@thoughtspot/visual-embed-sdk 1.32.7 → 1.32.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/cjs/package.json +3 -3
  2. package/cjs/src/css-variables.d.ts +18 -3
  3. package/cjs/src/css-variables.d.ts.map +1 -1
  4. package/cjs/src/embed/base.d.ts +34 -32
  5. package/cjs/src/embed/base.d.ts.map +1 -1
  6. package/cjs/src/embed/base.js +40 -37
  7. package/cjs/src/embed/base.js.map +1 -1
  8. package/cjs/src/tokenizedFetch.d.ts.map +1 -1
  9. package/cjs/src/tokenizedFetch.js +5 -1
  10. package/cjs/src/tokenizedFetch.js.map +1 -1
  11. package/cjs/src/types.d.ts +80 -8
  12. package/cjs/src/types.d.ts.map +1 -1
  13. package/cjs/src/types.js +76 -6
  14. package/cjs/src/types.js.map +1 -1
  15. package/cjs/src/utils/authService/authService.spec.js +3 -1
  16. package/cjs/src/utils/authService/authService.spec.js.map +1 -1
  17. package/cjs/src/utils.d.ts.map +1 -1
  18. package/cjs/src/utils.js +3 -1
  19. package/cjs/src/utils.js.map +1 -1
  20. package/dist/src/css-variables.d.ts +18 -3
  21. package/dist/src/css-variables.d.ts.map +1 -1
  22. package/dist/src/embed/base.d.ts +34 -32
  23. package/dist/src/embed/base.d.ts.map +1 -1
  24. package/dist/src/tokenizedFetch.d.ts.map +1 -1
  25. package/dist/src/types.d.ts +80 -8
  26. package/dist/src/types.d.ts.map +1 -1
  27. package/dist/src/utils.d.ts.map +1 -1
  28. package/dist/tsembed-react.es.js +314 -82
  29. package/dist/tsembed-react.js +257 -81
  30. package/dist/tsembed.es.js +354 -119
  31. package/dist/tsembed.js +297 -118
  32. package/dist/visual-embed-sdk-react-full.d.ts +132 -43
  33. package/dist/visual-embed-sdk-react.d.ts +132 -43
  34. package/dist/visual-embed-sdk.d.ts +132 -43
  35. package/lib/package.json +3 -3
  36. package/lib/src/css-variables.d.ts +18 -3
  37. package/lib/src/css-variables.d.ts.map +1 -1
  38. package/lib/src/embed/base.d.ts +34 -32
  39. package/lib/src/embed/base.d.ts.map +1 -1
  40. package/lib/src/embed/base.js +40 -37
  41. package/lib/src/embed/base.js.map +1 -1
  42. package/lib/src/tokenizedFetch.d.ts.map +1 -1
  43. package/lib/src/tokenizedFetch.js +5 -1
  44. package/lib/src/tokenizedFetch.js.map +1 -1
  45. package/lib/src/types.d.ts +80 -8
  46. package/lib/src/types.d.ts.map +1 -1
  47. package/lib/src/types.js +76 -6
  48. package/lib/src/types.js.map +1 -1
  49. package/lib/src/utils/authService/authService.spec.js +3 -1
  50. package/lib/src/utils/authService/authService.spec.js.map +1 -1
  51. package/lib/src/utils.d.ts.map +1 -1
  52. package/lib/src/utils.js +3 -1
  53. package/lib/src/utils.js.map +1 -1
  54. package/lib/src/visual-embed-sdk.d.ts +132 -43
  55. package/package.json +3 -3
  56. package/src/css-variables.ts +21 -3
  57. package/src/embed/base.ts +35 -32
  58. package/src/tokenizedFetch.ts +5 -1
  59. package/src/types.ts +80 -8
  60. package/src/utils/authService/authService.spec.ts +3 -1
  61. package/src/utils.ts +3 -0
@@ -199,7 +199,7 @@ const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) => {
199
199
  return false;
200
200
  };
201
201
  const getCustomisations = (embedConfig, viewConfig) => {
202
- var _a, _b;
202
+ var _a, _b, _c, _d;
203
203
  const customizationsFromViewConfig = viewConfig.customizations;
204
204
  const customizationsFromEmbedConfig = embedConfig.customizations
205
205
  || embedConfig.customisations;
@@ -211,6 +211,8 @@ const getCustomisations = (embedConfig, viewConfig) => {
211
211
  ...(_a = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _a === void 0 ? void 0 : _a.customCSS,
212
212
  ...(_b = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _b === void 0 ? void 0 : _b.customCSS,
213
213
  },
214
+ customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl)
215
+ || ((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl),
214
216
  },
215
217
  content: {
216
218
  ...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
@@ -630,6 +632,28 @@ var HomepageModule;
630
632
  * console.log('Drilldown event', drilldown);
631
633
  * }));
632
634
  * ```
635
+ *
636
+ * If you are using React components for embedding, you can register to any
637
+ * events from the `EmbedEvent` list by using the `on<EventName>` convention.
638
+ * For example,`onAlert`, `onCopyToClipboard` and so on.
639
+ *
640
+ * @example
641
+ * ```js
642
+ * // ...
643
+ * const MyComponent = ({ dataSources }) => {
644
+ * const onLoad = () => {
645
+ * console.log(EmbedEvent.Load, {});
646
+ * };
647
+ *
648
+ * return (
649
+ * <SearchEmbed
650
+ * dataSources={dataSources}
651
+ * onLoad = {logEvent("Load")}
652
+ * />
653
+ * );
654
+ * };
655
+ * ```
656
+ *
633
657
  * @group Events
634
658
  */
635
659
  // eslint-disable-next-line no-shadow
@@ -1506,8 +1530,8 @@ var EmbedEvent;
1506
1530
  * Prerequisite: Set isOnBeforeGetVizDataInterceptEnabled : true
1507
1531
  * for this embed event to get emitted.
1508
1532
  *
1509
- * Parameter: payload
1510
- * Parameter: responder
1533
+ * @param: payload
1534
+ * @param: responder
1511
1535
  * Contains elements that lets developers define whether ThoughtSpot
1512
1536
  * will run the search or not, and if not, which error message to provide.
1513
1537
  *
@@ -1519,6 +1543,7 @@ var EmbedEvent;
1519
1543
  *
1520
1544
  * @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
1521
1545
  *
1546
+ * @example
1522
1547
  *```js
1523
1548
  * .on(EmbedEvent.OnBeforeGetVizDataIntercept,
1524
1549
  * (payload, responder) => {
@@ -1554,7 +1579,6 @@ var EmbedEvent;
1554
1579
  * }})
1555
1580
  * })
1556
1581
  *```
1557
- *
1558
1582
  */
1559
1583
  EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
1560
1584
  /**
@@ -1572,7 +1596,7 @@ var EmbedEvent;
1572
1596
  })(EmbedEvent || (EmbedEvent = {}));
1573
1597
  /**
1574
1598
  * Event types that can be triggered by the host application
1575
- * to the embedded ThoughtSpot app
1599
+ * to the embedded ThoughtSpot app.
1576
1600
  *
1577
1601
  * To trigger an event use the corresponding
1578
1602
  * {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link
@@ -1589,6 +1613,40 @@ var EmbedEvent;
1589
1613
  * { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
1590
1614
  * ]);
1591
1615
  * ```
1616
+ * @example
1617
+ * If using React components to embed, use the format shown in this example:
1618
+ *
1619
+ * ```js
1620
+ * const selectVizs = () => {
1621
+ * embedRef.current.trigger(HostEvent.SetVisibleVizs, [
1622
+ * "715e4613-c891-4884-be44-aa8d13701c06",
1623
+ * "3f84d633-e325-44b2-be25-c6650e5a49cf"
1624
+ * ]);
1625
+ * };
1626
+ * ```
1627
+ *
1628
+ *
1629
+ * You can also attach an Embed event to a Host event to trigger
1630
+ * a specific action as shown in this example:
1631
+ *
1632
+ * @example
1633
+ * ```js
1634
+ * const EmbeddedComponent = () => {
1635
+ * const embedRef = useRef(null); // import { useRef } from react
1636
+ * const onLiveboardRendered = () => {
1637
+ * embedRef.current.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
1638
+ * };
1639
+ *
1640
+ * return (
1641
+ * <LiveboardEmbed
1642
+ * ref={embedRef}
1643
+ * liveboardId="<liveboard-guid>"
1644
+ * onLiveboardRendered={onLiveboardRendered}
1645
+ * />
1646
+ * );
1647
+ * }
1648
+ * ```
1649
+ *
1592
1650
  * @group Events
1593
1651
  */
1594
1652
  // eslint-disable-next-line no-shadow
@@ -2284,10 +2342,23 @@ var HostEvent;
2284
2342
  * filter: {
2285
2343
  * column: "item type",
2286
2344
  * oper: "IN",
2287
- * values: ["bags","shirts"],
2345
+ * values: ["bags","shirts"]
2346
+ * }
2347
+ * });
2348
+ * ```
2349
+ * @example
2350
+ * ```js
2351
+ *
2352
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2353
+ * filter: {
2354
+ * column: "date",
2355
+ * oper: "EQ",
2356
+ * values: ["JULY","2023"],
2357
+ * type: "MONTH_YEAR"
2288
2358
  * }
2289
2359
  * });
2290
2360
  * ```
2361
+ *
2291
2362
  * @example
2292
2363
  *
2293
2364
  * ```js
@@ -2305,7 +2376,8 @@ var HostEvent;
2305
2376
  * {
2306
2377
  * column: "Date",
2307
2378
  * oper: 'EQ',
2308
- * values: ["1656680400"]
2379
+ * values: ["2023-07-31"],
2380
+ * types: "EXACT_DATE"
2309
2381
  * }]
2310
2382
  * });
2311
2383
  * ```
@@ -6209,7 +6281,11 @@ const setEmbedConfig = (newConfig) => {
6209
6281
  const tokenizedFetch = async (input, init) => {
6210
6282
  const embedConfig = getEmbedConfig();
6211
6283
  if (embedConfig.authType !== AuthType.TrustedAuthTokenCookieless) {
6212
- return fetch(input, init);
6284
+ return fetch(input, {
6285
+ // ensure cookies are included for the non cookie-less api calls.
6286
+ credentials: 'include',
6287
+ ...init,
6288
+ });
6213
6289
  }
6214
6290
  const req = new Request(input, init);
6215
6291
  const authToken = await getAuthenticationToken(embedConfig);
@@ -6876,7 +6952,7 @@ const DEFAULT_EMBED_HEIGHT = '100%';
6876
6952
 
6877
6953
  var Config = {
6878
6954
  DEBUG: false,
6879
- LIB_VERSION: '2.45.0'
6955
+ LIB_VERSION: '2.47.0'
6880
6956
  };
6881
6957
 
6882
6958
  // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file
@@ -7706,20 +7782,24 @@ _.utf8Encode = function(string) {
7706
7782
 
7707
7783
  _.UUID = (function() {
7708
7784
 
7709
- // Time/ticks information
7710
- // 1*new Date() is a cross browser version of Date.now()
7785
+ // Time-based entropy
7711
7786
  var T = function() {
7712
- var d = 1 * new Date(),
7713
- i = 0;
7714
-
7715
- // this while loop figures how many browser ticks go by
7716
- // before 1*new Date() returns a new number, ie the amount
7717
- // of ticks that go by per millisecond
7718
- while (d == 1 * new Date()) {
7719
- i++;
7787
+ var time = 1 * new Date(); // cross-browser version of Date.now()
7788
+ var ticks;
7789
+ if (window$1.performance && window$1.performance.now) {
7790
+ ticks = window$1.performance.now();
7791
+ } else {
7792
+ // fall back to busy loop
7793
+ ticks = 0;
7794
+
7795
+ // this while loop figures how many browser ticks go by
7796
+ // before 1*new Date() returns a new number, ie the amount
7797
+ // of ticks that go by per millisecond
7798
+ while (time == 1 * new Date()) {
7799
+ ticks++;
7800
+ }
7720
7801
  }
7721
-
7722
- return d.toString(16) + i.toString(16);
7802
+ return time.toString(16) + Math.floor(ticks).toString(16);
7723
7803
  };
7724
7804
 
7725
7805
  // Math.Random entropy
@@ -8286,21 +8366,42 @@ _.dom_query = (function() {
8286
8366
  };
8287
8367
  })();
8288
8368
 
8369
+ var CAMPAIGN_KEYWORDS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'];
8370
+ var CLICK_IDS = ['dclid', 'fbclid', 'gclid', 'ko_click_id', 'li_fat_id', 'msclkid', 'ttclid', 'twclid', 'wbraid'];
8371
+
8289
8372
  _.info = {
8290
- campaignParams: function() {
8291
- var campaign_keywords = 'utm_source utm_medium utm_campaign utm_content utm_term'.split(' '),
8292
- kw = '',
8373
+ campaignParams: function(default_value) {
8374
+ var kw = '',
8293
8375
  params = {};
8294
- _.each(campaign_keywords, function(kwkey) {
8376
+ _.each(CAMPAIGN_KEYWORDS, function(kwkey) {
8295
8377
  kw = _.getQueryParam(document$1.URL, kwkey);
8296
8378
  if (kw.length) {
8297
8379
  params[kwkey] = kw;
8380
+ } else if (default_value !== undefined) {
8381
+ params[kwkey] = default_value;
8382
+ }
8383
+ });
8384
+
8385
+ return params;
8386
+ },
8387
+
8388
+ clickParams: function() {
8389
+ var id = '',
8390
+ params = {};
8391
+ _.each(CLICK_IDS, function(idkey) {
8392
+ id = _.getQueryParam(document$1.URL, idkey);
8393
+ if (id.length) {
8394
+ params[idkey] = id;
8298
8395
  }
8299
8396
  });
8300
8397
 
8301
8398
  return params;
8302
8399
  },
8303
8400
 
8401
+ marketingParams: function() {
8402
+ return _.extend(_.info.campaignParams(), _.info.clickParams());
8403
+ },
8404
+
8304
8405
  searchEngine: function(referrer) {
8305
8406
  if (referrer.search('https?://(.*)google.([^/?]*)') === 0) {
8306
8407
  return 'google';
@@ -8497,12 +8598,13 @@ _.info = {
8497
8598
  });
8498
8599
  },
8499
8600
 
8500
- pageviewInfo: function(page) {
8601
+ mpPageViewProperties: function() {
8501
8602
  return _.strip_empty_properties({
8502
- 'mp_page': page,
8503
- 'mp_referrer': document$1.referrer,
8504
- 'mp_browser': _.info.browser(userAgent, navigator.vendor, windowOpera),
8505
- 'mp_platform': _.info.os()
8603
+ 'current_page_title': document$1.title,
8604
+ 'current_domain': window$1.location.hostname,
8605
+ 'current_url_path': window$1.location.pathname,
8606
+ 'current_url_protocol': window$1.location.protocol,
8607
+ 'current_url_search': window$1.location.search
8506
8608
  });
8507
8609
  }
8508
8610
  };
@@ -9169,6 +9271,9 @@ var RequestBatcher = function(storageKey, options) {
9169
9271
 
9170
9272
  this.stopped = !this.libConfig['batch_autostart'];
9171
9273
  this.consecutiveRemovalFailures = 0;
9274
+
9275
+ // extra client-side dedupe
9276
+ this.itemIdsSentSuccessfully = {};
9172
9277
  };
9173
9278
 
9174
9279
  /**
@@ -9261,7 +9366,34 @@ RequestBatcher.prototype.flush = function(options) {
9261
9366
  payload = this.beforeSendHook(payload);
9262
9367
  }
9263
9368
  if (payload) {
9264
- dataForRequest.push(payload);
9369
+ // mp_sent_by_lib_version prop captures which lib version actually
9370
+ // sends each event (regardless of which version originally queued
9371
+ // it for sending)
9372
+ if (payload['event'] && payload['properties']) {
9373
+ payload['properties'] = _.extend(
9374
+ {},
9375
+ payload['properties'],
9376
+ {'mp_sent_by_lib_version': Config.LIB_VERSION}
9377
+ );
9378
+ }
9379
+ var addPayload = true;
9380
+ var itemId = item['id'];
9381
+ if (itemId) {
9382
+ if ((this.itemIdsSentSuccessfully[itemId] || 0) > 5) {
9383
+ this.reportError('[dupe] item ID sent too many times, not sending', {
9384
+ item: item,
9385
+ batchSize: batch.length,
9386
+ timesSent: this.itemIdsSentSuccessfully[itemId]
9387
+ });
9388
+ addPayload = false;
9389
+ }
9390
+ } else {
9391
+ this.reportError('[dupe] found item with no ID', {item: item});
9392
+ }
9393
+
9394
+ if (addPayload) {
9395
+ dataForRequest.push(payload);
9396
+ }
9265
9397
  }
9266
9398
  transformedItems[item['id']] = payload;
9267
9399
  }, this);
@@ -9344,6 +9476,24 @@ RequestBatcher.prototype.flush = function(options) {
9344
9476
  }
9345
9477
  }, this)
9346
9478
  );
9479
+
9480
+ // client-side dedupe
9481
+ _.each(batch, _.bind(function(item) {
9482
+ var itemId = item['id'];
9483
+ if (itemId) {
9484
+ this.itemIdsSentSuccessfully[itemId] = this.itemIdsSentSuccessfully[itemId] || 0;
9485
+ this.itemIdsSentSuccessfully[itemId]++;
9486
+ if (this.itemIdsSentSuccessfully[itemId] > 5) {
9487
+ this.reportError('[dupe] item ID sent too many times', {
9488
+ item: item,
9489
+ batchSize: batch.length,
9490
+ timesSent: this.itemIdsSentSuccessfully[itemId]
9491
+ });
9492
+ }
9493
+ } else {
9494
+ this.reportError('[dupe] found item with no ID while removing', {item: item});
9495
+ }
9496
+ }, this));
9347
9497
  }
9348
9498
 
9349
9499
  } catch(err) {
@@ -10189,24 +10339,25 @@ MixpanelPeople.prototype.union = addOptOutCheckMixpanelPeople(function(list_name
10189
10339
  });
10190
10340
 
10191
10341
  /*
10192
- * Record that you have charged the current user a certain amount
10193
- * of money. Charges recorded with track_charge() will appear in the
10194
- * Mixpanel revenue report.
10195
- *
10196
- * ### Usage:
10197
- *
10198
- * // charge a user $50
10199
- * mixpanel.people.track_charge(50);
10200
- *
10201
- * // charge a user $30.50 on the 2nd of january
10202
- * mixpanel.people.track_charge(30.50, {
10203
- * '$time': new Date('jan 1 2012')
10204
- * });
10205
- *
10206
- * @param {Number} amount The amount of money charged to the current user
10207
- * @param {Object} [properties] An associative array of properties associated with the charge
10208
- * @param {Function} [callback] If provided, the callback will be called when the server responds
10209
- */
10342
+ * Record that you have charged the current user a certain amount
10343
+ * of money. Charges recorded with track_charge() will appear in the
10344
+ * Mixpanel revenue report.
10345
+ *
10346
+ * ### Usage:
10347
+ *
10348
+ * // charge a user $50
10349
+ * mixpanel.people.track_charge(50);
10350
+ *
10351
+ * // charge a user $30.50 on the 2nd of january
10352
+ * mixpanel.people.track_charge(30.50, {
10353
+ * '$time': new Date('jan 1 2012')
10354
+ * });
10355
+ *
10356
+ * @param {Number} amount The amount of money charged to the current user
10357
+ * @param {Object} [properties] An associative array of properties associated with the charge
10358
+ * @param {Function} [callback] If provided, the callback will be called when the server responds
10359
+ * @deprecated
10360
+ */
10210
10361
  MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(amount, properties, callback) {
10211
10362
  if (!_.isNumber(amount)) {
10212
10363
  amount = parseFloat(amount);
@@ -10222,15 +10373,16 @@ MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(am
10222
10373
  });
10223
10374
 
10224
10375
  /*
10225
- * Permanently clear all revenue report transactions from the
10226
- * current user's people analytics profile.
10227
- *
10228
- * ### Usage:
10229
- *
10230
- * mixpanel.people.clear_charges();
10231
- *
10232
- * @param {Function} [callback] If provided, the callback will be called after tracking the event.
10233
- */
10376
+ * Permanently clear all revenue report transactions from the
10377
+ * current user's people analytics profile.
10378
+ *
10379
+ * ### Usage:
10380
+ *
10381
+ * mixpanel.people.clear_charges();
10382
+ *
10383
+ * @param {Function} [callback] If provided, the callback will be called after tracking the event.
10384
+ * @deprecated
10385
+ */
10234
10386
  MixpanelPeople.prototype.clear_charges = function(callback) {
10235
10387
  return this.set('$transactions', [], callback);
10236
10388
  };
@@ -10630,13 +10782,6 @@ MixpanelPersistence.prototype.unregister = function(prop) {
10630
10782
  }
10631
10783
  };
10632
10784
 
10633
- MixpanelPersistence.prototype.update_campaign_params = function() {
10634
- if (!this.campaign_params_saved) {
10635
- this.register_once(_.info.campaignParams());
10636
- this.campaign_params_saved = true;
10637
- }
10638
- };
10639
-
10640
10785
  MixpanelPersistence.prototype.update_search_keyword = function(referrer) {
10641
10786
  this.register(_.info.searchInfo(referrer));
10642
10787
  };
@@ -10919,6 +11064,7 @@ var NOOP_FUNC = function() {};
10919
11064
  /** @const */ var PRIMARY_INSTANCE_NAME = 'mixpanel';
10920
11065
  /** @const */ var PAYLOAD_TYPE_BASE64 = 'base64';
10921
11066
  /** @const */ var PAYLOAD_TYPE_JSON = 'json';
11067
+ /** @const */ var DEVICE_ID_PREFIX = '$device:';
10922
11068
 
10923
11069
 
10924
11070
  /*
@@ -10960,6 +11106,9 @@ var DEFAULT_CONFIG = {
10960
11106
  'cookie_domain': '',
10961
11107
  'cookie_name': '',
10962
11108
  'loaded': NOOP_FUNC,
11109
+ 'track_marketing': true,
11110
+ 'track_pageview': false,
11111
+ 'skip_first_touch_marketing': false,
10963
11112
  'store_google': true,
10964
11113
  'save_referrer': true,
10965
11114
  'test': false,
@@ -11026,6 +11175,25 @@ var create_mplib = function(token, config, name) {
11026
11175
  instance['people'] = new MixpanelPeople();
11027
11176
  instance['people']._init(instance);
11028
11177
 
11178
+ if (!instance.get_config('skip_first_touch_marketing')) {
11179
+ // We need null UTM params in the object because
11180
+ // UTM parameters act as a tuple. If any UTM param
11181
+ // is present, then we set all UTM params including
11182
+ // empty ones together
11183
+ var utm_params = _.info.campaignParams(null);
11184
+ var initial_utm_params = {};
11185
+ var has_utm = false;
11186
+ _.each(utm_params, function(utm_value, utm_key) {
11187
+ initial_utm_params['initial_' + utm_key] = utm_value;
11188
+ if (utm_value) {
11189
+ has_utm = true;
11190
+ }
11191
+ });
11192
+ if (has_utm) {
11193
+ instance['people'].set_once(initial_utm_params);
11194
+ }
11195
+ }
11196
+
11029
11197
  // if any instance on the page has debug = true, we set the
11030
11198
  // global debug to be true
11031
11199
  Config.DEBUG = Config.DEBUG || instance.get_config('debug');
@@ -11057,7 +11225,7 @@ var create_mplib = function(token, config, name) {
11057
11225
  * mixpanel.library_name.track(...);
11058
11226
  *
11059
11227
  * @param {String} token Your Mixpanel API token
11060
- * @param {Object} [config] A dictionary of config options to override. <a href="https://github.com/mixpanel/mixpanel-js/blob/8b2e1f7b/src/mixpanel-core.js#L87-L110">See a list of default config options</a>.
11228
+ * @param {Object} [config] A dictionary of config options to override. <a href="https://github.com/mixpanel/mixpanel-js/blob/v2.46.0/src/mixpanel-core.js#L88-L127">See a list of default config options</a>.
11061
11229
  * @param {String} [name] The name for the new mixpanel instance that you want created
11062
11230
  */
11063
11231
  MixpanelLib.prototype.init = function (token, config, name) {
@@ -11095,7 +11263,7 @@ MixpanelLib.prototype._init = function(token, config, name) {
11095
11263
  // default to JSON payload for standard mixpanel.com API hosts
11096
11264
  if (!('api_payload_format' in config)) {
11097
11265
  var api_host = config['api_host'] || DEFAULT_CONFIG['api_host'];
11098
- if (api_host.match(/\.mixpanel\.com$/)) {
11266
+ if (api_host.match(/\.mixpanel\.com/)) {
11099
11267
  variable_features['api_payload_format'] = PAYLOAD_TYPE_JSON;
11100
11268
  }
11101
11269
  }
@@ -11166,10 +11334,14 @@ MixpanelLib.prototype._init = function(token, config, name) {
11166
11334
  // or the device id if something was already stored
11167
11335
  // in the persitence
11168
11336
  this.register_once({
11169
- 'distinct_id': uuid,
11337
+ 'distinct_id': DEVICE_ID_PREFIX + uuid,
11170
11338
  '$device_id': uuid
11171
11339
  }, '');
11172
11340
  }
11341
+
11342
+ if (this.get_config('track_pageview')) {
11343
+ this.track_pageview();
11344
+ }
11173
11345
  };
11174
11346
 
11175
11347
  // Private methods
@@ -11183,7 +11355,7 @@ MixpanelLib.prototype._loaded = function() {
11183
11355
  MixpanelLib.prototype._set_default_superprops = function() {
11184
11356
  this['persistence'].update_search_keyword(document$1.referrer);
11185
11357
  if (this.get_config('store_google')) {
11186
- this['persistence'].update_campaign_params();
11358
+ this.register(_.info.campaignParams(), {persistent: false});
11187
11359
  }
11188
11360
  if (this.get_config('save_referrer')) {
11189
11361
  this['persistence'].update_referrer_info(document$1.referrer);
@@ -11665,6 +11837,10 @@ MixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, pro
11665
11837
 
11666
11838
  this._set_default_superprops();
11667
11839
 
11840
+ var marketing_properties = this.get_config('track_marketing')
11841
+ ? _.info.marketingParams()
11842
+ : {};
11843
+
11668
11844
  // note: extend writes to the first object, so lets make sure we
11669
11845
  // don't write to the persistence properties object and info
11670
11846
  // properties object by passing in a new object
@@ -11673,6 +11849,7 @@ MixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, pro
11673
11849
  properties = _.extend(
11674
11850
  {},
11675
11851
  _.info.properties(),
11852
+ marketing_properties,
11676
11853
  this['persistence'].properties(),
11677
11854
  this.unpersisted_superprops,
11678
11855
  properties
@@ -11833,17 +12010,54 @@ MixpanelLib.prototype.get_group = function (group_key, group_id) {
11833
12010
  };
11834
12011
 
11835
12012
  /**
11836
- * Track mp_page_view event. This is now ignored by the server.
12013
+ * Track a default Mixpanel page view event, which includes extra default event properties to
12014
+ * improve page view data. The `config.track_pageview` option for <a href="#mixpanelinit">mixpanel.init()</a>
12015
+ * may be turned on for tracking page loads automatically.
11837
12016
  *
11838
- * @param {String} [page] The url of the page to record. If you don't include this, it defaults to the current url.
11839
- * @deprecated
12017
+ * ### Usage
12018
+ *
12019
+ * // track a default $mp_web_page_view event
12020
+ * mixpanel.track_pageview();
12021
+ *
12022
+ * // track a page view event with additional event properties
12023
+ * mixpanel.track_pageview({'ab_test_variant': 'card-layout-b'});
12024
+ *
12025
+ * // example approach to track page views on different page types as event properties
12026
+ * mixpanel.track_pageview({'page': 'pricing'});
12027
+ * mixpanel.track_pageview({'page': 'homepage'});
12028
+ *
12029
+ * // UNCOMMON: Tracking a page view event with a custom event_name option. NOT expected to be used for
12030
+ * // individual pages on the same site or product. Use cases for custom event_name may be page
12031
+ * // views on different products or internal applications that are considered completely separate
12032
+ * mixpanel.track_pageview({'page': 'customer-search'}, {'event_name': '[internal] Admin Page View'});
12033
+ *
12034
+ * @param {Object} [properties] An optional set of additional properties to send with the page view event
12035
+ * @param {Object} [options] Page view tracking options
12036
+ * @param {String} [options.event_name] - Alternate name for the tracking event
12037
+ * @returns {Boolean|Object} If the tracking request was successfully initiated/queued, an object
12038
+ * with the tracking payload sent to the API server is returned; otherwise false.
11840
12039
  */
11841
- MixpanelLib.prototype.track_pageview = function(page) {
11842
- if (_.isUndefined(page)) {
11843
- page = document$1.location.href;
12040
+ MixpanelLib.prototype.track_pageview = addOptOutCheckMixpanelLib(function(properties, options) {
12041
+ if (typeof properties !== 'object') {
12042
+ properties = {};
11844
12043
  }
11845
- this.track('mp_page_view', _.info.pageviewInfo(page));
11846
- };
12044
+ options = options || {};
12045
+ var event_name = options['event_name'] || '$mp_web_page_view';
12046
+
12047
+ var default_page_properties = _.extend(
12048
+ _.info.mpPageViewProperties(),
12049
+ _.info.campaignParams(),
12050
+ _.info.clickParams()
12051
+ );
12052
+
12053
+ var event_properties = _.extend(
12054
+ {},
12055
+ default_page_properties,
12056
+ properties
12057
+ );
12058
+
12059
+ return this.track(event_name, event_properties);
12060
+ });
11847
12061
 
11848
12062
  /**
11849
12063
  * Track clicks on a set of document elements. Selector must be a
@@ -12092,7 +12306,15 @@ MixpanelLib.prototype.identify = function(
12092
12306
  // _unset_callback:function A callback to be run if and when the People unset queue is flushed
12093
12307
 
12094
12308
  var previous_distinct_id = this.get_distinct_id();
12095
- this.register({'$user_id': new_distinct_id});
12309
+ if (new_distinct_id && previous_distinct_id !== new_distinct_id) {
12310
+ // we allow the following condition if previous distinct_id is same as new_distinct_id
12311
+ // so that you can force flush people updates for anonymous profiles.
12312
+ if (typeof new_distinct_id === 'string' && new_distinct_id.indexOf(DEVICE_ID_PREFIX) === 0) {
12313
+ this.report_error('distinct_id cannot have $device: prefix');
12314
+ return -1;
12315
+ }
12316
+ this.register({'$user_id': new_distinct_id});
12317
+ }
12096
12318
 
12097
12319
  if (!this.get_property('$device_id')) {
12098
12320
  // The persisted distinct id might not actually be a device id at all
@@ -12133,7 +12355,7 @@ MixpanelLib.prototype.reset = function() {
12133
12355
  this._flags.identify_called = false;
12134
12356
  var uuid = _.UUID();
12135
12357
  this.register_once({
12136
- 'distinct_id': uuid,
12358
+ 'distinct_id': DEVICE_ID_PREFIX + uuid,
12137
12359
  '$device_id': uuid
12138
12360
  }, '');
12139
12361
  };
@@ -12258,8 +12480,8 @@ MixpanelLib.prototype.name_tag = function(name_tag) {
12258
12480
  * // batching or retry mechanisms.
12259
12481
  * api_transport: 'XHR'
12260
12482
  *
12261
- * // turn on request-batching/queueing/retry
12262
- * batch_requests: false,
12483
+ * // request-batching/queueing/retry
12484
+ * batch_requests: true,
12263
12485
  *
12264
12486
  * // maximum number of events/updates to send in a single
12265
12487
  * // network request
@@ -12331,10 +12553,20 @@ MixpanelLib.prototype.name_tag = function(name_tag) {
12331
12553
  * // secure, meaning they will only be transmitted over https
12332
12554
  * secure_cookie: false
12333
12555
  *
12556
+ * // disables enriching user profiles with first touch marketing data
12557
+ * skip_first_touch_marketing: false
12558
+ *
12334
12559
  * // the amount of time track_links will
12335
12560
  * // wait for Mixpanel's servers to respond
12336
12561
  * track_links_timeout: 300
12337
12562
  *
12563
+ * // adds any UTM parameters and click IDs present on the page to any events fired
12564
+ * track_marketing: true
12565
+ *
12566
+ * // enables automatic page view tracking using default page view events through
12567
+ * // the track_pageview() method
12568
+ * track_pageview: false
12569
+ *
12338
12570
  * // if you set upgrade to be true, the library will check for
12339
12571
  * // a cookie from our old js library and import super
12340
12572
  * // properties from it, then the old cookie is deleted
@@ -13939,7 +14171,7 @@ function backwardCompat(embedConfig) {
13939
14171
  * @group Authentication / Init
13940
14172
  */
13941
14173
  const init = (embedConfig) => {
13942
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
14174
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
13943
14175
  sanity(embedConfig);
13944
14176
  resetCachedAuthToken();
13945
14177
  embedConfig = setEmbedConfig(backwardCompat({
@@ -13955,10 +14187,11 @@ const init = (embedConfig) => {
13955
14187
  const { password, ...configToTrack } = getEmbedConfig();
13956
14188
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
13957
14189
  ...configToTrack,
13958
- usedCustomizationVariables: ((_c = (_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSS) === null || _c === void 0 ? void 0 : _c.variables) != null,
13959
- usedCustomizationRules: ((_f = (_e = (_d = embedConfig.customizations) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.customCSS) === null || _f === void 0 ? void 0 : _f.rules_UNSTABLE) != null,
13960
- usedCustomizationStrings: !!((_h = (_g = embedConfig.customizations) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.strings),
13961
- usedCustomizationIconSprite: !!((_j = embedConfig.customizations) === null || _j === void 0 ? void 0 : _j.iconSpriteUrl),
14190
+ usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
14191
+ usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCSS) === null || _e === void 0 ? void 0 : _e.variables) != null,
14192
+ usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) != null,
14193
+ usedCustomizationStrings: !!((_k = (_j = embedConfig.customizations) === null || _j === void 0 ? void 0 : _j.content) === null || _k === void 0 ? void 0 : _k.strings),
14194
+ usedCustomizationIconSprite: !!((_l = embedConfig.customizations) === null || _l === void 0 ? void 0 : _l.iconSpriteUrl),
13962
14195
  });
13963
14196
  if (getEmbedConfig().callPrefetch) {
13964
14197
  prefetch(getEmbedConfig().thoughtSpotHost);
@@ -14009,21 +14242,22 @@ const renderInQueue = (fn) => {
14009
14242
  /**
14010
14243
  * Imports TML representation of the metadata objects into ThoughtSpot.
14011
14244
  * @param data
14245
+ * @returns imports TML data into ThoughtSpot
14012
14246
  * @example
14013
14247
  * ```js
14014
- * executeTML({
14015
- * //Array of metadata Tmls
14016
- metadata_tmls: [
14017
- "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
14018
- \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
14019
- ],
14020
- import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
14021
- create_new: false, // If selected, creates TML objects with new GUIDs.
14022
- }).then(result => {
14023
- console.log(result);
14024
- }).catch(error => {
14025
- console.error(error);
14026
- });
14248
+ * executeTML({
14249
+ * //Array of metadata Tmls in string format
14250
+ * metadata_tmls: [
14251
+ * "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
14252
+ * \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
14253
+ * ],
14254
+ * import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
14255
+ * create_new: false, // If selected, creates TML objects with new GUIDs.
14256
+ * }).then(result => {
14257
+ * console.log(result);
14258
+ * }).catch(error => {
14259
+ * console.error(error);
14260
+ * });
14027
14261
  *```
14028
14262
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
14029
14263
  * @group Global methods
@@ -14065,27 +14299,28 @@ const executeTML = async (data) => {
14065
14299
  * Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
14066
14300
  * format.
14067
14301
  * @param data
14302
+ * @returns exports TML data
14068
14303
  * @example
14069
14304
  * ```js
14070
- exportTML({
14071
- metadata: [
14072
- {
14073
- type: "LIVEBOARD", //Metadata Type
14074
- identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
14075
- }
14076
- ],
14077
- export_associated: false,//indicates whether to export associated metadata objects
14078
- export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
14079
- //exporting a Liveboard and its associated objects, the API
14080
- //returns the Liveboard TML data with the FQNs of the referenced
14081
- //worksheet. If the exported TML data includes FQNs, you don't need
14082
- //to manually add FQNs of the referenced objects during TML import.
14083
- edoc_format: "JSON" //It takes JSON or YAML value
14084
- }).then(result => {
14085
- console.log(result);
14086
- }).catch(error => {
14087
- console.error(error);
14088
- });
14305
+ * exportTML({
14306
+ * metadata: [
14307
+ * {
14308
+ * type: "LIVEBOARD", //Metadata Type
14309
+ * identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
14310
+ * }
14311
+ * ],
14312
+ * export_associated: false,//indicates whether to export associated metadata objects
14313
+ * export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
14314
+ * //exporting a Liveboard and its associated objects, the API
14315
+ * //returns the Liveboard TML data with the FQNs of the referenced
14316
+ * //worksheet. If the exported TML data includes FQNs, you don't need
14317
+ * //to manually add FQNs of the referenced objects during TML import.
14318
+ * edoc_format: "JSON" //It takes JSON or YAML value
14319
+ * }).then(result => {
14320
+ * console.log(result);
14321
+ * }).catch(error => {
14322
+ * console.error(error);
14323
+ * });
14089
14324
  * ```
14090
14325
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
14091
14326
  * @group Global methods
@@ -14281,7 +14516,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
14281
14516
  });
14282
14517
  }
14283
14518
 
14284
- var name="@thoughtspot/visual-embed-sdk";var version="1.32.7";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/lodash":"^4.17.0","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.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:"2.30.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","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"48 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};
14519
+ var name="@thoughtspot/visual-embed-sdk";var version="1.32.9";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",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"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/lodash":"^4.17.0","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.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:"2.30.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","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"49 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};
14285
14520
 
14286
14521
  /**
14287
14522
  * Copyright (c) 2022