@thoughtspot/visual-embed-sdk 1.37.0 → 1.37.1-spotter-embed

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 (173) hide show
  1. package/cjs/package.json +3 -3
  2. package/cjs/src/auth.d.ts +9 -4
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +21 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/auth.spec.js +48 -0
  7. package/cjs/src/auth.spec.js.map +1 -1
  8. package/cjs/src/embed/app.d.ts +59 -0
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +13 -1
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +44 -0
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/bodyless-conversation.d.ts +39 -9
  15. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  16. package/cjs/src/embed/bodyless-conversation.js +32 -5
  17. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  18. package/cjs/src/embed/bodyless-conversation.spec.js +4 -4
  19. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  20. package/cjs/src/embed/conversation.d.ts +38 -11
  21. package/cjs/src/embed/conversation.d.ts.map +1 -1
  22. package/cjs/src/embed/conversation.js +28 -4
  23. package/cjs/src/embed/conversation.js.map +1 -1
  24. package/cjs/src/embed/conversation.spec.js +7 -7
  25. package/cjs/src/embed/conversation.spec.js.map +1 -1
  26. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  27. package/cjs/src/embed/ts-embed.js +4 -1
  28. package/cjs/src/embed/ts-embed.js.map +1 -1
  29. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  30. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  31. package/cjs/src/index.d.ts +3 -3
  32. package/cjs/src/index.d.ts.map +1 -1
  33. package/cjs/src/index.js +5 -3
  34. package/cjs/src/index.js.map +1 -1
  35. package/cjs/src/pages/embed-test.page.d.ts +8 -0
  36. package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
  37. package/cjs/src/pages/embed-test.page.js +20 -0
  38. package/cjs/src/pages/embed-test.page.js.map +1 -0
  39. package/cjs/src/pages/home.page.d.ts +6 -0
  40. package/cjs/src/pages/home.page.d.ts.map +1 -0
  41. package/cjs/src/pages/home.page.js +12 -0
  42. package/cjs/src/pages/home.page.js.map +1 -0
  43. package/cjs/src/pages/login.page.d.ts +15 -0
  44. package/cjs/src/pages/login.page.d.ts.map +1 -0
  45. package/cjs/src/pages/login.page.js +22 -0
  46. package/cjs/src/pages/login.page.js.map +1 -0
  47. package/cjs/src/react/all-types-export.d.ts +1 -1
  48. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  49. package/cjs/src/react/all-types-export.js +2 -1
  50. package/cjs/src/react/all-types-export.js.map +1 -1
  51. package/cjs/src/react/index.d.ts +24 -5
  52. package/cjs/src/react/index.d.ts.map +1 -1
  53. package/cjs/src/react/index.js +21 -4
  54. package/cjs/src/react/index.js.map +1 -1
  55. package/cjs/src/tests/auth.test.d.ts +1 -0
  56. package/cjs/src/tests/auth.test.d.ts.map +1 -0
  57. package/cjs/src/tests/auth.test.js +1 -0
  58. package/cjs/src/tests/auth.test.js.map +1 -0
  59. package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
  60. package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
  61. package/cjs/src/tests/e2e/auth.spec.js +54 -0
  62. package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
  63. package/cjs/src/types.d.ts +95 -3
  64. package/cjs/src/types.d.ts.map +1 -1
  65. package/cjs/src/types.js +79 -0
  66. package/cjs/src/types.js.map +1 -1
  67. package/cjs/src/utils/graphql/answerService/answerService.d.ts +35 -15
  68. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  69. package/cjs/src/utils/graphql/answerService/answerService.js +35 -15
  70. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  71. package/cjs/src/utils/processData.js +6 -4
  72. package/cjs/src/utils/processData.js.map +1 -1
  73. package/dist/index-Cj4BVGHL.js +7371 -0
  74. package/dist/index-DUaG1OG2.js +7447 -0
  75. package/dist/index-Fhk1V_Gw.js +7371 -0
  76. package/dist/index-OuiZF3zE.js +7371 -0
  77. package/dist/src/auth.d.ts +9 -4
  78. package/dist/src/auth.d.ts.map +1 -1
  79. package/dist/src/embed/app.d.ts +59 -0
  80. package/dist/src/embed/app.d.ts.map +1 -1
  81. package/dist/src/embed/bodyless-conversation.d.ts +39 -9
  82. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  83. package/dist/src/embed/conversation.d.ts +38 -11
  84. package/dist/src/embed/conversation.d.ts.map +1 -1
  85. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  86. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  87. package/dist/src/index.d.ts +3 -3
  88. package/dist/src/index.d.ts.map +1 -1
  89. package/dist/src/react/all-types-export.d.ts +1 -1
  90. package/dist/src/react/all-types-export.d.ts.map +1 -1
  91. package/dist/src/react/index.d.ts +24 -5
  92. package/dist/src/react/index.d.ts.map +1 -1
  93. package/dist/src/types.d.ts +95 -3
  94. package/dist/src/types.d.ts.map +1 -1
  95. package/dist/src/utils/graphql/answerService/answerService.d.ts +35 -15
  96. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  97. package/dist/tsembed-react.es.js +208 -31
  98. package/dist/tsembed-react.js +428 -174
  99. package/dist/tsembed.es.js +170 -32
  100. package/dist/tsembed.js +392 -176
  101. package/dist/visual-embed-sdk-react-full.d.ts +299 -47
  102. package/dist/visual-embed-sdk-react.d.ts +299 -47
  103. package/dist/visual-embed-sdk.d.ts +276 -43
  104. package/lib/package.json +3 -3
  105. package/lib/src/auth.d.ts +9 -4
  106. package/lib/src/auth.d.ts.map +1 -1
  107. package/lib/src/auth.js +21 -0
  108. package/lib/src/auth.js.map +1 -1
  109. package/lib/src/auth.spec.js +48 -0
  110. package/lib/src/auth.spec.js.map +1 -1
  111. package/lib/src/embed/app.d.ts +59 -0
  112. package/lib/src/embed/app.d.ts.map +1 -1
  113. package/lib/src/embed/app.js +13 -1
  114. package/lib/src/embed/app.js.map +1 -1
  115. package/lib/src/embed/app.spec.js +44 -0
  116. package/lib/src/embed/app.spec.js.map +1 -1
  117. package/lib/src/embed/bodyless-conversation.d.ts +39 -9
  118. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  119. package/lib/src/embed/bodyless-conversation.js +30 -4
  120. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  121. package/lib/src/embed/bodyless-conversation.spec.js +5 -5
  122. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  123. package/lib/src/embed/conversation.d.ts +38 -11
  124. package/lib/src/embed/conversation.d.ts.map +1 -1
  125. package/lib/src/embed/conversation.js +26 -3
  126. package/lib/src/embed/conversation.js.map +1 -1
  127. package/lib/src/embed/conversation.spec.js +8 -8
  128. package/lib/src/embed/conversation.spec.js.map +1 -1
  129. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  130. package/lib/src/embed/ts-embed.js +4 -1
  131. package/lib/src/embed/ts-embed.js.map +1 -1
  132. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  133. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  134. package/lib/src/index.d.ts +3 -3
  135. package/lib/src/index.d.ts.map +1 -1
  136. package/lib/src/index.js +3 -3
  137. package/lib/src/index.js.map +1 -1
  138. package/lib/src/react/all-types-export.d.ts +1 -1
  139. package/lib/src/react/all-types-export.d.ts.map +1 -1
  140. package/lib/src/react/all-types-export.js +1 -1
  141. package/lib/src/react/all-types-export.js.map +1 -1
  142. package/lib/src/react/index.d.ts +24 -5
  143. package/lib/src/react/index.d.ts.map +1 -1
  144. package/lib/src/react/index.js +21 -4
  145. package/lib/src/react/index.js.map +1 -1
  146. package/lib/src/types.d.ts +95 -3
  147. package/lib/src/types.d.ts.map +1 -1
  148. package/lib/src/types.js +79 -0
  149. package/lib/src/types.js.map +1 -1
  150. package/lib/src/utils/graphql/answerService/answerService.d.ts +35 -15
  151. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  152. package/lib/src/utils/graphql/answerService/answerService.js +35 -15
  153. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  154. package/lib/src/utils/processData.js +6 -4
  155. package/lib/src/utils/processData.js.map +1 -1
  156. package/lib/src/visual-embed-sdk.d.ts +278 -45
  157. package/package.json +3 -3
  158. package/src/auth.spec.ts +52 -0
  159. package/src/auth.ts +25 -3
  160. package/src/embed/app.spec.ts +64 -0
  161. package/src/embed/app.ts +80 -0
  162. package/src/embed/bodyless-conversation.spec.ts +6 -6
  163. package/src/embed/bodyless-conversation.ts +43 -8
  164. package/src/embed/conversation.spec.ts +16 -16
  165. package/src/embed/conversation.ts +42 -11
  166. package/src/embed/ts-embed.spec.ts +0 -2
  167. package/src/embed/ts-embed.ts +4 -0
  168. package/src/index.ts +8 -4
  169. package/src/react/all-types-export.ts +1 -0
  170. package/src/react/index.tsx +36 -10
  171. package/src/types.ts +99 -1
  172. package/src/utils/graphql/answerService/answerService.ts +35 -15
  173. package/src/utils/processData.ts +6 -6
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.37.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.37.1-spotter-embed */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -32,7 +32,7 @@
32
32
  }
33
33
  return false;
34
34
  };
35
- const merge = (...objects) => objects.reduce((result, current) => {
35
+ const merge$1 = (...objects) => objects.reduce((result, current) => {
36
36
  if (Array.isArray(current)) {
37
37
  throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
38
38
  }
@@ -41,19 +41,19 @@
41
41
  return;
42
42
  }
43
43
  if (Array.isArray(result[key]) && Array.isArray(current[key])) {
44
- result[key] = merge.options.mergeArrays
45
- ? merge.options.uniqueArrayItems
44
+ result[key] = merge$1.options.mergeArrays
45
+ ? merge$1.options.uniqueArrayItems
46
46
  ? Array.from(new Set(result[key].concat(current[key])))
47
47
  : [...result[key], ...current[key]]
48
48
  : current[key];
49
49
  }
50
50
  else if (isObject$1(result[key]) && isObject$1(current[key])) {
51
- result[key] = merge(result[key], current[key]);
51
+ result[key] = merge$1(result[key], current[key]);
52
52
  }
53
53
  else {
54
54
  result[key] =
55
55
  current[key] === undefined
56
- ? merge.options.allowUndefinedOverrides
56
+ ? merge$1.options.allowUndefinedOverrides
57
57
  ? current[key]
58
58
  : result[key]
59
59
  : current[key];
@@ -66,11 +66,11 @@
66
66
  mergeArrays: true,
67
67
  uniqueArrayItems: true,
68
68
  };
69
- merge.options = defaultOptions;
70
- merge.withOptions = (options, ...objects) => {
71
- merge.options = Object.assign(Object.assign({}, defaultOptions), options);
72
- const result = merge(...objects);
73
- merge.options = defaultOptions;
69
+ merge$1.options = defaultOptions;
70
+ merge$1.withOptions = (options, ...objects) => {
71
+ merge$1.options = Object.assign(Object.assign({}, defaultOptions), options);
72
+ const result = merge$1(...objects);
73
+ merge$1.options = defaultOptions;
74
74
  return result;
75
75
  };
76
76
 
@@ -271,7 +271,7 @@
271
271
  function getDOMNode(domSelector) {
272
272
  return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
273
273
  }
274
- const deepMerge = (target, source) => merge(target, source);
274
+ const deepMerge = (target, source) => merge$1(target, source);
275
275
  const getOperationNameFromQuery = (query) => {
276
276
  const regex = /(?:query|mutation)\s+(\w+)/;
277
277
  const matches = query.match(regex);
@@ -581,6 +581,18 @@
581
581
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
582
582
  */
583
583
  HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
584
+ /**
585
+ * Create new options in the insights left navigation,
586
+ * available when new navigation V3 is enabled.
587
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
588
+ */
589
+ HomeLeftNavItem["Create"] = "create";
590
+ /**
591
+ * Spotter option in the insights left navigation,
592
+ * available when new navigation V3 is enabled.
593
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
594
+ */
595
+ HomeLeftNavItem["Spotter"] = "spotter";
584
596
  })(exports.HomeLeftNavItem || (exports.HomeLeftNavItem = {}));
585
597
  /**
586
598
  * A map of the supported runtime filter operations
@@ -2663,8 +2675,17 @@
2663
2675
  /**
2664
2676
  * Get the Answer session for a Search or
2665
2677
  * Liveboard visualization.
2678
+ *
2679
+ * Note: This event is not typically used directly. Instead, use the
2680
+ * `getAnswerService()` method on the embed instance to get an AnswerService
2681
+ * object that provides a more convenient interface for working with answers.
2682
+ *
2666
2683
  * @example
2667
2684
  * ```js
2685
+ * // Preferred way to get an AnswerService
2686
+ * const service = await embed.getAnswerService();
2687
+ *
2688
+ * // Alternative direct usage (not recommended)
2668
2689
  * const {session} = await embed.trigger(
2669
2690
  * HostEvent.GetAnswerSession, {
2670
2691
  * vizId: '123', // For Liveboard Visualization.
@@ -2672,6 +2693,10 @@
2672
2693
  * ```
2673
2694
  * @example
2674
2695
  * ```js
2696
+ * // Preferred way to get an AnswerService
2697
+ * const service = await embed.getAnswerService();
2698
+ *
2699
+ * // Alternative direct usage (not recommended)
2675
2700
  * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
2676
2701
  * ```
2677
2702
  * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
@@ -2800,6 +2825,54 @@
2800
2825
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2801
2826
  */
2802
2827
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
2828
+ /**
2829
+ * Triggers the table visualization re-render with the updated data.
2830
+ * Includes the following properties:
2831
+ * @param - `columnDataLite` - an array of object containing the
2832
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2833
+ * payload.For example, { columnDataLite: []}`.
2834
+ */
2835
+ HostEvent["SpotterSearch"] = "SpotterSearch";
2836
+ /**
2837
+ * Triggers the table visualization re-render with the updated data.
2838
+ * Includes the following properties:
2839
+ * @param - `columnDataLite` - an array of object containing the
2840
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2841
+ * payload.For example, { columnDataLite: []}`.
2842
+ */
2843
+ HostEvent["EditLastPrompt"] = "EditLastPrompt";
2844
+ /**
2845
+ * Triggers the table visualization re-render with the updated data.
2846
+ * Includes the following properties:
2847
+ * @param - `columnDataLite` - an array of object containing the
2848
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2849
+ * payload.For example, { columnDataLite: []}`.
2850
+ */
2851
+ HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2852
+ /**
2853
+ * Triggers the table visualization re-render with the updated data.
2854
+ * Includes the following properties:
2855
+ * @param - `columnDataLite` - an array of object containing the
2856
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2857
+ * payload.For example, { columnDataLite: []}`.
2858
+ */
2859
+ HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
2860
+ /**
2861
+ * Triggers the table visualization re-render with the updated data.
2862
+ * Includes the following properties:
2863
+ * @param - `columnDataLite` - an array of object containing the
2864
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2865
+ * payload.For example, { columnDataLite: []}`.
2866
+ */
2867
+ HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
2868
+ /**
2869
+ * Triggers the table visualization re-render with the updated data.
2870
+ * Includes the following properties:
2871
+ * @param - `columnDataLite` - an array of object containing the
2872
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2873
+ * payload.For example, { columnDataLite: []}`.
2874
+ */
2875
+ HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
2803
2876
  })(exports.HostEvent || (exports.HostEvent = {}));
2804
2877
  /**
2805
2878
  * The different visual modes that the data sources panel within
@@ -2880,6 +2953,10 @@
2880
2953
  Param["ShowInsertToSlide"] = "insertInToSlide";
2881
2954
  Param["PrimaryNavHidden"] = "primaryNavHidden";
2882
2955
  Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
2956
+ Param["NavigationVersion"] = "navigationVersion";
2957
+ Param["HideHamburger"] = "hideHamburger";
2958
+ Param["HideObjectSearch"] = "hideObjectSearch";
2959
+ Param["HideNotification"] = "hideNotification";
2883
2960
  Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
2884
2961
  Param["HideOrgSwitcher"] = "orgSwitcherHidden";
2885
2962
  Param["IsSageEmbed"] = "isSageEmbed";
@@ -2936,6 +3013,8 @@
2936
3013
  Param["preAuthCache"] = "preAuthCache";
2937
3014
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2938
3015
  Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
3016
+ Param["PrimaryAction"] = "primaryAction";
3017
+ Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
2939
3018
  })(Param || (Param = {}));
2940
3019
  /**
2941
3020
  * ThoughtSpot application pages include actions and menu commands
@@ -7173,29 +7252,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
7173
7252
  OperationType["GetTableWithHeadlineData"] = "GetTableWithHeadlineData";
7174
7253
  })(OperationType || (OperationType = {}));
7175
7254
  /**
7176
- * Class representing the answer service provided with the
7177
- * custom action payload. This service could be used to run
7178
- * graphql queries in the context of the answer on which the
7179
- * custom action was triggered.
7255
+ * AnswerService provides a simple way to work with ThoughtSpot Answers.
7256
+ *
7257
+ * This service allows you to interact with ThoughtSpot Answers programmatically,
7258
+ * making it easy to customize visualizations, filter data, and extract insights
7259
+ * directly from your application.
7260
+ *
7261
+ * You can use this service to:
7262
+ * - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
7263
+ * - Apply filters to Answers (`addFilter`)
7264
+ * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
7265
+ * - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
7266
+ * - Run custom queries (`executeQuery`)
7267
+ * - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
7268
+ *
7180
7269
  * @example
7181
7270
  * ```js
7182
- * embed.on(EmbedEvent.CustomAction, e => {
7183
- * const underlying = await e.answerService.getUnderlyingDataForPoint([
7184
- * 'col name 1'
7185
- * ]);
7186
- * const data = await underlying.fetchData(0, 100);
7187
- * })
7271
+ * // Get the answer service
7272
+ * embed.on(EmbedEvent.Data, async (e) => {
7273
+ * const service = await embed.getAnswerService();
7274
+ *
7275
+ * // Add columns to the answer
7276
+ * await service.addColumnsByName(["Sales", "Region"]);
7277
+ *
7278
+ * // Get the data
7279
+ * const data = await service.fetchData();
7280
+ * console.log(data);
7281
+ * });
7188
7282
  * ```
7283
+ *
7189
7284
  * @example
7190
7285
  * ```js
7191
- * embed.on(EmbedEvent.Data, async (e) => {
7192
- * const service = await embed.getAnswerService();
7193
- * await service.addColumns([
7194
- * "<column guid>"
7286
+ * // Get data for a point in a visualization
7287
+ * embed.on(EmbedEvent.CustomAction, async (e) => {
7288
+ * const underlying = await e.answerService.getUnderlyingDataForPoint([
7289
+ * 'Product Name',
7290
+ * 'Sales Amount'
7195
7291
  * ]);
7196
- * console.log(await service.fetchData());
7292
+ *
7293
+ * const data = await underlying.fetchData(0, 100);
7294
+ * console.log(data);
7197
7295
  * });
7198
7296
  * ```
7297
+ *
7199
7298
  * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
7200
7299
  * @group Events
7201
7300
  */
@@ -14471,6 +14570,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14471
14570
  AuthFailureType["EXPIRY"] = "EXPIRY";
14472
14571
  AuthFailureType["OTHER"] = "OTHER";
14473
14572
  AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
14573
+ AuthFailureType["UNAUTHENTICATED_FAILURE"] = "UNAUTHENTICATED_FAILURE";
14474
14574
  })(exports.AuthFailureType || (exports.AuthFailureType = {}));
14475
14575
  /**
14476
14576
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -14506,6 +14606,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14506
14606
  * @version SDK: 1.19.0
14507
14607
  */
14508
14608
  AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
14609
+ /**
14610
+ * Emitted when the SAML popup is closed without authentication
14611
+ */
14612
+ AuthStatus["SAML_POPUP_CLOSED_NO_AUTH"] = "SAML_POPUP_CLOSED_NO_AUTH";
14509
14613
  })(exports.AuthStatus || (exports.AuthStatus = {}));
14510
14614
  /**
14511
14615
  * Events which can be triggered on the emitter returned from {@link init}.
@@ -14726,14 +14830,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14726
14830
  * @param triggerText
14727
14831
  */
14728
14832
  async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
14833
+ let popupClosedCheck;
14729
14834
  const openPopup = () => {
14730
14835
  if (samlAuthWindow === null || samlAuthWindow.closed) {
14731
14836
  samlAuthWindow = window.open(ssoURL, '_blank', 'location=no,height=570,width=520,scrollbars=yes,status=yes');
14837
+ if (samlAuthWindow) {
14838
+ popupClosedCheck = setInterval(() => {
14839
+ if (samlAuthWindow.closed) {
14840
+ clearInterval(popupClosedCheck);
14841
+ if (samlCompletionPromise && !samlCompletionResolved) {
14842
+ authEE === null || authEE === void 0 ? void 0 : authEE.emit(exports.AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
14843
+ }
14844
+ }
14845
+ }, 500);
14846
+ }
14732
14847
  }
14733
14848
  else {
14734
14849
  samlAuthWindow.focus();
14735
14850
  }
14736
14851
  };
14852
+ let samlCompletionResolved = false;
14737
14853
  authEE === null || authEE === void 0 ? void 0 : authEE.emit(exports.AuthStatus.WAITING_FOR_POPUP);
14738
14854
  const containerEl = getDOMNode(triggerContainer);
14739
14855
  if (containerEl) {
@@ -14745,6 +14861,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14745
14861
  samlCompletionPromise = samlCompletionPromise || new Promise((resolve, reject) => {
14746
14862
  window.addEventListener('message', (e) => {
14747
14863
  if (e.data.type === exports.EmbedEvent.SAMLComplete) {
14864
+ samlCompletionResolved = true;
14865
+ if (popupClosedCheck) {
14866
+ clearInterval(popupClosedCheck);
14867
+ }
14748
14868
  e.source.close();
14749
14869
  resolve();
14750
14870
  }
@@ -15250,15 +15370,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15250
15370
  * @param containerEl
15251
15371
  */
15252
15372
  function processAuthFailure(e, containerEl) {
15373
+ var _a;
15253
15374
  const { loginFailedMessage, authType, disableLoginFailurePage, autoLogin, } = getEmbedConfig();
15254
- if (autoLogin
15255
- && (authType === exports.AuthType.TrustedAuthToken
15256
- || authType === exports.AuthType.TrustedAuthTokenCookieless)) {
15375
+ const isEmbeddedSSO = authType === exports.AuthType.EmbeddedSSO;
15376
+ const isTrustedAuth = authType === exports.AuthType.TrustedAuthToken || authType === exports.AuthType.TrustedAuthTokenCookieless;
15377
+ const isEmbeddedSSOInfoFailure = isEmbeddedSSO && ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.type) === exports.AuthFailureType.UNAUTHENTICATED_FAILURE;
15378
+ if (autoLogin && isTrustedAuth) {
15257
15379
  // eslint-disable-next-line no-param-reassign
15258
15380
  containerEl.innerHTML = loginFailedMessage;
15259
15381
  notifyAuthFailure(exports.AuthFailureType.IDLE_SESSION_TIMEOUT);
15260
15382
  }
15261
- else if (authType !== exports.AuthType.None && !disableLoginFailurePage) {
15383
+ else if (authType !== exports.AuthType.None && !disableLoginFailurePage && !isEmbeddedSSOInfoFailure) {
15262
15384
  // eslint-disable-next-line no-param-reassign
15263
15385
  containerEl.innerHTML = loginFailedMessage;
15264
15386
  notifyAuthFailure(exports.AuthFailureType.OTHER);
@@ -15303,7 +15425,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15303
15425
  return e;
15304
15426
  }
15305
15427
 
15306
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};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$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15428
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.1-spotter-embed";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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15307
15429
 
15308
15430
  /**
15309
15431
  * Reloads the ThoughtSpot iframe.
@@ -15840,7 +15962,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15840
15962
  if (this.embedConfig.currencyFormat) {
15841
15963
  queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
15842
15964
  }
15843
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, } = this.viewConfig;
15965
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, primaryAction, } = this.viewConfig;
15844
15966
  const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
15845
15967
  const additionalFlags = {
15846
15968
  ...additionalFlagsFromInit,
@@ -15854,6 +15976,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15854
15976
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
15855
15977
  return queryParams;
15856
15978
  }
15979
+ if (primaryAction) {
15980
+ queryParams[Param.PrimaryAction] = primaryAction;
15981
+ }
15857
15982
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
15858
15983
  queryParams[Param.DisableActions] = disabledActions;
15859
15984
  }
@@ -16746,7 +16871,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16746
16871
  * embedded Liveboard or visualization.
16747
16872
  */
16748
16873
  getEmbedParams() {
16749
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
16874
+ const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, modularHomeExperienceV3 = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
16750
16875
  /* eslint-disable-next-line max-len */
16751
16876
  dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
16752
16877
  let params = {};
@@ -16765,6 +16890,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16765
16890
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
16766
16891
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
16767
16892
  params = this.getBaseQueryParams(params);
16893
+ if (modularHomeExperienceV3) {
16894
+ params[Param.NavigationVersion] = 'v3';
16895
+ }
16896
+ if (hideObjectSearch) {
16897
+ params[Param.HideObjectSearch] = !!hideObjectSearch;
16898
+ }
16899
+ if (hideHamburger) {
16900
+ params[Param.HideHamburger] = !!hideHamburger;
16901
+ }
16902
+ if (hideNotification) {
16903
+ params[Param.HideNotification] = !!hideNotification;
16904
+ }
16768
16905
  if (fullHeight === true) {
16769
16906
  params[Param.fullHeight] = true;
16770
16907
  }
@@ -17900,6 +18037,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17900
18037
  const path = 'conv-assist-answer';
17901
18038
  const queryParams = this.getBaseQueryParams();
17902
18039
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18040
+ queryParams[Param.isSpotterAgentEmbed] = true;
17903
18041
  let query = '';
17904
18042
  const queryParamsString = getQueryParamString(queryParams, true);
17905
18043
  if (queryParamsString) {
@@ -17925,9 +18063,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17925
18063
  * chatbots or other conversational interfaces.
17926
18064
  * @example
17927
18065
  * ```js
17928
- * import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
18066
+ * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
17929
18067
  *
17930
- * const conversation = new BodylessConversation({
18068
+ * const conversation = new SpotterAgentEmbed({
17931
18069
  * worksheetId: 'worksheetId',
17932
18070
  * });
17933
18071
  *
@@ -17937,9 +18075,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17937
18075
  * document.body.appendChild(container); // or to any other element
17938
18076
  * ```
17939
18077
  * @group Embed components
17940
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
18078
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
17941
18079
  */
17942
- class BodylessConversation {
18080
+ class SpotterAgentEmbed {
17943
18081
  constructor(viewConfig) {
17944
18082
  this.viewConfig = viewConfig;
17945
18083
  const embedConfig = getEmbedConfig();
@@ -17991,7 +18129,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17991
18129
  * @group Embed components
17992
18130
  * @example
17993
18131
  * ```js
17994
- * const conversation = new ConversationEmbed('#tsEmbed', {
18132
+ * const conversation = new SpotterEmbed('#tsEmbed', {
17995
18133
  * worksheetId: 'worksheetId',
17996
18134
  * searchOptions: {
17997
18135
  * searchQuery: 'searchQuery',
@@ -17999,9 +18137,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17999
18137
  * });
18000
18138
  * conversation.render();
18001
18139
  * ```
18002
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
18140
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18003
18141
  */
18004
- class ConversationEmbed extends TsEmbed {
18142
+ class SpotterEmbed extends TsEmbed {
18005
18143
  constructor(container, viewConfig) {
18006
18144
  viewConfig.embedComponentType = 'conversation';
18007
18145
  super(container, viewConfig);
@@ -19107,8 +19245,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
19107
19245
  return {
19108
19246
  onAnchor: (source) => {
19109
19247
  aliasObjects.push(source);
19110
- if (!prevAnchors)
19111
- prevAnchors = anchorNames(doc);
19248
+ prevAnchors ?? (prevAnchors = anchorNames(doc));
19112
19249
  const anchor = findNewAnchor(prefix, prevAnchors);
19113
19250
  prevAnchors.add(anchor);
19114
19251
  return anchor;
@@ -19272,23 +19409,36 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
19272
19409
  * Resolve the value of this alias within `doc`, finding the last
19273
19410
  * instance of the `source` anchor before this node.
19274
19411
  */
19275
- resolve(doc) {
19412
+ resolve(doc, ctx) {
19413
+ let nodes;
19414
+ if (ctx?.aliasResolveCache) {
19415
+ nodes = ctx.aliasResolveCache;
19416
+ }
19417
+ else {
19418
+ nodes = [];
19419
+ visit$1(doc, {
19420
+ Node: (_key, node) => {
19421
+ if (isAlias(node) || hasAnchor(node))
19422
+ nodes.push(node);
19423
+ }
19424
+ });
19425
+ if (ctx)
19426
+ ctx.aliasResolveCache = nodes;
19427
+ }
19276
19428
  let found = undefined;
19277
- visit$1(doc, {
19278
- Node: (_key, node) => {
19279
- if (node === this)
19280
- return visit$1.BREAK;
19281
- if (node.anchor === this.source)
19282
- found = node;
19283
- }
19284
- });
19429
+ for (const node of nodes) {
19430
+ if (node === this)
19431
+ break;
19432
+ if (node.anchor === this.source)
19433
+ found = node;
19434
+ }
19285
19435
  return found;
19286
19436
  }
19287
19437
  toJSON(_arg, ctx) {
19288
19438
  if (!ctx)
19289
19439
  return { source: this.source };
19290
19440
  const { anchors, doc, maxAliasCount } = ctx;
19291
- const source = this.resolve(doc);
19441
+ const source = this.resolve(doc, ctx);
19292
19442
  if (!source) {
19293
19443
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
19294
19444
  throw new ReferenceError(msg);
@@ -19407,8 +19557,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
19407
19557
  if (aliasDuplicateObjects && value && typeof value === 'object') {
19408
19558
  ref = sourceObjects.get(value);
19409
19559
  if (ref) {
19410
- if (!ref.anchor)
19411
- ref.anchor = onAnchor(value);
19560
+ ref.anchor ?? (ref.anchor = onAnchor(value));
19412
19561
  return new Alias(ref.anchor);
19413
19562
  }
19414
19563
  else {
@@ -19979,23 +20128,32 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
19979
20128
  start = start.replace(/\n+/g, `$&${indent}`);
19980
20129
  }
19981
20130
  const indentSize = indent ? '2' : '1'; // root is at -1
19982
- let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
20131
+ // Leading | or > is added later
20132
+ let header = (startWithSpace ? indentSize : '') + chomp;
19983
20133
  if (comment) {
19984
20134
  header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
19985
20135
  if (onComment)
19986
20136
  onComment();
19987
20137
  }
19988
- if (literal) {
19989
- value = value.replace(/\n+/g, `$&${indent}`);
19990
- return `${header}\n${indent}${start}${value}${end}`;
20138
+ if (!literal) {
20139
+ const foldedValue = value
20140
+ .replace(/\n+/g, '\n$&')
20141
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
20142
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
20143
+ .replace(/\n+/g, `$&${indent}`);
20144
+ let literalFallback = false;
20145
+ const foldOptions = getFoldOptions(ctx, true);
20146
+ if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
20147
+ foldOptions.onOverflow = () => {
20148
+ literalFallback = true;
20149
+ };
20150
+ }
20151
+ const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
20152
+ if (!literalFallback)
20153
+ return `>${header}\n${indent}${body}`;
19991
20154
  }
19992
- value = value
19993
- .replace(/\n+/g, '\n$&')
19994
- .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
19995
- // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
19996
- .replace(/\n+/g, `$&${indent}`);
19997
- const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
19998
- return `${header}\n${indent}${body}`;
20155
+ value = value.replace(/\n+/g, `$&${indent}`);
20156
+ return `|${header}\n${indent}${start}${value}${end}`;
19999
20157
  }
20000
20158
  function plainString(item, ctx, onComment, onChompKeep) {
20001
20159
  const { type, value } = item;
@@ -20004,10 +20162,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20004
20162
  (inFlow && /[[\]{},]/.test(value))) {
20005
20163
  return quotedString(value, ctx);
20006
20164
  }
20007
- if (!value ||
20008
- /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
20165
+ if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
20009
20166
  // not allowed:
20010
- // - empty string, '-' or '?'
20167
+ // - '-' or '?'
20011
20168
  // - start with an indicator character (except [?:-]) or /[?-] /
20012
20169
  // - '\n ', ': ' or ' \n' anywhere
20013
20170
  // - '#' not preceded by a non-space char
@@ -20136,7 +20293,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20136
20293
  let obj;
20137
20294
  if (isScalar$1(item)) {
20138
20295
  obj = item.value;
20139
- const match = tags.filter(t => t.identify?.(obj));
20296
+ let match = tags.filter(t => t.identify?.(obj));
20297
+ if (match.length > 1) {
20298
+ const testMatch = match.filter(t => t.test);
20299
+ if (testMatch.length > 0)
20300
+ match = testMatch;
20301
+ }
20140
20302
  tagObj =
20141
20303
  match.find(t => t.format === item.format) ?? match.find(t => !t.format);
20142
20304
  }
@@ -20145,7 +20307,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20145
20307
  tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
20146
20308
  }
20147
20309
  if (!tagObj) {
20148
- const name = obj?.constructor?.name ?? typeof obj;
20310
+ const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj);
20149
20311
  throw new Error(`Tag not resolved for ${name} value`);
20150
20312
  }
20151
20313
  return tagObj;
@@ -20160,7 +20322,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20160
20322
  anchors.add(anchor);
20161
20323
  props.push(`&${anchor}`);
20162
20324
  }
20163
- const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
20325
+ const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
20164
20326
  if (tag)
20165
20327
  props.push(doc.directives.tagString(tag));
20166
20328
  return props.join(' ');
@@ -20186,8 +20348,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20186
20348
  const node = isNode(item)
20187
20349
  ? item
20188
20350
  : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
20189
- if (!tagObj)
20190
- tagObj = getTagObject(ctx.doc.schema.tags, node);
20351
+ tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
20191
20352
  const props = stringifyProps(node, tagObj, ctx);
20192
20353
  if (props.length > 0)
20193
20354
  ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
@@ -20349,54 +20510,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20349
20510
 
20350
20511
  function warn(logLevel, warning) {
20351
20512
  if (logLevel === 'debug' || logLevel === 'warn') {
20352
- if (typeof process !== 'undefined' && process.emitWarning)
20353
- process.emitWarning(warning);
20354
- else
20355
- console.warn(warning);
20513
+ console.warn(warning);
20356
20514
  }
20357
20515
  }
20358
20516
 
20359
- const MERGE_KEY = '<<';
20360
- function addPairToJSMap(ctx, map, { key, value }) {
20361
- if (ctx?.doc.schema.merge && isMergeKey(key)) {
20362
- value = isAlias(value) ? value.resolve(ctx.doc) : value;
20363
- if (isSeq(value))
20364
- for (const it of value.items)
20365
- mergeToJSMap(ctx, map, it);
20366
- else if (Array.isArray(value))
20367
- for (const it of value)
20368
- mergeToJSMap(ctx, map, it);
20369
- else
20370
- mergeToJSMap(ctx, map, value);
20371
- }
20372
- else {
20373
- const jsKey = toJS(key, '', ctx);
20374
- if (map instanceof Map) {
20375
- map.set(jsKey, toJS(value, jsKey, ctx));
20376
- }
20377
- else if (map instanceof Set) {
20378
- map.add(jsKey);
20379
- }
20380
- else {
20381
- const stringKey = stringifyKey(key, jsKey, ctx);
20382
- const jsValue = toJS(value, stringKey, ctx);
20383
- if (stringKey in map)
20384
- Object.defineProperty(map, stringKey, {
20385
- value: jsValue,
20386
- writable: true,
20387
- enumerable: true,
20388
- configurable: true
20389
- });
20390
- else
20391
- map[stringKey] = jsValue;
20392
- }
20393
- }
20394
- return map;
20395
- }
20396
- const isMergeKey = (key) => key === MERGE_KEY ||
20397
- (isScalar$1(key) &&
20398
- key.value === MERGE_KEY &&
20399
- (!key.type || key.type === Scalar.PLAIN));
20400
20517
  // If the value associated with a merge key is a single mapping node, each of
20401
20518
  // its key/value pairs is inserted into the current mapping, unless the key
20402
20519
  // already exists in it. If the value associated with the merge key is a
@@ -20404,7 +20521,35 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20404
20521
  // of these nodes is merged in turn according to its order in the sequence.
20405
20522
  // Keys in mapping nodes earlier in the sequence override keys specified in
20406
20523
  // later mapping nodes. -- http://yaml.org/type/merge.html
20407
- function mergeToJSMap(ctx, map, value) {
20524
+ const MERGE_KEY = '<<';
20525
+ const merge = {
20526
+ identify: value => value === MERGE_KEY ||
20527
+ (typeof value === 'symbol' && value.description === MERGE_KEY),
20528
+ default: 'key',
20529
+ tag: 'tag:yaml.org,2002:merge',
20530
+ test: /^<<$/,
20531
+ resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
20532
+ addToJSMap: addMergeToJSMap
20533
+ }),
20534
+ stringify: () => MERGE_KEY
20535
+ };
20536
+ const isMergeKey = (ctx, key) => (merge.identify(key) ||
20537
+ (isScalar$1(key) &&
20538
+ (!key.type || key.type === Scalar.PLAIN) &&
20539
+ merge.identify(key.value))) &&
20540
+ ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
20541
+ function addMergeToJSMap(ctx, map, value) {
20542
+ value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
20543
+ if (isSeq(value))
20544
+ for (const it of value.items)
20545
+ mergeValue(ctx, map, it);
20546
+ else if (Array.isArray(value))
20547
+ for (const it of value)
20548
+ mergeValue(ctx, map, it);
20549
+ else
20550
+ mergeValue(ctx, map, value);
20551
+ }
20552
+ function mergeValue(ctx, map, value) {
20408
20553
  const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
20409
20554
  if (!isMap(source))
20410
20555
  throw new Error('Merge sources must be maps or map aliases');
@@ -20428,9 +20573,41 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20428
20573
  }
20429
20574
  return map;
20430
20575
  }
20576
+
20577
+ function addPairToJSMap(ctx, map, { key, value }) {
20578
+ if (isNode(key) && key.addToJSMap)
20579
+ key.addToJSMap(ctx, map, value);
20580
+ // TODO: Should drop this special case for bare << handling
20581
+ else if (isMergeKey(ctx, key))
20582
+ addMergeToJSMap(ctx, map, value);
20583
+ else {
20584
+ const jsKey = toJS(key, '', ctx);
20585
+ if (map instanceof Map) {
20586
+ map.set(jsKey, toJS(value, jsKey, ctx));
20587
+ }
20588
+ else if (map instanceof Set) {
20589
+ map.add(jsKey);
20590
+ }
20591
+ else {
20592
+ const stringKey = stringifyKey(key, jsKey, ctx);
20593
+ const jsValue = toJS(value, stringKey, ctx);
20594
+ if (stringKey in map)
20595
+ Object.defineProperty(map, stringKey, {
20596
+ value: jsValue,
20597
+ writable: true,
20598
+ enumerable: true,
20599
+ configurable: true
20600
+ });
20601
+ else
20602
+ map[stringKey] = jsValue;
20603
+ }
20604
+ }
20605
+ return map;
20606
+ }
20431
20607
  function stringifyKey(key, jsKey, ctx) {
20432
20608
  if (jsKey === null)
20433
20609
  return '';
20610
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
20434
20611
  if (typeof jsKey !== 'object')
20435
20612
  return String(jsKey);
20436
20613
  if (isNode(key) && ctx?.doc) {
@@ -21063,7 +21240,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21063
21240
  identify: value => typeof value === 'boolean',
21064
21241
  default: true,
21065
21242
  tag: 'tag:yaml.org,2002:bool',
21066
- test: /^true|false$/,
21243
+ test: /^true$|^false$/,
21067
21244
  resolve: str => str === 'true',
21068
21245
  stringify: stringifyJSON
21069
21246
  },
@@ -21108,10 +21285,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21108
21285
  * document.querySelector('#photo').src = URL.createObjectURL(blob)
21109
21286
  */
21110
21287
  resolve(src, onError) {
21111
- if (typeof Buffer === 'function') {
21112
- return Buffer.from(src, 'base64');
21113
- }
21114
- else if (typeof atob === 'function') {
21288
+ if (typeof atob === 'function') {
21115
21289
  // On IE 11, atob() can't handle newlines
21116
21290
  const str = atob(src.replace(/[\n\r]/g, ''));
21117
21291
  const buffer = new Uint8Array(str.length);
@@ -21125,15 +21299,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21125
21299
  }
21126
21300
  },
21127
21301
  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
21302
+ if (!value)
21303
+ return '';
21128
21304
  const buf = value; // checked earlier by binary.identify()
21129
21305
  let str;
21130
- if (typeof Buffer === 'function') {
21131
- str =
21132
- buf instanceof Buffer
21133
- ? buf.toString('base64')
21134
- : Buffer.from(buf.buffer).toString('base64');
21135
- }
21136
- else if (typeof btoa === 'function') {
21306
+ if (typeof btoa === 'function') {
21137
21307
  let s = '';
21138
21308
  for (let i = 0; i < buf.length; ++i)
21139
21309
  s += String.fromCharCode(buf[i]);
@@ -21142,8 +21312,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21142
21312
  else {
21143
21313
  throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
21144
21314
  }
21145
- if (!type)
21146
- type = Scalar.BLOCK_LITERAL;
21315
+ type ?? (type = Scalar.BLOCK_LITERAL);
21147
21316
  if (type !== Scalar.QUOTE_DOUBLE) {
21148
21317
  const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
21149
21318
  const n = Math.ceil(str.length / lineWidth);
@@ -21612,7 +21781,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21612
21781
  }
21613
21782
  return new Date(date);
21614
21783
  },
21615
- stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
21784
+ stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
21616
21785
  };
21617
21786
 
21618
21787
  const schema = [
@@ -21630,6 +21799,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21630
21799
  floatExp,
21631
21800
  float,
21632
21801
  binary,
21802
+ merge,
21633
21803
  omap,
21634
21804
  pairs,
21635
21805
  set,
@@ -21657,6 +21827,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21657
21827
  intOct: intOct$1,
21658
21828
  intTime,
21659
21829
  map,
21830
+ merge,
21660
21831
  null: nullTag,
21661
21832
  omap,
21662
21833
  pairs,
@@ -21666,13 +21837,20 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21666
21837
  };
21667
21838
  const coreKnownTags = {
21668
21839
  'tag:yaml.org,2002:binary': binary,
21840
+ 'tag:yaml.org,2002:merge': merge,
21669
21841
  'tag:yaml.org,2002:omap': omap,
21670
21842
  'tag:yaml.org,2002:pairs': pairs,
21671
21843
  'tag:yaml.org,2002:set': set,
21672
21844
  'tag:yaml.org,2002:timestamp': timestamp
21673
21845
  };
21674
- function getTags(customTags, schemaName) {
21675
- let tags = schemas.get(schemaName);
21846
+ function getTags(customTags, schemaName, addMergeTag) {
21847
+ const schemaTags = schemas.get(schemaName);
21848
+ if (schemaTags && !customTags) {
21849
+ return addMergeTag && !schemaTags.includes(merge)
21850
+ ? schemaTags.concat(merge)
21851
+ : schemaTags.slice();
21852
+ }
21853
+ let tags = schemaTags;
21676
21854
  if (!tags) {
21677
21855
  if (Array.isArray(customTags))
21678
21856
  tags = [];
@@ -21691,17 +21869,21 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21691
21869
  else if (typeof customTags === 'function') {
21692
21870
  tags = customTags(tags.slice());
21693
21871
  }
21694
- return tags.map(tag => {
21695
- if (typeof tag !== 'string')
21696
- return tag;
21697
- const tagObj = tagsByName[tag];
21698
- if (tagObj)
21699
- return tagObj;
21700
- const keys = Object.keys(tagsByName)
21701
- .map(key => JSON.stringify(key))
21702
- .join(', ');
21703
- throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
21704
- });
21872
+ if (addMergeTag)
21873
+ tags = tags.concat(merge);
21874
+ return tags.reduce((tags, tag) => {
21875
+ const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
21876
+ if (!tagObj) {
21877
+ const tagName = JSON.stringify(tag);
21878
+ const keys = Object.keys(tagsByName)
21879
+ .map(key => JSON.stringify(key))
21880
+ .join(', ');
21881
+ throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
21882
+ }
21883
+ if (!tags.includes(tagObj))
21884
+ tags.push(tagObj);
21885
+ return tags;
21886
+ }, []);
21705
21887
  }
21706
21888
 
21707
21889
  const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
@@ -21712,10 +21894,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21712
21894
  : compat
21713
21895
  ? getTags(null, compat)
21714
21896
  : null;
21715
- this.merge = !!merge;
21716
21897
  this.name = (typeof schema === 'string' && schema) || 'core';
21717
21898
  this.knownTags = resolveKnownTags ? coreKnownTags : {};
21718
- this.tags = getTags(customTags, this.name);
21899
+ this.tags = getTags(customTags, this.name, merge);
21719
21900
  this.toStringOptions = toStringDefaults ?? null;
21720
21901
  Object.defineProperty(this, MAP, { value: map });
21721
21902
  Object.defineProperty(this, SCALAR$1, { value: string });
@@ -21840,6 +22021,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21840
22021
  logLevel: 'warn',
21841
22022
  prettyErrors: true,
21842
22023
  strict: true,
22024
+ stringKeys: false,
21843
22025
  uniqueKeys: true,
21844
22026
  version: '1.2'
21845
22027
  }, options);
@@ -22063,7 +22245,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22063
22245
  this.directives.yaml.version = '1.1';
22064
22246
  else
22065
22247
  this.directives = new Directives({ version: '1.1' });
22066
- opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
22248
+ opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
22067
22249
  break;
22068
22250
  case '1.2':
22069
22251
  case 'next':
@@ -22071,7 +22253,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22071
22253
  this.directives.yaml.version = version;
22072
22254
  else
22073
22255
  this.directives = new Directives({ version });
22074
- opt = { merge: false, resolveKnownTags: true, schema: 'core' };
22256
+ opt = { resolveKnownTags: true, schema: 'core' };
22075
22257
  break;
22076
22258
  case null:
22077
22259
  if (this.directives)
@@ -22249,7 +22431,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22249
22431
  if (atNewline) {
22250
22432
  if (comment)
22251
22433
  comment += token.source;
22252
- else
22434
+ else if (!found || indicator !== 'seq-item-ind')
22253
22435
  spaceBefore = true;
22254
22436
  }
22255
22437
  else
@@ -22266,8 +22448,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22266
22448
  if (token.source.endsWith(':'))
22267
22449
  onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
22268
22450
  anchor = token;
22269
- if (start === null)
22270
- start = token.offset;
22451
+ start ?? (start = token.offset);
22271
22452
  atNewline = false;
22272
22453
  hasSpace = false;
22273
22454
  reqSpace = true;
@@ -22276,8 +22457,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22276
22457
  if (tag)
22277
22458
  onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
22278
22459
  tag = token;
22279
- if (start === null)
22280
- start = token.offset;
22460
+ start ?? (start = token.offset);
22281
22461
  atNewline = false;
22282
22462
  hasSpace = false;
22283
22463
  reqSpace = true;
@@ -22390,11 +22570,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22390
22570
  return false;
22391
22571
  const isEqual = typeof uniqueKeys === 'function'
22392
22572
  ? uniqueKeys
22393
- : (a, b) => a === b ||
22394
- (isScalar$1(a) &&
22395
- isScalar$1(b) &&
22396
- a.value === b.value &&
22397
- !(a.value === '<<' && ctx.schema.merge));
22573
+ : (a, b) => a === b || (isScalar$1(a) && isScalar$1(b) && a.value === b.value);
22398
22574
  return items.some(pair => isEqual(pair.key, search));
22399
22575
  }
22400
22576
 
@@ -22443,12 +22619,14 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22443
22619
  onError(offset, 'BAD_INDENT', startColMsg);
22444
22620
  }
22445
22621
  // key value
22622
+ ctx.atKey = true;
22446
22623
  const keyStart = keyProps.end;
22447
22624
  const keyNode = key
22448
22625
  ? composeNode(ctx, key, keyProps, onError)
22449
22626
  : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
22450
22627
  if (ctx.schema.compat)
22451
22628
  flowIndentCheck(bm.indent, key, onError);
22629
+ ctx.atKey = false;
22452
22630
  if (mapIncludes(ctx, map.items, keyNode))
22453
22631
  onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
22454
22632
  // value properties
@@ -22508,6 +22686,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22508
22686
  const seq = new NodeClass(ctx.schema);
22509
22687
  if (ctx.atRoot)
22510
22688
  ctx.atRoot = false;
22689
+ if (ctx.atKey)
22690
+ ctx.atKey = false;
22511
22691
  let offset = bs.offset;
22512
22692
  let commentEnd = null;
22513
22693
  for (const { start, value } of bs.items) {
@@ -22592,6 +22772,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22592
22772
  const atRoot = ctx.atRoot;
22593
22773
  if (atRoot)
22594
22774
  ctx.atRoot = false;
22775
+ if (ctx.atKey)
22776
+ ctx.atKey = false;
22595
22777
  let offset = fc.offset + fc.start.source.length;
22596
22778
  for (let i = 0; i < fc.items.length; ++i) {
22597
22779
  const collItem = fc.items[i];
@@ -22671,12 +22853,14 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22671
22853
  else {
22672
22854
  // item is a key+value pair
22673
22855
  // key value
22856
+ ctx.atKey = true;
22674
22857
  const keyStart = props.end;
22675
22858
  const keyNode = key
22676
22859
  ? composeNode(ctx, key, props, onError)
22677
22860
  : composeEmptyNode(ctx, keyStart, start, null, props, onError);
22678
22861
  if (isBlock(key))
22679
22862
  onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
22863
+ ctx.atKey = false;
22680
22864
  // value properties
22681
22865
  const valueProps = resolveProps(sep ?? [], {
22682
22866
  flow: fcName,
@@ -22832,8 +23016,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22832
23016
  tag = kt;
22833
23017
  }
22834
23018
  else {
22835
- if (kt?.collection) {
22836
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
23019
+ if (kt) {
23020
+ onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
22837
23021
  }
22838
23022
  else {
22839
23023
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
@@ -23274,11 +23458,16 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23274
23458
  const tagName = tagToken
23275
23459
  ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
23276
23460
  : null;
23277
- const tag = tagToken && tagName
23278
- ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
23279
- : token.type === 'scalar'
23280
- ? findScalarTagByTest(ctx, value, token, onError)
23281
- : ctx.schema[SCALAR$1];
23461
+ let tag;
23462
+ if (ctx.options.stringKeys && ctx.atKey) {
23463
+ tag = ctx.schema[SCALAR$1];
23464
+ }
23465
+ else if (tagName)
23466
+ tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
23467
+ else if (token.type === 'scalar')
23468
+ tag = findScalarTagByTest(ctx, value, token, onError);
23469
+ else
23470
+ tag = ctx.schema[SCALAR$1];
23282
23471
  let scalar;
23283
23472
  try {
23284
23473
  const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
@@ -23326,8 +23515,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23326
23515
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
23327
23516
  return schema[SCALAR$1];
23328
23517
  }
23329
- function findScalarTagByTest({ directives, schema }, value, token, onError) {
23330
- const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
23518
+ function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
23519
+ const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
23520
+ tag.test?.test(value)) || schema[SCALAR$1];
23331
23521
  if (schema.compat) {
23332
23522
  const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
23333
23523
  schema[SCALAR$1];
@@ -23343,8 +23533,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23343
23533
 
23344
23534
  function emptyScalarPosition(offset, before, pos) {
23345
23535
  if (before) {
23346
- if (pos === null)
23347
- pos = before.length;
23536
+ pos ?? (pos = before.length);
23348
23537
  for (let i = pos - 1; i >= 0; --i) {
23349
23538
  let st = before[i];
23350
23539
  switch (st.type) {
@@ -23369,6 +23558,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23369
23558
 
23370
23559
  const CN = { composeNode, composeEmptyNode };
23371
23560
  function composeNode(ctx, token, props, onError) {
23561
+ const atKey = ctx.atKey;
23372
23562
  const { spaceBefore, comment, anchor, tag } = props;
23373
23563
  let node;
23374
23564
  let isSrcToken = true;
@@ -23404,6 +23594,14 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23404
23594
  }
23405
23595
  if (anchor && node.anchor === '')
23406
23596
  onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
23597
+ if (atKey &&
23598
+ ctx.options.stringKeys &&
23599
+ (!isScalar$1(node) ||
23600
+ typeof node.value !== 'string' ||
23601
+ (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
23602
+ const msg = 'With stringKeys, all keys must be strings';
23603
+ onError(tag ?? token, 'NON_STRING_KEY', msg);
23604
+ }
23407
23605
  if (spaceBefore)
23408
23606
  node.spaceBefore = true;
23409
23607
  if (comment) {
@@ -23456,6 +23654,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23456
23654
  const opts = Object.assign({ _directives: directives }, options);
23457
23655
  const doc = new Document(undefined, opts);
23458
23656
  const ctx = {
23657
+ atKey: false,
23459
23658
  atRoot: true,
23460
23659
  directives: doc.directives,
23461
23660
  options: doc.options,
@@ -25590,7 +25789,20 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25590
25789
  default: {
25591
25790
  const bv = this.startBlockValue(map);
25592
25791
  if (bv) {
25593
- if (atMapIndent && bv.type !== 'block-seq') {
25792
+ if (bv.type === 'block-seq') {
25793
+ if (!it.explicitKey &&
25794
+ it.sep &&
25795
+ !includesToken(it.sep, 'newline')) {
25796
+ yield* this.pop({
25797
+ type: 'error',
25798
+ offset: this.offset,
25799
+ message: 'Unexpected block-seq-ind on same line with key',
25800
+ source: this.source
25801
+ });
25802
+ return;
25803
+ }
25804
+ }
25805
+ else if (atMapIndent) {
25594
25806
  map.items.push({ start });
25595
25807
  }
25596
25808
  this.stack.push(bv);
@@ -25961,6 +26173,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25961
26173
  if (!keepUndefined)
25962
26174
  return undefined;
25963
26175
  }
26176
+ if (isDocument(value) && !_replacer)
26177
+ return value.toString(options);
25964
26178
  return new Document(value, _replacer, options).toString(options);
25965
26179
  }
25966
26180
 
@@ -26036,14 +26250,16 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
26036
26250
 
26037
26251
  exports.AnswerService = AnswerService;
26038
26252
  exports.AppEmbed = AppEmbed;
26039
- exports.BodylessConversation = BodylessConversation;
26040
- exports.ConversationEmbed = ConversationEmbed;
26253
+ exports.BodylessConversation = SpotterAgentEmbed;
26254
+ exports.ConversationEmbed = SpotterEmbed;
26041
26255
  exports.LiveboardEmbed = LiveboardEmbed;
26042
26256
  exports.MIXPANEL_EVENT = MIXPANEL_EVENT;
26043
26257
  exports.PinboardEmbed = PinboardEmbed;
26044
26258
  exports.SageEmbed = SageEmbed;
26045
26259
  exports.SearchBarEmbed = SearchBarEmbed;
26046
26260
  exports.SearchEmbed = SearchEmbed;
26261
+ exports.SpotterAgentEmbed = SpotterAgentEmbed;
26262
+ exports.SpotterEmbed = SpotterEmbed;
26047
26263
  exports.createLiveboardWithAnswers = createLiveboardWithAnswers;
26048
26264
  exports.executeTML = executeTML;
26049
26265
  exports.exportTML = exportTML;