@alipay/ams-checkout 0.0.1730107332-dev.32 → 0.0.1730107332-dev.34

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 (41) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/component/channel.js +18 -10
  3. package/esm/config/index.js +3 -3
  4. package/esm/core/component/ckp/index.js +3 -2
  5. package/esm/core/component/element/components/address.d.ts +19 -0
  6. package/esm/core/component/element/components/address.js +68 -0
  7. package/esm/core/component/element/components/auth.d.ts +17 -0
  8. package/esm/core/component/element/components/auth.js +60 -0
  9. package/esm/core/component/element/components/payment.d.ts +19 -0
  10. package/esm/core/component/element/components/payment.js +74 -0
  11. package/esm/core/component/element/index.d.ts +47 -0
  12. package/esm/core/component/element/index.js +816 -0
  13. package/esm/core/component/element/mock.d.ts +4 -0
  14. package/esm/core/component/element/mock.js +491 -0
  15. package/esm/core/component/element/type.d.ts +184 -0
  16. package/esm/core/component/element/type.js +35 -0
  17. package/esm/core/component/element/utils.d.ts +13 -0
  18. package/esm/core/component/element/utils.js +6 -0
  19. package/esm/foundation/core/index.d.ts +1 -1
  20. package/esm/foundation/core/index.js +5 -5
  21. package/esm/foundation/index.d.ts +1 -0
  22. package/esm/foundation/service/container/index.js +1 -0
  23. package/esm/foundation/service/event-center.d.ts +2 -0
  24. package/esm/foundation/service/event-center.js +36 -2
  25. package/esm/foundation/service/security/index.js +20 -4
  26. package/esm/index.d.ts +5 -1
  27. package/esm/index.js +16 -1
  28. package/esm/plugin/component/cashierApp.d.ts +3 -1
  29. package/esm/plugin/component/cashierApp.js +12 -5
  30. package/esm/plugin/component/channel.d.ts +2 -2
  31. package/esm/plugin/component/component.inline.style.d.ts +1 -1
  32. package/esm/plugin/component/component.inline.style.js +6 -4
  33. package/esm/plugin/component/index.d.ts +1 -0
  34. package/esm/plugin/component/index.js +106 -55
  35. package/esm/service/element.d.ts +4 -0
  36. package/esm/service/element.js +51 -0
  37. package/esm/service/index.d.ts +1 -0
  38. package/esm/service/index.js +2 -0
  39. package/esm/types/index.d.ts +194 -17
  40. package/esm/types/index.js +44 -4
  41. package/package.json +2 -1
@@ -268,8 +268,13 @@ var ComponentApp = /*#__PURE__*/function () {
268
268
  this._componentSign = componentSign;
269
269
  if ((_renderParams = renderParams) !== null && _renderParams !== void 0 && _renderParams.selector) this._selector = renderParams.selector;
270
270
  this._renderDisplayType = renderParams.renderDisplayType;
271
+ // connect element模式会存在加载多个sdk,appendAliasContainerId为true来判断,给容器inlineId添加标识,id中不能存在#需在这里提前过滤一下
272
+ var _selector = this._selector.indexOf('#') === -1 ? this._selector : this._selector.slice(1);
273
+ // 修改需当前文件搜索,这段注释appendAliasContainerId
274
+ var appendAliasContainerId = renderParams.appendAliasContainerId ? "-".concat(_selector) : '';
275
+ var inlineId = "".concat(COMPONENT_CONTAINER_ID).concat(appendAliasContainerId);
276
+ var insertedNode = this._renderDisplayType === DisplayTypeEnum.inline ? "#".concat(inlineId) : this._selector;
271
277
  this._isAppWebview = renderParams.isAppWebview;
272
- var insertedNode = this._renderDisplayType === DisplayTypeEnum.inline ? "#".concat(COMPONENT_CONTAINER_ID) : this._selector;
273
278
  this.initLoggerMeta();
274
279
  this.initSecurity();
275
280
  this._performanceData.push({
@@ -335,7 +340,7 @@ var ComponentApp = /*#__PURE__*/function () {
335
340
  code: eventCodeEnum.SDK_START_OF_LOADING
336
341
  });
337
342
  if (this._renderDisplayType === DisplayTypeEnum.inline) {
338
- var container = createInlineBaseElement(this._selector);
343
+ var container = createInlineBaseElement(this._selector, COMPONENT_CONTAINER_ID, inlineId);
339
344
  if (container) this.renderInlineLoading(renderParams, container);
340
345
  insertStyleSheet();
341
346
  }
@@ -451,8 +456,8 @@ var ComponentApp = /*#__PURE__*/function () {
451
456
  // eslint-disable-next-line no-async-promise-executor
452
457
  this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
453
458
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
454
- var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6;
455
- var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams7, _ref8, _ref8$productSceneVer, productSceneVersion, _ref8$productScene, productScene, _this5$_renderParams8, _action$web2, _action$wap2, action, signType;
459
+ var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6, _this5$_renderParams7;
460
+ var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams8, _ref8, _ref8$productSceneVer, productSceneVersion, _ref8$productScene, productScene, _this5$_renderParams9, _action$web2, _action$wap2, action, signType;
456
461
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
457
462
  while (1) switch (_context2.prev = _context2.next) {
458
463
  case 0:
@@ -491,8 +496,7 @@ var ComponentApp = /*#__PURE__*/function () {
491
496
  if (ComponentSignEnum.ELEMENT_PAYMENT === _this5._componentSign) {
492
497
  params.paymentSessionConfig = handlePaymentSessionConfig(params.paymentSessionConfig);
493
498
  }
494
- /** 地址组件跳过接口查询 */
495
- if (!(ComponentSignEnum.ELEMENT_ADDRESS === _this5._componentSign)) {
499
+ if (!(ComponentSignEnum.ELEMENT_PAYMENT === _this5._componentSign && _this5 !== null && _this5 !== void 0 && (_this5$_renderParams6 = _this5._renderParams) !== null && _this5$_renderParams6 !== void 0 && (_this5$_renderParams6 = _this5$_renderParams6.paymentSessionMetaData) !== null && _this5$_renderParams6 !== void 0 && (_this5$_renderParams6 = _this5$_renderParams6.connectFactor) !== null && _this5$_renderParams6 !== void 0 && _this5$_renderParams6.enableConnect)) {
496
500
  _context2.next = 12;
497
501
  break;
498
502
  }
@@ -501,22 +505,31 @@ var ComponentApp = /*#__PURE__*/function () {
501
505
  success: true
502
506
  }));
503
507
  case 12:
508
+ if (!(ComponentSignEnum.ELEMENT_ADDRESS === _this5._componentSign)) {
509
+ _context2.next = 14;
510
+ break;
511
+ }
512
+ return _context2.abrupt("return", resolve({
513
+ message: 'sdk no need to make query request',
514
+ success: true
515
+ }));
516
+ case 14:
504
517
  if (!(ComponentSignEnum.VAULTING_CARD === _this5._componentSign)) {
505
- _context2.next = 24;
518
+ _context2.next = 26;
506
519
  break;
507
520
  }
508
521
  if (!enableVaultingApiOptimize) {
509
- _context2.next = 24;
522
+ _context2.next = 26;
510
523
  break;
511
524
  }
512
525
  if (!skipSdkQueryForm) {
513
- _context2.next = 21;
526
+ _context2.next = 23;
514
527
  break;
515
528
  }
516
529
  // 优先判断 skipSdkQueryForm
517
530
  ifSkip = matchVersion(skipSdkQueryForm, _this5._appVersion);
518
531
  if (!ifSkip) {
519
- _context2.next = 19;
532
+ _context2.next = 21;
520
533
  break;
521
534
  }
522
535
  resolve({
@@ -524,12 +537,12 @@ var ComponentApp = /*#__PURE__*/function () {
524
537
  success: true
525
538
  });
526
539
  return _context2.abrupt("return");
527
- case 19:
528
- _context2.next = 24;
529
- break;
530
540
  case 21:
541
+ _context2.next = 26;
542
+ break;
543
+ case 23:
531
544
  if (!skipSdkQuery) {
532
- _context2.next = 24;
545
+ _context2.next = 26;
533
546
  break;
534
547
  }
535
548
  resolve({
@@ -537,10 +550,10 @@ var ComponentApp = /*#__PURE__*/function () {
537
550
  success: true
538
551
  });
539
552
  return _context2.abrupt("return");
540
- case 24:
541
- channelBehavior = getChannelBehavior((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.paymentSessionMetaData); // Easypay TOSS 渠道无需actionQuery
553
+ case 26:
554
+ channelBehavior = getChannelBehavior((_this5$_renderParams7 = _this5._renderParams) === null || _this5$_renderParams7 === void 0 ? void 0 : _this5$_renderParams7.paymentSessionMetaData); // Easypay TOSS 渠道无需actionQuery
542
555
  if (!(channelBehavior !== null && channelBehavior !== void 0 && channelBehavior.usePaymentSessionAsQueryResult)) {
543
- _context2.next = 27;
556
+ _context2.next = 29;
544
557
  break;
545
558
  }
546
559
  return _context2.abrupt("return", resolve({
@@ -548,78 +561,78 @@ var ComponentApp = /*#__PURE__*/function () {
548
561
  amountConfirmRequired: actionData === null || actionData === void 0 ? void 0 : actionData.amountConfirmRequired,
549
562
  success: true
550
563
  }));
551
- case 27:
564
+ case 29:
552
565
  if (!(ComponentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || ComponentSignEnum.VAULTING_CARD === _this5._componentSign)) {
553
- _context2.next = 33;
566
+ _context2.next = 35;
554
567
  break;
555
568
  }
556
569
  params.paymentMethodType = 'CARD';
557
- _context2.next = 31;
570
+ _context2.next = 33;
558
571
  return _this5.getDeviceIdAndLog();
559
- case 31:
572
+ case 33:
560
573
  envInfo.deviceId = _context2.sent;
561
574
  if (window.navigator.userAgent.indexOf('miniProgram') > -1) {
562
575
  envInfo.extendInfo = {
563
576
  WAP_SUB_TYPE: 'WECHAT_MINI_PROGRAM'
564
577
  };
565
578
  }
566
- case 33:
579
+ case 35:
567
580
  if (!(ComponentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
568
- _context2.next = 42;
581
+ _context2.next = 44;
569
582
  break;
570
583
  }
571
584
  _ref8 = params.paymentSessionConfig || {}, _ref8$productSceneVer = _ref8.productSceneVersion, productSceneVersion = _ref8$productSceneVer === void 0 ? '' : _ref8$productSceneVer, _ref8$productScene = _ref8.productScene, productScene = _ref8$productScene === void 0 ? '' : _ref8$productScene;
572
- if (!((_this5$_renderParams7 = _this5._renderParams) !== null && _this5$_renderParams7 !== void 0 && (_this5$_renderParams7 = _this5$_renderParams7.paymentSessionMetaData) !== null && _this5$_renderParams7 !== void 0 && (_this5$_renderParams7 = _this5$_renderParams7.action) !== null && _this5$_renderParams7 !== void 0 && _this5$_renderParams7.skipSdkQuery && enableEasypayApiOptimize)) {
573
- _context2.next = 37;
585
+ if (!((_this5$_renderParams8 = _this5._renderParams) !== null && _this5$_renderParams8 !== void 0 && (_this5$_renderParams8 = _this5$_renderParams8.paymentSessionMetaData) !== null && _this5$_renderParams8 !== void 0 && (_this5$_renderParams8 = _this5$_renderParams8.action) !== null && _this5$_renderParams8 !== void 0 && _this5$_renderParams8.skipSdkQuery && enableEasypayApiOptimize)) {
586
+ _context2.next = 39;
574
587
  break;
575
588
  }
576
589
  return _context2.abrupt("return", resolve({
577
590
  message: 'sdk no need to make query request',
578
591
  success: true
579
592
  }));
580
- case 37:
593
+ case 39:
581
594
  if (!(productScene === ProductSceneEnum.EASY_PAY && productSceneVersion === '2.0')) {
582
- _context2.next = 39;
595
+ _context2.next = 41;
583
596
  break;
584
597
  }
585
598
  return _context2.abrupt("return", resolve({
586
599
  message: 'sdk no need to make query request',
587
600
  success: true
588
601
  }));
589
- case 39:
590
- _context2.next = 41;
591
- return _this5.getDeviceIdAndLog();
592
602
  case 41:
603
+ _context2.next = 43;
604
+ return _this5.getDeviceIdAndLog();
605
+ case 43:
593
606
  envInfo.deviceId = _context2.sent;
594
- case 42:
607
+ case 44:
595
608
  if (!(ComponentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
596
- _context2.next = 52;
609
+ _context2.next = 54;
597
610
  break;
598
611
  }
599
- action = ((_this5$_renderParams8 = _this5._renderParams) === null || _this5$_renderParams8 === void 0 || (_this5$_renderParams8 = _this5$_renderParams8.paymentSessionMetaData) === null || _this5$_renderParams8 === void 0 ? void 0 : _this5$_renderParams8.action) || {};
612
+ action = ((_this5$_renderParams9 = _this5._renderParams) === null || _this5$_renderParams9 === void 0 || (_this5$_renderParams9 = _this5$_renderParams9.paymentSessionMetaData) === null || _this5$_renderParams9 === void 0 ? void 0 : _this5$_renderParams9.action) || {};
600
613
  signType = isPC() ? action === null || action === void 0 || (_action$web2 = action.web) === null || _action$web2 === void 0 ? void 0 : _action$web2.signType : action === null || action === void 0 || (_action$wap2 = action.wap) === null || _action$wap2 === void 0 ? void 0 : _action$wap2.signType;
601
614
  if (!(signType === 'SMS')) {
602
- _context2.next = 47;
615
+ _context2.next = 49;
603
616
  break;
604
617
  }
605
618
  return _context2.abrupt("return", resolve({
606
619
  message: 'sdk no need to make query request',
607
620
  success: true
608
621
  }));
609
- case 47:
622
+ case 49:
610
623
  if (!(!signType || signType !== 'REDIRECT')) {
611
- _context2.next = 49;
624
+ _context2.next = 51;
612
625
  break;
613
626
  }
614
627
  return _context2.abrupt("return", resolve({
615
628
  success: false
616
629
  }));
617
- case 49:
618
- _context2.next = 51;
619
- return _this5.getDeviceIdAndLog();
620
630
  case 51:
631
+ _context2.next = 53;
632
+ return _this5.getDeviceIdAndLog();
633
+ case 53:
621
634
  envInfo.deviceId = _context2.sent;
622
- case 52:
635
+ case 54:
623
636
  _this5.AMSSDK.logger.logInfo({
624
637
  title: 'sdk_event_sdkQuery'
625
638
  }, {
@@ -658,7 +671,7 @@ var ComponentApp = /*#__PURE__*/function () {
658
671
  }).send();
659
672
  reject(err);
660
673
  });
661
- case 54:
674
+ case 56:
662
675
  case "end":
663
676
  return _context2.stop();
664
677
  }
@@ -883,7 +896,7 @@ var ComponentApp = /*#__PURE__*/function () {
883
896
  value: Date.now()
884
897
  });
885
898
  try {
886
- var _renderParams$payment, _renderParams$payment2, _renderParams$payment3, _renderParams$payment4;
899
+ var _renderParams$payment, _renderParams$payment2, _renderParams$payment3, _renderParams$payment4, _renderParams$debugPr, _renderParams$debugPr2;
887
900
  var productSceneVersion = (renderParams === null || renderParams === void 0 || (_renderParams$payment = renderParams.paymentSessionMetaData) === null || _renderParams$payment === void 0 || (_renderParams$payment = _renderParams$payment.paymentSessionConfig) === null || _renderParams$payment === void 0 ? void 0 : _renderParams$payment.productSceneVersion) || '';
888
901
  var productScene = (renderParams === null || renderParams === void 0 || (_renderParams$payment2 = renderParams.paymentSessionMetaData) === null || _renderParams$payment2 === void 0 || (_renderParams$payment2 = _renderParams$payment2.paymentSessionConfig) === null || _renderParams$payment2 === void 0 ? void 0 : _renderParams$payment2.productScene) || '';
889
902
  var extendInfo = (renderParams === null || renderParams === void 0 || (_renderParams$payment3 = renderParams.paymentSessionMetaData) === null || _renderParams$payment3 === void 0 ? void 0 : _renderParams$payment3.extendInfo) || '';
@@ -896,7 +909,8 @@ var ComponentApp = /*#__PURE__*/function () {
896
909
  productScene: productScene,
897
910
  productSceneVersion: productSceneVersion,
898
911
  extendInfo: extendInfo,
899
- mid: mid
912
+ mid: mid,
913
+ localLink: renderParams === null || renderParams === void 0 || (_renderParams$debugPr = renderParams.debugProps) === null || _renderParams$debugPr === void 0 ? void 0 : _renderParams$debugPr.localLink // TODO Connect本地调试link
900
914
  });
901
915
  this.app = createIframe(this.AMSSDK.options.mode, this.platform);
902
916
  var hostSign = ((renderParams === null || renderParams === void 0 ? void 0 : renderParams.sessionData) || '').split('&&')[1] || '';
@@ -912,7 +926,8 @@ var ComponentApp = /*#__PURE__*/function () {
912
926
  locale: this.AMSSDK.options.locale,
913
927
  instanceId: this.AMSSDK._instanceId,
914
928
  hostSign: hostSign,
915
- mid: mid
929
+ mid: mid,
930
+ localLink: renderParams === null || renderParams === void 0 || (_renderParams$debugPr2 = renderParams.debugProps) === null || _renderParams$debugPr2 === void 0 ? void 0 : _renderParams$debugPr2.localLink // TODO Connect本地调试link
916
931
  }),
917
932
  path = _getIframeUrl2.path,
918
933
  locationSearch = _getIframeUrl2.locationSearch;
@@ -1301,8 +1316,36 @@ var ComponentApp = /*#__PURE__*/function () {
1301
1316
  return;
1302
1317
  }
1303
1318
 
1304
- // The plug-in communicates with the sdk after processing
1305
- this.dispatchToSDK(data.context.event, data.context.data, data.context.eventCallbackId);
1319
+ // log event before sending the callback
1320
+ this.logEventCallback(data, "sdk_event_event_callback");
1321
+ try {
1322
+ // The plug-in communicates with the sdk after processing
1323
+ this.dispatchToSDK(data.context.event, data.context.data, data.context.eventCallbackId);
1324
+ // log event after sending the callback
1325
+ this.logEventCallback(data, "sdk_event_afterEventCallback");
1326
+ } catch (e) {
1327
+ console.error(e);
1328
+ }
1329
+ }
1330
+ }, {
1331
+ key: "logEventCallback",
1332
+ value: function logEventCallback(data, title) {
1333
+ if (data.context.event === EVENT.eventCallback.name) {
1334
+ var _data$context4;
1335
+ var callbackData = "";
1336
+ try {
1337
+ var _data$context3;
1338
+ callbackData = JSON.stringify((data === null || data === void 0 || (_data$context3 = data.context) === null || _data$context3 === void 0 ? void 0 : _data$context3.data) || "");
1339
+ } catch (e) {
1340
+ console.error(e);
1341
+ }
1342
+ this.AMSSDK.logger.logInfo({
1343
+ title: title
1344
+ }, {
1345
+ callbackData: callbackData,
1346
+ callbackId: (data === null || data === void 0 || (_data$context4 = data.context) === null || _data$context4 === void 0 ? void 0 : _data$context4.eventCallbackId) || ""
1347
+ }).send();
1348
+ }
1306
1349
  }
1307
1350
  }, {
1308
1351
  key: "dismissLoadingFunc",
@@ -1319,9 +1362,13 @@ var ComponentApp = /*#__PURE__*/function () {
1319
1362
  }, {
1320
1363
  key: "handleSizeChanged",
1321
1364
  value: function handleSizeChanged(data) {
1322
- var _data$context$data4;
1323
- var cashier = document.getElementById(COMPONENT_CONTAINER_ID);
1324
- if (((_data$context$data4 = data.context.data) === null || _data$context$data4 === void 0 ? void 0 : _data$context$data4.height) <= 1 || data.context.data.height === parseInt(cashier.style.height)) return;
1365
+ var _this$_renderParams$s, _this$_renderParams$s2, _data$context$data4, _cashier$style;
1366
+ var _selector = ((_this$_renderParams$s = this._renderParams.selector) === null || _this$_renderParams$s === void 0 ? void 0 : _this$_renderParams$s.indexOf('#')) === -1 ? this._renderParams.selector : (_this$_renderParams$s2 = this._renderParams.selector) === null || _this$_renderParams$s2 === void 0 ? void 0 : _this$_renderParams$s2.slice(1);
1367
+ // 修改需当前文件搜索,这段注释appendAliasContainerId
1368
+ var appendAliasContainerId = this._renderParams.appendAliasContainerId;
1369
+ var selectorId = appendAliasContainerId ? "".concat(COMPONENT_CONTAINER_ID, "-").concat(_selector) : COMPONENT_CONTAINER_ID;
1370
+ var cashier = document.getElementById(selectorId);
1371
+ if (((_data$context$data4 = data.context.data) === null || _data$context$data4 === void 0 ? void 0 : _data$context$data4.height) <= 1 || data.context.data.height === parseInt(cashier === null || cashier === void 0 || (_cashier$style = cashier.style) === null || _cashier$style === void 0 ? void 0 : _cashier$style.height)) return;
1325
1372
  cashier.style.height = "".concat(data.context.data.height, "px");
1326
1373
  this.app.style.opacity = '1';
1327
1374
  if (this._renderDisplayType === DisplayTypeEnum.popup) {
@@ -1760,15 +1807,19 @@ var ComponentApp = /*#__PURE__*/function () {
1760
1807
  }, {
1761
1808
  key: "hideComponentAnimation",
1762
1809
  value: function hideComponentAnimation() {
1763
- var _container$style;
1764
- var container = document.getElementById(COMPONENT_CONTAINER_ID);
1765
- if (this.app) this.app.style.height = container === null || container === void 0 || (_container$style = container.style) === null || _container$style === void 0 ? void 0 : _container$style.height;
1810
+ var _this$_renderParams$s3, _this$_renderParams$s4, _container$style;
1811
+ // 修改需当前文件搜索,这段注释appendAliasContainerId
1812
+ var _selector = ((_this$_renderParams$s3 = this._renderParams.selector) === null || _this$_renderParams$s3 === void 0 ? void 0 : _this$_renderParams$s3.indexOf('#')) === -1 ? this._renderParams.selector : (_this$_renderParams$s4 = this._renderParams.selector) === null || _this$_renderParams$s4 === void 0 ? void 0 : _this$_renderParams$s4.slice(1);
1813
+ var appendAliasContainerId = this._renderParams.appendAliasContainerId ? "-".concat(_selector) : '';
1814
+ var inlineId = "".concat(COMPONENT_CONTAINER_ID).concat(appendAliasContainerId);
1815
+ var container = document.getElementById(inlineId);
1816
+ if (this.app && container) this.app.style.height = container === null || container === void 0 || (_container$style = container.style) === null || _container$style === void 0 ? void 0 : _container$style.height;
1766
1817
  if (container) {
1767
1818
  // size变化动画取消
1768
1819
  container.style.transition = '';
1769
- container === null || container === void 0 || container.classList.remove("".concat(COMPONENT_CONTAINER_ID, "-").concat(this.platform));
1770
- container === null || container === void 0 || container.classList.remove("".concat(COMPONENT_CONTAINER_ID, "-").concat(this.platform, "-animation"));
1771
- container === null || container === void 0 || container.classList.add("".concat(COMPONENT_CONTAINER_ID, "-hidden-").concat(this.platform));
1820
+ container === null || container === void 0 || container.classList.remove("".concat(inlineId, "-").concat(this.platform));
1821
+ container === null || container === void 0 || container.classList.remove("".concat(inlineId, "-").concat(this.platform, "-animation"));
1822
+ container === null || container === void 0 || container.classList.add("".concat(inlineId, "-hidden-").concat(this.platform));
1772
1823
  }
1773
1824
  }
1774
1825
  }, {
@@ -0,0 +1,4 @@
1
+ import { AccountQueryRequest, RequestConfig, AccountQueryResult, CashierSdkActionQueryRequest, CashierSdkActionQueryResult } from '../types';
2
+ import type { Logger } from '../util/logger';
3
+ export declare function getElementOneAccount(payload: AccountQueryRequest, options: RequestConfig, logger: Logger): Promise<AccountQueryResult>;
4
+ export declare function getElementSdkAction(payload: CashierSdkActionQueryRequest, options: RequestConfig, logger: Logger): Promise<CashierSdkActionQueryResult>;
@@ -0,0 +1,51 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
10
+ import { request } from "../request";
11
+ export function getElementOneAccount(_x, _x2, _x3) {
12
+ return _getElementOneAccount.apply(this, arguments);
13
+ }
14
+ function _getElementOneAccount() {
15
+ _getElementOneAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(payload, options, logger) {
16
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
17
+ while (1) switch (_context.prev = _context.next) {
18
+ case 0:
19
+ return _context.abrupt("return", request(payload, _objectSpread(_objectSpread({}, options), {}, {
20
+ 'Operation-Type': 'com.ipay.iexpfront.one.account.query'
21
+ }), logger));
22
+ case 1:
23
+ case "end":
24
+ return _context.stop();
25
+ }
26
+ }, _callee);
27
+ }));
28
+ return _getElementOneAccount.apply(this, arguments);
29
+ }
30
+ export function getElementSdkAction(_x4, _x5, _x6) {
31
+ return _getElementSdkAction.apply(this, arguments);
32
+ }
33
+ function _getElementSdkAction() {
34
+ _getElementSdkAction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(payload, options, logger) {
35
+ var _options;
36
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
37
+ while (1) switch (_context2.prev = _context2.next) {
38
+ case 0:
39
+ // const deviceId = await getDeviceId();
40
+ _options = _objectSpread({}, options);
41
+ return _context2.abrupt("return", request(payload, _objectSpread(_objectSpread({}, _options), {}, {
42
+ 'Operation-Type': 'com.ipay.iexpcashier.sdkAction.query'
43
+ }), logger));
44
+ case 2:
45
+ case "end":
46
+ return _context2.stop();
47
+ }
48
+ }, _callee2);
49
+ }));
50
+ return _getElementSdkAction.apply(this, arguments);
51
+ }
@@ -1,5 +1,6 @@
1
1
  import { ApplePayPaymentSessionRequest, ApplePayPaymentSessionResult, CashierSdkActionQueryRequest, CashierSdkActionQueryResult, CashierSubmitPayRequest, CashierSubmitPayResult, RequestConfig } from '../types';
2
2
  import type { Logger } from '../util/logger';
3
+ export * as elementService from './element';
3
4
  export declare function queryPaymentInfo(params: CashierSdkActionQueryRequest, options: RequestConfig, logger: Logger): Promise<CashierSdkActionQueryResult>;
4
5
  export declare function antomConfig(options: RequestConfig, logger: Logger): Promise<any>;
5
6
  export declare function submitPayInfo(params: CashierSubmitPayRequest, options: RequestConfig, logger: Logger): Promise<CashierSubmitPayResult>;
@@ -16,6 +16,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
16
16
  */
17
17
  import { marmotConfigMap } from "../config";
18
18
  import { request } from "../request";
19
+ import * as _elementService from "./element";
20
+ export { _elementService as elementService };
19
21
  export function queryPaymentInfo(_x, _x2, _x3) {
20
22
  return _queryPaymentInfo.apply(this, arguments);
21
23
  }