@saasquatch/mint-components 2.2.0-1 → 2.2.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +27 -9
  2. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +30 -9
  3. package/dist/cjs/sqm-stencilbook.cjs.entry.js +470 -303
  4. package/dist/collection/components/sqm-referral-table/ReferralTable.stories.js +1 -0
  5. package/dist/collection/components/sqm-referral-table/ReferralTableRewardsCell.stories.js +1 -0
  6. package/dist/collection/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.js +209 -157
  7. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js +30 -10
  8. package/dist/collection/components/sqm-rewards-table/RewardsTableCell.stories.js +1 -0
  9. package/dist/collection/components/sqm-rewards-table/TaxAndCashRewardsTableCell.stories.js +223 -148
  10. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +30 -10
  11. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +1 -0
  12. package/dist/esm/sqm-referral-table_11.entry.js +27 -9
  13. package/dist/esm/sqm-rewards-table_9.entry.js +30 -9
  14. package/dist/esm/sqm-stencilbook.entry.js +470 -303
  15. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  16. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  17. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  18. package/dist/mint-components/mint-components.esm.js +1 -1
  19. package/dist/mint-components/p-162da001.system.entry.js +1 -0
  20. package/dist/mint-components/p-1c413a06.system.js +1 -1
  21. package/dist/mint-components/p-1f76371b.entry.js +9 -0
  22. package/dist/mint-components/p-bdf858c3.entry.js +1 -0
  23. package/dist/mint-components/{p-9e43f1eb.entry.js → p-be5ecf62.entry.js} +3 -2
  24. package/dist/mint-components/p-d3ac8246.system.entry.js +1 -0
  25. package/dist/mint-components/{p-0b2a428f.system.entry.js → p-e83d08d7.system.entry.js} +1 -1
  26. package/dist/types/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.d.ts +16 -0
  27. package/dist/types/components/sqm-rewards-table/TaxAndCashRewardsTableCell.stories.d.ts +18 -7
  28. package/dist/types/saasquatch.d.ts +1 -0
  29. package/docs/docs.docx +0 -0
  30. package/docs/raisins.json +1 -1
  31. package/package.json +1 -1
  32. package/dist/mint-components/p-55627a5c.entry.js +0 -1
  33. package/dist/mint-components/p-7a744cb2.entry.js +0 -9
  34. package/dist/mint-components/p-d01949f7.system.entry.js +0 -1
  35. package/dist/mint-components/p-e9e05970.system.entry.js +0 -1
@@ -2,6 +2,9 @@ import { h } from "@stencil/core";
2
2
  export default {
3
3
  title: "Components/Tax And Cash Rewards Table Cell",
4
4
  };
5
+ // Reusable timestamps (current date is May 2026)
6
+ const PAST = 1640995200000; // Jan 1, 2022
7
+ const FUTURE = 2779257600000; // ~2058
5
8
  const cashReward = {
6
9
  id: "68c34fd98a6cb4f5f8394084",
7
10
  type: "CREDIT",
@@ -21,13 +24,13 @@ const cashReward = {
21
24
  name: "Cash",
22
25
  },
23
26
  name: null,
24
- dateCreated: 1757630425085,
25
- dateScheduledFor: 1757631025115,
26
- dateGiven: 1757630737115,
27
+ dateCreated: PAST,
28
+ dateScheduledFor: null,
29
+ dateGiven: PAST,
27
30
  dateExpires: null,
28
31
  dateCancelled: null,
29
- dateRedeemed: 1757630737115,
30
- dateModified: 1757630737115,
32
+ dateRedeemed: null,
33
+ dateModified: PAST,
31
34
  rewardSource: "MANUAL",
32
35
  fuelTankCode: null,
33
36
  fuelTankType: null,
@@ -60,165 +63,237 @@ const cashReward = {
60
63
  },
61
64
  referral: null,
62
65
  description: null,
63
- statuses: ["REDEEMED"],
66
+ statuses: [],
64
67
  rewardRedemptionTransactions: {
65
68
  data: null,
66
69
  },
67
70
  exchangedRewardRedemptionTransaction: null,
68
71
  pendingReasons: [],
72
+ rewardedCash: true,
69
73
  };
70
- const pending = {
71
- statuses: ["PENDING"],
72
- };
73
- const payoutSent = {
74
- statuses: ["PAYOUT_APPROVED"],
75
- };
76
- const payoutFailed = {
77
- statuses: ["PAYOUT_FAILED"],
78
- };
79
- const payoutCancelled = {
80
- statuses: ["PAYOUT_CANCELLED"],
81
- dateCancelled: 1355612521321,
82
- };
83
- const processingPFT = {
84
- partnerFundsTransfer: {
85
- id: "123",
86
- status: null,
87
- dateCreated: 1355612521321,
88
- dateScheduled: 2779257600000,
89
- dateTransferred: null,
74
+ // ============================================================
75
+ // Reusable tax connections
76
+ // ============================================================
77
+ const fullySetupTaxConnection = {
78
+ connected: true,
79
+ taxHandlingEnabled: true,
80
+ connectionStatus: "COMPLETED",
81
+ publisher: {
82
+ requiredTaxDocumentType: "W9",
83
+ currentTaxDocument: {
84
+ status: "ACTIVE",
85
+ type: "W9",
86
+ dateCreated: PAST,
87
+ },
88
+ withdrawalSettings: { paymentMethod: "BANK_TRANSFER" },
89
+ payoutsAccount: null,
90
90
  },
91
91
  };
92
- const taxConnection = {
92
+ const connectedNoWithdrawalSettings = {
93
93
  connected: true,
94
94
  taxHandlingEnabled: true,
95
- connectionStatus: "NOT_STARTED",
95
+ connectionStatus: "COMPLETED",
96
96
  publisher: {
97
- requiredTaxDocumentType: "W8BEN",
97
+ requiredTaxDocumentType: "W9",
98
98
  currentTaxDocument: {
99
- status: "NOT_VERIFIED",
100
- type: "W8BEN",
101
- dateCreated: 321321487,
102
- },
103
- withdrawalSettings: {
104
- paymentMethod: "BANK_TRANSFER",
99
+ status: "ACTIVE",
100
+ type: "W9",
101
+ dateCreated: PAST,
105
102
  },
103
+ withdrawalSettings: null,
106
104
  payoutsAccount: null,
107
105
  },
108
106
  };
109
- export const CashReward = () => {
110
- return (h("sqm-rewards-table-reward-cell", { reward: { ...cashReward }, availableText: "{availableAmount} remaining" }));
111
- };
112
- export const StatusCellPendingTaxReview = () => {
113
- return (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: { ...cashReward, ...pending, pendingReasons: ["US_TAX"] }, taxConnection: {
114
- ...taxConnection,
115
- publisher: {
116
- requiredTaxDocumentType: "W8BEN",
117
- currentTaxDocument: {
118
- status: "",
119
- },
120
- ...taxConnection.publisher,
121
- },
122
- } }));
123
- };
124
- export const StatusCellPendingNewTaxForm = () => {
125
- return (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
126
- ...cashReward,
127
- statuses: ["PENDING"],
128
- pendingReasons: ["US_TAX"],
129
- }, taxConnection: {
130
- connected: true,
131
- taxHandlingEnabled: true,
132
- publisher: {
133
- requiredTaxDocumentType: "W8BEN",
134
- withdrawalSettings: {
135
- paymentMethod: "BANK_TRANSFER",
136
- },
137
- payoutsAccount: null,
138
- currentTaxDocument: {
139
- status: "INACTIVE",
140
- type: "W8BEN",
141
- dateCreated: 321321487,
142
- },
143
- },
144
- } }));
145
- };
146
- export const StatusCellPendingTaxSubmission = () => {
147
- return (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: { ...cashReward, ...pending, pendingReasons: ["US_TAX"] }, taxConnection: {
148
- ...taxConnection,
149
- publisher: {
150
- ...taxConnection.publisher,
151
- requiredTaxDocumentType: "W8BEN",
152
- currentTaxDocument: null,
153
- },
154
- } }));
155
- };
156
- export const StatusCellPartnerCreatedSetupStartedButIncomplete = () => {
157
- return (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
158
- ...cashReward,
159
- ...pending,
160
- pendingReasons: ["US_TAX"],
161
- }, taxConnection: {
162
- ...taxConnection,
163
- connected: false,
164
- } }));
165
- };
166
- export const StatusCellPartnerNotCreatedSetupNotStarted = () => {
167
- return (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
168
- ...cashReward,
169
- ...pending,
170
- pendingReasons: ["US_TAX"],
171
- }, taxConnection: {
172
- ...taxConnection,
173
- connected: false,
174
- } }));
175
- };
176
- export const StatusCellPendingW9 = () => {
177
- return (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
178
- ...cashReward,
179
- ...pending,
180
- pendingReasons: ["US_TAX"],
181
- }, taxConnection: {
182
- ...taxConnection,
183
- taxHandlingEnabled: false,
184
- } }));
185
- };
186
- export const StatusCellPayoutSent = () => {
187
- return (h("sqm-rewards-table-status-cell", { statusText: "Payout Sent", reward: {
188
- ...cashReward,
189
- partnerFundsTransfer: {
190
- id: "transfer-123",
191
- status: "TRANSFERRED",
192
- dateScheduled: 1640995200000,
193
- dateTransferred: 1640995200000,
194
- dateCreated: 1640995200000,
195
- },
196
- }, taxConnection: taxConnection }));
107
+ const notConnectedTaxConnection = {
108
+ connected: false,
109
+ taxHandlingEnabled: true,
110
+ connectionStatus: "NOT_STARTED",
111
+ publisher: null,
197
112
  };
198
- export const StatusCellPayoutFailed = () => {
199
- return (h("sqm-rewards-table-status-cell", { statusText: "Payout Failed", reward: {
200
- ...cashReward,
201
- partnerFundsTransfer: {
202
- id: "transfer-failed",
203
- status: "OVERDUE",
204
- dateScheduled: 1640995200000,
205
- dateTransferred: null,
206
- dateCreated: 1640995200000,
113
+ // ============================================================
114
+ // Reward Cell (kept from original)
115
+ // ============================================================
116
+ export const CashReward = () => (h("sqm-rewards-table-reward-cell", { reward: { ...cashReward, statuses: ["REDEEMED"], dateRedeemed: PAST }, availableText: "{availableAmount} remaining" }));
117
+ // ============================================================
118
+ // STATUS PRECEDENCE LADDER — one story per rule
119
+ // (See sqm-rewards-table-status-column-new.feature § 2)
120
+ // ============================================================
121
+ // 1. Fraud check denied the referral → status is Denied
122
+ export const StatusCellFraudDenied = () => (h("sqm-rewards-table-status-cell", { statusText: "Denied", reward: {
123
+ ...cashReward,
124
+ referral: { fraudData: { moderationStatus: "DENIED" } },
125
+ }, taxConnection: fullySetupTaxConnection }));
126
+ // 2. Fraud check is still pending review → status is Pending Review
127
+ export const StatusCellFraudPendingReview = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
128
+ ...cashReward,
129
+ referral: { fraudData: { moderationStatus: "PENDING" } },
130
+ }, taxConnection: fullySetupTaxConnection }));
131
+ // 3. Partner funds transfer was reversed → status is Payout Cancelled
132
+ export const StatusCellPayoutCancelled = () => (h("sqm-rewards-table-status-cell", { statusText: "Payout Cancelled", reward: {
133
+ ...cashReward,
134
+ partnerFundsTransfer: {
135
+ id: "pft-reversed",
136
+ status: "REVERSED",
137
+ dateCreated: PAST,
138
+ dateScheduled: PAST,
139
+ dateTransferred: null,
140
+ },
141
+ }, taxConnection: fullySetupTaxConnection }));
142
+ // 4. Partner funds transfer is overdue → status is Payout Failed
143
+ export const StatusCellPayoutFailed = () => (h("sqm-rewards-table-status-cell", { statusText: "Payout Failed", reward: {
144
+ ...cashReward,
145
+ partnerFundsTransfer: {
146
+ id: "pft-overdue",
147
+ status: "OVERDUE",
148
+ dateCreated: PAST,
149
+ dateScheduled: PAST,
150
+ dateTransferred: null,
151
+ },
152
+ }, taxConnection: fullySetupTaxConnection }));
153
+ // 5. Connected partner has not finished withdrawal settings setup → status is Pending
154
+ export const StatusCellPartnerCreatedSetupStartedButIncomplete = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
155
+ ...cashReward,
156
+ partnerFundsTransfer: {
157
+ id: "pft-not-yet-due",
158
+ status: "NOT_YET_DUE",
159
+ dateCreated: PAST,
160
+ dateScheduled: FUTURE,
161
+ dateTransferred: null,
162
+ },
163
+ }, taxConnection: connectedNoWithdrawalSettings }));
164
+ // Reward is pending US_TAX and the partner has not been created yet → shows the partner-setup prompt
165
+ export const StatusCellPartnerNotCreatedSetupNotStarted = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
166
+ ...cashReward,
167
+ statuses: ["PENDING"],
168
+ pendingReasons: ["US_TAX"],
169
+ }, taxConnection: notConnectedTaxConnection }));
170
+ // 6. Reward has MISSING_PAYOUT_CONFIGURATION pending reason and no withdrawal settings → status is Pending
171
+ export const StatusCellMissingPayoutConfiguration = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
172
+ ...cashReward,
173
+ statuses: ["PENDING"],
174
+ pendingReasons: ["MISSING_PAYOUT_CONFIGURATION"],
175
+ }, taxConnection: connectedNoWithdrawalSettings }));
176
+ // 7. Partner funds transfer is scheduled for a future date → status is Processing
177
+ export const StatusCellPayoutProcessing = () => (h("sqm-rewards-table-status-cell", { statusText: "Processing", reward: {
178
+ ...cashReward,
179
+ partnerFundsTransfer: {
180
+ id: "pft-processing",
181
+ status: null,
182
+ dateCreated: PAST,
183
+ dateScheduled: FUTURE,
184
+ dateTransferred: null,
185
+ },
186
+ }, taxConnection: fullySetupTaxConnection }));
187
+ // 8. Partner funds transfer has been transferred → status is Payout Approved
188
+ export const StatusCellPayoutApproved = () => (h("sqm-rewards-table-status-cell", { statusText: "Payout Approved", reward: {
189
+ ...cashReward,
190
+ partnerFundsTransfer: {
191
+ id: "pft-transferred",
192
+ status: "TRANSFERRED",
193
+ dateCreated: PAST,
194
+ dateScheduled: PAST,
195
+ dateTransferred: PAST,
196
+ },
197
+ }, taxConnection: fullySetupTaxConnection }));
198
+ // 9. Reward has a cancellation date set → status is Cancelled
199
+ export const StatusCellRewardCancelled = () => (h("sqm-rewards-table-status-cell", { statusText: "Cancelled", reward: {
200
+ ...cashReward,
201
+ statuses: ["CANCELLED"],
202
+ dateCancelled: PAST,
203
+ }, taxConnection: fullySetupTaxConnection }));
204
+ // 10. Reward statuses include EXPIRED → status is Expired
205
+ export const StatusCellRewardExpired = () => (h("sqm-rewards-table-status-cell", { statusText: "Expired", reward: {
206
+ ...cashReward,
207
+ statuses: ["EXPIRED"],
208
+ dateExpires: PAST,
209
+ }, taxConnection: fullySetupTaxConnection }));
210
+ // 11. Reward is pending and scheduled for a future date → status is Pending with the scheduled date shown
211
+ export const StatusCellPendingScheduled = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
212
+ ...cashReward,
213
+ statuses: ["PENDING"],
214
+ pendingReasons: ["SCHEDULED"],
215
+ dateScheduledFor: FUTURE,
216
+ }, taxConnection: fullySetupTaxConnection }));
217
+ // 12. Reward does not match any precedence rule → no badge text, no description
218
+ export const StatusCellNoMatchingRule = () => (h("sqm-rewards-table-status-cell", { statusText: "", reward: {
219
+ ...cashReward,
220
+ statuses: [],
221
+ }, taxConnection: fullySetupTaxConnection }));
222
+ // ============================================================
223
+ // US_TAX getTaxPendingReasons branches (Pending Description Resolution § 5)
224
+ // ============================================================
225
+ // Reward is pending US_TAX but tax handling is disabled → shows "W-9 required"
226
+ export const StatusCellPendingW9Required = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
227
+ ...cashReward,
228
+ statuses: ["PENDING"],
229
+ pendingReasons: ["US_TAX"],
230
+ }, taxConnection: { ...fullySetupTaxConnection, taxHandlingEnabled: false } }));
231
+ // Partner is connected but has not submitted any tax documents → shows the submit-tax-docs prompt
232
+ export const StatusCellPendingTaxSubmission = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
233
+ ...cashReward,
234
+ statuses: ["PENDING"],
235
+ pendingReasons: ["US_TAX"],
236
+ }, taxConnection: {
237
+ ...fullySetupTaxConnection,
238
+ publisher: {
239
+ ...fullySetupTaxConnection.publisher,
240
+ currentTaxDocument: null,
241
+ },
242
+ } }));
243
+ // Partner's tax document is inactive (rejected) → shows the submit-a-new-form prompt
244
+ export const StatusCellPendingNewTaxForm = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
245
+ ...cashReward,
246
+ statuses: ["PENDING"],
247
+ pendingReasons: ["US_TAX"],
248
+ }, taxConnection: {
249
+ ...fullySetupTaxConnection,
250
+ publisher: {
251
+ ...fullySetupTaxConnection.publisher,
252
+ currentTaxDocument: {
253
+ status: "INACTIVE",
254
+ type: "W9",
255
+ dateCreated: PAST,
207
256
  },
208
- } }));
209
- };
210
- export const StatusCellPayoutProcessing = () => {
211
- return (h("sqm-rewards-table-status-cell", { statusText: "Payment Processing", reward: { ...cashReward, ...processingPFT } }));
212
- };
213
- export const StatusCellPayoutCancelled = () => {
214
- return (h("sqm-rewards-table-status-cell", { statusText: "Payout Cancelled", reward: {
215
- ...cashReward,
216
- partnerFundsTransfer: {
217
- id: "transfer-reversed",
218
- status: "REVERSED",
219
- dateScheduled: 1640995200000,
220
- dateTransferred: null,
221
- dateCreated: 1640995200000,
257
+ },
258
+ } }));
259
+ // Partner's tax document is awaiting verification → shows the awaiting-review prompt
260
+ export const StatusCellPendingTaxReview = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
261
+ ...cashReward,
262
+ statuses: ["PENDING"],
263
+ pendingReasons: ["US_TAX"],
264
+ }, taxConnection: {
265
+ ...fullySetupTaxConnection,
266
+ publisher: {
267
+ ...fullySetupTaxConnection.publisher,
268
+ currentTaxDocument: {
269
+ status: "NOT_VERIFIED",
270
+ type: "W9",
271
+ dateCreated: PAST,
222
272
  },
223
- } }));
224
- };
273
+ },
274
+ } }));
275
+ // Partner has an active tax form but has not configured withdrawal settings → shows the partner-setup prompt
276
+ export const StatusCellExistingTaxFormNoWithdrawalSettings = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
277
+ ...cashReward,
278
+ statuses: ["PENDING"],
279
+ pendingReasons: ["US_TAX"],
280
+ }, taxConnection: connectedNoWithdrawalSettings }));
281
+ // Partner is connected, no tax form is required, but withdrawal settings are not submitted → shows the partner-setup prompt
282
+ export const StatusCellConnectedNoTaxRequiredNoWithdrawalSettings = () => (h("sqm-rewards-table-status-cell", { statusText: "Pending", reward: {
283
+ ...cashReward,
284
+ statuses: ["PENDING"],
285
+ pendingReasons: [],
286
+ }, taxConnection: {
287
+ connected: true,
288
+ taxHandlingEnabled: true,
289
+ connectionStatus: "COMPLETED",
290
+ publisher: {
291
+ requiredTaxDocumentType: null,
292
+ currentTaxDocument: null,
293
+ withdrawalSettings: null,
294
+ payoutsAccount: null,
295
+ },
296
+ } }));
297
+ // Aliases kept for the table-level stories file
298
+ export const StatusCellPayoutSent = StatusCellPayoutApproved;
299
+ export const StatusCellPendingW9 = StatusCellPendingW9Required;
@@ -68,7 +68,7 @@ export class RewardTableStatusCell {
68
68
  this.pendingTaxReview = "Awaiting tax form review.";
69
69
  this.pendingNewTaxForm = "Invalid tax form. Submit a new form to receive your rewards.";
70
70
  this.pendingTaxSubmission = "Submit your tax documents to receive your rewards.";
71
- this.pendingPartnerCreation = "Complete your tax and cash payout setup to receive your rewards.";
71
+ this.pendingPartnerCreation = "Complete your cash payout setup to receive your rewards.";
72
72
  this.pendingScheduled = "Until";
73
73
  this.pendingUnhandled = "Fulfillment error";
74
74
  this.pendingReviewText = "Awaiting review";
@@ -79,16 +79,26 @@ export class RewardTableStatusCell {
79
79
  this.payoutProcessing = "Processing until {date}. Payout is then scheduled based on your settings.";
80
80
  }
81
81
  rewardStatus(reward) {
82
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
82
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
83
83
  const hasExpired = (_a = reward.statuses) === null || _a === void 0 ? void 0 : _a.includes("EXPIRED");
84
84
  const isPending = (_b = reward.statuses) === null || _b === void 0 ? void 0 : _b.includes("PENDING");
85
85
  const integrationOrFueltankReward = reward.type === "INTEGRATION" || reward.type === "FUELTANK";
86
+ // AL: TODO Scott said we should change this to use pendingReasons instead of fraudStatus - probably dont want to change this for backwards compatibility
86
87
  const fraudStatus = (_d = (_c = reward.referral) === null || _c === void 0 ? void 0 : _c.fraudData) === null || _d === void 0 ? void 0 : _d.moderationStatus;
87
88
  if (fraudStatus === "DENIED")
88
89
  return "DENIED";
89
90
  if (fraudStatus === "PENDING")
90
91
  return "PENDING_REVIEW";
91
- const partnerTransferStatus = (_e = reward.partnerFundsTransfer) === null || _e === void 0 ? void 0 : _e.status;
92
+ const isCashReward = reward.rewardedCash;
93
+ console.log(this.reward, "reward in status cell");
94
+ // pft can now be created before withdrawal settings exist
95
+ if (isCashReward) {
96
+ if (!((_e = this.taxConnection) === null || _e === void 0 ? void 0 : _e.connected) ||
97
+ (((_f = this.taxConnection) === null || _f === void 0 ? void 0 : _f.connected) &&
98
+ !((_h = (_g = this.taxConnection) === null || _g === void 0 ? void 0 : _g.publisher) === null || _h === void 0 ? void 0 : _h.withdrawalSettings)))
99
+ return "PENDING";
100
+ }
101
+ const partnerTransferStatus = (_j = reward.partnerFundsTransfer) === null || _j === void 0 ? void 0 : _j.status;
92
102
  if (reward.partnerFundsTransfer) {
93
103
  if (partnerTransferStatus === "REVERSED")
94
104
  return "PAYOUT_CANCELLED";
@@ -113,24 +123,24 @@ export class RewardTableStatusCell {
113
123
  if (isPending)
114
124
  return "PENDING";
115
125
  if (reward.type === "CREDIT") {
116
- return ((_f = reward.statuses) === null || _f === void 0 ? void 0 : _f.includes("REDEEMED")) ? "REDEEMED" : "AVAILABLE";
126
+ return ((_k = reward.statuses) === null || _k === void 0 ? void 0 : _k.includes("REDEEMED")) ? "REDEEMED" : "AVAILABLE";
117
127
  }
118
- if (reward.type === "PCT_DISCOUNT" && ((_g = reward.statuses) === null || _g === void 0 ? void 0 : _g.includes("AVAILABLE"))) {
128
+ if (reward.type === "PCT_DISCOUNT" && ((_l = reward.statuses) === null || _l === void 0 ? void 0 : _l.includes("AVAILABLE"))) {
119
129
  return "AVAILABLE";
120
130
  }
121
131
  if (integrationOrFueltankReward && isPending) {
122
132
  return "PENDING";
123
133
  }
124
- if (integrationOrFueltankReward && ((_h = reward.statuses) === null || _h === void 0 ? void 0 : _h.includes("CANCELLED"))) {
134
+ if (integrationOrFueltankReward && ((_m = reward.statuses) === null || _m === void 0 ? void 0 : _m.includes("CANCELLED"))) {
125
135
  return "CANCELLED";
126
136
  }
127
- if (integrationOrFueltankReward && ((_j = reward.statuses) === null || _j === void 0 ? void 0 : _j.includes("AVAILABLE"))) {
137
+ if (integrationOrFueltankReward && ((_o = reward.statuses) === null || _o === void 0 ? void 0 : _o.includes("AVAILABLE"))) {
128
138
  return "AVAILABLE";
129
139
  }
130
140
  return "";
131
141
  }
132
142
  getTaxPendingReasons(reward, taxConnection) {
133
- var _a, _b, _c, _d, _e;
143
+ var _a, _b, _c, _d, _e, _f;
134
144
  if ((_a = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _a === void 0 ? void 0 : _a.includes("US_TAX")) {
135
145
  if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.taxHandlingEnabled))
136
146
  return this.pendingUsTax;
@@ -145,12 +155,22 @@ export class RewardTableStatusCell {
145
155
  if (status === "NOT_VERIFIED")
146
156
  return this.pendingTaxReview;
147
157
  }
148
- if (!((_d = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _d === void 0 ? void 0 : _d.withdrawalSettings))
158
+ if (!((_d = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _d === void 0 ? void 0 : _d.withdrawalSettings)) {
149
159
  return this.pendingPartnerCreation;
160
+ }
150
161
  }
151
162
  if ((_e = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _e === void 0 ? void 0 : _e.includes("MISSING_PAYOUT_CONFIGURATION")) {
152
163
  return this.pendingPartnerCreation;
153
164
  }
165
+ // Fallback: when rewardStatus() forced PENDING because the user is
166
+ // connected but hasn't set up withdrawal settings (no pendingReasons
167
+ // were returned by the API, e.g. for credit rewards with a PFT).
168
+ if (reward.rewardedCash) {
169
+ if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected) ||
170
+ ((taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected) &&
171
+ !((_f = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _f === void 0 ? void 0 : _f.withdrawalSettings)))
172
+ return this.pendingPartnerCreation;
173
+ }
154
174
  return "";
155
175
  }
156
176
  getBadgeType(rewardStatus) {
@@ -447,7 +467,7 @@ export class RewardTableStatusCell {
447
467
  },
448
468
  "attribute": "pending-partner-creation",
449
469
  "reflect": false,
450
- "defaultValue": "\"Complete your tax and cash payout setup to receive your rewards.\""
470
+ "defaultValue": "\"Complete your cash payout setup to receive your rewards.\""
451
471
  },
452
472
  "pendingScheduled": {
453
473
  "type": "string",
@@ -49,6 +49,7 @@ const GET_REWARDS = gql `
49
49
  fuelTankCode
50
50
  fuelTankType
51
51
  currency
52
+ rewardedCash
52
53
  prettyValue(locale: $locale)
53
54
  prettyValueNumber: prettyValue(
54
55
  formatType: NUMBER_FORMATTED
@@ -424,7 +424,7 @@ const ReferralTableRewardsCell = class {
424
424
  constructor(hostRef) {
425
425
  registerInstance(this, hostRef);
426
426
  this.statusText = "{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";
427
- this.statusLongText = "{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";
427
+ this.statusLongText = "{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";
428
428
  this.pendingForText = "{status} for {date}";
429
429
  this.locale = "en";
430
430
  }
@@ -531,7 +531,7 @@ const ReferralTableRewardsCell = class {
531
531
  }
532
532
  };
533
533
  const getState = (reward, taxConnection) => {
534
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
534
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
535
535
  const possibleStates = [
536
536
  "REDEEMED",
537
537
  "CANCELLED",
@@ -555,12 +555,21 @@ const ReferralTableRewardsCell = class {
555
555
  if (((_f = (_e = reward.referral) === null || _e === void 0 ? void 0 : _e.fraudData) === null || _f === void 0 ? void 0 : _f.moderationStatus) === "DENIED")
556
556
  return "DENIED";
557
557
  }
558
- const partnerFundsStatus = (_g = reward.partnerFundsTransfer) === null || _g === void 0 ? void 0 : _g.status;
558
+ const isCashReward = reward.rewardedCash;
559
+ if (isCashReward) {
560
+ if (!((_g = this.taxConnection) === null || _g === void 0 ? void 0 : _g.connected) ||
561
+ (((_h = this.taxConnection) === null || _h === void 0 ? void 0 : _h.connected) &&
562
+ !((_k = (_j = this.taxConnection) === null || _j === void 0 ? void 0 : _j.publisher) === null || _k === void 0 ? void 0 : _k.withdrawalSettings)))
563
+ return "PENDING_PARTNER_CREATION";
564
+ }
565
+ const partnerFundsStatus = (_l = reward.partnerFundsTransfer) === null || _l === void 0 ? void 0 : _l.status;
559
566
  if (reward.partnerFundsTransfer) {
560
567
  if (partnerFundsStatus === "REVERSED")
561
568
  return "PAYOUT_CANCELLED";
562
569
  if (partnerFundsStatus === "OVERDUE")
563
570
  return "PAYOUT_FAILED";
571
+ }
572
+ if (reward.partnerFundsTransfer) {
564
573
  if (reward.partnerFundsTransfer.dateScheduled &&
565
574
  reward.partnerFundsTransfer.dateScheduled > Date.now()) {
566
575
  return "PROCESSING";
@@ -573,13 +582,13 @@ const ReferralTableRewardsCell = class {
573
582
  partnerFundsStatus !== "REVERSED"))
574
583
  return "PAYOUT_APPROVED";
575
584
  }
576
- if ((_h = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _h === void 0 ? void 0 : _h.includes("US_TAX")) {
585
+ if ((_m = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _m === void 0 ? void 0 : _m.includes("US_TAX")) {
577
586
  if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.taxHandlingEnabled))
578
587
  return "PENDING";
579
588
  if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected))
580
589
  return "PENDING_PARTNER_CREATION";
581
- if ((_j = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _j === void 0 ? void 0 : _j.requiredTaxDocumentType) {
582
- if (!((_k = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _k === void 0 ? void 0 : _k.currentTaxDocument))
590
+ if ((_o = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _o === void 0 ? void 0 : _o.requiredTaxDocumentType) {
591
+ if (!((_p = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _p === void 0 ? void 0 : _p.currentTaxDocument))
583
592
  return "PENDING_TAX_SUBMISSION";
584
593
  const status = taxConnection.publisher.currentTaxDocument.status;
585
594
  if (status === "INACTIVE" ||
@@ -589,10 +598,19 @@ const ReferralTableRewardsCell = class {
589
598
  if (status === "NOT_VERIFIED")
590
599
  return "PENDING_TAX_REVIEW";
591
600
  }
592
- if (!((_l = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _l === void 0 ? void 0 : _l.withdrawalSettings))
601
+ if (!((_q = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _q === void 0 ? void 0 : _q.withdrawalSettings))
602
+ return "PENDING_PARTNER_CREATION";
603
+ }
604
+ // Fallback: when rewardStatus() forced PENDING because the user is
605
+ // connected but hasn't set up withdrawal settings (no pendingReasons
606
+ // were returned by the API, e.g. for credit rewards with a PFT).
607
+ if (reward.rewardedCash) {
608
+ if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected) ||
609
+ ((taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected) &&
610
+ !((_r = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _r === void 0 ? void 0 : _r.withdrawalSettings)))
593
611
  return "PENDING_PARTNER_CREATION";
594
612
  }
595
- if ((_m = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _m === void 0 ? void 0 : _m.includes("MISSING_PAYOUT_CONFIGURATION")) {
613
+ if ((_s = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _s === void 0 ? void 0 : _s.includes("MISSING_PAYOUT_CONFIGURATION")) {
596
614
  return "PENDING_PARTNER_CREATION";
597
615
  }
598
616
  if (reward.statuses.length === 1)
@@ -652,7 +670,7 @@ const ReferralTableRewardsCell = class {
652
670
  date: getTimeDiff(reward.dateScheduledFor),
653
671
  }))) : (h$1("sl-badge", { class: getBadgeCSSClass(slBadgeType), type: slBadgeType, pill: true }, badgeText)), reward.dateExpires && state === "AVAILABLE" && (h$1("sl-badge", { class: getBadgeCSSClass(slBadgeType), type: "info", pill: true }, this.expiringText, ` ${getTimeDiff(reward.dateExpires)}`)))), h$1("div", null, state === "PENDING_REVIEW" && ((_c = reward.referral) === null || _c === void 0 ? void 0 : _c.dateModerated) && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText, " ", h$1("span", { class: sheet.classes.BoldText, part: "sqm-cell-value" }, luxon.DateTime.fromMillis(reward.referral.dateModerated)
654
672
  .setLocale(luxonLocale(this.locale))
655
- .toLocaleString(luxon.DateTime.DATE_MED))))), state === "PAYOUT_APPROVED" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PROCESSING" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_FAILED" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_CANCELLED" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PENDING_TAX_REVIEW" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PENDING_NEW_TAX_FORM" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PENDING_TAX_SUBMISSION" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PENDING_PARTNER_CREATION" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "DENIED" && ((_d = reward.referral) === null || _d === void 0 ? void 0 : _d.dateModerated) && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText, " ", h$1("span", { class: sheet.classes.BoldText, part: "sqm-cell-value" }, luxon.DateTime.fromMillis(reward.referral.dateModerated)
673
+ .toLocaleString(luxon.DateTime.DATE_MED))))), state === "" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PROCESSING" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_APPROVED" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_FAILED" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_CANCELLED" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PENDING_TAX_REVIEW" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PENDING_NEW_TAX_FORM" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PENDING_TAX_SUBMISSION" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "PENDING_PARTNER_CREATION" && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText))), state === "DENIED" && ((_d = reward.referral) === null || _d === void 0 ? void 0 : _d.dateModerated) && (h$1("div", null, h$1(TextSpanView, { type: "p" }, statusText, " ", h$1("span", { class: sheet.classes.BoldText, part: "sqm-cell-value" }, luxon.DateTime.fromMillis(reward.referral.dateModerated)
656
674
  .setLocale(luxonLocale(this.locale))
657
675
  .toLocaleString(luxon.DateTime.DATE_MED)), ".", this.deniedHelpText ? ` ${this.deniedHelpText}` : ``))), reward.dateGiven && (h$1("div", null, h$1(TextSpanView, { type: "p" }, this.rewardReceivedText, " ", h$1("span", { class: sheet.classes.BoldText, part: "sqm-cell-value" }, luxon.DateTime.fromMillis(reward.dateGiven)
658
676
  .setLocale(luxonLocale(this.locale))