@thoughtspot/visual-embed-sdk 1.41.0-pre-render-1 → 1.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +2 -4
  2. package/cjs/package.json +3 -3
  3. package/cjs/src/authToken.d.ts +1 -0
  4. package/cjs/src/authToken.d.ts.map +1 -1
  5. package/cjs/src/authToken.js +13 -3
  6. package/cjs/src/authToken.js.map +1 -1
  7. package/cjs/src/authToken.spec.js +29 -0
  8. package/cjs/src/authToken.spec.js.map +1 -1
  9. package/cjs/src/css-variables.d.ts +2 -1
  10. package/cjs/src/css-variables.d.ts.map +1 -1
  11. package/cjs/src/embed/app.d.ts +22 -1
  12. package/cjs/src/embed/app.d.ts.map +1 -1
  13. package/cjs/src/embed/app.js +22 -1
  14. package/cjs/src/embed/app.js.map +1 -1
  15. package/cjs/src/embed/app.spec.js +70 -3
  16. package/cjs/src/embed/app.spec.js.map +1 -1
  17. package/cjs/src/embed/bodyless-conversation.d.ts +0 -1
  18. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  19. package/cjs/src/embed/bodyless-conversation.js +3 -7
  20. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  21. package/cjs/src/embed/conversation.d.ts +2 -3
  22. package/cjs/src/embed/conversation.d.ts.map +1 -1
  23. package/cjs/src/embed/conversation.js +2 -7
  24. package/cjs/src/embed/conversation.js.map +1 -1
  25. package/cjs/src/embed/liveboard.d.ts +32 -1
  26. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  27. package/cjs/src/embed/liveboard.js +8 -25
  28. package/cjs/src/embed/liveboard.js.map +1 -1
  29. package/cjs/src/embed/liveboard.spec.js +96 -28
  30. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  31. package/cjs/src/embed/sage.d.ts +0 -1
  32. package/cjs/src/embed/sage.d.ts.map +1 -1
  33. package/cjs/src/embed/sage.js +6 -10
  34. package/cjs/src/embed/sage.js.map +1 -1
  35. package/cjs/src/embed/sage.spec.js +20 -10
  36. package/cjs/src/embed/sage.spec.js.map +1 -1
  37. package/cjs/src/embed/search-bar.d.ts +0 -1
  38. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  39. package/cjs/src/embed/search-bar.js +7 -11
  40. package/cjs/src/embed/search-bar.js.map +1 -1
  41. package/cjs/src/embed/search.d.ts +0 -1
  42. package/cjs/src/embed/search.d.ts.map +1 -1
  43. package/cjs/src/embed/search.js +8 -7
  44. package/cjs/src/embed/search.js.map +1 -1
  45. package/cjs/src/embed/search.spec.js +10 -10
  46. package/cjs/src/embed/search.spec.js.map +1 -1
  47. package/cjs/src/embed/ts-embed.d.ts +5 -7
  48. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  49. package/cjs/src/embed/ts-embed.js +25 -22
  50. package/cjs/src/embed/ts-embed.js.map +1 -1
  51. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  52. package/cjs/src/embed/ts-embed.spec.js +122 -0
  53. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  54. package/cjs/src/errors.d.ts +11 -0
  55. package/cjs/src/errors.d.ts.map +1 -1
  56. package/cjs/src/errors.js +12 -1
  57. package/cjs/src/errors.js.map +1 -1
  58. package/cjs/src/index.d.ts +2 -2
  59. package/cjs/src/index.d.ts.map +1 -1
  60. package/cjs/src/index.js +3 -1
  61. package/cjs/src/index.js.map +1 -1
  62. package/cjs/src/react/index.d.ts +1 -1
  63. package/cjs/src/react/index.d.ts.map +1 -1
  64. package/cjs/src/react/index.js +4 -2
  65. package/cjs/src/react/index.js.map +1 -1
  66. package/cjs/src/react/index.spec.js +1 -1
  67. package/cjs/src/react/index.spec.js.map +1 -1
  68. package/cjs/src/types.d.ts +163 -21
  69. package/cjs/src/types.d.ts.map +1 -1
  70. package/cjs/src/types.js +65 -22
  71. package/cjs/src/types.js.map +1 -1
  72. package/cjs/src/utils/custom-actions.d.ts +12 -0
  73. package/cjs/src/utils/custom-actions.d.ts.map +1 -0
  74. package/cjs/src/utils/custom-actions.js +180 -0
  75. package/cjs/src/utils/custom-actions.js.map +1 -0
  76. package/cjs/src/utils/custom-actions.spec.d.ts +2 -0
  77. package/cjs/src/utils/custom-actions.spec.d.ts.map +1 -0
  78. package/cjs/src/utils/custom-actions.spec.js +399 -0
  79. package/cjs/src/utils/custom-actions.spec.js.map +1 -0
  80. package/cjs/src/utils/processData.d.ts.map +1 -1
  81. package/cjs/src/utils/processData.js +10 -0
  82. package/cjs/src/utils/processData.js.map +1 -1
  83. package/cjs/src/utils/processData.spec.js +11 -0
  84. package/cjs/src/utils/processData.spec.js.map +1 -1
  85. package/cjs/src/utils.d.ts +21 -0
  86. package/cjs/src/utils.d.ts.map +1 -1
  87. package/cjs/src/utils.js +32 -1
  88. package/cjs/src/utils.js.map +1 -1
  89. package/cjs/src/utils.spec.js +38 -0
  90. package/cjs/src/utils.spec.js.map +1 -1
  91. package/dist/{index-CmEQfuE3.js → index-DQueHwfQ.js} +1 -1
  92. package/dist/src/authToken.d.ts +1 -0
  93. package/dist/src/authToken.d.ts.map +1 -1
  94. package/dist/src/css-variables.d.ts +2 -1
  95. package/dist/src/css-variables.d.ts.map +1 -1
  96. package/dist/src/embed/app.d.ts +22 -1
  97. package/dist/src/embed/app.d.ts.map +1 -1
  98. package/dist/src/embed/bodyless-conversation.d.ts +0 -1
  99. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  100. package/dist/src/embed/conversation.d.ts +2 -3
  101. package/dist/src/embed/conversation.d.ts.map +1 -1
  102. package/dist/src/embed/liveboard.d.ts +32 -1
  103. package/dist/src/embed/liveboard.d.ts.map +1 -1
  104. package/dist/src/embed/sage.d.ts +0 -1
  105. package/dist/src/embed/sage.d.ts.map +1 -1
  106. package/dist/src/embed/search-bar.d.ts +0 -1
  107. package/dist/src/embed/search-bar.d.ts.map +1 -1
  108. package/dist/src/embed/search.d.ts +0 -1
  109. package/dist/src/embed/search.d.ts.map +1 -1
  110. package/dist/src/embed/ts-embed.d.ts +5 -7
  111. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  112. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  113. package/dist/src/errors.d.ts +11 -0
  114. package/dist/src/errors.d.ts.map +1 -1
  115. package/dist/src/index.d.ts +2 -2
  116. package/dist/src/index.d.ts.map +1 -1
  117. package/dist/src/react/index.d.ts +1 -1
  118. package/dist/src/react/index.d.ts.map +1 -1
  119. package/dist/src/types.d.ts +163 -21
  120. package/dist/src/types.d.ts.map +1 -1
  121. package/dist/src/utils/custom-actions.d.ts +12 -0
  122. package/dist/src/utils/custom-actions.d.ts.map +1 -0
  123. package/dist/src/utils/custom-actions.spec.d.ts +2 -0
  124. package/dist/src/utils/custom-actions.spec.d.ts.map +1 -0
  125. package/dist/src/utils/processData.d.ts.map +1 -1
  126. package/dist/src/utils.d.ts +21 -0
  127. package/dist/src/utils.d.ts.map +1 -1
  128. package/dist/tsembed-react.es.js +1773 -251
  129. package/dist/tsembed-react.js +1772 -250
  130. package/dist/tsembed.es.js +1771 -250
  131. package/dist/tsembed.js +1770 -249
  132. package/dist/visual-embed-sdk-react-full.d.ts +228 -39
  133. package/dist/visual-embed-sdk-react.d.ts +228 -39
  134. package/dist/visual-embed-sdk.d.ts +228 -39
  135. package/lib/package.json +3 -3
  136. package/lib/src/authToken.d.ts +1 -0
  137. package/lib/src/authToken.d.ts.map +1 -1
  138. package/lib/src/authToken.js +11 -2
  139. package/lib/src/authToken.js.map +1 -1
  140. package/lib/src/authToken.spec.js +30 -1
  141. package/lib/src/authToken.spec.js.map +1 -1
  142. package/lib/src/css-variables.d.ts +2 -1
  143. package/lib/src/css-variables.d.ts.map +1 -1
  144. package/lib/src/embed/app.d.ts +22 -1
  145. package/lib/src/embed/app.d.ts.map +1 -1
  146. package/lib/src/embed/app.js +22 -1
  147. package/lib/src/embed/app.js.map +1 -1
  148. package/lib/src/embed/app.spec.js +70 -3
  149. package/lib/src/embed/app.spec.js.map +1 -1
  150. package/lib/src/embed/bodyless-conversation.d.ts +0 -1
  151. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  152. package/lib/src/embed/bodyless-conversation.js +3 -7
  153. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  154. package/lib/src/embed/conversation.d.ts +2 -3
  155. package/lib/src/embed/conversation.d.ts.map +1 -1
  156. package/lib/src/embed/conversation.js +2 -7
  157. package/lib/src/embed/conversation.js.map +1 -1
  158. package/lib/src/embed/liveboard.d.ts +32 -1
  159. package/lib/src/embed/liveboard.d.ts.map +1 -1
  160. package/lib/src/embed/liveboard.js +8 -25
  161. package/lib/src/embed/liveboard.js.map +1 -1
  162. package/lib/src/embed/liveboard.spec.js +96 -28
  163. package/lib/src/embed/liveboard.spec.js.map +1 -1
  164. package/lib/src/embed/sage.d.ts +0 -1
  165. package/lib/src/embed/sage.d.ts.map +1 -1
  166. package/lib/src/embed/sage.js +6 -10
  167. package/lib/src/embed/sage.js.map +1 -1
  168. package/lib/src/embed/sage.spec.js +20 -10
  169. package/lib/src/embed/sage.spec.js.map +1 -1
  170. package/lib/src/embed/search-bar.d.ts +0 -1
  171. package/lib/src/embed/search-bar.d.ts.map +1 -1
  172. package/lib/src/embed/search-bar.js +7 -11
  173. package/lib/src/embed/search-bar.js.map +1 -1
  174. package/lib/src/embed/search.d.ts +0 -1
  175. package/lib/src/embed/search.d.ts.map +1 -1
  176. package/lib/src/embed/search.js +8 -7
  177. package/lib/src/embed/search.js.map +1 -1
  178. package/lib/src/embed/search.spec.js +11 -11
  179. package/lib/src/embed/search.spec.js.map +1 -1
  180. package/lib/src/embed/ts-embed.d.ts +5 -7
  181. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  182. package/lib/src/embed/ts-embed.js +25 -22
  183. package/lib/src/embed/ts-embed.js.map +1 -1
  184. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  185. package/lib/src/embed/ts-embed.spec.js +123 -1
  186. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  187. package/lib/src/errors.d.ts +11 -0
  188. package/lib/src/errors.d.ts.map +1 -1
  189. package/lib/src/errors.js +11 -0
  190. package/lib/src/errors.js.map +1 -1
  191. package/lib/src/index.d.ts +2 -2
  192. package/lib/src/index.d.ts.map +1 -1
  193. package/lib/src/index.js +2 -2
  194. package/lib/src/index.js.map +1 -1
  195. package/lib/src/react/index.d.ts +1 -1
  196. package/lib/src/react/index.d.ts.map +1 -1
  197. package/lib/src/react/index.js +3 -2
  198. package/lib/src/react/index.js.map +1 -1
  199. package/lib/src/react/index.spec.js +1 -1
  200. package/lib/src/react/index.spec.js.map +1 -1
  201. package/lib/src/types.d.ts +163 -21
  202. package/lib/src/types.d.ts.map +1 -1
  203. package/lib/src/types.js +64 -21
  204. package/lib/src/types.js.map +1 -1
  205. package/lib/src/utils/custom-actions.d.ts +12 -0
  206. package/lib/src/utils/custom-actions.d.ts.map +1 -0
  207. package/lib/src/utils/custom-actions.js +175 -0
  208. package/lib/src/utils/custom-actions.js.map +1 -0
  209. package/lib/src/utils/custom-actions.spec.d.ts +2 -0
  210. package/lib/src/utils/custom-actions.spec.d.ts.map +1 -0
  211. package/lib/src/utils/custom-actions.spec.js +397 -0
  212. package/lib/src/utils/custom-actions.spec.js.map +1 -0
  213. package/lib/src/utils/processData.d.ts.map +1 -1
  214. package/lib/src/utils/processData.js +10 -0
  215. package/lib/src/utils/processData.js.map +1 -1
  216. package/lib/src/utils/processData.spec.js +11 -0
  217. package/lib/src/utils/processData.spec.js.map +1 -1
  218. package/lib/src/utils.d.ts +21 -0
  219. package/lib/src/utils.d.ts.map +1 -1
  220. package/lib/src/utils.js +29 -0
  221. package/lib/src/utils.js.map +1 -1
  222. package/lib/src/utils.spec.js +39 -1
  223. package/lib/src/utils.spec.js.map +1 -1
  224. package/lib/src/visual-embed-sdk.d.ts +229 -40
  225. package/package.json +3 -3
  226. package/src/authToken.spec.ts +48 -1
  227. package/src/authToken.ts +13 -2
  228. package/src/css-variables.ts +2 -1
  229. package/src/embed/app.spec.ts +99 -3
  230. package/src/embed/app.ts +44 -1
  231. package/src/embed/bodyless-conversation.ts +3 -8
  232. package/src/embed/conversation.ts +4 -19
  233. package/src/embed/liveboard.spec.ts +128 -30
  234. package/src/embed/liveboard.ts +66 -52
  235. package/src/embed/sage.spec.ts +24 -10
  236. package/src/embed/sage.ts +7 -12
  237. package/src/embed/search-bar.tsx +7 -14
  238. package/src/embed/search.spec.ts +13 -14
  239. package/src/embed/search.ts +8 -19
  240. package/src/embed/ts-embed.spec.ts +136 -2
  241. package/src/embed/ts-embed.ts +31 -28
  242. package/src/errors.ts +12 -0
  243. package/src/index.ts +4 -0
  244. package/src/react/index.spec.tsx +1 -1
  245. package/src/react/index.tsx +5 -2
  246. package/src/types.ts +225 -79
  247. package/src/utils/custom-actions.spec.ts +431 -0
  248. package/src/utils/custom-actions.ts +217 -0
  249. package/src/utils/processData.spec.ts +12 -0
  250. package/src/utils/processData.ts +10 -0
  251. package/src/utils.spec.ts +52 -0
  252. package/src/utils.ts +31 -0
  253. package/dist/index-BDlM0f0T.js +0 -7371
  254. package/dist/index-D1pyb7RG.js +0 -7371
  255. package/dist/index-DeFzsyFF.js +0 -7371
  256. package/dist/index-Dpf0rd6w.js +0 -7371
  257. package/dist/index-UuEbsISo.js +0 -7447
  258. package/dist/index-e3Uw3YFO.js +0 -7371
  259. package/dist/index-k7pkZMhx.js +0 -7371
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.41.0-pre-render-1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.41.1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -379,6 +379,15 @@
379
379
  * @returns The stored value or `undefined` if the key is not found.
380
380
  */
381
381
  const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
382
+ /**
383
+ * Check if an array includes a string value
384
+ * @param arr - The array to check
385
+ * @param key - The string to search for
386
+ * @returns boolean indicating if the string is found in the array
387
+ */
388
+ const arrayIncludesString = (arr, key) => {
389
+ return arr.some(item => typeof item === 'string' && item === key);
390
+ };
382
391
  /**
383
392
  * Check if the document is currently in fullscreen mode
384
393
  */
@@ -460,6 +469,26 @@
460
469
  width: Math.max(0, frameRelativeRight - frameRelativeLeft),
461
470
  };
462
471
  return data;
472
+ };
473
+ /**
474
+ * Replaces placeholders in a template string with provided values.
475
+ * Placeholders should be in the format {key}.
476
+ * @param template - The template string with placeholders
477
+ * @param values - An object containing key-value pairs to replace placeholders
478
+ * @returns The template string with placeholders replaced
479
+ * @example
480
+ * formatTemplate('Hello {name}, you are {age} years old', { name: 'John', age: 30 })
481
+ * // Returns: 'Hello John, you are 30 years old'
482
+ *
483
+ * formatTemplate('Expected {type}, but received {actual}', { type: 'string', actual: 'number' })
484
+ * // Returns: 'Expected string, but received number'
485
+ */
486
+ const formatTemplate = (template, values) => {
487
+ // This regex /\{(\w+)\}/g finds all placeholders in the format {word}
488
+ // and captures the word inside the braces for replacement.
489
+ return template.replace(/\{(\w+)\}/g, (match, key) => {
490
+ return values[key] !== undefined ? String(values[key]) : match;
491
+ });
463
492
  };
464
493
 
465
494
  /**
@@ -474,7 +503,6 @@
474
503
  * the embedded app
475
504
  * @group Authentication / Init
476
505
  */
477
- // eslint-disable-next-line no-shadow
478
506
  exports.AuthType = void 0;
479
507
  (function (AuthType) {
480
508
  /**
@@ -688,7 +716,6 @@
688
716
  /**
689
717
  * A map of the supported runtime filter operations
690
718
  */
691
- // eslint-disable-next-line no-shadow
692
719
  exports.RuntimeFilterOp = void 0;
693
720
  (function (RuntimeFilterOp) {
694
721
  /**
@@ -759,7 +786,6 @@
759
786
  * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
760
787
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
761
788
  */
762
- // eslint-disable-next-line no-shadow
763
789
  exports.HomepageModule = void 0;
764
790
  (function (HomepageModule) {
765
791
  /**
@@ -792,7 +818,6 @@
792
818
  * **Note**: This option is applicable to full app embedding only.
793
819
  * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
794
820
  */
795
- // eslint-disable-next-line no-shadow
796
821
  exports.ListPageColumns = void 0;
797
822
  (function (ListPageColumns) {
798
823
  /**
@@ -855,7 +880,6 @@
855
880
  * ```
856
881
  * @group Events
857
882
  */
858
- // eslint-disable-next-line no-shadow
859
883
  exports.EmbedEvent = void 0;
860
884
  (function (EmbedEvent) {
861
885
  /**
@@ -1497,6 +1521,11 @@
1497
1521
  * @hidden
1498
1522
  */
1499
1523
  EmbedEvent["APP_INIT"] = "appInit";
1524
+ /**
1525
+ * Internal event to clear the cached info
1526
+ * @hidden
1527
+ */
1528
+ EmbedEvent["CLEAR_INFO_CACHE"] = "clearInfoCache";
1500
1529
  /**
1501
1530
  * Emitted when a user clicks **Show Liveboard details** on a Liveboard
1502
1531
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
@@ -1965,6 +1994,17 @@
1965
1994
  * ```
1966
1995
  */
1967
1996
  EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
1997
+ /**
1998
+ * Emitted when the organization is switched.
1999
+ * @example
2000
+ * ```js
2001
+ * appEmbed.on(EmbedEvent.OrgSwitched, (payload) => {
2002
+ * console.log('payload', payload);
2003
+ * })
2004
+ * ```
2005
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2006
+ */
2007
+ EmbedEvent["OrgSwitched"] = "orgSwitched";
1968
2008
  })(exports.EmbedEvent || (exports.EmbedEvent = {}));
1969
2009
  /**
1970
2010
  * Event types that can be triggered by the host application
@@ -2019,7 +2059,6 @@
2019
2059
  * ```
2020
2060
  * @group Events
2021
2061
  */
2022
- // eslint-disable-next-line no-shadow
2023
2062
  exports.HostEvent = void 0;
2024
2063
  (function (HostEvent) {
2025
2064
  /**
@@ -2883,7 +2922,7 @@
2883
2922
  * column: "Date",
2884
2923
  * oper: 'EQ',
2885
2924
  * values: ["2023-07-31"],
2886
- * types: "EXACT_DATE"
2925
+ * type: "EXACT_DATE"
2887
2926
  * }]
2888
2927
  * });
2889
2928
  * ```
@@ -3229,22 +3268,11 @@
3229
3268
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
3230
3269
  */
3231
3270
  HostEvent["AskSpotter"] = "AskSpotter";
3232
- /**
3233
- * @hidden
3234
- * Triggers the update of the embed params.
3235
- *
3236
- * @example
3237
- * ```js
3238
- * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
3239
- * ```
3240
- */
3241
- HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
3242
3271
  })(exports.HostEvent || (exports.HostEvent = {}));
3243
3272
  /**
3244
3273
  * The different visual modes that the data sources panel within
3245
3274
  * search could appear in, such as hidden, collapsed, or expanded.
3246
3275
  */
3247
- // eslint-disable-next-line no-shadow
3248
3276
  exports.DataSourceVisualMode = void 0;
3249
3277
  (function (DataSourceVisualMode) {
3250
3278
  /**
@@ -3264,7 +3292,6 @@
3264
3292
  * The query params passed down to the embedded ThoughtSpot app
3265
3293
  * containing configuration and/or visual information.
3266
3294
  */
3267
- // eslint-disable-next-line no-shadow
3268
3295
  var Param;
3269
3296
  (function (Param) {
3270
3297
  Param["EmbedApp"] = "embedApp";
@@ -3344,6 +3371,7 @@
3344
3371
  Param["Query"] = "query";
3345
3372
  Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
3346
3373
  Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
3374
+ Param["HomepageVersion"] = "homepageVersion";
3347
3375
  Param["ListPageVersion"] = "listpageVersion";
3348
3376
  Param["PendoTrackingKey"] = "additionalPendoKey";
3349
3377
  Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
@@ -3385,6 +3413,8 @@
3385
3413
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
3386
3414
  Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
3387
3415
  Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3416
+ Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
3417
+ Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
3388
3418
  })(Param || (Param = {}));
3389
3419
  /**
3390
3420
  * ThoughtSpot application pages include actions and menu commands
@@ -3413,7 +3443,6 @@
3413
3443
  * ```
3414
3444
  * See also link:https://developers.thoughtspot.com/docs/actions[Action IDs in the SDK]
3415
3445
  */
3416
- // eslint-disable-next-line no-shadow
3417
3446
  exports.Action = void 0;
3418
3447
  (function (Action) {
3419
3448
  /**
@@ -3958,7 +3987,7 @@
3958
3987
  * The Favorites icon (*) for Answers,
3959
3988
  * Liveboard, and data objects like Worksheet, Model,
3960
3989
  * Tables and Views.
3961
- * Allows adding an object to the users favorites list.
3990
+ * Allows adding an object to the user's favorites list.
3962
3991
  * @example
3963
3992
  * ```js
3964
3993
  * disabledActions: [Action.AddToFavorites]
@@ -4667,6 +4696,29 @@
4667
4696
  * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
4668
4697
  */
4669
4698
  Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
4699
+ /**
4700
+ * The **PNG screenshot in email** option in the schedule email dialog.
4701
+ * Includes a PNG screenshot in the notification email body.
4702
+ * @example
4703
+ * ```js
4704
+ * disabledActions: [Action.PngScreenshotInEmail]
4705
+ * ```
4706
+ * ```
4707
+ * @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
4708
+ */
4709
+ Action["PngScreenshotInEmail"] = "pngScreenshotInEmail";
4710
+ /**
4711
+ * The **Remove attachment** action in the schedule email dialog.
4712
+ * Removes an attachment from the email configuration.
4713
+ * @example
4714
+ * ```js
4715
+ * disabledActions: [Action.RemoveAttachment]
4716
+ * ```
4717
+ * ```
4718
+ * ```
4719
+ * @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
4720
+ */
4721
+ Action["RemoveAttachment"] = "removeAttachment";
4670
4722
  })(exports.Action || (exports.Action = {}));
4671
4723
  exports.PrefetchFeatures = void 0;
4672
4724
  (function (PrefetchFeatures) {
@@ -4685,6 +4737,26 @@
4685
4737
  ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
4686
4738
  ContextMenuTriggerOptions["BOTH_CLICKS"] = "both-clicks";
4687
4739
  })(exports.ContextMenuTriggerOptions || (exports.ContextMenuTriggerOptions = {}));
4740
+ /**
4741
+ * Enum options to show custom actions at different
4742
+ * positions in the application.
4743
+ */
4744
+ exports.CustomActionsPosition = void 0;
4745
+ (function (CustomActionsPosition) {
4746
+ CustomActionsPosition["PRIMARY"] = "PRIMARY";
4747
+ CustomActionsPosition["MENU"] = "MENU";
4748
+ CustomActionsPosition["CONTEXTMENU"] = "CONTEXTMENU";
4749
+ })(exports.CustomActionsPosition || (exports.CustomActionsPosition = {}));
4750
+ /**
4751
+ * Enum options to mention the target of the custom action.
4752
+ */
4753
+ exports.CustomActionTarget = void 0;
4754
+ (function (CustomActionTarget) {
4755
+ CustomActionTarget["LIVEBOARD"] = "LIVEBOARD";
4756
+ CustomActionTarget["VIZ"] = "VIZ";
4757
+ CustomActionTarget["ANSWER"] = "ANSWER";
4758
+ CustomActionTarget["SPOTTER"] = "SPOTTER";
4759
+ })(exports.CustomActionTarget || (exports.CustomActionTarget = {}));
4688
4760
  /**
4689
4761
  * Enum options to show or suppress Visual Embed SDK and
4690
4762
  * ThoughtSpot application logs in the console output.
@@ -5841,8 +5913,8 @@
5841
5913
  var _cacheHas = cacheHas;
5842
5914
 
5843
5915
  /** Used to compose bitmasks for value comparisons. */
5844
- var COMPARE_PARTIAL_FLAG$3 = 1,
5845
- COMPARE_UNORDERED_FLAG$1 = 2;
5916
+ var COMPARE_PARTIAL_FLAG$5 = 1,
5917
+ COMPARE_UNORDERED_FLAG$3 = 2;
5846
5918
 
5847
5919
  /**
5848
5920
  * A specialized version of `baseIsEqualDeep` for arrays with support for
@@ -5858,7 +5930,7 @@
5858
5930
  * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
5859
5931
  */
5860
5932
  function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
5861
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
5933
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
5862
5934
  arrLength = array.length,
5863
5935
  othLength = other.length;
5864
5936
 
@@ -5873,7 +5945,7 @@
5873
5945
  }
5874
5946
  var index = -1,
5875
5947
  result = true,
5876
- seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new _SetCache : undefined;
5948
+ seen = (bitmask & COMPARE_UNORDERED_FLAG$3) ? new _SetCache : undefined;
5877
5949
 
5878
5950
  stack.set(array, other);
5879
5951
  stack.set(other, array);
@@ -5965,8 +6037,8 @@
5965
6037
  var _setToArray = setToArray;
5966
6038
 
5967
6039
  /** Used to compose bitmasks for value comparisons. */
5968
- var COMPARE_PARTIAL_FLAG$2 = 1,
5969
- COMPARE_UNORDERED_FLAG = 2;
6040
+ var COMPARE_PARTIAL_FLAG$4 = 1,
6041
+ COMPARE_UNORDERED_FLAG$2 = 2;
5970
6042
 
5971
6043
  /** `Object#toString` result references. */
5972
6044
  var boolTag$2 = '[object Boolean]',
@@ -5977,14 +6049,14 @@
5977
6049
  regexpTag$1 = '[object RegExp]',
5978
6050
  setTag$3 = '[object Set]',
5979
6051
  stringTag$1 = '[object String]',
5980
- symbolTag = '[object Symbol]';
6052
+ symbolTag$1 = '[object Symbol]';
5981
6053
 
5982
6054
  var arrayBufferTag$1 = '[object ArrayBuffer]',
5983
6055
  dataViewTag$2 = '[object DataView]';
5984
6056
 
5985
6057
  /** Used to convert symbols to primitives and strings. */
5986
- var symbolProto = _Symbol ? _Symbol.prototype : undefined,
5987
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
6058
+ var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
6059
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
5988
6060
 
5989
6061
  /**
5990
6062
  * A specialized version of `baseIsEqualDeep` for comparing objects of
@@ -6041,7 +6113,7 @@
6041
6113
  var convert = _mapToArray;
6042
6114
 
6043
6115
  case setTag$3:
6044
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
6116
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
6045
6117
  convert || (convert = _setToArray);
6046
6118
 
6047
6119
  if (object.size != other.size && !isPartial) {
@@ -6052,7 +6124,7 @@
6052
6124
  if (stacked) {
6053
6125
  return stacked == other;
6054
6126
  }
6055
- bitmask |= COMPARE_UNORDERED_FLAG;
6127
+ bitmask |= COMPARE_UNORDERED_FLAG$2;
6056
6128
 
6057
6129
  // Recursively compare objects (susceptible to call stack limits).
6058
6130
  stack.set(object, other);
@@ -6060,7 +6132,7 @@
6060
6132
  stack['delete'](object);
6061
6133
  return result;
6062
6134
 
6063
- case symbolTag:
6135
+ case symbolTag$1:
6064
6136
  if (symbolValueOf) {
6065
6137
  return symbolValueOf.call(object) == symbolValueOf.call(other);
6066
6138
  }
@@ -6751,7 +6823,7 @@
6751
6823
  var _getAllKeys = getAllKeys;
6752
6824
 
6753
6825
  /** Used to compose bitmasks for value comparisons. */
6754
- var COMPARE_PARTIAL_FLAG$1 = 1;
6826
+ var COMPARE_PARTIAL_FLAG$3 = 1;
6755
6827
 
6756
6828
  /** Used for built-in method references. */
6757
6829
  var objectProto$2 = Object.prototype;
@@ -6773,7 +6845,7 @@
6773
6845
  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
6774
6846
  */
6775
6847
  function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
6776
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
6848
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
6777
6849
  objProps = _getAllKeys(object),
6778
6850
  objLength = objProps.length,
6779
6851
  othProps = _getAllKeys(other),
@@ -6911,7 +6983,7 @@
6911
6983
  var _getTag = getTag;
6912
6984
 
6913
6985
  /** Used to compose bitmasks for value comparisons. */
6914
- var COMPARE_PARTIAL_FLAG = 1;
6986
+ var COMPARE_PARTIAL_FLAG$2 = 1;
6915
6987
 
6916
6988
  /** `Object#toString` result references. */
6917
6989
  var argsTag = '[object Arguments]',
@@ -6964,7 +7036,7 @@
6964
7036
  ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
6965
7037
  : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
6966
7038
  }
6967
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
7039
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
6968
7040
  var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, '__wrapped__'),
6969
7041
  othIsWrapped = othIsObj && hasOwnProperty$2.call(other, '__wrapped__');
6970
7042
 
@@ -7126,6 +7198,7 @@
7126
7198
  SDK_NOT_INITIALIZED: 'SDK not initialized',
7127
7199
  SESSION_INFO_FAILED: 'Failed to get session information',
7128
7200
  INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
7201
+ INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
7129
7202
  MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
7130
7203
  PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
7131
7204
  SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
@@ -7134,6 +7207,16 @@
7134
7207
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7135
7208
  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',
7136
7209
  SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7210
+ };
7211
+ const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7212
+ INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
7213
+ MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
7214
+ UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
7215
+ INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
7216
+ INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
7217
+ INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
7218
+ INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
7219
+ DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
7137
7220
  };
7138
7221
 
7139
7222
  const EndPoints = {
@@ -7296,6 +7379,15 @@
7296
7379
  return authToken;
7297
7380
  }
7298
7381
  const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
7382
+ // even if token verification is disabled, we will still validate
7383
+ // that the token is a string before proceeding.
7384
+ if (typeof authToken !== 'string') {
7385
+ const errorMessage = formatTemplate(ERROR_MESSAGE.INVALID_TOKEN_TYPE_ERROR, {
7386
+ invalidType: typeof authToken,
7387
+ });
7388
+ logger$3.error(errorMessage);
7389
+ throw new Error(errorMessage);
7390
+ }
7299
7391
  const cachedAuthToken = getCacheAuthToken();
7300
7392
  if (embedConfig.disableTokenVerification) {
7301
7393
  logger$3.info('Token verification is disabled. Assuming token is valid.');
@@ -7986,141 +8078,1571 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
7986
8078
  if (columnsToRemove.length) {
7987
8079
  await unaggAnswerSession.removeColumns(columnsToRemove);
7988
8080
  }
7989
- return unaggAnswerSession;
7990
- }
7991
- /**
7992
- * Execute a custom graphql query in the context of the answer.
7993
- * @param query graphql query
7994
- * @param variables graphql variables
7995
- * @returns
7996
- */
7997
- async executeQuery(query, variables) {
7998
- const data = await graphqlQuery({
7999
- query,
8000
- variables: {
8001
- session: this.session,
8002
- ...variables,
8003
- },
8004
- thoughtSpotHost: this.thoughtSpotHost,
8005
- isCompositeQuery: false,
8006
- });
8007
- this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
8008
- return data;
8081
+ return unaggAnswerSession;
8082
+ }
8083
+ /**
8084
+ * Execute a custom graphql query in the context of the answer.
8085
+ * @param query graphql query
8086
+ * @param variables graphql variables
8087
+ * @returns
8088
+ */
8089
+ async executeQuery(query, variables) {
8090
+ const data = await graphqlQuery({
8091
+ query,
8092
+ variables: {
8093
+ session: this.session,
8094
+ ...variables,
8095
+ },
8096
+ thoughtSpotHost: this.thoughtSpotHost,
8097
+ isCompositeQuery: false,
8098
+ });
8099
+ this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
8100
+ return data;
8101
+ }
8102
+ /**
8103
+ * Get the internal session details for the answer.
8104
+ * @returns
8105
+ */
8106
+ getSession() {
8107
+ return this.session;
8108
+ }
8109
+ async getAnswer() {
8110
+ if (this.answer) {
8111
+ return this.answer;
8112
+ }
8113
+ this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
8114
+ return this.answer;
8115
+ }
8116
+ async getTML() {
8117
+ const { object } = await this.executeQuery(getAnswerTML, {});
8118
+ const edoc = object[0].edoc;
8119
+ const YAML = await Promise.resolve().then(function () { return index; });
8120
+ const parsedDoc = YAML.parse(edoc);
8121
+ return {
8122
+ answer: {
8123
+ ...parsedDoc.answer,
8124
+ ...this.tmlOverride,
8125
+ },
8126
+ };
8127
+ }
8128
+ async addDisplayedVizToLiveboard(liveboardId) {
8129
+ const { displayMode, visualizations } = await this.getAnswer();
8130
+ const viz = getDisplayedViz(visualizations, displayMode);
8131
+ return this.executeQuery(addVizToLiveboard, {
8132
+ liveboardId,
8133
+ vizId: viz.id,
8134
+ });
8135
+ }
8136
+ setTMLOverride(override) {
8137
+ this.tmlOverride = override;
8138
+ }
8139
+ }
8140
+ /**
8141
+ *
8142
+ * @param sourceDetail
8143
+ * @param colNames
8144
+ */
8145
+ function getGuidsFromColumnNames(sourceDetail, colNames) {
8146
+ const cols = sourceDetail.columns.reduce((colSet, col) => {
8147
+ colSet[col.name.toLowerCase()] = col;
8148
+ return colSet;
8149
+ }, {});
8150
+ return new Set(colNames.map((colName) => {
8151
+ const col = cols[colName.toLowerCase()];
8152
+ return col.id;
8153
+ }));
8154
+ }
8155
+ /**
8156
+ *
8157
+ * @param selectedPoints
8158
+ */
8159
+ function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
8160
+ const underlyingDataPoint = [];
8161
+ /**
8162
+ *
8163
+ * @param colVal
8164
+ */
8165
+ function addPointFromColVal(colVal) {
8166
+ var _a;
8167
+ const dataType = colVal.column.dataType;
8168
+ colVal.column.id;
8169
+ let dataValue;
8170
+ if (dataType === 'DATE') {
8171
+ if (Number.isFinite(colVal.value)) {
8172
+ dataValue = [{
8173
+ epochRange: {
8174
+ startEpoch: colVal.value,
8175
+ },
8176
+ }];
8177
+ // Case for custom calendar.
8178
+ }
8179
+ else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
8180
+ dataValue = [{
8181
+ epochRange: {
8182
+ startEpoch: colVal.value.v.s,
8183
+ endEpoch: colVal.value.v.e,
8184
+ },
8185
+ }];
8186
+ }
8187
+ }
8188
+ else {
8189
+ dataValue = [{ value: colVal.value }];
8190
+ }
8191
+ underlyingDataPoint.push({
8192
+ columnId: colVal.column.id,
8193
+ dataValue,
8194
+ });
8195
+ }
8196
+ selectedPoints.forEach((p) => {
8197
+ p.selectedAttributes.forEach(addPointFromColVal);
8198
+ });
8199
+ return underlyingDataPoint;
8200
+ }
8201
+ /**
8202
+ *
8203
+ * @param visualizations
8204
+ * @param displayMode
8205
+ */
8206
+ function getDisplayedViz(visualizations, displayMode) {
8207
+ if (displayMode === 'CHART_MODE') {
8208
+ return visualizations.find(
8209
+ // eslint-disable-next-line no-underscore-dangle
8210
+ (viz) => viz.__typename === 'ChartViz');
8211
+ }
8212
+ return visualizations.find(
8213
+ // eslint-disable-next-line no-underscore-dangle
8214
+ (viz) => viz.__typename === 'TableViz');
8215
+ }
8216
+
8217
+ /** Built-in value references. */
8218
+ var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
8219
+
8220
+ /**
8221
+ * Checks if `value` is a flattenable `arguments` object or array.
8222
+ *
8223
+ * @private
8224
+ * @param {*} value The value to check.
8225
+ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
8226
+ */
8227
+ function isFlattenable(value) {
8228
+ return isArray_1(value) || isArguments_1(value) ||
8229
+ !!(spreadableSymbol && value && value[spreadableSymbol]);
8230
+ }
8231
+
8232
+ var _isFlattenable = isFlattenable;
8233
+
8234
+ /**
8235
+ * The base implementation of `_.flatten` with support for restricting flattening.
8236
+ *
8237
+ * @private
8238
+ * @param {Array} array The array to flatten.
8239
+ * @param {number} depth The maximum recursion depth.
8240
+ * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
8241
+ * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
8242
+ * @param {Array} [result=[]] The initial result value.
8243
+ * @returns {Array} Returns the new flattened array.
8244
+ */
8245
+ function baseFlatten(array, depth, predicate, isStrict, result) {
8246
+ var index = -1,
8247
+ length = array.length;
8248
+
8249
+ predicate || (predicate = _isFlattenable);
8250
+ result || (result = []);
8251
+
8252
+ while (++index < length) {
8253
+ var value = array[index];
8254
+ if (depth > 0 && predicate(value)) {
8255
+ if (depth > 1) {
8256
+ // Recursively flatten arrays (susceptible to call stack limits).
8257
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
8258
+ } else {
8259
+ _arrayPush(result, value);
8260
+ }
8261
+ } else if (!isStrict) {
8262
+ result[result.length] = value;
8263
+ }
8264
+ }
8265
+ return result;
8266
+ }
8267
+
8268
+ var _baseFlatten = baseFlatten;
8269
+
8270
+ /**
8271
+ * A specialized version of `_.map` for arrays without support for iteratee
8272
+ * shorthands.
8273
+ *
8274
+ * @private
8275
+ * @param {Array} [array] The array to iterate over.
8276
+ * @param {Function} iteratee The function invoked per iteration.
8277
+ * @returns {Array} Returns the new mapped array.
8278
+ */
8279
+ function arrayMap(array, iteratee) {
8280
+ var index = -1,
8281
+ length = array == null ? 0 : array.length,
8282
+ result = Array(length);
8283
+
8284
+ while (++index < length) {
8285
+ result[index] = iteratee(array[index], index, array);
8286
+ }
8287
+ return result;
8288
+ }
8289
+
8290
+ var _arrayMap = arrayMap;
8291
+
8292
+ /** `Object#toString` result references. */
8293
+ var symbolTag = '[object Symbol]';
8294
+
8295
+ /**
8296
+ * Checks if `value` is classified as a `Symbol` primitive or object.
8297
+ *
8298
+ * @static
8299
+ * @memberOf _
8300
+ * @since 4.0.0
8301
+ * @category Lang
8302
+ * @param {*} value The value to check.
8303
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
8304
+ * @example
8305
+ *
8306
+ * _.isSymbol(Symbol.iterator);
8307
+ * // => true
8308
+ *
8309
+ * _.isSymbol('abc');
8310
+ * // => false
8311
+ */
8312
+ function isSymbol(value) {
8313
+ return typeof value == 'symbol' ||
8314
+ (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
8315
+ }
8316
+
8317
+ var isSymbol_1 = isSymbol;
8318
+
8319
+ /** Used to match property names within property paths. */
8320
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
8321
+ reIsPlainProp = /^\w*$/;
8322
+
8323
+ /**
8324
+ * Checks if `value` is a property name and not a property path.
8325
+ *
8326
+ * @private
8327
+ * @param {*} value The value to check.
8328
+ * @param {Object} [object] The object to query keys on.
8329
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
8330
+ */
8331
+ function isKey(value, object) {
8332
+ if (isArray_1(value)) {
8333
+ return false;
8334
+ }
8335
+ var type = typeof value;
8336
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
8337
+ value == null || isSymbol_1(value)) {
8338
+ return true;
8339
+ }
8340
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
8341
+ (object != null && value in Object(object));
8342
+ }
8343
+
8344
+ var _isKey = isKey;
8345
+
8346
+ /** Error message constants. */
8347
+ var FUNC_ERROR_TEXT = 'Expected a function';
8348
+
8349
+ /**
8350
+ * Creates a function that memoizes the result of `func`. If `resolver` is
8351
+ * provided, it determines the cache key for storing the result based on the
8352
+ * arguments provided to the memoized function. By default, the first argument
8353
+ * provided to the memoized function is used as the map cache key. The `func`
8354
+ * is invoked with the `this` binding of the memoized function.
8355
+ *
8356
+ * **Note:** The cache is exposed as the `cache` property on the memoized
8357
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
8358
+ * constructor with one whose instances implement the
8359
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
8360
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
8361
+ *
8362
+ * @static
8363
+ * @memberOf _
8364
+ * @since 0.1.0
8365
+ * @category Function
8366
+ * @param {Function} func The function to have its output memoized.
8367
+ * @param {Function} [resolver] The function to resolve the cache key.
8368
+ * @returns {Function} Returns the new memoized function.
8369
+ * @example
8370
+ *
8371
+ * var object = { 'a': 1, 'b': 2 };
8372
+ * var other = { 'c': 3, 'd': 4 };
8373
+ *
8374
+ * var values = _.memoize(_.values);
8375
+ * values(object);
8376
+ * // => [1, 2]
8377
+ *
8378
+ * values(other);
8379
+ * // => [3, 4]
8380
+ *
8381
+ * object.a = 2;
8382
+ * values(object);
8383
+ * // => [1, 2]
8384
+ *
8385
+ * // Modify the result cache.
8386
+ * values.cache.set(object, ['a', 'b']);
8387
+ * values(object);
8388
+ * // => ['a', 'b']
8389
+ *
8390
+ * // Replace `_.memoize.Cache`.
8391
+ * _.memoize.Cache = WeakMap;
8392
+ */
8393
+ function memoize(func, resolver) {
8394
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
8395
+ throw new TypeError(FUNC_ERROR_TEXT);
8396
+ }
8397
+ var memoized = function() {
8398
+ var args = arguments,
8399
+ key = resolver ? resolver.apply(this, args) : args[0],
8400
+ cache = memoized.cache;
8401
+
8402
+ if (cache.has(key)) {
8403
+ return cache.get(key);
8404
+ }
8405
+ var result = func.apply(this, args);
8406
+ memoized.cache = cache.set(key, result) || cache;
8407
+ return result;
8408
+ };
8409
+ memoized.cache = new (memoize.Cache || _MapCache);
8410
+ return memoized;
8411
+ }
8412
+
8413
+ // Expose `MapCache`.
8414
+ memoize.Cache = _MapCache;
8415
+
8416
+ var memoize_1 = memoize;
8417
+
8418
+ /** Used as the maximum memoize cache size. */
8419
+ var MAX_MEMOIZE_SIZE = 500;
8420
+
8421
+ /**
8422
+ * A specialized version of `_.memoize` which clears the memoized function's
8423
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
8424
+ *
8425
+ * @private
8426
+ * @param {Function} func The function to have its output memoized.
8427
+ * @returns {Function} Returns the new memoized function.
8428
+ */
8429
+ function memoizeCapped(func) {
8430
+ var result = memoize_1(func, function(key) {
8431
+ if (cache.size === MAX_MEMOIZE_SIZE) {
8432
+ cache.clear();
8433
+ }
8434
+ return key;
8435
+ });
8436
+
8437
+ var cache = result.cache;
8438
+ return result;
8439
+ }
8440
+
8441
+ var _memoizeCapped = memoizeCapped;
8442
+
8443
+ /** Used to match property names within property paths. */
8444
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
8445
+
8446
+ /** Used to match backslashes in property paths. */
8447
+ var reEscapeChar = /\\(\\)?/g;
8448
+
8449
+ /**
8450
+ * Converts `string` to a property path array.
8451
+ *
8452
+ * @private
8453
+ * @param {string} string The string to convert.
8454
+ * @returns {Array} Returns the property path array.
8455
+ */
8456
+ var stringToPath = _memoizeCapped(function(string) {
8457
+ var result = [];
8458
+ if (string.charCodeAt(0) === 46 /* . */) {
8459
+ result.push('');
8460
+ }
8461
+ string.replace(rePropName, function(match, number, quote, subString) {
8462
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
8463
+ });
8464
+ return result;
8465
+ });
8466
+
8467
+ var _stringToPath = stringToPath;
8468
+
8469
+ /** Used as references for various `Number` constants. */
8470
+ var INFINITY$1 = 1 / 0;
8471
+
8472
+ /** Used to convert symbols to primitives and strings. */
8473
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
8474
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
8475
+
8476
+ /**
8477
+ * The base implementation of `_.toString` which doesn't convert nullish
8478
+ * values to empty strings.
8479
+ *
8480
+ * @private
8481
+ * @param {*} value The value to process.
8482
+ * @returns {string} Returns the string.
8483
+ */
8484
+ function baseToString(value) {
8485
+ // Exit early for strings to avoid a performance hit in some environments.
8486
+ if (typeof value == 'string') {
8487
+ return value;
8488
+ }
8489
+ if (isArray_1(value)) {
8490
+ // Recursively convert values (susceptible to call stack limits).
8491
+ return _arrayMap(value, baseToString) + '';
8492
+ }
8493
+ if (isSymbol_1(value)) {
8494
+ return symbolToString ? symbolToString.call(value) : '';
8495
+ }
8496
+ var result = (value + '');
8497
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
8498
+ }
8499
+
8500
+ var _baseToString = baseToString;
8501
+
8502
+ /**
8503
+ * Converts `value` to a string. An empty string is returned for `null`
8504
+ * and `undefined` values. The sign of `-0` is preserved.
8505
+ *
8506
+ * @static
8507
+ * @memberOf _
8508
+ * @since 4.0.0
8509
+ * @category Lang
8510
+ * @param {*} value The value to convert.
8511
+ * @returns {string} Returns the converted string.
8512
+ * @example
8513
+ *
8514
+ * _.toString(null);
8515
+ * // => ''
8516
+ *
8517
+ * _.toString(-0);
8518
+ * // => '-0'
8519
+ *
8520
+ * _.toString([1, 2, 3]);
8521
+ * // => '1,2,3'
8522
+ */
8523
+ function toString$1(value) {
8524
+ return value == null ? '' : _baseToString(value);
8525
+ }
8526
+
8527
+ var toString_1 = toString$1;
8528
+
8529
+ /**
8530
+ * Casts `value` to a path array if it's not one.
8531
+ *
8532
+ * @private
8533
+ * @param {*} value The value to inspect.
8534
+ * @param {Object} [object] The object to query keys on.
8535
+ * @returns {Array} Returns the cast property path array.
8536
+ */
8537
+ function castPath(value, object) {
8538
+ if (isArray_1(value)) {
8539
+ return value;
8540
+ }
8541
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
8542
+ }
8543
+
8544
+ var _castPath = castPath;
8545
+
8546
+ /** Used as references for various `Number` constants. */
8547
+ var INFINITY = 1 / 0;
8548
+
8549
+ /**
8550
+ * Converts `value` to a string key if it's not a string or symbol.
8551
+ *
8552
+ * @private
8553
+ * @param {*} value The value to inspect.
8554
+ * @returns {string|symbol} Returns the key.
8555
+ */
8556
+ function toKey(value) {
8557
+ if (typeof value == 'string' || isSymbol_1(value)) {
8558
+ return value;
8559
+ }
8560
+ var result = (value + '');
8561
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
8562
+ }
8563
+
8564
+ var _toKey = toKey;
8565
+
8566
+ /**
8567
+ * The base implementation of `_.get` without support for default values.
8568
+ *
8569
+ * @private
8570
+ * @param {Object} object The object to query.
8571
+ * @param {Array|string} path The path of the property to get.
8572
+ * @returns {*} Returns the resolved value.
8573
+ */
8574
+ function baseGet(object, path) {
8575
+ path = _castPath(path, object);
8576
+
8577
+ var index = 0,
8578
+ length = path.length;
8579
+
8580
+ while (object != null && index < length) {
8581
+ object = object[_toKey(path[index++])];
8582
+ }
8583
+ return (index && index == length) ? object : undefined;
8584
+ }
8585
+
8586
+ var _baseGet = baseGet;
8587
+
8588
+ /** Used to compose bitmasks for value comparisons. */
8589
+ var COMPARE_PARTIAL_FLAG$1 = 1,
8590
+ COMPARE_UNORDERED_FLAG$1 = 2;
8591
+
8592
+ /**
8593
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
8594
+ *
8595
+ * @private
8596
+ * @param {Object} object The object to inspect.
8597
+ * @param {Object} source The object of property values to match.
8598
+ * @param {Array} matchData The property names, values, and compare flags to match.
8599
+ * @param {Function} [customizer] The function to customize comparisons.
8600
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
8601
+ */
8602
+ function baseIsMatch(object, source, matchData, customizer) {
8603
+ var index = matchData.length,
8604
+ length = index,
8605
+ noCustomizer = !customizer;
8606
+
8607
+ if (object == null) {
8608
+ return !length;
8609
+ }
8610
+ object = Object(object);
8611
+ while (index--) {
8612
+ var data = matchData[index];
8613
+ if ((noCustomizer && data[2])
8614
+ ? data[1] !== object[data[0]]
8615
+ : !(data[0] in object)
8616
+ ) {
8617
+ return false;
8618
+ }
8619
+ }
8620
+ while (++index < length) {
8621
+ data = matchData[index];
8622
+ var key = data[0],
8623
+ objValue = object[key],
8624
+ srcValue = data[1];
8625
+
8626
+ if (noCustomizer && data[2]) {
8627
+ if (objValue === undefined && !(key in object)) {
8628
+ return false;
8629
+ }
8630
+ } else {
8631
+ var stack = new _Stack;
8632
+ if (customizer) {
8633
+ var result = customizer(objValue, srcValue, key, object, source, stack);
8634
+ }
8635
+ if (!(result === undefined
8636
+ ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack)
8637
+ : result
8638
+ )) {
8639
+ return false;
8640
+ }
8641
+ }
8642
+ }
8643
+ return true;
8644
+ }
8645
+
8646
+ var _baseIsMatch = baseIsMatch;
8647
+
8648
+ /**
8649
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
8650
+ *
8651
+ * @private
8652
+ * @param {*} value The value to check.
8653
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
8654
+ * equality comparisons, else `false`.
8655
+ */
8656
+ function isStrictComparable(value) {
8657
+ return value === value && !isObject_1(value);
8658
+ }
8659
+
8660
+ var _isStrictComparable = isStrictComparable;
8661
+
8662
+ /**
8663
+ * Gets the property names, values, and compare flags of `object`.
8664
+ *
8665
+ * @private
8666
+ * @param {Object} object The object to query.
8667
+ * @returns {Array} Returns the match data of `object`.
8668
+ */
8669
+ function getMatchData(object) {
8670
+ var result = keys_1(object),
8671
+ length = result.length;
8672
+
8673
+ while (length--) {
8674
+ var key = result[length],
8675
+ value = object[key];
8676
+
8677
+ result[length] = [key, value, _isStrictComparable(value)];
8678
+ }
8679
+ return result;
8680
+ }
8681
+
8682
+ var _getMatchData = getMatchData;
8683
+
8684
+ /**
8685
+ * A specialized version of `matchesProperty` for source values suitable
8686
+ * for strict equality comparisons, i.e. `===`.
8687
+ *
8688
+ * @private
8689
+ * @param {string} key The key of the property to get.
8690
+ * @param {*} srcValue The value to match.
8691
+ * @returns {Function} Returns the new spec function.
8692
+ */
8693
+ function matchesStrictComparable(key, srcValue) {
8694
+ return function(object) {
8695
+ if (object == null) {
8696
+ return false;
8697
+ }
8698
+ return object[key] === srcValue &&
8699
+ (srcValue !== undefined || (key in Object(object)));
8700
+ };
8701
+ }
8702
+
8703
+ var _matchesStrictComparable = matchesStrictComparable;
8704
+
8705
+ /**
8706
+ * The base implementation of `_.matches` which doesn't clone `source`.
8707
+ *
8708
+ * @private
8709
+ * @param {Object} source The object of property values to match.
8710
+ * @returns {Function} Returns the new spec function.
8711
+ */
8712
+ function baseMatches(source) {
8713
+ var matchData = _getMatchData(source);
8714
+ if (matchData.length == 1 && matchData[0][2]) {
8715
+ return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
8716
+ }
8717
+ return function(object) {
8718
+ return object === source || _baseIsMatch(object, source, matchData);
8719
+ };
8720
+ }
8721
+
8722
+ var _baseMatches = baseMatches;
8723
+
8724
+ /**
8725
+ * Gets the value at `path` of `object`. If the resolved value is
8726
+ * `undefined`, the `defaultValue` is returned in its place.
8727
+ *
8728
+ * @static
8729
+ * @memberOf _
8730
+ * @since 3.7.0
8731
+ * @category Object
8732
+ * @param {Object} object The object to query.
8733
+ * @param {Array|string} path The path of the property to get.
8734
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
8735
+ * @returns {*} Returns the resolved value.
8736
+ * @example
8737
+ *
8738
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
8739
+ *
8740
+ * _.get(object, 'a[0].b.c');
8741
+ * // => 3
8742
+ *
8743
+ * _.get(object, ['a', '0', 'b', 'c']);
8744
+ * // => 3
8745
+ *
8746
+ * _.get(object, 'a.b.c', 'default');
8747
+ * // => 'default'
8748
+ */
8749
+ function get(object, path, defaultValue) {
8750
+ var result = object == null ? undefined : _baseGet(object, path);
8751
+ return result === undefined ? defaultValue : result;
8752
+ }
8753
+
8754
+ var get_1 = get;
8755
+
8756
+ /**
8757
+ * The base implementation of `_.hasIn` without support for deep paths.
8758
+ *
8759
+ * @private
8760
+ * @param {Object} [object] The object to query.
8761
+ * @param {Array|string} key The key to check.
8762
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
8763
+ */
8764
+ function baseHasIn(object, key) {
8765
+ return object != null && key in Object(object);
8766
+ }
8767
+
8768
+ var _baseHasIn = baseHasIn;
8769
+
8770
+ /**
8771
+ * Checks if `path` exists on `object`.
8772
+ *
8773
+ * @private
8774
+ * @param {Object} object The object to query.
8775
+ * @param {Array|string} path The path to check.
8776
+ * @param {Function} hasFunc The function to check properties.
8777
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
8778
+ */
8779
+ function hasPath(object, path, hasFunc) {
8780
+ path = _castPath(path, object);
8781
+
8782
+ var index = -1,
8783
+ length = path.length,
8784
+ result = false;
8785
+
8786
+ while (++index < length) {
8787
+ var key = _toKey(path[index]);
8788
+ if (!(result = object != null && hasFunc(object, key))) {
8789
+ break;
8790
+ }
8791
+ object = object[key];
8792
+ }
8793
+ if (result || ++index != length) {
8794
+ return result;
8795
+ }
8796
+ length = object == null ? 0 : object.length;
8797
+ return !!length && isLength_1(length) && _isIndex(key, length) &&
8798
+ (isArray_1(object) || isArguments_1(object));
8799
+ }
8800
+
8801
+ var _hasPath = hasPath;
8802
+
8803
+ /**
8804
+ * Checks if `path` is a direct or inherited property of `object`.
8805
+ *
8806
+ * @static
8807
+ * @memberOf _
8808
+ * @since 4.0.0
8809
+ * @category Object
8810
+ * @param {Object} object The object to query.
8811
+ * @param {Array|string} path The path to check.
8812
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
8813
+ * @example
8814
+ *
8815
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
8816
+ *
8817
+ * _.hasIn(object, 'a');
8818
+ * // => true
8819
+ *
8820
+ * _.hasIn(object, 'a.b');
8821
+ * // => true
8822
+ *
8823
+ * _.hasIn(object, ['a', 'b']);
8824
+ * // => true
8825
+ *
8826
+ * _.hasIn(object, 'b');
8827
+ * // => false
8828
+ */
8829
+ function hasIn(object, path) {
8830
+ return object != null && _hasPath(object, path, _baseHasIn);
8831
+ }
8832
+
8833
+ var hasIn_1 = hasIn;
8834
+
8835
+ /** Used to compose bitmasks for value comparisons. */
8836
+ var COMPARE_PARTIAL_FLAG = 1,
8837
+ COMPARE_UNORDERED_FLAG = 2;
8838
+
8839
+ /**
8840
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
8841
+ *
8842
+ * @private
8843
+ * @param {string} path The path of the property to get.
8844
+ * @param {*} srcValue The value to match.
8845
+ * @returns {Function} Returns the new spec function.
8846
+ */
8847
+ function baseMatchesProperty(path, srcValue) {
8848
+ if (_isKey(path) && _isStrictComparable(srcValue)) {
8849
+ return _matchesStrictComparable(_toKey(path), srcValue);
8850
+ }
8851
+ return function(object) {
8852
+ var objValue = get_1(object, path);
8853
+ return (objValue === undefined && objValue === srcValue)
8854
+ ? hasIn_1(object, path)
8855
+ : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
8856
+ };
8857
+ }
8858
+
8859
+ var _baseMatchesProperty = baseMatchesProperty;
8860
+
8861
+ /**
8862
+ * This method returns the first argument it receives.
8863
+ *
8864
+ * @static
8865
+ * @since 0.1.0
8866
+ * @memberOf _
8867
+ * @category Util
8868
+ * @param {*} value Any value.
8869
+ * @returns {*} Returns `value`.
8870
+ * @example
8871
+ *
8872
+ * var object = { 'a': 1 };
8873
+ *
8874
+ * console.log(_.identity(object) === object);
8875
+ * // => true
8876
+ */
8877
+ function identity(value) {
8878
+ return value;
8879
+ }
8880
+
8881
+ var identity_1 = identity;
8882
+
8883
+ /**
8884
+ * The base implementation of `_.property` without support for deep paths.
8885
+ *
8886
+ * @private
8887
+ * @param {string} key The key of the property to get.
8888
+ * @returns {Function} Returns the new accessor function.
8889
+ */
8890
+ function baseProperty(key) {
8891
+ return function(object) {
8892
+ return object == null ? undefined : object[key];
8893
+ };
8894
+ }
8895
+
8896
+ var _baseProperty = baseProperty;
8897
+
8898
+ /**
8899
+ * A specialized version of `baseProperty` which supports deep paths.
8900
+ *
8901
+ * @private
8902
+ * @param {Array|string} path The path of the property to get.
8903
+ * @returns {Function} Returns the new accessor function.
8904
+ */
8905
+ function basePropertyDeep(path) {
8906
+ return function(object) {
8907
+ return _baseGet(object, path);
8908
+ };
8909
+ }
8910
+
8911
+ var _basePropertyDeep = basePropertyDeep;
8912
+
8913
+ /**
8914
+ * Creates a function that returns the value at `path` of a given object.
8915
+ *
8916
+ * @static
8917
+ * @memberOf _
8918
+ * @since 2.4.0
8919
+ * @category Util
8920
+ * @param {Array|string} path The path of the property to get.
8921
+ * @returns {Function} Returns the new accessor function.
8922
+ * @example
8923
+ *
8924
+ * var objects = [
8925
+ * { 'a': { 'b': 2 } },
8926
+ * { 'a': { 'b': 1 } }
8927
+ * ];
8928
+ *
8929
+ * _.map(objects, _.property('a.b'));
8930
+ * // => [2, 1]
8931
+ *
8932
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
8933
+ * // => [1, 2]
8934
+ */
8935
+ function property(path) {
8936
+ return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
8937
+ }
8938
+
8939
+ var property_1 = property;
8940
+
8941
+ /**
8942
+ * The base implementation of `_.iteratee`.
8943
+ *
8944
+ * @private
8945
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
8946
+ * @returns {Function} Returns the iteratee.
8947
+ */
8948
+ function baseIteratee(value) {
8949
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
8950
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
8951
+ if (typeof value == 'function') {
8952
+ return value;
8953
+ }
8954
+ if (value == null) {
8955
+ return identity_1;
8956
+ }
8957
+ if (typeof value == 'object') {
8958
+ return isArray_1(value)
8959
+ ? _baseMatchesProperty(value[0], value[1])
8960
+ : _baseMatches(value);
8961
+ }
8962
+ return property_1(value);
8963
+ }
8964
+
8965
+ var _baseIteratee = baseIteratee;
8966
+
8967
+ /**
8968
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
8969
+ *
8970
+ * @private
8971
+ * @param {boolean} [fromRight] Specify iterating from right to left.
8972
+ * @returns {Function} Returns the new base function.
8973
+ */
8974
+ function createBaseFor(fromRight) {
8975
+ return function(object, iteratee, keysFunc) {
8976
+ var index = -1,
8977
+ iterable = Object(object),
8978
+ props = keysFunc(object),
8979
+ length = props.length;
8980
+
8981
+ while (length--) {
8982
+ var key = props[fromRight ? length : ++index];
8983
+ if (iteratee(iterable[key], key, iterable) === false) {
8984
+ break;
8985
+ }
8986
+ }
8987
+ return object;
8988
+ };
8989
+ }
8990
+
8991
+ var _createBaseFor = createBaseFor;
8992
+
8993
+ /**
8994
+ * The base implementation of `baseForOwn` which iterates over `object`
8995
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
8996
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
8997
+ *
8998
+ * @private
8999
+ * @param {Object} object The object to iterate over.
9000
+ * @param {Function} iteratee The function invoked per iteration.
9001
+ * @param {Function} keysFunc The function to get the keys of `object`.
9002
+ * @returns {Object} Returns `object`.
9003
+ */
9004
+ var baseFor = _createBaseFor();
9005
+
9006
+ var _baseFor = baseFor;
9007
+
9008
+ /**
9009
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
9010
+ *
9011
+ * @private
9012
+ * @param {Object} object The object to iterate over.
9013
+ * @param {Function} iteratee The function invoked per iteration.
9014
+ * @returns {Object} Returns `object`.
9015
+ */
9016
+ function baseForOwn(object, iteratee) {
9017
+ return object && _baseFor(object, iteratee, keys_1);
9018
+ }
9019
+
9020
+ var _baseForOwn = baseForOwn;
9021
+
9022
+ /**
9023
+ * Creates a `baseEach` or `baseEachRight` function.
9024
+ *
9025
+ * @private
9026
+ * @param {Function} eachFunc The function to iterate over a collection.
9027
+ * @param {boolean} [fromRight] Specify iterating from right to left.
9028
+ * @returns {Function} Returns the new base function.
9029
+ */
9030
+ function createBaseEach(eachFunc, fromRight) {
9031
+ return function(collection, iteratee) {
9032
+ if (collection == null) {
9033
+ return collection;
9034
+ }
9035
+ if (!isArrayLike_1(collection)) {
9036
+ return eachFunc(collection, iteratee);
9037
+ }
9038
+ var length = collection.length,
9039
+ index = fromRight ? length : -1,
9040
+ iterable = Object(collection);
9041
+
9042
+ while ((fromRight ? index-- : ++index < length)) {
9043
+ if (iteratee(iterable[index], index, iterable) === false) {
9044
+ break;
9045
+ }
9046
+ }
9047
+ return collection;
9048
+ };
9049
+ }
9050
+
9051
+ var _createBaseEach = createBaseEach;
9052
+
9053
+ /**
9054
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
9055
+ *
9056
+ * @private
9057
+ * @param {Array|Object} collection The collection to iterate over.
9058
+ * @param {Function} iteratee The function invoked per iteration.
9059
+ * @returns {Array|Object} Returns `collection`.
9060
+ */
9061
+ var baseEach = _createBaseEach(_baseForOwn);
9062
+
9063
+ var _baseEach = baseEach;
9064
+
9065
+ /**
9066
+ * The base implementation of `_.map` without support for iteratee shorthands.
9067
+ *
9068
+ * @private
9069
+ * @param {Array|Object} collection The collection to iterate over.
9070
+ * @param {Function} iteratee The function invoked per iteration.
9071
+ * @returns {Array} Returns the new mapped array.
9072
+ */
9073
+ function baseMap(collection, iteratee) {
9074
+ var index = -1,
9075
+ result = isArrayLike_1(collection) ? Array(collection.length) : [];
9076
+
9077
+ _baseEach(collection, function(value, key, collection) {
9078
+ result[++index] = iteratee(value, key, collection);
9079
+ });
9080
+ return result;
9081
+ }
9082
+
9083
+ var _baseMap = baseMap;
9084
+
9085
+ /**
9086
+ * The base implementation of `_.sortBy` which uses `comparer` to define the
9087
+ * sort order of `array` and replaces criteria objects with their corresponding
9088
+ * values.
9089
+ *
9090
+ * @private
9091
+ * @param {Array} array The array to sort.
9092
+ * @param {Function} comparer The function to define sort order.
9093
+ * @returns {Array} Returns `array`.
9094
+ */
9095
+ function baseSortBy(array, comparer) {
9096
+ var length = array.length;
9097
+
9098
+ array.sort(comparer);
9099
+ while (length--) {
9100
+ array[length] = array[length].value;
9101
+ }
9102
+ return array;
9103
+ }
9104
+
9105
+ var _baseSortBy = baseSortBy;
9106
+
9107
+ /**
9108
+ * Compares values to sort them in ascending order.
9109
+ *
9110
+ * @private
9111
+ * @param {*} value The value to compare.
9112
+ * @param {*} other The other value to compare.
9113
+ * @returns {number} Returns the sort order indicator for `value`.
9114
+ */
9115
+ function compareAscending(value, other) {
9116
+ if (value !== other) {
9117
+ var valIsDefined = value !== undefined,
9118
+ valIsNull = value === null,
9119
+ valIsReflexive = value === value,
9120
+ valIsSymbol = isSymbol_1(value);
9121
+
9122
+ var othIsDefined = other !== undefined,
9123
+ othIsNull = other === null,
9124
+ othIsReflexive = other === other,
9125
+ othIsSymbol = isSymbol_1(other);
9126
+
9127
+ if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
9128
+ (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
9129
+ (valIsNull && othIsDefined && othIsReflexive) ||
9130
+ (!valIsDefined && othIsReflexive) ||
9131
+ !valIsReflexive) {
9132
+ return 1;
9133
+ }
9134
+ if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
9135
+ (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
9136
+ (othIsNull && valIsDefined && valIsReflexive) ||
9137
+ (!othIsDefined && valIsReflexive) ||
9138
+ !othIsReflexive) {
9139
+ return -1;
9140
+ }
9141
+ }
9142
+ return 0;
9143
+ }
9144
+
9145
+ var _compareAscending = compareAscending;
9146
+
9147
+ /**
9148
+ * Used by `_.orderBy` to compare multiple properties of a value to another
9149
+ * and stable sort them.
9150
+ *
9151
+ * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
9152
+ * specify an order of "desc" for descending or "asc" for ascending sort order
9153
+ * of corresponding values.
9154
+ *
9155
+ * @private
9156
+ * @param {Object} object The object to compare.
9157
+ * @param {Object} other The other object to compare.
9158
+ * @param {boolean[]|string[]} orders The order to sort by for each property.
9159
+ * @returns {number} Returns the sort order indicator for `object`.
9160
+ */
9161
+ function compareMultiple(object, other, orders) {
9162
+ var index = -1,
9163
+ objCriteria = object.criteria,
9164
+ othCriteria = other.criteria,
9165
+ length = objCriteria.length,
9166
+ ordersLength = orders.length;
9167
+
9168
+ while (++index < length) {
9169
+ var result = _compareAscending(objCriteria[index], othCriteria[index]);
9170
+ if (result) {
9171
+ if (index >= ordersLength) {
9172
+ return result;
9173
+ }
9174
+ var order = orders[index];
9175
+ return result * (order == 'desc' ? -1 : 1);
9176
+ }
9177
+ }
9178
+ // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
9179
+ // that causes it, under certain circumstances, to provide the same value for
9180
+ // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
9181
+ // for more details.
9182
+ //
9183
+ // This also ensures a stable sort in V8 and other engines.
9184
+ // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
9185
+ return object.index - other.index;
9186
+ }
9187
+
9188
+ var _compareMultiple = compareMultiple;
9189
+
9190
+ /**
9191
+ * The base implementation of `_.orderBy` without param guards.
9192
+ *
9193
+ * @private
9194
+ * @param {Array|Object} collection The collection to iterate over.
9195
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
9196
+ * @param {string[]} orders The sort orders of `iteratees`.
9197
+ * @returns {Array} Returns the new sorted array.
9198
+ */
9199
+ function baseOrderBy(collection, iteratees, orders) {
9200
+ if (iteratees.length) {
9201
+ iteratees = _arrayMap(iteratees, function(iteratee) {
9202
+ if (isArray_1(iteratee)) {
9203
+ return function(value) {
9204
+ return _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
9205
+ }
9206
+ }
9207
+ return iteratee;
9208
+ });
9209
+ } else {
9210
+ iteratees = [identity_1];
9211
+ }
9212
+
9213
+ var index = -1;
9214
+ iteratees = _arrayMap(iteratees, _baseUnary(_baseIteratee));
9215
+
9216
+ var result = _baseMap(collection, function(value, key, collection) {
9217
+ var criteria = _arrayMap(iteratees, function(iteratee) {
9218
+ return iteratee(value);
9219
+ });
9220
+ return { 'criteria': criteria, 'index': ++index, 'value': value };
9221
+ });
9222
+
9223
+ return _baseSortBy(result, function(object, other) {
9224
+ return _compareMultiple(object, other, orders);
9225
+ });
9226
+ }
9227
+
9228
+ var _baseOrderBy = baseOrderBy;
9229
+
9230
+ /**
9231
+ * A faster alternative to `Function#apply`, this function invokes `func`
9232
+ * with the `this` binding of `thisArg` and the arguments of `args`.
9233
+ *
9234
+ * @private
9235
+ * @param {Function} func The function to invoke.
9236
+ * @param {*} thisArg The `this` binding of `func`.
9237
+ * @param {Array} args The arguments to invoke `func` with.
9238
+ * @returns {*} Returns the result of `func`.
9239
+ */
9240
+ function apply(func, thisArg, args) {
9241
+ switch (args.length) {
9242
+ case 0: return func.call(thisArg);
9243
+ case 1: return func.call(thisArg, args[0]);
9244
+ case 2: return func.call(thisArg, args[0], args[1]);
9245
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
9246
+ }
9247
+ return func.apply(thisArg, args);
9248
+ }
9249
+
9250
+ var _apply = apply;
9251
+
9252
+ /* Built-in method references for those with the same name as other `lodash` methods. */
9253
+ var nativeMax = Math.max;
9254
+
9255
+ /**
9256
+ * A specialized version of `baseRest` which transforms the rest array.
9257
+ *
9258
+ * @private
9259
+ * @param {Function} func The function to apply a rest parameter to.
9260
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
9261
+ * @param {Function} transform The rest array transform.
9262
+ * @returns {Function} Returns the new function.
9263
+ */
9264
+ function overRest(func, start, transform) {
9265
+ start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
9266
+ return function() {
9267
+ var args = arguments,
9268
+ index = -1,
9269
+ length = nativeMax(args.length - start, 0),
9270
+ array = Array(length);
9271
+
9272
+ while (++index < length) {
9273
+ array[index] = args[start + index];
9274
+ }
9275
+ index = -1;
9276
+ var otherArgs = Array(start + 1);
9277
+ while (++index < start) {
9278
+ otherArgs[index] = args[index];
9279
+ }
9280
+ otherArgs[start] = transform(array);
9281
+ return _apply(func, this, otherArgs);
9282
+ };
9283
+ }
9284
+
9285
+ var _overRest = overRest;
9286
+
9287
+ /**
9288
+ * Creates a function that returns `value`.
9289
+ *
9290
+ * @static
9291
+ * @memberOf _
9292
+ * @since 2.4.0
9293
+ * @category Util
9294
+ * @param {*} value The value to return from the new function.
9295
+ * @returns {Function} Returns the new constant function.
9296
+ * @example
9297
+ *
9298
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
9299
+ *
9300
+ * console.log(objects);
9301
+ * // => [{ 'a': 1 }, { 'a': 1 }]
9302
+ *
9303
+ * console.log(objects[0] === objects[1]);
9304
+ * // => true
9305
+ */
9306
+ function constant(value) {
9307
+ return function() {
9308
+ return value;
9309
+ };
9310
+ }
9311
+
9312
+ var constant_1 = constant;
9313
+
9314
+ var defineProperty = (function() {
9315
+ try {
9316
+ var func = _getNative(Object, 'defineProperty');
9317
+ func({}, '', {});
9318
+ return func;
9319
+ } catch (e) {}
9320
+ }());
9321
+
9322
+ var _defineProperty = defineProperty;
9323
+
9324
+ /**
9325
+ * The base implementation of `setToString` without support for hot loop shorting.
9326
+ *
9327
+ * @private
9328
+ * @param {Function} func The function to modify.
9329
+ * @param {Function} string The `toString` result.
9330
+ * @returns {Function} Returns `func`.
9331
+ */
9332
+ var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
9333
+ return _defineProperty(func, 'toString', {
9334
+ 'configurable': true,
9335
+ 'enumerable': false,
9336
+ 'value': constant_1(string),
9337
+ 'writable': true
9338
+ });
9339
+ };
9340
+
9341
+ var _baseSetToString = baseSetToString;
9342
+
9343
+ /** Used to detect hot functions by number of calls within a span of milliseconds. */
9344
+ var HOT_COUNT = 800,
9345
+ HOT_SPAN = 16;
9346
+
9347
+ /* Built-in method references for those with the same name as other `lodash` methods. */
9348
+ var nativeNow = Date.now;
9349
+
9350
+ /**
9351
+ * Creates a function that'll short out and invoke `identity` instead
9352
+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
9353
+ * milliseconds.
9354
+ *
9355
+ * @private
9356
+ * @param {Function} func The function to restrict.
9357
+ * @returns {Function} Returns the new shortable function.
9358
+ */
9359
+ function shortOut(func) {
9360
+ var count = 0,
9361
+ lastCalled = 0;
9362
+
9363
+ return function() {
9364
+ var stamp = nativeNow(),
9365
+ remaining = HOT_SPAN - (stamp - lastCalled);
9366
+
9367
+ lastCalled = stamp;
9368
+ if (remaining > 0) {
9369
+ if (++count >= HOT_COUNT) {
9370
+ return arguments[0];
9371
+ }
9372
+ } else {
9373
+ count = 0;
9374
+ }
9375
+ return func.apply(undefined, arguments);
9376
+ };
9377
+ }
9378
+
9379
+ var _shortOut = shortOut;
9380
+
9381
+ /**
9382
+ * Sets the `toString` method of `func` to return `string`.
9383
+ *
9384
+ * @private
9385
+ * @param {Function} func The function to modify.
9386
+ * @param {Function} string The `toString` result.
9387
+ * @returns {Function} Returns `func`.
9388
+ */
9389
+ var setToString = _shortOut(_baseSetToString);
9390
+
9391
+ var _setToString = setToString;
9392
+
9393
+ /**
9394
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
9395
+ *
9396
+ * @private
9397
+ * @param {Function} func The function to apply a rest parameter to.
9398
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
9399
+ * @returns {Function} Returns the new function.
9400
+ */
9401
+ function baseRest(func, start) {
9402
+ return _setToString(_overRest(func, start, identity_1), func + '');
9403
+ }
9404
+
9405
+ var _baseRest = baseRest;
9406
+
9407
+ /**
9408
+ * Checks if the given arguments are from an iteratee call.
9409
+ *
9410
+ * @private
9411
+ * @param {*} value The potential iteratee value argument.
9412
+ * @param {*} index The potential iteratee index or key argument.
9413
+ * @param {*} object The potential iteratee object argument.
9414
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
9415
+ * else `false`.
9416
+ */
9417
+ function isIterateeCall(value, index, object) {
9418
+ if (!isObject_1(object)) {
9419
+ return false;
9420
+ }
9421
+ var type = typeof index;
9422
+ if (type == 'number'
9423
+ ? (isArrayLike_1(object) && _isIndex(index, object.length))
9424
+ : (type == 'string' && index in object)
9425
+ ) {
9426
+ return eq_1(object[index], value);
9427
+ }
9428
+ return false;
9429
+ }
9430
+
9431
+ var _isIterateeCall = isIterateeCall;
9432
+
9433
+ /**
9434
+ * Creates an array of elements, sorted in ascending order by the results of
9435
+ * running each element in a collection thru each iteratee. This method
9436
+ * performs a stable sort, that is, it preserves the original sort order of
9437
+ * equal elements. The iteratees are invoked with one argument: (value).
9438
+ *
9439
+ * @static
9440
+ * @memberOf _
9441
+ * @since 0.1.0
9442
+ * @category Collection
9443
+ * @param {Array|Object} collection The collection to iterate over.
9444
+ * @param {...(Function|Function[])} [iteratees=[_.identity]]
9445
+ * The iteratees to sort by.
9446
+ * @returns {Array} Returns the new sorted array.
9447
+ * @example
9448
+ *
9449
+ * var users = [
9450
+ * { 'user': 'fred', 'age': 48 },
9451
+ * { 'user': 'barney', 'age': 36 },
9452
+ * { 'user': 'fred', 'age': 30 },
9453
+ * { 'user': 'barney', 'age': 34 }
9454
+ * ];
9455
+ *
9456
+ * _.sortBy(users, [function(o) { return o.user; }]);
9457
+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
9458
+ *
9459
+ * _.sortBy(users, ['user', 'age']);
9460
+ * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
9461
+ */
9462
+ var sortBy = _baseRest(function(collection, iteratees) {
9463
+ if (collection == null) {
9464
+ return [];
9465
+ }
9466
+ var length = iteratees.length;
9467
+ if (length > 1 && _isIterateeCall(collection, iteratees[0], iteratees[1])) {
9468
+ iteratees = [];
9469
+ } else if (length > 2 && _isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
9470
+ iteratees = [iteratees[0]];
9471
+ }
9472
+ return _baseOrderBy(collection, _baseFlatten(iteratees, 1), []);
9473
+ });
9474
+
9475
+ var sortBy_1 = sortBy;
9476
+
9477
+ /**
9478
+ * Configuration for custom action validation rules.
9479
+ * Defines allowed positions, metadata IDs, data model IDs, and fields for each target
9480
+ * type.
9481
+ *
9482
+ */
9483
+ const customActionValidationConfig = {
9484
+ [exports.CustomActionTarget.LIVEBOARD]: {
9485
+ positions: [exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.MENU],
9486
+ allowedMetadataIds: ['liveboardIds'],
9487
+ allowedDataModelIds: [],
9488
+ allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds'],
9489
+ },
9490
+ [exports.CustomActionTarget.VIZ]: {
9491
+ positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
9492
+ allowedMetadataIds: ['liveboardIds', 'vizIds', 'answerIds'],
9493
+ allowedDataModelIds: ['modelIds', 'modelColumnNames'],
9494
+ allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
9495
+ },
9496
+ [exports.CustomActionTarget.ANSWER]: {
9497
+ positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
9498
+ allowedMetadataIds: ['answerIds'],
9499
+ allowedDataModelIds: ['modelIds', 'modelColumnNames'],
9500
+ allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
9501
+ },
9502
+ [exports.CustomActionTarget.SPOTTER]: {
9503
+ positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.CONTEXTMENU],
9504
+ allowedMetadataIds: [],
9505
+ allowedDataModelIds: ['modelIds'],
9506
+ allowedFields: ['name', 'id', 'position', 'target', 'orgIds', 'groupIds', 'dataModelIds'],
9507
+ },
9508
+ };
9509
+ /**
9510
+ * Validates a single custom action based on its target type
9511
+ * @param action - The custom action to validate
9512
+ * @param primaryActionsPerTarget - Map to track primary actions per target
9513
+ * @returns CustomActionValidation with isValid flag and reason string
9514
+ *
9515
+ * @hidden
9516
+ */
9517
+ const validateCustomAction = (action, primaryActionsPerTarget) => {
9518
+ const { id: actionId, target: targetType, position, metadataIds, dataModelIds } = action;
9519
+ // Check if target type is supported
9520
+ if (!customActionValidationConfig[targetType]) {
9521
+ const errorMessage = CUSTOM_ACTIONS_ERROR_MESSAGE.UNSUPPORTED_TARGET(actionId, targetType);
9522
+ return { isValid: false, errors: [errorMessage] };
9523
+ }
9524
+ const config = customActionValidationConfig[targetType];
9525
+ const errors = [];
9526
+ // Validate position
9527
+ if (!arrayIncludesString(config.positions, position)) {
9528
+ const supportedPositions = config.positions.join(', ');
9529
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_POSITION(position, targetType, supportedPositions));
9530
+ }
9531
+ // Validate metadata IDs
9532
+ if (metadataIds) {
9533
+ const invalidMetadataIds = Object.keys(metadataIds).filter((key) => !arrayIncludesString(config.allowedMetadataIds, key));
9534
+ if (invalidMetadataIds.length > 0) {
9535
+ const supportedMetadataIds = config.allowedMetadataIds.length > 0 ? config.allowedMetadataIds.join(', ') : 'none';
9536
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_METADATA_IDS(targetType, invalidMetadataIds, supportedMetadataIds));
9537
+ }
8009
9538
  }
8010
- /**
8011
- * Get the internal session details for the answer.
8012
- * @returns
8013
- */
8014
- getSession() {
8015
- return this.session;
8016
- }
8017
- async getAnswer() {
8018
- if (this.answer) {
8019
- return this.answer;
9539
+ // Validate data model IDs
9540
+ if (dataModelIds) {
9541
+ const invalidDataModelIds = Object.keys(dataModelIds).filter((key) => !arrayIncludesString(config.allowedDataModelIds, key));
9542
+ if (invalidDataModelIds.length > 0) {
9543
+ const supportedDataModelIds = config.allowedDataModelIds.length > 0 ? config.allowedDataModelIds.join(', ') : 'none';
9544
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_DATA_MODEL_IDS(targetType, invalidDataModelIds, supportedDataModelIds));
8020
9545
  }
8021
- this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
8022
- return this.answer;
8023
- }
8024
- async getTML() {
8025
- const { object } = await this.executeQuery(getAnswerTML, {});
8026
- const edoc = object[0].edoc;
8027
- const YAML = await Promise.resolve().then(function () { return index; });
8028
- const parsedDoc = YAML.parse(edoc);
8029
- return {
8030
- answer: {
8031
- ...parsedDoc.answer,
8032
- ...this.tmlOverride,
8033
- },
8034
- };
8035
9546
  }
8036
- async addDisplayedVizToLiveboard(liveboardId) {
8037
- const { displayMode, visualizations } = await this.getAnswer();
8038
- const viz = getDisplayedViz(visualizations, displayMode);
8039
- return this.executeQuery(addVizToLiveboard, {
8040
- liveboardId,
8041
- vizId: viz.id,
8042
- });
8043
- }
8044
- setTMLOverride(override) {
8045
- this.tmlOverride = override;
9547
+ // Validate allowed fields
9548
+ const actionKeys = Object.keys(action);
9549
+ const invalidFields = actionKeys.filter((key) => !arrayIncludesString(config.allowedFields, key));
9550
+ if (invalidFields.length > 0) {
9551
+ const supportedFields = config.allowedFields.join(', ');
9552
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_FIELDS(targetType, invalidFields, supportedFields));
8046
9553
  }
8047
- }
9554
+ return {
9555
+ isValid: errors.length === 0,
9556
+ errors,
9557
+ };
9558
+ };
8048
9559
  /**
9560
+ * Validates basic action structure and required fields
9561
+ * @param action - The action to validate
9562
+ * @returns Object containing validation result and missing fields
8049
9563
  *
8050
- * @param sourceDetail
8051
- * @param colNames
9564
+ * @hidden
8052
9565
  */
8053
- function getGuidsFromColumnNames(sourceDetail, colNames) {
8054
- const cols = sourceDetail.columns.reduce((colSet, col) => {
8055
- colSet[col.name.toLowerCase()] = col;
8056
- return colSet;
8057
- }, {});
8058
- return new Set(colNames.map((colName) => {
8059
- const col = cols[colName.toLowerCase()];
8060
- return col.id;
8061
- }));
8062
- }
9566
+ const validateActionStructure = (action) => {
9567
+ if (!action || typeof action !== 'object') {
9568
+ return { isValid: false, missingFields: [] };
9569
+ }
9570
+ // Check for all missing required fields
9571
+ const missingFields = ['id', 'name', 'target', 'position'].filter(field => !action[field]);
9572
+ return { isValid: missingFields.length === 0, missingFields };
9573
+ };
8063
9574
  /**
9575
+ * Checks for duplicate IDs among actions
9576
+ * @param actions - Array of actions to check
9577
+ * @returns Object containing filtered actions and duplicate errors
8064
9578
  *
8065
- * @param selectedPoints
9579
+ * @hidden
8066
9580
  */
8067
- function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
8068
- const underlyingDataPoint = [];
8069
- /**
8070
- *
8071
- * @param colVal
8072
- */
8073
- function addPointFromColVal(colVal) {
8074
- var _a;
8075
- const dataType = colVal.column.dataType;
8076
- colVal.column.id;
8077
- let dataValue;
8078
- if (dataType === 'DATE') {
8079
- if (Number.isFinite(colVal.value)) {
8080
- dataValue = [{
8081
- epochRange: {
8082
- startEpoch: colVal.value,
8083
- },
8084
- }];
8085
- // Case for custom calendar.
8086
- }
8087
- else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
8088
- dataValue = [{
8089
- epochRange: {
8090
- startEpoch: colVal.value.v.s,
8091
- endEpoch: colVal.value.v.e,
8092
- },
8093
- }];
8094
- }
9581
+ const filterDuplicateIds = (actions) => {
9582
+ const idMap = actions.reduce((map, action) => {
9583
+ const list = map.get(action.id) || [];
9584
+ list.push(action);
9585
+ map.set(action.id, list);
9586
+ return map;
9587
+ }, new Map());
9588
+ const { actions: actionsWithUniqueIds, errors } = Array.from(idMap.entries()).reduce((acc, [id, actionsWithSameId]) => {
9589
+ if (actionsWithSameId.length === 1) {
9590
+ acc.actions.push(actionsWithSameId[0]);
8095
9591
  }
8096
9592
  else {
8097
- dataValue = [{ value: colVal.value }];
9593
+ // Keep the first action and add error for duplicates
9594
+ acc.actions.push(actionsWithSameId[0]);
9595
+ const duplicateNames = actionsWithSameId.slice(1).map(action => action.name);
9596
+ acc.errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.DUPLICATE_IDS(id, duplicateNames, actionsWithSameId[0].name));
8098
9597
  }
8099
- underlyingDataPoint.push({
8100
- columnId: colVal.column.id,
8101
- dataValue,
8102
- });
8103
- }
8104
- selectedPoints.forEach((p) => {
8105
- p.selectedAttributes.forEach(addPointFromColVal);
8106
- });
8107
- return underlyingDataPoint;
8108
- }
9598
+ return acc;
9599
+ }, { actions: [], errors: [] });
9600
+ return { actions: actionsWithUniqueIds, errors };
9601
+ };
8109
9602
  /**
8110
- *
8111
- * @param visualizations
8112
- * @param displayMode
9603
+ * Validates and processes custom actions
9604
+ * @param customActions - Array of custom actions to validate
9605
+ * @returns Object containing valid actions and any validation errors
8113
9606
  */
8114
- function getDisplayedViz(visualizations, displayMode) {
8115
- if (displayMode === 'CHART_MODE') {
8116
- return visualizations.find(
8117
- // eslint-disable-next-line no-underscore-dangle
8118
- (viz) => viz.__typename === 'ChartViz');
8119
- }
8120
- return visualizations.find(
8121
- // eslint-disable-next-line no-underscore-dangle
8122
- (viz) => viz.__typename === 'TableViz');
8123
- }
9607
+ const getCustomActions = (customActions) => {
9608
+ const errors = [];
9609
+ if (!customActions || !Array.isArray(customActions)) {
9610
+ return { actions: [], errors: [] };
9611
+ }
9612
+ // Step 1: Handle invalid actions first (null, undefined, missing required
9613
+ // fields)
9614
+ const validActions = customActions.filter(action => {
9615
+ const validation = validateActionStructure(action);
9616
+ if (!validation.isValid) {
9617
+ if (!action || typeof action !== 'object') {
9618
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_ACTION_OBJECT);
9619
+ }
9620
+ else {
9621
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.MISSING_REQUIRED_FIELDS(action.id, validation.missingFields));
9622
+ }
9623
+ return false;
9624
+ }
9625
+ return true;
9626
+ });
9627
+ // Step 2: Check for duplicate IDs among valid actions
9628
+ const { actions: actionsWithUniqueIds, errors: duplicateErrors } = filterDuplicateIds(validActions);
9629
+ // Add duplicate errors to the errors array
9630
+ duplicateErrors.forEach(error => errors.push(error));
9631
+ // Step 3: Validate actions with unique IDs
9632
+ const finalValidActions = [];
9633
+ actionsWithUniqueIds.forEach((action) => {
9634
+ const { isValid, errors: validationErrors } = validateCustomAction(action);
9635
+ validationErrors.forEach(error => errors.push(error));
9636
+ if (isValid) {
9637
+ finalValidActions.push(action);
9638
+ }
9639
+ });
9640
+ const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
9641
+ return {
9642
+ actions: sortedActions,
9643
+ errors: errors,
9644
+ };
9645
+ };
8124
9646
 
8125
9647
  /**
8126
9648
  * Copyright (c) 2023
@@ -15814,6 +17336,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15814
17336
  handleExitPresentMode();
15815
17337
  }
15816
17338
  }
17339
+ /**
17340
+ * Clears the cached preauth and session info.
17341
+ */
17342
+ function processClearInfoCache() {
17343
+ resetCachedPreauthInfo();
17344
+ resetCachedSessionInfo();
17345
+ }
15817
17346
  /**
15818
17347
  *
15819
17348
  * @param e
@@ -15920,11 +17449,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15920
17449
  return processAuthLogout(e, containerEl);
15921
17450
  case exports.EmbedEvent.ExitPresentMode:
15922
17451
  return processExitPresentMode();
17452
+ case exports.EmbedEvent.CLEAR_INFO_CACHE:
17453
+ return processClearInfoCache();
15923
17454
  }
15924
17455
  return e;
15925
17456
  }
15926
17457
 
15927
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.0-pre-render-1";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":"^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:"^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":"^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$1,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};
17458
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.1";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 | 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":"^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":"^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$1,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};
15928
17459
 
15929
17460
  /**
15930
17461
  * Reloads the ThoughtSpot iframe.
@@ -16235,10 +17766,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16235
17766
  };
16236
17767
  this.showPreRenderByDefault = false;
16237
17768
  /**
16238
- * @hidden
16239
- * Internal state to track if the embed container is loaded.
16240
- * This is used to trigger events after the embed container is loaded.
16241
- */
17769
+ * @hidden
17770
+ * Internal state to track if the embed container is loaded.
17771
+ * This is used to trigger events after the embed container is loaded.
17772
+ */
16242
17773
  this.isEmbedContainerLoaded = false;
16243
17774
  /**
16244
17775
  * @hidden
@@ -16297,10 +17828,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16297
17828
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
16298
17829
  ...viewConfig,
16299
17830
  });
16300
- const embedConfig = getEmbedConfig();
16301
- this.embedConfig = embedConfig;
16302
17831
  this.hostEventClient = new HostEventClient(this.iFrame);
16303
17832
  this.isReadyForRenderPromise = getInitPromise().then(async () => {
17833
+ const embedConfig = getEmbedConfig();
17834
+ this.embedConfig = embedConfig;
16304
17835
  if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
16305
17836
  this.embedConfig.authTriggerContainer = domSelector;
16306
17837
  }
@@ -16449,6 +17980,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16449
17980
  async getDefaultAppInitData() {
16450
17981
  var _a, _b;
16451
17982
  const authToken = await this.getAuthTokenForCookielessInit();
17983
+ const customActionsResult = getCustomActions([
17984
+ ...(this.viewConfig.customActions || []),
17985
+ ...(this.embedConfig.customActions || [])
17986
+ ]);
17987
+ if (customActionsResult.errors.length > 0) {
17988
+ this.handleError({
17989
+ type: 'CUSTOM_ACTION_VALIDATION',
17990
+ message: customActionsResult.errors,
17991
+ });
17992
+ }
16452
17993
  return {
16453
17994
  customisations: getCustomisations(this.embedConfig, this.viewConfig),
16454
17995
  authToken,
@@ -16466,6 +18007,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16466
18007
  : [],
16467
18008
  customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
16468
18009
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
18010
+ customActions: customActionsResult.actions,
16469
18011
  };
16470
18012
  }
16471
18013
  async getAppInitData() {
@@ -16485,11 +18027,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16485
18027
  .join('/');
16486
18028
  return `${basePath}#`;
16487
18029
  }
16488
- getUpdateEmbedParamsObject() {
16489
- let queryParams = this.getEmbedParamsObject();
16490
- queryParams = { ...this.viewConfig, ...queryParams };
16491
- return queryParams;
16492
- }
16493
18030
  /**
16494
18031
  * Common query params set for all the embed modes.
16495
18032
  * @param queryParams
@@ -16639,13 +18176,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16639
18176
  return path;
16640
18177
  }
16641
18178
  getEmbedParams() {
16642
- const queryParams = this.getEmbedParamsObject();
18179
+ const queryParams = this.getBaseQueryParams();
16643
18180
  return getQueryParamString(queryParams);
16644
18181
  }
16645
- getEmbedParamsObject() {
16646
- const params = this.getBaseQueryParams();
16647
- return params;
16648
- }
16649
18182
  getRootIframeSrc() {
16650
18183
  const query = this.getEmbedParams();
16651
18184
  return this.getEmbedBasePath(query);
@@ -17116,13 +18649,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17116
18649
  * Creates the preRender shell
17117
18650
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
17118
18651
  */
17119
- async preRender(showPreRenderByDefault = false) {
18652
+ async preRender(showPreRenderByDefault = false, replaceExistingPreRender = false) {
17120
18653
  if (!this.viewConfig.preRenderId) {
17121
18654
  logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
17122
18655
  return this;
17123
18656
  }
17124
18657
  this.isPreRendered = true;
17125
18658
  this.showPreRenderByDefault = showPreRenderByDefault;
18659
+ const isAlreadyRendered = this.connectPreRendered();
18660
+ if (isAlreadyRendered && !replaceExistingPreRender) {
18661
+ return this;
18662
+ }
17126
18663
  return this.handleRenderForPrerender();
17127
18664
  }
17128
18665
  /**
@@ -17206,12 +18743,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17206
18743
  return this.preRender(true);
17207
18744
  }
17208
18745
  this.validatePreRenderViewConfig(this.viewConfig);
17209
- logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
17210
- this.executeAfterEmbedContainerLoaded(() => {
17211
- this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
17212
- });
17213
18746
  }
17214
- this.beforePrerenderVisible();
17215
18747
  if (this.el) {
17216
18748
  this.syncPreRenderStyle();
17217
18749
  if (!this.viewConfig.doNotTrackPreRenderSize) {
@@ -17228,6 +18760,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17228
18760
  this.resizeObserver.observe(this.el);
17229
18761
  }
17230
18762
  }
18763
+ this.beforePrerenderVisible();
17231
18764
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
17232
18765
  this.subscribeToEvents();
17233
18766
  // Setup fullscreen change handler for prerendered components
@@ -17501,6 +19034,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17501
19034
  * It serves as the foundational version of the home page.
17502
19035
  */
17503
19036
  HomePage["Modular"] = "v2";
19037
+ /**
19038
+ * ModularWithStylingChanges (v3) introduces Modular Home Experience
19039
+ * with styling changes.
19040
+ */
19041
+ HomePage["ModularWithStylingChanges"] = "v3";
17504
19042
  })(exports.HomePage || (exports.HomePage = {}));
17505
19043
  /**
17506
19044
  * Define the version of the list page
@@ -17588,7 +19126,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17588
19126
  * embedded Liveboard or visualization.
17589
19127
  */
17590
19128
  getEmbedParams() {
17591
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
19129
+ const { tag, 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, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
17592
19130
  let params = {};
17593
19131
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17594
19132
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17605,6 +19143,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17605
19143
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17606
19144
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
17607
19145
  params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
19146
+ params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
17608
19147
  params = this.getBaseQueryParams(params);
17609
19148
  if (hideObjectSearch) {
17610
19149
  params[Param.HideObjectSearch] = !!hideObjectSearch;
@@ -17652,6 +19191,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17652
19191
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
17653
19192
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
17654
19193
  }
19194
+ if (isPNGInScheduledEmailsEnabled !== undefined) {
19195
+ params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
19196
+ }
17655
19197
  params[Param.DataPanelV2Enabled] = dataPanelV2;
17656
19198
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
17657
19199
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -17672,6 +19214,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17672
19214
  // To use v3 navigation, we must manually set the discoveryExperience
17673
19215
  // settings.
17674
19216
  params[Param.NavigationVersion] = 'v2';
19217
+ // Set homePageVersion to v2 by default to reset the LD flag value
19218
+ // for the homepageVersion.
19219
+ params[Param.HomepageVersion] = 'v2';
19220
+ // Set listpageVersion to v2 by default to reset the LD flag value
19221
+ // for the listpageVersion.
19222
+ params[Param.ListPageVersion] = exports.ListPage.List;
17675
19223
  if (discoveryExperience) {
17676
19224
  // primaryNavbarVersion v3 will enabled the new left navigation
17677
19225
  if (discoveryExperience.primaryNavbarVersion === exports.PrimaryNavbarVersion.Sliding) {
@@ -17684,6 +19232,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17684
19232
  if (discoveryExperience.homePage === exports.HomePage.Modular) {
17685
19233
  params[Param.ModularHomeExperienceEnabled] = true;
17686
19234
  }
19235
+ // ModularWithStylingChanges (v3) introduces the styling changes
19236
+ // to the Modular Homepage.
19237
+ // v3 will be the base version of homePageVersion.
19238
+ if (discoveryExperience.homePage === exports.HomePage.ModularWithStylingChanges) {
19239
+ params[Param.HomepageVersion] = exports.HomePage.ModularWithStylingChanges;
19240
+ }
17687
19241
  // listPageVersion v3 will enable the new list page
17688
19242
  if (discoveryExperience.listPageVersion === exports.ListPage.ListWithUXChanges) {
17689
19243
  params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
@@ -17987,14 +19541,9 @@ query GetEurekaVizSnapshots(
17987
19541
  * embedded Liveboard or visualization.
17988
19542
  */
17989
19543
  getEmbedParams() {
17990
- const params = this.getEmbedParamsObject();
17991
- const queryParams = getQueryParamString(params, true);
17992
- return queryParams;
17993
- }
17994
- getEmbedParamsObject() {
17995
19544
  let params = {};
17996
19545
  params = this.getBaseQueryParams(params);
17997
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
19546
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
17998
19547
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
17999
19548
  || this.viewConfig.preventPinboardFilterRemoval;
18000
19549
  if (fullHeight === true) {
@@ -18053,25 +19602,11 @@ query GetEurekaVizSnapshots(
18053
19602
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
18054
19603
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
18055
19604
  }
18056
- params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
18057
- params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
18058
- params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
18059
- params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
18060
- params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
18061
- params[Param.DataPanelV2Enabled] = dataPanelV2;
18062
- params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18063
- params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
18064
- if (oAuthPollingInterval !== undefined) {
18065
- params[Param.OauthPollingInterval] = oAuthPollingInterval;
18066
- }
18067
- if (isForceRedirect) {
18068
- params[Param.IsForceRedirect] = isForceRedirect;
18069
- }
18070
- if (dataSourceId !== undefined) {
18071
- params[Param.DataSourceId] = dataSourceId;
19605
+ if (isPNGInScheduledEmailsEnabled !== undefined) {
19606
+ params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
18072
19607
  }
18073
- if (isLiveboardStylingAndGroupingEnabled !== undefined) {
18074
- params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
19608
+ if (showSpotterLimitations !== undefined) {
19609
+ params[Param.ShowSpotterLimitations] = showSpotterLimitations;
18075
19610
  }
18076
19611
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
18077
19612
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
@@ -18081,7 +19616,9 @@ query GetEurekaVizSnapshots(
18081
19616
  params[Param.DataPanelV2Enabled] = dataPanelV2;
18082
19617
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18083
19618
  params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
18084
- return params;
19619
+ params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
19620
+ const queryParams = getQueryParamString(params, true);
19621
+ return queryParams;
18085
19622
  }
18086
19623
  getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
18087
19624
  let suffix = `/embed/viz/${liveboardId}`;
@@ -18323,9 +19860,11 @@ query GetEurekaVizSnapshots(
18323
19860
  const defaultAppInitData = await super.getAppInitData();
18324
19861
  return { ...defaultAppInitData, ...this.getSearchInitData() };
18325
19862
  }
18326
- getEmbedParamsObject() {
19863
+ getEmbedParams() {
18327
19864
  var _a;
18328
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
19865
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
19866
+ /* eslint-disable-next-line max-len */
19867
+ dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
18329
19868
  const queryParams = this.getBaseQueryParams();
18330
19869
  queryParams[Param.HideActions] = [
18331
19870
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -18358,6 +19897,7 @@ query GetEurekaVizSnapshots(
18358
19897
  queryParams[Param.HideSearchBar] = true;
18359
19898
  }
18360
19899
  if (isOnBeforeGetVizDataInterceptEnabled) {
19900
+ /* eslint-disable-next-line max-len */
18361
19901
  queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
18362
19902
  }
18363
19903
  if (!focusSearchBarOnRender) {
@@ -18370,22 +19910,20 @@ query GetEurekaVizSnapshots(
18370
19910
  queryParams[Param.UseLastSelectedDataSource] = false;
18371
19911
  }
18372
19912
  queryParams[Param.searchEmbed] = true;
19913
+ /* eslint-disable-next-line max-len */
18373
19914
  queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
18374
19915
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18375
19916
  if (dataPanelCustomGroupsAccordionInitialState
18376
19917
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
18377
19918
  || dataPanelCustomGroupsAccordionInitialState
18378
19919
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
19920
+ /* eslint-disable-next-line max-len */
18379
19921
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
18380
19922
  }
18381
19923
  else {
19924
+ /* eslint-disable-next-line max-len */
18382
19925
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
18383
19926
  }
18384
- return queryParams;
18385
- }
18386
- getEmbedParams() {
18387
- const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
18388
- const queryParams = this.getEmbedParamsObject();
18389
19927
  let query = '';
18390
19928
  const queryParamsString = getQueryParamString(queryParams, true);
18391
19929
  if (queryParamsString) {
@@ -18441,9 +19979,15 @@ query GetEurekaVizSnapshots(
18441
19979
  this.embedComponentType = 'SearchBarEmbed';
18442
19980
  this.viewConfig = viewConfig;
18443
19981
  }
18444
- getEmbedParamsObject() {
19982
+ /**
19983
+ * Construct the URL of the embedded ThoughtSpot search to be
19984
+ * loaded in the iframe
19985
+ * @param dataSources A list of data source GUIDs
19986
+ */
19987
+ getIFrameSrc() {
18445
19988
  var _a;
18446
19989
  const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
19990
+ const path = 'search-bar-embed';
18447
19991
  const queryParams = this.getBaseQueryParams();
18448
19992
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18449
19993
  if (dataSources && dataSources.length) {
@@ -18465,16 +20009,6 @@ query GetEurekaVizSnapshots(
18465
20009
  queryParams[Param.UseLastSelectedDataSource] = false;
18466
20010
  }
18467
20011
  queryParams[Param.searchEmbed] = true;
18468
- return queryParams;
18469
- }
18470
- /**
18471
- * Construct the URL of the embedded ThoughtSpot search to be
18472
- * loaded in the iframe
18473
- * @param dataSources A list of data source GUIDs
18474
- */
18475
- getIFrameSrc() {
18476
- const queryParams = this.getEmbedParamsObject();
18477
- const path = 'search-bar-embed';
18478
20012
  let query = '';
18479
20013
  const queryParamsString = getQueryParamString(queryParams, true);
18480
20014
  if (queryParamsString) {
@@ -18897,17 +20431,13 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18897
20431
  super(container, viewConfig);
18898
20432
  this.viewConfig = viewConfig;
18899
20433
  }
18900
- getEmbedParamsObject() {
20434
+ getIframeSrc() {
18901
20435
  var _a;
20436
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
20437
+ const path = 'conv-assist-answer';
18902
20438
  const queryParams = this.getBaseQueryParams();
18903
20439
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18904
20440
  queryParams[Param.isSpotterAgentEmbed] = true;
18905
- return queryParams;
18906
- }
18907
- getIframeSrc() {
18908
- const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18909
- const path = 'conv-assist-answer';
18910
- const queryParams = this.getEmbedParamsObject();
18911
20441
  let query = '';
18912
20442
  const queryParamsString = getQueryParamString(queryParams, true);
18913
20443
  if (queryParamsString) {
@@ -19068,8 +20598,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
19068
20598
  super(container, viewConfig);
19069
20599
  this.viewConfig = viewConfig;
19070
20600
  }
19071
- getEmbedParamsObject() {
20601
+ getIframeSrc() {
19072
20602
  const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
20603
+ const path = 'insights/conv-assist';
19073
20604
  if (!worksheetId) {
19074
20605
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
19075
20606
  }
@@ -19090,12 +20621,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
19090
20621
  if (!isUndefined_1(hideSampleQuestions)) {
19091
20622
  queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
19092
20623
  }
19093
- return queryParams;
19094
- }
19095
- getIframeSrc() {
19096
- const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
19097
- const path = 'insights/conv-assist';
19098
- const queryParams = this.getEmbedParamsObject();
19099
20624
  let query = '';
19100
20625
  const queryParamsString = getQueryParamString(queryParams, true);
19101
20626
  if (queryParamsString) {
@@ -19167,7 +20692,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
19167
20692
  viewConfig.embedComponentType = 'SageEmbed';
19168
20693
  super(domSelector, viewConfig);
19169
20694
  }
19170
- getEmbedParamsObject() {
20695
+ /**
20696
+ * Constructs a map of parameters to be passed on to the
20697
+ * embedded Eureka or Sage search page.
20698
+ * @returns {string} query string
20699
+ */
20700
+ getEmbedParams() {
19171
20701
  const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
19172
20702
  const params = this.getBaseQueryParams();
19173
20703
  params[Param.DataPanelV2Enabled] = !!dataPanelV2;
@@ -19182,15 +20712,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
19182
20712
  params[Param.HideSampleQuestions] = !!hideSampleQuestions;
19183
20713
  params[Param.IsProductTour] = !!isProductTour;
19184
20714
  params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
19185
- return params;
19186
- }
19187
- /**
19188
- * Constructs a map of parameters to be passed on to the
19189
- * embedded Eureka or Sage search page.
19190
- * @returns {string} query string
19191
- */
19192
- getEmbedParams() {
19193
- const params = this.getEmbedParamsObject();
19194
20715
  return getQueryParamString(params, true);
19195
20716
  }
19196
20717
  /**