@thoughtspot/visual-embed-sdk 1.51.2 → 1.52.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 (316) hide show
  1. package/cjs/package.json +9 -1
  2. package/cjs/src/api-intercept.d.ts.map +1 -1
  3. package/cjs/src/api-intercept.js +1 -0
  4. package/cjs/src/api-intercept.js.map +1 -1
  5. package/cjs/src/contracts/contracts.spec.d.ts +2 -0
  6. package/cjs/src/contracts/contracts.spec.d.ts.map +1 -0
  7. package/cjs/src/contracts/contracts.spec.js +345 -0
  8. package/cjs/src/contracts/contracts.spec.js.map +1 -0
  9. package/cjs/src/contracts/embed-event-payloads.d.ts +73 -0
  10. package/cjs/src/contracts/embed-event-payloads.d.ts.map +1 -0
  11. package/cjs/src/contracts/embed-event-payloads.js +3 -0
  12. package/cjs/src/contracts/embed-event-payloads.js.map +1 -0
  13. package/cjs/src/contracts/host-event-contracts.d.ts +378 -0
  14. package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -0
  15. package/cjs/src/contracts/host-event-contracts.js +3 -0
  16. package/cjs/src/contracts/host-event-contracts.js.map +1 -0
  17. package/cjs/src/contracts/index.d.ts +22 -0
  18. package/cjs/src/contracts/index.d.ts.map +1 -0
  19. package/cjs/src/contracts/index.js +33 -0
  20. package/cjs/src/contracts/index.js.map +1 -0
  21. package/cjs/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  22. package/cjs/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  23. package/cjs/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
  24. package/cjs/src/contracts/ui-passthrough-contracts.js.map +1 -0
  25. package/cjs/src/css-variables.d.ts +1 -1
  26. package/cjs/src/embed/app.d.ts +17 -140
  27. package/cjs/src/embed/app.d.ts.map +1 -1
  28. package/cjs/src/embed/app.js +20 -120
  29. package/cjs/src/embed/app.js.map +1 -1
  30. package/cjs/src/embed/app.spec.js +70 -26
  31. package/cjs/src/embed/app.spec.js.map +1 -1
  32. package/cjs/src/embed/conversation.d.ts +5 -5
  33. package/cjs/src/embed/events.spec.js +12 -2
  34. package/cjs/src/embed/events.spec.js.map +1 -1
  35. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -2
  36. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  37. package/cjs/src/embed/hostEventClient/host-event-client.js +23 -18
  38. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  39. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +36 -36
  40. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  41. package/cjs/src/embed/hostEventClient/utils.d.ts +1 -1
  42. package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
  43. package/cjs/src/embed/hostEventClient/utils.js +3 -3
  44. package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
  45. package/cjs/src/embed/liveboard.d.ts +9 -161
  46. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  47. package/cjs/src/embed/liveboard.js +68 -135
  48. package/cjs/src/embed/liveboard.js.map +1 -1
  49. package/cjs/src/embed/liveboard.spec.js +215 -32
  50. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  51. package/cjs/src/embed/search.d.ts +14 -0
  52. package/cjs/src/embed/search.d.ts.map +1 -1
  53. package/cjs/src/embed/search.js +4 -1
  54. package/cjs/src/embed/search.js.map +1 -1
  55. package/cjs/src/embed/search.spec.js +65 -0
  56. package/cjs/src/embed/search.spec.js.map +1 -1
  57. package/cjs/src/embed/ts-embed.d.ts +21 -25
  58. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  59. package/cjs/src/embed/ts-embed.js +105 -72
  60. package/cjs/src/embed/ts-embed.js.map +1 -1
  61. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  62. package/cjs/src/embed/ts-embed.spec.js +380 -33
  63. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  64. package/cjs/src/full-height.d.ts +137 -0
  65. package/cjs/src/full-height.d.ts.map +1 -0
  66. package/cjs/src/full-height.js +272 -0
  67. package/cjs/src/full-height.js.map +1 -0
  68. package/cjs/src/full-height.spec.d.ts +2 -0
  69. package/cjs/src/full-height.spec.d.ts.map +1 -0
  70. package/cjs/src/full-height.spec.js +835 -0
  71. package/cjs/src/full-height.spec.js.map +1 -0
  72. package/cjs/src/index.d.ts +4 -3
  73. package/cjs/src/index.d.ts.map +1 -1
  74. package/cjs/src/index.js +5 -4
  75. package/cjs/src/index.js.map +1 -1
  76. package/cjs/src/react/all-types-export.d.ts +1 -1
  77. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  78. package/cjs/src/react/all-types-export.js +2 -1
  79. package/cjs/src/react/all-types-export.js.map +1 -1
  80. package/cjs/src/react/all-types-export.parity.spec.js +55 -3
  81. package/cjs/src/react/all-types-export.parity.spec.js.map +1 -1
  82. package/cjs/src/react/index.d.ts +8 -8
  83. package/cjs/src/react/index.d.ts.map +1 -1
  84. package/cjs/src/react/index.js +1 -1
  85. package/cjs/src/react/index.js.map +1 -1
  86. package/cjs/src/react/index.spec.js +7 -7
  87. package/cjs/src/react/index.spec.js.map +1 -1
  88. package/cjs/src/types.d.ts +664 -39
  89. package/cjs/src/types.d.ts.map +1 -1
  90. package/cjs/src/types.js +406 -13
  91. package/cjs/src/types.js.map +1 -1
  92. package/cjs/src/utils/processTrigger.d.ts +3 -1
  93. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  94. package/cjs/src/utils/processTrigger.js +19 -51
  95. package/cjs/src/utils/processTrigger.js.map +1 -1
  96. package/cjs/src/utils/transport/iframe-transport.d.ts +55 -0
  97. package/cjs/src/utils/transport/iframe-transport.d.ts.map +1 -0
  98. package/cjs/src/utils/transport/iframe-transport.js +108 -0
  99. package/cjs/src/utils/transport/iframe-transport.js.map +1 -0
  100. package/cjs/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  101. package/cjs/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  102. package/cjs/src/utils/transport/iframe-transport.spec.js +140 -0
  103. package/cjs/src/utils/transport/iframe-transport.spec.js.map +1 -0
  104. package/cjs/src/utils.d.ts +18 -0
  105. package/cjs/src/utils.d.ts.map +1 -1
  106. package/cjs/src/utils.js +39 -1
  107. package/cjs/src/utils.js.map +1 -1
  108. package/cjs/src/utils.spec.js +62 -0
  109. package/cjs/src/utils.spec.js.map +1 -1
  110. package/dist/{index-D8_Zs-Nr.js → index-C1pmYb5H.js} +1 -1
  111. package/dist/src/api-intercept.d.ts.map +1 -1
  112. package/dist/src/contracts/contracts.spec.d.ts +2 -0
  113. package/dist/src/contracts/contracts.spec.d.ts.map +1 -0
  114. package/dist/src/contracts/embed-event-payloads.d.ts +73 -0
  115. package/dist/src/contracts/embed-event-payloads.d.ts.map +1 -0
  116. package/dist/src/contracts/host-event-contracts.d.ts +378 -0
  117. package/dist/src/contracts/host-event-contracts.d.ts.map +1 -0
  118. package/dist/src/contracts/index.d.ts +22 -0
  119. package/dist/src/contracts/index.d.ts.map +1 -0
  120. package/dist/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  121. package/dist/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  122. package/dist/src/css-variables.d.ts +1 -1
  123. package/dist/src/embed/app.d.ts +17 -140
  124. package/dist/src/embed/app.d.ts.map +1 -1
  125. package/dist/src/embed/conversation.d.ts +5 -5
  126. package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -2
  127. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  128. package/dist/src/embed/hostEventClient/utils.d.ts +1 -1
  129. package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
  130. package/dist/src/embed/liveboard.d.ts +9 -161
  131. package/dist/src/embed/liveboard.d.ts.map +1 -1
  132. package/dist/src/embed/search.d.ts +14 -0
  133. package/dist/src/embed/search.d.ts.map +1 -1
  134. package/dist/src/embed/ts-embed.d.ts +21 -25
  135. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  136. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  137. package/dist/src/full-height.d.ts +137 -0
  138. package/dist/src/full-height.d.ts.map +1 -0
  139. package/dist/src/full-height.spec.d.ts +2 -0
  140. package/dist/src/full-height.spec.d.ts.map +1 -0
  141. package/dist/src/index.d.ts +4 -3
  142. package/dist/src/index.d.ts.map +1 -1
  143. package/dist/src/react/all-types-export.d.ts +1 -1
  144. package/dist/src/react/all-types-export.d.ts.map +1 -1
  145. package/dist/src/react/index.d.ts +8 -8
  146. package/dist/src/react/index.d.ts.map +1 -1
  147. package/dist/src/types.d.ts +664 -39
  148. package/dist/src/types.d.ts.map +1 -1
  149. package/dist/src/utils/processTrigger.d.ts +3 -1
  150. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  151. package/dist/src/utils/transport/iframe-transport.d.ts +55 -0
  152. package/dist/src/utils/transport/iframe-transport.d.ts.map +1 -0
  153. package/dist/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  154. package/dist/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  155. package/dist/src/utils.d.ts +18 -0
  156. package/dist/src/utils.d.ts.map +1 -1
  157. package/dist/tsembed-react.es.js +1031 -392
  158. package/dist/tsembed-react.js +1030 -391
  159. package/dist/tsembed.es.js +1031 -392
  160. package/dist/tsembed.js +1029 -390
  161. package/dist/visual-embed-sdk-react-full.d.ts +1483 -693
  162. package/dist/visual-embed-sdk-react.d.ts +1364 -647
  163. package/dist/visual-embed-sdk.d.ts +1426 -659
  164. package/lib/package.json +9 -1
  165. package/lib/src/api-intercept.d.ts.map +1 -1
  166. package/lib/src/api-intercept.js +2 -1
  167. package/lib/src/api-intercept.js.map +1 -1
  168. package/lib/src/contracts/contracts.spec.d.ts +2 -0
  169. package/lib/src/contracts/contracts.spec.d.ts.map +1 -0
  170. package/lib/src/contracts/contracts.spec.js +342 -0
  171. package/lib/src/contracts/contracts.spec.js.map +1 -0
  172. package/lib/src/contracts/embed-event-payloads.d.ts +73 -0
  173. package/lib/src/contracts/embed-event-payloads.d.ts.map +1 -0
  174. package/lib/src/contracts/embed-event-payloads.js +2 -0
  175. package/lib/src/contracts/embed-event-payloads.js.map +1 -0
  176. package/lib/src/contracts/host-event-contracts.d.ts +378 -0
  177. package/lib/src/contracts/host-event-contracts.d.ts.map +1 -0
  178. package/lib/src/contracts/host-event-contracts.js +2 -0
  179. package/lib/src/contracts/host-event-contracts.js.map +1 -0
  180. package/lib/src/contracts/index.d.ts +22 -0
  181. package/lib/src/contracts/index.d.ts.map +1 -0
  182. package/lib/src/contracts/index.js +22 -0
  183. package/lib/src/contracts/index.js.map +1 -0
  184. package/lib/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  185. package/lib/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  186. package/lib/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
  187. package/lib/src/contracts/ui-passthrough-contracts.js.map +1 -0
  188. package/lib/src/css-variables.d.ts +1 -1
  189. package/lib/src/embed/app.d.ts +17 -140
  190. package/lib/src/embed/app.d.ts.map +1 -1
  191. package/lib/src/embed/app.js +22 -122
  192. package/lib/src/embed/app.js.map +1 -1
  193. package/lib/src/embed/app.spec.js +70 -26
  194. package/lib/src/embed/app.spec.js.map +1 -1
  195. package/lib/src/embed/conversation.d.ts +5 -5
  196. package/lib/src/embed/events.spec.js +12 -2
  197. package/lib/src/embed/events.spec.js.map +1 -1
  198. package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -2
  199. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  200. package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
  201. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  202. package/lib/src/embed/hostEventClient/host-event-client.spec.js +1 -1
  203. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  204. package/lib/src/embed/hostEventClient/utils.d.ts +1 -1
  205. package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
  206. package/lib/src/embed/hostEventClient/utils.js +1 -1
  207. package/lib/src/embed/hostEventClient/utils.js.map +1 -1
  208. package/lib/src/embed/liveboard.d.ts +9 -161
  209. package/lib/src/embed/liveboard.d.ts.map +1 -1
  210. package/lib/src/embed/liveboard.js +70 -137
  211. package/lib/src/embed/liveboard.js.map +1 -1
  212. package/lib/src/embed/liveboard.spec.js +215 -32
  213. package/lib/src/embed/liveboard.spec.js.map +1 -1
  214. package/lib/src/embed/search.d.ts +14 -0
  215. package/lib/src/embed/search.d.ts.map +1 -1
  216. package/lib/src/embed/search.js +4 -1
  217. package/lib/src/embed/search.js.map +1 -1
  218. package/lib/src/embed/search.spec.js +65 -0
  219. package/lib/src/embed/search.spec.js.map +1 -1
  220. package/lib/src/embed/ts-embed.d.ts +21 -25
  221. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  222. package/lib/src/embed/ts-embed.js +106 -73
  223. package/lib/src/embed/ts-embed.js.map +1 -1
  224. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  225. package/lib/src/embed/ts-embed.spec.js +378 -31
  226. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  227. package/lib/src/full-height.d.ts +137 -0
  228. package/lib/src/full-height.d.ts.map +1 -0
  229. package/lib/src/full-height.js +268 -0
  230. package/lib/src/full-height.js.map +1 -0
  231. package/lib/src/full-height.spec.d.ts +2 -0
  232. package/lib/src/full-height.spec.d.ts.map +1 -0
  233. package/lib/src/full-height.spec.js +833 -0
  234. package/lib/src/full-height.spec.js.map +1 -0
  235. package/lib/src/index.d.ts +4 -3
  236. package/lib/src/index.d.ts.map +1 -1
  237. package/lib/src/index.js +3 -3
  238. package/lib/src/index.js.map +1 -1
  239. package/lib/src/react/all-types-export.d.ts +1 -1
  240. package/lib/src/react/all-types-export.d.ts.map +1 -1
  241. package/lib/src/react/all-types-export.js +1 -1
  242. package/lib/src/react/all-types-export.js.map +1 -1
  243. package/lib/src/react/all-types-export.parity.spec.js +55 -3
  244. package/lib/src/react/all-types-export.parity.spec.js.map +1 -1
  245. package/lib/src/react/index.d.ts +8 -8
  246. package/lib/src/react/index.d.ts.map +1 -1
  247. package/lib/src/react/index.js +1 -1
  248. package/lib/src/react/index.js.map +1 -1
  249. package/lib/src/react/index.spec.js +7 -7
  250. package/lib/src/react/index.spec.js.map +1 -1
  251. package/lib/src/types.d.ts +664 -39
  252. package/lib/src/types.d.ts.map +1 -1
  253. package/lib/src/types.js +405 -12
  254. package/lib/src/types.js.map +1 -1
  255. package/lib/src/utils/processTrigger.d.ts +3 -1
  256. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  257. package/lib/src/utils/processTrigger.js +19 -51
  258. package/lib/src/utils/processTrigger.js.map +1 -1
  259. package/lib/src/utils/transport/iframe-transport.d.ts +55 -0
  260. package/lib/src/utils/transport/iframe-transport.d.ts.map +1 -0
  261. package/lib/src/utils/transport/iframe-transport.js +101 -0
  262. package/lib/src/utils/transport/iframe-transport.js.map +1 -0
  263. package/lib/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  264. package/lib/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  265. package/lib/src/utils/transport/iframe-transport.spec.js +138 -0
  266. package/lib/src/utils/transport/iframe-transport.spec.js.map +1 -0
  267. package/lib/src/utils.d.ts +18 -0
  268. package/lib/src/utils.d.ts.map +1 -1
  269. package/lib/src/utils.js +37 -0
  270. package/lib/src/utils.js.map +1 -1
  271. package/lib/src/utils.spec.js +63 -1
  272. package/lib/src/utils.spec.js.map +1 -1
  273. package/lib/src/visual-embed-sdk.d.ts +1426 -659
  274. package/package.json +9 -1
  275. package/src/api-intercept.ts +2 -1
  276. package/src/contracts/contracts.spec.ts +392 -0
  277. package/src/contracts/embed-event-payloads.ts +83 -0
  278. package/src/contracts/host-event-contracts.ts +456 -0
  279. package/src/contracts/index.ts +53 -0
  280. package/src/contracts/ui-passthrough-contracts.ts +301 -0
  281. package/src/css-variables.ts +1 -1
  282. package/src/embed/app.spec.ts +86 -34
  283. package/src/embed/app.ts +37 -264
  284. package/src/embed/conversation.ts +5 -5
  285. package/src/embed/events.spec.ts +14 -2
  286. package/src/embed/hostEventClient/host-event-client.spec.ts +2 -2
  287. package/src/embed/hostEventClient/host-event-client.ts +18 -5
  288. package/src/embed/hostEventClient/utils.ts +2 -1
  289. package/src/embed/liveboard.spec.ts +261 -42
  290. package/src/embed/liveboard.ts +78 -297
  291. package/src/embed/search.spec.ts +80 -0
  292. package/src/embed/search.ts +20 -0
  293. package/src/embed/ts-embed.spec.ts +518 -31
  294. package/src/embed/ts-embed.ts +133 -82
  295. package/src/full-height.spec.ts +1008 -0
  296. package/src/full-height.ts +361 -0
  297. package/src/index.ts +95 -5
  298. package/src/react/all-types-export.parity.spec.ts +63 -3
  299. package/src/react/all-types-export.ts +46 -0
  300. package/src/react/index.spec.tsx +7 -7
  301. package/src/react/index.tsx +9 -9
  302. package/src/types.ts +665 -37
  303. package/src/utils/processTrigger.ts +28 -58
  304. package/src/utils/transport/iframe-transport.spec.ts +177 -0
  305. package/src/utils/transport/iframe-transport.ts +122 -0
  306. package/src/utils.spec.ts +71 -0
  307. package/src/utils.ts +38 -0
  308. package/cjs/src/embed/hostEventClient/contracts.d.ts +0 -231
  309. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  310. package/cjs/src/embed/hostEventClient/contracts.js.map +0 -1
  311. package/dist/src/embed/hostEventClient/contracts.d.ts +0 -231
  312. package/dist/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  313. package/lib/src/embed/hostEventClient/contracts.d.ts +0 -231
  314. package/lib/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  315. package/lib/src/embed/hostEventClient/contracts.js.map +0 -1
  316. package/src/embed/hostEventClient/contracts.ts +0 -262
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.51.2 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.52.1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -864,6 +864,9 @@
864
864
  EmbedEvent["Download"] = "download";
865
865
  /**
866
866
  * Emitted when the download action is triggered on an Answer.
867
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer,
868
+ * Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
869
+ * accepts the union now; per-context enforced next release.
867
870
  * Use start:true to subscribe to when download is initiated, or end:true to
868
871
  * subscribe to when download is completed. Default is end:true.
869
872
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
@@ -880,6 +883,9 @@
880
883
  EmbedEvent["DownloadAsPng"] = "downloadAsPng";
881
884
  /**
882
885
  * Emitted when the Download as PDF action is triggered on an Answer
886
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer; plus
887
+ * liveboardId on Liveboard), {@link RequiredVizRequest} (Spotter). trigger()
888
+ * accepts the union now; per-context enforced next release.
883
889
  * Use start:true to subscribe to when download as PDF is initiated, or end:true to
884
890
  * subscribe to when download as PDF is completed. Default is end:true.
885
891
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
@@ -896,6 +902,9 @@
896
902
  EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
897
903
  /**
898
904
  * Emitted when the Download as CSV action is triggered on an Answer.
905
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer,
906
+ * Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
907
+ * accepts the union now; per-context enforced next release.
899
908
  * Use start:true to subscribe to when download as CSV is initiated, or end:true to
900
909
  * subscribe to when download as CSV is completed. Default is end:true.
901
910
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
@@ -912,6 +921,9 @@
912
921
  EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
913
922
  /**
914
923
  * Emitted when the Download as XLSX action is triggered on an Answer.
924
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer,
925
+ * Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
926
+ * accepts the union now; per-context enforced next release.
915
927
  * Use start:true to subscribe to when download as XLSX is initiated, or end:true to
916
928
  * subscribe to when download as XLSX is completed. Default is end:true.
917
929
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
@@ -1190,6 +1202,9 @@
1190
1202
  EmbedEvent["Schedule"] = "subscription";
1191
1203
  /**
1192
1204
  * Emitted when a user clicks **Edit** on a Liveboard or visualization
1205
+ * Payload varies by context: {@link VizScopedRequest} (Liveboard),
1206
+ * {@link RequiredVizRequest} (Spotter, vizId required). trigger() accepts the
1207
+ * union now; per-context enforced next release.
1193
1208
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1194
1209
  * @example
1195
1210
  * ```js
@@ -1731,7 +1746,32 @@
1731
1746
  */
1732
1747
  EmbedEvent["OrgSwitched"] = "orgSwitched";
1733
1748
  /**
1734
- * Emitted when the user intercepts a URL.
1749
+ * Emitted before the embedded ThoughtSpot app sends a network request whose
1750
+ * fully resolved URL matches one of the `interceptUrls` in the view config.
1751
+ * The request is held until you call `responder`, which decides whether the
1752
+ * real request goes out or a response you supply is used in its place.
1753
+ *
1754
+ * Setting `interceptUrls` is what enables this; there is no separate enable
1755
+ * flag. If `responder` is not called within `interceptTimeout` (30000 ms by
1756
+ * default) the request fails and `EmbedEvent.Error` is emitted.
1757
+ *
1758
+ * The payload is `{ input, init, urlType }`, where `input` is the request
1759
+ * URL and `init` is the `fetch` init object, with `init.body` parsed into an
1760
+ * object when it is valid JSON. `urlType` is the matching
1761
+ * `InterceptedApiType`; it is `InterceptedApiType.ALL` for any URL outside
1762
+ * the recognized API groups.
1763
+ *
1764
+ * Interception wraps the outermost layer of `fetch`, so `init` holds the
1765
+ * request as the application composed it, before ThoughtSpot attaches its
1766
+ * authentication headers. Those headers, and any token refresh and retry,
1767
+ * are applied afterwards and only when you pass `execute: true`. Only
1768
+ * requests made through `fetch` are intercepted.
1769
+ *
1770
+ * Pass `execute: true` to let the original request proceed untouched, in
1771
+ * which case any `response` you supply alongside it is ignored. With
1772
+ * `execute: false` the request is never sent, and your `response.body` is
1773
+ * returned to the app as JSON, defaulting to status 200 and a
1774
+ * `Content-Type: application/json` header.
1735
1775
  *
1736
1776
  * Supported on all embed types.
1737
1777
  *
@@ -2244,6 +2284,7 @@
2244
2284
  * the search query string.
2245
2285
  * Supported in `AppEmbed` and `SearchEmbed` deployments.
2246
2286
  * Includes the following properties:
2287
+ * Payload: {@link SearchRequest}.
2247
2288
  * @param - Includes the following keys:
2248
2289
  * - `searchQuery`: Query string with search tokens.
2249
2290
  * - `dataSources`: Data source GUID to search on.
@@ -2271,6 +2312,9 @@
2271
2312
  HostEvent["Search"] = "search";
2272
2313
  /**
2273
2314
  * Triggers a drill on certain points of the specified column
2315
+ * Payload: {@link DrillDownRequest}; in Liveboard context vizId is required
2316
+ * ({@link RequiredVizRequest}). trigger() accepts the union now; per-context
2317
+ * enforced next release.
2274
2318
  * Includes the following properties:
2275
2319
  * @param - Includes the following keys:
2276
2320
  * - `points`: An object containing `selectedPoints` and/or `clickedPoint`
@@ -2350,6 +2394,8 @@
2350
2394
  HostEvent["Reload"] = "reload";
2351
2395
  /**
2352
2396
  * Get iframe URL for the current embed view.
2397
+ * Payload: none.
2398
+ * Response: {@link GetIframeUrlResponse}.
2353
2399
  * @example
2354
2400
  * ```js
2355
2401
  * const url = embed.trigger(HostEvent.GetIframeUrl);
@@ -2368,6 +2414,7 @@
2368
2414
  HostEvent["GetIframeUrl"] = "GetIframeUrl";
2369
2415
  /**
2370
2416
  * Display specific visualizations on a Liveboard.
2417
+ * Payload: `string[]`.
2371
2418
  * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
2372
2419
  * in this parameter will be hidden.
2373
2420
  * @example
@@ -2390,6 +2437,7 @@
2390
2437
  HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
2391
2438
  /**
2392
2439
  * Set a Liveboard tab as an active tab.
2440
+ * Payload: {@link SetActiveTabRequest}.
2393
2441
  * @param - tabId - string of id of Tab to show
2394
2442
  * @example
2395
2443
  * ```js
@@ -2417,6 +2465,7 @@
2417
2465
  * and `AppEmbed` only. In full application embedding, this event updates
2418
2466
  * the runtime filters applied on the Liveboard and saved Answer objects.
2419
2467
  *
2468
+ * Payload: {@link RuntimeFilter}[].
2420
2469
  * @param - Array of {@link RuntimeFilter} objects. Each item includes:
2421
2470
  * - `columnName`: Name of the column to filter on.
2422
2471
  * - `operator`: {@link RuntimeFilterOp} to apply. For more information, see
@@ -2458,6 +2507,7 @@
2458
2507
  * Accepts either a plain value or an object with `path`
2459
2508
  * and an optional `replace` flag.
2460
2509
  *
2510
+ * Payload: `string` | `number` | {@link NavigateRequest}.
2461
2511
  * @param data - A string path, a numeric history delta, or an object
2462
2512
  * `{ path: string | number, replace?: boolean }`.
2463
2513
  * - `path` — the route to navigate to, or a history delta such as `1`
@@ -2485,6 +2535,9 @@
2485
2535
  /**
2486
2536
  * Open the filter panel for a particular column.
2487
2537
  * Works with Search and Liveboard embed.
2538
+ * Payload: {@link OpenFilterRequest} (the cross-context superset). The
2539
+ * accepted fields vary by context: {@link OpenFilterLiveboardRequest},
2540
+ * {@link OpenFilterSpotterRequest}, {@link OpenFilterSearchRequest}.
2488
2541
  * @param - { columnId: string,
2489
2542
  * name: string,
2490
2543
  * type: ATTRIBUTE/MEASURE,
@@ -2541,7 +2594,7 @@
2541
2594
  *
2542
2595
  * Unlike {@link HostEvent.OpenFilter}, which opens the panel of an
2543
2596
  * existing filter, this event starts the creation of a new filter.
2544
- * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
2597
+ * @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
2545
2598
  * @example
2546
2599
  * ```js
2547
2600
  * liveboardEmbed.trigger(HostEvent.OpenAddFilterModal);
@@ -2557,7 +2610,7 @@
2557
2610
  * Hiding the *Add parameter* button with `hiddenActions:
2558
2611
  * [Action.AddParameter]` does not block this event, but disabling it
2559
2612
  * with `disabledActions` does.
2560
- * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
2613
+ * @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
2561
2614
  * @example
2562
2615
  * ```js
2563
2616
  * liveboardEmbed.trigger(HostEvent.OpenAddParameterModal);
@@ -2567,6 +2620,7 @@
2567
2620
  /**
2568
2621
  * Open the parameter panel for a particular parameter on a Liveboard.
2569
2622
  * Mirrors {@link HostEvent.OpenFilter} for parameters.
2623
+ * Payload: {@link OpenParameterRequest}.
2570
2624
  * @param - Includes the following keys:
2571
2625
  * - `parameter`: An object identifying the parameter to open, for
2572
2626
  * example, `{ parameterId: '<parameter-GUID>' }`.
@@ -2598,6 +2652,7 @@
2598
2652
  HostEvent["OpenParameter"] = "openParameter";
2599
2653
  /**
2600
2654
  * Add columns to the current search query.
2655
+ * Payload: `{ columnIds: string[] }`.
2601
2656
  * @param - { columnIds: string[] }
2602
2657
  * @example
2603
2658
  * ```js
@@ -2616,6 +2671,7 @@
2616
2671
  HostEvent["AddColumns"] = "addColumns";
2617
2672
  /**
2618
2673
  * Remove a column from the current search query.
2674
+ * Payload: `{ columnId: string }`.
2619
2675
  * @param - { columnId: string }
2620
2676
  * @example
2621
2677
  * ```js
@@ -2640,6 +2696,8 @@
2640
2696
  * sorting, toggling of legends, and data drill down.
2641
2697
  * For more information, see
2642
2698
  * link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
2699
+ * Payload: none.
2700
+ * Response: {@link GetExportRequestForCurrentPinboardResponse}.
2643
2701
  * @example
2644
2702
  * ```js
2645
2703
  * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
@@ -2661,6 +2719,8 @@
2661
2719
  * requiring additional user input via the *Pin to Liveboard* modal, define
2662
2720
  * the following parameters:
2663
2721
  *
2722
+ * Payload: {@link PinAnswerToLiveboardRequest}.
2723
+ * Response: {@link PinAnswerToLiveboardResponse}.
2664
2724
  * @param - Includes the following keys:
2665
2725
  * - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
2666
2726
  * Liveboard.
@@ -2775,6 +2835,7 @@
2775
2835
  HostEvent["LiveboardInfo"] = "pinboardInfo";
2776
2836
  /**
2777
2837
  * Trigger the **Schedule** action on an embedded Liveboard.
2838
+ * Payload: {@link VizScopedRequest}.
2778
2839
  * @example
2779
2840
  * ```js
2780
2841
  * liveboardEmbed.trigger(HostEvent.Schedule)
@@ -2790,6 +2851,7 @@
2790
2851
  HostEvent["Schedule"] = "subscription";
2791
2852
  /**
2792
2853
  * Trigger the **Manage schedule** action on an embedded Liveboard
2854
+ * Payload: {@link VizScopedRequest}.
2793
2855
  * @example
2794
2856
  * ```js
2795
2857
  * liveboardEmbed.trigger(HostEvent.SchedulesList)
@@ -2806,6 +2868,7 @@
2806
2868
  /**
2807
2869
  * Trigger the **Export TML** action on an embedded Liveboard or
2808
2870
  * Answer.
2871
+ * Payload: {@link VizScopedRequest}.
2809
2872
  * @example
2810
2873
  * ```js
2811
2874
  * liveboardEmbed.trigger(HostEvent.ExportTML)
@@ -2828,6 +2891,7 @@
2828
2891
  /**
2829
2892
  * Trigger the **Edit TML** action on an embedded Liveboard or
2830
2893
  * saved Answers in the full application embedding.
2894
+ * Payload: {@link VizScopedRequest}.
2831
2895
  * @example
2832
2896
  * ```js
2833
2897
  * liveboardEmbed.trigger(HostEvent.EditTML)
@@ -2849,6 +2913,7 @@
2849
2913
  HostEvent["EditTML"] = "editTSL";
2850
2914
  /**
2851
2915
  * Trigger the **Update TML** action on an embedded Liveboard.
2916
+ * Payload: {@link VizScopedRequest}.
2852
2917
  * @example
2853
2918
  * ```js
2854
2919
  * liveboardEmbed.trigger(HostEvent.UpdateTML)
@@ -2866,6 +2931,7 @@
2866
2931
  * Trigger the **Download PDF** action on an embedded Liveboard,
2867
2932
  * visualization or Answer.
2868
2933
  *
2934
+ * Payload: {@link VizScopedRequest} plus optional `liveboardId`.
2869
2935
  * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2870
2936
  *
2871
2937
  * **NOTE**: The **Download** > **PDF** action is available on
@@ -2916,6 +2982,7 @@
2916
2982
  /**
2917
2983
  * Trigger the **AI Highlights** action on an embedded Liveboard
2918
2984
  *
2985
+ * Payload: none.
2919
2986
  * @example
2920
2987
  * ```js
2921
2988
  * liveboardEmbed.trigger(HostEvent.AIHighlights)
@@ -2970,6 +3037,9 @@
2970
3037
  HostEvent["MakeACopy"] = "makeACopy";
2971
3038
  /**
2972
3039
  * Trigger the **Delete** action for a Liveboard.
3040
+ * Payload varies by context: {@link RequiredVizRequest} (Liveboard, vizId
3041
+ * required), {@link VizScopedRequest} (Search). trigger() accepts the union
3042
+ * now; per-context enforced next release.
2973
3043
  * @example
2974
3044
  * ```js
2975
3045
  * appEmbed.trigger(HostEvent.Remove)
@@ -2984,6 +3054,7 @@
2984
3054
  HostEvent["Remove"] = "delete";
2985
3055
  /**
2986
3056
  * Trigger the **Explore** action on a visualization.
3057
+ * Payload: {@link RequiredVizRequest}.
2987
3058
  * @param - an object with `vizId` as a key
2988
3059
  * @example
2989
3060
  * ```js
@@ -3003,6 +3074,7 @@
3003
3074
  /**
3004
3075
  * Trigger the **Create alert** action on a KPI chart
3005
3076
  * in a Liveboard or saved Answer.
3077
+ * Payload: {@link VizScopedRequest}.
3006
3078
  * @param - an object with `vizId` as a key
3007
3079
  * @example
3008
3080
  * ```js
@@ -3034,6 +3106,7 @@
3034
3106
  /**
3035
3107
  * Trigger the **Manage alerts** action on a KPI chart
3036
3108
  * in a visualization or saved Answer.
3109
+ * Payload: {@link VizScopedRequest}.
3037
3110
  * @param - an object with `vizId` as a key
3038
3111
  * @example
3039
3112
  * ```js
@@ -3071,6 +3144,7 @@
3071
3144
  * on a Liveboard.
3072
3145
  *
3073
3146
  * This event is not supported in visualization embed and search embed.
3147
+ * Payload: {@link VizScopedRequest}.
3074
3148
  * @param - Object parameter. Includes the following keys:
3075
3149
  * - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
3076
3150
  * pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
@@ -3113,6 +3187,7 @@
3113
3187
  HostEvent["Edit"] = "edit";
3114
3188
  /**
3115
3189
  * Trigger the **Copy link** action on a Liveboard or visualization
3190
+ * Payload: {@link VizScopedRequest}.
3116
3191
  * @param - object - to trigger the action for a
3117
3192
  * specific visualization in Liveboard embed, pass in `vizId` as a key
3118
3193
  * @example
@@ -3158,6 +3233,7 @@
3158
3233
  HostEvent["CopyLink"] = "embedDocument";
3159
3234
  /**
3160
3235
  * Trigger the **Present** action on a Liveboard or visualization
3236
+ * Payload: {@link VizScopedRequest}.
3161
3237
  * @param - object - to trigger the action for a specific visualization
3162
3238
  * in Liveboard embed, pass in `vizId` as a key
3163
3239
  * @example
@@ -3203,6 +3279,8 @@
3203
3279
  HostEvent["Present"] = "present";
3204
3280
  /**
3205
3281
  * Get TML for the current search.
3282
+ * Payload: {@link GetTMLRequest}.
3283
+ * Response: `Record<string, any>`.
3206
3284
  * @example
3207
3285
  * ```js
3208
3286
  * searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
@@ -3252,6 +3330,7 @@
3252
3330
  * Trigger the **Show underlying data** action on a
3253
3331
  * chart or table.
3254
3332
  *
3333
+ * Payload: {@link VizScopedRequest}.
3255
3334
  * @param - an object with vizId as a key
3256
3335
  * @example
3257
3336
  * ```js
@@ -3285,6 +3364,7 @@
3285
3364
  * Trigger the **Delete** action for a visualization
3286
3365
  * in an embedded Liveboard, or a chart or table
3287
3366
  * generated from Search.
3367
+ * Payload: {@link VizScopedRequest}.
3288
3368
  * @param - Liveboard embed takes an object with `vizId` as a key.
3289
3369
  * Can be left empty if embedding Search or visualization.
3290
3370
  * @example
@@ -3313,6 +3393,7 @@
3313
3393
  /**
3314
3394
  * Trigger the **SpotIQ analyze** action on a
3315
3395
  * chart or table.
3396
+ * Payload: {@link VizScopedRequest}.
3316
3397
  * @param - Liveboard embed takes `vizId` as a
3317
3398
  * key. Can be left undefined when embedding Search or
3318
3399
  * visualization.
@@ -3375,6 +3456,7 @@
3375
3456
  /**
3376
3457
  * Trigger the **Download** > **PNG** action on
3377
3458
  * charts in the embedded view.
3459
+ * Payload: {@link VizScopedRequest}.
3378
3460
  * @example
3379
3461
  * ```js
3380
3462
  * liveboardEmbed.trigger(HostEvent.DownloadAsPng,
@@ -3406,6 +3488,7 @@
3406
3488
  /**
3407
3489
  * Trigger the **Download** > **CSV** action on tables in
3408
3490
  * the embedded view.
3491
+ * Payload: {@link VizScopedRequest}.
3409
3492
  * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
3410
3493
  * @example
3411
3494
  * ```js
@@ -3445,6 +3528,7 @@
3445
3528
  /**
3446
3529
  * Trigger the **Download** > **XLSX** action on tables
3447
3530
  * in the embedded view.
3531
+ * Payload: {@link VizScopedRequest}.
3448
3532
  * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
3449
3533
  * @example
3450
3534
  * ```js
@@ -3484,6 +3568,7 @@
3484
3568
  /**
3485
3569
  * Trigger the **Share** action on an embedded
3486
3570
  * Liveboard or Answer.
3571
+ * Payload: {@link VizScopedRequest}.
3487
3572
  * @example
3488
3573
  * ```js
3489
3574
  * liveboardEmbed.trigger(HostEvent.Share)
@@ -3510,6 +3595,7 @@
3510
3595
  * Trigger the **Save** action on a Liveboard, Answer, or Spotter.
3511
3596
  * Saves the changes.
3512
3597
  *
3598
+ * Payload: {@link VizScopedRequest}.
3513
3599
  * @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
3514
3600
  * It is required and can be retrieved from the data embed event.
3515
3601
  *
@@ -3561,6 +3647,7 @@
3561
3647
  /**
3562
3648
  * Trigger the **Sync to Sheets** action on an embedded visualization or Answer
3563
3649
  * Sends data from an Answer or Liveboard visualization to a Google sheet.
3650
+ * Payload: {@link VizScopedRequest}.
3564
3651
  * @param - an object with `vizId` as a key
3565
3652
  * @example
3566
3653
  * ```js
@@ -3591,6 +3678,7 @@
3591
3678
  * Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
3592
3679
  * Sends data from an Answer or Liveboard visualization to third-party apps such
3593
3680
  * as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
3681
+ * Payload: {@link VizScopedRequest}.
3594
3682
  * @param - an object with vizId as a key
3595
3683
  * @example
3596
3684
  * ```js
@@ -3621,6 +3709,7 @@
3621
3709
  * Trigger the **Manage pipelines** action on an embedded
3622
3710
  * visualization or Answer.
3623
3711
  * Allows users to manage ThoughtSpot Sync pipelines.
3712
+ * Payload: {@link VizScopedRequest}.
3624
3713
  * @param - an object with `vizId` as a key
3625
3714
  * @example
3626
3715
  * ```js
@@ -3649,6 +3738,7 @@
3649
3738
  HostEvent["ManagePipelines"] = "manage-pipeline";
3650
3739
  /**
3651
3740
  * Reset search operation on the Search or Answer page.
3741
+ * Payload: none.
3652
3742
  * @example
3653
3743
  * ```js
3654
3744
  * searchEmbed.trigger(HostEvent.ResetSearch)
@@ -3676,6 +3766,8 @@
3676
3766
  * whole Liveboard.
3677
3767
  * The `applicability` attribute is available from SDK: 1.53.0 |
3678
3768
  * ThoughtSpot: 26.10.0.cl.
3769
+ * Payload: {@link GetFiltersRequest}.
3770
+ * Response: {@link GetFiltersResponse}.
3679
3771
  * @example
3680
3772
  * ```js
3681
3773
  * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
@@ -3695,6 +3787,7 @@
3695
3787
  HostEvent["GetFilters"] = "getFilters";
3696
3788
  /**
3697
3789
  * Update one or several filters applied on a Liveboard.
3790
+ * Payload: {@link UpdateFiltersRequest}.
3698
3791
  * @param - Includes the following keys:
3699
3792
  * - `filter`: A single filter object containing column name, filter operator, and
3700
3793
  * values.
@@ -3823,6 +3916,8 @@
3823
3916
  HostEvent["UpdateFilters"] = "updateFilters";
3824
3917
  /**
3825
3918
  * Get tab details for the current Liveboard.
3919
+ * Payload: none.
3920
+ * Response: {@link GetTabsResponse}.
3826
3921
  * @example
3827
3922
  * ```js
3828
3923
  * liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
@@ -3848,6 +3943,8 @@
3848
3943
  /**
3849
3944
  * Get group details for the current Liveboard.
3850
3945
  * Mirrors {@link HostEvent.GetTabs} for filter/parameter groups.
3946
+ * Payload: none.
3947
+ * Response: {@link GetGroupsResponse}.
3851
3948
  * @example
3852
3949
  * ```js
3853
3950
  * liveboardEmbed.trigger(HostEvent.GetGroups).then((groupDetails) => {
@@ -3872,6 +3969,7 @@
3872
3969
  HostEvent["GetGroups"] = "getGroups";
3873
3970
  /**
3874
3971
  * Set the visible tabs on a Liveboard.
3972
+ * Payload: `string[]`.
3875
3973
  * @param - an array of ids of tabs to show, the IDs not passed
3876
3974
  * will be hidden.
3877
3975
  * @example
@@ -3894,6 +3992,7 @@
3894
3992
  HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
3895
3993
  /**
3896
3994
  * Set the hidden tabs on a Liveboard.
3995
+ * Payload: `string[]`.
3897
3996
  * @param - an array of the IDs of the tabs to hide.
3898
3997
  * The IDs not passed will be shown.
3899
3998
  * @example
@@ -3922,6 +4021,8 @@
3922
4021
  * `getAnswerService()` method on the embed instance to get an AnswerService
3923
4022
  * object that provides a more convenient interface for working with answers.
3924
4023
  *
4024
+ * Payload: {@link GetAnswerSessionRequest}.
4025
+ * Response: {@link GetAnswerSessionResponse}.
3925
4026
  * @example
3926
4027
  * ```js
3927
4028
  * // Preferred way to get an AnswerService
@@ -3949,6 +4050,7 @@
3949
4050
  HostEvent["GetAnswerSession"] = "getAnswerSession";
3950
4051
  /**
3951
4052
  * Trigger the *Ask Sage* action for visualizations
4053
+ * Payload: {@link RequiredVizRequest}.
3952
4054
  * @example
3953
4055
  * ```js
3954
4056
  * liveboardEmbed.trigger(HostEvent.AskSage,
@@ -3960,6 +4062,7 @@
3960
4062
  /**
3961
4063
  * Trigger cross filter update action on a Liveboard.
3962
4064
  *
4065
+ * Payload: {@link UpdateCrossFilterRequest}.
3963
4066
  * @example
3964
4067
  * ```js
3965
4068
  * liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
@@ -3975,7 +4078,9 @@
3975
4078
  HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
3976
4079
  /**
3977
4080
  * Trigger reset action for a personalized Liveboard view.
3978
- * This event is deprecated. Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
4081
+ * This event is deprecated.
4082
+ * Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
4083
+ * Payload: none.
3979
4084
  * @example
3980
4085
  * ```js
3981
4086
  * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
@@ -3996,6 +4101,7 @@
3996
4101
  /**
3997
4102
  * Triggers an action to update Parameter values on embedded
3998
4103
  * Answers, Liveboard, and Spotter answer in Edit mode.
4104
+ * Payload: {@link RuntimeParameter}[].
3999
4105
  * @param - Includes the following keys for each item:
4000
4106
  * - `name`: Name of the parameter.
4001
4107
  * - `value`: The value to set for the parameter.
@@ -4053,6 +4159,8 @@
4053
4159
  * whole Liveboard.
4054
4160
  * The `applicability` attribute is available from SDK: 1.53.0 |
4055
4161
  * ThoughtSpot: 26.10.0.cl.
4162
+ * Payload: none.
4163
+ * Response: {@link GetParametersResponse}.
4056
4164
  * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4057
4165
  * ```js
4058
4166
  * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
@@ -4090,6 +4198,7 @@
4090
4198
  * ```js
4091
4199
  * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
4092
4200
  * ```
4201
+ * Payload: {@link PersonalisedViewRequest} (`viewId` only).
4093
4202
  * @example
4094
4203
  * ```js
4095
4204
  * // Update personalized view from liveboard context
@@ -4122,6 +4231,7 @@
4122
4231
  * If neither is provided, the Liveboard resets to the original/default view.
4123
4232
  * When a `viewName` is provided and multiple views share
4124
4233
  * the same name, the first match is selected.
4234
+ * Payload: {@link PersonalisedViewRequest}.
4125
4235
  * @example
4126
4236
  * ```js
4127
4237
  * liveboardEmbed.trigger(
@@ -4165,6 +4275,8 @@
4165
4275
  * If no parameters are specified, the save action is
4166
4276
  * triggered with a modal to prompt users to
4167
4277
  * add a name and description for the Answer.
4278
+ * Payload: {@link SaveAnswerRequest}.
4279
+ * Response: {@link SaveAnswerResponse}.
4168
4280
  * @param - Includes the following keys:
4169
4281
  * - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
4170
4282
  * embed.
@@ -4250,6 +4362,7 @@
4250
4362
  /**
4251
4363
  * Triggers a search operation with the search tokens specified in
4252
4364
  * the search query string in spotter embed.
4365
+ * Payload: {@link SpotterSearchRequest}.
4253
4366
  * @param - Includes the following keys:
4254
4367
  * - `query`: Text string in Natural Language format.
4255
4368
  * - `executeSearch`: Boolean to execute search and update search query.
@@ -4274,6 +4387,7 @@
4274
4387
  HostEvent["SpotterSearch"] = "SpotterSearch";
4275
4388
  /**
4276
4389
  * Edits the last prompt in spotter embed.
4390
+ * Payload: `string`.
4277
4391
  * @param - `query`: Text string
4278
4392
  * @example
4279
4393
  * ```js
@@ -4290,6 +4404,7 @@
4290
4404
  HostEvent["EditLastPrompt"] = "EditLastPrompt";
4291
4405
  /**
4292
4406
  * Opens the data source preview modal in Spotter Embed.
4407
+ * Payload: none.
4293
4408
  * @example
4294
4409
  * ```js
4295
4410
  * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
@@ -4325,6 +4440,7 @@
4325
4440
  HostEvent["DataModelInstructions"] = "DataModelInstructions";
4326
4441
  /**
4327
4442
  * Resets the Spotter Embed Conversation.
4443
+ * Payload: none.
4328
4444
  * @example
4329
4445
  * ```js
4330
4446
  * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
@@ -4337,6 +4453,7 @@
4337
4453
  * `conversationId` is **mandatory** — you must pass the id of the
4338
4454
  * conversation to share. Also no-op when sharing is disabled
4339
4455
  * (enableShareConversation off) or when already in the read-only shared view.
4456
+ * Payload: {@link ConversationScopedRequest}.
4340
4457
  * @example
4341
4458
  * ```js
4342
4459
  * spotterEmbed.trigger(HostEvent.ShareSpotterConversation, { conversationId: 'abc' });
@@ -4346,6 +4463,7 @@
4346
4463
  HostEvent["ShareSpotterConversation"] = "ShareSpotterConversation";
4347
4464
  /**
4348
4465
  * Closes the Spotter share-conversation modal. No-op if none is open.
4466
+ * Payload: none.
4349
4467
  * @example
4350
4468
  * ```js
4351
4469
  * spotterEmbed.trigger(HostEvent.CloseSpotterShareConversation);
@@ -4355,6 +4473,7 @@
4355
4473
  HostEvent["CloseSpotterShareConversation"] = "CloseSpotterShareConversation";
4356
4474
  /**
4357
4475
  * Exits the read-only shared-conversation view.
4476
+ * Payload: none.
4358
4477
  * @example
4359
4478
  * ```js
4360
4479
  * spotterEmbed.trigger(HostEvent.ExitSpotterSharedConversation);
@@ -4364,6 +4483,7 @@
4364
4483
  HostEvent["ExitSpotterSharedConversation"] = "ExitSpotterSharedConversation";
4365
4484
  /**
4366
4485
  * Deletes the last prompt in spotter embed.
4486
+ * Payload: none.
4367
4487
  * @example
4368
4488
  * ```js
4369
4489
  * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
@@ -4373,6 +4493,7 @@
4373
4493
  HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
4374
4494
  /**
4375
4495
  * Toggle the visualization to chart or table view.
4496
+ * Payload: {@link RequiredVizRequest}.
4376
4497
  * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
4377
4498
  * @example
4378
4499
  * ```js
@@ -4411,6 +4532,7 @@
4411
4532
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
4412
4533
  /**
4413
4534
  * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
4535
+ * Payload: {@link RequiredVizRequest}.
4414
4536
  * @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
4415
4537
  * @example
4416
4538
  * ```js
@@ -4435,7 +4557,13 @@
4435
4557
  */
4436
4558
  HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
4437
4559
  /**
4438
- * Triggered when the embed needs to be destroyed. This is used to clean up any embed-related resources internally.
4560
+ * Notifies the embedded ThoughtSpot app that the embed is being torn down, so that
4561
+ * it can release any resources it holds before the iframe is removed from the DOM.
4562
+ *
4563
+ * This is triggered for you by `embed.destroy()`; you rarely need to trigger it
4564
+ * directly. If `waitForCleanupOnDestroy` is set in the embed config, `destroy()`
4565
+ * waits for the app to acknowledge this event (up to `cleanupTimeout`) before
4566
+ * removing the iframe.
4439
4567
  * @example
4440
4568
  * ```js
4441
4569
  * liveboardEmbed.trigger(HostEvent.DestroyEmbed);
@@ -4466,6 +4594,7 @@
4466
4594
  * instance. Contact your admin or ThoughtSpot Support to enable chat history on your
4467
4595
  * instance.
4468
4596
  *
4597
+ * Payload: {@link ConversationScopedRequest}.
4469
4598
  * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
4470
4599
  * @example
4471
4600
  * ```js
@@ -4483,6 +4612,7 @@
4483
4612
  * instance. Contact your admin or ThoughtSpot Support to enable chat history on your
4484
4613
  * instance.
4485
4614
  *
4615
+ * Payload: {@link ConversationScopedRequest}.
4486
4616
  * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
4487
4617
  * @example
4488
4618
  * ```js
@@ -4507,6 +4637,7 @@
4507
4637
  * Trigger the **Send Test Email** action in the Liveboard schedule modal.
4508
4638
  * Sends a test schedule email to self or all recipients.
4509
4639
  * Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
4640
+ * Payload: {@link ScheduleEmailRequest}.
4510
4641
  * @example
4511
4642
  * ```js
4512
4643
  * liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
@@ -4525,6 +4656,7 @@
4525
4656
  HostEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
4526
4657
  /**
4527
4658
  * Sends a user message (prompt) to the SpotterViz panel programmatically.
4659
+ * Payload: `{ query: string }`.
4528
4660
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4529
4661
  * @param query - the prompt text to send.
4530
4662
  * @example
@@ -4537,6 +4669,7 @@
4537
4669
  HostEvent["SpotterVizSendUserMessage"] = "SpotterVizSendUserMessage";
4538
4670
  /**
4539
4671
  * Initializes a new SpotterViz conversation.
4672
+ * Payload: none.
4540
4673
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4541
4674
  * @example
4542
4675
  * ```js
@@ -4546,6 +4679,7 @@
4546
4679
  HostEvent["InitSpotterVizConversation"] = "InitSpotterVizConversation";
4547
4680
  /**
4548
4681
  * Opens the SpotterViz panel.
4682
+ * Payload: none.
4549
4683
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4550
4684
  * @example
4551
4685
  * ```js
@@ -4555,6 +4689,7 @@
4555
4689
  HostEvent["OpenSpotterVizPanel"] = "OpenSpotterVizPanel";
4556
4690
  /**
4557
4691
  * Closes the SpotterViz panel.
4692
+ * Payload: none.
4558
4693
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4559
4694
  * @example
4560
4695
  * ```js
@@ -4565,6 +4700,7 @@
4565
4700
  /**
4566
4701
  * Clears browser cache and fetches new data for liveboard ChartViz Containers.
4567
4702
  * Requires `enableLiveboardDataCache` to be enabled.
4703
+ * Payload: {@link ScheduleEmailRequest}.
4568
4704
  * @example
4569
4705
  * ```js
4570
4706
  * liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
@@ -4762,6 +4898,7 @@
4762
4898
  Param["SpotterDataSources"] = "spotterDataSources";
4763
4899
  Param["AnalystId"] = "analystId";
4764
4900
  Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
4901
+ Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
4765
4902
  })(Param || (Param = {}));
4766
4903
  /**
4767
4904
  * ThoughtSpot application pages include actions and menu commands
@@ -6553,7 +6690,7 @@
6553
6690
  * ```js
6554
6691
  * hiddenActions: [Action.QuickSearchPill]
6555
6692
  * ```
6556
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
6693
+ * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
6557
6694
  */
6558
6695
  Action["QuickSearchPill"] = "quickSearchPill";
6559
6696
  /**
@@ -6568,7 +6705,7 @@
6568
6705
  * ```js
6569
6706
  * hiddenActions: [Action.DeepAnalysisPill]
6570
6707
  * ```
6571
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
6708
+ * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
6572
6709
  */
6573
6710
  Action["DeepAnalysisPill"] = "deepAnalysisPill";
6574
6711
  /**
@@ -6583,7 +6720,7 @@
6583
6720
  * ```js
6584
6721
  * hiddenActions: [Action.DataLiteracyPill]
6585
6722
  * ```
6586
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
6723
+ * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
6587
6724
  */
6588
6725
  Action["DataLiteracyPill"] = "dataLiteracyPill";
6589
6726
  /**
@@ -6766,6 +6903,225 @@
6766
6903
  * ```
6767
6904
  */
6768
6905
  Action["SpotterOnLiveboard"] = "spotterOnLiveboard";
6906
+ /**
6907
+ * Controls the visibility and disabled state of the "Chart Type" menu item
6908
+ * in Chart Settings V2.
6909
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
6910
+ * @example
6911
+ * ```js
6912
+ * {
6913
+ * hiddenActions: [Action.ChartTypeSettings],
6914
+ * disabledActions: [Action.ChartTypeSettings],
6915
+ * }
6916
+ * ```
6917
+ */
6918
+ Action["ChartTypeSettings"] = "CHART_TYPE";
6919
+ /**
6920
+ * Controls the visibility and disabled state of the "Layout" menu item
6921
+ * in Chart Settings V2.
6922
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
6923
+ * @example
6924
+ * ```js
6925
+ * {
6926
+ * hiddenActions: [Action.LayoutSettings],
6927
+ * disabledActions: [Action.LayoutSettings],
6928
+ * }
6929
+ * ```
6930
+ */
6931
+ Action["LayoutSettings"] = "LAYOUT";
6932
+ /**
6933
+ * Controls the visibility and disabled state of the "Column" menu item
6934
+ * in Chart Settings V2.
6935
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
6936
+ * @example
6937
+ * ```js
6938
+ * {
6939
+ * hiddenActions: [Action.ColumnSettings],
6940
+ * disabledActions: [Action.ColumnSettings],
6941
+ * }
6942
+ * ```
6943
+ */
6944
+ Action["ColumnSettings"] = "COLUMN";
6945
+ /**
6946
+ * Controls the visibility and disabled state of the "Axis" menu item
6947
+ * in Chart Settings V2.
6948
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
6949
+ * @example
6950
+ * ```js
6951
+ * {
6952
+ * hiddenActions: [Action.AxisSettings],
6953
+ * disabledActions: [Action.AxisSettings],
6954
+ * }
6955
+ * ```
6956
+ */
6957
+ Action["AxisSettings"] = "AXIS";
6958
+ /**
6959
+ * Controls the visibility and disabled state of the "Data Label" menu item
6960
+ * in Chart Settings V2.
6961
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
6962
+ * @example
6963
+ * ```js
6964
+ * {
6965
+ * hiddenActions: [Action.DataLabelSettings],
6966
+ * disabledActions: [Action.DataLabelSettings],
6967
+ * }
6968
+ * ```
6969
+ */
6970
+ Action["DataLabelSettings"] = "DATA_LABEL";
6971
+ /**
6972
+ * Controls the visibility and disabled state of the "Tooltip" menu item
6973
+ * in Chart Settings V2.
6974
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
6975
+ * @example
6976
+ * ```js
6977
+ * {
6978
+ * hiddenActions: [Action.TooltipSettings],
6979
+ * disabledActions: [Action.TooltipSettings],
6980
+ * }
6981
+ * ```
6982
+ */
6983
+ Action["TooltipSettings"] = "TOOLTIP";
6984
+ /**
6985
+ * Controls the visibility and disabled state of the "Legend" menu item
6986
+ * in Chart Settings V2.
6987
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
6988
+ * @example
6989
+ * ```js
6990
+ * {
6991
+ * hiddenActions: [Action.LegendSettings],
6992
+ * disabledActions: [Action.LegendSettings],
6993
+ * }
6994
+ * ```
6995
+ */
6996
+ Action["LegendSettings"] = "LEGEND";
6997
+ /**
6998
+ * Controls the visibility and disabled state of the "Display" menu item
6999
+ * in Chart Settings V2.
7000
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7001
+ * @example
7002
+ * ```js
7003
+ * {
7004
+ * hiddenActions: [Action.DisplaySettings],
7005
+ * disabledActions: [Action.DisplaySettings],
7006
+ * }
7007
+ * ```
7008
+ */
7009
+ Action["DisplaySettings"] = "DISPLAY";
7010
+ /**
7011
+ * Controls the visibility and disabled state of the "Query Details" menu
7012
+ * item in Chart Settings V2.
7013
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7014
+ * @example
7015
+ * ```js
7016
+ * {
7017
+ * hiddenActions: [Action.QuerySettings],
7018
+ * disabledActions: [Action.QuerySettings],
7019
+ * }
7020
+ * ```
7021
+ */
7022
+ Action["QuerySettings"] = "QUERY_DETAILS";
7023
+ /**
7024
+ * Controls the visibility and disabled state of the "Custom Action" menu
7025
+ * item in Chart Settings V2.
7026
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7027
+ * @example
7028
+ * ```js
7029
+ * {
7030
+ * hiddenActions: [Action.CustomSettings],
7031
+ * disabledActions: [Action.CustomSettings],
7032
+ * }
7033
+ * ```
7034
+ */
7035
+ Action["CustomSettings"] = "CUSTOM_ACTION";
7036
+ /**
7037
+ * Controls the visibility and disabled state of the "Muze AI" menu item
7038
+ * in Chart Settings V2.
7039
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7040
+ * @example
7041
+ * ```js
7042
+ * {
7043
+ * hiddenActions: [Action.MuzeAiSettings],
7044
+ * disabledActions: [Action.MuzeAiSettings],
7045
+ * }
7046
+ * ```
7047
+ */
7048
+ Action["MuzeAiSettings"] = "MUZE_AI";
7049
+ /**
7050
+ * Controls the visibility and disabled state of the "R Analysis" menu item
7051
+ * in Chart Settings V2.
7052
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7053
+ * @example
7054
+ * ```js
7055
+ * {
7056
+ * hiddenActions: [Action.RAnalysisSettings],
7057
+ * disabledActions: [Action.RAnalysisSettings],
7058
+ * }
7059
+ * ```
7060
+ */
7061
+ Action["RAnalysisSettings"] = "R_ANALYSIS";
7062
+ /**
7063
+ * Controls the visibility and disabled state of the "Add to Collection" menu item.
7064
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7065
+ * @example
7066
+ * ```js
7067
+ * {
7068
+ * hiddenActions: [Action.AddToCollection],
7069
+ * disabledActions: [Action.AddToCollection],
7070
+ * }
7071
+ * ```
7072
+ */
7073
+ Action["AddToCollection"] = "addToCollection";
7074
+ /**
7075
+ * Controls the visibility and disabled state of the "Create Collection" button.
7076
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7077
+ * @example
7078
+ * ```js
7079
+ * {
7080
+ * hiddenActions: [Action.CreateCollection],
7081
+ * disabledActions: [Action.CreateCollection],
7082
+ * }
7083
+ * ```
7084
+ */
7085
+ Action["CreateCollection"] = "createCollection";
7086
+ /**
7087
+ * Controls the visibility and disabled state of the "Move" menu item in a
7088
+ * Collection.
7089
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7090
+ * @example
7091
+ * ```js
7092
+ * {
7093
+ * hiddenActions: [Action.MoveToCollection],
7094
+ * disabledActions: [Action.MoveToCollection],
7095
+ * }
7096
+ * ```
7097
+ */
7098
+ Action["MoveToCollection"] = "moveToCollection";
7099
+ /**
7100
+ * Controls the visibility and disabled state of the "Remove" menu item in a
7101
+ * Collection.
7102
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7103
+ * @example
7104
+ * ```js
7105
+ * {
7106
+ * hiddenActions: [Action.RemoveFromCollection],
7107
+ * disabledActions: [Action.RemoveFromCollection],
7108
+ * }
7109
+ * ```
7110
+ */
7111
+ Action["RemoveFromCollection"] = "removeFromCollection";
7112
+ /**
7113
+ * Controls the visibility and disabled state of the "Delete" menu item for a
7114
+ * Collection.
7115
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7116
+ * @example
7117
+ * ```js
7118
+ * {
7119
+ * hiddenActions: [Action.DeleteCollection],
7120
+ * disabledActions: [Action.DeleteCollection],
7121
+ * }
7122
+ * ```
7123
+ */
7124
+ Action["DeleteCollection"] = "deleteCollection";
6769
7125
  })(exports.Action || (exports.Action = {}));
6770
7126
  exports.PrefetchFeatures = void 0;
6771
7127
  (function (PrefetchFeatures) {
@@ -7056,6 +7412,36 @@
7056
7412
  /** UpdateParameters payload is invalid - malformed applicability */
7057
7413
  EmbedErrorCodes["UPDATEPARAMETERS_INVALID_PAYLOAD"] = "UPDATEPARAMETERS_INVALID_PAYLOAD";
7058
7414
  })(exports.EmbedErrorCodes || (exports.EmbedErrorCodes = {}));
7415
+ /**
7416
+ * How badly an error affects the embed, so the host can decide whether it is
7417
+ * worth surfacing to the end user.
7418
+ *
7419
+ * Mirrors the severity that ThoughtSpot itself stamps on errors raised inside
7420
+ * the embedded app, so a host can apply one rule to both sources.
7421
+ *
7422
+ * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
7423
+ * @group Error Handling
7424
+ *
7425
+ * @example
7426
+ * Only surface errors that took the embed down
7427
+ *
7428
+ * ```js
7429
+ * embed.on(EmbedEvent.Error, (error) => {
7430
+ * if (error.severity === EmbedErrorSeverity.SEV1) {
7431
+ * showBanner(error.message);
7432
+ * }
7433
+ * });
7434
+ * ```
7435
+ */
7436
+ exports.EmbedErrorSeverity = void 0;
7437
+ (function (EmbedErrorSeverity) {
7438
+ /** The embed cannot render. Nothing usable is on screen. */
7439
+ EmbedErrorSeverity[EmbedErrorSeverity["SEV1"] = 1] = "SEV1";
7440
+ /** Something is degraded but the embed still works. */
7441
+ EmbedErrorSeverity[EmbedErrorSeverity["SEV2"] = 2] = "SEV2";
7442
+ /** Everything else, including validation of the embedder's own input. */
7443
+ EmbedErrorSeverity[EmbedErrorSeverity["SEV3"] = 3] = "SEV3";
7444
+ })(exports.EmbedErrorSeverity || (exports.EmbedErrorSeverity = {}));
7059
7445
  /**
7060
7446
  * Context types for specifying the page context when triggering host events.
7061
7447
  * Used as the third parameter in the `trigger` method to help ThoughtSpot
@@ -7096,20 +7482,27 @@
7096
7482
  ContextType["Other"] = "other";
7097
7483
  })(exports.ContextType || (exports.ContextType = {}));
7098
7484
  /**
7099
- * Enum for the type of API intercepted
7485
+ * Named groups of ThoughtSpot APIs that can be intercepted, for use in
7486
+ * `interceptUrls`. Each group expands to the underlying request URLs, so you do
7487
+ * not have to list them individually.
7100
7488
  */
7101
7489
  exports.InterceptedApiType = void 0;
7102
7490
  (function (InterceptedApiType) {
7103
7491
  /**
7104
- * The apis that are use to get the data for the embed
7492
+ * The APIs that fetch the data backing an Answer, including its chart,
7493
+ * table, and headline data.
7105
7494
  */
7106
7495
  InterceptedApiType["AnswerData"] = "AnswerData";
7107
7496
  /**
7108
- * This will intercept all the apis
7497
+ * Intercepts every `fetch` request the embedded application makes, not only
7498
+ * the data APIs. This includes authentication, session, and metadata calls,
7499
+ * so the handler must respond to requests it does not recognize by passing
7500
+ * `execute: true`. Listing this alongside other entries in `interceptUrls`
7501
+ * supersedes them.
7109
7502
  */
7110
7503
  InterceptedApiType["ALL"] = "ALL";
7111
7504
  /**
7112
- * The apis that are use to get the data for the liveboard
7505
+ * The APIs that fetch the data backing a Liveboard.
7113
7506
  */
7114
7507
  InterceptedApiType["LiveboardData"] = "LiveboardData";
7115
7508
  })(exports.InterceptedApiType || (exports.InterceptedApiType = {}));
@@ -7233,7 +7626,7 @@
7233
7626
  TableContentDensity["Compact"] = "COMPACT";
7234
7627
  })(exports.TableContentDensity || (exports.TableContentDensity = {}));
7235
7628
 
7236
- var version$1="1.51.2";var pkg = {version:version$1};
7629
+ var version$1="1.52.1";var pkg = {version:version$1};
7237
7630
 
7238
7631
  const { version } = pkg;
7239
7632
 
@@ -8055,6 +8448,43 @@
8055
8448
  if (value !== undefined) {
8056
8449
  queryParams[param] = asBoolean ? !!value : value;
8057
8450
  }
8451
+ };
8452
+ /**
8453
+ * Calculates the element center for the currently visible viewport of the
8454
+ * element, using the scroll position of the host app, the offsetTop of the
8455
+ * element in the host app, and the viewport height of the tab.
8456
+ *
8457
+ * The returned keys are sent to the ThoughtSpot app over postMessage, so they
8458
+ * are named after the iframe and must not be renamed.
8459
+ * @param element The element to measure
8460
+ * @returns The element center within the visible viewport, the element height,
8461
+ * and the viewport height.
8462
+ */
8463
+ const calculateElementCenter = (element) => {
8464
+ const offsetTopClient = getOffsetTop(element);
8465
+ const scrollTopClient = window.scrollY;
8466
+ const viewPortHeight = window.innerHeight;
8467
+ const iframeHeight = element.offsetHeight;
8468
+ const iframeScrolled = scrollTopClient - offsetTopClient;
8469
+ let iframeVisibleViewPort;
8470
+ let iframeOffset;
8471
+ if (iframeScrolled < 0) {
8472
+ iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
8473
+ iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
8474
+ iframeOffset = 0;
8475
+ }
8476
+ else {
8477
+ iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
8478
+ iframeOffset = iframeScrolled;
8479
+ }
8480
+ const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
8481
+ return {
8482
+ iframeCenter,
8483
+ iframeScrolled,
8484
+ iframeHeight,
8485
+ viewPortHeight,
8486
+ iframeVisibleViewPort,
8487
+ };
8058
8488
  };
8059
8489
 
8060
8490
  /**
@@ -8123,6 +8553,270 @@
8123
8553
  const DEFAULT_EMBED_HEIGHT = '100%';
8124
8554
  const DEFAULT_LAZY_LOADING_MARGIN = '500px 0px';
8125
8555
 
8556
+ /**
8557
+ * Copyright (c) 2025
8558
+ *
8559
+ * Full-height support for the Liveboard and app embeds.
8560
+ * @summary Full height
8561
+ */
8562
+ /**
8563
+ * The height the embed falls back to when the host app has not configured
8564
+ * `minimumHeight` or `defaultHeight`.
8565
+ */
8566
+ const DEFAULT_MINIMUM_HEIGHT = 500;
8567
+ /**
8568
+ * Routes that are part of the Liveboard experience itself. Navigating between
8569
+ * these does not reset the frame height, because the ThoughtSpot app keeps
8570
+ * reporting a height of its own for them.
8571
+ */
8572
+ const LIVEBOARD_RELATED_ROUTES = [
8573
+ '/pinboard/',
8574
+ '/insights/pinboard/',
8575
+ '/schedules/',
8576
+ '/embed/viz/',
8577
+ '/embed/insights/viz/',
8578
+ '/liveboard/',
8579
+ '/insights/liveboard/',
8580
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
8581
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
8582
+ ];
8583
+ /**
8584
+ * Owns every piece of full-height behavior for an embed: the height
8585
+ * negotiation with the ThoughtSpot app, the query parameters that switch the
8586
+ * feature on, and the viewport listeners that drive lazy loading.
8587
+ *
8588
+ * The controller is inert unless `fullHeight` is enabled, so embeds can create
8589
+ * one unconditionally.
8590
+ */
8591
+ class FullHeightController {
8592
+ constructor(viewConfig, host) {
8593
+ this.host = host;
8594
+ this.scrollContainers = [];
8595
+ /**
8596
+ * Sets the frame height to the height reported by the ThoughtSpot app,
8597
+ * never going below the configured minimum.
8598
+ */
8599
+ this.handleEmbedHeight = (payload) => {
8600
+ const height = Number(payload === null || payload === void 0 ? void 0 : payload.data);
8601
+ if (!isNaN(height)) {
8602
+ this.host.setFrameHeight(Math.max(height, this.minimumHeight));
8603
+ }
8604
+ this.sendVisibleCoordinates();
8605
+ };
8606
+ /**
8607
+ * Answers the app's request for the center of the visible embed region.
8608
+ */
8609
+ this.handleEmbedIframeCenter = (payload, responder) => {
8610
+ const iframe = this.host.getIframe();
8611
+ if (!iframe) {
8612
+ return;
8613
+ }
8614
+ responder === null || responder === void 0 ? void 0 : responder({
8615
+ type: exports.EmbedEvent.EmbedIframeCenter,
8616
+ data: calculateElementCenter(iframe),
8617
+ });
8618
+ };
8619
+ /**
8620
+ * Answers the app's request for the currently visible embed coordinates.
8621
+ */
8622
+ this.handleRequestVisibleCoordinates = (payload, responder) => {
8623
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', payload);
8624
+ responder === null || responder === void 0 ? void 0 : responder({
8625
+ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates,
8626
+ data: this.getVisibleCoordinates(),
8627
+ });
8628
+ };
8629
+ /**
8630
+ * Resets the frame height when the app navigates away from a Liveboard,
8631
+ * since only Liveboard routes report a height of their own.
8632
+ */
8633
+ this.handleRouteChange = (payload) => {
8634
+ var _a, _b;
8635
+ const currentPath = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.currentPath;
8636
+ if (!currentPath) {
8637
+ return;
8638
+ }
8639
+ if (LIVEBOARD_RELATED_ROUTES.some((route) => currentPath.startsWith(route))) {
8640
+ return;
8641
+ }
8642
+ this.host.setFrameHeight(((_b = this.config.frameParams) === null || _b === void 0 ? void 0 : _b.height) || this.minimumHeight);
8643
+ };
8644
+ /**
8645
+ * Pushes the visible embed region to the app so it can decide which
8646
+ * visualizations to load.
8647
+ */
8648
+ this.sendVisibleCoordinates = () => {
8649
+ if (!this.isLazyLoadEnabled) {
8650
+ return;
8651
+ }
8652
+ const coordinates = this.getVisibleCoordinates();
8653
+ if (coordinates) {
8654
+ this.host.trigger(exports.HostEvent.VisibleEmbedCoordinates, coordinates);
8655
+ }
8656
+ };
8657
+ this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
8658
+ this.registerEventHandlers();
8659
+ }
8660
+ /**
8661
+ * The view config the controller runs on: the host app's own config with
8662
+ * the lazy-loading defaults filled in. Read-only, so the only way to change
8663
+ * it is through the setter, which re-resolves the defaults.
8664
+ */
8665
+ get viewConfig() {
8666
+ return this.config;
8667
+ }
8668
+ /**
8669
+ * Replaces the view config the controller runs on and re-resolves the
8670
+ * lazy-loading defaults against it. The config the caller passes is never
8671
+ * written to; the controller keeps a copy of its own.
8672
+ */
8673
+ set viewConfig(viewConfig) {
8674
+ this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
8675
+ }
8676
+ /**
8677
+ * The view config with the lazy-loading settings the embed falls back to
8678
+ * when the host app has not chosen its own.
8679
+ *
8680
+ * Pure by design: it returns a new config rather than writing to the one it
8681
+ * is given, so the host app's object is left untouched.
8682
+ * @param viewConfig The embed's view config
8683
+ * @returns A copy with the defaults filled in, host app choices preserved
8684
+ */
8685
+ static withLazyLoadingDefaults(viewConfig) {
8686
+ return {
8687
+ ...viewConfig,
8688
+ lazyLoadingForFullHeight: viewConfig.lazyLoadingForFullHeight === undefined
8689
+ ? true
8690
+ : viewConfig.lazyLoadingForFullHeight,
8691
+ enableScrollableContainerLazyLoading: viewConfig.enableScrollableContainerLazyLoading === undefined
8692
+ ? true
8693
+ : viewConfig.enableScrollableContainerLazyLoading,
8694
+ lazyLoadingMargin: viewConfig.lazyLoadingMargin === undefined
8695
+ ? DEFAULT_LAZY_LOADING_MARGIN
8696
+ : viewConfig.lazyLoadingMargin,
8697
+ };
8698
+ }
8699
+ /**
8700
+ * Whether the host app asked for a full-height embed.
8701
+ */
8702
+ get isEnabled() {
8703
+ return this.config.fullHeight === true;
8704
+ }
8705
+ /**
8706
+ * Whether visualizations should load as they scroll into view, which
8707
+ * requires the SDK to report the visible region of the embed.
8708
+ */
8709
+ get isLazyLoadEnabled() {
8710
+ return this.isEnabled && !!this.config.lazyLoadingForFullHeight;
8711
+ }
8712
+ /**
8713
+ * The floor for the frame height. `defaultHeight` is the deprecated
8714
+ * spelling of `minimumHeight` and is still honored for compatibility.
8715
+ */
8716
+ get minimumHeight() {
8717
+ const { minimumHeight, defaultHeight } = this.config;
8718
+ return minimumHeight || defaultHeight || DEFAULT_MINIMUM_HEIGHT;
8719
+ }
8720
+ /**
8721
+ * Registers the embed event handlers the feature depends on. Called from
8722
+ * the constructor, so the handlers are in place before `render`.
8723
+ */
8724
+ registerEventHandlers() {
8725
+ if (!this.isEnabled) {
8726
+ return;
8727
+ }
8728
+ this.host.on(exports.EmbedEvent.RouteChange, this.handleRouteChange);
8729
+ this.host.on(exports.EmbedEvent.EmbedHeight, this.handleEmbedHeight);
8730
+ this.host.on(exports.EmbedEvent.EmbedIframeCenter, this.handleEmbedIframeCenter);
8731
+ this.host.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.handleRequestVisibleCoordinates);
8732
+ }
8733
+ /**
8734
+ * Adds the full-height query parameters to the embed URL params.
8735
+ * @param params The query parameters being built by the embed
8736
+ */
8737
+ addQueryParams(params) {
8738
+ if (!this.isEnabled) {
8739
+ return;
8740
+ }
8741
+ params[Param.fullHeight] = true;
8742
+ if (!this.config.lazyLoadingForFullHeight) {
8743
+ return;
8744
+ }
8745
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
8746
+ if (isValidCssMargin(this.config.lazyLoadingMargin)) {
8747
+ params[Param.RootMarginForLazyLoad] = this.config.lazyLoadingMargin;
8748
+ }
8749
+ }
8750
+ /**
8751
+ * Attaches the viewport listeners that keep lazy loading in sync. Call this
8752
+ * once the embed has rendered and the iframe exists.
8753
+ */
8754
+ onRender() {
8755
+ this.registerLazyLoadListeners();
8756
+ }
8757
+ /**
8758
+ * Detaches every listener and observer owned by the controller.
8759
+ */
8760
+ destroy() {
8761
+ this.unregisterLazyLoadListeners();
8762
+ }
8763
+ getVisibleCoordinates() {
8764
+ const iframe = this.host.getIframe();
8765
+ if (!iframe) {
8766
+ return null;
8767
+ }
8768
+ return calculateVisibleElementData(iframe, this.config.enableScrollableContainerLazyLoading);
8769
+ }
8770
+ registerLazyLoadListeners() {
8771
+ if (!this.isLazyLoadEnabled || !this.host.getIframe()) {
8772
+ return;
8773
+ }
8774
+ // Re-registering is safe: drop whatever a previous render attached.
8775
+ this.unregisterLazyLoadListeners();
8776
+ // TODO: Use passive: true, install modernizr to check for passive
8777
+ window.addEventListener('resize', this.sendVisibleCoordinates);
8778
+ window.addEventListener('scroll', this.sendVisibleCoordinates, true);
8779
+ if (!this.config.enableScrollableContainerLazyLoading) {
8780
+ return;
8781
+ }
8782
+ this.observeScrollableContainers();
8783
+ }
8784
+ /**
8785
+ * Tracks the ancestors that can scroll or clip the embed, so the visible
8786
+ * region stays correct when the embed lives inside its own scroll
8787
+ * container rather than the page.
8788
+ */
8789
+ observeScrollableContainers() {
8790
+ const iFrame = this.host.getIframe();
8791
+ this.scrollContainers = getScrollableAncestors(iFrame);
8792
+ this.scrollContainers.forEach((scrollContainer) => {
8793
+ scrollContainer.addEventListener('scroll', this.sendVisibleCoordinates);
8794
+ });
8795
+ if (typeof ResizeObserver === 'undefined') {
8796
+ return;
8797
+ }
8798
+ const resizeTargets = new Set([iFrame.parentElement, ...getEffectiveClippingAncestors(iFrame)].filter(Boolean));
8799
+ this.resizeObserver = new ResizeObserver(this.sendVisibleCoordinates);
8800
+ resizeTargets.forEach((resizeTarget) => {
8801
+ this.resizeObserver.observe(resizeTarget);
8802
+ });
8803
+ }
8804
+ unregisterLazyLoadListeners() {
8805
+ var _a;
8806
+ if (!this.isLazyLoadEnabled) {
8807
+ return;
8808
+ }
8809
+ window.removeEventListener('resize', this.sendVisibleCoordinates);
8810
+ window.removeEventListener('scroll', this.sendVisibleCoordinates, true);
8811
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
8812
+ this.resizeObserver = undefined;
8813
+ this.scrollContainers.forEach((scrollContainer) => {
8814
+ scrollContainer.removeEventListener('scroll', this.sendVisibleCoordinates);
8815
+ });
8816
+ this.scrollContainers = [];
8817
+ }
8818
+ }
8819
+
8126
8820
  /** Used for built-in method references. */
8127
8821
  var objectProto$d = Object.prototype;
8128
8822
 
@@ -9031,7 +9725,110 @@
9031
9725
  UIPassthroughEvent["GetTabs"] = "getTabs";
9032
9726
  UIPassthroughEvent["GetGroups"] = "getGroups";
9033
9727
  UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
9034
- })(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
9728
+ })(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
9729
+ // NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
9730
+ // live in the sibling ./host-event-contracts, which layers the
9731
+ // HostEventRequestMap on top of the UI-passthrough mapping above.
9732
+ // The former 2-tier definitions that lived here were superseded and removed.
9733
+
9734
+ /**
9735
+ * Copyright (c) 2026
9736
+ *
9737
+ * Dedicated transport layer for SDK <-> ThoughtSpot iframe messaging.
9738
+ *
9739
+ * Owns the postMessage/MessageChannel mechanics and origin resolution so
9740
+ * that embed/business logic (ts-embed.ts, hostEventClient) never touches
9741
+ * the wire directly. The wire format is unchanged from the historical
9742
+ * implementation — this layer is a pure structural extraction.
9743
+ */
9744
+ /**
9745
+ * Default time to wait for the app to respond to a request-response
9746
+ * message before giving up and reclaiming the channel.
9747
+ */
9748
+ const MESSAGE_RESPONSE_TIMEOUT = 30000;
9749
+ /**
9750
+ * Single implementation of origin resolution for the embedded app.
9751
+ * Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL,
9752
+ * or null when it cannot be parsed.
9753
+ * @param thoughtSpotHost
9754
+ */
9755
+ const resolveMessageOrigin = (thoughtSpotHost) => {
9756
+ try {
9757
+ return new URL(thoughtSpotHost).origin;
9758
+ }
9759
+ catch (e) {
9760
+ return null;
9761
+ }
9762
+ };
9763
+ /**
9764
+ * Validates that an inbound window message came from the embedded
9765
+ * ThoughtSpot app: the source window must be the embed iframe's window and,
9766
+ * when the expected origin is resolvable, the message origin must match it.
9767
+ *
9768
+ * Fails open (returns true) on the origin check when the expected origin
9769
+ * cannot be resolved, to avoid breaking unconventional-but-working setups;
9770
+ * a warning is logged on mismatch either way.
9771
+ * @param event The message event received on window.
9772
+ * @param iFrame The embed iframe the message should originate from.
9773
+ * @param thoughtSpotHost The configured ThoughtSpot host.
9774
+ */
9775
+ const isMessageFromIframe = (event, iFrame, thoughtSpotHost) => {
9776
+ if (event.source !== (iFrame === null || iFrame === void 0 ? void 0 : iFrame.contentWindow)) {
9777
+ return false;
9778
+ }
9779
+ const expectedOrigin = resolveMessageOrigin(thoughtSpotHost);
9780
+ if (expectedOrigin && event.origin && event.origin !== expectedOrigin) {
9781
+ logger$3.warn(`Dropped message from unexpected origin ${event.origin}; expected ${expectedOrigin}`);
9782
+ return false;
9783
+ }
9784
+ return true;
9785
+ };
9786
+ /**
9787
+ * Posts a one-way message to the embedded app's iframe, optionally
9788
+ * transferring a MessageChannel port for the response.
9789
+ * @param iFrame
9790
+ * @param message
9791
+ * @param thoughtSpotHost Used as the postMessage targetOrigin.
9792
+ * @param channel
9793
+ */
9794
+ const postMessageToIframe = (iFrame, message, thoughtSpotHost, channel) => {
9795
+ var _a;
9796
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, channel ? [channel.port2] : []);
9797
+ };
9798
+ /**
9799
+ * Sends a request-response message to the embedded app over a dedicated
9800
+ * MessageChannel. Resolves with the response payload; rejects when the app
9801
+ * responds with an error; resolves with a timeout Error object when no
9802
+ * response arrives in time (historical behavior, preserved for backward
9803
+ * compatibility).
9804
+ * @param iFrame
9805
+ * @param message
9806
+ * @param thoughtSpotHost
9807
+ * @param timeoutMs
9808
+ */
9809
+ function sendMessageWithResponse(iFrame, message, thoughtSpotHost, timeoutMs = MESSAGE_RESPONSE_TIMEOUT) {
9810
+ return new Promise((res, rej) => {
9811
+ const channel = new MessageChannel();
9812
+ // Close the messageChannel and resolve the promise if timeout.
9813
+ const timeoutId = setTimeout(() => {
9814
+ channel.port1.close();
9815
+ res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
9816
+ }, timeoutMs);
9817
+ channel.port1.onmessage = ({ data: responseData }) => {
9818
+ var _a;
9819
+ clearTimeout(timeoutId);
9820
+ channel.port1.close();
9821
+ const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
9822
+ if (error) {
9823
+ rej(error);
9824
+ }
9825
+ else {
9826
+ res(responseData);
9827
+ }
9828
+ };
9829
+ postMessageToIframe(iFrame, message, thoughtSpotHost, channel);
9830
+ });
9831
+ }
9035
9832
 
9036
9833
  const EndPoints = {
9037
9834
  AUTH_VERIFICATION: '/callosum/v1/session/info',
@@ -20203,23 +21000,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
20203
21000
  iFrame.src = src;
20204
21001
  }, 100);
20205
21002
  };
21003
+ const TRIGGER_TIMEOUT = MESSAGE_RESPONSE_TIMEOUT;
20206
21004
  /**
20207
- * Post iframe message.
20208
- * @param iFrame
20209
- * @param message
20210
- * @param message.type
20211
- * @param message.data
20212
- * @param message.context
20213
- * @param thoughtSpotHost
20214
- * @param channel
20215
- */
20216
- function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
20217
- var _a;
20218
- return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
20219
- }
20220
- const TRIGGER_TIMEOUT = 30000;
20221
- /**
20222
- *
21005
+ * Processes a host event trigger: handles SDK-local events (Reload,
21006
+ * Present) and forwards everything else to the embedded app over the
21007
+ * iframe transport.
20223
21008
  * @param iFrame
20224
21009
  * @param messageType
20225
21010
  * @param thoughtSpotHost
@@ -20227,42 +21012,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
20227
21012
  * @param context
20228
21013
  */
20229
21014
  function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
20230
- return new Promise((res, rej) => {
20231
- var _a;
20232
- if (messageType === exports.HostEvent.Reload) {
20233
- reload(iFrame);
20234
- return res(null);
20235
- }
20236
- if (messageType === exports.HostEvent.Present) {
20237
- const embedConfig = getEmbedConfig();
20238
- const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
20239
- if (!disableFullscreenPresentation) {
20240
- handlePresentEvent(iFrame);
20241
- }
20242
- else {
20243
- logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
20244
- }
21015
+ var _a;
21016
+ if (messageType === exports.HostEvent.Reload) {
21017
+ reload(iFrame);
21018
+ return Promise.resolve(null);
21019
+ }
21020
+ if (messageType === exports.HostEvent.Present) {
21021
+ const embedConfig = getEmbedConfig();
21022
+ const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
21023
+ if (!disableFullscreenPresentation) {
21024
+ handlePresentEvent(iFrame);
20245
21025
  }
20246
- const channel = new MessageChannel();
20247
- // Close the messageChannel and resolve the promise if timeout.
20248
- const timeoutId = setTimeout(() => {
20249
- channel.port1.close();
20250
- res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
20251
- }, TRIGGER_TIMEOUT);
20252
- channel.port1.onmessage = ({ data: responseData }) => {
20253
- var _a;
20254
- clearTimeout(timeoutId);
20255
- channel.port1.close();
20256
- const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
20257
- if (error) {
20258
- rej(error);
20259
- }
20260
- else {
20261
- res(responseData);
20262
- }
20263
- };
20264
- return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
20265
- });
21026
+ else {
21027
+ logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
21028
+ }
21029
+ }
21030
+ return sendMessageWithResponse(iFrame, { type: messageType, data, context }, thoughtSpotHost, TRIGGER_TIMEOUT);
20266
21031
  }
20267
21032
 
20268
21033
  /**
@@ -21124,6 +21889,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21124
21889
  if (!isValidUpdateFiltersPayload(payload)) {
21125
21890
  throwUpdateFiltersValidationError();
21126
21891
  }
21892
+ // The shared contract accepts both current (columnName/operator) and
21893
+ // legacy (column/oper) filter field names — as does the validation
21894
+ // above and the app at runtime. The UIPassthrough FilterUpdate type
21895
+ // still requires the legacy names; bridge until that contract is
21896
+ // audited.
21127
21897
  return this.handleHostEventWithParam(exports.UIPassthroughEvent.UpdateFilters, payload, context);
21128
21898
  }
21129
21899
  handleUpdateParametersEvent(payload, context) {
@@ -21274,6 +22044,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21274
22044
  errorType: exports.ErrorDetailsTypes.API,
21275
22045
  message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
21276
22046
  code: exports.EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
22047
+ severity: exports.EmbedErrorSeverity.SEV3,
21277
22048
  error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
21278
22049
  };
21279
22050
  executeEvent(exports.EmbedEvent.Error, errorDetails);
@@ -21357,6 +22128,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21357
22128
  */
21358
22129
  const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
21359
22130
  const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
22131
+ // The container applies UpdateEmbedParams through React state, so a delivered
22132
+ // post is not the same as the params being in effect.
22133
+ const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
22134
+ // The container ignores runtimeFilterParams/runtimeParameterParams unless truthy, so
22135
+ // null or '' leaves the previous embed's values in place. '&' is truthy and parses to {}.
22136
+ const NO_RUNTIME_PARAMS = '&';
21360
22137
  /**
21361
22138
  * The event id map from v2 event names to v1 event id
21362
22139
  * v1 events are the classic embed events implemented in Blink v1
@@ -21383,6 +22160,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21383
22160
  * The key to store the embed instance in the DOM node
21384
22161
  */
21385
22162
  this.embedNodeKey = '__tsEmbed';
22163
+ this.embedContainerLoadedKey = '__tsEmbedContainerLoaded';
21386
22164
  this.isAppInitialized = false;
21387
22165
  /**
21388
22166
  * Should we encode URL Query Params using base64 encoding which ThoughtSpot
@@ -21403,7 +22181,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21403
22181
  const eventType = this.getEventType(event);
21404
22182
  const eventPort = this.getEventPort(event);
21405
22183
  const eventData = this.formatEventData(event, eventType);
21406
- if (event.source === this.iFrame.contentWindow) {
22184
+ if (isMessageFromIframe(event, this.iFrame, this.thoughtSpotHost)) {
21407
22185
  const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.hostElement);
21408
22186
  if (eventType === exports.EmbedEvent.ApiIntercept) {
21409
22187
  this.handleApiInterceptEvent({ eventData, eventPort });
@@ -21545,7 +22323,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21545
22323
  this.createEmbedContainerHandler = (source) => () => {
21546
22324
  const processEmbedContainerReady = () => {
21547
22325
  logger$3.debug('processEmbedContainerReady');
21548
- this.isEmbedContainerLoaded = true;
22326
+ this.markEmbedContainerLoaded();
21549
22327
  this.executeEmbedContainerReadyCallbacks();
21550
22328
  };
21551
22329
  if (source === exports.EmbedEvent.AuthInit) {
@@ -21559,6 +22337,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21559
22337
  processEmbedContainerReady();
21560
22338
  }
21561
22339
  };
22340
+ // Subclasses that navigate the pre-render on show must await this before
22341
+ // triggering Navigate. Resolves even on failure, so navigation is never blocked.
22342
+ this.preRenderParamsApplied = Promise.resolve();
21562
22343
  this.hostElement = getDOMNode(domSelector);
21563
22344
  this.eventHandlerMap = new Map();
21564
22345
  this.isError = false;
@@ -21618,6 +22399,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21618
22399
  errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
21619
22400
  message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
21620
22401
  code: exports.EmbedErrorCodes.INIT_ERROR,
22402
+ severity: exports.EmbedErrorSeverity.SEV1,
21621
22403
  error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
21622
22404
  });
21623
22405
  }
@@ -21628,7 +22410,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21628
22410
  */
21629
22411
  handleError(errorDetails) {
21630
22412
  this.isError = true;
21631
- this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
22413
+ this.executeCallbacks(exports.EmbedEvent.Error, {
22414
+ severity: exports.EmbedErrorSeverity.SEV3,
22415
+ ...errorDetails,
22416
+ });
21632
22417
  // Log error
21633
22418
  logger$3.error(errorDetails);
21634
22419
  }
@@ -21713,6 +22498,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21713
22498
  errorType: exports.ErrorDetailsTypes.NETWORK,
21714
22499
  message: ERROR_MESSAGE.OFFLINE_WARNING,
21715
22500
  code: exports.EmbedErrorCodes.NETWORK_ERROR,
22501
+ severity: exports.EmbedErrorSeverity.SEV2,
21716
22502
  offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
21717
22503
  };
21718
22504
  this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
@@ -21870,6 +22656,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21870
22656
  return `${basePath}#`;
21871
22657
  }
21872
22658
  async getUpdateEmbedParamsObject() {
22659
+ var _a, _b;
21873
22660
  const queryParams = this.getEmbedParamsObject();
21874
22661
  // Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
21875
22662
  // them back so the event payload matches a URL load (SCAL-334713).
@@ -21877,7 +22664,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21877
22664
  queryParams[key] = deserializeParam(queryParams[key]);
21878
22665
  });
21879
22666
  const appInitData = await this.getAppInitData();
21880
- return { ...this.viewConfig, ...queryParams, ...appInitData };
22667
+ return {
22668
+ ...this.viewConfig,
22669
+ ...queryParams,
22670
+ ...appInitData,
22671
+ // A show cycle has no URL to carry these, so the payload always states them
22672
+ // — including "none", which is the case that leaks the previous filters.
22673
+ runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
22674
+ runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
22675
+ || NO_RUNTIME_PARAMS,
22676
+ };
21881
22677
  }
21882
22678
  /**
21883
22679
  * Common query params set for all the embed modes.
@@ -22085,9 +22881,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22085
22881
  return iFrame;
22086
22882
  }
22087
22883
  /**
22088
- * Returns a merged {@link PreRenderConfig} object where each shared key
22089
- * prefers `preRenderConfig.key` over the top-level `viewConfig.key` for
22090
- * backward compatibility.
22884
+ * Returns a merged {@link PreRenderConfig} object where each key prefers the
22885
+ * value from `preRenderConfig` over its deprecated top-level `viewConfig`
22886
+ * counterpart (`id`/`preRenderId`, `containerSelector`/`preRenderContainer`,
22887
+ * `doNotTrackSize`/`doNotTrackPreRenderSize`) for backward compatibility.
22091
22888
  */
22092
22889
  getPreRenderConfig() {
22093
22890
  var _a, _b, _c, _d;
@@ -22095,16 +22892,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22095
22892
  const preRenderCfg = (_a = viewCfg.preRenderConfig) !== null && _a !== void 0 ? _a : {};
22096
22893
  return {
22097
22894
  ...preRenderCfg,
22098
- preRenderId: (_b = preRenderCfg.preRenderId) !== null && _b !== void 0 ? _b : viewCfg.preRenderId,
22099
- preRenderContainer: (_c = preRenderCfg.preRenderContainer) !== null && _c !== void 0 ? _c : viewCfg.preRenderContainer,
22100
- doNotTrackPreRenderSize: (_d = preRenderCfg.doNotTrackPreRenderSize) !== null && _d !== void 0 ? _d : viewCfg.doNotTrackPreRenderSize,
22895
+ id: (_b = preRenderCfg.id) !== null && _b !== void 0 ? _b : viewCfg.preRenderId,
22896
+ containerSelector: (_c = preRenderCfg.containerSelector) !== null && _c !== void 0 ? _c : viewCfg.preRenderContainer,
22897
+ doNotTrackSize: (_d = preRenderCfg.doNotTrackSize) !== null && _d !== void 0 ? _d : viewCfg.doNotTrackPreRenderSize,
22101
22898
  };
22102
22899
  }
22103
22900
  /**
22104
22901
  * Returns true if this embed instance is configured for pre-rendering.
22105
22902
  */
22106
22903
  isPreRenderEmbed() {
22107
- return !!this.getPreRenderConfig().preRenderId;
22904
+ return !!this.getPreRenderConfig().id;
22108
22905
  }
22109
22906
  handleInsertionIntoDOM(child) {
22110
22907
  if (this.isPreRenderEmbed()) {
@@ -22200,6 +22997,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22200
22997
  errorType: exports.ErrorDetailsTypes.API,
22201
22998
  message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
22202
22999
  code: exports.EmbedErrorCodes.LOGIN_FAILED,
23000
+ severity: exports.EmbedErrorSeverity.SEV1,
22203
23001
  error: error,
22204
23002
  });
22205
23003
  });
@@ -22291,7 +23089,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22291
23089
  */
22292
23090
  resolvePreRenderContainerTarget() {
22293
23091
  var _a;
22294
- const containerConfig = this.getPreRenderConfig().preRenderContainer;
23092
+ const containerConfig = this.getPreRenderConfig().containerSelector;
22295
23093
  let container = null;
22296
23094
  if (typeof containerConfig === 'string') {
22297
23095
  try {
@@ -22316,7 +23114,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22316
23114
  return;
22317
23115
  }
22318
23116
  const ownerContainer = (_a = preRenderedObject.preRenderContainerEl) !== null && _a !== void 0 ? _a : document.body;
22319
- if (this.getPreRenderConfig().preRenderContainer
23117
+ if (this.getPreRenderConfig().containerSelector
22320
23118
  && this.resolvePreRenderContainerTarget() !== ownerContainer) {
22321
23119
  logger$3.warn('preRenderContainer is applied only by the component that creates the preRender; '
22322
23120
  + 'the one passed here is ignored. Set it on the PreRender component instead.');
@@ -22506,40 +23304,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22506
23304
  getCompatibleEventType(eventType) {
22507
23305
  return V1EventMap[eventType] || eventType;
22508
23306
  }
22509
- /**
22510
- * Calculates the iframe center for the current visible viewPort
22511
- * of iframe using Scroll position of Host App, offsetTop for iframe
22512
- * in Host app. ViewPort height of the tab.
22513
- * @returns iframe Center in visible viewport,
22514
- * Iframe height,
22515
- * View port height.
22516
- */
22517
- getIframeCenter() {
22518
- const offsetTopClient = getOffsetTop(this.iFrame);
22519
- const scrollTopClient = window.scrollY;
22520
- const viewPortHeight = window.innerHeight;
22521
- const iframeHeight = this.iFrame.offsetHeight;
22522
- const iframeScrolled = scrollTopClient - offsetTopClient;
22523
- let iframeVisibleViewPort;
22524
- let iframeOffset;
22525
- if (iframeScrolled < 0) {
22526
- iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
22527
- iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
22528
- iframeOffset = 0;
22529
- }
22530
- else {
22531
- iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
22532
- iframeOffset = iframeScrolled;
22533
- }
22534
- const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
22535
- return {
22536
- iframeCenter,
22537
- iframeScrolled,
22538
- iframeHeight,
22539
- viewPortHeight,
22540
- iframeVisibleViewPort,
22541
- };
22542
- }
22543
23307
  /**
22544
23308
  * Registers an event listener to trigger an alert when the ThoughtSpot app
22545
23309
  * sends an event of a particular message type to the host application.
@@ -22623,13 +23387,32 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22623
23387
  var _a;
22624
23388
  const embedObj = (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
22625
23389
  if (embedObj === this) {
22626
- logger$3.info('embedObj is same as this');
23390
+ logger$3.debug('embedObj is same as this');
22627
23391
  }
22628
23392
  return embedObj;
22629
23393
  }
23394
+ takeOverPreRender() {
23395
+ if (!this.preRenderWrapper)
23396
+ return;
23397
+ this.preRenderWrapper[this.embedNodeKey] = this;
23398
+ }
23399
+ // The flag lives on the wrapper because it describes the iframe: an instance
23400
+ // hidden when the container announced itself would otherwise report false forever.
23401
+ markEmbedContainerLoaded() {
23402
+ this.isEmbedContainerLoaded = true;
23403
+ if (this.preRenderWrapper) {
23404
+ this.preRenderWrapper[this.embedContainerLoadedKey] = true;
23405
+ }
23406
+ }
22630
23407
  checkEmbedContainerLoaded() {
23408
+ var _a;
22631
23409
  if (this.isEmbedContainerLoaded)
22632
23410
  return true;
23411
+ if ((_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedContainerLoadedKey]) {
23412
+ this.isEmbedContainerLoaded = true;
23413
+ return true;
23414
+ }
23415
+ // Older builds stamped the flag on the instance, not the wrapper.
22633
23416
  const preRenderObj = this.getPreRenderObj();
22634
23417
  if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
22635
23418
  this.isEmbedContainerLoaded = true;
@@ -22658,8 +23441,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22658
23441
  }
22659
23442
  /**
22660
23443
  * Triggers an event to the embedded app
23444
+ *
23445
+ * Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields
23446
+ * on a known event's payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the
23447
+ * payload is checked strictly against the event contract — update call sites now.
22661
23448
  * @param {HostEvent} messageType The event type
22662
- * @param {any} data The payload to send with the message
23449
+ * @param {TriggerData} data The payload, typed against the event's contract
22663
23450
  * @param {ContextType} context Optional context type to specify the context from which the event is triggered.
22664
23451
  * Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
22665
23452
  * ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
@@ -22676,7 +23463,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22676
23463
  * ```
22677
23464
  * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
22678
23465
  */
22679
- async trigger(messageType, data = {}, context) {
23466
+ async trigger(messageType,
23467
+ // Contract shape is the contextual type: payload fields autocomplete
23468
+ // and unknown fields on object literals are flagged. Strict checks
23469
+ // land in SDK 1.54.0 — see TriggerData.
23470
+ data = {}, context) {
22680
23471
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
22681
23472
  if (!this.isRendered) {
22682
23473
  this.handleError({
@@ -22813,7 +23604,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22813
23604
  showPreRenderByDefault,
22814
23605
  replaceExistingPreRender,
22815
23606
  });
22816
- if (!this.getPreRenderConfig().preRenderId) {
23607
+ if (!this.getPreRenderConfig().id) {
22817
23608
  logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
22818
23609
  return this;
22819
23610
  }
@@ -22964,20 +23755,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22964
23755
  // have moved on to UpdateEmbedParams supported clusters
22965
23756
  // this.validatePreRenderViewConfig(this.viewConfig); removed in #517
22966
23757
  logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
22967
- this.executeAfterEmbedContainerLoaded(async () => {
22968
- try {
22969
- const params = await this.getUpdateEmbedParamsObject();
22970
- this.trigger(exports.HostEvent.UpdateEmbedParams, params);
22971
- }
22972
- catch (error) {
22973
- logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
22974
- this.handleError({
22975
- errorType: exports.ErrorDetailsTypes.API,
22976
- message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
22977
- code: exports.EmbedErrorCodes.UPDATE_PARAMS_FAILED,
22978
- error: (error === null || error === void 0 ? void 0 : error.message) || error,
22979
- });
22980
- }
23758
+ // Created synchronously: a queued navigation needs something to await
23759
+ // whether the container is already loaded or not.
23760
+ this.preRenderParamsApplied = new Promise((resolve) => {
23761
+ this.executeAfterEmbedContainerLoaded(async () => {
23762
+ try {
23763
+ const params = await this.getUpdateEmbedParamsObject();
23764
+ this.trigger(exports.HostEvent.UpdateEmbedParams, params);
23765
+ }
23766
+ catch (error) {
23767
+ logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
23768
+ this.handleError({
23769
+ errorType: exports.ErrorDetailsTypes.API,
23770
+ message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
23771
+ code: exports.EmbedErrorCodes.UPDATE_PARAMS_FAILED,
23772
+ error: (error === null || error === void 0 ? void 0 : error.message) || error,
23773
+ });
23774
+ }
23775
+ finally {
23776
+ setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
23777
+ }
23778
+ });
22981
23779
  });
22982
23780
  }
22983
23781
  /**
@@ -22989,12 +23787,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22989
23787
  async showPreRender() {
22990
23788
  var _a, _b;
22991
23789
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
22992
- preRenderId: this.getPreRenderConfig().preRenderId,
23790
+ preRenderId: this.getPreRenderConfig().id,
22993
23791
  embedComponentType: this.viewConfig.embedComponentType,
22994
23792
  });
22995
23793
  if (this.shouldWaitForRenderPromise)
22996
23794
  await this.isReadyForRenderPromise;
22997
- if (!this.getPreRenderConfig().preRenderId) {
23795
+ if (!this.getPreRenderConfig().id) {
22998
23796
  logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
22999
23797
  return this;
23000
23798
  }
@@ -23030,7 +23828,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23030
23828
  this.containerScrollListener = () => this.syncPreRenderStyle();
23031
23829
  customContainer.addEventListener('scroll', this.containerScrollListener);
23032
23830
  }
23033
- if (!this.getPreRenderConfig().doNotTrackPreRenderSize) {
23831
+ if (!this.getPreRenderConfig().doNotTrackSize) {
23034
23832
  const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
23035
23833
  this.resizeObserver = new ResizeObserver((entries) => {
23036
23834
  entries.forEach((entry) => {
@@ -23053,6 +23851,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23053
23851
  if (this.iFrame) {
23054
23852
  this.setupFullscreenChangeHandler();
23055
23853
  }
23854
+ // Last, so everything above still sees the instance being taken over from.
23855
+ this.takeOverPreRender();
23056
23856
  return this;
23057
23857
  }
23058
23858
  getPreRenderPlaceHolderElement() {
@@ -23098,7 +23898,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23098
23898
  */
23099
23899
  hidePreRender() {
23100
23900
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
23101
- preRenderId: this.getPreRenderConfig().preRenderId,
23901
+ preRenderId: this.getPreRenderConfig().id,
23102
23902
  embedComponentType: this.viewConfig.embedComponentType,
23103
23903
  });
23104
23904
  logger$3.debug('HidePreRender Called');
@@ -23136,7 +23936,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23136
23936
  * @property {string} child - The HTML element ID for the PreRender child.
23137
23937
  */
23138
23938
  getPreRenderIds() {
23139
- const preRenderId = this.getPreRenderConfig().preRenderId;
23939
+ const preRenderId = this.getPreRenderConfig().id;
23140
23940
  return {
23141
23941
  wrapper: `${PRERENDER_WRAPPER_ID_PREFIX}${preRenderId}`,
23142
23942
  child: `tsEmbed-pre-render-child-${preRenderId}`,
@@ -23255,6 +24055,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23255
24055
  * ```
23256
24056
  */
23257
24057
  on(messageType, callback, options = { start: false }) {
24058
+ // Mirror the base TsEmbed.on generic signature so the enriched
24059
+ // EmbedEventPayload (e.g. CustomAction's answerService) flows through
24060
+ // the override too, and the class hierarchy stays assignable.
23258
24061
  const eventType = this.getCompatibleEventType(messageType);
23259
24062
  return super.on(eventType, callback, options);
23260
24063
  }
@@ -23495,73 +24298,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23495
24298
  constructor(domSelector, viewConfig) {
23496
24299
  viewConfig.embedComponentType = 'AppEmbed';
23497
24300
  super(domSelector, viewConfig);
23498
- this.defaultHeight = 500;
23499
- this.lazyLoadScrollContainers = [];
23500
- this.sendFullHeightLazyLoadData = () => {
23501
- const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
23502
- // this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
23503
- if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
23504
- this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
23505
- }
23506
- };
23507
- /**
23508
- * This is a handler for the RequestVisibleEmbedCoordinates event.
23509
- * It is used to send the visible coordinates data to the host application.
23510
- * @param data The event payload
23511
- * @param responder The responder function
23512
- */
23513
- this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
23514
- logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
23515
- const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
23516
- responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
23517
- };
23518
- /**
23519
- * Set the iframe height as per the computed height received
23520
- * from the ThoughtSpot app.
23521
- * @param data The event payload
23522
- */
23523
- this.updateIFrameHeight = (data) => {
23524
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
23525
- this.sendFullHeightLazyLoadData();
23526
- };
23527
- this.embedIframeCenter = (data, responder) => {
23528
- const obj = this.getIframeCenter();
23529
- responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
23530
- };
23531
- this.setIframeHeightForNonEmbedLiveboard = (data) => {
23532
- const { height: frameHeight } = this.viewConfig.frameParams || {};
23533
- const liveboardRelatedRoutes = [
23534
- '/pinboard/',
23535
- '/insights/pinboard/',
23536
- '/schedules/',
23537
- '/embed/viz/',
23538
- '/embed/insights/viz/',
23539
- '/liveboard/',
23540
- '/insights/liveboard/',
23541
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
23542
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
23543
- ];
23544
- if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
23545
- // Ignore the height reset of the frame, if the navigation is
23546
- // only within the liveboard page.
23547
- return;
23548
- }
23549
- this.setIFrameHeight(frameHeight || this.defaultHeight);
23550
- };
23551
24301
  if (this.viewConfig.fullHeight === true) {
23552
- if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
23553
- this.viewConfig.lazyLoadingForFullHeight = true;
23554
- }
23555
- if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
23556
- this.viewConfig.enableScrollableContainerLazyLoading = true;
23557
- }
23558
- if (this.viewConfig.lazyLoadingMargin === undefined) {
23559
- this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
23560
- }
23561
- this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
23562
- this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
23563
- this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
23564
- this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
24302
+ this.fullHeightController = new FullHeightController(this.viewConfig, {
24303
+ getIframe: () => this.iFrame,
24304
+ setFrameHeight: (height) => this.setIFrameHeight(height),
24305
+ on: (eventType, callback) => {
24306
+ this.on(eventType, callback);
24307
+ },
24308
+ trigger: (hostEvent, data) => {
24309
+ this.trigger(hostEvent, data);
24310
+ },
24311
+ });
23565
24312
  }
23566
24313
  }
23567
24314
  /**
@@ -23592,7 +24339,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23592
24339
  return getQueryParamString(params, true);
23593
24340
  }
23594
24341
  getEmbedParamsObject() {
23595
- const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, fullHeight, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, isEnhancedFilterInteractivityEnabled, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterDataSources, minimumHeight, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
24342
+ var _a;
24343
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, isEnhancedFilterInteractivityEnabled, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterDataSources, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, hideAnswerEditPanel, } = this.viewConfig;
23596
24344
  let params = {};
23597
24345
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
23598
24346
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -23628,6 +24376,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23628
24376
  if (!isUndefined$1(coverAndFilterOptionInPDF)) {
23629
24377
  params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
23630
24378
  }
24379
+ if (!isUndefined$1(hideAnswerEditPanel)) {
24380
+ params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
24381
+ }
23631
24382
  params = this.getBaseQueryParams(params);
23632
24383
  if (!isUndefined$1(updatedSpotterChatPrompt)) {
23633
24384
  params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
@@ -23674,15 +24425,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23674
24425
  if (hideNotification) {
23675
24426
  params[Param.HideNotification] = !!hideNotification;
23676
24427
  }
23677
- if (fullHeight === true) {
23678
- params[Param.fullHeight] = true;
23679
- if (this.viewConfig.lazyLoadingForFullHeight) {
23680
- params[Param.IsLazyLoadingForEmbedEnabled] = true;
23681
- if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
23682
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
23683
- }
23684
- }
23685
- }
24428
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
23686
24429
  if (tag) {
23687
24430
  params[Param.Tag] = tag;
23688
24431
  }
@@ -23749,7 +24492,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23749
24492
  if (isContinuousLiveboardPDFEnabled !== undefined) {
23750
24493
  params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
23751
24494
  }
23752
- this.defaultHeight = minimumHeight || this.defaultHeight;
23753
24495
  if (enableLiveboardDataCache !== undefined) {
23754
24496
  params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
23755
24497
  }
@@ -23888,52 +24630,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23888
24630
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
23889
24631
  */
23890
24632
  destroy() {
24633
+ var _a;
23891
24634
  super.destroy();
23892
- this.unregisterLazyLoadEvents();
24635
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
23893
24636
  }
23894
24637
  postRender() {
23895
- this.registerLazyLoadEvents();
23896
- }
23897
- registerLazyLoadEvents() {
23898
- if (!this.iFrame) {
23899
- return;
23900
- }
23901
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
23902
- this.unregisterLazyLoadEvents();
23903
- // TODO: Use passive: true, install modernizr to check for passive
23904
- window.addEventListener('resize', this.sendFullHeightLazyLoadData);
23905
- window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
23906
- if (!this.viewConfig.enableScrollableContainerLazyLoading) {
23907
- return;
23908
- }
23909
- this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
23910
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
23911
- scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
23912
- });
23913
- if (typeof ResizeObserver !== 'undefined') {
23914
- const resizeTargets = new Set([
23915
- this.iFrame.parentElement,
23916
- ...getEffectiveClippingAncestors(this.iFrame),
23917
- ].filter(Boolean));
23918
- this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
23919
- resizeTargets.forEach((resizeTarget) => {
23920
- this.lazyLoadResizeObserver.observe(resizeTarget);
23921
- });
23922
- }
23923
- }
23924
- }
23925
- unregisterLazyLoadEvents() {
23926
24638
  var _a;
23927
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
23928
- window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
23929
- window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
23930
- (_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
23931
- this.lazyLoadResizeObserver = undefined;
23932
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
23933
- scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
23934
- });
23935
- this.lazyLoadScrollContainers = [];
23936
- }
24639
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
23937
24640
  }
23938
24641
  /**
23939
24642
  * Renders the embedded application pages in the ThoughtSpot app.
@@ -24028,6 +24731,10 @@ query GetEurekaVizSnapshots(
24028
24731
  * @summary Liveboard & visualization embed
24029
24732
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
24030
24733
  */
24734
+ // Home unmounts the liveboard container, which is how its state gets cleared. The
24735
+ // settle window gives the container time to do it before we ask for the liveboard back.
24736
+ const HOME_ROUTE = 'home';
24737
+ const HOME_SETTLE_MS = 200;
24031
24738
  /**
24032
24739
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
24033
24740
  * waits for the authentication to complete, so you need not wait for
@@ -24047,59 +24754,6 @@ query GetEurekaVizSnapshots(
24047
24754
  constructor(domSelector, viewConfig) {
24048
24755
  viewConfig.embedComponentType = 'LiveboardEmbed';
24049
24756
  super(domSelector, viewConfig);
24050
- this.defaultHeight = 500;
24051
- this.lazyLoadScrollContainers = [];
24052
- this.sendFullHeightLazyLoadData = () => {
24053
- const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
24054
- // this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
24055
- if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
24056
- this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
24057
- }
24058
- };
24059
- /**
24060
- * This is a handler for the RequestVisibleEmbedCoordinates event.
24061
- * It is used to send the visible coordinates data to the host application.
24062
- * @param data The event payload
24063
- * @param responder The responder function
24064
- */
24065
- this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
24066
- logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
24067
- const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
24068
- responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
24069
- };
24070
- /**
24071
- * Set the iframe height as per the computed height received
24072
- * from the ThoughtSpot app.
24073
- * @param data The event payload
24074
- */
24075
- this.updateIFrameHeight = (data) => {
24076
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
24077
- this.sendFullHeightLazyLoadData();
24078
- };
24079
- this.embedIframeCenter = (data, responder) => {
24080
- const obj = this.getIframeCenter();
24081
- responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
24082
- };
24083
- this.setIframeHeightForNonEmbedLiveboard = (data) => {
24084
- const { height: frameHeight } = this.viewConfig.frameParams || {};
24085
- const liveboardRelatedRoutes = [
24086
- '/pinboard/',
24087
- '/insights/pinboard/',
24088
- '/schedules/',
24089
- '/embed/viz/',
24090
- '/embed/insights/viz/',
24091
- '/liveboard/',
24092
- '/insights/liveboard/',
24093
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
24094
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
24095
- ];
24096
- if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
24097
- // Ignore the height reset of the frame, if the navigation is
24098
- // only within the liveboard page.
24099
- return;
24100
- }
24101
- this.setIFrameHeight(frameHeight || this.defaultHeight);
24102
- };
24103
24757
  /**
24104
24758
  * @hidden
24105
24759
  * Internal state to track the current liveboard id.
@@ -24113,22 +24767,19 @@ query GetEurekaVizSnapshots(
24113
24767
  };
24114
24768
  if (this.viewConfig.fullHeight === true) {
24115
24769
  if (this.viewConfig.vizId) {
24116
- logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
24117
- 'Using full height with vizId might lead to unexpected behavior.');
24118
- }
24119
- if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
24120
- this.viewConfig.lazyLoadingForFullHeight = true;
24770
+ logger$3.warn('Full height is currently only supported for Liveboard embeds.'
24771
+ + 'Using full height with vizId might lead to unexpected behavior.');
24121
24772
  }
24122
- if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
24123
- this.viewConfig.enableScrollableContainerLazyLoading = true;
24124
- }
24125
- if (this.viewConfig.lazyLoadingMargin === undefined) {
24126
- this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
24127
- }
24128
- this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
24129
- this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
24130
- this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
24131
- this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
24773
+ this.fullHeightController = new FullHeightController(this.viewConfig, {
24774
+ getIframe: () => this.iFrame,
24775
+ setFrameHeight: (height) => this.setIFrameHeight(height),
24776
+ on: (eventType, callback) => {
24777
+ this.on(eventType, callback);
24778
+ },
24779
+ trigger: (hostEvent, data) => {
24780
+ this.trigger(hostEvent, data);
24781
+ },
24782
+ });
24132
24783
  }
24133
24784
  }
24134
24785
  async getAppInitData() {
@@ -24146,21 +24797,13 @@ query GetEurekaVizSnapshots(
24146
24797
  return queryParams;
24147
24798
  }
24148
24799
  getEmbedParamsObject() {
24800
+ var _a;
24149
24801
  let params = {};
24150
24802
  params = this.getBaseQueryParams(params);
24151
- const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, isEnhancedFilterInteractivityEnabled, enableAskSage, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, dataPanelV2 = true, updatedSpotterExperience, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, enableStopAnswerGenerationEmbed, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
24803
+ const { enableVizTransformations, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, isEnhancedFilterInteractivityEnabled, enableAskSage, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, dataPanelV2 = true, updatedSpotterExperience, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, enableStopAnswerGenerationEmbed, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
24152
24804
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
24153
24805
  || this.viewConfig.preventPinboardFilterRemoval;
24154
- if (fullHeight === true) {
24155
- params[Param.fullHeight] = true;
24156
- if (this.viewConfig.lazyLoadingForFullHeight) {
24157
- params[Param.IsLazyLoadingForEmbedEnabled] = true;
24158
- if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
24159
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
24160
- }
24161
- }
24162
- }
24163
- this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
24806
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
24164
24807
  if (enableVizTransformations !== undefined) {
24165
24808
  params[Param.EnableVizTransformations] = enableVizTransformations.toString();
24166
24809
  }
@@ -24345,6 +24988,7 @@ query GetEurekaVizSnapshots(
24345
24988
  errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
24346
24989
  message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
24347
24990
  code: exports.EmbedErrorCodes.LIVEBOARD_ID_MISSING,
24991
+ severity: exports.EmbedErrorSeverity.SEV1,
24348
24992
  error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
24349
24993
  });
24350
24994
  }
@@ -24386,19 +25030,45 @@ query GetEurekaVizSnapshots(
24386
25030
  }
24387
25031
  beforePrerenderVisible() {
24388
25032
  super.beforePrerenderVisible();
24389
- const embedObj = this.getPreRenderObj();
24390
- this.executeAfterEmbedContainerLoaded(() => {
24391
- this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
24392
- if (embedObj) {
24393
- embedObj.currentLiveboardState = {
24394
- liveboardId: this.viewConfig.liveboardId,
24395
- vizId: this.viewConfig.vizId,
24396
- activeTabId: this.viewConfig.activeTabId,
24397
- personalizedViewId: this.viewConfig.personalizedViewId,
24398
- };
25033
+ // Captured before showPreRender() hands the wrapper over to this instance.
25034
+ // Itself means a hide/show, not a hand-over, so there is nothing stale to clear.
25035
+ const previous = this.getPreRenderObj();
25036
+ const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
25037
+ this.executeAfterEmbedContainerLoaded(async () => {
25038
+ // Without this the params callback suspends on its await and Navigate
25039
+ // goes out first, so the container loads with the previous config's filters.
25040
+ await this.preRenderParamsApplied;
25041
+ if (this.isShowingLiveboardRoute(showing)) {
25042
+ // Navigate to the route we are already on is a no-op, so the liveboard
25043
+ // keeps its state. Home unmounts the container, which clears it.
25044
+ this.trigger(exports.HostEvent.Navigate, HOME_ROUTE)
25045
+ .catch((error) => logger$3.warn('Could not route via home', error));
25046
+ // Not awaited above: the container never acks Navigate, so that promise
25047
+ // only settles on the 30s trigger timeout.
25048
+ await new Promise((resolve) => {
25049
+ setTimeout(resolve, HOME_SETTLE_MS);
25050
+ });
24399
25051
  }
25052
+ this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
25053
+ this.currentLiveboardState = {
25054
+ liveboardId: this.viewConfig.liveboardId,
25055
+ vizId: this.viewConfig.vizId,
25056
+ activeTabId: this.viewConfig.activeTabId,
25057
+ personalizedViewId: this.viewConfig.personalizedViewId,
25058
+ };
24400
25059
  });
24401
25060
  }
25061
+ // The whole route, not just the liveboard id: the path is built from the viz, tab
25062
+ // and view too, so a same-liveboard show onto another tab is a real navigation.
25063
+ isShowingLiveboardRoute(showing) {
25064
+ if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
25065
+ return false;
25066
+ const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
25067
+ return showing.liveboardId === liveboardId
25068
+ && showing.vizId === vizId
25069
+ && showing.activeTabId === activeTabId
25070
+ && showing.personalizedViewId === personalizedViewId;
25071
+ }
24402
25072
  async handleRenderForPrerender() {
24403
25073
  if (isUndefined$1(this.viewConfig.liveboardId)) {
24404
25074
  return this.prerenderGeneric();
@@ -24407,11 +25077,16 @@ query GetEurekaVizSnapshots(
24407
25077
  }
24408
25078
  /**
24409
25079
  * Triggers an event to the embedded app
25080
+ * Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
25081
+ * from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
24410
25082
  * @param {HostEvent} messageType The event type
24411
- * @param {any} data The payload to send with the message
25083
+ * @param {TriggerData} data The payload, typed against the event's contract
24412
25084
  * @returns A promise that resolves with the response from the embedded app
24413
25085
  */
24414
- trigger(messageType, data = {}, context) {
25086
+ trigger(messageType,
25087
+ // Mirror TsEmbed.trigger: contract shape is the contextual type and
25088
+ // unknown fields on object literals are flagged. Strict in SDK 1.54.0.
25089
+ data = {}, context) {
24415
25090
  const dataWithVizId = data;
24416
25091
  if (messageType === exports.HostEvent.SetActiveTab) {
24417
25092
  this.setActiveTab(data);
@@ -24427,52 +25102,13 @@ query GetEurekaVizSnapshots(
24427
25102
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
24428
25103
  */
24429
25104
  destroy() {
25105
+ var _a;
24430
25106
  super.destroy();
24431
- this.unregisterLazyLoadEvents();
25107
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
24432
25108
  }
24433
25109
  postRender() {
24434
- this.registerLazyLoadEvents();
24435
- }
24436
- registerLazyLoadEvents() {
24437
- if (!this.iFrame) {
24438
- return;
24439
- }
24440
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24441
- this.unregisterLazyLoadEvents();
24442
- // TODO: Use passive: true, install modernizr to check for passive
24443
- window.addEventListener('resize', this.sendFullHeightLazyLoadData);
24444
- window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24445
- if (!this.viewConfig.enableScrollableContainerLazyLoading) {
24446
- return;
24447
- }
24448
- this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
24449
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24450
- scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
24451
- });
24452
- if (typeof ResizeObserver !== 'undefined') {
24453
- const resizeTargets = new Set([
24454
- this.iFrame.parentElement,
24455
- ...getEffectiveClippingAncestors(this.iFrame),
24456
- ].filter(Boolean));
24457
- this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
24458
- resizeTargets.forEach((resizeTarget) => {
24459
- this.lazyLoadResizeObserver.observe(resizeTarget);
24460
- });
24461
- }
24462
- }
24463
- }
24464
- unregisterLazyLoadEvents() {
24465
25110
  var _a;
24466
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24467
- window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
24468
- window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24469
- (_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24470
- this.lazyLoadResizeObserver = undefined;
24471
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24472
- scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
24473
- });
24474
- this.lazyLoadScrollContainers = [];
24475
- }
25111
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
24476
25112
  }
24477
25113
  /**
24478
25114
  * Render an embedded ThoughtSpot Liveboard or visualization
@@ -24496,7 +25132,7 @@ query GetEurekaVizSnapshots(
24496
25132
  if (this.isRendered) {
24497
25133
  this.trigger(exports.HostEvent.Navigate, path.substring(1));
24498
25134
  }
24499
- else if (this.getPreRenderConfig().preRenderId) {
25135
+ else if (this.getPreRenderConfig().id) {
24500
25136
  this.preRender(true);
24501
25137
  }
24502
25138
  else {
@@ -24617,7 +25253,7 @@ query GetEurekaVizSnapshots(
24617
25253
  }
24618
25254
  getEmbedParamsObject() {
24619
25255
  var _a;
24620
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, } = this.viewConfig;
25256
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, hideAnswerEditPanel, } = this.viewConfig;
24621
25257
  const queryParams = this.getBaseQueryParams();
24622
25258
  queryParams[Param.HideActions] = [
24623
25259
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -24640,6 +25276,9 @@ query GetEurekaVizSnapshots(
24640
25276
  if (enableSearchAssist) {
24641
25277
  queryParams[Param.EnableSearchAssist] = true;
24642
25278
  }
25279
+ if (hideAnswerEditPanel !== undefined) {
25280
+ queryParams[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
25281
+ }
24643
25282
  if (hideResults) {
24644
25283
  queryParams[Param.HideResult] = true;
24645
25284
  }