@pisell/private-materials 6.5.27 → 6.5.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +146 -165
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +24 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +24 -9
- package/es/components/Sales/Event/Detail.js +4 -3
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -2
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +273 -76
- package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/es/components/appointmentBooking/components/Services/index.js +22 -8
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +35 -30
- package/es/components/appointmentBooking/locales.d.ts +3 -0
- package/es/components/appointmentBooking/locales.js +9 -6
- package/es/components/authentication/admin/AuthMethods/AuthMethods.less +136 -0
- package/es/components/authentication/admin/AuthMethods/SettingList.d.ts +5 -0
- package/es/components/authentication/admin/AuthMethods/SettingList.js +62 -0
- package/es/components/authentication/admin/AuthMethods/SettingList.less +85 -0
- package/es/components/authentication/admin/AuthMethods/SettingsDrawer.d.ts +22 -0
- package/es/components/authentication/admin/AuthMethods/SettingsDrawer.js +121 -0
- package/es/components/authentication/admin/AuthMethods/SettingsDrawer.less +163 -0
- package/es/components/authentication/admin/AuthMethods/components/DefaultSettingsContent.d.ts +11 -0
- package/es/components/authentication/admin/AuthMethods/components/DefaultSettingsContent.js +15 -0
- package/es/components/authentication/admin/AuthMethods/components/EmailSettingsContent.d.ts +13 -0
- package/es/components/authentication/admin/AuthMethods/components/EmailSettingsContent.js +152 -0
- package/es/components/authentication/admin/AuthMethods/components/LoginMethodsList.d.ts +13 -0
- package/es/components/authentication/admin/AuthMethods/components/LoginMethodsList.js +114 -0
- package/es/components/authentication/admin/AuthMethods/components/PasswordRulesSettingsContent.d.ts +14 -0
- package/es/components/authentication/admin/AuthMethods/components/PasswordRulesSettingsContent.js +170 -0
- package/es/components/authentication/admin/AuthMethods/components/PhoneSettingsContent.d.ts +13 -0
- package/es/components/authentication/admin/AuthMethods/components/PhoneSettingsContent.js +116 -0
- package/es/components/authentication/admin/AuthMethods/components/index.d.ts +10 -0
- package/es/components/authentication/admin/AuthMethods/components/index.js +5 -0
- package/es/components/authentication/admin/AuthMethods/constants.d.ts +22 -0
- package/es/components/authentication/admin/AuthMethods/constants.js +121 -0
- package/es/components/authentication/admin/AuthMethods/index.d.ts +8 -0
- package/es/components/authentication/admin/AuthMethods/index.js +233 -0
- package/es/components/authentication/admin/AuthMethods/locales.d.ts +249 -0
- package/es/components/authentication/admin/AuthMethods/locales.js +290 -0
- package/es/components/authentication/admin/AuthMethods/types.d.ts +76 -0
- package/es/components/authentication/admin/AuthMethods/types.js +23 -0
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/AuthenticationMethods.less +231 -0
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/index.d.ts +6 -0
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/index.js +447 -0
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.d.ts +84 -0
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.js +107 -0
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/types.d.ts +41 -0
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/types.js +1 -0
- package/es/components/authentication/admin/ChannelAuthSetting/ChannelAuthSetting.less +111 -0
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/CollectInfo.less +259 -0
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/index.d.ts +6 -0
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/index.js +530 -0
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.d.ts +72 -0
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.js +86 -0
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/types.d.ts +33 -0
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/types.js +1 -0
- package/es/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.d.ts +6 -0
- package/es/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.js +460 -0
- package/es/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.less +111 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/PageSetting.less +105 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/index.d.ts +8 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/index.js +185 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.d.ts +27 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.js +32 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/types.d.ts +25 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/types.js +1 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/PageSettingItem.less +272 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/index.d.ts +8 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/index.js +214 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.d.ts +66 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.js +71 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/types.d.ts +26 -0
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/types.js +1 -0
- package/es/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.d.ts +6 -0
- package/es/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.js +287 -0
- package/es/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.less +111 -0
- package/es/components/authentication/admin/ChannelAuthSetting/index.d.ts +6 -0
- package/es/components/authentication/admin/ChannelAuthSetting/index.js +228 -0
- package/es/components/authentication/admin/ChannelAuthSetting/locales.d.ts +39 -0
- package/es/components/authentication/admin/ChannelAuthSetting/locales.js +50 -0
- package/es/components/authentication/admin/ChannelAuthSetting/types.d.ts +36 -0
- package/es/components/authentication/admin/ChannelAuthSetting/types.js +1 -0
- package/es/components/authentication/admin/CustomerAuth/CustomerAuth.less +104 -0
- package/es/components/authentication/admin/CustomerAuth/index.d.ts +6 -0
- package/es/components/authentication/admin/CustomerAuth/index.js +711 -0
- package/es/components/authentication/admin/CustomerAuth/locales.d.ts +66 -0
- package/es/components/authentication/admin/CustomerAuth/locales.js +86 -0
- package/es/components/authentication/admin/CustomerAuth/types.d.ts +16 -0
- package/es/components/authentication/admin/CustomerAuth/types.js +1 -0
- package/es/components/authentication/admin/CustomerOAuthConfig/CustomerOAuthConfig.less +164 -0
- package/es/components/authentication/admin/CustomerOAuthConfig/index.d.ts +6 -0
- package/es/components/authentication/admin/CustomerOAuthConfig/index.js +545 -0
- package/es/components/authentication/admin/CustomerOAuthConfig/locales.d.ts +108 -0
- package/es/components/authentication/admin/CustomerOAuthConfig/locales.js +137 -0
- package/es/components/authentication/admin/CustomerOAuthConfig/types.d.ts +22 -0
- package/es/components/authentication/admin/CustomerOAuthConfig/types.js +1 -0
- package/es/components/authentication/admin/DeviceAuth/DeviceAuth.less +104 -0
- package/es/components/authentication/admin/DeviceAuth/index.d.ts +6 -0
- package/es/components/authentication/admin/DeviceAuth/index.js +366 -0
- package/es/components/authentication/admin/DeviceAuth/locales.d.ts +57 -0
- package/es/components/authentication/admin/DeviceAuth/locales.js +74 -0
- package/es/components/authentication/admin/DeviceAuth/types.d.ts +16 -0
- package/es/components/authentication/admin/DeviceAuth/types.js +1 -0
- package/es/components/authentication/admin/OAuthConfig/OAuthConfig.less +165 -0
- package/es/components/authentication/admin/OAuthConfig/index.d.ts +6 -0
- package/es/components/authentication/admin/OAuthConfig/index.js +347 -0
- package/es/components/authentication/admin/OAuthConfig/locales.d.ts +90 -0
- package/es/components/authentication/admin/OAuthConfig/locales.js +116 -0
- package/es/components/authentication/admin/OAuthConfig/types.d.ts +22 -0
- package/es/components/authentication/admin/OAuthConfig/types.js +1 -0
- package/es/components/authentication/admin/OrgAdminAuth/OrgAdminAuth.less +104 -0
- package/es/components/authentication/admin/OrgAdminAuth/index.d.ts +6 -0
- package/es/components/authentication/admin/OrgAdminAuth/index.js +543 -0
- package/es/components/authentication/admin/OrgAdminAuth/locales.d.ts +54 -0
- package/es/components/authentication/admin/OrgAdminAuth/locales.js +74 -0
- package/es/components/authentication/admin/OrgAdminAuth/types.d.ts +16 -0
- package/es/components/authentication/admin/OrgAdminAuth/types.js +1 -0
- package/es/components/authentication/admin/POSOperatorAuth/POSOperatorAuth.less +104 -0
- package/es/components/authentication/admin/POSOperatorAuth/index.d.ts +6 -0
- package/es/components/authentication/admin/POSOperatorAuth/index.js +374 -0
- package/es/components/authentication/admin/POSOperatorAuth/locales.d.ts +48 -0
- package/es/components/authentication/admin/POSOperatorAuth/locales.js +65 -0
- package/es/components/authentication/admin/POSOperatorAuth/types.d.ts +16 -0
- package/es/components/authentication/admin/POSOperatorAuth/types.js +1 -0
- package/es/components/authentication/admin/SaaSAdminAuth/SaaSAdminAuth.less +104 -0
- package/es/components/authentication/admin/SaaSAdminAuth/index.d.ts +6 -0
- package/es/components/authentication/admin/SaaSAdminAuth/index.js +625 -0
- package/es/components/authentication/admin/SaaSAdminAuth/locales.d.ts +54 -0
- package/es/components/authentication/admin/SaaSAdminAuth/locales.js +74 -0
- package/es/components/authentication/admin/SaaSAdminAuth/types.d.ts +16 -0
- package/es/components/authentication/admin/SaaSAdminAuth/types.js +1 -0
- package/es/components/authentication/admin/index.d.ts +26 -0
- package/es/components/authentication/admin/index.js +23 -0
- package/es/components/authentication/index.d.ts +0 -0
- package/es/components/authentication/index.js +0 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/customSelect/index.js +23 -4
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +66 -54
- package/es/components/booking/components/footer/utils.js +87 -74
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/forms/footer.js +24 -10
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/info/client/index.js +28 -13
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
- package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/main.js +3 -2
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/Lists.js +1 -1
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info2/cartClientCard/index.js +30 -6
- package/es/components/booking/info2/index.js +3 -2
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
- package/es/components/booking/locales.d.ts +6 -0
- package/es/components/booking/locales.js +12 -3
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +4 -0
- package/es/components/booking/model.js +3 -0
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/checkout/PaymentModal.js +219 -112
- package/es/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/es/components/checkout/components/AdditionalModule/index.js +44 -12
- package/es/components/checkout/components/AmountSummary/index.js +9 -76
- package/es/components/checkout/components/AmountSummary/index.less +1 -1
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/es/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +6 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.js +2 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +31 -8
- package/es/components/checkout/components/PaymentResultToast/index.js +6 -6
- package/es/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +6 -0
- package/es/components/checkout/locales.js +6 -0
- package/es/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/linkly/index.js +64 -2
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eftposPay/tip.d.ts +1 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eftposPay/tyro/index.js +12 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/es/components/index.d.ts +3 -2
- package/es/components/index.js +3 -2
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +68 -35
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +70 -42
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +72 -41
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.d.ts +15 -0
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +143 -0
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +34 -0
- package/es/components/pay/toC/PaymentMethods/hooks/index.d.ts +19 -0
- package/es/components/pay/toC/PaymentMethods/hooks/index.js +126 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pay/toC/index.js +26 -22
- package/es/components/pay/toC/locales.d.ts +9 -0
- package/es/components/pay/toC/locales.js +12 -3
- package/es/components/pay/toC/model.d.ts +1 -0
- package/es/components/pay/toC/serve.d.ts +5 -0
- package/es/components/pay/toC/serve.js +9 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -86
- package/es/components/ticketBooking/components/menuBar/index.js +109 -12
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/es/components/ticketBooking/components/timeBar/index.js +112 -7
- package/es/components/ticketBooking/components/timeBar/index.less +59 -0
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +29 -18
- package/es/components/ticketBooking/locales.d.ts +6 -0
- package/es/components/ticketBooking/locales.js +9 -3
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/walletList/index.js +92 -56
- package/es/components/walletList/serve.d.ts +4 -0
- package/es/components/walletList/serve.js +46 -13
- package/es/components/walletList/types/index.d.ts +12 -12
- package/es/components/walletList/types/index.js +2 -2
- package/es/hooks/usePaymentLogger.d.ts +1 -0
- package/es/index.d.ts +7 -1
- package/es/index.js +7 -2
- package/es/plus/clientCard/locales.js +3 -3
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/clinetSearch/index.js +28 -30
- package/es/plus/clinetSearch/locales.d.ts +3 -0
- package/es/plus/clinetSearch/locales.js +7 -4
- package/es/plus/clinetSearch/types.d.ts +12 -0
- package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/es/plus/contactInfo/components/Avatar/index.js +30 -0
- package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
- package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/es/plus/contactInfo/index.d.ts +6 -0
- package/es/plus/contactInfo/index.js +198 -0
- package/es/plus/contactInfo/index.less +621 -0
- package/es/plus/contactInfo/locales.d.ts +15 -0
- package/es/plus/contactInfo/locales.js +14 -0
- package/es/plus/contactInfo/types.d.ts +91 -0
- package/es/plus/contactInfo/types.js +1 -0
- package/es/plus/contactInfo/utils.d.ts +7 -0
- package/es/plus/contactInfo/utils.js +50 -0
- package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
- package/es/plus/contactInfoModal/index.d.ts +41 -0
- package/es/plus/contactInfoModal/index.js +155 -0
- package/es/plus/contactInfoModal/index.less +19 -0
- package/es/plus/contactInfoModal/locales.d.ts +66 -0
- package/es/plus/contactInfoModal/locales.js +65 -0
- package/es/plus/productSelect/CategoryTabs/index.d.ts +2 -0
- package/es/plus/productSelect/CategoryTabs/index.js +6 -3
- package/es/plus/productSelect/ProductCard/index.d.ts +3 -1
- package/es/plus/productSelect/ProductCard/index.js +9 -1
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
- package/es/plus/productSelect/index.d.ts +3 -2
- package/es/plus/productSelect/index.js +33 -8
- package/es/plus/productSelect/index.less +4 -0
- package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/es/plus/saasRegister/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/es/plus/walletEditor/WalletEditor.d.ts +5 -0
- package/es/plus/walletEditor/WalletEditor.js +316 -0
- package/es/plus/walletEditor/WalletEditor.less +129 -0
- package/es/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
- package/es/plus/walletEditor/components/ImageUpload/index.js +223 -0
- package/es/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
- package/es/plus/walletEditor/components/JsonEditor/index.js +68 -0
- package/es/plus/walletEditor/components/JsonEditor/index.less +4 -0
- package/es/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
- package/es/plus/walletEditor/components/ValidityPeriodSelector/index.js +222 -0
- package/es/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
- package/es/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
- package/es/plus/walletEditor/components/relationProduct/index.js +49 -0
- package/es/plus/walletEditor/components/relationProduct/index.less +15 -0
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.js +193 -0
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
- package/es/plus/walletEditor/index.d.ts +3 -0
- package/es/plus/walletEditor/index.js +3 -0
- package/es/plus/walletEditor/locales.d.ts +126 -0
- package/es/plus/walletEditor/locales.js +143 -0
- package/es/plus/walletEditor/types.d.ts +52 -0
- package/es/plus/walletEditor/types.js +1 -0
- package/es/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
- package/es/plus/walletPassGallery/components/footerButton/index.js +247 -0
- package/es/plus/walletPassGallery/components/footerButton/index.less +93 -0
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
- package/es/plus/walletPassGallery/components/passDetail/index.js +274 -0
- package/es/plus/walletPassGallery/components/passDetail/index.less +57 -0
- package/es/plus/walletPassGallery/components/passList/index.d.ts +12 -0
- package/es/plus/walletPassGallery/components/passList/index.js +115 -0
- package/es/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
- package/es/plus/walletPassGallery/components/recharge/index.js +134 -0
- package/es/plus/walletPassGallery/components/recharge/index.less +16 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +9 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.js +176 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.less +67 -0
- package/es/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
- package/es/plus/walletPassGallery/components/usageRule/index.js +248 -0
- package/es/plus/walletPassGallery/components/usageRule/index.less +157 -0
- package/es/plus/walletPassGallery/index.d.ts +6 -0
- package/es/plus/walletPassGallery/index.js +602 -0
- package/es/plus/walletPassGallery/index.less +115 -0
- package/es/plus/walletPassGallery/locales.d.ts +270 -0
- package/es/plus/walletPassGallery/locales.js +279 -0
- package/es/plus/walletPassGallery/serve.d.ts +218 -0
- package/es/plus/walletPassGallery/serve.js +289 -0
- package/es/pro/Login2.0/AuthModal.d.ts +143 -0
- package/es/pro/Login2.0/AuthModal.js +630 -0
- package/es/pro/Login2.0/Login2.d.ts +61 -0
- package/es/pro/Login2.0/Login2.js +2236 -0
- package/es/pro/Login2.0/Register2.d.ts +65 -0
- package/es/pro/Login2.0/Register2.js +1502 -0
- package/es/pro/Login2.0/components/ForgotPasswordFlow.d.ts +31 -0
- package/es/pro/Login2.0/components/ForgotPasswordFlow.js +330 -0
- package/es/pro/Login2.0/components/LegalTerms.d.ts +8 -0
- package/es/pro/Login2.0/components/LegalTerms.js +51 -0
- package/es/pro/Login2.0/components/LegalTerms.less +74 -0
- package/es/pro/Login2.0/components/LoginCodeInput.d.ts +27 -0
- package/es/pro/Login2.0/components/LoginCodeInput.js +207 -0
- package/es/pro/Login2.0/components/OAuthButtonGroup.d.ts +22 -0
- package/es/pro/Login2.0/components/OAuthButtonGroup.js +55 -0
- package/es/pro/Login2.0/components/PhoneInput.d.ts +53 -0
- package/es/pro/Login2.0/components/PhoneInput.js +414 -0
- package/es/pro/Login2.0/components/PhoneInput.less +148 -0
- package/es/pro/Login2.0/components/phoneValidation.d.ts +17 -0
- package/es/pro/Login2.0/components/phoneValidation.js +228 -0
- package/es/pro/Login2.0/hooks/index.d.ts +2 -0
- package/es/pro/Login2.0/hooks/index.js +1 -0
- package/es/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +24 -0
- package/es/pro/Login2.0/hooks/usePasswordValidationRules.js +87 -0
- package/es/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
- package/es/pro/Login2.0/hooks/useRegisterFlow.js +158 -0
- package/es/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
- package/es/pro/Login2.0/hooks/useRegistrationMethods.js +31 -0
- package/es/pro/Login2.0/index.js +8 -0
- package/es/pro/Login2.0/index.less +1002 -0
- package/es/pro/Login2.0/locales.d.ts +543 -0
- package/es/pro/Login2.0/locales.js +622 -0
- package/es/pro/Login2.0/shared/Header.d.ts +11 -0
- package/es/pro/Login2.0/shared/Header.js +42 -0
- package/es/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
- package/es/pro/Login2.0/shared/OAuthButtons.js +59 -0
- package/es/pro/Login2.0/shared/registerFlow.d.ts +116 -0
- package/es/pro/Login2.0/shared/registerFlow.js +171 -0
- package/es/pro/Login2.0/shared/types.d.ts +232 -0
- package/es/pro/Login2.0/shared/types.js +1 -0
- package/es/pro/Login2.0/steps/CodeInput.d.ts +24 -0
- package/es/pro/Login2.0/steps/CodeInput.js +209 -0
- package/es/pro/Login2.0/steps/EmailAlreadyRegistered.d.ts +12 -0
- package/es/pro/Login2.0/steps/EmailAlreadyRegistered.js +35 -0
- package/es/pro/Login2.0/steps/EmailLinkAlreadyUsed.d.ts +7 -0
- package/es/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +25 -0
- package/es/pro/Login2.0/steps/EmailLinkExpired.d.ts +9 -0
- package/es/pro/Login2.0/steps/EmailLinkExpired.js +33 -0
- package/es/pro/Login2.0/steps/SetPassword.d.ts +19 -0
- package/es/pro/Login2.0/steps/SetPassword.js +148 -0
- package/es/pro/Login2.0/steps/VerificationSuccess.d.ts +8 -0
- package/es/pro/Login2.0/steps/VerificationSuccess.js +35 -0
- package/es/pro/Login2.0/steps/VerifyingEmailLink.d.ts +7 -0
- package/es/pro/Login2.0/steps/VerifyingEmailLink.js +17 -0
- package/es/pro/Login2.0/steps/WaitEmailLink.d.ts +18 -0
- package/es/pro/Login2.0/steps/WaitEmailLink.js +54 -0
- package/es/pro/Login2.0/steps/index.d.ts +19 -0
- package/es/pro/Login2.0/steps/index.js +11 -0
- package/es/pro/Login2.0/steps/steps.less +423 -0
- package/es/pro/Login2.0/types.d.ts +167 -0
- package/es/pro/Login2.0/types.js +1 -0
- package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/es/pro/comprehensiveSearch/locales.js +1 -1
- package/es/pro/pisellPaymentList/example.d.ts +20 -0
- package/es/pro/pisellPaymentList/example.js +434 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +11 -7
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +4 -2
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +10 -1
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +5 -2
- package/es/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lib/components/Sales/Event/Detail.js +3 -2
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -3
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/lib/components/appointmentBooking/components/Services/index.js +8 -3
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +76 -35
- package/lib/components/appointmentBooking/locales.d.ts +3 -0
- package/lib/components/appointmentBooking/locales.js +6 -3
- package/lib/components/authentication/admin/AuthMethods/AuthMethods.less +136 -0
- package/lib/components/authentication/admin/AuthMethods/SettingList.d.ts +5 -0
- package/lib/components/authentication/admin/AuthMethods/SettingList.js +75 -0
- package/lib/components/authentication/admin/AuthMethods/SettingList.less +85 -0
- package/lib/components/authentication/admin/AuthMethods/SettingsDrawer.d.ts +22 -0
- package/lib/components/authentication/admin/AuthMethods/SettingsDrawer.js +126 -0
- package/lib/components/authentication/admin/AuthMethods/SettingsDrawer.less +163 -0
- package/lib/components/authentication/admin/AuthMethods/components/DefaultSettingsContent.d.ts +11 -0
- package/lib/components/authentication/admin/AuthMethods/components/DefaultSettingsContent.js +42 -0
- package/lib/components/authentication/admin/AuthMethods/components/EmailSettingsContent.d.ts +13 -0
- package/lib/components/authentication/admin/AuthMethods/components/EmailSettingsContent.js +108 -0
- package/lib/components/authentication/admin/AuthMethods/components/LoginMethodsList.d.ts +13 -0
- package/lib/components/authentication/admin/AuthMethods/components/LoginMethodsList.js +108 -0
- package/lib/components/authentication/admin/AuthMethods/components/PasswordRulesSettingsContent.d.ts +14 -0
- package/lib/components/authentication/admin/AuthMethods/components/PasswordRulesSettingsContent.js +93 -0
- package/lib/components/authentication/admin/AuthMethods/components/PhoneSettingsContent.d.ts +13 -0
- package/lib/components/authentication/admin/AuthMethods/components/PhoneSettingsContent.js +85 -0
- package/lib/components/authentication/admin/AuthMethods/components/index.d.ts +10 -0
- package/lib/components/authentication/admin/AuthMethods/components/index.js +51 -0
- package/lib/components/authentication/admin/AuthMethods/constants.d.ts +22 -0
- package/lib/components/authentication/admin/AuthMethods/constants.js +115 -0
- package/lib/components/authentication/admin/AuthMethods/index.d.ts +8 -0
- package/lib/components/authentication/admin/AuthMethods/index.js +196 -0
- package/lib/components/authentication/admin/AuthMethods/locales.d.ts +249 -0
- package/lib/components/authentication/admin/AuthMethods/locales.js +314 -0
- package/lib/components/authentication/admin/AuthMethods/types.d.ts +76 -0
- package/lib/components/authentication/admin/AuthMethods/types.js +53 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/AuthenticationMethods.less +231 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/index.d.ts +6 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/index.js +311 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.d.ts +84 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.js +131 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/types.d.ts +41 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/types.js +17 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/ChannelAuthSetting.less +111 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/CollectInfo.less +259 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/index.d.ts +6 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/index.js +410 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.d.ts +72 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.js +110 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/types.d.ts +33 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/types.js +17 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.d.ts +6 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.js +383 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.less +111 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/PageSetting.less +105 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/index.d.ts +8 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/index.js +148 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.d.ts +27 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.js +56 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/types.d.ts +25 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/types.js +17 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/PageSettingItem.less +272 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/index.d.ts +8 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/index.js +206 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.d.ts +66 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.js +95 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/types.d.ts +26 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/types.js +17 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.d.ts +6 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.js +246 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.less +111 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/index.d.ts +6 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/index.js +177 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/locales.d.ts +39 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/locales.js +74 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/types.d.ts +36 -0
- package/lib/components/authentication/admin/ChannelAuthSetting/types.js +17 -0
- package/lib/components/authentication/admin/CustomerAuth/CustomerAuth.less +104 -0
- package/lib/components/authentication/admin/CustomerAuth/index.d.ts +6 -0
- package/lib/components/authentication/admin/CustomerAuth/index.js +507 -0
- package/lib/components/authentication/admin/CustomerAuth/locales.d.ts +66 -0
- package/lib/components/authentication/admin/CustomerAuth/locales.js +110 -0
- package/lib/components/authentication/admin/CustomerAuth/types.d.ts +16 -0
- package/lib/components/authentication/admin/CustomerAuth/types.js +17 -0
- package/lib/components/authentication/admin/CustomerOAuthConfig/CustomerOAuthConfig.less +164 -0
- package/lib/components/authentication/admin/CustomerOAuthConfig/index.d.ts +6 -0
- package/lib/components/authentication/admin/CustomerOAuthConfig/index.js +331 -0
- package/lib/components/authentication/admin/CustomerOAuthConfig/locales.d.ts +108 -0
- package/lib/components/authentication/admin/CustomerOAuthConfig/locales.js +161 -0
- package/lib/components/authentication/admin/CustomerOAuthConfig/types.d.ts +22 -0
- package/lib/components/authentication/admin/CustomerOAuthConfig/types.js +17 -0
- package/lib/components/authentication/admin/DeviceAuth/DeviceAuth.less +104 -0
- package/lib/components/authentication/admin/DeviceAuth/index.d.ts +6 -0
- package/lib/components/authentication/admin/DeviceAuth/index.js +254 -0
- package/lib/components/authentication/admin/DeviceAuth/locales.d.ts +57 -0
- package/lib/components/authentication/admin/DeviceAuth/locales.js +98 -0
- package/lib/components/authentication/admin/DeviceAuth/types.d.ts +16 -0
- package/lib/components/authentication/admin/DeviceAuth/types.js +17 -0
- package/lib/components/authentication/admin/OAuthConfig/OAuthConfig.less +165 -0
- package/lib/components/authentication/admin/OAuthConfig/index.d.ts +6 -0
- package/lib/components/authentication/admin/OAuthConfig/index.js +226 -0
- package/lib/components/authentication/admin/OAuthConfig/locales.d.ts +90 -0
- package/lib/components/authentication/admin/OAuthConfig/locales.js +140 -0
- package/lib/components/authentication/admin/OAuthConfig/types.d.ts +22 -0
- package/lib/components/authentication/admin/OAuthConfig/types.js +17 -0
- package/lib/components/authentication/admin/OrgAdminAuth/OrgAdminAuth.less +104 -0
- package/lib/components/authentication/admin/OrgAdminAuth/index.d.ts +6 -0
- package/lib/components/authentication/admin/OrgAdminAuth/index.js +398 -0
- package/lib/components/authentication/admin/OrgAdminAuth/locales.d.ts +54 -0
- package/lib/components/authentication/admin/OrgAdminAuth/locales.js +98 -0
- package/lib/components/authentication/admin/OrgAdminAuth/types.d.ts +16 -0
- package/lib/components/authentication/admin/OrgAdminAuth/types.js +17 -0
- package/lib/components/authentication/admin/POSOperatorAuth/POSOperatorAuth.less +104 -0
- package/lib/components/authentication/admin/POSOperatorAuth/index.d.ts +6 -0
- package/lib/components/authentication/admin/POSOperatorAuth/index.js +262 -0
- package/lib/components/authentication/admin/POSOperatorAuth/locales.d.ts +48 -0
- package/lib/components/authentication/admin/POSOperatorAuth/locales.js +89 -0
- package/lib/components/authentication/admin/POSOperatorAuth/types.d.ts +16 -0
- package/lib/components/authentication/admin/POSOperatorAuth/types.js +17 -0
- package/lib/components/authentication/admin/SaaSAdminAuth/SaaSAdminAuth.less +104 -0
- package/lib/components/authentication/admin/SaaSAdminAuth/index.d.ts +6 -0
- package/lib/components/authentication/admin/SaaSAdminAuth/index.js +481 -0
- package/lib/components/authentication/admin/SaaSAdminAuth/locales.d.ts +54 -0
- package/lib/components/authentication/admin/SaaSAdminAuth/locales.js +98 -0
- package/lib/components/authentication/admin/SaaSAdminAuth/types.d.ts +16 -0
- package/lib/components/authentication/admin/SaaSAdminAuth/types.js +17 -0
- package/lib/components/authentication/admin/index.d.ts +26 -0
- package/lib/components/authentication/admin/index.js +83 -0
- package/lib/components/authentication/index.d.ts +0 -0
- package/lib/components/authentication/index.js +0 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/customSelect/index.js +27 -4
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +19 -9
- package/lib/components/booking/components/footer/utils.js +82 -51
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/forms/footer.js +29 -11
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/info/client/index.js +14 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -2
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
- package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/main.js +5 -4
- package/lib/components/booking/info/model.js +5 -0
- package/lib/components/booking/info/service/Lists.js +1 -1
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info2/cartClientCard/index.js +25 -5
- package/lib/components/booking/info2/index.js +11 -5
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
- package/lib/components/booking/locales.d.ts +6 -0
- package/lib/components/booking/locales.js +12 -3
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +4 -0
- package/lib/components/booking/model.js +3 -0
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/checkout/PaymentModal.js +110 -21
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/lib/components/checkout/components/AdditionalModule/index.js +44 -11
- package/lib/components/checkout/components/AmountSummary/index.js +5 -46
- package/lib/components/checkout/components/AmountSummary/index.less +1 -1
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/lib/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +5 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +6 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +23 -5
- package/lib/components/checkout/components/PaymentResultToast/index.js +4 -4
- package/lib/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +6 -0
- package/lib/components/checkout/locales.js +6 -0
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/linkly/index.js +31 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/tip.d.ts +1 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eftposPay/tyro/index.js +12 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/lib/components/index.d.ts +3 -2
- package/lib/components/index.js +20 -1
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +27 -7
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +32 -8
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +30 -4
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.d.ts +15 -0
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +88 -0
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +34 -0
- package/lib/components/pay/toC/PaymentMethods/hooks/index.d.ts +19 -0
- package/lib/components/pay/toC/PaymentMethods/hooks/index.js +90 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pay/toC/index.js +11 -2
- package/lib/components/pay/toC/locales.d.ts +9 -0
- package/lib/components/pay/toC/locales.js +12 -3
- package/lib/components/pay/toC/model.d.ts +1 -0
- package/lib/components/pay/toC/serve.d.ts +5 -0
- package/lib/components/pay/toC/serve.js +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
- package/lib/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +105 -4
- package/lib/components/ticketBooking/components/timeBar/index.less +59 -0
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +17 -13
- package/lib/components/ticketBooking/locales.d.ts +6 -0
- package/lib/components/ticketBooking/locales.js +9 -3
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/walletList/index.js +88 -47
- package/lib/components/walletList/serve.d.ts +4 -0
- package/lib/components/walletList/serve.js +12 -0
- package/lib/components/walletList/types/index.d.ts +12 -12
- package/lib/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +38 -3
- package/lib/plus/clientCard/locales.js +3 -3
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/clinetSearch/index.js +17 -8
- package/lib/plus/clinetSearch/locales.d.ts +3 -0
- package/lib/plus/clinetSearch/locales.js +7 -4
- package/lib/plus/clinetSearch/types.d.ts +12 -0
- package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/lib/plus/contactInfo/index.d.ts +6 -0
- package/lib/plus/contactInfo/index.js +226 -0
- package/lib/plus/contactInfo/index.less +621 -0
- package/lib/plus/contactInfo/locales.d.ts +15 -0
- package/lib/plus/contactInfo/locales.js +38 -0
- package/lib/plus/contactInfo/types.d.ts +91 -0
- package/lib/plus/contactInfo/types.js +17 -0
- package/lib/plus/contactInfo/utils.d.ts +7 -0
- package/lib/plus/contactInfo/utils.js +64 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
- package/lib/plus/contactInfoModal/index.d.ts +41 -0
- package/lib/plus/contactInfoModal/index.js +139 -0
- package/lib/plus/contactInfoModal/index.less +19 -0
- package/lib/plus/contactInfoModal/locales.d.ts +66 -0
- package/lib/plus/contactInfoModal/locales.js +89 -0
- package/lib/plus/productSelect/CategoryTabs/index.d.ts +2 -0
- package/lib/plus/productSelect/CategoryTabs/index.js +86 -71
- package/lib/plus/productSelect/ProductCard/index.d.ts +3 -1
- package/lib/plus/productSelect/ProductCard/index.js +18 -1
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
- package/lib/plus/productSelect/index.d.ts +3 -2
- package/lib/plus/productSelect/index.js +20 -6
- package/lib/plus/productSelect/index.less +4 -0
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/lib/plus/saasRegister/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/lib/plus/walletEditor/WalletEditor.d.ts +5 -0
- package/lib/plus/walletEditor/WalletEditor.js +354 -0
- package/lib/plus/walletEditor/WalletEditor.less +129 -0
- package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
- package/lib/plus/walletEditor/components/ImageUpload/index.js +201 -0
- package/lib/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
- package/lib/plus/walletEditor/components/JsonEditor/index.js +89 -0
- package/lib/plus/walletEditor/components/JsonEditor/index.less +4 -0
- package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
- package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.js +176 -0
- package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
- package/lib/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
- package/lib/plus/walletEditor/components/relationProduct/index.js +73 -0
- package/lib/plus/walletEditor/components/relationProduct/index.less +15 -0
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.js +211 -0
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
- package/lib/plus/walletEditor/index.d.ts +3 -0
- package/lib/plus/walletEditor/index.js +42 -0
- package/lib/plus/walletEditor/locales.d.ts +126 -0
- package/lib/plus/walletEditor/locales.js +167 -0
- package/lib/plus/walletEditor/types.d.ts +52 -0
- package/lib/plus/walletEditor/types.js +17 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.js +187 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.less +93 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.js +287 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.less +57 -0
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +12 -0
- package/lib/plus/walletPassGallery/components/passList/index.js +136 -0
- package/lib/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
- package/lib/plus/walletPassGallery/components/recharge/index.js +146 -0
- package/lib/plus/walletPassGallery/components/recharge/index.less +16 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +9 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.js +212 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.less +67 -0
- package/lib/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
- package/lib/plus/walletPassGallery/components/usageRule/index.js +209 -0
- package/lib/plus/walletPassGallery/components/usageRule/index.less +157 -0
- package/lib/plus/walletPassGallery/index.d.ts +6 -0
- package/lib/plus/walletPassGallery/index.js +498 -0
- package/lib/plus/walletPassGallery/index.less +115 -0
- package/lib/plus/walletPassGallery/locales.d.ts +270 -0
- package/lib/plus/walletPassGallery/locales.js +299 -0
- package/lib/plus/walletPassGallery/serve.d.ts +218 -0
- package/lib/plus/walletPassGallery/serve.js +98 -0
- package/lib/pro/Login2.0/AuthModal.d.ts +143 -0
- package/lib/pro/Login2.0/AuthModal.js +503 -0
- package/lib/pro/Login2.0/Login2.d.ts +61 -0
- package/lib/pro/Login2.0/Login2.js +1545 -0
- package/lib/pro/Login2.0/Register2.d.ts +65 -0
- package/lib/pro/Login2.0/Register2.js +1063 -0
- package/lib/pro/Login2.0/components/ForgotPasswordFlow.d.ts +31 -0
- package/lib/pro/Login2.0/components/ForgotPasswordFlow.js +213 -0
- package/lib/pro/Login2.0/components/LegalTerms.d.ts +8 -0
- package/lib/pro/Login2.0/components/LegalTerms.js +76 -0
- package/lib/pro/Login2.0/components/LegalTerms.less +74 -0
- package/lib/pro/Login2.0/components/LoginCodeInput.d.ts +27 -0
- package/lib/pro/Login2.0/components/LoginCodeInput.js +161 -0
- package/lib/pro/Login2.0/components/OAuthButtonGroup.d.ts +22 -0
- package/lib/pro/Login2.0/components/OAuthButtonGroup.js +87 -0
- package/lib/pro/Login2.0/components/PhoneInput.d.ts +53 -0
- package/lib/pro/Login2.0/components/PhoneInput.js +263 -0
- package/lib/pro/Login2.0/components/PhoneInput.less +148 -0
- package/lib/pro/Login2.0/components/phoneValidation.d.ts +17 -0
- package/lib/pro/Login2.0/components/phoneValidation.js +153 -0
- package/lib/pro/Login2.0/hooks/index.d.ts +2 -0
- package/lib/pro/Login2.0/hooks/index.js +29 -0
- package/lib/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +24 -0
- package/lib/pro/Login2.0/hooks/usePasswordValidationRules.js +140 -0
- package/lib/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
- package/lib/pro/Login2.0/hooks/useRegisterFlow.js +149 -0
- package/lib/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
- package/lib/pro/Login2.0/hooks/useRegistrationMethods.js +51 -0
- package/lib/pro/Login2.0/index.js +45 -0
- package/lib/pro/Login2.0/index.less +1002 -0
- package/lib/pro/Login2.0/locales.d.ts +543 -0
- package/lib/pro/Login2.0/locales.js +646 -0
- package/lib/pro/Login2.0/shared/Header.d.ts +11 -0
- package/lib/pro/Login2.0/shared/Header.js +81 -0
- package/lib/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
- package/lib/pro/Login2.0/shared/OAuthButtons.js +78 -0
- package/lib/pro/Login2.0/shared/registerFlow.d.ts +116 -0
- package/lib/pro/Login2.0/shared/registerFlow.js +235 -0
- package/lib/pro/Login2.0/shared/types.d.ts +232 -0
- package/lib/pro/Login2.0/shared/types.js +17 -0
- package/lib/pro/Login2.0/steps/CodeInput.d.ts +24 -0
- package/lib/pro/Login2.0/steps/CodeInput.js +160 -0
- package/lib/pro/Login2.0/steps/EmailAlreadyRegistered.d.ts +12 -0
- package/lib/pro/Login2.0/steps/EmailAlreadyRegistered.js +46 -0
- package/lib/pro/Login2.0/steps/EmailLinkAlreadyUsed.d.ts +7 -0
- package/lib/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +51 -0
- package/lib/pro/Login2.0/steps/EmailLinkExpired.d.ts +9 -0
- package/lib/pro/Login2.0/steps/EmailLinkExpired.js +51 -0
- package/lib/pro/Login2.0/steps/SetPassword.d.ts +19 -0
- package/lib/pro/Login2.0/steps/SetPassword.js +131 -0
- package/lib/pro/Login2.0/steps/VerificationSuccess.d.ts +8 -0
- package/lib/pro/Login2.0/steps/VerificationSuccess.js +49 -0
- package/lib/pro/Login2.0/steps/VerifyingEmailLink.d.ts +7 -0
- package/lib/pro/Login2.0/steps/VerifyingEmailLink.js +41 -0
- package/lib/pro/Login2.0/steps/WaitEmailLink.d.ts +18 -0
- package/lib/pro/Login2.0/steps/WaitEmailLink.js +67 -0
- package/lib/pro/Login2.0/steps/index.d.ts +19 -0
- package/lib/pro/Login2.0/steps/index.js +60 -0
- package/lib/pro/Login2.0/steps/steps.less +423 -0
- package/lib/pro/Login2.0/types.d.ts +167 -0
- package/lib/pro/Login2.0/types.js +17 -0
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/lib/pro/comprehensiveSearch/locales.js +1 -1
- package/lib/pro/pisellPaymentList/example.d.ts +20 -0
- package/lib/pro/pisellPaymentList/example.js +416 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +9 -5
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +3 -2
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +8 -1
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +3 -2
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lowcode/admin-auth-customer-auth/meta.ts +29 -0
- package/lowcode/admin-auth-customer-oauth-config/meta.ts +55 -0
- package/lowcode/admin-auth-device-auth/meta.ts +30 -0
- package/lowcode/admin-auth-methods/meta.ts +385 -0
- package/lowcode/admin-auth-oauth-config/meta.ts +29 -0
- package/lowcode/admin-auth-online-shop-auth/meta.ts +29 -0
- package/lowcode/admin-auth-org-admin-auth/meta.ts +29 -0
- package/lowcode/admin-auth-pos-operator-auth/meta.ts +30 -0
- package/lowcode/admin-auth-saas-admin-auth/meta.ts +29 -0
- package/lowcode/admin-auth-saas-managerment-auth/meta.ts +30 -0
- package/lowcode/admin-setting-list/meta.ts +125 -0
- package/lowcode/authmodal/meta.ts +395 -0
- package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
- package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
- package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
- package/lowcode/contact-info/fragments/textStyle.ts +33 -0
- package/lowcode/contact-info/meta.ts +199 -0
- package/lowcode/contact-info-modal/meta.ts +98 -0
- package/lowcode/login2/CONFIG.md +447 -0
- package/lowcode/login2/TEST_CONFIG.md +324 -0
- package/lowcode/login2/VERIFICATION_METHODS.md +364 -0
- package/lowcode/login2/meta.ts +560 -0
- package/lowcode/login2/snippets.ts +124 -0
- package/lowcode/pro-register/meta.ts +385 -0
- package/lowcode/register2/meta.ts +562 -0
- package/lowcode/register2/snippets.ts +257 -0
- package/lowcode/sortable-wallet-pass-types/meta.ts +267 -0
- package/lowcode/wallet-editor/meta.ts +57 -0
- package/lowcode/wallet-editor/snippets.ts +13 -0
- package/lowcode/wallet-pass-gallery/meta.ts +35 -0
- package/package.json +6 -4
- package/lowcode/wallet/meta.ts +0 -79
|
@@ -0,0 +1,1545 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/pro/Login2.0/Login2.tsx
|
|
30
|
+
var Login2_exports = {};
|
|
31
|
+
__export(Login2_exports, {
|
|
32
|
+
default: () => Login2_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Login2_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_materials = require("@pisell/materials");
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_ahooks = require("ahooks");
|
|
41
|
+
var import_locales = __toESM(require("./locales"));
|
|
42
|
+
var import_Header = __toESM(require("./shared/Header"));
|
|
43
|
+
var import_LoginCodeInput = __toESM(require("./components/LoginCodeInput"));
|
|
44
|
+
var import_ForgotPasswordFlow = __toESM(require("./components/ForgotPasswordFlow"));
|
|
45
|
+
var import_SetPassword = __toESM(require("./steps/SetPassword"));
|
|
46
|
+
var import_PhoneInput = __toESM(require("./components/PhoneInput"));
|
|
47
|
+
var import_phoneValidation = require("./components/phoneValidation");
|
|
48
|
+
var import_LegalTerms = __toESM(require("./components/LegalTerms"));
|
|
49
|
+
var import_index = require("./index.less");
|
|
50
|
+
var import_useEngineContext = require("../../hooks/useEngineContext");
|
|
51
|
+
var import_useEngineContext2 = __toESM(require("../../hooks/useEngineContext"));
|
|
52
|
+
var import_materials2 = require("@pisell/materials");
|
|
53
|
+
var import_usePasswordValidationRules = __toESM(require("./hooks/usePasswordValidationRules"));
|
|
54
|
+
var import_OAuthButtonGroup = __toESM(require("./components/OAuthButtonGroup"));
|
|
55
|
+
var Login2 = ({
|
|
56
|
+
config,
|
|
57
|
+
visible = true,
|
|
58
|
+
onClose,
|
|
59
|
+
className,
|
|
60
|
+
style,
|
|
61
|
+
onLogin,
|
|
62
|
+
onOAuthLogin,
|
|
63
|
+
onSendVerificationCode,
|
|
64
|
+
onForgotPassword,
|
|
65
|
+
onSwitchToRegister,
|
|
66
|
+
onError
|
|
67
|
+
}) => {
|
|
68
|
+
var _a, _b, _c, _d, _e, _f;
|
|
69
|
+
const [form] = import_antd.Form.useForm();
|
|
70
|
+
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
71
|
+
const [countdown, setCountdown] = (0, import_react.useState)(0);
|
|
72
|
+
const [countries, setCountries] = (0, import_react.useState)([]);
|
|
73
|
+
const pisellOS = (0, import_useEngineContext.usePisellOS)();
|
|
74
|
+
const registerAndLogin = pisellOS == null ? void 0 : pisellOS.getModule("registerAndLogin");
|
|
75
|
+
const context = (0, import_useEngineContext2.default)();
|
|
76
|
+
const storage = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.storage;
|
|
77
|
+
(0, import_react.useEffect)(() => {
|
|
78
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g;
|
|
79
|
+
import_utils.locales.init(
|
|
80
|
+
import_locales.default,
|
|
81
|
+
((_e2 = (_d2 = (_c2 = (_b2 = (_a2 = context.appHelper.utils) == null ? void 0 : _a2.getApp) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c2.locales) == null ? void 0 : _d2.getLocale) == null ? void 0 : _e2.call(_d2)) || ((_g = (_f2 = context.appHelper.utils) == null ? void 0 : _f2.storage) == null ? void 0 : _g.get("umi_locale")) || "en"
|
|
82
|
+
);
|
|
83
|
+
}, []);
|
|
84
|
+
const loginMethods = config.loginMethods || [];
|
|
85
|
+
const passwordValidationRules = (0, import_usePasswordValidationRules.default)(
|
|
86
|
+
(_c = config.ui) == null ? void 0 : _c.passwordRules,
|
|
87
|
+
{
|
|
88
|
+
translate: import_utils.locales.getText,
|
|
89
|
+
fallbackMinLength: 6,
|
|
90
|
+
messageKeys: {
|
|
91
|
+
required: import_utils.locales.getText("pisell-login2-password-required"),
|
|
92
|
+
minLength: import_utils.locales.getText("pisell-set-password-min-length"),
|
|
93
|
+
requireUppercase: import_utils.locales.getText("pisell-set-password-require-uppercase"),
|
|
94
|
+
requireLowercase: import_utils.locales.getText("pisell-set-password-require-lowercase"),
|
|
95
|
+
requireNumber: import_utils.locales.getText("pisell-set-password-require-number"),
|
|
96
|
+
requireSpecialCharacters: import_utils.locales.getText("pisell-set-password-require-special"),
|
|
97
|
+
summary: import_utils.locales.getText("pisell-set-password-must-contain")
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
const [currentLoginMethod, setCurrentLoginMethod] = (0, import_react.useState)(null);
|
|
102
|
+
const [currentVerificationMethod, setCurrentVerificationMethod] = (0, import_react.useState)("password");
|
|
103
|
+
const hasTriggeredGuestLoginRef = (0, import_react.useRef)(false);
|
|
104
|
+
(0, import_react.useEffect)(() => {
|
|
105
|
+
var _a2;
|
|
106
|
+
if (loginMethods.length > 0 && !currentLoginMethod) {
|
|
107
|
+
const initialMethod = loginMethods[0];
|
|
108
|
+
setCurrentLoginMethod(initialMethod);
|
|
109
|
+
if ((initialMethod == null ? void 0 : initialMethod.type) === "email" || (initialMethod == null ? void 0 : initialMethod.type) === "phone") {
|
|
110
|
+
setCurrentVerificationMethod(
|
|
111
|
+
((_a2 = initialMethod.verificationMethods) == null ? void 0 : _a2[0]) || "password"
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (hasTriggeredGuestLoginRef.current) return;
|
|
116
|
+
const hasOnlyGuest = loginMethods.length === 1 && loginMethods[0].type === "guest";
|
|
117
|
+
if (!hasOnlyGuest) return;
|
|
118
|
+
hasTriggeredGuestLoginRef.current = true;
|
|
119
|
+
handleGuestLogin();
|
|
120
|
+
}, [loginMethods, currentLoginMethod]);
|
|
121
|
+
(0, import_react.useEffect)(() => {
|
|
122
|
+
if (((currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" || (currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "phone") && currentVerificationMethod === "password") {
|
|
123
|
+
const storedRememberMe = storage.get("login_remember_me") === "true";
|
|
124
|
+
setRememberMe(storedRememberMe);
|
|
125
|
+
let account = storage.get("login_account");
|
|
126
|
+
try {
|
|
127
|
+
account = JSON.parse(account || "{}");
|
|
128
|
+
} catch (e) {
|
|
129
|
+
console.error(e);
|
|
130
|
+
}
|
|
131
|
+
if (account && storedRememberMe) {
|
|
132
|
+
const accountString = typeof account === "string" ? account : account.phone || account.email || "";
|
|
133
|
+
const isEmail = accountString.includes("@");
|
|
134
|
+
const isPhone = /^\d+$/.test(accountString.replace(/\+/g, "").replace(/\s/g, ""));
|
|
135
|
+
const shouldUseStoredAccount = currentLoginMethod.type === "email" && isEmail || currentLoginMethod.type === "phone" && isPhone;
|
|
136
|
+
if (shouldUseStoredAccount) {
|
|
137
|
+
setEnteredAccount(account);
|
|
138
|
+
setHasStoredCredentials(true);
|
|
139
|
+
if (isEmail && !form.getFieldValue("email")) {
|
|
140
|
+
form.setFieldsValue({
|
|
141
|
+
email: account
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
if (isPhone && !form.getFieldValue("phone")) {
|
|
145
|
+
form.setFieldsValue({
|
|
146
|
+
phone: account
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (currentLoginMethod == null ? void 0 : currentLoginMethod.stepByStep) {
|
|
150
|
+
setLoginStep("password");
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
setHasStoredCredentials(false);
|
|
154
|
+
setEnteredAccount("");
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
setHasStoredCredentials(false);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}, [currentLoginMethod, currentVerificationMethod]);
|
|
161
|
+
(0, import_react.useEffect)(() => {
|
|
162
|
+
if (!visible) {
|
|
163
|
+
form.setFieldsValue({ password: "" });
|
|
164
|
+
}
|
|
165
|
+
}, [visible, form]);
|
|
166
|
+
const [loginStep, setLoginStep] = (0, import_react.useState)(
|
|
167
|
+
"account"
|
|
168
|
+
);
|
|
169
|
+
const [enteredAccount, setEnteredAccount] = (0, import_react.useState)("");
|
|
170
|
+
const [codeError, setCodeError] = (0, import_react.useState)("");
|
|
171
|
+
const [rememberMe, setRememberMe] = (0, import_react.useState)(false);
|
|
172
|
+
const [hasStoredCredentials, setHasStoredCredentials] = (0, import_react.useState)(false);
|
|
173
|
+
const [lastLoginMethod, setLastLoginMethod] = (0, import_react.useState)(null);
|
|
174
|
+
const [showForgotPassword, setShowForgotPassword] = (0, import_react.useState)(false);
|
|
175
|
+
const [emailLinkVerifyStatus, setEmailLinkVerifyStatus] = (0, import_react.useState)(null);
|
|
176
|
+
const [emailLinkError, setEmailLinkError] = (0, import_react.useState)("");
|
|
177
|
+
const [resetPasswordUserEmail, setResetPasswordUserEmail] = (0, import_react.useState)("");
|
|
178
|
+
const isEmailLinkVerification = ((_d = config.emailLinkVerification) == null ? void 0 : _d.enabled) && ((_e = config.emailLinkVerification) == null ? void 0 : _e.code);
|
|
179
|
+
(0, import_react.useEffect)(() => {
|
|
180
|
+
var _a2;
|
|
181
|
+
if (isEmailLinkVerification && ((_a2 = config.emailLinkVerification) == null ? void 0 : _a2.code)) {
|
|
182
|
+
setEmailLinkVerifyStatus("verifying");
|
|
183
|
+
const checkCode = async () => {
|
|
184
|
+
var _a3;
|
|
185
|
+
try {
|
|
186
|
+
if (registerAndLogin == null ? void 0 : registerAndLogin.checkResetPasswordCode) {
|
|
187
|
+
const result = await registerAndLogin.checkResetPasswordCode({
|
|
188
|
+
code: config.emailLinkVerification.code
|
|
189
|
+
});
|
|
190
|
+
if (result.status) {
|
|
191
|
+
setEmailLinkVerifyStatus("success");
|
|
192
|
+
if ((_a3 = result.data) == null ? void 0 : _a3.email) {
|
|
193
|
+
setResetPasswordUserEmail(result.data.email);
|
|
194
|
+
}
|
|
195
|
+
} else {
|
|
196
|
+
setEmailLinkVerifyStatus("error");
|
|
197
|
+
setEmailLinkError(result.message || "验证码无效或已过期");
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
setEmailLinkVerifyStatus("error");
|
|
201
|
+
setEmailLinkError("系统错误,请稍后重试");
|
|
202
|
+
}
|
|
203
|
+
} catch (error) {
|
|
204
|
+
setEmailLinkVerifyStatus("error");
|
|
205
|
+
setEmailLinkError("网络错误,请稍后重试");
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
checkCode();
|
|
209
|
+
}
|
|
210
|
+
}, [
|
|
211
|
+
isEmailLinkVerification,
|
|
212
|
+
(_f = config.emailLinkVerification) == null ? void 0 : _f.code,
|
|
213
|
+
registerAndLogin
|
|
214
|
+
]);
|
|
215
|
+
(0, import_react.useEffect)(() => {
|
|
216
|
+
if (countdown > 0) {
|
|
217
|
+
const timer = setTimeout(() => {
|
|
218
|
+
setCountdown(countdown - 1);
|
|
219
|
+
}, 1e3);
|
|
220
|
+
return () => clearTimeout(timer);
|
|
221
|
+
}
|
|
222
|
+
}, [countdown]);
|
|
223
|
+
(0, import_react.useEffect)(() => {
|
|
224
|
+
const fetchCountries = async () => {
|
|
225
|
+
try {
|
|
226
|
+
if (registerAndLogin == null ? void 0 : registerAndLogin.getCountries) {
|
|
227
|
+
const countriesList = await registerAndLogin.getCountries();
|
|
228
|
+
setCountries(countriesList || []);
|
|
229
|
+
}
|
|
230
|
+
} catch (error) {
|
|
231
|
+
console.error("Failed to fetch countries:", error);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
fetchCountries();
|
|
235
|
+
}, [registerAndLogin]);
|
|
236
|
+
(0, import_react.useEffect)(() => {
|
|
237
|
+
try {
|
|
238
|
+
const storedLoginMethod = storage.get("pisell_last_login_method");
|
|
239
|
+
if (storedLoginMethod) {
|
|
240
|
+
const parsedMethod = JSON.parse(storedLoginMethod);
|
|
241
|
+
setLastLoginMethod(parsedMethod);
|
|
242
|
+
}
|
|
243
|
+
const rememberMe2 = storage.get("login_remember_me") === "true";
|
|
244
|
+
const account = storage.get("login_account");
|
|
245
|
+
const password = storage.get("login_password");
|
|
246
|
+
if (rememberMe2 && account && password) {
|
|
247
|
+
let accountData;
|
|
248
|
+
try {
|
|
249
|
+
accountData = JSON.parse(account || "{}");
|
|
250
|
+
} catch (e) {
|
|
251
|
+
accountData = account;
|
|
252
|
+
}
|
|
253
|
+
const isEmail = typeof accountData === "string" && accountData.includes("@");
|
|
254
|
+
const loginMethod = loginMethods.find((m) => m.type === (isEmail ? "email" : "phone"));
|
|
255
|
+
if (loginMethod) {
|
|
256
|
+
setCurrentLoginMethod(loginMethod);
|
|
257
|
+
setCurrentVerificationMethod("password");
|
|
258
|
+
setEnteredAccount(accountData);
|
|
259
|
+
const accountFieldName = isEmail ? "email" : "phone";
|
|
260
|
+
form.setFieldsValue({ [accountFieldName]: accountData, password, remember_me: true });
|
|
261
|
+
setLoginStep("password");
|
|
262
|
+
setRememberMe(true);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
} catch (error) {
|
|
266
|
+
console.error("Failed to parse last login method:", error);
|
|
267
|
+
}
|
|
268
|
+
}, [loginMethods]);
|
|
269
|
+
const isLastLoginMethod = (0, import_react.useCallback)((methodType) => {
|
|
270
|
+
if (!lastLoginMethod) return false;
|
|
271
|
+
return lastLoginMethod.type === methodType;
|
|
272
|
+
}, [lastLoginMethod]);
|
|
273
|
+
const switchVerificationMethod = (0, import_react.useCallback)(
|
|
274
|
+
(method) => {
|
|
275
|
+
form.resetFields();
|
|
276
|
+
setLoginStep("account");
|
|
277
|
+
setEnteredAccount("");
|
|
278
|
+
setCurrentVerificationMethod(method);
|
|
279
|
+
},
|
|
280
|
+
[form]
|
|
281
|
+
);
|
|
282
|
+
const switchLoginMethod = (0, import_react.useCallback)(
|
|
283
|
+
(method) => {
|
|
284
|
+
form.resetFields();
|
|
285
|
+
setLoginStep("account");
|
|
286
|
+
setEnteredAccount("");
|
|
287
|
+
setHasStoredCredentials(false);
|
|
288
|
+
setCurrentLoginMethod(method);
|
|
289
|
+
if (method.type === "email" || method.type === "phone") {
|
|
290
|
+
setCurrentVerificationMethod(method.verificationMethods[0]);
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
[form]
|
|
294
|
+
);
|
|
295
|
+
const handleContinueWithAccountInternal = async () => {
|
|
296
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g;
|
|
297
|
+
try {
|
|
298
|
+
setLoading(true);
|
|
299
|
+
const accountFieldName = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" ? "email" : "phone";
|
|
300
|
+
const accountValues = await form.validateFields([accountFieldName]);
|
|
301
|
+
const account = accountValues[accountFieldName];
|
|
302
|
+
if ((currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" && registerAndLogin) {
|
|
303
|
+
const utils = ((_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.utils) || {};
|
|
304
|
+
const shopId = ((_g = (_f2 = (_e2 = (_d2 = (_c2 = (_b2 = utils.getStore) == null ? void 0 : _b2.call(utils)) == null ? void 0 : _c2.getState) == null ? void 0 : _d2.call(_c2)) == null ? void 0 : _e2.global) == null ? void 0 : _f2.shop) == null ? void 0 : _g.id) || 9;
|
|
305
|
+
const result = await registerAndLogin.checkEmailExists({
|
|
306
|
+
email: account,
|
|
307
|
+
shop_id: shopId
|
|
308
|
+
});
|
|
309
|
+
if (result.status && result.data) {
|
|
310
|
+
if (result.data.exists) {
|
|
311
|
+
setEnteredAccount(account);
|
|
312
|
+
setLoginStep("password");
|
|
313
|
+
form.setFieldsValue({ [accountFieldName]: account });
|
|
314
|
+
} else {
|
|
315
|
+
import_antd.message.error(
|
|
316
|
+
import_utils.locales.getText("pisell-login2-email-not-registered")
|
|
317
|
+
);
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
} else {
|
|
321
|
+
import_antd.message.error(
|
|
322
|
+
result.message || import_utils.locales.getText("pisell-login2-check-email-failed")
|
|
323
|
+
);
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
setEnteredAccount(account);
|
|
328
|
+
setLoginStep("password");
|
|
329
|
+
form.setFieldsValue({ [accountFieldName]: account });
|
|
330
|
+
}
|
|
331
|
+
} catch (error) {
|
|
332
|
+
if (error.errorFields) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
console.error("Continue with account error:", error);
|
|
336
|
+
import_antd.message.error(
|
|
337
|
+
(error == null ? void 0 : error.message) || import_utils.locales.getText("pisell-login2-continue-failed")
|
|
338
|
+
);
|
|
339
|
+
} finally {
|
|
340
|
+
setLoading(false);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
const { run: handleContinueWithAccount } = (0, import_ahooks.useDebounceFn)(handleContinueWithAccountInternal, {
|
|
344
|
+
wait: 200,
|
|
345
|
+
leading: true,
|
|
346
|
+
trailing: false
|
|
347
|
+
});
|
|
348
|
+
const handleBackToAccountInternal = () => {
|
|
349
|
+
setLoginStep("account");
|
|
350
|
+
form.resetFields(["password"]);
|
|
351
|
+
};
|
|
352
|
+
const { run: handleBackToAccount } = (0, import_ahooks.useDebounceFn)(handleBackToAccountInternal, {
|
|
353
|
+
wait: 200,
|
|
354
|
+
leading: true,
|
|
355
|
+
trailing: false
|
|
356
|
+
});
|
|
357
|
+
const handleSendCode = async () => {
|
|
358
|
+
var _a2;
|
|
359
|
+
try {
|
|
360
|
+
const accountFieldName = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" ? "email" : "phone";
|
|
361
|
+
await form.validateFields([accountFieldName]);
|
|
362
|
+
const account = form.getFieldValue(accountFieldName);
|
|
363
|
+
if (!account) {
|
|
364
|
+
import_antd.message.error(import_utils.locales.getText("pisell-login2-account-required"));
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
setLoading(true);
|
|
368
|
+
const type = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" ? "email" : "phone";
|
|
369
|
+
if (registerAndLogin) {
|
|
370
|
+
let res;
|
|
371
|
+
if (type === "email") {
|
|
372
|
+
res = await registerAndLogin.sendEmailLoginCode({
|
|
373
|
+
type: "email",
|
|
374
|
+
target: account,
|
|
375
|
+
purpose: "login"
|
|
376
|
+
});
|
|
377
|
+
} else {
|
|
378
|
+
let phoneData;
|
|
379
|
+
if (typeof account === "string") {
|
|
380
|
+
phoneData = {
|
|
381
|
+
phone: account,
|
|
382
|
+
country_calling_code: ((_a2 = countries.find((country) => country.value === account)) == null ? void 0 : _a2.calling_code) || ""
|
|
383
|
+
};
|
|
384
|
+
} else {
|
|
385
|
+
phoneData = account;
|
|
386
|
+
}
|
|
387
|
+
res = await registerAndLogin.sendSmsLoginCode(phoneData);
|
|
388
|
+
}
|
|
389
|
+
if ((res == null ? void 0 : res.code) !== 200) {
|
|
390
|
+
throw new Error(
|
|
391
|
+
(res == null ? void 0 : res.message) || import_utils.locales.getText("pisell-login2-code-send-failed")
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
await (onSendVerificationCode == null ? void 0 : onSendVerificationCode(account, type, config.channel));
|
|
396
|
+
setEnteredAccount(account);
|
|
397
|
+
setLoginStep("code");
|
|
398
|
+
setCountdown(60);
|
|
399
|
+
import_antd.message.success(import_utils.locales.getText("pisell-login2-code-sent"));
|
|
400
|
+
} catch (error) {
|
|
401
|
+
if (error == null ? void 0 : error.errorFields) return;
|
|
402
|
+
import_antd.message.error(
|
|
403
|
+
(error == null ? void 0 : error.message) || import_utils.locales.getText("pisell-login2-code-send-failed")
|
|
404
|
+
);
|
|
405
|
+
} finally {
|
|
406
|
+
setLoading(false);
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
const handleCodeSubmit = async (code) => {
|
|
410
|
+
var _a2;
|
|
411
|
+
try {
|
|
412
|
+
setLoading(true);
|
|
413
|
+
setCodeError("");
|
|
414
|
+
const method = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) || "email";
|
|
415
|
+
let result;
|
|
416
|
+
if (registerAndLogin) {
|
|
417
|
+
if (method === "email") {
|
|
418
|
+
result = await registerAndLogin.emailCodeLogin({
|
|
419
|
+
email: enteredAccount,
|
|
420
|
+
code
|
|
421
|
+
});
|
|
422
|
+
} else if (method === "phone") {
|
|
423
|
+
let phoneData;
|
|
424
|
+
if (typeof enteredAccount === "string") {
|
|
425
|
+
phoneData = {
|
|
426
|
+
phone: enteredAccount,
|
|
427
|
+
country_calling_code: ((_a2 = countries.find((country) => country.value === enteredAccount)) == null ? void 0 : _a2.calling_code) || ""
|
|
428
|
+
};
|
|
429
|
+
} else {
|
|
430
|
+
phoneData = enteredAccount;
|
|
431
|
+
}
|
|
432
|
+
result = await registerAndLogin.phoneCodeLogin({
|
|
433
|
+
phone: phoneData.phone,
|
|
434
|
+
country_calling_code: phoneData.country_calling_code,
|
|
435
|
+
code
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
if ((result == null ? void 0 : result.code) !== 200) {
|
|
439
|
+
const errorMessage = (result == null ? void 0 : result.message) || import_utils.locales.getText("pisell-login2-login-failed");
|
|
440
|
+
const error = new Error(errorMessage);
|
|
441
|
+
onError == null ? void 0 : onError(error, method);
|
|
442
|
+
setCodeError(errorMessage);
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
const loginData = {
|
|
447
|
+
account: enteredAccount,
|
|
448
|
+
password: void 0,
|
|
449
|
+
verification_code: code,
|
|
450
|
+
remember_me: false
|
|
451
|
+
};
|
|
452
|
+
await (onLogin == null ? void 0 : onLogin(result.data, method, loginData, config.channel));
|
|
453
|
+
import_antd.message.success(import_utils.locales.getText("pisell-login2-login-success"));
|
|
454
|
+
} catch (error) {
|
|
455
|
+
setCodeError(
|
|
456
|
+
(error == null ? void 0 : error.message) || import_utils.locales.getText("pisell-login2-login-failed")
|
|
457
|
+
);
|
|
458
|
+
} finally {
|
|
459
|
+
setLoading(false);
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
const handleBackFromCode = () => {
|
|
463
|
+
setLoginStep("account");
|
|
464
|
+
form.resetFields();
|
|
465
|
+
setCodeError("");
|
|
466
|
+
};
|
|
467
|
+
const handleForgotPasswordClickInternal = () => {
|
|
468
|
+
const accountFieldName = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" ? "email" : "phone";
|
|
469
|
+
const account = form.getFieldValue(accountFieldName);
|
|
470
|
+
setEnteredAccount(account || "");
|
|
471
|
+
setShowForgotPassword(true);
|
|
472
|
+
};
|
|
473
|
+
const { run: handleForgotPasswordClick } = (0, import_ahooks.useDebounceFn)(handleForgotPasswordClickInternal, {
|
|
474
|
+
wait: 200,
|
|
475
|
+
leading: true,
|
|
476
|
+
trailing: false
|
|
477
|
+
});
|
|
478
|
+
const handleCloseForgotPassword = () => {
|
|
479
|
+
setShowForgotPassword(false);
|
|
480
|
+
setCountdown(0);
|
|
481
|
+
};
|
|
482
|
+
const handleForgotPasswordSendLink = async (account) => {
|
|
483
|
+
try {
|
|
484
|
+
setLoading(true);
|
|
485
|
+
if (registerAndLogin) {
|
|
486
|
+
const res = await registerAndLogin.sendResetPasswordLink({
|
|
487
|
+
email: account
|
|
488
|
+
});
|
|
489
|
+
if (!res.status) {
|
|
490
|
+
throw new Error(res.message || "发送重置密码链接失败");
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
import_antd.message.success(import_utils.locales.getText("pisell-forgot-password-link-sent"));
|
|
494
|
+
} catch (error) {
|
|
495
|
+
import_antd.message.error((error == null ? void 0 : error.message) || "发送重置密码链接失败");
|
|
496
|
+
throw error;
|
|
497
|
+
} finally {
|
|
498
|
+
setLoading(false);
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
const handleForgotPasswordSendCode = async (account) => {
|
|
502
|
+
try {
|
|
503
|
+
setLoading(true);
|
|
504
|
+
const type = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" ? "email" : "phone";
|
|
505
|
+
if (registerAndLogin) {
|
|
506
|
+
if (type === "email") {
|
|
507
|
+
const res = await registerAndLogin.sendPasswordResetEmail({
|
|
508
|
+
email: account
|
|
509
|
+
});
|
|
510
|
+
if (!res.status) {
|
|
511
|
+
throw new Error(
|
|
512
|
+
res.message || import_utils.locales.getText("pisell-login2-code-send-failed")
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
} else {
|
|
516
|
+
const phoneAccount = account;
|
|
517
|
+
const res = await registerAndLogin.sendPasswordResetSms({
|
|
518
|
+
phone: phoneAccount.phone,
|
|
519
|
+
country_calling_code: phoneAccount.country_calling_code
|
|
520
|
+
});
|
|
521
|
+
if (!res.status) {
|
|
522
|
+
throw new Error(
|
|
523
|
+
res.message || import_utils.locales.getText("pisell-login2-code-send-failed")
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
setCountdown(60);
|
|
529
|
+
import_antd.message.success(import_utils.locales.getText("pisell-login2-code-sent"));
|
|
530
|
+
} catch (error) {
|
|
531
|
+
import_antd.message.error(
|
|
532
|
+
(error == null ? void 0 : error.message) || import_utils.locales.getText("pisell-login2-code-send-failed")
|
|
533
|
+
);
|
|
534
|
+
throw error;
|
|
535
|
+
} finally {
|
|
536
|
+
setLoading(false);
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
const handleForgotPasswordVerifyCode = async (account, code) => {
|
|
540
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g;
|
|
541
|
+
try {
|
|
542
|
+
setLoading(true);
|
|
543
|
+
if (registerAndLogin) {
|
|
544
|
+
const utils = ((_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.utils) || {};
|
|
545
|
+
const shopId = ((_g = (_f2 = (_e2 = (_d2 = (_c2 = (_b2 = utils.getStore) == null ? void 0 : _b2.call(utils)) == null ? void 0 : _c2.getState) == null ? void 0 : _d2.call(_c2)) == null ? void 0 : _e2.global) == null ? void 0 : _f2.shop) == null ? void 0 : _g.id) || 9;
|
|
546
|
+
const isPhoneAccount = typeof account === "object" && "phone" in account;
|
|
547
|
+
let res;
|
|
548
|
+
if (!isPhoneAccount) {
|
|
549
|
+
res = await registerAndLogin.checkEmailCode({
|
|
550
|
+
email: account,
|
|
551
|
+
shop_id: shopId,
|
|
552
|
+
code,
|
|
553
|
+
action: "customer_reset_password_code"
|
|
554
|
+
});
|
|
555
|
+
} else {
|
|
556
|
+
const phoneData = account;
|
|
557
|
+
res = await registerAndLogin.checkMobileCode({
|
|
558
|
+
phone: phoneData.phone,
|
|
559
|
+
country_calling_code: phoneData.country_calling_code,
|
|
560
|
+
code,
|
|
561
|
+
action: "forget"
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
if (!res.status) {
|
|
565
|
+
throw new Error(res.message || "验证码验证失败");
|
|
566
|
+
}
|
|
567
|
+
if (!res.data.valid) {
|
|
568
|
+
throw new Error(import_utils.locales.getText("pisell-login2-code-verify-failed"));
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
} catch (error) {
|
|
572
|
+
import_antd.message.error((error == null ? void 0 : error.message) || "验证码验证失败");
|
|
573
|
+
throw error;
|
|
574
|
+
} finally {
|
|
575
|
+
setLoading(false);
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
const handleForgotPasswordReset = async (account, password, code) => {
|
|
579
|
+
try {
|
|
580
|
+
setLoading(true);
|
|
581
|
+
if (registerAndLogin) {
|
|
582
|
+
const isPhoneAccount2 = typeof account === "object" && "phone" in account;
|
|
583
|
+
let resetPasswordParams;
|
|
584
|
+
if (isPhoneAccount2) {
|
|
585
|
+
resetPasswordParams = {
|
|
586
|
+
type: "phone",
|
|
587
|
+
target: {
|
|
588
|
+
phone: account.phone,
|
|
589
|
+
country_calling_code: account.country_calling_code
|
|
590
|
+
},
|
|
591
|
+
password,
|
|
592
|
+
code
|
|
593
|
+
};
|
|
594
|
+
} else {
|
|
595
|
+
resetPasswordParams = {
|
|
596
|
+
type: "email",
|
|
597
|
+
target: {
|
|
598
|
+
email: account
|
|
599
|
+
},
|
|
600
|
+
password,
|
|
601
|
+
code
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
const res = await registerAndLogin.resetPassword(resetPasswordParams);
|
|
605
|
+
if ((res == null ? void 0 : res.code) !== 200) {
|
|
606
|
+
throw new Error((res == null ? void 0 : res.message) || "密码重置失败");
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
handleCloseForgotPassword();
|
|
610
|
+
const isPhoneAccount = typeof account === "object" && "phone" in account;
|
|
611
|
+
if (isPhoneAccount) {
|
|
612
|
+
const phoneMethod = config.loginMethods.find((method) => method.type === "phone");
|
|
613
|
+
if (phoneMethod) {
|
|
614
|
+
setCurrentLoginMethod(phoneMethod);
|
|
615
|
+
setCurrentVerificationMethod(phoneMethod.verificationMethods[0]);
|
|
616
|
+
}
|
|
617
|
+
form.setFieldsValue({ phone: account });
|
|
618
|
+
setEnteredAccount(account);
|
|
619
|
+
} else {
|
|
620
|
+
const emailMethod = config.loginMethods.find((method) => method.type === "email");
|
|
621
|
+
if (emailMethod) {
|
|
622
|
+
setCurrentLoginMethod(emailMethod);
|
|
623
|
+
setCurrentVerificationMethod(emailMethod.verificationMethods[0]);
|
|
624
|
+
}
|
|
625
|
+
form.setFieldsValue({ email: account });
|
|
626
|
+
setEnteredAccount(account);
|
|
627
|
+
}
|
|
628
|
+
setLoginStep("account");
|
|
629
|
+
} catch (error) {
|
|
630
|
+
import_antd.message.error((error == null ? void 0 : error.message) || "密码重置失败");
|
|
631
|
+
} finally {
|
|
632
|
+
setLoading(false);
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
const handleEmailLinkResetPassword = async (account, password, code) => {
|
|
636
|
+
try {
|
|
637
|
+
setLoading(true);
|
|
638
|
+
if (registerAndLogin) {
|
|
639
|
+
const res = await registerAndLogin.resetPasswordByCode({
|
|
640
|
+
code: config.emailLinkVerification.code,
|
|
641
|
+
password
|
|
642
|
+
});
|
|
643
|
+
if ((res == null ? void 0 : res.code) !== 200) {
|
|
644
|
+
throw new Error((res == null ? void 0 : res.message) || "密码重置失败");
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
handleCloseForgotPassword();
|
|
648
|
+
setEmailLinkVerifyStatus(null);
|
|
649
|
+
import_antd.message.success("密码重置成功");
|
|
650
|
+
} catch (error) {
|
|
651
|
+
import_antd.message.error((error == null ? void 0 : error.message) || "密码重置失败");
|
|
652
|
+
throw error;
|
|
653
|
+
} finally {
|
|
654
|
+
setLoading(false);
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
const handleGuestLoginInternal = async () => {
|
|
658
|
+
try {
|
|
659
|
+
setLoading(true);
|
|
660
|
+
if (registerAndLogin) {
|
|
661
|
+
const result = await registerAndLogin.guestLogin();
|
|
662
|
+
if (result.code === 200) {
|
|
663
|
+
import_antd.message.success(import_utils.locales.getText("pisell-login2-login-success"));
|
|
664
|
+
const loginMethodInfo = {
|
|
665
|
+
type: "guest",
|
|
666
|
+
verificationMethod: null,
|
|
667
|
+
timestamp: Date.now()
|
|
668
|
+
};
|
|
669
|
+
storage.set("pisell_last_login_method", JSON.stringify(loginMethodInfo));
|
|
670
|
+
onLogin == null ? void 0 : onLogin(
|
|
671
|
+
result.data,
|
|
672
|
+
"guest",
|
|
673
|
+
{
|
|
674
|
+
account: "guest",
|
|
675
|
+
password: void 0
|
|
676
|
+
},
|
|
677
|
+
config.channel
|
|
678
|
+
);
|
|
679
|
+
} else {
|
|
680
|
+
import_antd.message.error(
|
|
681
|
+
result.message || import_utils.locales.getText("pisell-login2-login-failed")
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
} catch (error) {
|
|
686
|
+
console.error("Guest login error:", error);
|
|
687
|
+
import_antd.message.error(import_utils.locales.getText("pisell-login2-login-failed"));
|
|
688
|
+
} finally {
|
|
689
|
+
setLoading(false);
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
const { run: handleGuestLogin } = (0, import_ahooks.useDebounceFn)(handleGuestLoginInternal, {
|
|
693
|
+
wait: 200,
|
|
694
|
+
leading: true,
|
|
695
|
+
trailing: false
|
|
696
|
+
});
|
|
697
|
+
const oauthProviders = (0, import_react.useMemo)(() => {
|
|
698
|
+
return loginMethods.filter(
|
|
699
|
+
(method) => ["google", "facebook", "apple", "guest"].includes(method.type)
|
|
700
|
+
).map((method) => {
|
|
701
|
+
const isLast = isLastLoginMethod(method.type);
|
|
702
|
+
const commonConfig = {
|
|
703
|
+
className: (0, import_classnames.default)("login2-oauth-button", method.type, {
|
|
704
|
+
"has-last-login-badge": isLast
|
|
705
|
+
}),
|
|
706
|
+
badge: isLast ? import_utils.locales.getText("pisell-login2-last-login-badge") : void 0,
|
|
707
|
+
badgeClassName: "last-login-badge"
|
|
708
|
+
};
|
|
709
|
+
switch (method.type) {
|
|
710
|
+
case "google":
|
|
711
|
+
return {
|
|
712
|
+
key: "google",
|
|
713
|
+
label: /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell-login2-continue-with"), " Google"),
|
|
714
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-google" }),
|
|
715
|
+
onClick: () => handleOAuthClick("google"),
|
|
716
|
+
...commonConfig
|
|
717
|
+
};
|
|
718
|
+
case "facebook":
|
|
719
|
+
return {
|
|
720
|
+
key: "facebook",
|
|
721
|
+
label: /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell-login2-continue-with"), " Facebook"),
|
|
722
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-facebook" }),
|
|
723
|
+
onClick: () => handleOAuthClick("facebook"),
|
|
724
|
+
...commonConfig
|
|
725
|
+
};
|
|
726
|
+
case "apple":
|
|
727
|
+
return {
|
|
728
|
+
key: "apple",
|
|
729
|
+
label: /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell-login2-continue-with"), " Apple"),
|
|
730
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-apple" }),
|
|
731
|
+
onClick: () => handleOAuthClick("apple"),
|
|
732
|
+
...commonConfig
|
|
733
|
+
};
|
|
734
|
+
case "guest":
|
|
735
|
+
return {
|
|
736
|
+
key: "guest",
|
|
737
|
+
label: import_utils.locales.getText("pisell-login2-login-as-guest"),
|
|
738
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-user-01" }),
|
|
739
|
+
onClick: handleGuestLogin,
|
|
740
|
+
...commonConfig
|
|
741
|
+
};
|
|
742
|
+
default:
|
|
743
|
+
return null;
|
|
744
|
+
}
|
|
745
|
+
}).filter(Boolean);
|
|
746
|
+
}, [handleGuestLogin, handleOAuthClick, isLastLoginMethod, loginMethods]);
|
|
747
|
+
const handleLoginInternal = async () => {
|
|
748
|
+
var _a2;
|
|
749
|
+
try {
|
|
750
|
+
setLoading(true);
|
|
751
|
+
const values = await form.validateFields();
|
|
752
|
+
const accountFieldName = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" ? "email" : "phone";
|
|
753
|
+
const account = values[accountFieldName] || values.account;
|
|
754
|
+
const loginData = {
|
|
755
|
+
account,
|
|
756
|
+
password: currentVerificationMethod === "password" ? values.password : void 0,
|
|
757
|
+
verification_code: currentVerificationMethod === "verification_code" ? values.verification_code : void 0,
|
|
758
|
+
remember_me: values.remember_me
|
|
759
|
+
};
|
|
760
|
+
const method = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) || "email";
|
|
761
|
+
let result;
|
|
762
|
+
if (registerAndLogin) {
|
|
763
|
+
if (method === "email") {
|
|
764
|
+
if (currentVerificationMethod === "password") {
|
|
765
|
+
result = await registerAndLogin.emailPasswordLogin({
|
|
766
|
+
email: account,
|
|
767
|
+
password: values.password
|
|
768
|
+
});
|
|
769
|
+
} else {
|
|
770
|
+
result = await registerAndLogin.emailCodeLogin({
|
|
771
|
+
email: account,
|
|
772
|
+
code: values.verification_code
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
} else if (method === "phone") {
|
|
776
|
+
let phoneData;
|
|
777
|
+
if (typeof account === "string") {
|
|
778
|
+
phoneData = {
|
|
779
|
+
phone: account,
|
|
780
|
+
country_calling_code: ((_a2 = countries.find((country) => country.value === account)) == null ? void 0 : _a2.calling_code) || ""
|
|
781
|
+
};
|
|
782
|
+
} else {
|
|
783
|
+
phoneData = account;
|
|
784
|
+
}
|
|
785
|
+
if (currentVerificationMethod === "password") {
|
|
786
|
+
result = await registerAndLogin.phonePasswordLogin({
|
|
787
|
+
phone: phoneData.phone,
|
|
788
|
+
country_calling_code: phoneData.country_calling_code,
|
|
789
|
+
password: values.password
|
|
790
|
+
});
|
|
791
|
+
} else {
|
|
792
|
+
result = await registerAndLogin.phoneCodeLogin({
|
|
793
|
+
phone: phoneData.phone,
|
|
794
|
+
country_calling_code: phoneData.country_calling_code,
|
|
795
|
+
code: values.verification_code
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
if ((result == null ? void 0 : result.code) !== 200) {
|
|
800
|
+
throw new Error(
|
|
801
|
+
(result == null ? void 0 : result.message) || import_utils.locales.getText("pisell-login2-login-failed")
|
|
802
|
+
);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
await (onLogin == null ? void 0 : onLogin(result.data, method, loginData, config.channel));
|
|
806
|
+
const loginMethodInfo = {
|
|
807
|
+
type: method,
|
|
808
|
+
verificationMethod: currentVerificationMethod,
|
|
809
|
+
timestamp: Date.now()
|
|
810
|
+
};
|
|
811
|
+
storage.set("pisell_last_login_method", JSON.stringify(loginMethodInfo));
|
|
812
|
+
if (values.remember_me && account) {
|
|
813
|
+
storage.set("login_account", JSON.stringify(account));
|
|
814
|
+
storage.set("login_remember_me", "true");
|
|
815
|
+
if (currentVerificationMethod === "password") {
|
|
816
|
+
storage.set("login_password", values.password);
|
|
817
|
+
}
|
|
818
|
+
setEnteredAccount(account);
|
|
819
|
+
} else {
|
|
820
|
+
storage.remove("login_account");
|
|
821
|
+
storage.remove("login_remember_me");
|
|
822
|
+
storage.remove("login_password");
|
|
823
|
+
}
|
|
824
|
+
import_antd.message.success(import_utils.locales.getText("pisell-login2-login-success"));
|
|
825
|
+
} catch (error) {
|
|
826
|
+
if (error.errorFields) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
import_antd.message.error(
|
|
830
|
+
(error == null ? void 0 : error.message) || import_utils.locales.getText("pisell-login2-login-failed")
|
|
831
|
+
);
|
|
832
|
+
} finally {
|
|
833
|
+
setLoading(false);
|
|
834
|
+
}
|
|
835
|
+
};
|
|
836
|
+
const { run: handleLogin } = (0, import_ahooks.useDebounceFn)(handleLoginInternal, {
|
|
837
|
+
wait: 1e3,
|
|
838
|
+
leading: true,
|
|
839
|
+
trailing: false
|
|
840
|
+
});
|
|
841
|
+
const handleOAuthClickInternal = async (provider) => {
|
|
842
|
+
var _a2, _b2;
|
|
843
|
+
try {
|
|
844
|
+
setLoading(true);
|
|
845
|
+
if (provider === "facebook") {
|
|
846
|
+
const fbConfig = (_a2 = config == null ? void 0 : config.loginMethods) == null ? void 0 : _a2.find((n) => n.type === "facebook");
|
|
847
|
+
const token = fbConfig == null ? void 0 : fbConfig.appId;
|
|
848
|
+
if (token) {
|
|
849
|
+
const res = await registerAndLogin.loginWithFacebook(token);
|
|
850
|
+
if (res.status) {
|
|
851
|
+
onLogin == null ? void 0 : onLogin(res.data, "facebook", { account: "", password: "" }, config.channel);
|
|
852
|
+
}
|
|
853
|
+
} else {
|
|
854
|
+
throw new Error("Facebook app_id not configured");
|
|
855
|
+
}
|
|
856
|
+
} else if (provider === "apple") {
|
|
857
|
+
const appleConfig = (_b2 = config == null ? void 0 : config.loginMethods) == null ? void 0 : _b2.find((n) => n.type === "apple");
|
|
858
|
+
const token = appleConfig == null ? void 0 : appleConfig.clientId;
|
|
859
|
+
if (token) {
|
|
860
|
+
const res = await registerAndLogin.loginWithApple(token);
|
|
861
|
+
onLogin == null ? void 0 : onLogin(res.data, "apple", { account: "", password: "" }, config.channel);
|
|
862
|
+
} else {
|
|
863
|
+
throw new Error("Apple client_id not configured");
|
|
864
|
+
}
|
|
865
|
+
} else {
|
|
866
|
+
await (onOAuthLogin == null ? void 0 : onOAuthLogin(provider, config.channel));
|
|
867
|
+
}
|
|
868
|
+
} catch (error) {
|
|
869
|
+
if (error.message === "facebook_login_cancel") {
|
|
870
|
+
return import_antd.message.error(import_utils.locales.getText("pisell-register2-facebook-login-canceled"));
|
|
871
|
+
}
|
|
872
|
+
import_antd.message.error(
|
|
873
|
+
(error == null ? void 0 : error.message) || import_utils.locales.getText("pisell-login2-login-failed")
|
|
874
|
+
);
|
|
875
|
+
} finally {
|
|
876
|
+
setLoading(false);
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
const { run: handleOAuthClick } = (0, import_ahooks.useDebounceFn)(handleOAuthClickInternal, {
|
|
880
|
+
wait: 200,
|
|
881
|
+
leading: true,
|
|
882
|
+
trailing: false
|
|
883
|
+
});
|
|
884
|
+
const renderMainLoginForm = () => {
|
|
885
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
886
|
+
if (!currentLoginMethod) return null;
|
|
887
|
+
const { type } = currentLoginMethod;
|
|
888
|
+
if (type === "google" || type === "facebook" || type === "apple" || type === "guest") {
|
|
889
|
+
return null;
|
|
890
|
+
}
|
|
891
|
+
const hasEmailOrPhoneMethod = loginMethods.some(
|
|
892
|
+
(method) => method.type === "email" || method.type === "phone"
|
|
893
|
+
);
|
|
894
|
+
if (!hasEmailOrPhoneMethod) {
|
|
895
|
+
return null;
|
|
896
|
+
}
|
|
897
|
+
const isEmail = type === "email";
|
|
898
|
+
const isPhone = type === "phone";
|
|
899
|
+
const accountFieldName = isEmail ? "email" : "phone";
|
|
900
|
+
const getAccountValue = (values) => {
|
|
901
|
+
if (values) {
|
|
902
|
+
return values[accountFieldName] || values.account;
|
|
903
|
+
}
|
|
904
|
+
return form.getFieldValue(accountFieldName) || form.getFieldValue("account");
|
|
905
|
+
};
|
|
906
|
+
const accountLabel = isEmail ? ((_c2 = (_b2 = (_a2 = config.ui) == null ? void 0 : _a2.formLabels) == null ? void 0 : _b2.email) == null ? void 0 : _c2.show) !== false ? ((_f2 = (_e2 = (_d2 = config.ui) == null ? void 0 : _d2.formLabels) == null ? void 0 : _e2.email) == null ? void 0 : _f2.text) || import_utils.locales.getText("pisell-login2-email-label") : void 0 : ((_i = (_h = (_g = config.ui) == null ? void 0 : _g.formLabels) == null ? void 0 : _h.phone) == null ? void 0 : _i.show) !== false ? ((_l = (_k = (_j = config.ui) == null ? void 0 : _j.formLabels) == null ? void 0 : _k.phone) == null ? void 0 : _l.text) || import_utils.locales.getText("pisell-login2-phone-label") : void 0;
|
|
907
|
+
const accountPlaceholder = isEmail ? import_utils.locales.getText("pisell-login2-email-placeholder") : import_utils.locales.getText("pisell-login2-phone-placeholder");
|
|
908
|
+
const accountRules = isEmail ? [
|
|
909
|
+
{
|
|
910
|
+
required: true,
|
|
911
|
+
message: import_utils.locales.getText("pisell-login2-email-required")
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
type: "email",
|
|
915
|
+
message: import_utils.locales.getText("pisell-login2-email-invalid")
|
|
916
|
+
}
|
|
917
|
+
] : (0, import_phoneValidation.createPhoneValidationRules)(import_utils.locales.getText, true);
|
|
918
|
+
const useStepByStep = (currentLoginMethod == null ? void 0 : currentLoginMethod.stepByStep) && currentVerificationMethod === "password";
|
|
919
|
+
if (useStepByStep) {
|
|
920
|
+
const isPasswordStep = loginStep === "password";
|
|
921
|
+
const showPasswordField = isPasswordStep;
|
|
922
|
+
const handleFormSubmit = (e) => {
|
|
923
|
+
e == null ? void 0 : e.preventDefault();
|
|
924
|
+
if (isPasswordStep) {
|
|
925
|
+
handleLogin();
|
|
926
|
+
} else {
|
|
927
|
+
handleContinueWithAccount();
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
931
|
+
import_antd.Form,
|
|
932
|
+
{
|
|
933
|
+
form,
|
|
934
|
+
layout: "vertical",
|
|
935
|
+
className: "login2-form",
|
|
936
|
+
size: "large"
|
|
937
|
+
},
|
|
938
|
+
(isEmail || isPhone) && !showPasswordField && /* @__PURE__ */ import_react.default.createElement("div", { style: { position: "absolute", left: "-9999px", opacity: 0, pointerEvents: "none" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
939
|
+
"input",
|
|
940
|
+
{
|
|
941
|
+
type: "text",
|
|
942
|
+
name: "username",
|
|
943
|
+
autoComplete: "username",
|
|
944
|
+
tabIndex: -1,
|
|
945
|
+
readOnly: true,
|
|
946
|
+
"aria-hidden": "true"
|
|
947
|
+
}
|
|
948
|
+
)),
|
|
949
|
+
showPasswordField && /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-account-show-text-edit" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "login2-account-show-text-edit-text" }, isPhone && `+${(_m = getAccountValue()) == null ? void 0 : _m.country_calling_code}${(_n = getAccountValue()) == null ? void 0 : _n.phone}` || "", isEmail && getAccountValue() || ""), /* @__PURE__ */ import_react.default.createElement("span", { className: "login2-account-show-text-edit-icon", onClick: handleBackToAccount }, /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-edit-05" }))),
|
|
950
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
951
|
+
import_antd.Form.Item,
|
|
952
|
+
{
|
|
953
|
+
style: { display: showPasswordField ? "none" : "block" },
|
|
954
|
+
label: accountLabel,
|
|
955
|
+
name: isEmail ? "email" : "phone",
|
|
956
|
+
rules: accountRules,
|
|
957
|
+
validateTrigger: ["onBlur", "onSubmit"],
|
|
958
|
+
className: isPhone ? "phone-input-form-item" : ""
|
|
959
|
+
},
|
|
960
|
+
isPhone ? /* @__PURE__ */ import_react.default.createElement(
|
|
961
|
+
import_PhoneInput.default,
|
|
962
|
+
{
|
|
963
|
+
size: "large",
|
|
964
|
+
placeholder: accountPlaceholder,
|
|
965
|
+
className: "login2-phone-input",
|
|
966
|
+
countries,
|
|
967
|
+
valueFormat: "object",
|
|
968
|
+
value: isPasswordStep ? enteredAccount : getAccountValue() || void 0,
|
|
969
|
+
onChange: (value) => {
|
|
970
|
+
if (isPasswordStep) {
|
|
971
|
+
setEnteredAccount(value);
|
|
972
|
+
}
|
|
973
|
+
form.setFieldsValue({ [accountFieldName]: value });
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
) : /* @__PURE__ */ import_react.default.createElement(
|
|
977
|
+
import_materials.Input,
|
|
978
|
+
{
|
|
979
|
+
size: "large",
|
|
980
|
+
placeholder: accountPlaceholder,
|
|
981
|
+
className: "login2-input",
|
|
982
|
+
type: "email",
|
|
983
|
+
autoComplete: "email",
|
|
984
|
+
value: getAccountValue() || enteredAccount || "",
|
|
985
|
+
onChange: (e) => {
|
|
986
|
+
const newValue = e.target.value;
|
|
987
|
+
if (isPasswordStep) {
|
|
988
|
+
setEnteredAccount(newValue);
|
|
989
|
+
}
|
|
990
|
+
form.setFieldsValue({ [accountFieldName]: newValue });
|
|
991
|
+
},
|
|
992
|
+
onKeyDown: (e) => {
|
|
993
|
+
if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
|
994
|
+
e.preventDefault();
|
|
995
|
+
handleFormSubmit(e);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
)
|
|
1000
|
+
),
|
|
1001
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1002
|
+
import_antd.Form.Item,
|
|
1003
|
+
{
|
|
1004
|
+
style: { display: showPasswordField ? "block" : "none" },
|
|
1005
|
+
label: ((_q = (_p = (_o = config.ui) == null ? void 0 : _o.formLabels) == null ? void 0 : _p.password) == null ? void 0 : _q.show) !== false ? ((_t = (_s = (_r = config.ui) == null ? void 0 : _r.formLabels) == null ? void 0 : _s.password) == null ? void 0 : _t.text) || import_utils.locales.getText("pisell-login2-password-label") : void 0,
|
|
1006
|
+
name: "password",
|
|
1007
|
+
validateTrigger: ["onBlur", "onSubmit"],
|
|
1008
|
+
rules: passwordValidationRules
|
|
1009
|
+
},
|
|
1010
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1011
|
+
import_materials.Input.Password,
|
|
1012
|
+
{
|
|
1013
|
+
size: "large",
|
|
1014
|
+
placeholder: import_utils.locales.getText(
|
|
1015
|
+
"pisell-login2-password-placeholder"
|
|
1016
|
+
),
|
|
1017
|
+
className: "login2-input",
|
|
1018
|
+
name: "password",
|
|
1019
|
+
autoComplete: "current-password",
|
|
1020
|
+
type: "password",
|
|
1021
|
+
autoFocus: hasStoredCredentials,
|
|
1022
|
+
onKeyDown: (e) => {
|
|
1023
|
+
if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
|
1024
|
+
e.preventDefault();
|
|
1025
|
+
handleFormSubmit(e);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
)
|
|
1030
|
+
),
|
|
1031
|
+
showPasswordField && /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-form-footer" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "remember_me", valuePropName: "checked", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_materials.Checkbox, { defaultChecked: rememberMe }, import_utils.locales.getText("pisell-login2-remember-me"))), /* @__PURE__ */ import_react.default.createElement("a", { className: "login2-link", onClick: handleForgotPasswordClick }, import_utils.locales.getText("pisell-login2-forgot-password"))),
|
|
1032
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1033
|
+
import_materials.Button,
|
|
1034
|
+
{
|
|
1035
|
+
type: "primary",
|
|
1036
|
+
size: "large",
|
|
1037
|
+
block: true,
|
|
1038
|
+
htmlType: "button",
|
|
1039
|
+
loading,
|
|
1040
|
+
onClick: handleFormSubmit,
|
|
1041
|
+
className: "login2-submit-button"
|
|
1042
|
+
},
|
|
1043
|
+
isPasswordStep ? import_utils.locales.getText("pisell-login2-login-button") : isEmail ? import_utils.locales.getText("pisell-login2-continue-with-email") : import_utils.locales.getText("pisell-login2-continue-with-phone")
|
|
1044
|
+
),
|
|
1045
|
+
showPasswordField && /* @__PURE__ */ import_react.default.createElement(
|
|
1046
|
+
import_materials.Button,
|
|
1047
|
+
{
|
|
1048
|
+
size: "large",
|
|
1049
|
+
block: true,
|
|
1050
|
+
onClick: handleBackToAccount,
|
|
1051
|
+
className: "login2-back-button"
|
|
1052
|
+
},
|
|
1053
|
+
import_utils.locales.getText("pisell-login2-back")
|
|
1054
|
+
)
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
if (currentVerificationMethod === "verification_code" && loginStep === "account") {
|
|
1058
|
+
const handleFormSubmit = (e) => {
|
|
1059
|
+
e == null ? void 0 : e.preventDefault();
|
|
1060
|
+
handleSendCode();
|
|
1061
|
+
};
|
|
1062
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1063
|
+
import_antd.Form,
|
|
1064
|
+
{
|
|
1065
|
+
form,
|
|
1066
|
+
layout: "vertical",
|
|
1067
|
+
className: "login2-form",
|
|
1068
|
+
size: "large"
|
|
1069
|
+
},
|
|
1070
|
+
isEmail && /* @__PURE__ */ import_react.default.createElement("div", { style: { position: "absolute", left: "-9999px", opacity: 0, pointerEvents: "none" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
1071
|
+
"input",
|
|
1072
|
+
{
|
|
1073
|
+
type: "text",
|
|
1074
|
+
name: "username",
|
|
1075
|
+
autoComplete: "username",
|
|
1076
|
+
tabIndex: -1,
|
|
1077
|
+
readOnly: true,
|
|
1078
|
+
"aria-hidden": "true"
|
|
1079
|
+
}
|
|
1080
|
+
)),
|
|
1081
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1082
|
+
import_antd.Form.Item,
|
|
1083
|
+
{
|
|
1084
|
+
label: accountLabel,
|
|
1085
|
+
name: accountFieldName,
|
|
1086
|
+
rules: accountRules,
|
|
1087
|
+
className: isPhone ? "phone-input-form-item" : "",
|
|
1088
|
+
validateTrigger: ["onBlur", "onSubmit"]
|
|
1089
|
+
},
|
|
1090
|
+
isPhone ? /* @__PURE__ */ import_react.default.createElement(
|
|
1091
|
+
import_PhoneInput.default,
|
|
1092
|
+
{
|
|
1093
|
+
size: "large",
|
|
1094
|
+
placeholder: accountPlaceholder,
|
|
1095
|
+
className: "login2-phone-input",
|
|
1096
|
+
countries,
|
|
1097
|
+
valueFormat: "object",
|
|
1098
|
+
onKeyDown: (e) => {
|
|
1099
|
+
if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
|
1100
|
+
e.preventDefault();
|
|
1101
|
+
handleFormSubmit(e);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
) : /* @__PURE__ */ import_react.default.createElement(
|
|
1106
|
+
import_materials.Input,
|
|
1107
|
+
{
|
|
1108
|
+
size: "large",
|
|
1109
|
+
placeholder: accountPlaceholder,
|
|
1110
|
+
className: "login2-input",
|
|
1111
|
+
type: "email",
|
|
1112
|
+
autoComplete: "email",
|
|
1113
|
+
onKeyDown: (e) => {
|
|
1114
|
+
if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
|
1115
|
+
e.preventDefault();
|
|
1116
|
+
handleFormSubmit(e);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
)
|
|
1121
|
+
),
|
|
1122
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1123
|
+
import_materials.Button,
|
|
1124
|
+
{
|
|
1125
|
+
type: "primary",
|
|
1126
|
+
size: "large",
|
|
1127
|
+
block: true,
|
|
1128
|
+
htmlType: "button",
|
|
1129
|
+
loading,
|
|
1130
|
+
onClick: handleFormSubmit,
|
|
1131
|
+
className: "login2-submit-button"
|
|
1132
|
+
},
|
|
1133
|
+
isEmail ? import_utils.locales.getText("pisell-login2-continue-with-email") : import_utils.locales.getText("pisell-login2-continue-with-phone")
|
|
1134
|
+
)
|
|
1135
|
+
);
|
|
1136
|
+
}
|
|
1137
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1138
|
+
import_antd.Form,
|
|
1139
|
+
{
|
|
1140
|
+
form,
|
|
1141
|
+
layout: "vertical",
|
|
1142
|
+
className: "login2-form",
|
|
1143
|
+
size: "large",
|
|
1144
|
+
onFinish: handleLogin
|
|
1145
|
+
},
|
|
1146
|
+
isEmail && /* @__PURE__ */ import_react.default.createElement("div", { style: { position: "absolute", left: "-9999px", opacity: 0, pointerEvents: "none" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
1147
|
+
"input",
|
|
1148
|
+
{
|
|
1149
|
+
type: "text",
|
|
1150
|
+
name: "username",
|
|
1151
|
+
autoComplete: "username",
|
|
1152
|
+
tabIndex: -1,
|
|
1153
|
+
readOnly: true,
|
|
1154
|
+
"aria-hidden": "true"
|
|
1155
|
+
}
|
|
1156
|
+
)),
|
|
1157
|
+
isEmail ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label: accountLabel, name: accountFieldName, rules: accountRules, validateTrigger: ["onBlur", "onSubmit"] }, /* @__PURE__ */ import_react.default.createElement(
|
|
1158
|
+
import_materials.Input,
|
|
1159
|
+
{
|
|
1160
|
+
size: "large",
|
|
1161
|
+
placeholder: accountPlaceholder,
|
|
1162
|
+
className: "login2-input",
|
|
1163
|
+
type: "email",
|
|
1164
|
+
autoComplete: "email",
|
|
1165
|
+
value: getAccountValue() || enteredAccount || "",
|
|
1166
|
+
onChange: (e) => {
|
|
1167
|
+
const newValue = e.target.value;
|
|
1168
|
+
setEnteredAccount(newValue);
|
|
1169
|
+
form.setFieldsValue({ [accountFieldName]: newValue });
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
)) : /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label: accountLabel, name: accountFieldName, rules: accountRules, validateTrigger: ["onBlur", "onSubmit"] }, /* @__PURE__ */ import_react.default.createElement(
|
|
1173
|
+
import_PhoneInput.default,
|
|
1174
|
+
{
|
|
1175
|
+
size: "large",
|
|
1176
|
+
placeholder: accountPlaceholder,
|
|
1177
|
+
className: "login2-phone-input",
|
|
1178
|
+
countries,
|
|
1179
|
+
valueFormat: "object"
|
|
1180
|
+
}
|
|
1181
|
+
)),
|
|
1182
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1183
|
+
import_antd.Form.Item,
|
|
1184
|
+
{
|
|
1185
|
+
label: ((_w = (_v = (_u = config.ui) == null ? void 0 : _u.formLabels) == null ? void 0 : _v.password) == null ? void 0 : _w.show) !== false ? ((_z = (_y = (_x = config.ui) == null ? void 0 : _x.formLabels) == null ? void 0 : _y.password) == null ? void 0 : _z.text) || import_utils.locales.getText("pisell-login2-password-label") : void 0,
|
|
1186
|
+
name: "password",
|
|
1187
|
+
rules: passwordValidationRules,
|
|
1188
|
+
validateTrigger: ["onBlur", "onSubmit"]
|
|
1189
|
+
},
|
|
1190
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1191
|
+
import_materials.Input.Password,
|
|
1192
|
+
{
|
|
1193
|
+
size: "large",
|
|
1194
|
+
placeholder: import_utils.locales.getText("pisell-login2-password-placeholder"),
|
|
1195
|
+
className: "login2-input",
|
|
1196
|
+
name: "password",
|
|
1197
|
+
autoComplete: "current-password",
|
|
1198
|
+
type: "password"
|
|
1199
|
+
}
|
|
1200
|
+
)
|
|
1201
|
+
),
|
|
1202
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "login2-form-footer" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "remember_me", valuePropName: "checked", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_materials.Checkbox, null, import_utils.locales.getText("pisell-login2-remember-me"))), currentVerificationMethod === "password" && /* @__PURE__ */ import_react.default.createElement("a", { className: "login2-link", onClick: handleForgotPasswordClick }, import_utils.locales.getText("pisell-login2-forgot-password"))),
|
|
1203
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1204
|
+
import_materials.Button,
|
|
1205
|
+
{
|
|
1206
|
+
type: "primary",
|
|
1207
|
+
size: "large",
|
|
1208
|
+
block: true,
|
|
1209
|
+
htmlType: "submit",
|
|
1210
|
+
loading,
|
|
1211
|
+
onClick: handleLogin,
|
|
1212
|
+
className: "login2-submit-button"
|
|
1213
|
+
},
|
|
1214
|
+
import_utils.locales.getText("pisell-login2-login-button")
|
|
1215
|
+
)
|
|
1216
|
+
);
|
|
1217
|
+
};
|
|
1218
|
+
const renderSwitchOptions = () => {
|
|
1219
|
+
if (!currentLoginMethod) return null;
|
|
1220
|
+
const primaryMethod = loginMethods[0];
|
|
1221
|
+
const currentIsFormMethod = currentLoginMethod.type === "email" || currentLoginMethod.type === "phone";
|
|
1222
|
+
const primaryIsFormMethod = (primaryMethod == null ? void 0 : primaryMethod.type) === "email" || (primaryMethod == null ? void 0 : primaryMethod.type) === "phone";
|
|
1223
|
+
const shouldUseFormLayout = currentIsFormMethod || primaryIsFormMethod;
|
|
1224
|
+
const verificationSwitchButtons = [];
|
|
1225
|
+
if (currentIsFormMethod) {
|
|
1226
|
+
(currentLoginMethod.verificationMethods || []).filter((method) => method !== currentVerificationMethod).forEach((method) => {
|
|
1227
|
+
if (method === "verification_code") {
|
|
1228
|
+
const text = currentLoginMethod.type === "email" ? import_utils.locales.getText("pisell-login2-switch-to-email-code") : import_utils.locales.getText("pisell-login2-switch-to-sms-code");
|
|
1229
|
+
verificationSwitchButtons.push(
|
|
1230
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1231
|
+
"button",
|
|
1232
|
+
{
|
|
1233
|
+
key: "switch-to-code",
|
|
1234
|
+
className: "login2-switch-option-button",
|
|
1235
|
+
onClick: () => switchVerificationMethod("verification_code")
|
|
1236
|
+
},
|
|
1237
|
+
currentLoginMethod.type === "email" ? /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-mail-01" }) : /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-phone" }),
|
|
1238
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "option-text" }, text)
|
|
1239
|
+
)
|
|
1240
|
+
);
|
|
1241
|
+
} else {
|
|
1242
|
+
verificationSwitchButtons.push(
|
|
1243
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1244
|
+
"button",
|
|
1245
|
+
{
|
|
1246
|
+
key: "switch-to-password",
|
|
1247
|
+
className: "login2-switch-option-button",
|
|
1248
|
+
onClick: () => switchVerificationMethod("password")
|
|
1249
|
+
},
|
|
1250
|
+
/* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-key-01" }),
|
|
1251
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "option-text" }, import_utils.locales.getText("pisell-login2-switch-to-password"))
|
|
1252
|
+
)
|
|
1253
|
+
);
|
|
1254
|
+
}
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
const emailPhoneSwitchButtons = [];
|
|
1258
|
+
loginMethods.forEach((method, index) => {
|
|
1259
|
+
if (method.type === "email" || method.type === "phone") {
|
|
1260
|
+
if (method.type === currentLoginMethod.type) return;
|
|
1261
|
+
const isLast = isLastLoginMethod(method.type);
|
|
1262
|
+
const className2 = (0, import_classnames.default)("login2-switch-option-button", {
|
|
1263
|
+
"has-last-login-badge": isLast
|
|
1264
|
+
});
|
|
1265
|
+
emailPhoneSwitchButtons.push(
|
|
1266
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1267
|
+
"button",
|
|
1268
|
+
{
|
|
1269
|
+
key: `${method.type}-${index}`,
|
|
1270
|
+
className: className2,
|
|
1271
|
+
onClick: () => switchLoginMethod(method)
|
|
1272
|
+
},
|
|
1273
|
+
isLast && /* @__PURE__ */ import_react.default.createElement("div", { className: "last-login-badge" }, import_utils.locales.getText("pisell-login2-last-login-badge")),
|
|
1274
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1275
|
+
import_materials2.Iconfont,
|
|
1276
|
+
{
|
|
1277
|
+
type: method.type === "email" ? "pisell2-mail-01" : "pisell2-phone"
|
|
1278
|
+
}
|
|
1279
|
+
),
|
|
1280
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "option-text" }, method.type === "email" ? import_utils.locales.getText("pisell-login2-switch-to-email") : import_utils.locales.getText("pisell-login2-switch-to-phone"))
|
|
1281
|
+
)
|
|
1282
|
+
);
|
|
1283
|
+
}
|
|
1284
|
+
});
|
|
1285
|
+
const nonOauthButtons = [
|
|
1286
|
+
...verificationSwitchButtons,
|
|
1287
|
+
...emailPhoneSwitchButtons
|
|
1288
|
+
];
|
|
1289
|
+
const registerPrompt = onSwitchToRegister && /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-register-prompt" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "register-prompt-text" }, import_utils.locales.getText("pisell-login2-no-account")), /* @__PURE__ */ import_react.default.createElement(
|
|
1290
|
+
"button",
|
|
1291
|
+
{
|
|
1292
|
+
className: "register-prompt-link",
|
|
1293
|
+
onClick: onSwitchToRegister
|
|
1294
|
+
},
|
|
1295
|
+
import_utils.locales.getText("pisell-login2-register-link")
|
|
1296
|
+
));
|
|
1297
|
+
if (!nonOauthButtons.length && !oauthProviders.length) {
|
|
1298
|
+
return registerPrompt;
|
|
1299
|
+
}
|
|
1300
|
+
if (shouldUseFormLayout) {
|
|
1301
|
+
const groups = [];
|
|
1302
|
+
if (nonOauthButtons.length > 0) {
|
|
1303
|
+
groups.push(
|
|
1304
|
+
/* @__PURE__ */ import_react.default.createElement("div", { key: "non-oauth", className: "login2-switch-options" }, nonOauthButtons)
|
|
1305
|
+
);
|
|
1306
|
+
}
|
|
1307
|
+
if (oauthProviders.length > 0) {
|
|
1308
|
+
groups.push(
|
|
1309
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1310
|
+
import_OAuthButtonGroup.default,
|
|
1311
|
+
{
|
|
1312
|
+
key: "oauth",
|
|
1313
|
+
providers: oauthProviders,
|
|
1314
|
+
wrapperClassName: "login2-oauth-buttons",
|
|
1315
|
+
buttonClassName: "login2-oauth-button",
|
|
1316
|
+
gap: 12
|
|
1317
|
+
}
|
|
1318
|
+
)
|
|
1319
|
+
);
|
|
1320
|
+
}
|
|
1321
|
+
if (!groups.length) {
|
|
1322
|
+
return registerPrompt;
|
|
1323
|
+
}
|
|
1324
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-divider" }, import_utils.locales.getText("pisell-login2-or")), /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-switch-groups" }, groups), registerPrompt);
|
|
1325
|
+
}
|
|
1326
|
+
const primaryProvider = oauthProviders.find(
|
|
1327
|
+
(provider) => provider.key === (primaryMethod == null ? void 0 : primaryMethod.type)
|
|
1328
|
+
);
|
|
1329
|
+
const secondaryOauthProviders = oauthProviders.filter(
|
|
1330
|
+
(provider) => provider.key !== (primaryMethod == null ? void 0 : primaryMethod.type)
|
|
1331
|
+
);
|
|
1332
|
+
const hasSecondaryButtons = nonOauthButtons.length > 0 || secondaryOauthProviders.length > 0;
|
|
1333
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-switch-groups" }, primaryProvider ? /* @__PURE__ */ import_react.default.createElement(
|
|
1334
|
+
import_OAuthButtonGroup.default,
|
|
1335
|
+
{
|
|
1336
|
+
providers: [primaryProvider],
|
|
1337
|
+
wrapperClassName: "login2-oauth-buttons",
|
|
1338
|
+
buttonClassName: "login2-oauth-button",
|
|
1339
|
+
gap: 12
|
|
1340
|
+
}
|
|
1341
|
+
) : /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-switch-options" }, /* @__PURE__ */ import_react.default.createElement(
|
|
1342
|
+
"button",
|
|
1343
|
+
{
|
|
1344
|
+
key: "primary-fallback",
|
|
1345
|
+
className: "login2-switch-option-button",
|
|
1346
|
+
onClick: () => {
|
|
1347
|
+
if ((primaryMethod == null ? void 0 : primaryMethod.type) === "guest") {
|
|
1348
|
+
handleGuestLogin();
|
|
1349
|
+
} else if ((primaryMethod == null ? void 0 : primaryMethod.type) === "google" || (primaryMethod == null ? void 0 : primaryMethod.type) === "facebook" || (primaryMethod == null ? void 0 : primaryMethod.type) === "apple") {
|
|
1350
|
+
handleOAuthClick(primaryMethod.type);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
},
|
|
1354
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1355
|
+
import_materials2.Iconfont,
|
|
1356
|
+
{
|
|
1357
|
+
type: (primaryMethod == null ? void 0 : primaryMethod.type) === "guest" ? "pisell2-user-01" : (primaryMethod == null ? void 0 : primaryMethod.type) === "google" ? "pisell2-google" : (primaryMethod == null ? void 0 : primaryMethod.type) === "facebook" ? "pisell2-facebook" : "pisell2-apple"
|
|
1358
|
+
}
|
|
1359
|
+
),
|
|
1360
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "option-text" }, (primaryMethod == null ? void 0 : primaryMethod.type) === "guest" ? import_utils.locales.getText("pisell-login2-login-as-guest") : `${import_utils.locales.getText("pisell-login2-continue-with")} ${(primaryMethod == null ? void 0 : primaryMethod.type) ? primaryMethod.type.charAt(0).toUpperCase() + primaryMethod.type.slice(1) : ""}`)
|
|
1361
|
+
)), hasSecondaryButtons && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-divider" }, import_utils.locales.getText("pisell-login2-or")), nonOauthButtons.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-switch-options" }, nonOauthButtons), secondaryOauthProviders.length > 0 && /* @__PURE__ */ import_react.default.createElement(
|
|
1362
|
+
import_OAuthButtonGroup.default,
|
|
1363
|
+
{
|
|
1364
|
+
providers: secondaryOauthProviders,
|
|
1365
|
+
wrapperClassName: "login2-oauth-buttons",
|
|
1366
|
+
buttonClassName: "login2-oauth-button",
|
|
1367
|
+
gap: 12
|
|
1368
|
+
}
|
|
1369
|
+
))), registerPrompt);
|
|
1370
|
+
};
|
|
1371
|
+
if (!visible) {
|
|
1372
|
+
return null;
|
|
1373
|
+
}
|
|
1374
|
+
const { ui } = config;
|
|
1375
|
+
if (isEmailLinkVerification) {
|
|
1376
|
+
if (emailLinkVerifyStatus === "verifying") {
|
|
1377
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1378
|
+
"div",
|
|
1379
|
+
{
|
|
1380
|
+
className: (0, import_classnames.default)("login2-container", className),
|
|
1381
|
+
style: {
|
|
1382
|
+
...style,
|
|
1383
|
+
"--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
|
|
1384
|
+
}
|
|
1385
|
+
},
|
|
1386
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "login2-email-link-verifying" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "verifying-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "verifying-icon" }, /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "icon-loading", spin: true })), /* @__PURE__ */ import_react.default.createElement("h2", { className: "verifying-title" }, "Verifying your email..."), /* @__PURE__ */ import_react.default.createElement("p", { className: "verifying-desc" }, "Please wait while we verify your email link.")))
|
|
1387
|
+
);
|
|
1388
|
+
}
|
|
1389
|
+
if (emailLinkVerifyStatus === "success") {
|
|
1390
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1391
|
+
"div",
|
|
1392
|
+
{
|
|
1393
|
+
className: (0, import_classnames.default)("login2-container", className),
|
|
1394
|
+
style: {
|
|
1395
|
+
...style,
|
|
1396
|
+
"--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
|
|
1397
|
+
}
|
|
1398
|
+
},
|
|
1399
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1400
|
+
import_SetPassword.default,
|
|
1401
|
+
{
|
|
1402
|
+
scenario: "reset",
|
|
1403
|
+
flowData: {
|
|
1404
|
+
account: resetPasswordUserEmail || "",
|
|
1405
|
+
accountType: "email",
|
|
1406
|
+
verificationMethod: "verification_code"
|
|
1407
|
+
},
|
|
1408
|
+
onSubmit: async (password, confirmPassword) => {
|
|
1409
|
+
try {
|
|
1410
|
+
if (registerAndLogin == null ? void 0 : registerAndLogin.resetPasswordByCode) {
|
|
1411
|
+
const result = await registerAndLogin.resetPasswordByCode({
|
|
1412
|
+
code: config.emailLinkVerification.code,
|
|
1413
|
+
password
|
|
1414
|
+
});
|
|
1415
|
+
if (result.status) {
|
|
1416
|
+
import_antd.message.success("密码重置成功");
|
|
1417
|
+
setEmailLinkVerifyStatus(null);
|
|
1418
|
+
setEmailLinkError("");
|
|
1419
|
+
if (resetPasswordUserEmail) {
|
|
1420
|
+
const emailMethod = config.loginMethods.find((method) => method.type === "email");
|
|
1421
|
+
if (emailMethod) {
|
|
1422
|
+
setCurrentLoginMethod(emailMethod);
|
|
1423
|
+
setCurrentVerificationMethod(emailMethod.verificationMethods[0]);
|
|
1424
|
+
}
|
|
1425
|
+
form.setFieldsValue({ email: resetPasswordUserEmail });
|
|
1426
|
+
setEnteredAccount(resetPasswordUserEmail);
|
|
1427
|
+
setLoginStep("account");
|
|
1428
|
+
}
|
|
1429
|
+
} else {
|
|
1430
|
+
import_antd.message.error(result.message || "密码重置失败");
|
|
1431
|
+
}
|
|
1432
|
+
} else {
|
|
1433
|
+
import_antd.message.error("系统错误,请稍后重试");
|
|
1434
|
+
}
|
|
1435
|
+
} catch (error) {
|
|
1436
|
+
import_antd.message.error((error == null ? void 0 : error.message) || "密码重置失败");
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
onBack: () => {
|
|
1440
|
+
setEmailLinkVerifyStatus(null);
|
|
1441
|
+
setEmailLinkError("");
|
|
1442
|
+
},
|
|
1443
|
+
loading
|
|
1444
|
+
}
|
|
1445
|
+
)
|
|
1446
|
+
);
|
|
1447
|
+
}
|
|
1448
|
+
if (emailLinkVerifyStatus === "error") {
|
|
1449
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1450
|
+
"div",
|
|
1451
|
+
{
|
|
1452
|
+
className: (0, import_classnames.default)("login2-container", className),
|
|
1453
|
+
style: {
|
|
1454
|
+
...style,
|
|
1455
|
+
"--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
|
|
1456
|
+
}
|
|
1457
|
+
},
|
|
1458
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "login2-email-link-error" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "error-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "error-icon" }, /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "icon-error" })), /* @__PURE__ */ import_react.default.createElement("h2", { className: "error-title" }, import_utils.locales.getText("pisell-login2-verification-failed-title")), /* @__PURE__ */ import_react.default.createElement("p", { className: "error-desc" }, emailLinkError), /* @__PURE__ */ import_react.default.createElement(
|
|
1459
|
+
import_materials.Button,
|
|
1460
|
+
{
|
|
1461
|
+
type: "primary",
|
|
1462
|
+
size: "large",
|
|
1463
|
+
block: true,
|
|
1464
|
+
className: "login2-error-main-button",
|
|
1465
|
+
onClick: () => {
|
|
1466
|
+
setEmailLinkVerifyStatus(null);
|
|
1467
|
+
setEmailLinkError("");
|
|
1468
|
+
}
|
|
1469
|
+
},
|
|
1470
|
+
import_utils.locales.getText("pisell-login2-login-button")
|
|
1471
|
+
)))
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
if (showForgotPassword) {
|
|
1476
|
+
const accountType = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" ? "email" : "phone";
|
|
1477
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1478
|
+
"div",
|
|
1479
|
+
{
|
|
1480
|
+
className: (0, import_classnames.default)("login2-container", className),
|
|
1481
|
+
style: {
|
|
1482
|
+
...style,
|
|
1483
|
+
"--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
|
|
1484
|
+
}
|
|
1485
|
+
},
|
|
1486
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1487
|
+
import_ForgotPasswordFlow.default,
|
|
1488
|
+
{
|
|
1489
|
+
initialEmail: enteredAccount,
|
|
1490
|
+
accountType,
|
|
1491
|
+
onSendCode: handleForgotPasswordSendCode,
|
|
1492
|
+
onVerifyCode: handleForgotPasswordVerifyCode,
|
|
1493
|
+
onResetPassword: isEmailLinkVerification ? handleEmailLinkResetPassword : handleForgotPasswordReset,
|
|
1494
|
+
onSendResetLink: handleForgotPasswordSendLink,
|
|
1495
|
+
onBack: handleCloseForgotPassword,
|
|
1496
|
+
loading,
|
|
1497
|
+
countdown,
|
|
1498
|
+
countries
|
|
1499
|
+
}
|
|
1500
|
+
)
|
|
1501
|
+
);
|
|
1502
|
+
}
|
|
1503
|
+
if (loginStep === "code") {
|
|
1504
|
+
const accountType = (currentLoginMethod == null ? void 0 : currentLoginMethod.type) === "email" ? "email" : "phone";
|
|
1505
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1506
|
+
"div",
|
|
1507
|
+
{
|
|
1508
|
+
className: (0, import_classnames.default)("login2-container", className),
|
|
1509
|
+
style: {
|
|
1510
|
+
...style,
|
|
1511
|
+
"--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
|
|
1512
|
+
}
|
|
1513
|
+
},
|
|
1514
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1515
|
+
import_LoginCodeInput.default,
|
|
1516
|
+
{
|
|
1517
|
+
account: typeof enteredAccount === "string" ? enteredAccount : enteredAccount.phone,
|
|
1518
|
+
accountType,
|
|
1519
|
+
codeLength: 4,
|
|
1520
|
+
onSubmit: handleCodeSubmit,
|
|
1521
|
+
onResend: handleSendCode,
|
|
1522
|
+
onBack: handleBackFromCode,
|
|
1523
|
+
countdown,
|
|
1524
|
+
loading,
|
|
1525
|
+
error: codeError,
|
|
1526
|
+
onClearError: () => setCodeError("")
|
|
1527
|
+
}
|
|
1528
|
+
)
|
|
1529
|
+
);
|
|
1530
|
+
}
|
|
1531
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1532
|
+
"div",
|
|
1533
|
+
{
|
|
1534
|
+
className: (0, import_classnames.default)("login2-container", "register2-container", className),
|
|
1535
|
+
style: {
|
|
1536
|
+
...style,
|
|
1537
|
+
"--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
|
|
1538
|
+
}
|
|
1539
|
+
},
|
|
1540
|
+
/* @__PURE__ */ import_react.default.createElement(import_Header.default, { ui }),
|
|
1541
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "login2-content" }, renderMainLoginForm(), renderSwitchOptions()),
|
|
1542
|
+
/* @__PURE__ */ import_react.default.createElement(import_LegalTerms.default, { config: { ...config.legalTerms, mode: "login" } })
|
|
1543
|
+
);
|
|
1544
|
+
};
|
|
1545
|
+
var Login2_default = Login2;
|