@alipay/ams-checkout 0.0.1700804278-dev.1 → 0.0.1701850681-dev.0

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.
@@ -15,13 +15,12 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
15
15
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
16
16
  */
17
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
- import { marmotMap } from "../../config/index";
18
+ // import { marmotMap } from '../../config/index';
19
19
  import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID } from "../../constant";
20
- import { queryPaymentInfo } from "../../service";
21
- import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, RedirectType, renderDisplayTypeEnum, SecuritySceneEnum, targetEnum } from "../../types";
20
+ import { queryPaymentInfo, submitPayInfo } from "../../service";
21
+ import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, RedirectType, renderDisplayTypeEnum, targetEnum } from "../../types";
22
22
  import { getType, isJsonString, isPC } from "../../util";
23
23
  import { isLocalMock } from "../../util/mock";
24
- import { getApdidToken, getAppname, getSecurityHost, initSecuritySDK } from "../../util/security";
25
24
  import { createIframe, getAppDomain, getIframeUrl } from "./cashierApp";
26
25
  import { addInlineLoading, createInlineBaseElement } from "./component.inline.style";
27
26
  import { addPopupLoading, createBaseElement, createMockup, createRetentionPopup, handleDeclareInfo as _handleDeclareInfo, hideRetentionPopup, removeRetentionPopup as _removeRetentionPopup } from "./component.popup.style";
@@ -36,20 +35,21 @@ var ComponentApp = /*#__PURE__*/function () {
36
35
  _defineProperty(this, "_performanceData", []);
37
36
  _defineProperty(this, "_loadAppPromiseResolve", null);
38
37
  _defineProperty(this, "_isInitComponent", void 0);
39
- _defineProperty(this, "_threedData", void 0);
40
- _defineProperty(this, "popupWindow", void 0);
38
+ _defineProperty(this, "_globalData", void 0);
39
+ _defineProperty(this, "popupApp", void 0);
41
40
  _defineProperty(this, "appDomain", void 0);
42
41
  _defineProperty(this, "createIframeNode", void 0);
43
42
  _defineProperty(this, "_selector", void 0);
44
43
  _defineProperty(this, "_appVersion", void 0);
45
44
  _defineProperty(this, "_isRetention", void 0);
46
45
  _defineProperty(this, "_actionQueryPromise", null);
46
+ _defineProperty(this, "_actionSubmitPromise", null);
47
47
  _defineProperty(this, "_renderParams", null);
48
48
  _defineProperty(this, "_componentSign", componentSignEnum.NONE);
49
49
  _defineProperty(this, "_appLocationSearch", void 0);
50
50
  _defineProperty(this, "_renderDisplayType", renderDisplayTypeEnum.popup);
51
51
  _defineProperty(this, "_multipleCallbackEvents", void 0);
52
- this._appVersion = '1.6.0';
52
+ this._appVersion = '1.7.0';
53
53
  this._isInitComponent = false;
54
54
  this._selector = "#".concat(COMPONENT_SECTION_ID);
55
55
  this.createIframeNode = function () {
@@ -62,6 +62,7 @@ var ComponentApp = /*#__PURE__*/function () {
62
62
  key: 'sdk_init',
63
63
  value: Date.now()
64
64
  });
65
+ this._globalData = new Map();
65
66
  }
66
67
 
67
68
  /**
@@ -86,7 +87,6 @@ var ComponentApp = /*#__PURE__*/function () {
86
87
  key: "initLoggerMeta",
87
88
  value: function initLoggerMeta() {
88
89
  var _this$_renderParams, _paymentSessionMetaDa;
89
- console.log('this._renderParams', JSON.stringify(this._renderParams), null, 3);
90
90
  var paymentSessionMetaData = (_this$_renderParams = this._renderParams) === null || _this$_renderParams === void 0 ? void 0 : _this$_renderParams.paymentSessionMetaData;
91
91
  var paymentSessionConfig = paymentSessionMetaData.paymentSessionConfig;
92
92
  this.AMSSDK.logger.setMedta({
@@ -115,39 +115,39 @@ var ComponentApp = /*#__PURE__*/function () {
115
115
  this.createIframeNode = renderFunc;
116
116
  }
117
117
  }, {
118
- key: "initAPSecurity",
119
- value: function initAPSecurity() {
118
+ key: "initSecurity",
119
+ value: function initSecurity() {
120
120
  var _this$_renderParams2,
121
121
  _this = this;
122
- if (componentSignEnum.CASHIER_PAYMENT_CARD !== this._componentSign) {
123
- return;
124
- }
125
- var securityConfig = (_this$_renderParams2 = this._renderParams) === null || _this$_renderParams2 === void 0 || (_this$_renderParams2 = _this$_renderParams2.paymentSessionMetaData) === null || _this$_renderParams2 === void 0 ? void 0 : _this$_renderParams2.securityConfig;
126
- if (!securityConfig) {
127
- return;
128
- }
129
- var appName = securityConfig === null || securityConfig === void 0 ? void 0 : securityConfig.appName;
130
- var h5gateway = securityConfig === null || securityConfig === void 0 ? void 0 : securityConfig.h5gateway;
131
-
132
- // if merchant have init securitySDK and same as service paymentSessionMetaData, no need init again
133
- if (this.AMSSDK.securityConfig) {
134
- if (appName === getAppname(this.AMSSDK.securityConfig.scene) && h5gateway === getSecurityHost(this.AMSSDK.securityConfig.region)) {
135
- return;
136
- }
122
+ var product = (_this$_renderParams2 = this._renderParams) === null || _this$_renderParams2 === void 0 || (_this$_renderParams2 = _this$_renderParams2.paymentSessionMetaData) === null || _this$_renderParams2 === void 0 || (_this$_renderParams2 = _this$_renderParams2.paymentSessionConfig) === null || _this$_renderParams2 === void 0 ? void 0 : _this$_renderParams2.productScene;
123
+ if (componentSignEnum.CASHIER_PAYMENT_BANK === this._componentSign) {
124
+ this.AMSSDK.logger.logInfo({
125
+ title: 'sdk_event_security_unneeded_scenarios'
126
+ }, {
127
+ product: product
128
+ });
137
129
  }
138
- this.AMSSDK.logger.logInfo({
139
- title: 'sdk_event_securitySdkInit'
130
+ var securitySDK = this.AMSSDK._getSecuritySDKByProductScene({
131
+ product: product
140
132
  });
141
- initSecuritySDK(appName, h5gateway, function () {
142
- _this.AMSSDK.logger.logInfo({
143
- title: 'sdk_event_securitySdkInitSuccess'
133
+ if (!securitySDK) {
134
+ this.AMSSDK.logger.logInfo({
135
+ title: 'sdk_event_securitySdkInit'
144
136
  });
145
- }, function () {
146
- // TODO Distinguishing Call Scenarios of Security SDK Failures
147
- _this.AMSSDK.logger.logError({
148
- title: 'sdk_error_securitySdkInitFailed'
137
+ this.AMSSDK._newSecuritySDKByScene({
138
+ product: product
139
+ }, function () {
140
+ _this.AMSSDK.logger.logInfo({
141
+ title: 'sdk_event_securitySdkInitSuccess'
142
+ });
143
+ }, function () {
144
+ _this.AMSSDK.logger.logError({
145
+ title: 'sdk_error_securitySdkInitFailed'
146
+ }, {
147
+ sign: 'SDK internal initialization'
148
+ });
149
149
  });
150
- });
150
+ }
151
151
  }
152
152
  }, {
153
153
  key: "logDeviceId",
@@ -173,23 +173,47 @@ var ComponentApp = /*#__PURE__*/function () {
173
173
  key: "getDeviceIdAndLog",
174
174
  value: function getDeviceIdAndLog() {
175
175
  var _this2 = this;
176
+ var deviceIdParameter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
177
+ var isPolling = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
176
178
  return new Promise(function (resolve) {
177
179
  // To avoid rendering being blocked, move the logic to the next event loop for processing
178
180
  setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
179
181
  var _this2$_renderParams;
180
- var securityConfig, getDeviceIdStartTime, deviceId;
182
+ var productScene, getDeviceIdStartTime, securitySDK, deviceId;
181
183
  return _regeneratorRuntime().wrap(function _callee$(_context) {
182
184
  while (1) switch (_context.prev = _context.next) {
183
185
  case 0:
184
- securityConfig = (_this2$_renderParams = _this2._renderParams) === null || _this2$_renderParams === void 0 || (_this2$_renderParams = _this2$_renderParams.paymentSessionMetaData) === null || _this2$_renderParams === void 0 ? void 0 : _this2$_renderParams.securityConfig;
186
+ productScene = (_this2$_renderParams = _this2._renderParams) === null || _this2$_renderParams === void 0 || (_this2$_renderParams = _this2$_renderParams.paymentSessionMetaData) === null || _this2$_renderParams === void 0 || (_this2$_renderParams = _this2$_renderParams.paymentSessionConfig) === null || _this2$_renderParams === void 0 ? void 0 : _this2$_renderParams.productScene;
185
187
  getDeviceIdStartTime = Date.now();
186
- _context.next = 4;
187
- return getApdidToken(getAppname(SecuritySceneEnum.CARD), securityConfig);
188
- case 4:
189
- deviceId = _context.sent;
188
+ securitySDK = _this2.AMSSDK._getSecuritySDKByProductScene({
189
+ product: (deviceIdParameter === null || deviceIdParameter === void 0 ? void 0 : deviceIdParameter.productScene) || productScene
190
+ });
191
+ deviceId = '';
192
+ if (!securitySDK) {
193
+ _context.next = 16;
194
+ break;
195
+ }
196
+ if (!(isPolling && parseInt(deviceIdParameter === null || deviceIdParameter === void 0 ? void 0 : deviceIdParameter.tokenCollectTime) > 0)) {
197
+ _context.next = 11;
198
+ break;
199
+ }
200
+ _context.next = 8;
201
+ return securitySDK.pollingGetApdidToken(deviceIdParameter);
202
+ case 8:
203
+ _context.t0 = _context.sent;
204
+ _context.next = 14;
205
+ break;
206
+ case 11:
207
+ _context.next = 13;
208
+ return securitySDK.getApdidToken();
209
+ case 13:
210
+ _context.t0 = _context.sent;
211
+ case 14:
212
+ deviceId = _context.t0;
190
213
  _this2.logDeviceId(deviceId, getDeviceIdStartTime);
214
+ case 16:
191
215
  resolve(deviceId);
192
- case 7:
216
+ case 17:
193
217
  case "end":
194
218
  return _context.stop();
195
219
  }
@@ -204,18 +228,20 @@ var ComponentApp = /*#__PURE__*/function () {
204
228
  }, {
205
229
  key: "appendIframeNodes",
206
230
  value: function appendIframeNodes(componentSign, renderParams) {
207
- var _this3 = this;
231
+ var _renderParams,
232
+ _this3 = this;
208
233
  if (this._isInitComponent) {
209
234
  this.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);
210
235
  return Promise.reject(ERRORMESSAGE.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);
211
236
  }
237
+ renderParams = this.setParameterDefaultValues(componentSign, renderParams);
212
238
  this._isInitComponent = true;
213
239
  this._renderParams = renderParams;
214
240
  this._componentSign = componentSign;
215
- if (renderParams !== null && renderParams !== void 0 && renderParams.selector) this._selector = renderParams.selector;
241
+ if ((_renderParams = renderParams) !== null && _renderParams !== void 0 && _renderParams.selector) this._selector = renderParams.selector;
216
242
  this._renderDisplayType = renderParams.renderDisplayType;
217
243
  var insertedNode = this._renderDisplayType === renderDisplayTypeEnum.inline ? "#".concat(COMPONENT_CONTAINER_ID) : this._selector;
218
- this.initAPSecurity();
244
+ this.initSecurity();
219
245
  this.initLoggerMeta();
220
246
  this._performanceData.push({
221
247
  key: 'sdk_create_component',
@@ -236,17 +262,27 @@ var ComponentApp = /*#__PURE__*/function () {
236
262
  this.renderPopupLoading(renderParams);
237
263
  }
238
264
  this.createApp(renderParams);
239
- return Promise.all([this.createActionQueryPromise(), this.createIframeNode(this, insertedNode, this._renderDisplayType), this._createLoadAppPromise()]).then(function () {
240
- _this3.AMSSDK.logger.logInfo({
241
- title: 'sdk_event_successfully_created_app_process'
242
- }).send();
265
+ return Promise.all([this.createActionQueryPromise(), this.createSubmitPromise(), this.createIframeNode(this, insertedNode, this._renderDisplayType), this._createLoadAppPromise()]).then(function () {
243
266
  return Promise.resolve();
244
267
  }).catch(function (error) {
268
+ _this3.AMSSDK.logger.logError({
269
+ title: 'sdk_error_created_app_process_failed'
270
+ }).send();
245
271
  _this3._isInitComponent = false;
246
272
  _this3.cleanContainer();
247
273
  return Promise.reject(error);
248
274
  });
249
275
  }
276
+ }, {
277
+ key: "setParameterDefaultValues",
278
+ value: function setParameterDefaultValues(componentSign, renderParams) {
279
+ var newParams = Object.assign({}, renderParams);
280
+ if (componentSign === componentSignEnum.VAULTING_CARD) {
281
+ var _newParams$notRedirec;
282
+ newParams.notRedirectAfterComplete = (_newParams$notRedirec = newParams === null || newParams === void 0 ? void 0 : newParams.notRedirectAfterComplete) !== null && _newParams$notRedirec !== void 0 ? _newParams$notRedirec : true;
283
+ }
284
+ return newParams;
285
+ }
250
286
  }, {
251
287
  key: "renderInlineLoading",
252
288
  value: function renderInlineLoading(renderParams, selector) {
@@ -268,18 +304,15 @@ var ComponentApp = /*#__PURE__*/function () {
268
304
  }
269
305
  }, {
270
306
  key: "_createLoadAppPromise",
271
- value: function _createLoadAppPromise() {
307
+ value: function _createLoadAppPromise(loadTimeLimit) {
272
308
  var _this4 = this;
273
309
  return new Promise(function (resolve, reject) {
274
310
  _this4._loadAppPromiseResolve = resolve;
275
311
  setTimeout(function () {
276
312
  reject(ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
277
- }, LOADTIME_LIMIT);
313
+ }, loadTimeLimit !== null && loadTimeLimit !== void 0 ? loadTimeLimit : LOADTIME_LIMIT);
278
314
  }).catch(function (error) {
279
- _this4.dispatchToSDK(EVENT.error.name, {
280
- code: ERRORMESSAGE.CREATECOMPONENT_ERROR.code,
281
- message: ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT.message
282
- });
315
+ _this4.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
283
316
  _this4.AMSSDK.logger.logError({
284
317
  title: 'sdk_error_web_app_timeout'
285
318
  }).send();
@@ -303,7 +336,7 @@ var ComponentApp = /*#__PURE__*/function () {
303
336
  this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
304
337
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
305
338
  var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4;
306
- var envInfo, params, securityConfig, _this5$_renderParams5, extendInfo, info, _this5$_renderParams6, _ref3, _ref3$productSceneVer, productSceneVersion, _ref3$productScene, productScene, _ref4, _ref4$action, _ref4$action2, _ref4$action2$autoDeb, autoDebitWithToken, _this5$_renderParams7, _action$web, _action$wap, action, signType;
339
+ var envInfo, params, _this5$_renderParams5, _ref3, _ref3$productSceneVer, productSceneVersion, _ref3$productScene, productScene, _ref4, _ref4$action, _ref4$action2, _ref4$action2$autoDeb, autoDebitWithToken, _this5$_renderParams6, _action$web, _action$wap, action, signType;
307
340
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
308
341
  while (1) switch (_context2.prev = _context2.next) {
309
342
  case 0:
@@ -316,74 +349,80 @@ var ComponentApp = /*#__PURE__*/function () {
316
349
  notRedirectAfterComplete: ((_this5$_renderParams3 = _this5._renderParams) === null || _this5$_renderParams3 === void 0 ? void 0 : _this5$_renderParams3.notRedirectAfterComplete) === true
317
350
  };
318
351
  /**
319
- * @description card
352
+ * @description Simulated or unnecessary scenarios
320
353
  */
321
- if (componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign) {
322
- params.paymentMethodType = 'CARD';
323
- }
324
- securityConfig = (_this5$_renderParams4 = _this5._renderParams) === null || _this5$_renderParams4 === void 0 || (_this5$_renderParams4 = _this5$_renderParams4.paymentSessionMetaData) === null || _this5$_renderParams4 === void 0 ? void 0 : _this5$_renderParams4.securityConfig;
325
- if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign && securityConfig)) {
326
- _context2.next = 11;
354
+ if (!(isLocalMock() || (_this5$_renderParams4 = _this5._renderParams) !== null && _this5$_renderParams4 !== void 0 && (_this5$_renderParams4 = _this5$_renderParams4.paymentSessionMetaData) !== null && _this5$_renderParams4 !== void 0 && (_this5$_renderParams4 = _this5$_renderParams4.action) !== null && _this5$_renderParams4 !== void 0 && _this5$_renderParams4.skipSdkQuery)) {
355
+ _context2.next = 4;
327
356
  break;
328
357
  }
329
- extendInfo = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 || (_this5$_renderParams5 = _this5$_renderParams5.paymentSessionMetaData) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.extendInfo) || '{}';
330
- info = JSON.parse(extendInfo);
331
- if (!((info === null || info === void 0 ? void 0 : info.cardTokenPay) !== 'false')) {
332
- _context2.next = 11;
358
+ return _context2.abrupt("return", resolve({
359
+ message: 'sdk no need to make query request',
360
+ success: true
361
+ }));
362
+ case 4:
363
+ if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
364
+ _context2.next = 9;
333
365
  break;
334
366
  }
335
- _context2.next = 10;
367
+ params.paymentMethodType = 'CARD';
368
+ _context2.next = 8;
336
369
  return _this5.getDeviceIdAndLog();
337
- case 10:
370
+ case 8:
338
371
  envInfo.deviceId = _context2.sent;
339
- case 11:
372
+ case 9:
340
373
  if (!(componentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
341
- _context2.next = 16;
374
+ _context2.next = 17;
342
375
  break;
343
376
  }
344
377
  _ref3 = params.paymentSessionConfig || {}, _ref3$productSceneVer = _ref3.productSceneVersion, productSceneVersion = _ref3$productSceneVer === void 0 ? '' : _ref3$productSceneVer, _ref3$productScene = _ref3.productScene, productScene = _ref3$productScene === void 0 ? '' : _ref3$productScene;
345
- _ref4 = ((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.paymentSessionMetaData) || {}, _ref4$action = _ref4.action, _ref4$action2 = _ref4$action === void 0 ? {} : _ref4$action, _ref4$action2$autoDeb = _ref4$action2.autoDebitWithToken, autoDebitWithToken = _ref4$action2$autoDeb === void 0 ? false : _ref4$action2$autoDeb;
378
+ _ref4 = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.paymentSessionMetaData) || {}, _ref4$action = _ref4.action, _ref4$action2 = _ref4$action === void 0 ? {} : _ref4$action, _ref4$action2$autoDeb = _ref4$action2.autoDebitWithToken, autoDebitWithToken = _ref4$action2$autoDeb === void 0 ? false : _ref4$action2$autoDeb;
346
379
  if (!(productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken)) {
347
- _context2.next = 16;
380
+ _context2.next = 14;
348
381
  break;
349
382
  }
350
383
  return _context2.abrupt("return", resolve({
351
384
  message: 'sdk no need to make query request',
352
385
  success: true
353
386
  }));
387
+ case 14:
388
+ _context2.next = 16;
389
+ return _this5.getDeviceIdAndLog();
354
390
  case 16:
391
+ envInfo.deviceId = _context2.sent;
392
+ case 17:
355
393
  if (!(componentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
356
- _context2.next = 23;
394
+ _context2.next = 27;
357
395
  break;
358
396
  }
359
- action = ((_this5$_renderParams7 = _this5._renderParams) === null || _this5$_renderParams7 === void 0 || (_this5$_renderParams7 = _this5$_renderParams7.paymentSessionMetaData) === null || _this5$_renderParams7 === void 0 ? void 0 : _this5$_renderParams7.action) || {};
397
+ action = ((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 || (_this5$_renderParams6 = _this5$_renderParams6.paymentSessionMetaData) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.action) || {};
360
398
  signType = isPC() ? action === null || action === void 0 || (_action$web = action.web) === null || _action$web === void 0 ? void 0 : _action$web.signType : action === null || action === void 0 || (_action$wap = action.wap) === null || _action$wap === void 0 ? void 0 : _action$wap.signType;
361
399
  if (!(signType === 'SMS')) {
362
- _context2.next = 21;
400
+ _context2.next = 22;
363
401
  break;
364
402
  }
365
403
  return _context2.abrupt("return", resolve({
366
404
  message: 'sdk no need to make query request',
367
405
  success: true
368
406
  }));
369
- case 21:
407
+ case 22:
370
408
  if (!(!signType || signType !== 'REDIRECT')) {
371
- _context2.next = 23;
409
+ _context2.next = 24;
372
410
  break;
373
411
  }
374
412
  return _context2.abrupt("return", resolve({
375
413
  success: false
376
414
  }));
377
- case 23:
378
- if (!isLocalMock()) {
379
- _context2.next = 25;
380
- break;
381
- }
382
- return _context2.abrupt("return", resolve({
383
- message: 'sdk no need to make query request',
384
- success: true
385
- }));
386
- case 25:
415
+ case 24:
416
+ _context2.next = 26;
417
+ return _this5.getDeviceIdAndLog();
418
+ case 26:
419
+ envInfo.deviceId = _context2.sent;
420
+ case 27:
421
+ _this5.AMSSDK.logger.logInfo({
422
+ title: 'sdk_event_sdkQuery'
423
+ }, {
424
+ paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
425
+ }).send();
387
426
  queryPaymentInfo(params, {
388
427
  env: _this5.AMSSDK.options.env.environment,
389
428
  envInfo: envInfo
@@ -398,7 +437,7 @@ var ComponentApp = /*#__PURE__*/function () {
398
437
  resolve(res);
399
438
  }
400
439
  }).catch(function (err) {
401
- if (componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign) {
440
+ if ([componentSignEnum.CASHIER_PAYMENT_CARD, componentSignEnum.VAULTING_CARD].includes(_this5._componentSign)) {
402
441
  return resolve({
403
442
  success: false
404
443
  });
@@ -407,8 +446,14 @@ var ComponentApp = /*#__PURE__*/function () {
407
446
  code: ERRORMESSAGE.CREATECOMPONENT_ERROR.code
408
447
  });
409
448
  reject(err);
449
+ }).finally(function () {
450
+ _this5.AMSSDK.logger.logInfo({
451
+ title: 'sdk_event_sdkQueryEnd'
452
+ }, {
453
+ paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
454
+ }).send();
410
455
  });
411
- case 26:
456
+ case 29:
412
457
  case "end":
413
458
  return _context2.stop();
414
459
  }
@@ -420,6 +465,90 @@ var ComponentApp = /*#__PURE__*/function () {
420
465
  }());
421
466
  return this._actionQueryPromise;
422
467
  }
468
+ }, {
469
+ key: "createSubmitPromise",
470
+ value: function createSubmitPromise() {
471
+ var _this$_renderParams3,
472
+ _this$_renderParams4,
473
+ _this6 = this;
474
+ this._performanceData.push({
475
+ key: 'sdk_submit_start',
476
+ value: Date.now()
477
+ });
478
+ var params = {
479
+ paymentSessionData: this._renderParams && ((_this$_renderParams3 = this._renderParams) === null || _this$_renderParams3 === void 0 ? void 0 : _this$_renderParams3.sessionData) || '',
480
+ paymentSessionConfig: (_this$_renderParams4 = this._renderParams) === null || _this$_renderParams4 === void 0 || (_this$_renderParams4 = _this$_renderParams4.paymentSessionMetaData) === null || _this$_renderParams4 === void 0 ? void 0 : _this$_renderParams4.paymentSessionConfig
481
+ };
482
+
483
+ // eslint-disable-next-line no-async-promise-executor
484
+ this._actionSubmitPromise = new Promise( /*#__PURE__*/function () {
485
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
486
+ var _this6$_renderParams;
487
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
488
+ while (1) switch (_context3.prev = _context3.next) {
489
+ case 0:
490
+ if (!(!((_this6$_renderParams = _this6._renderParams) !== null && _this6$_renderParams !== void 0 && (_this6$_renderParams = _this6$_renderParams.paymentSessionMetaData) !== null && _this6$_renderParams !== void 0 && (_this6$_renderParams = _this6$_renderParams.action) !== null && _this6$_renderParams !== void 0 && _this6$_renderParams.skipSdkQuery) || componentSignEnum.EASY_PAY_WALLET !== _this6._componentSign)) {
491
+ _context3.next = 2;
492
+ break;
493
+ }
494
+ return _context3.abrupt("return", resolve({
495
+ message: 'sdk no need to make submitPay request',
496
+ success: true
497
+ }));
498
+ case 2:
499
+ _this6.AMSSDK.logger.logInfo({
500
+ title: 'sdk_event_submitPay'
501
+ }, {
502
+ paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
503
+ }).send();
504
+ _context3.t0 = submitPayInfo;
505
+ _context3.t1 = params;
506
+ _context3.t2 = _this6.AMSSDK.options.env.environment;
507
+ _context3.next = 8;
508
+ return _this6.getDeviceIdAndLog();
509
+ case 8:
510
+ _context3.t3 = _context3.sent;
511
+ _context3.t4 = {
512
+ deviceId: _context3.t3
513
+ };
514
+ _context3.t5 = {
515
+ env: _context3.t2,
516
+ timeout: 15000,
517
+ envInfo: _context3.t4
518
+ };
519
+ _context3.t6 = _this6.AMSSDK.logger;
520
+ (0, _context3.t0)(_context3.t1, _context3.t5, _context3.t6).then(function (res) {
521
+ _this6._performanceData.push({
522
+ key: 'sdk_submit_end',
523
+ value: Date.now()
524
+ });
525
+ if (res !== null && res !== void 0 && res.success) {
526
+ resolve(res);
527
+ } else {
528
+ resolve(res);
529
+ }
530
+ }).catch(function () {
531
+ resolve({
532
+ success: false
533
+ });
534
+ }).finally(function () {
535
+ _this6.AMSSDK.logger.logInfo({
536
+ title: 'sdk_event_submitPayEnd'
537
+ }, {
538
+ paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
539
+ }).send();
540
+ });
541
+ case 13:
542
+ case "end":
543
+ return _context3.stop();
544
+ }
545
+ }, _callee3);
546
+ }));
547
+ return function (_x3) {
548
+ return _ref5.apply(this, arguments);
549
+ };
550
+ }());
551
+ }
423
552
  }, {
424
553
  key: "cleanElement",
425
554
  value: function cleanElement() {
@@ -534,13 +663,12 @@ var ComponentApp = /*#__PURE__*/function () {
534
663
  });
535
664
  }
536
665
  }, {
537
- key: "createPopupWindow",
538
- value: function createPopupWindow(data) {
539
- var _this$_renderParams3;
540
- this._threedData = data;
541
- var sessionData = encodeURIComponent((_this$_renderParams3 = this._renderParams) === null || _this$_renderParams3 === void 0 ? void 0 : _this$_renderParams3.sessionData);
542
- var threedPageUrl = "".concat(marmotMap[this.AMSSDK.options.env.environment], "/threedPage/index.html?scene=threedWrapperPage&sessionData=").concat(sessionData, "&").concat(this._appLocationSearch);
543
- this.popupWindow = createModal({
666
+ key: "createDialog",
667
+ value: function createDialog(data) {
668
+ var threedPageUrl = data.url.includes('?') ? "".concat(data.url, "&").concat(this._appLocationSearch) : "".concat(data.url, "?").concat(this._appLocationSearch);
669
+ this.popupApp = createModal({
670
+ widthPadding: data === null || data === void 0 ? void 0 : data.widthPadding,
671
+ heightPadding: data === null || data === void 0 ? void 0 : data.heightPadding,
544
672
  device: this.platform,
545
673
  url: threedPageUrl
546
674
  });
@@ -548,19 +676,19 @@ var ComponentApp = /*#__PURE__*/function () {
548
676
  }, {
549
677
  key: "getDeviceIdAndCallback",
550
678
  value: function () {
551
- var _getDeviceIdAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(eventContext) {
679
+ var _getDeviceIdAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(eventContext) {
552
680
  var deviceId;
553
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
554
- while (1) switch (_context3.prev = _context3.next) {
681
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
682
+ while (1) switch (_context4.prev = _context4.next) {
555
683
  case 0:
556
684
  if (!(eventContext !== null && eventContext !== void 0 && eventContext.eventCallbackId)) {
557
- _context3.next = 5;
685
+ _context4.next = 5;
558
686
  break;
559
687
  }
560
- _context3.next = 3;
561
- return this.getDeviceIdAndLog();
688
+ _context4.next = 3;
689
+ return this.getDeviceIdAndLog(eventContext === null || eventContext === void 0 ? void 0 : eventContext.data, true);
562
690
  case 3:
563
- deviceId = _context3.sent;
691
+ deviceId = _context4.sent;
564
692
  this.dispatchToApp({
565
693
  context: {
566
694
  event: 'appEventCallback',
@@ -572,15 +700,44 @@ var ComponentApp = /*#__PURE__*/function () {
572
700
  });
573
701
  case 5:
574
702
  case "end":
575
- return _context3.stop();
703
+ return _context4.stop();
576
704
  }
577
- }, _callee3, this);
705
+ }, _callee4, this);
578
706
  }));
579
- function getDeviceIdAndCallback(_x3) {
707
+ function getDeviceIdAndCallback(_x4) {
580
708
  return _getDeviceIdAndCallback.apply(this, arguments);
581
709
  }
582
710
  return getDeviceIdAndCallback;
583
711
  }()
712
+ }, {
713
+ key: "returnDataAndCallback",
714
+ value: function () {
715
+ var _returnDataAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(eventContext) {
716
+ var _eventContext$data, targetData;
717
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
718
+ while (1) switch (_context5.prev = _context5.next) {
719
+ case 0:
720
+ if (eventContext !== null && eventContext !== void 0 && eventContext.eventCallbackId) {
721
+ targetData = this._globalData.get((_eventContext$data = eventContext.data) === null || _eventContext$data === void 0 ? void 0 : _eventContext$data.dataKey);
722
+ this.dispatchToApp({
723
+ context: {
724
+ event: 'appEventCallback',
725
+ eventCallbackId: eventContext === null || eventContext === void 0 ? void 0 : eventContext.eventCallbackId,
726
+ data: targetData
727
+ }
728
+ });
729
+ }
730
+ case 1:
731
+ case "end":
732
+ return _context5.stop();
733
+ }
734
+ }, _callee5, this);
735
+ }));
736
+ function returnDataAndCallback(_x5) {
737
+ return _returnDataAndCallback.apply(this, arguments);
738
+ }
739
+ return returnDataAndCallback;
740
+ }()
584
741
  /**
585
742
  * @description Initialize subscription iframe message
586
743
  */
@@ -606,7 +763,9 @@ var ComponentApp = /*#__PURE__*/function () {
606
763
  }, {
607
764
  key: "_handleAppMessage",
608
765
  value: function _handleAppMessage(data) {
609
- var eventKeyMap = [EVENT.launch.name, EVENT.redirect.name, EVENT.sizeChanged.name, EVENT.log.name, EVENT.close.name, EVENT.error.name, EVENT.eventCallback.name, EVENT.submitForm.name, EVENT.showCloseButton.name, EVENT.hideCloseButton.name, EVENT.setAllowRetention.name, EVENT.declareCheckoutInfo.name, EVENT.showPopup.name, EVENT.dismissLoading.name, EVENT.popupWindow.name, EVENT.threedReady.name, EVENT.closePopup.name, EVENT.getDeviceId.name, EVENT.declareEventCallbackInfo.name];
766
+ var eventKeyMap = Object.keys(EVENT).map(function (key) {
767
+ return EVENT[key].name;
768
+ });
610
769
  if (!eventKeyMap.includes(data.context.event)) {
611
770
  return;
612
771
  }
@@ -614,29 +773,38 @@ var ComponentApp = /*#__PURE__*/function () {
614
773
  this.getDeviceIdAndCallback(data.context);
615
774
  return;
616
775
  }
617
- if (data.context.event === EVENT.closePopup.name) {
776
+ if (data.context.event === EVENT.popWindow.name) {
618
777
  destroyModal();
619
778
  return;
620
779
  }
621
- if (data.context.event === EVENT.threedReady.name) {
622
- this.dispatchToApp({
623
- context: {
624
- event: 'renderThreedPage',
625
- data: this._threedData
626
- }
627
- }, this.popupWindow);
780
+ if (data.context.event === EVENT.getGlobalData.name) {
781
+ this.returnDataAndCallback(data.context);
628
782
  return;
629
783
  }
630
- if (data.context.event === EVENT.popupWindow.name) {
784
+ if (data.context.event === EVENT.setGlobalData.name) {
785
+ var _data$context$data, _data$context$data2;
786
+ this._globalData.set((_data$context$data = data.context.data) === null || _data$context$data === void 0 ? void 0 : _data$context$data.dataKey, (_data$context$data2 = data.context.data) === null || _data$context$data2 === void 0 ? void 0 : _data$context$data2.data);
787
+ return;
788
+ }
789
+ if (data.context.event === EVENT.startDialog.name) {
631
790
  var _data$context;
632
- this.createPopupWindow((_data$context = data.context) === null || _data$context === void 0 ? void 0 : _data$context.data);
791
+ this.createDialog((_data$context = data.context) === null || _data$context === void 0 ? void 0 : _data$context.data);
792
+ return;
793
+ }
794
+ if (data.context.event === EVENT.sendMuitiAppEventToSdk.name) {
795
+ this.dispatchToApp({
796
+ context: {
797
+ event: 'receiveMuitiAppFromSdk',
798
+ data: data.context.data
799
+ }
800
+ });
633
801
  return;
634
802
  }
635
803
  if (data.context.event === EVENT.dismissLoading.name) {
636
- var _data$context$data;
804
+ var _data$context$data3;
637
805
  this.dispatchToSDK(EVENT.eventCallback.name, {
638
806
  code: 'SDK_END_OF_LOADING',
639
- message: ((_data$context$data = data.context.data) === null || _data$context$data === void 0 ? void 0 : _data$context$data.message) || ''
807
+ message: ((_data$context$data3 = data.context.data) === null || _data$context$data3 === void 0 ? void 0 : _data$context$data3.message) || ''
640
808
  });
641
809
  return;
642
810
  }
@@ -695,8 +863,8 @@ var ComponentApp = /*#__PURE__*/function () {
695
863
  }, {
696
864
  key: "handleSizeChanged",
697
865
  value: function handleSizeChanged(data) {
698
- var _data$context$data2;
699
- if (((_data$context$data2 = data.context.data) === null || _data$context$data2 === void 0 ? void 0 : _data$context$data2.height) <= 1) return;
866
+ var _data$context$data4;
867
+ if (((_data$context$data4 = data.context.data) === null || _data$context$data4 === void 0 ? void 0 : _data$context$data4.height) <= 1) return;
700
868
  var cashier = document.getElementById(COMPONENT_CONTAINER_ID);
701
869
  cashier.style.height = "".concat(data.context.data.height, "px");
702
870
  if (this._renderDisplayType === renderDisplayTypeEnum.popup) {
@@ -745,7 +913,7 @@ var ComponentApp = /*#__PURE__*/function () {
745
913
  }, {
746
914
  key: "handleRedirect",
747
915
  value: function handleRedirect(data) {
748
- var _this6 = this;
916
+ var _this7 = this;
749
917
  var _data = typeof data === 'string' ? {
750
918
  normalUrl: data
751
919
  } : {
@@ -760,11 +928,11 @@ var ComponentApp = /*#__PURE__*/function () {
760
928
  redirectInfo: JSON.stringify(_data)
761
929
  }).send();
762
930
  var successCallback = function successCallback(type, url) {
763
- _this6.dispatchToSDK(EVENT.eventCallback.name, {
931
+ _this7.dispatchToSDK(EVENT.eventCallback.name, {
764
932
  code: eventCodeEnum.SDK_CALL_URL_SUCCESS,
765
933
  message: "Successfully opened the app,".concat(type, ": ").concat(url)
766
934
  });
767
- _this6.AMSSDK.logger.logInfo({
935
+ _this7.AMSSDK.logger.logInfo({
768
936
  title: 'sdk_event_call_url_success'
769
937
  }, {
770
938
  redirectInfo: JSON.stringify(_data),
@@ -773,11 +941,11 @@ var ComponentApp = /*#__PURE__*/function () {
773
941
  }).send();
774
942
  };
775
943
  var failCallback = function failCallback(type, url) {
776
- _this6.dispatchToSDK(EVENT.eventCallback.name, {
777
- code: eventCodeEnum.SDK_CALL_URL_SUCCESS,
944
+ _this7.dispatchToSDK(EVENT.eventCallback.name, {
945
+ code: eventCodeEnum.SDK_CALL_URL_ERROR,
778
946
  message: "Failed to open app,applinkUrl: ".concat(_data === null || _data === void 0 ? void 0 : _data.applinkUrl, " schemeUrl: ").concat(_data === null || _data === void 0 ? void 0 : _data.schemeUrl, " normalUrl: ").concat(_data === null || _data === void 0 ? void 0 : _data.normalUrl)
779
947
  });
780
- _this6.AMSSDK.logger.logInfo({
948
+ _this7.AMSSDK.logger.logInfo({
781
949
  title: 'sdk_error_call_url_failed'
782
950
  }, {
783
951
  redirectInfo: JSON.stringify(_data),
@@ -800,14 +968,14 @@ var ComponentApp = /*#__PURE__*/function () {
800
968
  successCallback(RedirectType.ApplinkUrl, _data === null || _data === void 0 ? void 0 : _data.applinkUrl);
801
969
  }).catch(function () {
802
970
  failCallback(RedirectType.ApplinkUrl, _data === null || _data === void 0 ? void 0 : _data.applinkUrl);
803
- return _this6.AMSSDK._redirect({
971
+ return _this7.AMSSDK._redirect({
804
972
  schemeUrl: _data === null || _data === void 0 ? void 0 : _data.schemeUrl
805
973
  });
806
974
  }).then(function () {
807
975
  successCallback(RedirectType.SchemeUrl, _data === null || _data === void 0 ? void 0 : _data.schemeUrl);
808
976
  }).catch(function () {
809
977
  failCallback(RedirectType.SchemeUrl, _data === null || _data === void 0 ? void 0 : _data.schemeUrl);
810
- return _this6.AMSSDK._redirect({
978
+ return _this7.AMSSDK._redirect({
811
979
  normalUrl: _data === null || _data === void 0 ? void 0 : _data.normalUrl
812
980
  });
813
981
  }).then(function () {
@@ -818,9 +986,9 @@ var ComponentApp = /*#__PURE__*/function () {
818
986
  }
819
987
  }, {
820
988
  key: "handleDeclareInfo",
821
- value: function handleDeclareInfo(_ref5) {
822
- var _ref5$closeDialogData = _ref5.closeDialogData,
823
- closeDialogData = _ref5$closeDialogData === void 0 ? {} : _ref5$closeDialogData;
989
+ value: function handleDeclareInfo(_ref6) {
990
+ var _ref6$closeDialogData = _ref6.closeDialogData,
991
+ closeDialogData = _ref6$closeDialogData === void 0 ? {} : _ref6$closeDialogData;
824
992
  _handleDeclareInfo({
825
993
  closeDialogData: closeDialogData
826
994
  });
@@ -885,8 +1053,11 @@ var ComponentApp = /*#__PURE__*/function () {
885
1053
  if (targetElement && targetElement.contentWindow) {
886
1054
  return targetElement.contentWindow.postMessage(JSON.stringify(data), '*');
887
1055
  }
888
- if (this.app && this.app.contentWindow) {
889
- return this.app.contentWindow.postMessage(JSON.stringify(data), this.appDomain);
1056
+ if (this.app || this.popupApp) {
1057
+ var _this$app, _this$app2, _this$popupApp, _this$popupApp2;
1058
+ (this === null || this === void 0 || (_this$app = this.app) === null || _this$app === void 0 ? void 0 : _this$app.contentWindow) && (this === null || this === void 0 || (_this$app2 = this.app) === null || _this$app2 === void 0 ? void 0 : _this$app2.contentWindow.postMessage(JSON.stringify(data), this.appDomain));
1059
+ (this === null || this === void 0 || (_this$popupApp = this.popupApp) === null || _this$popupApp === void 0 ? void 0 : _this$popupApp.contentWindow) && (this === null || this === void 0 || (_this$popupApp2 = this.popupApp) === null || _this$popupApp2 === void 0 ? void 0 : _this$popupApp2.contentWindow.postMessage(JSON.stringify(data), '*'));
1060
+ return;
890
1061
  }
891
1062
  throw new Error(ERRORMESSAGE.SDK_SUBMIT_ERROR.message);
892
1063
  }
@@ -912,22 +1083,26 @@ var ComponentApp = /*#__PURE__*/function () {
912
1083
  }, {
913
1084
  key: "sendRenderEvent",
914
1085
  value: function () {
915
- var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
916
- var _this$_renderParams4, _this$_renderParams5, _this$_renderParams6, _this$_renderParams7, _this$_renderParams8, res;
917
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
918
- while (1) switch (_context4.prev = _context4.next) {
1086
+ var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
1087
+ var _this$_renderParams5, _this$_renderParams6, _this$_renderParams7, _this$_renderParams8, _this$_renderParams9, res, submitRes;
1088
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1089
+ while (1) switch (_context6.prev = _context6.next) {
919
1090
  case 0:
920
- _context4.prev = 0;
921
- if (this._actionQueryPromise) {
922
- _context4.next = 3;
1091
+ _context6.prev = 0;
1092
+ if (!(!this._actionQueryPromise || !this._actionSubmitPromise)) {
1093
+ _context6.next = 3;
923
1094
  break;
924
1095
  }
925
- return _context4.abrupt("return");
1096
+ return _context6.abrupt("return");
926
1097
  case 3:
927
- _context4.next = 5;
1098
+ _context6.next = 5;
928
1099
  return this._actionQueryPromise;
929
1100
  case 5:
930
- res = _context4.sent;
1101
+ res = _context6.sent;
1102
+ _context6.next = 8;
1103
+ return this._actionSubmitPromise;
1104
+ case 8:
1105
+ submitRes = _context6.sent;
931
1106
  this._performanceData.push({
932
1107
  key: 'sdk_render_component',
933
1108
  value: Date.now()
@@ -937,12 +1112,13 @@ var ComponentApp = /*#__PURE__*/function () {
937
1112
  event: 'renderComponent',
938
1113
  data: {
939
1114
  queryResult: res,
940
- sessionResult: (_this$_renderParams4 = this._renderParams) === null || _this$_renderParams4 === void 0 ? void 0 : _this$_renderParams4.paymentSessionMetaData,
941
- paymentSessionData: (_this$_renderParams5 = this._renderParams) === null || _this$_renderParams5 === void 0 ? void 0 : _this$_renderParams5.sessionData,
1115
+ submitResult: submitRes,
1116
+ sessionResult: (_this$_renderParams5 = this._renderParams) === null || _this$_renderParams5 === void 0 ? void 0 : _this$_renderParams5.paymentSessionMetaData,
1117
+ paymentSessionData: (_this$_renderParams6 = this._renderParams) === null || _this$_renderParams6 === void 0 ? void 0 : _this$_renderParams6.sessionData,
942
1118
  heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
943
- renderDisplayType: (_this$_renderParams6 = this._renderParams) === null || _this$_renderParams6 === void 0 ? void 0 : _this$_renderParams6.renderDisplayType,
944
- appearance: (_this$_renderParams7 = this._renderParams) === null || _this$_renderParams7 === void 0 ? void 0 : _this$_renderParams7.appearance,
945
- notRedirectAfterComplete: ((_this$_renderParams8 = this._renderParams) === null || _this$_renderParams8 === void 0 ? void 0 : _this$_renderParams8.notRedirectAfterComplete) === true,
1119
+ renderDisplayType: (_this$_renderParams7 = this._renderParams) === null || _this$_renderParams7 === void 0 ? void 0 : _this$_renderParams7.renderDisplayType,
1120
+ appearance: (_this$_renderParams8 = this._renderParams) === null || _this$_renderParams8 === void 0 ? void 0 : _this$_renderParams8.appearance,
1121
+ notRedirectAfterComplete: ((_this$_renderParams9 = this._renderParams) === null || _this$_renderParams9 === void 0 ? void 0 : _this$_renderParams9.notRedirectAfterComplete) === true,
946
1122
  envInfo: {
947
1123
  screenHeight: screen.height,
948
1124
  screenWidth: screen.width
@@ -959,16 +1135,16 @@ var ComponentApp = /*#__PURE__*/function () {
959
1135
  }
960
1136
  });
961
1137
  // eslint-disable-next-line no-empty
962
- _context4.next = 13;
1138
+ _context6.next = 16;
963
1139
  break;
964
- case 11:
965
- _context4.prev = 11;
966
- _context4.t0 = _context4["catch"](0);
967
- case 13:
1140
+ case 14:
1141
+ _context6.prev = 14;
1142
+ _context6.t0 = _context6["catch"](0);
1143
+ case 16:
968
1144
  case "end":
969
- return _context4.stop();
1145
+ return _context6.stop();
970
1146
  }
971
- }, _callee4, this, [[0, 11]]);
1147
+ }, _callee6, this, [[0, 14]]);
972
1148
  }));
973
1149
  function sendRenderEvent() {
974
1150
  return _sendRenderEvent.apply(this, arguments);
@@ -982,7 +1158,7 @@ var ComponentApp = /*#__PURE__*/function () {
982
1158
  key: "cleanContainer",
983
1159
  value: function cleanContainer() {
984
1160
  var _document$getElementB4,
985
- _this7 = this;
1161
+ _this8 = this;
986
1162
  var immediately = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
987
1163
  this._loadAppPromiseResolve && this._loadAppPromiseResolve(true);
988
1164
  this._performanceData = [];
@@ -994,7 +1170,7 @@ var ComponentApp = /*#__PURE__*/function () {
994
1170
  mockup === null || mockup === void 0 || mockup.classList.add("".concat(MOCKUP_ID, "-hidden"));
995
1171
  if (immediately) this.cleanElement();else {
996
1172
  setTimeout(function () {
997
- _this7.cleanElement();
1173
+ _this8.cleanElement();
998
1174
  }, 300);
999
1175
  }
1000
1176
  }