@dropins/storefront-auth 2.1.0-alpha2 → 2.1.0-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/api.js +1 -0
  2. package/api.js.map +1 -0
  3. package/chunks/Button.js +1 -0
  4. package/chunks/Button.js.map +1 -0
  5. package/chunks/Button2.js +1 -0
  6. package/chunks/Button2.js.map +1 -0
  7. package/chunks/ResetPasswordForm.js +1 -0
  8. package/chunks/ResetPasswordForm.js.map +1 -0
  9. package/chunks/SignInForm.js +1 -0
  10. package/chunks/SignInForm.js.map +1 -0
  11. package/chunks/SignUpForm.js +1 -0
  12. package/chunks/SignUpForm.js.map +1 -0
  13. package/chunks/SkeletonLoader.js +1 -0
  14. package/chunks/SkeletonLoader.js.map +1 -0
  15. package/chunks/acdl.js +1 -0
  16. package/chunks/acdl.js.map +1 -0
  17. package/chunks/confirmEmail.js +1 -0
  18. package/chunks/confirmEmail.js.map +1 -0
  19. package/chunks/createCustomerAddress.js +1 -0
  20. package/chunks/createCustomerAddress.js.map +1 -0
  21. package/chunks/focusOnEmptyPasswordField.js +1 -0
  22. package/chunks/focusOnEmptyPasswordField.js.map +1 -0
  23. package/chunks/getCustomerToken.js +1 -0
  24. package/chunks/getCustomerToken.js.map +1 -0
  25. package/chunks/index.js +1 -0
  26. package/chunks/index.js.map +1 -0
  27. package/chunks/index2.js +1 -0
  28. package/chunks/index2.js.map +1 -0
  29. package/chunks/index3.js +1 -0
  30. package/chunks/index3.js.map +1 -0
  31. package/chunks/initialize.js +1 -0
  32. package/chunks/initialize.js.map +1 -0
  33. package/chunks/network-error.js +1 -0
  34. package/chunks/network-error.js.map +1 -0
  35. package/chunks/requestPasswordResetEmail.js +1 -0
  36. package/chunks/requestPasswordResetEmail.js.map +1 -0
  37. package/chunks/resendConfirmationEmail.js +1 -0
  38. package/chunks/resendConfirmationEmail.js.map +1 -0
  39. package/chunks/resetPassword.js +1 -0
  40. package/chunks/resetPassword.js.map +1 -0
  41. package/chunks/revokeCustomerToken.js +1 -0
  42. package/chunks/revokeCustomerToken.js.map +1 -0
  43. package/chunks/setReCaptchaToken.js +1 -0
  44. package/chunks/setReCaptchaToken.js.map +1 -0
  45. package/chunks/simplifyTransformAttributesForm.js +1 -0
  46. package/chunks/simplifyTransformAttributesForm.js.map +1 -0
  47. package/chunks/transform-attributes-form.js +1 -0
  48. package/chunks/transform-attributes-form.js.map +1 -0
  49. package/chunks/usePasswordValidationMessage.js +1 -0
  50. package/chunks/usePasswordValidationMessage.js.map +1 -0
  51. package/chunks/verifyToken.js +1 -0
  52. package/chunks/verifyToken.js.map +1 -0
  53. package/containers/AuthCombine.js +1 -0
  54. package/containers/AuthCombine.js.map +1 -0
  55. package/containers/ResetPassword.js +1 -0
  56. package/containers/ResetPassword.js.map +1 -0
  57. package/containers/SignIn.js +1 -0
  58. package/containers/SignIn.js.map +1 -0
  59. package/containers/SignUp.js +1 -0
  60. package/containers/SignUp.js.map +1 -0
  61. package/containers/SuccessNotification.js +1 -0
  62. package/containers/SuccessNotification.js.map +1 -0
  63. package/containers/UpdatePassword.js +1 -0
  64. package/containers/UpdatePassword.js.map +1 -0
  65. package/fragments.js +1 -0
  66. package/fragments.js.map +1 -0
  67. package/package.json +1 -1
  68. package/render.js +1 -0
  69. package/render.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acdl.js","sources":["/@dropins/storefront-auth/src/data/transforms/transform-auth.ts","/@dropins/storefront-auth/src/lib/acdl.ts"],"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\nimport { AccountModel, CustomerModel } from '@/auth/data/models';\n\n/**\n * References:\n * https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/handlers/account/signInAEP.ts\n * https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/handlers/account/createAccountAEP.ts\n */\nexport const transformAccount = (data: CustomerModel): AccountModel => {\n return {\n firstName: data.firstName,\n lastName: data.lastName,\n emailAddress: data?.email || '',\n accountId: data?.email || '',\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 { transformAccount } from '../data/transforms';\n\nconst ACCOUNT_CONTEXT = 'accountContext';\nconst CHANNEL_CONTEXT = 'channelContext';\n\nenum EventsList {\n CREATE_ACCOUNT_EVENT = 'create-account',\n SIGN_IN = 'sign-in',\n SIGN_OUT = 'sign-out',\n}\n\nconst events = {\n // Reference - https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/handlers/account/createAccountAEP.ts\n CREATE_ACCOUNT: EventsList.CREATE_ACCOUNT_EVENT,\n // Reference - https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/handlers/account/signInAEP.ts\n SIGN_IN: EventsList.SIGN_IN,\n // Reference - https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/handlers/account/signOutAEP.ts\n SIGN_OUT: EventsList.SIGN_OUT,\n};\n\nexport function getAdobeDataLayer() {\n // @ts-ignore\n window.adobeDataLayer = window.adobeDataLayer || [];\n // @ts-ignore\n return window.adobeDataLayer;\n}\n\n/**\n * Sets a context in the Adobe Client Data Layer (ACDL)\n * Logic based on: https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/Base.ts#L6\n */\nfunction setContext(name: string, data: any) {\n const adobeDataLayer = getAdobeDataLayer();\n\n // Clear existing context\n adobeDataLayer.push({\n [name]: null,\n });\n\n // Set new context\n adobeDataLayer.push({\n [name]: data,\n });\n}\n\n/**\n * Sets channel context for AEP events\n */\nfunction setChannelContext() {\n const channelData = {\n _id: 'https://ns.adobe.com/xdm/channels/web',\n _type: 'https://ns.adobe.com/xdm/channel-types/web',\n };\n\n setContext(CHANNEL_CONTEXT, channelData);\n}\n\n/**\n * Pushes an event to the Adobe Client Data Layer (ACDL)\n * Logic based on: https://github.com/adobe/commerce-events/blob/1973d0ce28471ef190fa06dad6359ffa0ab51db6/packages/storefront-events-sdk/src/Base.ts#L34\n */\nfunction pushEvent(event: string, additionalContext?: any) {\n const adobeDataLayer = getAdobeDataLayer();\n\n adobeDataLayer.push((acdl: any) => {\n const state = acdl.getState ? acdl.getState() : {};\n\n acdl.push({\n event,\n eventInfo: {\n ...state,\n ...additionalContext,\n },\n });\n });\n}\n\n/**\n * References:\n * https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/handlers/account/createAccountAEP.ts\n * https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/utils/aep/account.ts\n */\nfunction createAccountEvent(eventData: any) {\n const accountData = transformAccount(eventData);\n\n setContext(ACCOUNT_CONTEXT, accountData);\n\n pushEvent(events.CREATE_ACCOUNT);\n}\n\n/**\n * References:\n * https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/handlers/account/signInAEP.ts\n * https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/utils/aep/account.ts\n */\nfunction loginEvent(eventData: any) {\n const accountData = transformAccount(eventData);\n\n setContext(ACCOUNT_CONTEXT, accountData);\n\n pushEvent(events.SIGN_IN);\n}\n\n/**\n * Based on storefront-events-collector - sign out event should not contain accountContext\n * Reference - https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-collector/src/handlers/account/signOutAEP.ts\n */\nfunction logoutEvent() {\n pushEvent(events.SIGN_OUT);\n}\n\nconst publishEvents = (eventType: string, eventParams: any) => {\n const storeConfigRaw = sessionStorage.getItem('storeConfig');\n const storeConfig = storeConfigRaw ? JSON.parse(storeConfigRaw) : {};\n\n const eventData = { ...storeConfig, ...eventParams };\n\n setChannelContext();\n\n switch (eventType) {\n case EventsList.CREATE_ACCOUNT_EVENT:\n createAccountEvent(eventData);\n break;\n\n case EventsList.SIGN_IN:\n loginEvent(eventData);\n break;\n\n case EventsList.SIGN_OUT:\n logoutEvent();\n break;\n\n default:\n return null;\n }\n};\n\nexport { EventsList, publishEvents, pushEvent };\n"],"names":["transformAccount","data","ACCOUNT_CONTEXT","CHANNEL_CONTEXT","EventsList","events","getAdobeDataLayer","setContext","name","adobeDataLayer","setChannelContext","pushEvent","event","additionalContext","acdl","state","createAccountEvent","eventData","accountData","loginEvent","logoutEvent","publishEvents","eventType","eventParams","storeConfigRaw"],"mappings":"AAwBa,MAAAA,EAAoBC,IACxB,CACL,UAAWA,EAAK,UAChB,SAAUA,EAAK,SACf,cAAcA,GAAA,YAAAA,EAAM,QAAS,GAC7B,WAAWA,GAAA,YAAAA,EAAM,QAAS,EAC5B,GCXIC,EAAkB,iBAClBC,EAAkB,iBAEnB,IAAAC,GAAAA,IACHA,EAAA,qBAAuB,iBACvBA,EAAA,QAAU,UACVA,EAAA,SAAW,WAHRA,IAAAA,GAAA,CAAA,CAAA,EAML,MAAMC,EAAS,CAEb,eAAgB,iBAEhB,QAAS,UAET,SAAU,UACZ,EAEO,SAASC,GAAoB,CAE3B,cAAA,eAAiB,OAAO,gBAAkB,CAAC,EAE3C,OAAO,cAChB,CAMA,SAASC,EAAWC,EAAcP,EAAW,CAC3C,MAAMQ,EAAiBH,EAAkB,EAGzCG,EAAe,KAAK,CAClB,CAACD,CAAI,EAAG,IAAA,CACT,EAGDC,EAAe,KAAK,CAClB,CAACD,CAAI,EAAGP,CAAA,CACT,CACH,CAKA,SAASS,GAAoB,CAM3BH,EAAWJ,EALS,CAClB,IAAK,wCACL,MAAO,4CACT,CAEuC,CACzC,CAMA,SAASQ,EAAUC,EAAeC,EAAyB,CAClCP,EAAkB,EAE1B,KAAMQ,GAAc,CACjC,MAAMC,EAAQD,EAAK,SAAWA,EAAK,WAAa,CAAC,EAEjDA,EAAK,KAAK,CACR,MAAAF,EACA,UAAW,CACT,GAAGG,EACH,GAAGF,CAAA,CACL,CACD,CAAA,CACF,CACH,CAOA,SAASG,EAAmBC,EAAgB,CACpC,MAAAC,EAAclB,EAAiBiB,CAAS,EAE9CV,EAAWL,EAAiBgB,CAAW,EAEvCP,EAAUN,EAAO,cAAc,CACjC,CAOA,SAASc,EAAWF,EAAgB,CAC5B,MAAAC,EAAclB,EAAiBiB,CAAS,EAE9CV,EAAWL,EAAiBgB,CAAW,EAEvCP,EAAUN,EAAO,OAAO,CAC1B,CAMA,SAASe,GAAc,CACrBT,EAAUN,EAAO,QAAQ,CAC3B,CAEM,MAAAgB,EAAgB,CAACC,EAAmBC,IAAqB,CACvD,MAAAC,EAAiB,eAAe,QAAQ,aAAa,EAGrDP,EAAY,CAAE,GAFAO,EAAiB,KAAK,MAAMA,CAAc,EAAI,CAAC,EAE/B,GAAGD,CAAY,EAInD,OAFkBb,EAAA,EAEVY,EAAW,CACjB,IAAK,iBACHN,EAAmBC,CAAS,EAC5B,MAEF,IAAK,UACHE,EAAWF,CAAS,EACpB,MAEF,IAAK,WACSG,EAAA,EACZ,MAEF,QACS,OAAA,IAAA,CAEb"}
@@ -11,3 +11,4 @@ import{f as o,h as r}from"./network-error.js";const t=`
11
11
  }
12
12
  }
13
13
  `,m=async({customerEmail:i,customerConfirmationKey:a})=>await o(t,{method:"POST",variables:{email:i,confirmation_key:a}}).catch(r);export{m as c};
14
+ //# sourceMappingURL=confirmEmail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirmEmail.js","sources":["/@dropins/storefront-auth/src/api/confirmEmail/graphql/confirmEmail.graphql.ts","/@dropins/storefront-auth/src/api/confirmEmail/confirmEmail.ts"],"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 CONFIRM_EMAIL = /* GraphQL */ `\n mutation CONFIRM_EMAIL($email: String!, $confirmation_key: String!) {\n confirmEmail(\n input: { email: $email, confirmation_key: $confirmation_key }\n ) {\n customer {\n email\n }\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 { confirmEmailResponse, confirmEmailProps } from '@/auth/types';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { CONFIRM_EMAIL } from './graphql/confirmEmail.graphql';\nimport { handleNetworkError } from '@/auth/lib/network-error';\n\nexport const confirmEmail = async ({\n customerEmail,\n customerConfirmationKey,\n}: confirmEmailProps): Promise<confirmEmailResponse | undefined> => {\n return await fetchGraphQl(CONFIRM_EMAIL, {\n method: 'POST',\n variables: {\n email: customerEmail,\n confirmation_key: customerConfirmationKey,\n },\n }).catch(handleNetworkError);\n};\n"],"names":["CONFIRM_EMAIL","confirmEmail","customerEmail","customerConfirmationKey","fetchGraphQl","handleNetworkError"],"mappings":"8CAiBa,MAAAA,EAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECK9BC,EAAe,MAAO,CACjC,cAAAC,EACA,wBAAAC,CACF,IACS,MAAMC,EAAaJ,EAAe,CACvC,OAAQ,OACR,UAAW,CACT,MAAOE,EACP,iBAAkBC,CAAA,CACpB,CACD,EAAE,MAAME,CAAkB"}
@@ -57,3 +57,4 @@ import{CUSTOMER_INFORMATION_FRAGMENT as O}from"../fragments.js";import{f as s,h
57
57
  }
58
58
  }
59
59
  `,z=async r=>await s(y,{method:"POST",variables:{input:r}}).then(e=>{var o;return(o=e.errors)!=null&&o.length?S(e.errors):e.data.createCustomerAddress.firstname||""}).catch(u);export{z as a,Q as c,j as g};
60
+ //# sourceMappingURL=createCustomerAddress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCustomerAddress.js","sources":["/@dropins/storefront-auth/src/api/createCustomer/graphql/createCustomer.graphql.ts","/@dropins/storefront-auth/src/api/createCustomer/graphql/createCustomerV2.graphql.ts","/@dropins/storefront-auth/src/data/transforms/transform-create-customer.tsx","/@dropins/storefront-auth/src/lib/transformDobForm.ts","/@dropins/storefront-auth/src/api/createCustomer/createCustomer.ts","/@dropins/storefront-auth/src/api/getAttributesForm/graphql/getAttributesForm.graphql.ts","/@dropins/storefront-auth/src/api/getAttributesForm/getAttributesForm.ts","/@dropins/storefront-auth/src/api/createCustomerAddress/graphql/createCustomerAddress.graphql.ts","/@dropins/storefront-auth/src/api/createCustomerAddress/createCustomerAddress.ts"],"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\nimport { CUSTOMER_INFORMATION_FRAGMENT } from '@/auth/api/fragments';\n\nexport const CREATE_CUSTOMER = /* GraphQL */ `\n mutation CREATE_CUSTOMER($input: CustomerInput!) {\n createCustomer(input: $input) {\n customer {\n ...CUSTOMER_INFORMATION_FRAGMENT\n }\n }\n }\n ${CUSTOMER_INFORMATION_FRAGMENT}\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 { CUSTOMER_INFORMATION_FRAGMENT } from '@/auth/api/fragments';\n\nexport const CREATE_CUSTOMER_V2 = /* GraphQL */ `\n mutation CREATE_CUSTOMER_V2($input: CustomerCreateInput!) {\n createCustomerV2(input: $input) {\n customer {\n ...CUSTOMER_INFORMATION_FRAGMENT\n }\n }\n }\n ${CUSTOMER_INFORMATION_FRAGMENT}\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 { DataCreateCustomerV2, DataCreateCustomer } from '@/auth/types';\nimport { config } from '@/auth/api';\nimport { merge } from '@adobe-commerce/elsie/lib';\nimport { CustomerModel } from '../models';\n\ntype ApiResponse<T extends boolean> = T extends true\n ? DataCreateCustomerV2\n : DataCreateCustomer;\n\nexport const transformCreateCustomer = <T extends boolean>(\n response: ApiResponse<T>,\n apiVersion2: T\n): CustomerModel => {\n let model: CustomerModel;\n\n if (apiVersion2) {\n const { data } = response as DataCreateCustomerV2;\n\n model = {\n firstName: data?.createCustomerV2?.customer?.firstname ?? '',\n lastName: data?.createCustomerV2?.customer?.lastname ?? '',\n email: data?.createCustomerV2?.customer?.email ?? '',\n customAttributes: data?.createCustomerV2?.custom_attributes ?? [],\n errors: response?.errors ?? [],\n };\n } else {\n const { data } = response as DataCreateCustomer;\n\n model = {\n firstName: data?.createCustomer?.customer?.firstname ?? '',\n lastName: data?.createCustomer?.customer?.lastname ?? '',\n email: data?.createCustomer?.customer?.email ?? '',\n errors: response?.errors ?? [],\n };\n }\n\n return merge(\n model, // default transformer\n config.getConfig().models?.CustomerModel?.transformer?.(response) // custom transformer\n );\n};\n","export const transformDobForm = (\n form: Record<string, any>\n): Record<string, any> => {\n if (!form.dob) return form;\n\n const { dob, ...rest } = form;\n return { ...rest, date_of_birth: dob };\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 { Customer } from '@/auth/types';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { CREATE_CUSTOMER } from './graphql/createCustomer.graphql';\nimport { CREATE_CUSTOMER_V2 } from './graphql/createCustomerV2.graphql';\nimport { handleNetworkError } from '@/auth/lib/network-error';\nimport { setReCaptchaToken } from '@/auth/lib/setReCaptchaToken';\nimport { transformCreateCustomer } from '@/auth/data/transforms';\nimport { CustomerModel } from '@/auth/data/models';\nimport { transformDobForm } from '@/auth/lib/transformDobForm';\n\nexport const createCustomer = async (\n forms: Customer,\n apiVersion2: boolean\n): Promise<CustomerModel> => {\n await setReCaptchaToken();\n\n const response = await fetchGraphQl(\n apiVersion2 ? CREATE_CUSTOMER_V2 : CREATE_CUSTOMER,\n {\n method: 'POST',\n variables: {\n input: {\n ...transformDobForm(forms),\n },\n },\n }\n ).catch(handleNetworkError);\n\n return transformCreateCustomer(response, apiVersion2);\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 GET_ATTRIBUTES_FORM = /* GraphQL */ `\n query GET_ATTRIBUTES_FORM($formCode: String!) {\n attributesForm(formCode: $formCode) {\n items {\n code\n default_value\n entity_type\n frontend_class\n frontend_input\n is_required\n is_unique\n label\n options {\n is_default\n label\n value\n }\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n validate_rules {\n name\n value\n }\n }\n }\n errors {\n type\n message\n }\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 { fetchGraphQl } from '../fetch-graphql';\nimport { GET_ATTRIBUTES_FORM } from './graphql/getAttributesForm.graphql';\nimport { handleNetworkError } from '@/auth/lib/network-error';\nimport { transformAttributesForm } from '@/auth/data/transforms';\nimport { handleFetchError } from '@/auth/lib/fetch-error';\nimport { AttributesFormModel } from '@/auth/data/models';\nimport { GetAttributesFormResponse } from '@/auth/types';\n\nexport const getAttributesForm = async (\n formCode: string\n): Promise<AttributesFormModel[]> => {\n return await fetchGraphQl(GET_ATTRIBUTES_FORM, {\n method: 'GET',\n cache: 'force-cache',\n variables: { formCode },\n })\n .then((response: GetAttributesFormResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return transformAttributesForm(response);\n })\n .catch(handleNetworkError);\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 CREATE_CUSTOMER_ADDRESS = /* GraphQL */ `\n mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {\n createCustomerAddress(input: $input) {\n firstname\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 { AddressFormProps, CreateCustomerAddressResponse } from '@/auth/types';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { CREATE_CUSTOMER_ADDRESS } from './graphql/createCustomerAddress.graphql';\nimport { handleNetworkError } from '@/auth/lib/network-error';\nimport { handleFetchError } from '@/auth/lib/fetch-error';\n\nexport const createCustomerAddress = async (\n address: AddressFormProps\n): Promise<string> => {\n return await fetchGraphQl(CREATE_CUSTOMER_ADDRESS, {\n method: 'POST',\n variables: {\n input: address,\n },\n })\n .then((response: CreateCustomerAddressResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return response.data.createCustomerAddress.firstname || '';\n })\n .catch(handleNetworkError);\n};\n"],"names":["CREATE_CUSTOMER","CUSTOMER_INFORMATION_FRAGMENT","CREATE_CUSTOMER_V2","transformCreateCustomer","response","apiVersion2","model","data","_b","_a","_d","_c","_f","_e","_g","_i","_h","_k","_j","_m","_l","merge","_p","_o","_n","config","transformDobForm","form","dob","rest","createCustomer","forms","setReCaptchaToken","fetchGraphQl","handleNetworkError","GET_ATTRIBUTES_FORM","getAttributesForm","formCode","handleFetchError","transformAttributesForm","CREATE_CUSTOMER_ADDRESS","createCustomerAddress","address"],"mappings":"2YAmBa,MAAAA,EAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQzCC,CAA6B;AAAA,ECRpBC,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQ5CD,CAA6B;AAAA,ECDpBE,EAA0B,CACrCC,EACAC,IACkB,qCACd,IAAAC,EAEJ,GAAID,EAAa,CACT,KAAA,CAAE,KAAAE,GAASH,EAETE,EAAA,CACN,YAAWE,GAAAC,EAAAF,GAAA,YAAAA,EAAM,mBAAN,YAAAE,EAAwB,WAAxB,YAAAD,EAAkC,YAAa,GAC1D,WAAUE,GAAAC,EAAAJ,GAAA,YAAAA,EAAM,mBAAN,YAAAI,EAAwB,WAAxB,YAAAD,EAAkC,WAAY,GACxD,QAAOE,GAAAC,EAAAN,GAAA,YAAAA,EAAM,mBAAN,YAAAM,EAAwB,WAAxB,YAAAD,EAAkC,QAAS,GAClD,mBAAkBE,EAAAP,GAAA,YAAAA,EAAM,mBAAN,YAAAO,EAAwB,oBAAqB,CAAC,EAChE,QAAQV,GAAA,YAAAA,EAAU,SAAU,CAAA,CAC9B,CAAA,KACK,CACC,KAAA,CAAE,KAAAG,GAASH,EAETE,EAAA,CACN,YAAWS,GAAAC,EAAAT,GAAA,YAAAA,EAAM,iBAAN,YAAAS,EAAsB,WAAtB,YAAAD,EAAgC,YAAa,GACxD,WAAUE,GAAAC,EAAAX,GAAA,YAAAA,EAAM,iBAAN,YAAAW,EAAsB,WAAtB,YAAAD,EAAgC,WAAY,GACtD,QAAOE,GAAAC,EAAAb,GAAA,YAAAA,EAAM,iBAAN,YAAAa,EAAsB,WAAtB,YAAAD,EAAgC,QAAS,GAChD,QAAQf,GAAA,YAAAA,EAAU,SAAU,CAAA,CAC9B,CAAA,CAGK,OAAAiB,EACLf,GACAgB,GAAAC,GAAAC,EAAAC,EAAO,UAAU,EAAE,SAAnB,YAAAD,EAA2B,gBAA3B,YAAAD,EAA0C,cAA1C,YAAAD,EAAA,KAAAC,EAAwDnB,EAC1D,CACF,ECzDasB,EACXC,GACwB,CACpB,GAAA,CAACA,EAAK,IAAY,OAAAA,EAEtB,KAAM,CAAE,IAAAC,EAAK,GAAGC,CAAA,EAASF,EACzB,MAAO,CAAE,GAAGE,EAAM,cAAeD,CAAI,CACvC,ECoBaE,EAAiB,MAC5BC,EACA1B,IAC2B,CAC3B,MAAM2B,EAAkB,EAExB,MAAM5B,EAAW,MAAM6B,EACrB5B,EAAcH,EAAqBF,EACnC,CACE,OAAQ,OACR,UAAW,CACT,MAAO,CACL,GAAG0B,EAAiBK,CAAK,CAAA,CAC3B,CACF,CACF,EACA,MAAMG,CAAkB,EAEnB,OAAA/B,EAAwBC,EAAUC,CAAW,CACtD,EC7Ba8B,EAAoC;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,ECQpCC,EAAoB,MAC/BC,GAEO,MAAMJ,EAAaE,EAAqB,CAC7C,OAAQ,MACR,MAAO,cACP,UAAW,CAAE,SAAAE,CAAS,CAAA,CACvB,EACE,KAAMjC,GAAwC,OAC7C,OAAIK,EAAAL,EAAS,SAAT,MAAAK,EAAiB,OAAe6B,EAAiBlC,EAAS,MAAM,EAE7DmC,EAAwBnC,CAAQ,CAAA,CACxC,EACA,MAAM8B,CAAkB,ECrBhBM,EAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECMxCC,EAAwB,MACnCC,GAEO,MAAMT,EAAaO,EAAyB,CACjD,OAAQ,OACR,UAAW,CACT,MAAOE,CAAA,CACT,CACD,EACE,KAAMtC,GAA4C,OACjD,OAAIK,EAAAL,EAAS,SAAT,MAAAK,EAAiB,OAAe6B,EAAiBlC,EAAS,MAAM,EAE7DA,EAAS,KAAK,sBAAsB,WAAa,EAAA,CACzD,EACA,MAAM8B,CAAkB"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{jsxs as c,jsx as m}from"@dropins/tools/preact-jsx-runtime.js";import{classes as b}from"@dropins/tools/lib.js";import{InLineAlert as y,Header as p}from"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{r as C}from"./resendConfirmationEmail.js";import{useState as x,useCallback as E}from"@dropins/tools/preact-hooks.js";import{useText as u}from"@dropins/tools/i18n.js";import"./Button.js";import{B as f}from"./Button2.js";const g=({userEmail:o,handleSetInLineAlertProps:t})=>{const a=u({emailConfirmationMessage:"Auth.Notification.emailConfirmationMessage",technicalErrorSendEmail:"Auth.Notification.technicalErrors.technicalErrorSendEmail"}),[r,e]=x(!1);return{handleEmailConfirmation:E(async()=>{var n,s;if(e(!0),o){const i=await C(o);if(i){const d=(n=i==null?void 0:i.errors)==null?void 0:n.length,h=(s=i==null?void 0:i.data)==null?void 0:s.resendConfirmationEmail;t(d?{type:"error",text:a.technicalErrorSendEmail}:{type:h?"success":"error",text:a.emailConfirmationMessage})}}e(!1)},[t,a,o]),disabledButton:r}},I=({formSize:o,userEmail:t,inLineAlertProps:a,hideCloseBtnOnEmailConfirmation:r,handleSetInLineAlertProps:e,onPrimaryButtonClick:l})=>{const n=u({title:"Auth.EmailConfirmationForm.title",subtitle:"Auth.EmailConfirmationForm.subtitle",mainText:"Auth.EmailConfirmationForm.mainText",buttonPrimary:"Auth.EmailConfirmationForm.buttonPrimary",buttonSecondary:"Auth.EmailConfirmationForm.buttonSecondary"}),{handleEmailConfirmation:s,disabledButton:i}=g({userEmail:t,handleSetInLineAlertProps:e});return c("div",{className:b(["auth-email-confirmation-form",`auth-email-confirmation-form--${o}`]),children:[a.text?m(y,{className:"auth-signInForm__notification",type:a.type,variant:"secondary",heading:a.text,icon:a.icon,"data-testid":"authInLineAlert"}):null,m(p,{title:n.title,divider:!1,className:"auth-email-confirmation-form__title"}),t!=null&&t.length?m("span",{className:"auth-email-confirmation-form__subtitle",children:`${n.subtitle} ${t}`}):null,m("span",{className:"auth-email-confirmation-form__text",children:n.mainText}),c("div",{className:"auth-email-confirmation-form__buttons",children:[m(f,{type:"button",variant:"tertiary",style:{padding:0},buttonText:n.buttonSecondary,enableLoader:!1,onClick:s,disabled:i}),r?null:m(f,{type:"submit",buttonText:n.buttonPrimary,variant:"primary",enableLoader:!1,disabled:i,onClick:l})]})]})},M=(o,t,a)=>{const r=o.target.querySelector('input[name="password"]'),e=o.target.querySelector('input[name="confirmPasswordField"]');r&&!t.length?r.focus():e&&!a.length&&e.focus()};export{I as E,M as f};
4
+ //# sourceMappingURL=focusOnEmptyPasswordField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusOnEmptyPasswordField.js","sources":["/@dropins/storefront-auth/src/hooks/components/useEmailConfirmationForm.tsx","/@dropins/storefront-auth/src/components/EmailConfirmationForm/EmailConfirmationForm.tsx","/@dropins/storefront-auth/src/lib/focusOnEmptyPasswordField.ts"],"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\nimport { resendConfirmationEmail } from '@/auth/api';\nimport { useEmailConfirmationFormProps } from '@/auth/types';\nimport { useCallback, useState } from 'preact/hooks';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport const useEmailConfirmationForm = ({\n userEmail,\n handleSetInLineAlertProps,\n}: useEmailConfirmationFormProps) => {\n const translations = useText({\n emailConfirmationMessage: 'Auth.Notification.emailConfirmationMessage',\n technicalErrorSendEmail:\n 'Auth.Notification.technicalErrors.technicalErrorSendEmail',\n });\n\n const [disabledButton, setDisabledButton] = useState(false);\n\n const handleEmailConfirmation = useCallback(async () => {\n setDisabledButton(true);\n\n if (userEmail) {\n const response = await resendConfirmationEmail(userEmail);\n\n if (response) {\n const errors = response?.errors?.length;\n const isEmailResend = response?.data?.resendConfirmationEmail;\n\n if (errors) {\n handleSetInLineAlertProps({\n type: 'error',\n text: translations.technicalErrorSendEmail,\n });\n } else {\n handleSetInLineAlertProps({\n type: isEmailResend ? 'success' : 'error',\n text: translations.emailConfirmationMessage,\n });\n }\n }\n }\n\n setDisabledButton(false);\n }, [handleSetInLineAlertProps, translations, userEmail]);\n\n return { handleEmailConfirmation, disabledButton };\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 { Button } from '@/auth/components';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent } from 'preact';\nimport { Header, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useEmailConfirmationForm } from '@/auth/hooks/components/useEmailConfirmationForm';\nimport { EmailConfirmationFormProps } from '@/auth/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/auth/components/EmailConfirmationForm/EmailConfirmationForm.css';\n\nexport const EmailConfirmationForm: FunctionComponent<\n EmailConfirmationFormProps\n> = ({\n formSize,\n userEmail,\n inLineAlertProps,\n hideCloseBtnOnEmailConfirmation,\n handleSetInLineAlertProps,\n onPrimaryButtonClick,\n}) => {\n const translations = useText({\n title: 'Auth.EmailConfirmationForm.title',\n subtitle: 'Auth.EmailConfirmationForm.subtitle',\n mainText: 'Auth.EmailConfirmationForm.mainText',\n buttonPrimary: 'Auth.EmailConfirmationForm.buttonPrimary',\n buttonSecondary: 'Auth.EmailConfirmationForm.buttonSecondary',\n });\n\n const { handleEmailConfirmation, disabledButton } = useEmailConfirmationForm({\n userEmail,\n handleSetInLineAlertProps,\n });\n\n return (\n <div\n className={classes([\n 'auth-email-confirmation-form',\n `auth-email-confirmation-form--${formSize}`,\n ])}\n >\n {inLineAlertProps.text ? (\n <InLineAlert\n className=\"auth-signInForm__notification\"\n type={inLineAlertProps.type}\n variant=\"secondary\"\n heading={inLineAlertProps.text}\n icon={inLineAlertProps.icon}\n data-testid=\"authInLineAlert\"\n />\n ) : null}\n <Header\n title={translations.title}\n divider={false}\n className=\"auth-email-confirmation-form__title\"\n />\n {userEmail?.length ? (\n <span className=\"auth-email-confirmation-form__subtitle\">{`${translations.subtitle} ${userEmail}`}</span>\n ) : null}\n <span className=\"auth-email-confirmation-form__text\">\n {translations.mainText}\n </span>\n <div className=\"auth-email-confirmation-form__buttons\">\n <Button\n type=\"button\"\n variant=\"tertiary\"\n style={{ padding: 0 }}\n buttonText={translations.buttonSecondary}\n enableLoader={false}\n onClick={handleEmailConfirmation}\n disabled={disabledButton}\n />\n {hideCloseBtnOnEmailConfirmation ? null : (\n <Button\n type=\"submit\"\n buttonText={translations.buttonPrimary}\n variant=\"primary\"\n enableLoader={false}\n disabled={disabledButton}\n onClick={onPrimaryButtonClick}\n />\n )}\n </div>\n </div>\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 const focusOnEmptyPasswordField = (\n event: Event,\n signUpPasswordValue: string,\n confirmPassword: string\n) => {\n const emptyInputPassword = (event.target as HTMLFormElement).querySelector(\n 'input[name=\"password\"]'\n );\n const emptyInputConfirmPassword = (\n event.target as HTMLFormElement\n ).querySelector('input[name=\"confirmPasswordField\"]');\n\n if (emptyInputPassword && !signUpPasswordValue.length) {\n (emptyInputPassword as HTMLInputElement).focus();\n } else if (emptyInputConfirmPassword && !confirmPassword.length) {\n (emptyInputConfirmPassword as HTMLInputElement).focus();\n }\n};\n"],"names":["useEmailConfirmationForm","userEmail","handleSetInLineAlertProps","translations","useText","disabledButton","setDisabledButton","useState","useCallback","response","resendConfirmationEmail","errors","_a","isEmailResend","_b","EmailConfirmationForm","formSize","inLineAlertProps","hideCloseBtnOnEmailConfirmation","onPrimaryButtonClick","handleEmailConfirmation","jsxs","classes","jsx","InLineAlert","Header","Button","focusOnEmptyPasswordField","event","signUpPasswordValue","confirmPassword","emptyInputPassword","emptyInputConfirmPassword"],"mappings":"seAsBO,MAAMA,EAA2B,CAAC,CACvC,UAAAC,EACA,0BAAAC,CACF,IAAqC,CACnC,MAAMC,EAAeC,EAAQ,CAC3B,yBAA0B,6CAC1B,wBACE,2DAAA,CACH,EAEK,CAACC,EAAgBC,CAAiB,EAAIC,EAAS,EAAK,EA6BnD,MAAA,CAAE,wBA3BuBC,EAAY,SAAY,SAGtD,GAFAF,EAAkB,EAAI,EAElBL,EAAW,CACP,MAAAQ,EAAW,MAAMC,EAAwBT,CAAS,EAExD,GAAIQ,EAAU,CACN,MAAAE,GAASC,EAAAH,GAAA,YAAAA,EAAU,SAAV,YAAAG,EAAkB,OAC3BC,GAAgBC,EAAAL,GAAA,YAAAA,EAAU,OAAV,YAAAK,EAAgB,wBAGVZ,EADxBS,EACwB,CACxB,KAAM,QACN,KAAMR,EAAa,uBAAA,EAGK,CACxB,KAAMU,EAAgB,UAAY,QAClC,KAAMV,EAAa,wBAAA,CAJpB,CAMH,CACF,CAGFG,EAAkB,EAAK,CACtB,EAAA,CAACJ,EAA2BC,EAAcF,CAAS,CAAC,EAErB,eAAAI,CAAe,CACnD,ECpCaU,EAET,CAAC,CACH,SAAAC,EACA,UAAAf,EACA,iBAAAgB,EACA,gCAAAC,EACA,0BAAAhB,EACA,qBAAAiB,CACF,IAAM,CACJ,MAAMhB,EAAeC,EAAQ,CAC3B,MAAO,mCACP,SAAU,sCACV,SAAU,sCACV,cAAe,2CACf,gBAAiB,4CAAA,CAClB,EAEK,CAAE,wBAAAgB,EAAyB,eAAAf,CAAe,EAAIL,EAAyB,CAC3E,UAAAC,EACA,0BAAAC,CAAA,CACD,EAGC,OAAAmB,EAAC,MAAA,CACC,UAAWC,EAAQ,CACjB,+BACA,iCAAiCN,CAAQ,EAAA,CAC1C,EAEA,SAAA,CAAAC,EAAiB,KAChBM,EAACC,EAAA,CACC,UAAU,gCACV,KAAMP,EAAiB,KACvB,QAAQ,YACR,QAASA,EAAiB,KAC1B,KAAMA,EAAiB,KACvB,cAAY,iBAAA,CAAA,EAEZ,KACJM,EAACE,EAAA,CACC,MAAOtB,EAAa,MACpB,QAAS,GACT,UAAU,qCAAA,CACZ,EACCF,GAAA,MAAAA,EAAW,OACTsB,EAAA,OAAA,CAAK,UAAU,yCAA0C,SAAG,GAAApB,EAAa,QAAQ,IAAIF,CAAS,EAAG,CAAA,EAChG,KACHsB,EAAA,OAAA,CAAK,UAAU,qCACb,WAAa,SAChB,EACAF,EAAC,MAAI,CAAA,UAAU,wCACb,SAAA,CAAAE,EAACG,EAAA,CACC,KAAK,SACL,QAAQ,WACR,MAAO,CAAE,QAAS,CAAE,EACpB,WAAYvB,EAAa,gBACzB,aAAc,GACd,QAASiB,EACT,SAAUf,CAAA,CACZ,EACCa,EAAkC,KACjCK,EAACG,EAAA,CACC,KAAK,SACL,WAAYvB,EAAa,cACzB,QAAQ,UACR,aAAc,GACd,SAAUE,EACV,QAASc,CAAA,CAAA,CACX,CAEJ,CAAA,CAAA,CAAA,CACF,CAEJ,ECnFaQ,EAA4B,CACvCC,EACAC,EACAC,IACG,CACG,MAAAC,EAAsBH,EAAM,OAA2B,cAC3D,wBACF,EACMI,EACJJ,EAAM,OACN,cAAc,oCAAoC,EAEhDG,GAAsB,CAACF,EAAoB,OAC5CE,EAAwC,MAAM,EACtCC,GAA6B,CAACF,EAAgB,QACtDE,EAA+C,MAAM,CAE1D"}
@@ -14,3 +14,4 @@ import{a as G,f as h,h as $}from"./network-error.js";import"@dropins/tools/recap
14
14
  }
15
15
  }
16
16
  `,V=async({email:t,password:e,translations:f,onErrorCallback:o,handleSetInLineAlertProps:i})=>{var r,g,E,_,d;await F();const a=await h(H,{method:"POST",variables:{email:t,password:e}}).catch($);if(!((g=(r=a==null?void 0:a.data)==null?void 0:r.generateCustomerToken)!=null&&g.token)){const M=f.customerTokenErrorMessage,N=a!=null&&a.errors?a.errors[0].message:M;return o==null||o(N),i==null||i({type:"error",text:N}),{errorMessage:N,userName:""}}const c=(_=(E=a==null?void 0:a.data)==null?void 0:E.generateCustomerToken)==null?void 0:_.token,m=await K(c),u=m==null?void 0:m.firstName,s=m==null?void 0:m.email;if(!u||!s){const M=f.customerTokenErrorMessage;return o==null||o(M),i==null||i({type:"error",text:M}),{errorMessage:M,userName:"",userEmail:""}}const T=await U();return document.cookie=`${O.auth_dropin_firstname}=${u}; path=/; ${T}; `,document.cookie=`${O.auth_dropin_user_token}=${c}; path=/; ${T}; `,w.emit("authenticated",!!c),x((d=y)==null?void 0:d.SIGN_IN,{...m}),{errorMessage:"",userName:u,userEmail:s}};export{V as a,K as g};
17
+ //# sourceMappingURL=getCustomerToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCustomerToken.js","sources":["/@dropins/storefront-auth/src/data/transforms/transform-customer-data.ts","/@dropins/storefront-auth/src/api/getCustomerData/graphql/getCustomerData.graphql.ts","/@dropins/storefront-auth/src/api/getCustomerData/getCustomerData.ts","/@dropins/storefront-auth/src/api/getCustomerToken/graphql/getCustomerToken.graphql.ts","/@dropins/storefront-auth/src/api/getCustomerToken/getCustomerToken.ts"],"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\nimport { getCustomerDataResponse } from '@/auth/types';\nimport { CustomerModel } from '../models';\nimport { config } from '@/auth/api';\nimport { merge } from '@adobe-commerce/elsie/lib';\n\nexport const transformCustomerData = (\n response: getCustomerDataResponse\n): CustomerModel => {\n const model = {\n email: response?.data?.customer?.email ?? '',\n firstName: response?.data?.customer?.firstname ?? '',\n lastName: response?.data?.customer?.lastname ?? '',\n };\n\n // Extend the model merging custom transformer, if provided\n return merge(\n model, // default transformer\n config?.getConfig()?.models?.CustomerModel?.transformer?.(response.data) // custom transformer\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 { CUSTOMER_INFORMATION_FRAGMENT } from '@/auth/api/fragments';\n\nexport const GET_CUSTOMER_DATA = /* GraphQL */ `\n query GET_CUSTOMER_DATA {\n customer {\n ...CUSTOMER_INFORMATION_FRAGMENT\n }\n }\n ${CUSTOMER_INFORMATION_FRAGMENT}\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 { fetchGraphQl, setFetchGraphQlHeader, config } from '@/auth/api';\nimport { GET_CUSTOMER_DATA } from './graphql/getCustomerData.graphql';\nimport { handleNetworkError } from '@/auth/lib/network-error';\nimport { CustomerModel } from '@/auth/data/models';\nimport { transformCustomerData } from '@/auth/data/transforms';\n\nexport const getCustomerData = async (\n user_token: string\n): Promise<CustomerModel> => {\n if (user_token) {\n const { authHeaderConfig } = config.getConfig();\n\n setFetchGraphQlHeader(\n authHeaderConfig.header,\n authHeaderConfig.tokenPrefix\n ? `${authHeaderConfig.tokenPrefix} ${user_token}`\n : user_token\n );\n }\n\n return await fetchGraphQl(GET_CUSTOMER_DATA, {\n method: 'GET',\n cache: 'force-cache',\n })\n .then((response) => {\n return transformCustomerData(response);\n })\n .catch(handleNetworkError);\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 GET_CUSTOMER_TOKEN = /* GraphQL */ `\n mutation GET_CUSTOMER_TOKEN($email: String!, $password: String!) {\n generateCustomerToken(email: $email, password: $password) {\n token\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 { handleNetworkError } from '@/auth/lib/network-error';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { GET_CUSTOMER_TOKEN } from './graphql/getCustomerToken.graphql';\nimport { getCustomerData } from '../getCustomerData';\nimport { InLineAlertInterface } from '@/auth/types';\nimport { events } from '@adobe-commerce/event-bus';\nimport { COOKIE_NAMES } from '@/auth/configs/cookieConfigs';\nimport { getCookiesLifetime } from '@/auth/lib/cookieUtils';\nimport { publishEvents, EventsList } from '@/auth/lib/acdl';\nimport { setReCaptchaToken } from '@/auth/lib/setReCaptchaToken';\n\ninterface getCustomerTokenProps {\n email: string;\n password: string;\n handleSetInLineAlertProps: (value?: InLineAlertInterface) => void;\n translations: Record<string, string>;\n onErrorCallback?: (value?: unknown) => void;\n}\n\nexport const getCustomerToken = async ({\n email,\n password,\n translations,\n onErrorCallback,\n handleSetInLineAlertProps,\n}: getCustomerTokenProps): Promise<{\n errorMessage: string;\n userName: string;\n userEmail: string;\n}> => {\n await setReCaptchaToken();\n\n const response = await fetchGraphQl(GET_CUSTOMER_TOKEN, {\n method: 'POST',\n variables: { email, password },\n }).catch(handleNetworkError);\n\n if (!response?.data?.generateCustomerToken?.token) {\n // Fallback error message\n const defaultErrorMessage = translations.customerTokenErrorMessage;\n const errorMessage = response?.errors\n ? response.errors[0].message\n : defaultErrorMessage;\n\n onErrorCallback?.(errorMessage);\n handleSetInLineAlertProps?.({ type: 'error', text: errorMessage });\n\n return { errorMessage, userName: '' };\n }\n\n const userToken = response?.data?.generateCustomerToken?.token;\n\n const responseCustomer = await getCustomerData(userToken);\n const userName = responseCustomer?.firstName;\n const userEmail = responseCustomer?.email;\n\n if (!userName || !userEmail) {\n const errorMessage = translations.customerTokenErrorMessage;\n\n onErrorCallback?.(errorMessage);\n handleSetInLineAlertProps?.({ type: 'error', text: errorMessage });\n\n return { errorMessage, userName: '', userEmail: '' };\n }\n\n const cookiesLifetime = await getCookiesLifetime();\n\n document.cookie = `${COOKIE_NAMES.auth_dropin_firstname}=${userName}; path=/; ${cookiesLifetime}; `;\n document.cookie = `${COOKIE_NAMES.auth_dropin_user_token}=${userToken}; path=/; ${cookiesLifetime}; `;\n\n events.emit('authenticated', !!userToken);\n\n publishEvents(EventsList?.SIGN_IN, { ...responseCustomer });\n\n return { errorMessage: '', userName, userEmail };\n};\n"],"names":["transformCustomerData","response","model","_b","_a","_d","_c","_f","_e","merge","_k","_j","_i","_h","_g","config","GET_CUSTOMER_DATA","CUSTOMER_INFORMATION_FRAGMENT","getCustomerData","user_token","authHeaderConfig","setFetchGraphQlHeader","fetchGraphQl","handleNetworkError","GET_CUSTOMER_TOKEN","getCustomerToken","email","password","translations","onErrorCallback","handleSetInLineAlertProps","setReCaptchaToken","defaultErrorMessage","errorMessage","userToken","responseCustomer","userName","userEmail","cookiesLifetime","getCookiesLifetime","COOKIE_NAMES","events","publishEvents","EventsList"],"mappings":"4ZAsBa,MAAAA,EACXC,GACkB,2BAClB,MAAMC,EAAQ,CACZ,QAAOC,GAAAC,EAAAH,GAAA,YAAAA,EAAU,OAAV,YAAAG,EAAgB,WAAhB,YAAAD,EAA0B,QAAS,GAC1C,YAAWE,GAAAC,EAAAL,GAAA,YAAAA,EAAU,OAAV,YAAAK,EAAgB,WAAhB,YAAAD,EAA0B,YAAa,GAClD,WAAUE,GAAAC,EAAAP,GAAA,YAAAA,EAAU,OAAV,YAAAO,EAAgB,WAAhB,YAAAD,EAA0B,WAAY,EAClD,EAGO,OAAAE,EACLP,GACAQ,GAAAC,GAAAC,GAAAC,GAAAC,EAAAC,IAAA,YAAAD,EAAQ,cAAR,YAAAD,EAAqB,SAArB,YAAAD,EAA6B,gBAA7B,YAAAD,EAA4C,cAA5C,YAAAD,EAAA,KAAAC,EAA0DV,EAAS,KACrE,CACF,ECjBae,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM3CC,CAA6B;AAAA,ECFpBC,EAAkB,MAC7BC,GAC2B,CAC3B,GAAIA,EAAY,CACd,KAAM,CAAE,iBAAAC,CAAA,EAAqBL,EAAO,UAAU,EAE9CM,EACED,EAAiB,OACjBA,EAAiB,YACb,GAAGA,EAAiB,WAAW,IAAID,CAAU,GAC7CA,CACN,CAAA,CAGK,OAAA,MAAMG,EAAaN,EAAmB,CAC3C,OAAQ,MACR,MAAO,aAAA,CACR,EACE,KAAMf,GACED,EAAsBC,CAAQ,CACtC,EACA,MAAMsB,CAAkB,CAC7B,EC5BaC,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECmBnCC,EAAmB,MAAO,CACrC,MAAAC,EACA,SAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,0BAAAC,CACF,IAIM,eACJ,MAAMC,EAAkB,EAElB,MAAA9B,EAAW,MAAMqB,EAAaE,EAAoB,CACtD,OAAQ,OACR,UAAW,CAAE,MAAAE,EAAO,SAAAC,CAAS,CAAA,CAC9B,EAAE,MAAMJ,CAAkB,EAE3B,GAAI,GAACpB,GAAAC,EAAAH,GAAA,YAAAA,EAAU,OAAV,YAAAG,EAAgB,wBAAhB,MAAAD,EAAuC,OAAO,CAEjD,MAAM6B,EAAsBJ,EAAa,0BACnCK,EAAehC,GAAA,MAAAA,EAAU,OAC3BA,EAAS,OAAO,CAAC,EAAE,QACnB+B,EAEJ,OAAAH,GAAA,MAAAA,EAAkBI,GAClBH,GAAA,MAAAA,EAA4B,CAAE,KAAM,QAAS,KAAMG,IAE5C,CAAE,aAAAA,EAAc,SAAU,EAAG,CAAA,CAGhC,MAAAC,GAAY7B,GAAAC,EAAAL,GAAA,YAAAA,EAAU,OAAV,YAAAK,EAAgB,wBAAhB,YAAAD,EAAuC,MAEnD8B,EAAmB,MAAMjB,EAAgBgB,CAAS,EAClDE,EAAWD,GAAA,YAAAA,EAAkB,UAC7BE,EAAYF,GAAA,YAAAA,EAAkB,MAEhC,GAAA,CAACC,GAAY,CAACC,EAAW,CAC3B,MAAMJ,EAAeL,EAAa,0BAElC,OAAAC,GAAA,MAAAA,EAAkBI,GAClBH,GAAA,MAAAA,EAA4B,CAAE,KAAM,QAAS,KAAMG,IAE5C,CAAE,aAAAA,EAAc,SAAU,GAAI,UAAW,EAAG,CAAA,CAG/C,MAAAK,EAAkB,MAAMC,EAAmB,EAEjD,gBAAS,OAAS,GAAGC,EAAa,qBAAqB,IAAIJ,CAAQ,aAAaE,CAAe,KAC/F,SAAS,OAAS,GAAGE,EAAa,sBAAsB,IAAIN,CAAS,aAAaI,CAAe,KAEjGG,EAAO,KAAK,gBAAiB,CAAC,CAACP,CAAS,EAExCQ,GAAclC,EAAAmC,IAAA,YAAAnC,EAAY,QAAS,CAAE,GAAG2B,EAAkB,EAEnD,CAAE,aAAc,GAAI,SAAAC,EAAU,UAAAC,CAAU,CACjD"}
package/chunks/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{R as b,R as c}from"./ResetPasswordForm.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"./Button.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"./requestPasswordResetEmail.js";import"./network-error.js";import"@dropins/tools/fetch-graphql.js";import"./setReCaptchaToken.js";import"./Button2.js";import"./simplifyTransformAttributesForm.js";import"./transform-attributes-form.js";export{b as ResetPasswordForm,c as default};
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/chunks/index2.js CHANGED
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{S as v,S as w}from"./SignInForm.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"./Button2.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/components.js";import"./Button.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/i18n.js";import"@dropins/tools/event-bus.js";import"./getCustomerToken.js";import"./network-error.js";import"@dropins/tools/fetch-graphql.js";import"./initialize.js";import"./verifyToken.js";import"../fragments.js";import"./acdl.js";import"./setReCaptchaToken.js";import"./resendConfirmationEmail.js";import"./simplifyTransformAttributesForm.js";import"./transform-attributes-form.js";import"./focusOnEmptyPasswordField.js";import"./confirmEmail.js";export{v as SignInForm,w as default};
4
+ //# sourceMappingURL=index2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/chunks/index3.js CHANGED
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{S as y,S as z}from"./SignUpForm.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"./createCustomerAddress.js";import"../fragments.js";import"./network-error.js";import"@dropins/tools/fetch-graphql.js";import"./setReCaptchaToken.js";import"./initialize.js";import"./verifyToken.js";import"./transform-attributes-form.js";import"@dropins/tools/preact-hooks.js";import"./simplifyTransformAttributesForm.js";import"./usePasswordValidationMessage.js";import"@dropins/tools/i18n.js";import"./getCustomerToken.js";import"./acdl.js";import"./Button2.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/components.js";import"./Button.js";import"./focusOnEmptyPasswordField.js";import"./resendConfirmationEmail.js";import"./SkeletonLoader.js";export{y as SignUpForm,z as default};
4
+ //# sourceMappingURL=index3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{Initializer as n}from"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{v as t}from"./verifyToken.js";const e=new n({init:async o=>{const i={...{authHeaderConfig:{header:"Authorization",tokenPrefix:"Bearer"}},...o};e.config.setConfig(i),t(i.authHeaderConfig.header,i.authHeaderConfig.tokenPrefix)},listeners:()=>[]}),c=e.config;export{c,e as i};
4
+ //# sourceMappingURL=initialize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initialize.js","sources":["/@dropins/storefront-auth/src/api/initialize/initialize.ts"],"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\nimport { Initializer, Model } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { CustomerModel } from '@/auth/data/models';\nimport { verifyToken } from '@/auth/api';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n authHeaderConfig: {\n header: string;\n tokenPrefix: string;\n };\n models?: {\n CustomerModel?: Model<CustomerModel>;\n };\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {\n authHeaderConfig: {\n header: 'Authorization',\n tokenPrefix: 'Bearer',\n },\n };\n\n const mergedConfig = { ...defaultConfig, ...config };\n\n initialize.config.setConfig(mergedConfig);\n\n verifyToken(\n mergedConfig.authHeaderConfig.header,\n mergedConfig.authHeaderConfig.tokenPrefix\n );\n },\n\n listeners: () => [],\n});\n\nexport const config = initialize.config;\n"],"names":["initialize","Initializer","config","mergedConfig","verifyToken"],"mappings":"iKAiCa,MAAAA,EAAa,IAAIC,EAAyB,CACrD,KAAM,MAAOC,GAAW,CAQtB,MAAMC,EAAe,CAAE,GAPD,CACpB,iBAAkB,CAChB,OAAQ,gBACR,YAAa,QAAA,CAEjB,EAEyC,GAAGD,CAAO,EAExCF,EAAA,OAAO,UAAUG,CAAY,EAExCC,EACED,EAAa,iBAAiB,OAC9BA,EAAa,iBAAiB,WAChC,CACF,EAEA,UAAW,IAAM,CAAA,CACnB,CAAC,EAEYD,EAASF,EAAW"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{FetchGraphQL as e}from"@dropins/tools/fetch-graphql.js";import{events as r}from"@dropins/tools/event-bus.js";const{setEndpoint:h,setFetchGraphQlHeader:n,removeFetchGraphQlHeader:c,setFetchGraphQlHeaders:p,fetchGraphQl:i,getConfig:f}=new e().getMethods(),m=t=>{throw t instanceof DOMException&&t.name==="AbortError"||r.emit("auth/error",{source:"auth",type:"network",error:t}),t};export{n as a,p as b,i as f,f as g,m as h,c as r,h as s};
4
+ //# sourceMappingURL=network-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-error.js","sources":["/@dropins/storefront-auth/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-auth/src/lib/network-error.ts"],"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\nimport { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\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 { events } from '@adobe-commerce/event-bus';\n\n/**\n * A function which can be attached to fetchGraphQL to handle thrown errors in\n * a generic way.\n */\nexport const handleNetworkError = (error: Error) => {\n const isAbortError =\n error instanceof DOMException && error.name === 'AbortError';\n\n if (!isAbortError) {\n events.emit('auth/error', {\n source: 'auth',\n type: 'network',\n error,\n });\n }\n throw error;\n};\n"],"names":["setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","handleNetworkError","error","events"],"mappings":"oHAmBa,KAAA,CACX,YAAAA,EACA,sBAAAC,EACA,yBAAAC,EACA,uBAAAC,EACA,aAAAC,EACA,UAAAC,CACF,EAAI,IAAIC,EAAa,EAAE,WAAW,ECHrBC,EAAsBC,GAAiB,CAIlD,MAFEA,aAAiB,cAAgBA,EAAM,OAAS,cAGhDC,EAAO,KAAK,aAAc,CACxB,OAAQ,OACR,KAAM,UACN,MAAAD,CAAA,CACD,EAEGA,CACR"}
@@ -5,3 +5,4 @@ import{f as E,h as l}from"./network-error.js";import{s as e}from"./setReCaptchaT
5
5
  requestPasswordResetEmail(email: $email)
6
6
  }
7
7
  `,o=async a=>(await e(),await E(c,{method:"POST",variables:{email:a}}).then(t=>R(t)).catch(l));export{o as r};
8
+ //# sourceMappingURL=requestPasswordResetEmail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestPasswordResetEmail.js","sources":["/@dropins/storefront-auth/src/data/transforms/transform-password-reset-email.ts","/@dropins/storefront-auth/src/api/requestPasswordResetEmail/graphql/requestPasswordResetEmail.graphql.ts","/@dropins/storefront-auth/src/api/requestPasswordResetEmail/requestPasswordResetEmail.ts"],"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\nimport { PasswordResetEmailResponse } from '@/auth/types';\nimport { PasswordResetEmailModel } from '../models';\n\nexport const transformPasswordResetEmail = (\n response: PasswordResetEmailResponse\n): PasswordResetEmailModel => {\n let message: string = '';\n\n if (response?.errors?.length)\n message = response?.errors[0]?.message as unknown as string;\n\n return {\n message,\n success: Boolean(response?.data?.requestPasswordResetEmail),\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 const REQUEST_PASSWORD_RESET_EMAIL = /* GraphQL */ `\n mutation REQUEST_PASSWORD_RESET_EMAIL($email: String!) {\n requestPasswordResetEmail(email: $email)\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 { handleNetworkError } from '@/auth/lib/network-error';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { REQUEST_PASSWORD_RESET_EMAIL } from './graphql/requestPasswordResetEmail.graphql';\nimport { transformPasswordResetEmail } from '@/auth/data/transforms';\nimport { PasswordResetEmailModel } from '@/auth/data/models';\nimport { setReCaptchaToken } from '@/auth/lib/setReCaptchaToken';\n\nexport const requestPasswordResetEmail = async (\n email: string\n): Promise<PasswordResetEmailModel> => {\n await setReCaptchaToken();\n\n return await fetchGraphQl(REQUEST_PASSWORD_RESET_EMAIL, {\n method: 'POST',\n variables: { email },\n })\n .then((response) => {\n return transformPasswordResetEmail(response);\n })\n .catch(handleNetworkError);\n};\n"],"names":["transformPasswordResetEmail","response","message","_a","_b","_c","REQUEST_PASSWORD_RESET_EMAIL","requestPasswordResetEmail","email","setReCaptchaToken","fetchGraphQl","handleNetworkError"],"mappings":"yFAoBa,MAAAA,EACXC,GAC4B,WAC5B,IAAIC,EAAkB,GAEtB,OAAIC,EAAAF,GAAA,YAAAA,EAAU,SAAV,MAAAE,EAAkB,SACVD,GAAAE,EAAAH,GAAA,YAAAA,EAAU,OAAO,KAAjB,YAAAG,EAAqB,SAE1B,CACL,QAAAF,EACA,QAAS,IAAQG,EAAAJ,GAAA,YAAAA,EAAU,OAAV,MAAAI,EAAgB,0BACnC,CACF,ECfaC,EAA6C;AAAA;AAAA;AAAA;AAAA,ECO7CC,EAA4B,MACvCC,IAEA,MAAMC,EAAkB,EAEjB,MAAMC,EAAaJ,EAA8B,CACtD,OAAQ,OACR,UAAW,CAAE,MAAAE,CAAM,CAAA,CACpB,EACE,KAAMP,GACED,EAA4BC,CAAQ,CAC5C,EACA,MAAMU,CAAkB"}
@@ -5,3 +5,4 @@ import{f as r,h as e}from"./network-error.js";const i=`
5
5
  resendConfirmationEmail(email: $email)
6
6
  }
7
7
  `,n=async a=>await r(i,{method:"POST",variables:{email:a}}).catch(e);export{n as r};
8
+ //# sourceMappingURL=resendConfirmationEmail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resendConfirmationEmail.js","sources":["/@dropins/storefront-auth/src/api/resendConfirmationEmail/graphql/resendConfirmationEmail.graphql.ts","/@dropins/storefront-auth/src/api/resendConfirmationEmail/resendConfirmationEmail.ts"],"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 RESEND_CONFIRMATION_EMAIL = /* GraphQL */ `\n mutation RESEND_CONFIRMATION_EMAIL($email: String!) {\n resendConfirmationEmail(email: $email)\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 { fetchGraphQl } from '../fetch-graphql';\nimport { handleNetworkError } from '@/auth/lib/network-error';\nimport { RESEND_CONFIRMATION_EMAIL } from './graphql/resendConfirmationEmail.graphql';\nimport { resendConfirmationEmailResponse } from '@/auth/types';\n\nexport const resendConfirmationEmail = async (\n customerEmail: string\n): Promise<resendConfirmationEmailResponse> => {\n return await fetchGraphQl(RESEND_CONFIRMATION_EMAIL, {\n method: 'POST',\n variables: {\n email: customerEmail,\n },\n }).catch(handleNetworkError);\n};\n"],"names":["RESEND_CONFIRMATION_EMAIL","resendConfirmationEmail","customerEmail","fetchGraphQl","handleNetworkError"],"mappings":"8CAiBa,MAAAA,EAA0C;AAAA;AAAA;AAAA;AAAA,ECK1CC,EAA0B,MACrCC,GAEO,MAAMC,EAAaH,EAA2B,CACnD,OAAQ,OACR,UAAW,CACT,MAAOE,CAAA,CACT,CACD,EAAE,MAAME,CAAkB"}
@@ -13,3 +13,4 @@ import{f as o,h as w}from"./network-error.js";import{s as d}from"./setReCaptchaT
13
13
  )
14
14
  }
15
15
  `,P=a=>{var r,s,e;let t="";return(r=a==null?void 0:a.errors)!=null&&r.length&&(t=(s=a==null?void 0:a.errors[0])==null?void 0:s.message),{message:t,success:!!((e=a==null?void 0:a.data)!=null&&e.resetPassword)}},S=async(a,t,r)=>(await d(),await o(i,{method:"POST",variables:{email:a,resetPasswordToken:t,newPassword:r}}).then(s=>P(s)).catch(w));export{S as r};
16
+ //# sourceMappingURL=resetPassword.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resetPassword.js","sources":["/@dropins/storefront-auth/src/api/resetPassword/graphql/resetPassword.graphql.ts","/@dropins/storefront-auth/src/data/transforms/transform-reset-password.ts","/@dropins/storefront-auth/src/api/resetPassword/resetPassword.ts"],"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 RESET_PASSWORD = /* GraphQL */ `\n mutation RESET_PASSWORD(\n $email: String!\n $resetPasswordToken: String!\n $newPassword: String!\n ) {\n resetPassword(\n email: $email\n resetPasswordToken: $resetPasswordToken\n newPassword: $newPassword\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 { ResetPasswordResponse } from '@/auth/types';\nimport { ResetPasswordModel } from '../models';\n\nexport const transformResetPassword = (\n response: ResetPasswordResponse\n): ResetPasswordModel => {\n let message: string = '';\n\n if (response?.errors?.length)\n message = response?.errors[0]?.message as unknown as string;\n\n return {\n message,\n success: Boolean(response?.data?.resetPassword),\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 { handleNetworkError } from '@/auth/lib/network-error';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { RESET_PASSWORD } from './graphql/resetPassword.graphql';\nimport { transformResetPassword } from '@/auth/data/transforms/transform-reset-password';\nimport { ResetPasswordModel } from '@/auth/data/models';\nimport { ResetPasswordResponse } from '@/auth/types';\nimport { setReCaptchaToken } from '@/auth/lib/setReCaptchaToken';\n\nexport const resetPassword = async (\n email: string,\n resetPasswordToken: string,\n newPassword: string\n): Promise<ResetPasswordModel> => {\n await setReCaptchaToken();\n\n return await fetchGraphQl(RESET_PASSWORD, {\n method: 'POST',\n variables: { email, resetPasswordToken, newPassword },\n })\n .then((response: ResetPasswordResponse) => {\n return transformResetPassword(response);\n })\n .catch(handleNetworkError);\n};\n"],"names":["RESET_PASSWORD","transformResetPassword","response","message","_a","_b","_c","resetPassword","email","resetPasswordToken","newPassword","setReCaptchaToken","fetchGraphQl","handleNetworkError"],"mappings":"yFAiBa,MAAAA,EAA+B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECG/BC,EACXC,GACuB,WACvB,IAAIC,EAAkB,GAEtB,OAAIC,EAAAF,GAAA,YAAAA,EAAU,SAAV,MAAAE,EAAkB,SACVD,GAAAE,EAAAH,GAAA,YAAAA,EAAU,OAAO,KAAjB,YAAAG,EAAqB,SAE1B,CACL,QAAAF,EACA,QAAS,IAAQG,EAAAJ,GAAA,YAAAA,EAAU,OAAV,MAAAI,EAAgB,cACnC,CACF,ECPaC,EAAgB,MAC3BC,EACAC,EACAC,KAEA,MAAMC,EAAkB,EAEjB,MAAMC,EAAaZ,EAAgB,CACxC,OAAQ,OACR,UAAW,CAAE,MAAAQ,EAAO,mBAAAC,EAAoB,YAAAC,CAAY,CAAA,CACrD,EACE,KAAMR,GACED,EAAuBC,CAAQ,CACvC,EACA,MAAMW,CAAkB"}
@@ -8,3 +8,4 @@ import{f as n,h as s}from"./network-error.js";import{C as m,d as i,v as u}from".
8
8
  }
9
9
  `,v=async()=>await n(f,{method:"POST"}).then(t=>{const e=h(t);if(e!=null&&e.success)[m.auth_dropin_user_token,m.auth_dropin_firstname].forEach(r=>{i(r)}),c.emit("authenticated",!1),E(k.SIGN_OUT,{});else{const r=`
10
10
  ERROR revokeCustomerToken: ${e.message}`;console.error(r),u()}return e}).catch(s);export{v as r};
11
+ //# sourceMappingURL=revokeCustomerToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revokeCustomerToken.js","sources":["/@dropins/storefront-auth/src/data/transforms/transform-revoke-customer-token.ts","/@dropins/storefront-auth/src/api/revokeCustomerToken/graphql/revokeCustomerToken.graphql.ts","/@dropins/storefront-auth/src/api/revokeCustomerToken/revokeCustomerToken.ts"],"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\nimport { RevokeCustomerTokenResponse } from '@/auth/types/api/revokeCustomerToken.types';\nimport { RevokeCustomerTokenModel } from '../models';\n\nexport const transformRevokeCustomerToken = (\n response: RevokeCustomerTokenResponse\n): RevokeCustomerTokenModel => {\n let message: string = '';\n\n if (response?.errors?.length)\n message =\n (response?.errors[0]?.message as unknown as string) || 'Unknown error';\n\n return {\n message,\n success: Boolean(response?.data?.revokeCustomerToken),\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 const REVOKE_CUSTOMER_TOKEN = /* GraphQL */ `\n mutation REVOKE_CUSTOMER_TOKEN {\n revokeCustomerToken {\n result\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 { RevokeCustomerTokenModel } from '@/auth/data/models';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { REVOKE_CUSTOMER_TOKEN } from './graphql/revokeCustomerToken.graphql';\nimport { handleNetworkError } from '@/auth/lib/network-error';\nimport { transformRevokeCustomerToken } from '@/auth/data/transforms';\nimport { RevokeCustomerTokenResponse } from '@/auth/types/api/revokeCustomerToken.types';\nimport { deleteCookie } from '@/auth/lib/cookieUtils';\nimport { events } from '@adobe-commerce/event-bus';\nimport { COOKIE_NAMES } from '@/auth/configs/cookieConfigs';\nimport { EventsList, publishEvents } from '@/auth/lib/acdl';\nimport { verifyToken } from '@/auth/api/verifyToken';\n\nexport const revokeCustomerToken =\n async (): Promise<RevokeCustomerTokenModel> => {\n return await fetchGraphQl(REVOKE_CUSTOMER_TOKEN, {\n method: 'POST',\n })\n .then((response: RevokeCustomerTokenResponse) => {\n const transformData = transformRevokeCustomerToken(response);\n\n if (transformData?.success) {\n [\n COOKIE_NAMES.auth_dropin_user_token,\n COOKIE_NAMES.auth_dropin_firstname,\n ].forEach((name) => {\n deleteCookie(name);\n });\n\n events.emit('authenticated', false);\n\n publishEvents(EventsList.SIGN_OUT, {});\n } else {\n const errorMessage = `\n ERROR revokeCustomerToken: ${transformData.message}`;\n console.error(errorMessage);\n\n // Verify if the token is still valid after failed revocation attempt\n // This ensures the authentication state is consistent with the actual token status even if the revocation fails\n verifyToken();\n }\n\n return transformData;\n })\n .catch(handleNetworkError);\n };\n"],"names":["transformRevokeCustomerToken","response","message","_a","_b","_c","REVOKE_CUSTOMER_TOKEN","revokeCustomerToken","fetchGraphQl","transformData","COOKIE_NAMES","name","deleteCookie","events","publishEvents","EventsList","errorMessage","verifyToken","handleNetworkError"],"mappings":"2LAoBa,MAAAA,EACXC,GAC6B,WAC7B,IAAIC,EAAkB,GAEtB,OAAIC,EAAAF,GAAA,YAAAA,EAAU,SAAV,MAAAE,EAAkB,SACpBD,IACGE,EAAAH,GAAA,YAAAA,EAAU,OAAO,KAAjB,YAAAG,EAAqB,UAAiC,iBAEpD,CACL,QAAAF,EACA,QAAS,IAAQG,EAAAJ,GAAA,YAAAA,EAAU,OAAV,MAAAI,EAAgB,oBACnC,CACF,EChBaC,EAAsC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECYtCC,EACX,SACS,MAAMC,EAAaF,EAAuB,CAC/C,OAAQ,MAAA,CACT,EACE,KAAML,GAA0C,CACzC,MAAAQ,EAAgBT,EAA6BC,CAAQ,EAE3D,GAAIQ,GAAA,MAAAA,EAAe,QACjB,CACEC,EAAa,uBACbA,EAAa,qBAAA,EACb,QAASC,GAAS,CAClBC,EAAaD,CAAI,CAAA,CAClB,EAEME,EAAA,KAAK,gBAAiB,EAAK,EAEpBC,EAAAC,EAAW,SAAU,EAAE,MAChC,CACL,MAAMC,EAAe;AAAA,uCACQP,EAAc,OAAO,GAClD,QAAQ,MAAMO,CAAY,EAIdC,EAAA,CAAA,CAGP,OAAAR,CAAA,CACR,EACA,MAAMS,CAAkB"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{verifyReCaptcha as t}from"@dropins/tools/recaptcha.js";import"@dropins/tools/event-bus.js";import{a as e}from"./network-error.js";const s=async()=>{const a=await t();a&&e("X-ReCaptcha",a)};export{s};
4
+ //# sourceMappingURL=setReCaptchaToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setReCaptchaToken.js","sources":["/@dropins/storefront-auth/src/lib/setReCaptchaToken.ts"],"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\nimport { verifyReCaptcha } from '@adobe-commerce/recaptcha';\nimport { setFetchGraphQlHeader } from '../api';\n\nexport const setReCaptchaToken = async () => {\n const token = await verifyReCaptcha();\n\n if (token) {\n setFetchGraphQlHeader('X-ReCaptcha', token);\n }\n};\n"],"names":["setReCaptchaToken","token","verifyReCaptcha","setFetchGraphQlHeader"],"mappings":"yIAoBO,MAAMA,EAAoB,SAAY,CACrC,MAAAC,EAAQ,MAAMC,EAAgB,EAEhCD,GACFE,EAAsB,cAAeF,CAAK,CAE9C"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{t}from"./transform-attributes-form.js";const o=[{customUpperCode:"email",code:"email",default_value:"",entity_type:"CUSTOMER",frontend_class:"auth-sign-in-form__form__email",frontend_input:"TEXT",is_required:!0,multiline_count:1,sort_order:1,is_unique:!1,label:"Email",options:[],validateRules:[{name:"INPUT_VALIDATION",value:"email"}],autocomplete:"username"}],s=[{customUpperCode:"email",code:"email",default_value:"",entity_type:"CUSTOMER",frontend_class:"auth-reset-password-form__form__item",frontend_input:"TEXT",is_required:!0,is_unique:!1,label:"Email",options:[],validateRules:[{name:"INPUT_VALIDATION",value:"email"}],autocomplete:"username"}],n=[{customUpperCode:"email",code:"email",default_value:"",entity_type:"CUSTOMER",frontend_class:"",frontend_input:"TEXT",is_required:!0,is_unique:!1,label:"Email",multiline_count:1,sort_order:1,options:[],validateRules:[{name:"INPUT_VALIDATION",value:"email"}],autocomplete:"username"},{customUpperCode:"firstname",code:"firstname",default_value:"",entity_type:"CUSTOMER",frontend_class:"",frontend_input:"TEXT",is_required:!0,is_unique:!1,label:"First name",multiline_count:1,sort_order:2,options:[]},{customUpperCode:"lastname",code:"lastname",default_value:"",entity_type:"CUSTOMER",frontend_class:"",frontend_input:"TEXT",is_required:!1,is_unique:!1,label:"Last name",multiline_count:1,sort_order:3,options:[]}],i=e=>e!=null&&e.length?t({data:{attributesForm:{items:e}}}):[];export{s as D,o as a,n as b,i as s};
4
+ //# sourceMappingURL=simplifyTransformAttributesForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simplifyTransformAttributesForm.js","sources":["/@dropins/storefront-auth/src/configs/defaultCreateUserConfigs.ts","/@dropins/storefront-auth/src/lib/simplifyTransformAttributesForm.ts"],"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 DEFAULT__SIGN_IN_EMAIL_FIELD = [\n {\n customUpperCode: 'email',\n code: 'email',\n default_value: '',\n entity_type: 'CUSTOMER',\n frontend_class: 'auth-sign-in-form__form__email',\n frontend_input: 'TEXT',\n is_required: true,\n multiline_count: 1,\n sort_order: 1,\n is_unique: false,\n label: 'Email',\n options: [],\n validateRules: [\n {\n name: 'INPUT_VALIDATION',\n value: 'email',\n },\n ],\n autocomplete: 'username',\n },\n];\n\nexport const DEFAULT__RESET_PASSWORD_EMAIL_FIELD: Record<\n string,\n string | boolean | unknown\n>[] = [\n {\n customUpperCode: 'email',\n code: 'email',\n default_value: '',\n entity_type: 'CUSTOMER',\n frontend_class: 'auth-reset-password-form__form__item',\n frontend_input: 'TEXT',\n is_required: true,\n is_unique: false,\n label: 'Email',\n options: [],\n validateRules: [\n {\n name: 'INPUT_VALIDATION',\n value: 'email',\n },\n ],\n autocomplete: 'username',\n },\n];\n\nexport const DEFAULT_SIGN_UP_FIELDS = [\n {\n customUpperCode: 'email',\n code: 'email',\n default_value: '',\n entity_type: 'CUSTOMER',\n frontend_class: '',\n frontend_input: 'TEXT',\n is_required: true,\n is_unique: false,\n label: 'Email',\n multiline_count: 1,\n sort_order: 1,\n options: [],\n validateRules: [\n {\n name: 'INPUT_VALIDATION',\n value: 'email',\n },\n ],\n autocomplete: 'username',\n },\n {\n customUpperCode: 'firstname',\n code: 'firstname',\n default_value: '',\n entity_type: 'CUSTOMER',\n frontend_class: '',\n frontend_input: 'TEXT',\n is_required: true,\n is_unique: false,\n label: 'First name',\n multiline_count: 1,\n sort_order: 2,\n options: [],\n },\n {\n customUpperCode: 'lastname',\n code: 'lastname',\n default_value: '',\n entity_type: 'CUSTOMER',\n frontend_class: '',\n frontend_input: 'TEXT',\n is_required: false,\n is_unique: false,\n label: 'Last name',\n multiline_count: 1,\n sort_order: 3,\n options: [],\n },\n];\n\nexport const DEFAULT_INPUTS_PROPS: Record<string, string | ''> = {\n dob: '',\n email: '',\n firstname: '',\n gender: '',\n lastname: '',\n middlename: '',\n password: '',\n prefix: '',\n suffix: '',\n taxvat: '',\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 { transformAttributesForm } from '../data/transforms';\n\nexport const simplifyTransformAttributesForm = (defaultSignUpFields: any) => {\n if (!defaultSignUpFields?.length) return [];\n\n const params = {\n data: {\n attributesForm: { items: defaultSignUpFields },\n },\n };\n\n return transformAttributesForm(params);\n};\n"],"names":["DEFAULT__SIGN_IN_EMAIL_FIELD","DEFAULT__RESET_PASSWORD_EMAIL_FIELD","DEFAULT_SIGN_UP_FIELDS","simplifyTransformAttributesForm","defaultSignUpFields","transformAttributesForm"],"mappings":"8CAiBO,MAAMA,EAA+B,CAC1C,CACE,gBAAiB,QACjB,KAAM,QACN,cAAe,GACf,YAAa,WACb,eAAgB,iCAChB,eAAgB,OAChB,YAAa,GACb,gBAAiB,EACjB,WAAY,EACZ,UAAW,GACX,MAAO,QACP,QAAS,CAAC,EACV,cAAe,CACb,CACE,KAAM,mBACN,MAAO,OAAA,CAEX,EACA,aAAc,UAAA,CAElB,EAEaC,EAGP,CACJ,CACE,gBAAiB,QACjB,KAAM,QACN,cAAe,GACf,YAAa,WACb,eAAgB,uCAChB,eAAgB,OAChB,YAAa,GACb,UAAW,GACX,MAAO,QACP,QAAS,CAAC,EACV,cAAe,CACb,CACE,KAAM,mBACN,MAAO,OAAA,CAEX,EACA,aAAc,UAAA,CAElB,EAEaC,EAAyB,CACpC,CACE,gBAAiB,QACjB,KAAM,QACN,cAAe,GACf,YAAa,WACb,eAAgB,GAChB,eAAgB,OAChB,YAAa,GACb,UAAW,GACX,MAAO,QACP,gBAAiB,EACjB,WAAY,EACZ,QAAS,CAAC,EACV,cAAe,CACb,CACE,KAAM,mBACN,MAAO,OAAA,CAEX,EACA,aAAc,UAChB,EACA,CACE,gBAAiB,YACjB,KAAM,YACN,cAAe,GACf,YAAa,WACb,eAAgB,GAChB,eAAgB,OAChB,YAAa,GACb,UAAW,GACX,MAAO,aACP,gBAAiB,EACjB,WAAY,EACZ,QAAS,CAAA,CACX,EACA,CACE,gBAAiB,WACjB,KAAM,WACN,cAAe,GACf,YAAa,WACb,eAAgB,GAChB,eAAgB,OAChB,YAAa,GACb,UAAW,GACX,MAAO,YACP,gBAAiB,EACjB,WAAY,EACZ,QAAS,CAAA,CAAC,CAEd,ECjGaC,EAAmCC,GACzCA,GAAA,MAAAA,EAAqB,OAQnBC,EANQ,CACb,KAAM,CACJ,eAAgB,CAAE,MAAOD,CAAoB,CAAA,CAEjD,CAEqC,EARI,CAAC"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  const _=t=>t.replace(/_([a-z])/g,(n,e)=>e.toUpperCase()),p=t=>t.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),m=(t,n,e)=>{const s=["string","boolean","number"],a=n==="camelCase"?_:p;return Array.isArray(t)?t.map(o=>s.includes(typeof o)||o===null?o:typeof o=="object"?m(o,n,e):o):t!==null&&typeof t=="object"?Object.entries(t).reduce((o,[i,c])=>{const r=e&&e[i]?e[i]:a(i);return o[r]=s.includes(typeof c)||c===null?c:m(c,n,e),o},{}):t},b=t=>{let n=[];for(const e of t)if(!(e.frontend_input!=="MULTILINE"||e.multiline_count<2))for(let s=2;s<=e.multiline_count;s++){const a={...e,is_required:!1,name:`${e.code}_multiline_${s}`,code:`${e.code}_multiline_${s}`,id:`${e.code}_multiline_${s}`};n.push(a)}return n},C=t=>{var o,i,c;const n=((i=(o=t==null?void 0:t.data)==null?void 0:o.attributesForm)==null?void 0:i.items)||[];if(!n.length)return[];const e=(c=n.filter(r=>{var u;return!((u=r.frontend_input)!=null&&u.includes("HIDDEN"))}))==null?void 0:c.map(({code:r,...u})=>{const l=r!=="country_id"?r:"country_code";return{...u,name:l,id:l,code:l}}),s=b(e);return e.concat(s).map(r=>{var d;const u=r.code==="firstname"?"firstName":r.code==="lastname"?"lastName":_(r.code),l=(d=r.options)==null?void 0:d.map(f=>({isDefault:f.is_default,text:f.label,value:f.value}));return m({...r,options:l,customUpperCode:u},"camelCase",{frontend_input:"fieldType",frontend_class:"className",is_required:"required",sort_order:"orderNumber"})}).sort((r,u)=>r.orderNumber-u.orderNumber)};export{m as c,C as t};
4
+ //# sourceMappingURL=transform-attributes-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-attributes-form.js","sources":["/@dropins/storefront-auth/src/lib/convertCase.ts","/@dropins/storefront-auth/src/data/transforms/transform-attributes-form.ts"],"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 convertToCamelCase = (key: string): string => {\n return key.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());\n};\n\nexport const convertToSnakeCase = (key: string): string => {\n return key.replace(/([A-Z])/g, (letter) => `_${letter.toLowerCase()}`);\n};\n\nexport const convertKeysCase = (\n data: any,\n type: 'snakeCase' | 'camelCase',\n dictionary?: Record<string, string>\n): any => {\n const typeList = ['string', 'boolean', 'number'];\n const callback =\n type === 'camelCase' ? convertToCamelCase : convertToSnakeCase;\n\n if (Array.isArray(data)) {\n return data.map((element) => {\n if (typeList.includes(typeof element) || element === null) return element;\n\n if (typeof element === 'object') {\n return convertKeysCase(element, type, dictionary);\n }\n return element;\n });\n }\n\n if (data !== null && typeof data === 'object') {\n return Object.entries(data).reduce((acc, [key, value]) => {\n const newKey =\n dictionary && dictionary[key] ? dictionary[key] : callback(key);\n acc[newKey] =\n typeList.includes(typeof value) || value === null\n ? value\n : convertKeysCase(value, type, dictionary);\n return acc;\n }, {} as Record<string, unknown>);\n }\n\n return data;\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 {\n GetAttributesFormResponse,\n ResponseAttributesFormItemsProps,\n} from '@/auth/types';\nimport { AttributesFormModel } from '../models';\nimport { convertKeysCase, convertToCamelCase } from '@/auth/lib/convertCase';\n\nexport const cloneArrayIfExists = (\n fields: ResponseAttributesFormItemsProps[]\n) => {\n let multilineItems: any = [];\n\n for (const element of fields) {\n if (element.frontend_input !== 'MULTILINE' || element.multiline_count < 2) {\n continue;\n }\n\n for (let i = 2; i <= element.multiline_count; i++) {\n const newItem = {\n ...element,\n is_required: false,\n name: `${element.code}_multiline_${i}`,\n code: `${element.code}_multiline_${i}`,\n id: `${element.code}_multiline_${i}`,\n };\n\n multilineItems.push(newItem);\n }\n }\n\n return multilineItems;\n};\n\nexport const transformAttributesForm = (\n response: GetAttributesFormResponse\n): AttributesFormModel[] => {\n const items = response?.data?.attributesForm?.items || [];\n\n if (!items.length) return [];\n\n const fields = items\n .filter((el) => !el.frontend_input?.includes('HIDDEN'))\n ?.map(({ code, ...other }) => {\n const isDefaultCode = code !== 'country_id' ? code : 'country_code';\n\n return {\n ...other,\n name: isDefaultCode,\n id: isDefaultCode,\n code: isDefaultCode,\n };\n });\n\n const multilineItems = cloneArrayIfExists(fields as any);\n\n const attributesConfig = fields\n .concat(multilineItems)\n .map((item) => {\n const customUpperCode =\n item.code === 'firstname'\n ? 'firstName'\n : item.code === 'lastname'\n ? 'lastName'\n : convertToCamelCase(item.code);\n\n const options = item.options?.map((el) => {\n return {\n isDefault: el.is_default,\n text: el.label,\n value: el.value,\n };\n });\n\n return convertKeysCase(\n { ...item, options, customUpperCode },\n 'camelCase',\n {\n frontend_input: 'fieldType',\n frontend_class: 'className',\n is_required: 'required',\n sort_order: 'orderNumber',\n }\n );\n })\n .sort(\n (a: AttributesFormModel, b: AttributesFormModel) =>\n a.orderNumber - b.orderNumber\n );\n\n return attributesConfig;\n};\n"],"names":["convertToCamelCase","key","_","letter","convertToSnakeCase","convertKeysCase","data","type","dictionary","typeList","callback","element","acc","value","newKey","cloneArrayIfExists","fields","multilineItems","i","newItem","transformAttributesForm","response","_a","_b","_c","items","el","code","other","isDefaultCode","item","customUpperCode","options","a","b"],"mappings":"AAiBa,MAAAA,EAAsBC,GAC1BA,EAAI,QAAQ,YAAa,CAACC,EAAGC,IAAWA,EAAO,aAAa,EAGxDC,EAAsBH,GAC1BA,EAAI,QAAQ,WAAaE,GAAW,IAAIA,EAAO,YAAa,CAAA,EAAE,EAG1DE,EAAkB,CAC7BC,EACAC,EACAC,IACQ,CACR,MAAMC,EAAW,CAAC,SAAU,UAAW,QAAQ,EACzCC,EACJH,IAAS,YAAcP,EAAqBI,EAE1C,OAAA,MAAM,QAAQE,CAAI,EACbA,EAAK,IAAKK,GACXF,EAAS,SAAS,OAAOE,CAAO,GAAKA,IAAY,KAAaA,EAE9D,OAAOA,GAAY,SACdN,EAAgBM,EAASJ,EAAMC,CAAU,EAE3CG,CACR,EAGCL,IAAS,MAAQ,OAAOA,GAAS,SAC5B,OAAO,QAAQA,CAAI,EAAE,OAAO,CAACM,EAAK,CAACX,EAAKY,CAAK,IAAM,CAClD,MAAAC,EACJN,GAAcA,EAAWP,CAAG,EAAIO,EAAWP,CAAG,EAAIS,EAAST,CAAG,EAChE,OAAAW,EAAIE,CAAM,EACRL,EAAS,SAAS,OAAOI,CAAK,GAAKA,IAAU,KACzCA,EACAR,EAAgBQ,EAAON,EAAMC,CAAU,EACtCI,CACT,EAAG,EAA6B,EAG3BN,CACT,EClCaS,EACXC,GACG,CACH,IAAIC,EAAsB,CAAC,EAE3B,UAAWN,KAAWK,EACpB,GAAI,EAAAL,EAAQ,iBAAmB,aAAeA,EAAQ,gBAAkB,GAIxE,QAASO,EAAI,EAAGA,GAAKP,EAAQ,gBAAiBO,IAAK,CACjD,MAAMC,EAAU,CACd,GAAGR,EACH,YAAa,GACb,KAAM,GAAGA,EAAQ,IAAI,cAAcO,CAAC,GACpC,KAAM,GAAGP,EAAQ,IAAI,cAAcO,CAAC,GACpC,GAAI,GAAGP,EAAQ,IAAI,cAAcO,CAAC,EACpC,EAEAD,EAAe,KAAKE,CAAO,CAAA,CAIxB,OAAAF,CACT,EAEaG,EACXC,GAC0B,CDnCf,IAAAC,EAAAC,EAAAC,ECoCX,MAAMC,IAAQF,GAAAD,EAAAD,GAAA,YAAAA,EAAU,OAAV,YAAAC,EAAgB,iBAAhB,YAAAC,EAAgC,QAAS,CAAC,EAExD,GAAI,CAACE,EAAM,OAAQ,MAAO,CAAC,EAE3B,MAAMT,GAASQ,EAAAC,EACZ,OAAQC,GAAO,CDzCP,IAAAJ,ECyCO,SAACA,EAAAI,EAAG,iBAAH,MAAAJ,EAAmB,SAAS,WAAS,IADzC,YAAAE,EAEX,IAAI,CAAC,CAAE,KAAAG,EAAM,GAAGC,KAAY,CACtB,MAAAC,EAAgBF,IAAS,aAAeA,EAAO,eAE9C,MAAA,CACL,GAAGC,EACH,KAAMC,EACN,GAAIA,EACJ,KAAMA,CACR,CAAA,GAGEZ,EAAiBF,EAAmBC,CAAa,EAoChD,OAlCkBA,EACtB,OAAOC,CAAc,EACrB,IAAKa,GAAS,CDzDN,IAAAR,EC0DD,MAAAS,EACJD,EAAK,OAAS,YACV,YACAA,EAAK,OAAS,WACd,WACA9B,EAAmB8B,EAAK,IAAI,EAE5BE,GAAUV,EAAAQ,EAAK,UAAL,YAAAR,EAAc,IAAKI,IAC1B,CACL,UAAWA,EAAG,WACd,KAAMA,EAAG,MACT,MAAOA,EAAG,KACZ,IAGK,OAAArB,EACL,CAAE,GAAGyB,EAAM,QAAAE,EAAS,gBAAAD,CAAgB,EACpC,YACA,CACE,eAAgB,YAChB,eAAgB,YAChB,YAAa,WACb,WAAY,aAAA,CAEhB,CACD,CAAA,EACA,KACC,CAACE,EAAwBC,IACvBD,EAAE,YAAcC,EAAE,WACtB,CAGJ"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{g as m}from"./verifyToken.js";import{useState as c,useEffect as u,useMemo as h}from"@dropins/tools/preact-hooks.js";import{useText as f}from"@dropins/tools/i18n.js";const A=()=>{const[e,n]=c(!1),[t,i]=c(null);return u(()=>{const a=sessionStorage.getItem("storeConfig"),r=a?JSON.parse(a):null;if(r){const{minLength:o,requiredCharacterClasses:s,createAccountConfirmation:g}=r;i({minLength:o,requiredCharacterClasses:s}),n(g)}else m().then(o=>{if(o){const{minLength:s,requiredCharacterClasses:g,createAccountConfirmation:l}=o;sessionStorage.setItem("storeConfig",JSON.stringify(o)),i({minLength:s,requiredCharacterClasses:g}),n(l)}})},[]),{passwordConfigs:t,isEmailConfirmationRequired:e}},L=(e,n)=>{if(n<=1)return!0;const t=/[0-9]/.test(e)?1:0,i=/[a-z]/.test(e)?1:0,a=/[A-Z]/.test(e)?1:0,r=/[^a-zA-Z0-9\s]/.test(e)?1:0;return t+i+a+r>=n},M=({passwordConfigs:e,isClickSubmit:n,password:t})=>{const i=f({messageLengthPassword:"Auth.PasswordValidationMessage.messageLengthPassword"}),[a,r]=c("pending");u(()=>{if(!e)return;const s=L(t,e.requiredCharacterClasses);n&&t.length>0?r(s?"success":"error"):n&&t.length===0?r("pending"):r(s?"success":"pending")},[n,e,t]);const o=h(()=>{var g;if(!e)return;const s={status:"pending",icon:"pending",message:(g=i.messageLengthPassword)==null?void 0:g.replace("{minLength}",`${e.minLength}`)};return t.length&&t.length>=e.minLength?{...s,icon:"success",status:"success"}:t.length&&t.length<e.minLength?n?{...s,icon:"error",status:"error"}:{...s,icon:"pending",status:"pending"}:s},[e,i.messageLengthPassword,t==null?void 0:t.length,n]);return{isValidUniqueSymbols:a,defaultLengthMessage:o}};export{M as a,A as u,L as v};
4
+ //# sourceMappingURL=usePasswordValidationMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePasswordValidationMessage.js","sources":["/@dropins/storefront-auth/src/hooks/api/useGetStoreConfigs.tsx","/@dropins/storefront-auth/src/lib/validationUniqueSymbolsPassword.ts","/@dropins/storefront-auth/src/hooks/components/usePasswordValidationMessage.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\nimport { getStoreConfig } from '@/auth/api';\nimport { useEffect, useState } from 'preact/hooks';\nimport { StoreConfigModel } from '../../data/models';\n\nexport const useGetStoreConfigs = () => {\n const [isEmailConfirmationRequired, setIsEmailConfirmationRequired] =\n useState(false);\n const [passwordConfigs, setPasswordConfigs] = useState<{\n minLength: number;\n requiredCharacterClasses: number;\n } | null>(null);\n\n useEffect(() => {\n const storeConfigString = sessionStorage.getItem('storeConfig');\n\n const cachedStoreConfig: StoreConfigModel = storeConfigString\n ? JSON.parse(storeConfigString)\n : null;\n\n if (cachedStoreConfig) {\n const { minLength, requiredCharacterClasses, createAccountConfirmation } =\n cachedStoreConfig;\n\n setPasswordConfigs({\n minLength,\n requiredCharacterClasses,\n });\n\n setIsEmailConfirmationRequired(createAccountConfirmation);\n } else {\n getStoreConfig().then((response) => {\n if (response) {\n const {\n minLength,\n requiredCharacterClasses,\n createAccountConfirmation,\n } = response;\n\n sessionStorage.setItem('storeConfig', JSON.stringify(response));\n\n setPasswordConfigs({\n minLength,\n requiredCharacterClasses,\n });\n\n setIsEmailConfirmationRequired(createAccountConfirmation);\n }\n });\n }\n }, []);\n\n return { passwordConfigs, isEmailConfirmationRequired };\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 validationUniqueSymbolsPassword = (\n password: string,\n uniqueSymbolsCount: number\n) => {\n if (uniqueSymbolsCount <= 1) return true;\n\n const numbers = /[0-9]/.test(password) ? 1 : 0;\n const lowerCaseLetter = /[a-z]/.test(password) ? 1 : 0;\n const upperCaseLetter = /[A-Z]/.test(password) ? 1 : 0;\n const specialSymbols = /[^a-zA-Z0-9\\s]/.test(password) ? 1 : 0;\n\n return (\n numbers + lowerCaseLetter + upperCaseLetter + specialSymbols >=\n uniqueSymbolsCount\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 { validationUniqueSymbolsPassword } from '@/auth/lib/validationUniqueSymbolsPassword';\nimport { useEffect, useMemo, useState } from 'preact/hooks';\nimport { ValidateLengthConfigProps, statusTypes } from '@/auth/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\ninterface UsePasswordValidationMessageProps {\n passwordConfigs: {\n minLength: number;\n requiredCharacterClasses: number;\n } | null;\n isClickSubmit: boolean;\n password: string;\n}\n\nexport const usePasswordValidationMessage = ({\n passwordConfigs,\n isClickSubmit,\n password,\n}: UsePasswordValidationMessageProps) => {\n const translations = useText({\n messageLengthPassword:\n 'Auth.PasswordValidationMessage.messageLengthPassword',\n });\n\n const [isValidUniqueSymbols, setIsValidUniqueSymbols] =\n useState<statusTypes>('pending');\n\n useEffect(() => {\n if (!passwordConfigs) return;\n\n const result = validationUniqueSymbolsPassword(\n password,\n passwordConfigs.requiredCharacterClasses\n );\n\n if (isClickSubmit && password.length > 0) {\n result\n ? setIsValidUniqueSymbols('success')\n : setIsValidUniqueSymbols('error');\n } else if (isClickSubmit && password.length === 0) {\n setIsValidUniqueSymbols('pending');\n } else {\n result\n ? setIsValidUniqueSymbols('success')\n : setIsValidUniqueSymbols('pending');\n }\n }, [isClickSubmit, passwordConfigs, password]);\n\n const defaultLengthMessage: ValidateLengthConfigProps | undefined =\n useMemo(() => {\n if (!passwordConfigs) return;\n\n const defaultMessage: ValidateLengthConfigProps = {\n status: 'pending',\n icon: 'pending',\n message: translations.messageLengthPassword?.replace(\n '{minLength}',\n `${passwordConfigs.minLength}`\n ),\n };\n\n if (password.length && password.length >= passwordConfigs.minLength) {\n return { ...defaultMessage, icon: 'success', status: 'success' };\n }\n\n if (password.length && password.length < passwordConfigs.minLength) {\n return isClickSubmit\n ? { ...defaultMessage, icon: 'error', status: 'error' }\n : { ...defaultMessage, icon: 'pending', status: 'pending' };\n }\n\n return defaultMessage;\n }, [\n passwordConfigs,\n translations.messageLengthPassword,\n password?.length,\n isClickSubmit,\n ]);\n\n return { isValidUniqueSymbols, defaultLengthMessage };\n};\n"],"names":["useGetStoreConfigs","isEmailConfirmationRequired","setIsEmailConfirmationRequired","useState","passwordConfigs","setPasswordConfigs","useEffect","storeConfigString","cachedStoreConfig","minLength","requiredCharacterClasses","createAccountConfirmation","getStoreConfig","response","validationUniqueSymbolsPassword","password","uniqueSymbolsCount","numbers","lowerCaseLetter","upperCaseLetter","specialSymbols","usePasswordValidationMessage","isClickSubmit","translations","useText","isValidUniqueSymbols","setIsValidUniqueSymbols","result","defaultLengthMessage","useMemo","defaultMessage","_a"],"mappings":"oPAqBO,MAAMA,EAAqB,IAAM,CACtC,KAAM,CAACC,EAA6BC,CAA8B,EAChEC,EAAS,EAAK,EACV,CAACC,EAAiBC,CAAkB,EAAIF,EAGpC,IAAI,EAEd,OAAAG,EAAU,IAAM,CACR,MAAAC,EAAoB,eAAe,QAAQ,aAAa,EAExDC,EAAsCD,EACxC,KAAK,MAAMA,CAAiB,EAC5B,KAEJ,GAAIC,EAAmB,CACrB,KAAM,CAAE,UAAAC,EAAW,yBAAAC,EAA0B,0BAAAC,CAC3C,EAAAH,EAEiBH,EAAA,CACjB,UAAAI,EACA,yBAAAC,CAAA,CACD,EAEDR,EAA+BS,CAAyB,CAAA,MAEzCC,EAAA,EAAE,KAAMC,GAAa,CAClC,GAAIA,EAAU,CACN,KAAA,CACJ,UAAAJ,EACA,yBAAAC,EACA,0BAAAC,CAAA,EACEE,EAEJ,eAAe,QAAQ,cAAe,KAAK,UAAUA,CAAQ,CAAC,EAE3CR,EAAA,CACjB,UAAAI,EACA,yBAAAC,CAAA,CACD,EAEDR,EAA+BS,CAAyB,CAAA,CAC1D,CACD,CAEL,EAAG,EAAE,EAEE,CAAE,gBAAAP,EAAiB,4BAAAH,CAA4B,CACxD,ECpDaa,EAAkC,CAC7CC,EACAC,IACG,CACC,GAAAA,GAAsB,EAAU,MAAA,GAEpC,MAAMC,EAAU,QAAQ,KAAKF,CAAQ,EAAI,EAAI,EACvCG,EAAkB,QAAQ,KAAKH,CAAQ,EAAI,EAAI,EAC/CI,EAAkB,QAAQ,KAAKJ,CAAQ,EAAI,EAAI,EAC/CK,EAAiB,iBAAiB,KAAKL,CAAQ,EAAI,EAAI,EAG3D,OAAAE,EAAUC,EAAkBC,EAAkBC,GAC9CJ,CAEJ,ECDaK,EAA+B,CAAC,CAC3C,gBAAAjB,EACA,cAAAkB,EACA,SAAAP,CACF,IAAyC,CACvC,MAAMQ,EAAeC,EAAQ,CAC3B,sBACE,sDAAA,CACH,EAEK,CAACC,EAAsBC,CAAuB,EAClDvB,EAAsB,SAAS,EAEjCG,EAAU,IAAM,CACd,GAAI,CAACF,EAAiB,OAEtB,MAAMuB,EAASb,EACbC,EACAX,EAAgB,wBAClB,EAEIkB,GAAiBP,EAAS,OAAS,EAEjCW,EADJC,EAC4B,UACA,OADS,EAE5BL,GAAiBP,EAAS,SAAW,EAC9CW,EAAwB,SAAS,EAG7BA,EADJC,EAC4B,UACA,SADS,CAGtC,EAAA,CAACL,EAAelB,EAAiBW,CAAQ,CAAC,EAEvC,MAAAa,EACJC,EAAQ,IAAM,OACZ,GAAI,CAACzB,EAAiB,OAEtB,MAAM0B,EAA4C,CAChD,OAAQ,UACR,KAAM,UACN,SAASC,EAAAR,EAAa,wBAAb,YAAAQ,EAAoC,QAC3C,cACA,GAAG3B,EAAgB,SAAS,GAEhC,EAEA,OAAIW,EAAS,QAAUA,EAAS,QAAUX,EAAgB,UACjD,CAAE,GAAG0B,EAAgB,KAAM,UAAW,OAAQ,SAAU,EAG7Df,EAAS,QAAUA,EAAS,OAASX,EAAgB,UAChDkB,EACH,CAAE,GAAGQ,EAAgB,KAAM,QAAS,OAAQ,OAAQ,EACpD,CAAE,GAAGA,EAAgB,KAAM,UAAW,OAAQ,SAAU,EAGvDA,CAAA,EACN,CACD1B,EACAmB,EAAa,sBACbR,GAAA,YAAAA,EAAU,OACVO,CAAA,CACD,EAEI,MAAA,CAAE,qBAAAG,EAAsB,qBAAAG,CAAqB,CACtD"}
@@ -21,3 +21,4 @@ import{events as f}from"@dropins/tools/event-bus.js";import"@dropins/tools/recap
21
21
  }
22
22
  }
23
23
  `,q=async(t="Authorization",o="Bearer")=>{const e=T(h.auth_dropin_user_token);if(f.emit("authenticated",!!e),!!e)return l(t,`${o} ${e}`),d(I).then(r=>{var a;(a=r.errors)!=null&&a.find(i=>{var n;return((n=i.extensions)==null?void 0:n.category)==="graphql-authentication"})&&(O(h.auth_dropin_user_token),C(t),f.emit("authenticated",!1))})};export{h as C,N as a,O as d,A as g,E as h,q as v};
24
+ //# sourceMappingURL=verifyToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyToken.js","sources":["/@dropins/storefront-auth/src/configs/cookieConfigs.ts","/@dropins/storefront-auth/src/data/transforms/transform-store-config.ts","/@dropins/storefront-auth/src/lib/fetch-error.ts","/@dropins/storefront-auth/src/lib/cookieUtils.ts","/@dropins/storefront-auth/src/api/getStoreConfig/graphql/getStoreConfig.graphql.ts","/@dropins/storefront-auth/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-auth/src/api/verifyToken/graphql/verifyToken.graphql.ts","/@dropins/storefront-auth/src/api/verifyToken/verifyToken.ts"],"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\nconst COOKIE_NAMES = {\n auth_dropin_user_token: 'auth_dropin_user_token',\n auth_dropin_firstname: 'auth_dropin_firstname',\n};\n\nconst COOKIE_LIFETIME = 3600;\n\nexport { COOKIE_NAMES, COOKIE_LIFETIME };\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 { getStoreConfigResponse } from '@/auth/types';\nimport { COOKIE_LIFETIME } from '@/auth/configs/cookieConfigs';\nimport { StoreConfigModel } from '../models';\n\nexport const transformStoreConfig = (\n response: getStoreConfigResponse\n): StoreConfigModel => {\n return {\n autocompleteOnStorefront:\n response?.data?.storeConfig?.autocomplete_on_storefront || false,\n // Need information about min length in response undefined\n minLength: response?.data?.storeConfig?.minimum_password_length || 3,\n requiredCharacterClasses:\n +response?.data?.storeConfig?.required_character_classes_number || 0,\n createAccountConfirmation:\n response?.data?.storeConfig?.create_account_confirmation || false,\n customerAccessTokenLifetime:\n response?.data?.storeConfig?.customer_access_token_lifetime *\n COOKIE_LIFETIME || COOKIE_LIFETIME,\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/** Actions */\nexport const handleFetchError = (errors: Array<{ message: string }>) => {\n const errorMessage = errors.map((e: any) => e.message).join(' ');\n\n throw Error(errorMessage);\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/* eslint-disable no-useless-escape */\nimport { getStoreConfig } from '@/auth/api';\nimport { COOKIE_LIFETIME } from '@/auth/configs/cookieConfigs';\n\nexport const getCookie = (cookieName: string) => {\n const cookies = document.cookie.split(';');\n let foundValue;\n\n cookies.forEach((cookie) => {\n const [name, value] = cookie.trim().split('=');\n if (name === cookieName) {\n foundValue = decodeURIComponent(value);\n }\n });\n\n return foundValue;\n};\n\nexport const deleteCookie = (cookieName: string) => {\n document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;\n};\n\nexport const getCookiesLifetime = async () => {\n try {\n const storeConfigString = sessionStorage.getItem('storeConfig');\n const cachedStoreConfig = storeConfigString\n ? JSON.parse(storeConfigString)\n : {};\n\n let accessTokenLifeTime = cachedStoreConfig.customerAccessTokenLifetime;\n\n if (!accessTokenLifeTime) {\n const storeConfig = await getStoreConfig();\n\n sessionStorage.setItem('storeConfig', JSON.stringify(storeConfig));\n\n accessTokenLifeTime =\n storeConfig?.customerAccessTokenLifetime || COOKIE_LIFETIME;\n }\n\n return `Max-Age=${accessTokenLifeTime}`;\n } catch (error) {\n console.error('getCookiesLifetime() Error:', error);\n return `Max-Age=${COOKIE_LIFETIME}`;\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 const GET_STORE_CONFIG = /* GraphQL */ `\n query GET_STORE_CONFIG {\n storeConfig {\n autocomplete_on_storefront\n minimum_password_length\n required_character_classes_number\n store_code\n store_name\n store_group_code\n locale\n create_account_confirmation\n customer_access_token_lifetime\n }\n }\n`;\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 { getStoreConfigResponse } from '@/auth/types';\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { GET_STORE_CONFIG } from './graphql/getStoreConfig.graphql';\nimport { handleNetworkError } from '@/auth/lib/network-error';\nimport { transformStoreConfig } from '@/auth/data/transforms';\nimport { StoreConfigModel } from '@/auth/data/models';\nimport { handleFetchError } from '@/auth/lib/fetch-error';\n\nexport const getStoreConfig = async (): Promise<StoreConfigModel> => {\n return await fetchGraphQl(GET_STORE_CONFIG, {\n method: 'GET',\n cache: 'force-cache',\n })\n .then((response: getStoreConfigResponse) => {\n if (response.errors?.length) return handleFetchError(response.errors);\n\n return transformStoreConfig(response);\n })\n .catch(handleNetworkError);\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 VALIDATE_CUSTOMER_TOKEN = /* GraphQL */ `\n query VALIDATE_TOKEN {\n customerCart {\n 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 { events } from '@adobe-commerce/event-bus';\nimport {\n fetchGraphQl,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeader,\n} from '../fetch-graphql';\nimport { deleteCookie, getCookie } from '@/auth/lib/cookieUtils';\nimport { COOKIE_NAMES } from '@/auth/configs/cookieConfigs';\nimport { VALIDATE_CUSTOMER_TOKEN } from './graphql/verifyToken.graphql';\n\nexport const verifyToken = async (\n authType = 'Authorization',\n type = 'Bearer'\n) => {\n const token = getCookie(COOKIE_NAMES.auth_dropin_user_token);\n\n events.emit('authenticated', !!token);\n\n if (!token) return;\n\n setFetchGraphQlHeader(authType, `${type} ${token}`);\n\n return fetchGraphQl(VALIDATE_CUSTOMER_TOKEN).then((res) => {\n const unauthenticated = !!res.errors?.find(\n (error) => error.extensions?.category === 'graphql-authentication'\n );\n\n if (!unauthenticated) return;\n\n deleteCookie(COOKIE_NAMES.auth_dropin_user_token);\n removeFetchGraphQlHeader(authType);\n events.emit('authenticated', false);\n });\n};\n"],"names":["COOKIE_NAMES","COOKIE_LIFETIME","transformStoreConfig","response","_b","_a","_d","_c","_f","_e","_h","_g","_j","_i","handleFetchError","errors","errorMessage","getCookie","cookieName","cookies","foundValue","cookie","name","value","deleteCookie","getCookiesLifetime","storeConfigString","accessTokenLifeTime","storeConfig","getStoreConfig","error","GET_STORE_CONFIG","fetchGraphQl","handleNetworkError","VALIDATE_CUSTOMER_TOKEN","verifyToken","authType","type","token","events","setFetchGraphQlHeader","res","removeFetchGraphQlHeader"],"mappings":"qJAiBA,MAAMA,EAAe,CACnB,uBAAwB,yBACxB,sBAAuB,uBACzB,EAEMC,EAAkB,KCDXC,EACXC,GACqB,yBACd,MAAA,CACL,2BACEC,GAAAC,EAAAF,GAAA,YAAAA,EAAU,OAAV,YAAAE,EAAgB,cAAhB,YAAAD,EAA6B,6BAA8B,GAE7D,YAAWE,GAAAC,EAAAJ,GAAA,YAAAA,EAAU,OAAV,YAAAI,EAAgB,cAAhB,YAAAD,EAA6B,0BAA2B,EACnE,yBACE,GAACE,GAAAC,EAAAN,GAAA,YAAAA,EAAU,OAAV,YAAAM,EAAgB,cAAhB,YAAAD,EAA6B,oCAAqC,EACrE,4BACEE,GAAAC,EAAAR,GAAA,YAAAA,EAAU,OAAV,YAAAQ,EAAgB,cAAhB,YAAAD,EAA6B,8BAA+B,GAC9D,8BACEE,GAAAC,EAAAV,GAAA,YAAAA,EAAU,OAAV,YAAAU,EAAgB,cAAhB,YAAAD,EAA6B,gCAC3BX,GAAmBA,CACzB,CACF,ECnBaa,EAAoBC,GAAuC,CAChE,MAAAC,EAAeD,EAAO,IAAK,GAAW,EAAE,OAAO,EAAE,KAAK,GAAG,EAE/D,MAAM,MAAMC,CAAY,CAC1B,ECDaC,EAAaC,GAAuB,CAC/C,MAAMC,EAAU,SAAS,OAAO,MAAM,GAAG,EACrC,IAAAC,EAEI,OAAAD,EAAA,QAASE,GAAW,CACpB,KAAA,CAACC,EAAMC,CAAK,EAAIF,EAAO,KAAK,EAAE,MAAM,GAAG,EACzCC,IAASJ,IACXE,EAAa,mBAAmBG,CAAK,EACvC,CACD,EAEMH,CACT,EAEaI,EAAgBN,GAAuB,CACzC,SAAA,OAAS,GAAGA,CAAU,mDACjC,EAEaO,EAAqB,SAAY,CACxC,GAAA,CACI,MAAAC,EAAoB,eAAe,QAAQ,aAAa,EAK9D,IAAIC,GAJsBD,EACtB,KAAK,MAAMA,CAAiB,EAC5B,CAAC,GAEuC,4BAE5C,GAAI,CAACC,EAAqB,CAClB,MAAAC,EAAc,MAAMC,EAAe,EAEzC,eAAe,QAAQ,cAAe,KAAK,UAAUD,CAAW,CAAC,EAEjED,GACEC,GAAA,YAAAA,EAAa,8BAA+B3B,CAAA,CAGhD,MAAO,WAAW0B,CAAmB,SAC9BG,EAAO,CACN,eAAA,MAAM,8BAA+BA,CAAK,EAC3C,WAAW7B,CAAe,EAAA,CAErC,EC7Ca8B,EAAiC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECQjCF,EAAiB,SACrB,MAAMG,EAAaD,EAAkB,CAC1C,OAAQ,MACR,MAAO,aAAA,CACR,EACE,KAAM5B,GAAqC,OAC1C,OAAIE,EAAAF,EAAS,SAAT,MAAAE,EAAiB,OAAeS,EAAiBX,EAAS,MAAM,EAE7DD,EAAqBC,CAAQ,CAAA,CACrC,EACA,MAAM8B,CAAkB,EClBhBC,EAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECUxCC,EAAc,MACzBC,EAAW,gBACXC,EAAO,WACJ,CACG,MAAAC,EAAQrB,EAAUjB,EAAa,sBAAsB,EAI3D,GAFAuC,EAAO,KAAK,gBAAiB,CAAC,CAACD,CAAK,EAEhC,EAACA,EAEL,OAAAE,EAAsBJ,EAAU,GAAGC,CAAI,IAAIC,CAAK,EAAE,EAE3CN,EAAaE,CAAuB,EAAE,KAAMO,GAAQ,QAC/BpC,EAAAoC,EAAI,SAAJ,MAAApC,EAAY,KACnCyB,GAAU,OAAA,QAAAzB,EAAAyB,EAAM,aAAN,YAAAzB,EAAkB,YAAa,6BAK5CmB,EAAaxB,EAAa,sBAAsB,EAChD0C,EAAyBN,CAAQ,EAC1BG,EAAA,KAAK,gBAAiB,EAAK,EAAA,CACnC,CACH"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{jsx as i}from"@dropins/tools/preact-jsx-runtime.js";import{lazy as d,Suspense as E}from"@dropins/tools/preact-compat.js";import{useState as S,useMemo as P}from"@dropins/tools/preact-hooks.js";import{S as y}from"../chunks/SkeletonLoader.js";import"@dropins/tools/components.js";const L=function(){const r=typeof document<"u"&&document.createElement("link").relList;return r&&r.supports&&r.supports("modulepreload")?"modulepreload":"preload"}(),k=function(l){return"/"+l},f={},p=function(r,c,u){let a=Promise.resolve();if(c&&c.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),t=(e==null?void 0:e.nonce)||(e==null?void 0:e.getAttribute("nonce"));a=Promise.allSettled(c.map(o=>{if(o=k(o),o in f)return;f[o]=!0;const m=o.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${h}`))return;const n=document.createElement("link");if(n.rel=m?"stylesheet":L,m||(n.as="script"),n.crossOrigin="",n.href=o,t&&n.setAttribute("nonce",t),document.head.appendChild(n),m)return new Promise((_,v)=>{n.addEventListener("load",_),n.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${o}`)))})}))}function s(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return a.then(e=>{for(const t of e||[])t.status==="rejected"&&s(t.reason);return r().catch(s)})},b=d(()=>p(()=>import("../chunks/index.js"),[])),w=d(()=>p(()=>import("../chunks/index2.js"),[])),A=d(()=>p(()=>import("../chunks/index3.js"),[])),O=({defaultView:l="signInForm",signInFormConfig:r,signUpFormConfig:c,resetPasswordFormConfig:u})=>{const[a,s]=S(l),e=P(()=>({signInForm:i(w,{setActiveComponent:s,...r}),signUpForm:i(A,{setActiveComponent:s,...c}),resetPasswordForm:i(b,{setActiveComponent:s,...u})}),[u,r,c,s]);return i("div",{children:i(E,{fallback:i(y,{activeSkeleton:a}),children:i("div",{className:"auth-combine",children:e[a]})})})};export{O as AuthCombine,O as default};
4
+ //# sourceMappingURL=AuthCombine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":"m5CAuBMA,EAAoBC,EACxB,UAAM,OAAO,oBAAqC,KACpD,EACMC,EAAaD,EAAK,IAAME,EAAA,WAAO,qBAA8B,EAAC,KAC9DC,EAAaH,EAAK,IAAME,EAAA,WAAO,qBAA8B,EAAC,KAEvDE,EAA2C,CAAC,CACvD,YAAAC,EAAc,aACd,iBAAAC,EACA,iBAAAC,EACA,wBAAAC,CACF,IAAM,CACJ,KAAM,CAACC,EAAiBC,CAAkB,EACxCC,EAA8BN,CAAW,EAErCO,EAAkBC,EACtB,KAAO,CACL,WACEC,EAACb,EAAA,CACC,mBAAAS,EACC,GAAGJ,CAAA,CACN,EAEF,WACEQ,EAACX,EAAA,CACC,mBAAAO,EACC,GAAGH,CAAA,CACN,EAEF,kBACEO,EAACf,EAAA,CACC,mBAAAW,EACC,GAAGF,CAAA,EACN,GAGJ,CACEA,EACAF,EACAC,EACAG,CAAA,CAEJ,EAEA,SACG,MACC,UAAAI,EAACC,GAAS,SAAUD,EAACE,GAAe,eAAgBP,CAAA,CAAiB,EACnE,SAAAK,EAAC,OAAI,UAAU,eAAgB,WAAgBL,CAAe,EAAE,EAClE,CACF,EAEJ","names":["ResetPasswordForm","lazy","SignInForm","__vitePreload","SignUpForm","AuthCombine","defaultView","signInFormConfig","signUpFormConfig","resetPasswordFormConfig","activeComponent","setActiveComponent","useState","renderComponent","useMemo","jsx","Suspense","SkeletonLoader"],"ignoreList":[],"sources":["/@dropins/storefront-auth/src/containers/AuthCombine/AuthCombine.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\nimport { Suspense, lazy } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useMemo, useState } from 'preact/hooks';\nimport { AuthCombineProps, activeComponentType } from '@/auth/types';\nimport SkeletonLoader from '@/auth/components/SkeletonLoader';\n\nconst ResetPasswordForm = lazy(\n () => import('@/auth/components/ResetPasswordForm')\n);\nconst SignInForm = lazy(() => import('@/auth/components/SignInForm'));\nconst SignUpForm = lazy(() => import('@/auth/components/SignUpForm'));\n\nexport const AuthCombine: Container<AuthCombineProps> = ({\n defaultView = 'signInForm',\n signInFormConfig,\n signUpFormConfig,\n resetPasswordFormConfig,\n}) => {\n const [activeComponent, setActiveComponent] =\n useState<activeComponentType>(defaultView);\n\n const renderComponent = useMemo(\n () => ({\n signInForm: (\n <SignInForm\n setActiveComponent={setActiveComponent}\n {...signInFormConfig}\n />\n ),\n signUpForm: (\n <SignUpForm\n setActiveComponent={setActiveComponent}\n {...signUpFormConfig}\n />\n ),\n resetPasswordForm: (\n <ResetPasswordForm\n setActiveComponent={setActiveComponent}\n {...resetPasswordFormConfig}\n />\n ),\n }),\n [\n resetPasswordFormConfig,\n signInFormConfig,\n signUpFormConfig,\n setActiveComponent,\n ]\n );\n\n return (\n <div>\n <Suspense fallback={<SkeletonLoader activeSkeleton={activeComponent} />}>\n <div className=\"auth-combine\">{renderComponent[activeComponent]}</div>\n </Suspense>\n </div>\n );\n};\n"],"file":"containers/AuthCombine.js"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/preact-hooks.js";import"../chunks/Button.js";import"@dropins/tools/i18n.js";import{R as p}from"../chunks/ResetPasswordForm.js";import"@dropins/tools/preact-compat.js";import"../chunks/requestPasswordResetEmail.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/setReCaptchaToken.js";import"../chunks/Button2.js";import"../chunks/simplifyTransformAttributesForm.js";import"../chunks/transform-attributes-form.js";const N=({formSize:o,routeSignIn:t,onErrorCallback:m,onSuccessCallback:i})=>r("div",{className:"auth-reset-password",children:r(p,{formSize:o,routeSignIn:t,onErrorCallback:m,onSuccessCallback:i})});export{N as ResetPassword,N as default};
4
+ //# sourceMappingURL=ResetPassword.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPassword.js","sources":["/@dropins/storefront-auth/src/containers/ResetPassword/ResetPassword.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\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { ResetPasswordForm } from '@/auth/components';\nimport { ResetPasswordProps } from '@/auth/types';\n\nexport const ResetPassword: Container<ResetPasswordProps> = ({\n formSize,\n routeSignIn,\n onErrorCallback,\n onSuccessCallback,\n}) => {\n return (\n <div className=\"auth-reset-password\">\n <ResetPasswordForm\n formSize={formSize}\n routeSignIn={routeSignIn}\n onErrorCallback={onErrorCallback}\n onSuccessCallback={onSuccessCallback}\n />\n </div>\n );\n};\n"],"names":["ResetPassword","formSize","routeSignIn","onErrorCallback","onSuccessCallback","jsx","ResetPasswordForm"],"mappings":"qqBAqBO,MAAMA,EAA+C,CAAC,CAC3D,SAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,kBAAAC,CACF,IAEIC,EAAC,MAAI,CAAA,UAAU,sBACb,SAAAA,EAACC,EAAA,CACC,SAAAL,EACA,YAAAC,EACA,gBAAAC,EACA,kBAAAC,CAAA,CAAA,EAEJ"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/preact-hooks.js";import"../chunks/Button.js";import"@dropins/tools/i18n.js";import{S as u}from"../chunks/SignInForm.js";import"@dropins/tools/preact-compat.js";import"../chunks/Button2.js";import"../chunks/getCustomerToken.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/initialize.js";import"../chunks/verifyToken.js";import"../fragments.js";import"../chunks/acdl.js";import"../chunks/setReCaptchaToken.js";import"../chunks/resendConfirmationEmail.js";import"../chunks/simplifyTransformAttributesForm.js";import"../chunks/transform-attributes-form.js";import"../chunks/focusOnEmptyPasswordField.js";import"../chunks/confirmEmail.js";const M=({slots:i,labels:o,enableEmailConfirmation:t,initialEmailValue:m,formSize:p,renderSignUpLink:n,hideCloseBtnOnEmailConfirmation:s,routeRedirectOnEmailConfirmationClose:a,routeRedirectOnSignIn:e,routeForgotPassword:c,routeSignUp:d,onSuccessCallback:f,onErrorCallback:g,onSignUpLinkClick:l})=>r("div",{className:"auth-sign-in",children:r(u,{slots:i,labels:o,formSize:p,renderSignUpLink:n,initialEmailValue:m,enableEmailConfirmation:t,hideCloseBtnOnEmailConfirmation:s,routeRedirectOnEmailConfirmationClose:a,routeSignUp:d,onErrorCallback:g,onSuccessCallback:f,onSignUpLinkClick:l,routeForgotPassword:c,routeRedirectOnSignIn:e})});export{M as SignIn,M as default};
4
+ //# sourceMappingURL=SignIn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignIn.js","sources":["/@dropins/storefront-auth/src/containers/SignIn/SignIn.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\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { SignInForm } from '@/auth/components';\nimport { SignInProps } from '@/auth/types';\n\nexport const SignIn: Container<SignInProps> = ({\n slots,\n labels,\n enableEmailConfirmation,\n initialEmailValue,\n formSize,\n renderSignUpLink,\n hideCloseBtnOnEmailConfirmation,\n routeRedirectOnEmailConfirmationClose,\n routeRedirectOnSignIn,\n routeForgotPassword,\n routeSignUp,\n onSuccessCallback,\n onErrorCallback,\n onSignUpLinkClick,\n}) => {\n return (\n <div className=\"auth-sign-in\">\n <SignInForm\n slots={slots}\n labels={labels}\n formSize={formSize}\n renderSignUpLink={renderSignUpLink}\n initialEmailValue={initialEmailValue}\n enableEmailConfirmation={enableEmailConfirmation}\n hideCloseBtnOnEmailConfirmation={hideCloseBtnOnEmailConfirmation}\n routeRedirectOnEmailConfirmationClose={\n routeRedirectOnEmailConfirmationClose\n }\n routeSignUp={routeSignUp}\n onErrorCallback={onErrorCallback}\n onSuccessCallback={onSuccessCallback}\n onSignUpLinkClick={onSignUpLinkClick}\n routeForgotPassword={routeForgotPassword}\n routeRedirectOnSignIn={routeRedirectOnSignIn}\n />\n </div>\n );\n};\n"],"names":["SignIn","slots","labels","enableEmailConfirmation","initialEmailValue","formSize","renderSignUpLink","hideCloseBtnOnEmailConfirmation","routeRedirectOnEmailConfirmationClose","routeRedirectOnSignIn","routeForgotPassword","routeSignUp","onSuccessCallback","onErrorCallback","onSignUpLinkClick","jsx","SignInForm"],"mappings":"s4BAqBO,MAAMA,EAAiC,CAAC,CAC7C,MAAAC,EACA,OAAAC,EACA,wBAAAC,EACA,kBAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,gCAAAC,EACA,sCAAAC,EACA,sBAAAC,EACA,oBAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,kBAAAC,CACF,IAEIC,EAAC,MAAI,CAAA,UAAU,eACb,SAAAA,EAACC,EAAA,CACC,MAAAf,EACA,OAAAC,EACA,SAAAG,EACA,iBAAAC,EACA,kBAAAF,EACA,wBAAAD,EACA,gCAAAI,EACA,sCAAAC,EAGA,YAAAG,EACA,gBAAAE,EACA,kBAAAD,EACA,kBAAAE,EACA,oBAAAJ,EACA,sBAAAD,CAAA,CAAA,EAEJ"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/preact-hooks.js";import"../chunks/Button.js";import"@dropins/tools/i18n.js";import{S as l}from"../chunks/SignUpForm.js";import"@dropins/tools/preact-compat.js";import"../chunks/createCustomerAddress.js";import"../fragments.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/setReCaptchaToken.js";import"../chunks/initialize.js";import"../chunks/verifyToken.js";import"../chunks/transform-attributes-form.js";import"../chunks/simplifyTransformAttributesForm.js";import"../chunks/usePasswordValidationMessage.js";import"../chunks/getCustomerToken.js";import"../chunks/acdl.js";import"../chunks/Button2.js";import"../chunks/focusOnEmptyPasswordField.js";import"../chunks/resendConfirmationEmail.js";import"../chunks/SkeletonLoader.js";const O=({slots:i,formSize:o,apiVersion2:t,addressesData:m,isAutoSignInEnabled:p,requireRetypePassword:s,inputsDefaultValueSet:a,fieldsConfigForApiVersion1:n,hideCloseBtnOnEmailConfirmation:e,routeRedirectOnEmailConfirmationClose:u,routeRedirectOnSignIn:c,onSuccessCallback:d,onErrorCallback:f,routeSignIn:g})=>r("div",{className:"auth-sign-up",children:r(l,{requireRetypePassword:s,formSize:o,apiVersion2:t,addressesData:m,isAutoSignInEnabled:p,inputsDefaultValueSet:a,fieldsConfigForApiVersion1:n,hideCloseBtnOnEmailConfirmation:e,routeRedirectOnEmailConfirmationClose:u,routeRedirectOnSignIn:c,routeSignIn:g,slots:i,onErrorCallback:f,onSuccessCallback:d})});export{O as SignUp,O as default};
4
+ //# sourceMappingURL=SignUp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignUp.js","sources":["/@dropins/storefront-auth/src/containers/SignUp/SignUp.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\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { SignUpForm } from '@/auth/components';\nimport { SignUpProps } from '@/auth/types';\n\nexport const SignUp: Container<SignUpProps> = ({\n slots,\n formSize,\n apiVersion2,\n addressesData,\n isAutoSignInEnabled,\n requireRetypePassword,\n inputsDefaultValueSet,\n fieldsConfigForApiVersion1,\n hideCloseBtnOnEmailConfirmation,\n routeRedirectOnEmailConfirmationClose,\n routeRedirectOnSignIn,\n onSuccessCallback,\n onErrorCallback,\n routeSignIn,\n}) => {\n return (\n <div className=\"auth-sign-up\">\n <SignUpForm\n requireRetypePassword={requireRetypePassword}\n formSize={formSize}\n apiVersion2={apiVersion2}\n addressesData={addressesData}\n isAutoSignInEnabled={isAutoSignInEnabled}\n inputsDefaultValueSet={inputsDefaultValueSet}\n fieldsConfigForApiVersion1={fieldsConfigForApiVersion1}\n hideCloseBtnOnEmailConfirmation={hideCloseBtnOnEmailConfirmation}\n routeRedirectOnEmailConfirmationClose={\n routeRedirectOnEmailConfirmationClose\n }\n routeRedirectOnSignIn={routeRedirectOnSignIn}\n routeSignIn={routeSignIn}\n slots={slots}\n onErrorCallback={onErrorCallback}\n onSuccessCallback={onSuccessCallback}\n />\n </div>\n );\n};\n"],"names":["SignUp","slots","formSize","apiVersion2","addressesData","isAutoSignInEnabled","requireRetypePassword","inputsDefaultValueSet","fieldsConfigForApiVersion1","hideCloseBtnOnEmailConfirmation","routeRedirectOnEmailConfirmationClose","routeRedirectOnSignIn","onSuccessCallback","onErrorCallback","routeSignIn","jsx","SignUpForm"],"mappings":"q+BAqBO,MAAMA,EAAiC,CAAC,CAC7C,MAAAC,EACA,SAAAC,EACA,YAAAC,EACA,cAAAC,EACA,oBAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,2BAAAC,EACA,gCAAAC,EACA,sCAAAC,EACA,sBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,YAAAC,CACF,IAEIC,EAAC,MAAI,CAAA,UAAU,eACb,SAAAA,EAACC,EAAA,CACC,sBAAAV,EACA,SAAAJ,EACA,YAAAC,EACA,cAAAC,EACA,oBAAAC,EACA,sBAAAE,EACA,2BAAAC,EACA,gCAAAC,EACA,sCAAAC,EAGA,sBAAAC,EACA,YAAAG,EACA,MAAAb,EACA,gBAAAY,EACA,kBAAAD,CAAA,CAAA,EAEJ"}
@@ -1,3 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
3
  import{jsxs as a,jsx as o,Fragment as s}from"@dropins/tools/preact-jsx-runtime.js";import{classes as m,Slot as u}from"@dropins/tools/lib.js";import{Button as r}from"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/preact-hooks.js";import"../chunks/Button.js";import{useText as d}from"@dropins/tools/i18n.js";import{r as f}from"../chunks/revokeCustomerToken.js";import"@dropins/tools/preact-compat.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/verifyToken.js";import"../chunks/acdl.js";const h=({formSize:c="default",className:n="",slots:i,labels:t})=>{const e=d({headingText:"Auth.SuccessNotification.headingText",messageText:"Auth.SuccessNotification.messageText",primaryButtonText:"Auth.SuccessNotification.primaryButtonText",secondaryButtonText:"Auth.SuccessNotification.secondaryButtonText"});return a("div",{className:m(["auth-success-notification-form",`auth-success-notification-form--${c}`,n]),id:"welcome-message",role:"alert","aria-live":"assertive","aria-labelledby":(t==null?void 0:t.headingText)??e.headingText,"aria-describedby":(t==null?void 0:t.messageText)??e.messageText,"tab-index":"-1",children:[o("p",{id:"welcome-heading",className:"auth-success-notification-form__title","data-testid":"notification-title",children:(t==null?void 0:t.headingText)??e.headingText}),o("p",{id:"welcome-details",className:"auth-success-notification-form__content-text","data-testid":"notification-content",children:(t==null?void 0:t.messageText)??e.messageText}),i!=null&&i.SuccessNotificationActions?o(u,{"data-testid":"successNotificationActions",name:"SuccessNotificationActions",slot:i==null?void 0:i.SuccessNotificationActions,context:{}}):a(s,{children:[o(r,{"data-testid":"primaryButton",type:"button",className:"auth-success-notification-form__button auth-success-notification-form__button--top",onClick:()=>window.location.href="/",children:e.primaryButtonText}),o(r,{"data-testid":"secondaryButton",type:"button",variant:"tertiary",onClick:async()=>{await f(),window.location.href="/"},children:e.secondaryButtonText})]})]})},j=({formSize:c="default",slots:n,className:i,labels:t})=>o("div",{className:"auth-success-notification",children:o(h,{formSize:c,className:i,slots:n,labels:t})});export{j as SuccessNotification,j as default};
4
+ //# sourceMappingURL=SuccessNotification.js.map