@myinterview/widget-react 1.1.23-development-b93fb54 → 1.1.23-from-21-to-dev

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/dist/esm/index.js CHANGED
@@ -2,6 +2,31 @@ import * as React from 'react';
2
2
  import React__default, { createContext, forwardRef, useRef, useEffect, useState, useLayoutEffect, useImperativeHandle, useDebugValue, useContext, createElement, useCallback, useMemo } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
 
5
+ /*! *****************************************************************************
6
+ Copyright (c) Microsoft Corporation.
7
+
8
+ Permission to use, copy, modify, and/or distribute this software for any
9
+ purpose with or without fee is hereby granted.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
+ PERFORMANCE OF THIS SOFTWARE.
18
+ ***************************************************************************** */
19
+
20
+ function __awaiter(thisArg, _arguments, P, generator) {
21
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
22
+ return new (P || (P = Promise))(function (resolve, reject) {
23
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
24
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
25
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
26
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
27
+ });
28
+ }
29
+
5
30
  // eslint-disable-next-line @typescript-eslint/unbound-method
6
31
  const objectToString = Object.prototype.toString;
7
32
 
@@ -370,21 +395,85 @@ function getLocationHref() {
370
395
  }
371
396
  }
372
397
 
373
- /** An error emitted by Sentry SDKs and related utilities. */
374
- class SentryError extends Error {
375
- /** Display name of this error instance. */
398
+ /** Prefix for logging strings */
399
+ const PREFIX = 'Sentry Logger ';
376
400
 
377
- constructor( message, logLevel = 'warn') {
378
- super(message);this.message = message;
379
- this.name = new.target.prototype.constructor.name;
380
- // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line
381
- // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes
382
- // instances of `SentryError` fail `obj instanceof SentryError` checks.
383
- Object.setPrototypeOf(this, new.target.prototype);
384
- this.logLevel = logLevel;
401
+ const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ;
402
+
403
+ /**
404
+ * Temporarily disable sentry console instrumentations.
405
+ *
406
+ * @param callback The function to run against the original `console` messages
407
+ * @returns The results of the callback
408
+ */
409
+ function consoleSandbox(callback) {
410
+ if (!('console' in GLOBAL_OBJ)) {
411
+ return callback();
412
+ }
413
+
414
+ const originalConsole = GLOBAL_OBJ.console ;
415
+ const wrappedLevels = {};
416
+
417
+ // Restore all wrapped console methods
418
+ CONSOLE_LEVELS.forEach(level => {
419
+ // TODO(v7): Remove this check as it's only needed for Node 6
420
+ const originalWrappedFunc =
421
+ originalConsole[level] && (originalConsole[level] ).__sentry_original__;
422
+ if (level in originalConsole && originalWrappedFunc) {
423
+ wrappedLevels[level] = originalConsole[level] ;
424
+ originalConsole[level] = originalWrappedFunc ;
425
+ }
426
+ });
427
+
428
+ try {
429
+ return callback();
430
+ } finally {
431
+ // Revert restoration to wrapped state
432
+ Object.keys(wrappedLevels).forEach(level => {
433
+ originalConsole[level] = wrappedLevels[level ];
434
+ });
385
435
  }
386
436
  }
387
437
 
438
+ function makeLogger() {
439
+ let enabled = false;
440
+ const logger = {
441
+ enable: () => {
442
+ enabled = true;
443
+ },
444
+ disable: () => {
445
+ enabled = false;
446
+ },
447
+ };
448
+
449
+ if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
450
+ CONSOLE_LEVELS.forEach(name => {
451
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
452
+ logger[name] = (...args) => {
453
+ if (enabled) {
454
+ consoleSandbox(() => {
455
+ GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
456
+ });
457
+ }
458
+ };
459
+ });
460
+ } else {
461
+ CONSOLE_LEVELS.forEach(name => {
462
+ logger[name] = () => undefined;
463
+ });
464
+ }
465
+
466
+ return logger ;
467
+ }
468
+
469
+ // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
470
+ let logger;
471
+ if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
472
+ logger = getGlobalSingleton('logger', makeLogger);
473
+ } else {
474
+ logger = makeLogger();
475
+ }
476
+
388
477
  /** Regular expression used to parse a Dsn. */
389
478
  const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
390
479
 
@@ -413,13 +502,16 @@ function dsnToString(dsn, withPassword = false) {
413
502
  * Parses a Dsn from a given string.
414
503
  *
415
504
  * @param str A Dsn as string
416
- * @returns Dsn as DsnComponents
505
+ * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string
417
506
  */
418
507
  function dsnFromString(str) {
419
508
  const match = DSN_REGEX.exec(str);
420
509
 
421
510
  if (!match) {
422
- throw new SentryError(`Invalid Sentry Dsn: ${str}`);
511
+ // This should be logged to the console
512
+ // eslint-disable-next-line no-console
513
+ console.error(`Invalid Sentry Dsn: ${str}`);
514
+ return undefined;
423
515
  }
424
516
 
425
517
  const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);
@@ -456,117 +548,67 @@ function dsnFromComponents(components) {
456
548
 
457
549
  function validateDsn(dsn) {
458
550
  if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
459
- return;
551
+ return true;
460
552
  }
461
553
 
462
554
  const { port, projectId, protocol } = dsn;
463
555
 
464
556
  const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];
465
- requiredComponents.forEach(component => {
557
+ const hasMissingRequiredComponent = requiredComponents.find(component => {
466
558
  if (!dsn[component]) {
467
- throw new SentryError(`Invalid Sentry Dsn: ${component} missing`);
559
+ logger.error(`Invalid Sentry Dsn: ${component} missing`);
560
+ return true;
468
561
  }
562
+ return false;
469
563
  });
470
564
 
565
+ if (hasMissingRequiredComponent) {
566
+ return false;
567
+ }
568
+
471
569
  if (!projectId.match(/^\d+$/)) {
472
- throw new SentryError(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
570
+ logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
571
+ return false;
473
572
  }
474
573
 
475
574
  if (!isValidProtocol(protocol)) {
476
- throw new SentryError(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
575
+ logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
576
+ return false;
477
577
  }
478
578
 
479
579
  if (port && isNaN(parseInt(port, 10))) {
480
- throw new SentryError(`Invalid Sentry Dsn: Invalid port ${port}`);
580
+ logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);
581
+ return false;
481
582
  }
482
583
 
483
584
  return true;
484
585
  }
485
586
 
486
- /** The Sentry Dsn, identifying a Sentry instance and project. */
487
- function makeDsn(from) {
488
- const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);
489
- validateDsn(components);
490
- return components;
491
- }
492
-
493
- /** Prefix for logging strings */
494
- const PREFIX = 'Sentry Logger ';
495
-
496
- const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ;
497
-
498
587
  /**
499
- * Temporarily disable sentry console instrumentations.
500
- *
501
- * @param callback The function to run against the original `console` messages
502
- * @returns The results of the callback
588
+ * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.
589
+ * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source
503
590
  */
504
- function consoleSandbox(callback) {
505
- if (!('console' in GLOBAL_OBJ)) {
506
- return callback();
507
- }
508
-
509
- const originalConsole = GLOBAL_OBJ.console ;
510
- const wrappedLevels = {};
511
-
512
- // Restore all wrapped console methods
513
- CONSOLE_LEVELS.forEach(level => {
514
- // TODO(v7): Remove this check as it's only needed for Node 6
515
- const originalWrappedFunc =
516
- originalConsole[level] && (originalConsole[level] ).__sentry_original__;
517
- if (level in originalConsole && originalWrappedFunc) {
518
- wrappedLevels[level] = originalConsole[level] ;
519
- originalConsole[level] = originalWrappedFunc ;
520
- }
521
- });
522
-
523
- try {
524
- return callback();
525
- } finally {
526
- // Revert restoration to wrapped state
527
- Object.keys(wrappedLevels).forEach(level => {
528
- originalConsole[level] = wrappedLevels[level ];
529
- });
591
+ function makeDsn(from) {
592
+ const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);
593
+ if (!components || !validateDsn(components)) {
594
+ return undefined;
530
595
  }
596
+ return components;
531
597
  }
532
598
 
533
- function makeLogger() {
534
- let enabled = false;
535
- const logger = {
536
- enable: () => {
537
- enabled = true;
538
- },
539
- disable: () => {
540
- enabled = false;
541
- },
542
- };
599
+ /** An error emitted by Sentry SDKs and related utilities. */
600
+ class SentryError extends Error {
601
+ /** Display name of this error instance. */
543
602
 
544
- if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
545
- CONSOLE_LEVELS.forEach(name => {
546
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
547
- logger[name] = (...args) => {
548
- if (enabled) {
549
- consoleSandbox(() => {
550
- GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
551
- });
552
- }
553
- };
554
- });
555
- } else {
556
- CONSOLE_LEVELS.forEach(name => {
557
- logger[name] = () => undefined;
558
- });
603
+ constructor( message, logLevel = 'warn') {
604
+ super(message);this.message = message;
605
+ this.name = new.target.prototype.constructor.name;
606
+ // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line
607
+ // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes
608
+ // instances of `SentryError` fail `obj instanceof SentryError` checks.
609
+ Object.setPrototypeOf(this, new.target.prototype);
610
+ this.logLevel = logLevel;
559
611
  }
560
-
561
- return logger ;
562
- }
563
-
564
- // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
565
- let logger;
566
- if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
567
- logger = getGlobalSingleton('logger', makeLogger);
568
- } else {
569
- logger = makeLogger();
570
612
  }
571
613
 
572
614
  /**
@@ -5066,16 +5108,20 @@ class BaseClient {
5066
5108
  */
5067
5109
  constructor(options) {BaseClient.prototype.__init.call(this);BaseClient.prototype.__init2.call(this);BaseClient.prototype.__init3.call(this);BaseClient.prototype.__init4.call(this);BaseClient.prototype.__init5.call(this);
5068
5110
  this._options = options;
5111
+
5069
5112
  if (options.dsn) {
5070
5113
  this._dsn = makeDsn(options.dsn);
5114
+ } else {
5115
+ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('No DSN provided, client will not do anything.');
5116
+ }
5117
+
5118
+ if (this._dsn) {
5071
5119
  const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);
5072
5120
  this._transport = options.transport({
5073
5121
  recordDroppedEvent: this.recordDroppedEvent.bind(this),
5074
5122
  ...options.transportOptions,
5075
5123
  url,
5076
5124
  });
5077
- } else {
5078
- (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('No DSN provided, client will not do anything.');
5079
5125
  }
5080
5126
  }
5081
5127
 
@@ -5794,7 +5840,7 @@ function getEventForEnvelopeItem(item, type) {
5794
5840
  return Array.isArray(item) ? (item )[1] : undefined;
5795
5841
  }
5796
5842
 
5797
- const SDK_VERSION = '7.52.1';
5843
+ const SDK_VERSION = '7.53.0';
5798
5844
 
5799
5845
  let originalFunctionToString;
5800
5846
 
@@ -6027,9 +6073,9 @@ function _getEventFilterUrl(event) {
6027
6073
  }
6028
6074
 
6029
6075
  var Integrations = /*#__PURE__*/Object.freeze({
6030
- __proto__: null,
6031
- FunctionToString: FunctionToString,
6032
- InboundFilters: InboundFilters
6076
+ __proto__: null,
6077
+ FunctionToString: FunctionToString,
6078
+ InboundFilters: InboundFilters
6033
6079
  });
6034
6080
 
6035
6081
  const WINDOW$1 = GLOBAL_OBJ ;
@@ -8253,13 +8299,13 @@ function startSessionTracking() {
8253
8299
  }
8254
8300
 
8255
8301
  var index$1 = /*#__PURE__*/Object.freeze({
8256
- __proto__: null,
8257
- GlobalHandlers: GlobalHandlers,
8258
- TryCatch: TryCatch,
8259
- Breadcrumbs: Breadcrumbs,
8260
- LinkedErrors: LinkedErrors,
8261
- HttpContext: HttpContext,
8262
- Dedupe: Dedupe
8302
+ __proto__: null,
8303
+ GlobalHandlers: GlobalHandlers,
8304
+ TryCatch: TryCatch,
8305
+ Breadcrumbs: Breadcrumbs,
8306
+ LinkedErrors: LinkedErrors,
8307
+ HttpContext: HttpContext,
8308
+ Dedupe: Dedupe
8263
8309
  });
8264
8310
 
8265
8311
  // exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`
@@ -11546,6 +11592,23 @@ var NodeType;
11546
11592
  NodeType[NodeType["Comment"] = 5] = "Comment";
11547
11593
  })(NodeType || (NodeType = {}));
11548
11594
 
11595
+ /* eslint-disable @typescript-eslint/naming-convention */
11596
+
11597
+ var EventType; (function (EventType) {
11598
+ const DomContentLoaded = 0; EventType[EventType["DomContentLoaded"] = DomContentLoaded] = "DomContentLoaded";
11599
+ const Load = 1; EventType[EventType["Load"] = Load] = "Load";
11600
+ const FullSnapshot = 2; EventType[EventType["FullSnapshot"] = FullSnapshot] = "FullSnapshot";
11601
+ const IncrementalSnapshot = 3; EventType[EventType["IncrementalSnapshot"] = IncrementalSnapshot] = "IncrementalSnapshot";
11602
+ const Meta = 4; EventType[EventType["Meta"] = Meta] = "Meta";
11603
+ const Custom = 5; EventType[EventType["Custom"] = Custom] = "Custom";
11604
+ const Plugin = 6; EventType[EventType["Plugin"] = Plugin] = "Plugin";
11605
+ })(EventType || (EventType = {}));
11606
+
11607
+ /**
11608
+ * This is a partial copy of rrweb's eventWithTime type which only contains the properties
11609
+ * we specifcally need in the SDK.
11610
+ */
11611
+
11549
11612
  /**
11550
11613
  * Converts a timestamp to ms, if it was in s, or keeps it as ms.
11551
11614
  */
@@ -11588,7 +11651,18 @@ async function addEvent(
11588
11651
  replay.eventBuffer.clear();
11589
11652
  }
11590
11653
 
11591
- return await replay.eventBuffer.addEvent(event);
11654
+ const replayOptions = replay.getOptions();
11655
+
11656
+ const eventAfterPossibleCallback =
11657
+ typeof replayOptions.beforeAddRecordingEvent === 'function' && event.type === EventType.Custom
11658
+ ? replayOptions.beforeAddRecordingEvent(event)
11659
+ : event;
11660
+
11661
+ if (!eventAfterPossibleCallback) {
11662
+ return;
11663
+ }
11664
+
11665
+ return await replay.eventBuffer.addEvent(eventAfterPossibleCallback);
11592
11666
  } catch (error) {
11593
11667
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(error);
11594
11668
  await replay.stop('addEvent');
@@ -14564,23 +14638,6 @@ function debounce(func, wait, options) {
14564
14638
  return debounced;
14565
14639
  }
14566
14640
 
14567
- /* eslint-disable @typescript-eslint/naming-convention */
14568
-
14569
- var EventType; (function (EventType) {
14570
- const DomContentLoaded = 0; EventType[EventType["DomContentLoaded"] = DomContentLoaded] = "DomContentLoaded";
14571
- const Load = 1; EventType[EventType["Load"] = Load] = "Load";
14572
- const FullSnapshot = 2; EventType[EventType["FullSnapshot"] = FullSnapshot] = "FullSnapshot";
14573
- const IncrementalSnapshot = 3; EventType[EventType["IncrementalSnapshot"] = IncrementalSnapshot] = "IncrementalSnapshot";
14574
- const Meta = 4; EventType[EventType["Meta"] = Meta] = "Meta";
14575
- const Custom = 5; EventType[EventType["Custom"] = Custom] = "Custom";
14576
- const Plugin = 6; EventType[EventType["Plugin"] = Plugin] = "Plugin";
14577
- })(EventType || (EventType = {}));
14578
-
14579
- /**
14580
- * This is a partial copy of rrweb's eventWithTime type which only contains the properties
14581
- * we specifcally need in the SDK.
14582
- */
14583
-
14584
14641
  /**
14585
14642
  * Handler for recording events.
14586
14643
  *
@@ -14654,6 +14711,30 @@ function getHandleRecordingEmit(replay) {
14654
14711
  }
14655
14712
  }
14656
14713
 
14714
+ const options = replay.getOptions();
14715
+
14716
+ // TODO: We want this as an experiment so that we can test
14717
+ // internally and create metrics before making this the default
14718
+ if (options._experiments.delayFlushOnCheckout) {
14719
+ // If the full snapshot is due to an initial load, we will not have
14720
+ // a previous session ID. In this case, we want to buffer events
14721
+ // for a set amount of time before flushing. This can help avoid
14722
+ // capturing replays of users that immediately close the window.
14723
+ setTimeout(() => replay.conditionalFlush(), options._experiments.delayFlushOnCheckout);
14724
+
14725
+ // Cancel any previously debounced flushes to ensure there are no [near]
14726
+ // simultaneous flushes happening. The latter request should be
14727
+ // insignificant in this case, so wait for additional user interaction to
14728
+ // trigger a new flush.
14729
+ //
14730
+ // This can happen because there's no guarantee that a recording event
14731
+ // happens first. e.g. a mouse click can happen and trigger a debounced
14732
+ // flush before the checkout.
14733
+ replay.cancelFlush();
14734
+
14735
+ return true;
14736
+ }
14737
+
14657
14738
  // Flush immediately so that we do not miss the first segment, otherwise
14658
14739
  // it can prevent loading on the UI. This will cause an increase in short
14659
14740
  // replays (e.g. opening and closing a tab quickly), but these can be
@@ -15419,7 +15500,17 @@ class ReplayContainer {
15419
15500
  }
15420
15501
 
15421
15502
  /**
15422
- *
15503
+ * Only flush if `this.recordingMode === 'session'`
15504
+ */
15505
+ conditionalFlush() {
15506
+ if (this.recordingMode === 'buffer') {
15507
+ return Promise.resolve();
15508
+ }
15509
+
15510
+ return this.flushImmediate();
15511
+ }
15512
+
15513
+ /**
15423
15514
  * Always flush via `_debouncedFlush` so that we do not have flushes triggered
15424
15515
  * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
15425
15516
  * cases of mulitple flushes happening closely together.
@@ -15430,6 +15521,13 @@ class ReplayContainer {
15430
15521
  return this._debouncedFlush.flush() ;
15431
15522
  }
15432
15523
 
15524
+ /**
15525
+ * Cancels queued up flushes.
15526
+ */
15527
+ cancelFlush() {
15528
+ this._debouncedFlush.cancel();
15529
+ }
15530
+
15433
15531
  /** Get the current sesion (=replay) ID */
15434
15532
  getSessionId() {
15435
15533
  return this.session && this.session.id;
@@ -15679,7 +15777,7 @@ class ReplayContainer {
15679
15777
  // Send replay when the page/tab becomes hidden. There is no reason to send
15680
15778
  // replay if it becomes visible, since no actions we care about were done
15681
15779
  // while it was hidden
15682
- this._conditionalFlush();
15780
+ void this.conditionalFlush();
15683
15781
  }
15684
15782
 
15685
15783
  /**
@@ -15763,17 +15861,6 @@ class ReplayContainer {
15763
15861
  return Promise.all(createPerformanceSpans(this, createPerformanceEntries(entries)));
15764
15862
  }
15765
15863
 
15766
- /**
15767
- * Only flush if `this.recordingMode === 'session'`
15768
- */
15769
- _conditionalFlush() {
15770
- if (this.recordingMode === 'buffer') {
15771
- return;
15772
- }
15773
-
15774
- void this.flushImmediate();
15775
- }
15776
-
15777
15864
  /**
15778
15865
  * Clear _context
15779
15866
  */
@@ -16135,6 +16222,8 @@ class Replay {
16135
16222
  ignore = [],
16136
16223
  maskFn,
16137
16224
 
16225
+ beforeAddRecordingEvent,
16226
+
16138
16227
  // eslint-disable-next-line deprecation/deprecation
16139
16228
  blockClass,
16140
16229
  // eslint-disable-next-line deprecation/deprecation
@@ -16192,6 +16281,7 @@ class Replay {
16192
16281
  networkCaptureBodies,
16193
16282
  networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders),
16194
16283
  networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders),
16284
+ beforeAddRecordingEvent,
16195
16285
 
16196
16286
  _experiments,
16197
16287
  };
@@ -25560,6 +25650,7 @@ var STATES$5;
25560
25650
  STATES["RE_INIT_RECORDER__NEXT_QUESTION"] = "reInitRecorderNextQuestion";
25561
25651
  STATES["UPLOADING"] = "uploading";
25562
25652
  STATES["CONFIRM"] = "confirm";
25653
+ STATES["CONFIRM_WATING"] = "confirmWaiting";
25563
25654
  STATES["FINISHED"] = "finished";
25564
25655
  STATES["ERROR"] = "error";
25565
25656
  })(STATES$5 || (STATES$5 = {}));
@@ -25613,6 +25704,7 @@ var ACTIONS$6;
25613
25704
  ACTIONS["RESET_FAILED_RECORDING_ATTEMPTS"] = "resetFailedRecordingAttempts";
25614
25705
  ACTIONS["CLEAR_VIDEO_ERROR"] = "clearVideoError";
25615
25706
  ACTIONS["UPDATE_VIDEO_DIMENSIONS"] = "updateVideoDimensions";
25707
+ ACTIONS["UPDATE_UPLOADED_FALSE_COUNT"] = "updateUploadedFalseCount";
25616
25708
  })(ACTIONS$6 || (ACTIONS$6 = {}));
25617
25709
  var EVENTS$5;
25618
25710
  (function (EVENTS) {
@@ -25668,6 +25760,7 @@ var GUARDS$3;
25668
25760
  GUARDS["IS_RECORDER_READY"] = "isRecorderReady";
25669
25761
  GUARDS["IS_ASSESSMENT_QUESTION"] = "isAssessmentQuestion";
25670
25762
  GUARDS["IS_TIMES_UP"] = "isTimesUp";
25763
+ GUARDS["SHOULD_TRY_TO_CONFIRM"] = "shouldTryToConfirm";
25671
25764
  })(GUARDS$3 || (GUARDS$3 = {}));
25672
25765
  var TAGS;
25673
25766
  (function (TAGS) {
@@ -25677,6 +25770,7 @@ var TAGS;
25677
25770
  TAGS["DISPLAY_OUTER_VIEW"] = "displayOuterView";
25678
25771
  TAGS["DISPLAY_QUESTION"] = "displayQuestion";
25679
25772
  TAGS["DISPLAY_QUESTIONS_LIST"] = "displayQuestionsList";
25773
+ TAGS["DISPLAY_UPLOAD"] = "displayUpload";
25680
25774
  TAGS["LOADING"] = "loading";
25681
25775
  })(TAGS || (TAGS = {}));
25682
25776
 
@@ -30398,7 +30492,7 @@ const configGenerator = () => {
30398
30492
  let release;
30399
30493
  try {
30400
30494
  environment !== null && environment !== void 0 ? environment : (environment = "staging");
30401
- release !== null && release !== void 0 ? release : (release = "1.1.23");
30495
+ release !== null && release !== void 0 ? release : (release = "1.1.23-from-21-to-dev");
30402
30496
  }
30403
30497
  catch (_a) {
30404
30498
  console.error('sentry configGenerator error');
@@ -30871,6 +30965,7 @@ const SECONDS_LEFT_HIGHLIGHT = 10;
30871
30965
  const DEFAULT_ASSESSMENT_MAX_CHARS = 300;
30872
30966
  const DEFAULT_ASSESSMENT_DURATION = 0;
30873
30967
  const DEFAULT_VIDEO_DIMENSIONS = { width: 1280, height: 720 }; // Transcoder default dimensions (720p)
30968
+ const MAX_CONFIRM_ATTEMPTS = 5;
30874
30969
  // Font
30875
30970
  const FONT_URL = 'https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700&display=swap';
30876
30971
  var RETAKE_SPEED;
@@ -35031,8 +35126,8 @@ function memoizeOne(resultFn, isEqual) {
35031
35126
  }
35032
35127
 
35033
35128
  var memoizeOne_esm = /*#__PURE__*/Object.freeze({
35034
- __proto__: null,
35035
- 'default': memoizeOne
35129
+ __proto__: null,
35130
+ 'default': memoizeOne
35036
35131
  });
35037
35132
 
35038
35133
  var require$$2 = /*@__PURE__*/getAugmentedNamespace(memoizeOne_esm);
@@ -38992,6 +39087,11 @@ var EVENT_TYPES;
38992
39087
  EVENT_TYPES["SOUND_RESTORED"] = "soundRestored";
38993
39088
  EVENT_TYPES["TIMES_UP"] = "timesUp";
38994
39089
  EVENT_TYPES["COMPLETED_INTERVIEW"] = "completedInterview";
39090
+ EVENT_TYPES["RECONNECTED"] = "reconnected";
39091
+ EVENT_TYPES["CONFIRM_UPLOADED_FAILED"] = "confirmUploadedFailed";
39092
+ EVENT_TYPES["FINISHED"] = "finished";
39093
+ EVENT_TYPES["ON_FINISH_SUCCEED"] = "onFinishSucceed";
39094
+ EVENT_TYPES["ON_FINISH_FAILED"] = "onFinishFailed";
38995
39095
  })(EVENT_TYPES || (EVENT_TYPES = {}));
38996
39096
  let event_id;
38997
39097
  const updateEventId = (eventId) => { event_id = eventId; };
@@ -39541,31 +39641,6 @@ const Setup = ({ widgetMachine, sendToWidget, isPracticeDisabled, recordWithoutV
39541
39641
  React__default.createElement(C, { className: startButtonClassNames, color: "special", backgroundColor: "white", onClick: () => sendToWidget(EVENTS$5.QUESTION_MODE), disabled: !canStartInterview }, t(isResumed ? 'welcome.resumeInterview' : 'buttons.btn_start').toUpperCase()))));
39542
39642
  };
39543
39643
 
39544
- /*! *****************************************************************************
39545
- Copyright (c) Microsoft Corporation.
39546
-
39547
- Permission to use, copy, modify, and/or distribute this software for any
39548
- purpose with or without fee is hereby granted.
39549
-
39550
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
39551
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39552
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
39553
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39554
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39555
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39556
- PERFORMANCE OF THIS SOFTWARE.
39557
- ***************************************************************************** */
39558
-
39559
- function __awaiter(thisArg, _arguments, P, generator) {
39560
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
39561
- return new (P || (P = Promise))(function (resolve, reject) {
39562
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39563
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
39564
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
39565
- step((generator = generator.apply(thisArg, _arguments || [])).next());
39566
- });
39567
- }
39568
-
39569
39644
  const uploadToS3 = (url, data, onProgress, timeout = 0) => s3AxiosInstance.put(url, data, {
39570
39645
  headers: { 'Content-Type': 'video/webm' }, onUploadProgress: onProgress, timeout,
39571
39646
  });
@@ -39636,8 +39711,8 @@ const OuterView = ({ widgetMachine, sendToWidget, recorderRef }) => {
39636
39711
  const isQuestionDisplayed = widgetMachine.hasTag(TAGS.DISPLAY_QUESTION) || (isVideoQuestionState && !currentQuestionObj.thinkingTime);
39637
39712
  const isPreviewState = widgetMachine.matches(STATES$5.PREVIEW);
39638
39713
  const isUploadingState = widgetMachine.matches(STATES$5.UPLOADING);
39639
- const isConfirmState = widgetMachine.matches(STATES$5.CONFIRM);
39640
39714
  const isQuestionsListDisplayed = widgetMachine.hasTag(TAGS.DISPLAY_QUESTIONS_LIST);
39715
+ const isUploadDisplayed = widgetMachine.hasTag(TAGS.DISPLAY_UPLOAD);
39641
39716
  const isRecording = recorderMachine.matches({ [STATES$6.RECORDING]: STATES$6.COLLECTING_BLOBS });
39642
39717
  const isCountDown = recorderMachine.matches({ [STATES$6.RECORDING]: STATES$6.COUNT_DOWN });
39643
39718
  const isPracticeMode = recordingType === TAKE_TYPES.PRACTICE;
@@ -39655,7 +39730,7 @@ const OuterView = ({ widgetMachine, sendToWidget, recorderRef }) => {
39655
39730
  isSetupState && React__default.createElement(Setup, { recordWithoutVideo: recordWithoutVideo, widgetMachine: widgetMachine, sendToWidget: sendToWidget, isPracticeDisabled: !!config.disablePractice }),
39656
39731
  isQuestionsListDisplayed && React__default.createElement(QuestionsList, { questions: questions, currentQuestion: currentQuestion, isPracticeMode: isPracticeMode, questionsStatus: questionsStatus }),
39657
39732
  isQuestionDisplayed && React__default.createElement(Question, { questionObj: currentQuestionObj }),
39658
- (isUploadingState || isConfirmState) && (React__default.createElement(Upload, { isConnected: isConnected, totalFileSize: totalFileSize, totalUploadedFilesSize: totalUploadedFilesSize, totalUploadSpeed: totalUploadSpeed }))));
39733
+ isUploadDisplayed && (React__default.createElement(Upload, { isConnected: isConnected, totalFileSize: totalFileSize, totalUploadedFilesSize: totalUploadedFilesSize, totalUploadSpeed: totalUploadSpeed }))));
39659
39734
  };
39660
39735
 
39661
39736
  var actions = {};
@@ -44752,7 +44827,7 @@ const accUploaderMachine = createMachine({
44752
44827
  actions: [ACTIONS$2.SENTRY],
44753
44828
  },
44754
44829
  {
44755
- actions: [ACTIONS$2.SET_UPLOADED, ACTIONS$2.SENTRY],
44830
+ actions: [ACTIONS$2.SENTRY],
44756
44831
  target: `#uploader.${STATES$2.UPLOADED}`, // In case the video already uploaded
44757
44832
  },
44758
44833
  ],
@@ -44769,7 +44844,6 @@ const accUploaderMachine = createMachine({
44769
44844
  id: 'uploadToS3',
44770
44845
  src: ({ signedUrl, file }) => (callback) => uploadToS3(signedUrl, file, callback),
44771
44846
  onDone: {
44772
- // actions: [ACTIONS.SET_UPLOADED],
44773
44847
  target: `#uploader.${STATES$2.UPLOADED}`,
44774
44848
  },
44775
44849
  onError: {
@@ -45125,10 +45199,14 @@ const accWidgetMachine = createMachine({
45125
45199
  failedRecordingMessage: VIDEO_CORRUPTED_STATES.NO_ERROR,
45126
45200
  isResumed: false,
45127
45201
  videoDimensions: DEFAULT_VIDEO_DIMENSIONS,
45202
+ confirmUploadedFalseCount: 0,
45128
45203
  },
45129
45204
  on: {
45130
45205
  [EVENTS$1.CONNECTION_CHANGED]: {
45131
- actions: [ACTIONS$6.SET_CONNECTION],
45206
+ actions: [
45207
+ ACTIONS$6.SET_CONNECTION,
45208
+ { type: ACTIONS$6.EMIT_TRACKING_EVENT, data: { eventType: EVENT_TYPES.RECONNECTED } },
45209
+ ],
45132
45210
  },
45133
45211
  [EVENTS$5.UPLOADER_PROGRESS]: {
45134
45212
  actions: [ACTIONS$6.UPDATE_TOTAL_UPLOADED_FILES_SIZE],
@@ -45655,7 +45733,7 @@ const accWidgetMachine = createMachine({
45655
45733
  },
45656
45734
  },
45657
45735
  [STATES$5.UPLOADING]: {
45658
- tags: [TAGS.DISPLAY_OUTER_VIEW],
45736
+ tags: [TAGS.DISPLAY_OUTER_VIEW, TAGS.DISPLAY_UPLOAD],
45659
45737
  entry: [
45660
45738
  { type: ACTIONS$6.SESSION_EVENT, data: { event: 'widget_completed', type: 'date' } },
45661
45739
  { type: ACTIONS$6.CONSOLE_DEBUG, data: { message: DEBUG.UPLOADING_STATE } },
@@ -45669,30 +45747,57 @@ const accWidgetMachine = createMachine({
45669
45747
  },
45670
45748
  },
45671
45749
  },
45750
+ [STATES$5.CONFIRM_WATING]: {
45751
+ tags: [TAGS.DISPLAY_OUTER_VIEW, TAGS.DISPLAY_UPLOAD],
45752
+ always: {
45753
+ target: STATES$5.CONFIRM,
45754
+ cond: GUARDS$3.IS_CONNECTED,
45755
+ },
45756
+ },
45672
45757
  [STATES$5.CONFIRM]: {
45673
- tags: [TAGS.DISPLAY_OUTER_VIEW],
45758
+ tags: [TAGS.DISPLAY_OUTER_VIEW, TAGS.DISPLAY_UPLOAD],
45674
45759
  invoke: {
45675
45760
  id: 'getVideo',
45676
45761
  src: (context) => { var _a; return getVideo(((_a = context.widgetConfig.video) === null || _a === void 0 ? void 0 : _a.video_id) || ''); },
45677
- onDone: {
45678
- target: STATES$5.FINISHED,
45679
- cond: (_, event) => !!event.data.data.data.video.uploaded,
45680
- },
45762
+ onDone: [
45763
+ {
45764
+ target: STATES$5.FINISHED,
45765
+ cond: (_, event) => !!event.data.data.data.video.uploaded,
45766
+ },
45767
+ {
45768
+ actions: [
45769
+ ACTIONS$6.UPDATE_UPLOADED_FALSE_COUNT,
45770
+ { type: ACTIONS$6.SENTRY, data: { eventName: 'CONFIRM::UPLOADED_FALSE' } },
45771
+ ],
45772
+ target: STATES$5.CONFIRM_WATING,
45773
+ cond: GUARDS$3.SHOULD_TRY_TO_CONFIRM,
45774
+ },
45775
+ {
45776
+ actions: [
45777
+ { type: ACTIONS$6.SET_VIDEO_ERROR, data: { errorMessage: 'Error, Please contact support' } },
45778
+ { type: ACTIONS$6.EMIT_TRACKING_EVENT, data: { eventType: EVENT_TYPES.CONFIRM_UPLOADED_FAILED } },
45779
+ ],
45780
+ target: STATES$5.ERROR,
45781
+ },
45782
+ ],
45681
45783
  onError: [
45682
45784
  {
45683
- actions: [() => console.error('UPDATE_VIDEO_UPLADED_ERROR:'), console.error, ACTIONS$6.SENTRY],
45785
+ actions: [() => console.error('UPDATE_VIDEO_UPLADED_ERROR:'), console.error, { type: ACTIONS$6.SENTRY, data: { eventName: 'CONFIRM::ERROR__NOT_FOUND' } }],
45684
45786
  target: STATES$5.FINISHED,
45685
45787
  cond: (_, event) => event.data.response.status === STATUS_CODES.NOT_FOUND,
45686
45788
  },
45687
45789
  {
45688
- actions: [ACTIONS$6.SENTRY],
45689
- target: STATES$5.CONFIRM,
45790
+ actions: [() => console.error('UPDATE_VIDEO_UPLADED_ERROR:'), console.error, { type: ACTIONS$6.SENTRY, data: { eventName: 'CONFIRM::ERROR' } }],
45791
+ target: STATES$5.CONFIRM_WATING,
45690
45792
  },
45691
45793
  ],
45692
45794
  },
45693
45795
  },
45694
45796
  [STATES$5.FINISHED]: {
45695
- entry: [{ type: ACTIONS$6.CONSOLE_DEBUG, data: { message: DEBUG.INTERVIEW_SUBMITTED } }],
45797
+ entry: [
45798
+ { type: ACTIONS$6.CONSOLE_DEBUG, data: { message: DEBUG.INTERVIEW_SUBMITTED } },
45799
+ { type: ACTIONS$6.EMIT_TRACKING_EVENT, data: { eventType: EVENT_TYPES.FINISHED } },
45800
+ ],
45696
45801
  type: 'final',
45697
45802
  },
45698
45803
  [STATES$5.ERROR]: {
@@ -45888,9 +45993,12 @@ const accWidgetMachine = createMachine({
45888
45993
  widgetConfig: Object.assign(Object.assign({}, widgetConfig), { video: Object.assign(Object.assign({}, widgetConfig.video), { videos: (_b = (_a = widgetConfig.video) === null || _a === void 0 ? void 0 : _a.videos) === null || _b === void 0 ? void 0 : _b.map((video, idx) => ((idx !== questionNumber - 1) ? video : videoFile)) }) }),
45889
45994
  });
45890
45995
  }),
45891
- [ACTIONS$6.SET_VIDEO_ERROR]: assign$2((_, event) => ({
45892
- error: event.data.response.data || { errorMessage: event.data.message },
45893
- })),
45996
+ [ACTIONS$6.SET_VIDEO_ERROR]: assign$2((_, event, meta) => {
45997
+ var _a, _b, _c, _d;
45998
+ return ({
45999
+ error: ((_b = (_a = event.data) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.data) || { errorMessage: ((_c = event.data) === null || _c === void 0 ? void 0 : _c.message) || ((_d = meta.action.data) === null || _d === void 0 ? void 0 : _d.errorMessage) },
46000
+ });
46001
+ }),
45894
46002
  [ACTIONS$6.REVOKE_MEMORY]: send$2((_, event) => ({ type: EVENTS$4.REMOVE_TAKES, data: { questionToRemove: event.data.questionNumber } }), { to: ({ storageRef }) => storageRef }),
45895
46003
  [ACTIONS$6.UPDATE_VIDEO_OBJECT]: assign$2(({ widgetConfig, recordingType }) => {
45896
46004
  var _a, _b;
@@ -45924,6 +46032,9 @@ const accWidgetMachine = createMachine({
45924
46032
  height: event.data.height,
45925
46033
  },
45926
46034
  })),
46035
+ [ACTIONS$6.UPDATE_UPLOADED_FALSE_COUNT]: assign$2(({ confirmUploadedFalseCount }) => ({
46036
+ confirmUploadedFalseCount: confirmUploadedFalseCount + 1,
46037
+ })),
45927
46038
  },
45928
46039
  services: {
45929
46040
  [SERVICES$1.UPDATE_VIDEO_OBJECT_CALL]: ({ widgetConfig: { video }, recordingType, speedTestResult }, event, meta) => (callback, onReceive) => {
@@ -45967,6 +46078,7 @@ const accWidgetMachine = createMachine({
45967
46078
  [GUARDS$3.IS_RECORDER_READY]: ({ recorderRef }) => (recorderRef === null || recorderRef === void 0 ? void 0 : recorderRef.getSnapshot().value) === STATES$6.IDLE,
45968
46079
  [GUARDS$3.IS_ASSESSMENT_QUESTION]: ({ questions, currentQuestion }) => !!questions[currentQuestion - 1].answerType && questions[currentQuestion - 1].answerType !== ANSWER_TYPES.VIDEO,
45969
46080
  [GUARDS$3.IS_TIMES_UP]: (_, event) => !!event.data.isTimesUp,
46081
+ [GUARDS$3.SHOULD_TRY_TO_CONFIRM]: ({ confirmUploadedFalseCount }) => confirmUploadedFalseCount <= MAX_CONFIRM_ATTEMPTS,
45970
46082
  },
45971
46083
  });
45972
46084
 
@@ -48489,10 +48601,25 @@ const Main = ({ widgetConfig, setShouldShowWaterMark, myinterviewRef, isWidgetMi
48489
48601
  useEffect(() => {
48490
48602
  setShouldShowWaterMark(!!(company === null || company === void 0 ? void 0 : company.shouldShowWaterMark));
48491
48603
  }, [company === null || company === void 0 ? void 0 : company.shouldShowWaterMark]);
48604
+ const _onFinish = () => __awaiter(void 0, void 0, void 0, function* () { var _a, _b; return (_b = (_a = widgetConfig.config).onFinish) === null || _b === void 0 ? void 0 : _b.call(_a, { redirectUrl: candidate.redirectUrl, video_id: (video === null || video === void 0 ? void 0 : video.video_id) || '' }); });
48492
48605
  useEffect(() => {
48493
- var _a, _b;
48494
48606
  if (machine.done) {
48495
- (_b = (_a = widgetConfig.config).onFinish) === null || _b === void 0 ? void 0 : _b.call(_a, { redirectUrl: candidate.redirectUrl, video_id: (video === null || video === void 0 ? void 0 : video.video_id) || '' });
48607
+ if (widgetConfig.config.onFinish) {
48608
+ _onFinish().then(() => {
48609
+ emitTrackEvent({ eventType: EVENT_TYPES.ON_FINISH_SUCCEED });
48610
+ }).catch((err) => {
48611
+ var _a;
48612
+ let errorMessage = '';
48613
+ try {
48614
+ errorMessage = (err === null || err === void 0 ? void 0 : err.message) || (err === null || err === void 0 ? void 0 : err.msg) || ((_a = err === null || err === void 0 ? void 0 : err.data) === null || _a === void 0 ? void 0 : _a.message);
48615
+ }
48616
+ catch (_b) {
48617
+ //
48618
+ }
48619
+ emitTrackEvent({ eventType: EVENT_TYPES.ON_FINISH_FAILED, extraData: { errorMessage } });
48620
+ throw err;
48621
+ });
48622
+ }
48496
48623
  }
48497
48624
  }, [machine.done]);
48498
48625
  useEffect(() => {
@@ -48508,11 +48635,16 @@ const Main = ({ widgetConfig, setShouldShowWaterMark, myinterviewRef, isWidgetMi
48508
48635
  });
48509
48636
  }
48510
48637
  }, [candidate, job === null || job === void 0 ? void 0 : job.language]);
48638
+ const setBackgroundOpacity = () => {
48639
+ var _a;
48640
+ (_a = myinterviewRef === null || myinterviewRef === void 0 ? void 0 : myinterviewRef.current) === null || _a === void 0 ? void 0 : _a.style.setProperty('--myinterview-background-opacity', isLoading || isErrorState ? '0' : '1');
48641
+ };
48511
48642
  useEffect(() => {
48512
48643
  var _a, _b;
48513
48644
  if (isErrorState && (error === null || error === void 0 ? void 0 : error.statusCode) === 400) {
48514
48645
  (_b = (_a = widgetConfig.config).onError) === null || _b === void 0 ? void 0 : _b.call(_a, { messageType: 'applied' });
48515
48646
  }
48647
+ setBackgroundOpacity();
48516
48648
  }, [isErrorState]);
48517
48649
  const isResumed = useMemo(() => { var _a, _b; return !!((_b = (_a = widgetConfig.video) === null || _a === void 0 ? void 0 : _a.videos) === null || _b === void 0 ? void 0 : _b.some((v) => v.uploaded)); }, [widgetConfig.video]);
48518
48650
  const handleScroll = (e) => {
@@ -48522,8 +48654,7 @@ const Main = ({ widgetConfig, setShouldShowWaterMark, myinterviewRef, isWidgetMi
48522
48654
  (_b = viewsRef === null || viewsRef === void 0 ? void 0 : viewsRef.current) === null || _b === void 0 ? void 0 : _b.style.setProperty('--myinterview-widget-practice-opacity', scrollTop > 10 ? '0' : '1');
48523
48655
  };
48524
48656
  useEffect(() => {
48525
- var _a;
48526
- (_a = myinterviewRef === null || myinterviewRef === void 0 ? void 0 : myinterviewRef.current) === null || _a === void 0 ? void 0 : _a.style.setProperty('--myinterview-background-opacity', isLoading || isErrorState ? '0' : '1');
48657
+ setBackgroundOpacity();
48527
48658
  }, [isLoading]);
48528
48659
  const onRetry = () => {
48529
48660
  send(EVENTS$5.RETRY);
@@ -48721,15 +48852,15 @@ const Widget = ({ candidate, job, video, config, disabled = false, buttonText =
48721
48852
  revertBodyStyling();
48722
48853
  setIsWidgetOpen(false);
48723
48854
  };
48724
- const onInterviewCompleted = (data) => {
48855
+ const onInterviewCompleted = (data) => __awaiter(void 0, void 0, void 0, function* () {
48725
48856
  var _a;
48726
- (_a = config.onFinish) === null || _a === void 0 ? void 0 : _a.call(config, data);
48727
48857
  onCloseWidget();
48728
- };
48858
+ yield ((_a = config.onFinish) === null || _a === void 0 ? void 0 : _a.call(config, data));
48859
+ });
48729
48860
  const onError = (data) => {
48730
48861
  var _a;
48731
- (_a = config.onError) === null || _a === void 0 ? void 0 : _a.call(config, data);
48732
48862
  onCloseWidget();
48863
+ (_a = config.onError) === null || _a === void 0 ? void 0 : _a.call(config, data);
48733
48864
  };
48734
48865
  const openWidget = () => {
48735
48866
  var _a;