@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.
- package/api/confirmEmail/confirmEmail.d.ts +4 -0
- package/api/confirmEmail/graphql/confirmEmail.graphql.d.ts +2 -0
- package/api/confirmEmail/index.d.ts +2 -0
- package/api/createCustomer/createCustomer.d.ts +4 -0
- package/api/createCustomer/graphql/createCustomer.graphql.d.ts +2 -0
- package/api/createCustomer/graphql/createCustomerV2.graphql.d.ts +2 -0
- package/api/createCustomer/index.d.ts +2 -0
- package/api/createCustomerAddress/createCustomerAddress.d.ts +4 -0
- package/api/createCustomerAddress/graphql/createCustomerAddress.graphql.d.ts +2 -0
- package/api/createCustomerAddress/index.d.ts +2 -0
- package/api/fetch-graphql/fetch-graphql.d.ts +8 -0
- package/api/fetch-graphql/index.d.ts +2 -0
- package/api/getAttributesForm/getAttributesForm.d.ts +4 -0
- package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +2 -0
- package/api/getAttributesForm/index.d.ts +2 -0
- package/api/getCustomerData/getCustomerData.d.ts +4 -0
- package/api/getCustomerData/graphql/getCustomerData.graphql.d.ts +2 -0
- package/api/getCustomerData/index.d.ts +2 -0
- package/api/getCustomerToken/getCustomerToken.d.ts +15 -0
- package/api/getCustomerToken/graphql/getCustomerToken.graphql.d.ts +2 -0
- package/api/getCustomerToken/index.d.ts +2 -0
- package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +2 -0
- package/api/getStoreConfig/index.d.ts +2 -0
- package/api/index.d.ts +14 -0
- package/api/initialize/index.d.ts +2 -0
- package/api/initialize/initialize.d.ts +14 -0
- package/api/requestPasswordResetEmail/graphql/requestPasswordResetEmail.graphql.d.ts +2 -0
- package/api/requestPasswordResetEmail/index.d.ts +2 -0
- package/api/requestPasswordResetEmail/requestPasswordResetEmail.d.ts +4 -0
- package/api/resendConfirmationEmail/graphql/resendConfirmationEmail.graphql.d.ts +2 -0
- package/api/resendConfirmationEmail/index.d.ts +2 -0
- package/api/resendConfirmationEmail/resendConfirmationEmail.d.ts +4 -0
- package/api/resetPassword/graphql/resetPassword.graphql.d.ts +2 -0
- package/api/resetPassword/index.d.ts +2 -0
- package/api/resetPassword/resetPassword.d.ts +4 -0
- package/api/revokeCustomerToken/graphql/revokeCustomerToken.graphql.d.ts +2 -0
- package/api/revokeCustomerToken/index.d.ts +2 -0
- package/api/revokeCustomerToken/revokeCustomerToken.d.ts +4 -0
- package/api.d.ts +1 -0
- package/api.js +3 -4
- package/chunks/EmailConfirmationForm.js +1 -2
- package/chunks/PasswordField.js +1 -2
- package/chunks/ResetPasswordForm.js +1 -2
- package/chunks/SignInForm.js +1 -2
- package/chunks/SignUpForm.js +1 -2
- package/chunks/SkeletonLoader.js +1 -2
- package/chunks/confirmEmail.js +1 -2
- package/chunks/createCustomerAddress.js +5 -6
- package/chunks/getStoreConfig.js +4 -5
- package/chunks/index.js +1 -2
- package/chunks/index2.js +1 -2
- package/chunks/index3.js +1 -2
- package/chunks/initialize.js +0 -1
- package/chunks/requestPasswordResetEmail.js +2 -3
- package/chunks/resendConfirmationEmail.js +1 -2
- package/chunks/resetPassword.js +2 -3
- package/chunks/setReCaptchaToken.js +1 -0
- package/chunks/simplifyTransformAttributesForm.js +0 -1
- package/chunks/transform-attributes-form.js +0 -1
- package/chunks/useInLineAlert.js +1 -2
- package/chunks/usePasswordValidationMessage.js +1 -2
- package/components/EmailConfirmationForm/EmailConfirmationForm.d.ts +5 -0
- package/components/EmailConfirmationForm/index.d.ts +3 -0
- package/components/PasswordValidationMessage/PasswordValidationMessage.d.ts +12 -0
- package/components/PasswordValidationMessage/index.d.ts +3 -0
- package/components/ResetPasswordForm/ResetPasswordForm.d.ts +6 -0
- package/components/ResetPasswordForm/index.d.ts +3 -0
- package/components/SignInForm/SignInForm.d.ts +5 -0
- package/components/SignInForm/index.d.ts +3 -0
- package/components/SignUpForm/SignUpForm.d.ts +5 -0
- package/components/SignUpForm/index.d.ts +3 -0
- package/components/SkeletonLoader/SkeletonLoader.d.ts +5 -0
- package/components/SkeletonLoader/Skeletons/ResetPasswordSkeleton.d.ts +2 -0
- package/components/SkeletonLoader/Skeletons/SignInSkeleton.d.ts +2 -0
- package/components/SkeletonLoader/Skeletons/SignUpSkeleton.d.ts +2 -0
- package/components/SkeletonLoader/Skeletons/index.d.ts +4 -0
- package/components/SkeletonLoader/index.d.ts +3 -0
- package/components/SuccessNotificationForm/SuccessNotificationForm.d.ts +6 -0
- package/components/SuccessNotificationForm/index.d.ts +3 -0
- package/components/UI/Button/Button.d.ts +16 -0
- package/components/UI/Button/index.d.ts +3 -0
- package/components/UI/CheckboxField/CheckboxField.d.ts +13 -0
- package/components/UI/CheckboxField/index.d.ts +3 -0
- package/components/UI/DateField/DateField.d.ts +13 -0
- package/components/UI/DateField/index.d.ts +3 -0
- package/components/UI/Form/Form.d.ts +5 -0
- package/components/UI/Form/index.d.ts +3 -0
- package/components/UI/FormInputs/FormInputs.d.ts +12 -0
- package/components/UI/FormInputs/index.d.ts +3 -0
- package/components/UI/PasswordField/PasswordField.d.ts +15 -0
- package/components/UI/PasswordField/index.d.ts +3 -0
- package/components/UI/SelectField/SelectField.d.ts +17 -0
- package/components/UI/SelectField/index.d.ts +3 -0
- package/components/UI/TextArea/TextArea.d.ts +13 -0
- package/components/UI/TextArea/index.d.ts +3 -0
- package/components/UI/TextField/TextField.d.ts +13 -0
- package/components/UI/TextField/index.d.ts +3 -0
- package/components/UI/Title/Title.d.ts +11 -0
- package/components/UI/Title/index.d.ts +3 -0
- package/components/UI/index.d.ts +11 -0
- package/components/UpdatePasswordForm/UpdatePasswordForm.d.ts +5 -0
- package/components/UpdatePasswordForm/index.d.ts +3 -0
- package/components/index.d.ts +18 -0
- package/configs/cookieConfigs.d.ts +7 -0
- package/configs/defaultCreateUserConfigs.d.ts +16 -0
- package/configs/patternConfigs.d.ts +3 -0
- package/containers/AuthCombine/AuthCombine.d.ts +5 -0
- package/containers/AuthCombine/index.d.ts +3 -0
- package/containers/AuthCombine.d.ts +3 -0
- package/containers/AuthCombine.js +1 -2
- package/containers/ResetPassword/ResetPassword.d.ts +5 -0
- package/containers/ResetPassword/index.d.ts +3 -0
- package/containers/ResetPassword.d.ts +3 -0
- package/containers/ResetPassword.js +1 -2
- package/containers/SignIn/SignIn.d.ts +5 -0
- package/containers/SignIn/index.d.ts +3 -0
- package/containers/SignIn.d.ts +3 -0
- package/containers/SignIn.js +1 -2
- package/containers/SignUp/SignUp.d.ts +5 -0
- package/containers/SignUp/index.d.ts +3 -0
- package/containers/SignUp.d.ts +3 -0
- package/containers/SignUp.js +1 -2
- package/containers/SuccessNotification/SuccessNotification.d.ts +5 -0
- package/containers/SuccessNotification/index.d.ts +3 -0
- package/containers/SuccessNotification.d.ts +3 -0
- package/containers/SuccessNotification.js +1 -2
- package/containers/UpdatePassword/UpdatePassword.d.ts +5 -0
- package/containers/UpdatePassword/index.d.ts +3 -0
- package/containers/UpdatePassword.d.ts +3 -0
- package/containers/UpdatePassword.js +1 -2
- package/containers/index.d.ts +7 -0
- package/data/models/attributes-form.d.ts +25 -0
- package/data/models/customer-data.d.ts +6 -0
- package/data/models/index.d.ts +7 -0
- package/data/models/password-reset-email.d.ts +5 -0
- package/data/models/reset-password.d.ts +5 -0
- package/data/models/revoke-customer-token.d.ts +5 -0
- package/data/models/store-config.d.ts +8 -0
- package/data/transforms/index.d.ts +7 -0
- package/data/transforms/transform-attributes-form.d.ts +5 -0
- package/data/transforms/transform-auth.d.ts +37 -0
- package/data/transforms/transform-customer-data.d.ts +5 -0
- package/data/transforms/transform-password-reset-email.d.ts +5 -0
- package/data/transforms/transform-reset-password.d.ts +5 -0
- package/data/transforms/transform-revoke-customer-token.d.ts +5 -0
- package/data/transforms/transform-store-config.d.ts +5 -0
- package/hooks/api/useGetAttributesForm.d.ts +14 -0
- package/hooks/api/useGetStoreConfigs.d.ts +8 -0
- package/hooks/components/useEmailConfirmationForm.d.ts +7 -0
- package/hooks/components/usePasswordValidationMessage.d.ts +16 -0
- package/hooks/components/useResetPasswordForm.d.ts +8 -0
- package/hooks/components/useSignInForm.d.ts +21 -0
- package/hooks/components/useSignUpForm.d.ts +20 -0
- package/hooks/components/useUpdatePasswordForm.d.ts +14 -0
- package/hooks/ui/useForm.d.ts +11 -0
- package/hooks/useEmailConfirmation.d.ts +11 -0
- package/hooks/useInLineAlert.d.ts +7 -0
- package/i18n/en_US.json.d.ts +66 -0
- package/icons/index.d.ts +4 -0
- package/lib/acdl.d.ts +9 -0
- package/lib/checkIsFunction.d.ts +2 -0
- package/lib/clearUrlAndReplace.d.ts +2 -0
- package/lib/convertToInputDateFormat.d.ts +2 -0
- package/lib/cookieUtils.d.ts +3 -0
- package/lib/fetch-error.d.ts +5 -0
- package/lib/generateRandomDigits.d.ts +2 -0
- package/lib/getFormValues.d.ts +2 -0
- package/lib/getUrlParam.d.ts +2 -0
- package/lib/mergeFormObjects.d.ts +3 -0
- package/lib/network-error.d.ts +6 -0
- package/lib/setLoadingState.d.ts +2 -0
- package/lib/setReCaptchaToken.d.ts +2 -0
- package/lib/simplifyTransformAttributesForm.d.ts +2 -0
- package/lib/validationUniqueSymbolsPassword.d.ts +2 -0
- package/package.json +1 -1
- package/render/Provider.d.ts +8 -0
- package/render/index.d.ts +2 -0
- package/render/render.d.ts +4 -0
- package/render.d.ts +1 -0
- package/render.js +1 -2
- package/types/api/confirmEmail.types.d.ts +17 -0
- package/types/api/createCustomer.types.d.ts +24 -0
- package/types/api/createCustomerAddress.types.d.ts +47 -0
- package/types/api/getAttributesForm.types.d.ts +29 -0
- package/types/api/getCustomerData.types.d.ts +13 -0
- package/types/api/getCustomerToken.types.d.ts +11 -0
- package/types/api/passwordResetEmail.types.d.ts +9 -0
- package/types/api/resendConfirmationEmail.types.d.ts +9 -0
- package/types/api/resetPassword.types.d.ts +9 -0
- package/types/api/revokeCustomerToken.types.d.ts +9 -0
- package/types/api/storeConfig.types.d.ts +16 -0
- package/types/authCombine.types.d.ts +12 -0
- package/types/emailConfirmationForm.types.d.ts +14 -0
- package/types/form.types.d.ts +11 -0
- package/types/index.d.ts +22 -0
- package/types/notification.types.d.ts +15 -0
- package/types/resetPassword.types.d.ts +15 -0
- package/types/signIn.types.d.ts +34 -0
- package/types/signUp.types.d.ts +41 -0
- package/types/skeletonLoader.types.d.ts +6 -0
- package/types/successNotification.types.d.ts +13 -0
- package/types/updatePassword.types.d.ts +24 -0
- package/api.js.map +0 -1
- package/chunks/EmailConfirmationForm.js.map +0 -1
- package/chunks/PasswordField.js.map +0 -1
- package/chunks/ResetPasswordForm.js.map +0 -1
- package/chunks/SignInForm.js.map +0 -1
- package/chunks/SignUpForm.js.map +0 -1
- package/chunks/SkeletonLoader.js.map +0 -1
- package/chunks/confirmEmail.js.map +0 -1
- package/chunks/createCustomerAddress.js.map +0 -1
- package/chunks/getStoreConfig.js.map +0 -1
- package/chunks/index.js.map +0 -1
- package/chunks/index2.js.map +0 -1
- package/chunks/index3.js.map +0 -1
- package/chunks/initialize.js.map +0 -1
- package/chunks/network-error.js +0 -2
- package/chunks/network-error.js.map +0 -1
- package/chunks/requestPasswordResetEmail.js.map +0 -1
- package/chunks/resendConfirmationEmail.js.map +0 -1
- package/chunks/resetPassword.js.map +0 -1
- package/chunks/simplifyTransformAttributesForm.js.map +0 -1
- package/chunks/transform-attributes-form.js.map +0 -1
- package/chunks/useInLineAlert.js.map +0 -1
- package/chunks/usePasswordValidationMessage.js.map +0 -1
- package/containers/AuthCombine.js.map +0 -1
- package/containers/ResetPassword.js.map +0 -1
- package/containers/SignIn.js.map +0 -1
- package/containers/SignUp.js.map +0 -1
- package/containers/SuccessNotification.js.map +0 -1
- package/containers/UpdatePassword.js.map +0 -1
- package/render.js.map +0 -1
|
@@ -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,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 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,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_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
|
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,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 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
|
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
|
|
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
|
-
`,
|
|
8
|
-
ERROR revokeCustomerToken: ${t.message}`;console.error(r)}return t}).catch(u);export{
|
|
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{
|
|
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};
|
package/chunks/PasswordField.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
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
|
|
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};
|
package/chunks/SignInForm.js
CHANGED
|
@@ -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{
|
|
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};
|
package/chunks/SignUpForm.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{classes as at}from"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{g as
|
|
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};
|
package/chunks/SkeletonLoader.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/chunks/confirmEmail.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as o,h as r}from"./
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
|
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};
|
package/chunks/getStoreConfig.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y,f as h,h as C}from"./
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
|
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
|
|
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};
|
package/chunks/initialize.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import{f as
|
|
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
|
-
`,
|
|
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"./
|
|
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
|