@dropins/storefront-auth 0.0.1-alpha4 → 0.0.1-alpha6

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 (233) hide show
  1. package/api/confirmEmail/confirmEmail.d.ts +4 -0
  2. package/api/confirmEmail/graphql/confirmEmail.graphql.d.ts +2 -0
  3. package/api/confirmEmail/index.d.ts +2 -0
  4. package/api/createCustomer/createCustomer.d.ts +4 -0
  5. package/api/createCustomer/graphql/createCustomer.graphql.d.ts +2 -0
  6. package/api/createCustomer/graphql/createCustomerV2.graphql.d.ts +2 -0
  7. package/api/createCustomer/index.d.ts +2 -0
  8. package/api/createCustomerAddress/createCustomerAddress.d.ts +4 -0
  9. package/api/createCustomerAddress/graphql/createCustomerAddress.graphql.d.ts +2 -0
  10. package/api/createCustomerAddress/index.d.ts +2 -0
  11. package/api/fetch-graphql/fetch-graphql.d.ts +8 -0
  12. package/api/fetch-graphql/index.d.ts +2 -0
  13. package/api/getAttributesForm/getAttributesForm.d.ts +4 -0
  14. package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +2 -0
  15. package/api/getAttributesForm/index.d.ts +2 -0
  16. package/api/getCustomerData/getCustomerData.d.ts +4 -0
  17. package/api/getCustomerData/graphql/getCustomerData.graphql.d.ts +2 -0
  18. package/api/getCustomerData/index.d.ts +2 -0
  19. package/api/getCustomerToken/getCustomerToken.d.ts +15 -0
  20. package/api/getCustomerToken/graphql/getCustomerToken.graphql.d.ts +2 -0
  21. package/api/getCustomerToken/index.d.ts +2 -0
  22. package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
  23. package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +2 -0
  24. package/api/getStoreConfig/index.d.ts +2 -0
  25. package/api/index.d.ts +14 -0
  26. package/api/initialize/index.d.ts +2 -0
  27. package/api/initialize/initialize.d.ts +14 -0
  28. package/api/requestPasswordResetEmail/graphql/requestPasswordResetEmail.graphql.d.ts +2 -0
  29. package/api/requestPasswordResetEmail/index.d.ts +2 -0
  30. package/api/requestPasswordResetEmail/requestPasswordResetEmail.d.ts +4 -0
  31. package/api/resendConfirmationEmail/graphql/resendConfirmationEmail.graphql.d.ts +2 -0
  32. package/api/resendConfirmationEmail/index.d.ts +2 -0
  33. package/api/resendConfirmationEmail/resendConfirmationEmail.d.ts +4 -0
  34. package/api/resetPassword/graphql/resetPassword.graphql.d.ts +2 -0
  35. package/api/resetPassword/index.d.ts +2 -0
  36. package/api/resetPassword/resetPassword.d.ts +4 -0
  37. package/api/revokeCustomerToken/graphql/revokeCustomerToken.graphql.d.ts +2 -0
  38. package/api/revokeCustomerToken/index.d.ts +2 -0
  39. package/api/revokeCustomerToken/revokeCustomerToken.d.ts +4 -0
  40. package/api.d.ts +1 -0
  41. package/api.js +3 -4
  42. package/chunks/EmailConfirmationForm.js +1 -2
  43. package/chunks/PasswordField.js +1 -2
  44. package/chunks/ResetPasswordForm.js +1 -2
  45. package/chunks/SignInForm.js +1 -2
  46. package/chunks/SignUpForm.js +1 -2
  47. package/chunks/SkeletonLoader.js +1 -2
  48. package/chunks/confirmEmail.js +1 -2
  49. package/chunks/createCustomerAddress.js +5 -6
  50. package/chunks/getStoreConfig.js +4 -5
  51. package/chunks/index.js +1 -2
  52. package/chunks/index2.js +1 -2
  53. package/chunks/index3.js +1 -2
  54. package/chunks/initialize.js +0 -1
  55. package/chunks/requestPasswordResetEmail.js +2 -3
  56. package/chunks/resendConfirmationEmail.js +1 -2
  57. package/chunks/resetPassword.js +2 -3
  58. package/chunks/setReCaptchaToken.js +1 -0
  59. package/chunks/simplifyTransformAttributesForm.js +0 -1
  60. package/chunks/transform-attributes-form.js +0 -1
  61. package/chunks/useInLineAlert.js +1 -2
  62. package/chunks/usePasswordValidationMessage.js +1 -2
  63. package/components/EmailConfirmationForm/EmailConfirmationForm.d.ts +5 -0
  64. package/components/EmailConfirmationForm/index.d.ts +3 -0
  65. package/components/PasswordValidationMessage/PasswordValidationMessage.d.ts +12 -0
  66. package/components/PasswordValidationMessage/index.d.ts +3 -0
  67. package/components/ResetPasswordForm/ResetPasswordForm.d.ts +6 -0
  68. package/components/ResetPasswordForm/index.d.ts +3 -0
  69. package/components/SignInForm/SignInForm.d.ts +5 -0
  70. package/components/SignInForm/index.d.ts +3 -0
  71. package/components/SignUpForm/SignUpForm.d.ts +5 -0
  72. package/components/SignUpForm/index.d.ts +3 -0
  73. package/components/SkeletonLoader/SkeletonLoader.d.ts +5 -0
  74. package/components/SkeletonLoader/Skeletons/ResetPasswordSkeleton.d.ts +2 -0
  75. package/components/SkeletonLoader/Skeletons/SignInSkeleton.d.ts +2 -0
  76. package/components/SkeletonLoader/Skeletons/SignUpSkeleton.d.ts +2 -0
  77. package/components/SkeletonLoader/Skeletons/index.d.ts +4 -0
  78. package/components/SkeletonLoader/index.d.ts +3 -0
  79. package/components/SuccessNotificationForm/SuccessNotificationForm.d.ts +6 -0
  80. package/components/SuccessNotificationForm/index.d.ts +3 -0
  81. package/components/UI/Button/Button.d.ts +16 -0
  82. package/components/UI/Button/index.d.ts +3 -0
  83. package/components/UI/CheckboxField/CheckboxField.d.ts +13 -0
  84. package/components/UI/CheckboxField/index.d.ts +3 -0
  85. package/components/UI/DateField/DateField.d.ts +13 -0
  86. package/components/UI/DateField/index.d.ts +3 -0
  87. package/components/UI/Form/Form.d.ts +5 -0
  88. package/components/UI/Form/index.d.ts +3 -0
  89. package/components/UI/FormInputs/FormInputs.d.ts +12 -0
  90. package/components/UI/FormInputs/index.d.ts +3 -0
  91. package/components/UI/PasswordField/PasswordField.d.ts +15 -0
  92. package/components/UI/PasswordField/index.d.ts +3 -0
  93. package/components/UI/SelectField/SelectField.d.ts +17 -0
  94. package/components/UI/SelectField/index.d.ts +3 -0
  95. package/components/UI/TextArea/TextArea.d.ts +13 -0
  96. package/components/UI/TextArea/index.d.ts +3 -0
  97. package/components/UI/TextField/TextField.d.ts +13 -0
  98. package/components/UI/TextField/index.d.ts +3 -0
  99. package/components/UI/Title/Title.d.ts +11 -0
  100. package/components/UI/Title/index.d.ts +3 -0
  101. package/components/UI/index.d.ts +11 -0
  102. package/components/UpdatePasswordForm/UpdatePasswordForm.d.ts +5 -0
  103. package/components/UpdatePasswordForm/index.d.ts +3 -0
  104. package/components/index.d.ts +18 -0
  105. package/configs/cookieConfigs.d.ts +7 -0
  106. package/configs/defaultCreateUserConfigs.d.ts +16 -0
  107. package/configs/patternConfigs.d.ts +3 -0
  108. package/containers/AuthCombine/AuthCombine.d.ts +5 -0
  109. package/containers/AuthCombine/index.d.ts +3 -0
  110. package/containers/AuthCombine.d.ts +3 -0
  111. package/containers/AuthCombine.js +1 -2
  112. package/containers/ResetPassword/ResetPassword.d.ts +5 -0
  113. package/containers/ResetPassword/index.d.ts +3 -0
  114. package/containers/ResetPassword.d.ts +3 -0
  115. package/containers/ResetPassword.js +1 -2
  116. package/containers/SignIn/SignIn.d.ts +5 -0
  117. package/containers/SignIn/index.d.ts +3 -0
  118. package/containers/SignIn.d.ts +3 -0
  119. package/containers/SignIn.js +1 -2
  120. package/containers/SignUp/SignUp.d.ts +5 -0
  121. package/containers/SignUp/index.d.ts +3 -0
  122. package/containers/SignUp.d.ts +3 -0
  123. package/containers/SignUp.js +1 -2
  124. package/containers/SuccessNotification/SuccessNotification.d.ts +5 -0
  125. package/containers/SuccessNotification/index.d.ts +3 -0
  126. package/containers/SuccessNotification.d.ts +3 -0
  127. package/containers/SuccessNotification.js +1 -2
  128. package/containers/UpdatePassword/UpdatePassword.d.ts +5 -0
  129. package/containers/UpdatePassword/index.d.ts +3 -0
  130. package/containers/UpdatePassword.d.ts +3 -0
  131. package/containers/UpdatePassword.js +1 -2
  132. package/containers/index.d.ts +7 -0
  133. package/data/models/attributes-form.d.ts +25 -0
  134. package/data/models/customer-data.d.ts +6 -0
  135. package/data/models/index.d.ts +7 -0
  136. package/data/models/password-reset-email.d.ts +5 -0
  137. package/data/models/reset-password.d.ts +5 -0
  138. package/data/models/revoke-customer-token.d.ts +5 -0
  139. package/data/models/store-config.d.ts +8 -0
  140. package/data/transforms/index.d.ts +7 -0
  141. package/data/transforms/transform-attributes-form.d.ts +5 -0
  142. package/data/transforms/transform-auth.d.ts +37 -0
  143. package/data/transforms/transform-customer-data.d.ts +5 -0
  144. package/data/transforms/transform-password-reset-email.d.ts +5 -0
  145. package/data/transforms/transform-reset-password.d.ts +5 -0
  146. package/data/transforms/transform-revoke-customer-token.d.ts +5 -0
  147. package/data/transforms/transform-store-config.d.ts +5 -0
  148. package/hooks/api/useGetAttributesForm.d.ts +14 -0
  149. package/hooks/api/useGetStoreConfigs.d.ts +8 -0
  150. package/hooks/components/useEmailConfirmationForm.d.ts +7 -0
  151. package/hooks/components/usePasswordValidationMessage.d.ts +16 -0
  152. package/hooks/components/useResetPasswordForm.d.ts +8 -0
  153. package/hooks/components/useSignInForm.d.ts +21 -0
  154. package/hooks/components/useSignUpForm.d.ts +20 -0
  155. package/hooks/components/useUpdatePasswordForm.d.ts +14 -0
  156. package/hooks/ui/useForm.d.ts +11 -0
  157. package/hooks/useEmailConfirmation.d.ts +11 -0
  158. package/hooks/useInLineAlert.d.ts +7 -0
  159. package/i18n/en_US.json.d.ts +66 -0
  160. package/icons/index.d.ts +4 -0
  161. package/lib/acdl.d.ts +9 -0
  162. package/lib/checkIsFunction.d.ts +2 -0
  163. package/lib/clearUrlAndReplace.d.ts +2 -0
  164. package/lib/convertToInputDateFormat.d.ts +2 -0
  165. package/lib/cookieUtils.d.ts +3 -0
  166. package/lib/fetch-error.d.ts +5 -0
  167. package/lib/generateRandomDigits.d.ts +2 -0
  168. package/lib/getFormValues.d.ts +2 -0
  169. package/lib/getUrlParam.d.ts +2 -0
  170. package/lib/mergeFormObjects.d.ts +3 -0
  171. package/lib/network-error.d.ts +6 -0
  172. package/lib/setLoadingState.d.ts +2 -0
  173. package/lib/setReCaptchaToken.d.ts +2 -0
  174. package/lib/simplifyTransformAttributesForm.d.ts +2 -0
  175. package/lib/validationUniqueSymbolsPassword.d.ts +2 -0
  176. package/package.json +1 -1
  177. package/render/Provider.d.ts +8 -0
  178. package/render/index.d.ts +2 -0
  179. package/render/render.d.ts +4 -0
  180. package/render.d.ts +1 -0
  181. package/render.js +1 -2
  182. package/types/api/confirmEmail.types.d.ts +17 -0
  183. package/types/api/createCustomer.types.d.ts +24 -0
  184. package/types/api/createCustomerAddress.types.d.ts +47 -0
  185. package/types/api/getAttributesForm.types.d.ts +29 -0
  186. package/types/api/getCustomerData.types.d.ts +13 -0
  187. package/types/api/getCustomerToken.types.d.ts +11 -0
  188. package/types/api/passwordResetEmail.types.d.ts +9 -0
  189. package/types/api/resendConfirmationEmail.types.d.ts +9 -0
  190. package/types/api/resetPassword.types.d.ts +9 -0
  191. package/types/api/revokeCustomerToken.types.d.ts +9 -0
  192. package/types/api/storeConfig.types.d.ts +16 -0
  193. package/types/authCombine.types.d.ts +12 -0
  194. package/types/emailConfirmationForm.types.d.ts +14 -0
  195. package/types/form.types.d.ts +11 -0
  196. package/types/index.d.ts +22 -0
  197. package/types/notification.types.d.ts +15 -0
  198. package/types/resetPassword.types.d.ts +15 -0
  199. package/types/signIn.types.d.ts +34 -0
  200. package/types/signUp.types.d.ts +41 -0
  201. package/types/skeletonLoader.types.d.ts +6 -0
  202. package/types/successNotification.types.d.ts +13 -0
  203. package/types/updatePassword.types.d.ts +24 -0
  204. package/api.js.map +0 -1
  205. package/chunks/EmailConfirmationForm.js.map +0 -1
  206. package/chunks/PasswordField.js.map +0 -1
  207. package/chunks/ResetPasswordForm.js.map +0 -1
  208. package/chunks/SignInForm.js.map +0 -1
  209. package/chunks/SignUpForm.js.map +0 -1
  210. package/chunks/SkeletonLoader.js.map +0 -1
  211. package/chunks/confirmEmail.js.map +0 -1
  212. package/chunks/createCustomerAddress.js.map +0 -1
  213. package/chunks/getStoreConfig.js.map +0 -1
  214. package/chunks/index.js.map +0 -1
  215. package/chunks/index2.js.map +0 -1
  216. package/chunks/index3.js.map +0 -1
  217. package/chunks/initialize.js.map +0 -1
  218. package/chunks/network-error.js +0 -2
  219. package/chunks/network-error.js.map +0 -1
  220. package/chunks/requestPasswordResetEmail.js.map +0 -1
  221. package/chunks/resendConfirmationEmail.js.map +0 -1
  222. package/chunks/resetPassword.js.map +0 -1
  223. package/chunks/simplifyTransformAttributesForm.js.map +0 -1
  224. package/chunks/transform-attributes-form.js.map +0 -1
  225. package/chunks/useInLineAlert.js.map +0 -1
  226. package/chunks/usePasswordValidationMessage.js.map +0 -1
  227. package/containers/AuthCombine.js.map +0 -1
  228. package/containers/ResetPassword.js.map +0 -1
  229. package/containers/SignIn.js.map +0 -1
  230. package/containers/SignUp.js.map +0 -1
  231. package/containers/SuccessNotification.js.map +0 -1
  232. package/containers/UpdatePassword.js.map +0 -1
  233. package/render.js.map +0 -1
@@ -0,0 +1,4 @@
1
+ import { confirmEmailResponse, confirmEmailProps } from '../../types';
2
+
3
+ export declare const confirmEmail: ({ customerEmail, customerConfirmationKey, }: confirmEmailProps) => Promise<confirmEmailResponse | undefined>;
4
+ //# sourceMappingURL=confirmEmail.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const CONFIRM_EMAIL = "\n mutation CONFIRM_EMAIL($email: String!, $confirmation_key: String!) {\n confirmEmail(input: {\n email: $email,\n confirmation_key: $confirmation_key\n }) {\n customer {\n email\n }\n }\n }\n";
2
+ //# sourceMappingURL=confirmEmail.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './confirmEmail';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { CreateCustomerDataResponse, Customer } from '../../types';
2
+
3
+ export declare const createCustomer: (forms: Customer, apiVersion2: boolean) => Promise<CreateCustomerDataResponse>;
4
+ //# sourceMappingURL=createCustomer.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const CREATE_CUSTOMER = "\n mutation CREATE_CUSTOMER($input: CustomerInput!) {\n createCustomer(input: $input) {\n customer {\n firstname\n lastname\n email\n is_subscribed\n }\n }\n }\n";
2
+ //# sourceMappingURL=createCustomer.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const CREATE_CUSTOMER_V2 = "\n mutation CREATE_CUSTOMER_V2($input: CustomerCreateInput!) {\n createCustomerV2(input: $input) {\n customer {\n firstname\n lastname\n email\n is_subscribed\n }\n }\n }\n";
2
+ //# sourceMappingURL=createCustomerV2.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './createCustomer';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { AddressFormProps } from '../../types';
2
+
3
+ export declare const createCustomerAddress: (address: AddressFormProps) => Promise<string>;
4
+ //# sourceMappingURL=createCustomerAddress.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const CREATE_CUSTOMER_ADDRESS = "\n mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {\n createCustomerAddress(input:$input) {\n firstname\n }\n }\n";
2
+ //# sourceMappingURL=createCustomerAddress.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './createCustomerAddress';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
1
+ export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, removeFetchGraphQlHeader: (key: string) => void, setFetchGraphQlHeaders: (header: import('@adobe/fetch-graphql').Header) => void, fetchGraphQl: <T = any>(query: string, options?: import('@adobe/fetch-graphql').FetchOptions | undefined) => Promise<{
2
+ errors?: import('@adobe/fetch-graphql').FetchQueryError | undefined;
3
+ data: T;
4
+ }>, getConfig: () => {
5
+ endpoint: string | undefined;
6
+ fetchGraphQlHeaders: import('@adobe/fetch-graphql').Header | undefined;
7
+ };
8
+ //# sourceMappingURL=fetch-graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './fetch-graphql';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { AttributesFormModel } from '../../data/models';
2
+
3
+ export declare const getAttributesForm: (formCode: string) => Promise<AttributesFormModel>;
4
+ //# sourceMappingURL=getAttributesForm.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const GET_ATTRIBUTES_FORM = "\n query GET_ATTRIBUTES_FORM($formCode: String!) {\n attributesForm(formCode: $formCode) {\n items {\n code\n default_value\n entity_type\n frontend_class\n frontend_input\n is_required\n is_unique\n label\n options {\n is_default\n label\n value\n }\n }\n errors {\n type\n message\n }\n }\n }\n";
2
+ //# sourceMappingURL=getAttributesForm.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './getAttributesForm';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { CustomerDataModel } from '../../data/models';
2
+
3
+ export declare const getCustomerData: (user_token: string) => Promise<CustomerDataModel>;
4
+ //# sourceMappingURL=getCustomerData.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const GET_CUSTOMER_DATA = "\n query GET_CUSTOMER_DATA {\n customer {\n firstname\n lastname\n email\n }\n }\n";
2
+ //# sourceMappingURL=getCustomerData.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './getCustomerData';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { inLineAlertInterface } from '../../types';
2
+
3
+ interface getCustomerTokenProps {
4
+ email: string;
5
+ password: string;
6
+ handleSetInLineAlertProps: (value?: inLineAlertInterface) => void;
7
+ translations: Record<string, string>;
8
+ onErrorCallback?: (value?: unknown) => void;
9
+ }
10
+ export declare const getCustomerToken: ({ email, password, translations, onErrorCallback, handleSetInLineAlertProps, }: getCustomerTokenProps) => Promise<{
11
+ errorMessage: string;
12
+ userName: string;
13
+ }>;
14
+ export {};
15
+ //# sourceMappingURL=getCustomerToken.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const GET_CUSTOMER_TOKEN = "\n mutation GET_CUSTOMER_TOKEN($email: String!, $password: String!) {\n generateCustomerToken(email: $email, password: $password) {\n token\n }\n }\n";
2
+ //# sourceMappingURL=getCustomerToken.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './getCustomerToken';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { StoreConfigModel } from '../../data/models';
2
+
3
+ export declare const getStoreConfig: () => Promise<StoreConfigModel>;
4
+ //# sourceMappingURL=getStoreConfig.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const GET_STORE_CONFIG = "\n query GET_STORE_CONFIG {\n storeConfig {\n autocomplete_on_storefront\n minimum_password_length\n required_character_classes_number\n store_code\n store_name\n store_group_code\n locale\n create_account_confirmation\n customer_access_token_lifetime\n }\n }\n";
2
+ //# sourceMappingURL=getStoreConfig.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './getStoreConfig';
2
+ //# sourceMappingURL=index.d.ts.map
package/api/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export * from './initialize';
2
+ export * from './fetch-graphql';
3
+ export * from './createCustomer';
4
+ export * from './getAttributesForm';
5
+ export * from './getCustomerData';
6
+ export * from './getCustomerToken';
7
+ export * from './getStoreConfig';
8
+ export * from './requestPasswordResetEmail';
9
+ export * from './resetPassword';
10
+ export * from './revokeCustomerToken';
11
+ export * from './confirmEmail';
12
+ export * from './resendConfirmationEmail';
13
+ export * from './createCustomerAddress';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './initialize';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { Initializer } from '@dropins/tools/types/elsie/src/lib';
2
+ import { Lang } from '@dropins/tools/types/elsie/src/i18n';
3
+
4
+ type ConfigProps = {
5
+ langDefinitions?: Lang;
6
+ authHeaderConfig: {
7
+ header: string;
8
+ tokenPrefix: string;
9
+ };
10
+ };
11
+ export declare const initialize: Initializer<ConfigProps>;
12
+ export declare const config: import('@dropins/tools/types/elsie/src/lib').Config<ConfigProps>;
13
+ export {};
14
+ //# sourceMappingURL=initialize.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const REQUEST_PASSWORD_RESET_EMAIL = "\n mutation REQUEST_PASSWORD_RESET_EMAIL($email: String!) {\n requestPasswordResetEmail(email: $email)\n }\n";
2
+ //# sourceMappingURL=requestPasswordResetEmail.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './requestPasswordResetEmail';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { PasswordResetEmailModel } from '../../data/models';
2
+
3
+ export declare const requestPasswordResetEmail: (email: string) => Promise<PasswordResetEmailModel>;
4
+ //# sourceMappingURL=requestPasswordResetEmail.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const RESEND_CONFIRMATION_EMAIL = "\nmutation RESEND_CONFIRMATION_EMAIL($email: String!) {\n resendConfirmationEmail(email: $email)\n}";
2
+ //# sourceMappingURL=resendConfirmationEmail.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './resendConfirmationEmail';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { resendConfirmationEmailResponse } from '../../types';
2
+
3
+ export declare const resendConfirmationEmail: (customerEmail: string) => Promise<resendConfirmationEmailResponse>;
4
+ //# sourceMappingURL=resendConfirmationEmail.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const RESET_PASSWORD = "\n mutation RESET_PASSWORD($email: String!, $resetPasswordToken: String!, $newPassword: String!){\n resetPassword(email: $email,resetPasswordToken: $resetPasswordToken,newPassword: $newPassword)\n }\n";
2
+ //# sourceMappingURL=resetPassword.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './resetPassword';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { ResetPasswordModel } from '../../data/models';
2
+
3
+ export declare const resetPassword: (email: string, resetPasswordToken: string, newPassword: string) => Promise<ResetPasswordModel>;
4
+ //# sourceMappingURL=resetPassword.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const REVOKE_CUSTOMER_TOKEN = "\n mutation REVOKE_CUSTOMER_TOKEN {\n revokeCustomerToken {\n result\n }\n }\n";
2
+ //# sourceMappingURL=revokeCustomerToken.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './revokeCustomerToken';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { RevokeCustomerTokenModel } from '../../data/models';
2
+
3
+ export declare const revokeCustomerToken: () => Promise<RevokeCustomerTokenModel>;
4
+ //# sourceMappingURL=revokeCustomerToken.d.ts.map
package/api.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './api/index'
package/api.js CHANGED
@@ -1,9 +1,8 @@
1
- import{c as v,a as x,g as R}from"./chunks/createCustomerAddress.js";import{C as s,d as m,p as i,E as n}from"./chunks/getStoreConfig.js";import{g as w,a as G,b as K}from"./chunks/getStoreConfig.js";import{r as b}from"./chunks/requestPasswordResetEmail.js";import{r as F}from"./chunks/resetPassword.js";import{f as c,h as u}from"./chunks/network-error.js";import{g as Q,r as U,s as H,a as P,b as I}from"./chunks/network-error.js";import{events as f}from"@dropins/tools/event-bus.js";import{c as q}from"./chunks/confirmEmail.js";import{r as z}from"./chunks/resendConfirmationEmail.js";import{c as L,i as $}from"./chunks/initialize.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/lib.js";const E=e=>{var r,o,a;let t="";return(r=e==null?void 0:e.errors)!=null&&r.length&&(t=((o=e==null?void 0:e.errors[0])==null?void 0:o.message)||"Unknown error"),{message:t,success:!!((a=e==null?void 0:e.data)!=null&&a.revokeCustomerToken)}},h=`
1
+ import{c as x,a as R,g as S}from"./chunks/createCustomerAddress.js";import{C as s,d as m,p as i,E as n}from"./chunks/getStoreConfig.js";import{g as G,a as K,b as N}from"./chunks/getStoreConfig.js";import{r as A}from"./chunks/requestPasswordResetEmail.js";import{r as M}from"./chunks/resetPassword.js";import{f as c,h as u}from"./chunks/setReCaptchaToken.js";import{g as U,r as H,s as P,a as I,b as V}from"./chunks/setReCaptchaToken.js";import{events as f}from"@dropins/tools/event-bus.js";import{c as y}from"./chunks/confirmEmail.js";import{r as B}from"./chunks/resendConfirmationEmail.js";import{c as $,i as j}from"./chunks/initialize.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/lib.js";const E=e=>{var r,o,a;let t="";return(r=e==null?void 0:e.errors)!=null&&r.length&&(t=((o=e==null?void 0:e.errors[0])==null?void 0:o.message)||"Unknown error"),{message:t,success:!!((a=e==null?void 0:e.data)!=null&&a.revokeCustomerToken)}},h=`
2
2
  mutation REVOKE_CUSTOMER_TOKEN {
3
3
  revokeCustomerToken {
4
4
  result
5
5
  }
6
6
  }
7
- `,p=async()=>await c(h,{method:"POST"}).then(e=>{const t=E(e);if(t!=null&&t.success)[s.auth_dropin_user_token,s.auth_dropin_firstname].forEach(r=>{m(r)}),f.emit("authenticated",!1),i(n.SIGN_OUT,{logoutAttempt:!0});else{const r=`
8
- ERROR revokeCustomerToken: ${t.message}`;console.error(r)}return t}).catch(u);export{L as config,q as confirmEmail,v as createCustomer,x as createCustomerAddress,c as fetchGraphQl,R as getAttributesForm,Q as getConfig,w as getCustomerData,G as getCustomerToken,K as getStoreConfig,$ as initialize,U as removeFetchGraphQlHeader,b as requestPasswordResetEmail,z as resendConfirmationEmail,F as resetPassword,p as revokeCustomerToken,H as setEndpoint,P as setFetchGraphQlHeader,I as setFetchGraphQlHeaders};
9
- //# sourceMappingURL=api.js.map
7
+ `,O=async()=>await c(h,{method:"POST"}).then(e=>{const t=E(e);if(t!=null&&t.success)[s.auth_dropin_user_token,s.auth_dropin_firstname].forEach(r=>{m(r)}),f.emit("authenticated",!1),i(n.SIGN_OUT,{logoutAttempt:!0});else{const r=`
8
+ ERROR revokeCustomerToken: ${t.message}`;console.error(r)}return t}).catch(u);export{$ as config,y as confirmEmail,x as createCustomer,R as createCustomerAddress,c as fetchGraphQl,S as getAttributesForm,U as getConfig,G as getCustomerData,K as getCustomerToken,N as getStoreConfig,j as initialize,H as removeFetchGraphQlHeader,A as requestPasswordResetEmail,B as resendConfirmationEmail,M as resetPassword,O as revokeCustomerToken,P as setEndpoint,I as setFetchGraphQlHeader,V as setFetchGraphQlHeaders};
@@ -1,2 +1 @@
1
- import{classes as b}from"@dropins/tools/lib.js";import{InLineAlert as C}from"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import{r as y}from"./resendConfirmationEmail.js";import{useState as x,useCallback as E}from"@dropins/tools/preact-hooks.js";import{useText as u}from"@dropins/tools/i18n.js";import{jsxs as c,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{T as F,B as f}from"./useInLineAlert.js";const p=({userEmail:e,handleSetInLineAlertProps:a})=>{const i=u({emailConfirmationMessage:"Auth.Notification.emailConfirmationMessage",technicalErrorSendEmail:"Auth.Notification.technicalErrors.technicalErrorSendEmail"}),[l,r]=x(!1);return{handleEmailConfirmation:E(async()=>{var o,m;if(r(!0),e){const t=await y(e);if(t){const d=(o=t==null?void 0:t.errors)==null?void 0:o.length,h=(m=t==null?void 0:t.data)==null?void 0:m.resendConfirmationEmail;a(d?{type:"error",text:i.technicalErrorSendEmail}:{type:h?"success":"error",text:i.emailConfirmationMessage})}}r(!1)},[a,i,e]),disabledButton:l}},k=({formSize:e,userEmail:a,inLineAlertProps:i,hideCloseBtnOnEmailConfirmation:l,handleSetInLineAlertProps:r,onPrimaryButtonClick:s})=>{const o=u({title:"Auth.EmailConfirmationForm.title",subtitle:"Auth.EmailConfirmationForm.subtitle",mainText:"Auth.EmailConfirmationForm.mainText",buttonPrimary:"Auth.EmailConfirmationForm.buttonPrimary",buttonSecondary:"Auth.EmailConfirmationForm.buttonSecondary"}),{handleEmailConfirmation:m,disabledButton:t}=p({userEmail:a,handleSetInLineAlertProps:r});return c("div",{className:b(["auth-emailConfirmationForm",e]),children:[i.text?n(C,{className:"auth-signInForm__notification",type:i.type,variant:"secondary",heading:i.text,icon:i.icon,"data-testid":"authInLineAlert"}):null,n(F,{text:o.title,bottomLine:!1,className:"auth-emailConfirmationForm__title"}),a!=null&&a.length?n("span",{className:"auth-emailConfirmationForm__subtitle",children:`${o.subtitle} ${a}`}):null,n("span",{className:"auth-emailConfirmationForm__text",children:o.mainText}),c("div",{className:"auth-emailConfirmationForm-buttons",children:[n(f,{type:"button",variant:"tertiary",style:{padding:0},buttonText:o.buttonSecondary,enableLoader:!1,onClick:m,disabled:t}),l?null:n(f,{type:"submit",buttonText:o.buttonPrimary,variant:"primary",enableLoader:!1,disabled:t,onClick:s})]})]})};export{k as E};
2
- //# sourceMappingURL=EmailConfirmationForm.js.map
1
+ import{jsxs as c,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{classes as b}from"@dropins/tools/lib.js";import{InLineAlert as C}from"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{r as y}from"./resendConfirmationEmail.js";import{useState as x,useCallback as E}from"@dropins/tools/preact-hooks.js";import{useText as u}from"@dropins/tools/i18n.js";import{T as F,B as f}from"./useInLineAlert.js";const p=({userEmail:e,handleSetInLineAlertProps:a})=>{const i=u({emailConfirmationMessage:"Auth.Notification.emailConfirmationMessage",technicalErrorSendEmail:"Auth.Notification.technicalErrors.technicalErrorSendEmail"}),[l,r]=x(!1);return{handleEmailConfirmation:E(async()=>{var o,m;if(r(!0),e){const t=await y(e);if(t){const d=(o=t==null?void 0:t.errors)==null?void 0:o.length,h=(m=t==null?void 0:t.data)==null?void 0:m.resendConfirmationEmail;a(d?{type:"error",text:i.technicalErrorSendEmail}:{type:h?"success":"error",text:i.emailConfirmationMessage})}}r(!1)},[a,i,e]),disabledButton:l}},M=({formSize:e,userEmail:a,inLineAlertProps:i,hideCloseBtnOnEmailConfirmation:l,handleSetInLineAlertProps:r,onPrimaryButtonClick:s})=>{const o=u({title:"Auth.EmailConfirmationForm.title",subtitle:"Auth.EmailConfirmationForm.subtitle",mainText:"Auth.EmailConfirmationForm.mainText",buttonPrimary:"Auth.EmailConfirmationForm.buttonPrimary",buttonSecondary:"Auth.EmailConfirmationForm.buttonSecondary"}),{handleEmailConfirmation:m,disabledButton:t}=p({userEmail:a,handleSetInLineAlertProps:r});return c("div",{className:b(["auth-emailConfirmationForm",e]),children:[i.text?n(C,{className:"auth-signInForm__notification",type:i.type,variant:"secondary",heading:i.text,icon:i.icon,"data-testid":"authInLineAlert"}):null,n(F,{text:o.title,bottomLine:!1,className:"auth-emailConfirmationForm__title"}),a!=null&&a.length?n("span",{className:"auth-emailConfirmationForm__subtitle",children:`${o.subtitle} ${a}`}):null,n("span",{className:"auth-emailConfirmationForm__text",children:o.mainText}),c("div",{className:"auth-emailConfirmationForm-buttons",children:[n(f,{type:"button",variant:"tertiary",style:{padding:0},buttonText:o.buttonSecondary,enableLoader:!1,onClick:m,disabled:t}),l?null:n(f,{type:"submit",buttonText:o.buttonPrimary,variant:"primary",enableLoader:!1,disabled:t,onClick:s})]})]})};export{M as E};
@@ -1,2 +1 @@
1
- import{useState as m,useCallback as g}from"@dropins/tools/preact-hooks.js";import{classes as f}from"@dropins/tools/lib.js";import*as e from"@dropins/tools/preact-compat.js";import{Field as M,Input as k}from"@dropins/tools/components.js";import{jsxs as E,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{useText as L}from"@dropins/tools/i18n.js";const v=r=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},e.createElement("g",{clipPath:"url(#clip0_3785_11045)"},e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.33 11H16.66C17.4 11 17.99 11.81 17.99 12.82V19.18C17.99 20.18 17.39 21 16.66 21H7.33C6.59 21 6 20.19 6 19.18V12.82C6 11.82 6.6 11 7.33 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.5 10.86V6.5C8.5 4.57 10.07 3 12 3C13.93 3 15.5 4.57 15.5 6.5V10.86",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),e.createElement("defs",null,e.createElement("clipPath",{id:"clip0_3785_11045"},e.createElement("rect",{width:13.5,height:19.5,fill:"white",transform:"translate(5.25 2.25)"})))),x=r=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},e.createElement("path",{d:"M11.9952 8.05896C7.85898 8.04913 4.04561 10.1916 1.96743 13.6609C4.04561 17.14 7.86907 19.2629 11.9952 19.2629C16.1314 19.2727 19.9447 17.1302 22.0229 13.6609C20.0153 10.3096 16.2827 8.05896 11.9952 8.05896ZM11.9952 8.05896V4.73709M20.5097 11.027L23.2335 9.0221M16.8174 8.88451L18.4618 6.0737M3.48067 11.027L0.756836 9.03193M7.17298 8.89434L5.52859 6.08353M14.8401 13.6609C14.8401 15.1843 13.5689 16.4226 12.0053 16.4226C10.4416 16.4226 9.17045 15.1843 9.17045 13.6609C9.17045 12.1376 10.4416 10.8993 12.0053 10.8993C13.5689 10.8993 14.8401 12.1376 14.8401 13.6609Z",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),B=r=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},e.createElement("path",{d:"M17.11 18.12C19.13 17.16 20.85 15.62 22.02 13.67C20.01 10.32 16.28 8.07 11.99 8.07M11.99 8.07C11.09 8.07 10.21 8.17 9.35 8.36M11.99 8.07V4.75M20.5 11.03L23.22 9.03M16.81 8.89L18.45 6.08M3.47 11.03L0.75 9.03M11.3096 10.99C11.5296 10.94 11.7596 10.91 11.9996 10.91C13.5596 10.91 14.8296 12.15 14.8296 13.67C14.8296 14.05 14.7496 14.41 14.6096 14.74M11.9999 16.43C10.4399 16.43 9.16992 15.19 9.16992 13.67C9.16992 13.37 9.21992 13.09 9.30992 12.83M6.13996 9.60001C4.43996 10.57 2.98996 11.96 1.95996 13.67C4.03996 17.15 7.85996 19.27 11.99 19.27C12.57 19.27 13.15 19.23 13.71 19.14M20.4404 22.5L4.44043 2.5",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),y=({initialPassword:r="",required:n,isError:s,children:a,name:i,className:l,setPasswordValueCallback:d,onBlur:c})=>{const h=L({requiredFieldError:"Auth.FormText.requiredFieldError"}),[o,w]=m(!1),p=g(()=>{w(C=>!C)},[]),u=s&&!r.length?h.requiredFieldError:"";return E("div",{className:f(["auth-password-field",l,s?"auth-password-field--error":""]),children:[t(M,{error:u,children:t(k,{name:i||"password",type:o?"text":"password",placeholder:"Password",floatingLabel:"Password","aria-label":"Password","aria-required":!0,required:n||!1,value:r,onValue:d,icon:t(v,{}),onBlur:c,"data-testid":"passwordInput"})}),t("div",{"data-testid":"toggle-password-icon",className:`auth-password-field__eye-icon auth-password-field__eye-icon--${o?"show":"hide"}`,onClick:p,children:o?t(x,{}):t(B,{})}),a]})};export{y as P};
2
- //# sourceMappingURL=PasswordField.js.map
1
+ import{jsxs as m,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{useState as g,useCallback as f}from"@dropins/tools/preact-hooks.js";import{classes as M}from"@dropins/tools/lib.js";import*as e from"@dropins/tools/preact-compat.js";import{Field as k,Input as E}from"@dropins/tools/components.js";import{useText as L}from"@dropins/tools/i18n.js";const v=r=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},e.createElement("g",{clipPath:"url(#clip0_3785_11045)"},e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.33 11H16.66C17.4 11 17.99 11.81 17.99 12.82V19.18C17.99 20.18 17.39 21 16.66 21H7.33C6.59 21 6 20.19 6 19.18V12.82C6 11.82 6.6 11 7.33 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.5 10.86V6.5C8.5 4.57 10.07 3 12 3C13.93 3 15.5 4.57 15.5 6.5V10.86",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),e.createElement("defs",null,e.createElement("clipPath",{id:"clip0_3785_11045"},e.createElement("rect",{width:13.5,height:19.5,fill:"white",transform:"translate(5.25 2.25)"})))),x=r=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},e.createElement("path",{d:"M11.9952 8.05896C7.85898 8.04913 4.04561 10.1916 1.96743 13.6609C4.04561 17.14 7.86907 19.2629 11.9952 19.2629C16.1314 19.2727 19.9447 17.1302 22.0229 13.6609C20.0153 10.3096 16.2827 8.05896 11.9952 8.05896ZM11.9952 8.05896V4.73709M20.5097 11.027L23.2335 9.0221M16.8174 8.88451L18.4618 6.0737M3.48067 11.027L0.756836 9.03193M7.17298 8.89434L5.52859 6.08353M14.8401 13.6609C14.8401 15.1843 13.5689 16.4226 12.0053 16.4226C10.4416 16.4226 9.17045 15.1843 9.17045 13.6609C9.17045 12.1376 10.4416 10.8993 12.0053 10.8993C13.5689 10.8993 14.8401 12.1376 14.8401 13.6609Z",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),B=r=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},e.createElement("path",{d:"M17.11 18.12C19.13 17.16 20.85 15.62 22.02 13.67C20.01 10.32 16.28 8.07 11.99 8.07M11.99 8.07C11.09 8.07 10.21 8.17 9.35 8.36M11.99 8.07V4.75M20.5 11.03L23.22 9.03M16.81 8.89L18.45 6.08M3.47 11.03L0.75 9.03M11.3096 10.99C11.5296 10.94 11.7596 10.91 11.9996 10.91C13.5596 10.91 14.8296 12.15 14.8296 13.67C14.8296 14.05 14.7496 14.41 14.6096 14.74M11.9999 16.43C10.4399 16.43 9.16992 15.19 9.16992 13.67C9.16992 13.37 9.21992 13.09 9.30992 12.83M6.13996 9.60001C4.43996 10.57 2.98996 11.96 1.95996 13.67C4.03996 17.15 7.85996 19.27 11.99 19.27C12.57 19.27 13.15 19.23 13.71 19.14M20.4404 22.5L4.44043 2.5",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),y=({initialPassword:r="",required:n,isError:s,children:a,name:i,className:l,setPasswordValueCallback:d,onBlur:c})=>{const h=L({requiredFieldError:"Auth.FormText.requiredFieldError"}),[o,w]=g(!1),p=f(()=>{w(C=>!C)},[]),u=s&&!r.length?h.requiredFieldError:"";return m("div",{className:M(["auth-password-field",l,s?"auth-password-field--error":""]),children:[t(k,{error:u,children:t(E,{name:i||"password",type:o?"text":"password",placeholder:"Password",floatingLabel:"Password","aria-label":"Password","aria-required":!0,required:n||!1,value:r,onValue:d,icon:t(v,{}),onBlur:c,"data-testid":"passwordInput"})}),t("div",{"data-testid":"toggle-password-icon",className:`auth-password-field__eye-icon auth-password-field__eye-icon--${o?"show":"hide"}`,onClick:p,children:o?t(x,{}):t(B,{})}),a]})};export{y as P};
@@ -1,2 +1 @@
1
- import{classes as R}from"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{r as b}from"./requestPasswordResetEmail.js";import{g,c as l,u as _,T as p,F as x,B as w,S as N}from"./useInLineAlert.js";import{useState as T,useCallback as y}from"@dropins/tools/preact-hooks.js";import{useText as P}from"@dropins/tools/i18n.js";import{InLineAlert as h}from"@dropins/tools/components.js";import{s as D,D as E}from"./simplifyTransformAttributesForm.js";import{jsxs as F,jsx as o}from"@dropins/tools/preact-jsx-runtime.js";const v=({routeSignIn:r,onErrorCallback:e,setActiveComponent:i,handleSetInLineAlertProps:s})=>{const c=P({successPasswordResetEmailNotification:"Auth.Notification.successPasswordResetEmailNotification"}),[m,t]=T(!1),d=y(async n=>{n.preventDefault(),t(!0);const a=g(n.target);if(a&&a.email){const f=await b(a.email);f.success?s==null||s({type:"success",text:c.successPasswordResetEmailNotification.replace("{email}",a.email)}):(e==null||e(f),s==null||s({type:"error",text:f.message}))}t(!1)},[s,e,c.successPasswordResetEmailNotification]),u=y(()=>{if(l(i)){i("signInForm");return}l(r)&&(window.location.href=r())},[i,r]);return{isLoading:m,submitResetPassword:d,redirectToSignInPage:u}},z=({formSize:r="default",routeSignIn:e,setActiveComponent:i,onErrorCallback:s,...c})=>{const m=P({title:"Auth.ResetPasswordForm.title",buttonPrimary:"Auth.ResetPasswordForm.buttonPrimary",buttonSecondary:"Auth.ResetPasswordForm.buttonSecondary"}),{inLineAlertProps:t,handleSetInLineAlertProps:d}=_(),{isLoading:u,submitResetPassword:n,redirectToSignInPage:a}=v({routeSignIn:e,setActiveComponent:i,onErrorCallback:s,handleSetInLineAlertProps:d});return F("div",{...c,className:R(["auth-resetPasswordForm",r]),"data-testid":"resetPasswordForm",children:[o(p,{text:m.title,bottomLine:!1,className:"auth-resetPasswordForm__title"}),t.text?o(h,{className:"auth-resetPasswordForm__notification",type:t.type,variant:"secondary",heading:t.text,icon:t.icon}):null,o(x,{name:"resetPassword_form",className:"auth-resetPasswordForm__form",submitCallback:n,isLoading:u,fieldsConfig:D(E),children:F("div",{className:"auth-resetPasswordForm__buttons",children:[o(w,{type:"button",variant:"tertiary",style:{padding:"0"},icon:o(N,{style:{transform:"rotate(90deg)"}}),buttonText:m.buttonSecondary,enableLoader:!1,onClick:a}),o(w,{type:"submit",buttonText:m.buttonPrimary,variant:"primary",enableLoader:u})]})})]})};export{z as R};
2
- //# sourceMappingURL=ResetPasswordForm.js.map
1
+ import{jsxs as l,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{classes as R}from"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{r as b}from"./requestPasswordResetEmail.js";import{g,c as w,u as _,T as p,F as x,B as y,S as N}from"./useInLineAlert.js";import{useState as T,useCallback as F}from"@dropins/tools/preact-hooks.js";import{useText as P}from"@dropins/tools/i18n.js";import{InLineAlert as h}from"@dropins/tools/components.js";import{s as E,D as v}from"./simplifyTransformAttributesForm.js";const D=({routeSignIn:i,onErrorCallback:a,setActiveComponent:r,handleSetInLineAlertProps:s})=>{const c=P({successPasswordResetEmailNotification:"Auth.Notification.successPasswordResetEmailNotification"}),[m,t]=T(!1),d=F(async n=>{n.preventDefault(),t(!0);const o=g(n.target);if(o&&o.email){const f=await b(o.email);f.success?s==null||s({type:"success",text:c.successPasswordResetEmailNotification.replace("{email}",o.email)}):(a==null||a(f),s==null||s({type:"error",text:f.message}))}t(!1)},[s,a,c.successPasswordResetEmailNotification]),u=F(()=>{if(w(r)){r("signInForm");return}w(i)&&(window.location.href=i())},[r,i]);return{isLoading:m,submitResetPassword:d,redirectToSignInPage:u}},A=({formSize:i="default",routeSignIn:a,setActiveComponent:r,onErrorCallback:s,...c})=>{const m=P({title:"Auth.ResetPasswordForm.title",buttonPrimary:"Auth.ResetPasswordForm.buttonPrimary",buttonSecondary:"Auth.ResetPasswordForm.buttonSecondary"}),{inLineAlertProps:t,handleSetInLineAlertProps:d}=_(),{isLoading:u,submitResetPassword:n,redirectToSignInPage:o}=D({routeSignIn:a,setActiveComponent:r,onErrorCallback:s,handleSetInLineAlertProps:d});return l("div",{...c,className:R(["auth-resetPasswordForm",i]),"data-testid":"resetPasswordForm",children:[e(p,{text:m.title,bottomLine:!1,className:"auth-resetPasswordForm__title"}),t.text?e(h,{className:"auth-resetPasswordForm__notification",type:t.type,variant:"secondary",heading:t.text,icon:t.icon}):null,e(x,{name:"resetPassword_form",className:"auth-resetPasswordForm__form",submitCallback:n,isLoading:u,fieldsConfig:E(v),children:l("div",{className:"auth-resetPasswordForm__buttons",children:[e(y,{type:"button",variant:"tertiary",style:{padding:"0"},icon:e(N,{style:{transform:"rotate(90deg)"}}),buttonText:m.buttonSecondary,enableLoader:!1,onClick:o}),e(y,{type:"submit",buttonText:m.buttonPrimary,variant:"primary",enableLoader:u})]})}),e("div",{id:"requestPasswordResetEmail"})]})};export{A as R};
@@ -1,2 +1 @@
1
- import{classes as X}from"@dropins/tools/lib.js";import{g as Y,c as w,u as Z,T as $,F as z,B as G}from"./useInLineAlert.js";import{useState as _,useCallback as b,useEffect as q,useMemo as V}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import{a as O}from"./getStoreConfig.js";import{r as R}from"./resendConfirmationEmail.js";import{s as tt,a as at}from"./simplifyTransformAttributesForm.js";import{jsxs as N,jsx as c}from"@dropins/tools/preact-jsx-runtime.js";import{c as st}from"./confirmEmail.js";import{useText as H}from"@dropins/tools/i18n.js";import{InLineAlert as rt}from"@dropins/tools/components.js";import{E as ot}from"./EmailConfirmationForm.js";import{P as et}from"./PasswordField.js";const it=({emailConfirmationStatusMessage:a,translations:s,initialEmailValue:e,routeSignUp:l,routeForgotPassword:m,routeRedirectOnSignIn:y,onErrorCallback:d,setActiveComponent:t,onSuccessCallback:u,onSignUpLinkClick:f,handleSetInLineAlertProps:r,routeRedirectOnEmailConfirmationClose:E})=>{const[A,T]=_(""),[h,I]=_(!1),[g,F]=_(""),[L,k]=_(!1),[B,p]=_({userName:"",status:!1}),[P,x]=_(!1),C=b(async i=>{await R(i),I(!0),r({})},[r]);q(()=>{a!=null&&a.text&&r({text:a.text,type:a.status?a.status:void 0})},[a,r]);const M=b(i=>s?N("span",{className:"auth-signInForm__resend-email-notification",children:[s.resendEmailInformationText," ",c("button",{onClick:()=>C(i),children:s.resendEmailButtonText})," ",s.resendEmailAdditionalText]}):"",[C,s]),U=b(async i=>{var K;r({}),x(!0);const n=Y(i.target);if(n.password||(k(!0),x(!1)),n!=null&&n.email&&(n!=null&&n.password)){const{email:D,password:Q}=n,o=await O({email:D,password:Q,handleSetInLineAlertProps:r,onErrorCallback:d,translations:s});if((K=o==null?void 0:o.errorMessage)!=null&&K.length){T(D);const W=o.errorMessage.includes("This account isn't confirmed. Verify and try again.")?M(D):o.errorMessage;r({text:W,type:"error"}),F("")}o!=null&&o.userName&&(i.target.reset(),w(y)?window.location.href=y():(u==null||u({userName:o==null?void 0:o.userName,status:!0}),p({userName:o==null?void 0:o.userName,status:!0}))),k(!1)}x(!1),F("")},[M,r,s,d,y,u]),v=b(()=>{if(w(t)){t("resetPasswordForm");return}w(m)&&(window.location.href=m())},[m,t]),S=b(()=>{if(w(f)&&f(),w(t)){t("signUpForm");return}w(l)&&(window.location.href=l())},[f,l,t]),j=V(()=>{const i=tt(at);return e!=null&&e.length?i==null?void 0:i.map(n=>({...n,defaultValue:e})):i},[e]),J=b(()=>{r({}),w(E)?window.location.href=E():I(!1)},[r,E]);return{userEmail:A,defaultEnhancedEmailFields:j,passwordError:L,isSuccessful:B,isLoading:P,signInPasswordValue:g,showEmailConfirmationForm:h,setShowEmailConfirmationForm:I,setSignInPasswordValue:F,submitLogInUser:U,forgotPasswordCallback:v,onSignUpLinkClickCallback:S,handledOnPrimaryButtonClick:J}},nt=()=>{let a=new URL(window.location.href),s=a.searchParams.get("email"),e=a.searchParams.get("key");s&&e&&(a.searchParams.delete("email"),a.searchParams.delete("key"),window.history.replaceState({},document.title,a.toString()))},mt=({enableEmailConfirmation:a})=>{const s=H({accountConfirmMessage:"Auth.EmailConfirmationForm.accountConfirmMessage",accountConfirmationEmailSuccessMessage:"Auth.EmailConfirmationForm.accountConfirmationEmailSuccessMessage"}),[e,l]=_({text:"",status:""});return q(()=>{if(a){const{search:m}=window.location;m.includes("email=")&&m.includes("key=")&&(async()=>{var u,f,r;const d=new URLSearchParams(m),t=await st({customerEmail:d.get("email"),customerConfirmationKey:d.get("key")});if(!t)return null;(u=t==null?void 0:t.errors)!=null&&u.length?l({text:t==null?void 0:t.errors[0].message,status:"error"}):(l({text:t.data.confirmEmail.customer.email?s.accountConfirmationEmailSuccessMessage.replace("{email}",(r=(f=t==null?void 0:t.data)==null?void 0:f.confirmEmail.customer)==null?void 0:r.email):s.accountConfirmMessage,status:"success"}),nt())})()}},[a,s]),{emailConfirmationStatusMessage:e}},It=({formSize:a="default",initialEmailValue:s="",renderSignUpLink:e=!1,enableEmailConfirmation:l=!1,hideCloseBtnOnEmailConfirmation:m=!1,routeRedirectOnEmailConfirmationClose:y,routeRedirectOnSignIn:d,routeForgotPassword:t,routeSignUp:u,onSuccessCallback:f,setActiveComponent:r,onErrorCallback:E,onSignUpLinkClick:A,successNotificationForm:T})=>{const h=H({title:"Auth.SignInForm.title",buttonPrimary:"Auth.SignInForm.buttonPrimary",buttonSecondary:"Auth.SignInForm.buttonSecondary",buttonTertiary:"Auth.SignInForm.buttonTertiary",resendEmailInformationText:"Auth.Notification.resendEmailNotification.informationText",resendEmailButtonText:"Auth.Notification.resendEmailNotification.buttonText",resendEmailAdditionalText:"Auth.Notification.resendEmailNotification.additionalText",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage"}),{emailConfirmationStatusMessage:I}=mt({enableEmailConfirmation:l}),{inLineAlertProps:g,handleSetInLineAlertProps:F}=Z(),{userEmail:L,defaultEnhancedEmailFields:k,passwordError:B,isSuccessful:p,isLoading:P,signInPasswordValue:x,showEmailConfirmationForm:C,setSignInPasswordValue:M,submitLogInUser:U,forgotPasswordCallback:v,onSignUpLinkClickCallback:S,handledOnPrimaryButtonClick:j}=it({translations:h,emailConfirmationStatusMessage:I,initialEmailValue:s,routeSignUp:u,routeForgotPassword:t,routeRedirectOnSignIn:d,setActiveComponent:r,onErrorCallback:E,onSuccessCallback:f,onSignUpLinkClick:A,handleSetInLineAlertProps:F,routeRedirectOnEmailConfirmationClose:y});return T&&p.status?T(p.userName):C?c(ot,{formSize:a,userEmail:L,inLineAlertProps:g,hideCloseBtnOnEmailConfirmation:m,handleSetInLineAlertProps:F,onPrimaryButtonClick:j}):N("div",{className:X(["auth-signInForm",a]),"data-testid":"signInForm",children:[c($,{text:h.title,bottomLine:!1,className:"auth-signInForm__title"}),g.text?c(rt,{"data-testid":"authInLineAlert",className:"auth-signInForm__notification",type:g.type,variant:"secondary",heading:g.text,icon:g.icon}):null,N(z,{name:"signIn_form",className:"auth-signInForm__form",submitCallback:U,isLoading:P,fieldsConfig:k,children:[c(et,{className:"auth-signInForm__form__password",isError:B,initialPassword:x,setPasswordValueCallback:M}),N("div",{className:"auth-signInForm__form__buttons",children:[N("div",{className:"auth-signInForm__form__buttons--combine",children:[c(G,{type:"button",variant:"tertiary",style:{padding:0},buttonText:h.buttonTertiary,className:"auth-signInForm__button auth-signInForm__button--forgot",enableLoader:!1,onClick:v,"data-testid":"switchToSignUp"}),e?c("span",{}):null,e?c(G,{type:"button",variant:"tertiary",style:{padding:0},buttonText:h.buttonSecondary,className:"auth-signInForm__button auth-signInForm__button--signup",enableLoader:!1,onClick:S}):null]}),c(G,{type:"submit",buttonText:h.buttonPrimary,variant:"primary",className:"auth-signInForm__button auth-signInForm__button--submit",enableLoader:P})]})]})]})};export{It as S};
2
- //# sourceMappingURL=SignInForm.js.map
1
+ import{jsxs as T,jsx as m}from"@dropins/tools/preact-jsx-runtime.js";import{classes as X}from"@dropins/tools/lib.js";import{g as Y,c as w,u as Z,T as $,F as z,B as G}from"./useInLineAlert.js";import{useState as _,useCallback as b,useEffect as q,useMemo as V}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{a as O}from"./getStoreConfig.js";import{r as R}from"./resendConfirmationEmail.js";import{s as tt,a as at}from"./simplifyTransformAttributesForm.js";import{c as rt}from"./confirmEmail.js";import{useText as H}from"@dropins/tools/i18n.js";import{InLineAlert as st}from"@dropins/tools/components.js";import{E as ot}from"./EmailConfirmationForm.js";import{P as et}from"./PasswordField.js";const it=({emailConfirmationStatusMessage:a,translations:r,initialEmailValue:e,routeSignUp:l,routeForgotPassword:u,routeRedirectOnSignIn:y,onErrorCallback:d,setActiveComponent:t,onSuccessCallback:c,onSignUpLinkClick:f,handleSetInLineAlertProps:s,routeRedirectOnEmailConfirmationClose:E})=>{const[A,N]=_(""),[g,I]=_(!1),[h,F]=_(""),[L,k]=_(!1),[B,p]=_({userName:"",status:!1}),[P,x]=_(!1),C=b(async i=>{await R(i),I(!0),s({})},[s]);q(()=>{a!=null&&a.text&&s({text:a.text,type:a.status?a.status:void 0})},[a,s]);const M=b(i=>r?T("span",{className:"auth-signInForm__resend-email-notification",children:[r.resendEmailInformationText," ",m("button",{onClick:()=>C(i),children:r.resendEmailButtonText})," ",r.resendEmailAdditionalText]}):"",[C,r]),U=b(async i=>{var K;s({}),x(!0);const n=Y(i.target);if(n.password||(k(!0),x(!1)),n!=null&&n.email&&(n!=null&&n.password)){const{email:D,password:Q}=n,o=await O({email:D,password:Q,handleSetInLineAlertProps:s,onErrorCallback:d,translations:r});if((K=o==null?void 0:o.errorMessage)!=null&&K.length){N(D);const W=o.errorMessage.includes("This account isn't confirmed. Verify and try again.")?M(D):o.errorMessage;s({text:W,type:"error"}),F("")}o!=null&&o.userName&&(i.target.reset(),w(y)?window.location.href=y():(c==null||c({userName:o==null?void 0:o.userName,status:!0}),p({userName:o==null?void 0:o.userName,status:!0}))),k(!1)}x(!1),F("")},[M,s,r,d,y,c]),v=b(()=>{if(w(t)){t("resetPasswordForm");return}w(u)&&(window.location.href=u())},[u,t]),S=b(()=>{if(w(f)&&f(),w(t)){t("signUpForm");return}w(l)&&(window.location.href=l())},[f,l,t]),j=V(()=>{const i=tt(at);return e!=null&&e.length?i==null?void 0:i.map(n=>({...n,defaultValue:e})):i},[e]),J=b(()=>{s({}),w(E)?window.location.href=E():I(!1)},[s,E]);return{userEmail:A,defaultEnhancedEmailFields:j,passwordError:L,isSuccessful:B,isLoading:P,signInPasswordValue:h,showEmailConfirmationForm:g,setShowEmailConfirmationForm:I,setSignInPasswordValue:F,submitLogInUser:U,forgotPasswordCallback:v,onSignUpLinkClickCallback:S,handledOnPrimaryButtonClick:J}},nt=()=>{let a=new URL(window.location.href),r=a.searchParams.get("email"),e=a.searchParams.get("key");r&&e&&(a.searchParams.delete("email"),a.searchParams.delete("key"),window.history.replaceState({},document.title,a.toString()))},mt=({enableEmailConfirmation:a})=>{const r=H({accountConfirmMessage:"Auth.EmailConfirmationForm.accountConfirmMessage",accountConfirmationEmailSuccessMessage:"Auth.EmailConfirmationForm.accountConfirmationEmailSuccessMessage"}),[e,l]=_({text:"",status:""});return q(()=>{if(a){const{search:u}=window.location;u.includes("email=")&&u.includes("key=")&&(async()=>{var c,f,s;const d=new URLSearchParams(u),t=await rt({customerEmail:d.get("email"),customerConfirmationKey:d.get("key")});if(!t)return null;(c=t==null?void 0:t.errors)!=null&&c.length?l({text:t==null?void 0:t.errors[0].message,status:"error"}):(l({text:t.data.confirmEmail.customer.email?r.accountConfirmationEmailSuccessMessage.replace("{email}",(s=(f=t==null?void 0:t.data)==null?void 0:f.confirmEmail.customer)==null?void 0:s.email):r.accountConfirmMessage,status:"success"}),nt())})()}},[a,r]),{emailConfirmationStatusMessage:e}},xt=({formSize:a="default",initialEmailValue:r="",renderSignUpLink:e=!1,enableEmailConfirmation:l=!1,hideCloseBtnOnEmailConfirmation:u=!1,routeRedirectOnEmailConfirmationClose:y,routeRedirectOnSignIn:d,routeForgotPassword:t,routeSignUp:c,onSuccessCallback:f,setActiveComponent:s,onErrorCallback:E,onSignUpLinkClick:A,successNotificationForm:N})=>{const g=H({title:"Auth.SignInForm.title",buttonPrimary:"Auth.SignInForm.buttonPrimary",buttonSecondary:"Auth.SignInForm.buttonSecondary",buttonTertiary:"Auth.SignInForm.buttonTertiary",resendEmailInformationText:"Auth.Notification.resendEmailNotification.informationText",resendEmailButtonText:"Auth.Notification.resendEmailNotification.buttonText",resendEmailAdditionalText:"Auth.Notification.resendEmailNotification.additionalText",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage"}),{emailConfirmationStatusMessage:I}=mt({enableEmailConfirmation:l}),{inLineAlertProps:h,handleSetInLineAlertProps:F}=Z(),{userEmail:L,defaultEnhancedEmailFields:k,passwordError:B,isSuccessful:p,isLoading:P,signInPasswordValue:x,showEmailConfirmationForm:C,setSignInPasswordValue:M,submitLogInUser:U,forgotPasswordCallback:v,onSignUpLinkClickCallback:S,handledOnPrimaryButtonClick:j}=it({translations:g,emailConfirmationStatusMessage:I,initialEmailValue:r,routeSignUp:c,routeForgotPassword:t,routeRedirectOnSignIn:d,setActiveComponent:s,onErrorCallback:E,onSuccessCallback:f,onSignUpLinkClick:A,handleSetInLineAlertProps:F,routeRedirectOnEmailConfirmationClose:y});return N&&p.status?N(p.userName):C?m(ot,{formSize:a,userEmail:L,inLineAlertProps:h,hideCloseBtnOnEmailConfirmation:u,handleSetInLineAlertProps:F,onPrimaryButtonClick:j}):T("div",{className:X(["auth-signInForm",a]),"data-testid":"signInForm",children:[m($,{text:g.title,bottomLine:!1,className:"auth-signInForm__title"}),h.text?m(st,{"data-testid":"authInLineAlert",className:"auth-signInForm__notification",type:h.type,variant:"secondary",heading:h.text,icon:h.icon}):null,T(z,{name:"signIn_form",className:"auth-signInForm__form",submitCallback:U,isLoading:P,fieldsConfig:k,children:[m(et,{className:"auth-signInForm__form__password",isError:B,initialPassword:x,setPasswordValueCallback:M}),T("div",{className:"auth-signInForm__form__buttons",children:[T("div",{className:"auth-signInForm__form__buttons--combine",children:[m(G,{type:"button",variant:"tertiary",style:{padding:0},buttonText:g.buttonTertiary,className:"auth-signInForm__button auth-signInForm__button--forgot",enableLoader:!1,onClick:v,"data-testid":"switchToSignUp"}),e?m("span",{}):null,e?m(G,{type:"button",variant:"tertiary",style:{padding:0},buttonText:g.buttonSecondary,className:"auth-signInForm__button auth-signInForm__button--signup",enableLoader:!1,onClick:S}):null]}),m(G,{type:"submit",buttonText:g.buttonPrimary,variant:"primary",className:"auth-signInForm__button auth-signInForm__button--submit",enableLoader:P})]})]}),m("div",{id:"generateCustomerToken"})]})};export{xt as S};
@@ -1,2 +1 @@
1
- import{classes as at}from"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{g as ot,c as nt,a as ut}from"./createCustomerAddress.js";import{useState as b,useEffect as mt,useCallback as B}from"@dropins/tools/preact-hooks.js";import{s as Y,b as lt,c as ct}from"./simplifyTransformAttributesForm.js";import{v as ft,u as gt,a as ht,P as dt}from"./usePasswordValidationMessage.js";import{p as Z,E as z,a as Ft}from"./getStoreConfig.js";import{c as K,g as bt,u as Ut,T as _t,F as yt,C as $,B as R}from"./useInLineAlert.js";import{InLineAlert as Tt}from"@dropins/tools/components.js";import{S as pt}from"./SkeletonLoader.js";import{jsx as o,jsxs as E}from"@dropins/tools/preact-jsx-runtime.js";import{E as Pt}from"./EmailConfirmationForm.js";import{useText as Lt}from"@dropins/tools/i18n.js";import{P as Et}from"./PasswordField.js";const D=(t,e)=>e!=null&&e.length?t.map(a=>{var s;const i=(s=e.find(({code:d})=>d===a.code))==null?void 0:s.defaultValue;return i?{...a,defaultValue:i}:a}):t,St=({inputsDefaultValueSet:t,fieldsConfigForApiVersion1:e,apiVersion2:a})=>{const[i,s]=b([]);return mt(()=>{(async()=>{var l;if(a){const r=await ot("customer_account_create");if((l=r==null?void 0:r.fields)!=null&&l.length)if(t!=null&&t.length){const c=D(r==null?void 0:r.fields,t);s(c)}else s(r==null?void 0:r.fields)}else{const r=Y(lt),c=Y(e),n=D(r,t);s(e&&e.length?c:n)}})()},[a,e,t]),{fieldsListConfigs:i}},xt=t=>{switch(t){case"true":return!0;case"false":return!1;default:return t}},Nt=(t,e)=>{if(!e)return t;const a={};a.custom_attributes=[];for(const i in t)Object.prototype.hasOwnProperty.call(ct,i)?a[i]=t[i]:a.custom_attributes.push({attribute_code:i,value:xt(t[i])});return a},Ct=({addressesData:t,translations:e,isEmailConfirmationRequired:a,apiVersion2:i=!0,passwordConfigs:s,routeRedirectOnSignIn:d,routeSignIn:l,onErrorCallback:r,onSuccessCallback:c,setActiveComponent:n,handleSetInLineAlertProps:f,routeRedirectOnEmailConfirmationClose:T})=>{const[I,S]=b(""),[x,u]=b(!1),[m,N]=b({userName:"",status:!1}),[C,g]=b(""),[w,k]=b(!1),[G,U]=b(!1),[M,v]=b(!0),p=B(({target:F})=>{v(F.checked)},[]),A=B(()=>{if(K(n)){n("signInForm");return}K(l)&&(window.location.href=l())},[n,l]),H=B(F=>{g(F)},[]),O=B(()=>{f({}),g(""),K(T)?window.location.href=T():(u(!1),n==null||n("signInForm"))},[f,T,n]);return{isKeepMeLogged:M,userEmail:I,showEmailConfirmationForm:x,isSuccessful:m,isClickSubmit:w,signUpPasswordValue:C,isLoading:G,onSubmitSignUp:async(F,V)=>{var Q;if(f({}),U(!0),!V){k(!0),U(!1);return}const q=i?"createCustomerV2":"createCustomer",_=bt(F.target),{email:P,password:L,is_subscribed:tt}=_,et=(s==null?void 0:s.requiredCharacterClasses)||0,rt=(s==null?void 0:s.minLength)||1;if(!ft(L,et)||rt>(L==null?void 0:L.length)){k(!0),U(!1);return}const st=Nt({..._,is_subscribed:!!tt||!1},i),{data:W,errors:y}=await nt(st,i);if(y&&(y!=null&&y.length))f==null||f({type:"error",text:y[0].message}),r==null||r(y),Z(z.CREATE_ACCOUNT_EVENT,{updateProfile:!1}),S(P);else{const j={email:"",...W==null?void 0:W[q]};if(Z(z.CREATE_ACCOUNT_EVENT,{email:j==null?void 0:j.email,updateProfile:!0}),a){(Q=F.target)==null||Q.reset(),U(!1),g(""),u(!0),S(P);return}const h=await Ft({email:P,password:L,translations:e,handleSetInLineAlertProps:f,onErrorCallback:r});if(h!=null&&h.userName){if(t!=null&&t.length)for(const X of t)try{await ut(X)}catch(it){console.error(e.failedCreateCustomerAddress,X,it)}K(d)?window.location.href=d():(c==null||c({userName:h==null?void 0:h.userName,status:!0}),N({userName:h==null?void 0:h.userName,status:!0}))}}U(!1)},signInButton:A,handleSetSignUpPasswordValue:H,onKeepMeLoggedChange:p,handleHideEmailConfirmationForm:O}},jt=({addressesData:t,formSize:e="default",inputsDefaultValueSet:a,fieldsConfigForApiVersion1:i,apiVersion2:s=!0,displayTermsOfUseCheckbox:d=!1,displayNewsletterCheckbox:l=!1,hideCloseBtnOnEmailConfirmation:r=!1,routeRedirectOnEmailConfirmationClose:c,routeRedirectOnSignIn:n,routeSignIn:f,onErrorCallback:T,onSuccessCallback:I,setActiveComponent:S,successNotificationForm:x})=>{const u=Lt({title:"Auth.SignUpForm.title",buttonPrimary:"Auth.SignUpForm.buttonPrimary",buttonSecondary:"Auth.SignUpForm.buttonSecondary",privacyPolicyDefaultText:"Auth.SignUpForm.privacyPolicyDefaultText",subscribedDefaultText:"Auth.SignUpForm.subscribedDefaultText",keepMeLoggedText:"Auth.SignUpForm.keepMeLoggedText",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage",failedCreateCustomerAddress:"Auth.SignUpForm.failedCreateCustomerAddress"}),{passwordConfigs:m,isEmailConfirmationRequired:N}=gt(),{fieldsListConfigs:C}=St({fieldsConfigForApiVersion1:i,apiVersion2:s,inputsDefaultValueSet:a}),{inLineAlertProps:g,handleSetInLineAlertProps:w}=Ut(),{isKeepMeLogged:k,userEmail:G,showEmailConfirmationForm:U,isSuccessful:M,isClickSubmit:v,signUpPasswordValue:p,isLoading:A,onSubmitSignUp:H,signInButton:O,handleSetSignUpPasswordValue:J,onKeepMeLoggedChange:F,handleHideEmailConfirmationForm:V}=Ct({addressesData:t,translations:u,isEmailConfirmationRequired:N,apiVersion2:s,passwordConfigs:m,routeRedirectOnSignIn:n,routeSignIn:f,onErrorCallback:T,onSuccessCallback:I,setActiveComponent:S,handleSetInLineAlertProps:w,routeRedirectOnEmailConfirmationClose:c}),{isValidUniqueSymbols:q,defaultLengthMessage:_}=ht({password:p,isClickSubmit:v,passwordConfigs:m}),P=!N&&(t==null?void 0:t.length);return!C.length&&s?o("div",{className:`auth-signUpForm ${e} skeleton-loader`,"data-testid":"SignUpForm",children:o(pt,{activeSkeleton:"signUpForm"})}):x&&M.status?x(M.userName):U?o(Pt,{formSize:e,userEmail:G,inLineAlertProps:g,hideCloseBtnOnEmailConfirmation:r,handleSetInLineAlertProps:w,onPrimaryButtonClick:V}):E("div",{className:at(["auth-signUpForm",e]),"data-testid":"SignUpForm",children:[o(_t,{text:u.title,bottomLine:!1,className:"auth-signUpForm__title"}),g.text?o(Tt,{className:"auth-signUpForm__notification",type:g.type,variant:"secondary",heading:g.text,icon:g.icon}):null,E(yt,{submitCallback:H,className:"auth-signUpForm__form",isLoading:A,name:"signUp_form",fieldsConfig:C,children:[E(Et,{initialPassword:p,className:"auth-signUpForm__form__item",setPasswordValueCallback:J,isError:q==="error"||(_==null?void 0:_.status)==="error"||v&&p.length<=0,children:[o(dt,{minLength:m==null?void 0:m.minLength,requiredCharacterClasses:m==null?void 0:m.requiredCharacterClasses,validateLengthConfig:_,isValidUniqueSymbols:q}),P?o("div",{className:"auth-signUpForm__automatic-login",children:o($,{label:u.keepMeLoggedText,onChange:F,initialValue:k})}):null]}),l||d?E("div",{className:"auth-signUpForm__item auth-signUpForm__checkbox",children:[l?o($,{name:"is_subscribed",label:u.subscribedDefaultText}):null,d?o($,{name:"privacyPolicy",label:u.privacyPolicyDefaultText}):null]}):null,E("div",{className:"auth-signUpForm-buttons",children:[o(R,{type:"button",variant:"tertiary",style:{padding:0},buttonText:u.buttonSecondary,enableLoader:!1,onClick:O}),o(R,{type:"submit",buttonText:u.buttonPrimary,variant:"primary",enableLoader:A})]})]})]})};export{jt as S};
2
- //# sourceMappingURL=SignUpForm.js.map
1
+ import{jsx as o,jsxs as E}from"@dropins/tools/preact-jsx-runtime.js";import{classes as at}from"@dropins/tools/lib.js";import{v as ot,u as nt,a as mt,P as ut}from"./usePasswordValidationMessage.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{g as lt,c as ct,a as ft}from"./createCustomerAddress.js";import{useState as b,useEffect as gt,useCallback as B}from"@dropins/tools/preact-hooks.js";import{s as Y,b as dt,c as ht}from"./simplifyTransformAttributesForm.js";import{p as Z,E as z,a as Ft}from"./getStoreConfig.js";import{c as K,g as bt,u as Ut,T as _t,F as yt,C as $,B as R}from"./useInLineAlert.js";import{InLineAlert as pt}from"@dropins/tools/components.js";import{S as Tt}from"./SkeletonLoader.js";import{E as Pt}from"./EmailConfirmationForm.js";import{useText as Lt}from"@dropins/tools/i18n.js";import{P as Et}from"./PasswordField.js";const D=(t,e)=>e!=null&&e.length?t.map(a=>{var s;const i=(s=e.find(({code:h})=>h===a.code))==null?void 0:s.defaultValue;return i?{...a,defaultValue:i}:a}):t,St=({inputsDefaultValueSet:t,fieldsConfigForApiVersion1:e,apiVersion2:a})=>{const[i,s]=b([]);return gt(()=>{(async()=>{var l;if(a){const r=await lt("customer_account_create");if((l=r==null?void 0:r.fields)!=null&&l.length)if(t!=null&&t.length){const c=D(r==null?void 0:r.fields,t);s(c)}else s(r==null?void 0:r.fields)}else{const r=Y(dt),c=Y(e),n=D(r,t);s(e&&e.length?c:n)}})()},[a,e,t]),{fieldsListConfigs:i}},xt=t=>{switch(t){case"true":return!0;case"false":return!1;default:return t}},Nt=(t,e)=>{if(!e)return t;const a={};a.custom_attributes=[];for(const i in t)Object.prototype.hasOwnProperty.call(ht,i)?a[i]=t[i]:a.custom_attributes.push({attribute_code:i,value:xt(t[i])});return a},Ct=({addressesData:t,translations:e,isEmailConfirmationRequired:a,apiVersion2:i=!0,passwordConfigs:s,routeRedirectOnSignIn:h,routeSignIn:l,onErrorCallback:r,onSuccessCallback:c,setActiveComponent:n,handleSetInLineAlertProps:f,routeRedirectOnEmailConfirmationClose:p})=>{const[I,S]=b(""),[x,m]=b(!1),[u,N]=b({userName:"",status:!1}),[C,g]=b(""),[w,k]=b(!1),[G,U]=b(!1),[M,v]=b(!0),T=B(({target:F})=>{v(F.checked)},[]),A=B(()=>{if(K(n)){n("signInForm");return}K(l)&&(window.location.href=l())},[n,l]),V=B(F=>{g(F)},[]),H=B(()=>{f({}),g(""),K(p)?window.location.href=p():(m(!1),n==null||n("signInForm"))},[f,p,n]);return{isKeepMeLogged:M,userEmail:I,showEmailConfirmationForm:x,isSuccessful:u,isClickSubmit:w,signUpPasswordValue:C,isLoading:G,onSubmitSignUp:async(F,O)=>{var Q;if(f({}),U(!0),!O){k(!0),U(!1);return}const q=i?"createCustomerV2":"createCustomer",_=bt(F.target),{email:P,password:L,is_subscribed:tt}=_,et=(s==null?void 0:s.requiredCharacterClasses)||0,rt=(s==null?void 0:s.minLength)||1;if(!ot(L,et)||rt>(L==null?void 0:L.length)){k(!0),U(!1);return}const st=Nt({..._,is_subscribed:!!tt||!1},i),{data:W,errors:y}=await ct(st,i);if(y&&(y!=null&&y.length))f==null||f({type:"error",text:y[0].message}),r==null||r(y),Z(z.CREATE_ACCOUNT_EVENT,{updateProfile:!1}),S(P);else{const j={email:"",...W==null?void 0:W[q]};if(Z(z.CREATE_ACCOUNT_EVENT,{email:j==null?void 0:j.email,updateProfile:!0}),a){(Q=F.target)==null||Q.reset(),U(!1),g(""),m(!0),S(P);return}const d=await Ft({email:P,password:L,translations:e,handleSetInLineAlertProps:f,onErrorCallback:r});if(d!=null&&d.userName){if(t!=null&&t.length)for(const X of t)try{await ft(X)}catch(it){console.error(e.failedCreateCustomerAddress,X,it)}K(h)?window.location.href=h():(c==null||c({userName:d==null?void 0:d.userName,status:!0}),N({userName:d==null?void 0:d.userName,status:!0}))}}U(!1)},signInButton:A,handleSetSignUpPasswordValue:V,onKeepMeLoggedChange:T,handleHideEmailConfirmationForm:H}},$t=({addressesData:t,formSize:e="default",inputsDefaultValueSet:a,fieldsConfigForApiVersion1:i,apiVersion2:s=!0,displayTermsOfUseCheckbox:h=!1,displayNewsletterCheckbox:l=!1,hideCloseBtnOnEmailConfirmation:r=!1,routeRedirectOnEmailConfirmationClose:c,routeRedirectOnSignIn:n,routeSignIn:f,onErrorCallback:p,onSuccessCallback:I,setActiveComponent:S,successNotificationForm:x})=>{const m=Lt({title:"Auth.SignUpForm.title",buttonPrimary:"Auth.SignUpForm.buttonPrimary",buttonSecondary:"Auth.SignUpForm.buttonSecondary",privacyPolicyDefaultText:"Auth.SignUpForm.privacyPolicyDefaultText",subscribedDefaultText:"Auth.SignUpForm.subscribedDefaultText",keepMeLoggedText:"Auth.SignUpForm.keepMeLoggedText",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage",failedCreateCustomerAddress:"Auth.SignUpForm.failedCreateCustomerAddress"}),{passwordConfigs:u,isEmailConfirmationRequired:N}=nt(),{fieldsListConfigs:C}=St({fieldsConfigForApiVersion1:i,apiVersion2:s,inputsDefaultValueSet:a}),{inLineAlertProps:g,handleSetInLineAlertProps:w}=Ut(),{isKeepMeLogged:k,userEmail:G,showEmailConfirmationForm:U,isSuccessful:M,isClickSubmit:v,signUpPasswordValue:T,isLoading:A,onSubmitSignUp:V,signInButton:H,handleSetSignUpPasswordValue:J,onKeepMeLoggedChange:F,handleHideEmailConfirmationForm:O}=Ct({addressesData:t,translations:m,isEmailConfirmationRequired:N,apiVersion2:s,passwordConfigs:u,routeRedirectOnSignIn:n,routeSignIn:f,onErrorCallback:p,onSuccessCallback:I,setActiveComponent:S,handleSetInLineAlertProps:w,routeRedirectOnEmailConfirmationClose:c}),{isValidUniqueSymbols:q,defaultLengthMessage:_}=mt({password:T,isClickSubmit:v,passwordConfigs:u}),P=!N&&(t==null?void 0:t.length);return!C.length&&s?o("div",{className:`auth-signUpForm ${e} skeleton-loader`,"data-testid":"SignUpForm",children:o(Tt,{activeSkeleton:"signUpForm"})}):x&&M.status?x(M.userName):U?o(Pt,{formSize:e,userEmail:G,inLineAlertProps:g,hideCloseBtnOnEmailConfirmation:r,handleSetInLineAlertProps:w,onPrimaryButtonClick:O}):E("div",{className:at(["auth-signUpForm",e]),"data-testid":"SignUpForm",children:[o(_t,{text:m.title,bottomLine:!1,className:"auth-signUpForm__title"}),g.text?o(pt,{className:"auth-signUpForm__notification",type:g.type,variant:"secondary",heading:g.text,icon:g.icon}):null,E(yt,{submitCallback:V,className:"auth-signUpForm__form",isLoading:A,name:"signUp_form",fieldsConfig:C,children:[E(Et,{initialPassword:T,className:"auth-signUpForm__form__item",setPasswordValueCallback:J,isError:q==="error"||(_==null?void 0:_.status)==="error"||v&&T.length<=0,children:[o(ut,{minLength:u==null?void 0:u.minLength,requiredCharacterClasses:u==null?void 0:u.requiredCharacterClasses,validateLengthConfig:_,isValidUniqueSymbols:q}),P?o("div",{className:"auth-signUpForm__automatic-login",children:o($,{label:m.keepMeLoggedText,onChange:F,initialValue:k})}):null]}),l||h?E("div",{className:"auth-signUpForm__item auth-signUpForm__checkbox",children:[l?o($,{name:"is_subscribed",label:m.subscribedDefaultText}):null,h?o($,{name:"privacyPolicy",label:m.privacyPolicyDefaultText}):null]}):null,E("div",{className:"auth-signUpForm-buttons",children:[o(R,{type:"button",variant:"tertiary",style:{padding:0},buttonText:m.buttonSecondary,enableLoader:!1,onClick:H}),o(R,{type:"submit",buttonText:m.buttonPrimary,variant:"primary",enableLoader:A})]})]}),o("div",{id:"createCustomerV2"})]})};export{$t as S};
@@ -1,2 +1 @@
1
- import{useMemo as r}from"@dropins/tools/preact-hooks.js";import{jsxs as l,jsx as e,Fragment as s}from"@dropins/tools/preact-jsx-runtime.js";import{Skeleton as a,SkeletonRow as i}from"@dropins/tools/components.js";const d=()=>l(a,{children:[e(i,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})," ",e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})]}),h=()=>l(a,{children:[e(i,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})," ",e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})]}),u=()=>l(a,{children:[e(i,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})," ",e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})]}),o=({activeSkeleton:n})=>{const t=r(()=>({signInForm:e(h,{}),signUpForm:e(d,{}),resetPasswordForm:e(u,{})}),[]);return e(s,{children:t[n]})};export{o as S};
2
- //# sourceMappingURL=SkeletonLoader.js.map
1
+ import{jsxs as l,jsx as e,Fragment as r}from"@dropins/tools/preact-jsx-runtime.js";import{useMemo as s}from"@dropins/tools/preact-hooks.js";import{Skeleton as a,SkeletonRow as i}from"@dropins/tools/components.js";const d=()=>l(a,{children:[e(i,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})," ",e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})]}),h=()=>l(a,{children:[e(i,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})," ",e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})]}),u=()=>l(a,{children:[e(i,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})," ",e(i,{variant:"heading",size:"medium",fullWidth:!1,lines:1})]}),o=({activeSkeleton:n})=>{const t=s(()=>({signInForm:e(h,{}),signUpForm:e(d,{}),resetPasswordForm:e(u,{})}),[]);return e(r,{children:t[n]})};export{o as S};
@@ -1,4 +1,4 @@
1
- import{f as o,h as r}from"./network-error.js";const t=`
1
+ import{f as o,h as r}from"./setReCaptchaToken.js";const t=`
2
2
  mutation CONFIRM_EMAIL($email: String!, $confirmation_key: String!) {
3
3
  confirmEmail(input: {
4
4
  email: $email,
@@ -10,4 +10,3 @@ import{f as o,h as r}from"./network-error.js";const t=`
10
10
  }
11
11
  }
12
12
  `,m=async({customerEmail:i,customerConfirmationKey:a})=>await o(t,{method:"POST",variables:{email:i,confirmation_key:a}}).catch(r);export{m as c};
13
- //# sourceMappingURL=confirmEmail.js.map
@@ -1,4 +1,4 @@
1
- import{f as s,h as a}from"./network-error.js";import{t as o}from"./transform-attributes-form.js";import{h as n}from"./getStoreConfig.js";const i=`
1
+ import{c as o,f as a,h as s}from"./setReCaptchaToken.js";import{t as i}from"./transform-attributes-form.js";import{h as n}from"./getStoreConfig.js";const u=`
2
2
  mutation CREATE_CUSTOMER($input: CustomerInput!) {
3
3
  createCustomer(input: $input) {
4
4
  customer {
@@ -9,7 +9,7 @@ import{f as s,h as a}from"./network-error.js";import{t as o}from"./transform-att
9
9
  }
10
10
  }
11
11
  }
12
- `,u=`
12
+ `,m=`
13
13
  mutation CREATE_CUSTOMER_V2($input: CustomerCreateInput!) {
14
14
  createCustomerV2(input: $input) {
15
15
  customer {
@@ -20,7 +20,7 @@ import{f as s,h as a}from"./network-error.js";import{t as o}from"./transform-att
20
20
  }
21
21
  }
22
22
  }
23
- `,T=async(r,t)=>await s(t?u:i,{method:"POST",variables:{input:{...r}}}).catch(a),m=`
23
+ `,p=async(r,t)=>(await o(),await a(t?m:u,{method:"POST",variables:{input:{...r}}}).catch(s)),c=`
24
24
  query GET_ATTRIBUTES_FORM($formCode: String!) {
25
25
  attributesForm(formCode: $formCode) {
26
26
  items {
@@ -44,11 +44,10 @@ import{f as s,h as a}from"./network-error.js";import{t as o}from"./transform-att
44
44
  }
45
45
  }
46
46
  }
47
- `,_=async r=>await s(m.replace(/\s+/g," ").trim(),{method:"GET",cache:"force-cache",variables:{formCode:r}}).then(t=>{var e;return(e=t.errors)!=null&&e.length?n(t.errors):o(t)}).catch(a),c=`
47
+ `,_=async r=>await a(c.replace(/\s+/g," ").trim(),{method:"GET",cache:"force-cache",variables:{formCode:r}}).then(t=>{var e;return(e=t.errors)!=null&&e.length?n(t.errors):i(t)}).catch(s),E=`
48
48
  mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {
49
49
  createCustomerAddress(input:$input) {
50
50
  firstname
51
51
  }
52
52
  }
53
- `,l=async r=>await s(c,{method:"POST",variables:{input:r}}).then(t=>{var e;return(e=t.errors)!=null&&e.length?n(t.errors):t.data.createCustomerAddress.firstname||""}).catch(a);export{l as a,T as c,_ as g};
54
- //# sourceMappingURL=createCustomerAddress.js.map
53
+ `,l=async r=>await a(E,{method:"POST",variables:{input:r}}).then(t=>{var e;return(e=t.errors)!=null&&e.length?n(t.errors):t.data.createCustomerAddress.firstname||""}).catch(s);export{l as a,p as c,_ as g};
@@ -1,4 +1,4 @@
1
- import{a as y,f as h,h as C}from"./network-error.js";import{events as M}from"@dropins/tools/event-bus.js";import{c as A}from"./initialize.js";const v=t=>({personalEmail:{address:(t==null?void 0:t.email)||""},userAccount:{login:!0},commerce:{commerceScope:{storeCode:(t==null?void 0:t.store_code)||""}}}),D=t=>({userAccount:{logout:!0},commerce:{commerceScope:{storeCode:(t==null?void 0:t.store_code)||""}}}),U=t=>({personalEmail:{address:(t==null?void 0:t.email)||""},userAccount:{updateProfile:t==null?void 0:t.updateProfile},commerce:{commerceScope:{storeCode:(t==null?void 0:t.store_code)||""}}}),I={auth_dropin_user_token:"auth_dropin_user_token",auth_dropin_firstname:"auth_dropin_firstname"},g=3600,R=t=>{var e,a,o,r,c,i,n,u,m,s;return{autocompleteOnStorefront:((a=(e=t==null?void 0:t.data)==null?void 0:e.storeConfig)==null?void 0:a.autocomplete_on_storefront)||!1,minLength:((r=(o=t==null?void 0:t.data)==null?void 0:o.storeConfig)==null?void 0:r.minimum_password_length)||3,requiredCharacterClasses:+((i=(c=t==null?void 0:t.data)==null?void 0:c.storeConfig)==null?void 0:i.required_character_classes_number)||0,createAccountConfirmation:((u=(n=t==null?void 0:t.data)==null?void 0:n.storeConfig)==null?void 0:u.create_account_confirmation)||!1,customerAccessTokenLifetime:((s=(m=t==null?void 0:t.data)==null?void 0:m.storeConfig)==null?void 0:s.customer_access_token_lifetime)*g||g}},q=t=>{var e,a,o,r,c,i;return{email:((a=(e=t==null?void 0:t.data)==null?void 0:e.customer)==null?void 0:a.email)||"",firstname:((r=(o=t==null?void 0:t.data)==null?void 0:o.customer)==null?void 0:r.firstname)||"",lastname:((i=(c=t==null?void 0:t.data)==null?void 0:c.customer)==null?void 0:i.lastname)||""}},$=t=>{const e=t.map(a=>a.message).join(" ");throw Error(e)},F=`
1
+ import{a as y,f as h,h as C,c as M}from"./setReCaptchaToken.js";import"@dropins/tools/recaptcha.js";import{events as A}from"@dropins/tools/event-bus.js";import{c as v}from"./initialize.js";const D=t=>({personalEmail:{address:(t==null?void 0:t.email)||""},userAccount:{login:!0},commerce:{commerceScope:{storeCode:(t==null?void 0:t.store_code)||""}}}),U=t=>({userAccount:{logout:!0},commerce:{commerceScope:{storeCode:(t==null?void 0:t.store_code)||""}}}),R=t=>({personalEmail:{address:(t==null?void 0:t.email)||""},userAccount:{updateProfile:t==null?void 0:t.updateProfile},commerce:{commerceScope:{storeCode:(t==null?void 0:t.store_code)||""}}}),I={auth_dropin_user_token:"auth_dropin_user_token",auth_dropin_firstname:"auth_dropin_firstname"},g=3600,q=t=>{var e,a,o,r,c,i,n,s,m,u;return{autocompleteOnStorefront:((a=(e=t==null?void 0:t.data)==null?void 0:e.storeConfig)==null?void 0:a.autocomplete_on_storefront)||!1,minLength:((r=(o=t==null?void 0:t.data)==null?void 0:o.storeConfig)==null?void 0:r.minimum_password_length)||3,requiredCharacterClasses:+((i=(c=t==null?void 0:t.data)==null?void 0:c.storeConfig)==null?void 0:i.required_character_classes_number)||0,createAccountConfirmation:((s=(n=t==null?void 0:t.data)==null?void 0:n.storeConfig)==null?void 0:s.create_account_confirmation)||!1,customerAccessTokenLifetime:((u=(m=t==null?void 0:t.data)==null?void 0:m.storeConfig)==null?void 0:u.customer_access_token_lifetime)*g||g}},F=t=>{var e,a,o,r,c,i;return{email:((a=(e=t==null?void 0:t.data)==null?void 0:e.customer)==null?void 0:a.email)||"",firstname:((r=(o=t==null?void 0:t.data)==null?void 0:o.customer)==null?void 0:r.firstname)||"",lastname:((i=(c=t==null?void 0:t.data)==null?void 0:c.customer)==null?void 0:i.lastname)||""}},$=t=>{const e=t.map(a=>a.message).join(" ");throw Error(e)},b=`
2
2
  query GET_CUSTOMER_DATA {
3
3
  customer {
4
4
  firstname
@@ -6,13 +6,13 @@ import{a as y,f as h,h as C}from"./network-error.js";import{events as M}from"@dr
6
6
  email
7
7
  }
8
8
  }
9
- `,b=async t=>{if(t){const{authHeaderConfig:e}=A.getConfig();y(e.header,e.tokenPrefix?`${e.tokenPrefix} ${t}`:t)}return await h(F,{method:"GET",cache:"force-cache"}).then(e=>{var a;return(a=e.errors)!=null&&a.length?$(e.errors):q(e)}).catch(C)},J=`
9
+ `,J=async t=>{if(t){const{authHeaderConfig:e}=v.getConfig();y(e.header,e.tokenPrefix?`${e.tokenPrefix} ${t}`:t)}return await h(b,{method:"GET",cache:"force-cache"}).then(e=>{var a;return(a=e.errors)!=null&&a.length?$(e.errors):F(e)}).catch(C)},K=`
10
10
  mutation GET_CUSTOMER_TOKEN($email: String!, $password: String!) {
11
11
  generateCustomerToken(email: $email, password: $password) {
12
12
  token
13
13
  }
14
14
  }
15
- `,W=t=>{document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`},K=async()=>{try{const t=sessionStorage.getItem("storeConfig");let a=(t?JSON.parse(t):{}).customerAccessTokenLifetime;if(!a){const o=await V();sessionStorage.setItem("storeConfig",JSON.stringify(o)),a=(o==null?void 0:o.customerAccessTokenLifetime)||g}return`Max-Age=${a}`}catch(t){return console.error("getCookiesLifetime() Error:",t),`Max-Age=${g}`}};var _=(t=>(t.CREATE_ACCOUNT_EVENT="create-account",t.SIGN_IN="sign-in",t.SIGN_OUT="sign-out",t))(_||{});const E="authContext",N={CREATE_ACCOUNT:"create-account",SIGN_IN:"sign-in",SIGN_OUT:"sign-out"};function S(t,e){const a=window.adobeDataLayer||[];a.push({[t]:null}),a.push({[t]:e})}function O(t){(window.adobeDataLayer||[]).push(a=>{const o=a.getState?a.getState():{};a.push({event:t,eventInfo:{...o}})})}function H(t){const e=U(t);S(E,e),O(N.CREATE_ACCOUNT)}function L(t){const e=v(t);S(E,e),O(N.SIGN_IN)}function Q(t){const e=D(t);S(E,e),O(N.SIGN_OUT)}const T=(t,e)=>{const a=sessionStorage.getItem("storeConfig"),r={...a?JSON.parse(a):{},...e};switch(t){case"create-account":H(r);break;case"sign-in":L(r);break;case"sign-out":Q(r);break;default:return null}},Y=async({email:t,password:e,translations:a,onErrorCallback:o,handleSetInLineAlertProps:r})=>{var k,G,l,w;const c=await h(J,{method:"POST",variables:{email:t,password:e}}).catch(C);if(!((G=(k=c==null?void 0:c.data)==null?void 0:k.generateCustomerToken)!=null&&G.token)){const f=a.customerTokenErrorMessage,d=c!=null&&c.errors?c.errors[0].message:f;return o==null||o(d),r==null||r({type:"error",text:d}),T(_.SIGN_IN,{}),{errorMessage:d,userName:""}}const i=(w=(l=c==null?void 0:c.data)==null?void 0:l.generateCustomerToken)==null?void 0:w.token,n=await b(i);if(!(n!=null&&n.firstname)||!(n!=null&&n.email)){const f=a.customerTokenErrorMessage;return o==null||o(f),r==null||r({type:"error",text:f}),T(_.SIGN_IN,{}),{errorMessage:f,userName:""}}const u=n==null?void 0:n.firstname,m=n==null?void 0:n.email,s=await K();return document.cookie=`${I.auth_dropin_firstname}=${u}; path=/; ${s}; `,document.cookie=`${I.auth_dropin_user_token}=${i}; path=/; ${s}; `,M.emit("authenticated",!!i),T(_.SIGN_IN,m?{email:m}:{}),{errorMessage:"",userName:u}},j=`
15
+ `,Z=t=>{document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`},H=async()=>{try{const t=sessionStorage.getItem("storeConfig");let a=(t?JSON.parse(t):{}).customerAccessTokenLifetime;if(!a){const o=await X();sessionStorage.setItem("storeConfig",JSON.stringify(o)),a=(o==null?void 0:o.customerAccessTokenLifetime)||g}return`Max-Age=${a}`}catch(t){return console.error("getCookiesLifetime() Error:",t),`Max-Age=${g}`}};var _=(t=>(t.CREATE_ACCOUNT_EVENT="create-account",t.SIGN_IN="sign-in",t.SIGN_OUT="sign-out",t))(_||{});const E="authContext",N={CREATE_ACCOUNT:"create-account",SIGN_IN:"sign-in",SIGN_OUT:"sign-out"};function S(t,e){const a=window.adobeDataLayer||[];a.push({[t]:null}),a.push({[t]:e})}function O(t){(window.adobeDataLayer||[]).push(a=>{const o=a.getState?a.getState():{};a.push({event:t,eventInfo:{...o}})})}function L(t){const e=R(t);S(E,e),O(N.CREATE_ACCOUNT)}function Q(t){const e=D(t);S(E,e),O(N.SIGN_IN)}function j(t){const e=U(t);S(E,e),O(N.SIGN_OUT)}const T=(t,e)=>{const a=sessionStorage.getItem("storeConfig"),r={...a?JSON.parse(a):{},...e};switch(t){case"create-account":L(r);break;case"sign-in":Q(r);break;case"sign-out":j(r);break;default:return null}},P=async({email:t,password:e,translations:a,onErrorCallback:o,handleSetInLineAlertProps:r})=>{var k,G,w,l;await M();const c=await h(K,{method:"POST",variables:{email:t,password:e}}).catch(C);if(!((G=(k=c==null?void 0:c.data)==null?void 0:k.generateCustomerToken)!=null&&G.token)){const f=a.customerTokenErrorMessage,d=c!=null&&c.errors?c.errors[0].message:f;return o==null||o(d),r==null||r({type:"error",text:d}),T(_.SIGN_IN,{}),{errorMessage:d,userName:""}}const i=(l=(w=c==null?void 0:c.data)==null?void 0:w.generateCustomerToken)==null?void 0:l.token,n=await J(i);if(!(n!=null&&n.firstname)||!(n!=null&&n.email)){const f=a.customerTokenErrorMessage;return o==null||o(f),r==null||r({type:"error",text:f}),T(_.SIGN_IN,{}),{errorMessage:f,userName:""}}const s=n==null?void 0:n.firstname,m=n==null?void 0:n.email,u=await H();return document.cookie=`${I.auth_dropin_firstname}=${s}; path=/; ${u}; `,document.cookie=`${I.auth_dropin_user_token}=${i}; path=/; ${u}; `,A.emit("authenticated",!!i),T(_.SIGN_IN,m?{email:m}:{}),{errorMessage:"",userName:s}},V=`
16
16
  query GET_STORE_CONFIG {
17
17
  storeConfig {
18
18
  autocomplete_on_storefront
@@ -26,5 +26,4 @@ import{a as y,f as h,h as C}from"./network-error.js";import{events as M}from"@dr
26
26
  customer_access_token_lifetime
27
27
  }
28
28
  }
29
- `,V=async()=>await h(j,{method:"GET",cache:"force-cache"}).then(t=>{var e;return(e=t.errors)!=null&&e.length?$(t.errors):R(t)}).catch(C);export{I as C,_ as E,Y as a,V as b,W as d,b as g,$ as h,T as p};
30
- //# sourceMappingURL=getStoreConfig.js.map
29
+ `,X=async()=>await h(V,{method:"GET",cache:"force-cache"}).then(t=>{var e;return(e=t.errors)!=null&&e.length?$(t.errors):q(t)}).catch(C);export{I as C,_ as E,P as a,X as b,Z as d,J as g,$ as h,T as p};
package/chunks/index.js CHANGED
@@ -1,2 +1 @@
1
- import{R as x,R as F}from"./ResetPasswordForm.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"./requestPasswordResetEmail.js";import"./network-error.js";import"@dropins/tools/fetch-graphql.js";import"./useInLineAlert.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"./simplifyTransformAttributesForm.js";import"./transform-attributes-form.js";export{x as ResetPasswordForm,F as default};
2
- //# sourceMappingURL=index.js.map
1
+ import{R as F,R as P}from"./ResetPasswordForm.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"./requestPasswordResetEmail.js";import"./setReCaptchaToken.js";import"@dropins/tools/fetch-graphql.js";import"./useInLineAlert.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"./simplifyTransformAttributesForm.js";import"./transform-attributes-form.js";export{F as ResetPasswordForm,P as default};
package/chunks/index2.js CHANGED
@@ -1,2 +1 @@
1
- import{S as c,S as h}from"./SignInForm.js";import"@dropins/tools/lib.js";import"./useInLineAlert.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/event-bus.js";import"./getStoreConfig.js";import"./network-error.js";import"@dropins/tools/fetch-graphql.js";import"./initialize.js";import"./resendConfirmationEmail.js";import"./simplifyTransformAttributesForm.js";import"./transform-attributes-form.js";import"./confirmEmail.js";import"./EmailConfirmationForm.js";import"./PasswordField.js";export{c as SignInForm,h as default};
2
- //# sourceMappingURL=index2.js.map
1
+ import{S as h,S as j}from"./SignInForm.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"./useInLineAlert.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/event-bus.js";import"./getStoreConfig.js";import"./setReCaptchaToken.js";import"@dropins/tools/fetch-graphql.js";import"./initialize.js";import"./resendConfirmationEmail.js";import"./simplifyTransformAttributesForm.js";import"./transform-attributes-form.js";import"./confirmEmail.js";import"./EmailConfirmationForm.js";import"./PasswordField.js";export{h as SignInForm,j as default};
package/chunks/index3.js CHANGED
@@ -1,2 +1 @@
1
- import{S as j,S as k}from"./SignUpForm.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"./createCustomerAddress.js";import"./network-error.js";import"@dropins/tools/fetch-graphql.js";import"./transform-attributes-form.js";import"./getStoreConfig.js";import"./initialize.js";import"@dropins/tools/preact-hooks.js";import"./simplifyTransformAttributesForm.js";import"./usePasswordValidationMessage.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/i18n.js";import"./useInLineAlert.js";import"@dropins/tools/components.js";import"./SkeletonLoader.js";import"./EmailConfirmationForm.js";import"./resendConfirmationEmail.js";import"./PasswordField.js";export{j as SignUpForm,k as default};
2
- //# sourceMappingURL=index3.js.map
1
+ import{S as k,S as q}from"./SignUpForm.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"./usePasswordValidationMessage.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/i18n.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"./getStoreConfig.js";import"./setReCaptchaToken.js";import"@dropins/tools/fetch-graphql.js";import"./initialize.js";import"@dropins/tools/preact-hooks.js";import"./createCustomerAddress.js";import"./transform-attributes-form.js";import"./simplifyTransformAttributesForm.js";import"./useInLineAlert.js";import"@dropins/tools/components.js";import"./SkeletonLoader.js";import"./EmailConfirmationForm.js";import"./resendConfirmationEmail.js";import"./PasswordField.js";export{k as SignUpForm,q as default};
@@ -1,2 +1 @@
1
1
  import{Initializer as o}from"@dropins/tools/lib.js";const i=new o({init:async n=>{const e={authHeaderConfig:{header:"Authorization",tokenPrefix:"Bearer"}};i.config.setConfig({...e,...n})},listeners:()=>[]}),a=i.config;export{a as c,i};
2
- //# sourceMappingURL=initialize.js.map
@@ -1,6 +1,5 @@
1
- import{f as i,h as l}from"./network-error.js";const R=a=>{var r,E,m;let t="";return(r=a==null?void 0:a.errors)!=null&&r.length&&(t=(E=a==null?void 0:a.errors[0])==null?void 0:E.message),{message:t,success:!!((m=a==null?void 0:a.data)!=null&&m.requestPasswordResetEmail)}},S=`
1
+ import{c as m,f as l,h as e}from"./setReCaptchaToken.js";const c=a=>{var r,E,i;let t="";return(r=a==null?void 0:a.errors)!=null&&r.length&&(t=(E=a==null?void 0:a.errors[0])==null?void 0:E.message),{message:t,success:!!((i=a==null?void 0:a.data)!=null&&i.requestPasswordResetEmail)}},R=`
2
2
  mutation REQUEST_PASSWORD_RESET_EMAIL($email: String!) {
3
3
  requestPasswordResetEmail(email: $email)
4
4
  }
5
- `,e=async a=>await i(S,{method:"POST",variables:{email:a}}).then(t=>R(t)).catch(l);export{e as r};
6
- //# sourceMappingURL=requestPasswordResetEmail.js.map
5
+ `,h=async a=>(await m(),await l(R,{method:"POST",variables:{email:a}}).then(t=>c(t)).catch(e));export{h as r};
@@ -1,5 +1,4 @@
1
- import{f as r,h as e}from"./network-error.js";const i=`
1
+ import{f as r,h as e}from"./setReCaptchaToken.js";const i=`
2
2
  mutation RESEND_CONFIRMATION_EMAIL($email: String!) {
3
3
  resendConfirmationEmail(email: $email)
4
4
  }`,n=async a=>await r(i,{method:"POST",variables:{email:a}}).catch(e);export{n as r};
5
- //# sourceMappingURL=resendConfirmationEmail.js.map