@adyen/kyc-components 3.67.3 → 3.68.1

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 (142) hide show
  1. package/dist/AcceptTermsOfServiceComponent-CU2alc91.js +1711 -0
  2. package/dist/{AccountSetupRejected-ChiJY18-.js → AccountSetupRejected-CJ-_A3Ny.js} +3 -2
  3. package/dist/{BusinessTypeSelection-D7ZvvIMS.js → BusinessTypeSelection-8O8S1NJQ.js} +16 -16
  4. package/dist/{CXEL7IU7-Bk2n0dNy.js → CXEL7IU7-BJwGAGi_.js} +3 -3
  5. package/dist/CreateIndividualComponent-CbKLS3lw.js +3803 -0
  6. package/dist/{CustomerSupport-CJNWyhvH.js → CustomerSupport-DwHNm45d.js} +4 -3
  7. package/dist/{DebugModal-Bv0myReE.js → DebugModal-Bl6alyPp.js} +8 -9
  8. package/dist/{DecisionMakers-ChL8AjTJ.js → DecisionMakers-D35kGGBp.js} +4 -2
  9. package/dist/EmbedShell-uQMA3IsQ.js +60 -0
  10. package/dist/{core-B_WrZP-J.js → EventEmitter-BCgWoSHk.js} +1242 -23651
  11. package/dist/{HASRA6WW-1uv7rGnF.js → HASRA6WW-bymne0OX.js} +2 -2
  12. package/dist/{I3HPI4QX-Cu2MHefw.js → I3HPI4QX-BjDbFXav.js} +3 -3
  13. package/dist/{Introduction-S84AjEkr.js → Introduction-C0NQbS7T.js} +3 -2
  14. package/dist/{Review-B416UIqb.js → Review-dqxqat30.js} +4 -2
  15. package/dist/{SingpassSelection-CGe7MVVA.js → SingpassSelection-Dkxz3a-V.js} +3 -3
  16. package/dist/{TaxReportingDropin-CUnugFcz.js → TaxReportingDropin-E8B4As4p.js} +48 -17
  17. package/dist/adyen-kyc-components.js +1 -1
  18. package/dist/adyenConfig.js +3 -13
  19. package/dist/core-PYXN6HpB.js +18040 -0
  20. package/dist/{css-BdtMD5A5.js → css-w3W1DNq3.js} +2 -2
  21. package/dist/individual.js +35 -19
  22. package/dist/{json-DbFHJS1e.js → json-BVkPD1GZ.js} +2 -2
  23. package/dist/listToRecord-CBVflh7a.js +160 -0
  24. package/dist/{plaintext-DuNA8yq2.js → plaintext-Bgjkv8j9.js} +2 -2
  25. package/dist/style.css +948 -377
  26. package/dist/styles-CLV89_hH.js +6142 -0
  27. package/dist/terms-of-service-preact.js +15 -0
  28. package/dist/terms-of-service-react.js +15 -0
  29. package/dist/terms-of-service.js +55 -0
  30. package/dist/types/api/address/useAddressCleanse.d.ts +1 -0
  31. package/dist/types/api/address/useRetrieveAddress.d.ts +5 -0
  32. package/dist/types/api/address/useSearchAddress.d.ts +1 -0
  33. package/dist/types/api/businessLines/useBusinessLines.d.ts +1 -0
  34. package/dist/types/api/check/useCheck.d.ts +2 -0
  35. package/dist/types/api/configurations/useScenarios.d.ts +181 -0
  36. package/dist/types/api/configurations/useSupportedCountries.d.ts +1 -0
  37. package/dist/types/api/configurations/useTaskTypes.d.ts +6 -0
  38. package/dist/types/api/configurations/useVersionConfiguration.d.ts +2 -4
  39. package/dist/types/api/datasets/useLegalForms.d.ts +1 -0
  40. package/dist/types/api/datasets/useNaceCodes.d.ts +1 -0
  41. package/dist/types/api/datasets/useSourceOfFundsTypes.d.ts +1 -0
  42. package/dist/types/api/documents/{useGetDocument.d.ts → useDocument.d.ts} +6 -1
  43. package/dist/types/api/legalEntity/useLegalEntity.d.ts +5 -0
  44. package/dist/types/api/onboardingStatus/useOnboardingStatus.d.ts +1 -0
  45. package/dist/types/api/openId/useOpenIdAuthorizationLink.d.ts +1 -0
  46. package/dist/types/api/pciTemplate/usePciQuestionnaireList.d.ts +6 -2
  47. package/dist/types/api/pciTemplate/usePciStatus.d.ts +5 -2
  48. package/dist/types/api/pciTemplate/usePciTemplate.d.ts +5 -2
  49. package/dist/types/api/pciTemplate/useSignPci.d.ts +4 -1
  50. package/dist/types/api/providersConfiguration/useProviderStatus.d.ts +1 -0
  51. package/dist/types/api/taskStatus/useTaskStatus.d.ts +1 -0
  52. package/dist/types/api/taxClassification/useTaxClassification.d.ts +1 -0
  53. package/dist/types/api/termsOfService/useAcceptTermsOfService.d.ts +4 -1
  54. package/dist/types/api/termsOfService/useAcceptedTermsOfService.d.ts +14 -2
  55. package/dist/types/api/termsOfService/useTermsOfService.d.ts +6 -2
  56. package/dist/types/api/termsOfService/useTermsOfServiceAcceptanceInfos.d.ts +5 -1
  57. package/dist/types/api/termsOfService/useTermsOfServiceStatus.d.ts +6 -2
  58. package/dist/types/api/transferInstruments/{useGetBankVerificationProviders.d.ts → useBankVerificationProviders.d.ts} +5 -1
  59. package/dist/types/api/transferInstruments/{useGetTransferInstrument.d.ts → useTransferInstrument.d.ts} +6 -1
  60. package/dist/types/api/transferInstruments/{useGetTransferInstruments.d.ts → useTransferInstruments.d.ts} +2 -1
  61. package/dist/types/api/types.d.ts +14 -0
  62. package/dist/types/api/uiAnalytics/useAnalyticsSession.d.ts +5 -0
  63. package/dist/types/api/validation/useValidateAccountIdentification.d.ts +6 -2
  64. package/dist/types/api/validation/useValidatePhoneNumber.d.ts +15 -0
  65. package/dist/types/components/BankAccount/forms/BankVerification/types.d.ts +1 -1
  66. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +1 -1
  67. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/PreferInstantVerificationMethod/PreferInstantVerificationMethod.d.ts +1 -1
  68. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/types.d.ts +1 -1
  69. package/dist/types/components/BankAccount/hooks/useAsyncAccountDetailsValidationRules.d.ts +1 -1
  70. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +1 -1
  71. package/dist/types/components/Business/tasks/BusinessDetailsDropin/BusinessDetailsDropin.d.ts +1 -1
  72. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +4 -4
  73. package/dist/types/components/EFP/tasks/HighExposureDropin/types.d.ts +0 -2
  74. package/dist/types/components/EFP/tasks/TaxReportingDropin/utils.d.ts +2 -1
  75. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverview/ManageTransferInstrumentOverview.d.ts +1 -1
  76. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItem/ManageTransferInstrumentOverviewItem.d.ts +1 -1
  77. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +1 -1
  78. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/DropinComposer.d.ts +1 -1
  79. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/types.d.ts +2 -8
  80. package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/types.d.ts +4 -3
  81. package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/utils.d.ts +3 -0
  82. package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.types.d.ts +0 -5
  83. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +2 -4
  84. package/dist/types/components/Individual/tasks/IndividualDropin/IndividualDropin.d.ts +1 -1
  85. package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoDropin.d.ts +1 -1
  86. package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +10 -0
  87. package/dist/types/components/Shared/fields/PhoneField/fieldConfig.d.ts +2 -2
  88. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  89. package/dist/types/components/Shared/forms/BusinessTypeSelection/types.d.ts +2 -2
  90. package/dist/types/components/Shared/tasks/TaskList/TaskList.d.ts +1 -1
  91. package/dist/types/components/Shared/tasks/TaskList/types.d.ts +0 -3
  92. package/dist/types/components/Trust/forms/Trust/types.d.ts +2 -2
  93. package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +30 -0
  94. package/dist/types/components/Trust/tasks/TrustDropin/TrustDropin.d.ts +1 -1
  95. package/dist/types/components/Trust/tasks/TrustMembers/TrustMembersOverview.d.ts +6 -3
  96. package/dist/types/components/Trust/utils/addOrUpdateAssociatedTrustMember.d.ts +4 -4
  97. package/dist/types/components/Trust/utils/addOrUpdateUndefinedBeneficiary.d.ts +2 -2
  98. package/dist/types/components/Trust/utils/updateExemptSettlorName.d.ts +4 -4
  99. package/dist/types/components/UnincorporatedPartnership/utils/unincorporatedPartnershipMembers.d.ts +2 -2
  100. package/dist/types/components/ui/atoms/Checkbox/Checkbox.d.ts +7 -3
  101. package/dist/types/components/ui/atoms/Field/Field.d.ts +26 -7
  102. package/dist/types/components/ui/atoms/Field/Field.types.d.ts +4 -2
  103. package/dist/types/components/ui/atoms/InputBase/InputBase.d.ts +2 -6
  104. package/dist/types/components/ui/atoms/Select/Select.d.ts +1 -1
  105. package/dist/types/components/ui/atoms/Select/Select.types.d.ts +3 -3
  106. package/dist/types/components/ui/atoms/SelectButton/SelectButton.d.ts +1 -2
  107. package/dist/types/components/ui/atoms/SelectButton/SelectButton.types.d.ts +3 -2
  108. package/dist/types/components/ui/atoms/SelectListItem/SelectListItem.d.ts +1 -1
  109. package/dist/types/components/ui/atoms/SelectListItem/SelectListItem.types.d.ts +1 -0
  110. package/dist/types/components/ui/molecules/Dropzone/FilePicker.d.ts +4 -2
  111. package/dist/types/context/ExperimentContext/types.d.ts +0 -10
  112. package/dist/types/context/SettingsContext/types.d.ts +3 -1
  113. package/dist/types/core/EmbedShell/EmbedShell.d.ts +26 -0
  114. package/dist/types/core/models/errors/validation-error.d.ts +1 -9
  115. package/dist/types/core/services/http.d.ts +3 -3
  116. package/dist/types/core/services/types.d.ts +2 -2
  117. package/dist/types/embeds/individual/individual.types.d.ts +5 -1
  118. package/dist/types/embeds/individual/preact/Individual.d.ts +3 -3
  119. package/dist/types/embeds/individual/react/Individual.d.ts +3 -3
  120. package/dist/types/embeds/individual/vue/individual.types.d.ts +3 -3
  121. package/dist/types/embeds/terms-of-service/adyen-terms-of-service.d.ts +1 -0
  122. package/dist/types/embeds/terms-of-service/preact/TermsOfService.d.ts +10 -0
  123. package/dist/types/embeds/terms-of-service/react/TermsOfService.d.ts +20 -0
  124. package/dist/types/embeds/terms-of-service/terms-of-service.types.d.ts +8 -0
  125. package/dist/types/embeds/utils.d.ts +4 -0
  126. package/dist/types/hooks/useScenarioConfiguration.d.ts +11 -4
  127. package/dist/types/utils/api/processValidationErrors.d.ts +5 -1
  128. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  129. package/dist/utils-Do7EwrWz.js +24 -0
  130. package/dist/{yaml-CZT9wc9a.js → yaml-Jyq-xpmw.js} +2 -2
  131. package/package.json +16 -1
  132. package/dist/types/context/ConfigurationApiContext/ConfigurationApiContext.d.ts +0 -7
  133. package/dist/types/context/ConfigurationApiContext/ConfigurationApiProvider.d.ts +0 -7
  134. package/dist/types/context/ConfigurationApiContext/getEmbeddedApi.d.ts +0 -5
  135. package/dist/types/context/ConfigurationApiContext/useConfigurationApi.d.ts +0 -2
  136. package/dist/types/core/models/api/get-configuration.d.ts +0 -17
  137. package/dist/types/core/models/api/get-tasks.d.ts +0 -2
  138. package/dist/types/core/services/componentApi/get-scenarios.d.ts +0 -4
  139. package/dist/types/core/services/componentApi/get-tasks.d.ts +0 -3
  140. package/dist/types/core/services/componentApi/update-legal-entity.d.ts +0 -3
  141. package/dist/types/core/services/componentApi/validate-phone-number.d.ts +0 -3
  142. package/dist/types/hooks/useComponentApi.d.ts +0 -10
@@ -0,0 +1,1711 @@
1
+ ;
2
+ {
3
+ try {
4
+ let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ce5b835d-a22d-4597-865b-f6c7d76e4cf3", e._sentryDebugIdIdentifier = "sentry-dbid-ce5b835d-a22d-4597-865b-f6c7d76e4cf3");
6
+ } catch (e) {
7
+ }
8
+ }
9
+ ;
10
+ import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
11
+ import { useRef, useState, useEffect, useCallback } from "preact/hooks";
12
+ import { a as useApiContext, f as useQueryClient, e as useMutation, h as httpPost, b as useQuery, d as httpGet, dU as skipToken, Q as Icon, dV as AlertIcon, c as createLogger, i as useI18nContext, j as useAnalyticsContext, l as useToastContext, n as useExperimentsContext, bi as useForm, U as Alert, G as Button, b7 as localizeDateString, L as LoaderWrapper, b8 as Field, b9 as Select, d0 as Checkbox, cG as ActionBar, c$ as MaybeModal, D as ModalContent, F as ModalFooter, dD as StepProgressIndicator, X as Spacer, J as LegalEntityType, aj as getOwnSignatories, a3 as doesLegalEntityRequiresLegalRepresentative, a2 as getLegalRepresentative, cE as FormNavigation, I as useCoreContext, u as useLegalEntity, K as Loader, T as TaskTypes } from "./EventEmitter-BCgWoSHk.js";
13
+ import cx from "classnames";
14
+ import { defineSlots } from "named-slots";
15
+ const acceptTermsOfService = async (legalEntityId, url, termsOfServiceDocumentId, data) => {
16
+ return httpPost(
17
+ {
18
+ loadingContext: url,
19
+ errorLevel: "warn",
20
+ errorMessage: `Failed to accept Terms of service`,
21
+ path: `legalEntities/${legalEntityId}/termsOfService/accept`,
22
+ authentication: "jwt",
23
+ headers: {
24
+ "Content-Type": "application/json"
25
+ }
26
+ },
27
+ {
28
+ ...data,
29
+ legalEntityReference: legalEntityId,
30
+ termsOfServiceDocumentId
31
+ }
32
+ );
33
+ };
34
+ const useAcceptTermsOfService = (options) => {
35
+ const { legalEntityId, baseUrl } = useApiContext();
36
+ const queryClient = useQueryClient();
37
+ return useMutation({
38
+ mutationFn: (data) => acceptTermsOfService(legalEntityId.value, baseUrl.value, data.termsOfServiceDocumentId, data),
39
+ onSuccess: async () => {
40
+ queryClient.invalidateQueries({
41
+ queryKey: ["legalEntity", legalEntityId.value]
42
+ });
43
+ queryClient.invalidateQueries({
44
+ queryKey: ["termsOfServiceStatus"]
45
+ });
46
+ queryClient.invalidateQueries({
47
+ queryKey: ["termsOfServiceAcceptanceInfos"]
48
+ });
49
+ },
50
+ ...options
51
+ });
52
+ };
53
+ const getTermsOfServiceAcceptanceInfos = async (legalEntityId, url) => {
54
+ return httpGet({
55
+ loadingContext: url,
56
+ errorLevel: "warn",
57
+ errorMessage: `Failed to get terms of service acceptance info`,
58
+ path: `legalEntities/${legalEntityId}/termsOfService/termsOfServiceAcceptanceInfos`,
59
+ authentication: "jwt",
60
+ headers: {
61
+ "Content-Type": "application/json"
62
+ }
63
+ });
64
+ };
65
+ const useTermsOfServiceAcceptanceInfos = (options) => {
66
+ const { legalEntityId, baseUrl } = useApiContext();
67
+ return useQuery({
68
+ queryKey: ["termsOfServiceAcceptanceInfos"],
69
+ queryFn: () => getTermsOfServiceAcceptanceInfos(legalEntityId.value, baseUrl.value),
70
+ ...options
71
+ });
72
+ };
73
+ const getTermsOfServiceStatus = async (legalEntityId, url) => {
74
+ return httpGet({
75
+ loadingContext: url,
76
+ errorLevel: "warn",
77
+ errorMessage: `Failed to get terms of service status`,
78
+ path: `legalEntities/${legalEntityId}/termsOfService/termsOfServiceStatus`,
79
+ authentication: "jwt",
80
+ headers: {
81
+ "Content-Type": "application/json"
82
+ }
83
+ });
84
+ };
85
+ const useTermsOfServiceStatus = (options) => {
86
+ const { legalEntityId, baseUrl } = useApiContext();
87
+ return useQuery({
88
+ queryKey: ["termsOfServiceStatus"],
89
+ queryFn: () => getTermsOfServiceStatus(legalEntityId.value, baseUrl.value),
90
+ ...options
91
+ });
92
+ };
93
+ const getAcceptedTermsOfService = async (legalEntityId, url, termsOfServiceAcceptanceReference, documentFormat) => {
94
+ return httpGet({
95
+ loadingContext: url,
96
+ errorLevel: "warn",
97
+ errorMessage: `Failed to get accepted service agreement`,
98
+ path: `legalEntities/${legalEntityId}/termsOfService/acceptedTermsOfServiceDocument/${termsOfServiceAcceptanceReference}?documentformat=${documentFormat} `,
99
+ authentication: "jwt",
100
+ headers: {
101
+ "Content-Type": "application/json"
102
+ }
103
+ });
104
+ };
105
+ const useAcceptedTermsOfService = (termsOfServiceAcceptanceReference, documentFormat, options) => {
106
+ const { legalEntityId, baseUrl } = useApiContext();
107
+ return useQuery({
108
+ queryKey: ["acceptedTermsOfService", termsOfServiceAcceptanceReference, documentFormat],
109
+ queryFn: termsOfServiceAcceptanceReference ? () => getAcceptedTermsOfService(
110
+ legalEntityId.value,
111
+ baseUrl.value,
112
+ termsOfServiceAcceptanceReference,
113
+ documentFormat
114
+ ) : skipToken,
115
+ ...options
116
+ });
117
+ };
118
+ const getTermsOfService = async (legalEntityId, url, data) => {
119
+ return httpPost(
120
+ {
121
+ loadingContext: url,
122
+ errorLevel: "warn",
123
+ errorMessage: `Failed to get terms of service`,
124
+ path: `legalEntities/${legalEntityId}/termsOfService`,
125
+ authentication: "jwt",
126
+ headers: {
127
+ "Content-Type": "application/json"
128
+ }
129
+ },
130
+ data
131
+ );
132
+ };
133
+ const useTermsOfService = (data, options) => {
134
+ const { legalEntityId, baseUrl } = useApiContext();
135
+ return useQuery({
136
+ queryKey: ["termsOfService", data],
137
+ queryFn: () => getTermsOfService(legalEntityId.value, baseUrl.value, data),
138
+ ...options
139
+ });
140
+ };
141
+ const outlinedIcon = "adyen-kyc-outlined-icon";
142
+ const styles = {
143
+ outlinedIcon
144
+ };
145
+ const OutlinedIcon = ({ name }) => /* @__PURE__ */ jsx("div", { className: styles.outlinedIcon, children: /* @__PURE__ */ jsx(Icon, { name }) });
146
+ const FormEndState = ({ variant = "success", children, className }) => {
147
+ const Slot = defineSlots(children, ["title", "content", "icon", "actions"]);
148
+ return /* @__PURE__ */ jsxs(
149
+ "div",
150
+ {
151
+ className: cx("adyen-form-end-state", `adyen-form-end-state__icon--${variant}`, className),
152
+ role: "alert",
153
+ children: [
154
+ /* @__PURE__ */ jsx(Slot, { name: "icon", children: variant === "success" ? /* @__PURE__ */ jsx(Icon, { name: "checkmark" }) : /* @__PURE__ */ jsx(AlertIcon, { variant }) }),
155
+ /* @__PURE__ */ jsx("span", { className: "adyen-form-end-state__title", children: /* @__PURE__ */ jsx(Slot, { name: "title" }) }),
156
+ /* @__PURE__ */ jsx("div", { className: "adyen-form-end-state__description", children: /* @__PURE__ */ jsx(Slot, { name: "content" }) }),
157
+ /* @__PURE__ */ jsx("div", { className: "adyen-form-end-state__actions", children: /* @__PURE__ */ jsx(Slot, { name: "actions" }) })
158
+ ]
159
+ }
160
+ );
161
+ };
162
+ const downloadFile = async (base64, filename) => {
163
+ saveBlobAsFile(base64ToBlob(base64), filename);
164
+ };
165
+ const base64ToBlob = (base64, mimeType = "application/octet-stream") => {
166
+ const bytes = window.atob(base64);
167
+ const amount = bytes.length;
168
+ const byteArray = new Array(amount);
169
+ for (let i = 0; i < amount; i += 1) {
170
+ byteArray[i] = bytes.charCodeAt(i);
171
+ }
172
+ return new Blob([new Uint8Array(byteArray)], { type: mimeType });
173
+ };
174
+ const saveBlobAsFile = (fileData, filename) => {
175
+ if ("msSaveBlob" in window.navigator && typeof window.navigator.msSaveBlob === "function") {
176
+ window.navigator.msSaveBlob(fileData, filename);
177
+ } else {
178
+ const blobUrl = window.URL.createObjectURL(fileData);
179
+ const link = document.createElement("a");
180
+ link.style.display = "none";
181
+ link.href = blobUrl;
182
+ link.setAttribute("download", filename);
183
+ if (typeof link.download === "undefined") {
184
+ link.setAttribute("target", "_blank");
185
+ }
186
+ document.body.appendChild(link);
187
+ link.click();
188
+ document.body.removeChild(link);
189
+ window.URL.revokeObjectURL(blobUrl);
190
+ }
191
+ };
192
+ var G, d, xe, E, le, $e, X, Ce, D = {}, Se = [], Ye = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, re = Array.isArray;
193
+ function C(e, t) {
194
+ for (var n in t)
195
+ e[n] = t[n];
196
+ return e;
197
+ }
198
+ function Ee(e) {
199
+ var t = e.parentNode;
200
+ t && t.removeChild(e);
201
+ }
202
+ function Pe(e, t, n) {
203
+ var o, _, r, c = {};
204
+ for (r in t)
205
+ r == "key" ? o = t[r] : r == "ref" ? _ = t[r] : c[r] = t[r];
206
+ if (arguments.length > 2 && (c.children = arguments.length > 3 ? G.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null)
207
+ for (r in e.defaultProps)
208
+ c[r] === void 0 && (c[r] = e.defaultProps[r]);
209
+ return M(e, c, o, _, null);
210
+ }
211
+ function M(e, t, n, o, _) {
212
+ var r = { type: e, props: t, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: _ ?? ++xe, __i: -1, __u: 0 };
213
+ return _ == null && d.vnode != null && d.vnode(r), r;
214
+ }
215
+ function Y(e) {
216
+ return e.children;
217
+ }
218
+ function W(e, t) {
219
+ this.props = e, this.context = t;
220
+ }
221
+ function L(e, t) {
222
+ if (t == null)
223
+ return e.__ ? L(e.__, e.__i + 1) : null;
224
+ for (var n; t < e.__k.length; t++)
225
+ if ((n = e.__k[t]) != null && n.__e != null)
226
+ return n.__e;
227
+ return typeof e.type == "function" ? L(e) : null;
228
+ }
229
+ function He(e) {
230
+ var t, n;
231
+ if ((e = e.__) != null && e.__c != null) {
232
+ for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++)
233
+ if ((n = e.__k[t]) != null && n.__e != null) {
234
+ e.__e = e.__c.base = n.__e;
235
+ break;
236
+ }
237
+ return He(e);
238
+ }
239
+ }
240
+ function Z(e) {
241
+ (!e.__d && (e.__d = true) && E.push(e) && !q.__r++ || le !== d.debounceRendering) && ((le = d.debounceRendering) || $e)(q);
242
+ }
243
+ function q() {
244
+ var e, t, n, o, _, r, c, s, a;
245
+ for (E.sort(X); e = E.shift(); )
246
+ e.__d && (t = E.length, o = void 0, r = (_ = (n = e).__v).__e, s = [], a = [], (c = n.__P) && ((o = C({}, _)).__v = _.__v + 1, d.vnode && d.vnode(o), _e(c, o, _, n.__n, c.ownerSVGElement !== void 0, 32 & _.__u ? [r] : null, s, r ?? L(_), !!(32 & _.__u), a), o.__.__k[o.__i] = o, Te(s, o, a), o.__e != r && He(o)), E.length > t && E.sort(X));
247
+ q.__r = 0;
248
+ }
249
+ function Le(e, t, n, o, _, r, c, s, a, l, p) {
250
+ var i, h, f, v, w, b = o && o.__k || Se, m = t.length;
251
+ for (n.__d = a, Ke(n, t, b), a = n.__d, i = 0; i < m; i++)
252
+ (f = n.__k[i]) != null && typeof f != "boolean" && typeof f != "function" && (h = f.__i === -1 ? D : b[f.__i] || D, f.__i = i, _e(e, f, h, _, r, c, s, a, l, p), v = f.__e, f.ref && h.ref != f.ref && (h.ref && ie(h.ref, null, f), p.push(f.ref, f.__c || v, f)), w == null && v != null && (w = v), 65536 & f.__u || h.__k === f.__k ? a = Ie(f, a, e) : typeof f.type == "function" && f.__d !== void 0 ? a = f.__d : v && (a = v.nextSibling), f.__d = void 0, f.__u &= -196609);
253
+ n.__d = a, n.__e = w;
254
+ }
255
+ function Ke(e, t, n) {
256
+ var o, _, r, c, s, a = t.length, l = n.length, p = l, i = 0;
257
+ for (e.__k = [], o = 0; o < a; o++)
258
+ (_ = e.__k[o] = (_ = t[o]) == null || typeof _ == "boolean" || typeof _ == "function" ? null : typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" || _.constructor == String ? M(null, _, null, null, _) : re(_) ? M(Y, { children: _ }, null, null, null) : _.constructor === void 0 && _.__b > 0 ? M(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : _) != null ? (_.__ = e, _.__b = e.__b + 1, s = Je(_, n, c = o + i, p), _.__i = s, r = null, s !== -1 && (p--, (r = n[s]) && (r.__u |= 131072)), r == null || r.__v === null ? (s == -1 && i--, typeof _.type != "function" && (_.__u |= 65536)) : s !== c && (s === c + 1 ? i++ : s > c ? p > a - c ? i += s - c : i-- : i = s < c && s == c - 1 ? s - c : 0, s !== o + i && (_.__u |= 65536))) : (r = n[o]) && r.key == null && r.__e && (r.__e == e.__d && (e.__d = L(r)), ee(r, r, false), n[o] = null, p--);
259
+ if (p)
260
+ for (o = 0; o < l; o++)
261
+ (r = n[o]) != null && !(131072 & r.__u) && (r.__e == e.__d && (e.__d = L(r)), ee(r, r));
262
+ }
263
+ function Ie(e, t, n) {
264
+ var o, _;
265
+ if (typeof e.type == "function") {
266
+ for (o = e.__k, _ = 0; o && _ < o.length; _++)
267
+ o[_] && (o[_].__ = e, t = Ie(o[_], t, n));
268
+ return t;
269
+ }
270
+ return e.__e != t && (n.insertBefore(e.__e, t || null), t = e.__e), t && t.nextSibling;
271
+ }
272
+ function Je(e, t, n, o) {
273
+ var _ = e.key, r = e.type, c = n - 1, s = n + 1, a = t[n];
274
+ if (a === null || a && _ == a.key && r === a.type)
275
+ return n;
276
+ if (o > (a != null && !(131072 & a.__u) ? 1 : 0))
277
+ for (; c >= 0 || s < t.length; ) {
278
+ if (c >= 0) {
279
+ if ((a = t[c]) && !(131072 & a.__u) && _ == a.key && r === a.type)
280
+ return c;
281
+ c--;
282
+ }
283
+ if (s < t.length) {
284
+ if ((a = t[s]) && !(131072 & a.__u) && _ == a.key && r === a.type)
285
+ return s;
286
+ s++;
287
+ }
288
+ }
289
+ return -1;
290
+ }
291
+ function ae(e, t, n) {
292
+ t[0] === "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Ye.test(t) ? n : n + "px";
293
+ }
294
+ function V(e, t, n, o, _) {
295
+ var r;
296
+ e:
297
+ if (t === "style")
298
+ if (typeof n == "string")
299
+ e.style.cssText = n;
300
+ else {
301
+ if (typeof o == "string" && (e.style.cssText = o = ""), o)
302
+ for (t in o)
303
+ n && t in n || ae(e.style, t, "");
304
+ if (n)
305
+ for (t in n)
306
+ o && n[t] === o[t] || ae(e.style, t, n[t]);
307
+ }
308
+ else if (t[0] === "o" && t[1] === "n")
309
+ r = t !== (t = t.replace(/(PointerCapture)$|Capture$/, "$1")), t = t.toLowerCase() in e ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + r] = n, n ? o ? n.u = o.u : (n.u = Date.now(), e.addEventListener(t, r ? fe : ue, r)) : e.removeEventListener(t, r ? fe : ue, r);
310
+ else {
311
+ if (_)
312
+ t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
313
+ else if (t !== "width" && t !== "height" && t !== "href" && t !== "list" && t !== "form" && t !== "tabIndex" && t !== "download" && t !== "rowSpan" && t !== "colSpan" && t !== "role" && t in e)
314
+ try {
315
+ e[t] = n ?? "";
316
+ break e;
317
+ } catch {
318
+ }
319
+ typeof n == "function" || (n == null || n === false && t[4] !== "-" ? e.removeAttribute(t) : e.setAttribute(t, n));
320
+ }
321
+ }
322
+ function ue(e) {
323
+ var t = this.l[e.type + false];
324
+ if (e.t) {
325
+ if (e.t <= t.u)
326
+ return;
327
+ } else
328
+ e.t = Date.now();
329
+ return t(d.event ? d.event(e) : e);
330
+ }
331
+ function fe(e) {
332
+ return this.l[e.type + true](d.event ? d.event(e) : e);
333
+ }
334
+ function _e(e, t, n, o, _, r, c, s, a, l) {
335
+ var p, i, h, f, v, w, b, m, g, $, R, A, se, U, J, k = t.type;
336
+ if (t.constructor !== void 0)
337
+ return null;
338
+ 128 & n.__u && (a = !!(32 & n.__u), r = [s = t.__e = n.__e]), (p = d.__b) && p(t);
339
+ e:
340
+ if (typeof k == "function")
341
+ try {
342
+ if (m = t.props, g = (p = k.contextType) && o[p.__c], $ = p ? g ? g.props.value : p.__ : o, n.__c ? b = (i = t.__c = n.__c).__ = i.__E : ("prototype" in k && k.prototype.render ? t.__c = i = new k(m, $) : (t.__c = i = new W(m, $), i.constructor = k, i.render = Xe), g && g.sub(i), i.props = m, i.state || (i.state = {}), i.context = $, i.__n = o, h = i.__d = true, i.__h = [], i._sb = []), i.__s == null && (i.__s = i.state), k.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = C({}, i.__s)), C(i.__s, k.getDerivedStateFromProps(m, i.__s))), f = i.props, v = i.state, i.__v = t, h)
343
+ k.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), i.componentDidMount != null && i.__h.push(i.componentDidMount);
344
+ else {
345
+ if (k.getDerivedStateFromProps == null && m !== f && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, $), !i.__e && (i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, $) === false || t.__v === n.__v)) {
346
+ for (t.__v !== n.__v && (i.props = m, i.state = i.__s, i.__d = false), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(O) {
347
+ O && (O.__ = t);
348
+ }), R = 0; R < i._sb.length; R++)
349
+ i.__h.push(i._sb[R]);
350
+ i._sb = [], i.__h.length && c.push(i);
351
+ break e;
352
+ }
353
+ i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s, $), i.componentDidUpdate != null && i.__h.push(function() {
354
+ i.componentDidUpdate(f, v, w);
355
+ });
356
+ }
357
+ if (i.context = $, i.props = m, i.__P = e, i.__e = false, A = d.__r, se = 0, "prototype" in k && k.prototype.render) {
358
+ for (i.state = i.__s, i.__d = false, A && A(t), p = i.render(i.props, i.state, i.context), U = 0; U < i._sb.length; U++)
359
+ i.__h.push(i._sb[U]);
360
+ i._sb = [];
361
+ } else
362
+ do
363
+ i.__d = false, A && A(t), p = i.render(i.props, i.state, i.context), i.state = i.__s;
364
+ while (i.__d && ++se < 25);
365
+ i.state = i.__s, i.getChildContext != null && (o = C(C({}, o), i.getChildContext())), h || i.getSnapshotBeforeUpdate == null || (w = i.getSnapshotBeforeUpdate(f, v)), Le(e, re(J = p != null && p.type === Y && p.key == null ? p.props.children : p) ? J : [J], t, n, o, _, r, c, s, a, l), i.base = t.__e, t.__u &= -161, i.__h.length && c.push(i), b && (i.__E = i.__ = null);
366
+ } catch (O) {
367
+ t.__v = null, a || r != null ? (t.__e = s, t.__u |= a ? 160 : 32, r[r.indexOf(s)] = null) : (t.__e = n.__e, t.__k = n.__k), d.__e(O, t, n);
368
+ }
369
+ else
370
+ r == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = Qe(n.__e, t, n, o, _, r, c, a, l);
371
+ (p = d.diffed) && p(t);
372
+ }
373
+ function Te(e, t, n) {
374
+ t.__d = void 0;
375
+ for (var o = 0; o < n.length; o++)
376
+ ie(n[o], n[++o], n[++o]);
377
+ d.__c && d.__c(t, e), e.some(function(_) {
378
+ try {
379
+ e = _.__h, _.__h = [], e.some(function(r) {
380
+ r.call(_);
381
+ });
382
+ } catch (r) {
383
+ d.__e(r, _.__v);
384
+ }
385
+ });
386
+ }
387
+ function Qe(e, t, n, o, _, r, c, s, a) {
388
+ var l, p, i, h, f, v, w, b = n.props, m = t.props, g = t.type;
389
+ if (g === "svg" && (_ = true), r != null) {
390
+ for (l = 0; l < r.length; l++)
391
+ if ((f = r[l]) && "setAttribute" in f == !!g && (g ? f.localName === g : f.nodeType === 3)) {
392
+ e = f, r[l] = null;
393
+ break;
394
+ }
395
+ }
396
+ if (e == null) {
397
+ if (g === null)
398
+ return document.createTextNode(m);
399
+ e = _ ? document.createElementNS("http://www.w3.org/2000/svg", g) : document.createElement(g, m.is && m), r = null, s = false;
400
+ }
401
+ if (g === null)
402
+ b === m || s && e.data === m || (e.data = m);
403
+ else {
404
+ if (r = r && G.call(e.childNodes), b = n.props || D, !s && r != null)
405
+ for (b = {}, l = 0; l < e.attributes.length; l++)
406
+ b[(f = e.attributes[l]).name] = f.value;
407
+ for (l in b)
408
+ f = b[l], l == "children" || (l == "dangerouslySetInnerHTML" ? i = f : l === "key" || l in m || V(e, l, null, f, _));
409
+ for (l in m)
410
+ f = m[l], l == "children" ? h = f : l == "dangerouslySetInnerHTML" ? p = f : l == "value" ? v = f : l == "checked" ? w = f : l === "key" || s && typeof f != "function" || b[l] === f || V(e, l, f, b[l], _);
411
+ if (p)
412
+ s || i && (p.__html === i.__html || p.__html === e.innerHTML) || (e.innerHTML = p.__html), t.__k = [];
413
+ else if (i && (e.innerHTML = ""), Le(e, re(h) ? h : [h], t, n, o, _ && g !== "foreignObject", r, c, r ? r[0] : n.__k && L(n, 0), s, a), r != null)
414
+ for (l = r.length; l--; )
415
+ r[l] != null && Ee(r[l]);
416
+ s || (l = "value", v !== void 0 && (v !== e[l] || g === "progress" && !v || g === "option" && v !== b[l]) && V(e, l, v, b[l], false), l = "checked", w !== void 0 && w !== e[l] && V(e, l, w, b[l], false));
417
+ }
418
+ return e;
419
+ }
420
+ function ie(e, t, n) {
421
+ try {
422
+ typeof e == "function" ? e(t) : e.current = t;
423
+ } catch (o) {
424
+ d.__e(o, n);
425
+ }
426
+ }
427
+ function ee(e, t, n) {
428
+ var o, _;
429
+ if (d.unmount && d.unmount(e), (o = e.ref) && (o.current && o.current !== e.__e || ie(o, null, t)), (o = e.__c) != null) {
430
+ if (o.componentWillUnmount)
431
+ try {
432
+ o.componentWillUnmount();
433
+ } catch (r) {
434
+ d.__e(r, t);
435
+ }
436
+ o.base = o.__P = null, e.__c = void 0;
437
+ }
438
+ if (o = e.__k)
439
+ for (_ = 0; _ < o.length; _++)
440
+ o[_] && ee(o[_], t, n || typeof e.type != "function");
441
+ n || e.__e == null || Ee(e.__e), e.__ = e.__e = e.__d = void 0;
442
+ }
443
+ function Xe(e, t, n) {
444
+ return this.constructor(e, n);
445
+ }
446
+ function Ze(e, t, n) {
447
+ var o, _, r, c;
448
+ d.__ && d.__(e, t), _ = (o = false) ? null : t.__k, r = [], c = [], _e(t, e = t.__k = Pe(Y, null, [e]), _ || D, D, t.ownerSVGElement !== void 0, _ ? null : t.firstChild ? G.call(t.childNodes) : null, r, _ ? _.__e : t.firstChild, o, c), Te(r, e, c);
449
+ }
450
+ function Ae(e, t) {
451
+ var n = { __c: t = "__cC" + Ce++, __: e, Consumer: function(o, _) {
452
+ return o.children(_);
453
+ }, Provider: function(o) {
454
+ var _, r;
455
+ return this.getChildContext || (_ = [], (r = {})[t] = this, this.getChildContext = function() {
456
+ return r;
457
+ }, this.shouldComponentUpdate = function(c) {
458
+ this.props.value !== c.value && _.some(function(s) {
459
+ s.__e = true, Z(s);
460
+ });
461
+ }, this.sub = function(c) {
462
+ _.push(c);
463
+ var s = c.componentWillUnmount;
464
+ c.componentWillUnmount = function() {
465
+ _.splice(_.indexOf(c), 1), s && s.call(c);
466
+ };
467
+ }), o.children;
468
+ } };
469
+ return n.Provider.__ = n.Consumer.contextType = n;
470
+ }
471
+ G = Se.slice, d = { __e: function(e, t, n, o) {
472
+ for (var _, r, c; t = t.__; )
473
+ if ((_ = t.__c) && !_.__)
474
+ try {
475
+ if ((r = _.constructor) && r.getDerivedStateFromError != null && (_.setState(r.getDerivedStateFromError(e)), c = _.__d), _.componentDidCatch != null && (_.componentDidCatch(e, o || {}), c = _.__d), c)
476
+ return _.__E = _;
477
+ } catch (s) {
478
+ e = s;
479
+ }
480
+ throw e;
481
+ } }, xe = 0, W.prototype.setState = function(e, t) {
482
+ var n;
483
+ n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = C({}, this.state), typeof e == "function" && (e = e(C({}, n), this.props)), e && C(n, e), e != null && this.__v && (t && this._sb.push(t), Z(this));
484
+ }, W.prototype.forceUpdate = function(e) {
485
+ this.__v && (this.__e = true, e && this.__h.push(e), Z(this));
486
+ }, W.prototype.render = Y, E = [], $e = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, X = function(e, t) {
487
+ return e.__v.__b - t.__v.__b;
488
+ }, q.__r = 0, Ce = 0;
489
+ var et = 0;
490
+ function u(e, t, n, o, _, r) {
491
+ var c, s, a = {};
492
+ for (s in t)
493
+ s == "ref" ? c = t[s] : a[s] = t[s];
494
+ var l = { type: e, props: a, key: n, ref: c, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --et, __i: -1, __u: 0, __source: _, __self: r };
495
+ if (typeof e == "function" && (c = e.defaultProps))
496
+ for (s in c)
497
+ a[s] === void 0 && (a[s] = c[s]);
498
+ return d.vnode && d.vnode(l), l;
499
+ }
500
+ function tt(e) {
501
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
502
+ }
503
+ var De = { exports: {} };
504
+ /*!
505
+ Copyright (c) 2018 Jed Watson.
506
+ Licensed under the MIT License (MIT), see
507
+ http://jedwatson.github.io/classnames
508
+ */
509
+ (function(e) {
510
+ (function() {
511
+ var t = {}.hasOwnProperty;
512
+ function n() {
513
+ for (var r = "", c = 0; c < arguments.length; c++) {
514
+ var s = arguments[c];
515
+ s && (r = _(r, o(s)));
516
+ }
517
+ return r;
518
+ }
519
+ function o(r) {
520
+ if (typeof r == "string" || typeof r == "number")
521
+ return r;
522
+ if (typeof r != "object")
523
+ return "";
524
+ if (Array.isArray(r))
525
+ return n.apply(null, r);
526
+ if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
527
+ return r.toString();
528
+ var c = "";
529
+ for (var s in r)
530
+ t.call(r, s) && r[s] && (c = _(c, s));
531
+ return c;
532
+ }
533
+ function _(r, c) {
534
+ return c ? r ? r + " " + c : r + c : r;
535
+ }
536
+ e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
537
+ })();
538
+ })(De);
539
+ var nt = De.exports;
540
+ const x = /* @__PURE__ */ tt(nt);
541
+ var N = /* @__PURE__ */ ((e) => (e.Chapter = "chapter", e.Section = "section", e.Paragraph = "paragraph", e.Text = "text", e.Weblink = "weblink", e.List = "list", e.Table = "table", e.InternalReference = "internalReference", e))(N || {}), te = /* @__PURE__ */ ((e) => (e.Bold = "BOLD", e.Italic = "ITALIC", e))(te || {});
542
+ let de = Date.now();
543
+ const Re = (e = "id") => (de += 1, `${e}-${de}`);
544
+ var I, y, Q, pe, z = 0, Ue = [], F = [], he = d.__b, ve = d.__r, me = d.diffed, ye = d.__c, be = d.unmount;
545
+ function K(e, t) {
546
+ d.__h && d.__h(y, e, z || t), z = 0;
547
+ var n = y.__H || (y.__H = { __: [], __h: [] });
548
+ return e >= n.__.length && n.__.push({ __V: F }), n.__[e];
549
+ }
550
+ function T(e) {
551
+ return z = 1, ot(We, e);
552
+ }
553
+ function ot(e, t, n) {
554
+ var o = K(I++, 2);
555
+ if (o.t = e, !o.__c && (o.__ = [We(void 0, t), function(s) {
556
+ var a = o.__N ? o.__N[0] : o.__[0], l = o.t(a, s);
557
+ a !== l && (o.__N = [l, o.__[1]], o.__c.setState({}));
558
+ }], o.__c = y, !y.u)) {
559
+ var _ = function(s, a, l) {
560
+ if (!o.__c.__H)
561
+ return true;
562
+ var p = o.__c.__H.__.filter(function(h) {
563
+ return h.__c;
564
+ });
565
+ if (p.every(function(h) {
566
+ return !h.__N;
567
+ }))
568
+ return !r || r.call(this, s, a, l);
569
+ var i = false;
570
+ return p.forEach(function(h) {
571
+ if (h.__N) {
572
+ var f = h.__[0];
573
+ h.__ = h.__N, h.__N = void 0, f !== h.__[0] && (i = true);
574
+ }
575
+ }), !(!i && o.__c.props === s) && (!r || r.call(this, s, a, l));
576
+ };
577
+ y.u = true;
578
+ var r = y.shouldComponentUpdate, c = y.componentWillUpdate;
579
+ y.componentWillUpdate = function(s, a, l) {
580
+ if (this.__e) {
581
+ var p = r;
582
+ r = void 0, _(s, a, l), r = p;
583
+ }
584
+ c && c.call(this, s, a, l);
585
+ }, y.shouldComponentUpdate = _;
586
+ }
587
+ return o.__N || o.__;
588
+ }
589
+ function H(e, t) {
590
+ var n = K(I++, 3);
591
+ !d.__s && Me(n.__H, t) && (n.__ = e, n.i = t, y.__H.__h.push(n));
592
+ }
593
+ function rt(e) {
594
+ return z = 5, Oe(function() {
595
+ return { current: e };
596
+ }, []);
597
+ }
598
+ function Oe(e, t) {
599
+ var n = K(I++, 7);
600
+ return Me(n.__H, t) ? (n.__V = e(), n.i = t, n.__h = e, n.__V) : n.__;
601
+ }
602
+ function Ve(e) {
603
+ var t = y.context[e.__c], n = K(I++, 9);
604
+ return n.c = e, t ? (n.__ == null && (n.__ = true, t.sub(y)), t.props.value) : e.__;
605
+ }
606
+ function _t() {
607
+ for (var e; e = Ue.shift(); )
608
+ if (e.__P && e.__H)
609
+ try {
610
+ e.__H.__h.forEach(B), e.__H.__h.forEach(ne), e.__H.__h = [];
611
+ } catch (t) {
612
+ e.__H.__h = [], d.__e(t, e.__v);
613
+ }
614
+ }
615
+ d.__b = function(e) {
616
+ y = null, he && he(e);
617
+ }, d.__r = function(e) {
618
+ ve && ve(e), I = 0;
619
+ var t = (y = e.__c).__H;
620
+ t && (Q === y ? (t.__h = [], y.__h = [], t.__.forEach(function(n) {
621
+ n.__N && (n.__ = n.__N), n.__V = F, n.__N = n.i = void 0;
622
+ })) : (t.__h.forEach(B), t.__h.forEach(ne), t.__h = [], I = 0)), Q = y;
623
+ }, d.diffed = function(e) {
624
+ me && me(e);
625
+ var t = e.__c;
626
+ t && t.__H && (t.__H.__h.length && (Ue.push(t) !== 1 && pe === d.requestAnimationFrame || ((pe = d.requestAnimationFrame) || it)(_t)), t.__H.__.forEach(function(n) {
627
+ n.i && (n.__H = n.i), n.__V !== F && (n.__ = n.__V), n.i = void 0, n.__V = F;
628
+ })), Q = y = null;
629
+ }, d.__c = function(e, t) {
630
+ t.some(function(n) {
631
+ try {
632
+ n.__h.forEach(B), n.__h = n.__h.filter(function(o) {
633
+ return !o.__ || ne(o);
634
+ });
635
+ } catch (o) {
636
+ t.some(function(_) {
637
+ _.__h && (_.__h = []);
638
+ }), t = [], d.__e(o, n.__v);
639
+ }
640
+ }), ye && ye(e, t);
641
+ }, d.unmount = function(e) {
642
+ be && be(e);
643
+ var t, n = e.__c;
644
+ n && n.__H && (n.__H.__.forEach(function(o) {
645
+ try {
646
+ B(o);
647
+ } catch (_) {
648
+ t = _;
649
+ }
650
+ }), n.__H = void 0, t && d.__e(t, n.__v));
651
+ };
652
+ var ge = typeof requestAnimationFrame == "function";
653
+ function it(e) {
654
+ var t, n = function() {
655
+ clearTimeout(o), ge && cancelAnimationFrame(t), setTimeout(e);
656
+ }, o = setTimeout(n, 100);
657
+ ge && (t = requestAnimationFrame(n));
658
+ }
659
+ function B(e) {
660
+ var t = y, n = e.__c;
661
+ typeof n == "function" && (e.__c = void 0, n()), y = t;
662
+ }
663
+ function ne(e) {
664
+ var t = y;
665
+ e.__c = e.__(), y = t;
666
+ }
667
+ function Me(e, t) {
668
+ return !e || e.length !== t.length || t.some(function(n, o) {
669
+ return n !== e[o];
670
+ });
671
+ }
672
+ function We(e, t) {
673
+ return typeof t == "function" ? t(e) : t;
674
+ }
675
+ const Fe = Ae(null);
676
+ function ct({
677
+ children: e,
678
+ className: t,
679
+ expand: n = false,
680
+ type: o,
681
+ onExpandSection: _
682
+ }) {
683
+ const [r, c] = T([]), s = x("adv-accordion", t, {
684
+ "adv-accordion--container": o === "container"
685
+ });
686
+ return /* @__PURE__ */ u(Fe.Provider, { value: { expand: n, items: r, setItems: c, onExpandSection: _ }, children: /* @__PURE__ */ u("div", { className: s, children: e }) });
687
+ }
688
+ const we = {
689
+ 1: "h1",
690
+ 2: "h2"
691
+ };
692
+ function ce({ className: e, level: t, children: n }) {
693
+ const o = we[t] || we[1], _ = x("adv-heading", `adv-heading--${t}`, e);
694
+ return Pe(o, { className: _ }, n);
695
+ }
696
+ function P({ content: e, styles: t }) {
697
+ const n = x({
698
+ "adv-u-font-weight-semi-bold": t == null ? void 0 : t.includes(te.Bold),
699
+ "adv-u-font-italic": t == null ? void 0 : t.includes(te.Italic)
700
+ });
701
+ return /* @__PURE__ */ u("span", { className: n, children: e });
702
+ }
703
+ function st({ title: e, contentElements: t }) {
704
+ return /* @__PURE__ */ u("section", { className: "adv-u-margin-bottom-48", children: [
705
+ /* @__PURE__ */ u(ce, { level: 2, className: "adv-u-margin-top-24 adv-u-margin-bottom-16", children: /* @__PURE__ */ u(P, { content: e.content, styles: e.styles }) }),
706
+ /* @__PURE__ */ u(S, { contentElements: t, isTopLevel: true })
707
+ ] });
708
+ }
709
+ const Be = Ae({
710
+ references: {},
711
+ addReference: () => {
712
+ }
713
+ });
714
+ function qe() {
715
+ const e = Ve(Be);
716
+ if (e === void 0)
717
+ throw new Error("useReferenceContext must be used within a ReferenceProvider");
718
+ return e;
719
+ }
720
+ const lt = (e) => new Promise((t) => {
721
+ setTimeout(t, e);
722
+ }), j = (e) => e ? `adyen-document-viewer-${e.replace(/[^\w-]/g, "").slice(0, 32)}` : void 0, ze = (e) => {
723
+ if (!e)
724
+ return null;
725
+ const t = e instanceof HTMLElement, n = t && window.getComputedStyle(e).overflowY;
726
+ return t && (n !== "visible" && n !== "hidden") ? e : ze(e.parentNode) ?? document.body;
727
+ };
728
+ const at = ({ onClick: e, label: t }) => /* @__PURE__ */ u("button", { className: "adv-link", type: "button", onClick: e, title: t, children: t });
729
+ function ut({
730
+ referencedLabel: e,
731
+ displayText: t
732
+ }) {
733
+ const n = t ? t.content : e, o = j(e) ?? "", { references: _ } = qe();
734
+ return /* @__PURE__ */ u(at, { onClick: async () => {
735
+ _ && o && _[o] && (_[o].openSection(), await lt(150));
736
+ const c = ze(document.getElementById(o)), s = c == null ? void 0 : c.querySelector(`#${o}`);
737
+ s == null || s.scrollIntoView({ behavior: "smooth" });
738
+ }, label: n });
739
+ }
740
+ function ft({ className: e, nested: t, ordered: n, noMarkers: o, children: _ }) {
741
+ const r = x([
742
+ "adv-list",
743
+ t && "adv-list--nested",
744
+ n && "adv-list--ordered",
745
+ o && "adv-list--no-markers",
746
+ e
747
+ ]);
748
+ return /* @__PURE__ */ u("ul", { className: r, children: _ });
749
+ }
750
+ function dt({ className: e, children: t, noMarkers: n }) {
751
+ const o = x(["adv-list__item", n && "adv-list__item--no-markers", e]);
752
+ return /* @__PURE__ */ u("li", { className: o, children: t });
753
+ }
754
+ function je({ items: e, style: t }) {
755
+ return /* @__PURE__ */ u(ft, { ordered: t.ordered, children: e.map((n, o) => /* @__PURE__ */ u(dt, { children: [
756
+ /* @__PURE__ */ u(S, { contentElements: n.content }),
757
+ n.subList && /* @__PURE__ */ u(je, { style: n.subList.style, items: n.subList.items })
758
+ ] }, o)) });
759
+ }
760
+ function pt({ isTopLevel: e, contentElements: t }) {
761
+ const n = x("adv-paragraph", {
762
+ "adv-u-margin-bottom-16": e
763
+ });
764
+ return /* @__PURE__ */ u("p", { className: n, children: /* @__PURE__ */ u(S, { contentElements: t }) });
765
+ }
766
+ function ht({
767
+ children: e,
768
+ collapsed: t = false
769
+ }) {
770
+ const n = rt(null), [o, _] = T(t ? 0 : void 0);
771
+ return H(() => {
772
+ var r;
773
+ _(t ? 0 : (r = n.current) == null ? void 0 : r.scrollHeight);
774
+ }, [t]), /* @__PURE__ */ u(
775
+ "div",
776
+ {
777
+ className: "adv-collapsible-container",
778
+ "aria-hidden": t,
779
+ ref: n,
780
+ style: { height: o },
781
+ children: e
782
+ }
783
+ );
784
+ }
785
+ const vt = ({ className: e = "", name: t }) => {
786
+ const n = {
787
+ "chevron-up": /* @__PURE__ */ u("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 15 15", width: "15", height: "15", children: /* @__PURE__ */ u(
788
+ "path",
789
+ {
790
+ fillRule: "evenodd",
791
+ d: "M13 10a1 1 0 0 1-1.743.669L7.5 6.495 3.743 10.67a1 1 0 0 1-1.486-1.338l4.5-5a1 1 0 0 1 1.486 0l4.5 5a.998.998 0 0 1 .257.67z"
792
+ }
793
+ ) }),
794
+ "chevron-down": /* @__PURE__ */ u("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 15 15", width: "15", height: "15", children: /* @__PURE__ */ u(
795
+ "path",
796
+ {
797
+ fillRule: "evenodd",
798
+ d: "M2 5a1 1 0 0 1 1.743-.669L7.5 8.505l3.757-4.174a1 1 0 0 1 1.486 1.338l-4.5 5a1 1 0 0 1-1.486 0l-4.5-5A.998.998 0 0 1 2 4.999z"
799
+ }
800
+ ) })
801
+ };
802
+ return /* @__PURE__ */ u("i", { className: x("adv-icon", e), role: "img", "aria-hidden": true, children: n[t] });
803
+ };
804
+ function mt() {
805
+ return Ve(Fe);
806
+ }
807
+ function yt({
808
+ children: e,
809
+ open: t = false,
810
+ title: n = "",
811
+ onOpen: o = () => {
812
+ },
813
+ onClose: _ = () => {
814
+ }
815
+ }) {
816
+ const { expand: r, items: c, setItems: s, onExpandSection: a } = mt(), [l, p] = T(t), [i] = T(Re), h = () => {
817
+ const f = !l, v = [...c];
818
+ r ? (v.find((w) => w.id === i).isOpen = f, s(v)) : s(v.map((w) => ({ ...w, isOpen: w.id === i ? f : false })));
819
+ };
820
+ return H(() => {
821
+ s((f) => [...f, { id: i, isOpen: l }]);
822
+ }, []), H(() => {
823
+ p(t);
824
+ }, [t]), H(() => {
825
+ var f;
826
+ p(((f = c.find((v) => v.id === i)) == null ? void 0 : f.isOpen) ?? false);
827
+ }, [c]), H(() => {
828
+ l ? (a == null || a(n), o()) : _();
829
+ }, [l]), /* @__PURE__ */ u("div", { className: "adv-accordion__item", children: [
830
+ /* @__PURE__ */ u("div", { role: "button", className: "adv-accordion__header", tabIndex: 0, onClick: h, children: [
831
+ /* @__PURE__ */ u(vt, { name: l ? "chevron-up" : "chevron-down", className: "adv-accordion__toggle" }),
832
+ /* @__PURE__ */ u("div", { className: "adv-accordion__title-wrapper", children: /* @__PURE__ */ u("div", { className: "adv-accordion__title", children: n }) })
833
+ ] }),
834
+ /* @__PURE__ */ u(ht, { collapsed: !l, children: /* @__PURE__ */ u("div", { className: "adv-accordion__content", children: e }) })
835
+ ] });
836
+ }
837
+ const Ge = (e) => {
838
+ if (typeof e != "object" || e === null)
839
+ return [];
840
+ const t = [];
841
+ "label" in e && typeof e.label == "string" && e.label !== "" && t.push(e.label);
842
+ for (const n in e) {
843
+ const o = e[n];
844
+ (Array.isArray(o) || typeof o == "object" && o !== null) && t.push(...Ge(o));
845
+ }
846
+ return t;
847
+ };
848
+ function bt({
849
+ title: e,
850
+ label: t,
851
+ isTopLevel: n,
852
+ contentElements: o
853
+ }) {
854
+ const [_, r] = T(false), { addReference: c } = qe(), s = j(t);
855
+ return H(() => {
856
+ if (n) {
857
+ const a = Ge(o).map(j);
858
+ s && a.push(s), a.length && a.forEach((l) => {
859
+ c({ [l]: { openSection: () => r(true) } });
860
+ });
861
+ }
862
+ }, []), n ? /* @__PURE__ */ u(
863
+ yt,
864
+ {
865
+ title: e.content,
866
+ open: _,
867
+ onOpen: () => {
868
+ r(true);
869
+ },
870
+ onClose: () => {
871
+ r(false);
872
+ },
873
+ children: /* @__PURE__ */ u("section", { className: "adv-section-box", id: s, children: /* @__PURE__ */ u(S, { contentElements: o }) })
874
+ }
875
+ ) : /* @__PURE__ */ u("section", { id: s, children: [
876
+ /* @__PURE__ */ u(ce, { level: 2, className: "adv-u-margin-top-24 adv-u-margin-bottom-16", children: /* @__PURE__ */ u(P, { content: e.content, styles: e.styles }) }),
877
+ /* @__PURE__ */ u(S, { contentElements: o })
878
+ ] });
879
+ }
880
+ function gt({
881
+ rows: e,
882
+ label: t,
883
+ captions: n,
884
+ titlePrefix: o,
885
+ title: _
886
+ }) {
887
+ const r = j(t);
888
+ return /* @__PURE__ */ u("div", { id: r, children: [
889
+ /* @__PURE__ */ u("div", { className: "adv-u-margin-y-8 adv-u-text-align-center", children: [
890
+ o && /* @__PURE__ */ u(P, { ...o }),
891
+ o && _ && " ",
892
+ _ && /* @__PURE__ */ u(P, { ..._ })
893
+ ] }),
894
+ /* @__PURE__ */ u("table", { className: "adv-table adv-table--condensed", children: [
895
+ n && /* @__PURE__ */ u("caption", { children: /* @__PURE__ */ u(S, { contentElements: n }) }),
896
+ /* @__PURE__ */ u("tbody", { className: "adv-table__body", children: e.map((c, s) => /* @__PURE__ */ u("tr", { className: "adv-table__row", children: c.map((a, l) => /* @__PURE__ */ u("td", { className: "adv-table__cell", children: /* @__PURE__ */ u(S, { contentElements: a.elements }) }, l)) }, s)) })
897
+ ] })
898
+ ] });
899
+ }
900
+ const wt = ({
901
+ className: e,
902
+ children: t,
903
+ href: n,
904
+ underline: o,
905
+ inheritStyles: _,
906
+ onClick: r
907
+ }) => {
908
+ const c = x("adv-link", e, {
909
+ "adv-link--underline": o,
910
+ "adv-link--inherit": _
911
+ });
912
+ return /* @__PURE__ */ u(
913
+ "a",
914
+ {
915
+ href: n,
916
+ className: c,
917
+ target: "_blank",
918
+ rel: "noopener noreferrer",
919
+ onClick: r,
920
+ children: /* @__PURE__ */ u("span", { className: "adv-link__text", children: t })
921
+ }
922
+ );
923
+ }, kt = ({ url: e, displayText: t }) => /* @__PURE__ */ u(wt, { href: e, children: t ? /* @__PURE__ */ u(P, { ...t }) : e }), Nt = {
924
+ chapter: st,
925
+ section: bt,
926
+ paragraph: pt,
927
+ text: P,
928
+ weblink: kt,
929
+ list: je,
930
+ table: gt,
931
+ internalReference: ut,
932
+ breakline: "br"
933
+ }, xt = (e) => `key-${e}-${Re()}`, $t = (e, t) => {
934
+ if (!("type" in e))
935
+ return null;
936
+ switch (e.type) {
937
+ case N.Chapter:
938
+ return {
939
+ title: e.title,
940
+ contentElements: e.contentElements
941
+ };
942
+ case N.Section:
943
+ return {
944
+ isTopLevel: t,
945
+ title: e.title,
946
+ label: e.label,
947
+ contentElements: e.contentElements
948
+ };
949
+ case N.Paragraph:
950
+ return {
951
+ isTopLevel: t,
952
+ contentElements: e.contentElements
953
+ };
954
+ case N.Text:
955
+ return {
956
+ content: e.content,
957
+ styles: e.styles
958
+ };
959
+ case N.Weblink:
960
+ return {
961
+ url: e.url,
962
+ displayText: e.displayText
963
+ };
964
+ case N.List:
965
+ return {
966
+ items: e.items,
967
+ style: e.style
968
+ };
969
+ case N.Table:
970
+ return {
971
+ rows: e.rows,
972
+ label: e.label,
973
+ captions: e.captions,
974
+ titlePrefix: e.titlePrefix,
975
+ title: e.title
976
+ };
977
+ case N.InternalReference:
978
+ return {
979
+ referencedLabel: e.referencedLabel,
980
+ displayText: e.displayText
981
+ };
982
+ default:
983
+ return null;
984
+ }
985
+ };
986
+ function S({
987
+ contentElements: e,
988
+ isTopLevel: t = false,
989
+ onExpandSection: n,
990
+ multiple: o
991
+ }) {
992
+ const _ = e.map((r) => {
993
+ if (!("type" in r))
994
+ return null;
995
+ const c = Nt[r.type];
996
+ return /* @__PURE__ */ u(c, { ...$t(r, t) }, xt(r.type));
997
+ });
998
+ return t ? /* @__PURE__ */ u(ct, { onExpandSection: n, expand: o, children: _ }) : /* @__PURE__ */ u("span", { children: _ });
999
+ }
1000
+ function Ct({ children: e }) {
1001
+ const [t, n] = T({}), o = Oe(
1002
+ () => ({
1003
+ addReference: (_) => {
1004
+ n((r) => ({
1005
+ ...r,
1006
+ ..._
1007
+ }));
1008
+ },
1009
+ references: t
1010
+ }),
1011
+ [t, n]
1012
+ );
1013
+ return /* @__PURE__ */ u(Be.Provider, { value: o, children: e });
1014
+ }
1015
+ function St({
1016
+ document: e,
1017
+ className: t,
1018
+ onExpandSection: n,
1019
+ multiple: o
1020
+ }) {
1021
+ const _ = x("adyen-document-viewer", t);
1022
+ return /* @__PURE__ */ u(Ct, { children: /* @__PURE__ */ u("div", { className: _, children: [
1023
+ /* @__PURE__ */ u(ce, { level: 1, className: "adv-u-margin-top-24 adv-u-margin-bottom-16", children: /* @__PURE__ */ u(P, { content: e.title.content, styles: e.title.styles }) }),
1024
+ /* @__PURE__ */ u(
1025
+ S,
1026
+ {
1027
+ contentElements: e.contentElements,
1028
+ onExpandSection: n,
1029
+ multiple: o,
1030
+ isTopLevel: true
1031
+ }
1032
+ )
1033
+ ] }) });
1034
+ }
1035
+ function ke(e) {
1036
+ return "type" in e && e.type === N.Section;
1037
+ }
1038
+ function Ne(e) {
1039
+ return "contentElements" in e && Array.isArray(e.contentElements);
1040
+ }
1041
+ function Et(e) {
1042
+ return e.isTopLevel ? `${e.counter}` : `${e.prefix}${e.counter}`;
1043
+ }
1044
+ function Pt(e, t) {
1045
+ return `${e} ${t}`;
1046
+ }
1047
+ function oe(e, t) {
1048
+ if (ke(e)) {
1049
+ const n = Et(t), o = {
1050
+ ...e,
1051
+ title: {
1052
+ ...e.title,
1053
+ content: Pt(n, e.title.content)
1054
+ }
1055
+ };
1056
+ if (t.counter += 1, Ne(e)) {
1057
+ let _ = 1;
1058
+ o.contentElements = e.contentElements.map((r) => {
1059
+ if (ke(r)) {
1060
+ const c = {
1061
+ prefix: `${n}.`,
1062
+ counter: _,
1063
+ isTopLevel: false
1064
+ };
1065
+ return _ += 1, oe(r, c);
1066
+ }
1067
+ return r;
1068
+ });
1069
+ }
1070
+ return o;
1071
+ }
1072
+ return Ne(e) ? {
1073
+ ...e,
1074
+ contentElements: e.contentElements.map(
1075
+ (n) => oe(n, t)
1076
+ )
1077
+ } : e;
1078
+ }
1079
+ function Ht(e) {
1080
+ const t = { prefix: "", counter: 1, isTopLevel: true };
1081
+ return {
1082
+ ...e,
1083
+ contentElements: e.contentElements.map(
1084
+ (n) => oe(n, t)
1085
+ )
1086
+ };
1087
+ }
1088
+ class Lt {
1089
+ /**
1090
+ * Initializes the library
1091
+ * @param target - The target element (HTMLElement or querySelector string)
1092
+ * @param options - Configuration options for AdyenDocumentViewer
1093
+ */
1094
+ constructor(t, n = {}) {
1095
+ if (typeof t == "object" && "nodeType" in t)
1096
+ this.target = t;
1097
+ else {
1098
+ const o = window.document.querySelector(t);
1099
+ if (o instanceof HTMLElement)
1100
+ this.target = o;
1101
+ else
1102
+ throw new Error("Target element was not found");
1103
+ }
1104
+ this.options = {
1105
+ onExpandSection: n.onExpandSection ?? void 0,
1106
+ multiple: n.multiple ?? false,
1107
+ showSectionNumbering: n.showSectionNumbering ?? false
1108
+ };
1109
+ }
1110
+ /**
1111
+ * Renders the document
1112
+ * @param document - The JSON document
1113
+ */
1114
+ render(t) {
1115
+ const n = this.options.showSectionNumbering ? Ht(t) : t;
1116
+ Ze(
1117
+ /* @__PURE__ */ u(
1118
+ St,
1119
+ {
1120
+ document: n,
1121
+ onExpandSection: this.options.onExpandSection,
1122
+ multiple: this.options.multiple
1123
+ }
1124
+ ),
1125
+ this.target
1126
+ );
1127
+ }
1128
+ }
1129
+ function ContractViewer({
1130
+ contract,
1131
+ className,
1132
+ onExpandSection,
1133
+ showSectionNumbering
1134
+ }) {
1135
+ const classNames = cx("adyen-contract-viewer", className);
1136
+ const container = useRef(null);
1137
+ const [adyenDocumentViewer, setAdyenDocumentViewer] = useState(null);
1138
+ useEffect(() => {
1139
+ if (container.current && !adyenDocumentViewer) {
1140
+ setAdyenDocumentViewer(
1141
+ new Lt(container.current, { onExpandSection, showSectionNumbering })
1142
+ );
1143
+ }
1144
+ if (adyenDocumentViewer && contract) {
1145
+ adyenDocumentViewer.render(contract);
1146
+ }
1147
+ }, [contract, adyenDocumentViewer, onExpandSection, showSectionNumbering]);
1148
+ return /* @__PURE__ */ jsx("div", { ref: container, className: classNames });
1149
+ }
1150
+ const logger$1 = createLogger();
1151
+ const FALLBACK_LANGUAGE_CODE$1 = "en";
1152
+ const useServiceAgreement = ({
1153
+ handleServiceAgreementIsNotAvailableInThatLanguage,
1154
+ acceptanceId,
1155
+ serviceAgreementType,
1156
+ language
1157
+ }) => {
1158
+ const [agreementLanguage, setAgreementLanguage] = useState(language);
1159
+ useEffect(() => {
1160
+ if (agreementLanguage !== language) {
1161
+ setAgreementLanguage(language);
1162
+ }
1163
+ }, [language]);
1164
+ const {
1165
+ data: unAcceptedServiceAgreement,
1166
+ isSuccess: isUnAcceptedServiceAgreementSuccess,
1167
+ isError,
1168
+ error
1169
+ } = useTermsOfService(
1170
+ {
1171
+ language: agreementLanguage,
1172
+ type: serviceAgreementType,
1173
+ termsOfServiceDocumentFormat: "JSON"
1174
+ },
1175
+ { enabled: !acceptanceId }
1176
+ );
1177
+ const { data: acceptedServiceAgreement, isSuccess: isAcceptedServiceAgreementSuccess } = useAcceptedTermsOfService(acceptanceId, "JSON");
1178
+ if (isUnAcceptedServiceAgreementSuccess || isAcceptedServiceAgreementSuccess) {
1179
+ const termsOfService = unAcceptedServiceAgreement ?? acceptedServiceAgreement;
1180
+ const documentId = (unAcceptedServiceAgreement == null ? void 0 : unAcceptedServiceAgreement.termsOfServiceDocumentId) ?? (acceptedServiceAgreement == null ? void 0 : acceptedServiceAgreement.termsOfServiceAcceptanceReference);
1181
+ if ((termsOfService == null ? void 0 : termsOfService.document) && documentId) {
1182
+ const contract = JSON.parse(decodeURIComponent(escape(window.atob(termsOfService.document))));
1183
+ return {
1184
+ loading: "success",
1185
+ serviceAgreement: {
1186
+ id: documentId,
1187
+ contract
1188
+ }
1189
+ };
1190
+ }
1191
+ }
1192
+ if (isError) {
1193
+ if (agreementLanguage !== FALLBACK_LANGUAGE_CODE$1) {
1194
+ handleServiceAgreementIsNotAvailableInThatLanguage();
1195
+ setAgreementLanguage(FALLBACK_LANGUAGE_CODE$1);
1196
+ } else {
1197
+ logger$1.error(error);
1198
+ }
1199
+ return {
1200
+ loading: "success",
1201
+ serviceAgreement: void 0
1202
+ };
1203
+ }
1204
+ return {
1205
+ loading: "loading",
1206
+ serviceAgreement: void 0
1207
+ };
1208
+ };
1209
+ const serviceAgreementValidationRules = {
1210
+ signer: { modes: ["blur"], validate: (signer) => !!signer, errorMessage: "fieldIsRequired" },
1211
+ acceptServiceAgreement: {
1212
+ modes: ["blur"],
1213
+ validate: (acceptServiceAgreement) => !!acceptServiceAgreement,
1214
+ errorMessage: "fieldIsRequired"
1215
+ }
1216
+ };
1217
+ const serviceAgreementTypesTranslationMapping = {
1218
+ adyenForPlatformsManage: "paymentProcessingTerms",
1219
+ adyenIssuing: "accountHolderTerms",
1220
+ adyenForPlatformsAdvanced: "paymentProcessingTerms",
1221
+ adyenCapital: "capitalUserTerms",
1222
+ adyenAccount: "businessAccountTerms",
1223
+ adyenCard: "cardUserTerms",
1224
+ adyenFranchisee: "franchiseesTAndCs",
1225
+ adyenPccr: "pccr",
1226
+ adyenChargeCard: "chargeCardUserAgreement"
1227
+ };
1228
+ const logger = createLogger();
1229
+ const FALLBACK_LANGUAGE_CODE = "en";
1230
+ function ServiceAgreementDropin({
1231
+ legalEntityResponse,
1232
+ handleHomeClick,
1233
+ handleAddSigner,
1234
+ handleSign,
1235
+ serviceAgreementTypes,
1236
+ serviceAgreementAcceptanceInfos,
1237
+ asEmbedded = false,
1238
+ asModal = false,
1239
+ handleCloseClick
1240
+ }) {
1241
+ var _a, _b;
1242
+ const { i18n } = useI18nContext();
1243
+ const userEvents = useAnalyticsContext();
1244
+ const { showToast } = useToastContext();
1245
+ const { isExperimentEnabled } = useExperimentsContext();
1246
+ const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
1247
+ const { legalEntityId, baseUrl } = useApiContext();
1248
+ const [loadingStatus, setLoadingStatus] = useState();
1249
+ const signedForms = serviceAgreementAcceptanceInfos.map((serviceAgreementAcceptanceInfo) => ({
1250
+ formId: serviceAgreementAcceptanceInfo.id,
1251
+ serviceAgreementType: serviceAgreementAcceptanceInfo.type,
1252
+ acceptanceId: serviceAgreementAcceptanceInfo.id,
1253
+ createdAt: serviceAgreementAcceptanceInfo.createdAt,
1254
+ formName: serviceAgreementTypesTranslationMapping[serviceAgreementAcceptanceInfo.type],
1255
+ isValid: true
1256
+ }));
1257
+ const formsToBeSigned = serviceAgreementTypes.map((serviceAgreementType) => ({
1258
+ formId: serviceAgreementType,
1259
+ serviceAgreementType,
1260
+ formName: serviceAgreementTypesTranslationMapping[serviceAgreementType],
1261
+ isValid: false
1262
+ }));
1263
+ const forms = [...signedForms, ...formsToBeSigned];
1264
+ const [activeFormIndex, setActiveFormIndex] = useState(0);
1265
+ const [activeForm, setActiveForm] = useState(forms[activeFormIndex]);
1266
+ const [hasFinished, setHasFinished] = useState(false);
1267
+ const canSign = (serviceAgreementTypes == null ? void 0 : serviceAgreementTypes.includes(activeForm == null ? void 0 : activeForm.serviceAgreementType)) && !(activeForm == null ? void 0 : activeForm.acceptanceId);
1268
+ const isLastStep = activeFormIndex === forms.length - 1;
1269
+ const showSignedAlert = !!(activeForm == null ? void 0 : activeForm.acceptanceId);
1270
+ const translationKeys = {
1271
+ home: "goToOverview",
1272
+ next: canSign ? "sign" : "next"
1273
+ };
1274
+ const { refetch: downloadAcceptedTermsAsPdf } = useAcceptedTermsOfService(
1275
+ activeForm == null ? void 0 : activeForm.acceptanceId,
1276
+ "PDF",
1277
+ {
1278
+ enabled: false
1279
+ }
1280
+ );
1281
+ const handleServiceAgreementIsNotAvailableInThatLanguage = useCallback(() => {
1282
+ showToast({
1283
+ label: i18n.get("failedToGetServiceAgreementInSelectedLanguageFallbackToEn"),
1284
+ variant: "error"
1285
+ });
1286
+ }, [i18n, showToast]);
1287
+ const { loading: contractLoadingStatus, serviceAgreement } = useServiceAgreement({
1288
+ handleServiceAgreementIsNotAvailableInThatLanguage,
1289
+ acceptanceId: activeForm == null ? void 0 : activeForm.acceptanceId,
1290
+ serviceAgreementType: activeForm == null ? void 0 : activeForm.serviceAgreementType,
1291
+ language: i18n.languageCode
1292
+ });
1293
+ const { handleChangeFor, triggerValidation, data, valid, isValid, errors } = useForm({
1294
+ schema: ["signer", "acceptServiceAgreement"],
1295
+ rules: serviceAgreementValidationRules
1296
+ });
1297
+ const getSigners = () => {
1298
+ var _a2, _b2;
1299
+ if (legalEntityResponse.type === LegalEntityType.ORGANIZATION) {
1300
+ return getOwnSignatories(legalEntityResponse).map(({ legalEntityId: id, name }) => ({
1301
+ id: id ?? "",
1302
+ name: name ?? ""
1303
+ }));
1304
+ }
1305
+ if (isAgeVerificationEnabled && doesLegalEntityRequiresLegalRepresentative(legalEntityResponse)) {
1306
+ const legalRepresentative = getLegalRepresentative(legalEntityResponse);
1307
+ return legalRepresentative ? [{ id: legalRepresentative.legalEntityId, name: legalRepresentative.name }] : [];
1308
+ }
1309
+ return [
1310
+ {
1311
+ id: legalEntityResponse == null ? void 0 : legalEntityResponse.id,
1312
+ name: `${(_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _a2.name.firstName} ${(_b2 = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _b2.name.lastName}`
1313
+ }
1314
+ ];
1315
+ };
1316
+ const signers = getSigners();
1317
+ const handleSignClick = async () => {
1318
+ const baseTracking = {
1319
+ actionType: "sign"
1320
+ };
1321
+ triggerValidation();
1322
+ if (loadingStatus === "loading" || !serviceAgreement || !data.signer) return;
1323
+ if (isValid) {
1324
+ try {
1325
+ setLoadingStatus("loading");
1326
+ await handleSign(legalEntityResponse.id, serviceAgreement.id, { acceptedBy: data.signer });
1327
+ setLoadingStatus("success");
1328
+ showToast({
1329
+ label: i18n.get("serviceAgreementSignedSuccessfully"),
1330
+ variant: "success"
1331
+ });
1332
+ userEvents.addTaskEvent("Success", baseTracking);
1333
+ data.acceptServiceAgreement = false;
1334
+ data.signer = void 0;
1335
+ } catch (e) {
1336
+ setLoadingStatus("success");
1337
+ showToast({ label: i18n.get("serviceAgreementSignFailed"), variant: "error" });
1338
+ userEvents.addTaskEvent("Encountered error", {
1339
+ ...baseTracking,
1340
+ returnType: (e == null ? void 0 : e.errorCode) || "backend",
1341
+ returnValue: (e == null ? void 0 : e.title) ?? (e == null ? void 0 : e.message)
1342
+ });
1343
+ }
1344
+ } else {
1345
+ userEvents.addTaskEvent("Encountered error", {
1346
+ ...baseTracking,
1347
+ returnType: "validation",
1348
+ returnValue: Object.entries(valid).filter(([, value]) => !value).map(([key]) => key)
1349
+ });
1350
+ }
1351
+ };
1352
+ const goHome = () => {
1353
+ userEvents.addPageEvent("Clicked button", {
1354
+ actionType: "back",
1355
+ label: translationKeys.home
1356
+ });
1357
+ handleHomeClick();
1358
+ };
1359
+ const handleExpandSection = useCallback((title) => {
1360
+ userEvents.addFieldEvent("Clicked accordion", {
1361
+ actionType: "open",
1362
+ field: title
1363
+ });
1364
+ }, []);
1365
+ useEffect(() => {
1366
+ if (!serviceAgreementAcceptanceInfos.length) return;
1367
+ gotoForm(serviceAgreementAcceptanceInfos.length - 1);
1368
+ }, [serviceAgreementAcceptanceInfos]);
1369
+ useEffect(() => {
1370
+ userEvents.addTaskEvent("Landed on page", {
1371
+ actionType: "start"
1372
+ });
1373
+ const initialFormIndex = forms.length === signedForms.length ? 0 : signedForms.length;
1374
+ gotoForm(initialFormIndex);
1375
+ }, []);
1376
+ useEffect(() => {
1377
+ userEvents.updateSharedEventProperties({ page: activeForm == null ? void 0 : activeForm.formName });
1378
+ }, [activeForm]);
1379
+ const gotoForm = (index) => {
1380
+ setActiveForm(forms[index]);
1381
+ setActiveFormIndex(index);
1382
+ };
1383
+ const onDownloadAcceptedTermsOfServiceDocument = async () => {
1384
+ const { isError, isSuccess, data: data2 } = await downloadAcceptedTermsAsPdf();
1385
+ if (isSuccess && (data2 == null ? void 0 : data2.document)) {
1386
+ await downloadFile(data2.document, `${i18n.get(activeForm.formName)}.pdf`);
1387
+ }
1388
+ if (isError) {
1389
+ showToast({
1390
+ label: i18n.get("failedToDownloadAcceptedServiceAgreementDocument"),
1391
+ variant: "error"
1392
+ });
1393
+ }
1394
+ };
1395
+ const onDownloadUnacceptedTermsOfServiceDocument = async () => {
1396
+ const requestAndDownload = async (languageCode) => {
1397
+ const response = await getTermsOfService(legalEntityId.value, baseUrl.value, {
1398
+ type: activeForm.serviceAgreementType,
1399
+ language: languageCode,
1400
+ termsOfServiceDocumentFormat: "PDF"
1401
+ });
1402
+ if (!(response == null ? void 0 : response.document)) {
1403
+ throw new Error(`No terms Of service document found in response`);
1404
+ }
1405
+ await downloadFile(response.document, `${i18n.get(activeForm.formName)}.pdf`);
1406
+ };
1407
+ try {
1408
+ await requestAndDownload(i18n.languageCode);
1409
+ } catch {
1410
+ if (i18n.languageCode !== FALLBACK_LANGUAGE_CODE) {
1411
+ await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger.error);
1412
+ return;
1413
+ }
1414
+ showToast({
1415
+ label: i18n.get("failedToDownloadServiceAgreementDocument"),
1416
+ variant: "error"
1417
+ });
1418
+ }
1419
+ };
1420
+ const isIndividual = legalEntityResponse.type === "individual";
1421
+ const addSignerAlert = handleAddSigner && /* @__PURE__ */ jsx(
1422
+ Alert,
1423
+ {
1424
+ variant: signers.length ? "info" : "warning",
1425
+ className: "adyen-kyc-u-margin-top-16",
1426
+ title: i18n.get(signers.length ? "isYourNameMissingFromSigners" : "thereAreNoSigners"),
1427
+ children: /* @__PURE__ */ jsx(Button, { onClick: handleAddSigner, variant: "link", children: i18n.get("addYourselfAsSigner") })
1428
+ }
1429
+ );
1430
+ const getSignedName = (acceptanceId) => {
1431
+ var _a2, _b2, _c;
1432
+ if (!acceptanceId) return "";
1433
+ if (legalEntityResponse.type === LegalEntityType.INDIVIDUAL) {
1434
+ const name = (_a2 = legalEntityResponse.individual) == null ? void 0 : _a2.name;
1435
+ return `${(name == null ? void 0 : name.firstName) ?? ""} ${(name == null ? void 0 : name.lastName) ?? ""}`;
1436
+ }
1437
+ const signatory = serviceAgreementAcceptanceInfos.find((info) => info.id === acceptanceId);
1438
+ return ((_c = (_b2 = legalEntityResponse.entityAssociations) == null ? void 0 : _b2.find(
1439
+ (entity) => entity.legalEntityId === (signatory == null ? void 0 : signatory.acceptedBy)
1440
+ )) == null ? void 0 : _c.name) ?? "";
1441
+ };
1442
+ const signedAlert = showSignedAlert && /* @__PURE__ */ jsx(
1443
+ Alert,
1444
+ {
1445
+ variant: "success",
1446
+ className: "adyen-kyc-signed-alert",
1447
+ title: i18n.get("signedByOn", {
1448
+ values: {
1449
+ date: localizeDateString(activeForm.createdAt, i18n.locale) ?? "",
1450
+ signer: getSignedName(activeForm.acceptanceId)
1451
+ }
1452
+ })
1453
+ }
1454
+ );
1455
+ const sidebar = /* @__PURE__ */ jsx(
1456
+ LoaderWrapper,
1457
+ {
1458
+ status: loadingStatus,
1459
+ formOpacityWhenLoading: 0.3,
1460
+ showSpinner: false,
1461
+ className: "adyen-kyc-dropin__sidebar-wrapper",
1462
+ children: /* @__PURE__ */ jsx(
1463
+ FormNavigation,
1464
+ {
1465
+ forms,
1466
+ activeForm,
1467
+ gotoForm,
1468
+ taskName: "signServiceAgreement",
1469
+ className: "adyen-kyc-u-margin-bottom-24"
1470
+ }
1471
+ )
1472
+ }
1473
+ );
1474
+ const content = /* @__PURE__ */ jsxs(
1475
+ LoaderWrapper,
1476
+ {
1477
+ status: loadingStatus,
1478
+ formOpacityWhenLoading: 0.3,
1479
+ showSpinner: false,
1480
+ className: "adyen-kyc-form-container",
1481
+ children: [
1482
+ /* @__PURE__ */ jsxs(
1483
+ LoaderWrapper,
1484
+ {
1485
+ status: contractLoadingStatus,
1486
+ formOpacityWhenLoading: 0.3,
1487
+ showSpinner: false,
1488
+ children: [
1489
+ serviceAgreement && /* @__PURE__ */ jsxs(Fragment, { children: [
1490
+ signedAlert,
1491
+ /* @__PURE__ */ jsx(
1492
+ ContractViewer,
1493
+ {
1494
+ contract: serviceAgreement.contract,
1495
+ onExpandSection: handleExpandSection,
1496
+ showSectionNumbering: true
1497
+ }
1498
+ ),
1499
+ signedAlert,
1500
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-margin-top-16", children: /* @__PURE__ */ jsx(
1501
+ Button,
1502
+ {
1503
+ variant: "secondary",
1504
+ onClick: (activeForm == null ? void 0 : activeForm.acceptanceId) ? onDownloadAcceptedTermsOfServiceDocument : onDownloadUnacceptedTermsOfServiceDocument,
1505
+ icon: "download",
1506
+ children: i18n.get("downloadAsPdf")
1507
+ }
1508
+ ) })
1509
+ ] }),
1510
+ !forms.length && /* @__PURE__ */ jsx(Alert, { variant: "info", title: i18n.get("nothingNeedsToBeSigned") })
1511
+ ]
1512
+ }
1513
+ ),
1514
+ canSign && /* @__PURE__ */ jsxs(Fragment, { children: [
1515
+ !!signers.length && /* @__PURE__ */ jsx(
1516
+ Field,
1517
+ {
1518
+ name: "signer",
1519
+ label: i18n.get("signer"),
1520
+ classNameModifiers: ["col-50"],
1521
+ className: "adyen-kyc-u-margin-top-32",
1522
+ errorMessage: (_a = errors.signer) == null ? void 0 : _a.errorMessage,
1523
+ isValid: valid.signer,
1524
+ children: (childProps) => /* @__PURE__ */ jsx(
1525
+ Select,
1526
+ {
1527
+ ...childProps,
1528
+ onChange: handleChangeFor("signer", "blur"),
1529
+ name: "signer",
1530
+ placeholder: i18n.get("selectSigner"),
1531
+ selected: data.signer,
1532
+ items: signers
1533
+ }
1534
+ )
1535
+ }
1536
+ ),
1537
+ !isIndividual && addSignerAlert,
1538
+ /* @__PURE__ */ jsx(
1539
+ Field,
1540
+ {
1541
+ el: "fieldset",
1542
+ name: "acceptServiceAgreement",
1543
+ className: "adyen-kyc-u-margin-top-16",
1544
+ errorMessage: (_b = errors.acceptServiceAgreement) == null ? void 0 : _b.errorMessage,
1545
+ isValid: valid.acceptServiceAgreement,
1546
+ children: (childProps) => /* @__PURE__ */ jsx(
1547
+ Checkbox,
1548
+ {
1549
+ ...childProps,
1550
+ label: i18n.get("iHaveReadAndIAcceptTheseTerms"),
1551
+ checked: data.acceptServiceAgreement ?? false,
1552
+ name: "acceptServiceAgreement",
1553
+ onChange: handleChangeFor("acceptServiceAgreement")
1554
+ }
1555
+ )
1556
+ }
1557
+ )
1558
+ ] }),
1559
+ !asEmbedded && /* @__PURE__ */ jsx(
1560
+ ActionBar,
1561
+ {
1562
+ onHome: goHome,
1563
+ homeButtonLabel: i18n.get(translationKeys.home),
1564
+ onNext: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1),
1565
+ nextButtonLabel: i18n.get(translationKeys.next),
1566
+ nextButtonDisabled: forms.length === 0 || !canSign && isLastStep,
1567
+ onBack: () => gotoForm(activeFormIndex - 1),
1568
+ hideBackButton: activeFormIndex === 0,
1569
+ backButtonLabel: i18n.get("previous")
1570
+ }
1571
+ )
1572
+ ]
1573
+ }
1574
+ );
1575
+ const currentStep = signedForms.length;
1576
+ const totalSteps = forms.length;
1577
+ const handleClick = async () => {
1578
+ if (canSign) {
1579
+ await handleSignClick();
1580
+ } else if (!isLastStep) {
1581
+ gotoForm(activeFormIndex + 1);
1582
+ } else {
1583
+ setHasFinished(true);
1584
+ }
1585
+ };
1586
+ const endScreen = hasFinished && /* @__PURE__ */ jsxs(FormEndState, { children: [
1587
+ /* @__PURE__ */ jsx("template", { slot: "title", children: i18n.get("serviceAgreementSignedAndDated") }),
1588
+ /* @__PURE__ */ jsx(OutlinedIcon, { slot: "icon", name: "check" }),
1589
+ /* @__PURE__ */ jsx("div", { slot: "content", children: /* @__PURE__ */ jsx(Button, { onClick: () => handleCloseClick, children: i18n.get("finish") }) })
1590
+ ] });
1591
+ return /* @__PURE__ */ jsx(MaybeModal, { inline: !asModal, onClose: handleCloseClick, children: /* @__PURE__ */ jsxs(ModalContent, { children: [
1592
+ /* @__PURE__ */ jsxs("article", { className: "adyen-kyc-service-agreement-content", children: [
1593
+ !asEmbedded && sidebar,
1594
+ endScreen || content
1595
+ ] }),
1596
+ asEmbedded && /* @__PURE__ */ jsxs(ModalFooter, { children: [
1597
+ "...",
1598
+ /* @__PURE__ */ jsx(
1599
+ StepProgressIndicator,
1600
+ {
1601
+ activeStepIndex: currentStep ?? 0,
1602
+ stepsCount: totalSteps ?? 3,
1603
+ circles: true,
1604
+ thick: true
1605
+ }
1606
+ ),
1607
+ /* @__PURE__ */ jsx(Spacer, {}),
1608
+ !asModal && /* @__PURE__ */ jsx(
1609
+ Button,
1610
+ {
1611
+ icon: "chevron-left",
1612
+ onClick: () => gotoForm(activeFormIndex - 1),
1613
+ variant: "secondary",
1614
+ children: i18n.get("back")
1615
+ }
1616
+ ),
1617
+ /* @__PURE__ */ jsx(Button, { variant: canSign ? "primary" : "secondary", onClick: handleClick, children: i18n.get(canSign ? "signAndContinue" : "next") })
1618
+ ] })
1619
+ ] }) });
1620
+ }
1621
+ function AcceptTermsOfServiceComponent({
1622
+ legalEntityId,
1623
+ modalView,
1624
+ asEmbedded = true,
1625
+ /* triggered when X button clicked, or at the end, on Finish button click */
1626
+ onClose,
1627
+ onUnmount,
1628
+ /* triggered on every document signed, typically multiple times */
1629
+ onAccept,
1630
+ handleAddSigner
1631
+ }) {
1632
+ const { isModalView, setIsModalView } = useCoreContext();
1633
+ if (!legalEntityId) {
1634
+ throw new Error("Must provide at-least a legalEntityId");
1635
+ }
1636
+ const [stepsData, setStepsData] = useState({
1637
+ unAcceptedTermsOfServiceTypes: [],
1638
+ acceptedTermsOfServices: []
1639
+ });
1640
+ const { data: legalEntity } = useLegalEntity();
1641
+ const { data: serviceAgreementStatus, isLoading: isStatusLoading } = useTermsOfServiceStatus();
1642
+ const { data: serviceAgreementAcceptanceInfos, isLoading: isAcceptanceInfoLoading } = useTermsOfServiceAcceptanceInfos();
1643
+ const { mutateAsync: acceptTermsOfService2 } = useAcceptTermsOfService();
1644
+ if (modalView) {
1645
+ setIsModalView(true);
1646
+ }
1647
+ const handleOnClose = () => {
1648
+ if (modalView) {
1649
+ onUnmount == null ? void 0 : onUnmount();
1650
+ }
1651
+ onClose == null ? void 0 : onClose();
1652
+ };
1653
+ const handleSign = useCallback(
1654
+ async (legalEntityId2, termsOfServiceDocumentId, signedBy) => {
1655
+ var _a;
1656
+ const acceptedTermsOfService = await acceptTermsOfService2({
1657
+ acceptedBy: signedBy.acceptedBy,
1658
+ legalEntityReference: legalEntityId2,
1659
+ termsOfServiceDocumentId
1660
+ });
1661
+ const paramAllowList = {
1662
+ type: acceptedTermsOfService.type,
1663
+ acceptedBy: acceptedTermsOfService.acceptedBy,
1664
+ id: acceptedTermsOfService.id,
1665
+ language: acceptedTermsOfService.language,
1666
+ termsOfServiceDocumentId: acceptedTermsOfService.termsOfServiceDocumentId
1667
+ };
1668
+ const { acceptedTermsOfServices } = stepsData;
1669
+ acceptedTermsOfServices.push(paramAllowList);
1670
+ const unAcceptedTos = ((_a = serviceAgreementStatus == null ? void 0 : serviceAgreementStatus.termsOfServiceTypes) == null ? void 0 : _a.filter(
1671
+ (tosType) => tosType !== acceptedTermsOfService.type
1672
+ )) ?? [];
1673
+ const newStepsData = {
1674
+ unAcceptedTermsOfServiceTypes: unAcceptedTos,
1675
+ acceptedTermsOfServices
1676
+ };
1677
+ setStepsData(newStepsData);
1678
+ onAccept == null ? void 0 : onAccept(newStepsData);
1679
+ },
1680
+ [onAccept, stepsData, acceptTermsOfService2, serviceAgreementStatus == null ? void 0 : serviceAgreementStatus.termsOfServiceTypes]
1681
+ );
1682
+ return isStatusLoading || isAcceptanceInfoLoading || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
1683
+ ServiceAgreementDropin,
1684
+ {
1685
+ taskType: TaskTypes.SERVICE_AGREEMENT,
1686
+ legalEntityResponse: legalEntity,
1687
+ serviceAgreementTypes: (serviceAgreementStatus == null ? void 0 : serviceAgreementStatus.termsOfServiceTypes) ?? [],
1688
+ serviceAgreementAcceptanceInfos: (serviceAgreementAcceptanceInfos == null ? void 0 : serviceAgreementAcceptanceInfos.data) ?? [],
1689
+ handleHomeClick: handleOnClose,
1690
+ handleSign,
1691
+ asEmbedded,
1692
+ asModal: isModalView,
1693
+ handleCloseClick: handleOnClose,
1694
+ handleAddSigner
1695
+ }
1696
+ );
1697
+ }
1698
+ const AcceptTermsOfServiceComponent$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1699
+ __proto__: null,
1700
+ AcceptTermsOfServiceComponent
1701
+ }, Symbol.toStringTag, { value: "Module" }));
1702
+ export {
1703
+ AcceptTermsOfServiceComponent as A,
1704
+ ContractViewer as C,
1705
+ FormEndState as F,
1706
+ OutlinedIcon as O,
1707
+ useTermsOfServiceStatus as a,
1708
+ AcceptTermsOfServiceComponent$1 as b,
1709
+ downloadFile as d,
1710
+ useTermsOfServiceAcceptanceInfos as u
1711
+ };