@dropins/storefront-auth 2.1.0 → 2.2.0-alpha001
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/getCustomerRolePermissions/getCustomerRolePermissions.d.ts +24 -0
- package/api/getCustomerRolePermissions/graphql/getCustomerRolePermissions.graphql.d.ts +2 -0
- package/api/getCustomerRolePermissions/index.d.ts +10 -0
- package/api/index.d.ts +1 -0
- package/api.js +34 -1
- package/api.js.map +1 -1
- package/chunks/Button.js.map +1 -1
- package/chunks/Button2.js.map +1 -1
- package/chunks/ResetPasswordForm.js.map +1 -1
- package/chunks/SignInForm.js.map +1 -1
- package/chunks/SignUpForm.js.map +1 -1
- package/chunks/SkeletonLoader.js.map +1 -1
- package/chunks/acdl.js.map +1 -1
- package/chunks/confirmEmail.js.map +1 -1
- package/chunks/createCustomerAddress.js.map +1 -1
- package/chunks/focusOnEmptyPasswordField.js.map +1 -1
- package/chunks/getCustomerToken.js +3 -3
- package/chunks/getCustomerToken.js.map +1 -1
- package/chunks/initialize.js.map +1 -1
- package/chunks/network-error.js +1 -1
- package/chunks/network-error.js.map +1 -1
- package/chunks/requestPasswordResetEmail.js.map +1 -1
- package/chunks/resendConfirmationEmail.js.map +1 -1
- package/chunks/resetPassword.js.map +1 -1
- package/chunks/revokeCustomerToken.js.map +1 -1
- package/chunks/setReCaptchaToken.js +1 -1
- package/chunks/setReCaptchaToken.js.map +1 -1
- package/chunks/simplifyTransformAttributesForm.js.map +1 -1
- package/chunks/transform-attributes-form.js.map +1 -1
- package/chunks/usePasswordValidationMessage.js.map +1 -1
- package/chunks/verifyToken.js +1 -1
- package/chunks/verifyToken.js.map +1 -1
- package/containers/AuthCombine.js.map +1 -1
- package/containers/ResetPassword.js.map +1 -1
- package/containers/SignIn.js.map +1 -1
- package/containers/SignUp.js.map +1 -1
- package/containers/SuccessNotification.js.map +1 -1
- package/containers/UpdatePassword.js.map +1 -1
- package/fragments.js.map +1 -1
- package/package.json +1 -1
- package/render.js.map +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2025 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
interface FlattenedPermissions {
|
|
10
|
+
all?: boolean;
|
|
11
|
+
admin?: boolean;
|
|
12
|
+
[key: string]: boolean | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Gets user role permissions with caching
|
|
16
|
+
*/
|
|
17
|
+
export declare const getCustomerRolePermissions: () => Promise<FlattenedPermissions>;
|
|
18
|
+
/**
|
|
19
|
+
* Clears the permissions cache - for testing purposes
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare const __clearCacheForTesting: () => void;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=getCustomerRolePermissions.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const GET_CUSTOMER_ROLE_PERMISSIONS = "\n query GET_CUSTOMER_ROLE_PERMISSIONS {\n customer {\n role {\n id\n name\n permissions {\n id\n text\n children {\n id\n text\n children {\n id\n text\n children {\n id\n text\n children {\n id\n text\n children {\n id\n text\n }\n }\n }\n }\n }\n }\n }\n }\n }\n";
|
|
2
|
+
//# sourceMappingURL=getCustomerRolePermissions.graphql.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2025 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
export * from './getCustomerRolePermissions';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
package/api/index.d.ts
CHANGED
package/api.js
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{c as
|
|
3
|
+
import{c as O,a as v,g as A}from"./chunks/createCustomerAddress.js";import{g as Q,a as U}from"./chunks/getCustomerToken.js";import{g as w,v as I}from"./chunks/verifyToken.js";import{r as b}from"./chunks/requestPasswordResetEmail.js";import{r as L}from"./chunks/resetPassword.js";import{r as N}from"./chunks/revokeCustomerToken.js";import{c as D}from"./chunks/confirmEmail.js";import{r as B}from"./chunks/resendConfirmationEmail.js";import{f as m}from"./chunks/network-error.js";import{g as K,r as V,a as W,s as X,b as Y}from"./chunks/network-error.js";import{c as $,i as rr}from"./chunks/initialize.js";import"./fragments.js";import"./chunks/setReCaptchaToken.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";import"./chunks/transform-attributes-form.js";import"./chunks/acdl.js";import"@dropins/tools/fetch-graphql.js";const c=`
|
|
4
|
+
query GET_CUSTOMER_ROLE_PERMISSIONS {
|
|
5
|
+
customer {
|
|
6
|
+
role {
|
|
7
|
+
id
|
|
8
|
+
name
|
|
9
|
+
permissions {
|
|
10
|
+
id
|
|
11
|
+
text
|
|
12
|
+
children {
|
|
13
|
+
id
|
|
14
|
+
text
|
|
15
|
+
children {
|
|
16
|
+
id
|
|
17
|
+
text
|
|
18
|
+
children {
|
|
19
|
+
id
|
|
20
|
+
text
|
|
21
|
+
children {
|
|
22
|
+
id
|
|
23
|
+
text
|
|
24
|
+
children {
|
|
25
|
+
id
|
|
26
|
+
text
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;let n=null,i=null;const p=r=>{const t={},s=e=>{e.forEach(o=>{var a;t[o.text]=!0,(a=o.children)!=null&&a.length&&s(o.children)})};return s(r),t},l=r=>(r==null?void 0:r.name)==="company administrator"&&Array.isArray(r.permissions)&&r.permissions.length===0,f=r=>{var s;if(l(r))return{admin:!0};const t={all:!0};if((s=r==null?void 0:r.permissions)!=null&&s.length){const e=p(r.permissions);return{...t,...e}}return t},d=async()=>{var r,t,s;try{const e=await m(c,{method:"GET"});(r=e.errors)!=null&&r.length&&console.error("GraphQL errors",e.errors);const o=f((s=(t=e.data)==null?void 0:t.customer)==null?void 0:s.role);return n=o,i=null,o}catch(e){throw i=null,e}},S=()=>n?Promise.resolve(n):(i||(i=d()),i),G=()=>{n=null,i=null};export{G as __clearCacheForTesting,$ as config,D as confirmEmail,O as createCustomer,v as createCustomerAddress,m as fetchGraphQl,A as getAttributesForm,K as getConfig,Q as getCustomerData,S as getCustomerRolePermissions,U as getCustomerToken,w as getStoreConfig,rr as initialize,V as removeFetchGraphQlHeader,b as requestPasswordResetEmail,B as resendConfirmationEmail,L as resetPassword,N as revokeCustomerToken,W as setEndpoint,X as setFetchGraphQlHeader,Y as setFetchGraphQlHeaders,I as verifyToken};
|
|
4
37
|
//# sourceMappingURL=api.js.map
|
package/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"api.js","sources":["/@dropins/storefront-auth/src/api/getCustomerRolePermissions/graphql/getCustomerRolePermissions.graphql.ts","/@dropins/storefront-auth/src/api/getCustomerRolePermissions/getCustomerRolePermissions.ts"],"sourcesContent":["export const GET_CUSTOMER_ROLE_PERMISSIONS = `\n query GET_CUSTOMER_ROLE_PERMISSIONS {\n customer {\n role {\n id\n name\n permissions {\n id\n text\n children {\n id\n text\n children {\n id\n text\n children {\n id\n text\n children {\n id\n text\n children {\n id\n text\n }\n }\n }\n }\n }\n }\n }\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from \"@/auth/api/fetch-graphql\";\nimport { GET_CUSTOMER_ROLE_PERMISSIONS } from \"./graphql/getCustomerRolePermissions.graphql\";\n\n// TypeScript interfaces\ninterface Permission {\n id: string;\n text: string;\n children?: Permission[];\n}\n\ninterface Role {\n id: string;\n name: string;\n permissions?: Permission[];\n}\n\ninterface GetCustomerRolePermissionsResponse {\n data?: {\n customer?: {\n role?: Role;\n };\n };\n errors?: {\n message: string;\n }[];\n}\n\ninterface FlattenedPermissions {\n all?: boolean;\n admin?: boolean;\n [key: string]: boolean | undefined;\n}\n\n// Module-level cache\nlet permissionsCache: FlattenedPermissions | null = null;\nlet fetchPromise: Promise<FlattenedPermissions> | null = null;\n\n/**\n * Recursively flattens permission tree into a flat object\n */\nconst flattenPermissionTree = (permissions: Permission[]): Record<string, boolean> => {\n const flattened: Record<string, boolean> = {};\n\n const processPermissions = (perms: Permission[]): void => {\n perms.forEach(permission => {\n flattened[permission.text] = true;\n if (permission.children?.length) {\n processPermissions(permission.children);\n }\n });\n };\n\n processPermissions(permissions);\n return flattened;\n};\n\n/**\n * Determines if user has admin privileges\n * Admin is only when user is company administrator AND has an empty permissions array\n */\nconst isAdminUser = (role?: Role): boolean => {\n return role?.name === 'company administrator' &&\n Array.isArray(role.permissions) &&\n role.permissions.length === 0;\n};\n\n/**\n * Processes role data into flattened permissions\n */\nconst processUserPermissions = (role?: Role): FlattenedPermissions => {\n if (isAdminUser(role)) {\n return { admin: true };\n }\n\n const basePermissions: FlattenedPermissions = { all: true };\n \n if (role?.permissions?.length) {\n const flattenedPerms = flattenPermissionTree(role.permissions);\n return { ...basePermissions, ...flattenedPerms };\n }\n\n return basePermissions;\n};\n\n/**\n * Fetches user role permissions from GraphQL API\n */\nconst fetchUserRolePermissions = async (): Promise<FlattenedPermissions> => {\n try {\n const response = await fetchGraphQl(GET_CUSTOMER_ROLE_PERMISSIONS, {\n method: 'GET'\n }) as GetCustomerRolePermissionsResponse;\n\n if (response.errors?.length) {\n console.error('GraphQL errors', response.errors);\n }\n\n const permissions = processUserPermissions(response.data?.customer?.role);\n\n // Update cache\n permissionsCache = permissions;\n fetchPromise = null;\n\n return permissions;\n } catch (error) {\n fetchPromise = null;\n throw error;\n }\n};\n\n/**\n * Gets user role permissions with caching\n */\nexport const getCustomerRolePermissions = (): Promise<FlattenedPermissions> => {\n // Return cached data as resolved promise if available\n if (permissionsCache) {\n return Promise.resolve(permissionsCache);\n }\n\n // No cache available - create and return fetch promise if not already fetching\n if (!fetchPromise) {\n fetchPromise = fetchUserRolePermissions();\n }\n\n return fetchPromise;\n};\n\n/**\n * Clears the permissions cache - for testing purposes\n * @internal\n */\nexport const __clearCacheForTesting = (): void => {\n permissionsCache = null;\n fetchPromise = null;\n};\n"],"names":["GET_CUSTOMER_ROLE_PERMISSIONS","permissionsCache","fetchPromise","flattenPermissionTree","permissions","flattened","processPermissions","perms","permission","_a","isAdminUser","role","processUserPermissions","basePermissions","flattenedPerms","fetchUserRolePermissions","response","fetchGraphQl","_c","_b","error","getCustomerRolePermissions","__clearCacheForTesting"],"mappings":"62BAAO,MAAMA,EAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EC2C7C,IAAIC,EAAgD,KAChDC,EAAqD,KAKzD,MAAMC,EAAyBC,GAAuD,CACpF,MAAMC,EAAqC,CAAA,EAErCC,EAAsBC,GAA8B,CACxDA,EAAM,QAAQC,GAAc,OAC1BH,EAAUG,EAAW,IAAI,EAAI,IACzBC,EAAAD,EAAW,WAAX,MAAAC,EAAqB,QACvBH,EAAmBE,EAAW,QAAQ,CAE1C,CAAC,CACH,EAEA,OAAAF,EAAmBF,CAAW,EACvBC,CACT,EAMMK,EAAeC,IACZA,GAAA,YAAAA,EAAM,QAAS,yBACpB,MAAM,QAAQA,EAAK,WAAW,GAC9BA,EAAK,YAAY,SAAW,EAM1BC,EAA0BD,GAAsC,OACpE,GAAID,EAAYC,CAAI,EAClB,MAAO,CAAE,MAAO,EAAA,EAGlB,MAAME,EAAwC,CAAE,IAAK,EAAA,EAErD,IAAIJ,EAAAE,GAAA,YAAAA,EAAM,cAAN,MAAAF,EAAmB,OAAQ,CAC7B,MAAMK,EAAiBX,EAAsBQ,EAAK,WAAW,EAC7D,MAAO,CAAE,GAAGE,EAAiB,GAAGC,CAAA,CAClC,CAEA,OAAOD,CACT,EAKME,EAA2B,SAA2C,WAC1E,GAAI,CACF,MAAMC,EAAW,MAAMC,EAAajB,EAA+B,CACjE,OAAQ,KAAA,CACT,GAEGS,EAAAO,EAAS,SAAT,MAAAP,EAAiB,QACnB,QAAQ,MAAM,iBAAkBO,EAAS,MAAM,EAGjD,MAAMZ,EAAcQ,GAAuBM,GAAAC,EAAAH,EAAS,OAAT,YAAAG,EAAe,WAAf,YAAAD,EAAyB,IAAI,EAGxE,OAAAjB,EAAmBG,EACnBF,EAAe,KAERE,CACT,OAASgB,EAAO,CACd,MAAAlB,EAAe,KACTkB,CACR,CACF,EAKaC,EAA6B,IAEpCpB,EACK,QAAQ,QAAQA,CAAgB,GAIpCC,IACHA,EAAea,EAAA,GAGVb,GAOIoB,EAAyB,IAAY,CAChDrB,EAAmB,KACnBC,EAAe,IACjB"}
|
package/chunks/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["/@dropins/storefront-auth/src/types/validationErrors.types.ts","/@dropins/storefront-auth/src/hooks/useCustomTranslations.tsx","/@dropins/storefront-auth/src/lib/validationFields.ts","/@dropins/storefront-auth/src/lib/initializeFormDataAndErrors.ts","/@dropins/storefront-auth/src/configs/excludedFocusClasses.ts","/@dropins/storefront-auth/src/hooks/components/useForm.tsx","/@dropins/storefront-auth/src/data/models/attributes-form.ts","/@dropins/storefront-auth/src/lib/extractErrorKeyAndMessage.tsx","/@dropins/storefront-auth/src/components/Form/Elements/FieldElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/InputElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/SelectElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/InputDateElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/InputCheckBoxElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/TextAreaElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/FormSlot.tsx","/@dropins/storefront-auth/src/components/Form/Form.tsx"],"sourcesContent":["/**\n * Error types in this enum are used to provide custom i18n translations for specific validation errors.\n * Each key corresponds to an error type that maps to the `Auth.FormText` i18n values in `src/i18n/en_US.json`.\n */\nexport enum ValidationErrorTypes {\n REQUIRED_FIELD_ERROR = 'requiredFieldError',\n NUMERIC_ERROR = 'numericError',\n ALPHA_NUM_WITH_SPACES_ERROR = 'alphaNumWithSpacesError',\n ALPHA_NUMERIC_ERROR = 'alphaNumericError',\n ALPHA_ERROR = 'alphaError',\n EMAIL_ERROR = 'emailError',\n DATE_ERROR = 'dateError',\n DATE_RANGE_ERROR = 'dateRangeError',\n DATE_MAX_ERROR = 'dateMaxError',\n DATE_MIN_ERROR = 'dateMinError',\n URL_ERROR = 'urlError',\n LENGTH_TEXT_ERROR = 'lengthTextError',\n}\n\n/**\n * `ERROR_CONFIG_SEPARATOR` uses the ASCII 31 (Unit Separator) character,\n * a rarely used control character, to avoid conflicts with custom i18n error messages.\n *\n * Learn more: https://theasciicode.com.ar/ascii-control-characters/unit-separator-ascii-code-31.html\n */\nexport const ERROR_CONFIG_SEPARATOR = `${String.fromCharCode(\n 31\n)}/${String.fromCharCode(31)}`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useText } from 'preact-i18n';\nimport { ValidationErrorTypes } from '@/auth/types';\n\n/**\n * A custom hook for handling translations with support for extensible error messages.\n *\n * @param defaultKeys - A mapping of keys to their translation paths.\n * @returns A complete set of translations, including dynamically updated values for null error keys.\n */\nexport const useCustomTranslations = (\n defaultKeys: Record<string, string>\n): Record<string, string> => {\n /**\n * Step 1: Fetch initial translations using the provided keys\n * Translations are fetched from the i18n system based on the provided defaultKeys.\n */\n const translations = useText(defaultKeys);\n\n /**\n * Step 2: Identify keys that require updates\n * - These keys correspond to validation errors (defined in ValidationErrorTypes).\n * - A key needs an update if:\n * 1. Its value in the initial translations is `null`.\n * 2. The key exists in ValidationErrorTypes (indicating it’s a known error type).\n *\n * Null values typically occur when translations for the given error key are not overridden\n * and instead rely on a plain structure, e.g., \"requiredFieldError\": \"This is a required field.\"\n */\n const keysToUpdate = Object.entries(translations)\n .filter(\n ([key, value]) =>\n value === null &&\n (Object.values(ValidationErrorTypes) as string[]).includes(key)\n )\n .map(([key]) => key);\n\n /**\n * Step 3: Prepare paths for fetching updated translations\n * - For each key needing an update, create a path to its extended translation.\n * - Example: For the key \"requiredFieldError\", the updated path would be \"Auth.FormText.requiredFieldError\".\n */\n const translationKeys = keysToUpdate.reduce((acc, key) => {\n acc[key] = `Auth.FormText.${key}`; // Build the updated translation path\n return acc;\n }, {} as Record<string, string>);\n\n // Step 4: Fetch updated translations for the keys identified in Step 2\n const updatedTranslations = useText(translationKeys);\n\n /**\n * Step 5: Merge updated translations back into the initial translations\n * - Replace `null` values with the fetched updated translations.\n * - Preserve all other original translations.\n */\n return {\n ...translations, // Include original translations\n ...keysToUpdate.reduce<Record<string, string>>((acc, key) => {\n acc[key] = updatedTranslations[key]; // Overwrite `null` values with updated translations\n return acc;\n }, {}),\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { ValidationErrorTypes, ERROR_CONFIG_SEPARATOR } from '@/auth/types';\n\n/* eslint-disable no-useless-escape */\ntype ValidationConfig = Record<string, string>;\ntype TranslationList = Record<string, string>;\ntype ErrorsList = Record<string, string>;\nexport type ValidationFieldsConfig = {\n validateRules: Record<string, string>[];\n code?: string;\n customUpperCode: string;\n required: boolean;\n};\n\nenum ConfigEnumLength {\n MIN_TEXT_LENGTH = 'MIN_TEXT_LENGTH',\n MAX_TEXT_LENGTH = 'MAX_TEXT_LENGTH',\n DATE_RANGE_MIN = 'DATE_RANGE_MIN',\n DATE_RANGE_MAX = 'DATE_RANGE_MAX',\n}\n\nexport enum InputValidation {\n Numeric = 'numeric',\n AlphanumWithSpaces = 'alphanum-with-spaces',\n Alphanumeric = 'alphanumeric',\n Alpha = 'alpha',\n Email = 'email',\n Length = 'length',\n Date = 'date',\n Url = 'url',\n}\n\nconst flattenObjectsArray = (arr: ValidationConfig[]): ValidationConfig => {\n return arr.reduce((acc, obj) => {\n return { ...acc, [obj.name]: obj.value };\n }, {});\n};\n\n//The basic material for the functions responsible for validation was taken from https://github.com/magento/magento2/blob/2.4/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js\nexport const validateNumeric = (value: string): boolean => /^\\d+$/.test(value);\n\nexport const validateAlphanumWithSpaces = (value: string): boolean =>\n /^[a-zA-Z0-9\\s]+$/.test(value);\n\nexport const validateAlphanumeric = (value: string): boolean =>\n /^[a-zA-Z0-9]+$/.test(value);\n\nexport const validateAlpha = (value: string): boolean =>\n /^[a-zA-Z]+$/.test(value);\n\nexport const validateEmail = (value: string): boolean =>\n /^[a-z0-9,!\\#\\$%&'\\*\\+\\/=\\?\\^_`\\{\\|\\}~-]+(\\.[a-z0-9,!\\#\\$%&'\\*\\+\\/=\\?\\^_`\\{\\|\\}~-]+)*@([a-z0-9-]+\\.)+[a-z]{2,}$/i.test(\n value\n );\n\nexport const validateDate = (value: string): boolean =>\n /^\\d{4}-\\d{2}-\\d{2}$/.test(value) && !isNaN(Date.parse(value));\n\nexport const isDateWithinRange = (\n date: string,\n minTimestamp?: number,\n maxTimestamp?: number\n): boolean => {\n const dateTimestamp = new Date(date).getTime() / 1000;\n\n if (isNaN(dateTimestamp) || dateTimestamp < 0) {\n return false;\n }\n\n if (typeof minTimestamp !== 'undefined' && dateTimestamp < minTimestamp) {\n return false;\n }\n\n if (typeof maxTimestamp !== 'undefined' && dateTimestamp > maxTimestamp) {\n return false;\n }\n\n return true;\n};\n\nexport const convertTimestampToDate = (\n timestamp: string | undefined | null\n): string => {\n if (!timestamp || timestamp.trim() === '') return '';\n\n const parsedTimestamp = parseInt(timestamp, 10);\n\n if (!isNaN(parsedTimestamp)) {\n const date = new Date(parsedTimestamp * 1000);\n\n if (isNaN(date.getTime())) return '';\n\n return date.toISOString().split('T')[0];\n }\n\n const isoDate = new Date(timestamp);\n\n if (isNaN(isoDate.getTime())) return '';\n\n const month = parseInt(timestamp.split('-')[1], 10);\n\n if (month > 12 || month < 1) return '';\n\n return isoDate.toISOString().split('T')[0];\n};\n\nexport const validateUrl = (url: string) => {\n const urlPattern =\n /^(https?|ftp):\\/\\/(([A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))(\\.[A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))*)(:(\\d+))?(\\/[A-Z0-9~](([A-Z0-9_~-]|\\.)*[A-Z0-9~]|))*\\/?(.*)?$/i;\n return urlPattern.test(url);\n};\n\nexport const validateLength = (\n value: string,\n minLength: number,\n maxLength: number\n): boolean => {\n const length = value.length;\n return length >= minLength && length <= maxLength;\n};\n\nexport const validationFields = (\n value: string,\n configs: ValidationFieldsConfig,\n translations: TranslationList,\n errorsList: ErrorsList\n) => {\n const {\n requiredFieldError,\n lengthTextError,\n numericError,\n alphaNumWithSpacesError,\n alphaNumericError,\n alphaError,\n emailError,\n dateError,\n urlError,\n dateRangeError,\n dateMaxError,\n dateMinError,\n } = translations;\n\n const fieldName = configs?.customUpperCode as string;\n\n const defaultFields = { [fieldName]: '' };\n\n if (errorsList[fieldName]) {\n delete errorsList[fieldName];\n }\n\n if (configs?.required && (!value || value === 'false')) {\n return {\n [fieldName]: `${ValidationErrorTypes.REQUIRED_FIELD_ERROR}${ERROR_CONFIG_SEPARATOR}${requiredFieldError}`,\n };\n }\n\n if (!configs?.required && !value) {\n return defaultFields;\n }\n\n if (!configs?.validateRules?.length) return defaultFields;\n\n const validateRulesConfig = flattenObjectsArray(configs?.validateRules);\n\n const min = validateRulesConfig[ConfigEnumLength.MIN_TEXT_LENGTH] ?? 1;\n const max = validateRulesConfig[ConfigEnumLength.MAX_TEXT_LENGTH] ?? 255;\n const dateMin = validateRulesConfig[ConfigEnumLength.DATE_RANGE_MIN];\n const dateMax = validateRulesConfig[ConfigEnumLength.DATE_RANGE_MAX];\n\n if (!validateLength(value, +min, +max) && !(dateMin || dateMax)) {\n const parsedErrorMessage = lengthTextError\n .replace('{min}', min)\n .replace('{max}', max);\n\n return {\n [fieldName]: `${ValidationErrorTypes.LENGTH_TEXT_ERROR}${ERROR_CONFIG_SEPARATOR}${parsedErrorMessage}`,\n };\n }\n\n if (!isDateWithinRange(value, +dateMin, +dateMax) && (dateMin || dateMax)) {\n if (dateMin && dateMin) {\n const parsedErrorMessage = dateRangeError\n .replace('{min}', convertTimestampToDate(dateMin))\n .replace('{max}', convertTimestampToDate(dateMax));\n\n return {\n [fieldName]: `${ValidationErrorTypes.DATE_RANGE_ERROR}${ERROR_CONFIG_SEPARATOR}${parsedErrorMessage}`,\n };\n }\n\n if (typeof dateMin === 'undefined' && typeof dateMax !== 'undefined') {\n const parsedErrorMessage = dateMaxError.replace(\n '{max}',\n convertTimestampToDate(dateMax)\n );\n\n return {\n [fieldName]: `${ValidationErrorTypes.DATE_MAX_ERROR}${ERROR_CONFIG_SEPARATOR}${parsedErrorMessage}`,\n };\n }\n\n if (typeof dateMax === 'undefined' && typeof dateMin !== 'undefined') {\n const parsedErrorMessage = dateMinError.replace(\n '{min}',\n convertTimestampToDate(dateMin)\n );\n\n return {\n [fieldName]: `${ValidationErrorTypes.DATE_MIN_ERROR}${ERROR_CONFIG_SEPARATOR}${parsedErrorMessage}`,\n };\n }\n }\n\n const validationMap = {\n [InputValidation.Numeric]: {\n validate: validateNumeric,\n error: `${ValidationErrorTypes.NUMERIC_ERROR}${ERROR_CONFIG_SEPARATOR}${numericError}`,\n },\n [InputValidation.AlphanumWithSpaces]: {\n validate: validateAlphanumWithSpaces,\n error: `${ValidationErrorTypes.ALPHA_NUM_WITH_SPACES_ERROR}${ERROR_CONFIG_SEPARATOR}${alphaNumWithSpacesError}`,\n },\n [InputValidation.Alphanumeric]: {\n validate: validateAlphanumeric,\n error: `${ValidationErrorTypes.ALPHA_NUMERIC_ERROR}${ERROR_CONFIG_SEPARATOR}${alphaNumericError}`,\n },\n [InputValidation.Alpha]: {\n validate: validateAlpha,\n error: `${ValidationErrorTypes.ALPHA_ERROR}${ERROR_CONFIG_SEPARATOR}${alphaError}`,\n },\n [InputValidation.Email]: {\n validate: validateEmail,\n error: `${ValidationErrorTypes.EMAIL_ERROR}${ERROR_CONFIG_SEPARATOR}${emailError}`,\n },\n [InputValidation.Date]: {\n validate: validateDate,\n error: `${ValidationErrorTypes.DATE_ERROR}${ERROR_CONFIG_SEPARATOR}${dateError}`,\n },\n [InputValidation.Url]: {\n validate: validateUrl,\n error: `${ValidationErrorTypes.URL_ERROR}${ERROR_CONFIG_SEPARATOR}${urlError}`,\n },\n };\n\n const validation =\n validationMap[\n validateRulesConfig['INPUT_VALIDATION'] as keyof typeof validationMap\n ];\n\n if (\n validation &&\n !validation.validate(value) &&\n !errorsList[fieldName]?.length\n ) {\n return { [fieldName]: validation.error };\n }\n\n return defaultFields;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport default (\n fieldsConfig: Array<{\n customUpperCode?: string;\n required?: boolean;\n defaultValue?: unknown;\n }>\n): {\n initialData: Record<string, unknown>;\n errorList: Record<string, string>;\n} => {\n return fieldsConfig.reduce(\n (\n acc: {\n initialData: Record<string, unknown>;\n errorList: Record<string, string>;\n },\n { customUpperCode, required, defaultValue }\n ) => {\n if (required && customUpperCode) {\n acc.initialData[customUpperCode] = defaultValue || '';\n acc.errorList[customUpperCode] = '';\n }\n\n return acc;\n },\n {\n initialData: {},\n errorList: {},\n }\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * This file defines an array of class names that should be excluded\n * from specific init Recaptcha logic.\n *\n * The array contains class names representing elements that should be\n * ignored when certain operations, such as focusing or applying event\n * handlers, are executed.\n *\n * By checking if an element's class matches any class in this array,\n * you can easily bypass unwanted logic for those elements, ensuring\n * precise and predictable behavior in your application.\n *\n */\n\nexport const excludedFocusClasses = [\n 'auth-reset-password-form__buttons--signin',\n 'auth-sign-up-form-buttons--signin',\n 'auth-sign-in-form__button--forgot',\n 'auth-sign-in-form__button--signup',\n];\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useRef, useState, useEffect } from 'preact/hooks';\nimport { FieldsProps, useFormProps } from '@/auth/types';\nimport { initReCaptcha } from '@adobe-commerce/recaptcha';\nimport initializeFormDataAndErrors from '@/auth/lib/initializeFormDataAndErrors';\nimport {\n validationFields,\n ValidationFieldsConfig,\n} from '@/auth/lib/validationFields';\nimport { excludedFocusClasses } from '@/auth/configs/excludedFocusClasses';\nimport { useCustomTranslations } from '@/auth/hooks/useCustomTranslations';\n\nexport const useForm = ({ fieldsConfig, onSubmit }: useFormProps) => {\n /**\n * useCustomTranslations is required to support extensibility of error messages.\n * Ensure all error-related translation paths include \".default\"\n * to allow future handling of dynamic or nested error messages.\n */\n const translations = useCustomTranslations({\n requiredFieldError: 'Auth.FormText.requiredFieldError.default',\n lengthTextError: 'Auth.FormText.lengthTextError.default',\n numericError: 'Auth.FormText.numericError.default',\n alphaNumWithSpacesError: 'Account.FormText.alphaNumWithSpacesError.default',\n alphaNumericError: 'Auth.FormText.alphaNumericError.default',\n alphaError: 'Auth.FormText.alphaError.default',\n emailError: 'Auth.FormText.emailError.default',\n dateError: 'Auth.FormText.dateError.default',\n dateRangeError: 'Auth.FormText.dateRangeError.default',\n dateMaxError: 'Auth.FormText.dateMaxError.default',\n dateMinError: 'Auth.FormText.dateMinError.default',\n urlError: 'Auth.FormText.urlError.default',\n });\n\n const formRef = useRef<HTMLFormElement>(null);\n const focusExecutedRef = useRef<boolean>(false);\n const [formData, setFormData] = useState<\n Record<string, string | boolean | number>\n >({});\n const [errors, setErrors] = useState<Record<string, string>>({});\n\n const handleValidationSubmit = useCallback(() => {\n let formValid = true;\n const errorsList = { ...errors };\n let firstErrorField: string | null = null;\n\n for (const [name, value] of Object.entries(formData)) {\n const fieldConfig = fieldsConfig?.find((config: FieldsProps) =>\n config?.customUpperCode?.includes(name)\n );\n\n const validationResult = validationFields(\n value.toString(),\n fieldConfig as ValidationFieldsConfig,\n translations,\n errorsList\n );\n\n if (validationResult[name]) {\n Object.assign(errorsList, validationResult);\n formValid = false;\n }\n\n if (!firstErrorField) {\n firstErrorField =\n Object.keys(errorsList).find((key) => errorsList[key]) ?? null;\n }\n }\n\n setErrors(errorsList);\n\n if (firstErrorField && formRef.current) {\n const input = formRef.current.elements.namedItem(\n firstErrorField\n ) as HTMLElement;\n input?.focus();\n }\n\n return formValid;\n }, [errors, fieldsConfig, formData, translations]);\n\n useEffect(() => {\n if (fieldsConfig?.length) {\n const { initialData, errorList } =\n initializeFormDataAndErrors(fieldsConfig);\n\n setFormData((prev) => ({\n ...(initialData as Record<string, string | number>),\n ...prev,\n }));\n\n setErrors(errorList);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(fieldsConfig)]);\n\n const handleFocus = useCallback(async (event: FocusEvent) => {\n const target = event.target as HTMLInputElement;\n const isFocusable = !excludedFocusClasses.some((className) =>\n target.classList.contains(className)\n );\n\n if (!focusExecutedRef.current && isFocusable) {\n await initReCaptcha(0);\n focusExecutedRef.current = true;\n }\n }, []);\n\n const handleChange = useCallback(\n (event: Event) => {\n const { name, value, type, checked } = event?.target as HTMLInputElement;\n const fieldValue = type === 'checkbox' ? checked : value;\n\n setFormData((prev) => {\n const updatedFormData = {\n ...prev,\n [name]: fieldValue,\n };\n\n return updatedFormData as Record<string, string | number>;\n });\n\n const fieldConfig = fieldsConfig?.find((config: FieldsProps) =>\n config?.customUpperCode?.includes(name)\n );\n\n let errorsList = { ...errors };\n\n if (fieldConfig) {\n const validationResult = validationFields(\n fieldValue.toString(),\n fieldConfig as ValidationFieldsConfig,\n translations,\n errorsList\n );\n\n if (validationResult) {\n Object.assign(errorsList, validationResult);\n }\n\n setErrors(errorsList);\n }\n },\n [fieldsConfig, errors, translations]\n );\n\n const handleBlur = useCallback(\n (event: Event) => {\n const { name, value, type, checked } = event?.target as HTMLInputElement;\n const fieldValue = type === 'checkbox' ? checked : value;\n\n const fieldConfig = fieldsConfig?.find(\n (config: FieldsProps) => config.customUpperCode === name\n );\n\n if (fieldConfig) {\n const errorsList = { ...errors };\n\n const validationResult = validationFields(\n fieldValue.toString(),\n fieldConfig as ValidationFieldsConfig,\n translations,\n errorsList\n );\n\n if (validationResult) {\n Object.assign(errorsList, validationResult);\n }\n\n setErrors(errorsList);\n }\n },\n [errors, fieldsConfig, translations]\n );\n\n const handleSubmit = useCallback(\n (event: SubmitEvent) => {\n event.preventDefault();\n\n const formValid = handleValidationSubmit();\n\n onSubmit?.(event, formValid);\n },\n [handleValidationSubmit, onSubmit]\n );\n\n return {\n formData,\n errors,\n formRef,\n handleChange,\n handleBlur,\n handleSubmit,\n handleFocus,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport enum FieldEnumList {\n BOOLEAN = 'BOOLEAN',\n DATE = 'DATE',\n DATETIME = 'DATETIME',\n DROPDOWN = 'DROPDOWN',\n FILE = 'FILE',\n GALLERY = 'GALLERY',\n HIDDEN = 'HIDDEN',\n IMAGE = 'IMAGE',\n MEDIA_IMAGE = 'MEDIA_IMAGE',\n MULTILINE = 'MULTILINE',\n MULTISELECT = 'MULTISELECT',\n PRICE = 'PRICE',\n SELECT = 'SELECT',\n TEXT = 'TEXT',\n TEXTAREA = 'TEXTAREA',\n UNDEFINED = 'UNDEFINED',\n VISUAL = 'VISUAL',\n WEIGHT = 'WEIGHT',\n EMPTY = '',\n}\n\nexport interface AttributesFormItemsProps {\n code?: string;\n name?: string;\n id?: string;\n defaultValue?: string | boolean | number;\n entityType?: string;\n className?: string;\n fieldType?: FieldEnumList;\n multilineCount: number;\n required?: boolean;\n unique?: boolean;\n label?: string;\n orderNumber: number;\n options?: { is_default: boolean; label: string; value: string }[];\n hidden?: boolean;\n customUpperCode: string;\n}\n\nexport interface AttributesFormModel extends AttributesFormItemsProps {}\n","import { ERROR_CONFIG_SEPARATOR } from '@/auth/types';\n\ntype ExtractErrorKeyAndMessage = {\n errorKey: string;\n defaultErrorMessage: string;\n};\n\nexport const extractErrorKeyAndMessage = (\n errorConfig: string\n): ExtractErrorKeyAndMessage => {\n const fallbackData = { errorKey: '', defaultErrorMessage: '' };\n\n if (!errorConfig) return fallbackData;\n\n const index = errorConfig.indexOf(ERROR_CONFIG_SEPARATOR);\n\n if (index === -1) return fallbackData;\n\n return {\n errorKey: errorConfig.substring(0, index).trim(),\n defaultErrorMessage: errorConfig\n .substring(index + ERROR_CONFIG_SEPARATOR.length)\n .trim(),\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FieldElementProps } from '@/auth/types';\nimport { Field } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { memo } from 'preact/compat';\nimport { extractErrorKeyAndMessage } from '@/auth/lib/extractErrorKeyAndMessage';\nimport { VNode } from 'preact';\n\nexport const FieldElement = memo(\n ({\n item,\n errorConfig,\n className,\n itemClassName,\n loading,\n children,\n }: FieldElementProps) => {\n const { errorKey, defaultErrorMessage } =\n extractErrorKeyAndMessage(errorConfig);\n const customErrorMessage = useText(\n `Auth.FormText.${errorKey}.${item.code}`\n )[item.code];\n\n let errorMessage = '';\n\n // This check indicates that validation identified an error\n if (defaultErrorMessage.length) {\n errorMessage = customErrorMessage || defaultErrorMessage;\n }\n\n return (\n <Field\n key={item.id}\n error={errorMessage}\n className={classes([\n itemClassName,\n `${itemClassName}--${item.id}`,\n [`${itemClassName}--${item.id}-hidden`, item.isHidden],\n item.className,\n ])}\n data-testid={`${className}--${item.id}`}\n disabled={loading || item.disabled}\n >\n {children as VNode<{}>}\n </Field>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { Input } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const InputElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n onFocus,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <Input\n type=\"text\"\n name={item.customUpperCode}\n value={valueMessage ?? item.defaultValue}\n placeholder={item.label}\n floatingLabel={`${item.label} ${item.required ? '*' : ''}`}\n autocomplete={item.autocomplete}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { Picker } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const SelectElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n const defaultSelectValue = item.options.find(\n (option: { isDefault: boolean; value: string; text: string }) =>\n option.isDefault\n )?.value;\n\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <Picker\n name={item.customUpperCode}\n floatingLabel={`${item.label} ${item.required ? '*' : ''}`}\n placeholder={item.label}\n aria-label={item.label}\n options={item.options}\n onBlur={onBlur}\n handleSelect={onChange}\n defaultValue={defaultSelectValue ?? valueMessage ?? item.defaultValue}\n value={defaultSelectValue ?? valueMessage ?? item.defaultValue}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { InputDate } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const InputDateElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <InputDate\n // @ts-ignore\n type=\"text\"\n name={item.customUpperCode}\n value={valueMessage || item.defaultValue}\n placeholder={item.label}\n floatingLabel={`${item.label} ${item.required ? '*' : ''}`}\n onBlur={onBlur}\n onChange={onChange}\n disabled={loading || item.disabled}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { Checkbox } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const InputCheckBoxElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <Checkbox\n name={item.customUpperCode}\n checked={valueMessage || item.defaultValue}\n placeholder={item.label}\n label={`${item.label} ${item.required ? '*' : ''}`}\n onBlur={onBlur}\n onChange={onChange}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { TextArea } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const TextAreaElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <TextArea\n name={item.customUpperCode}\n value={valueMessage ?? item.defaultValue}\n label={`${item.label} ${item.required ? '*' : ''}`}\n onBlur={onBlur}\n onChange={onChange}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { extractErrorKeyAndMessage } from '@/auth/lib/extractErrorKeyAndMessage';\nimport { FormSlotProps } from '@/auth/types';\nimport { useText } from 'preact-i18n';\nimport { Slot } from '@adobe-commerce/elsie/lib';\n\nexport const FormSlot = ({\n slots,\n item,\n handleOnChange,\n handleOnBlur,\n handleOnFocus,\n errorConfig,\n errors,\n}: FormSlotProps) => {\n const { errorKey, defaultErrorMessage } =\n extractErrorKeyAndMessage(errorConfig);\n const customErrorMessage = useText(`Auth.FormText.${errorKey}.${item.code}`)[\n item.code\n ];\n\n let errorMessage = '';\n\n // This check indicates that validation identified an error\n if (defaultErrorMessage.length) {\n errorMessage = customErrorMessage || defaultErrorMessage;\n }\n\n const contextValue = {\n inputName: item.customUpperCode,\n handleOnChange,\n handleOnBlur,\n handleOnFocus,\n errorMessage,\n errors,\n config: item,\n };\n\n return (\n <Slot\n data-testid={`signUpFormInput_${item.code}`}\n name={`SignUpFormInput_${item.code}`}\n slot={slots?.[`SignUpFormInput_${item.code}`]}\n context={contextValue}\n key={item.id}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FieldsProps, FormProps } from '@/auth/types';\nimport { useForm } from '@/auth/hooks/components/useForm';\nimport { FieldEnumList } from '@/auth/data/models';\nimport {\n SelectElement,\n InputElement,\n InputDateElement,\n InputCheckBoxElement,\n TextAreaElement,\n FormSlot,\n} from './Elements';\nimport { memo } from 'preact/compat';\n\nexport const Form = memo(\n ({\n slots,\n name,\n loading,\n children,\n className = 'defaultForm',\n fieldsConfig = [],\n onSubmit,\n ...props\n }: FormProps) => {\n const {\n formData,\n errors,\n formRef,\n handleChange,\n handleBlur,\n handleSubmit,\n handleFocus,\n } = useForm({\n onSubmit,\n fieldsConfig,\n });\n\n const itemClassName = `${className}__field`;\n\n return (\n <form\n className={className}\n onSubmit={handleSubmit}\n name={name}\n ref={formRef}\n onFocus={handleFocus}\n {...props}\n >\n {fieldsConfig.map((item: FieldsProps) => {\n const errorConfig = errors?.[item.customUpperCode];\n const valueMessage = formData?.[item.customUpperCode] as string;\n const isSlot = !!slots?.[`SignUpFormInput_${item.code}`];\n\n const renderSlot = (\n <FormSlot\n slots={slots}\n item={item}\n handleOnChange={handleChange}\n handleOnBlur={handleBlur}\n handleOnFocus={handleFocus}\n errorConfig={errorConfig}\n errors={errors}\n />\n );\n\n switch (item.fieldType) {\n case FieldEnumList.TEXT: {\n if (isSlot) return renderSlot;\n\n if (item.options.length) {\n return (\n <SelectElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n return (\n <InputElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.MULTILINE: {\n if (isSlot) return renderSlot;\n\n return (\n <InputElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.SELECT: {\n if (isSlot) return renderSlot;\n\n return (\n <SelectElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.DATE: {\n if (isSlot) return renderSlot;\n\n return (\n <InputDateElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.BOOLEAN: {\n if (isSlot) return renderSlot;\n\n return (\n <InputCheckBoxElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.TEXTAREA: {\n if (isSlot) return renderSlot;\n\n return (\n <TextAreaElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n default:\n return null;\n }\n })}\n\n {children}\n </form>\n );\n }\n);\n"],"names":["ValidationErrorTypes","ERROR_CONFIG_SEPARATOR","useCustomTranslations","defaultKeys","translations","useText","keysToUpdate","key","value","translationKeys","acc","updatedTranslations","flattenObjectsArray","arr","obj","validateNumeric","validateAlphanumWithSpaces","validateAlphanumeric","validateAlpha","validateEmail","validateDate","isDateWithinRange","date","minTimestamp","maxTimestamp","dateTimestamp","convertTimestampToDate","timestamp","parsedTimestamp","isoDate","month","validateUrl","url","validateLength","minLength","maxLength","length","validationFields","configs","errorsList","requiredFieldError","lengthTextError","numericError","alphaNumWithSpacesError","alphaNumericError","alphaError","emailError","dateError","urlError","dateRangeError","dateMaxError","dateMinError","fieldName","defaultFields","_a","validateRulesConfig","min","max","dateMin","dateMax","parsedErrorMessage","validation","_b","initializeFormDataAndErrors","fieldsConfig","customUpperCode","required","defaultValue","excludedFocusClasses","useForm","onSubmit","formRef","useRef","focusExecutedRef","formData","setFormData","useState","errors","setErrors","handleValidationSubmit","useCallback","formValid","firstErrorField","name","fieldConfig","config","validationResult","input","useEffect","initialData","errorList","prev","handleFocus","event","target","isFocusable","className","initReCaptcha","handleChange","type","checked","fieldValue","handleBlur","handleSubmit","FieldEnumList","extractErrorKeyAndMessage","errorConfig","fallbackData","index","FieldElement","memo","item","itemClassName","loading","children","errorKey","defaultErrorMessage","customErrorMessage","errorMessage","jsx","Field","classes","InputElement","valueMessage","onBlur","onChange","onFocus","Input","SelectElement","defaultSelectValue","option","Picker","InputDateElement","InputDate","InputCheckBoxElement","Checkbox","TextAreaElement","TextArea","FormSlot","slots","handleOnChange","handleOnBlur","handleOnFocus","contextValue","Slot","Form","props","jsxs","isSlot","renderSlot"],"mappings":"ggBAIY,IAAAA,GAAAA,IACVA,EAAA,qBAAuB,qBACvBA,EAAA,cAAgB,eAChBA,EAAA,4BAA8B,0BAC9BA,EAAA,oBAAsB,oBACtBA,EAAA,YAAc,aACdA,EAAA,YAAc,aACdA,EAAA,WAAa,YACbA,EAAA,iBAAmB,iBACnBA,EAAA,eAAiB,eACjBA,EAAA,eAAiB,eACjBA,EAAA,UAAY,WACZA,EAAA,kBAAoB,kBAZVA,IAAAA,GAAA,CAAA,CAAA,EAqBC,MAAAC,EAAyB,MCCzBC,GACXC,GAC2B,CAKrB,MAAAC,EAAeC,EAAQF,CAAW,EAYlCG,EAAe,OAAO,QAAQF,CAAY,EAC7C,OACC,CAAC,CAACG,EAAKC,CAAK,IACVA,IAAU,MACT,OAAO,OAAOR,CAAoB,EAAe,SAASO,CAAG,GAEjE,IAAI,CAAC,CAACA,CAAG,IAAMA,CAAG,EAOfE,EAAkBH,EAAa,OAAO,CAACI,EAAKH,KAC5CG,EAAAH,CAAG,EAAI,iBAAiBA,CAAG,GACxBG,GACN,EAA4B,EAGzBC,EAAsBN,EAAQI,CAAe,EAO5C,MAAA,CACL,GAAGL,EACH,GAAGE,EAAa,OAA+B,CAACI,EAAKH,KAC/CG,EAAAH,CAAG,EAAII,EAAoBJ,CAAG,EAC3BG,GACN,CAAE,CAAA,CACP,CACF,EC9BME,GAAuBC,GACpBA,EAAI,OAAO,CAACH,EAAKI,KACf,CAAE,GAAGJ,EAAK,CAACI,EAAI,IAAI,EAAGA,EAAI,KAAM,GACtC,EAAE,EAIMC,GAAmBP,GAA2B,QAAQ,KAAKA,CAAK,EAEh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iB,GAAA,CACC,KAAAzB,EACA,aAAAY,EACA,YAAAjB,EACA,OAAQJ,EACR,SAAUJ,EACV,cAAAc,EACA,UAAAhB,EACA,QAAAiB,CAAA,CACF,EAIJ,QACS,OAAA,IAAA,CACX,CACD,EAEAC,CAAA,CAAA,CACH,CAAA,CAGN"}
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["/@dropins/storefront-auth/src/types/validationErrors.types.ts","/@dropins/storefront-auth/src/hooks/useCustomTranslations.tsx","/@dropins/storefront-auth/src/lib/validationFields.ts","/@dropins/storefront-auth/src/lib/initializeFormDataAndErrors.ts","/@dropins/storefront-auth/src/configs/excludedFocusClasses.ts","/@dropins/storefront-auth/src/hooks/components/useForm.tsx","/@dropins/storefront-auth/src/data/models/attributes-form.ts","/@dropins/storefront-auth/src/lib/extractErrorKeyAndMessage.tsx","/@dropins/storefront-auth/src/components/Form/Elements/FieldElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/InputElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/SelectElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/InputDateElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/InputCheckBoxElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/TextAreaElement.tsx","/@dropins/storefront-auth/src/components/Form/Elements/FormSlot.tsx","/@dropins/storefront-auth/src/components/Form/Form.tsx"],"sourcesContent":["/**\n * Error types in this enum are used to provide custom i18n translations for specific validation errors.\n * Each key corresponds to an error type that maps to the `Auth.FormText` i18n values in `src/i18n/en_US.json`.\n */\nexport enum ValidationErrorTypes {\n REQUIRED_FIELD_ERROR = 'requiredFieldError',\n NUMERIC_ERROR = 'numericError',\n ALPHA_NUM_WITH_SPACES_ERROR = 'alphaNumWithSpacesError',\n ALPHA_NUMERIC_ERROR = 'alphaNumericError',\n ALPHA_ERROR = 'alphaError',\n EMAIL_ERROR = 'emailError',\n DATE_ERROR = 'dateError',\n DATE_RANGE_ERROR = 'dateRangeError',\n DATE_MAX_ERROR = 'dateMaxError',\n DATE_MIN_ERROR = 'dateMinError',\n URL_ERROR = 'urlError',\n LENGTH_TEXT_ERROR = 'lengthTextError',\n}\n\n/**\n * `ERROR_CONFIG_SEPARATOR` uses the ASCII 31 (Unit Separator) character,\n * a rarely used control character, to avoid conflicts with custom i18n error messages.\n *\n * Learn more: https://theasciicode.com.ar/ascii-control-characters/unit-separator-ascii-code-31.html\n */\nexport const ERROR_CONFIG_SEPARATOR = `${String.fromCharCode(\n 31\n)}/${String.fromCharCode(31)}`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useText } from 'preact-i18n';\nimport { ValidationErrorTypes } from '@/auth/types';\n\n/**\n * A custom hook for handling translations with support for extensible error messages.\n *\n * @param defaultKeys - A mapping of keys to their translation paths.\n * @returns A complete set of translations, including dynamically updated values for null error keys.\n */\nexport const useCustomTranslations = (\n defaultKeys: Record<string, string>\n): Record<string, string> => {\n /**\n * Step 1: Fetch initial translations using the provided keys\n * Translations are fetched from the i18n system based on the provided defaultKeys.\n */\n const translations = useText(defaultKeys);\n\n /**\n * Step 2: Identify keys that require updates\n * - These keys correspond to validation errors (defined in ValidationErrorTypes).\n * - A key needs an update if:\n * 1. Its value in the initial translations is `null`.\n * 2. The key exists in ValidationErrorTypes (indicating it’s a known error type).\n *\n * Null values typically occur when translations for the given error key are not overridden\n * and instead rely on a plain structure, e.g., \"requiredFieldError\": \"This is a required field.\"\n */\n const keysToUpdate = Object.entries(translations)\n .filter(\n ([key, value]) =>\n value === null &&\n (Object.values(ValidationErrorTypes) as string[]).includes(key)\n )\n .map(([key]) => key);\n\n /**\n * Step 3: Prepare paths for fetching updated translations\n * - For each key needing an update, create a path to its extended translation.\n * - Example: For the key \"requiredFieldError\", the updated path would be \"Auth.FormText.requiredFieldError\".\n */\n const translationKeys = keysToUpdate.reduce((acc, key) => {\n acc[key] = `Auth.FormText.${key}`; // Build the updated translation path\n return acc;\n }, {} as Record<string, string>);\n\n // Step 4: Fetch updated translations for the keys identified in Step 2\n const updatedTranslations = useText(translationKeys);\n\n /**\n * Step 5: Merge updated translations back into the initial translations\n * - Replace `null` values with the fetched updated translations.\n * - Preserve all other original translations.\n */\n return {\n ...translations, // Include original translations\n ...keysToUpdate.reduce<Record<string, string>>((acc, key) => {\n acc[key] = updatedTranslations[key]; // Overwrite `null` values with updated translations\n return acc;\n }, {}),\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { ValidationErrorTypes, ERROR_CONFIG_SEPARATOR } from '@/auth/types';\n\n/* eslint-disable no-useless-escape */\ntype ValidationConfig = Record<string, string>;\ntype TranslationList = Record<string, string>;\ntype ErrorsList = Record<string, string>;\nexport type ValidationFieldsConfig = {\n validateRules: Record<string, string>[];\n code?: string;\n customUpperCode: string;\n required: boolean;\n};\n\nenum ConfigEnumLength {\n MIN_TEXT_LENGTH = 'MIN_TEXT_LENGTH',\n MAX_TEXT_LENGTH = 'MAX_TEXT_LENGTH',\n DATE_RANGE_MIN = 'DATE_RANGE_MIN',\n DATE_RANGE_MAX = 'DATE_RANGE_MAX',\n}\n\nexport enum InputValidation {\n Numeric = 'numeric',\n AlphanumWithSpaces = 'alphanum-with-spaces',\n Alphanumeric = 'alphanumeric',\n Alpha = 'alpha',\n Email = 'email',\n Length = 'length',\n Date = 'date',\n Url = 'url',\n}\n\nconst flattenObjectsArray = (arr: ValidationConfig[]): ValidationConfig => {\n return arr.reduce((acc, obj) => {\n return { ...acc, [obj.name]: obj.value };\n }, {});\n};\n\n//The basic material for the functions responsible for validation was taken from https://github.com/magento/magento2/blob/2.4/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js\nexport const validateNumeric = (value: string): boolean => /^\\d+$/.test(value);\n\nexport const validateAlphanumWithSpaces = (value: string): boolean =>\n /^[a-zA-Z0-9\\s]+$/.test(value);\n\nexport const validateAlphanumeric = (value: string): boolean =>\n /^[a-zA-Z0-9]+$/.test(value);\n\nexport const validateAlpha = (value: string): boolean =>\n /^[a-zA-Z]+$/.test(value);\n\nexport const validateEmail = (value: string): boolean =>\n /^[a-z0-9,!\\#\\$%&'\\*\\+\\/=\\?\\^_`\\{\\|\\}~-]+(\\.[a-z0-9,!\\#\\$%&'\\*\\+\\/=\\?\\^_`\\{\\|\\}~-]+)*@([a-z0-9-]+\\.)+[a-z]{2,}$/i.test(\n value\n );\n\nexport const validateDate = (value: string): boolean =>\n /^\\d{4}-\\d{2}-\\d{2}$/.test(value) && !isNaN(Date.parse(value));\n\nexport const isDateWithinRange = (\n date: string,\n minTimestamp?: number,\n maxTimestamp?: number\n): boolean => {\n const dateTimestamp = new Date(date).getTime() / 1000;\n\n if (isNaN(dateTimestamp) || dateTimestamp < 0) {\n return false;\n }\n\n if (typeof minTimestamp !== 'undefined' && dateTimestamp < minTimestamp) {\n return false;\n }\n\n if (typeof maxTimestamp !== 'undefined' && dateTimestamp > maxTimestamp) {\n return false;\n }\n\n return true;\n};\n\nexport const convertTimestampToDate = (\n timestamp: string | undefined | null\n): string => {\n if (!timestamp || timestamp.trim() === '') return '';\n\n const parsedTimestamp = parseInt(timestamp, 10);\n\n if (!isNaN(parsedTimestamp)) {\n const date = new Date(parsedTimestamp * 1000);\n\n if (isNaN(date.getTime())) return '';\n\n return date.toISOString().split('T')[0];\n }\n\n const isoDate = new Date(timestamp);\n\n if (isNaN(isoDate.getTime())) return '';\n\n const month = parseInt(timestamp.split('-')[1], 10);\n\n if (month > 12 || month < 1) return '';\n\n return isoDate.toISOString().split('T')[0];\n};\n\nexport const validateUrl = (url: string) => {\n const urlPattern =\n /^(https?|ftp):\\/\\/(([A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))(\\.[A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))*)(:(\\d+))?(\\/[A-Z0-9~](([A-Z0-9_~-]|\\.)*[A-Z0-9~]|))*\\/?(.*)?$/i;\n return urlPattern.test(url);\n};\n\nexport const validateLength = (\n value: string,\n minLength: number,\n maxLength: number\n): boolean => {\n const length = value.length;\n return length >= minLength && length <= maxLength;\n};\n\nexport const validationFields = (\n value: string,\n configs: ValidationFieldsConfig,\n translations: TranslationList,\n errorsList: ErrorsList\n) => {\n const {\n requiredFieldError,\n lengthTextError,\n numericError,\n alphaNumWithSpacesError,\n alphaNumericError,\n alphaError,\n emailError,\n dateError,\n urlError,\n dateRangeError,\n dateMaxError,\n dateMinError,\n } = translations;\n\n const fieldName = configs?.customUpperCode as string;\n\n const defaultFields = { [fieldName]: '' };\n\n if (errorsList[fieldName]) {\n delete errorsList[fieldName];\n }\n\n if (configs?.required && (!value || value === 'false')) {\n return {\n [fieldName]: `${ValidationErrorTypes.REQUIRED_FIELD_ERROR}${ERROR_CONFIG_SEPARATOR}${requiredFieldError}`,\n };\n }\n\n if (!configs?.required && !value) {\n return defaultFields;\n }\n\n if (!configs?.validateRules?.length) return defaultFields;\n\n const validateRulesConfig = flattenObjectsArray(configs?.validateRules);\n\n const min = validateRulesConfig[ConfigEnumLength.MIN_TEXT_LENGTH] ?? 1;\n const max = validateRulesConfig[ConfigEnumLength.MAX_TEXT_LENGTH] ?? 255;\n const dateMin = validateRulesConfig[ConfigEnumLength.DATE_RANGE_MIN];\n const dateMax = validateRulesConfig[ConfigEnumLength.DATE_RANGE_MAX];\n\n if (!validateLength(value, +min, +max) && !(dateMin || dateMax)) {\n const parsedErrorMessage = lengthTextError\n .replace('{min}', min)\n .replace('{max}', max);\n\n return {\n [fieldName]: `${ValidationErrorTypes.LENGTH_TEXT_ERROR}${ERROR_CONFIG_SEPARATOR}${parsedErrorMessage}`,\n };\n }\n\n if (!isDateWithinRange(value, +dateMin, +dateMax) && (dateMin || dateMax)) {\n if (dateMin && dateMin) {\n const parsedErrorMessage = dateRangeError\n .replace('{min}', convertTimestampToDate(dateMin))\n .replace('{max}', convertTimestampToDate(dateMax));\n\n return {\n [fieldName]: `${ValidationErrorTypes.DATE_RANGE_ERROR}${ERROR_CONFIG_SEPARATOR}${parsedErrorMessage}`,\n };\n }\n\n if (typeof dateMin === 'undefined' && typeof dateMax !== 'undefined') {\n const parsedErrorMessage = dateMaxError.replace(\n '{max}',\n convertTimestampToDate(dateMax)\n );\n\n return {\n [fieldName]: `${ValidationErrorTypes.DATE_MAX_ERROR}${ERROR_CONFIG_SEPARATOR}${parsedErrorMessage}`,\n };\n }\n\n if (typeof dateMax === 'undefined' && typeof dateMin !== 'undefined') {\n const parsedErrorMessage = dateMinError.replace(\n '{min}',\n convertTimestampToDate(dateMin)\n );\n\n return {\n [fieldName]: `${ValidationErrorTypes.DATE_MIN_ERROR}${ERROR_CONFIG_SEPARATOR}${parsedErrorMessage}`,\n };\n }\n }\n\n const validationMap = {\n [InputValidation.Numeric]: {\n validate: validateNumeric,\n error: `${ValidationErrorTypes.NUMERIC_ERROR}${ERROR_CONFIG_SEPARATOR}${numericError}`,\n },\n [InputValidation.AlphanumWithSpaces]: {\n validate: validateAlphanumWithSpaces,\n error: `${ValidationErrorTypes.ALPHA_NUM_WITH_SPACES_ERROR}${ERROR_CONFIG_SEPARATOR}${alphaNumWithSpacesError}`,\n },\n [InputValidation.Alphanumeric]: {\n validate: validateAlphanumeric,\n error: `${ValidationErrorTypes.ALPHA_NUMERIC_ERROR}${ERROR_CONFIG_SEPARATOR}${alphaNumericError}`,\n },\n [InputValidation.Alpha]: {\n validate: validateAlpha,\n error: `${ValidationErrorTypes.ALPHA_ERROR}${ERROR_CONFIG_SEPARATOR}${alphaError}`,\n },\n [InputValidation.Email]: {\n validate: validateEmail,\n error: `${ValidationErrorTypes.EMAIL_ERROR}${ERROR_CONFIG_SEPARATOR}${emailError}`,\n },\n [InputValidation.Date]: {\n validate: validateDate,\n error: `${ValidationErrorTypes.DATE_ERROR}${ERROR_CONFIG_SEPARATOR}${dateError}`,\n },\n [InputValidation.Url]: {\n validate: validateUrl,\n error: `${ValidationErrorTypes.URL_ERROR}${ERROR_CONFIG_SEPARATOR}${urlError}`,\n },\n };\n\n const validation =\n validationMap[\n validateRulesConfig['INPUT_VALIDATION'] as keyof typeof validationMap\n ];\n\n if (\n validation &&\n !validation.validate(value) &&\n !errorsList[fieldName]?.length\n ) {\n return { [fieldName]: validation.error };\n }\n\n return defaultFields;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport default (\n fieldsConfig: Array<{\n customUpperCode?: string;\n required?: boolean;\n defaultValue?: unknown;\n }>\n): {\n initialData: Record<string, unknown>;\n errorList: Record<string, string>;\n} => {\n return fieldsConfig.reduce(\n (\n acc: {\n initialData: Record<string, unknown>;\n errorList: Record<string, string>;\n },\n { customUpperCode, required, defaultValue }\n ) => {\n if (required && customUpperCode) {\n acc.initialData[customUpperCode] = defaultValue || '';\n acc.errorList[customUpperCode] = '';\n }\n\n return acc;\n },\n {\n initialData: {},\n errorList: {},\n }\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * This file defines an array of class names that should be excluded\n * from specific init Recaptcha logic.\n *\n * The array contains class names representing elements that should be\n * ignored when certain operations, such as focusing or applying event\n * handlers, are executed.\n *\n * By checking if an element's class matches any class in this array,\n * you can easily bypass unwanted logic for those elements, ensuring\n * precise and predictable behavior in your application.\n *\n */\n\nexport const excludedFocusClasses = [\n 'auth-reset-password-form__buttons--signin',\n 'auth-sign-up-form-buttons--signin',\n 'auth-sign-in-form__button--forgot',\n 'auth-sign-in-form__button--signup',\n];\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useRef, useState, useEffect } from 'preact/hooks';\nimport { FieldsProps, useFormProps } from '@/auth/types';\nimport { initReCaptcha } from '@adobe-commerce/recaptcha';\nimport initializeFormDataAndErrors from '@/auth/lib/initializeFormDataAndErrors';\nimport {\n validationFields,\n ValidationFieldsConfig,\n} from '@/auth/lib/validationFields';\nimport { excludedFocusClasses } from '@/auth/configs/excludedFocusClasses';\nimport { useCustomTranslations } from '@/auth/hooks/useCustomTranslations';\n\nexport const useForm = ({ fieldsConfig, onSubmit }: useFormProps) => {\n /**\n * useCustomTranslations is required to support extensibility of error messages.\n * Ensure all error-related translation paths include \".default\"\n * to allow future handling of dynamic or nested error messages.\n */\n const translations = useCustomTranslations({\n requiredFieldError: 'Auth.FormText.requiredFieldError.default',\n lengthTextError: 'Auth.FormText.lengthTextError.default',\n numericError: 'Auth.FormText.numericError.default',\n alphaNumWithSpacesError: 'Account.FormText.alphaNumWithSpacesError.default',\n alphaNumericError: 'Auth.FormText.alphaNumericError.default',\n alphaError: 'Auth.FormText.alphaError.default',\n emailError: 'Auth.FormText.emailError.default',\n dateError: 'Auth.FormText.dateError.default',\n dateRangeError: 'Auth.FormText.dateRangeError.default',\n dateMaxError: 'Auth.FormText.dateMaxError.default',\n dateMinError: 'Auth.FormText.dateMinError.default',\n urlError: 'Auth.FormText.urlError.default',\n });\n\n const formRef = useRef<HTMLFormElement>(null);\n const focusExecutedRef = useRef<boolean>(false);\n const [formData, setFormData] = useState<\n Record<string, string | boolean | number>\n >({});\n const [errors, setErrors] = useState<Record<string, string>>({});\n\n const handleValidationSubmit = useCallback(() => {\n let formValid = true;\n const errorsList = { ...errors };\n let firstErrorField: string | null = null;\n\n for (const [name, value] of Object.entries(formData)) {\n const fieldConfig = fieldsConfig?.find((config: FieldsProps) =>\n config?.customUpperCode?.includes(name)\n );\n\n const validationResult = validationFields(\n value.toString(),\n fieldConfig as ValidationFieldsConfig,\n translations,\n errorsList\n );\n\n if (validationResult[name]) {\n Object.assign(errorsList, validationResult);\n formValid = false;\n }\n\n if (!firstErrorField) {\n firstErrorField =\n Object.keys(errorsList).find((key) => errorsList[key]) ?? null;\n }\n }\n\n setErrors(errorsList);\n\n if (firstErrorField && formRef.current) {\n const input = formRef.current.elements.namedItem(\n firstErrorField\n ) as HTMLElement;\n input?.focus();\n }\n\n return formValid;\n }, [errors, fieldsConfig, formData, translations]);\n\n useEffect(() => {\n if (fieldsConfig?.length) {\n const { initialData, errorList } =\n initializeFormDataAndErrors(fieldsConfig);\n\n setFormData((prev) => ({\n ...(initialData as Record<string, string | number>),\n ...prev,\n }));\n\n setErrors(errorList);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(fieldsConfig)]);\n\n const handleFocus = useCallback(async (event: FocusEvent) => {\n const target = event.target as HTMLInputElement;\n const isFocusable = !excludedFocusClasses.some((className) =>\n target.classList.contains(className)\n );\n\n if (!focusExecutedRef.current && isFocusable) {\n await initReCaptcha(0);\n focusExecutedRef.current = true;\n }\n }, []);\n\n const handleChange = useCallback(\n (event: Event) => {\n const { name, value, type, checked } = event?.target as HTMLInputElement;\n const fieldValue = type === 'checkbox' ? checked : value;\n\n setFormData((prev) => {\n const updatedFormData = {\n ...prev,\n [name]: fieldValue,\n };\n\n return updatedFormData as Record<string, string | number>;\n });\n\n const fieldConfig = fieldsConfig?.find((config: FieldsProps) =>\n config?.customUpperCode?.includes(name)\n );\n\n let errorsList = { ...errors };\n\n if (fieldConfig) {\n const validationResult = validationFields(\n fieldValue.toString(),\n fieldConfig as ValidationFieldsConfig,\n translations,\n errorsList\n );\n\n if (validationResult) {\n Object.assign(errorsList, validationResult);\n }\n\n setErrors(errorsList);\n }\n },\n [fieldsConfig, errors, translations]\n );\n\n const handleBlur = useCallback(\n (event: Event) => {\n const { name, value, type, checked } = event?.target as HTMLInputElement;\n const fieldValue = type === 'checkbox' ? checked : value;\n\n const fieldConfig = fieldsConfig?.find(\n (config: FieldsProps) => config.customUpperCode === name\n );\n\n if (fieldConfig) {\n const errorsList = { ...errors };\n\n const validationResult = validationFields(\n fieldValue.toString(),\n fieldConfig as ValidationFieldsConfig,\n translations,\n errorsList\n );\n\n if (validationResult) {\n Object.assign(errorsList, validationResult);\n }\n\n setErrors(errorsList);\n }\n },\n [errors, fieldsConfig, translations]\n );\n\n const handleSubmit = useCallback(\n (event: SubmitEvent) => {\n event.preventDefault();\n\n const formValid = handleValidationSubmit();\n\n onSubmit?.(event, formValid);\n },\n [handleValidationSubmit, onSubmit]\n );\n\n return {\n formData,\n errors,\n formRef,\n handleChange,\n handleBlur,\n handleSubmit,\n handleFocus,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport enum FieldEnumList {\n BOOLEAN = 'BOOLEAN',\n DATE = 'DATE',\n DATETIME = 'DATETIME',\n DROPDOWN = 'DROPDOWN',\n FILE = 'FILE',\n GALLERY = 'GALLERY',\n HIDDEN = 'HIDDEN',\n IMAGE = 'IMAGE',\n MEDIA_IMAGE = 'MEDIA_IMAGE',\n MULTILINE = 'MULTILINE',\n MULTISELECT = 'MULTISELECT',\n PRICE = 'PRICE',\n SELECT = 'SELECT',\n TEXT = 'TEXT',\n TEXTAREA = 'TEXTAREA',\n UNDEFINED = 'UNDEFINED',\n VISUAL = 'VISUAL',\n WEIGHT = 'WEIGHT',\n EMPTY = '',\n}\n\nexport interface AttributesFormItemsProps {\n code?: string;\n name?: string;\n id?: string;\n defaultValue?: string | boolean | number;\n entityType?: string;\n className?: string;\n fieldType?: FieldEnumList;\n multilineCount: number;\n required?: boolean;\n unique?: boolean;\n label?: string;\n orderNumber: number;\n options?: { is_default: boolean; label: string; value: string }[];\n hidden?: boolean;\n customUpperCode: string;\n}\n\nexport interface AttributesFormModel extends AttributesFormItemsProps {}\n","import { ERROR_CONFIG_SEPARATOR } from '@/auth/types';\n\ntype ExtractErrorKeyAndMessage = {\n errorKey: string;\n defaultErrorMessage: string;\n};\n\nexport const extractErrorKeyAndMessage = (\n errorConfig: string\n): ExtractErrorKeyAndMessage => {\n const fallbackData = { errorKey: '', defaultErrorMessage: '' };\n\n if (!errorConfig) return fallbackData;\n\n const index = errorConfig.indexOf(ERROR_CONFIG_SEPARATOR);\n\n if (index === -1) return fallbackData;\n\n return {\n errorKey: errorConfig.substring(0, index).trim(),\n defaultErrorMessage: errorConfig\n .substring(index + ERROR_CONFIG_SEPARATOR.length)\n .trim(),\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FieldElementProps } from '@/auth/types';\nimport { Field } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { memo } from 'preact/compat';\nimport { extractErrorKeyAndMessage } from '@/auth/lib/extractErrorKeyAndMessage';\nimport { VNode } from 'preact';\n\nexport const FieldElement = memo(\n ({\n item,\n errorConfig,\n className,\n itemClassName,\n loading,\n children,\n }: FieldElementProps) => {\n const { errorKey, defaultErrorMessage } =\n extractErrorKeyAndMessage(errorConfig);\n const customErrorMessage = useText(\n `Auth.FormText.${errorKey}.${item.code}`\n )[item.code];\n\n let errorMessage = '';\n\n // This check indicates that validation identified an error\n if (defaultErrorMessage.length) {\n errorMessage = customErrorMessage || defaultErrorMessage;\n }\n\n return (\n <Field\n key={item.id}\n error={errorMessage}\n className={classes([\n itemClassName,\n `${itemClassName}--${item.id}`,\n [`${itemClassName}--${item.id}-hidden`, item.isHidden],\n item.className,\n ])}\n data-testid={`${className}--${item.id}`}\n disabled={loading || item.disabled}\n >\n {children as VNode<{}>}\n </Field>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { Input } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const InputElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n onFocus,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <Input\n type=\"text\"\n name={item.customUpperCode}\n value={valueMessage ?? item.defaultValue}\n placeholder={item.label}\n floatingLabel={`${item.label} ${item.required ? '*' : ''}`}\n autocomplete={item.autocomplete}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { Picker } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const SelectElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n const defaultSelectValue = item.options.find(\n (option: { isDefault: boolean; value: string; text: string }) =>\n option.isDefault\n )?.value;\n\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <Picker\n name={item.customUpperCode}\n floatingLabel={`${item.label} ${item.required ? '*' : ''}`}\n placeholder={item.label}\n aria-label={item.label}\n options={item.options}\n onBlur={onBlur}\n handleSelect={onChange}\n defaultValue={defaultSelectValue ?? valueMessage ?? item.defaultValue}\n value={defaultSelectValue ?? valueMessage ?? item.defaultValue}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { InputDate } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const InputDateElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <InputDate\n // @ts-ignore\n type=\"text\"\n name={item.customUpperCode}\n value={valueMessage || item.defaultValue}\n placeholder={item.label}\n floatingLabel={`${item.label} ${item.required ? '*' : ''}`}\n onBlur={onBlur}\n onChange={onChange}\n disabled={loading || item.disabled}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { Checkbox } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const InputCheckBoxElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <Checkbox\n name={item.customUpperCode}\n checked={valueMessage || item.defaultValue}\n placeholder={item.label}\n label={`${item.label} ${item.required ? '*' : ''}`}\n onBlur={onBlur}\n onChange={onChange}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FormElementProps } from '@/auth/types';\nimport { TextArea } from '@adobe-commerce/elsie/components';\nimport { memo } from 'preact/compat';\nimport { FieldElement } from './FieldElement';\n\nexport const TextAreaElement = memo(\n ({\n item,\n valueMessage,\n errorConfig,\n onBlur,\n onChange,\n className,\n itemClassName,\n loading,\n }: FormElementProps) => {\n return (\n <FieldElement\n item={item}\n errorConfig={errorConfig}\n className={className}\n itemClassName={itemClassName}\n loading={loading}\n >\n <TextArea\n name={item.customUpperCode}\n value={valueMessage ?? item.defaultValue}\n label={`${item.label} ${item.required ? '*' : ''}`}\n onBlur={onBlur}\n onChange={onChange}\n />\n </FieldElement>\n );\n }\n);\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { extractErrorKeyAndMessage } from '@/auth/lib/extractErrorKeyAndMessage';\nimport { FormSlotProps } from '@/auth/types';\nimport { useText } from 'preact-i18n';\nimport { Slot } from '@adobe-commerce/elsie/lib';\n\nexport const FormSlot = ({\n slots,\n item,\n handleOnChange,\n handleOnBlur,\n handleOnFocus,\n errorConfig,\n errors,\n}: FormSlotProps) => {\n const { errorKey, defaultErrorMessage } =\n extractErrorKeyAndMessage(errorConfig);\n const customErrorMessage = useText(`Auth.FormText.${errorKey}.${item.code}`)[\n item.code\n ];\n\n let errorMessage = '';\n\n // This check indicates that validation identified an error\n if (defaultErrorMessage.length) {\n errorMessage = customErrorMessage || defaultErrorMessage;\n }\n\n const contextValue = {\n inputName: item.customUpperCode,\n handleOnChange,\n handleOnBlur,\n handleOnFocus,\n errorMessage,\n errors,\n config: item,\n };\n\n return (\n <Slot\n data-testid={`signUpFormInput_${item.code}`}\n name={`SignUpFormInput_${item.code}`}\n slot={slots?.[`SignUpFormInput_${item.code}`]}\n context={contextValue}\n key={item.id}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FieldsProps, FormProps } from '@/auth/types';\nimport { useForm } from '@/auth/hooks/components/useForm';\nimport { FieldEnumList } from '@/auth/data/models';\nimport {\n SelectElement,\n InputElement,\n InputDateElement,\n InputCheckBoxElement,\n TextAreaElement,\n FormSlot,\n} from './Elements';\nimport { memo } from 'preact/compat';\n\nexport const Form = memo(\n ({\n slots,\n name,\n loading,\n children,\n className = 'defaultForm',\n fieldsConfig = [],\n onSubmit,\n ...props\n }: FormProps) => {\n const {\n formData,\n errors,\n formRef,\n handleChange,\n handleBlur,\n handleSubmit,\n handleFocus,\n } = useForm({\n onSubmit,\n fieldsConfig,\n });\n\n const itemClassName = `${className}__field`;\n\n return (\n <form\n className={className}\n onSubmit={handleSubmit}\n name={name}\n ref={formRef}\n onFocus={handleFocus}\n {...props}\n >\n {fieldsConfig.map((item: FieldsProps) => {\n const errorConfig = errors?.[item.customUpperCode];\n const valueMessage = formData?.[item.customUpperCode] as string;\n const isSlot = !!slots?.[`SignUpFormInput_${item.code}`];\n\n const renderSlot = (\n <FormSlot\n slots={slots}\n item={item}\n handleOnChange={handleChange}\n handleOnBlur={handleBlur}\n handleOnFocus={handleFocus}\n errorConfig={errorConfig}\n errors={errors}\n />\n );\n\n switch (item.fieldType) {\n case FieldEnumList.TEXT: {\n if (isSlot) return renderSlot;\n\n if (item.options.length) {\n return (\n <SelectElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n return (\n <InputElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.MULTILINE: {\n if (isSlot) return renderSlot;\n\n return (\n <InputElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.SELECT: {\n if (isSlot) return renderSlot;\n\n return (\n <SelectElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.DATE: {\n if (isSlot) return renderSlot;\n\n return (\n <InputDateElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.BOOLEAN: {\n if (isSlot) return renderSlot;\n\n return (\n <InputCheckBoxElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n case FieldEnumList.TEXTAREA: {\n if (isSlot) return renderSlot;\n\n return (\n <TextAreaElement\n item={item}\n valueMessage={valueMessage}\n errorConfig={errorConfig}\n onBlur={handleBlur}\n onChange={handleChange}\n itemClassName={itemClassName}\n className={className}\n loading={loading}\n />\n );\n }\n\n default:\n return null;\n }\n })}\n\n {children}\n </form>\n );\n }\n);\n"],"names":["ValidationErrorTypes","ERROR_CONFIG_SEPARATOR","useCustomTranslations","defaultKeys","translations","useText","keysToUpdate","key","value","translationKeys","acc","updatedTranslations","flattenObjectsArray","arr","obj","validateNumeric","validateAlphanumWithSpaces","validateAlphanumeric","validateAlpha","validateEmail","validateDate","isDateWithinRange","date","minTimestamp","maxTimestamp","dateTimestamp","convertTimestampToDate","timestamp","parsedTimestamp","isoDate","month","validateUrl","url","validateLength","minLength","maxLength","length","validationFields","configs","errorsList","requiredFieldError","lengthTextError","numericError","alphaNumWithSpacesError","alphaNumericError","alphaError","emailError","dateError","urlError","dateRangeError","dateMaxError","dateMinError","fieldName","defaultFields","_a","validateRulesConfig","min","max","dateMin","dateMax","parsedErrorMessage","validation","_b","initializeFormDataAndErrors","fieldsConfig","customUpperCode","required","defaultValue","excludedFocusClasses","useForm","onSubmit","formRef","useRef","focusExecutedRef","formData","setFormData","useState","errors","setErrors","handleValidationSubmit","useCallback","formValid","firstErrorField","name","fieldConfig","config","validationResult","input","useEffect","initialData","errorList","prev","handleFocus","event","target","isFocusable","className","initReCaptcha","handleChange","type","checked","fieldValue","handleBlur","handleSubmit","FieldEnumList","extractErrorKeyAndMessage","errorConfig","fallbackData","index","FieldElement","memo","item","itemClassName","loading","children","errorKey","defaultErrorMessage","customErrorMessage","errorMessage","jsx","Field","classes","InputElement","valueMessage","onBlur","onChange","onFocus","Input","SelectElement","defaultSelectValue","option","Picker","InputDateElement","InputDate","InputCheckBoxElement","Checkbox","TextAreaElement","TextArea","FormSlot","slots","handleOnChange","handleOnBlur","handleOnFocus","contextValue","Slot","Form","props","jsxs","isSlot","renderSlot"],"mappings":"ggBAIO,IAAKA,GAAAA,IACVA,EAAA,qBAAuB,qBACvBA,EAAA,cAAgB,eAChBA,EAAA,4BAA8B,0BAC9BA,EAAA,oBAAsB,oBACtBA,EAAA,YAAc,aACdA,EAAA,YAAc,aACdA,EAAA,WAAa,YACbA,EAAA,iBAAmB,iBACnBA,EAAA,eAAiB,eACjBA,EAAA,eAAiB,eACjBA,EAAA,UAAY,WACZA,EAAA,kBAAoB,kBAZVA,IAAAA,GAAA,CAAA,CAAA,EAqBL,MAAMC,EAAyB,MCCzBC,GACXC,GAC2B,CAK3B,MAAMC,EAAeC,EAAQF,CAAW,EAYlCG,EAAe,OAAO,QAAQF,CAAY,EAC7C,OACC,CAAC,CAACG,EAAKC,CAAK,IACVA,IAAU,MACT,OAAO,OAAOR,CAAoB,EAAe,SAASO,CAAG,CAAA,EAEjE,IAAI,CAAC,CAACA,CAAG,IAAMA,CAAG,EAOfE,EAAkBH,EAAa,OAAO,CAACI,EAAKH,KAChDG,EAAIH,CAAG,EAAI,iBAAiBA,C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AA,EAKN,KAAKT,EAAc,KACjB,OAAI4C,EAAeC,EAGjB9B,EAACa,GAAA,CACC,KAAArB,EACA,aAAAY,EACA,YAAAjB,EACA,OAAQJ,EACR,SAAUJ,EACV,cAAAc,EACA,UAAAhB,EACA,QAAAiB,CAAA,CAAA,EAKN,KAAKT,EAAc,QACjB,OAAI4C,EAAeC,EAGjB9B,EAACe,GAAA,CACC,KAAAvB,EACA,aAAAY,EACA,YAAAjB,EACA,OAAQJ,EACR,SAAUJ,EACV,cAAAc,EACA,UAAAhB,EACA,QAAAiB,CAAA,CAAA,EAKN,KAAKT,EAAc,SACjB,OAAI4C,EAAeC,EAGjB9B,EAACiB,GAAA,CACC,KAAAzB,EACA,aAAAY,EACA,YAAAjB,EACA,OAAQJ,EACR,SAAUJ,EACV,cAAAc,EACA,UAAAhB,EACA,QAAAiB,CAAA,CAAA,EAKN,QACE,OAAO,IAAA,CAEb,CAAC,EAEAC,CAAA,CAAA,CAAA,CAGP,CACF"}
|
package/chunks/Button2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button2.js","sources":["/@dropins/storefront-auth/src/lib/getFormValues.ts","/@dropins/storefront-auth/src/lib/checkIsFunction.ts","../../node_modules/@adobe-commerce/elsie/src/icons/Warning.svg","../../node_modules/@adobe-commerce/elsie/src/icons/CheckWithCircle.svg","../../node_modules/@adobe-commerce/elsie/src/icons/WarningWithCircle.svg","/@dropins/storefront-auth/src/hooks/useInLineAlert.tsx","/@dropins/storefront-auth/src/components/Button/Button.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const getFormValues = (form: any) => {\n if (!form) return null;\n\n const formData = new FormData(form);\n\n if (formData && typeof formData.entries === 'function') {\n const entries = formData.entries();\n if (entries && typeof entries[Symbol.iterator] === 'function') {\n return JSON.parse(JSON.stringify(Object.fromEntries(entries))) || {};\n }\n }\n return {};\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const checkIsFunction = (value: any): value is Function => {\n return typeof value === 'function';\n};\n","import * as React from \"react\";\nconst SvgWarning = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Warning_Base\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_841_1324)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_841_1324\" }, /* @__PURE__ */ React.createElement(\"rect\", { width: 24, height: 21, fill: \"white\", transform: \"translate(0 1.5)\" }))));\nexport default SvgWarning;\n","import * as React from \"react\";\nconst SvgCheckWithCircle = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M6.75 12.762L10.2385 15.75L17.25 9\", stroke: \"currentColor\" }));\nexport default SvgCheckWithCircle;\n","import * as React from \"react\";\nconst SvgWarningWithCircle = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z\", stroke: \"currentColor\" }));\nexport default SvgWarningWithCircle;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { InLineAlertInterface } from '../types';\nimport {\n CheckWithCircle as Success,\n Warning,\n WarningWithCircle as Error,\n} from '@adobe-commerce/elsie/icons';\n\nconst iconsList = {\n success: <Success />,\n warning: <Warning />,\n error: <Error />,\n};\n\nexport const useInLineAlert = () => {\n const [inLineAlertProps, setInLineAlertProps] =\n useState<InLineAlertInterface>({});\n\n const handleSetInLineAlertProps = useCallback(\n (notification: InLineAlertInterface | undefined) => {\n if (!notification || !notification.type) {\n setInLineAlertProps({});\n return;\n }\n\n const icon = iconsList[notification.type];\n\n setInLineAlertProps({\n ...notification,\n icon,\n });\n },\n []\n );\n\n return { inLineAlertProps, handleSetInLineAlertProps };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useCallback } from 'preact/hooks';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Button as ElsieButton } from '@adobe-commerce/elsie/components';\nimport '@/auth/components/Button/Button.css';\n\nexport interface ButtonProps {\n type: 'submit' | 'button';\n variant?: 'primary' | 'secondary' | 'tertiary';\n className?: string;\n buttonText: string;\n enableLoader?: boolean;\n onClick?: (event: MouseEvent) => void;\n style?: Record<string, string | number>;\n icon?: VNode<HTMLAttributes<SVGSVGElement>>;\n disabled?: boolean;\n}\n\nexport const Button: FunctionComponent<ButtonProps> = ({\n type,\n buttonText,\n variant,\n className = '',\n enableLoader = false,\n onClick,\n style,\n icon,\n ...props\n}) => {\n const handleOnclick = useCallback(\n (event: MouseEvent) => {\n onClick?.(event);\n },\n [onClick]\n );\n\n const isLoader = enableLoader ? 'enableLoader' : '';\n\n return (\n <ElsieButton\n icon={icon}\n style={style}\n type={type}\n variant={variant}\n className={classes(['auth-button', className, isLoader])}\n onClick={handleOnclick}\n {...props}\n >\n <span className=\"auth-button__text\">{buttonText}</span>\n {enableLoader ? (\n <div className=\"auth-button__wrapper\">\n <span className=\"auth-button__loader\" />\n </div>\n ) : null}\n </ElsieButton>\n );\n};\n"],"names":["getFormValues","form","formData","entries","checkIsFunction","value","SvgWarning","props","React","SvgCheckWithCircle","SvgWarningWithCircle","iconsList","Success","Warning","Error","useInLineAlert","inLineAlertProps","setInLineAlertProps","useState","handleSetInLineAlertProps","useCallback","notification","icon","Button","type","buttonText","variant","className","enableLoader","onClick","style","handleOnclick","event","jsxs","ElsieButton","classes","jsx"],"mappings":"4TAiBa,MAAAA,EAAiBC,GAAc,CACtC,GAAA,CAACA,EAAa,OAAA,KAEZ,MAAAC,EAAW,IAAI,SAASD,CAAI,EAElC,GAAIC,GAAY,OAAOA,EAAS,SAAY,WAAY,CAChD,MAAAC,EAAUD,EAAS,QAAQ,EACjC,GAAIC,GAAW,OAAOA,EAAQ,OAAO,QAAQ,GAAM,WAC1C,OAAA,KAAK,MAAM,KAAK,UAAU,OAAO,YAAYA,CAAO,CAAC,CAAC,GAAK,CAAC,CACrE,CAEF,MAAO,CAAC,CACV,ECZaC,EAAmBC,GACvB,OAAOA,GAAU,WCjBpBC,EAAcC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,oBAAqB,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAO,EAAkBC,EAAM,cAAc,IAAK,CAAE,SAAU,wBAA0CA,EAAM,cAAc,OAAQ,CAAE,a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J,EAAoB,CAAA,CAAE,EACtB,MAAA,CAGI,MAAAK,EAAOX,EAAUU,EAAa,IAAI,EAEpBJ,EAAA,CAClB,GAAGI,EACH,KAAAC,CAAA,CACD,CACH,EACA,CAAA,CACF,EAEO,MAAA,CAAE,iBAAAN,EAAkB,0BAAAG,CAA0B,CACvD,ECjBaI,EAAyC,CAAC,CACrD,KAAAC,EACA,WAAAC,EACA,QAAAC,EACA,UAAAC,EAAY,GACZ,aAAAC,EAAe,GACf,QAAAC,EACA,MAAAC,EACA,KAAAR,EACA,GAAGf,CACL,IAAM,CACJ,MAAMwB,EAAgBX,EACnBY,GAAsB,CACrBH,GAAA,MAAAA,EAAUG,EACZ,EACA,CAACH,CAAO,CACV,EAKE,OAAAI,EAACC,EAAA,CACC,KAAAZ,EACA,MAAAQ,EACA,KAAAN,EACA,QAAAE,EACA,UAAWS,EAAQ,CAAC,cAAeR,EARtBC,EAAe,eAAiB,EAQS,CAAC,EACvD,QAASG,EACR,GAAGxB,EAEJ,SAAA,CAAC6B,EAAA,OAAA,CAAK,UAAU,oBAAqB,SAAWX,EAAA,EAC/CG,EACEQ,EAAA,MAAA,CAAI,UAAU,uBACb,WAAC,OAAK,CAAA,UAAU,qBAAsB,CAAA,CACxC,CAAA,EACE,IAAA,CAAA,CACN,CAEJ","x_google_ignoreList":[2,3,4]}
|
|
1
|
+
{"version":3,"file":"Button2.js","sources":["/@dropins/storefront-auth/src/lib/getFormValues.ts","/@dropins/storefront-auth/src/lib/checkIsFunction.ts","../../node_modules/@adobe-commerce/elsie/src/icons/Warning.svg","../../node_modules/@adobe-commerce/elsie/src/icons/CheckWithCircle.svg","../../node_modules/@adobe-commerce/elsie/src/icons/WarningWithCircle.svg","/@dropins/storefront-auth/src/hooks/useInLineAlert.tsx","/@dropins/storefront-auth/src/components/Button/Button.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const getFormValues = (form: any) => {\n if (!form) return null;\n\n const formData = new FormData(form);\n\n if (formData && typeof formData.entries === 'function') {\n const entries = formData.entries();\n if (entries && typeof entries[Symbol.iterator] === 'function') {\n return JSON.parse(JSON.stringify(Object.fromEntries(entries))) || {};\n }\n }\n return {};\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const checkIsFunction = (value: any): value is Function => {\n return typeof value === 'function';\n};\n","import * as React from \"react\";\nconst SvgWarning = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Warning_Base\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_841_1324)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_841_1324\" }, /* @__PURE__ */ React.createElement(\"rect\", { width: 24, height: 21, fill: \"white\", transform: \"translate(0 1.5)\" }))));\nexport default SvgWarning;\n","import * as React from \"react\";\nconst SvgCheckWithCircle = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M6.75 12.762L10.2385 15.75L17.25 9\", stroke: \"currentColor\" }));\nexport default SvgCheckWithCircle;\n","import * as React from \"react\";\nconst SvgWarningWithCircle = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z\", stroke: \"currentColor\" }));\nexport default SvgWarningWithCircle;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { InLineAlertInterface } from '../types';\nimport {\n CheckWithCircle as Success,\n Warning,\n WarningWithCircle as Error,\n} from '@adobe-commerce/elsie/icons';\n\nconst iconsList = {\n success: <Success />,\n warning: <Warning />,\n error: <Error />,\n};\n\nexport const useInLineAlert = () => {\n const [inLineAlertProps, setInLineAlertProps] =\n useState<InLineAlertInterface>({});\n\n const handleSetInLineAlertProps = useCallback(\n (notification: InLineAlertInterface | undefined) => {\n if (!notification || !notification.type) {\n setInLineAlertProps({});\n return;\n }\n\n const icon = iconsList[notification.type];\n\n setInLineAlertProps({\n ...notification,\n icon,\n });\n },\n []\n );\n\n return { inLineAlertProps, handleSetInLineAlertProps };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useCallback } from 'preact/hooks';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Button as ElsieButton } from '@adobe-commerce/elsie/components';\nimport '@/auth/components/Button/Button.css';\n\nexport interface ButtonProps {\n type: 'submit' | 'button';\n variant?: 'primary' | 'secondary' | 'tertiary';\n className?: string;\n buttonText: string;\n enableLoader?: boolean;\n onClick?: (event: MouseEvent) => void;\n style?: Record<string, string | number>;\n icon?: VNode<HTMLAttributes<SVGSVGElement>>;\n disabled?: boolean;\n}\n\nexport const Button: FunctionComponent<ButtonProps> = ({\n type,\n buttonText,\n variant,\n className = '',\n enableLoader = false,\n onClick,\n style,\n icon,\n ...props\n}) => {\n const handleOnclick = useCallback(\n (event: MouseEvent) => {\n onClick?.(event);\n },\n [onClick]\n );\n\n const isLoader = enableLoader ? 'enableLoader' : '';\n\n return (\n <ElsieButton\n icon={icon}\n style={style}\n type={type}\n variant={variant}\n className={classes(['auth-button', className, isLoader])}\n onClick={handleOnclick}\n {...props}\n >\n <span className=\"auth-button__text\">{buttonText}</span>\n {enableLoader ? (\n <div className=\"auth-button__wrapper\">\n <span className=\"auth-button__loader\" />\n </div>\n ) : null}\n </ElsieButton>\n );\n};\n"],"names":["getFormValues","form","formData","entries","checkIsFunction","value","SvgWarning","props","React","SvgCheckWithCircle","SvgWarningWithCircle","iconsList","Success","Warning","Error","useInLineAlert","inLineAlertProps","setInLineAlertProps","useState","handleSetInLineAlertProps","useCallback","notification","icon","Button","type","buttonText","variant","className","enableLoader","onClick","style","handleOnclick","event","jsxs","ElsieButton","classes","jsx"],"mappings":"4TAiBO,MAAMA,EAAiBC,GAAc,CAC1C,GAAI,CAACA,EAAM,OAAO,KAElB,MAAMC,EAAW,IAAI,SAASD,CAAI,EAElC,GAAIC,GAAY,OAAOA,EAAS,SAAY,WAAY,CACtD,MAAMC,EAAUD,EAAS,QAAA,EACzB,GAAIC,GAAW,OAAOA,EAAQ,OAAO,QAAQ,GAAM,WACjD,OAAO,KAAK,MAAM,KAAK,UAAU,OAAO,YAAYA,CAAO,CAAC,CAAC,GAAK,CAAA,CAEtE,CACA,MAAO,CAAA,CACT,ECZaC,EAAmBC,GACvB,OAAOA,GAAU,WCjBpBC,EAAcC,GAA0BC,EAAM,cAAc,MAAO,C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AM,CAChB,EAEaC,EAAiB,IAAM,CAClC,KAAM,CAACC,EAAkBC,CAAmB,EAC1CC,EAA+B,CAAA,CAAE,EAE7BC,EAA4BC,EAC/BC,GAAmD,CAClD,GAAI,CAACA,GAAgB,CAACA,EAAa,KAAM,CACvCJ,EAAoB,CAAA,CAAE,EACtB,MACF,CAEA,MAAMK,EAAOX,EAAUU,EAAa,IAAI,EAExCJ,EAAoB,CAClB,GAAGI,EACH,KAAAC,CAAA,CACD,CACH,EACA,CAAA,CAAC,EAGH,MAAO,CAAE,iBAAAN,EAAkB,0BAAAG,CAAA,CAC7B,ECjBaI,EAAyC,CAAC,CACrD,KAAAC,EACA,WAAAC,EACA,QAAAC,EACA,UAAAC,EAAY,GACZ,aAAAC,EAAe,GACf,QAAAC,EACA,MAAAC,EACA,KAAAR,EACA,GAAGf,CACL,IAAM,CACJ,MAAMwB,EAAgBX,EACnBY,GAAsB,CACrBH,GAAA,MAAAA,EAAUG,EACZ,EACA,CAACH,CAAO,CAAA,EAKV,OACEI,EAACC,EAAA,CACC,KAAAZ,EACA,MAAAQ,EACA,KAAAN,EACA,QAAAE,EACA,UAAWS,EAAQ,CAAC,cAAeR,EARtBC,EAAe,eAAiB,EAQS,CAAC,EACvD,QAASG,EACR,GAAGxB,EAEJ,SAAA,CAAA6B,EAAC,OAAA,CAAK,UAAU,oBAAqB,SAAAX,EAAW,EAC/CG,EACCQ,EAAC,MAAA,CAAI,UAAU,uBACb,WAAC,OAAA,CAAK,UAAU,qBAAA,CAAsB,CAAA,CACxC,EACE,IAAA,CAAA,CAAA,CAGV","x_google_ignoreList":[2,3,4]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResetPasswordForm.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/ChevronDown.svg","/@dropins/storefront-auth/src/hooks/components/useResetPasswordForm.tsx","/@dropins/storefront-auth/src/components/ResetPasswordForm/ResetPasswordForm.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgChevronDown = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"square\", strokeLinejoin: \"round\" }));\nexport default SvgChevronDown;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { requestPasswordResetEmail } from '@/auth/api';\nimport { checkIsFunction } from '@/auth/lib/checkIsFunction';\nimport { getFormValues } from '@/auth/lib/getFormValues';\nimport { UseResetPasswordFormProps } from '@/auth/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { useCallback, useState } from 'preact/hooks';\nimport { validateEmail } from '@/auth/lib/validationFields';\n\nexport const useResetPasswordForm = ({\n routeSignIn,\n onErrorCallback,\n onSuccessCallback,\n setActiveComponent,\n handleSetInLineAlertProps,\n}: UseResetPasswordFormProps) => {\n const translations = useText({\n successPasswordResetEmailNotification:\n 'Auth.Notification.successPasswordResetEmailNotification',\n });\n const [isLoading, setIsLoading] = useState(false);\n\n const submitResetPassword = useCallback(\n async (event: any): Promise<void> => {\n event.preventDefault();\n\n const formValues = getFormValues(event.target);\n\n if (!validateEmail(formValues?.email)) {\n return;\n }\n\n setIsLoading(true);\n\n const response = await requestPasswordResetEmail(formValues.email);\n\n setIsLoading(false);\n\n if (!response.success) {\n onErrorCallback?.(response);\n handleSetInLineAlertProps?.({\n type: 'error',\n text: response.message,\n });\n return;\n }\n\n if (onSuccessCallback) {\n await onSuccessCallback();\n return;\n }\n\n handleSetInLineAlertProps?.({\n type: 'success',\n text: translations.successPasswordResetEmailNotification.replace(\n '{email}',\n formValues.email\n ),\n });\n },\n [\n handleSetInLineAlertProps,\n onErrorCallback,\n onSuccessCallback,\n translations.successPasswordResetEmailNotification,\n ]\n );\n\n const redirectToSignInPage = useCallback(() => {\n if (checkIsFunction(setActiveComponent)) {\n setActiveComponent('signInForm');\n return;\n }\n\n if (checkIsFunction(routeSignIn)) {\n window.location.href = routeSignIn();\n }\n }, [setActiveComponent, routeSignIn]);\n\n return {\n isLoading,\n submitResetPassword,\n redirectToSignInPage,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport '@/auth/components/ResetPasswordForm/ResetPasswordForm.css';\nimport { useResetPasswordForm } from '@/auth/hooks/components/useResetPasswordForm';\nimport { ResetPasswordFormProps } from '@/auth/types';\nimport { ChevronDown as ChevronLeft } from '@adobe-commerce/elsie/icons';\nimport { Form, Button } from '@/auth/components';\nimport { useInLineAlert } from '@/auth/hooks/useInLineAlert';\nimport { Header, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { simplifyTransformAttributesForm } from '@/auth/lib/simplifyTransformAttributesForm';\nimport { DEFAULT__RESET_PASSWORD_EMAIL_FIELD } from '@/auth/configs/defaultCreateUserConfigs';\n\nexport const ResetPasswordForm: FunctionComponent<\n ResetPasswordFormProps & HTMLAttributes<HTMLDivElement>\n> = ({\n formSize = 'default',\n routeSignIn,\n setActiveComponent,\n onErrorCallback,\n onSuccessCallback,\n ...props\n}) => {\n const translations = useText({\n title: 'Auth.ResetPasswordForm.title',\n buttonPrimary: 'Auth.ResetPasswordForm.buttonPrimary',\n buttonSecondary: 'Auth.ResetPasswordForm.buttonSecondary',\n formAriaLabel: 'Auth.ResetPasswordForm.formAriaLabel',\n });\n\n const { inLineAlertProps, handleSetInLineAlertProps } = useInLineAlert();\n\n const { isLoading, submitResetPassword, redirectToSignInPage } =\n useResetPasswordForm({\n routeSignIn,\n setActiveComponent,\n onErrorCallback,\n onSuccessCallback,\n handleSetInLineAlertProps,\n });\n\n return (\n <div\n {...props}\n className={classes([\n 'auth-reset-password-form',\n `auth-reset-password-form--${formSize}`,\n ])}\n data-testid=\"resetPasswordForm\"\n >\n <Header\n title={translations.title}\n divider={false}\n className=\"auth-reset-password-form__title\"\n />\n {inLineAlertProps.text ? (\n <InLineAlert\n className=\"auth-reset-password-form__notification\"\n type={inLineAlertProps.type}\n variant=\"secondary\"\n heading={inLineAlertProps.text}\n icon={inLineAlertProps.icon}\n />\n ) : null}\n <Form\n aria-labelledby={translations.formAriaLabel}\n name=\"resetPassword_form\"\n className=\"auth-reset-password-form__form\"\n onSubmit={submitResetPassword}\n loading={isLoading}\n fieldsConfig={simplifyTransformAttributesForm(\n DEFAULT__RESET_PASSWORD_EMAIL_FIELD\n )}\n >\n <div className=\"auth-reset-password-form__buttons\">\n <Button\n className=\"auth-reset-password-form__buttons--signin\"\n type=\"button\"\n variant=\"tertiary\"\n style={{ padding: '0' }}\n icon={<ChevronLeft style={{ transform: 'rotate(90deg)' }} />}\n buttonText={translations.buttonSecondary}\n enableLoader={false}\n onClick={redirectToSignInPage}\n />\n <Button\n type=\"submit\"\n buttonText={translations.buttonPrimary}\n variant=\"primary\"\n enableLoader={isLoading}\n />\n </div>\n </Form>\n <div id=\"requestPasswordResetEmail\" />\n </div>\n );\n};\n"],"names":["SvgChevronDown","props","React","useResetPasswordForm","routeSignIn","onErrorCallback","onSuccessCallback","setActiveComponent","handleSetInLineAlertProps","translations","useText","isLoading","setIsLoading","useState","submitResetPassword","useCallback","event","formValues","getFormValues","validateEmail","response","requestPasswordResetEmail","redirectToSignInPage","checkIsFunction","ResetPasswordForm","formSize","inLineAlertProps","useInLineAlert","jsxs","classes","jsx","Header","InLineAlert","Form","simplifyTransformAttributesForm","DEFAULT__RESET_PASSWORD_EMAIL_FIELD","Button","ChevronLeft"],"mappings":"wnBACA,MAAMA,EAAkBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAO,EAAkBC,EAAM,cAAc,OAAQ,CAAE,EAAG,kDAAmD,OAAQ,eAAgB,YAAa,IAAK,cAAe,SAAU,eAAgB,OAAO,CAAE,CAAC,ECwB/WC,EAAuB,CAAC,CACnC,YAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,mBAAAC,EACA,0BAAAC,CACF,IAAiC,CAC/B,MAAMC,EAAeC,EAAQ,CAC3B,sCACE,yDAAA,CACH,EACK,CAACC,EAAWC,CAAY,EAAIC,EAAS,EAAK,EAE1CC,EAAsBC,EAC1B,MAAOC,GAA8B,CACnCA,EAAM,eAAe,EAEf,MAAAC,EAAaC,EAAcF,EAAM,MAAM,EAE7C,GAAI,CAACG,EAAcF,GAAA,YAAAA,EAAY,KAAK,EAClC,OAGFL,EAAa,EAAI,EAEjB,MAAMQ,EAAW,MAAMC,EAA0BJ,EAAW,KAAK,EAI7D,GAFJL,EAAa,EAAK,EAEd,CAACQ,EAAS,QAAS,CACrBf,GAAA,MAAAA,EAAkBe,GACUZ,GAAA,MAAAA,EAAA,CAC1B,KAAM,QACN,KAAMY,EAAS,OAAA,GAEjB,MAAA,CAGF,GAAId,EAAmB,CACrB,MAAMA,EAAkB,EACxB,MAAA,C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V,SAAUK,EACV,QAASH,EACT,aAAcuB,EACZC,CACF,EAEA,SAAAP,EAAC,MAAI,CAAA,UAAU,oCACb,SAAA,CAAAE,EAACM,EAAA,CACC,UAAU,4CACV,KAAK,SACL,QAAQ,WACR,MAAO,CAAE,QAAS,GAAI,EACtB,KAAON,EAAAO,EAAA,CAAY,MAAO,CAAE,UAAW,iBAAmB,EAC1D,WAAY5B,EAAa,gBACzB,aAAc,GACd,QAASa,CAAA,CACX,EACAQ,EAACM,EAAA,CACC,KAAK,SACL,WAAY3B,EAAa,cACzB,QAAQ,UACR,aAAcE,CAAA,CAAA,CAChB,CACF,CAAA,CAAA,CACF,EACAmB,EAAC,MAAI,CAAA,GAAG,2BAA4B,CAAA,CAAA,CAAA,CACtC,CAEJ","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"ResetPasswordForm.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/ChevronDown.svg","/@dropins/storefront-auth/src/hooks/components/useResetPasswordForm.tsx","/@dropins/storefront-auth/src/components/ResetPasswordForm/ResetPasswordForm.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgChevronDown = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"square\", strokeLinejoin: \"round\" }));\nexport default SvgChevronDown;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { requestPasswordResetEmail } from '@/auth/api';\nimport { checkIsFunction } from '@/auth/lib/checkIsFunction';\nimport { getFormValues } from '@/auth/lib/getFormValues';\nimport { UseResetPasswordFormProps } from '@/auth/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { useCallback, useState } from 'preact/hooks';\nimport { validateEmail } from '@/auth/lib/validationFields';\n\nexport const useResetPasswordForm = ({\n routeSignIn,\n onErrorCallback,\n onSuccessCallback,\n setActiveComponent,\n handleSetInLineAlertProps,\n}: UseResetPasswordFormProps) => {\n const translations = useText({\n successPasswordResetEmailNotification:\n 'Auth.Notification.successPasswordResetEmailNotification',\n });\n const [isLoading, setIsLoading] = useState(false);\n\n const submitResetPassword = useCallback(\n async (event: any): Promise<void> => {\n event.preventDefault();\n\n const formValues = getFormValues(event.target);\n\n if (!validateEmail(formValues?.email)) {\n return;\n }\n\n setIsLoading(true);\n\n const response = await requestPasswordResetEmail(formValues.email);\n\n setIsLoading(false);\n\n if (!response.success) {\n onErrorCallback?.(response);\n handleSetInLineAlertProps?.({\n type: 'error',\n text: response.message,\n });\n return;\n }\n\n if (onSuccessCallback) {\n await onSuccessCallback();\n return;\n }\n\n handleSetInLineAlertProps?.({\n type: 'success',\n text: translations.successPasswordResetEmailNotification.replace(\n '{email}',\n formValues.email\n ),\n });\n },\n [\n handleSetInLineAlertProps,\n onErrorCallback,\n onSuccessCallback,\n translations.successPasswordResetEmailNotification,\n ]\n );\n\n const redirectToSignInPage = useCallback(() => {\n if (checkIsFunction(setActiveComponent)) {\n setActiveComponent('signInForm');\n return;\n }\n\n if (checkIsFunction(routeSignIn)) {\n window.location.href = routeSignIn();\n }\n }, [setActiveComponent, routeSignIn]);\n\n return {\n isLoading,\n submitResetPassword,\n redirectToSignInPage,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport '@/auth/components/ResetPasswordForm/ResetPasswordForm.css';\nimport { useResetPasswordForm } from '@/auth/hooks/components/useResetPasswordForm';\nimport { ResetPasswordFormProps } from '@/auth/types';\nimport { ChevronDown as ChevronLeft } from '@adobe-commerce/elsie/icons';\nimport { Form, Button } from '@/auth/components';\nimport { useInLineAlert } from '@/auth/hooks/useInLineAlert';\nimport { Header, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { simplifyTransformAttributesForm } from '@/auth/lib/simplifyTransformAttributesForm';\nimport { DEFAULT__RESET_PASSWORD_EMAIL_FIELD } from '@/auth/configs/defaultCreateUserConfigs';\n\nexport const ResetPasswordForm: FunctionComponent<\n ResetPasswordFormProps & HTMLAttributes<HTMLDivElement>\n> = ({\n formSize = 'default',\n routeSignIn,\n setActiveComponent,\n onErrorCallback,\n onSuccessCallback,\n ...props\n}) => {\n const translations = useText({\n title: 'Auth.ResetPasswordForm.title',\n buttonPrimary: 'Auth.ResetPasswordForm.buttonPrimary',\n buttonSecondary: 'Auth.ResetPasswordForm.buttonSecondary',\n formAriaLabel: 'Auth.ResetPasswordForm.formAriaLabel',\n });\n\n const { inLineAlertProps, handleSetInLineAlertProps } = useInLineAlert();\n\n const { isLoading, submitResetPassword, redirectToSignInPage } =\n useResetPasswordForm({\n routeSignIn,\n setActiveComponent,\n onErrorCallback,\n onSuccessCallback,\n handleSetInLineAlertProps,\n });\n\n return (\n <div\n {...props}\n className={classes([\n 'auth-reset-password-form',\n `auth-reset-password-form--${formSize}`,\n ])}\n data-testid=\"resetPasswordForm\"\n >\n <Header\n title={translations.title}\n divider={false}\n className=\"auth-reset-password-form__title\"\n />\n {inLineAlertProps.text ? (\n <InLineAlert\n className=\"auth-reset-password-form__notification\"\n type={inLineAlertProps.type}\n variant=\"secondary\"\n heading={inLineAlertProps.text}\n icon={inLineAlertProps.icon}\n />\n ) : null}\n <Form\n aria-labelledby={translations.formAriaLabel}\n name=\"resetPassword_form\"\n className=\"auth-reset-password-form__form\"\n onSubmit={submitResetPassword}\n loading={isLoading}\n fieldsConfig={simplifyTransformAttributesForm(\n DEFAULT__RESET_PASSWORD_EMAIL_FIELD\n )}\n >\n <div className=\"auth-reset-password-form__buttons\">\n <Button\n className=\"auth-reset-password-form__buttons--signin\"\n type=\"button\"\n variant=\"tertiary\"\n style={{ padding: '0' }}\n icon={<ChevronLeft style={{ transform: 'rotate(90deg)' }} />}\n buttonText={translations.buttonSecondary}\n enableLoader={false}\n onClick={redirectToSignInPage}\n />\n <Button\n type=\"submit\"\n buttonText={translations.buttonPrimary}\n variant=\"primary\"\n enableLoader={isLoading}\n />\n </div>\n </Form>\n <div id=\"requestPasswordResetEmail\" />\n </div>\n );\n};\n"],"names":["SvgChevronDown","props","React","useResetPasswordForm","routeSignIn","onErrorCallback","onSuccessCallback","setActiveComponent","handleSetInLineAlertProps","translations","useText","isLoading","setIsLoading","useState","submitResetPassword","useCallback","event","formValues","getFormValues","validateEmail","response","requestPasswordResetEmail","redirectToSignInPage","checkIsFunction","ResetPasswordForm","formSize","inLineAlertProps","useInLineAlert","jsxs","classes","jsx","Header","InLineAlert","Form","simplifyTransformAttributesForm","DEFAULT__RESET_PASSWORD_EMAIL_FIELD","Button","ChevronLeft"],"mappings":"wnBACA,MAAMA,EAAkBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,EAAG,kDAA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