@faststore/core 3.75.0 → 3.76.0
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +24 -24
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/account/orders.js +1 -1
- package/.next/server/pages/account/security.js +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/pages/account/orders-7e9738a62542bd48.js +1 -0
- package/.next/static/chunks/pages/account/security-7d12dd7a4ca973e6.js +1 -0
- package/.next/static/chunks/{webpack-3154bd2292a6ff53.js → webpack-b6bad1900f53d6e6.js} +1 -1
- package/.next/static/css/{3d41485722b4e3f5.css → 38e3a4a55b13b062.css} +1 -1
- package/.next/static/{hFo9Wcpbmu-Dxoo5xhC5c → naUI3eBajLdiLSfzUOpMz}/_buildManifest.js +1 -1
- package/.next/trace +135 -134
- package/.turbo/turbo-build.log +12 -12
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +10 -0
- package/package.json +2 -2
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/MyAccountFilterFacetPlacedBy.tsx +172 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/index.ts +2 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/styles.scss +96 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterSlider.tsx +8 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/section.module.scss +2 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrders.tsx +16 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountSelectedTags/MyAccountSelectedTags.tsx +20 -3
- package/src/components/account/security/SecurityDrawer.tsx +2 -6
- package/src/pages/account/orders/index.tsx +6 -0
- package/src/sdk/account/useSetPassword.ts +59 -48
- package/src/sdk/account/useShopperSuggestions.ts +151 -0
- package/src/sdk/search/useMyAccountFilter.ts +7 -0
- package/.next/static/chunks/pages/account/orders-692ad278b72ea12c.js +0 -1
- package/.next/static/chunks/pages/account/security-8ea4d1e2aba1bfb7.js +0 -1
- /package/.next/static/{hFo9Wcpbmu-Dxoo5xhC5c → naUI3eBajLdiLSfzUOpMz}/_ssgManifest.js +0 -0
|
@@ -11,24 +11,36 @@ type SetPasswordInput = {
|
|
|
11
11
|
recaptcha?: string
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
type SetPasswordState = {
|
|
15
|
-
error: Error | null
|
|
16
|
-
loading: boolean
|
|
17
|
-
}
|
|
18
|
-
|
|
19
14
|
type SetPasswordResultType = {
|
|
20
15
|
authStatus?: string
|
|
21
16
|
message?: string
|
|
22
17
|
}
|
|
23
18
|
|
|
19
|
+
const AUTH_STATUS = {
|
|
20
|
+
SUCCESS: 'success',
|
|
21
|
+
INVALID_EMAIL: 'invalidemail',
|
|
22
|
+
INVALID_PASSWORD: 'invalidpassword',
|
|
23
|
+
WRONG_CREDENTIALS: 'wrongcredentials',
|
|
24
|
+
UNEXPECTED_ERROR: 'unexpectederror',
|
|
25
|
+
NO_RESPONSE: 'noresponse',
|
|
26
|
+
FAILED: 'failed',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const authMessage = {
|
|
30
|
+
[AUTH_STATUS.SUCCESS]: 'Password set successfully',
|
|
31
|
+
[AUTH_STATUS.INVALID_EMAIL]: 'Invalid email or password',
|
|
32
|
+
[AUTH_STATUS.INVALID_PASSWORD]: 'Invalid email or password',
|
|
33
|
+
[AUTH_STATUS.WRONG_CREDENTIALS]: 'Wrong credentials',
|
|
34
|
+
[AUTH_STATUS.UNEXPECTED_ERROR]: 'Unexpected error. Please try again later.',
|
|
35
|
+
[AUTH_STATUS.NO_RESPONSE]: 'No response from set password API',
|
|
36
|
+
[AUTH_STATUS.FAILED]: 'Failed to set password',
|
|
37
|
+
}
|
|
38
|
+
|
|
24
39
|
export const useSetPassword = (accountName?: string) => {
|
|
25
|
-
const [
|
|
26
|
-
error: null,
|
|
27
|
-
loading: false,
|
|
28
|
-
})
|
|
40
|
+
const [loading, setLoading] = useState<boolean>(false)
|
|
29
41
|
|
|
30
42
|
const setPassword = useCallback(async (input: SetPasswordInput) => {
|
|
31
|
-
|
|
43
|
+
setLoading(true)
|
|
32
44
|
|
|
33
45
|
try {
|
|
34
46
|
await startLogin({ email: input.userEmail, accountName })
|
|
@@ -51,66 +63,62 @@ export const useSetPassword = (accountName?: string) => {
|
|
|
51
63
|
)
|
|
52
64
|
|
|
53
65
|
if (!response.ok) {
|
|
54
|
-
|
|
55
|
-
`Failed to set password: ${response.status} ${response.statusText}`
|
|
56
|
-
)
|
|
57
|
-
}
|
|
66
|
+
setLoading(false)
|
|
58
67
|
|
|
59
|
-
|
|
60
|
-
authStatus: 'Unexpected error',
|
|
61
|
-
message: 'Unexpected error while setting password',
|
|
62
|
-
}
|
|
68
|
+
console.error('Set password request failed:', response.statusText)
|
|
63
69
|
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
let errorStatus = AUTH_STATUS.UNEXPECTED_ERROR
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const errorBody = await response.json()
|
|
74
|
+
if (errorBody?.authStatus) {
|
|
75
|
+
errorStatus = String(errorBody.authStatus).toLowerCase().trim()
|
|
76
|
+
}
|
|
77
|
+
} catch {
|
|
78
|
+
// Keep the default error
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return {
|
|
66
82
|
success: false,
|
|
67
|
-
message:
|
|
83
|
+
message: authMessage[errorStatus],
|
|
68
84
|
}
|
|
85
|
+
}
|
|
69
86
|
|
|
70
|
-
|
|
87
|
+
const result: SetPasswordResultType = await response.json()
|
|
71
88
|
|
|
72
|
-
|
|
89
|
+
if (!result) {
|
|
90
|
+
setLoading(false)
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
success: false,
|
|
94
|
+
message: authMessage[AUTH_STATUS.NO_RESPONSE],
|
|
95
|
+
}
|
|
73
96
|
}
|
|
74
97
|
|
|
75
|
-
|
|
98
|
+
const authStatus = result?.authStatus?.toLowerCase().trim() ?? ''
|
|
76
99
|
|
|
77
100
|
return {
|
|
78
|
-
success:
|
|
79
|
-
|
|
80
|
-
: false,
|
|
81
|
-
message: 'Password set successfully',
|
|
101
|
+
success: authStatus === AUTH_STATUS.SUCCESS,
|
|
102
|
+
message: authMessage[authStatus] || 'Unexpected error occurred',
|
|
82
103
|
}
|
|
83
104
|
} catch (err) {
|
|
84
105
|
console.error('Error setting password:', err)
|
|
85
106
|
|
|
86
107
|
const authStatus =
|
|
87
108
|
typeof err === 'object' && err !== null && 'authStatus' in err
|
|
88
|
-
? String(err.authStatus)
|
|
89
|
-
:
|
|
90
|
-
|
|
91
|
-
const isInvalidCredentials =
|
|
92
|
-
authStatus.toLowerCase().includes('invalidemail') ||
|
|
93
|
-
authStatus.toLowerCase().includes('invalidpassword')
|
|
109
|
+
? String(err.authStatus).toLowerCase().trim()
|
|
110
|
+
: AUTH_STATUS.UNEXPECTED_ERROR
|
|
94
111
|
|
|
95
|
-
|
|
112
|
+
return {
|
|
96
113
|
success: false,
|
|
97
|
-
message:
|
|
98
|
-
? 'Invalid email or password'
|
|
99
|
-
: 'Unexpected error while setting password',
|
|
114
|
+
message: authMessage[authStatus] || 'Unexpected error occurred',
|
|
100
115
|
}
|
|
101
|
-
|
|
102
|
-
setState({ error: new Error('Failed to set password'), loading: false })
|
|
103
|
-
return errorResult
|
|
104
116
|
} finally {
|
|
105
|
-
|
|
117
|
+
setLoading(false)
|
|
106
118
|
}
|
|
107
119
|
}, [])
|
|
108
120
|
|
|
109
|
-
return {
|
|
110
|
-
setPassword,
|
|
111
|
-
error: state.error,
|
|
112
|
-
loading: state.loading,
|
|
113
|
-
}
|
|
121
|
+
return { setPassword, loading }
|
|
114
122
|
}
|
|
115
123
|
|
|
116
124
|
const startLogin = async ({
|
|
@@ -136,7 +144,10 @@ const startLogin = async ({
|
|
|
136
144
|
|
|
137
145
|
if (!response.ok) {
|
|
138
146
|
throw {
|
|
139
|
-
response: {
|
|
147
|
+
response: {
|
|
148
|
+
status: response.status,
|
|
149
|
+
statusText: response.statusText,
|
|
150
|
+
},
|
|
140
151
|
}
|
|
141
152
|
}
|
|
142
153
|
} catch (error) {
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { useMemo, useState, useCallback, useEffect } from 'react'
|
|
2
|
+
|
|
3
|
+
// This will be replaced with an imported type from a GraphQL schema in the future
|
|
4
|
+
export type Shopper = {
|
|
5
|
+
purchase_agent_id: string
|
|
6
|
+
name: string
|
|
7
|
+
email: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Mock data for now, will be fetched from API in the future
|
|
11
|
+
const MOCK_SHOPPERS: Shopper[] = [
|
|
12
|
+
{
|
|
13
|
+
purchase_agent_id: '1',
|
|
14
|
+
name: 'Robert Fox',
|
|
15
|
+
email: 'robert.fox@example.com',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
purchase_agent_id: '2',
|
|
19
|
+
name: 'Ronald Wilson',
|
|
20
|
+
email: 'ronald.wilson@example.com',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
purchase_agent_id: '3',
|
|
24
|
+
name: 'Cameron Williamson',
|
|
25
|
+
email: 'cameron.williamson@example.com',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
purchase_agent_id: '4',
|
|
29
|
+
name: 'Brooklyn Simmons',
|
|
30
|
+
email: 'brooklyn.simmons@example.com',
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
interface ShopperSuggestionsData {
|
|
35
|
+
/**
|
|
36
|
+
* Array of shoppers that match the search term
|
|
37
|
+
*/
|
|
38
|
+
shoppers: Shopper[]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface ShopperSuggestionsResult {
|
|
42
|
+
/**
|
|
43
|
+
* The data containing matched shoppers
|
|
44
|
+
*/
|
|
45
|
+
data: ShopperSuggestionsData | null
|
|
46
|
+
/**
|
|
47
|
+
* Error message if any
|
|
48
|
+
*/
|
|
49
|
+
error: Error | null
|
|
50
|
+
/**
|
|
51
|
+
* Whether the data is currently being loaded
|
|
52
|
+
*/
|
|
53
|
+
isLoading: boolean
|
|
54
|
+
/**
|
|
55
|
+
* Function to find a shopper by ID
|
|
56
|
+
*/
|
|
57
|
+
findShopperById: (id: string) => Shopper | undefined
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Hook to search for shoppers by name or email
|
|
62
|
+
*
|
|
63
|
+
* @param searchTerm - The term to search for
|
|
64
|
+
* @param options - Additional options for the hook
|
|
65
|
+
* @returns Result object with data, loading state, and error
|
|
66
|
+
*/
|
|
67
|
+
export function useShopperSuggestions(
|
|
68
|
+
searchTerm = ''
|
|
69
|
+
): ShopperSuggestionsResult {
|
|
70
|
+
const [data, setData] = useState<ShopperSuggestionsData | null>({
|
|
71
|
+
shoppers: MOCK_SHOPPERS,
|
|
72
|
+
})
|
|
73
|
+
const [error, setError] = useState<Error | null>(null)
|
|
74
|
+
const [isLoading, setIsLoading] = useState(false)
|
|
75
|
+
|
|
76
|
+
// Function to search for shoppers
|
|
77
|
+
const searchShoppers = useCallback(
|
|
78
|
+
async (term: string) => {
|
|
79
|
+
// Don't search if term is empty or null
|
|
80
|
+
if (!term?.trim()) {
|
|
81
|
+
setData({ shoppers: MOCK_SHOPPERS })
|
|
82
|
+
setIsLoading(false)
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
setIsLoading(true)
|
|
87
|
+
setError(null)
|
|
88
|
+
|
|
89
|
+
try {
|
|
90
|
+
// Simulate API call with timeout
|
|
91
|
+
const results = await new Promise<Shopper[]>((resolve) => {
|
|
92
|
+
setTimeout(() => {
|
|
93
|
+
// Filter logic to simulate server-side filtering
|
|
94
|
+
const q = term.trim().toLowerCase()
|
|
95
|
+
const filtered = MOCK_SHOPPERS.filter(
|
|
96
|
+
(shopper) =>
|
|
97
|
+
shopper.name.toLowerCase().includes(q) ||
|
|
98
|
+
shopper.email.toLowerCase().includes(q)
|
|
99
|
+
)
|
|
100
|
+
resolve(filtered)
|
|
101
|
+
}, 300) // Simulate network delay
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
setData({ shoppers: results })
|
|
105
|
+
} catch (err) {
|
|
106
|
+
setError(
|
|
107
|
+
err instanceof Error
|
|
108
|
+
? err
|
|
109
|
+
: new Error('Failed to search for shoppers')
|
|
110
|
+
)
|
|
111
|
+
setData({ shoppers: [] })
|
|
112
|
+
} finally {
|
|
113
|
+
setIsLoading(false)
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
[] // No dependencies needed for this mock implementation
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
// Setup debouncing for the search term
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
// Don't run search if term is empty and we already have null data
|
|
122
|
+
if (!searchTerm && data === null) return
|
|
123
|
+
|
|
124
|
+
const handler = setTimeout(() => {
|
|
125
|
+
searchShoppers(searchTerm)
|
|
126
|
+
}, 300)
|
|
127
|
+
|
|
128
|
+
return () => {
|
|
129
|
+
clearTimeout(handler)
|
|
130
|
+
}
|
|
131
|
+
}, [searchTerm])
|
|
132
|
+
|
|
133
|
+
// Helper function to find a shopper by ID
|
|
134
|
+
// We use useMemo instead of useCallback to ensure this function has a stable reference
|
|
135
|
+
// and doesn't cause infinite loops in dependencies of other hooks
|
|
136
|
+
const findShopperById = useMemo(() => {
|
|
137
|
+
// Return a stable function that won't change between renders
|
|
138
|
+
return (id: string): Shopper | undefined => {
|
|
139
|
+
return data?.shoppers.find((s) => s.purchase_agent_id === id)
|
|
140
|
+
}
|
|
141
|
+
}, [])
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
data,
|
|
145
|
+
error,
|
|
146
|
+
isLoading,
|
|
147
|
+
findShopperById,
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export default useShopperSuggestions
|
|
@@ -49,9 +49,16 @@ export type MyAccountFilter_Facets_StoreFacetRange_Fragment = {
|
|
|
49
49
|
to: string
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
export type MyAccountFilter_Facets_StoreFacetPlacedBy_Fragment = {
|
|
53
|
+
__typename: 'StoreFacetPlacedBy'
|
|
54
|
+
key: string
|
|
55
|
+
label: string
|
|
56
|
+
}
|
|
57
|
+
|
|
52
58
|
export type MyAccountFilter_FacetsFragment =
|
|
53
59
|
| MyAccountFilter_Facets_StoreFacetBoolean_Fragment
|
|
54
60
|
| MyAccountFilter_Facets_StoreFacetRange_Fragment
|
|
61
|
+
| MyAccountFilter_Facets_StoreFacetPlacedBy_Fragment
|
|
55
62
|
|
|
56
63
|
const reducer = (state: State, action: Action) => {
|
|
57
64
|
const { expanded, selected } = state
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5972],{6886:function(e,t,r){"use strict";r.d(t,{Z:function(){return MyAccountLayout_MyAccountLayout}});var a=r(6890),n=r(2210),i=r(727),l=r(9009),o=r(3339),c=r(7085),s=r.n(c),d=r(679),u=r(1549),Nav=e=>{var{items:t}=e,r=(0,o.useRouter)().pathname;return(0,u.jsx)("ul",{className:s().nav,children:t.map(e=>{var{route:t,title:a}=e;return(0,u.jsx)("li",{className:s().navItem,"data-is-selected":r.includes(t),children:(0,u.jsx)(i.Z,{href:t,tabIndex:0,children:a})},t)})})},MyAccountMenu_MyAccountMenu=e=>{var{avatarImageUrl:t,accountName:r,items:a}=e,{isDesktop:n}=(0,d.Z)();return(0,u.jsxs)("div",{className:s().menu,children:[n?(0,u.jsxs)("div",{className:s().account,children:[(0,u.jsxs)("div",{className:s().avatarContainer,children:[t?(0,u.jsx)("img",{className:s().avatar,src:t}):(0,u.jsx)("span",{className:s().avatar,children:null==r?void 0:r[0]}),(0,u.jsx)("h2",{children:r})]}),(0,u.jsx)(l.Z,{className:s().switchButton,variant:"secondary",size:"small",children:"Switch"})]}):null,(0,u.jsx)(Nav,{items:a})]})},f=[n.d3],MyAccountLayout_MyAccountLayout=e=>{var{children:t,accountName:r,isRepresentative:n=!0}=e,i=n?a.Z:a.Z.filter(e=>{var{route:t}=e;return!f.includes(t)});return(0,u.jsxs)("div",{className:s().layout,children:[(0,u.jsx)(MyAccountMenu_MyAccountMenu,{accountName:r,items:i}),(0,u.jsx)("section",{children:t})]})}},2562:function(e,t,r){"use strict";var a=r(5759),n=r(1549);t.Z=function(e){var t,{status:r,statusFallback:i}=e;return(0,n.jsx)("span",{"data-fs-my-account-badge":!0,"data-fs-my-account-badge-variant":function(e){var t,{status:r}=e;return(null===(t=a._y[r])||void 0===t?void 0:t.variant)||"neutral"}({status:r}),children:(null===(t=a._y[r])||void 0===t?void 0:t.label)||i||"-"})}},6896:function(e,t,r){"use strict";r.d(t,{p:function(){return useFormatPrice}});var a=r(31),n=r(4194),useFormatPrice=()=>{var{locale:e}=(0,a.kP)();return(0,n.useCallback)((t,r)=>new Intl.NumberFormat(e,{style:"currency",currency:r,minimumFractionDigits:2}).format(t/100),[e])}},6901:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return B},default:function(){return ListOrdersPage}});var a=r(3067),n=r(5935),i=r(6886),l=r(9173),o=r(1772),c=r(6924),s=r(1549),after=function(){return(0,s.jsx)(s.Fragment,{})},before=function(){return(0,s.jsx)(s.Fragment,{})},d=r(4235),u=r(4194),f=r(3339),p=r(6652),v=r(6396),y=r(9009),b=r(2614),m=r(6133),h=r(3922),g=r(1844),j=r(5699),x=r(4199),w=r(2815),O=r(6174),P=r(3779);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,a.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var _=(0,u.forwardRef)((e,t)=>{var{to:r,from:a,setDisabled:n}=e,i=(0,u.useRef)(null),l=(0,u.useRef)(null),{0:o,1:c}=(0,u.useState)(),{0:d,1:f}=(0,u.useState)(),{0:p,1:v}=(0,u.useState)({from:a,to:r});function onEnd(e){if(!e.from||!e.to){c(void 0),f(void 0),n(!1);return}new Date(e.from)>new Date(e.to)?(c("Invalid date range"),n(!0)):(c(void 0),f(void 0),n(!1))}return(0,u.useImperativeHandle)(t,()=>({clear:()=>{c(void 0),f(void 0),v({from:"",to:""}),i.current&&(i.current.value=""),l.current&&(l.current.value="")},getDataRangeFacet:()=>({key:"dateRange",value:p})})),(0,s.jsx)("div",{"data-fs-list-orders-filters-date-range":!0,children:(0,s.jsxs)("div",{"data-fs-list-orders-filters-date-range-inputs":!0,children:[(0,s.jsx)(P.Z,{id:"date-range-from",label:"From",type:"date",inputMode:"text",error:o,inputRef:i,value:p.from,onChange:e=>{var t;return t=e.target.value,void(v(_objectSpread(_objectSpread({},p),{},{from:String(t)})),null==onEnd||onEnd(_objectSpread(_objectSpread({},p),{},{from:String(t)})))},onBlur:()=>!o&&(null==onEnd?void 0:onEnd(p))}),(0,s.jsx)(P.Z,{id:"date-range-to",label:"To",type:"date",inputMode:"text",error:d,inputRef:l,value:p.to,onChange:e=>{var t;return t=e.target.value,void(v(_objectSpread(_objectSpread({},p),{},{to:String(t)})),null==onEnd||onEnd(_objectSpread(_objectSpread({},p),{},{to:String(t)})))},onBlur:()=>!d&&(null==onEnd?void 0:onEnd(p))})]})})}),S=r(9048),E=r.n(S),MyAccountFilterSlider_MyAccountFilterSlider=function(e){var{facets:t,testId:r,dispatch:a,expanded:n,selected:i,title:l,clearButtonLabel:o,applyButtonLabel:c,searchInputRef:d}=e,f=(0,u.useRef)(null),{0:p,1:v}=(0,u.useState)(!1),handleFilterChange=e=>{var{selectedFacets:t,text:r}=e,a=t.reduce((e,t)=>{var{key:r,value:a}=t;return"dateInitial"===r&&(e.dateInitial=a),"dateFinal"===r&&(e.dateFinal=a),"status"===r&&(e.status=Array.isArray(e.status)?[...e.status,a]:[a]),e},{}),n=new URLSearchParams;r&&n.set("text",r),Object.entries(a).forEach(e=>{var[t,r]=e;Array.isArray(r)?r.forEach(e=>n.append(t,e)):n.set(t,r)}),window.location.href="/account/orders?".concat(n.toString())};return(0,s.jsx)(g.Z,{overlayProps:{className:"section ".concat(E().section," section-filter-slider")},title:l,size:"partial",direction:"rightSide",clearBtnProps:{variant:"secondary",onClick:()=>{var e;null===(e=f.current)||void 0===e||e.clear(),a({type:"selectFacets",payload:[]})},children:null!=o?o:"Clear All"},applyBtnProps:{variant:"primary",onClick:()=>{var e,t,r=null===(e=f.current)||void 0===e?void 0:e.getDataRangeFacet();handleFilterChange({selectedFacets:[...i,r.value.from.trim()?{key:"dateInitial",value:r.value.from}:void 0,r.value.to.trim()?{key:"dateFinal",value:r.value.to}:void 0].filter(Boolean),text:null===(t=d.current)||void 0===t?void 0:t.inputRef.value})},disabled:p,children:null!=c?c:"Apply"},onClose:()=>{},children:(0,s.jsx)(j.Z,{testId:"mobile-".concat(r),indicesExpanded:n,onAccordionChange:e=>a({type:"toggleExpanded",payload:e}),children:t.map((e,t)=>{var{__typename:i,label:l}=e,o=n.has(t);return(0,s.jsxs)(x.Z,{testId:"mobile-".concat(r),index:t,type:i,label:l,children:["StoreFacetBoolean"===i&&o&&(0,s.jsx)(w.Z,{children:e.values.map(t=>(0,s.jsx)(O.Z,{id:"".concat(r,"-").concat(e.label,"-").concat(t.label),testId:"mobile-".concat(r),onFacetChange:e=>a({type:"toggleFacet",payload:e}),selected:t.selected,value:t.value,quantity:t.quantity,facetKey:e.key,label:t.label},"".concat(r,"-").concat(e.label,"-").concat(t.label)))}),"StoreFacetRange"===i&&o&&(0,s.jsx)(_,{ref:f,from:e.from,to:e.to,setDisabled:v})]},"".concat(r,"-").concat(l,"-").concat(t))})})})},useDebounce=(e,t,r)=>{var{0:a,1:n}=(0,u.useState)(r);return(0,u.useEffect)(()=>{if(a!==r){var n=setTimeout(()=>{e(a)},t);return()=>{clearTimeout(n)}}},[a]),n},A=r(9664),D=["value"];function useMyAccountFilter_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function useMyAccountFilter_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?useMyAccountFilter_ownKeys(Object(r),!0).forEach(function(t){(0,a.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):useMyAccountFilter_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var reducer=(e,t)=>{var{expanded:r,selected:a}=e,{type:n,payload:i}=t;switch(n){case"toggleExpanded":return r.has(i)?r.delete(i):r.add(i),useMyAccountFilter_objectSpread(useMyAccountFilter_objectSpread({},e),{},{expanded:new Set(r)});case"selectFacets":if(i!==a)return useMyAccountFilter_objectSpread(useMyAccountFilter_objectSpread({},e),{},{selected:i});break;case"toggleFacet":return useMyAccountFilter_objectSpread(useMyAccountFilter_objectSpread({},e),{},{selected:(0,A.wB)(e.selected,i)});case"setFacet":return useMyAccountFilter_objectSpread(useMyAccountFilter_objectSpread({},e),{},{selected:(0,A.uL)(e.selected,i.facet,i.unique)});default:throw Error("Action ".concat(n," not implemented"))}return e},useMyAccountFilter=e=>{var{allFacets:t,selectedFacets:r}=e,{0:{selected:a,expanded:n},1:i}=(0,u.useReducer)(reducer,null,()=>({expanded:new Set([0,1]),selected:r})),l=(0,u.useMemo)(()=>a.reduce((e,t)=>{var r;return e.has(t.key)||e.set(t.key,new Map),null===(r=e.get(t.key))||void 0===r||r.set(t.value,t),e},new Map),[a]);return{facets:(0,u.useMemo)(()=>t.map(e=>"StoreFacetBoolean"===e.__typename?useMyAccountFilter_objectSpread(useMyAccountFilter_objectSpread({},e),{},{values:e.values.map(t=>{var r,{value:a}=t;return useMyAccountFilter_objectSpread(useMyAccountFilter_objectSpread({},(0,d.Z)(t,D)),{},{value:a.toLowerCase(),selected:!!(null===(r=l.get(e.key))||void 0===r?void 0:r.has(a.toLowerCase()))})})}):e),[t,l]),selected:a,expanded:n,dispatch:i}},F=r(679),Z=r(5759),R=r(2562),C=r(6896),k=r(31),M=["page"];function MyAccountListOrdersTable_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function MyAccountListOrdersTable_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?MyAccountListOrdersTable_ownKeys(Object(r),!0).forEach(function(t){(0,a.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MyAccountListOrdersTable_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function formatOrderDate(e,t){return new Date(e).toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"})}function Pagination(e){var{page:t,total:r,perPage:a}=e,n=(0,f.useRouter)(),i=Math.ceil(r/a),l=1===t?1:(t-1)*a+1,o=r>l+a-1?l+a-1:r,handlePageChange=e=>{var t=n.query,{page:r}=t,a=(0,d.Z)(t,M);n.push({pathname:"/account/orders",query:MyAccountListOrdersTable_objectSpread(MyAccountListOrdersTable_objectSpread({},a),0===e||1===e?{}:{page:e})})};return(0,s.jsxs)("div",{"data-fs-list-orders-table-pagination":!0,children:[(0,s.jsx)("p",{children:"".concat(l," — ").concat(o," of ").concat(r)}),(0,s.jsx)(y.Z,{size:"small",variant:"tertiary",disabled:1===t,onClick:()=>handlePageChange(t-1),icon:(0,s.jsx)(b.Z,{width:16,height:16,name:"CaretLeft","aria-label":"Previous Page"}),iconPosition:"left"}),(0,s.jsx)(y.Z,{size:"small",variant:"tertiary",disabled:t===i,onClick:()=>handlePageChange(t+1),icon:(0,s.jsx)(b.Z,{width:16,height:16,name:"CaretRight","aria-label":"Next Page"}),iconPosition:"left"})]})}function MyAccountListOrdersTable(e){var t,{listOrders:r,total:a,perPage:n,filters:i}=e,l=(null==r?void 0:null===(t=r.list)||void 0===t?void 0:t.some(e=>{var t;return(null==e?void 0:null===(t=e.customFields)||void 0===t?void 0:t.filter(e=>"order"===e.type||"item"===e.type).flatMap(e=>e.value).length)>0}))||!1,{isDesktop:o}=(0,F.Z)(),{locale:c}=(0,k.kP)(),d=(0,C.p)(),{0:f,1:p}=(0,u.useState)({}),handleToggleExpand=e=>{p(t=>MyAccountListOrdersTable_objectSpread(MyAccountListOrdersTable_objectSpread({},t),{},{[e]:!t[e]}))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("table",{"data-fs-list-orders-table":!0,children:(0,s.jsx)("tbody",{"data-fs-list-orders-table-body":!0,children:r.list.map(e=>{var t,r,a,n,i,u=(null==e?void 0:null===(t=e.customFields)||void 0===t?void 0:null===(r=t.find(e=>{var{type:t}=e;return"item"===t}))||void 0===r?void 0:r.value)||[],p=f[e.orderId],v=u.length>5,m=p?u:u.slice(0,5),h="/account/orders/".concat(e.orderId);return(0,s.jsxs)("tr",{"data-fs-list-orders-table-body-row":!0,"data-fs-list-orders-table-row":!0,onClick:()=>{window.location.href=h},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),window.location.href=h)},tabIndex:0,"aria-label":"View order ".concat(e.orderId," details"),children:[(0,s.jsx)("td",{"data-fs-list-orders-table-cell":!0,children:(0,s.jsxs)("div",{"data-fs-list-orders-table-product-info-main":!0,children:[(0,s.jsx)("p",{"data-fs-list-orders-table-product-info-order-id":!0,children:e.orderId||"-"}),(0,s.jsxs)("p",{"data-fs-list-orders-table-product-info-order-total":!0,children:["Total: ",d(e.totalValue,e.currencyCode)]})]})}),o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("td",{"data-fs-list-orders-table-cell":!0,children:[(0,s.jsxs)("div",{"data-fs-list-orders-table-product-info":!0,children:[(0,s.jsx)("p",{"data-fs-list-orders-table-product-info-label":!0,children:"Placed on"}),(0,s.jsx)("p",{"data-fs-list-orders-table-product-info-value":!0,children:e.creationDate?formatOrderDate(e.creationDate,c):"-"})]}),l&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{"data-fs-list-orders-table-product-info":!0,children:[(0,s.jsx)("p",{"data-fs-list-orders-table-product-info-label":!0,children:"Delivery by"}),(0,s.jsx)("p",{"data-fs-list-orders-table-product-info-value":!0,children:e.ShippingEstimatedDate?formatOrderDate(e.ShippingEstimatedDate,c):"-"})]})})]}),!l&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("td",{"data-fs-list-orders-table-cell":!0,children:(0,s.jsxs)("div",{"data-fs-list-orders-table-product-info":!0,children:[(0,s.jsx)("p",{"data-fs-list-orders-table-product-info-label":!0,children:"Delivery by"}),(0,s.jsx)("p",{"data-fs-list-orders-table-product-info-value":!0,children:e.ShippingEstimatedDate?formatOrderDate(e.ShippingEstimatedDate,c):"-"})]})})}),l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{"data-fs-list-orders-table-cell":!0,children:null==e?void 0:null===(a=e.customFields)||void 0===a?void 0:null===(n=a.find(e=>{var{type:t}=e;return"order"===t}))||void 0===n?void 0:null===(i=n.value)||void 0===i?void 0:i.map((e,t)=>(0,s.jsx)("p",{"data-fs-list-orders-table-product-info-order":!0,children:e},e+t))}),(0,s.jsxs)("td",{"data-fs-list-orders-table-cell":!0,children:[m.map((e,t)=>(0,s.jsx)("p",{"data-fs-list-orders-table-product-info-item":!0,children:e},e+t)),v&&(0,s.jsx)(y.Z,{"data-fs-list-orders-table-expand-button":!0,size:"small",variant:"primary",inverse:!0,iconPosition:"right",icon:p?(0,s.jsx)(b.Z,{width:16,height:16,name:"CaretUp","aria-label":"Collapse"}):(0,s.jsx)(b.Z,{width:16,height:16,name:"CaretDown","aria-label":"Expand"}),onClick:t=>{t.preventDefault(),t.stopPropagation(),handleToggleExpand(e.orderId)},children:p?"View less":"View all"})]})]})]}),(0,s.jsxs)("td",{"data-fs-list-orders-table-cell":!0,children:[(0,s.jsx)(R.Z,{status:e.status,statusFallback:e.statusDescription}),!o&&(0,s.jsx)("p",{children:e.ShippingEstimatedDate?"Delivery by ".concat(formatOrderDate(e.ShippingEstimatedDate,c)):""})]})]},e.orderId)})})}),o&&(0,s.jsx)(Pagination,{page:i.page,total:a,perPage:n})]})}function formatFilterDate(e,t){var[r,a,n]=e.split("-").map(Number);return new Date(r,a-1,n).toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"})}function Tags(e){var{filters:t,onRemoveFilter:r}=e,{locale:a}=(0,k.kP)(),{dateInitial:n,dateFinal:i,status:l}=t,o=n?formatFilterDate(n,a):"",c=i?formatFilterDate(i,a):"",d=(n||i)&&(0,s.jsxs)("div",{"data-fs-list-orders-selected-tag":!0,children:[(0,s.jsx)("span",{"data-fs-list-orders-selected-tag-label":!0,children:(n&&i?"".concat(o," to ").concat(c):o?"from ".concat(o):"to ".concat(c))||""}),(0,s.jsx)("button",{"data-fs-list-orders-selected-tag-clear":!0,onClick:()=>{r("dateInitial",n)},children:"\xd7"})]},"date-range"),u=(l||[]).map(e=>(0,s.jsxs)("div",{"data-fs-list-orders-selected-tag":!0,children:[(0,s.jsx)("span",{children:Z.BX[e.toLowerCase()]||e}),(0,s.jsx)("button",{"data-fs-list-orders-selected-tag-clear":!0,onClick:()=>r("status",e),children:"\xd7"})]},"status-".concat(e)));return(0,s.jsxs)(s.Fragment,{children:[d,u]})}var MyAccountSelectedTags_MyAccountSelectedTags=function(e){var{filters:t,onClearAll:r,onRemoveFilter:a}=e,n=Object.entries(t).some(e=>{var[t,r]=e;return("status"===t||"dateInitial"===t||"dateFinal"===t)&&r&&(!Array.isArray(r)||r.length>0)});return(0,s.jsx)(s.Fragment,{children:n&&(0,s.jsxs)("div",{"data-fs-list-orders-selected-tags":!0,children:[(0,s.jsx)(Tags,{filters:t,onRemoveFilter:a}),(0,s.jsx)(y.Z,{variant:"tertiary",size:"small","data-fs-list-orders-selected-tags-clear-all-button":!0,onClick:r,children:"Clear All"})]})})},I=r(5841),L=r.n(I),N=["page","clientEmail"];function MyAccountListOrders_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function MyAccountListOrders_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?MyAccountListOrders_ownKeys(Object(r),!0).forEach(function(t){(0,a.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MyAccountListOrders_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function getSelectedFacets(e){var{filters:t}=e;return Object.keys(t).reduce((e,r)=>{if("page"===r||"text"===r||"clientEmail"===r)return e;var a=t[r];if("status"===r&&a.length>0){var n=Array.isArray(a)?a:[a];e.push(...n.map(e=>({key:"status",value:e.toLowerCase()})))}else"dateInitial"===r&&a?e.push({key:"dateInitial",value:String(a)}):"dateFinal"===r&&a&&e.push({key:"dateFinal",value:String(a)});return e},[])}function MyAccountListOrders(e){var{listOrders:t,total:r,perPage:a,filters:n}=e,i=(0,f.useRouter)(),{isDesktop:l}=(0,F.Z)(),o=(0,u.useRef)(null);(0,u.useEffect)(()=>{var e,t;null!==(e=o.current)&&void 0!==e&&e.inputRef&&(null!=n&&n.text&&null!==(t=o.current)&&void 0!==t&&t.inputRef?o.current.inputRef.value=n.text:o.current.inputRef.value="")},[null==n?void 0:n.text]);var c=useDebounce(e=>{if((e||i.query.text)&&e.trim().toLowerCase()!==(null===(t=i.query.text)||void 0===t?void 0:t.toString().trim().toLowerCase())){var t,r=new URLSearchParams(window.location.search);r.delete("text"),r.delete("page"),e&&r.set("text",e),window.location.href="/account/orders?".concat(r.toString())}},300,String(i.query.text)),g=getSelectedFacets({filters:n}),j=useMyAccountFilter({allFacets:function(e){var{filters:t}=e;return[{__typename:"StoreFacetBoolean",key:"status",label:"Status",values:Z.j4.map(e=>({label:e,quantity:0,selected:!1,value:e.toLowerCase()}))},{__typename:"StoreFacetRange",key:"dateRange",label:"Order Date",from:t.dateInitial,to:t.dateFinal}]}({filters:n}),selectedFacets:g}),{openFilter:x,filter:w}=(0,p.l8)(),O=n.status.length>0||!!n.dateInitial||!!n.dateFinal||!!n.text,P=0===t.list.length;return(0,s.jsxs)("div",{className:L().page,children:[(0,s.jsxs)("div",{"data-fs-list-orders":!0,children:[(0,s.jsx)("h1",{"data-fs-list-orders-title":!0,children:"Orders"}),(0,s.jsxs)("div",{"data-fs-list-orders-header":!0,children:[(0,s.jsxs)("div",{"data-fs-list-orders-search-filters":!0,children:[(0,s.jsx)(v.Z,{ref:o,"data-fs-search-input-field-list-orders":!0,placeholder:"Search",onBlur:e=>{c(o.current.inputRef.value)},onKeyDown:e=>{"Enter"===e.key&&c(o.current.inputRef.value)},onSubmit:e=>{c(o.current.inputRef.value)}}),(0,s.jsx)(y.Z,{"data-fs-list-orders-search-filters-button":!0,variant:"tertiary",icon:(0,s.jsx)(b.Z,{width:16,height:16,name:"FadersHorizontal","aria-label":"Open Filters"}),iconPosition:"left",onClick:()=>{j.dispatch({type:"selectFacets",payload:getSelectedFacets({filters:n})}),x()},children:"Filters"})]}),l&&(0,s.jsx)(Pagination,{page:n.page,total:r,perPage:a})]}),(0,s.jsx)(MyAccountSelectedTags_MyAccountSelectedTags,{filters:{status:n.status,dateInitial:n.dateInitial,dateFinal:n.dateFinal},onClearAll:()=>{window.location.href="/account/orders"},onRemoveFilter:(e,t)=>{var r=MyAccountListOrders_objectSpread({},n),{page:a,clientEmail:i}=r,l=(0,d.Z)(r,N);"status"===e&&Array.isArray(l[e])?l[e]=l[e].filter(e=>e!==t):"dateInitial"===e||"dateFinal"===e?(delete l.dateInitial,delete l.dateFinal):delete l[e],"status"===e&&Array.isArray(l[e])?l[e]=l[e].filter(e=>e.toLowerCase()!==t.toLowerCase()):"dateInitial"===e||"dateFinal"===e?(delete l.dateInitial,delete l.dateFinal):delete l[e];var o=Object.fromEntries(Object.entries(l).filter(e=>{var[,t]=e;return Array.isArray(t)?t.length>0:!!t})),c=new URLSearchParams(o);window.location.href="/account/orders?".concat(c.toString())}}),w&&(0,s.jsx)(MyAccountFilterSlider_MyAccountFilterSlider,MyAccountListOrders_objectSpread(MyAccountListOrders_objectSpread({},j),{},{title:"Filters",clearButtonLabel:"Clear All",applyButtonLabel:"View Results",searchInputRef:o})),P?(0,s.jsx)(m.Z,{titleIcon:(0,s.jsx)(b.Z,{name:O?"MagnifyingGlass":"Bag2",width:56,height:56,weight:"thin"}),title:O?"No results found":"You don't have any orders",bkgColor:"light",children:!O&&(0,s.jsx)(h.Z,{"data-fs-list-orders-empty-state-link":!0,href:"/",variant:"secondary",children:"Start shopping"})}):(0,s.jsx)(MyAccountListOrdersTable,{listOrders:t,total:r,perPage:a,filters:n})]}),!l&&(0,s.jsx)(Pagination,{page:n.page,total:r,perPage:a})]})}var T=r(6272);function orders_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function orders_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?orders_ownKeys(Object(r),!0).forEach(function(t){(0,a.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):orders_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var q=orders_objectSpread(orders_objectSpread({},o.Z),c.Z),B=!0;function ListOrdersPage(e){var{globalSections:t,accountName:r,listOrders:a,total:o,perPage:c,filters:d,isRepresentative:u}=e,{sections:f,settings:p}=null!=t?t:{};return(0,s.jsx)(T.ZP,{context:{globalSettings:p},children:(0,s.jsxs)(l.ZP,{globalSections:f,components:q,children:[(0,s.jsx)(n.PB,{noindex:!0,nofollow:!0}),(0,s.jsxs)(i.Z,{isRepresentative:u,accountName:r,children:[(0,s.jsx)(before,{}),(0,s.jsx)(MyAccountListOrders,{listOrders:a,filters:d,perPage:c,total:o}),(0,s.jsx)(after,{})]})]})})}},5759:function(e,t,r){"use strict";r.d(t,{BX:function(){return i},_y:function(){return a},j4:function(){return n}});var a={created:{variant:"success",label:"Order Placed"},creating:{variant:"success",label:"Order Placed"},"on-order-completed":{variant:"success",label:"Order Placed"},"on-order-completed-ffm":{variant:"success",label:"Order Placed"},"order-accepted":{variant:"success",label:"Order Placed"},"order-created":{variant:"success",label:"Order Placed"},"waiting-for-seller-confirmation":{variant:"success",label:"Order Placed"},"waiting-for-authorization":{variant:"warning",label:"Approval Pending"},"waiting-for-confirmation":{variant:"warning",label:"Approval Pending"},"approving-transaction":{variant:"warning",label:"Payment Pending"},"notify-payment":{variant:"warning",label:"Payment Pending"},"payment-pending":{variant:"warning",label:"Payment Pending"},"payment-approved":{variant:"success",label:"Payment Approved"},"approve-payment":{variant:"success",label:"Payment Approved"},"payment-denied":{variant:"neutral",label:"Payment Denied"},"authorize-fulfillment":{variant:"success",label:"Ready for Delivery"},handling:{variant:"success",label:"Ready for Delivery"},invoice:{variant:"success",label:"Ready for Delivery"},"invoice-after-cancellation-deny":{variant:"success",label:"Ready for Delivery"},invoicing:{variant:"success",label:"Ready for Delivery"},packing:{variant:"success",label:"Ready for Delivery"},picking:{variant:"success",label:"Ready for Delivery"},"ready-for-handling":{variant:"success",label:"Ready for Delivery"},"ready-for-invoicing":{variant:"success",label:"Ready for Delivery"},"ready-for-packing":{variant:"success",label:"Ready for Delivery"},"ready-for-picking":{variant:"success",label:"Ready for Delivery"},"release-to-fulfillment":{variant:"success",label:"Ready for Delivery"},"start-handling":{variant:"success",label:"Ready for Delivery"},"waiting-ffmt-authorization":{variant:"success",label:"Ready for Delivery"},"waiting-for-fulfillment":{variant:"success",label:"Ready for Delivery"},"window-to-cancel":{variant:"success",label:"Ready for Delivery"},invoiced:{variant:"success",label:"Invoiced"},"accepting-cancel":{variant:"neutral",label:"Cancellation Requested"},cancel:{variant:"neutral",label:"Cancellation Requested"},canceling:{variant:"neutral",label:"Cancellation Requested"},"cancellation-requested":{variant:"neutral",label:"Cancellation Requested"},"cancellation-requested-with-ack":{variant:"neutral",label:"Cancellation Requested"},"request-cancel":{variant:"neutral",label:"Cancellation Requested"},"waiting-for-seller-decision":{variant:"neutral",label:"Cancellation Requested"},canceled:{variant:"neutral",label:"Canceled"}},n=["Order Placed","Approval Pending","Payment Pending","Payment Approved","Payment Denied","Ready for Delivery","Invoiced","Cancellation Requested","Canceled"],i={"order placed":"Order Placed","approval pending":"Approval Pending","payment pending":"Payment Pending","payment approved":"Payment Approved","payment denied":"Payment Denied","ready for delivery":"Ready for Delivery",invoiced:"Invoiced","cancellation requested":"Cancellation Requested",canceled:"Canceled"}},1403:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/orders",function(){return r(6901)}])},9048:function(e){e.exports={section:"section_section__YPC0_"}},5841:function(e){e.exports={page:"styles_page__flnO9"}},7085:function(e){e.exports={layout:"section_layout__QJ4xs",menu:"section_menu__WKZdl",account:"section_account__YjCAC",avatarContainer:"section_avatarContainer__1RMsJ",switchButton:"section_switchButton__ul06M",nav:"section_nav__Jjee8",navItem:"section_navItem__yr27R",avatar:"section_avatar__IQLo8"}},2740:function(e,t,r){"use strict";var a=r(4194);let n=(0,a.forwardRef)(function({testId:e="fs-checkbox",partial:t,...r},n){return a.createElement("input",{ref:n,"data-fs-checkbox":!0,"data-testid":e,"data-fs-checkbox-partial":t,type:"checkbox",...r})});t.Z=n},6735:function(e,t,r){"use strict";var a=r(4194);let n=(0,a.forwardRef)(function({testId:e="fs-radio",...t},r){return a.createElement("input",{ref:r,"data-fs-radio":!0,type:"radio","data-testid":e,...t})});t.Z=n},1516:function(e,t,r){"use strict";r.d(t,{A:function(){return useAccordion}});var a=r(4194);let n=(0,a.createContext)(void 0),i=(0,a.forwardRef)(function({testId:e="fs-accordion",indices:t,onChange:r,children:i,...l},o){let c=a.Children.map(i,(e,t)=>{if(e)return(0,a.cloneElement)(e,{index:e.props.index??t})}),s={indices:new Set(t),onChange:r,numberOfItems:c.length};return a.createElement(n.Provider,{value:s},a.createElement("div",{ref:o,"data-fs-accordion":!0,role:"region","data-testid":e,...l},c))});function useAccordion(){let e=(0,a.useContext)(n);if(void 0===e)throw Error("Do not use Accordion components outside the Accordion context.");return e}t.Z=i},7734:function(e,t,r){"use strict";var a=r(4194),n=r(1516),i=r(783),l=r(2614),o=r(9009);let c=(0,a.forwardRef)(function({testId:e="fs-accordion-button",expandedIcon:t=a.createElement(l.Z,{name:"MinusCircle","data-icon":"expanded"}),collapsedIcon:r=a.createElement(l.Z,{name:"PlusCircle","data-icon":"collapsed"}),children:c,...s},d){let{indices:u,onChange:f,numberOfItems:p}=(0,n.A)(),{index:v,panel:y,button:b,prefixId:m}=(0,i.D)();return a.createElement(o.Z,{ref:d,id:b,variant:"tertiary","data-fs-accordion-button":u.has(v)?"expanded":"collapsed","aria-expanded":u.has(v),icon:u.has(v)?t:r,iconPosition:"right","aria-controls":y,onKeyDown:e=>{if(["ArrowDown","ArrowUp"].includes(e.key))switch(e.key){case"ArrowDown":e.preventDefault(),(()=>{let e=Number(v)+1===p?0:Number(v)+1;return document.getElementById(`${m&&`${m}-`}button--${e}`)})()?.focus();break;case"ArrowUp":e.preventDefault(),(()=>{let e=Number(v)-1<0?p-1:Number(v)-1;return document.getElementById(`${m&&`${m}-`}button--${e}`)})()?.focus()}},onClick:()=>{f(v)},"data-testid":e,...s},c)});t.Z=c},783:function(e,t,r){"use strict";r.d(t,{D:function(){return useAccordionItem}});var a=r(4194);let n=(0,a.createContext)(void 0),i=(0,a.forwardRef)(function({prefixId:e="",index:t=0,as:r,children:i,testId:l="fs-accordion-item",...o},c){let s=r??"div",d={index:t,prefixId:e,panel:`${e&&`${e}-`}panel--${t}`,button:`${e&&`${e}-`}button--${t}`};return a.createElement(n.Provider,{value:d},a.createElement(s,{ref:c,"data-fs-accordion-item":!0,"data-testid":l,...o},i))});function useAccordionItem(){let e=(0,a.useContext)(n);if(void 0===e)throw Error("Do not use AccordionItem components outside the AccordionItem context.");return e}t.Z=i},7583:function(e,t,r){"use strict";var a=r(4194),n=r(1516),i=r(783);let l=(0,a.forwardRef)(function({testId:e="fs-accordion-panel",children:t,...r},l){let{indices:o}=(0,n.A)(),{index:c,button:s,panel:d}=(0,i.D)();return a.createElement("div",{ref:l,id:d,"data-fs-accordion-panel":!0,"aria-labelledby":s,role:"region",hidden:!o.has(c),"data-testid":e,...r},t)});t.Z=l},3922:function(e,t,r){"use strict";var a=r(4194);t.Z=function({icon:e,inverse:t,children:r,disabled:n,iconPosition:i,size:l="regular",variant:o="primary",testId:c="fs-link-button",...s}){let d=(0,a.useRef)(null);return a.createElement("a",{ref:d,"data-fs-button":!0,"data-fs-link-button":!0,"data-fs-button-size":l,"data-fs-button-variant":o,"data-fs-button-inverse":t,"data-fs-button-disabled":n,onFocus:function(e){e.preventDefault(),n&&d.current?.blur()},"data-testid":c,...s},a.createElement("div",{"data-fs-button-wrapper":!0},!!e&&"left"===i&&a.createElement("span",{"data-fs-button-icon":!0},e),r&&a.createElement("span",null,r),!!e&&"right"===i&&a.createElement("span",{"data-fs-button-icon":!0},e)))}},5737:function(e,t,r){"use strict";var a=r(4194),n=r(1953),i=r(6735);let l=(0,a.forwardRef)(function({testId:e="fs-radio-field",id:t,label:r,value:l,name:o,...c},s){return a.createElement("div",{ref:s,"data-fs-radio-field":!0,"data-testid":e},a.createElement(i.Z,{id:t,value:"string"==typeof r?r:l,name:o,...c}),a.createElement(n.Z,{htmlFor:t},r))});t.Z=l},6396:function(e,t,r){"use strict";var a=r(4194),n=r(2256),i=r(7041),l=r(2614);let o=(0,a.forwardRef)(function({onSubmit:e,buttonIcon:t,"aria-label":r="search",testId:o="fs-search-input",buttonProps:c,...s},d){let u=(0,a.useRef)(null),f=(0,a.useRef)(null);return(0,a.useImperativeHandle)(d,()=>({inputRef:u.current,formRef:f.current})),a.createElement("form",{ref:f,"data-fs-search-input-field":!0,"data-testid":o,onSubmit:t=>{t.preventDefault(),u.current?.value!==""&&e(u.current.value)},role:"search"},a.createElement(n.Z,{ref:u,"aria-label":r,"data-fs-search-input-field-input":!0,...s}),a.createElement(i.Z,{type:"submit","aria-label":"Submit Search",icon:t??a.createElement(l.Z,{name:"MagnifyingGlass"}),size:"small",...c}))});t.Z=o},6133:function(e,t,r){"use strict";var a=r(4194);t.Z=function({testId:e="fs-empty-state",title:t,titleIcon:r,variant:n="default",bkgColor:i="default",children:l,...o}){return a.createElement("section",{"data-fs-empty-state":!0,"data-fs-empty-state-variant":n,"data-fs-empty-state-bkg-color":i,"data-fs-content":"empty-state","data-testid":e,...o},t&&a.createElement("header",{"data-fs-empty-state-title":!0},r&&a.createElement(a.Fragment,null,r),a.createElement("p",null,t)),l)}},5699:function(e,t,r){"use strict";var a=r(4194),n=r(1516);t.Z=function({testId:e,title:t,indicesExpanded:r,onAccordionChange:i,children:l}){return a.createElement("div",{"data-fs-filter":!0,"data-testid":e},a.createElement("h2",{"data-fs-filter-title":!0},t),a.createElement(n.Z,{indices:r,onChange:i,"data-fs-filter-accordion":!0},l))}},2815:function(e,t,r){"use strict";var a=r(4194),n=r(4564);t.Z=function({children:e}){return a.createElement(n.Z,{"data-fs-filter-list":!0},e)}},6174:function(e,t,r){"use strict";var a=r(4194),n=r(2740),i=r(1953),l=r(276),o=r(5737);t.Z=function({testId:e,id:t,selected:r,value:c,quantity:s,facetKey:d,label:u,type:f="checkbox",onFacetChange:p}){return a.createElement("li",{key:t,"data-fs-filter-list-item":!0},"checkbox"===f?a.createElement(a.Fragment,null,a.createElement(n.Z,{id:t,checked:r,onChange:()=>p({key:d,value:c},"BOOLEAN"),"data-fs-filter-list-item-checkbox":!0,"data-testid":`${e}-accordion-panel-checkbox`,"data-value":c,"data-quantity":s}),a.createElement(i.Z,{htmlFor:t,className:"text__title-mini-alt","data-fs-filter-list-item-label":!0},u," ",a.createElement(l.Z,{"data-fs-filter-list-item-badge":!0},s))):a.createElement(o.Z,{id:t,name:d,value:c,checked:r,onChange:()=>p({key:d,value:c},"BOOLEAN"),"data-fs-filter-list-item-radio":!0,"data-testid":`${e}-accordion-panel-radio`,"data-value":c,label:u}))}},4199:function(e,t,r){"use strict";var a=r(4194),n=r(783),i=r(7734),l=r(7583);t.Z=function({testId:e,label:t,index:r,children:o,type:c,description:s}){return a.createElement(n.Z,{key:`${t}-${r}`,prefixId:e,testId:`${e}-accordion`,index:r,"data-type":c,"data-fs-filter-accordion-item":!0},a.createElement(i.Z,{testId:`${e}-accordion-button`},t),a.createElement(l.Z,null,s&&a.createElement("span",{"data-fs-filter-accordion-item-description":!0},s),o))}},1844:function(e,t,r){"use strict";var a=r(4194),n=r(3666),i=r(6652),l=r(7215),o=r(5049),c=r(9009);t.Z=function({testId:e="fs-filter-slider",title:t,size:r,direction:s,children:d,applyBtnProps:u,clearBtnProps:f,overlayProps:p,onClose:v,onDismiss:y,footer:b=!0,...m}){let{fade:h,fadeOut:g}=(0,n.b)(),{closeFilter:j,closeRegionSlider:x}=(0,i.l8)();return a.createElement(l.Z,{"data-fs-filter-slider":!0,isOpen:!0,fade:h,onDismiss:()=>{g(),y?.()},size:r,direction:s,onTransitionEnd:()=>{"out"===h&&(j(),x())},testId:e,overlayProps:p,...m},a.createElement("div",{"data-fs-filter-slider-content":!0},a.createElement(o.Z,{onClose:()=>{v(),g()}},a.createElement("h2",{"data-fs-filter-slider-title":!0},t)),d),b&&a.createElement("footer",{"data-fs-filter-slider-footer":!0},f&&a.createElement(c.Z,{"data-fs-filter-slider-footer-button-clear":!0,...f}),u&&a.createElement(c.Z,{"data-fs-filter-slider-footer-button-apply":!0,testId:`${e}-button-apply`,...u,onClick:e=>{u?.onClick?.(e),g()}})))}}},function(e){e.O(0,[6031,9173,9774,2888,179],function(){return e(e.s=1403)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7889],{6886:function(e,t,r){"use strict";r.d(t,{Z:function(){return MyAccountLayout_MyAccountLayout}});var s=r(6890),a=r(2210),n=r(727),i=r(9009),c=r(3339),o=r(7085),l=r.n(o),d=r(679),u=r(1549),Nav=e=>{var{items:t}=e,r=(0,c.useRouter)().pathname;return(0,u.jsx)("ul",{className:l().nav,children:t.map(e=>{var{route:t,title:s}=e;return(0,u.jsx)("li",{className:l().navItem,"data-is-selected":r.includes(t),children:(0,u.jsx)(n.Z,{href:t,tabIndex:0,children:s})},t)})})},MyAccountMenu_MyAccountMenu=e=>{var{avatarImageUrl:t,accountName:r,items:s}=e,{isDesktop:a}=(0,d.Z)();return(0,u.jsxs)("div",{className:l().menu,children:[a?(0,u.jsxs)("div",{className:l().account,children:[(0,u.jsxs)("div",{className:l().avatarContainer,children:[t?(0,u.jsx)("img",{className:l().avatar,src:t}):(0,u.jsx)("span",{className:l().avatar,children:null==r?void 0:r[0]}),(0,u.jsx)("h2",{children:r})]}),(0,u.jsx)(i.Z,{className:l().switchButton,variant:"secondary",size:"small",children:"Switch"})]}):null,(0,u.jsx)(Nav,{items:s})]})},p=[a.d3],MyAccountLayout_MyAccountLayout=e=>{var{children:t,accountName:r,isRepresentative:a=!0}=e,n=a?s.Z:s.Z.filter(e=>{var{route:t}=e;return!p.includes(t)});return(0,u.jsxs)("div",{className:l().layout,children:[(0,u.jsx)(MyAccountMenu_MyAccountMenu,{accountName:r,items:n}),(0,u.jsx)("section",{children:t})]})}},5893:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return M},default:function(){return Page}});var s,a=r(3067),n=r(5935),i=r(6886),c=r(9173),o=r(1772),l=r(6924),d=r(1549),after=function(){return(0,d.jsx)(d.Fragment,{})},before=function(){return(0,d.jsx)(d.Fragment,{})},u=r(6272),p=r(4194),y=r(9009),h=r(4988),w=r(3666),f=r(6652),j=r(2614),x=r(7215),b=r(5049),v=r(2256),m=r(7041),g=r(6899),_=r.n(g),S=r(4018),O=r(3412),P=r.n(O);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,a.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var useSetPassword=e=>{var t,{0:r,1:s}=(0,p.useState)({error:null,loading:!1});return{setPassword:(0,p.useCallback)((t=(0,h.Z)(function*(t){s(e=>_objectSpread(_objectSpread({},e),{},{loading:!0,error:null}));try{yield Z({email:t.userEmail,accountName:e});var r,a={login:t.userEmail,currentPassword:t.currentPassword,newPassword:t.newPassword,accesskey:t.accesskey?t.accesskey:null,recaptcha:t.recaptcha?t.recaptcha:null},n=yield _()("/api/vtexid/pub/authentication/classic/setpassword?expireSessions=true",{method:"POST",body:(0,S.GZ)(a),credentials:"include"});if(!n.ok)throw Error("Failed to set password: ".concat(n.status," ").concat(n.statusText));var i=null!==(r=yield n.json())&&void 0!==r?r:{authStatus:"Unexpected error",message:"Unexpected error while setting password"};if(!i){var c={success:!1,message:"No response from set password API"};return s({loading:!1,error:Error(c.message)}),c}return s({error:null,loading:!1}),{success:null!=i&&!!i.authStatus&&(null==i?void 0:i.authStatus.toLowerCase())==="success",message:"Password set successfully"}}catch(e){console.error("Error setting password:",e);var o="object"==typeof e&&null!==e&&"authStatus"in e?String(e.authStatus):"Unexpected error",l=o.toLowerCase().includes("invalidemail")||o.toLowerCase().includes("invalidpassword");return s({error:Error("Failed to set password"),loading:!1}),{success:!1,message:l?"Invalid email or password":"Unexpected error while setting password"}}finally{s(e=>_objectSpread(_objectSpread({},e),{},{loading:!1}))}}),function(e){return t.apply(this,arguments)}),[]),error:r.error,loading:r.loading}},Z=(s=(0,h.Z)(function*(e){var{email:t,accountName:r}=e;try{if(!(yield _()("/api/vtexid/pub/authentication/startlogin",{method:"POST",credentials:"include",body:(0,S.GZ)({user:t,scope:null!=r?r:P().api.storeId,accountName:null!=r?r:P().api.storeId,returnUrl:"/",callbackUrl:"/",fingerprint:null})})).ok)throw{response:{}}}catch(e){throw console.error("Error starting login:",e),e}}),function(e){return s.apply(this,arguments)}),C=r(7256),E=r.n(C),N=[{label:"8 characters",test:e=>e.length>=8},{label:"1 uppercase letter",test:e=>/[A-Z]/.test(e)},{label:"1 lowercase letter",test:e=>/[a-z]/.test(e)},{label:"1 number",test:e=>/\d/.test(e)}],SecurityDrawer=e=>{var t,{userEmail:r,accountName:s,isOpen:a,onClose:n}=e,{fade:i,fadeOut:c}=(0,w.b)(),{pushToast:o}=(0,f.l8)(),{0:l,1:u}=(0,p.useState)(""),{0:g,1:_}=(0,p.useState)(!1),{0:S,1:O}=(0,p.useState)(""),{0:P,1:Z}=(0,p.useState)(!1),{0:C,1:k}=(0,p.useState)(null),{setPassword:M,loading:A,error:R}=useSetPassword(s),D=N.map(e=>({label:e.label,isValid:e.test(S)})),I=D.every(e=>e.isValid),handleClose=()=>{k(null),u(""),_(!1),O(""),Z(!1),n()},F=(t=(0,h.Z)(function*(){if(!r){k("Email is required to set a new password.");return}if(!S||!l){k("All fields are required to set a new password.");return}if(S===l){k("New password cannot be the same as the current password.");return}try{var e=yield M({userEmail:r,currentPassword:l,newPassword:S});if(R)throw R;if(!e.success){o({title:"Error setting password",status:"ERROR",message:"Failed to set password: ".concat(e.message),icon:(0,d.jsx)(j.Z,{width:30,height:30,name:"CircleWavyWarning"})});return}e.success&&(o({title:"Success setting password",status:"INFO",message:"Password updated successfully",icon:(0,d.jsx)(j.Z,{width:30,height:30,name:"CircleWavyCheck"})}),handleClose())}catch(e){console.error("Error setting password:",e),o({title:"Error setting password",status:"ERROR",message:"Failed to set password.",icon:(0,d.jsx)(j.Z,{width:30,height:30,name:"CircleWavyWarning"})})}}),function(){return t.apply(this,arguments)});return(0,d.jsxs)(x.Z,{"data-fs-security-drawer":!0,fade:i,onDismiss:c,onTransitionEnd:()=>"out"===i&&handleClose(),isOpen:a,size:"partial",direction:"rightSide",overlayProps:{className:E().section},children:[(0,d.jsx)(b.Z,{"data-fs-security-drawer-header":!0,onClose:handleClose,children:(0,d.jsx)("h1",{"data-fs-security-drawer-header-title":!0,children:"Reset password"})}),(0,d.jsx)("div",{"data-fs-security-drawer-body":!0,children:(0,d.jsxs)("div",{"data-fs-security-drawer-body-form":!0,children:[(0,d.jsxs)("div",{"data-fs-security-drawer-body-current-password":!0,children:[(0,d.jsx)(v.Z,{"data-fs-security-drawer-input":!0,id:"security-drawer-input-current-password",type:g?"text":"password",placeholder:"Current Password",inputMode:"text",value:l,onChange:e=>{k(null),u(e.target.value)}}),(0,d.jsx)(m.Z,{"data-fs-security-drawer-input-password-toggle":!0,size:"small","aria-label":"Show Password",onClick:()=>_(e=>!e),icon:g?(0,d.jsx)(j.Z,{name:"EyeSlash"}):(0,d.jsx)(j.Z,{name:"Eye"})})]}),(0,d.jsxs)("div",{"data-fs-security-drawer-body-new-password":!0,children:[(0,d.jsx)(v.Z,{"data-fs-security-drawer-input":!0,id:"security-drawer-input-new-password",type:P?"text":"password",placeholder:"New Password",inputMode:"text",value:S,onChange:e=>{k(null),O(e.target.value)}}),(0,d.jsx)(m.Z,{"data-fs-security-drawer-input-password-toggle":!0,size:"small","aria-label":"Show Password",onClick:()=>Z(e=>!e),icon:P?(0,d.jsx)(j.Z,{name:"EyeSlash"}):(0,d.jsx)(j.Z,{name:"Eye"})})]}),C&&(0,d.jsxs)("div",{"data-fs-security-drawer-error":!0,children:[(0,d.jsx)(j.Z,{width:20,height:20,name:"CircleWavyWarning","data-fs-security-drawer-error-icon":!0}),(0,d.jsx)("span",{children:C})]}),S.length>0&&(0,d.jsxs)("div",{"data-fs-security-drawer-input-password-rules-container":!0,children:[(0,d.jsx)("p",{"data-fs-security-drawer-input-password-rules-title":!0,children:"Your password must have at least:"}),(0,d.jsx)("ul",{"data-fs-security-drawer-input-password-rules-list":!0,children:D.map((e,t)=>(0,d.jsxs)("li",{"data-fs-security-drawer-input-password-rule-item":!0,"data-status":e.isValid?"success":"error",children:[(0,d.jsx)(j.Z,{name:e.isValid?"CheckCircle":"XCircle",width:20,height:20}),e.label]},t))})]})]})}),(0,d.jsxs)("footer",{"data-fs-security-drawer-footer":!0,children:[(0,d.jsx)(y.Z,{variant:"tertiary",onClick:handleClose,children:"Cancel"}),(0,d.jsx)(y.Z,{"data-fs-security-drawer-footer-button":!0,variant:"primary",loading:A,disabled:A||!l||!S||!I,onClick:F,children:"Save Password"})]})]})},SecuritySection=e=>{var{userEmail:t,accountName:r}=e,{0:s,1:a}=(0,p.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[s&&(0,d.jsx)(SecurityDrawer,{userEmail:t,accountName:r,isOpen:s,onClose:()=>a(!1)}),(0,d.jsxs)("section",{"data-fs-securiry-section":!0,className:E().section,children:[(0,d.jsx)("header",{"data-fs-security-header":!0,children:(0,d.jsx)("h1",{"data-fs-security-title":!0,children:"Security"})}),(0,d.jsx)("div",{"data-fs-security-container":!0,children:(0,d.jsx)("table",{"data-fs-security-table":!0,children:(0,d.jsx)("tbody",{"data-fs-security-table-body":!0,children:(0,d.jsxs)("tr",{"data-fs-security-table-row":!0,children:[(0,d.jsx)("th",{"data-fs-security-table-heading":!0,children:"Password"}),(0,d.jsxs)("td",{"data-fs-security-table-data":!0,children:[(0,d.jsx)("span",{"data-fs-security-table-data-text":!0,children:"••••••••••"}),(0,d.jsx)(y.Z,{variant:"tertiary","data-fs-security-table-action-button":!0,onClick:()=>a(!0),children:"Reset password"})]})]})})})})]})]})};function security_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function security_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?security_ownKeys(Object(r),!0).forEach(function(t){(0,a.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):security_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var k=security_objectSpread(security_objectSpread({},o.Z),l.Z),M=!0;function Page(e){var{globalSections:t,accountName:r,isRepresentative:s,userEmail:a}=e,{sections:o,settings:l}=null!=t?t:{};return(0,d.jsx)(u.ZP,{context:{globalSettings:l},children:(0,d.jsxs)(c.ZP,{globalSections:o,components:k,children:[(0,d.jsx)(n.PB,{noindex:!0,nofollow:!0}),(0,d.jsxs)(i.Z,{isRepresentative:s,accountName:r,children:[(0,d.jsx)(before,{}),(0,d.jsx)(SecuritySection,{userEmail:a}),(0,d.jsx)(after,{})]})]})})}},1855:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/security",function(){return r(5893)}])},7085:function(e){e.exports={layout:"section_layout__QJ4xs",menu:"section_menu__WKZdl",account:"section_account__YjCAC",avatarContainer:"section_avatarContainer__1RMsJ",switchButton:"section_switchButton__ul06M",nav:"section_nav__Jjee8",navItem:"section_navItem__yr27R",avatar:"section_avatar__IQLo8"}},7256:function(e){e.exports={section:"styles_section__tqV_v"}}},function(e){e.O(0,[6031,9173,9774,2888,179],function(){return e(e.s=1855)}),_N_E=e.O()}]);
|
|
File without changes
|