-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1431.bdea449b85fb7a94.js
321 lines (294 loc) · 21 KB
/
1431.bdea449b85fb7a94.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
"use strict";(self.webpackChunkfuse=self.webpackChunkfuse||[]).push([[1431],{47399:(E,y,t)=>{t.d(y,{T:()=>d,l:()=>c});var p=t(54438),r=t(36596);const c=(o,g)=>(0,p.WQX)(r.m).getBrands(),d=(o,g)=>(0,p.WQX)(r.m).findActiveBrands()},67943:(E,y,t)=>{t.d(y,{DC:()=>d});var p=t(59640);const r=o=>o.brands,d=((0,p.Mz)(r,o=>o.brand),(0,p.Mz)(r,o=>o.brands))},36596:(E,y,t)=>{t.d(y,{m:()=>B});var p=t(54438),r=t(53473),c=t(96697),d=t(25558),o=t(88141),g=t(59640),v=t(17022),M=t(98216),I=t(67943);const P=r.J1`
mutation CreateBrand($createBrandInput: CreateBrandInput!) {
createBrand(createBrandInput: $createBrandInput) {
ok
message
brand {
id
active
name
description
logo
}
}
}
`,A=r.J1`
mutation UpdateBrand($updateBrandInput: UpdateBrandInput!) {
updateBrand(updateBrandInput: $updateBrandInput) {
ok
message
brand {
id
active
name
description
logo
}
}
}
`,C=r.J1`
mutation Mutation($updateEntityStatusInput: UpdateEntityStatusInput!) {
updateBrandStatus(updateEntityStatusInput: $updateEntityStatusInput) {
ok
message
}
}
`,U=r.J1`
mutation RemoveBrand($removeBrandId: String!) {
removeBrand(id: $removeBrandId) {
ok
message
}
}
`,T=r.J1`
query FindAllBrands($page: Int, $size: Int, $sort: String, $order: Order, $search: String) {
findAllBrands(page: $page, size: $size, sort: $sort, order: $order, search: $search) {
ok
message
pagination {
length
size
page
}
brands {
id
active
name
description
slug
}
}
}
`,O=r.J1`
query FindActiveBrands($search: String!, $size: Int!) {
findActiveBrands(search: $search, size: $size) {
ok
message
brands {
id
name
slug
}
}
}
`,D=r.J1`
query FindBrandById($findBrandByIdId: String!) {
findBrandById(id: $findBrandByIdId) {
ok
message
brand {
id
active
name
description
slug
logo
}
}
}
`;let B=(()=>{class ${constructor(){this.apolloProvider=(0,p.WQX)(r.Ic),this.store=(0,p.WQX)(g.il),this._apollo=this.apolloProvider.use("BALANC")}createBrand(l){return this.store.select(I.DC).pipe((0,c.s)(1),(0,d.n)(e=>this._apollo.mutate({mutation:P,variables:{createBrandInput:l},errorPolicy:"all"}).pipe((0,o.M)(({data:a})=>{const n=structuredClone(e);n.push(a.createBrand.brand),this.store.dispatch((0,v.VO)({brands:n}))}))))}getBrands(l=0,e=20,a="code",n="asc",s=""){return this._apollo.query({query:T,errorPolicy:"all",variables:{page:l,size:e,sort:a,order:n,search:s}}).pipe((0,o.M)(({data:u})=>{this.store.dispatch((0,M.Bp)({pagination:u.findAllBrands.pagination})),this.store.dispatch((0,v.VO)({brands:u.findAllBrands.brands}))}))}findActiveBrands(l="",e=50){return this._apollo.query({query:O,errorPolicy:"all",variables:{search:l,size:e}}).pipe((0,o.M)(({data:a})=>{this.store.dispatch((0,v.VO)({brands:a.findActiveBrands.brands}))}))}getBrandById(l){return this._apollo.query({query:D,variables:{findBrandByIdId:l},errorPolicy:"all"}).pipe((0,o.M)(({data:e})=>{this.store.dispatch((0,v.aA)({brand:e.findBrandById.brand}))}))}updateBrand(l){return this.store.select(I.DC).pipe((0,c.s)(1),(0,d.n)(e=>this._apollo.mutate({mutation:A,variables:{updateBrandInput:l},errorPolicy:"all"}).pipe((0,o.M)(({data:a})=>{const n=structuredClone(e);n[e.findIndex(u=>u.id===l.id)]=a.updateBrand.brand,this.store.dispatch((0,v.VO)({brands:n}))}))))}updateBrandStatus(l){return this.store.select(I.DC).pipe((0,c.s)(1),(0,d.n)(e=>this._apollo.mutate({mutation:C,variables:{updateEntityStatusInput:l},errorPolicy:"all"}).pipe((0,o.M)(()=>{const a=structuredClone(e);a[e.findIndex(s=>s.id===l.id)].active=l.active,this.store.dispatch((0,v.VO)({brands:a}))}))))}removeBrand(l){return this.store.select(I.DC).pipe((0,c.s)(1),(0,d.n)(e=>this._apollo.mutate({mutation:U,variables:{removeBrandId:l},errorPolicy:"all"}).pipe((0,o.M)(({})=>{const n=structuredClone(e),s=e.findIndex(u=>u.id===l);n.splice(s,1),this.store.dispatch((0,v.VO)({brands:n}))}))))}static#t=this.\u0275fac=function(e){return new(e||$)};static#e=this.\u0275prov=p.jDH({token:$,factory:$.\u0275fac,providedIn:"root"})}return $})()},57981:(E,y,t)=>{t.d(y,{d:()=>c});var p=t(54438),r=t(90362);const c=(d,o)=>(0,p.WQX)(r.y).getMultipliers()},98929:(E,y,t)=>{t.d(y,{DC:()=>d});var p=t(59640);const r=o=>o.multipliers,d=((0,p.Mz)(r,o=>o.multiplier),(0,p.Mz)(r,o=>o.multipliers))},90362:(E,y,t)=>{t.d(y,{y:()=>$});var p=t(96697),r=t(25558),c=t(88141),d=t(64916),o=t(98216),g=t(98929),v=t(53473);const M=v.J1`
mutation CreateMultiplier($createMultiplierInput: CreateMultiplierInput!) {
createMultiplier(createMultiplierInput: $createMultiplierInput) {
ok
message
multiplier {
id
active
value
}
}
}
`,I=v.J1`
mutation UpdateMultiplier($updateMultiplierInput: UpdateMultiplierInput!) {
updateMultiplier(updateMultiplierInput: $updateMultiplierInput) {
ok
message
multiplier {
id
active
value
}
}
}
`,P=v.J1`
mutation Mutation($updateEntityStatusInput: UpdateEntityStatusInput!) {
updateMultiplierStatus(updateEntityStatusInput: $updateEntityStatusInput) {
ok
message
}
}
`,A=v.J1`
mutation RemoveMultiplier($removeMultiplierId: String!) {
removeMultiplier(id: $removeMultiplierId) {
ok
message
}
}
`,C=v.J1`
query FindAllMultipliers($offset: Int, $limit: Int, $sort: String, $order: Order, $search: String) {
findAllMultipliers(offset: $offset, limit: $limit, sort: $sort, order: $order, search: $search) {
ok
message
pagination {
length
size
page
}
multipliers {
id
active
value
}
}
}
`,U=v.J1`
query FindMultiplierById($findMultiplierByIdId: String!) {
findMultiplierById(id: $findMultiplierByIdId) {
ok
message
multiplier {
id
active
value
}
}
}
`;var T=t(94794),O=t(54438),D=t(95416),B=t(59640);let $=(()=>{class h{constructor(e,a,n){this.apolloProvider=e,this._snackBar=a,this.store=n,this._apollo=this.apolloProvider.use("BALANC")}createMultiplier(e){return this.store.select(g.DC).pipe((0,p.s)(1),(0,r.n)(a=>this._apollo.mutate({mutation:M,variables:{createMultiplierInput:e},errorPolicy:"all"}).pipe((0,c.M)(({errors:n,data:s})=>{if(n){let i="";n.forEach(m=>i+=`\n ${m.message}.`),this._snackBar.openFromComponent(T.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:i,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}const u=structuredClone(a);u.push(s.createMultiplier.multiplier),this.store.dispatch((0,d.rd)({multipliers:u}))}))))}getMultipliers(e=1,a=20,n="code",s="asc",u=""){return this._apollo.query({query:C,errorPolicy:"all",variables:{offset:a*(e-1),limit:a,sort:n,order:s,search:u}}).pipe((0,c.M)(({errors:i,data:m})=>{if(i){let f="";i.forEach(S=>f+=`\n ${S.message}.`),this._snackBar.openFromComponent(T.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:f,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}this.store.dispatch((0,o.Bp)({pagination:m.findAllMultipliers.pagination})),this.store.dispatch((0,d.rd)({multipliers:m.findAllMultipliers.multipliers}))}))}getMultiplierById(e){return this._apollo.query({query:U,variables:{findMultiplierByIdId:e},errorPolicy:"all"}).pipe((0,c.M)(({errors:a,data:n})=>{if(a){let s="";a.forEach(u=>s+=`\n ${u.message}.`),this._snackBar.openFromComponent(T.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:s,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}this.store.dispatch((0,d.Up)({multiplier:n.findMultiplierById.multiplier}))}))}updateMultiplier(e){return this.store.select(g.DC).pipe((0,p.s)(1),(0,r.n)(a=>this._apollo.mutate({mutation:I,variables:{updateMultiplierInput:e},errorPolicy:"all"}).pipe((0,c.M)(({errors:n,data:s})=>{if(n){let m="";n.forEach(f=>m+=`\n ${f.message}.`),this._snackBar.openFromComponent(T.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:m,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}const u=structuredClone(a);u[a.findIndex(m=>m.id===e.id)]=s.updateMultiplier.multiplier,this.store.dispatch((0,d.rd)({multipliers:u}))}))))}updateMultiplierStatus(e){return this.store.select(g.DC).pipe((0,p.s)(1),(0,r.n)(a=>this._apollo.mutate({mutation:P,variables:{updateEntityStatusInput:e},errorPolicy:"all"}).pipe((0,c.M)(({errors:n})=>{if(n){let i="";n.forEach(m=>i+=`\n ${m.message}.`),this._snackBar.openFromComponent(T.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:i,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}const s=structuredClone(a);s[a.findIndex(i=>i.id===e.id)].active=e.active,this.store.dispatch((0,d.rd)({multipliers:s}))}))))}removeMultiplier(e){return this.store.select(g.DC).pipe((0,p.s)(1),(0,r.n)(a=>this._apollo.mutate({mutation:A,variables:{removeMultiplierId:e},errorPolicy:"all"}).pipe((0,c.M)(({errors:n})=>{if(n){let i="";n.forEach(m=>i+=`\n ${m.message}.`),this._snackBar.openFromComponent(T.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:i,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}const s=structuredClone(a),u=a.findIndex(i=>i.id===e);s.splice(u,1),this.store.dispatch((0,d.rd)({multipliers:s}))}))))}static#t=this.\u0275fac=function(a){return new(a||h)(O.KVO(v.Ic),O.KVO(D.UG),O.KVO(B.il))};static#e=this.\u0275prov=O.jDH({token:h,factory:h.\u0275fac,providedIn:"root"})}return h})()},23285:(E,y,t)=>{t.d(y,{h:()=>c});var p=t(54438),r=t(52777);const c=(d,o)=>(0,p.WQX)(r.k).getOperationTypes()},94425:(E,y,t)=>{t.d(y,{nK:()=>d});var p=t(59640);const r=o=>o.operationTypes,d=((0,p.Mz)(r,o=>o.operationType),(0,p.Mz)(r,o=>o.operationTypes))},52777:(E,y,t)=>{t.d(y,{k:()=>D});var p=t(54438),r=t(96697),c=t(25558),d=t(88141),o=t(53473),g=t(59640),v=t(98216),M=t(7692),I=t(94425);const P=o.J1`
query FindAllOperationTypes($offset: Int, $limit: Int, $sort: String, $order: Order, $search: String) {
findAllOperationTypes(offset: $offset, limit: $limit, sort: $sort, order: $order, search: $search) {
ok
message
pagination {
length
size
page
}
operationTypes {
id
active
name
}
}
}
`,A=o.J1`
query FindOperationTypeById($findOperationTypeById: String!) {
findOperationTypeById(id: $findOperationTypeById) {
ok
message
operationType {
id
active
name
}
}
}
`,C=o.J1`
mutation CreateOperationType($createOperationTypeInput: CreateOperationTypeInput!) {
createOperationType(createOperationTypeInput: $createOperationTypeInput) {
ok
message
operationType {
id
active
name
}
}
}
`,U=o.J1`
mutation UpdateOperationType($updateOperationTypeInput: UpdateOperationTypeInput!) {
updateOperationType(updateOperationTypeInput: $updateOperationTypeInput) {
ok
message
operationType {
id
active
name
}
}
}
`,T=o.J1`
mutation RemoveOperationType($removeOperationTypeId: String!) {
removeOperationType(id: $removeOperationTypeId) {
ok
message
}
}
`,O=o.J1`
mutation Mutation($updateEntityStatusInput: UpdateEntityStatusInput!) {
updateOperationTypeStatus(updateEntityStatusInput: $updateEntityStatusInput) {
ok
message
}
}
`;let D=(()=>{class B{constructor(){this.apolloProvider=(0,p.WQX)(o.Ic),this.store=(0,p.WQX)(g.il),this._apollo=this.apolloProvider.use("BALANC")}createOperationType(h){return this.store.select(I.nK).pipe((0,r.s)(1),(0,c.n)(l=>this._apollo.mutate({mutation:C,variables:{createOperationTypeInput:h},errorPolicy:"all"}).pipe((0,d.M)(({data:e})=>{const a=structuredClone(l);a.push(e.createOperationType.operationType),this.store.dispatch((0,M.ZO)({operationTypes:a}))}))))}getOperationTypes(h=1,l=50,e="name",a="asc",n=""){return this._apollo.query({query:P,errorPolicy:"all",variables:{offset:l*(h-1),limit:l,sort:e,order:a,search:n}}).pipe((0,d.M)(({data:s})=>{this.store.dispatch((0,M.ZO)({operationTypes:s.findAllOperationTypes.operationTypes})),this.store.dispatch((0,v.Bp)({pagination:s.findAllOperationTypes.pagination}))}))}getOperationTypeById(h){return this._apollo.query({query:A,variables:{findOperationTypeByIdId:h},errorPolicy:"all"}).pipe((0,d.M)(({data:l})=>{this.store.dispatch((0,M.c5)({operationType:l.findOneOperationTypeById.operationType}))}))}updateOperationType(h){return this.store.select(I.nK).pipe((0,r.s)(1),(0,c.n)(l=>this._apollo.mutate({mutation:U,variables:{updateOperationTypeInput:h},errorPolicy:"all"}).pipe((0,d.M)(({data:e})=>{const a=structuredClone(l);a[l.findIndex(s=>s.id===h.id)]=e.updateOperationType.operationType,this.store.dispatch((0,M.ZO)({operationTypes:a}))}))))}updateOperationTypeStatus(h){return this.store.select(I.nK).pipe((0,r.s)(1),(0,c.n)(l=>this._apollo.mutate({mutation:O,variables:{updateEntityStatusInput:h},errorPolicy:"all"}).pipe((0,d.M)(({})=>{const a=structuredClone(l);a[l.findIndex(s=>s.id===h.id)].active=h.active,this.store.dispatch((0,M.ZO)({operationTypes:a}))}))))}removeOperationType(h){return this.store.select(I.nK).pipe((0,r.s)(1),(0,c.n)(l=>this._apollo.mutate({mutation:T,variables:{removeOperationTypeId:h},errorPolicy:"all"}).pipe((0,d.M)(()=>{const e=structuredClone(l),a=l.findIndex(n=>n.id===h);e.splice(a,1),this.store.dispatch((0,M.ZO)({operationTypes:e}))}))))}static#t=this.\u0275fac=function(l){return new(l||B)};static#e=this.\u0275prov=p.jDH({token:B,factory:B.\u0275fac,providedIn:"root"})}return B})()},59013:(E,y,t)=>{t.d(y,{v:()=>c});var p=t(54438),r=t(78693);const c=(d,o)=>(0,p.WQX)(r.q).getPaymentMethods()},84713:(E,y,t)=>{t.d(y,{xi:()=>d});var p=t(59640);const r=o=>o.paymentMethods,d=((0,p.Mz)(r,o=>o.paymentMethod),(0,p.Mz)(r,o=>o.paymentMethods))},78693:(E,y,t)=>{t.d(y,{q:()=>$});var p=t(54438),r=t(96697),c=t(25558),d=t(88141),o=t(53473),g=t(59640),v=t(98216),M=t(20604),I=t(84713),P=t(94794);const A=o.J1`
query FindAllPaymentMethods($page: Int, $size: Int, $sort: String, $order: Order, $search: String) {
findAllPaymentMethods(page: $page, size: $size, sort: $sort, order: $order, search: $search) {
ok
message
pagination {
length
size
page
}
paymentMethods {
id
active
name
useGateway
}
}
}
`,C=o.J1`
query FindPaymentMethodById($findPaymentMethodById: String!) {
findPaymentMethodById(id: $findPaymentMethodById) {
ok
message
paymentMethod {
id
active
name
useGateway
}
}
}
`,U=o.J1`
mutation CreatePaymentMethod($createPaymentMethodInput: CreatePaymentMethodInput!) {
createPaymentMethod(createPaymentMethodInput: $createPaymentMethodInput) {
ok
message
paymentMethod {
id
active
name
useGateway
}
}
}
`,T=o.J1`
mutation UpdatePaymentMethod($updatePaymentMethodInput: UpdatePaymentMethodInput!) {
updatePaymentMethod(updatePaymentMethodInput: $updatePaymentMethodInput) {
ok
message
paymentMethod {
id
active
name
useGateway
}
}
}
`,O=o.J1`
mutation RemovePaymentMethod($removePaymentMethodId: String!) {
removePaymentMethod(id: $removePaymentMethodId) {
ok
message
}
}
`,D=o.J1`
mutation Mutation($updateEntityStatusInput: UpdateEntityStatusInput!) {
updatePaymentMethodStatus(updateEntityStatusInput: $updateEntityStatusInput) {
ok
message
}
}
`;var B=t(95416);let $=(()=>{class h{constructor(e){this._snackBar=e,this.apolloProvider=(0,p.WQX)(o.Ic),this.store=(0,p.WQX)(g.il),this._apollo=this.apolloProvider.use("BALANC")}createPaymentMethod(e){return this.store.select(I.xi).pipe((0,r.s)(1),(0,c.n)(a=>this._apollo.mutate({mutation:U,variables:{createPaymentMethodInput:e},errorPolicy:"all"}).pipe((0,d.M)(({errors:n,data:s})=>{if(n){let i="";n.forEach(m=>i+=`\n ${m.message}.`),this._snackBar.openFromComponent(P.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:i,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}const u=structuredClone(a);u.push(s.createPaymentMethod.paymentMethod),this.store.dispatch((0,M.f)({paymentMethods:u}))}))))}getPaymentMethods(e=0,a=25,n="name",s="asc",u=""){return this._apollo.query({query:A,errorPolicy:"all",variables:{page:e,size:a,sort:n,order:s,search:u}}).pipe((0,d.M)(({errors:i,data:m})=>{if(i){let f="";i.forEach(S=>f+=`\n ${S.message}.`),this._snackBar.openFromComponent(P.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:f,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}this.store.dispatch((0,M.f)({paymentMethods:m.findAllPaymentMethods.paymentMethods})),this.store.dispatch((0,v.Bp)({pagination:m.findAllPaymentMethods.pagination}))}))}getPaymentMethodById(e){return this._apollo.query({query:C,variables:{findPaymentMethodByIdId:e},errorPolicy:"all"}).pipe((0,d.M)(({errors:a,data:n})=>{if(a){let s="";a.forEach(u=>s+=`\n ${u.message}.`),this._snackBar.openFromComponent(P.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:s,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}this.store.dispatch((0,M.Ye)({paymentMethod:n.findPaymentMethodById.paymentMethod}))}))}updatePaymentMethod(e){return this.store.select(I.xi).pipe((0,r.s)(1),(0,c.n)(a=>this._apollo.mutate({mutation:T,variables:{updatePaymentMethodInput:e},errorPolicy:"all"}).pipe((0,d.M)(({errors:n,data:s})=>{if(n){let m="";n.forEach(f=>m+=`\n ${f.message}.`),this._snackBar.openFromComponent(P.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:m,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}const u=structuredClone(a);u[a.findIndex(m=>m.id===e.id)]=s.updatePaymentMethod.paymentMethod,this.store.dispatch((0,M.f)({paymentMethods:u}))}))))}updatePaymentMethodStatus(e){return this.store.select(I.xi).pipe((0,r.s)(1),(0,c.n)(a=>this._apollo.mutate({mutation:D,variables:{updateEntityStatusInput:e},errorPolicy:"all"}).pipe((0,d.M)(({errors:n})=>{if(n){let i="";n.forEach(m=>i+=`\n ${m.message}.`),this._snackBar.openFromComponent(P.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:i,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}const s=structuredClone(a);s[a.findIndex(i=>i.id===e.id)].active=e.active,this.store.dispatch((0,M.f)({paymentMethods:s}))}))))}removePaymentMethod(e){return this.store.select(I.xi).pipe((0,r.s)(1),(0,c.n)(a=>this._apollo.mutate({mutation:O,variables:{removePaymentMethodId:e},errorPolicy:"all"}).pipe((0,d.M)(({errors:n})=>{if(n){let i="";n.forEach(m=>i+=`\n ${m.message}.`),this._snackBar.openFromComponent(P.p,{panelClass:["p-0","bg-transparent"],horizontalPosition:"end",verticalPosition:"bottom",duration:1e4,data:{message:i,title:"Error",type:"error",svgIcon:"mat_solid:error"}})}const s=structuredClone(a),u=a.findIndex(i=>i.id===e);s.splice(u,1),this.store.dispatch((0,M.f)({paymentMethods:s}))}))))}static#t=this.\u0275fac=function(a){return new(a||h)(p.KVO(B.UG))};static#e=this.\u0275prov=p.jDH({token:h,factory:h.\u0275fac,providedIn:"root"})}return h})()}}]);