@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.
- package/README.md +2 -4
- package/cjs/package.json +3 -3
- package/cjs/src/authToken.d.ts +1 -0
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +13 -3
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.js +29 -0
- package/cjs/src/authToken.spec.js.map +1 -1
- package/cjs/src/css-variables.d.ts +2 -1
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +22 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +22 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +70 -3
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +0 -1
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +3 -7
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +2 -3
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +2 -7
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +32 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +8 -25
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +96 -28
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +0 -1
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +6 -10
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/sage.spec.js +20 -10
- package/cjs/src/embed/sage.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +0 -1
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +7 -11
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +0 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +8 -7
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +10 -10
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +5 -7
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +25 -22
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +122 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +11 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +12 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/index.d.ts +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +4 -2
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +1 -1
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +163 -21
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +65 -22
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/custom-actions.d.ts +12 -0
- package/cjs/src/utils/custom-actions.d.ts.map +1 -0
- package/cjs/src/utils/custom-actions.js +180 -0
- package/cjs/src/utils/custom-actions.js.map +1 -0
- package/cjs/src/utils/custom-actions.spec.d.ts +2 -0
- package/cjs/src/utils/custom-actions.spec.d.ts.map +1 -0
- package/cjs/src/utils/custom-actions.spec.js +399 -0
- package/cjs/src/utils/custom-actions.spec.js.map +1 -0
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +10 -0
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +11 -0
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/cjs/src/utils.d.ts +21 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +32 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +38 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-CmEQfuE3.js → index-DQueHwfQ.js} +1 -1
- package/dist/src/authToken.d.ts +1 -0
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +2 -1
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +22 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +0 -1
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +2 -3
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +32 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +0 -1
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +0 -1
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +0 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +5 -7
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +11 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +163 -21
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/custom-actions.d.ts +12 -0
- package/dist/src/utils/custom-actions.d.ts.map +1 -0
- package/dist/src/utils/custom-actions.spec.d.ts +2 -0
- package/dist/src/utils/custom-actions.spec.d.ts.map +1 -0
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils.d.ts +21 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +1773 -251
- package/dist/tsembed-react.js +1772 -250
- package/dist/tsembed.es.js +1771 -250
- package/dist/tsembed.js +1770 -249
- package/dist/visual-embed-sdk-react-full.d.ts +228 -39
- package/dist/visual-embed-sdk-react.d.ts +228 -39
- package/dist/visual-embed-sdk.d.ts +228 -39
- package/lib/package.json +3 -3
- package/lib/src/authToken.d.ts +1 -0
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +11 -2
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.js +30 -1
- package/lib/src/authToken.spec.js.map +1 -1
- package/lib/src/css-variables.d.ts +2 -1
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +22 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +22 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +70 -3
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +0 -1
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +3 -7
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +2 -3
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +2 -7
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +32 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +8 -25
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +96 -28
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +0 -1
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +6 -10
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/sage.spec.js +20 -10
- package/lib/src/embed/sage.spec.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +0 -1
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +7 -11
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +0 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +8 -7
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +11 -11
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +5 -7
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +25 -22
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +123 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +11 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +11 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/index.d.ts +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +3 -2
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +1 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +163 -21
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +64 -21
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/custom-actions.d.ts +12 -0
- package/lib/src/utils/custom-actions.d.ts.map +1 -0
- package/lib/src/utils/custom-actions.js +175 -0
- package/lib/src/utils/custom-actions.js.map +1 -0
- package/lib/src/utils/custom-actions.spec.d.ts +2 -0
- package/lib/src/utils/custom-actions.spec.d.ts.map +1 -0
- package/lib/src/utils/custom-actions.spec.js +397 -0
- package/lib/src/utils/custom-actions.spec.js.map +1 -0
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +10 -0
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js +11 -0
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/utils.d.ts +21 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +29 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +39 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +229 -40
- package/package.json +3 -3
- package/src/authToken.spec.ts +48 -1
- package/src/authToken.ts +13 -2
- package/src/css-variables.ts +2 -1
- package/src/embed/app.spec.ts +99 -3
- package/src/embed/app.ts +44 -1
- package/src/embed/bodyless-conversation.ts +3 -8
- package/src/embed/conversation.ts +4 -19
- package/src/embed/liveboard.spec.ts +128 -30
- package/src/embed/liveboard.ts +66 -52
- package/src/embed/sage.spec.ts +24 -10
- package/src/embed/sage.ts +7 -12
- package/src/embed/search-bar.tsx +7 -14
- package/src/embed/search.spec.ts +13 -14
- package/src/embed/search.ts +8 -19
- package/src/embed/ts-embed.spec.ts +136 -2
- package/src/embed/ts-embed.ts +31 -28
- package/src/errors.ts +12 -0
- package/src/index.ts +4 -0
- package/src/react/index.spec.tsx +1 -1
- package/src/react/index.tsx +5 -2
- package/src/types.ts +225 -79
- package/src/utils/custom-actions.spec.ts +431 -0
- package/src/utils/custom-actions.ts +217 -0
- package/src/utils/processData.spec.ts +12 -0
- package/src/utils/processData.ts +10 -0
- package/src/utils.spec.ts +52 -0
- package/src/utils.ts +31 -0
- package/dist/index-BDlM0f0T.js +0 -7371
- package/dist/index-D1pyb7RG.js +0 -7371
- package/dist/index-DeFzsyFF.js +0 -7371
- package/dist/index-Dpf0rd6w.js +0 -7371
- package/dist/index-UuEbsISo.js +0 -7447
- package/dist/index-e3Uw3YFO.js +0 -7371
- package/dist/index-k7pkZMhx.js +0 -7371
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.41.
|
|
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, require('react')) :
|
|
@@ -217,7 +217,6 @@
|
|
|
217
217
|
* the embedded app
|
|
218
218
|
* @group Authentication / Init
|
|
219
219
|
*/
|
|
220
|
-
// eslint-disable-next-line no-shadow
|
|
221
220
|
var AuthType;
|
|
222
221
|
(function (AuthType) {
|
|
223
222
|
/**
|
|
@@ -431,7 +430,6 @@
|
|
|
431
430
|
/**
|
|
432
431
|
* A map of the supported runtime filter operations
|
|
433
432
|
*/
|
|
434
|
-
// eslint-disable-next-line no-shadow
|
|
435
433
|
exports.RuntimeFilterOp = void 0;
|
|
436
434
|
(function (RuntimeFilterOp) {
|
|
437
435
|
/**
|
|
@@ -502,7 +500,6 @@
|
|
|
502
500
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
503
501
|
* @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
504
502
|
*/
|
|
505
|
-
// eslint-disable-next-line no-shadow
|
|
506
503
|
exports.HomepageModule = void 0;
|
|
507
504
|
(function (HomepageModule) {
|
|
508
505
|
/**
|
|
@@ -535,7 +532,6 @@
|
|
|
535
532
|
* **Note**: This option is applicable to full app embedding only.
|
|
536
533
|
* @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
|
|
537
534
|
*/
|
|
538
|
-
// eslint-disable-next-line no-shadow
|
|
539
535
|
exports.ListPageColumns = void 0;
|
|
540
536
|
(function (ListPageColumns) {
|
|
541
537
|
/**
|
|
@@ -598,7 +594,6 @@
|
|
|
598
594
|
* ```
|
|
599
595
|
* @group Events
|
|
600
596
|
*/
|
|
601
|
-
// eslint-disable-next-line no-shadow
|
|
602
597
|
exports.EmbedEvent = void 0;
|
|
603
598
|
(function (EmbedEvent) {
|
|
604
599
|
/**
|
|
@@ -1240,6 +1235,11 @@
|
|
|
1240
1235
|
* @hidden
|
|
1241
1236
|
*/
|
|
1242
1237
|
EmbedEvent["APP_INIT"] = "appInit";
|
|
1238
|
+
/**
|
|
1239
|
+
* Internal event to clear the cached info
|
|
1240
|
+
* @hidden
|
|
1241
|
+
*/
|
|
1242
|
+
EmbedEvent["CLEAR_INFO_CACHE"] = "clearInfoCache";
|
|
1243
1243
|
/**
|
|
1244
1244
|
* Emitted when a user clicks **Show Liveboard details** on a Liveboard
|
|
1245
1245
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
@@ -1708,6 +1708,17 @@
|
|
|
1708
1708
|
* ```
|
|
1709
1709
|
*/
|
|
1710
1710
|
EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
|
|
1711
|
+
/**
|
|
1712
|
+
* Emitted when the organization is switched.
|
|
1713
|
+
* @example
|
|
1714
|
+
* ```js
|
|
1715
|
+
* appEmbed.on(EmbedEvent.OrgSwitched, (payload) => {
|
|
1716
|
+
* console.log('payload', payload);
|
|
1717
|
+
* })
|
|
1718
|
+
* ```
|
|
1719
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1720
|
+
*/
|
|
1721
|
+
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1711
1722
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1712
1723
|
/**
|
|
1713
1724
|
* Event types that can be triggered by the host application
|
|
@@ -1762,7 +1773,6 @@
|
|
|
1762
1773
|
* ```
|
|
1763
1774
|
* @group Events
|
|
1764
1775
|
*/
|
|
1765
|
-
// eslint-disable-next-line no-shadow
|
|
1766
1776
|
exports.HostEvent = void 0;
|
|
1767
1777
|
(function (HostEvent) {
|
|
1768
1778
|
/**
|
|
@@ -2626,7 +2636,7 @@
|
|
|
2626
2636
|
* column: "Date",
|
|
2627
2637
|
* oper: 'EQ',
|
|
2628
2638
|
* values: ["2023-07-31"],
|
|
2629
|
-
*
|
|
2639
|
+
* type: "EXACT_DATE"
|
|
2630
2640
|
* }]
|
|
2631
2641
|
* });
|
|
2632
2642
|
* ```
|
|
@@ -2972,22 +2982,11 @@
|
|
|
2972
2982
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2973
2983
|
*/
|
|
2974
2984
|
HostEvent["AskSpotter"] = "AskSpotter";
|
|
2975
|
-
/**
|
|
2976
|
-
* @hidden
|
|
2977
|
-
* Triggers the update of the embed params.
|
|
2978
|
-
*
|
|
2979
|
-
* @example
|
|
2980
|
-
* ```js
|
|
2981
|
-
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
2982
|
-
* ```
|
|
2983
|
-
*/
|
|
2984
|
-
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2985
2985
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2986
2986
|
/**
|
|
2987
2987
|
* The different visual modes that the data sources panel within
|
|
2988
2988
|
* search could appear in, such as hidden, collapsed, or expanded.
|
|
2989
2989
|
*/
|
|
2990
|
-
// eslint-disable-next-line no-shadow
|
|
2991
2990
|
var DataSourceVisualMode;
|
|
2992
2991
|
(function (DataSourceVisualMode) {
|
|
2993
2992
|
/**
|
|
@@ -3007,7 +3006,6 @@
|
|
|
3007
3006
|
* The query params passed down to the embedded ThoughtSpot app
|
|
3008
3007
|
* containing configuration and/or visual information.
|
|
3009
3008
|
*/
|
|
3010
|
-
// eslint-disable-next-line no-shadow
|
|
3011
3009
|
var Param;
|
|
3012
3010
|
(function (Param) {
|
|
3013
3011
|
Param["EmbedApp"] = "embedApp";
|
|
@@ -3087,6 +3085,7 @@
|
|
|
3087
3085
|
Param["Query"] = "query";
|
|
3088
3086
|
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
3089
3087
|
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
3088
|
+
Param["HomepageVersion"] = "homepageVersion";
|
|
3090
3089
|
Param["ListPageVersion"] = "listpageVersion";
|
|
3091
3090
|
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
3092
3091
|
Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
|
|
@@ -3128,6 +3127,8 @@
|
|
|
3128
3127
|
Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
|
|
3129
3128
|
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3130
3129
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3130
|
+
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3131
|
+
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3131
3132
|
})(Param || (Param = {}));
|
|
3132
3133
|
/**
|
|
3133
3134
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -3156,7 +3157,6 @@
|
|
|
3156
3157
|
* ```
|
|
3157
3158
|
* See also link:https://developers.thoughtspot.com/docs/actions[Action IDs in the SDK]
|
|
3158
3159
|
*/
|
|
3159
|
-
// eslint-disable-next-line no-shadow
|
|
3160
3160
|
exports.Action = void 0;
|
|
3161
3161
|
(function (Action) {
|
|
3162
3162
|
/**
|
|
@@ -3701,7 +3701,7 @@
|
|
|
3701
3701
|
* The Favorites icon (*) for Answers,
|
|
3702
3702
|
* Liveboard, and data objects like Worksheet, Model,
|
|
3703
3703
|
* Tables and Views.
|
|
3704
|
-
* Allows adding an object to the user
|
|
3704
|
+
* Allows adding an object to the user's favorites list.
|
|
3705
3705
|
* @example
|
|
3706
3706
|
* ```js
|
|
3707
3707
|
* disabledActions: [Action.AddToFavorites]
|
|
@@ -4410,6 +4410,29 @@
|
|
|
4410
4410
|
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4411
4411
|
*/
|
|
4412
4412
|
Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
|
|
4413
|
+
/**
|
|
4414
|
+
* The **PNG screenshot in email** option in the schedule email dialog.
|
|
4415
|
+
* Includes a PNG screenshot in the notification email body.
|
|
4416
|
+
* @example
|
|
4417
|
+
* ```js
|
|
4418
|
+
* disabledActions: [Action.PngScreenshotInEmail]
|
|
4419
|
+
* ```
|
|
4420
|
+
* ```
|
|
4421
|
+
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4422
|
+
*/
|
|
4423
|
+
Action["PngScreenshotInEmail"] = "pngScreenshotInEmail";
|
|
4424
|
+
/**
|
|
4425
|
+
* The **Remove attachment** action in the schedule email dialog.
|
|
4426
|
+
* Removes an attachment from the email configuration.
|
|
4427
|
+
* @example
|
|
4428
|
+
* ```js
|
|
4429
|
+
* disabledActions: [Action.RemoveAttachment]
|
|
4430
|
+
* ```
|
|
4431
|
+
* ```
|
|
4432
|
+
* ```
|
|
4433
|
+
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4434
|
+
*/
|
|
4435
|
+
Action["RemoveAttachment"] = "removeAttachment";
|
|
4413
4436
|
})(exports.Action || (exports.Action = {}));
|
|
4414
4437
|
var PrefetchFeatures;
|
|
4415
4438
|
(function (PrefetchFeatures) {
|
|
@@ -4428,6 +4451,26 @@
|
|
|
4428
4451
|
ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
|
|
4429
4452
|
ContextMenuTriggerOptions["BOTH_CLICKS"] = "both-clicks";
|
|
4430
4453
|
})(ContextMenuTriggerOptions || (ContextMenuTriggerOptions = {}));
|
|
4454
|
+
/**
|
|
4455
|
+
* Enum options to show custom actions at different
|
|
4456
|
+
* positions in the application.
|
|
4457
|
+
*/
|
|
4458
|
+
exports.CustomActionsPosition = void 0;
|
|
4459
|
+
(function (CustomActionsPosition) {
|
|
4460
|
+
CustomActionsPosition["PRIMARY"] = "PRIMARY";
|
|
4461
|
+
CustomActionsPosition["MENU"] = "MENU";
|
|
4462
|
+
CustomActionsPosition["CONTEXTMENU"] = "CONTEXTMENU";
|
|
4463
|
+
})(exports.CustomActionsPosition || (exports.CustomActionsPosition = {}));
|
|
4464
|
+
/**
|
|
4465
|
+
* Enum options to mention the target of the custom action.
|
|
4466
|
+
*/
|
|
4467
|
+
var CustomActionTarget;
|
|
4468
|
+
(function (CustomActionTarget) {
|
|
4469
|
+
CustomActionTarget["LIVEBOARD"] = "LIVEBOARD";
|
|
4470
|
+
CustomActionTarget["VIZ"] = "VIZ";
|
|
4471
|
+
CustomActionTarget["ANSWER"] = "ANSWER";
|
|
4472
|
+
CustomActionTarget["SPOTTER"] = "SPOTTER";
|
|
4473
|
+
})(CustomActionTarget || (CustomActionTarget = {}));
|
|
4431
4474
|
/**
|
|
4432
4475
|
* Enum options to show or suppress Visual Embed SDK and
|
|
4433
4476
|
* ThoughtSpot application logs in the console output.
|
|
@@ -4888,6 +4931,15 @@
|
|
|
4888
4931
|
* @returns The stored value or `undefined` if the key is not found.
|
|
4889
4932
|
*/
|
|
4890
4933
|
const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
|
|
4934
|
+
/**
|
|
4935
|
+
* Check if an array includes a string value
|
|
4936
|
+
* @param arr - The array to check
|
|
4937
|
+
* @param key - The string to search for
|
|
4938
|
+
* @returns boolean indicating if the string is found in the array
|
|
4939
|
+
*/
|
|
4940
|
+
const arrayIncludesString = (arr, key) => {
|
|
4941
|
+
return arr.some(item => typeof item === 'string' && item === key);
|
|
4942
|
+
};
|
|
4891
4943
|
/**
|
|
4892
4944
|
* Check if the document is currently in fullscreen mode
|
|
4893
4945
|
*/
|
|
@@ -4969,6 +5021,26 @@
|
|
|
4969
5021
|
width: Math.max(0, frameRelativeRight - frameRelativeLeft),
|
|
4970
5022
|
};
|
|
4971
5023
|
return data;
|
|
5024
|
+
};
|
|
5025
|
+
/**
|
|
5026
|
+
* Replaces placeholders in a template string with provided values.
|
|
5027
|
+
* Placeholders should be in the format {key}.
|
|
5028
|
+
* @param template - The template string with placeholders
|
|
5029
|
+
* @param values - An object containing key-value pairs to replace placeholders
|
|
5030
|
+
* @returns The template string with placeholders replaced
|
|
5031
|
+
* @example
|
|
5032
|
+
* formatTemplate('Hello {name}, you are {age} years old', { name: 'John', age: 30 })
|
|
5033
|
+
* // Returns: 'Hello John, you are 30 years old'
|
|
5034
|
+
*
|
|
5035
|
+
* formatTemplate('Expected {type}, but received {actual}', { type: 'string', actual: 'number' })
|
|
5036
|
+
* // Returns: 'Expected string, but received number'
|
|
5037
|
+
*/
|
|
5038
|
+
const formatTemplate = (template, values) => {
|
|
5039
|
+
// This regex /\{(\w+)\}/g finds all placeholders in the format {word}
|
|
5040
|
+
// and captures the word inside the braces for replacement.
|
|
5041
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => {
|
|
5042
|
+
return values[key] !== undefined ? String(values[key]) : match;
|
|
5043
|
+
});
|
|
4972
5044
|
};
|
|
4973
5045
|
|
|
4974
5046
|
/**
|
|
@@ -5972,8 +6044,8 @@
|
|
|
5972
6044
|
var _cacheHas = cacheHas;
|
|
5973
6045
|
|
|
5974
6046
|
/** Used to compose bitmasks for value comparisons. */
|
|
5975
|
-
var COMPARE_PARTIAL_FLAG$
|
|
5976
|
-
COMPARE_UNORDERED_FLAG$
|
|
6047
|
+
var COMPARE_PARTIAL_FLAG$5 = 1,
|
|
6048
|
+
COMPARE_UNORDERED_FLAG$3 = 2;
|
|
5977
6049
|
|
|
5978
6050
|
/**
|
|
5979
6051
|
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
|
@@ -5989,7 +6061,7 @@
|
|
|
5989
6061
|
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
|
5990
6062
|
*/
|
|
5991
6063
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
5992
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$
|
|
6064
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
|
|
5993
6065
|
arrLength = array.length,
|
|
5994
6066
|
othLength = other.length;
|
|
5995
6067
|
|
|
@@ -6004,7 +6076,7 @@
|
|
|
6004
6076
|
}
|
|
6005
6077
|
var index = -1,
|
|
6006
6078
|
result = true,
|
|
6007
|
-
seen = (bitmask & COMPARE_UNORDERED_FLAG$
|
|
6079
|
+
seen = (bitmask & COMPARE_UNORDERED_FLAG$3) ? new _SetCache : undefined;
|
|
6008
6080
|
|
|
6009
6081
|
stack.set(array, other);
|
|
6010
6082
|
stack.set(other, array);
|
|
@@ -6096,8 +6168,8 @@
|
|
|
6096
6168
|
var _setToArray = setToArray;
|
|
6097
6169
|
|
|
6098
6170
|
/** Used to compose bitmasks for value comparisons. */
|
|
6099
|
-
var COMPARE_PARTIAL_FLAG$
|
|
6100
|
-
COMPARE_UNORDERED_FLAG = 2;
|
|
6171
|
+
var COMPARE_PARTIAL_FLAG$4 = 1,
|
|
6172
|
+
COMPARE_UNORDERED_FLAG$2 = 2;
|
|
6101
6173
|
|
|
6102
6174
|
/** `Object#toString` result references. */
|
|
6103
6175
|
var boolTag$2 = '[object Boolean]',
|
|
@@ -6108,14 +6180,14 @@
|
|
|
6108
6180
|
regexpTag$1 = '[object RegExp]',
|
|
6109
6181
|
setTag$3 = '[object Set]',
|
|
6110
6182
|
stringTag$1 = '[object String]',
|
|
6111
|
-
symbolTag = '[object Symbol]';
|
|
6183
|
+
symbolTag$1 = '[object Symbol]';
|
|
6112
6184
|
|
|
6113
6185
|
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
6114
6186
|
dataViewTag$2 = '[object DataView]';
|
|
6115
6187
|
|
|
6116
6188
|
/** Used to convert symbols to primitives and strings. */
|
|
6117
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
6118
|
-
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
6189
|
+
var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
|
|
6190
|
+
symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
|
|
6119
6191
|
|
|
6120
6192
|
/**
|
|
6121
6193
|
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
|
@@ -6172,7 +6244,7 @@
|
|
|
6172
6244
|
var convert = _mapToArray;
|
|
6173
6245
|
|
|
6174
6246
|
case setTag$3:
|
|
6175
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$
|
|
6247
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
|
|
6176
6248
|
convert || (convert = _setToArray);
|
|
6177
6249
|
|
|
6178
6250
|
if (object.size != other.size && !isPartial) {
|
|
@@ -6183,7 +6255,7 @@
|
|
|
6183
6255
|
if (stacked) {
|
|
6184
6256
|
return stacked == other;
|
|
6185
6257
|
}
|
|
6186
|
-
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
6258
|
+
bitmask |= COMPARE_UNORDERED_FLAG$2;
|
|
6187
6259
|
|
|
6188
6260
|
// Recursively compare objects (susceptible to call stack limits).
|
|
6189
6261
|
stack.set(object, other);
|
|
@@ -6191,7 +6263,7 @@
|
|
|
6191
6263
|
stack['delete'](object);
|
|
6192
6264
|
return result;
|
|
6193
6265
|
|
|
6194
|
-
case symbolTag:
|
|
6266
|
+
case symbolTag$1:
|
|
6195
6267
|
if (symbolValueOf) {
|
|
6196
6268
|
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
6197
6269
|
}
|
|
@@ -6882,7 +6954,7 @@
|
|
|
6882
6954
|
var _getAllKeys = getAllKeys;
|
|
6883
6955
|
|
|
6884
6956
|
/** Used to compose bitmasks for value comparisons. */
|
|
6885
|
-
var COMPARE_PARTIAL_FLAG$
|
|
6957
|
+
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
6886
6958
|
|
|
6887
6959
|
/** Used for built-in method references. */
|
|
6888
6960
|
var objectProto$2 = Object.prototype;
|
|
@@ -6904,7 +6976,7 @@
|
|
|
6904
6976
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
6905
6977
|
*/
|
|
6906
6978
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
6907
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$
|
|
6979
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
|
|
6908
6980
|
objProps = _getAllKeys(object),
|
|
6909
6981
|
objLength = objProps.length,
|
|
6910
6982
|
othProps = _getAllKeys(other),
|
|
@@ -7042,7 +7114,7 @@
|
|
|
7042
7114
|
var _getTag = getTag;
|
|
7043
7115
|
|
|
7044
7116
|
/** Used to compose bitmasks for value comparisons. */
|
|
7045
|
-
var COMPARE_PARTIAL_FLAG = 1;
|
|
7117
|
+
var COMPARE_PARTIAL_FLAG$2 = 1;
|
|
7046
7118
|
|
|
7047
7119
|
/** `Object#toString` result references. */
|
|
7048
7120
|
var argsTag = '[object Arguments]',
|
|
@@ -7095,7 +7167,7 @@
|
|
|
7095
7167
|
? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
7096
7168
|
: _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
7097
7169
|
}
|
|
7098
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
7170
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
|
|
7099
7171
|
var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, '__wrapped__'),
|
|
7100
7172
|
othIsWrapped = othIsObj && hasOwnProperty$2.call(other, '__wrapped__');
|
|
7101
7173
|
|
|
@@ -7257,6 +7329,7 @@
|
|
|
7257
7329
|
SDK_NOT_INITIALIZED: 'SDK not initialized',
|
|
7258
7330
|
SESSION_INFO_FAILED: 'Failed to get session information',
|
|
7259
7331
|
INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
|
|
7332
|
+
INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
|
|
7260
7333
|
MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
|
|
7261
7334
|
PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
|
|
7262
7335
|
SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
|
|
@@ -7265,6 +7338,16 @@
|
|
|
7265
7338
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7266
7339
|
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',
|
|
7267
7340
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7341
|
+
};
|
|
7342
|
+
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7343
|
+
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
7344
|
+
MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
|
|
7345
|
+
UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
|
|
7346
|
+
INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
|
|
7347
|
+
INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
|
|
7348
|
+
INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
|
|
7349
|
+
INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
|
|
7350
|
+
DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
|
|
7268
7351
|
};
|
|
7269
7352
|
|
|
7270
7353
|
const EndPoints = {
|
|
@@ -7427,6 +7510,15 @@
|
|
|
7427
7510
|
return authToken;
|
|
7428
7511
|
}
|
|
7429
7512
|
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
7513
|
+
// even if token verification is disabled, we will still validate
|
|
7514
|
+
// that the token is a string before proceeding.
|
|
7515
|
+
if (typeof authToken !== 'string') {
|
|
7516
|
+
const errorMessage = formatTemplate(ERROR_MESSAGE.INVALID_TOKEN_TYPE_ERROR, {
|
|
7517
|
+
invalidType: typeof authToken,
|
|
7518
|
+
});
|
|
7519
|
+
logger$3.error(errorMessage);
|
|
7520
|
+
throw new Error(errorMessage);
|
|
7521
|
+
}
|
|
7430
7522
|
const cachedAuthToken = getCacheAuthToken();
|
|
7431
7523
|
if (embedConfig.disableTokenVerification) {
|
|
7432
7524
|
logger$3.info('Token verification is disabled. Assuming token is valid.');
|
|
@@ -8117,141 +8209,1571 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
8117
8209
|
if (columnsToRemove.length) {
|
|
8118
8210
|
await unaggAnswerSession.removeColumns(columnsToRemove);
|
|
8119
8211
|
}
|
|
8120
|
-
return unaggAnswerSession;
|
|
8121
|
-
}
|
|
8122
|
-
/**
|
|
8123
|
-
* Execute a custom graphql query in the context of the answer.
|
|
8124
|
-
* @param query graphql query
|
|
8125
|
-
* @param variables graphql variables
|
|
8126
|
-
* @returns
|
|
8127
|
-
*/
|
|
8128
|
-
async executeQuery(query, variables) {
|
|
8129
|
-
const data = await graphqlQuery({
|
|
8130
|
-
query,
|
|
8131
|
-
variables: {
|
|
8132
|
-
session: this.session,
|
|
8133
|
-
...variables,
|
|
8134
|
-
},
|
|
8135
|
-
thoughtSpotHost: this.thoughtSpotHost,
|
|
8136
|
-
isCompositeQuery: false,
|
|
8137
|
-
});
|
|
8138
|
-
this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
|
|
8139
|
-
return data;
|
|
8212
|
+
return unaggAnswerSession;
|
|
8213
|
+
}
|
|
8214
|
+
/**
|
|
8215
|
+
* Execute a custom graphql query in the context of the answer.
|
|
8216
|
+
* @param query graphql query
|
|
8217
|
+
* @param variables graphql variables
|
|
8218
|
+
* @returns
|
|
8219
|
+
*/
|
|
8220
|
+
async executeQuery(query, variables) {
|
|
8221
|
+
const data = await graphqlQuery({
|
|
8222
|
+
query,
|
|
8223
|
+
variables: {
|
|
8224
|
+
session: this.session,
|
|
8225
|
+
...variables,
|
|
8226
|
+
},
|
|
8227
|
+
thoughtSpotHost: this.thoughtSpotHost,
|
|
8228
|
+
isCompositeQuery: false,
|
|
8229
|
+
});
|
|
8230
|
+
this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
|
|
8231
|
+
return data;
|
|
8232
|
+
}
|
|
8233
|
+
/**
|
|
8234
|
+
* Get the internal session details for the answer.
|
|
8235
|
+
* @returns
|
|
8236
|
+
*/
|
|
8237
|
+
getSession() {
|
|
8238
|
+
return this.session;
|
|
8239
|
+
}
|
|
8240
|
+
async getAnswer() {
|
|
8241
|
+
if (this.answer) {
|
|
8242
|
+
return this.answer;
|
|
8243
|
+
}
|
|
8244
|
+
this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
|
|
8245
|
+
return this.answer;
|
|
8246
|
+
}
|
|
8247
|
+
async getTML() {
|
|
8248
|
+
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8249
|
+
const edoc = object[0].edoc;
|
|
8250
|
+
const YAML = await Promise.resolve().then(function () { return index; });
|
|
8251
|
+
const parsedDoc = YAML.parse(edoc);
|
|
8252
|
+
return {
|
|
8253
|
+
answer: {
|
|
8254
|
+
...parsedDoc.answer,
|
|
8255
|
+
...this.tmlOverride,
|
|
8256
|
+
},
|
|
8257
|
+
};
|
|
8258
|
+
}
|
|
8259
|
+
async addDisplayedVizToLiveboard(liveboardId) {
|
|
8260
|
+
const { displayMode, visualizations } = await this.getAnswer();
|
|
8261
|
+
const viz = getDisplayedViz(visualizations, displayMode);
|
|
8262
|
+
return this.executeQuery(addVizToLiveboard, {
|
|
8263
|
+
liveboardId,
|
|
8264
|
+
vizId: viz.id,
|
|
8265
|
+
});
|
|
8266
|
+
}
|
|
8267
|
+
setTMLOverride(override) {
|
|
8268
|
+
this.tmlOverride = override;
|
|
8269
|
+
}
|
|
8270
|
+
}
|
|
8271
|
+
/**
|
|
8272
|
+
*
|
|
8273
|
+
* @param sourceDetail
|
|
8274
|
+
* @param colNames
|
|
8275
|
+
*/
|
|
8276
|
+
function getGuidsFromColumnNames(sourceDetail, colNames) {
|
|
8277
|
+
const cols = sourceDetail.columns.reduce((colSet, col) => {
|
|
8278
|
+
colSet[col.name.toLowerCase()] = col;
|
|
8279
|
+
return colSet;
|
|
8280
|
+
}, {});
|
|
8281
|
+
return new Set(colNames.map((colName) => {
|
|
8282
|
+
const col = cols[colName.toLowerCase()];
|
|
8283
|
+
return col.id;
|
|
8284
|
+
}));
|
|
8285
|
+
}
|
|
8286
|
+
/**
|
|
8287
|
+
*
|
|
8288
|
+
* @param selectedPoints
|
|
8289
|
+
*/
|
|
8290
|
+
function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
|
|
8291
|
+
const underlyingDataPoint = [];
|
|
8292
|
+
/**
|
|
8293
|
+
*
|
|
8294
|
+
* @param colVal
|
|
8295
|
+
*/
|
|
8296
|
+
function addPointFromColVal(colVal) {
|
|
8297
|
+
var _a;
|
|
8298
|
+
const dataType = colVal.column.dataType;
|
|
8299
|
+
colVal.column.id;
|
|
8300
|
+
let dataValue;
|
|
8301
|
+
if (dataType === 'DATE') {
|
|
8302
|
+
if (Number.isFinite(colVal.value)) {
|
|
8303
|
+
dataValue = [{
|
|
8304
|
+
epochRange: {
|
|
8305
|
+
startEpoch: colVal.value,
|
|
8306
|
+
},
|
|
8307
|
+
}];
|
|
8308
|
+
// Case for custom calendar.
|
|
8309
|
+
}
|
|
8310
|
+
else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
|
|
8311
|
+
dataValue = [{
|
|
8312
|
+
epochRange: {
|
|
8313
|
+
startEpoch: colVal.value.v.s,
|
|
8314
|
+
endEpoch: colVal.value.v.e,
|
|
8315
|
+
},
|
|
8316
|
+
}];
|
|
8317
|
+
}
|
|
8318
|
+
}
|
|
8319
|
+
else {
|
|
8320
|
+
dataValue = [{ value: colVal.value }];
|
|
8321
|
+
}
|
|
8322
|
+
underlyingDataPoint.push({
|
|
8323
|
+
columnId: colVal.column.id,
|
|
8324
|
+
dataValue,
|
|
8325
|
+
});
|
|
8326
|
+
}
|
|
8327
|
+
selectedPoints.forEach((p) => {
|
|
8328
|
+
p.selectedAttributes.forEach(addPointFromColVal);
|
|
8329
|
+
});
|
|
8330
|
+
return underlyingDataPoint;
|
|
8331
|
+
}
|
|
8332
|
+
/**
|
|
8333
|
+
*
|
|
8334
|
+
* @param visualizations
|
|
8335
|
+
* @param displayMode
|
|
8336
|
+
*/
|
|
8337
|
+
function getDisplayedViz(visualizations, displayMode) {
|
|
8338
|
+
if (displayMode === 'CHART_MODE') {
|
|
8339
|
+
return visualizations.find(
|
|
8340
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
8341
|
+
(viz) => viz.__typename === 'ChartViz');
|
|
8342
|
+
}
|
|
8343
|
+
return visualizations.find(
|
|
8344
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
8345
|
+
(viz) => viz.__typename === 'TableViz');
|
|
8346
|
+
}
|
|
8347
|
+
|
|
8348
|
+
/** Built-in value references. */
|
|
8349
|
+
var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
|
|
8350
|
+
|
|
8351
|
+
/**
|
|
8352
|
+
* Checks if `value` is a flattenable `arguments` object or array.
|
|
8353
|
+
*
|
|
8354
|
+
* @private
|
|
8355
|
+
* @param {*} value The value to check.
|
|
8356
|
+
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
|
|
8357
|
+
*/
|
|
8358
|
+
function isFlattenable(value) {
|
|
8359
|
+
return isArray_1(value) || isArguments_1(value) ||
|
|
8360
|
+
!!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
8361
|
+
}
|
|
8362
|
+
|
|
8363
|
+
var _isFlattenable = isFlattenable;
|
|
8364
|
+
|
|
8365
|
+
/**
|
|
8366
|
+
* The base implementation of `_.flatten` with support for restricting flattening.
|
|
8367
|
+
*
|
|
8368
|
+
* @private
|
|
8369
|
+
* @param {Array} array The array to flatten.
|
|
8370
|
+
* @param {number} depth The maximum recursion depth.
|
|
8371
|
+
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
|
|
8372
|
+
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
|
|
8373
|
+
* @param {Array} [result=[]] The initial result value.
|
|
8374
|
+
* @returns {Array} Returns the new flattened array.
|
|
8375
|
+
*/
|
|
8376
|
+
function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
8377
|
+
var index = -1,
|
|
8378
|
+
length = array.length;
|
|
8379
|
+
|
|
8380
|
+
predicate || (predicate = _isFlattenable);
|
|
8381
|
+
result || (result = []);
|
|
8382
|
+
|
|
8383
|
+
while (++index < length) {
|
|
8384
|
+
var value = array[index];
|
|
8385
|
+
if (depth > 0 && predicate(value)) {
|
|
8386
|
+
if (depth > 1) {
|
|
8387
|
+
// Recursively flatten arrays (susceptible to call stack limits).
|
|
8388
|
+
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
|
8389
|
+
} else {
|
|
8390
|
+
_arrayPush(result, value);
|
|
8391
|
+
}
|
|
8392
|
+
} else if (!isStrict) {
|
|
8393
|
+
result[result.length] = value;
|
|
8394
|
+
}
|
|
8395
|
+
}
|
|
8396
|
+
return result;
|
|
8397
|
+
}
|
|
8398
|
+
|
|
8399
|
+
var _baseFlatten = baseFlatten;
|
|
8400
|
+
|
|
8401
|
+
/**
|
|
8402
|
+
* A specialized version of `_.map` for arrays without support for iteratee
|
|
8403
|
+
* shorthands.
|
|
8404
|
+
*
|
|
8405
|
+
* @private
|
|
8406
|
+
* @param {Array} [array] The array to iterate over.
|
|
8407
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
8408
|
+
* @returns {Array} Returns the new mapped array.
|
|
8409
|
+
*/
|
|
8410
|
+
function arrayMap(array, iteratee) {
|
|
8411
|
+
var index = -1,
|
|
8412
|
+
length = array == null ? 0 : array.length,
|
|
8413
|
+
result = Array(length);
|
|
8414
|
+
|
|
8415
|
+
while (++index < length) {
|
|
8416
|
+
result[index] = iteratee(array[index], index, array);
|
|
8417
|
+
}
|
|
8418
|
+
return result;
|
|
8419
|
+
}
|
|
8420
|
+
|
|
8421
|
+
var _arrayMap = arrayMap;
|
|
8422
|
+
|
|
8423
|
+
/** `Object#toString` result references. */
|
|
8424
|
+
var symbolTag = '[object Symbol]';
|
|
8425
|
+
|
|
8426
|
+
/**
|
|
8427
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
8428
|
+
*
|
|
8429
|
+
* @static
|
|
8430
|
+
* @memberOf _
|
|
8431
|
+
* @since 4.0.0
|
|
8432
|
+
* @category Lang
|
|
8433
|
+
* @param {*} value The value to check.
|
|
8434
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
8435
|
+
* @example
|
|
8436
|
+
*
|
|
8437
|
+
* _.isSymbol(Symbol.iterator);
|
|
8438
|
+
* // => true
|
|
8439
|
+
*
|
|
8440
|
+
* _.isSymbol('abc');
|
|
8441
|
+
* // => false
|
|
8442
|
+
*/
|
|
8443
|
+
function isSymbol(value) {
|
|
8444
|
+
return typeof value == 'symbol' ||
|
|
8445
|
+
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
8446
|
+
}
|
|
8447
|
+
|
|
8448
|
+
var isSymbol_1 = isSymbol;
|
|
8449
|
+
|
|
8450
|
+
/** Used to match property names within property paths. */
|
|
8451
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
8452
|
+
reIsPlainProp = /^\w*$/;
|
|
8453
|
+
|
|
8454
|
+
/**
|
|
8455
|
+
* Checks if `value` is a property name and not a property path.
|
|
8456
|
+
*
|
|
8457
|
+
* @private
|
|
8458
|
+
* @param {*} value The value to check.
|
|
8459
|
+
* @param {Object} [object] The object to query keys on.
|
|
8460
|
+
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
8461
|
+
*/
|
|
8462
|
+
function isKey(value, object) {
|
|
8463
|
+
if (isArray_1(value)) {
|
|
8464
|
+
return false;
|
|
8465
|
+
}
|
|
8466
|
+
var type = typeof value;
|
|
8467
|
+
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
8468
|
+
value == null || isSymbol_1(value)) {
|
|
8469
|
+
return true;
|
|
8470
|
+
}
|
|
8471
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
8472
|
+
(object != null && value in Object(object));
|
|
8473
|
+
}
|
|
8474
|
+
|
|
8475
|
+
var _isKey = isKey;
|
|
8476
|
+
|
|
8477
|
+
/** Error message constants. */
|
|
8478
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
8479
|
+
|
|
8480
|
+
/**
|
|
8481
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
8482
|
+
* provided, it determines the cache key for storing the result based on the
|
|
8483
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
8484
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
8485
|
+
* is invoked with the `this` binding of the memoized function.
|
|
8486
|
+
*
|
|
8487
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
8488
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
8489
|
+
* constructor with one whose instances implement the
|
|
8490
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
8491
|
+
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
8492
|
+
*
|
|
8493
|
+
* @static
|
|
8494
|
+
* @memberOf _
|
|
8495
|
+
* @since 0.1.0
|
|
8496
|
+
* @category Function
|
|
8497
|
+
* @param {Function} func The function to have its output memoized.
|
|
8498
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
8499
|
+
* @returns {Function} Returns the new memoized function.
|
|
8500
|
+
* @example
|
|
8501
|
+
*
|
|
8502
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
8503
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
8504
|
+
*
|
|
8505
|
+
* var values = _.memoize(_.values);
|
|
8506
|
+
* values(object);
|
|
8507
|
+
* // => [1, 2]
|
|
8508
|
+
*
|
|
8509
|
+
* values(other);
|
|
8510
|
+
* // => [3, 4]
|
|
8511
|
+
*
|
|
8512
|
+
* object.a = 2;
|
|
8513
|
+
* values(object);
|
|
8514
|
+
* // => [1, 2]
|
|
8515
|
+
*
|
|
8516
|
+
* // Modify the result cache.
|
|
8517
|
+
* values.cache.set(object, ['a', 'b']);
|
|
8518
|
+
* values(object);
|
|
8519
|
+
* // => ['a', 'b']
|
|
8520
|
+
*
|
|
8521
|
+
* // Replace `_.memoize.Cache`.
|
|
8522
|
+
* _.memoize.Cache = WeakMap;
|
|
8523
|
+
*/
|
|
8524
|
+
function memoize(func, resolver) {
|
|
8525
|
+
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
8526
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
8527
|
+
}
|
|
8528
|
+
var memoized = function() {
|
|
8529
|
+
var args = arguments,
|
|
8530
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
8531
|
+
cache = memoized.cache;
|
|
8532
|
+
|
|
8533
|
+
if (cache.has(key)) {
|
|
8534
|
+
return cache.get(key);
|
|
8535
|
+
}
|
|
8536
|
+
var result = func.apply(this, args);
|
|
8537
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
8538
|
+
return result;
|
|
8539
|
+
};
|
|
8540
|
+
memoized.cache = new (memoize.Cache || _MapCache);
|
|
8541
|
+
return memoized;
|
|
8542
|
+
}
|
|
8543
|
+
|
|
8544
|
+
// Expose `MapCache`.
|
|
8545
|
+
memoize.Cache = _MapCache;
|
|
8546
|
+
|
|
8547
|
+
var memoize_1 = memoize;
|
|
8548
|
+
|
|
8549
|
+
/** Used as the maximum memoize cache size. */
|
|
8550
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
8551
|
+
|
|
8552
|
+
/**
|
|
8553
|
+
* A specialized version of `_.memoize` which clears the memoized function's
|
|
8554
|
+
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
8555
|
+
*
|
|
8556
|
+
* @private
|
|
8557
|
+
* @param {Function} func The function to have its output memoized.
|
|
8558
|
+
* @returns {Function} Returns the new memoized function.
|
|
8559
|
+
*/
|
|
8560
|
+
function memoizeCapped(func) {
|
|
8561
|
+
var result = memoize_1(func, function(key) {
|
|
8562
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
8563
|
+
cache.clear();
|
|
8564
|
+
}
|
|
8565
|
+
return key;
|
|
8566
|
+
});
|
|
8567
|
+
|
|
8568
|
+
var cache = result.cache;
|
|
8569
|
+
return result;
|
|
8570
|
+
}
|
|
8571
|
+
|
|
8572
|
+
var _memoizeCapped = memoizeCapped;
|
|
8573
|
+
|
|
8574
|
+
/** Used to match property names within property paths. */
|
|
8575
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
8576
|
+
|
|
8577
|
+
/** Used to match backslashes in property paths. */
|
|
8578
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
8579
|
+
|
|
8580
|
+
/**
|
|
8581
|
+
* Converts `string` to a property path array.
|
|
8582
|
+
*
|
|
8583
|
+
* @private
|
|
8584
|
+
* @param {string} string The string to convert.
|
|
8585
|
+
* @returns {Array} Returns the property path array.
|
|
8586
|
+
*/
|
|
8587
|
+
var stringToPath = _memoizeCapped(function(string) {
|
|
8588
|
+
var result = [];
|
|
8589
|
+
if (string.charCodeAt(0) === 46 /* . */) {
|
|
8590
|
+
result.push('');
|
|
8591
|
+
}
|
|
8592
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
8593
|
+
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
8594
|
+
});
|
|
8595
|
+
return result;
|
|
8596
|
+
});
|
|
8597
|
+
|
|
8598
|
+
var _stringToPath = stringToPath;
|
|
8599
|
+
|
|
8600
|
+
/** Used as references for various `Number` constants. */
|
|
8601
|
+
var INFINITY$1 = 1 / 0;
|
|
8602
|
+
|
|
8603
|
+
/** Used to convert symbols to primitives and strings. */
|
|
8604
|
+
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
8605
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
8606
|
+
|
|
8607
|
+
/**
|
|
8608
|
+
* The base implementation of `_.toString` which doesn't convert nullish
|
|
8609
|
+
* values to empty strings.
|
|
8610
|
+
*
|
|
8611
|
+
* @private
|
|
8612
|
+
* @param {*} value The value to process.
|
|
8613
|
+
* @returns {string} Returns the string.
|
|
8614
|
+
*/
|
|
8615
|
+
function baseToString(value) {
|
|
8616
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
|
8617
|
+
if (typeof value == 'string') {
|
|
8618
|
+
return value;
|
|
8619
|
+
}
|
|
8620
|
+
if (isArray_1(value)) {
|
|
8621
|
+
// Recursively convert values (susceptible to call stack limits).
|
|
8622
|
+
return _arrayMap(value, baseToString) + '';
|
|
8623
|
+
}
|
|
8624
|
+
if (isSymbol_1(value)) {
|
|
8625
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
8626
|
+
}
|
|
8627
|
+
var result = (value + '');
|
|
8628
|
+
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
8629
|
+
}
|
|
8630
|
+
|
|
8631
|
+
var _baseToString = baseToString;
|
|
8632
|
+
|
|
8633
|
+
/**
|
|
8634
|
+
* Converts `value` to a string. An empty string is returned for `null`
|
|
8635
|
+
* and `undefined` values. The sign of `-0` is preserved.
|
|
8636
|
+
*
|
|
8637
|
+
* @static
|
|
8638
|
+
* @memberOf _
|
|
8639
|
+
* @since 4.0.0
|
|
8640
|
+
* @category Lang
|
|
8641
|
+
* @param {*} value The value to convert.
|
|
8642
|
+
* @returns {string} Returns the converted string.
|
|
8643
|
+
* @example
|
|
8644
|
+
*
|
|
8645
|
+
* _.toString(null);
|
|
8646
|
+
* // => ''
|
|
8647
|
+
*
|
|
8648
|
+
* _.toString(-0);
|
|
8649
|
+
* // => '-0'
|
|
8650
|
+
*
|
|
8651
|
+
* _.toString([1, 2, 3]);
|
|
8652
|
+
* // => '1,2,3'
|
|
8653
|
+
*/
|
|
8654
|
+
function toString$1(value) {
|
|
8655
|
+
return value == null ? '' : _baseToString(value);
|
|
8656
|
+
}
|
|
8657
|
+
|
|
8658
|
+
var toString_1 = toString$1;
|
|
8659
|
+
|
|
8660
|
+
/**
|
|
8661
|
+
* Casts `value` to a path array if it's not one.
|
|
8662
|
+
*
|
|
8663
|
+
* @private
|
|
8664
|
+
* @param {*} value The value to inspect.
|
|
8665
|
+
* @param {Object} [object] The object to query keys on.
|
|
8666
|
+
* @returns {Array} Returns the cast property path array.
|
|
8667
|
+
*/
|
|
8668
|
+
function castPath(value, object) {
|
|
8669
|
+
if (isArray_1(value)) {
|
|
8670
|
+
return value;
|
|
8671
|
+
}
|
|
8672
|
+
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
8673
|
+
}
|
|
8674
|
+
|
|
8675
|
+
var _castPath = castPath;
|
|
8676
|
+
|
|
8677
|
+
/** Used as references for various `Number` constants. */
|
|
8678
|
+
var INFINITY = 1 / 0;
|
|
8679
|
+
|
|
8680
|
+
/**
|
|
8681
|
+
* Converts `value` to a string key if it's not a string or symbol.
|
|
8682
|
+
*
|
|
8683
|
+
* @private
|
|
8684
|
+
* @param {*} value The value to inspect.
|
|
8685
|
+
* @returns {string|symbol} Returns the key.
|
|
8686
|
+
*/
|
|
8687
|
+
function toKey(value) {
|
|
8688
|
+
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
8689
|
+
return value;
|
|
8690
|
+
}
|
|
8691
|
+
var result = (value + '');
|
|
8692
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
8693
|
+
}
|
|
8694
|
+
|
|
8695
|
+
var _toKey = toKey;
|
|
8696
|
+
|
|
8697
|
+
/**
|
|
8698
|
+
* The base implementation of `_.get` without support for default values.
|
|
8699
|
+
*
|
|
8700
|
+
* @private
|
|
8701
|
+
* @param {Object} object The object to query.
|
|
8702
|
+
* @param {Array|string} path The path of the property to get.
|
|
8703
|
+
* @returns {*} Returns the resolved value.
|
|
8704
|
+
*/
|
|
8705
|
+
function baseGet(object, path) {
|
|
8706
|
+
path = _castPath(path, object);
|
|
8707
|
+
|
|
8708
|
+
var index = 0,
|
|
8709
|
+
length = path.length;
|
|
8710
|
+
|
|
8711
|
+
while (object != null && index < length) {
|
|
8712
|
+
object = object[_toKey(path[index++])];
|
|
8713
|
+
}
|
|
8714
|
+
return (index && index == length) ? object : undefined;
|
|
8715
|
+
}
|
|
8716
|
+
|
|
8717
|
+
var _baseGet = baseGet;
|
|
8718
|
+
|
|
8719
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
8720
|
+
var COMPARE_PARTIAL_FLAG$1 = 1,
|
|
8721
|
+
COMPARE_UNORDERED_FLAG$1 = 2;
|
|
8722
|
+
|
|
8723
|
+
/**
|
|
8724
|
+
* The base implementation of `_.isMatch` without support for iteratee shorthands.
|
|
8725
|
+
*
|
|
8726
|
+
* @private
|
|
8727
|
+
* @param {Object} object The object to inspect.
|
|
8728
|
+
* @param {Object} source The object of property values to match.
|
|
8729
|
+
* @param {Array} matchData The property names, values, and compare flags to match.
|
|
8730
|
+
* @param {Function} [customizer] The function to customize comparisons.
|
|
8731
|
+
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
|
|
8732
|
+
*/
|
|
8733
|
+
function baseIsMatch(object, source, matchData, customizer) {
|
|
8734
|
+
var index = matchData.length,
|
|
8735
|
+
length = index,
|
|
8736
|
+
noCustomizer = !customizer;
|
|
8737
|
+
|
|
8738
|
+
if (object == null) {
|
|
8739
|
+
return !length;
|
|
8740
|
+
}
|
|
8741
|
+
object = Object(object);
|
|
8742
|
+
while (index--) {
|
|
8743
|
+
var data = matchData[index];
|
|
8744
|
+
if ((noCustomizer && data[2])
|
|
8745
|
+
? data[1] !== object[data[0]]
|
|
8746
|
+
: !(data[0] in object)
|
|
8747
|
+
) {
|
|
8748
|
+
return false;
|
|
8749
|
+
}
|
|
8750
|
+
}
|
|
8751
|
+
while (++index < length) {
|
|
8752
|
+
data = matchData[index];
|
|
8753
|
+
var key = data[0],
|
|
8754
|
+
objValue = object[key],
|
|
8755
|
+
srcValue = data[1];
|
|
8756
|
+
|
|
8757
|
+
if (noCustomizer && data[2]) {
|
|
8758
|
+
if (objValue === undefined && !(key in object)) {
|
|
8759
|
+
return false;
|
|
8760
|
+
}
|
|
8761
|
+
} else {
|
|
8762
|
+
var stack = new _Stack;
|
|
8763
|
+
if (customizer) {
|
|
8764
|
+
var result = customizer(objValue, srcValue, key, object, source, stack);
|
|
8765
|
+
}
|
|
8766
|
+
if (!(result === undefined
|
|
8767
|
+
? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack)
|
|
8768
|
+
: result
|
|
8769
|
+
)) {
|
|
8770
|
+
return false;
|
|
8771
|
+
}
|
|
8772
|
+
}
|
|
8773
|
+
}
|
|
8774
|
+
return true;
|
|
8775
|
+
}
|
|
8776
|
+
|
|
8777
|
+
var _baseIsMatch = baseIsMatch;
|
|
8778
|
+
|
|
8779
|
+
/**
|
|
8780
|
+
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
|
|
8781
|
+
*
|
|
8782
|
+
* @private
|
|
8783
|
+
* @param {*} value The value to check.
|
|
8784
|
+
* @returns {boolean} Returns `true` if `value` if suitable for strict
|
|
8785
|
+
* equality comparisons, else `false`.
|
|
8786
|
+
*/
|
|
8787
|
+
function isStrictComparable(value) {
|
|
8788
|
+
return value === value && !isObject_1(value);
|
|
8789
|
+
}
|
|
8790
|
+
|
|
8791
|
+
var _isStrictComparable = isStrictComparable;
|
|
8792
|
+
|
|
8793
|
+
/**
|
|
8794
|
+
* Gets the property names, values, and compare flags of `object`.
|
|
8795
|
+
*
|
|
8796
|
+
* @private
|
|
8797
|
+
* @param {Object} object The object to query.
|
|
8798
|
+
* @returns {Array} Returns the match data of `object`.
|
|
8799
|
+
*/
|
|
8800
|
+
function getMatchData(object) {
|
|
8801
|
+
var result = keys_1(object),
|
|
8802
|
+
length = result.length;
|
|
8803
|
+
|
|
8804
|
+
while (length--) {
|
|
8805
|
+
var key = result[length],
|
|
8806
|
+
value = object[key];
|
|
8807
|
+
|
|
8808
|
+
result[length] = [key, value, _isStrictComparable(value)];
|
|
8809
|
+
}
|
|
8810
|
+
return result;
|
|
8811
|
+
}
|
|
8812
|
+
|
|
8813
|
+
var _getMatchData = getMatchData;
|
|
8814
|
+
|
|
8815
|
+
/**
|
|
8816
|
+
* A specialized version of `matchesProperty` for source values suitable
|
|
8817
|
+
* for strict equality comparisons, i.e. `===`.
|
|
8818
|
+
*
|
|
8819
|
+
* @private
|
|
8820
|
+
* @param {string} key The key of the property to get.
|
|
8821
|
+
* @param {*} srcValue The value to match.
|
|
8822
|
+
* @returns {Function} Returns the new spec function.
|
|
8823
|
+
*/
|
|
8824
|
+
function matchesStrictComparable(key, srcValue) {
|
|
8825
|
+
return function(object) {
|
|
8826
|
+
if (object == null) {
|
|
8827
|
+
return false;
|
|
8828
|
+
}
|
|
8829
|
+
return object[key] === srcValue &&
|
|
8830
|
+
(srcValue !== undefined || (key in Object(object)));
|
|
8831
|
+
};
|
|
8832
|
+
}
|
|
8833
|
+
|
|
8834
|
+
var _matchesStrictComparable = matchesStrictComparable;
|
|
8835
|
+
|
|
8836
|
+
/**
|
|
8837
|
+
* The base implementation of `_.matches` which doesn't clone `source`.
|
|
8838
|
+
*
|
|
8839
|
+
* @private
|
|
8840
|
+
* @param {Object} source The object of property values to match.
|
|
8841
|
+
* @returns {Function} Returns the new spec function.
|
|
8842
|
+
*/
|
|
8843
|
+
function baseMatches(source) {
|
|
8844
|
+
var matchData = _getMatchData(source);
|
|
8845
|
+
if (matchData.length == 1 && matchData[0][2]) {
|
|
8846
|
+
return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
|
8847
|
+
}
|
|
8848
|
+
return function(object) {
|
|
8849
|
+
return object === source || _baseIsMatch(object, source, matchData);
|
|
8850
|
+
};
|
|
8851
|
+
}
|
|
8852
|
+
|
|
8853
|
+
var _baseMatches = baseMatches;
|
|
8854
|
+
|
|
8855
|
+
/**
|
|
8856
|
+
* Gets the value at `path` of `object`. If the resolved value is
|
|
8857
|
+
* `undefined`, the `defaultValue` is returned in its place.
|
|
8858
|
+
*
|
|
8859
|
+
* @static
|
|
8860
|
+
* @memberOf _
|
|
8861
|
+
* @since 3.7.0
|
|
8862
|
+
* @category Object
|
|
8863
|
+
* @param {Object} object The object to query.
|
|
8864
|
+
* @param {Array|string} path The path of the property to get.
|
|
8865
|
+
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
8866
|
+
* @returns {*} Returns the resolved value.
|
|
8867
|
+
* @example
|
|
8868
|
+
*
|
|
8869
|
+
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
8870
|
+
*
|
|
8871
|
+
* _.get(object, 'a[0].b.c');
|
|
8872
|
+
* // => 3
|
|
8873
|
+
*
|
|
8874
|
+
* _.get(object, ['a', '0', 'b', 'c']);
|
|
8875
|
+
* // => 3
|
|
8876
|
+
*
|
|
8877
|
+
* _.get(object, 'a.b.c', 'default');
|
|
8878
|
+
* // => 'default'
|
|
8879
|
+
*/
|
|
8880
|
+
function get(object, path, defaultValue) {
|
|
8881
|
+
var result = object == null ? undefined : _baseGet(object, path);
|
|
8882
|
+
return result === undefined ? defaultValue : result;
|
|
8883
|
+
}
|
|
8884
|
+
|
|
8885
|
+
var get_1 = get;
|
|
8886
|
+
|
|
8887
|
+
/**
|
|
8888
|
+
* The base implementation of `_.hasIn` without support for deep paths.
|
|
8889
|
+
*
|
|
8890
|
+
* @private
|
|
8891
|
+
* @param {Object} [object] The object to query.
|
|
8892
|
+
* @param {Array|string} key The key to check.
|
|
8893
|
+
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
|
8894
|
+
*/
|
|
8895
|
+
function baseHasIn(object, key) {
|
|
8896
|
+
return object != null && key in Object(object);
|
|
8897
|
+
}
|
|
8898
|
+
|
|
8899
|
+
var _baseHasIn = baseHasIn;
|
|
8900
|
+
|
|
8901
|
+
/**
|
|
8902
|
+
* Checks if `path` exists on `object`.
|
|
8903
|
+
*
|
|
8904
|
+
* @private
|
|
8905
|
+
* @param {Object} object The object to query.
|
|
8906
|
+
* @param {Array|string} path The path to check.
|
|
8907
|
+
* @param {Function} hasFunc The function to check properties.
|
|
8908
|
+
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
|
8909
|
+
*/
|
|
8910
|
+
function hasPath(object, path, hasFunc) {
|
|
8911
|
+
path = _castPath(path, object);
|
|
8912
|
+
|
|
8913
|
+
var index = -1,
|
|
8914
|
+
length = path.length,
|
|
8915
|
+
result = false;
|
|
8916
|
+
|
|
8917
|
+
while (++index < length) {
|
|
8918
|
+
var key = _toKey(path[index]);
|
|
8919
|
+
if (!(result = object != null && hasFunc(object, key))) {
|
|
8920
|
+
break;
|
|
8921
|
+
}
|
|
8922
|
+
object = object[key];
|
|
8923
|
+
}
|
|
8924
|
+
if (result || ++index != length) {
|
|
8925
|
+
return result;
|
|
8926
|
+
}
|
|
8927
|
+
length = object == null ? 0 : object.length;
|
|
8928
|
+
return !!length && isLength_1(length) && _isIndex(key, length) &&
|
|
8929
|
+
(isArray_1(object) || isArguments_1(object));
|
|
8930
|
+
}
|
|
8931
|
+
|
|
8932
|
+
var _hasPath = hasPath;
|
|
8933
|
+
|
|
8934
|
+
/**
|
|
8935
|
+
* Checks if `path` is a direct or inherited property of `object`.
|
|
8936
|
+
*
|
|
8937
|
+
* @static
|
|
8938
|
+
* @memberOf _
|
|
8939
|
+
* @since 4.0.0
|
|
8940
|
+
* @category Object
|
|
8941
|
+
* @param {Object} object The object to query.
|
|
8942
|
+
* @param {Array|string} path The path to check.
|
|
8943
|
+
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
|
8944
|
+
* @example
|
|
8945
|
+
*
|
|
8946
|
+
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
|
|
8947
|
+
*
|
|
8948
|
+
* _.hasIn(object, 'a');
|
|
8949
|
+
* // => true
|
|
8950
|
+
*
|
|
8951
|
+
* _.hasIn(object, 'a.b');
|
|
8952
|
+
* // => true
|
|
8953
|
+
*
|
|
8954
|
+
* _.hasIn(object, ['a', 'b']);
|
|
8955
|
+
* // => true
|
|
8956
|
+
*
|
|
8957
|
+
* _.hasIn(object, 'b');
|
|
8958
|
+
* // => false
|
|
8959
|
+
*/
|
|
8960
|
+
function hasIn(object, path) {
|
|
8961
|
+
return object != null && _hasPath(object, path, _baseHasIn);
|
|
8962
|
+
}
|
|
8963
|
+
|
|
8964
|
+
var hasIn_1 = hasIn;
|
|
8965
|
+
|
|
8966
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
8967
|
+
var COMPARE_PARTIAL_FLAG = 1,
|
|
8968
|
+
COMPARE_UNORDERED_FLAG = 2;
|
|
8969
|
+
|
|
8970
|
+
/**
|
|
8971
|
+
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
|
|
8972
|
+
*
|
|
8973
|
+
* @private
|
|
8974
|
+
* @param {string} path The path of the property to get.
|
|
8975
|
+
* @param {*} srcValue The value to match.
|
|
8976
|
+
* @returns {Function} Returns the new spec function.
|
|
8977
|
+
*/
|
|
8978
|
+
function baseMatchesProperty(path, srcValue) {
|
|
8979
|
+
if (_isKey(path) && _isStrictComparable(srcValue)) {
|
|
8980
|
+
return _matchesStrictComparable(_toKey(path), srcValue);
|
|
8981
|
+
}
|
|
8982
|
+
return function(object) {
|
|
8983
|
+
var objValue = get_1(object, path);
|
|
8984
|
+
return (objValue === undefined && objValue === srcValue)
|
|
8985
|
+
? hasIn_1(object, path)
|
|
8986
|
+
: _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
8987
|
+
};
|
|
8988
|
+
}
|
|
8989
|
+
|
|
8990
|
+
var _baseMatchesProperty = baseMatchesProperty;
|
|
8991
|
+
|
|
8992
|
+
/**
|
|
8993
|
+
* This method returns the first argument it receives.
|
|
8994
|
+
*
|
|
8995
|
+
* @static
|
|
8996
|
+
* @since 0.1.0
|
|
8997
|
+
* @memberOf _
|
|
8998
|
+
* @category Util
|
|
8999
|
+
* @param {*} value Any value.
|
|
9000
|
+
* @returns {*} Returns `value`.
|
|
9001
|
+
* @example
|
|
9002
|
+
*
|
|
9003
|
+
* var object = { 'a': 1 };
|
|
9004
|
+
*
|
|
9005
|
+
* console.log(_.identity(object) === object);
|
|
9006
|
+
* // => true
|
|
9007
|
+
*/
|
|
9008
|
+
function identity(value) {
|
|
9009
|
+
return value;
|
|
9010
|
+
}
|
|
9011
|
+
|
|
9012
|
+
var identity_1 = identity;
|
|
9013
|
+
|
|
9014
|
+
/**
|
|
9015
|
+
* The base implementation of `_.property` without support for deep paths.
|
|
9016
|
+
*
|
|
9017
|
+
* @private
|
|
9018
|
+
* @param {string} key The key of the property to get.
|
|
9019
|
+
* @returns {Function} Returns the new accessor function.
|
|
9020
|
+
*/
|
|
9021
|
+
function baseProperty(key) {
|
|
9022
|
+
return function(object) {
|
|
9023
|
+
return object == null ? undefined : object[key];
|
|
9024
|
+
};
|
|
9025
|
+
}
|
|
9026
|
+
|
|
9027
|
+
var _baseProperty = baseProperty;
|
|
9028
|
+
|
|
9029
|
+
/**
|
|
9030
|
+
* A specialized version of `baseProperty` which supports deep paths.
|
|
9031
|
+
*
|
|
9032
|
+
* @private
|
|
9033
|
+
* @param {Array|string} path The path of the property to get.
|
|
9034
|
+
* @returns {Function} Returns the new accessor function.
|
|
9035
|
+
*/
|
|
9036
|
+
function basePropertyDeep(path) {
|
|
9037
|
+
return function(object) {
|
|
9038
|
+
return _baseGet(object, path);
|
|
9039
|
+
};
|
|
9040
|
+
}
|
|
9041
|
+
|
|
9042
|
+
var _basePropertyDeep = basePropertyDeep;
|
|
9043
|
+
|
|
9044
|
+
/**
|
|
9045
|
+
* Creates a function that returns the value at `path` of a given object.
|
|
9046
|
+
*
|
|
9047
|
+
* @static
|
|
9048
|
+
* @memberOf _
|
|
9049
|
+
* @since 2.4.0
|
|
9050
|
+
* @category Util
|
|
9051
|
+
* @param {Array|string} path The path of the property to get.
|
|
9052
|
+
* @returns {Function} Returns the new accessor function.
|
|
9053
|
+
* @example
|
|
9054
|
+
*
|
|
9055
|
+
* var objects = [
|
|
9056
|
+
* { 'a': { 'b': 2 } },
|
|
9057
|
+
* { 'a': { 'b': 1 } }
|
|
9058
|
+
* ];
|
|
9059
|
+
*
|
|
9060
|
+
* _.map(objects, _.property('a.b'));
|
|
9061
|
+
* // => [2, 1]
|
|
9062
|
+
*
|
|
9063
|
+
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
|
|
9064
|
+
* // => [1, 2]
|
|
9065
|
+
*/
|
|
9066
|
+
function property(path) {
|
|
9067
|
+
return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
|
|
9068
|
+
}
|
|
9069
|
+
|
|
9070
|
+
var property_1 = property;
|
|
9071
|
+
|
|
9072
|
+
/**
|
|
9073
|
+
* The base implementation of `_.iteratee`.
|
|
9074
|
+
*
|
|
9075
|
+
* @private
|
|
9076
|
+
* @param {*} [value=_.identity] The value to convert to an iteratee.
|
|
9077
|
+
* @returns {Function} Returns the iteratee.
|
|
9078
|
+
*/
|
|
9079
|
+
function baseIteratee(value) {
|
|
9080
|
+
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
|
|
9081
|
+
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
|
|
9082
|
+
if (typeof value == 'function') {
|
|
9083
|
+
return value;
|
|
9084
|
+
}
|
|
9085
|
+
if (value == null) {
|
|
9086
|
+
return identity_1;
|
|
9087
|
+
}
|
|
9088
|
+
if (typeof value == 'object') {
|
|
9089
|
+
return isArray_1(value)
|
|
9090
|
+
? _baseMatchesProperty(value[0], value[1])
|
|
9091
|
+
: _baseMatches(value);
|
|
9092
|
+
}
|
|
9093
|
+
return property_1(value);
|
|
9094
|
+
}
|
|
9095
|
+
|
|
9096
|
+
var _baseIteratee = baseIteratee;
|
|
9097
|
+
|
|
9098
|
+
/**
|
|
9099
|
+
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
9100
|
+
*
|
|
9101
|
+
* @private
|
|
9102
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
9103
|
+
* @returns {Function} Returns the new base function.
|
|
9104
|
+
*/
|
|
9105
|
+
function createBaseFor(fromRight) {
|
|
9106
|
+
return function(object, iteratee, keysFunc) {
|
|
9107
|
+
var index = -1,
|
|
9108
|
+
iterable = Object(object),
|
|
9109
|
+
props = keysFunc(object),
|
|
9110
|
+
length = props.length;
|
|
9111
|
+
|
|
9112
|
+
while (length--) {
|
|
9113
|
+
var key = props[fromRight ? length : ++index];
|
|
9114
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
9115
|
+
break;
|
|
9116
|
+
}
|
|
9117
|
+
}
|
|
9118
|
+
return object;
|
|
9119
|
+
};
|
|
9120
|
+
}
|
|
9121
|
+
|
|
9122
|
+
var _createBaseFor = createBaseFor;
|
|
9123
|
+
|
|
9124
|
+
/**
|
|
9125
|
+
* The base implementation of `baseForOwn` which iterates over `object`
|
|
9126
|
+
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
9127
|
+
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
9128
|
+
*
|
|
9129
|
+
* @private
|
|
9130
|
+
* @param {Object} object The object to iterate over.
|
|
9131
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9132
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
9133
|
+
* @returns {Object} Returns `object`.
|
|
9134
|
+
*/
|
|
9135
|
+
var baseFor = _createBaseFor();
|
|
9136
|
+
|
|
9137
|
+
var _baseFor = baseFor;
|
|
9138
|
+
|
|
9139
|
+
/**
|
|
9140
|
+
* The base implementation of `_.forOwn` without support for iteratee shorthands.
|
|
9141
|
+
*
|
|
9142
|
+
* @private
|
|
9143
|
+
* @param {Object} object The object to iterate over.
|
|
9144
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9145
|
+
* @returns {Object} Returns `object`.
|
|
9146
|
+
*/
|
|
9147
|
+
function baseForOwn(object, iteratee) {
|
|
9148
|
+
return object && _baseFor(object, iteratee, keys_1);
|
|
9149
|
+
}
|
|
9150
|
+
|
|
9151
|
+
var _baseForOwn = baseForOwn;
|
|
9152
|
+
|
|
9153
|
+
/**
|
|
9154
|
+
* Creates a `baseEach` or `baseEachRight` function.
|
|
9155
|
+
*
|
|
9156
|
+
* @private
|
|
9157
|
+
* @param {Function} eachFunc The function to iterate over a collection.
|
|
9158
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
9159
|
+
* @returns {Function} Returns the new base function.
|
|
9160
|
+
*/
|
|
9161
|
+
function createBaseEach(eachFunc, fromRight) {
|
|
9162
|
+
return function(collection, iteratee) {
|
|
9163
|
+
if (collection == null) {
|
|
9164
|
+
return collection;
|
|
9165
|
+
}
|
|
9166
|
+
if (!isArrayLike_1(collection)) {
|
|
9167
|
+
return eachFunc(collection, iteratee);
|
|
9168
|
+
}
|
|
9169
|
+
var length = collection.length,
|
|
9170
|
+
index = fromRight ? length : -1,
|
|
9171
|
+
iterable = Object(collection);
|
|
9172
|
+
|
|
9173
|
+
while ((fromRight ? index-- : ++index < length)) {
|
|
9174
|
+
if (iteratee(iterable[index], index, iterable) === false) {
|
|
9175
|
+
break;
|
|
9176
|
+
}
|
|
9177
|
+
}
|
|
9178
|
+
return collection;
|
|
9179
|
+
};
|
|
9180
|
+
}
|
|
9181
|
+
|
|
9182
|
+
var _createBaseEach = createBaseEach;
|
|
9183
|
+
|
|
9184
|
+
/**
|
|
9185
|
+
* The base implementation of `_.forEach` without support for iteratee shorthands.
|
|
9186
|
+
*
|
|
9187
|
+
* @private
|
|
9188
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9189
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9190
|
+
* @returns {Array|Object} Returns `collection`.
|
|
9191
|
+
*/
|
|
9192
|
+
var baseEach = _createBaseEach(_baseForOwn);
|
|
9193
|
+
|
|
9194
|
+
var _baseEach = baseEach;
|
|
9195
|
+
|
|
9196
|
+
/**
|
|
9197
|
+
* The base implementation of `_.map` without support for iteratee shorthands.
|
|
9198
|
+
*
|
|
9199
|
+
* @private
|
|
9200
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9201
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9202
|
+
* @returns {Array} Returns the new mapped array.
|
|
9203
|
+
*/
|
|
9204
|
+
function baseMap(collection, iteratee) {
|
|
9205
|
+
var index = -1,
|
|
9206
|
+
result = isArrayLike_1(collection) ? Array(collection.length) : [];
|
|
9207
|
+
|
|
9208
|
+
_baseEach(collection, function(value, key, collection) {
|
|
9209
|
+
result[++index] = iteratee(value, key, collection);
|
|
9210
|
+
});
|
|
9211
|
+
return result;
|
|
9212
|
+
}
|
|
9213
|
+
|
|
9214
|
+
var _baseMap = baseMap;
|
|
9215
|
+
|
|
9216
|
+
/**
|
|
9217
|
+
* The base implementation of `_.sortBy` which uses `comparer` to define the
|
|
9218
|
+
* sort order of `array` and replaces criteria objects with their corresponding
|
|
9219
|
+
* values.
|
|
9220
|
+
*
|
|
9221
|
+
* @private
|
|
9222
|
+
* @param {Array} array The array to sort.
|
|
9223
|
+
* @param {Function} comparer The function to define sort order.
|
|
9224
|
+
* @returns {Array} Returns `array`.
|
|
9225
|
+
*/
|
|
9226
|
+
function baseSortBy(array, comparer) {
|
|
9227
|
+
var length = array.length;
|
|
9228
|
+
|
|
9229
|
+
array.sort(comparer);
|
|
9230
|
+
while (length--) {
|
|
9231
|
+
array[length] = array[length].value;
|
|
9232
|
+
}
|
|
9233
|
+
return array;
|
|
9234
|
+
}
|
|
9235
|
+
|
|
9236
|
+
var _baseSortBy = baseSortBy;
|
|
9237
|
+
|
|
9238
|
+
/**
|
|
9239
|
+
* Compares values to sort them in ascending order.
|
|
9240
|
+
*
|
|
9241
|
+
* @private
|
|
9242
|
+
* @param {*} value The value to compare.
|
|
9243
|
+
* @param {*} other The other value to compare.
|
|
9244
|
+
* @returns {number} Returns the sort order indicator for `value`.
|
|
9245
|
+
*/
|
|
9246
|
+
function compareAscending(value, other) {
|
|
9247
|
+
if (value !== other) {
|
|
9248
|
+
var valIsDefined = value !== undefined,
|
|
9249
|
+
valIsNull = value === null,
|
|
9250
|
+
valIsReflexive = value === value,
|
|
9251
|
+
valIsSymbol = isSymbol_1(value);
|
|
9252
|
+
|
|
9253
|
+
var othIsDefined = other !== undefined,
|
|
9254
|
+
othIsNull = other === null,
|
|
9255
|
+
othIsReflexive = other === other,
|
|
9256
|
+
othIsSymbol = isSymbol_1(other);
|
|
9257
|
+
|
|
9258
|
+
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
|
|
9259
|
+
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
|
|
9260
|
+
(valIsNull && othIsDefined && othIsReflexive) ||
|
|
9261
|
+
(!valIsDefined && othIsReflexive) ||
|
|
9262
|
+
!valIsReflexive) {
|
|
9263
|
+
return 1;
|
|
9264
|
+
}
|
|
9265
|
+
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
|
|
9266
|
+
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
|
|
9267
|
+
(othIsNull && valIsDefined && valIsReflexive) ||
|
|
9268
|
+
(!othIsDefined && valIsReflexive) ||
|
|
9269
|
+
!othIsReflexive) {
|
|
9270
|
+
return -1;
|
|
9271
|
+
}
|
|
9272
|
+
}
|
|
9273
|
+
return 0;
|
|
9274
|
+
}
|
|
9275
|
+
|
|
9276
|
+
var _compareAscending = compareAscending;
|
|
9277
|
+
|
|
9278
|
+
/**
|
|
9279
|
+
* Used by `_.orderBy` to compare multiple properties of a value to another
|
|
9280
|
+
* and stable sort them.
|
|
9281
|
+
*
|
|
9282
|
+
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
|
|
9283
|
+
* specify an order of "desc" for descending or "asc" for ascending sort order
|
|
9284
|
+
* of corresponding values.
|
|
9285
|
+
*
|
|
9286
|
+
* @private
|
|
9287
|
+
* @param {Object} object The object to compare.
|
|
9288
|
+
* @param {Object} other The other object to compare.
|
|
9289
|
+
* @param {boolean[]|string[]} orders The order to sort by for each property.
|
|
9290
|
+
* @returns {number} Returns the sort order indicator for `object`.
|
|
9291
|
+
*/
|
|
9292
|
+
function compareMultiple(object, other, orders) {
|
|
9293
|
+
var index = -1,
|
|
9294
|
+
objCriteria = object.criteria,
|
|
9295
|
+
othCriteria = other.criteria,
|
|
9296
|
+
length = objCriteria.length,
|
|
9297
|
+
ordersLength = orders.length;
|
|
9298
|
+
|
|
9299
|
+
while (++index < length) {
|
|
9300
|
+
var result = _compareAscending(objCriteria[index], othCriteria[index]);
|
|
9301
|
+
if (result) {
|
|
9302
|
+
if (index >= ordersLength) {
|
|
9303
|
+
return result;
|
|
9304
|
+
}
|
|
9305
|
+
var order = orders[index];
|
|
9306
|
+
return result * (order == 'desc' ? -1 : 1);
|
|
9307
|
+
}
|
|
9308
|
+
}
|
|
9309
|
+
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
|
|
9310
|
+
// that causes it, under certain circumstances, to provide the same value for
|
|
9311
|
+
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
|
|
9312
|
+
// for more details.
|
|
9313
|
+
//
|
|
9314
|
+
// This also ensures a stable sort in V8 and other engines.
|
|
9315
|
+
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
|
|
9316
|
+
return object.index - other.index;
|
|
9317
|
+
}
|
|
9318
|
+
|
|
9319
|
+
var _compareMultiple = compareMultiple;
|
|
9320
|
+
|
|
9321
|
+
/**
|
|
9322
|
+
* The base implementation of `_.orderBy` without param guards.
|
|
9323
|
+
*
|
|
9324
|
+
* @private
|
|
9325
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9326
|
+
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
|
|
9327
|
+
* @param {string[]} orders The sort orders of `iteratees`.
|
|
9328
|
+
* @returns {Array} Returns the new sorted array.
|
|
9329
|
+
*/
|
|
9330
|
+
function baseOrderBy(collection, iteratees, orders) {
|
|
9331
|
+
if (iteratees.length) {
|
|
9332
|
+
iteratees = _arrayMap(iteratees, function(iteratee) {
|
|
9333
|
+
if (isArray_1(iteratee)) {
|
|
9334
|
+
return function(value) {
|
|
9335
|
+
return _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
|
9336
|
+
}
|
|
9337
|
+
}
|
|
9338
|
+
return iteratee;
|
|
9339
|
+
});
|
|
9340
|
+
} else {
|
|
9341
|
+
iteratees = [identity_1];
|
|
9342
|
+
}
|
|
9343
|
+
|
|
9344
|
+
var index = -1;
|
|
9345
|
+
iteratees = _arrayMap(iteratees, _baseUnary(_baseIteratee));
|
|
9346
|
+
|
|
9347
|
+
var result = _baseMap(collection, function(value, key, collection) {
|
|
9348
|
+
var criteria = _arrayMap(iteratees, function(iteratee) {
|
|
9349
|
+
return iteratee(value);
|
|
9350
|
+
});
|
|
9351
|
+
return { 'criteria': criteria, 'index': ++index, 'value': value };
|
|
9352
|
+
});
|
|
9353
|
+
|
|
9354
|
+
return _baseSortBy(result, function(object, other) {
|
|
9355
|
+
return _compareMultiple(object, other, orders);
|
|
9356
|
+
});
|
|
9357
|
+
}
|
|
9358
|
+
|
|
9359
|
+
var _baseOrderBy = baseOrderBy;
|
|
9360
|
+
|
|
9361
|
+
/**
|
|
9362
|
+
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
9363
|
+
* with the `this` binding of `thisArg` and the arguments of `args`.
|
|
9364
|
+
*
|
|
9365
|
+
* @private
|
|
9366
|
+
* @param {Function} func The function to invoke.
|
|
9367
|
+
* @param {*} thisArg The `this` binding of `func`.
|
|
9368
|
+
* @param {Array} args The arguments to invoke `func` with.
|
|
9369
|
+
* @returns {*} Returns the result of `func`.
|
|
9370
|
+
*/
|
|
9371
|
+
function apply(func, thisArg, args) {
|
|
9372
|
+
switch (args.length) {
|
|
9373
|
+
case 0: return func.call(thisArg);
|
|
9374
|
+
case 1: return func.call(thisArg, args[0]);
|
|
9375
|
+
case 2: return func.call(thisArg, args[0], args[1]);
|
|
9376
|
+
case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
9377
|
+
}
|
|
9378
|
+
return func.apply(thisArg, args);
|
|
9379
|
+
}
|
|
9380
|
+
|
|
9381
|
+
var _apply = apply;
|
|
9382
|
+
|
|
9383
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
9384
|
+
var nativeMax = Math.max;
|
|
9385
|
+
|
|
9386
|
+
/**
|
|
9387
|
+
* A specialized version of `baseRest` which transforms the rest array.
|
|
9388
|
+
*
|
|
9389
|
+
* @private
|
|
9390
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
9391
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
9392
|
+
* @param {Function} transform The rest array transform.
|
|
9393
|
+
* @returns {Function} Returns the new function.
|
|
9394
|
+
*/
|
|
9395
|
+
function overRest(func, start, transform) {
|
|
9396
|
+
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
|
9397
|
+
return function() {
|
|
9398
|
+
var args = arguments,
|
|
9399
|
+
index = -1,
|
|
9400
|
+
length = nativeMax(args.length - start, 0),
|
|
9401
|
+
array = Array(length);
|
|
9402
|
+
|
|
9403
|
+
while (++index < length) {
|
|
9404
|
+
array[index] = args[start + index];
|
|
9405
|
+
}
|
|
9406
|
+
index = -1;
|
|
9407
|
+
var otherArgs = Array(start + 1);
|
|
9408
|
+
while (++index < start) {
|
|
9409
|
+
otherArgs[index] = args[index];
|
|
9410
|
+
}
|
|
9411
|
+
otherArgs[start] = transform(array);
|
|
9412
|
+
return _apply(func, this, otherArgs);
|
|
9413
|
+
};
|
|
9414
|
+
}
|
|
9415
|
+
|
|
9416
|
+
var _overRest = overRest;
|
|
9417
|
+
|
|
9418
|
+
/**
|
|
9419
|
+
* Creates a function that returns `value`.
|
|
9420
|
+
*
|
|
9421
|
+
* @static
|
|
9422
|
+
* @memberOf _
|
|
9423
|
+
* @since 2.4.0
|
|
9424
|
+
* @category Util
|
|
9425
|
+
* @param {*} value The value to return from the new function.
|
|
9426
|
+
* @returns {Function} Returns the new constant function.
|
|
9427
|
+
* @example
|
|
9428
|
+
*
|
|
9429
|
+
* var objects = _.times(2, _.constant({ 'a': 1 }));
|
|
9430
|
+
*
|
|
9431
|
+
* console.log(objects);
|
|
9432
|
+
* // => [{ 'a': 1 }, { 'a': 1 }]
|
|
9433
|
+
*
|
|
9434
|
+
* console.log(objects[0] === objects[1]);
|
|
9435
|
+
* // => true
|
|
9436
|
+
*/
|
|
9437
|
+
function constant(value) {
|
|
9438
|
+
return function() {
|
|
9439
|
+
return value;
|
|
9440
|
+
};
|
|
9441
|
+
}
|
|
9442
|
+
|
|
9443
|
+
var constant_1 = constant;
|
|
9444
|
+
|
|
9445
|
+
var defineProperty = (function() {
|
|
9446
|
+
try {
|
|
9447
|
+
var func = _getNative(Object, 'defineProperty');
|
|
9448
|
+
func({}, '', {});
|
|
9449
|
+
return func;
|
|
9450
|
+
} catch (e) {}
|
|
9451
|
+
}());
|
|
9452
|
+
|
|
9453
|
+
var _defineProperty = defineProperty;
|
|
9454
|
+
|
|
9455
|
+
/**
|
|
9456
|
+
* The base implementation of `setToString` without support for hot loop shorting.
|
|
9457
|
+
*
|
|
9458
|
+
* @private
|
|
9459
|
+
* @param {Function} func The function to modify.
|
|
9460
|
+
* @param {Function} string The `toString` result.
|
|
9461
|
+
* @returns {Function} Returns `func`.
|
|
9462
|
+
*/
|
|
9463
|
+
var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
|
|
9464
|
+
return _defineProperty(func, 'toString', {
|
|
9465
|
+
'configurable': true,
|
|
9466
|
+
'enumerable': false,
|
|
9467
|
+
'value': constant_1(string),
|
|
9468
|
+
'writable': true
|
|
9469
|
+
});
|
|
9470
|
+
};
|
|
9471
|
+
|
|
9472
|
+
var _baseSetToString = baseSetToString;
|
|
9473
|
+
|
|
9474
|
+
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
|
9475
|
+
var HOT_COUNT = 800,
|
|
9476
|
+
HOT_SPAN = 16;
|
|
9477
|
+
|
|
9478
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
9479
|
+
var nativeNow = Date.now;
|
|
9480
|
+
|
|
9481
|
+
/**
|
|
9482
|
+
* Creates a function that'll short out and invoke `identity` instead
|
|
9483
|
+
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
|
|
9484
|
+
* milliseconds.
|
|
9485
|
+
*
|
|
9486
|
+
* @private
|
|
9487
|
+
* @param {Function} func The function to restrict.
|
|
9488
|
+
* @returns {Function} Returns the new shortable function.
|
|
9489
|
+
*/
|
|
9490
|
+
function shortOut(func) {
|
|
9491
|
+
var count = 0,
|
|
9492
|
+
lastCalled = 0;
|
|
9493
|
+
|
|
9494
|
+
return function() {
|
|
9495
|
+
var stamp = nativeNow(),
|
|
9496
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
|
9497
|
+
|
|
9498
|
+
lastCalled = stamp;
|
|
9499
|
+
if (remaining > 0) {
|
|
9500
|
+
if (++count >= HOT_COUNT) {
|
|
9501
|
+
return arguments[0];
|
|
9502
|
+
}
|
|
9503
|
+
} else {
|
|
9504
|
+
count = 0;
|
|
9505
|
+
}
|
|
9506
|
+
return func.apply(undefined, arguments);
|
|
9507
|
+
};
|
|
9508
|
+
}
|
|
9509
|
+
|
|
9510
|
+
var _shortOut = shortOut;
|
|
9511
|
+
|
|
9512
|
+
/**
|
|
9513
|
+
* Sets the `toString` method of `func` to return `string`.
|
|
9514
|
+
*
|
|
9515
|
+
* @private
|
|
9516
|
+
* @param {Function} func The function to modify.
|
|
9517
|
+
* @param {Function} string The `toString` result.
|
|
9518
|
+
* @returns {Function} Returns `func`.
|
|
9519
|
+
*/
|
|
9520
|
+
var setToString = _shortOut(_baseSetToString);
|
|
9521
|
+
|
|
9522
|
+
var _setToString = setToString;
|
|
9523
|
+
|
|
9524
|
+
/**
|
|
9525
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
9526
|
+
*
|
|
9527
|
+
* @private
|
|
9528
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
9529
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
9530
|
+
* @returns {Function} Returns the new function.
|
|
9531
|
+
*/
|
|
9532
|
+
function baseRest(func, start) {
|
|
9533
|
+
return _setToString(_overRest(func, start, identity_1), func + '');
|
|
9534
|
+
}
|
|
9535
|
+
|
|
9536
|
+
var _baseRest = baseRest;
|
|
9537
|
+
|
|
9538
|
+
/**
|
|
9539
|
+
* Checks if the given arguments are from an iteratee call.
|
|
9540
|
+
*
|
|
9541
|
+
* @private
|
|
9542
|
+
* @param {*} value The potential iteratee value argument.
|
|
9543
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
9544
|
+
* @param {*} object The potential iteratee object argument.
|
|
9545
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
9546
|
+
* else `false`.
|
|
9547
|
+
*/
|
|
9548
|
+
function isIterateeCall(value, index, object) {
|
|
9549
|
+
if (!isObject_1(object)) {
|
|
9550
|
+
return false;
|
|
9551
|
+
}
|
|
9552
|
+
var type = typeof index;
|
|
9553
|
+
if (type == 'number'
|
|
9554
|
+
? (isArrayLike_1(object) && _isIndex(index, object.length))
|
|
9555
|
+
: (type == 'string' && index in object)
|
|
9556
|
+
) {
|
|
9557
|
+
return eq_1(object[index], value);
|
|
9558
|
+
}
|
|
9559
|
+
return false;
|
|
9560
|
+
}
|
|
9561
|
+
|
|
9562
|
+
var _isIterateeCall = isIterateeCall;
|
|
9563
|
+
|
|
9564
|
+
/**
|
|
9565
|
+
* Creates an array of elements, sorted in ascending order by the results of
|
|
9566
|
+
* running each element in a collection thru each iteratee. This method
|
|
9567
|
+
* performs a stable sort, that is, it preserves the original sort order of
|
|
9568
|
+
* equal elements. The iteratees are invoked with one argument: (value).
|
|
9569
|
+
*
|
|
9570
|
+
* @static
|
|
9571
|
+
* @memberOf _
|
|
9572
|
+
* @since 0.1.0
|
|
9573
|
+
* @category Collection
|
|
9574
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9575
|
+
* @param {...(Function|Function[])} [iteratees=[_.identity]]
|
|
9576
|
+
* The iteratees to sort by.
|
|
9577
|
+
* @returns {Array} Returns the new sorted array.
|
|
9578
|
+
* @example
|
|
9579
|
+
*
|
|
9580
|
+
* var users = [
|
|
9581
|
+
* { 'user': 'fred', 'age': 48 },
|
|
9582
|
+
* { 'user': 'barney', 'age': 36 },
|
|
9583
|
+
* { 'user': 'fred', 'age': 30 },
|
|
9584
|
+
* { 'user': 'barney', 'age': 34 }
|
|
9585
|
+
* ];
|
|
9586
|
+
*
|
|
9587
|
+
* _.sortBy(users, [function(o) { return o.user; }]);
|
|
9588
|
+
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
|
|
9589
|
+
*
|
|
9590
|
+
* _.sortBy(users, ['user', 'age']);
|
|
9591
|
+
* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
|
|
9592
|
+
*/
|
|
9593
|
+
var sortBy = _baseRest(function(collection, iteratees) {
|
|
9594
|
+
if (collection == null) {
|
|
9595
|
+
return [];
|
|
9596
|
+
}
|
|
9597
|
+
var length = iteratees.length;
|
|
9598
|
+
if (length > 1 && _isIterateeCall(collection, iteratees[0], iteratees[1])) {
|
|
9599
|
+
iteratees = [];
|
|
9600
|
+
} else if (length > 2 && _isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
|
|
9601
|
+
iteratees = [iteratees[0]];
|
|
9602
|
+
}
|
|
9603
|
+
return _baseOrderBy(collection, _baseFlatten(iteratees, 1), []);
|
|
9604
|
+
});
|
|
9605
|
+
|
|
9606
|
+
var sortBy_1 = sortBy;
|
|
9607
|
+
|
|
9608
|
+
/**
|
|
9609
|
+
* Configuration for custom action validation rules.
|
|
9610
|
+
* Defines allowed positions, metadata IDs, data model IDs, and fields for each target
|
|
9611
|
+
* type.
|
|
9612
|
+
*
|
|
9613
|
+
*/
|
|
9614
|
+
const customActionValidationConfig = {
|
|
9615
|
+
[CustomActionTarget.LIVEBOARD]: {
|
|
9616
|
+
positions: [exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.MENU],
|
|
9617
|
+
allowedMetadataIds: ['liveboardIds'],
|
|
9618
|
+
allowedDataModelIds: [],
|
|
9619
|
+
allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds'],
|
|
9620
|
+
},
|
|
9621
|
+
[CustomActionTarget.VIZ]: {
|
|
9622
|
+
positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
|
|
9623
|
+
allowedMetadataIds: ['liveboardIds', 'vizIds', 'answerIds'],
|
|
9624
|
+
allowedDataModelIds: ['modelIds', 'modelColumnNames'],
|
|
9625
|
+
allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
|
|
9626
|
+
},
|
|
9627
|
+
[CustomActionTarget.ANSWER]: {
|
|
9628
|
+
positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
|
|
9629
|
+
allowedMetadataIds: ['answerIds'],
|
|
9630
|
+
allowedDataModelIds: ['modelIds', 'modelColumnNames'],
|
|
9631
|
+
allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
|
|
9632
|
+
},
|
|
9633
|
+
[CustomActionTarget.SPOTTER]: {
|
|
9634
|
+
positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.CONTEXTMENU],
|
|
9635
|
+
allowedMetadataIds: [],
|
|
9636
|
+
allowedDataModelIds: ['modelIds'],
|
|
9637
|
+
allowedFields: ['name', 'id', 'position', 'target', 'orgIds', 'groupIds', 'dataModelIds'],
|
|
9638
|
+
},
|
|
9639
|
+
};
|
|
9640
|
+
/**
|
|
9641
|
+
* Validates a single custom action based on its target type
|
|
9642
|
+
* @param action - The custom action to validate
|
|
9643
|
+
* @param primaryActionsPerTarget - Map to track primary actions per target
|
|
9644
|
+
* @returns CustomActionValidation with isValid flag and reason string
|
|
9645
|
+
*
|
|
9646
|
+
* @hidden
|
|
9647
|
+
*/
|
|
9648
|
+
const validateCustomAction = (action, primaryActionsPerTarget) => {
|
|
9649
|
+
const { id: actionId, target: targetType, position, metadataIds, dataModelIds } = action;
|
|
9650
|
+
// Check if target type is supported
|
|
9651
|
+
if (!customActionValidationConfig[targetType]) {
|
|
9652
|
+
const errorMessage = CUSTOM_ACTIONS_ERROR_MESSAGE.UNSUPPORTED_TARGET(actionId, targetType);
|
|
9653
|
+
return { isValid: false, errors: [errorMessage] };
|
|
9654
|
+
}
|
|
9655
|
+
const config = customActionValidationConfig[targetType];
|
|
9656
|
+
const errors = [];
|
|
9657
|
+
// Validate position
|
|
9658
|
+
if (!arrayIncludesString(config.positions, position)) {
|
|
9659
|
+
const supportedPositions = config.positions.join(', ');
|
|
9660
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_POSITION(position, targetType, supportedPositions));
|
|
9661
|
+
}
|
|
9662
|
+
// Validate metadata IDs
|
|
9663
|
+
if (metadataIds) {
|
|
9664
|
+
const invalidMetadataIds = Object.keys(metadataIds).filter((key) => !arrayIncludesString(config.allowedMetadataIds, key));
|
|
9665
|
+
if (invalidMetadataIds.length > 0) {
|
|
9666
|
+
const supportedMetadataIds = config.allowedMetadataIds.length > 0 ? config.allowedMetadataIds.join(', ') : 'none';
|
|
9667
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_METADATA_IDS(targetType, invalidMetadataIds, supportedMetadataIds));
|
|
9668
|
+
}
|
|
8140
9669
|
}
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
}
|
|
8148
|
-
async getAnswer() {
|
|
8149
|
-
if (this.answer) {
|
|
8150
|
-
return this.answer;
|
|
9670
|
+
// Validate data model IDs
|
|
9671
|
+
if (dataModelIds) {
|
|
9672
|
+
const invalidDataModelIds = Object.keys(dataModelIds).filter((key) => !arrayIncludesString(config.allowedDataModelIds, key));
|
|
9673
|
+
if (invalidDataModelIds.length > 0) {
|
|
9674
|
+
const supportedDataModelIds = config.allowedDataModelIds.length > 0 ? config.allowedDataModelIds.join(', ') : 'none';
|
|
9675
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_DATA_MODEL_IDS(targetType, invalidDataModelIds, supportedDataModelIds));
|
|
8151
9676
|
}
|
|
8152
|
-
this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
|
|
8153
|
-
return this.answer;
|
|
8154
|
-
}
|
|
8155
|
-
async getTML() {
|
|
8156
|
-
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8157
|
-
const edoc = object[0].edoc;
|
|
8158
|
-
const YAML = await Promise.resolve().then(function () { return index; });
|
|
8159
|
-
const parsedDoc = YAML.parse(edoc);
|
|
8160
|
-
return {
|
|
8161
|
-
answer: {
|
|
8162
|
-
...parsedDoc.answer,
|
|
8163
|
-
...this.tmlOverride,
|
|
8164
|
-
},
|
|
8165
|
-
};
|
|
8166
9677
|
}
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
});
|
|
8174
|
-
}
|
|
8175
|
-
setTMLOverride(override) {
|
|
8176
|
-
this.tmlOverride = override;
|
|
9678
|
+
// Validate allowed fields
|
|
9679
|
+
const actionKeys = Object.keys(action);
|
|
9680
|
+
const invalidFields = actionKeys.filter((key) => !arrayIncludesString(config.allowedFields, key));
|
|
9681
|
+
if (invalidFields.length > 0) {
|
|
9682
|
+
const supportedFields = config.allowedFields.join(', ');
|
|
9683
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_FIELDS(targetType, invalidFields, supportedFields));
|
|
8177
9684
|
}
|
|
8178
|
-
|
|
9685
|
+
return {
|
|
9686
|
+
isValid: errors.length === 0,
|
|
9687
|
+
errors,
|
|
9688
|
+
};
|
|
9689
|
+
};
|
|
8179
9690
|
/**
|
|
9691
|
+
* Validates basic action structure and required fields
|
|
9692
|
+
* @param action - The action to validate
|
|
9693
|
+
* @returns Object containing validation result and missing fields
|
|
8180
9694
|
*
|
|
8181
|
-
* @
|
|
8182
|
-
* @param colNames
|
|
9695
|
+
* @hidden
|
|
8183
9696
|
*/
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
}));
|
|
8193
|
-
}
|
|
9697
|
+
const validateActionStructure = (action) => {
|
|
9698
|
+
if (!action || typeof action !== 'object') {
|
|
9699
|
+
return { isValid: false, missingFields: [] };
|
|
9700
|
+
}
|
|
9701
|
+
// Check for all missing required fields
|
|
9702
|
+
const missingFields = ['id', 'name', 'target', 'position'].filter(field => !action[field]);
|
|
9703
|
+
return { isValid: missingFields.length === 0, missingFields };
|
|
9704
|
+
};
|
|
8194
9705
|
/**
|
|
9706
|
+
* Checks for duplicate IDs among actions
|
|
9707
|
+
* @param actions - Array of actions to check
|
|
9708
|
+
* @returns Object containing filtered actions and duplicate errors
|
|
8195
9709
|
*
|
|
8196
|
-
* @
|
|
9710
|
+
* @hidden
|
|
8197
9711
|
*/
|
|
8198
|
-
|
|
8199
|
-
const
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
let dataValue;
|
|
8209
|
-
if (dataType === 'DATE') {
|
|
8210
|
-
if (Number.isFinite(colVal.value)) {
|
|
8211
|
-
dataValue = [{
|
|
8212
|
-
epochRange: {
|
|
8213
|
-
startEpoch: colVal.value,
|
|
8214
|
-
},
|
|
8215
|
-
}];
|
|
8216
|
-
// Case for custom calendar.
|
|
8217
|
-
}
|
|
8218
|
-
else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
|
|
8219
|
-
dataValue = [{
|
|
8220
|
-
epochRange: {
|
|
8221
|
-
startEpoch: colVal.value.v.s,
|
|
8222
|
-
endEpoch: colVal.value.v.e,
|
|
8223
|
-
},
|
|
8224
|
-
}];
|
|
8225
|
-
}
|
|
9712
|
+
const filterDuplicateIds = (actions) => {
|
|
9713
|
+
const idMap = actions.reduce((map, action) => {
|
|
9714
|
+
const list = map.get(action.id) || [];
|
|
9715
|
+
list.push(action);
|
|
9716
|
+
map.set(action.id, list);
|
|
9717
|
+
return map;
|
|
9718
|
+
}, new Map());
|
|
9719
|
+
const { actions: actionsWithUniqueIds, errors } = Array.from(idMap.entries()).reduce((acc, [id, actionsWithSameId]) => {
|
|
9720
|
+
if (actionsWithSameId.length === 1) {
|
|
9721
|
+
acc.actions.push(actionsWithSameId[0]);
|
|
8226
9722
|
}
|
|
8227
9723
|
else {
|
|
8228
|
-
|
|
9724
|
+
// Keep the first action and add error for duplicates
|
|
9725
|
+
acc.actions.push(actionsWithSameId[0]);
|
|
9726
|
+
const duplicateNames = actionsWithSameId.slice(1).map(action => action.name);
|
|
9727
|
+
acc.errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.DUPLICATE_IDS(id, duplicateNames, actionsWithSameId[0].name));
|
|
8229
9728
|
}
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
}
|
|
8235
|
-
selectedPoints.forEach((p) => {
|
|
8236
|
-
p.selectedAttributes.forEach(addPointFromColVal);
|
|
8237
|
-
});
|
|
8238
|
-
return underlyingDataPoint;
|
|
8239
|
-
}
|
|
9729
|
+
return acc;
|
|
9730
|
+
}, { actions: [], errors: [] });
|
|
9731
|
+
return { actions: actionsWithUniqueIds, errors };
|
|
9732
|
+
};
|
|
8240
9733
|
/**
|
|
8241
|
-
*
|
|
8242
|
-
* @param
|
|
8243
|
-
* @
|
|
9734
|
+
* Validates and processes custom actions
|
|
9735
|
+
* @param customActions - Array of custom actions to validate
|
|
9736
|
+
* @returns Object containing valid actions and any validation errors
|
|
8244
9737
|
*/
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
9738
|
+
const getCustomActions = (customActions) => {
|
|
9739
|
+
const errors = [];
|
|
9740
|
+
if (!customActions || !Array.isArray(customActions)) {
|
|
9741
|
+
return { actions: [], errors: [] };
|
|
9742
|
+
}
|
|
9743
|
+
// Step 1: Handle invalid actions first (null, undefined, missing required
|
|
9744
|
+
// fields)
|
|
9745
|
+
const validActions = customActions.filter(action => {
|
|
9746
|
+
const validation = validateActionStructure(action);
|
|
9747
|
+
if (!validation.isValid) {
|
|
9748
|
+
if (!action || typeof action !== 'object') {
|
|
9749
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_ACTION_OBJECT);
|
|
9750
|
+
}
|
|
9751
|
+
else {
|
|
9752
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.MISSING_REQUIRED_FIELDS(action.id, validation.missingFields));
|
|
9753
|
+
}
|
|
9754
|
+
return false;
|
|
9755
|
+
}
|
|
9756
|
+
return true;
|
|
9757
|
+
});
|
|
9758
|
+
// Step 2: Check for duplicate IDs among valid actions
|
|
9759
|
+
const { actions: actionsWithUniqueIds, errors: duplicateErrors } = filterDuplicateIds(validActions);
|
|
9760
|
+
// Add duplicate errors to the errors array
|
|
9761
|
+
duplicateErrors.forEach(error => errors.push(error));
|
|
9762
|
+
// Step 3: Validate actions with unique IDs
|
|
9763
|
+
const finalValidActions = [];
|
|
9764
|
+
actionsWithUniqueIds.forEach((action) => {
|
|
9765
|
+
const { isValid, errors: validationErrors } = validateCustomAction(action);
|
|
9766
|
+
validationErrors.forEach(error => errors.push(error));
|
|
9767
|
+
if (isValid) {
|
|
9768
|
+
finalValidActions.push(action);
|
|
9769
|
+
}
|
|
9770
|
+
});
|
|
9771
|
+
const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
|
|
9772
|
+
return {
|
|
9773
|
+
actions: sortedActions,
|
|
9774
|
+
errors: errors,
|
|
9775
|
+
};
|
|
9776
|
+
};
|
|
8255
9777
|
|
|
8256
9778
|
/**
|
|
8257
9779
|
* Copyright (c) 2023
|
|
@@ -15779,6 +17301,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15779
17301
|
handleExitPresentMode();
|
|
15780
17302
|
}
|
|
15781
17303
|
}
|
|
17304
|
+
/**
|
|
17305
|
+
* Clears the cached preauth and session info.
|
|
17306
|
+
*/
|
|
17307
|
+
function processClearInfoCache() {
|
|
17308
|
+
resetCachedPreauthInfo();
|
|
17309
|
+
resetCachedSessionInfo();
|
|
17310
|
+
}
|
|
15782
17311
|
/**
|
|
15783
17312
|
*
|
|
15784
17313
|
* @param e
|
|
@@ -15885,11 +17414,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15885
17414
|
return processAuthLogout(e, containerEl);
|
|
15886
17415
|
case exports.EmbedEvent.ExitPresentMode:
|
|
15887
17416
|
return processExitPresentMode();
|
|
17417
|
+
case exports.EmbedEvent.CLEAR_INFO_CACHE:
|
|
17418
|
+
return processClearInfoCache();
|
|
15888
17419
|
}
|
|
15889
17420
|
return e;
|
|
15890
17421
|
}
|
|
15891
17422
|
|
|
15892
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.
|
|
17423
|
+
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};
|
|
15893
17424
|
|
|
15894
17425
|
/**
|
|
15895
17426
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -16200,10 +17731,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16200
17731
|
};
|
|
16201
17732
|
this.showPreRenderByDefault = false;
|
|
16202
17733
|
/**
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
17734
|
+
* @hidden
|
|
17735
|
+
* Internal state to track if the embed container is loaded.
|
|
17736
|
+
* This is used to trigger events after the embed container is loaded.
|
|
17737
|
+
*/
|
|
16207
17738
|
this.isEmbedContainerLoaded = false;
|
|
16208
17739
|
/**
|
|
16209
17740
|
* @hidden
|
|
@@ -16262,10 +17793,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16262
17793
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
16263
17794
|
...viewConfig,
|
|
16264
17795
|
});
|
|
16265
|
-
const embedConfig = getEmbedConfig();
|
|
16266
|
-
this.embedConfig = embedConfig;
|
|
16267
17796
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16268
17797
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
17798
|
+
const embedConfig = getEmbedConfig();
|
|
17799
|
+
this.embedConfig = embedConfig;
|
|
16269
17800
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
16270
17801
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
16271
17802
|
}
|
|
@@ -16414,6 +17945,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16414
17945
|
async getDefaultAppInitData() {
|
|
16415
17946
|
var _a, _b;
|
|
16416
17947
|
const authToken = await this.getAuthTokenForCookielessInit();
|
|
17948
|
+
const customActionsResult = getCustomActions([
|
|
17949
|
+
...(this.viewConfig.customActions || []),
|
|
17950
|
+
...(this.embedConfig.customActions || [])
|
|
17951
|
+
]);
|
|
17952
|
+
if (customActionsResult.errors.length > 0) {
|
|
17953
|
+
this.handleError({
|
|
17954
|
+
type: 'CUSTOM_ACTION_VALIDATION',
|
|
17955
|
+
message: customActionsResult.errors,
|
|
17956
|
+
});
|
|
17957
|
+
}
|
|
16417
17958
|
return {
|
|
16418
17959
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
16419
17960
|
authToken,
|
|
@@ -16431,6 +17972,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16431
17972
|
: [],
|
|
16432
17973
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
16433
17974
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
17975
|
+
customActions: customActionsResult.actions,
|
|
16434
17976
|
};
|
|
16435
17977
|
}
|
|
16436
17978
|
async getAppInitData() {
|
|
@@ -16450,11 +17992,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16450
17992
|
.join('/');
|
|
16451
17993
|
return `${basePath}#`;
|
|
16452
17994
|
}
|
|
16453
|
-
getUpdateEmbedParamsObject() {
|
|
16454
|
-
let queryParams = this.getEmbedParamsObject();
|
|
16455
|
-
queryParams = { ...this.viewConfig, ...queryParams };
|
|
16456
|
-
return queryParams;
|
|
16457
|
-
}
|
|
16458
17995
|
/**
|
|
16459
17996
|
* Common query params set for all the embed modes.
|
|
16460
17997
|
* @param queryParams
|
|
@@ -16604,13 +18141,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16604
18141
|
return path;
|
|
16605
18142
|
}
|
|
16606
18143
|
getEmbedParams() {
|
|
16607
|
-
const queryParams = this.
|
|
18144
|
+
const queryParams = this.getBaseQueryParams();
|
|
16608
18145
|
return getQueryParamString(queryParams);
|
|
16609
18146
|
}
|
|
16610
|
-
getEmbedParamsObject() {
|
|
16611
|
-
const params = this.getBaseQueryParams();
|
|
16612
|
-
return params;
|
|
16613
|
-
}
|
|
16614
18147
|
getRootIframeSrc() {
|
|
16615
18148
|
const query = this.getEmbedParams();
|
|
16616
18149
|
return this.getEmbedBasePath(query);
|
|
@@ -17081,13 +18614,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17081
18614
|
* Creates the preRender shell
|
|
17082
18615
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
17083
18616
|
*/
|
|
17084
|
-
async preRender(showPreRenderByDefault = false) {
|
|
18617
|
+
async preRender(showPreRenderByDefault = false, replaceExistingPreRender = false) {
|
|
17085
18618
|
if (!this.viewConfig.preRenderId) {
|
|
17086
18619
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
17087
18620
|
return this;
|
|
17088
18621
|
}
|
|
17089
18622
|
this.isPreRendered = true;
|
|
17090
18623
|
this.showPreRenderByDefault = showPreRenderByDefault;
|
|
18624
|
+
const isAlreadyRendered = this.connectPreRendered();
|
|
18625
|
+
if (isAlreadyRendered && !replaceExistingPreRender) {
|
|
18626
|
+
return this;
|
|
18627
|
+
}
|
|
17091
18628
|
return this.handleRenderForPrerender();
|
|
17092
18629
|
}
|
|
17093
18630
|
/**
|
|
@@ -17171,12 +18708,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17171
18708
|
return this.preRender(true);
|
|
17172
18709
|
}
|
|
17173
18710
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17174
|
-
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17175
|
-
this.executeAfterEmbedContainerLoaded(() => {
|
|
17176
|
-
this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
17177
|
-
});
|
|
17178
18711
|
}
|
|
17179
|
-
this.beforePrerenderVisible();
|
|
17180
18712
|
if (this.el) {
|
|
17181
18713
|
this.syncPreRenderStyle();
|
|
17182
18714
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -17193,6 +18725,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17193
18725
|
this.resizeObserver.observe(this.el);
|
|
17194
18726
|
}
|
|
17195
18727
|
}
|
|
18728
|
+
this.beforePrerenderVisible();
|
|
17196
18729
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
17197
18730
|
this.subscribeToEvents();
|
|
17198
18731
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -17381,9 +18914,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17381
18914
|
this.embedComponentType = 'SearchBarEmbed';
|
|
17382
18915
|
this.viewConfig = viewConfig;
|
|
17383
18916
|
}
|
|
17384
|
-
|
|
18917
|
+
/**
|
|
18918
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18919
|
+
* loaded in the iframe
|
|
18920
|
+
* @param dataSources A list of data source GUIDs
|
|
18921
|
+
*/
|
|
18922
|
+
getIFrameSrc() {
|
|
17385
18923
|
var _a;
|
|
17386
18924
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
18925
|
+
const path = 'search-bar-embed';
|
|
17387
18926
|
const queryParams = this.getBaseQueryParams();
|
|
17388
18927
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
17389
18928
|
if (dataSources && dataSources.length) {
|
|
@@ -17405,16 +18944,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17405
18944
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17406
18945
|
}
|
|
17407
18946
|
queryParams[Param.searchEmbed] = true;
|
|
17408
|
-
return queryParams;
|
|
17409
|
-
}
|
|
17410
|
-
/**
|
|
17411
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
17412
|
-
* loaded in the iframe
|
|
17413
|
-
* @param dataSources A list of data source GUIDs
|
|
17414
|
-
*/
|
|
17415
|
-
getIFrameSrc() {
|
|
17416
|
-
const queryParams = this.getEmbedParamsObject();
|
|
17417
|
-
const path = 'search-bar-embed';
|
|
17418
18947
|
let query = '';
|
|
17419
18948
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17420
18949
|
if (queryParamsString) {
|
|
@@ -17465,7 +18994,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17465
18994
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
17466
18995
|
super(domSelector, viewConfig);
|
|
17467
18996
|
}
|
|
17468
|
-
|
|
18997
|
+
/**
|
|
18998
|
+
* Constructs a map of parameters to be passed on to the
|
|
18999
|
+
* embedded Eureka or Sage search page.
|
|
19000
|
+
* @returns {string} query string
|
|
19001
|
+
*/
|
|
19002
|
+
getEmbedParams() {
|
|
17469
19003
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
17470
19004
|
const params = this.getBaseQueryParams();
|
|
17471
19005
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -17480,15 +19014,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17480
19014
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
17481
19015
|
params[Param.IsProductTour] = !!isProductTour;
|
|
17482
19016
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
17483
|
-
return params;
|
|
17484
|
-
}
|
|
17485
|
-
/**
|
|
17486
|
-
* Constructs a map of parameters to be passed on to the
|
|
17487
|
-
* embedded Eureka or Sage search page.
|
|
17488
|
-
* @returns {string} query string
|
|
17489
|
-
*/
|
|
17490
|
-
getEmbedParams() {
|
|
17491
|
-
const params = this.getEmbedParamsObject();
|
|
17492
19017
|
return getQueryParamString(params, true);
|
|
17493
19018
|
}
|
|
17494
19019
|
/**
|
|
@@ -17598,9 +19123,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17598
19123
|
const defaultAppInitData = await super.getAppInitData();
|
|
17599
19124
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
17600
19125
|
}
|
|
17601
|
-
|
|
19126
|
+
getEmbedParams() {
|
|
17602
19127
|
var _a;
|
|
17603
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 =
|
|
19128
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
19129
|
+
/* eslint-disable-next-line max-len */
|
|
19130
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
17604
19131
|
const queryParams = this.getBaseQueryParams();
|
|
17605
19132
|
queryParams[Param.HideActions] = [
|
|
17606
19133
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -17633,6 +19160,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17633
19160
|
queryParams[Param.HideSearchBar] = true;
|
|
17634
19161
|
}
|
|
17635
19162
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19163
|
+
/* eslint-disable-next-line max-len */
|
|
17636
19164
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17637
19165
|
}
|
|
17638
19166
|
if (!focusSearchBarOnRender) {
|
|
@@ -17645,22 +19173,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17645
19173
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17646
19174
|
}
|
|
17647
19175
|
queryParams[Param.searchEmbed] = true;
|
|
19176
|
+
/* eslint-disable-next-line max-len */
|
|
17648
19177
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
17649
19178
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17650
19179
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
17651
19180
|
=== DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
|
|
17652
19181
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17653
19182
|
=== DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
|
|
19183
|
+
/* eslint-disable-next-line max-len */
|
|
17654
19184
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17655
19185
|
}
|
|
17656
19186
|
else {
|
|
19187
|
+
/* eslint-disable-next-line max-len */
|
|
17657
19188
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
17658
19189
|
}
|
|
17659
|
-
return queryParams;
|
|
17660
|
-
}
|
|
17661
|
-
getEmbedParams() {
|
|
17662
|
-
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
17663
|
-
const queryParams = this.getEmbedParamsObject();
|
|
17664
19190
|
let query = '';
|
|
17665
19191
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17666
19192
|
if (queryParamsString) {
|
|
@@ -17801,6 +19327,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17801
19327
|
* It serves as the foundational version of the home page.
|
|
17802
19328
|
*/
|
|
17803
19329
|
HomePage["Modular"] = "v2";
|
|
19330
|
+
/**
|
|
19331
|
+
* ModularWithStylingChanges (v3) introduces Modular Home Experience
|
|
19332
|
+
* with styling changes.
|
|
19333
|
+
*/
|
|
19334
|
+
HomePage["ModularWithStylingChanges"] = "v3";
|
|
17804
19335
|
})(HomePage || (HomePage = {}));
|
|
17805
19336
|
/**
|
|
17806
19337
|
* Define the version of the list page
|
|
@@ -17888,7 +19419,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17888
19419
|
* embedded Liveboard or visualization.
|
|
17889
19420
|
*/
|
|
17890
19421
|
getEmbedParams() {
|
|
17891
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 =
|
|
19422
|
+
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 = 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;
|
|
17892
19423
|
let params = {};
|
|
17893
19424
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17894
19425
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17905,6 +19436,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17905
19436
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17906
19437
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17907
19438
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
19439
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
17908
19440
|
params = this.getBaseQueryParams(params);
|
|
17909
19441
|
if (hideObjectSearch) {
|
|
17910
19442
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
@@ -17952,6 +19484,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17952
19484
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
17953
19485
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
17954
19486
|
}
|
|
19487
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19488
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19489
|
+
}
|
|
17955
19490
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17956
19491
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
17957
19492
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -17972,6 +19507,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17972
19507
|
// To use v3 navigation, we must manually set the discoveryExperience
|
|
17973
19508
|
// settings.
|
|
17974
19509
|
params[Param.NavigationVersion] = 'v2';
|
|
19510
|
+
// Set homePageVersion to v2 by default to reset the LD flag value
|
|
19511
|
+
// for the homepageVersion.
|
|
19512
|
+
params[Param.HomepageVersion] = 'v2';
|
|
19513
|
+
// Set listpageVersion to v2 by default to reset the LD flag value
|
|
19514
|
+
// for the listpageVersion.
|
|
19515
|
+
params[Param.ListPageVersion] = ListPage.List;
|
|
17975
19516
|
if (discoveryExperience) {
|
|
17976
19517
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17977
19518
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
@@ -17984,6 +19525,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17984
19525
|
if (discoveryExperience.homePage === HomePage.Modular) {
|
|
17985
19526
|
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17986
19527
|
}
|
|
19528
|
+
// ModularWithStylingChanges (v3) introduces the styling changes
|
|
19529
|
+
// to the Modular Homepage.
|
|
19530
|
+
// v3 will be the base version of homePageVersion.
|
|
19531
|
+
if (discoveryExperience.homePage === HomePage.ModularWithStylingChanges) {
|
|
19532
|
+
params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
|
|
19533
|
+
}
|
|
17987
19534
|
// listPageVersion v3 will enable the new list page
|
|
17988
19535
|
if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
|
|
17989
19536
|
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
@@ -18287,14 +19834,9 @@ query GetEurekaVizSnapshots(
|
|
|
18287
19834
|
* embedded Liveboard or visualization.
|
|
18288
19835
|
*/
|
|
18289
19836
|
getEmbedParams() {
|
|
18290
|
-
const params = this.getEmbedParamsObject();
|
|
18291
|
-
const queryParams = getQueryParamString(params, true);
|
|
18292
|
-
return queryParams;
|
|
18293
|
-
}
|
|
18294
|
-
getEmbedParamsObject() {
|
|
18295
19837
|
let params = {};
|
|
18296
19838
|
params = this.getBaseQueryParams(params);
|
|
18297
|
-
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 =
|
|
19839
|
+
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;
|
|
18298
19840
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
18299
19841
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
18300
19842
|
if (fullHeight === true) {
|
|
@@ -18353,25 +19895,11 @@ query GetEurekaVizSnapshots(
|
|
|
18353
19895
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
18354
19896
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
18355
19897
|
}
|
|
18356
|
-
|
|
18357
|
-
|
|
18358
|
-
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
18359
|
-
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
18360
|
-
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
18361
|
-
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
18362
|
-
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18363
|
-
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
18364
|
-
if (oAuthPollingInterval !== undefined) {
|
|
18365
|
-
params[Param.OauthPollingInterval] = oAuthPollingInterval;
|
|
18366
|
-
}
|
|
18367
|
-
if (isForceRedirect) {
|
|
18368
|
-
params[Param.IsForceRedirect] = isForceRedirect;
|
|
18369
|
-
}
|
|
18370
|
-
if (dataSourceId !== undefined) {
|
|
18371
|
-
params[Param.DataSourceId] = dataSourceId;
|
|
19898
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19899
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
18372
19900
|
}
|
|
18373
|
-
if (
|
|
18374
|
-
params[Param.
|
|
19901
|
+
if (showSpotterLimitations !== undefined) {
|
|
19902
|
+
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
18375
19903
|
}
|
|
18376
19904
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
18377
19905
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
@@ -18381,7 +19909,9 @@ query GetEurekaVizSnapshots(
|
|
|
18381
19909
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
18382
19910
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18383
19911
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
18384
|
-
|
|
19912
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19913
|
+
const queryParams = getQueryParamString(params, true);
|
|
19914
|
+
return queryParams;
|
|
18385
19915
|
}
|
|
18386
19916
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
18387
19917
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -18939,17 +20469,13 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18939
20469
|
super(container, viewConfig);
|
|
18940
20470
|
this.viewConfig = viewConfig;
|
|
18941
20471
|
}
|
|
18942
|
-
|
|
20472
|
+
getIframeSrc() {
|
|
18943
20473
|
var _a;
|
|
20474
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20475
|
+
const path = 'conv-assist-answer';
|
|
18944
20476
|
const queryParams = this.getBaseQueryParams();
|
|
18945
20477
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18946
20478
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18947
|
-
return queryParams;
|
|
18948
|
-
}
|
|
18949
|
-
getIframeSrc() {
|
|
18950
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18951
|
-
const path = 'conv-assist-answer';
|
|
18952
|
-
const queryParams = this.getEmbedParamsObject();
|
|
18953
20479
|
let query = '';
|
|
18954
20480
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18955
20481
|
if (queryParamsString) {
|
|
@@ -19105,8 +20631,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
19105
20631
|
super(container, viewConfig);
|
|
19106
20632
|
this.viewConfig = viewConfig;
|
|
19107
20633
|
}
|
|
19108
|
-
|
|
20634
|
+
getIframeSrc() {
|
|
19109
20635
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20636
|
+
const path = 'insights/conv-assist';
|
|
19110
20637
|
if (!worksheetId) {
|
|
19111
20638
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
19112
20639
|
}
|
|
@@ -19127,12 +20654,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
19127
20654
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
19128
20655
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
19129
20656
|
}
|
|
19130
|
-
return queryParams;
|
|
19131
|
-
}
|
|
19132
|
-
getIframeSrc() {
|
|
19133
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
19134
|
-
const path = 'insights/conv-assist';
|
|
19135
|
-
const queryParams = this.getEmbedParamsObject();
|
|
19136
20657
|
let query = '';
|
|
19137
20658
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19138
20659
|
if (queryParamsString) {
|
|
@@ -19241,7 +20762,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
19241
20762
|
handleDestroy(tsEmbed);
|
|
19242
20763
|
};
|
|
19243
20764
|
}, [viewConfig, listeners]);
|
|
19244
|
-
|
|
20765
|
+
const preRenderStyles = isPreRenderedComponent ? { display: 'none' } : {};
|
|
20766
|
+
return viewConfig.insertAsSibling ? (React.createElement("span", { "data-testid": "tsEmbed", ref: ref, style: { position: 'absolute', ...preRenderStyles } })) : (React.createElement("div", { "data-testid": "tsEmbed", ref: ref, style: { ...style, ...preRenderStyles }, className: `ts-embed-container ${className}` }));
|
|
19245
20767
|
});
|
|
19246
20768
|
/**
|
|
19247
20769
|
* React component for Search Embed.
|