@adyen/adyen-web 6.0.0-alpha.8 → 6.0.0-beta.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.
Files changed (169) hide show
  1. package/dist/cjs/adyen.css +65 -65
  2. package/dist/cjs/adyen.css.map +1 -1
  3. package/dist/cjs/index.cjs +2 -2
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/index.d.cts +861 -1243
  6. package/dist/es/adyen.css +65 -65
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/Ach/Ach.js +1 -1
  9. package/dist/es/components/Ach/Ach.js.map +1 -1
  10. package/dist/es/components/BankTransfer/BankTransfer.js +1 -1
  11. package/dist/es/components/BankTransfer/BankTransfer.js.map +1 -1
  12. package/dist/es/components/Blik/Blik.js +1 -1
  13. package/dist/es/components/Blik/Blik.js.map +1 -1
  14. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  15. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  16. package/dist/es/components/Card/components/CardInput/handlers.js +1 -1
  17. package/dist/es/components/Card/components/CardInput/useSRPanelForCardInputErrors.js +2 -0
  18. package/dist/es/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -0
  19. package/dist/es/components/CashAppPay/CashAppPay.js +1 -1
  20. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  21. package/dist/es/components/Dropin/Dropin.js +1 -1
  22. package/dist/es/components/Dropin/Dropin.js.map +1 -1
  23. package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
  24. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  25. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  26. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  27. package/dist/es/components/Dropin/elements/createElements.js.map +1 -1
  28. package/dist/es/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
  29. package/dist/es/components/Dropin/elements/createStoredElements.js.map +1 -1
  30. package/dist/es/components/Dropin/elements/filters.js.map +1 -1
  31. package/dist/es/components/Giropay/Giropay.js +1 -1
  32. package/dist/es/components/Giropay/Giropay.js.map +1 -1
  33. package/dist/es/components/Multibanco/Multibanco.js +1 -1
  34. package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
  35. package/dist/es/components/Redirect/Redirect.js +1 -1
  36. package/dist/es/components/Redirect/Redirect.js.map +1 -1
  37. package/dist/es/components/Trustly/Trustly.js +1 -1
  38. package/dist/es/components/Trustly/Trustly.js.map +1 -1
  39. package/dist/es/components/WeChat/config.js +1 -1
  40. package/dist/es/components/WeChat/config.js.map +1 -1
  41. package/dist/es/components/components-name-map.js +1 -1
  42. package/dist/es/components/components-name-map.js.map +1 -1
  43. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  44. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  45. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  46. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  47. package/dist/es/components/index.js +1 -1
  48. package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
  49. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  50. package/dist/es/components/internal/ClickToPay/models/ShopperCard.js +1 -1
  51. package/dist/es/components/internal/ClickToPay/models/ShopperCard.js.map +1 -1
  52. package/dist/es/components/internal/ClickToPay/services/sdks/SrciError.js +1 -1
  53. package/dist/es/components/internal/ClickToPay/services/sdks/SrciError.js.map +1 -1
  54. package/dist/es/components/internal/ClickToPay/services/utils.js +1 -1
  55. package/dist/es/components/internal/ClickToPay/services/utils.js.map +1 -1
  56. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  57. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  58. package/dist/es/components/internal/RedirectButton/RedirectButton.js +1 -1
  59. package/dist/es/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  60. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  61. package/dist/es/components/tx-variants.js +1 -1
  62. package/dist/es/components/tx-variants.js.map +1 -1
  63. package/dist/es/core/AdyenCheckout.js.map +1 -1
  64. package/dist/es/core/Analytics/Analytics.js +1 -1
  65. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  66. package/dist/es/core/CheckoutSession/CheckoutSession.js.map +1 -1
  67. package/dist/es/core/ProcessResponse/PaymentAction/PaymentAction.js.map +1 -1
  68. package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  69. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  70. package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
  71. package/dist/es/core/Services/http.js +1 -1
  72. package/dist/es/core/Services/http.js.map +1 -1
  73. package/dist/es/core/Services/sessions/setup-session.js +1 -1
  74. package/dist/es/core/Services/sessions/setup-session.js.map +1 -1
  75. package/dist/es/core/core.js +1 -1
  76. package/dist/es/core/core.js.map +1 -1
  77. package/dist/es/core/core.registry.js.map +1 -1
  78. package/dist/es/external/preact/dist/preact.js +1 -1
  79. package/dist/es/external/preact/dist/preact.js.map +1 -1
  80. package/dist/es/index.d.ts +861 -1243
  81. package/dist/es/index.js +1 -1
  82. package/dist/es/language/constants.js +1 -1
  83. package/dist/es/language/constants.js.map +1 -1
  84. package/dist/es-legacy/adyen.css +65 -65
  85. package/dist/es-legacy/adyen.css.map +1 -1
  86. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  87. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  88. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  89. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  90. package/dist/es-legacy/components/Blik/Blik.js +1 -1
  91. package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
  92. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  93. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  94. package/dist/es-legacy/components/Card/components/CardInput/handlers.js +1 -1
  95. package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js +2 -0
  96. package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -0
  97. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  98. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  99. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  100. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  101. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  102. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  103. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  104. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  105. package/dist/es-legacy/components/Dropin/elements/createElements.js.map +1 -1
  106. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
  107. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js.map +1 -1
  108. package/dist/es-legacy/components/Dropin/elements/filters.js.map +1 -1
  109. package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
  110. package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
  111. package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
  112. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  113. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  114. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  115. package/dist/es-legacy/components/Trustly/Trustly.js +1 -1
  116. package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
  117. package/dist/es-legacy/components/WeChat/config.js +1 -1
  118. package/dist/es-legacy/components/WeChat/config.js.map +1 -1
  119. package/dist/es-legacy/components/components-name-map.js +1 -1
  120. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  121. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  122. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  123. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  124. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  125. package/dist/es-legacy/components/index.js +1 -1
  126. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
  127. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  128. package/dist/es-legacy/components/internal/ClickToPay/models/ShopperCard.js +1 -1
  129. package/dist/es-legacy/components/internal/ClickToPay/models/ShopperCard.js.map +1 -1
  130. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrciError.js +1 -1
  131. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrciError.js.map +1 -1
  132. package/dist/es-legacy/components/internal/ClickToPay/services/utils.js +1 -1
  133. package/dist/es-legacy/components/internal/ClickToPay/services/utils.js.map +1 -1
  134. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  135. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  136. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  137. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  138. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  139. package/dist/es-legacy/components/tx-variants.js +1 -1
  140. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  141. package/dist/es-legacy/core/AdyenCheckout.js.map +1 -1
  142. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  143. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  144. package/dist/es-legacy/core/CheckoutSession/CheckoutSession.js.map +1 -1
  145. package/dist/es-legacy/core/ProcessResponse/PaymentAction/PaymentAction.js.map +1 -1
  146. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  147. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  148. package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
  149. package/dist/es-legacy/core/Services/http.js +1 -1
  150. package/dist/es-legacy/core/Services/http.js.map +1 -1
  151. package/dist/es-legacy/core/Services/sessions/setup-session.js +1 -1
  152. package/dist/es-legacy/core/Services/sessions/setup-session.js.map +1 -1
  153. package/dist/es-legacy/core/core.js +1 -1
  154. package/dist/es-legacy/core/core.js.map +1 -1
  155. package/dist/es-legacy/core/core.registry.js.map +1 -1
  156. package/dist/es-legacy/external/preact/dist/preact.js +1 -1
  157. package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
  158. package/dist/es-legacy/index.js +1 -1
  159. package/dist/es-legacy/language/constants.js +1 -1
  160. package/dist/es-legacy/language/constants.js.map +1 -1
  161. package/package.json +30 -30
  162. package/dist/es/components/Ideal/index.js +0 -2
  163. package/dist/es/components/Ideal/index.js.map +0 -1
  164. package/dist/es/core/Services/analytics/log-event.js +0 -2
  165. package/dist/es/core/Services/analytics/log-event.js.map +0 -1
  166. package/dist/es-legacy/components/Ideal/index.js +0 -2
  167. package/dist/es-legacy/components/Ideal/index.js.map +0 -1
  168. package/dist/es-legacy/core/Services/analytics/log-event.js +0 -2
  169. package/dist/es-legacy/core/Services/analytics/log-event.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Analytics.js","sources":["../../../../src/core/Analytics/Analytics.ts"],"sourcesContent":["import LogEvent from '../Services/analytics/log-event';\nimport CollectId from '../Services/analytics/collect-id';\nimport EventsQueue, { EventsQueueModule } from './EventsQueue';\nimport { ANALYTICS_EVENT, AnalyticsInitialEvent, AnalyticsObject, AnalyticsProps, CreateAnalyticsEventObject } from './types';\nimport { ANALYTICS_EVENT_ERROR, ANALYTICS_EVENT_INFO, ANALYTICS_EVENT_LOG, ANALYTICS_INFO_TIMER_INTERVAL, ANALYTICS_PATH } from './constants';\nimport { debounce } from '../../utils/debounce';\nimport { AnalyticsModule } from '../../types/global-types';\nimport { createAnalyticsObject, processAnalyticsData } from './utils';\nimport { analyticsPreProcessor } from './analyticsPreProcessor';\n\nlet capturedCheckoutAttemptId = null;\nlet hasLoggedPixel = false;\nlet sendEventsTimerId = null;\n\nconst Analytics = ({ loadingContext, locale, clientKey, analytics, amount, analyticsContext, bundleType }: AnalyticsProps): AnalyticsModule => {\n const defaultProps = {\n enabled: true,\n telemetry: true,\n checkoutAttemptId: null,\n analyticsData: {}\n };\n\n const props = { ...defaultProps, ...analytics };\n\n const logEvent = LogEvent({ loadingContext, locale });\n const collectId = CollectId({ analyticsContext, clientKey, locale, amount, analyticsPath: ANALYTICS_PATH, bundleType });\n const eventsQueue: EventsQueueModule = EventsQueue({ analyticsContext, clientKey, analyticsPath: ANALYTICS_PATH });\n\n const sendAnalyticsEvents = () => {\n if (capturedCheckoutAttemptId) {\n return eventsQueue.run(capturedCheckoutAttemptId);\n }\n return Promise.resolve(null);\n };\n\n const addAnalyticsEvent = (type: ANALYTICS_EVENT, obj: AnalyticsObject) => {\n const arrayName = type === ANALYTICS_EVENT_INFO ? type : `${type}s`;\n eventsQueue.add(`${arrayName}`, obj);\n\n /**\n * The logic is:\n * - info events are stored until a log or error comes along,\n * but, if after a set time, no other analytics event (log or error) has come along then we send the info events anyway\n */\n if (type === ANALYTICS_EVENT_INFO) {\n clearTimeout(sendEventsTimerId);\n sendEventsTimerId = setTimeout(sendAnalyticsEvents, ANALYTICS_INFO_TIMER_INTERVAL);\n }\n\n /**\n * The logic is:\n * - errors and logs get sent straightaway\n * ...but... tests with the 3DS2 process show that many logs can happen almost at the same time (or you can have an error followed immediately by a log),\n * so instead of making several sequential api calls we see if we can \"batch\" them using debounce\n */\n if (type === ANALYTICS_EVENT_LOG || type === ANALYTICS_EVENT_ERROR) {\n clearTimeout(sendEventsTimerId); // clear any timer that might be about to dispatch the info events array\n\n debounce(sendAnalyticsEvents)();\n }\n };\n\n const anlModule: AnalyticsModule = {\n /**\n * Make \"setup\" call, to pass containerWidth, buildType, channel etc, and receive a checkoutAttemptId in return\n * @param initialEvent -\n */\n setUp: async (initialEvent: AnalyticsInitialEvent) => {\n const { enabled, payload, telemetry } = props; // TODO what is payload, is it ever used?\n\n const analyticsData = processAnalyticsData(props.analyticsData);\n\n if (enabled === true) {\n if (telemetry === true && !capturedCheckoutAttemptId) {\n try {\n const checkoutAttemptId = await collectId({\n ...initialEvent,\n ...(payload && { ...payload }),\n ...(Object.keys(analyticsData).length && { ...analyticsData })\n });\n capturedCheckoutAttemptId = checkoutAttemptId;\n } catch (e) {\n console.warn(`Fetching checkoutAttemptId failed.${e ? ` Error=${e}` : ''}`);\n }\n }\n\n if (!hasLoggedPixel) {\n // Log pixel\n // TODO once we stop using the pixel we can stop requiring both \"enabled\" & \"telemetry\" config options.\n // And v6 will have a \"level: 'none\" | \"all\" | \"minimal\" config prop\n logEvent(initialEvent);\n hasLoggedPixel = true;\n }\n }\n },\n\n getCheckoutAttemptId: (): string => capturedCheckoutAttemptId,\n\n // Expose getter for testing purposes\n getEventsQueue: () => eventsQueue,\n\n createAnalyticsEvent: ({ event, data }: CreateAnalyticsEventObject): AnalyticsObject => {\n const aObj: AnalyticsObject = createAnalyticsObject({\n event,\n ...data\n });\n // console.log('### Analytics::createAnalyticsEvent:: event=', event, ' aObj=', aObj);\n\n addAnalyticsEvent(event, aObj);\n\n return aObj;\n },\n\n getEnabled: () => props.enabled,\n\n sendAnalytics: null\n };\n\n anlModule.sendAnalytics = analyticsPreProcessor(anlModule);\n\n return anlModule;\n};\n\nexport default Analytics;\n"],"names":["capturedCheckoutAttemptId","hasLoggedPixel","sendEventsTimerId","Analytics","loadingContext","locale","clientKey","analytics","amount","analyticsContext","bundleType","props","enabled","telemetry","checkoutAttemptId","analyticsData","logEvent","LogEvent","collectId","CollectId","analyticsPath","ANALYTICS_PATH","eventsQueue","EventsQueue","sendAnalyticsEvents","run","Promise","resolve","anlModule","setUp","async","initialEvent","payload","processAnalyticsData","Object","keys","length","e","console","warn","getCheckoutAttemptId","getEventsQueue","createAnalyticsEvent","event","data","aObj","createAnalyticsObject","type","obj","arrayName","ANALYTICS_EVENT_INFO","add","clearTimeout","setTimeout","ANALYTICS_INFO_TIMER_INTERVAL","ANALYTICS_EVENT_LOG","ANALYTICS_EVENT_ERROR","debounce","addAnalyticsEvent","getEnabled","sendAnalytics","analyticsPreProcessor"],"mappings":"yeAUA,IAAIA,EAA4B,KAC5BC,GAAiB,EACjBC,EAAoB,KAExB,MAAMC,EAAY,EAAGC,iBAAgBC,SAAQC,YAAWC,YAAWC,SAAQC,mBAAkBC,iBACzF,MAOMC,EAAQ,CANVC,SAAS,EACTC,WAAW,EACXC,kBAAmB,KACnBC,cAAe,CAAC,KAGgBR,GAE9BS,EAAWC,EAAS,CAAEb,iBAAgBC,WACtCa,EAAYC,EAAU,CAAEV,mBAAkBH,YAAWD,SAAQG,SAAQY,cAAeC,EAAgBX,eACpGY,EAAiCC,EAAY,CAAEd,mBAAkBH,YAAWc,cAAeC,IAE3FG,EAAsB,IACpBxB,EACOsB,EAAYG,IAAIzB,GAEpB0B,QAAQC,QAAQ,MA8BrBC,EAA6B,CAK/BC,MAAOC,MAAOC,IACV,MAAMnB,QAAEA,EAAOoB,QAAEA,EAAOnB,UAAEA,GAAcF,EAElCI,EAAgBkB,EAAqBtB,EAAMI,eAEjD,IAAgB,IAAZH,EAAkB,CAClB,IAAkB,IAAdC,IAAuBb,EACvB,IACI,MAAMc,QAA0BI,EAAU,IACnCa,KACCC,GAAW,IAAKA,MAChBE,OAAOC,KAAKpB,GAAeqB,QAAU,IAAKrB,KAElDf,EAA4Bc,CAChC,CAAE,MAAOuB,GACLC,QAAQC,KAAK,sCAAqCF,EAAI,UAAUA,IAAM,IAC1E,CAGCpC,IAIDe,EAASe,GACT9B,GAAiB,EAEzB,GAGJuC,qBAAsB,IAAcxC,EAGpCyC,eAAgB,IAAMnB,EAEtBoB,qBAAsB,EAAGC,QAAOC,WAC5B,MAAMC,EAAwBC,EAAsB,CAChDH,WACGC,IAMP,MA3EkB,EAACG,EAAuBC,KAC9C,MAAMC,EAAYF,IAASG,EAAuBH,EAAO,GAAGA,KAC5DzB,EAAY6B,IAAI,GAAGF,IAAaD,GAO5BD,IAASG,IACTE,aAAalD,GACbA,EAAoBmD,WAAW7B,EAAqB8B,IASpDP,IAASQ,GAAuBR,IAASS,IACzCJ,aAAalD,GAEbuD,EAASjC,EAATiC,GACJ,EAiDIC,CAAkBf,EAAOE,GAElBA,CAAAA,EAGXc,WAAY,IAAMhD,EAAMC,QAExBgD,cAAe,MAKnB,OAFAhC,EAAUgC,cAAgBC,EAAsBjC,GAEzCA,CAAAA"}
1
+ {"version":3,"file":"Analytics.js","sources":["../../../../src/core/Analytics/Analytics.ts"],"sourcesContent":["import CollectId from '../Services/analytics/collect-id';\nimport EventsQueue, { EventsQueueModule } from './EventsQueue';\nimport { ANALYTICS_EVENT, AnalyticsInitialEvent, AnalyticsObject, AnalyticsProps, CreateAnalyticsEventObject } from './types';\nimport { ANALYTICS_EVENT_ERROR, ANALYTICS_EVENT_INFO, ANALYTICS_EVENT_LOG, ANALYTICS_INFO_TIMER_INTERVAL, ANALYTICS_PATH } from './constants';\nimport { debounce } from '../../utils/debounce';\nimport { AnalyticsModule } from '../../types/global-types';\nimport { createAnalyticsObject, processAnalyticsData } from './utils';\nimport { analyticsPreProcessor } from './analyticsPreProcessor';\n\nlet capturedCheckoutAttemptId = null;\nlet sendEventsTimerId = null;\n\nconst Analytics = ({ locale, clientKey, analytics, amount, analyticsContext, bundleType }: AnalyticsProps): AnalyticsModule => {\n const defaultProps = {\n enabled: true,\n checkoutAttemptId: null,\n analyticsData: {}\n };\n\n const props = { ...defaultProps, ...analytics };\n\n const collectId = CollectId({ analyticsContext, clientKey, locale, amount, analyticsPath: ANALYTICS_PATH, bundleType });\n const eventsQueue: EventsQueueModule = EventsQueue({ analyticsContext, clientKey, analyticsPath: ANALYTICS_PATH });\n\n const sendAnalyticsEvents = () => {\n if (capturedCheckoutAttemptId) {\n return eventsQueue.run(capturedCheckoutAttemptId);\n }\n return Promise.resolve(null);\n };\n\n const addAnalyticsEvent = (type: ANALYTICS_EVENT, obj: AnalyticsObject) => {\n const arrayName = type === ANALYTICS_EVENT_INFO ? type : `${type}s`;\n eventsQueue.add(`${arrayName}`, obj);\n\n /**\n * The logic is:\n * - info events are stored until a log or error comes along,\n * but, if after a set time, no other analytics event (log or error) has come along then we send the info events anyway\n */\n if (type === ANALYTICS_EVENT_INFO) {\n clearTimeout(sendEventsTimerId);\n sendEventsTimerId = setTimeout(sendAnalyticsEvents, ANALYTICS_INFO_TIMER_INTERVAL);\n }\n\n /**\n * The logic is:\n * - errors and logs get sent straightaway\n * ...but... tests with the 3DS2 process show that many logs can happen almost at the same time (or you can have an error followed immediately by a log),\n * so instead of making several sequential api calls we see if we can \"batch\" them using debounce\n */\n if (type === ANALYTICS_EVENT_LOG || type === ANALYTICS_EVENT_ERROR) {\n clearTimeout(sendEventsTimerId); // clear any timer that might be about to dispatch the info events array\n\n debounce(sendAnalyticsEvents)();\n }\n };\n\n const anlModule: AnalyticsModule = {\n /**\n * Make \"setup\" call, to pass containerWidth, buildType, channel etc, and receive a checkoutAttemptId in return\n * @param initialEvent -\n */\n setUp: async (initialEvent: AnalyticsInitialEvent) => {\n const { enabled, payload } = props; // TODO what is payload, is it ever used?\n\n const analyticsData = processAnalyticsData(props.analyticsData);\n\n if (enabled === true && !capturedCheckoutAttemptId) {\n try {\n const checkoutAttemptId = await collectId({\n ...initialEvent,\n ...(payload && { ...payload }),\n ...(Object.keys(analyticsData).length && { ...analyticsData })\n });\n capturedCheckoutAttemptId = checkoutAttemptId;\n } catch (e) {\n console.warn(`Fetching checkoutAttemptId failed.${e ? ` Error=${e}` : ''}`);\n }\n }\n },\n\n getCheckoutAttemptId: (): string => capturedCheckoutAttemptId,\n\n // Expose getter for testing purposes\n getEventsQueue: () => eventsQueue,\n\n createAnalyticsEvent: ({ event, data }: CreateAnalyticsEventObject): AnalyticsObject => {\n const aObj: AnalyticsObject = createAnalyticsObject({\n event,\n ...data\n });\n // console.log('### Analytics::createAnalyticsEvent:: event=', event, ' aObj=', aObj);\n\n addAnalyticsEvent(event, aObj);\n\n return aObj;\n },\n\n getEnabled: () => props.enabled,\n\n sendAnalytics: null\n };\n\n anlModule.sendAnalytics = analyticsPreProcessor(anlModule);\n\n return anlModule;\n};\n\nexport default Analytics;\n"],"names":["capturedCheckoutAttemptId","sendEventsTimerId","Analytics","locale","clientKey","analytics","amount","analyticsContext","bundleType","props","enabled","checkoutAttemptId","analyticsData","collectId","CollectId","analyticsPath","ANALYTICS_PATH","eventsQueue","EventsQueue","sendAnalyticsEvents","run","Promise","resolve","anlModule","setUp","async","initialEvent","payload","processAnalyticsData","Object","keys","length","e","console","warn","getCheckoutAttemptId","getEventsQueue","createAnalyticsEvent","event","data","aObj","createAnalyticsObject","type","obj","arrayName","ANALYTICS_EVENT_INFO","add","clearTimeout","setTimeout","ANALYTICS_INFO_TIMER_INTERVAL","ANALYTICS_EVENT_LOG","ANALYTICS_EVENT_ERROR","debounce","addAnalyticsEvent","getEnabled","sendAnalytics","analyticsPreProcessor"],"mappings":"ubASA,IAAIA,EAA4B,KAC5BC,EAAoB,KAExB,MAAMC,EAAY,EAAGC,SAAQC,YAAWC,YAAWC,SAAQC,mBAAkBC,iBACzE,MAMMC,EAAQ,CALVC,SAAS,EACTC,kBAAmB,KACnBC,cAAe,CAAC,KAGgBP,GAE9BQ,EAAYC,EAAU,CAAEP,mBAAkBH,YAAWD,SAAQG,SAAQS,cAAeC,EAAgBR,eACpGS,EAAiCC,EAAY,CAAEX,mBAAkBH,YAAWW,cAAeC,IAE3FG,EAAsB,IACpBnB,EACOiB,EAAYG,IAAIpB,GAEpBqB,QAAQC,QAAQ,MA8BrBC,EAA6B,CAK/BC,MAAOC,MAAOC,IACV,MAAMhB,QAAEA,EAAOiB,QAAEA,GAAYlB,EAEvBG,EAAgBgB,EAAqBnB,EAAMG,eAEjD,IAAgB,IAAZF,IAAqBV,EACrB,IACI,MAAMW,QAA0BE,EAAU,IACnCa,KACCC,GAAW,IAAKA,MAChBE,OAAOC,KAAKlB,GAAemB,QAAU,IAAKnB,KAElDZ,EAA4BW,CAChC,CAAE,MAAOqB,GACLC,QAAQC,KAAK,sCAAqCF,EAAI,UAAUA,IAAM,IAC1E,CACJ,EAGJG,qBAAsB,IAAcnC,EAGpCoC,eAAgB,IAAMnB,EAEtBoB,qBAAsB,EAAGC,QAAOC,WAC5B,MAAMC,EAAwBC,EAAsB,CAChDH,WACGC,IAMP,MAjEkB,EAACG,EAAuBC,KAC9C,MAAMC,EAAYF,IAASG,EAAuBH,EAAO,GAAGA,KAC5DzB,EAAY6B,IAAI,GAAGF,IAAaD,GAO5BD,IAASG,IACTE,aAAa9C,GACbA,EAAoB+C,WAAW7B,EAAqB8B,IASpDP,IAASQ,GAAuBR,IAASS,IACzCJ,aAAa9C,GAEbmD,EAASjC,EAATiC,GACJ,EAuCIC,CAAkBf,EAAOE,GAElBA,CAAAA,EAGXc,WAAY,IAAM7C,EAAMC,QAExB6C,cAAe,MAKnB,OAFAhC,EAAUgC,cAAgBC,EAAsBjC,GAEzCA,CAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutSession.js","sources":["../../../../src/core/CheckoutSession/CheckoutSession.ts"],"sourcesContent":["import makePayment from '../Services/sessions/make-payment';\nimport submitDetails from '../Services/sessions/submit-details';\nimport setupSession from '../Services/sessions/setup-session';\nimport checkBalance from '../Services/sessions/check-balance';\nimport Storage from '../../utils/Storage';\nimport createOrder from '../Services/sessions/create-order';\nimport { sanitizeSession } from './utils';\nimport {\n CheckoutSession,\n CheckoutSessionBalanceResponse,\n CheckoutSessionDetailsResponse,\n CheckoutSessionOrdersResponse,\n CheckoutSessionPaymentResponse,\n CheckoutSessionSetupResponse,\n SessionConfiguration\n} from './types';\nimport cancelOrder from '../Services/sessions/cancel-order';\nimport { onOrderCancelData } from '../../components/Dropin/types';\nimport { AdditionalDetailsStateData } from '../../types/global-types';\n\nclass Session {\n private readonly session: CheckoutSession;\n private readonly storage: Storage<CheckoutSession>;\n public readonly clientKey: string;\n public readonly loadingContext: string;\n public configuration: SessionConfiguration;\n\n constructor(rawSession: Partial<CheckoutSession>, clientKey: string, loadingContext: string) {\n const session = sanitizeSession(rawSession) as CheckoutSession;\n\n if (!clientKey) throw new Error('No clientKey available');\n if (!loadingContext) throw new Error('No loadingContext available');\n\n this.storage = new Storage('session', 'localStorage');\n this.clientKey = clientKey;\n this.loadingContext = loadingContext;\n this.session = session;\n\n if (!this.session.sessionData) {\n this.session = this.getStoredSession();\n } else {\n this.storeSession();\n }\n }\n\n get shopperLocale() {\n return this.session.shopperLocale;\n }\n\n get id() {\n return this.session.id;\n }\n\n get data() {\n return this.session.sessionData;\n }\n\n /**\n * Updates the session.data with the latest data blob\n */\n private updateSessionData(latestData: string): void {\n this.session.sessionData = latestData;\n this.storeSession();\n }\n\n /**\n * Fetches data from a session\n */\n setupSession(options): Promise<CheckoutSessionSetupResponse> {\n return setupSession(this, options).then(response => {\n if (response.configuration) {\n this.configuration = { ...response.configuration };\n }\n\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Submits a session payment\n */\n submitPayment(data): Promise<CheckoutSessionPaymentResponse> {\n return makePayment(data, this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Submits session payment additional details\n */\n submitDetails(data: AdditionalDetailsStateData['data']): Promise<CheckoutSessionDetailsResponse> {\n return submitDetails(data, this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Checks the balance for a payment method\n */\n checkBalance(data): Promise<CheckoutSessionBalanceResponse> {\n return checkBalance(data, this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Creates an order for the current session\n */\n createOrder(): Promise<CheckoutSessionOrdersResponse> {\n return createOrder(this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Cancels an order for the current session\n */\n cancelOrder(data: onOrderCancelData): Promise<CheckoutSessionOrdersResponse> {\n return cancelOrder(data.order, this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Gets the stored session but only if the current id and the stored id match\n */\n getStoredSession(): CheckoutSession {\n const storedSession = this.storage.get();\n return this.id === storedSession?.id ? storedSession : this.session;\n }\n\n /**\n * Stores the session\n */\n storeSession(): void {\n this.storage.set({ id: this.session.id, sessionData: this.session.sessionData });\n }\n\n /**\n * Clears the stored session\n */\n removeStoredSession(): void {\n this.storage.remove();\n }\n}\n\nexport default Session;\n"],"names":["Session","session","storage","clientKey","loadingContext","configuration","constructor","rawSession","sanitizeSession","Error","this","Storage","sessionData","storeSession","getStoredSession","shopperLocale","id","data","updateSessionData","latestData","setupSession","options","then","response","submitPayment","makePayment","submitDetails","checkBalance","createOrder","cancelOrder","order","storedSession","get","set","removeStoredSession","remove"],"mappings":"+YAoBA,MAAMA,EACeC,QACAC,QACDC,UACAC,eACTC,cAEPC,WAAAA,CAAYC,EAAsCJ,EAAmBC,GACjE,MAAMH,EAAUO,EAAgBD,GAEhC,IAAKJ,EAAW,MAAM,IAAIM,MAAM,0BAChC,IAAKL,EAAgB,MAAM,IAAIK,MAAM,+BAErCC,KAAKR,QAAU,IAAIS,EAAQ,UAAW,gBACtCD,KAAKP,UAAYA,EACjBO,KAAKN,eAAiBA,EACtBM,KAAKT,QAAUA,EAEVS,KAAKT,QAAQW,YAGdF,KAAKG,eAFLH,KAAKT,QAAUS,KAAKI,kBAI5B,CAEA,iBAAIC,GACA,OAAOL,KAAKT,QAAQc,aACxB,CAEA,MAAIC,GACA,OAAON,KAAKT,QAAQe,EACxB,CAEA,QAAIC,GACA,OAAOP,KAAKT,QAAQW,WACxB,CAKQM,iBAAAA,CAAkBC,GACtBT,KAAKT,QAAQW,YAAcO,EAC3BT,KAAKG,cACT,CAKAO,YAAAA,CAAaC,GACT,OAAOD,EAAaV,KAAMW,GAASC,MAAKC,IAChCA,EAASlB,gBACTK,KAAKL,cAAgB,IAAKkB,EAASlB,gBAGnCkB,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAC,aAAAA,CAAcP,GACV,OAAOQ,EAAYR,EAAMP,MAAMY,MAAKC,IAC5BA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAG,aAAAA,CAAcT,GACV,OAAOS,EAAcT,EAAMP,MAAMY,MAAKC,IAC9BA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAI,YAAAA,CAAaV,GACT,OAAOU,EAAaV,EAAMP,MAAMY,MAAKC,IAC7BA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAK,WAAAA,GACI,OAAOA,EAAYlB,MAAMY,MAAKC,IACtBA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAM,WAAAA,CAAYZ,GACR,OAAOY,EAAYZ,EAAKa,MAAOpB,MAAMY,MAAKC,IAClCA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAT,gBAAAA,GACI,MAAMiB,EAAgBrB,KAAKR,QAAQ8B,MACnC,OAAOtB,KAAKM,KAAOe,GAAef,GAAKe,EAAgBrB,KAAKT,OAChE,CAKAY,YAAAA,GACIH,KAAKR,QAAQ+B,IAAI,CAAEjB,GAAIN,KAAKT,QAAQe,GAAIJ,YAAaF,KAAKT,QAAQW,aACtE,CAKAsB,mBAAAA,GACIxB,KAAKR,QAAQiC,QACjB"}
1
+ {"version":3,"file":"CheckoutSession.js","sources":["../../../../src/core/CheckoutSession/CheckoutSession.ts"],"sourcesContent":["import makePayment from '../Services/sessions/make-payment';\nimport submitDetails from '../Services/sessions/submit-details';\nimport setupSession from '../Services/sessions/setup-session';\nimport checkBalance from '../Services/sessions/check-balance';\nimport Storage from '../../utils/Storage';\nimport createOrder from '../Services/sessions/create-order';\nimport { sanitizeSession } from './utils';\nimport {\n CheckoutSession,\n CheckoutSessionBalanceResponse,\n CheckoutSessionDetailsResponse,\n CheckoutSessionOrdersResponse,\n CheckoutSessionPaymentResponse,\n CheckoutSessionSetupResponse,\n SessionConfiguration\n} from './types';\nimport cancelOrder from '../Services/sessions/cancel-order';\nimport { onOrderCancelData } from '../../components/Dropin/types';\nimport type { AdditionalDetailsData } from '../types';\n\nclass Session {\n private readonly session: CheckoutSession;\n private readonly storage: Storage<CheckoutSession>;\n public readonly clientKey: string;\n public readonly loadingContext: string;\n public configuration: SessionConfiguration;\n\n constructor(rawSession: Partial<CheckoutSession>, clientKey: string, loadingContext: string) {\n const session = sanitizeSession(rawSession) as CheckoutSession;\n\n if (!clientKey) throw new Error('No clientKey available');\n if (!loadingContext) throw new Error('No loadingContext available');\n\n this.storage = new Storage('session', 'localStorage');\n this.clientKey = clientKey;\n this.loadingContext = loadingContext;\n this.session = session;\n\n if (!this.session.sessionData) {\n this.session = this.getStoredSession();\n } else {\n this.storeSession();\n }\n }\n\n get shopperLocale() {\n return this.session.shopperLocale;\n }\n\n get id() {\n return this.session.id;\n }\n\n get data() {\n return this.session.sessionData;\n }\n\n /**\n * Updates the session.data with the latest data blob\n */\n private updateSessionData(latestData: string): void {\n this.session.sessionData = latestData;\n this.storeSession();\n }\n\n /**\n * Fetches data from a session\n */\n setupSession(options): Promise<CheckoutSessionSetupResponse> {\n return setupSession(this, options).then(response => {\n if (response.configuration) {\n this.configuration = { ...response.configuration };\n }\n\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Submits a session payment\n */\n submitPayment(data): Promise<CheckoutSessionPaymentResponse> {\n return makePayment(data, this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Submits session payment additional details\n */\n submitDetails(data: AdditionalDetailsData['data']): Promise<CheckoutSessionDetailsResponse> {\n return submitDetails(data, this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Checks the balance for a payment method\n */\n checkBalance(data): Promise<CheckoutSessionBalanceResponse> {\n return checkBalance(data, this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Creates an order for the current session\n */\n createOrder(): Promise<CheckoutSessionOrdersResponse> {\n return createOrder(this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Cancels an order for the current session\n */\n cancelOrder(data: onOrderCancelData): Promise<CheckoutSessionOrdersResponse> {\n return cancelOrder(data.order, this).then(response => {\n if (response.sessionData) {\n this.updateSessionData(response.sessionData);\n }\n\n return response;\n });\n }\n\n /**\n * Gets the stored session but only if the current id and the stored id match\n */\n getStoredSession(): CheckoutSession {\n const storedSession = this.storage.get();\n return this.id === storedSession?.id ? storedSession : this.session;\n }\n\n /**\n * Stores the session\n */\n storeSession(): void {\n this.storage.set({ id: this.session.id, sessionData: this.session.sessionData });\n }\n\n /**\n * Clears the stored session\n */\n removeStoredSession(): void {\n this.storage.remove();\n }\n}\n\nexport default Session;\n"],"names":["Session","session","storage","clientKey","loadingContext","configuration","constructor","rawSession","sanitizeSession","Error","this","Storage","sessionData","storeSession","getStoredSession","shopperLocale","id","data","updateSessionData","latestData","setupSession","options","then","response","submitPayment","makePayment","submitDetails","checkBalance","createOrder","cancelOrder","order","storedSession","get","set","removeStoredSession","remove"],"mappings":"+YAoBA,MAAMA,EACeC,QACAC,QACDC,UACAC,eACTC,cAEPC,WAAAA,CAAYC,EAAsCJ,EAAmBC,GACjE,MAAMH,EAAUO,EAAgBD,GAEhC,IAAKJ,EAAW,MAAM,IAAIM,MAAM,0BAChC,IAAKL,EAAgB,MAAM,IAAIK,MAAM,+BAErCC,KAAKR,QAAU,IAAIS,EAAQ,UAAW,gBACtCD,KAAKP,UAAYA,EACjBO,KAAKN,eAAiBA,EACtBM,KAAKT,QAAUA,EAEVS,KAAKT,QAAQW,YAGdF,KAAKG,eAFLH,KAAKT,QAAUS,KAAKI,kBAI5B,CAEA,iBAAIC,GACA,OAAOL,KAAKT,QAAQc,aACxB,CAEA,MAAIC,GACA,OAAON,KAAKT,QAAQe,EACxB,CAEA,QAAIC,GACA,OAAOP,KAAKT,QAAQW,WACxB,CAKQM,iBAAAA,CAAkBC,GACtBT,KAAKT,QAAQW,YAAcO,EAC3BT,KAAKG,cACT,CAKAO,YAAAA,CAAaC,GACT,OAAOD,EAAaV,KAAMW,GAASC,MAAKC,IAChCA,EAASlB,gBACTK,KAAKL,cAAgB,IAAKkB,EAASlB,gBAGnCkB,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAC,aAAAA,CAAcP,GACV,OAAOQ,EAAYR,EAAMP,MAAMY,MAAKC,IAC5BA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAG,aAAAA,CAAcT,GACV,OAAOS,EAAcT,EAAMP,MAAMY,MAAKC,IAC9BA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAI,YAAAA,CAAaV,GACT,OAAOU,EAAaV,EAAMP,MAAMY,MAAKC,IAC7BA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAK,WAAAA,GACI,OAAOA,EAAYlB,MAAMY,MAAKC,IACtBA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAM,WAAAA,CAAYZ,GACR,OAAOY,EAAYZ,EAAKa,MAAOpB,MAAMY,MAAKC,IAClCA,EAASX,aACTF,KAAKQ,kBAAkBK,EAASX,aAG7BW,IAEf,CAKAT,gBAAAA,GACI,MAAMiB,EAAgBrB,KAAKR,QAAQ8B,MACnC,OAAOtB,KAAKM,KAAOe,GAAef,GAAKe,EAAgBrB,KAAKT,OAChE,CAKAY,YAAAA,GACIH,KAAKR,QAAQ+B,IAAI,CAAEjB,GAAIN,KAAKT,QAAQe,GAAIJ,YAAaF,KAAKT,QAAQW,aACtE,CAKAsB,mBAAAA,GACIxB,KAAKR,QAAQiC,QACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentAction.js","sources":["../../../../../src/core/ProcessResponse/PaymentAction/PaymentAction.ts"],"sourcesContent":["import actionTypes from './actionTypes';\nimport type { PaymentAction } from '../../../types/global-types';\nimport type { IRegistry } from '../../core.registry';\nimport type { ICore } from '../../types';\n// import type { IUIElement } from '../../../components/internal/UIElement/types';\nimport UIElement from '../../../components/internal/UIElement';\n\nexport function getComponentForAction(core: ICore, registry: IRegistry, action: PaymentAction, props = {}): UIElement {\n const nextAction = actionTypes[action.type];\n\n if (nextAction && typeof nextAction === 'function') {\n return nextAction(core, registry, action, props);\n }\n\n throw new Error('Invalid Action');\n}\n\nexport default getComponentForAction;\n"],"names":["getComponentForAction","core","registry","action","props","nextAction","actionTypes","type","Error"],"mappings":"gCAOO,SAASA,EAAsBC,EAAaC,EAAqBC,EAAuBC,EAAQ,CAAA,GACnG,MAAMC,EAAaC,EAAYH,EAAOI,MAEtC,GAAIF,GAAoC,mBAAfA,EACrB,OAAOA,EAAWJ,EAAMC,EAAUC,EAAQC,GAG9C,MAAM,IAAII,MAAM,iBACpB"}
1
+ {"version":3,"file":"PaymentAction.js","sources":["../../../../../src/core/ProcessResponse/PaymentAction/PaymentAction.ts"],"sourcesContent":["import actionTypes from './actionTypes';\nimport type { PaymentAction } from '../../../types/global-types';\nimport type { IRegistry } from '../../core.registry';\nimport type { ICore } from '../../types';\nimport UIElement from '../../../components/internal/UIElement';\n\nexport function getComponentForAction(core: ICore, registry: IRegistry, action: PaymentAction, props = {}): UIElement {\n const nextAction = actionTypes[action.type];\n\n if (nextAction && typeof nextAction === 'function') {\n return nextAction(core, registry, action, props);\n }\n\n throw new Error('Invalid Action');\n}\n\nexport default getComponentForAction;\n"],"names":["getComponentForAction","core","registry","action","props","nextAction","actionTypes","type","Error"],"mappings":"gCAMO,SAASA,EAAsBC,EAAaC,EAAqBC,EAAuBC,EAAQ,CAAA,GACnG,MAAMC,EAAaC,EAAYH,EAAOI,MAEtC,GAAIF,GAAoC,mBAAfA,EACrB,OAAOA,EAAWJ,EAAMC,EAAUC,EAAQC,GAG9C,MAAM,IAAII,MAAM,iBACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"actionTypes.js","sources":["../../../../../src/core/ProcessResponse/PaymentAction/actionTypes.ts"],"sourcesContent":["import { get3DS2FlowProps } from '../../../components/ThreeDS2/components/utils';\nimport uuid from '../../../utils/uuid';\nimport type { PaymentAction } from '../../../types/global-types';\nimport type { IRegistry } from '../../core.registry';\nimport type { ICore } from '../../types';\nimport type { IUIElement } from '../../../components/internal/UIElement/types';\n\nconst createComponent = (core: ICore, registry: IRegistry, componentType, props): IUIElement => {\n const Element = registry.getComponent(componentType);\n\n if (!Element) {\n throw Error(`Action Element of type ${componentType} not found in the registry`);\n }\n\n return new Element(core, { ...props, id: `${componentType}-${uuid()}` });\n};\n\nconst getActionHandler = statusType => {\n return (core: ICore, registry: IRegistry, action: PaymentAction, props) => {\n const config = {\n ...props,\n ...action,\n onComplete: props.onAdditionalDetails,\n onError: props.onError,\n statusType\n };\n\n return createComponent(core, registry, action.paymentMethodType, config);\n };\n};\n\nconst actionTypes = {\n redirect: (core: ICore, registry, action: PaymentAction, props) => {\n const config = {\n ...props,\n ...action,\n statusType: 'redirect'\n };\n\n return createComponent(core, registry, 'redirect', config);\n },\n\n threeDS2: (core: ICore, registry, action: PaymentAction, props) => {\n const componentType = action.subtype === 'fingerprint' ? 'threeDS2DeviceFingerprint' : 'threeDS2Challenge';\n\n const paymentData = action.subtype === 'fingerprint' || props.isMDFlow ? action.paymentData : action.authorisationToken;\n\n const config = {\n // Props common to both flows\n core: core,\n token: action.token,\n paymentData,\n onActionHandled: props.onActionHandled,\n onComplete: props.isMDFlow ? props.onComplete : props.onAdditionalDetails,\n onError: props.onError,\n isDropin: !!props.isDropin,\n loadingContext: props.loadingContext,\n clientKey: props.clientKey,\n paymentMethodType: props.paymentMethodType,\n challengeWindowSize: props.challengeWindowSize, // always pass challengeWindowSize in case it's been set directly in the handleAction config object\n isMDFlow: props.isMDFlow,\n modules: {\n analytics: props.modules?.analytics,\n resources: props.modules?.resources\n },\n\n // Props unique to a particular flow\n ...get3DS2FlowProps(action.subtype, props)\n };\n\n return createComponent(core, registry, componentType, config);\n },\n\n voucher: getActionHandler('custom'),\n qrCode: getActionHandler('custom'),\n await: getActionHandler('custom'),\n bankTransfer: getActionHandler('custom'),\n sdk: getActionHandler('custom')\n} as const;\n\nexport default actionTypes;\n"],"names":["createComponent","core","registry","componentType","props","Element","getComponent","Error","id","uuid","getActionHandler","statusType","action","config","onComplete","onAdditionalDetails","onError","paymentMethodType","actionTypes","redirect","threeDS2","subtype","paymentData","isMDFlow","authorisationToken","token","onActionHandled","isDropin","loadingContext","clientKey","challengeWindowSize","modules","analytics","resources","get3DS2FlowProps","voucher","qrCode","await","bankTransfer","sdk"],"mappings":"0HAOA,MAAMA,EAAkB,CAACC,EAAaC,EAAqBC,EAAeC,KACtE,MAAMC,EAAUH,EAASI,aAAaH,GAEtC,IAAKE,EACD,MAAME,MAAM,0BAA0BJ,+BAG1C,OAAO,IAAIE,EAAQJ,EAAM,IAAKG,EAAOI,GAAI,GAAGL,KAAiBM,OAAS,EAGpEC,EAAmBC,GACd,CAACV,EAAaC,EAAqBU,EAAuBR,KAC7D,MAAMS,EAAS,IACRT,KACAQ,EACHE,WAAYV,EAAMW,oBAClBC,QAASZ,EAAMY,QACfL,cAGJ,OAAOX,EAAgBC,EAAMC,EAAUU,EAAOK,kBAAmBJ,EAAAA,EAInEK,EAAc,CAChBC,SAAU,CAAClB,EAAaC,EAAUU,EAAuBR,KACrD,MAAMS,EAAS,IACRT,KACAQ,EACHD,WAAY,YAGhB,OAAOX,EAAgBC,EAAMC,EAAU,WAAYW,EAAAA,EAGvDO,SAAU,CAACnB,EAAaC,EAAUU,EAAuBR,KACrD,MAAMD,EAAmC,gBAAnBS,EAAOS,QAA4B,4BAA8B,oBAEjFC,EAAiC,gBAAnBV,EAAOS,SAA6BjB,EAAMmB,SAAWX,EAAOU,YAAcV,EAAOY,mBAE/FX,EAAS,CAEXZ,KAAMA,EACNwB,MAAOb,EAAOa,MACdH,cACAI,gBAAiBtB,EAAMsB,gBACvBZ,WAAYV,EAAMmB,SAAWnB,EAAMU,WAAaV,EAAMW,oBACtDC,QAASZ,EAAMY,QACfW,WAAYvB,EAAMuB,SAClBC,eAAgBxB,EAAMwB,eACtBC,UAAWzB,EAAMyB,UACjBZ,kBAAmBb,EAAMa,kBACzBa,oBAAqB1B,EAAM0B,oBAC3BP,SAAUnB,EAAMmB,SAChBQ,QAAS,CACLC,UAAW5B,EAAM2B,SAASC,UAC1BC,UAAW7B,EAAM2B,SAASE,cAI3BC,EAAiBtB,EAAOS,QAASjB,IAGxC,OAAOJ,EAAgBC,EAAMC,EAAUC,EAAeU,EAAAA,EAG1DsB,QAASzB,EAAiB,UAC1B0B,OAAQ1B,EAAiB,UACzB2B,MAAO3B,EAAiB,UACxB4B,aAAc5B,EAAiB,UAC/B6B,IAAK7B,EAAiB"}
1
+ {"version":3,"file":"actionTypes.js","sources":["../../../../../src/core/ProcessResponse/PaymentAction/actionTypes.ts"],"sourcesContent":["import { get3DS2FlowProps } from '../../../components/ThreeDS2/components/utils';\nimport uuid from '../../../utils/uuid';\nimport UIElement from '../../../components/internal/UIElement';\nimport type { PaymentAction } from '../../../types/global-types';\nimport type { IRegistry } from '../../core.registry';\nimport type { ICore } from '../../types';\n\nconst createComponent = (core: ICore, registry: IRegistry, componentType, props): UIElement => {\n const Element = registry.getComponent(componentType);\n\n if (!Element) {\n throw Error(`Action Element of type ${componentType} not found in the registry`);\n }\n\n return new Element(core, { ...props, id: `${componentType}-${uuid()}` });\n};\n\nconst getActionHandler = statusType => {\n return (core: ICore, registry: IRegistry, action: PaymentAction, props) => {\n const config = {\n ...props,\n ...action,\n onComplete: props.onAdditionalDetails,\n onError: props.onError,\n statusType\n };\n\n return createComponent(core, registry, action.paymentMethodType, config);\n };\n};\n\nconst actionTypes = {\n redirect: (core: ICore, registry, action: PaymentAction, props) => {\n const config = {\n ...props,\n ...action,\n statusType: 'redirect'\n };\n\n return createComponent(core, registry, 'redirect', config);\n },\n\n threeDS2: (core: ICore, registry, action: PaymentAction, props) => {\n const componentType = action.subtype === 'fingerprint' ? 'threeDS2DeviceFingerprint' : 'threeDS2Challenge';\n\n /**\n * NOTE: the isMDFlow prop comes from the options object, added within the MDFlow when it calls createFromAction(action, options) to initiate a 3DS2 component\n * It replaces the useOriginalFlow config prop that the MDFlow used to pass when directly initiating the threeDS2Fingerprint or threeDS2Challenge components\n */\n const paymentData = action.subtype === 'fingerprint' || props.isMDFlow ? action.paymentData : action.authorisationToken;\n\n const config = {\n // Props common to both flows\n core: core,\n token: action.token,\n paymentData,\n onActionHandled: props.onActionHandled,\n onComplete: props.isMDFlow ? props.onComplete : props.onAdditionalDetails,\n onError: props.onError,\n isDropin: !!props.isDropin,\n loadingContext: props.loadingContext,\n clientKey: props.clientKey,\n paymentMethodType: props.paymentMethodType,\n challengeWindowSize: props.challengeWindowSize, // always pass challengeWindowSize in case it's been set directly in the handleAction config object\n isMDFlow: props.isMDFlow,\n modules: {\n analytics: props.modules?.analytics,\n resources: props.modules?.resources\n },\n\n // Props unique to a particular flow\n ...get3DS2FlowProps(action.subtype, props)\n };\n\n return createComponent(core, registry, componentType, config);\n },\n\n voucher: getActionHandler('custom'),\n qrCode: getActionHandler('custom'),\n await: getActionHandler('custom'),\n bankTransfer: getActionHandler('custom'),\n sdk: getActionHandler('custom')\n} as const;\n\nexport default actionTypes;\n"],"names":["createComponent","core","registry","componentType","props","Element","getComponent","Error","id","uuid","getActionHandler","statusType","action","config","onComplete","onAdditionalDetails","onError","paymentMethodType","actionTypes","redirect","threeDS2","subtype","paymentData","isMDFlow","authorisationToken","token","onActionHandled","isDropin","loadingContext","clientKey","challengeWindowSize","modules","analytics","resources","get3DS2FlowProps","voucher","qrCode","await","bankTransfer","sdk"],"mappings":"0HAOA,MAAMA,EAAkB,CAACC,EAAaC,EAAqBC,EAAeC,KACtE,MAAMC,EAAUH,EAASI,aAAaH,GAEtC,IAAKE,EACD,MAAME,MAAM,0BAA0BJ,+BAG1C,OAAO,IAAIE,EAAQJ,EAAM,IAAKG,EAAOI,GAAI,GAAGL,KAAiBM,OAAS,EAGpEC,EAAmBC,GACd,CAACV,EAAaC,EAAqBU,EAAuBR,KAC7D,MAAMS,EAAS,IACRT,KACAQ,EACHE,WAAYV,EAAMW,oBAClBC,QAASZ,EAAMY,QACfL,cAGJ,OAAOX,EAAgBC,EAAMC,EAAUU,EAAOK,kBAAmBJ,EAAAA,EAInEK,EAAc,CAChBC,SAAU,CAAClB,EAAaC,EAAUU,EAAuBR,KACrD,MAAMS,EAAS,IACRT,KACAQ,EACHD,WAAY,YAGhB,OAAOX,EAAgBC,EAAMC,EAAU,WAAYW,EAAAA,EAGvDO,SAAU,CAACnB,EAAaC,EAAUU,EAAuBR,KACrD,MAAMD,EAAmC,gBAAnBS,EAAOS,QAA4B,4BAA8B,oBAMjFC,EAAiC,gBAAnBV,EAAOS,SAA6BjB,EAAMmB,SAAWX,EAAOU,YAAcV,EAAOY,mBAE/FX,EAAS,CAEXZ,KAAMA,EACNwB,MAAOb,EAAOa,MACdH,cACAI,gBAAiBtB,EAAMsB,gBACvBZ,WAAYV,EAAMmB,SAAWnB,EAAMU,WAAaV,EAAMW,oBACtDC,QAASZ,EAAMY,QACfW,WAAYvB,EAAMuB,SAClBC,eAAgBxB,EAAMwB,eACtBC,UAAWzB,EAAMyB,UACjBZ,kBAAmBb,EAAMa,kBACzBa,oBAAqB1B,EAAM0B,oBAC3BP,SAAUnB,EAAMmB,SAChBQ,QAAS,CACLC,UAAW5B,EAAM2B,SAASC,UAC1BC,UAAW7B,EAAM2B,SAASE,cAI3BC,EAAiBtB,EAAOS,QAASjB,IAGxC,OAAOJ,EAAgBC,EAAMC,EAAUC,EAAeU,EAAAA,EAG1DsB,QAASzB,EAAiB,UAC1B0B,OAAQ1B,EAAiB,UACzB2B,MAAO3B,EAAiB,UACxB4B,aAAc5B,EAAiB,UAC/B6B,IAAK7B,EAAiB"}
@@ -1,2 +1,2 @@
1
- import{httpPost as e}from"../http.js";import t from"../../../utils/Storage.js";const o='WARNING: Failed to retrieve "checkoutAttemptId". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';const n=({analyticsContext:n,clientKey:r,locale:i,analyticsPath:a,bundleType:c})=>{let l;const s={errorLevel:"fatal",loadingContext:n,path:`${a}?clientKey=${r}`};return n=>{const a={version:"6.0.0-alpha.8",channel:"Web",platform:"Web",buildType:c,locale:i,referrer:window.location.href,screenWidth:window.screen.width,...n};if(l)return l;if(!r)return Promise.reject("no-client-key");const m=new t("checkout-attempt-id","sessionStorage"),p=m.get();return function(e){if(!e?.id)return!1;const t=Date.now()-9e5;return e.timestamp>t}(p)?Promise.resolve(p.id):(l=e(s,a).then((e=>{if(e?.checkoutAttemptId)return m.set({id:e.checkoutAttemptId,timestamp:Date.now()}),e.checkoutAttemptId})).catch((()=>Promise.reject(o))),l)}};export{o as FAILURE_MSG,n as default};
1
+ import{httpPost as e}from"../http.js";import t from"../../../utils/Storage.js";const o='WARNING: Failed to retrieve "checkoutAttemptId". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';const n=({analyticsContext:n,clientKey:r,locale:i,analyticsPath:c,bundleType:a})=>{let l;const s={errorLevel:"fatal",loadingContext:n,path:`${c}?clientKey=${r}`};return n=>{const c={version:"6.0.0-beta.0",channel:"Web",platform:"Web",buildType:a,locale:i,referrer:window.location.href,screenWidth:window.screen.width,...n};if(l)return l;if(!r)return Promise.reject("no-client-key");const m=new t("checkout-attempt-id","sessionStorage"),d=m.get();return function(e){if(!e?.id)return!1;const t=Date.now()-9e5;return e.timestamp>t}(d)?Promise.resolve(d.id):(l=e(s,c).then((e=>{if(e?.checkoutAttemptId)return m.set({id:e.checkoutAttemptId,timestamp:Date.now()}),e.checkoutAttemptId})).catch((()=>Promise.reject(o))),l)}};export{o as FAILURE_MSG,n as default};
2
2
  //# sourceMappingURL=collect-id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collect-id.js","sources":["../../../../../src/core/Services/analytics/collect-id.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Storage from '../../../utils/Storage';\nimport { CheckoutAttemptIdSession, CollectIdEvent, CollectIdProps, TelemetryEvent } from './types';\n\nexport const FAILURE_MSG =\n 'WARNING: Failed to retrieve \"checkoutAttemptId\". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';\n\n/**\n * If the checkout attempt ID was stored more than fifteen minutes ago, then we should request a new ID.\n * More here: COWEB-1099\n */\nfunction confirmSessionDurationIsMaxFifteenMinutes(checkoutAttemptIdSession: CheckoutAttemptIdSession): boolean {\n if (!checkoutAttemptIdSession?.id) return false;\n\n const fifteenMinInMs = 1000 * 60 * 15;\n const fifteenMinAgoTimestamp = Date.now() - fifteenMinInMs;\n return checkoutAttemptIdSession.timestamp > fifteenMinAgoTimestamp;\n}\n\n/**\n * Send an event to Adyen with some basic telemetry info and receive a checkoutAttemptId in response\n * @param config - object containing values needed to calculate the url for the request; and also some that need to be serialized and included in the body of request\n * @returns a function returning a promise containing the response of the call (an object containing a checkoutAttemptId property)\n */\n// const collectId = ({ analyticsContext, clientKey, locale, amount }: CollectIdProps) => { // TODO - amount will be supported in the future\nconst collectId = ({ analyticsContext, clientKey, locale, analyticsPath, bundleType }: CollectIdProps) => {\n let promise;\n\n const options = {\n errorLevel: 'fatal' as const, // ensure our catch block is called\n loadingContext: analyticsContext,\n path: `${analyticsPath}?clientKey=${clientKey}`\n };\n\n return (event: CollectIdEvent): Promise<string> => {\n const telemetryEvent: TelemetryEvent = {\n // amount, // TODO will be supported in the future\n version: process.env.VERSION,\n // The data team want both platform & channel properties:\n channel: 'Web',\n platform: 'Web',\n buildType: bundleType,\n locale,\n referrer: window.location.href,\n screenWidth: window.screen.width,\n ...event\n };\n\n if (promise) return promise; // Prevents multiple standalone components on the same page from making multiple calls to collect a checkoutAttemptId\n if (!clientKey) return Promise.reject('no-client-key');\n\n const storage = new Storage<CheckoutAttemptIdSession>('checkout-attempt-id', 'sessionStorage');\n const checkoutAttemptIdSession = storage.get();\n\n // In some cases, e.g. where the merchant has redirected the shopper and then returned them to checkout, we still have a valid checkoutAttemptId\n // so there is no need for the re-initialised Checkout to generate another one\n if (confirmSessionDurationIsMaxFifteenMinutes(checkoutAttemptIdSession)) {\n return Promise.resolve(checkoutAttemptIdSession.id);\n }\n\n promise = httpPost(options, telemetryEvent)\n .then(conversion => {\n if (conversion?.checkoutAttemptId) {\n storage.set({ id: conversion.checkoutAttemptId, timestamp: Date.now() });\n return conversion.checkoutAttemptId;\n }\n return undefined;\n })\n .catch(() => {\n return Promise.reject(FAILURE_MSG);\n });\n\n return promise;\n };\n};\n\nexport default collectId;\n"],"names":["FAILURE_MSG","collectId","analyticsContext","clientKey","locale","analyticsPath","bundleType","promise","options","errorLevel","loadingContext","path","event","telemetryEvent","version","channel","platform","buildType","referrer","window","location","href","screenWidth","screen","width","Promise","reject","storage","Storage","checkoutAttemptIdSession","get","id","fifteenMinAgoTimestamp","Date","now","timestamp","confirmSessionDurationIsMaxFifteenMinutes","resolve","httpPost","then","conversion","checkoutAttemptId","set","undefined","catch"],"mappings":"+EAIO,MAAMA,EACT,uKAoBJ,MAAMC,EAAY,EAAGC,mBAAkBC,YAAWC,SAAQC,gBAAeC,iBACrE,IAAIC,EAEJ,MAAMC,EAAU,CACZC,WAAY,QACZC,eAAgBR,EAChBS,KAAM,GAAGN,eAA2BF,KAGxC,OAAQS,IACJ,MAAMC,EAAiC,CAEnCC,QAAS,gBAETC,QAAS,MACTC,SAAU,MACVC,UAAWX,EACXF,SACAc,SAAUC,OAAOC,SAASC,KAC1BC,YAAaH,OAAOI,OAAOC,SACxBZ,GAGP,GAAIL,EAAS,OAAOA,EACpB,IAAKJ,EAAW,OAAOsB,QAAQC,OAAO,iBAEtC,MAAMC,EAAU,IAAIC,EAAkC,sBAAuB,kBACvEC,EAA2BF,EAAQG,MAIzC,OA7CR,SAAmDD,GAC/C,IAAKA,GAA0BE,GAAI,OAAO,EAE1C,MACMC,EAAyBC,KAAKC,MADb,IAEvB,OAAOL,EAAyBM,UAAYH,CAChD,CAuCYI,CAA0CP,GACnCJ,QAAQY,QAAQR,EAAyBE,KAGpDxB,EAAU+B,EAAS9B,EAASK,GACvB0B,MAAKC,IACF,GAAIA,GAAYC,kBAEZ,OADAd,EAAQe,IAAI,CAAEX,GAAIS,EAAWC,kBAAmBN,UAAWF,KAAKC,QACzDM,EAAWC,iBAEfE,IAEVC,OAAM,IACInB,QAAQC,OAAO1B,KAGvBO,EAAAA,CACX"}
1
+ {"version":3,"file":"collect-id.js","sources":["../../../../../src/core/Services/analytics/collect-id.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Storage from '../../../utils/Storage';\nimport { CheckoutAttemptIdSession, CollectIdEvent, CollectIdProps, TelemetryEvent } from './types';\n\nexport const FAILURE_MSG =\n 'WARNING: Failed to retrieve \"checkoutAttemptId\". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';\n\n/**\n * If the checkout attempt ID was stored more than fifteen minutes ago, then we should request a new ID.\n * More here: COWEB-1099\n */\nfunction confirmSessionDurationIsMaxFifteenMinutes(checkoutAttemptIdSession: CheckoutAttemptIdSession): boolean {\n if (!checkoutAttemptIdSession?.id) return false;\n\n const fifteenMinInMs = 1000 * 60 * 15;\n const fifteenMinAgoTimestamp = Date.now() - fifteenMinInMs;\n return checkoutAttemptIdSession.timestamp > fifteenMinAgoTimestamp;\n}\n\n/**\n * Send an event to Adyen with some basic telemetry info and receive a checkoutAttemptId in response\n * @param config - object containing values needed to calculate the url for the request; and also some that need to be serialized and included in the body of request\n * @returns a function returning a promise containing the response of the call (an object containing a checkoutAttemptId property)\n */\n// const collectId = ({ analyticsContext, clientKey, locale, amount }: CollectIdProps) => { // TODO - amount will be supported in the future\nconst collectId = ({ analyticsContext, clientKey, locale, analyticsPath, bundleType }: CollectIdProps) => {\n let promise;\n\n const options = {\n errorLevel: 'fatal' as const, // ensure our catch block is called\n loadingContext: analyticsContext,\n path: `${analyticsPath}?clientKey=${clientKey}`\n };\n\n return (event: CollectIdEvent): Promise<string> => {\n const telemetryEvent: TelemetryEvent = {\n // amount, // TODO will be supported in the future\n version: process.env.VERSION,\n // The data team want both platform & channel properties:\n channel: 'Web',\n platform: 'Web',\n buildType: bundleType,\n locale,\n referrer: window.location.href,\n screenWidth: window.screen.width,\n ...event\n };\n\n if (promise) return promise; // Prevents multiple standalone components on the same page from making multiple calls to collect a checkoutAttemptId\n if (!clientKey) return Promise.reject('no-client-key');\n\n const storage = new Storage<CheckoutAttemptIdSession>('checkout-attempt-id', 'sessionStorage');\n const checkoutAttemptIdSession = storage.get();\n\n // In some cases, e.g. where the merchant has redirected the shopper and then returned them to checkout, we still have a valid checkoutAttemptId\n // so there is no need for the re-initialised Checkout to generate another one\n if (confirmSessionDurationIsMaxFifteenMinutes(checkoutAttemptIdSession)) {\n return Promise.resolve(checkoutAttemptIdSession.id);\n }\n\n promise = httpPost(options, telemetryEvent)\n .then(conversion => {\n if (conversion?.checkoutAttemptId) {\n storage.set({ id: conversion.checkoutAttemptId, timestamp: Date.now() });\n return conversion.checkoutAttemptId;\n }\n return undefined;\n })\n .catch(() => {\n return Promise.reject(FAILURE_MSG);\n });\n\n return promise;\n };\n};\n\nexport default collectId;\n"],"names":["FAILURE_MSG","collectId","analyticsContext","clientKey","locale","analyticsPath","bundleType","promise","options","errorLevel","loadingContext","path","event","telemetryEvent","version","channel","platform","buildType","referrer","window","location","href","screenWidth","screen","width","Promise","reject","storage","Storage","checkoutAttemptIdSession","get","id","fifteenMinAgoTimestamp","Date","now","timestamp","confirmSessionDurationIsMaxFifteenMinutes","resolve","httpPost","then","conversion","checkoutAttemptId","set","undefined","catch"],"mappings":"+EAIO,MAAMA,EACT,uKAoBJ,MAAMC,EAAY,EAAGC,mBAAkBC,YAAWC,SAAQC,gBAAeC,iBACrE,IAAIC,EAEJ,MAAMC,EAAU,CACZC,WAAY,QACZC,eAAgBR,EAChBS,KAAM,GAAGN,eAA2BF,KAGxC,OAAQS,IACJ,MAAMC,EAAiC,CAEnCC,QAAS,eAETC,QAAS,MACTC,SAAU,MACVC,UAAWX,EACXF,SACAc,SAAUC,OAAOC,SAASC,KAC1BC,YAAaH,OAAOI,OAAOC,SACxBZ,GAGP,GAAIL,EAAS,OAAOA,EACpB,IAAKJ,EAAW,OAAOsB,QAAQC,OAAO,iBAEtC,MAAMC,EAAU,IAAIC,EAAkC,sBAAuB,kBACvEC,EAA2BF,EAAQG,MAIzC,OA7CR,SAAmDD,GAC/C,IAAKA,GAA0BE,GAAI,OAAO,EAE1C,MACMC,EAAyBC,KAAKC,MADb,IAEvB,OAAOL,EAAyBM,UAAYH,CAChD,CAuCYI,CAA0CP,GACnCJ,QAAQY,QAAQR,EAAyBE,KAGpDxB,EAAU+B,EAAS9B,EAASK,GACvB0B,MAAKC,IACF,GAAIA,GAAYC,kBAEZ,OADAd,EAAQe,IAAI,CAAEX,GAAIS,EAAWC,kBAAmBN,UAAWF,KAAKC,QACzDM,EAAWC,iBAEfE,IAEVC,OAAM,IACInB,QAAQC,OAAO1B,KAGvBO,EAAAA,CACX"}
@@ -1,2 +1,2 @@
1
- import{FALLBACK_CONTEXT as e,DEFAULT_HTTP_TIMEOUT as r}from"../config.js";import o from"../Errors/AdyenCheckoutError.js";function t(t,a){const{headers:i=[],errorLevel:s="warn",loadingContext:c=e,method:l="GET",path:f,timeout:d=r}=t,u={method:l,mode:"cors",cache:"default",credentials:"same-origin",headers:{Accept:"application/json, text/plain, */*","Content-Type":"POST"===l?"application/json":"text/plain",...i},redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",...AbortSignal?.timeout&&{signal:AbortSignal?.timeout(d)},...a&&{body:JSON.stringify(a)}},h=`${c}${f}`;return fetch(h,u).then((async e=>{const r=await e.json();if(e.ok)return r;if(function(e){return e&&e.errorCode&&e.errorType&&e.message&&e.status}(r))return void n(r.message,s);n(t.errorMessage||`Service at ${h} is not available`,s)})).catch((e=>{if(e instanceof o)throw e;n(t.errorMessage||`Call to ${h} failed. Error= ${e}`,s)}))}function n(e,r){switch(r){case"silent":break;case"info":case"warn":case"error":console[r](e);break;default:throw new o("NETWORK_ERROR",e)}}function a(e,r){return t({...e,method:"GET"},r)}function i(e,r){return t({...e,method:"POST"},r)}export{t as http,a as httpGet,i as httpPost};
1
+ import{FALLBACK_CONTEXT as e,DEFAULT_HTTP_TIMEOUT as r}from"../config.js";import o from"../Errors/AdyenCheckoutError.js";function t(t,a){const{headers:i=[],errorLevel:s="warn",loadingContext:c=e,method:l="GET",path:f,timeout:d=r}=t,u={method:l,mode:"cors",cache:"default",credentials:"same-origin",headers:{Accept:"application/json, text/plain, */*","Content-Type":"POST"===l?"application/json":"text/plain",...i},redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",...AbortSignal?.timeout&&{signal:AbortSignal?.timeout(d)},...a&&{body:JSON.stringify(a)}},h=`${c}${f}`;return fetch(h,u).then((async e=>{const r=await e.json();if(e.ok)return r;if(function(e){return e&&e.errorCode&&e.errorType&&e.message&&e.status}(r))return void n(r.message,s,r);n(t.errorMessage||`Service at ${h} is not available`,s,r)})).catch((e=>{if(e instanceof o)throw e;n(t.errorMessage||`Call to ${h} failed. Error= ${e}`,s,e)}))}function n(e,r,t){switch(r){case"silent":break;case"info":case"warn":case"error":console[r](e);break;default:throw new o("NETWORK_ERROR",e,{cause:t})}}function a(e,r){return t({...e,method:"GET"},r)}function i(e,r){return t({...e,method:"POST"},r)}export{t as http,a as httpGet,i as httpPost};
2
2
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../../src/core/Services/http.ts"],"sourcesContent":["import { DEFAULT_HTTP_TIMEOUT, FALLBACK_CONTEXT } from '../config';\nimport AdyenCheckoutError from '../Errors/AdyenCheckoutError';\n\nexport interface HttpOptions {\n accept?: string;\n contentType?: string;\n errorMessage?: string;\n headers?;\n loadingContext?: string;\n method?: string;\n path: string;\n errorLevel?: ErrorLevel;\n timeout?: number;\n}\n\ntype ErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';\n\ntype AdyenErrorResponse = {\n errorCode: string;\n message: string;\n errorType: string;\n status: number;\n};\n\nfunction isAdyenErrorResponse(data: any): data is AdyenErrorResponse {\n return data && data.errorCode && data.errorType && data.message && data.status;\n}\n\nexport function http<T>(options: HttpOptions, data?: any): Promise<T> {\n const { headers = [], errorLevel = 'warn', loadingContext = FALLBACK_CONTEXT, method = 'GET', path, timeout = DEFAULT_HTTP_TIMEOUT } = options;\n\n const request: RequestInit = {\n method,\n mode: 'cors',\n cache: 'default',\n credentials: 'same-origin',\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': method === 'POST' ? 'application/json' : 'text/plain',\n ...headers\n },\n redirect: 'follow',\n referrerPolicy: 'no-referrer-when-downgrade',\n ...(AbortSignal?.timeout && { signal: AbortSignal?.timeout(timeout) }),\n ...(data && { body: JSON.stringify(data) })\n };\n\n const url = `${loadingContext}${path}`;\n\n return (\n fetch(url, request)\n .then(async response => {\n const data = await response.json();\n\n if (response.ok) {\n return data;\n }\n\n if (isAdyenErrorResponse(data)) {\n handleFetchError(data.message, errorLevel);\n return;\n }\n\n const errorMessage = options.errorMessage || `Service at ${url} is not available`;\n handleFetchError(errorMessage, errorLevel);\n return;\n })\n /**\n * Catch block handles Network error, CORS error, or exception throw by the `handleFetchError`\n * inside the `then` block\n */\n .catch(error => {\n /**\n * If error is instance of AdyenCheckoutError, which means that it was already\n * handled by the `handleFetchError` on the `then` block, then we just throw it.\n * There is no need to create it again\n */\n if (error instanceof AdyenCheckoutError) {\n throw error;\n }\n\n const errorMessage = options.errorMessage || `Call to ${url} failed. Error= ${error}`;\n handleFetchError(errorMessage, errorLevel);\n })\n );\n}\n\nfunction handleFetchError(message: string, level: ErrorLevel): void {\n switch (level) {\n case 'silent': {\n break;\n }\n case 'info':\n case 'warn':\n case 'error': {\n console[level](message);\n break;\n }\n default:\n throw new AdyenCheckoutError('NETWORK_ERROR', message);\n }\n}\n\nexport function httpGet<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'GET' }, data);\n}\n\nexport function httpPost<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'POST' }, data);\n}\n"],"names":["http","options","data","headers","errorLevel","loadingContext","FALLBACK_CONTEXT","method","path","timeout","DEFAULT_HTTP_TIMEOUT","request","mode","cache","credentials","Accept","redirect","referrerPolicy","AbortSignal","signal","body","JSON","stringify","url","fetch","then","async","response","json","ok","errorCode","errorType","message","status","isAdyenErrorResponse","handleFetchError","errorMessage","catch","error","AdyenCheckoutError","level","console","httpGet","httpPost"],"mappings":"yHA4BO,SAASA,EAAQC,EAAsBC,GAC1C,MAAMC,QAAEA,EAAU,GAAEC,WAAEA,EAAa,OAAMC,eAAEA,EAAiBC,EAAgBC,OAAEA,EAAS,MAAKC,KAAEA,EAAIC,QAAEA,EAAUC,GAAyBT,EAEjIU,EAAuB,CACzBJ,SACAK,KAAM,OACNC,MAAO,UACPC,YAAa,cACbX,QAAS,CACLY,OAAQ,oCACR,eAA2B,SAAXR,EAAoB,mBAAqB,gBACtDJ,GAEPa,SAAU,SACVC,eAAgB,gCACZC,aAAaT,SAAW,CAAEU,OAAQD,aAAaT,QAAQA,OACvDP,GAAQ,CAAEkB,KAAMC,KAAKC,UAAUpB,KAGjCqB,EAAM,GAAGlB,IAAiBG,IAEhC,OACIgB,MAAMD,EAAKZ,GACNc,MAAKC,MAAMC,IACR,MAAMzB,QAAayB,EAASC,OAE5B,GAAID,EAASE,GACT,OAAO3B,EAGX,GAlChB,SAA8BA,GAC1B,OAAOA,GAAQA,EAAK4B,WAAa5B,EAAK6B,WAAa7B,EAAK8B,SAAW9B,EAAK+B,MAC5E,CAgCoBC,CAAqBhC,GAErB,YADAiC,EAAiBjC,EAAK8B,QAAS5B,GAKnC+B,EADqBlC,EAAQmC,cAAgB,cAAcb,qBAC5BnB,EAC/B,IAMHiC,OAAMC,IAMH,GAAIA,aAAiBC,EACjB,MAAMD,EAIVH,EADqBlC,EAAQmC,cAAgB,WAAWb,oBAAsBe,IAC/ClC,EAAAA,GAG/C,CAEA,SAAS+B,EAAiBH,EAAiBQ,GACvC,OAAQA,GACJ,IAAK,SACD,MAEJ,IAAK,OACL,IAAK,OACL,IAAK,QACDC,QAAQD,GAAOR,GACf,MAEJ,QACI,MAAM,IAAIO,EAAmB,gBAAiBP,GAE1D,CAEO,SAASU,EAAiBzC,EAAsBC,GACnD,OAAOF,EAAQ,IAAKC,EAASM,OAAQ,OAASL,EAClD,CAEO,SAASyC,EAAkB1C,EAAsBC,GACpD,OAAOF,EAAQ,IAAKC,EAASM,OAAQ,QAAUL,EACnD"}
1
+ {"version":3,"file":"http.js","sources":["../../../../src/core/Services/http.ts"],"sourcesContent":["import { DEFAULT_HTTP_TIMEOUT, FALLBACK_CONTEXT } from '../config';\nimport AdyenCheckoutError from '../Errors/AdyenCheckoutError';\n\nexport interface HttpOptions {\n accept?: string;\n contentType?: string;\n headers?;\n loadingContext?: string;\n method?: string;\n path: string;\n timeout?: number;\n errorLevel?: ErrorLevel;\n errorMessage?: string;\n}\n\ntype ErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';\n\ntype AdyenApiErrorResponse = {\n errorCode: string;\n message: string;\n errorType: string;\n status: number;\n};\n\nfunction isAdyenApiErrorResponse(data: any): data is AdyenApiErrorResponse {\n return data && data.errorCode && data.errorType && data.message && data.status;\n}\n\nexport function http<T>(options: HttpOptions, data?: any): Promise<T> {\n const { headers = [], errorLevel = 'warn', loadingContext = FALLBACK_CONTEXT, method = 'GET', path, timeout = DEFAULT_HTTP_TIMEOUT } = options;\n\n const request: RequestInit = {\n method,\n mode: 'cors',\n cache: 'default',\n credentials: 'same-origin',\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': method === 'POST' ? 'application/json' : 'text/plain',\n ...headers\n },\n redirect: 'follow',\n referrerPolicy: 'no-referrer-when-downgrade',\n ...(AbortSignal?.timeout && { signal: AbortSignal?.timeout(timeout) }),\n ...(data && { body: JSON.stringify(data) })\n };\n\n const url = `${loadingContext}${path}`;\n\n return (\n fetch(url, request)\n .then(async response => {\n const data = await response.json();\n\n if (response.ok) {\n return data;\n }\n\n if (isAdyenApiErrorResponse(data)) {\n handleFetchError(data.message, errorLevel, data);\n return;\n }\n\n const errorMessage = options.errorMessage || `Service at ${url} is not available`;\n handleFetchError(errorMessage, errorLevel, data);\n return;\n })\n /**\n * Catch block handles Network error, CORS error, or exception throw by the `handleFetchError`\n * inside the `then` block\n */\n .catch((error: unknown) => {\n /**\n * If error is instance of AdyenCheckoutError, which means that it was already\n * handled by the `handleFetchError` on the `then` block, then we just throw it.\n * There is no need to create it again\n */\n if (error instanceof AdyenCheckoutError) {\n throw error;\n }\n\n const errorMessage = options.errorMessage || `Call to ${url} failed. Error= ${error}`;\n handleFetchError(errorMessage, errorLevel, error);\n })\n );\n}\n\nfunction handleFetchError(message: string, level: ErrorLevel, error: unknown): void {\n switch (level) {\n case 'silent': {\n break;\n }\n case 'info':\n case 'warn':\n case 'error': {\n console[level](message);\n break;\n }\n default:\n throw new AdyenCheckoutError('NETWORK_ERROR', message, { cause: error });\n }\n}\n\nexport function httpGet<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'GET' }, data);\n}\n\nexport function httpPost<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'POST' }, data);\n}\n"],"names":["http","options","data","headers","errorLevel","loadingContext","FALLBACK_CONTEXT","method","path","timeout","DEFAULT_HTTP_TIMEOUT","request","mode","cache","credentials","Accept","redirect","referrerPolicy","AbortSignal","signal","body","JSON","stringify","url","fetch","then","async","response","json","ok","errorCode","errorType","message","status","isAdyenApiErrorResponse","handleFetchError","errorMessage","catch","error","AdyenCheckoutError","level","console","cause","httpGet","httpPost"],"mappings":"yHA4BO,SAASA,EAAQC,EAAsBC,GAC1C,MAAMC,QAAEA,EAAU,GAAEC,WAAEA,EAAa,OAAMC,eAAEA,EAAiBC,EAAgBC,OAAEA,EAAS,MAAKC,KAAEA,EAAIC,QAAEA,EAAUC,GAAyBT,EAEjIU,EAAuB,CACzBJ,SACAK,KAAM,OACNC,MAAO,UACPC,YAAa,cACbX,QAAS,CACLY,OAAQ,oCACR,eAA2B,SAAXR,EAAoB,mBAAqB,gBACtDJ,GAEPa,SAAU,SACVC,eAAgB,gCACZC,aAAaT,SAAW,CAAEU,OAAQD,aAAaT,QAAQA,OACvDP,GAAQ,CAAEkB,KAAMC,KAAKC,UAAUpB,KAGjCqB,EAAM,GAAGlB,IAAiBG,IAEhC,OACIgB,MAAMD,EAAKZ,GACNc,MAAKC,MAAMC,IACR,MAAMzB,QAAayB,EAASC,OAE5B,GAAID,EAASE,GACT,OAAO3B,EAGX,GAlChB,SAAiCA,GAC7B,OAAOA,GAAQA,EAAK4B,WAAa5B,EAAK6B,WAAa7B,EAAK8B,SAAW9B,EAAK+B,MAC5E,CAgCoBC,CAAwBhC,GAExB,YADAiC,EAAiBjC,EAAK8B,QAAS5B,EAAYF,GAK/CiC,EADqBlC,EAAQmC,cAAgB,cAAcb,qBAC5BnB,EAAYF,EAC3C,IAMHmC,OAAOC,IAMJ,GAAIA,aAAiBC,EACjB,MAAMD,EAIVH,EADqBlC,EAAQmC,cAAgB,WAAWb,oBAAsBe,IAC/ClC,EAAYkC,EAAAA,GAG3D,CAEA,SAASH,EAAiBH,EAAiBQ,EAAmBF,GAC1D,OAAQE,GACJ,IAAK,SACD,MAEJ,IAAK,OACL,IAAK,OACL,IAAK,QACDC,QAAQD,GAAOR,GACf,MAEJ,QACI,MAAM,IAAIO,EAAmB,gBAAiBP,EAAS,CAAEU,MAAOJ,IAE5E,CAEO,SAASK,EAAiB1C,EAAsBC,GACnD,OAAOF,EAAQ,IAAKC,EAASM,OAAQ,OAASL,EAClD,CAEO,SAAS0C,EAAkB3C,EAAsBC,GACpD,OAAOF,EAAQ,IAAKC,EAASM,OAAQ,QAAUL,EACnD"}
@@ -1,2 +1,2 @@
1
- import{httpPost as e}from"../http.js";import{API_VERSION as r}from"./constants.js";function t(t,o){const a=`${r}/sessions/${t.id}/setup?clientKey=${t.clientKey}`,n={sessionData:t.data,...o.order?{order:{orderData:o.order.orderData,pspReference:o.order.pspReference}}:{}};return e({loadingContext:t.loadingContext,path:a,errorLevel:"fatal",errorMessage:"ERROR: Invalid ClientKey"},n)}export{t as default};
1
+ import{httpPost as e}from"../http.js";import{API_VERSION as r}from"./constants.js";function t(t,o){const a=`${r}/sessions/${t.id}/setup?clientKey=${t.clientKey}`,n={sessionData:t.data,...o.order?{order:{orderData:o.order.orderData,pspReference:o.order.pspReference}}:{}};return e({loadingContext:t.loadingContext,path:a,errorLevel:"fatal"},n)}export{t as default};
2
2
  //# sourceMappingURL=setup-session.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-session.js","sources":["../../../../../src/core/Services/sessions/setup-session.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { CheckoutSessionSetupResponse } from '../../CheckoutSession/types';\nimport { API_VERSION } from './constants';\n\n/**\n */\nfunction setupSession(session: Session, options): Promise<CheckoutSessionSetupResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/setup?clientKey=${session.clientKey}`;\n const data = {\n sessionData: session.data,\n ...(options.order\n ? {\n order: { orderData: options.order.orderData, pspReference: options.order.pspReference }\n }\n : {})\n };\n\n return httpPost<CheckoutSessionSetupResponse>(\n {\n loadingContext: session.loadingContext,\n path,\n errorLevel: 'fatal',\n errorMessage: 'ERROR: Invalid ClientKey'\n },\n data\n );\n}\n\nexport default setupSession;\n"],"names":["setupSession","session","options","path","API_VERSION","id","clientKey","data","sessionData","order","orderData","pspReference","httpPost","loadingContext","errorLevel","errorMessage"],"mappings":"mFAOA,SAASA,EAAaC,EAAkBC,GACpC,MAAMC,EAAO,GAAGC,cAAwBH,EAAQI,sBAAsBJ,EAAQK,YACxEC,EAAO,CACTC,YAAaP,EAAQM,QACjBL,EAAQO,MACN,CACIA,MAAO,CAAEC,UAAWR,EAAQO,MAAMC,UAAWC,aAAcT,EAAQO,MAAME,eAE7E,CAAE,GAGZ,OAAOC,EACH,CACIC,eAAgBZ,EAAQY,eACxBV,OACAW,WAAY,QACZC,aAAc,4BAElBR,EAER"}
1
+ {"version":3,"file":"setup-session.js","sources":["../../../../../src/core/Services/sessions/setup-session.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { CheckoutSessionSetupResponse } from '../../CheckoutSession/types';\nimport { API_VERSION } from './constants';\n\nfunction setupSession(session: Session, options): Promise<CheckoutSessionSetupResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/setup?clientKey=${session.clientKey}`;\n const data = {\n sessionData: session.data,\n ...(options.order\n ? {\n order: { orderData: options.order.orderData, pspReference: options.order.pspReference }\n }\n : {})\n };\n\n return httpPost<CheckoutSessionSetupResponse>(\n {\n loadingContext: session.loadingContext,\n path,\n errorLevel: 'fatal'\n },\n data\n );\n}\n\nexport default setupSession;\n"],"names":["setupSession","session","options","path","API_VERSION","id","clientKey","data","sessionData","order","orderData","pspReference","httpPost","loadingContext","errorLevel"],"mappings":"mFAKA,SAASA,EAAaC,EAAkBC,GACpC,MAAMC,EAAO,GAAGC,cAAwBH,EAAQI,sBAAsBJ,EAAQK,YACxEC,EAAO,CACTC,YAAaP,EAAQM,QACjBL,EAAQO,MACN,CACIA,MAAO,CAAEC,UAAWR,EAAQO,MAAMC,UAAWC,aAAcT,EAAQO,MAAME,eAE7E,CAAE,GAGZ,OAAOC,EACH,CACIC,eAAgBZ,EAAQY,eACxBV,OACAW,WAAY,SAEhBP,EAER"}
@@ -1,2 +1,2 @@
1
- import{Language as t}from"../language/Language.js";import o from"./RiskModule/RiskModule.js";import s from"./ProcessResponse/PaymentMethods/PaymentMethods.js";import{getComponentForAction as e}from"./ProcessResponse/PaymentAction/PaymentAction.js";import n from"./Analytics/Analytics.js";import{assertConfigurationPropertiesAreValid as i,processGlobalOptions as a}from"./utils.js";import r from"./CheckoutSession/CheckoutSession.js";import{hasOwnProperty as h}from"../utils/hasOwnProperty.js";import{Resources as l}from"./Context/Resources.js";import{SRPanel as c}from"./Errors/SRPanel.js";import p from"./core.registry.js";import{sanitizeResponse as m,verifyPaymentDidNotFail as d,cleanupFinalResult as u}from"../components/internal/UIElement/utils.js";import y,{IMPLEMENTATION_ERROR as f}from"./Errors/AdyenCheckoutError.js";import{ANALYTICS_ACTION_STR as C}from"./Analytics/constants.js";import{THREEDS2_FULL as g}from"../components/ThreeDS2/constants.js";import{DEFAULT_LOCALE as w}from"../language/constants.js";import j from"./Services/get-translations.js";import{defaultProps as E}from"./core.defaultProps.js";import{formatLocale as A,formatCustomTranslations as P}from"../language/utils.js";import{resolveEnvironments as v}from"./Environment/Environment.js";class M{session;paymentMethodsResponse;modules;options;analyticsContext;loadingContext;cdnImagesUrl;cdnTranslationsUrl;components=[];static metadata={version:"6.0.0-alpha.8",bundleType:"esm"};static registry=p;static setBundleType(t){M.metadata.bundleType=t}static register(...t){p.add(...t)}register(...t){p.add(...t)}getComponent(t){return p.getComponent(t)}constructor(t){i(t),this.createFromAction=this.createFromAction.bind(this),this.setOptions({...E,...t});const{apiUrl:o,analyticsUrl:s,cdnImagesUrl:e,cdnTranslationsUrl:n}=v(this.options.environment,this.options._environmentUrls);this.loadingContext=o,this.analyticsContext=s,this.cdnImagesUrl=e,this.cdnTranslationsUrl=n,this.session=this.options.session&&new r(this.options.session,this.options.clientKey,this.loadingContext);const a=this.options.clientKey?.substr(0,4);if(("test"===a||"live"===a)&&!this.loadingContext.includes(a))throw new y("IMPLEMENTATION_ERROR",`Error: you are using a ${a} clientKey against the ${this.options._environmentUrls?.api||this.options.environment} environment`);this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=M.metadata)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),await this.createCoreModules(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then((t=>{const{amount:o,shopperLocale:s,countryCode:e,paymentMethods:n,...i}=t;return this.setOptions({...i,amount:this.options.order?this.options.order.remainingAmount:o,locale:this.options.locale||s,countryCode:this.options.countryCode||e}),this.createPaymentMethodsList(n),this})).catch((t=>(this.options.onError&&this.options.onError(t),Promise.reject(t)))):(this.createPaymentMethodsList(),Promise.resolve(this))}async fetchLocaleTranslations(){try{return await j(this.cdnTranslationsUrl,M.metadata.version,this.options.locale,this.options.translations)}catch(t){t instanceof y?this.options.onError?.(t):this.options.onError?.(new y("ERROR","Failed to fetch translation",{cause:t}))}}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new y(f,"You must specify a countryCode when initializing checkout.");this.options.locale||this.setOptions({locale:w}),this.options.locale=A(this.options.locale),this.options.translations=P(this.options.translations)}submitDetails(t){let o=null;this.options.onAdditionalDetails&&(o=new Promise(((o,s)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:o,reject:s})}))),this.session&&(o=this.session.submitDetails(t).catch((t=>(this.options.onError?.(t),Promise.reject(t))))),o?o.then(m).then(d).then((t=>{u(t),this.options.onPaymentCompleted?.(t)})).catch((t=>{u(t),this.options.onPaymentFailed?.(t)})):this.options.onError?.(new y("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,o={}){if(!t||!t.type){if(h(t,"action")&&h(t,"resultCode"))throw new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property')}if(t.type){const s=t.type===g?`${t.type}${t.subtype}`:t.paymentMethodType;this.modules.analytics.sendAnalytics(s,{type:C,subtype:t.type,message:`${s} action was handled by the SDK`});const n={...this.getCorePropsForComponent(),...o};return e(this,p,t,n)}return this.handleCreateError()}update=(t={})=>(this.setOptions(t),this.initialize().then((()=>(this.components.forEach((o=>{const s={...t,...this.session&&{session:this.session}};o.update(s)})),this))));remove=t=>(this.components=this.components.filter((o=>o._id!==t._id)),t.unmount(),this);setOptions=t=>{this.options={...this.options,...t,locale:t?.locale||this.options?.locale}};getCorePropsForComponent(){return{...a(this.options),core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction}}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){const o=t?`${t?.name??"The passed payment method"} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(o)}createPaymentMethodsList(t){this.paymentMethodsResponse=new s(this.options.paymentMethodsResponse||t,this.options)}async createCoreModules(){if(this.modules)return;const s=await this.fetchLocaleTranslations();this.modules=Object.freeze({risk:new o(this,{...this.options,loadingContext:this.loadingContext}),analytics:n({loadingContext:this.loadingContext,analyticsContext:this.analyticsContext,clientKey:this.options.clientKey,locale:this.options.locale,analytics:this.options.analytics,amount:this.options.amount,bundleType:M.metadata.bundleType}),resources:new l(this.cdnImagesUrl),i18n:new t({locale:this.options.locale,translations:s,customTranslations:this.options.translations}),srPanel:new c(this,{...this.options.srConfig})})}}export{M as default};
1
+ import{Language as t}from"../language/Language.js";import o from"./RiskModule/RiskModule.js";import s from"./ProcessResponse/PaymentMethods/PaymentMethods.js";import{getComponentForAction as e}from"./ProcessResponse/PaymentAction/PaymentAction.js";import n from"./Analytics/Analytics.js";import{assertConfigurationPropertiesAreValid as i,processGlobalOptions as a}from"./utils.js";import r from"./CheckoutSession/CheckoutSession.js";import{hasOwnProperty as h}from"../utils/hasOwnProperty.js";import{Resources as l}from"./Context/Resources.js";import{SRPanel as c}from"./Errors/SRPanel.js";import p from"./core.registry.js";import{sanitizeResponse as m,verifyPaymentDidNotFail as d,cleanupFinalResult as u}from"../components/internal/UIElement/utils.js";import y,{IMPLEMENTATION_ERROR as f}from"./Errors/AdyenCheckoutError.js";import{ANALYTICS_ACTION_STR as C}from"./Analytics/constants.js";import{THREEDS2_FULL as g}from"../components/ThreeDS2/constants.js";import{DEFAULT_LOCALE as w}from"../language/constants.js";import j from"./Services/get-translations.js";import{defaultProps as E}from"./core.defaultProps.js";import{formatLocale as A,formatCustomTranslations as P}from"../language/utils.js";import{resolveEnvironments as v}from"./Environment/Environment.js";class M{session;paymentMethodsResponse;modules;options;analyticsContext;loadingContext;cdnImagesUrl;cdnTranslationsUrl;components=[];static metadata={version:"6.0.0-beta.0",bundleType:"esm"};static registry=p;static setBundleType(t){M.metadata.bundleType=t}static register(...t){p.add(...t)}register(...t){p.add(...t)}getComponent(t){return p.getComponent(t)}constructor(t){i(t),this.createFromAction=this.createFromAction.bind(this),this.setOptions({...E,...t});const{apiUrl:o,analyticsUrl:s,cdnImagesUrl:e,cdnTranslationsUrl:n}=v(this.options.environment,this.options._environmentUrls);this.loadingContext=o,this.analyticsContext=s,this.cdnImagesUrl=e,this.cdnTranslationsUrl=n,this.session=this.options.session&&new r(this.options.session,this.options.clientKey,this.loadingContext);const a=this.options.clientKey?.substr(0,4);if(("test"===a||"live"===a)&&!this.loadingContext.includes(a))throw new y("IMPLEMENTATION_ERROR",`Error: you are using a ${a} clientKey against the ${this.options._environmentUrls?.api||this.options.environment} environment`);this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=M.metadata)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),await this.createCoreModules(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then((t=>{const{amount:o,shopperLocale:s,countryCode:e,paymentMethods:n,...i}=t;return this.setOptions({...i,amount:this.options.order?this.options.order.remainingAmount:o,locale:this.options.locale||s,countryCode:this.options.countryCode||e}),this.createPaymentMethodsList(n),this})).catch((t=>(this.options.onError&&this.options.onError(t),Promise.reject(t)))):(this.createPaymentMethodsList(),Promise.resolve(this))}async fetchLocaleTranslations(){try{return await j(this.cdnTranslationsUrl,M.metadata.version,this.options.locale,this.options.translations)}catch(t){t instanceof y?this.options.onError?.(t):this.options.onError?.(new y("ERROR","Failed to fetch translation",{cause:t}))}}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new y(f,"You must specify a countryCode when initializing checkout.");this.options.locale||this.setOptions({locale:w}),this.options.locale=A(this.options.locale),this.options.translations=P(this.options.translations)}submitDetails(t){let o=null;this.options.onAdditionalDetails&&(o=new Promise(((o,s)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:o,reject:s})}))),this.session&&(o=this.session.submitDetails(t).catch((t=>(this.options.onError?.(t),Promise.reject(t))))),o?o.then(m).then(d).then((t=>{u(t),this.options.onPaymentCompleted?.(t)})).catch((t=>{u(t),this.options.onPaymentFailed?.(t)})):this.options.onError?.(new y("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,o={}){if(!t||!t.type){if(h(t,"action")&&h(t,"resultCode"))throw new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property')}if(t.type){const s=t.type===g?`${t.type}${t.subtype}`:t.paymentMethodType;this.modules.analytics.sendAnalytics(s,{type:C,subtype:t.type,message:`${s} action was handled by the SDK`});const n={...this.getCorePropsForComponent(),...o};return e(this,p,t,n)}return this.handleCreateError()}update=(t={})=>(this.setOptions(t),this.initialize().then((()=>(this.components.forEach((o=>{const s={...t,...this.session&&{session:this.session}};o.update(s)})),this))));remove=t=>(this.components=this.components.filter((o=>o._id!==t._id)),t.unmount(),this);setOptions=t=>{this.options={...this.options,...t,locale:t?.locale||this.options?.locale}};getCorePropsForComponent(){return{...a(this.options),core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction}}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){const o=t?`${t?.name??"The passed payment method"} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(o)}createPaymentMethodsList(t){this.paymentMethodsResponse=new s(this.options.paymentMethodsResponse||t,this.options)}async createCoreModules(){if(this.modules)return;const s=await this.fetchLocaleTranslations();this.modules=Object.freeze({risk:new o(this,{...this.options,loadingContext:this.loadingContext}),analytics:n({loadingContext:this.loadingContext,analyticsContext:this.analyticsContext,clientKey:this.options.clientKey,locale:this.options.locale,analytics:this.options.analytics,amount:this.options.amount,bundleType:M.metadata.bundleType}),resources:new l(this.cdnImagesUrl),i18n:new t({locale:this.options.locale,translations:s,customTranslations:this.options.translations}),srPanel:new c(this,{...this.options.srConfig})})}}export{M as default};
2
2
  //# sourceMappingURL=core.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sources":["../../../src/core/core.ts"],"sourcesContent":["import Language from '../language';\nimport UIElement from '../components/internal/UIElement/UIElement';\nimport RiskModule from './RiskModule';\nimport PaymentMethods from './ProcessResponse/PaymentMethods';\nimport getComponentForAction from './ProcessResponse/PaymentAction';\nimport Analytics from './Analytics';\nimport { assertConfigurationPropertiesAreValid, processGlobalOptions } from './utils';\nimport Session from './CheckoutSession';\nimport { hasOwnProperty } from '../utils/hasOwnProperty';\nimport { Resources } from './Context/Resources';\nimport { SRPanel } from './Errors/SRPanel';\nimport registry, { NewableComponent } from './core.registry';\nimport { cleanupFinalResult, sanitizeResponse, verifyPaymentDidNotFail } from '../components/internal/UIElement/utils';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from './Errors/AdyenCheckoutError';\nimport { ANALYTICS_ACTION_STR } from './Analytics/constants';\nimport { THREEDS2_FULL } from '../components/ThreeDS2/constants';\nimport { DEFAULT_LOCALE } from '../language/constants';\nimport getTranslations from './Services/get-translations';\nimport { defaultProps } from './core.defaultProps';\nimport { formatCustomTranslations, formatLocale } from '../language/utils';\nimport { resolveEnvironments } from './Environment';\n\nimport type { AdditionalDetailsStateData, PaymentAction, PaymentResponseData } from '../types/global-types';\nimport type { CoreConfiguration, ICore } from './types';\nimport type { Translations } from '../language/types';\nimport type { UIElementProps } from '../components/internal/UIElement/types';\n\nclass Core implements ICore {\n public session?: Session;\n public paymentMethodsResponse: PaymentMethods;\n public modules: any;\n public options: CoreConfiguration;\n\n public analyticsContext: string;\n public loadingContext: string;\n public cdnImagesUrl: string;\n public cdnTranslationsUrl: string;\n\n private components: UIElement[] = [];\n\n public static readonly metadata = {\n version: process.env.VERSION,\n bundleType: process.env.BUNDLE_TYPE\n };\n\n public static registry = registry;\n\n public static setBundleType(type: string): void {\n Core.metadata.bundleType = type;\n }\n\n public static register(...items: NewableComponent[]) {\n registry.add(...items);\n }\n\n /**\n * Used internally by the PaymentMethod components to auto-register themselves\n * @internal\n */\n public register(...items: NewableComponent[]) {\n registry.add(...items);\n }\n\n public getComponent(txVariant: string) {\n return registry.getComponent(txVariant);\n }\n\n constructor(props: CoreConfiguration) {\n assertConfigurationPropertiesAreValid(props);\n\n this.createFromAction = this.createFromAction.bind(this);\n\n this.setOptions({ ...defaultProps, ...props });\n\n const { apiUrl, analyticsUrl, cdnImagesUrl, cdnTranslationsUrl } = resolveEnvironments(\n this.options.environment,\n this.options._environmentUrls\n );\n\n this.loadingContext = apiUrl;\n this.analyticsContext = analyticsUrl;\n this.cdnImagesUrl = cdnImagesUrl;\n this.cdnTranslationsUrl = cdnTranslationsUrl;\n\n this.session = this.options.session && new Session(this.options.session, this.options.clientKey, this.loadingContext);\n\n const clientKeyType = this.options.clientKey?.substr(0, 4);\n if ((clientKeyType === 'test' || clientKeyType === 'live') && !this.loadingContext.includes(clientKeyType)) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Error: you are using a ${clientKeyType} clientKey against the ${this.options._environmentUrls?.api || this.options.environment} environment`\n );\n }\n\n if (this.options.exposeLibraryMetadata) {\n window['AdyenWebMetadata'] = Core.metadata;\n }\n }\n\n public async initialize(): Promise<this> {\n await this.initializeCore();\n this.validateCoreConfiguration();\n await this.createCoreModules();\n return this;\n }\n\n private async initializeCore(): Promise<this> {\n if (this.session) {\n return this.session\n .setupSession(this.options)\n .then(sessionResponse => {\n const { amount, shopperLocale, countryCode, paymentMethods, ...rest } = sessionResponse;\n\n this.setOptions({\n ...rest,\n amount: this.options.order ? this.options.order.remainingAmount : amount,\n locale: this.options.locale || shopperLocale,\n countryCode: this.options.countryCode || countryCode\n });\n\n this.createPaymentMethodsList(paymentMethods);\n\n return this;\n })\n .catch(error => {\n if (this.options.onError) this.options.onError(error);\n return Promise.reject(error);\n });\n }\n\n this.createPaymentMethodsList();\n return Promise.resolve(this);\n }\n\n private async fetchLocaleTranslations(): Promise<Translations> {\n try {\n const translation = await getTranslations(this.cdnTranslationsUrl, Core.metadata.version, this.options.locale, this.options.translations);\n return translation;\n } catch (error: unknown) {\n if (error instanceof AdyenCheckoutError) this.options.onError?.(error);\n else this.options.onError?.(new AdyenCheckoutError('ERROR', 'Failed to fetch translation', { cause: error }));\n }\n }\n\n private validateCoreConfiguration(): void {\n // @ts-ignore This property does not exist, although merchants might be using when migrating from v5 to v6\n if (this.options.paymentMethodsConfiguration) {\n console.warn('WARNING: \"paymentMethodsConfiguration\" is supported only by Drop-in.');\n }\n\n if (!this.options.countryCode) {\n throw new AdyenCheckoutError(IMPLEMENTATION_ERROR, 'You must specify a countryCode when initializing checkout.');\n }\n\n if (!this.options.locale) {\n this.setOptions({ locale: DEFAULT_LOCALE });\n }\n\n this.options.locale = formatLocale(this.options.locale);\n this.options.translations = formatCustomTranslations(this.options.translations);\n }\n\n /**\n * Method used when handling redirects. It submits details using 'onAdditionalDetails' or the Sessions flow if available.\n *\n * @public\n * @see {https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Components&version=5.55.1#handle-the-redirect}\n * @param details - Details object containing the redirectResult\n */\n public submitDetails(details: AdditionalDetailsStateData['data']): void {\n let promise = null;\n\n if (this.options.onAdditionalDetails) {\n promise = new Promise((resolve, reject) => {\n this.options.onAdditionalDetails({ data: details }, undefined, { resolve, reject });\n });\n }\n\n if (this.session) {\n promise = this.session.submitDetails(details).catch(error => {\n this.options.onError?.(error);\n return Promise.reject(error);\n });\n }\n\n if (!promise) {\n this.options.onError?.(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not submit the details. The callback \"onAdditionalDetails\" or the Session is not setup correctly.'\n )\n );\n return;\n }\n\n promise\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then((response: PaymentResponseData) => {\n cleanupFinalResult(response);\n this.options.onPaymentCompleted?.(response);\n })\n .catch((response: PaymentResponseData) => {\n cleanupFinalResult(response);\n this.options.onPaymentFailed?.(response);\n });\n }\n\n /**\n * Instantiates a new element component ready to be mounted from an action object\n *\n * @param action - action defining the component with the component data\n * @param options - options that will be merged to the global Checkout props\n * @returns new UIElement\n */\n public createFromAction(action: PaymentAction, options = {}): UIElement {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'createFromAction::Invalid Action - the passed action object itself has an \"action\" property and ' +\n 'a \"resultCode\": have you passed in the whole response object by mistake?'\n );\n }\n throw new Error('createFromAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n if (action.type) {\n // 'threeDS2' OR 'qrCode', 'voucher', 'redirect', 'await', 'bankTransfer`\n const component = action.type === THREEDS2_FULL ? `${action.type}${action.subtype}` : action.paymentMethodType;\n\n this.modules.analytics.sendAnalytics(component, {\n type: ANALYTICS_ACTION_STR,\n subtype: action.type,\n message: `${component} action was handled by the SDK`\n });\n\n const props = {\n ...this.getCorePropsForComponent(),\n ...options\n };\n\n return getComponentForAction(this, registry, action, props);\n }\n\n return this.handleCreateError();\n }\n\n /**\n * Updates global configurations, resets the internal state and remounts each element.\n *\n * @param options - props to update\n * @returns this - the element instance\n */\n public update = (options: Partial<CoreConfiguration> = {}): Promise<this> => {\n this.setOptions(options);\n\n return this.initialize().then(() => {\n this.components.forEach(component => {\n // We update only with the new options that have been received\n const newProps: Partial<UIElementProps> = {\n ...options,\n ...(this.session && { session: this.session })\n };\n component.update(newProps);\n });\n return this;\n });\n };\n\n /**\n * Remove the reference of a component\n * @param component - reference to the component to be removed\n * @returns this - the element instance\n * // TODO: Do we need this?\n */\n public remove = (component): this => {\n this.components = this.components.filter(c => c._id !== component._id);\n component.unmount();\n\n return this;\n };\n\n /**\n * @internal\n * Create or update the config object passed when AdyenCheckout is initialised (environment, clientKey, etc...)\n */\n private setOptions = (options: CoreConfiguration): void => {\n this.options = {\n ...this.options,\n ...options,\n locale: options?.locale || this.options?.locale\n };\n };\n\n /**\n * @internal\n * @returns props for a new UIElement\n */\n public getCorePropsForComponent(): any {\n const globalOptions = processGlobalOptions(this.options);\n\n return {\n ...globalOptions,\n core: this,\n i18n: this.modules.i18n,\n modules: this.modules,\n session: this.session,\n loadingContext: this.loadingContext,\n cdnContext: this.cdnImagesUrl,\n createFromAction: this.createFromAction\n };\n }\n\n public storeElementReference(element: UIElement) {\n if (element) {\n this.components.push(element);\n }\n }\n\n /**\n * @internal\n */\n private handleCreateError(paymentMethod?): never {\n const paymentMethodName = paymentMethod?.name ?? 'The passed payment method';\n const errorMessage = paymentMethod\n ? `${paymentMethodName} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(\n paymentMethod\n )}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`\n : 'No Payment Method component was passed';\n\n throw new Error(errorMessage);\n }\n\n private createPaymentMethodsList(paymentMethodsResponse?: PaymentMethods): void {\n this.paymentMethodsResponse = new PaymentMethods(this.options.paymentMethodsResponse || paymentMethodsResponse, this.options);\n }\n\n private async createCoreModules(): Promise<void> {\n if (this.modules) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('Core: Core modules are already created.');\n }\n return;\n }\n\n const translations = await this.fetchLocaleTranslations();\n\n this.modules = Object.freeze({\n risk: new RiskModule(this, { ...this.options, loadingContext: this.loadingContext }),\n analytics: Analytics({\n loadingContext: this.loadingContext,\n analyticsContext: this.analyticsContext,\n clientKey: this.options.clientKey,\n locale: this.options.locale,\n analytics: this.options.analytics,\n amount: this.options.amount,\n bundleType: Core.metadata.bundleType\n }),\n resources: new Resources(this.cdnImagesUrl),\n i18n: new Language({\n locale: this.options.locale,\n translations,\n customTranslations: this.options.translations\n }),\n srPanel: new SRPanel(this, { ...this.options.srConfig })\n });\n }\n}\n\nexport default Core;\n"],"names":["Core","session","paymentMethodsResponse","modules","options","analyticsContext","loadingContext","cdnImagesUrl","cdnTranslationsUrl","components","static","version","bundleType","registry","setBundleType","type","metadata","register","items","add","getComponent","txVariant","constructor","props","assertConfigurationPropertiesAreValid","this","createFromAction","bind","setOptions","defaultProps","apiUrl","analyticsUrl","resolveEnvironments","environment","_environmentUrls","Session","clientKey","clientKeyType","substr","includes","AdyenCheckoutError","api","exposeLibraryMetadata","window","initialize","initializeCore","validateCoreConfiguration","createCoreModules","setupSession","then","sessionResponse","amount","shopperLocale","countryCode","paymentMethods","rest","order","remainingAmount","locale","createPaymentMethodsList","catch","error","onError","Promise","reject","resolve","fetchLocaleTranslations","getTranslations","translations","cause","paymentMethodsConfiguration","console","warn","IMPLEMENTATION_ERROR","DEFAULT_LOCALE","formatLocale","formatCustomTranslations","submitDetails","details","promise","onAdditionalDetails","data","undefined","sanitizeResponse","verifyPaymentDidNotFail","response","cleanupFinalResult","onPaymentCompleted","onPaymentFailed","action","hasOwnProperty","Error","component","THREEDS2_FULL","subtype","paymentMethodType","analytics","sendAnalytics","ANALYTICS_ACTION_STR","message","getCorePropsForComponent","getComponentForAction","handleCreateError","update","forEach","newProps","remove","filter","c","_id","unmount","processGlobalOptions","core","i18n","cdnContext","storeElementReference","element","push","paymentMethod","errorMessage","name","JSON","stringify","PaymentMethods","Object","freeze","risk","RiskModule","Analytics","resources","Resources","Language","customTranslations","srPanel","SRPanel","srConfig"],"mappings":"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"}
1
+ {"version":3,"file":"core.js","sources":["../../../src/core/core.ts"],"sourcesContent":["import Language from '../language';\nimport UIElement from '../components/internal/UIElement/UIElement';\nimport RiskModule from './RiskModule';\nimport PaymentMethods from './ProcessResponse/PaymentMethods';\nimport getComponentForAction from './ProcessResponse/PaymentAction';\nimport Analytics from './Analytics';\nimport { assertConfigurationPropertiesAreValid, processGlobalOptions } from './utils';\nimport Session from './CheckoutSession';\nimport { hasOwnProperty } from '../utils/hasOwnProperty';\nimport { Resources } from './Context/Resources';\nimport { SRPanel } from './Errors/SRPanel';\nimport registry, { NewableComponent } from './core.registry';\nimport { cleanupFinalResult, sanitizeResponse, verifyPaymentDidNotFail } from '../components/internal/UIElement/utils';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from './Errors/AdyenCheckoutError';\nimport { ANALYTICS_ACTION_STR } from './Analytics/constants';\nimport { THREEDS2_FULL } from '../components/ThreeDS2/constants';\nimport { DEFAULT_LOCALE } from '../language/constants';\nimport getTranslations from './Services/get-translations';\nimport { defaultProps } from './core.defaultProps';\nimport { formatCustomTranslations, formatLocale } from '../language/utils';\nimport { resolveEnvironments } from './Environment';\n\nimport type { AnalyticsModule, PaymentAction, PaymentResponseData } from '../types/global-types';\nimport type { CoreConfiguration, ICore, AdditionalDetailsData } from './types';\nimport type { Translations } from '../language/types';\nimport type { UIElementProps } from '../components/internal/UIElement/types';\n\nclass Core implements ICore {\n public session?: Session;\n public paymentMethodsResponse: PaymentMethods;\n public modules: Readonly<{\n risk: RiskModule;\n analytics: AnalyticsModule;\n resources: Resources;\n i18n: Language;\n srPanel: SRPanel;\n }>;\n public options: CoreConfiguration;\n\n public analyticsContext: string;\n public loadingContext: string;\n public cdnImagesUrl: string;\n public cdnTranslationsUrl: string;\n\n private components: UIElement[] = [];\n\n public static readonly metadata = {\n version: process.env.VERSION,\n bundleType: process.env.BUNDLE_TYPE\n };\n\n public static registry = registry;\n\n public static setBundleType(type: string): void {\n Core.metadata.bundleType = type;\n }\n\n public static register(...items: NewableComponent[]) {\n registry.add(...items);\n }\n\n /**\n * Used internally by the PaymentMethod components to auto-register themselves\n * @internal\n */\n public register(...items: NewableComponent[]) {\n registry.add(...items);\n }\n\n public getComponent(txVariant: string) {\n return registry.getComponent(txVariant);\n }\n\n constructor(props: CoreConfiguration) {\n assertConfigurationPropertiesAreValid(props);\n\n this.createFromAction = this.createFromAction.bind(this);\n\n this.setOptions({ ...defaultProps, ...props });\n\n const { apiUrl, analyticsUrl, cdnImagesUrl, cdnTranslationsUrl } = resolveEnvironments(\n this.options.environment,\n this.options._environmentUrls\n );\n\n this.loadingContext = apiUrl;\n this.analyticsContext = analyticsUrl;\n this.cdnImagesUrl = cdnImagesUrl;\n this.cdnTranslationsUrl = cdnTranslationsUrl;\n\n this.session = this.options.session && new Session(this.options.session, this.options.clientKey, this.loadingContext);\n\n const clientKeyType = this.options.clientKey?.substr(0, 4);\n if ((clientKeyType === 'test' || clientKeyType === 'live') && !this.loadingContext.includes(clientKeyType)) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Error: you are using a ${clientKeyType} clientKey against the ${this.options._environmentUrls?.api || this.options.environment} environment`\n );\n }\n\n if (this.options.exposeLibraryMetadata) {\n window['AdyenWebMetadata'] = Core.metadata;\n }\n }\n\n public async initialize(): Promise<this> {\n await this.initializeCore();\n this.validateCoreConfiguration();\n await this.createCoreModules();\n return this;\n }\n\n private async initializeCore(): Promise<this> {\n if (this.session) {\n return this.session\n .setupSession(this.options)\n .then(sessionResponse => {\n const { amount, shopperLocale, countryCode, paymentMethods, ...rest } = sessionResponse;\n\n this.setOptions({\n ...rest,\n amount: this.options.order ? this.options.order.remainingAmount : amount,\n locale: this.options.locale || shopperLocale,\n countryCode: this.options.countryCode || countryCode\n });\n\n this.createPaymentMethodsList(paymentMethods);\n\n return this;\n })\n .catch(error => {\n if (this.options.onError) this.options.onError(error);\n return Promise.reject(error);\n });\n }\n\n this.createPaymentMethodsList();\n return Promise.resolve(this);\n }\n\n private async fetchLocaleTranslations(): Promise<Translations> {\n try {\n const translation = await getTranslations(this.cdnTranslationsUrl, Core.metadata.version, this.options.locale, this.options.translations);\n return translation;\n } catch (error: unknown) {\n if (error instanceof AdyenCheckoutError) this.options.onError?.(error);\n else this.options.onError?.(new AdyenCheckoutError('ERROR', 'Failed to fetch translation', { cause: error }));\n }\n }\n\n private validateCoreConfiguration(): void {\n // @ts-ignore This property does not exist, although merchants might be using when migrating from v5 to v6\n if (this.options.paymentMethodsConfiguration) {\n console.warn('WARNING: \"paymentMethodsConfiguration\" is supported only by Drop-in.');\n }\n\n if (!this.options.countryCode) {\n throw new AdyenCheckoutError(IMPLEMENTATION_ERROR, 'You must specify a countryCode when initializing checkout.');\n }\n\n if (!this.options.locale) {\n this.setOptions({ locale: DEFAULT_LOCALE });\n }\n\n this.options.locale = formatLocale(this.options.locale);\n this.options.translations = formatCustomTranslations(this.options.translations);\n }\n\n /**\n * Method used when handling redirects. It submits details using 'onAdditionalDetails' or the Sessions flow if available.\n *\n * @public\n * @see {https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Components&version=5.55.1#handle-the-redirect}\n * @param details - Details object containing the redirectResult\n */\n public submitDetails(details: AdditionalDetailsData['data']): void {\n let promise = null;\n\n if (this.options.onAdditionalDetails) {\n promise = new Promise((resolve, reject) => {\n this.options.onAdditionalDetails({ data: details }, undefined, { resolve, reject });\n });\n }\n\n if (this.session) {\n promise = this.session.submitDetails(details).catch(error => {\n this.options.onError?.(error);\n return Promise.reject(error);\n });\n }\n\n if (!promise) {\n this.options.onError?.(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not submit the details. The callback \"onAdditionalDetails\" or the Session is not setup correctly.'\n )\n );\n return;\n }\n\n promise\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then((response: PaymentResponseData) => {\n cleanupFinalResult(response);\n this.options.onPaymentCompleted?.(response);\n })\n .catch((response: PaymentResponseData) => {\n cleanupFinalResult(response);\n this.options.onPaymentFailed?.(response);\n });\n }\n\n /**\n * Instantiates a new element component ready to be mounted from an action object\n *\n * @param action - action defining the component with the component data\n * @param options - options that will be merged to the global Checkout props\n * @returns new UIElement\n */\n public createFromAction(action: PaymentAction, options = {}): UIElement {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'createFromAction::Invalid Action - the passed action object itself has an \"action\" property and ' +\n 'a \"resultCode\": have you passed in the whole response object by mistake?'\n );\n }\n throw new Error('createFromAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n if (action.type) {\n // 'threeDS2' OR 'qrCode', 'voucher', 'redirect', 'await', 'bankTransfer`\n const component = action.type === THREEDS2_FULL ? `${action.type}${action.subtype}` : action.paymentMethodType;\n\n this.modules.analytics.sendAnalytics(component, {\n type: ANALYTICS_ACTION_STR,\n subtype: action.type,\n message: `${component} action was handled by the SDK`\n });\n\n const props = {\n ...this.getCorePropsForComponent(),\n ...options\n };\n\n return getComponentForAction(this, registry, action, props);\n }\n\n return this.handleCreateError();\n }\n\n /**\n * Updates global configurations, resets the internal state and remounts each element.\n *\n * @param options - props to update\n * @returns this - the element instance\n */\n public update = (options: Partial<CoreConfiguration> = {}): Promise<this> => {\n this.setOptions(options);\n\n return this.initialize().then(() => {\n this.components.forEach(component => {\n // We update only with the new options that have been received\n const newProps: Partial<UIElementProps> = {\n ...options,\n ...(this.session && { session: this.session })\n };\n component.update(newProps);\n });\n return this;\n });\n };\n\n /**\n * Remove the reference of a component\n * @param component - reference to the component to be removed\n * @returns this - the element instance\n * // TODO: Do we need this?\n */\n public remove = (component): this => {\n this.components = this.components.filter(c => c._id !== component._id);\n component.unmount();\n\n return this;\n };\n\n /**\n * @internal\n * Create or update the config object passed when AdyenCheckout is initialised (environment, clientKey, etc...)\n */\n private setOptions = (options: CoreConfiguration): void => {\n this.options = {\n ...this.options,\n ...options,\n locale: options?.locale || this.options?.locale\n };\n };\n\n /**\n * @internal\n * @returns props for a new UIElement\n */\n public getCorePropsForComponent(): any {\n const globalOptions = processGlobalOptions(this.options);\n\n return {\n ...globalOptions,\n core: this,\n i18n: this.modules.i18n,\n modules: this.modules,\n session: this.session,\n loadingContext: this.loadingContext,\n cdnContext: this.cdnImagesUrl,\n createFromAction: this.createFromAction\n };\n }\n\n public storeElementReference(element: UIElement) {\n if (element) {\n this.components.push(element);\n }\n }\n\n /**\n * @internal\n */\n private handleCreateError(paymentMethod?): never {\n const paymentMethodName = paymentMethod?.name ?? 'The passed payment method';\n const errorMessage = paymentMethod\n ? `${paymentMethodName} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(\n paymentMethod\n )}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`\n : 'No Payment Method component was passed';\n\n throw new Error(errorMessage);\n }\n\n private createPaymentMethodsList(paymentMethodsResponse?: PaymentMethods): void {\n this.paymentMethodsResponse = new PaymentMethods(this.options.paymentMethodsResponse || paymentMethodsResponse, this.options);\n }\n\n private async createCoreModules(): Promise<void> {\n if (this.modules) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('Core: Core modules are already created.');\n }\n return;\n }\n\n const translations = await this.fetchLocaleTranslations();\n\n this.modules = Object.freeze({\n risk: new RiskModule(this, { ...this.options, loadingContext: this.loadingContext }),\n analytics: Analytics({\n loadingContext: this.loadingContext,\n analyticsContext: this.analyticsContext,\n clientKey: this.options.clientKey,\n locale: this.options.locale,\n analytics: this.options.analytics,\n amount: this.options.amount,\n bundleType: Core.metadata.bundleType\n }),\n resources: new Resources(this.cdnImagesUrl),\n i18n: new Language({\n locale: this.options.locale,\n translations,\n customTranslations: this.options.translations\n }),\n srPanel: new SRPanel(this, { ...this.options.srConfig })\n });\n }\n}\n\nexport default Core;\n"],"names":["Core","session","paymentMethodsResponse","modules","options","analyticsContext","loadingContext","cdnImagesUrl","cdnTranslationsUrl","components","static","version","bundleType","registry","setBundleType","type","metadata","register","items","add","getComponent","txVariant","constructor","props","assertConfigurationPropertiesAreValid","this","createFromAction","bind","setOptions","defaultProps","apiUrl","analyticsUrl","resolveEnvironments","environment","_environmentUrls","Session","clientKey","clientKeyType","substr","includes","AdyenCheckoutError","api","exposeLibraryMetadata","window","initialize","initializeCore","validateCoreConfiguration","createCoreModules","setupSession","then","sessionResponse","amount","shopperLocale","countryCode","paymentMethods","rest","order","remainingAmount","locale","createPaymentMethodsList","catch","error","onError","Promise","reject","resolve","fetchLocaleTranslations","getTranslations","translations","cause","paymentMethodsConfiguration","console","warn","IMPLEMENTATION_ERROR","DEFAULT_LOCALE","formatLocale","formatCustomTranslations","submitDetails","details","promise","onAdditionalDetails","data","undefined","sanitizeResponse","verifyPaymentDidNotFail","response","cleanupFinalResult","onPaymentCompleted","onPaymentFailed","action","hasOwnProperty","Error","component","THREEDS2_FULL","subtype","paymentMethodType","analytics","sendAnalytics","ANALYTICS_ACTION_STR","message","getCorePropsForComponent","getComponentForAction","handleCreateError","update","forEach","newProps","remove","filter","c","_id","unmount","processGlobalOptions","core","i18n","cdnContext","storeElementReference","element","push","paymentMethod","errorMessage","name","JSON","stringify","PaymentMethods","Object","freeze","risk","RiskModule","Analytics","resources","Resources","Language","customTranslations","srPanel","SRPanel","srConfig"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"core.registry.js","sources":["../../../src/core/core.registry.ts"],"sourcesContent":["import UIElement from '../components/internal/UIElement/UIElement';\nimport ThreeDS2Challenge from '../components/ThreeDS2/ThreeDS2Challenge';\nimport ThreeDS2DeviceFingerprint from '../components/ThreeDS2/ThreeDS2DeviceFingerprint';\nimport Redirect from '../components/Redirect';\nimport { TxVariants } from '../components/tx-variants';\nimport type { ICore } from './types';\nimport type { IUIElement } from '../components/internal/UIElement/types';\n\nfunction assertClassHasType(Class: any): Class is typeof UIElement {\n const hasValidType = typeof Class.type === 'string' && !!Class.type;\n return hasValidType;\n}\n\nexport type NewableComponent = new (checkout: ICore, props?) => IUIElement;\n\nexport interface IRegistry {\n add(...items: NewableComponent[]): void;\n getComponent(type: string): NewableComponent | undefined;\n}\n\nconst defaultComponents = {\n [TxVariants.redirect]: Redirect,\n [TxVariants.threeDS2Challenge]: ThreeDS2Challenge,\n [TxVariants.threeDS2DeviceFingerprint]: ThreeDS2DeviceFingerprint\n};\n\nclass Registry implements IRegistry {\n public componentsMap: Record<string, NewableComponent> = defaultComponents;\n\n public supportedTxVariants: Set<string> = new Set(Object.values(TxVariants));\n\n public add(...items: NewableComponent[]) {\n this.componentsMap = {\n ...this.componentsMap,\n ...this.createComponentsMap(items)\n };\n }\n\n public getComponent(type: string): NewableComponent | undefined {\n const Component = this.componentsMap[type];\n if (Component) {\n return Component;\n }\n\n if (this.supportedTxVariants.has(type)) {\n return;\n }\n\n return Redirect;\n }\n\n public createComponentsMap(components: NewableComponent[]) {\n const componentsMap = components.reduce((memo, component) => {\n const isValid = assertClassHasType(component);\n\n if (!isValid) {\n console.error('CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement');\n return memo;\n }\n if (component.type === 'dropin') {\n return memo;\n }\n\n const supportedTxVariants = [component.type, ...component.txVariants].filter(txVariant => txVariant);\n\n supportedTxVariants.forEach(txVariant => {\n memo = {\n ...memo,\n [txVariant]: component\n };\n });\n\n return memo;\n }, {});\n\n return componentsMap;\n }\n}\n\nexport default new Registry();\n"],"names":["defaultComponents","TxVariants","redirect","Redirect","threeDS2Challenge","ThreeDS2Challenge","threeDS2DeviceFingerprint","ThreeDS2DeviceFingerprint","registry","componentsMap","supportedTxVariants","Set","Object","values","add","items","this","createComponentsMap","getComponent","type","Component","has","components","reduce","memo","component","Class","console","error","txVariants","filter","txVariant","forEach"],"mappings":"0OAoBA,MAAMA,EAAoB,CACtB,CAACC,EAAWC,UAAWC,EACvB,CAACF,EAAWG,mBAAoBC,EAChC,CAACJ,EAAWK,2BAA4BC,GAwD5C,IAAeC,EAAA,IArDf,MACWC,cAAkDT,EAElDU,oBAAmC,IAAIC,IAAIC,OAAOC,OAAOZ,IAEzDa,GAAAA,IAAOC,GACVC,KAAKP,cAAgB,IACdO,KAAKP,iBACLO,KAAKC,oBAAoBF,GAEpC,CAEOG,YAAAA,CAAaC,GAChB,MAAMC,EAAYJ,KAAKP,cAAcU,GACrC,OAAIC,IAIAJ,KAAKN,oBAAoBW,IAAIF,QAAjC,EAIOhB,EACX,CAEOc,mBAAAA,CAAoBK,GAwBvB,OAvBsBA,EAAWC,QAAO,CAACC,EAAMC,KA5CvD,IAA4BC,EA+ChB,KA9CmC,iBADnBA,EA6CmBD,GA5CTN,QAAuBO,EAAMP,MAgDnD,OADAQ,QAAQC,MAAM,sFACPJ,EAEX,GAAuB,WAAnBC,EAAUN,KACV,OAAOK,EAYX,MAT4B,CAACC,EAAUN,QAASM,EAAUI,YAAYC,QAAOC,GAAaA,IAEtEC,SAAQD,IACxBP,EAAO,IACAA,EACHO,CAACA,GAAYN,EACjB,IAGGD,CAAAA,GACR,CAAC,EAGR"}
1
+ {"version":3,"file":"core.registry.js","sources":["../../../src/core/core.registry.ts"],"sourcesContent":["import UIElement from '../components/internal/UIElement/UIElement';\nimport ThreeDS2Challenge from '../components/ThreeDS2/ThreeDS2Challenge';\nimport ThreeDS2DeviceFingerprint from '../components/ThreeDS2/ThreeDS2DeviceFingerprint';\nimport Redirect from '../components/Redirect';\nimport { TxVariants } from '../components/tx-variants';\nimport type { ICore } from './types';\n\nfunction assertClassHasType(Class: any): Class is typeof UIElement {\n const hasValidType = typeof Class.type === 'string' && !!Class.type;\n return hasValidType;\n}\n\nexport type NewableComponent = new (checkout: ICore, props?) => UIElement;\n\nexport interface IRegistry {\n add(...items: NewableComponent[]): void;\n getComponent(type: string): NewableComponent | undefined;\n}\n\nconst defaultComponents = {\n [TxVariants.redirect]: Redirect,\n [TxVariants.threeDS2Challenge]: ThreeDS2Challenge,\n [TxVariants.threeDS2DeviceFingerprint]: ThreeDS2DeviceFingerprint\n};\n\nclass Registry implements IRegistry {\n public componentsMap: Record<string, NewableComponent> = defaultComponents;\n\n public supportedTxVariants: Set<string> = new Set(Object.values(TxVariants));\n\n public add(...items: NewableComponent[]) {\n this.componentsMap = {\n ...this.componentsMap,\n ...this.createComponentsMap(items)\n };\n }\n\n public getComponent(type: string): NewableComponent | undefined {\n const Component = this.componentsMap[type];\n if (Component) {\n return Component;\n }\n\n if (this.supportedTxVariants.has(type)) {\n return;\n }\n\n return Redirect;\n }\n\n public createComponentsMap(components: NewableComponent[]) {\n const componentsMap = components.reduce((memo, component) => {\n const isValid = assertClassHasType(component);\n\n if (!isValid) {\n console.error('CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement');\n return memo;\n }\n if (component.type === 'dropin') {\n return memo;\n }\n\n const supportedTxVariants = [component.type, ...component.txVariants].filter(txVariant => txVariant);\n\n supportedTxVariants.forEach(txVariant => {\n memo = {\n ...memo,\n [txVariant]: component\n };\n });\n\n return memo;\n }, {});\n\n return componentsMap;\n }\n}\n\nexport default new Registry();\n"],"names":["defaultComponents","TxVariants","redirect","Redirect","threeDS2Challenge","ThreeDS2Challenge","threeDS2DeviceFingerprint","ThreeDS2DeviceFingerprint","registry","componentsMap","supportedTxVariants","Set","Object","values","add","items","this","createComponentsMap","getComponent","type","Component","has","components","reduce","memo","component","Class","console","error","txVariants","filter","txVariant","forEach"],"mappings":"0OAmBA,MAAMA,EAAoB,CACtB,CAACC,EAAWC,UAAWC,EACvB,CAACF,EAAWG,mBAAoBC,EAChC,CAACJ,EAAWK,2BAA4BC,GAwD5C,IAAeC,EAAA,IArDf,MACWC,cAAkDT,EAElDU,oBAAmC,IAAIC,IAAIC,OAAOC,OAAOZ,IAEzDa,GAAAA,IAAOC,GACVC,KAAKP,cAAgB,IACdO,KAAKP,iBACLO,KAAKC,oBAAoBF,GAEpC,CAEOG,YAAAA,CAAaC,GAChB,MAAMC,EAAYJ,KAAKP,cAAcU,GACrC,OAAIC,IAIAJ,KAAKN,oBAAoBW,IAAIF,QAAjC,EAIOhB,EACX,CAEOc,mBAAAA,CAAoBK,GAwBvB,OAvBsBA,EAAWC,QAAO,CAACC,EAAMC,KA5CvD,IAA4BC,EA+ChB,KA9CmC,iBADnBA,EA6CmBD,GA5CTN,QAAuBO,EAAMP,MAgDnD,OADAQ,QAAQC,MAAM,sFACPJ,EAEX,GAAuB,WAAnBC,EAAUN,KACV,OAAOK,EAYX,MAT4B,CAACC,EAAUN,QAASM,EAAUI,YAAYC,QAAOC,GAAaA,IAEtEC,SAAQD,IACxBP,EAAO,IACAA,EACHO,CAACA,GAAYN,EACjB,IAGGD,CAAAA,GACR,CAAC,EAGR"}
@@ -1,2 +1,2 @@
1
- var e,n,_,t,o,l,r,u,i,s,c,f={},p=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function h(e,n){for(var _ in n)e[_]=n[_];return e}function v(e){var n=e.parentNode;n&&n.removeChild(e)}function y(n,_,t){var o,l,r,u={};for(r in _)"key"==r?o=_[r]:"ref"==r?l=_[r]:u[r]=_[r];if(arguments.length>2&&(u.children=arguments.length>3?e.call(arguments,2):t),"function"==typeof n&&null!=n.defaultProps)for(r in n.defaultProps)void 0===u[r]&&(u[r]=n.defaultProps[r]);return m(n,u,o,l,null)}function m(e,t,o,l,r){var u={type:e,props:t,key:o,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++_:r,__i:-1,__u:0};return null==r&&null!=n.vnode&&n.vnode(u),u}function g(e){return e.children}function k(e,n){this.props=e,this.context=n}function b(e,n){if(null==n)return e.__?b(e.__,e.__i+1):null;for(var _;n<e.__k.length;n++)if(null!=(_=e.__k[n])&&null!=_.__e)return _.__e;return"function"==typeof e.type?b(e):null}function C(e){var n,_;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if(null!=(_=e.__k[n])&&null!=_.__e){e.__e=e.__c.base=_.__e;break}return C(e)}}function x(e){(!e.__d&&(e.__d=!0)&&t.push(e)&&!P.__r++||o!==n.debounceRendering)&&((o=n.debounceRendering)||l)(P)}function P(){var e,_,o,l,u,i,s,c;for(t.sort(r);e=t.shift();)e.__d&&(_=t.length,l=void 0,i=(u=(o=e).__v).__e,s=[],c=[],o.__P&&((l=h({},u)).__v=u.__v+1,n.vnode&&n.vnode(l),L(o.__P,l,u,o.__n,void 0!==o.__P.ownerSVGElement,32&u.__u?[i]:null,s,null==i?b(u):i,!!(32&u.__u),c),l.__v=u.__v,l.__.__k[l.__i]=l,M(s,l,c),l.__e!=i&&C(l)),t.length>_&&t.sort(r));P.__r=0}function S(e,n,_,t,o,l,r,u,i,s,c){var a,d,h,v,y,m=t&&t.__k||p,g=n.length;for(_.__d=i,w(_,n,m),i=_.__d,a=0;a<g;a++)null!=(h=_.__k[a])&&"boolean"!=typeof h&&"function"!=typeof h&&(d=-1===h.__i?f:m[h.__i]||f,h.__i=a,L(e,h,d,o,l,r,u,i,s,c),v=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&A(d.ref,null,h),c.push(h.ref,h.__c||v,h)),null==y&&null!=v&&(y=v),65536&h.__u||d.__k===h.__k?(i&&!i.isConnected&&(i=b(d)),i=E(h,i,e)):"function"==typeof h.type&&void 0!==h.__d?i=h.__d:v&&(i=v.nextSibling),h.__d=void 0,h.__u&=-196609);_.__d=i,_.__e=y}function w(e,n,_){var t,o,l,r,u,i=n.length,s=_.length,c=s,f=0;for(e.__k=[],t=0;t<i;t++)r=t+f,null!=(o=e.__k[t]=null==(o=n[t])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(g,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,u=T(o,_,r,c),o.__i=u,l=null,-1!==u&&(c--,(l=_[u])&&(l.__u|=131072)),null==l||null===l.__v?(-1==u&&f--,"function"!=typeof o.type&&(o.__u|=65536)):u!==r&&(u===r+1?f++:u>r?c>i-r?f+=u-r:f--:u<r?u==r-1&&(f=u-r):f=0,u!==t+f&&(o.__u|=65536))):(l=_[r])&&null==l.key&&l.__e&&!(131072&l.__u)&&(l.__e==e.__d&&(e.__d=b(l)),H(l,l,!1),_[r]=null,c--);if(c)for(t=0;t<s;t++)null!=(l=_[t])&&!(131072&l.__u)&&(l.__e==e.__d&&(e.__d=b(l)),H(l,l))}function E(e,n,_){var t,o;if("function"==typeof e.type){for(t=e.__k,o=0;t&&o<t.length;o++)t[o]&&(t[o].__=e,n=E(t[o],n,_));return n}e.__e!=n&&(_.insertBefore(e.__e,n||null),n=e.__e);do{n=n&&n.nextSibling}while(null!=n&&8===n.nodeType);return n}function U(e,n){return n=n||[],null==e||"boolean"==typeof e||(d(e)?e.some((function(e){U(e,n)})):n.push(e)),n}function T(e,n,_,t){var o=e.key,l=e.type,r=_-1,u=_+1,i=n[_];if(null===i||i&&o==i.key&&l===i.type&&!(131072&i.__u))return _;if(t>(null==i||131072&i.__u?0:1))for(;r>=0||u<n.length;){if(r>=0){if((i=n[r])&&!(131072&i.__u)&&o==i.key&&l===i.type)return r;r--}if(u<n.length){if((i=n[u])&&!(131072&i.__u)&&o==i.key&&l===i.type)return u;u++}}return-1}function D(e,n,_){"-"===n[0]?e.setProperty(n,null==_?"":_):e[n]=null==_?"":"number"!=typeof _||a.test(n)?_:_+"px"}function W(e,n,_,t,o){var l;e:if("style"===n)if("string"==typeof _)e.style.cssText=_;else{if("string"==typeof t&&(e.style.cssText=t=""),t)for(n in t)_&&n in _||D(e.style,n,"");if(_)for(n in _)t&&_[n]===t[n]||D(e.style,n,_[n])}else if("o"===n[0]&&"n"===n[1])l=n!==(n=n.replace(/(PointerCapture)$|Capture$/i,"$1")),n=n.toLowerCase()in e||"onFocusOut"===n||"onFocusIn"===n?n.toLowerCase().slice(2):n.slice(2),e.l||(e.l={}),e.l[n+l]=_,_?t?_.u=t.u:(_.u=u,e.addEventListener(n,l?s:i,l)):e.removeEventListener(n,l?s:i,l);else{if(o)n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=n&&"height"!=n&&"href"!=n&&"list"!=n&&"form"!=n&&"tabIndex"!=n&&"download"!=n&&"rowSpan"!=n&&"colSpan"!=n&&"role"!=n&&n in e)try{e[n]=null==_?"":_;break e}catch(e){}"function"==typeof _||(null==_||!1===_&&"-"!==n[4]?e.removeAttribute(n):e.setAttribute(n,_))}}function F(e){return function(_){if(this.l){var t=this.l[_.type+e];if(null==_.t)_.t=u++;else if(_.t<t.u)return;return t(n.event?n.event(_):_)}}}function L(e,_,t,o,l,r,u,i,s,c){var f,p,a,v,y,m,b,C,x,P,w,E,U,T,D,W=_.type;if(void 0!==_.constructor)return null;128&t.__u&&(s=!!(32&t.__u),r=[i=_.__e=t.__e]),(f=n.__b)&&f(_);e:if("function"==typeof W)try{if(C=_.props,x=(f=W.contextType)&&o[f.__c],P=f?x?x.props.value:f.__:o,t.__c?b=(p=_.__c=t.__c).__=p.__E:("prototype"in W&&W.prototype.render?_.__c=p=new W(C,P):(_.__c=p=new k(C,P),p.constructor=W,p.render=$),x&&x.sub(p),p.props=C,p.state||(p.state={}),p.context=P,p.__n=o,a=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=W.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=h({},p.__s)),h(p.__s,W.getDerivedStateFromProps(C,p.__s))),v=p.props,y=p.state,p.__v=_,a)null==W.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==W.getDerivedStateFromProps&&C!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(C,P),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(C,p.__s,P)||_.__v===t.__v)){for(_.__v!==t.__v&&(p.props=C,p.state=p.__s,p.__d=!1),_.__e=t.__e,_.__k=t.__k,_.__k.forEach((function(e){e&&(e.__=_)})),w=0;w<p._sb.length;w++)p.__h.push(p._sb[w]);p._sb=[],p.__h.length&&u.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(C,p.__s,P),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(v,y,m)}))}if(p.context=P,p.props=C,p.__P=e,p.__e=!1,E=n.__r,U=0,"prototype"in W&&W.prototype.render){for(p.state=p.__s,p.__d=!1,E&&E(_),f=p.render(p.props,p.state,p.context),T=0;T<p._sb.length;T++)p.__h.push(p._sb[T]);p._sb=[]}else do{p.__d=!1,E&&E(_),f=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++U<25);p.state=p.__s,null!=p.getChildContext&&(o=h(h({},o),p.getChildContext())),a||null==p.getSnapshotBeforeUpdate||(m=p.getSnapshotBeforeUpdate(v,y)),S(e,d(D=null!=f&&f.type===g&&null==f.key?f.props.children:f)?D:[D],_,t,o,l,r,u,i,s,c),p.base=_.__e,_.__u&=-161,p.__h.length&&u.push(p),b&&(p.__E=p.__=null)}catch(e){_.__v=null,s||null!=r?(_.__e=i,_.__u|=s?160:32,r[r.indexOf(i)]=null):(_.__e=t.__e,_.__k=t.__k),n.__e(e,_,t)}else null==r&&_.__v===t.__v?(_.__k=t.__k,_.__e=t.__e):_.__e=N(t.__e,_,t,o,l,r,u,s,c);(f=n.diffed)&&f(_)}function M(e,_,t){_.__d=void 0;for(var o=0;o<t.length;o++)A(t[o],t[++o],t[++o]);n.__c&&n.__c(_,e),e.some((function(_){try{e=_.__h,_.__h=[],e.some((function(e){e.call(_)}))}catch(e){n.__e(e,_.__v)}}))}function N(n,_,t,o,l,r,u,i,s){var c,p,a,h,y,m,g,k=t.props,C=_.props,x=_.type;if("svg"===x&&(l=!0),null!=r)for(c=0;c<r.length;c++)if((y=r[c])&&"setAttribute"in y==!!x&&(x?y.localName===x:3===y.nodeType)){n=y,r[c]=null;break}if(null==n){if(null===x)return document.createTextNode(C);n=l?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,C.is&&C),r=null,i=!1}if(null===x)k===C||i&&n.data===C||(n.data=C);else{if(r=r&&e.call(n.childNodes),k=t.props||f,!i&&null!=r)for(k={},c=0;c<n.attributes.length;c++)k[(y=n.attributes[c]).name]=y.value;for(c in k)if(y=k[c],"children"==c);else if("dangerouslySetInnerHTML"==c)a=y;else if("key"!==c&&!(c in C)){if("value"==c&&"defaultValue"in C||"checked"==c&&"defaultChecked"in C)continue;W(n,c,null,y,l)}for(c in C)y=C[c],"children"==c?h=y:"dangerouslySetInnerHTML"==c?p=y:"value"==c?m=y:"checked"==c?g=y:"key"===c||i&&"function"!=typeof y||k[c]===y||W(n,c,y,k[c],l);if(p)i||a&&(p.__html===a.__html||p.__html===n.innerHTML)||(n.innerHTML=p.__html),_.__k=[];else if(a&&(n.innerHTML=""),S(n,d(h)?h:[h],_,t,o,l&&"foreignObject"!==x,r,u,r?r[0]:t.__k&&b(t,0),i,s),null!=r)for(c=r.length;c--;)null!=r[c]&&v(r[c]);i||(c="value",void 0!==m&&(m!==n[c]||"progress"===x&&!m||"option"===x&&m!==k[c])&&W(n,c,m,k[c],!1),c="checked",void 0!==g&&g!==n[c]&&W(n,c,g,k[c],!1))}return n}function A(e,_,t){try{"function"==typeof e?e(_):e.current=_}catch(e){n.__e(e,t)}}function H(e,_,t){var o,l;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||A(o,null,_)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,_)}o.base=o.__P=null}if(o=e.__k)for(l=0;l<o.length;l++)o[l]&&H(o[l],_,t||"function"!=typeof e.type);t||null==e.__e||v(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function $(e,n,_){return this.constructor(e,_)}function I(_,t,o){var l,r,u,i;n.__&&n.__(_,t),r=(l="function"==typeof o)?null:t.__k,u=[],i=[],L(t,_=(!l&&o||t).__k=y(g,null,[_]),r||f,f,void 0!==t.ownerSVGElement,!l&&o?[o]:r?null:t.firstChild?e.call(t.childNodes):null,u,!l&&o?o:r?r.__e:t.firstChild,l,i),M(u,_,i)}function O(n,_,t){var o,l,r,u,i=h({},n.props);for(r in n.type&&n.type.defaultProps&&(u=n.type.defaultProps),_)"key"==r?o=_[r]:"ref"==r?l=_[r]:i[r]=void 0===_[r]&&void 0!==u?u[r]:_[r];return arguments.length>2&&(i.children=arguments.length>3?e.call(arguments,2):t),m(n.type,i,o||n.key,l||n.ref,null)}function R(e,n){var _={__c:n="__cC"+c++,__:e,Consumer:function(e,n){return e.children(n)},Provider:function(e){var _,t;return this.getChildContext||(_=[],(t={})[n]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&_.some((function(e){e.__e=!0,x(e)}))},this.sub=function(e){_.push(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){_.splice(_.indexOf(e),1),n&&n.call(e)}}),e.children}};return _.Provider.__=_.Consumer.contextType=_}e=p.slice,n={__e:function(e,n,_,t){for(var o,l,r;n=n.__;)if((o=n.__c)&&!o.__)try{if((l=o.constructor)&&null!=l.getDerivedStateFromError&&(o.setState(l.getDerivedStateFromError(e)),r=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,t||{}),r=o.__d),r)return o.__E=o}catch(n){e=n}throw e}},_=0,k.prototype.setState=function(e,n){var _;_=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},_),this.props)),e&&h(_,e),null!=e&&this.__v&&(n&&this._sb.push(n),x(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},k.prototype.render=g,t=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,r=function(e,n){return e.__v.__b-n.__v.__b},P.__r=0,u=0,i=F(!1),s=F(!0),c=0;export{k as Component,g as Fragment,O as cloneElement,R as createContext,y as createElement,y as h,n as options,I as render,U as toChildArray};
1
+ var e,n,t,_,o,l,r,u,i,s,c,f={},p=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function h(e,n){for(var t in n)e[t]=n[t];return e}function v(e){var n=e.parentNode;n&&n.removeChild(e)}function y(n,t,_){var o,l,r,u={};for(r in t)"key"==r?o=t[r]:"ref"==r?l=t[r]:u[r]=t[r];if(arguments.length>2&&(u.children=arguments.length>3?e.call(arguments,2):_),"function"==typeof n&&null!=n.defaultProps)for(r in n.defaultProps)void 0===u[r]&&(u[r]=n.defaultProps[r]);return m(n,u,o,l,null)}function m(e,_,o,l,r){var u={type:e,props:_,key:o,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++t:r,__i:-1,__u:0};return null==r&&null!=n.vnode&&n.vnode(u),u}function g(e){return e.children}function k(e,n){this.props=e,this.context=n}function b(e,n){if(null==n)return e.__?b(e.__,e.__i+1):null;for(var t;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e)return t.__e;return"function"==typeof e.type?b(e):null}function w(e){var n,t;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e){e.__e=e.__c.base=t.__e;break}return w(e)}}function C(e){(!e.__d&&(e.__d=!0)&&_.push(e)&&!x.__r++||o!==n.debounceRendering)&&((o=n.debounceRendering)||l)(x)}function x(){var e,t,o,l,u,i,s,c;for(_.sort(r);e=_.shift();)e.__d&&(t=_.length,l=void 0,i=(u=(o=e).__v).__e,s=[],c=[],o.__P&&((l=h({},u)).__v=u.__v+1,n.vnode&&n.vnode(l),W(o.__P,l,u,o.__n,o.__P.namespaceURI,32&u.__u?[i]:null,s,null==i?b(u):i,!!(32&u.__u),c),l.__v=u.__v,l.__.__k[l.__i]=l,F(s,l,c),l.__e!=i&&w(l)),_.length>t&&_.sort(r));x.__r=0}function P(e,n,t,_,o,l,r,u,i,s,c){var a,d,h,v,y,m=_&&_.__k||p,g=n.length;for(t.__d=i,S(t,n,m),i=t.__d,a=0;a<g;a++)null!=(h=t.__k[a])&&"boolean"!=typeof h&&"function"!=typeof h&&(d=-1===h.__i?f:m[h.__i]||f,h.__i=a,W(e,h,d,o,l,r,u,i,s,c),v=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&A(d.ref,null,h),c.push(h.ref,h.__c||v,h)),null==y&&null!=v&&(y=v),65536&h.__u||d.__k===h.__k?(i&&!i.isConnected&&(i=b(d)),i=U(h,i,e)):"function"==typeof h.type&&void 0!==h.__d?i=h.__d:v&&(i=v.nextSibling),h.__d=void 0,h.__u&=-196609);t.__d=i,t.__e=y}function S(e,n,t){var _,o,l,r,u,i=n.length,s=t.length,c=s,f=0;for(e.__k=[],_=0;_<i;_++)r=_+f,null!=(o=e.__k[_]=null==(o=n[_])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(g,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,u=D(o,t,r,c),o.__i=u,l=null,-1!==u&&(c--,(l=t[u])&&(l.__u|=131072)),null==l||null===l.__v?(-1==u&&f--,"function"!=typeof o.type&&(o.__u|=65536)):u!==r&&(u===r+1?f++:u>r?c>i-r?f+=u-r:f--:u<r?u==r-1&&(f=u-r):f=0,u!==_+f&&(o.__u|=65536))):(l=t[r])&&null==l.key&&l.__e&&!(131072&l.__u)&&(l.__e==e.__d&&(e.__d=b(l)),H(l,l,!1),t[r]=null,c--);if(c)for(_=0;_<s;_++)null!=(l=t[_])&&!(131072&l.__u)&&(l.__e==e.__d&&(e.__d=b(l)),H(l,l))}function U(e,n,t){var _,o;if("function"==typeof e.type){for(_=e.__k,o=0;_&&o<_.length;o++)_[o]&&(_[o].__=e,n=U(_[o],n,t));return n}e.__e!=n&&(t.insertBefore(e.__e,n||null),n=e.__e);do{n=n&&n.nextSibling}while(null!=n&&8===n.nodeType);return n}function T(e,n){return n=n||[],null==e||"boolean"==typeof e||(d(e)?e.some((function(e){T(e,n)})):n.push(e)),n}function D(e,n,t,_){var o=e.key,l=e.type,r=t-1,u=t+1,i=n[t];if(null===i||i&&o==i.key&&l===i.type&&!(131072&i.__u))return t;if(_>(null==i||131072&i.__u?0:1))for(;r>=0||u<n.length;){if(r>=0){if((i=n[r])&&!(131072&i.__u)&&o==i.key&&l===i.type)return r;r--}if(u<n.length){if((i=n[u])&&!(131072&i.__u)&&o==i.key&&l===i.type)return u;u++}}return-1}function M(e,n,t){"-"===n[0]?e.setProperty(n,null==t?"":t):e[n]=null==t?"":"number"!=typeof t||a.test(n)?t:t+"px"}function E(e,n,t,_,o){var l;e:if("style"===n)if("string"==typeof t)e.style.cssText=t;else{if("string"==typeof _&&(e.style.cssText=_=""),_)for(n in _)t&&n in t||M(e.style,n,"");if(t)for(n in t)_&&t[n]===_[n]||M(e.style,n,t[n])}else if("o"===n[0]&&"n"===n[1])l=n!==(n=n.replace(/(PointerCapture)$|Capture$/i,"$1")),n=n.toLowerCase()in e||"onFocusOut"===n||"onFocusIn"===n?n.toLowerCase().slice(2):n.slice(2),e.l||(e.l={}),e.l[n+l]=t,t?_?t.u=_.u:(t.u=u,e.addEventListener(n,l?s:i,l)):e.removeEventListener(n,l?s:i,l);else{if("http://www.w3.org/2000/svg"==o)n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=n&&"height"!=n&&"href"!=n&&"list"!=n&&"form"!=n&&"tabIndex"!=n&&"download"!=n&&"rowSpan"!=n&&"colSpan"!=n&&"role"!=n&&n in e)try{e[n]=null==t?"":t;break e}catch(e){}"function"==typeof t||(null==t||!1===t&&"-"!==n[4]?e.removeAttribute(n):e.setAttribute(n,t))}}function L(e){return function(t){if(this.l){var _=this.l[t.type+e];if(null==t.t)t.t=u++;else if(t.t<_.u)return;return _(n.event?n.event(t):t)}}}function W(e,t,_,o,l,r,u,i,s,c){var f,p,a,v,y,m,b,w,C,x,S,U,T,D,M,E=t.type;if(void 0!==t.constructor)return null;128&_.__u&&(s=!!(32&_.__u),r=[i=t.__e=_.__e]),(f=n.__b)&&f(t);e:if("function"==typeof E)try{if(w=t.props,C=(f=E.contextType)&&o[f.__c],x=f?C?C.props.value:f.__:o,_.__c?b=(p=t.__c=_.__c).__=p.__E:("prototype"in E&&E.prototype.render?t.__c=p=new E(w,x):(t.__c=p=new k(w,x),p.constructor=E,p.render=I),C&&C.sub(p),p.props=w,p.state||(p.state={}),p.context=x,p.__n=o,a=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=E.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=h({},p.__s)),h(p.__s,E.getDerivedStateFromProps(w,p.__s))),v=p.props,y=p.state,p.__v=t,a)null==E.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==E.getDerivedStateFromProps&&w!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,x),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,x)||t.__v===_.__v)){for(t.__v!==_.__v&&(p.props=w,p.state=p.__s,p.__d=!1),t.__e=_.__e,t.__k=_.__k,t.__k.forEach((function(e){e&&(e.__=t)})),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&u.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,x),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(v,y,m)}))}if(p.context=x,p.props=w,p.__P=e,p.__e=!1,U=n.__r,T=0,"prototype"in E&&E.prototype.render){for(p.state=p.__s,p.__d=!1,U&&U(t),f=p.render(p.props,p.state,p.context),D=0;D<p._sb.length;D++)p.__h.push(p._sb[D]);p._sb=[]}else do{p.__d=!1,U&&U(t),f=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++T<25);p.state=p.__s,null!=p.getChildContext&&(o=h(h({},o),p.getChildContext())),a||null==p.getSnapshotBeforeUpdate||(m=p.getSnapshotBeforeUpdate(v,y)),P(e,d(M=null!=f&&f.type===g&&null==f.key?f.props.children:f)?M:[M],t,_,o,l,r,u,i,s,c),p.base=t.__e,t.__u&=-161,p.__h.length&&u.push(p),b&&(p.__E=p.__=null)}catch(e){t.__v=null,s||null!=r?(t.__e=i,t.__u|=s?160:32,r[r.indexOf(i)]=null):(t.__e=_.__e,t.__k=_.__k),n.__e(e,t,_)}else null==r&&t.__v===_.__v?(t.__k=_.__k,t.__e=_.__e):t.__e=N(_.__e,t,_,o,l,r,u,s,c);(f=n.diffed)&&f(t)}function F(e,t,_){t.__d=void 0;for(var o=0;o<_.length;o++)A(_[o],_[++o],_[++o]);n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function N(n,t,_,o,l,r,u,i,s){var c,p,a,h,y,m,g,k=_.props,w=t.props,C=t.type;if("svg"===C?l="http://www.w3.org/2000/svg":"math"===C?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),null!=r)for(c=0;c<r.length;c++)if((y=r[c])&&"setAttribute"in y==!!C&&(C?y.localName===C:3===y.nodeType)){n=y,r[c]=null;break}if(null==n){if(null===C)return document.createTextNode(w);n=document.createElementNS(l,C,w.is&&w),r=null,i=!1}if(null===C)k===w||i&&n.data===w||(n.data=w);else{if(r=r&&e.call(n.childNodes),k=_.props||f,!i&&null!=r)for(k={},c=0;c<n.attributes.length;c++)k[(y=n.attributes[c]).name]=y.value;for(c in k)if(y=k[c],"children"==c);else if("dangerouslySetInnerHTML"==c)a=y;else if("key"!==c&&!(c in w)){if("value"==c&&"defaultValue"in w||"checked"==c&&"defaultChecked"in w)continue;E(n,c,null,y,l)}for(c in w)y=w[c],"children"==c?h=y:"dangerouslySetInnerHTML"==c?p=y:"value"==c?m=y:"checked"==c?g=y:"key"===c||i&&"function"!=typeof y||k[c]===y||E(n,c,y,k[c],l);if(p)i||a&&(p.__html===a.__html||p.__html===n.innerHTML)||(n.innerHTML=p.__html),t.__k=[];else if(a&&(n.innerHTML=""),P(n,d(h)?h:[h],t,_,o,"foreignObject"===C?"http://www.w3.org/1999/xhtml":l,r,u,r?r[0]:_.__k&&b(_,0),i,s),null!=r)for(c=r.length;c--;)null!=r[c]&&v(r[c]);i||(c="value",void 0!==m&&(m!==n[c]||"progress"===C&&!m||"option"===C&&m!==k[c])&&E(n,c,m,k[c],l),c="checked",void 0!==g&&g!==n[c]&&E(n,c,g,k[c],l))}return n}function A(e,t,_){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,_)}}function H(e,t,_){var o,l;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||A(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(l=0;l<o.length;l++)o[l]&&H(o[l],t,_||"function"!=typeof e.type);_||null==e.__e||v(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function I(e,n,t){return this.constructor(e,t)}function R(t,_,o){var l,r,u,i;n.__&&n.__(t,_),r=(l="function"==typeof o)?null:_.__k,u=[],i=[],W(_,t=(!l&&o||_).__k=y(g,null,[t]),r||f,f,_.namespaceURI,!l&&o?[o]:r?null:_.firstChild?e.call(_.childNodes):null,u,!l&&o?o:r?r.__e:_.firstChild,l,i),F(u,t,i)}function $(n,t,_){var o,l,r,u,i=h({},n.props);for(r in n.type&&n.type.defaultProps&&(u=n.type.defaultProps),t)"key"==r?o=t[r]:"ref"==r?l=t[r]:i[r]=void 0===t[r]&&void 0!==u?u[r]:t[r];return arguments.length>2&&(i.children=arguments.length>3?e.call(arguments,2):_),m(n.type,i,o||n.key,l||n.ref,null)}function O(e,n){var t={__c:n="__cC"+c++,__:e,Consumer:function(e,n){return e.children(n)},Provider:function(e){var t,_;return this.getChildContext||(t=[],(_={})[n]=this,this.getChildContext=function(){return _},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some((function(e){e.__e=!0,C(e)}))},this.sub=function(e){t.push(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),n&&n.call(e)}}),e.children}};return t.Provider.__=t.Consumer.contextType=t}e=p.slice,n={__e:function(e,n,t,_){for(var o,l,r;n=n.__;)if((o=n.__c)&&!o.__)try{if((l=o.constructor)&&null!=l.getDerivedStateFromError&&(o.setState(l.getDerivedStateFromError(e)),r=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,_||{}),r=o.__d),r)return o.__E=o}catch(n){e=n}throw e}},t=0,k.prototype.setState=function(e,n){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},t),this.props)),e&&h(t,e),null!=e&&this.__v&&(n&&this._sb.push(n),C(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},k.prototype.render=g,_=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,r=function(e,n){return e.__v.__b-n.__v.__b},x.__r=0,u=0,i=L(!1),s=L(!0),c=0;export{k as Component,g as Fragment,$ as cloneElement,O as createContext,y as createElement,y as h,n as options,R as render,T as toChildArray};
2
2
  //# sourceMappingURL=preact.js.map