@thoughtspot/visual-embed-sdk 1.44.0 → 1.44.1-test

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 (148) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/api-intercept.d.ts.map +1 -1
  3. package/cjs/src/api-intercept.js +8 -3
  4. package/cjs/src/api-intercept.js.map +1 -1
  5. package/cjs/src/api-intercept.spec.js +19 -3
  6. package/cjs/src/api-intercept.spec.js.map +1 -1
  7. package/cjs/src/embed/app.d.ts +17 -0
  8. package/cjs/src/embed/app.d.ts.map +1 -1
  9. package/cjs/src/embed/app.js +6 -4
  10. package/cjs/src/embed/app.js.map +1 -1
  11. package/cjs/src/embed/app.spec.js +84 -1
  12. package/cjs/src/embed/app.spec.js.map +1 -1
  13. package/cjs/src/embed/base.d.ts +7 -0
  14. package/cjs/src/embed/base.d.ts.map +1 -1
  15. package/cjs/src/embed/base.js +16 -1
  16. package/cjs/src/embed/base.js.map +1 -1
  17. package/cjs/src/embed/base.spec.js +21 -0
  18. package/cjs/src/embed/base.spec.js.map +1 -1
  19. package/cjs/src/embed/conversation.d.ts.map +1 -1
  20. package/cjs/src/embed/conversation.js +6 -1
  21. package/cjs/src/embed/conversation.js.map +1 -1
  22. package/cjs/src/embed/conversation.spec.js +6 -1
  23. package/cjs/src/embed/conversation.spec.js.map +1 -1
  24. package/cjs/src/embed/liveboard.d.ts +18 -0
  25. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  26. package/cjs/src/embed/liveboard.js +10 -5
  27. package/cjs/src/embed/liveboard.js.map +1 -1
  28. package/cjs/src/embed/liveboard.spec.js +86 -0
  29. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  30. package/cjs/src/embed/ts-embed.d.ts +3 -2
  31. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  32. package/cjs/src/embed/ts-embed.js +51 -17
  33. package/cjs/src/embed/ts-embed.js.map +1 -1
  34. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  35. package/cjs/src/embed/ts-embed.spec.js +93 -5
  36. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  37. package/cjs/src/errors.d.ts +7 -0
  38. package/cjs/src/errors.d.ts.map +1 -1
  39. package/cjs/src/errors.js +7 -0
  40. package/cjs/src/errors.js.map +1 -1
  41. package/cjs/src/index.d.ts +2 -2
  42. package/cjs/src/index.d.ts.map +1 -1
  43. package/cjs/src/index.js +2 -1
  44. package/cjs/src/index.js.map +1 -1
  45. package/cjs/src/react/all-types-export.d.ts +1 -1
  46. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  47. package/cjs/src/react/all-types-export.js +2 -1
  48. package/cjs/src/react/all-types-export.js.map +1 -1
  49. package/cjs/src/types.d.ts +248 -6
  50. package/cjs/src/types.d.ts.map +1 -1
  51. package/cjs/src/types.js +134 -2
  52. package/cjs/src/types.js.map +1 -1
  53. package/dist/{index-B2QPwxuL.js → index-BXCUJ09L.js} +1 -1
  54. package/dist/src/api-intercept.d.ts.map +1 -1
  55. package/dist/src/embed/app.d.ts +17 -0
  56. package/dist/src/embed/app.d.ts.map +1 -1
  57. package/dist/src/embed/base.d.ts +7 -0
  58. package/dist/src/embed/base.d.ts.map +1 -1
  59. package/dist/src/embed/conversation.d.ts.map +1 -1
  60. package/dist/src/embed/liveboard.d.ts +18 -0
  61. package/dist/src/embed/liveboard.d.ts.map +1 -1
  62. package/dist/src/embed/ts-embed.d.ts +3 -2
  63. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  64. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  65. package/dist/src/errors.d.ts +7 -0
  66. package/dist/src/errors.d.ts.map +1 -1
  67. package/dist/src/index.d.ts +2 -2
  68. package/dist/src/index.d.ts.map +1 -1
  69. package/dist/src/react/all-types-export.d.ts +1 -1
  70. package/dist/src/react/all-types-export.d.ts.map +1 -1
  71. package/dist/src/types.d.ts +248 -6
  72. package/dist/src/types.d.ts.map +1 -1
  73. package/dist/tsembed-react.es.js +293 -104
  74. package/dist/tsembed-react.js +292 -103
  75. package/dist/tsembed.es.js +307 -105
  76. package/dist/tsembed.js +306 -103
  77. package/dist/visual-embed-sdk-react-full.d.ts +245 -7
  78. package/dist/visual-embed-sdk-react.d.ts +238 -7
  79. package/dist/visual-embed-sdk.d.ts +245 -7
  80. package/lib/package.json +1 -1
  81. package/lib/src/api-intercept.d.ts.map +1 -1
  82. package/lib/src/api-intercept.js +9 -4
  83. package/lib/src/api-intercept.js.map +1 -1
  84. package/lib/src/api-intercept.spec.js +20 -4
  85. package/lib/src/api-intercept.spec.js.map +1 -1
  86. package/lib/src/embed/app.d.ts +17 -0
  87. package/lib/src/embed/app.d.ts.map +1 -1
  88. package/lib/src/embed/app.js +6 -4
  89. package/lib/src/embed/app.js.map +1 -1
  90. package/lib/src/embed/app.spec.js +84 -1
  91. package/lib/src/embed/app.spec.js.map +1 -1
  92. package/lib/src/embed/base.d.ts +7 -0
  93. package/lib/src/embed/base.d.ts.map +1 -1
  94. package/lib/src/embed/base.js +14 -0
  95. package/lib/src/embed/base.js.map +1 -1
  96. package/lib/src/embed/base.spec.js +21 -0
  97. package/lib/src/embed/base.spec.js.map +1 -1
  98. package/lib/src/embed/conversation.d.ts.map +1 -1
  99. package/lib/src/embed/conversation.js +7 -2
  100. package/lib/src/embed/conversation.js.map +1 -1
  101. package/lib/src/embed/conversation.spec.js +7 -2
  102. package/lib/src/embed/conversation.spec.js.map +1 -1
  103. package/lib/src/embed/liveboard.d.ts +18 -0
  104. package/lib/src/embed/liveboard.d.ts.map +1 -1
  105. package/lib/src/embed/liveboard.js +11 -6
  106. package/lib/src/embed/liveboard.js.map +1 -1
  107. package/lib/src/embed/liveboard.spec.js +86 -0
  108. package/lib/src/embed/liveboard.spec.js.map +1 -1
  109. package/lib/src/embed/ts-embed.d.ts +3 -2
  110. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  111. package/lib/src/embed/ts-embed.js +52 -18
  112. package/lib/src/embed/ts-embed.js.map +1 -1
  113. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  114. package/lib/src/embed/ts-embed.spec.js +94 -6
  115. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  116. package/lib/src/errors.d.ts +7 -0
  117. package/lib/src/errors.d.ts.map +1 -1
  118. package/lib/src/errors.js +7 -0
  119. package/lib/src/errors.js.map +1 -1
  120. package/lib/src/index.d.ts +2 -2
  121. package/lib/src/index.d.ts.map +1 -1
  122. package/lib/src/index.js +2 -2
  123. package/lib/src/index.js.map +1 -1
  124. package/lib/src/react/all-types-export.d.ts +1 -1
  125. package/lib/src/react/all-types-export.d.ts.map +1 -1
  126. package/lib/src/react/all-types-export.js +1 -1
  127. package/lib/src/react/all-types-export.js.map +1 -1
  128. package/lib/src/types.d.ts +248 -6
  129. package/lib/src/types.d.ts.map +1 -1
  130. package/lib/src/types.js +133 -1
  131. package/lib/src/types.js.map +1 -1
  132. package/package.json +1 -1
  133. package/src/api-intercept.spec.ts +23 -10
  134. package/src/api-intercept.ts +9 -4
  135. package/src/embed/app.spec.ts +116 -2
  136. package/src/embed/app.ts +26 -2
  137. package/src/embed/base.spec.ts +28 -0
  138. package/src/embed/base.ts +15 -0
  139. package/src/embed/conversation.spec.ts +7 -2
  140. package/src/embed/conversation.ts +7 -2
  141. package/src/embed/liveboard.spec.ts +107 -0
  142. package/src/embed/liveboard.ts +32 -4
  143. package/src/embed/ts-embed.spec.ts +107 -15
  144. package/src/embed/ts-embed.ts +56 -19
  145. package/src/errors.ts +7 -0
  146. package/src/index.ts +2 -0
  147. package/src/react/all-types-export.ts +1 -0
  148. package/src/types.ts +259 -6
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.44.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.44.1-test */
2
2
  'use client';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -764,6 +764,7 @@ var EmbedEvent;
764
764
  * SearchEmbed.on(EmbedEvent.Error, (error) => {
765
765
  * console.log(error);
766
766
  * // { type: "Error", data: { errorType: "API", error: { message: '...', error: '...' } } }
767
+ * // { errorType: "API", message: '...', code: '...' } new format
767
768
  * });
768
769
  * ```
769
770
  * @example
@@ -775,6 +776,7 @@ var EmbedEvent;
775
776
  * // message: "Fullscreen API is not enabled",
776
777
  * // stack: "..."
777
778
  * // } }}
779
+ * // { errorType: "FULLSCREEN", message: "Fullscreen API is not enabled", code: '...' } new format
778
780
  * })
779
781
  * ```
780
782
  */
@@ -930,7 +932,8 @@ var EmbedEvent;
930
932
  */
931
933
  EmbedEvent["ALL"] = "*";
932
934
  /**
933
- * Emitted when an Answer is saved in the app
935
+ * Emitted when an Answer is saved in the app.
936
+ * Use start:true to subscribe to when save is initiated, or end:true to subscribe to when save is completed. Default is end:true.
934
937
  * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
935
938
  * @example
936
939
  *```js
@@ -965,6 +968,7 @@ var EmbedEvent;
965
968
  EmbedEvent["Download"] = "download";
966
969
  /**
967
970
  * Emitted when the download action is triggered on an Answer.
971
+ * Use start:true to subscribe to when download is initiated, or end:true to subscribe to when download is completed. Default is end:true.
968
972
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
969
973
  * @example
970
974
  *```js
@@ -979,6 +983,7 @@ var EmbedEvent;
979
983
  EmbedEvent["DownloadAsPng"] = "downloadAsPng";
980
984
  /**
981
985
  * Emitted when the Download as PDF action is triggered on an Answer
986
+ * Use start:true to subscribe to when download as PDF is initiated, or end:true to subscribe to when download as PDF is completed. Default is end:true.
982
987
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
983
988
  * @example
984
989
  *```js
@@ -993,6 +998,7 @@ var EmbedEvent;
993
998
  EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
994
999
  /**
995
1000
  * Emitted when the Download as CSV action is triggered on an Answer.
1001
+ * Use start:true to subscribe to when download as CSV is initiated, or end:true to subscribe to when download as CSV is completed. Default is end:true.
996
1002
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
997
1003
  * @example
998
1004
  *```js
@@ -1007,6 +1013,7 @@ var EmbedEvent;
1007
1013
  EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
1008
1014
  /**
1009
1015
  * Emitted when the Download as XLSX action is triggered on an Answer.
1016
+ * Use start:true to subscribe to when download as XLSX is initiated, or end:true to subscribe to when download as XLSX is completed. Default is end:true.
1010
1017
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1011
1018
  * @example
1012
1019
  *```js
@@ -1021,6 +1028,7 @@ var EmbedEvent;
1021
1028
  EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
1022
1029
  /**
1023
1030
  * Emitted when an Answer is deleted in the app
1031
+ * Use start:true to subscribe to when delete is initiated, or end:true to subscribe to when delete is completed. Default is end:true.
1024
1032
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1025
1033
  * @example
1026
1034
  *```js
@@ -1047,6 +1055,7 @@ var EmbedEvent;
1047
1055
  /**
1048
1056
  * Emitted when a user initiates the Pin action to
1049
1057
  * add an Answer to a Liveboard.
1058
+ * Use start:true to subscribe to when pin is initiated, or end:true to subscribe to when pin is completed. Default is end:true.
1050
1059
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1051
1060
  * @example
1052
1061
  *```js
@@ -1160,6 +1169,7 @@ var EmbedEvent;
1160
1169
  /**
1161
1170
  * Emitted when the **Export TML** action is triggered on an
1162
1171
  * an embedded object in the app
1172
+ * Use start:true to subscribe to when export is initiated, or end:true to subscribe to when export is completed. Default is end:true.
1163
1173
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1164
1174
  * @example
1165
1175
  *```js
@@ -1185,6 +1195,7 @@ var EmbedEvent;
1185
1195
  EmbedEvent["SaveAsView"] = "saveAsView";
1186
1196
  /**
1187
1197
  * Emitted when the user creates a copy of an Answer.
1198
+ * Use start:true to subscribe to when copy and edit is initiated, or end:true to subscribe to when copy and edit is completed. Default is end:true.
1188
1199
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1189
1200
  * @example
1190
1201
  *```js
@@ -3256,6 +3267,8 @@ var Param;
3256
3267
  Param["HideLiveboardHeader"] = "hideLiveboardHeader";
3257
3268
  Param["ShowLiveboardDescription"] = "showLiveboardDescription";
3258
3269
  Param["ShowLiveboardTitle"] = "showLiveboardTitle";
3270
+ Param["ShowMaskedFilterChip"] = "showMaskedFilterChip";
3271
+ Param["IsLiveboardMasterpiecesEnabled"] = "isLiveboardMasterpiecesEnabled";
3259
3272
  Param["HiddenTabs"] = "hideTabs";
3260
3273
  Param["VisibleTabs"] = "visibleTabs";
3261
3274
  Param["HideTabPanel"] = "hideTabPanel";
@@ -4627,6 +4640,46 @@ var Action;
4627
4640
  * @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.15.0.cl
4628
4641
  */
4629
4642
  Action["LiveboardStylePanel"] = "liveboardStylePanel";
4643
+ /**
4644
+ * The **Move to Group** menu action on a Liveboard.
4645
+ * Allows moving a visualization to a different group.
4646
+ * @example
4647
+ * ```js
4648
+ * disabledActions: [Action.MoveToGroup]
4649
+ * ```
4650
+ * @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
4651
+ */
4652
+ Action["MoveToGroup"] = "moveToGroup";
4653
+ /**
4654
+ * The **Move out of Group** menu action on a Liveboard.
4655
+ * Allows moving a visualization out of a group.
4656
+ * @example
4657
+ * ```js
4658
+ * disabledActions: [Action.MoveOutOfGroup]
4659
+ * ```
4660
+ * @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
4661
+ */
4662
+ Action["MoveOutOfGroup"] = "moveOutOfGroup";
4663
+ /**
4664
+ * The **Create Group** menu action on a Liveboard.
4665
+ * Allows creating a new group.
4666
+ * @example
4667
+ * ```js
4668
+ * disabledActions: [Action.CreateGroup]
4669
+ * ```
4670
+ * @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
4671
+ */
4672
+ Action["CreateGroup"] = "createGroup";
4673
+ /**
4674
+ * The **Ungroup Liveboard Group** menu action on a Liveboard.
4675
+ * Allows ungrouping a liveboard group.
4676
+ * @example
4677
+ * ```js
4678
+ * disabledActions: [Action.UngroupLiveboardGroup]
4679
+ * ```
4680
+ * @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
4681
+ */
4682
+ Action["UngroupLiveboardGroup"] = "ungroupLiveboardGroup";
4630
4683
  })(Action || (Action = {}));
4631
4684
  var PrefetchFeatures;
4632
4685
  (function (PrefetchFeatures) {
@@ -4749,6 +4802,85 @@ var LogLevel;
4749
4802
  */
4750
4803
  LogLevel["TRACE"] = "TRACE";
4751
4804
  })(LogLevel || (LogLevel = {}));
4805
+ /**
4806
+ * Error types emitted by embedded components.
4807
+ *
4808
+ * These enum values categorize different types of errors that can occur during
4809
+ * the lifecycle of an embedded ThoughtSpot component. Use these values to implement
4810
+ * specific error handling logic based on the error category.
4811
+ *
4812
+ * @see {@link EmbedErrorDetailsEvent} - The error event object structure
4813
+ * @see {@link EmbedEvent.Error} - The event that emits these errors
4814
+ * @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
4815
+ * @group Error Handling
4816
+ */
4817
+ var ErrorDetailsTypes;
4818
+ (function (ErrorDetailsTypes) {
4819
+ /** API call failure */
4820
+ ErrorDetailsTypes["API"] = "API";
4821
+ /** General validation error */
4822
+ ErrorDetailsTypes["VALIDATION_ERROR"] = "VALIDATION_ERROR";
4823
+ /** Network connectivity or request error */
4824
+ ErrorDetailsTypes["NETWORK"] = "NETWORK";
4825
+ })(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
4826
+ /**
4827
+ * Specific error codes for embedded component errors.
4828
+ *
4829
+ * These codes provide granular identification of errors that occur in embedded components.
4830
+ * They are returned in the {@link EmbedErrorDetailsEvent.code} property and allow for
4831
+ * precise error handling and debugging.
4832
+ *
4833
+ * The codes are organized into categories:
4834
+ * - **Worksheet ID not found or does not exist**: Errors related to applying or updating filters
4835
+ * - **Liveboard ID missing**: Errors related to missing liveboard ID
4836
+ * - **Conflicting actions configuration**: Errors related to conflicting actions configuration
4837
+ * - **Conflicting tabs configuration**: Errors related to conflicting tabs configuration
4838
+ * - **Initialization error**: Errors related to initialization error
4839
+ * - **Network error**: Errors related to network error
4840
+ * - **Custom action validation**: Errors related to custom action validation
4841
+ * - **Login failed**: Errors related to login failed
4842
+ * - **Render not called**: Errors related to render not called
4843
+ * - **Host event type undefined or invalid**: Errors related to host event type undefined or invalid
4844
+ *
4845
+ * @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
4846
+ * @group Error Handling
4847
+ * @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
4848
+ * @see {@link ErrorDetailsTypes} - General error type categories
4849
+ *
4850
+ * @example
4851
+ * Handle specific error codes
4852
+ *
4853
+ * embed.on(EmbedEvent.Error, (error) => {
4854
+ * if (error.code === EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND) {
4855
+ * console.error('Worksheet ID not found:', error.message);
4856
+ * }
4857
+ * });
4858
+ * */
4859
+ var EmbedErrorCodes;
4860
+ (function (EmbedErrorCodes) {
4861
+ /** Worksheet ID not found or does not exist */
4862
+ EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
4863
+ /** Required Liveboard ID is missing from configuration */
4864
+ EmbedErrorCodes["LIVEBOARD_ID_MISSING"] = "LIVEBOARD_ID_MISSING";
4865
+ /** Conflicting action configuration detected (e.g., both hiddenActions and visibleActions specified) */
4866
+ EmbedErrorCodes["CONFLICTING_ACTIONS_CONFIG"] = "CONFLICTING_ACTIONS_CONFIG";
4867
+ /** Conflicting tab configuration detected (e.g., both hiddenTabs and visibleTabs specified) */
4868
+ EmbedErrorCodes["CONFLICTING_TABS_CONFIG"] = "CONFLICTING_TABS_CONFIG";
4869
+ /** Error during component initialization */
4870
+ EmbedErrorCodes["INIT_ERROR"] = "INIT_ERROR";
4871
+ /** Network connectivity or request error */
4872
+ EmbedErrorCodes["NETWORK_ERROR"] = "NETWORK_ERROR";
4873
+ /** Custom action validation failed */
4874
+ EmbedErrorCodes["CUSTOM_ACTION_VALIDATION"] = "CUSTOM_ACTION_VALIDATION";
4875
+ /** Authentication/login failed */
4876
+ EmbedErrorCodes["LOGIN_FAILED"] = "LOGIN_FAILED";
4877
+ /** Render method was not called before attempting to use the component */
4878
+ EmbedErrorCodes["RENDER_NOT_CALLED"] = "RENDER_NOT_CALLED";
4879
+ /** Host event type is undefined or invalid */
4880
+ EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
4881
+ /** Error parsing api intercept body */
4882
+ EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
4883
+ })(EmbedErrorCodes || (EmbedErrorCodes = {}));
4752
4884
  /**
4753
4885
  * Enum for the type of API intercepted
4754
4886
  */
@@ -7562,6 +7694,13 @@ const ERROR_MESSAGE = {
7562
7694
  RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
7563
7695
  SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7564
7696
  OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
7697
+ INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
7698
+ CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
7699
+ CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
7700
+ RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
7701
+ HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
7702
+ LOGIN_FAILED: 'Login failed',
7703
+ ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
7565
7704
  };
7566
7705
  const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7567
7706
  INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
@@ -8471,7 +8610,7 @@ class AnswerService {
8471
8610
  async getTML() {
8472
8611
  const { object } = await this.executeQuery(getAnswerTML, {});
8473
8612
  const edoc = object[0].edoc;
8474
- const YAML = await import('./index-B2QPwxuL.js');
8613
+ const YAML = await import('./index-BXCUJ09L.js');
8475
8614
  const parsedDoc = YAML.parse(edoc);
8476
8615
  return {
8477
8616
  answer: {
@@ -17316,6 +17455,76 @@ if (typeof Promise.withResolvers === 'undefined') {
17316
17455
  };
17317
17456
  }
17318
17457
 
17458
+ /**
17459
+ * Reloads the ThoughtSpot iframe.
17460
+ * @param iFrame
17461
+ */
17462
+ const reload = (iFrame) => {
17463
+ const src = iFrame.src;
17464
+ iFrame.src = '';
17465
+ setTimeout(() => {
17466
+ iFrame.src = src;
17467
+ }, 100);
17468
+ };
17469
+ /**
17470
+ * Post iframe message.
17471
+ * @param iFrame
17472
+ * @param message
17473
+ * @param message.type
17474
+ * @param message.data
17475
+ * @param thoughtSpotHost
17476
+ * @param channel
17477
+ */
17478
+ function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
17479
+ var _a;
17480
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
17481
+ }
17482
+ const TRIGGER_TIMEOUT = 30000;
17483
+ /**
17484
+ *
17485
+ * @param iFrame
17486
+ * @param messageType
17487
+ * @param thoughtSpotHost
17488
+ * @param data
17489
+ */
17490
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17491
+ return new Promise((res, rej) => {
17492
+ var _a;
17493
+ if (messageType === HostEvent.Reload) {
17494
+ reload(iFrame);
17495
+ return res(null);
17496
+ }
17497
+ if (messageType === HostEvent.Present) {
17498
+ const embedConfig = getEmbedConfig();
17499
+ const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
17500
+ if (!disableFullscreenPresentation) {
17501
+ handlePresentEvent(iFrame);
17502
+ }
17503
+ else {
17504
+ logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
17505
+ }
17506
+ }
17507
+ const channel = new MessageChannel();
17508
+ channel.port1.onmessage = ({ data: responseData }) => {
17509
+ var _a;
17510
+ channel.port1.close();
17511
+ const error = responseData.error || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
17512
+ if (error) {
17513
+ rej(error);
17514
+ }
17515
+ else {
17516
+ res(responseData);
17517
+ }
17518
+ };
17519
+ // Close the messageChannel and resolve the promise if timeout.
17520
+ setTimeout(() => {
17521
+ channel.port1.close();
17522
+ res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17523
+ }, TRIGGER_TIMEOUT);
17524
+ return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17525
+ });
17526
+ }
17527
+
17319
17528
  /* eslint-disable camelcase */
17320
17529
  /* eslint-disable import/no-mutable-exports */
17321
17530
  /**
@@ -17654,77 +17863,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
17654
17863
  return eventData;
17655
17864
  }
17656
17865
 
17657
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17658
-
17659
- /**
17660
- * Reloads the ThoughtSpot iframe.
17661
- * @param iFrame
17662
- */
17663
- const reload = (iFrame) => {
17664
- const src = iFrame.src;
17665
- iFrame.src = '';
17666
- setTimeout(() => {
17667
- iFrame.src = src;
17668
- }, 100);
17669
- };
17670
- /**
17671
- * Post iframe message.
17672
- * @param iFrame
17673
- * @param message
17674
- * @param message.type
17675
- * @param message.data
17676
- * @param thoughtSpotHost
17677
- * @param channel
17678
- */
17679
- function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
17680
- var _a;
17681
- return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
17682
- }
17683
- const TRIGGER_TIMEOUT = 30000;
17684
- /**
17685
- *
17686
- * @param iFrame
17687
- * @param messageType
17688
- * @param thoughtSpotHost
17689
- * @param data
17690
- */
17691
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17692
- return new Promise((res, rej) => {
17693
- var _a;
17694
- if (messageType === HostEvent.Reload) {
17695
- reload(iFrame);
17696
- return res(null);
17697
- }
17698
- if (messageType === HostEvent.Present) {
17699
- const embedConfig = getEmbedConfig();
17700
- const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
17701
- if (!disableFullscreenPresentation) {
17702
- handlePresentEvent(iFrame);
17703
- }
17704
- else {
17705
- logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
17706
- }
17707
- }
17708
- const channel = new MessageChannel();
17709
- channel.port1.onmessage = ({ data: responseData }) => {
17710
- var _a;
17711
- channel.port1.close();
17712
- const error = responseData.error || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
17713
- if (error) {
17714
- rej(error);
17715
- }
17716
- else {
17717
- res(responseData);
17718
- }
17719
- };
17720
- // Close the messageChannel and resolve the promise if timeout.
17721
- setTimeout(() => {
17722
- channel.port1.close();
17723
- res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17724
- }, TRIGGER_TIMEOUT);
17725
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17726
- });
17727
- }
17866
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.1-test";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17728
17867
 
17729
17868
  class HostEventClient {
17730
17869
  constructor(iFrame) {
@@ -17922,9 +18061,13 @@ const handleInterceptEvent = async (params) => {
17922
18061
  const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
17923
18062
  const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
17924
18063
  if (bodyParseError) {
17925
- executeEvent(EmbedEvent.Error, {
17926
- error: 'Error parsing api intercept body',
17927
- });
18064
+ const errorDetails = {
18065
+ errorType: ErrorDetailsTypes.API,
18066
+ message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
18067
+ code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
18068
+ error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
18069
+ };
18070
+ executeEvent(EmbedEvent.Error, errorDetails);
17928
18071
  logger$3.error('Error parsing request body', bodyParseError);
17929
18072
  return;
17930
18073
  }
@@ -18236,19 +18379,23 @@ class TsEmbed {
18236
18379
  * Throws error encountered during initialization.
18237
18380
  */
18238
18381
  throwInitError() {
18239
- this.handleError('You need to init the ThoughtSpot SDK module first');
18382
+ this.handleError({
18383
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18384
+ message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
18385
+ code: EmbedErrorCodes.INIT_ERROR,
18386
+ error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
18387
+ });
18240
18388
  }
18241
18389
  /**
18242
18390
  * Handles errors within the SDK
18243
18391
  * @param error The error message or object
18392
+ * @param errorDetails The error details
18244
18393
  */
18245
- handleError(error) {
18394
+ handleError(errorDetails) {
18246
18395
  this.isError = true;
18247
- this.executeCallbacks(EmbedEvent.Error, {
18248
- error,
18249
- });
18396
+ this.executeCallbacks(EmbedEvent.Error, errorDetails);
18250
18397
  // Log error
18251
- logger$3.error(error);
18398
+ logger$3.error(errorDetails);
18252
18399
  }
18253
18400
  /**
18254
18401
  * Extracts the type field from the event payload
@@ -18327,11 +18474,14 @@ class TsEmbed {
18327
18474
  };
18328
18475
  window.addEventListener('online', onlineEventListener);
18329
18476
  const offlineEventListener = (e) => {
18330
- const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
18331
- this.executeCallbacks(EmbedEvent.Error, {
18332
- offlineWarning,
18333
- });
18334
- logger$3.warn(offlineWarning);
18477
+ const errorDetails = {
18478
+ errorType: ErrorDetailsTypes.NETWORK,
18479
+ message: ERROR_MESSAGE.OFFLINE_WARNING,
18480
+ code: EmbedErrorCodes.NETWORK_ERROR,
18481
+ offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
18482
+ };
18483
+ this.executeCallbacks(EmbedEvent.Error, errorDetails);
18484
+ logger$3.warn(errorDetails);
18335
18485
  };
18336
18486
  window.addEventListener('offline', offlineEventListener);
18337
18487
  this.subscribedListeners.online = onlineEventListener;
@@ -18411,8 +18561,10 @@ class TsEmbed {
18411
18561
  ]);
18412
18562
  if (customActionsResult.errors.length > 0) {
18413
18563
  this.handleError({
18414
- type: 'CUSTOM_ACTION_VALIDATION',
18564
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18415
18565
  message: customActionsResult.errors,
18566
+ code: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION,
18567
+ error: { type: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }
18416
18568
  });
18417
18569
  }
18418
18570
  const baseInitData = {
@@ -18509,11 +18661,21 @@ class TsEmbed {
18509
18661
  ...additionalFlagsFromView,
18510
18662
  };
18511
18663
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
18512
- this.handleError('You cannot have both hidden actions and visible actions');
18664
+ this.handleError({
18665
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18666
+ message: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
18667
+ code: EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG,
18668
+ error: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
18669
+ });
18513
18670
  return queryParams;
18514
18671
  }
18515
18672
  if (Array.isArray(visibleTabs) && Array.isArray(hiddenTabs)) {
18516
- this.handleError('You cannot have both hidden Tabs and visible Tabs');
18673
+ this.handleError({
18674
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18675
+ message: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
18676
+ code: EmbedErrorCodes.CONFLICTING_TABS_CONFIG,
18677
+ error: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
18678
+ });
18517
18679
  return queryParams;
18518
18680
  }
18519
18681
  if (primaryAction) {
@@ -18738,7 +18900,12 @@ class TsEmbed {
18738
18900
  error: JSON.stringify(error),
18739
18901
  });
18740
18902
  this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
18741
- this.handleError(error);
18903
+ this.handleError({
18904
+ errorType: ErrorDetailsTypes.API,
18905
+ message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
18906
+ code: EmbedErrorCodes.LOGIN_FAILED,
18907
+ error: error,
18908
+ });
18742
18909
  });
18743
18910
  });
18744
18911
  }
@@ -19043,11 +19210,21 @@ class TsEmbed {
19043
19210
  async trigger(messageType, data = {}) {
19044
19211
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
19045
19212
  if (!this.isRendered) {
19046
- this.handleError('Please call render before triggering events');
19213
+ this.handleError({
19214
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
19215
+ message: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
19216
+ code: EmbedErrorCodes.RENDER_NOT_CALLED,
19217
+ error: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
19218
+ });
19047
19219
  return null;
19048
19220
  }
19049
19221
  if (!messageType) {
19050
- this.handleError('Host event type is undefined');
19222
+ this.handleError({
19223
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
19224
+ message: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
19225
+ code: EmbedErrorCodes.HOST_EVENT_TYPE_UNDEFINED,
19226
+ error: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
19227
+ });
19051
19228
  return null;
19052
19229
  }
19053
19230
  // Check if iframe exists before triggering -
@@ -19860,7 +20037,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
19860
20037
  constructor(domSelector, viewConfig) {
19861
20038
  viewConfig.embedComponentType = 'AppEmbed';
19862
20039
  super(domSelector, viewConfig);
19863
- this.defaultHeight = '100%';
20040
+ this.defaultHeight = 500;
19864
20041
  this.sendFullHeightLazyLoadData = () => {
19865
20042
  const data = calculateVisibleElementData(this.iFrame);
19866
20043
  this.trigger(HostEvent.VisibleEmbedCoordinates, data);
@@ -19882,8 +20059,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
19882
20059
  * @param data The event payload
19883
20060
  */
19884
20061
  this.updateIFrameHeight = (data) => {
19885
- var _a;
19886
- this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
20062
+ this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
19887
20063
  this.sendFullHeightLazyLoadData();
19888
20064
  };
19889
20065
  this.embedIframeCenter = (data, responder) => {
@@ -19922,7 +20098,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
19922
20098
  * embedded Liveboard or visualization.
19923
20099
  */
19924
20100
  getEmbedParams() {
19925
- const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
20101
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, minimumHeight, } = this.viewConfig;
19926
20102
  let params = {};
19927
20103
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
19928
20104
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -19931,6 +20107,8 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
19931
20107
  params[Param.HideLiveboardHeader] = hideLiveboardHeader;
19932
20108
  params[Param.ShowLiveboardTitle] = showLiveboardTitle;
19933
20109
  params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
20110
+ params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
20111
+ params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
19934
20112
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
19935
20113
  params[Param.IsFullAppEmbed] = true;
19936
20114
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
@@ -20002,6 +20180,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
20002
20180
  if (isCentralizedLiveboardFilterUXEnabled != undefined) {
20003
20181
  params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
20004
20182
  }
20183
+ this.defaultHeight = minimumHeight || this.defaultHeight;
20005
20184
  params[Param.DataPanelV2Enabled] = dataPanelV2;
20006
20185
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
20007
20186
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -20356,7 +20535,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20356
20535
  getEmbedParamsObject() {
20357
20536
  let params = {};
20358
20537
  params = this.getBaseQueryParams(params);
20359
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
20538
+ const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
20360
20539
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
20361
20540
  || this.viewConfig.preventPinboardFilterRemoval;
20362
20541
  if (fullHeight === true) {
@@ -20366,9 +20545,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20366
20545
  params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
20367
20546
  }
20368
20547
  }
20369
- if (defaultHeight) {
20370
- this.defaultHeight = defaultHeight;
20371
- }
20548
+ this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
20372
20549
  if (enableVizTransformations !== undefined) {
20373
20550
  params[Param.EnableVizTransformations] = enableVizTransformations.toString();
20374
20551
  }
@@ -20435,6 +20612,8 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20435
20612
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
20436
20613
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
20437
20614
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
20615
+ params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
20616
+ params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
20438
20617
  params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
20439
20618
  params[Param.DataPanelV2Enabled] = dataPanelV2;
20440
20619
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
@@ -20466,7 +20645,12 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20466
20645
  const { vizId, activeTabId } = this.viewConfig;
20467
20646
  const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
20468
20647
  if (!liveboardId) {
20469
- this.handleError(ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION);
20648
+ this.handleError({
20649
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
20650
+ message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
20651
+ code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
20652
+ error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
20653
+ });
20470
20654
  }
20471
20655
  return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId)}`;
20472
20656
  }
@@ -21170,7 +21354,12 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
21170
21354
  getEmbedParamsObject() {
21171
21355
  const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
21172
21356
  if (!worksheetId) {
21173
- this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
21357
+ this.handleError({
21358
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
21359
+ message: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
21360
+ code: EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
21361
+ error: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
21362
+ });
21174
21363
  }
21175
21364
  const queryParams = this.getBaseQueryParams();
21176
21365
  queryParams[Param.SpotterEnabled] = true;