@domino-sdk/relay 1.36.0 → 1.38.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.
Files changed (46) hide show
  1. package/dist/{attempt-captures-B2Clh9Df.d.ts → attempt-captures-CSiN1HKd.d.ts} +1 -1
  2. package/dist/authoring.d.ts +62 -47
  3. package/dist/authoring.js +14 -6
  4. package/dist/{automatic-outcomes-BiarOoiy.d.ts → automatic-outcomes-DDbgRubQ.d.ts} +1 -1
  5. package/dist/browser.d.ts +6 -6
  6. package/dist/browser.js +10 -10
  7. package/dist/{chunk-2A4LCKTU.js → chunk-2CP3SULY.js} +9 -2
  8. package/dist/{chunk-FTB7F5IP.js → chunk-B65YJ6K4.js} +1 -1
  9. package/dist/{chunk-LNPV4J53.js → chunk-BYX27T2S.js} +2 -2
  10. package/dist/{chunk-K7PUCZJY.js → chunk-CHQWG5KQ.js} +12 -10
  11. package/dist/{chunk-JXFRKZGL.js → chunk-CRX274HO.js} +1 -1
  12. package/dist/{chunk-R5NQEW5J.js → chunk-DZZ5GSJ6.js} +2 -2
  13. package/dist/{chunk-SB3ODDGR.js → chunk-FTGW72A6.js} +1 -1
  14. package/dist/{chunk-GI6RO43K.js → chunk-JYHRPMCE.js} +8 -2
  15. package/dist/{chunk-JHHTQ73D.js → chunk-KEYQHJHU.js} +6 -6
  16. package/dist/{chunk-S37JPI5O.js → chunk-KTHHGZSJ.js} +1 -1
  17. package/dist/{chunk-RIMESZ4X.js → chunk-OEO5OBY5.js} +35 -3
  18. package/dist/{chunk-U735N4KB.js → chunk-SBW52XXL.js} +1 -1
  19. package/dist/{chunk-Z2EN4ERZ.js → chunk-V7KYVH3Z.js} +1 -1
  20. package/dist/{chunk-NQDZX3D2.js → chunk-YNQPFRQO.js} +7 -2
  21. package/dist/{chunk-L33BQLNF.js → chunk-Z3SG7LKF.js} +4 -4
  22. package/dist/{chunk-3KCKA2XH.js → chunk-ZT7FPD7B.js} +1 -1
  23. package/dist/{client-CraOIr8b.d.ts → client-DjwKrpFo.d.ts} +19 -4
  24. package/dist/{deployments-DTaJPDsl.d.ts → deployments-DYeuxXYg.d.ts} +257 -213
  25. package/dist/{groups-DTsvf0Z2.d.ts → groups-JzAQ2JIN.d.ts} +9 -2
  26. package/dist/index.d.ts +7 -7
  27. package/dist/index.js +9 -9
  28. package/dist/internal.d.ts +9 -9
  29. package/dist/internal.js +8 -8
  30. package/dist/{offers-DFJ4dmR3.d.ts → offers-CIDAJEYs.d.ts} +2 -2
  31. package/dist/{pages-B5agdH0f.d.ts → pages-DR2YRvAp.d.ts} +20 -1
  32. package/dist/portal-proxy.js +3 -3
  33. package/dist/react/index.d.ts +29 -18
  34. package/dist/react/index.js +60 -17
  35. package/dist/{schema--jNn3OfJ.d.ts → schema-Cgmj-CbC.d.ts} +18 -1
  36. package/dist/schema.d.ts +341 -320
  37. package/dist/schema.js +11 -7
  38. package/dist/server/index.d.ts +9 -9
  39. package/dist/server/index.js +104 -16
  40. package/dist/{submission-input-BHzSin84.d.ts → submission-input-UBqB8NFC.d.ts} +2 -2
  41. package/dist/{telegram-browser-B1LFWF_v.d.ts → telegram-browser-2IllFeh-.d.ts} +1 -1
  42. package/dist/testing.d.ts +3 -3
  43. package/dist/testing.js +5 -5
  44. package/dist/{transport-4QyqeZLU.d.ts → transport-B3DkXMNu.d.ts} +3612 -3080
  45. package/dist/{x-imfTy_I1.d.ts → x-vVG6gZqi.d.ts} +1 -1
  46. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import * as z from 'zod';
2
- import { q as ResourceHandle, G as GroupHandle } from './schema--jNn3OfJ.js';
2
+ import { q as ResourceHandle, G as GroupHandle } from './schema-Cgmj-CbC.js';
3
3
 
4
4
  declare const pointLedgerPropertiesSchema: z.ZodObject<{
5
5
  name: z.ZodString;
@@ -764,6 +764,7 @@ declare const leaderboardDefinitionSchema: z.ZodObject<{
764
764
  participants: "participants";
765
765
  }>>;
766
766
  group: z.ZodOptional<z.ZodString>;
767
+ includeUnscored: z.ZodOptional<z.ZodBoolean>;
767
768
  settle: z.ZodOptional<z.ZodObject<{
768
769
  at: z.ZodLiteral<"window-end">;
769
770
  ties: z.ZodEnum<{
@@ -853,6 +854,7 @@ declare const leaderboardDefinitionResponseSchema: z.ZodObject<{
853
854
  participants: "participants";
854
855
  }>>;
855
856
  group: z.ZodOptional<z.ZodString>;
857
+ includeUnscored: z.ZodOptional<z.ZodBoolean>;
856
858
  settle: z.ZodOptional<z.ZodObject<{
857
859
  at: z.ZodLiteral<"window-end">;
858
860
  ties: z.ZodEnum<{
@@ -897,6 +899,7 @@ declare const leaderboardAuthoringSchema: z.ZodObject<{
897
899
  public: "public";
898
900
  participants: "participants";
899
901
  }>>;
902
+ includeUnscored: z.ZodOptional<z.ZodBoolean>;
900
903
  settle: z.ZodOptional<z.ZodObject<{
901
904
  at: z.ZodLiteral<"window-end">;
902
905
  ties: z.ZodEnum<{
@@ -984,6 +987,7 @@ declare const leaderboardArtifactSchema: z.ZodUnion<readonly [z.ZodObject<{
984
987
  public: "public";
985
988
  participants: "participants";
986
989
  }>>;
990
+ includeUnscored: z.ZodOptional<z.ZodBoolean>;
987
991
  settle: z.ZodOptional<z.ZodObject<{
988
992
  at: z.ZodLiteral<"window-end">;
989
993
  ties: z.ZodEnum<{
@@ -1121,6 +1125,7 @@ declare const publishedLeaderboardSchema: z.ZodObject<{
1121
1125
  participants: "participants";
1122
1126
  }>>;
1123
1127
  group: z.ZodOptional<z.ZodString>;
1128
+ includeUnscored: z.ZodOptional<z.ZodBoolean>;
1124
1129
  settle: z.ZodOptional<z.ZodObject<{
1125
1130
  at: z.ZodLiteral<"window-end">;
1126
1131
  ties: z.ZodEnum<{
@@ -1298,7 +1303,8 @@ declare const leaderboardPageSchema: z.ZodObject<{
1298
1303
  type LeaderboardPage = z.infer<typeof leaderboardPageSchema>;
1299
1304
  /**
1300
1305
  * A profile's current place on one board, calculated now. `rank` and `score` are null while the
1301
- * member is unranked there (no counted points, excluded, or outside the board's group).
1306
+ * member is unranked there (no counted points on a board without `includeUnscored`, excluded, or
1307
+ * outside the board's group).
1302
1308
  */
1303
1309
  declare const leaderboardPlacementSchema: z.ZodObject<{
1304
1310
  leaderboard: z.ZodString;
@@ -1366,6 +1372,7 @@ declare const leaderboardPreviewSchema: z.ZodObject<{
1366
1372
  participants: "participants";
1367
1373
  }>>;
1368
1374
  group: z.ZodOptional<z.ZodString>;
1375
+ includeUnscored: z.ZodOptional<z.ZodBoolean>;
1369
1376
  settle: z.ZodOptional<z.ZodObject<{
1370
1377
  at: z.ZodLiteral<"window-end">;
1371
1378
  ties: z.ZodEnum<{
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- export { B as Badge, M as ManagedBadge, a as MemberBadge, b as MemberBadges, O as Offer, c as OfferDefinition, d as OfferPrice, R as RedeemOfferInput, e as Redemption } from './offers-DFJ4dmR3.js';
1
+ export { B as Badge, M as ManagedBadge, a as MemberBadge, b as MemberBadges, O as Offer, c as OfferDefinition, d as OfferPrice, R as RedeemOfferInput, e as Redemption } from './offers-CIDAJEYs.js';
2
2
  export { R as RelayAction, a as RequestError, b as RequestErrorDetails, c as RequestErrorKind, d as RequestRecovery, e as createRelayAction, i as isRequestError } from './action-DBzILFx9.js';
3
- export { A as AuthStartInput, C as ClaimSubmission, E as EmailVerification, K as KnownRelayErrorCode, P as PhotoSubmission, a as ProgressObservation, b as ProgressObserver, Q as QuestActionResult, c as QuestController, d as QuestUpdatedError, e as QuizSubmission, R as RelayClient, f as RelayClientOptions, g as RelayError, h as RelayErrorCode, i as RelayErrorDetails, j as RelayErrorKind, k as RelayRequestOptions, l as RelayResponseOptions, S as SubmissionCallOptions, m as SubmissionDraft, n as SubmissionStatus, o as SubmissionStore, V as ValueSubmission, p as createRelayClient, q as isRelayError } from './client-CraOIr8b.js';
4
- export { A as Attempt, a as AttemptStatus, E as Entitlement, b as EvaluatorProgress, K as KnownAttemptStatus, c as KnownTrackerSkipCode, M as MemberProgress, Q as QuestBudgetView, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, R as Reward, S as SubmissionEvidence, g as SubmitInput, T as TieredRewardReference, h as TrackerSkipCode } from './schema--jNn3OfJ.js';
3
+ export { A as AuthStartInput, C as ClaimSubmission, E as EmailVerification, K as KnownRelayErrorCode, P as PhotoSubmission, a as ProgressObservation, b as ProgressObserver, Q as QuestActionResult, c as QuestController, d as QuestUpdatedError, e as QuizSubmission, R as RelayClient, f as RelayClientOptions, g as RelayError, h as RelayErrorCode, i as RelayErrorDetails, j as RelayErrorKind, k as RelayRequestOptions, l as RelayResponseOptions, S as SubmissionCallOptions, m as SubmissionDraft, n as SubmissionStatus, o as SubmissionStore, V as ValueSubmission, p as createRelayClient, q as isRelayError } from './client-DjwKrpFo.js';
4
+ export { A as Attempt, a as AttemptStatus, E as Entitlement, b as EvaluatorProgress, K as KnownAttemptStatus, c as KnownTrackerSkipCode, M as MemberProgress, Q as QuestBudgetView, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, R as Reward, S as SubmissionEvidence, g as SubmitInput, T as TieredRewardReference, h as TrackerSkipCode } from './schema-Cgmj-CbC.js';
5
5
  export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
6
- export { P as Page, a as PageQuery, Q as QuestClaimInput, b as QuestEnrollment, c as QuestEnrollmentInput, d as QuestInteraction, e as QuestOutcome, f as QuestOutcomePage, g as QuestOutcomeQuery, h as QuestOutcomeState, i as QuestRewardView, j as QuestView, R as ResponseResult, U as UnsupportedResponse, p as paginate } from './pages-B5agdH0f.js';
6
+ export { P as Page, a as PageQuery, Q as QuestClaimInput, b as QuestEnrollment, c as QuestEnrollmentInput, d as QuestInteraction, e as QuestOutcome, f as QuestOutcomePage, g as QuestOutcomeQuery, h as QuestOutcomeState, i as QuestRewardView, j as QuestView, R as ResponseResult, U as UnsupportedResponse, p as paginate } from './pages-DR2YRvAp.js';
7
7
  export { A as AccountConnection, a as AuthProvider, T as TelegramAccountConnection, b as TelegramSignInMethods } from './accounts-DRPENuZe.js';
8
8
  export { E as ExchangeInput, M as MemberSummary, P as ParticipantActivity, a as ParticipantPrincipal, b as ParticipantSession, R as RelayEvent, S as Session, s as sessionMember } from './participant-activity-CoB2F30C.js';
9
- export { A as AvailabilityWindow, C as CampaignDefinition, a as CampaignEnrollment, b as CampaignEnrollmentInput, c as CampaignView, d as CampaignWithdrawalInput, K as KnownPointEntryKind, L as LeaderboardDefinition, e as LeaderboardPage, f as LeaderboardPlacement, g as LeaderboardQuery, M as MemberCampaignEnrollmentInput, h as MemberCampaignWithdrawalInput, P as PointBalance, i as PointBalances, j as PointEntry, k as PointEntryKind, l as PointHistoryPage, m as PointHistoryQuery, n as PointLedgerReference, o as ProjectGroup, p as ProjectGroupReference, R as ReferralDefinition } from './groups-DTsvf0Z2.js';
10
- export { A as AutomaticCatchUpPreview, a as AutomaticEvent, b as AutomaticOutcome, C as CollectionPass, c as CounterAchievement, d as CounterPolicy, e as CounterProgress } from './automatic-outcomes-BiarOoiy.js';
11
- export { M as MissingPrerequisite, P as Prerequisite, T as TextEvidence, a as TextOptions, U as UrlEvidence, b as UrlOptions, V as ValueEvidence } from './submission-input-BHzSin84.js';
9
+ export { A as AvailabilityWindow, C as CampaignDefinition, a as CampaignEnrollment, b as CampaignEnrollmentInput, c as CampaignView, d as CampaignWithdrawalInput, K as KnownPointEntryKind, L as LeaderboardDefinition, e as LeaderboardPage, f as LeaderboardPlacement, g as LeaderboardQuery, M as MemberCampaignEnrollmentInput, h as MemberCampaignWithdrawalInput, P as PointBalance, i as PointBalances, j as PointEntry, k as PointEntryKind, l as PointHistoryPage, m as PointHistoryQuery, n as PointLedgerReference, o as ProjectGroup, p as ProjectGroupReference, R as ReferralDefinition } from './groups-JzAQ2JIN.js';
10
+ export { A as AutomaticCatchUpPreview, a as AutomaticEvent, b as AutomaticOutcome, C as CollectionPass, c as CounterAchievement, d as CounterPolicy, e as CounterProgress } from './automatic-outcomes-DDbgRubQ.js';
11
+ export { M as MissingPrerequisite, P as Prerequisite, T as TextEvidence, a as TextOptions, U as UrlEvidence, b as UrlOptions, V as ValueEvidence } from './submission-input-UBqB8NFC.js';
12
12
  export { A as AvatarProvider, O as OwnProfile, P as ProfileAvatar, a as ProfileCompletion, b as ProfileCompletionPage, c as ProfileCompletionQuery, d as ProfileReferral, e as ProfileSummary, f as ProfileUpdate, g as ProfileVisibility } from './profiles-BHuQdzsW.js';
13
13
  export { Q as QuizContent, S as StreakProgress } from './streaks-0YuipsUQ.js';
14
14
  export { C as CosmosChain, a as CosmosNetwork, L as LinkedWallet, W as WalletAddressInput, b as WalletChain, c as WalletMessageChallenge, d as WalletSignInNetwork, e as WalletSignature, f as WalletSigner, g as WalletUnlinkInput } from './wallet-t7uNDg9p.js';
package/dist/index.js CHANGED
@@ -5,22 +5,22 @@ import {
5
5
  import {
6
6
  QuestUpdatedError,
7
7
  createRelayClient
8
- } from "./chunk-K7PUCZJY.js";
8
+ } from "./chunk-CHQWG5KQ.js";
9
9
  import {
10
10
  createRelayAction
11
- } from "./chunk-JXFRKZGL.js";
11
+ } from "./chunk-CRX274HO.js";
12
12
  import {
13
13
  QuestOutcomeState
14
- } from "./chunk-GI6RO43K.js";
14
+ } from "./chunk-JYHRPMCE.js";
15
15
  import {
16
16
  PointEntryKind
17
- } from "./chunk-2A4LCKTU.js";
18
- import "./chunk-FTB7F5IP.js";
19
- import "./chunk-U735N4KB.js";
20
- import "./chunk-S37JPI5O.js";
17
+ } from "./chunk-2CP3SULY.js";
18
+ import "./chunk-B65YJ6K4.js";
19
+ import "./chunk-SBW52XXL.js";
20
+ import "./chunk-KTHHGZSJ.js";
21
21
  import {
22
22
  sessionMember
23
- } from "./chunk-SB3ODDGR.js";
23
+ } from "./chunk-FTGW72A6.js";
24
24
  import {
25
25
  AttemptStatus,
26
26
  RelayError,
@@ -29,7 +29,7 @@ import {
29
29
  isRelayError,
30
30
  isRequestError,
31
31
  paginate
32
- } from "./chunk-RIMESZ4X.js";
32
+ } from "./chunk-OEO5OBY5.js";
33
33
  export {
34
34
  AttemptStatus,
35
35
  PointEntryKind,
@@ -1,15 +1,15 @@
1
- export { I as IdentityKindClaim, M as ManagementTransportOptions, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, m as managementTransport, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, n as sourceRoles, v as validateQuestShape } from './transport-4QyqeZLU.js';
2
- export { E as Extracted } from './x-imfTy_I1.js';
1
+ export { I as IdentityKindClaim, M as ManagementTransportOptions, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, m as managementTransport, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, n as sourceRoles, v as validateQuestShape } from './transport-B3DkXMNu.js';
2
+ export { E as Extracted } from './x-vVG6gZqi.js';
3
3
  import { c as RequestErrorKind } from './action-DBzILFx9.js';
4
- export { i as TrackerDataBudget, s as schemaCheckedReader, t as trackerDataBatchSteps, j as trackerDataIssue, k as trackerDataIssues, l as trackerDataPathTypes, m as trackerDataRecordSteps, w as whereSchemaIssue } from './schema--jNn3OfJ.js';
4
+ export { i as TrackerDataBudget, s as schemaCheckedReader, t as trackerDataBatchSteps, j as trackerDataIssue, k as trackerDataIssues, l as trackerDataPathTypes, m as trackerDataRecordSteps, w as whereSchemaIssue } from './schema-Cgmj-CbC.js';
5
5
  import 'zod';
6
- import './pages-B5agdH0f.js';
7
- import './offers-DFJ4dmR3.js';
8
- import './groups-DTsvf0Z2.js';
6
+ import './pages-DR2YRvAp.js';
7
+ import './offers-CIDAJEYs.js';
8
+ import './groups-JzAQ2JIN.js';
9
9
  import './profiles-BHuQdzsW.js';
10
- import './automatic-outcomes-BiarOoiy.js';
11
- import './attempt-captures-B2Clh9Df.js';
12
- import './deployments-DTaJPDsl.js';
10
+ import './automatic-outcomes-DDbgRubQ.js';
11
+ import './attempt-captures-CSiN1HKd.js';
12
+ import './deployments-DYeuxXYg.js';
13
13
 
14
14
  /** The management client's and the CLI's default deadline per call. */
15
15
  declare const MANAGEMENT_TIMEOUT = 30000;
package/dist/internal.js CHANGED
@@ -9,17 +9,17 @@ import {
9
9
  participantExchangeSchema,
10
10
  questConfiguration,
11
11
  sequenceCursorSchema
12
- } from "./chunk-L33BQLNF.js";
12
+ } from "./chunk-Z3SG7LKF.js";
13
13
  import {
14
14
  parseImageExtraction,
15
15
  parseImageResult
16
- } from "./chunk-LNPV4J53.js";
17
- import "./chunk-Z2EN4ERZ.js";
16
+ } from "./chunk-BYX27T2S.js";
17
+ import "./chunk-V7KYVH3Z.js";
18
18
  import {
19
19
  sourceDataSchema,
20
20
  sourceRoles,
21
21
  validateQuestShape
22
- } from "./chunk-NQDZX3D2.js";
22
+ } from "./chunk-YNQPFRQO.js";
23
23
  import {
24
24
  isIntegrationParticipantPath,
25
25
  isParticipantRoute,
@@ -31,9 +31,9 @@ import {
31
31
  lifetime,
32
32
  retryAfter,
33
33
  retrying
34
- } from "./chunk-U735N4KB.js";
35
- import "./chunk-S37JPI5O.js";
36
- import "./chunk-SB3ODDGR.js";
34
+ } from "./chunk-SBW52XXL.js";
35
+ import "./chunk-KTHHGZSJ.js";
36
+ import "./chunk-FTGW72A6.js";
37
37
  import {
38
38
  schemaCheckedReader,
39
39
  trackerDataBatchSteps,
@@ -42,7 +42,7 @@ import {
42
42
  trackerDataPathTypes,
43
43
  trackerDataRecordSteps,
44
44
  whereSchemaIssue
45
- } from "./chunk-RIMESZ4X.js";
45
+ } from "./chunk-OEO5OBY5.js";
46
46
  export {
47
47
  MANAGEMENT_TIMEOUT,
48
48
  REFERRAL_INTEGRATION_REWARD_ERROR,
@@ -1,6 +1,6 @@
1
1
  import * as z from 'zod';
2
- import { q as ResourceHandle } from './schema--jNn3OfJ.js';
3
- import { r as AuthoringIdentity } from './groups-DTsvf0Z2.js';
2
+ import { q as ResourceHandle } from './schema-Cgmj-CbC.js';
3
+ import { r as AuthoringIdentity } from './groups-JzAQ2JIN.js';
4
4
 
5
5
  declare const badgePropertiesSchema: z.ZodObject<{
6
6
  name: z.ZodString;
@@ -1,5 +1,5 @@
1
1
  import * as z from 'zod';
2
- import { a as AttemptStatus, bY as questDescriptionSchema, h as TrackerSkipCode } from './schema--jNn3OfJ.js';
2
+ import { a as AttemptStatus, bY as questDescriptionSchema, h as TrackerSkipCode } from './schema-Cgmj-CbC.js';
3
3
 
4
4
  /**
5
5
  * The delivery actions this SDK knows. `RewardDelivery.action` is an open string: Relay can add
@@ -551,6 +551,7 @@ declare const questTypeVersionSchema: z.ZodObject<{
551
551
  balance: z.ZodString;
552
552
  }, z.core.$strict>]>;
553
553
  }, z.core.$strict>>>;
554
+ retryCooldownMs: z.ZodOptional<z.ZodNumber>;
554
555
  completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
555
556
  kind: z.ZodLiteral<"streak">;
556
557
  days: z.ZodNumber;
@@ -684,6 +685,7 @@ declare const questInstanceSchema: z.ZodObject<{
684
685
  group: z.ZodString;
685
686
  title: z.ZodString;
686
687
  }, z.core.$strict>], "kind">>;
688
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
687
689
  status: z.ZodEnum<{
688
690
  paused: "paused";
689
691
  active: "active";
@@ -756,6 +758,7 @@ declare const questDraftChangesSchema: z.ZodObject<{
756
758
  group: z.ZodString;
757
759
  title: z.ZodString;
758
760
  }, z.core.$strict>], "kind">>;
761
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
759
762
  status: z.ZodEnum<{
760
763
  paused: "paused";
761
764
  active: "active";
@@ -843,6 +846,7 @@ declare const questDraftSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
843
846
  group: z.ZodString;
844
847
  title: z.ZodString;
845
848
  }, z.core.$strict>], "kind">>;
849
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
846
850
  status: z.ZodEnum<{
847
851
  paused: "paused";
848
852
  active: "active";
@@ -931,6 +935,7 @@ declare const questDraftSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
931
935
  group: z.ZodString;
932
936
  title: z.ZodString;
933
937
  }, z.core.$strict>], "kind">>;
938
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
934
939
  status: z.ZodEnum<{
935
940
  paused: "paused";
936
941
  active: "active";
@@ -1288,6 +1293,7 @@ declare const questCatalogSchema: z.ZodObject<{
1288
1293
  balance: z.ZodString;
1289
1294
  }, z.core.$strict>]>;
1290
1295
  }, z.core.$strict>>>;
1296
+ retryCooldownMs: z.ZodOptional<z.ZodNumber>;
1291
1297
  completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
1292
1298
  kind: z.ZodLiteral<"streak">;
1293
1299
  days: z.ZodNumber;
@@ -1405,6 +1411,7 @@ declare const questCatalogSchema: z.ZodObject<{
1405
1411
  group: z.ZodString;
1406
1412
  title: z.ZodString;
1407
1413
  }, z.core.$strict>], "kind">>;
1414
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1408
1415
  status: z.ZodEnum<{
1409
1416
  paused: "paused";
1410
1417
  active: "active";
@@ -1481,6 +1488,7 @@ declare const questCatalogSchema: z.ZodObject<{
1481
1488
  group: z.ZodString;
1482
1489
  title: z.ZodString;
1483
1490
  }, z.core.$strict>], "kind">>;
1491
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1484
1492
  status: z.ZodEnum<{
1485
1493
  paused: "paused";
1486
1494
  active: "active";
@@ -1569,6 +1577,7 @@ declare const questCatalogSchema: z.ZodObject<{
1569
1577
  group: z.ZodString;
1570
1578
  title: z.ZodString;
1571
1579
  }, z.core.$strict>], "kind">>;
1580
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1572
1581
  status: z.ZodEnum<{
1573
1582
  paused: "paused";
1574
1583
  active: "active";
@@ -1918,6 +1927,7 @@ declare const questCatalogSchema: z.ZodObject<{
1918
1927
  balance: z.ZodString;
1919
1928
  }, z.core.$strict>]>;
1920
1929
  }, z.core.$strict>>>;
1930
+ retryCooldownMs: z.ZodOptional<z.ZodNumber>;
1921
1931
  completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
1922
1932
  kind: z.ZodLiteral<"streak">;
1923
1933
  days: z.ZodNumber;
@@ -2421,6 +2431,7 @@ declare const catalogDeploymentPreviewSchema: z.ZodObject<{
2421
2431
  balance: z.ZodString;
2422
2432
  }, z.core.$strict>]>;
2423
2433
  }, z.core.$strict>>>;
2434
+ retryCooldownMs: z.ZodOptional<z.ZodNumber>;
2424
2435
  completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
2425
2436
  kind: z.ZodLiteral<"streak">;
2426
2437
  days: z.ZodNumber;
@@ -2553,6 +2564,7 @@ declare const saveQuestDraftSchema: z.ZodObject<{
2553
2564
  group: z.ZodString;
2554
2565
  title: z.ZodString;
2555
2566
  }, z.core.$strict>], "kind">>;
2567
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2556
2568
  status: z.ZodEnum<{
2557
2569
  paused: "paused";
2558
2570
  active: "active";
@@ -3002,6 +3014,7 @@ declare const questViewSchema: z.ZodObject<{
3002
3014
  remaining: z.ZodNumber;
3003
3015
  resetsAt: z.ZodNullable<z.ZodNumber>;
3004
3016
  }, z.core.$strip>>>;
3017
+ retryAt: z.ZodOptional<z.ZodNumber>;
3005
3018
  attempt: z.ZodNullable<z.ZodObject<{
3006
3019
  id: z.ZodString;
3007
3020
  release: z.ZodString;
@@ -3515,6 +3528,7 @@ declare const collectionViewSchema: z.ZodObject<{
3515
3528
  remaining: z.ZodNumber;
3516
3529
  resetsAt: z.ZodNullable<z.ZodNumber>;
3517
3530
  }, z.core.$strip>>>;
3531
+ retryAt: z.ZodOptional<z.ZodNumber>;
3518
3532
  attempt: z.ZodNullable<z.ZodObject<{
3519
3533
  id: z.ZodString;
3520
3534
  release: z.ZodString;
@@ -4202,6 +4216,7 @@ declare const questExperienceSchema: z.ZodObject<{
4202
4216
  remaining: z.ZodNumber;
4203
4217
  resetsAt: z.ZodNullable<z.ZodNumber>;
4204
4218
  }, z.core.$strip>>>;
4219
+ retryAt: z.ZodOptional<z.ZodNumber>;
4205
4220
  attempt: z.ZodNullable<z.ZodObject<{
4206
4221
  id: z.ZodString;
4207
4222
  release: z.ZodString;
@@ -4715,6 +4730,7 @@ declare const questExperienceSchema: z.ZodObject<{
4715
4730
  remaining: z.ZodNumber;
4716
4731
  resetsAt: z.ZodNullable<z.ZodNumber>;
4717
4732
  }, z.core.$strip>>>;
4733
+ retryAt: z.ZodOptional<z.ZodNumber>;
4718
4734
  attempt: z.ZodNullable<z.ZodObject<{
4719
4735
  id: z.ZodString;
4720
4736
  release: z.ZodString;
@@ -4906,6 +4922,7 @@ declare const questPublicationPreviewSchema: z.ZodObject<{
4906
4922
  group: z.ZodString;
4907
4923
  title: z.ZodString;
4908
4924
  }, z.core.$strict>], "kind">>;
4925
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4909
4926
  status: z.ZodEnum<{
4910
4927
  paused: "paused";
4911
4928
  active: "active";
@@ -4994,6 +5011,7 @@ declare const questPublicationPreviewSchema: z.ZodObject<{
4994
5011
  group: z.ZodString;
4995
5012
  title: z.ZodString;
4996
5013
  }, z.core.$strict>], "kind">>;
5014
+ retryCooldownMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4997
5015
  status: z.ZodEnum<{
4998
5016
  paused: "paused";
4999
5017
  active: "active";
@@ -5343,6 +5361,7 @@ declare const questPublicationPreviewSchema: z.ZodObject<{
5343
5361
  balance: z.ZodString;
5344
5362
  }, z.core.$strict>]>;
5345
5363
  }, z.core.$strict>>>;
5364
+ retryCooldownMs: z.ZodOptional<z.ZodNumber>;
5346
5365
  completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
5347
5366
  kind: z.ZodLiteral<"streak">;
5348
5367
  days: z.ZodNumber;
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-DP4YWFMY.js";
4
4
  import {
5
5
  clientIdentity
6
- } from "./chunk-S37JPI5O.js";
6
+ } from "./chunk-KTHHGZSJ.js";
7
7
  import {
8
8
  exchangeResultSchema
9
- } from "./chunk-SB3ODDGR.js";
10
- import "./chunk-RIMESZ4X.js";
9
+ } from "./chunk-FTGW72A6.js";
10
+ import "./chunk-OEO5OBY5.js";
11
11
 
12
12
  // src/portal-proxy.ts
13
13
  var statusCode = (status) => ({
@@ -1,20 +1,20 @@
1
- import { B as Badge, b as MemberBadges, O as Offer, e as Redemption } from '../offers-DFJ4dmR3.js';
1
+ import { B as Badge, b as MemberBadges, O as Offer, e as Redemption } from '../offers-CIDAJEYs.js';
2
2
  import { b as ParticipantSession, R as RelayEvent, P as ParticipantActivity, M as MemberSummary } from '../participant-activity-CoB2F30C.js';
3
- import { g as RelayError, R as RelayClient, m as SubmissionDraft } from '../client-CraOIr8b.js';
4
- import { P as Page, A as collectionViewSchema, j as QuestView, g as QuestOutcomeQuery, e as QuestOutcome } from '../pages-B5agdH0f.js';
3
+ import { g as RelayError, R as RelayClient, m as SubmissionDraft } from '../client-DjwKrpFo.js';
4
+ import { P as Page, A as collectionViewSchema, j as QuestView, g as QuestOutcomeQuery, e as QuestOutcome } from '../pages-DR2YRvAp.js';
5
5
  import * as react from 'react';
6
6
  import { ReactNode } from 'react';
7
7
  import { J as JSONType } from '../util.d-w9f9t3ua.js';
8
8
  import { z } from 'zod';
9
- import { E as Entitlement, a as AttemptStatus, T as TieredRewardReference } from '../schema--jNn3OfJ.js';
9
+ import { E as Entitlement, a as AttemptStatus, T as TieredRewardReference } from '../schema-Cgmj-CbC.js';
10
10
  import { a as AuthProvider, A as AccountConnection } from '../accounts-DRPENuZe.js';
11
11
  export { T as TelegramAccountConnection, b as TelegramSignInMethods } from '../accounts-DRPENuZe.js';
12
- import { c as SignInMethods, C as CosmosChains, d as SignInOption, f as SignInUnavailable, T as TelegramSignInOption, g as SignInWallet, D as DiscoveredWallet } from '../telegram-browser-B1LFWF_v.js';
13
- export { a as EmailSignInOption, O as OAuthSignInOption, b as SignInIcon, W as WalletSignInOption, t as telegramMiniAppInitData } from '../telegram-browser-B1LFWF_v.js';
12
+ import { c as SignInMethods, C as CosmosChains, d as SignInOption, f as SignInUnavailable, T as TelegramSignInOption, g as SignInWallet, D as DiscoveredWallet } from '../telegram-browser-2IllFeh-.js';
13
+ export { a as EmailSignInOption, O as OAuthSignInOption, b as SignInIcon, W as WalletSignInOption, t as telegramMiniAppInitData } from '../telegram-browser-2IllFeh-.js';
14
14
  import { f as WalletSigner, d as WalletSignInNetwork, L as LinkedWallet } from '../wallet-t7uNDg9p.js';
15
- import { f as LeaderboardPlacement, ba as referralSummarySchema, e as LeaderboardPage, i as PointBalances, j as PointEntry, n as PointLedgerReference } from '../groups-DTsvf0Z2.js';
15
+ import { f as LeaderboardPlacement, ba as referralSummarySchema, e as LeaderboardPage, i as PointBalances, j as PointEntry, n as PointLedgerReference } from '../groups-JzAQ2JIN.js';
16
16
  import { f as ProfileUpdate, e as ProfileSummary, a as ProfileCompletion, d as ProfileReferral } from '../profiles-BHuQdzsW.js';
17
- import '../submission-input-BHzSin84.js';
17
+ import '../submission-input-UBqB8NFC.js';
18
18
  import '../action-DBzILFx9.js';
19
19
 
20
20
  /**
@@ -1232,6 +1232,7 @@ declare function useQuest(observed: QuestView): {
1232
1232
  budget: string;
1233
1233
  } | null;
1234
1234
  } | null | undefined;
1235
+ retryAt?: number | undefined;
1235
1236
  };
1236
1237
  /** Input recovered after the quest changed. Prefill the form with it. */
1237
1238
  draft: SubmissionDraft | null;
@@ -1267,11 +1268,13 @@ type QuestTone = "open" | "done" | "waiting" | "attention" | "locked" | "off";
1267
1268
  * - `retryable`: verification could not run; the participant can retry.
1268
1269
  * - `staff-required`: a staff member confirms it.
1269
1270
  * - `rejected`: the last submission was not accepted; the participant can try again.
1271
+ * - `retry-cooldown`: the last submission was not accepted, and the quest's retry cooldown runs
1272
+ * until `retryAt`.
1270
1273
  * - `ready`: the participant can act now.
1271
1274
  *
1272
1275
  * @compat open
1273
1276
  */
1274
- type KnownQuestStatusCode = "completed" | "paused" | "closed" | "counter" | "counter-budget-exhausted" | "counter-revoked" | "streak" | "streak-budget-exhausted" | "automatic" | "in-progress" | "locked" | "budget-exhausted" | "connection-required" | "wallet-required" | "outside-window" | "enrollment-required" | "checking" | "evaluator-deferred" | "evaluator-progress" | "in-review" | "retryable" | "staff-required" | "rejected" | "ready";
1277
+ type KnownQuestStatusCode = "completed" | "paused" | "closed" | "counter" | "counter-budget-exhausted" | "counter-revoked" | "streak" | "streak-budget-exhausted" | "automatic" | "in-progress" | "locked" | "budget-exhausted" | "connection-required" | "wallet-required" | "outside-window" | "enrollment-required" | "checking" | "evaluator-deferred" | "evaluator-progress" | "in-review" | "retryable" | "staff-required" | "rejected" | "retry-cooldown" | "ready";
1275
1278
  /** A known code, or one a newer SDK adds: render unknown codes with a neutral fallback. */
1276
1279
  type QuestStatusCode = KnownQuestStatusCode | (string & {});
1277
1280
  type QuestStatus = {
@@ -1284,6 +1287,8 @@ type QuestStatus = {
1284
1287
  * string when it gave none.
1285
1288
  */
1286
1289
  reason?: string;
1290
+ /** Unix milliseconds when the participant may submit again, when `code` is `retry-cooldown`. */
1291
+ retryAt?: number;
1287
1292
  };
1288
1293
  /** `QuestStatus` in English: a short `label`, and a sentence of `detail` when there is more. */
1289
1294
  type QuestStatusText = QuestStatus & {
@@ -1314,18 +1319,24 @@ declare function completionCountText(view: QuestView): string | null;
1314
1319
  */
1315
1320
  declare function canRepeat(view: QuestView): boolean;
1316
1321
  /**
1317
- * What a QuestView means for the participant, as a tone and a code. Pure and free of copy: render
1318
- * the code in your own words, or call `questStatusText` for English. The code is an open string,
1319
- * so a `switch` over it needs a `default` for codes a newer SDK adds.
1322
+ * What a QuestView means for the participant, as a tone and a code. Free of copy: render the code
1323
+ * in your own words, or call `questStatusText` for English. The code is an open string, so a
1324
+ * `switch` over it needs a `default` for codes a newer SDK adds. `now` (Unix milliseconds, the
1325
+ * current time by default) decides whether a retry cooldown is still running.
1320
1326
  */
1321
- declare function questStatus(view: QuestView): QuestStatus;
1327
+ declare function questStatus(view: QuestView, now?: number): QuestStatus;
1328
+ /** True while the quest's retry cooldown after the participant's rejected attempt runs. */
1329
+ declare function isCoolingDown(view: QuestView, now?: number): boolean;
1322
1330
  /**
1323
1331
  * `questStatus` in English, for apps that do not localize: a `label` such as "In review", and a
1324
- * `detail` sentence when there is more to say.
1332
+ * `detail` sentence when there is more to say. `now` is as in `questStatus`.
1325
1333
  */
1326
- declare function questStatusText(view: QuestView): QuestStatusText;
1327
- /** True when the participant can submit something right now. */
1328
- declare function canSubmit(view: QuestView): boolean;
1334
+ declare function questStatusText(view: QuestView, now?: number): QuestStatusText;
1335
+ /**
1336
+ * True when the participant can submit something right now (`now`, Unix milliseconds, the current
1337
+ * time by default): not while a retry cooldown runs.
1338
+ */
1339
+ declare function canSubmit(view: QuestView, now?: number): boolean;
1329
1340
  /**
1330
1341
  * "x of y completed" for a list of quests: `total` counts every quest that is not archived or
1331
1342
  * repeatable, including locked and paused ones, because they are still part of what the
@@ -1949,4 +1960,4 @@ declare function usePointLedgers(): Query<PointLedgerReference[]>;
1949
1960
  */
1950
1961
  declare function useTieredRewards(): Query<TieredRewardReference[]>;
1951
1962
 
1952
- export { type Collection, CosmosChains, DiscoveredWallet, type ExperienceData, type Invitation, type KnownQuestStatusCode, type KnownRoleDeliveryStatus, type MemberPagedQuery, type MemberQuery, type MemberQueryOptions, type MemberSnapshot, type Mutation, type MutationContext, type MutationOptions, type MutationStatus, type OAuthProvider, Page, type PageLoader, type PageRead, type PagedQuery, type Query, type QueryContext, type QueryKey, type QueryOptions, type QueryRead, type QuerySnapshot, type QuestInput, type QuestNotice, type QuestStatus, type QuestStatusCode, type QuestStatusText, type QuestTone, type ReferralSummary, type RelayActionResult, RelayClient, type RelayPolling, RelayProvider, type RelayQueryOptions, type RoleDelivery, type RoleDeliveryStatus, type SavedSubmission, SignInMethods, SignInOption, SignInUnavailable, SignInWallet, TelegramSignInOption, canRepeat, canSubmit, captureReferralCode, completionCountText, isAutomatic, isConnected, isFinished, progressOf, questGroups, questStatus, questStatusText, relayKeys, roleDeliveryLabel, roleDeliveryStatus, useAccounts, useActivity, useBadgeCatalog, useBadges, useBalances, useDeliveries, useEntitlements, useExperience, useInvalidate, useInvitation, useLeaderboard, useLeaderboardPlacement, useMe, useMemberPages, useMemberQuery, useMyProfile, useOffers, usePointHistory, usePointLedgers, useProfile, useProfileBadges, useProfileCompletions, useProfileReferral, useQuest, useQuestOutcomes, useRedeemOffer, useReferralSummary, useRelay, useRelayAction, useRelayMutation, useRelayPages, useRelayQuery, useSession, useSetQueryData, useSignIn, useSignInMethods, useSignInOptions, useSignInWallets, useSignOut, useTelegramAccount, useTieredRewards, useWalletDiscovery, useWallets };
1963
+ export { type Collection, CosmosChains, DiscoveredWallet, type ExperienceData, type Invitation, type KnownQuestStatusCode, type KnownRoleDeliveryStatus, type MemberPagedQuery, type MemberQuery, type MemberQueryOptions, type MemberSnapshot, type Mutation, type MutationContext, type MutationOptions, type MutationStatus, type OAuthProvider, Page, type PageLoader, type PageRead, type PagedQuery, type Query, type QueryContext, type QueryKey, type QueryOptions, type QueryRead, type QuerySnapshot, type QuestInput, type QuestNotice, type QuestStatus, type QuestStatusCode, type QuestStatusText, type QuestTone, type ReferralSummary, type RelayActionResult, RelayClient, type RelayPolling, RelayProvider, type RelayQueryOptions, type RoleDelivery, type RoleDeliveryStatus, type SavedSubmission, SignInMethods, SignInOption, SignInUnavailable, SignInWallet, TelegramSignInOption, canRepeat, canSubmit, captureReferralCode, completionCountText, isAutomatic, isConnected, isCoolingDown, isFinished, progressOf, questGroups, questStatus, questStatusText, relayKeys, roleDeliveryLabel, roleDeliveryStatus, useAccounts, useActivity, useBadgeCatalog, useBadges, useBalances, useDeliveries, useEntitlements, useExperience, useInvalidate, useInvitation, useLeaderboard, useLeaderboardPlacement, useMe, useMemberPages, useMemberQuery, useMyProfile, useOffers, usePointHistory, usePointLedgers, useProfile, useProfileBadges, useProfileCompletions, useProfileReferral, useQuest, useQuestOutcomes, useRedeemOffer, useReferralSummary, useRelay, useRelayAction, useRelayMutation, useRelayPages, useRelayQuery, useSession, useSetQueryData, useSignIn, useSignInMethods, useSignInOptions, useSignInWallets, useSignOut, useTelegramAccount, useTieredRewards, useWalletDiscovery, useWallets };
@@ -9,19 +9,19 @@ import {
9
9
  readSignInMethods,
10
10
  signInOptionsFrom,
11
11
  telegramMiniAppInitData
12
- } from "../chunk-R5NQEW5J.js";
13
- import "../chunk-K7PUCZJY.js";
12
+ } from "../chunk-DZZ5GSJ6.js";
13
+ import "../chunk-CHQWG5KQ.js";
14
14
  import {
15
15
  createRelayAction
16
- } from "../chunk-JXFRKZGL.js";
17
- import "../chunk-GI6RO43K.js";
18
- import "../chunk-2A4LCKTU.js";
19
- import "../chunk-FTB7F5IP.js";
20
- import "../chunk-U735N4KB.js";
21
- import "../chunk-S37JPI5O.js";
16
+ } from "../chunk-CRX274HO.js";
17
+ import "../chunk-JYHRPMCE.js";
18
+ import "../chunk-2CP3SULY.js";
19
+ import "../chunk-B65YJ6K4.js";
20
+ import "../chunk-SBW52XXL.js";
21
+ import "../chunk-KTHHGZSJ.js";
22
22
  import {
23
23
  sessionMember
24
- } from "../chunk-SB3ODDGR.js";
24
+ } from "../chunk-FTGW72A6.js";
25
25
  import {
26
26
  RelayError,
27
27
  RelayErrorCode,
@@ -29,7 +29,7 @@ import {
29
29
  clientError,
30
30
  isRelayError,
31
31
  isRequestError
32
- } from "../chunk-RIMESZ4X.js";
32
+ } from "../chunk-OEO5OBY5.js";
33
33
 
34
34
  // src/react/context.ts
35
35
  import { createContext, useContext } from "react";
@@ -749,10 +749,13 @@ function canRepeat(view) {
749
749
  function visibleQuests(quests) {
750
750
  return quests.filter((q) => q.visibility !== "hidden");
751
751
  }
752
- function questStatus(view) {
753
- return knownStatus(view);
752
+ function questStatus(view, now = Date.now()) {
753
+ return knownStatus(view, now);
754
754
  }
755
- function knownStatus(view) {
755
+ function isCoolingDown(view, now = Date.now()) {
756
+ return view.retryAt !== void 0 && view.retryAt > now;
757
+ }
758
+ function knownStatus(view, now) {
756
759
  if (isFinished(view)) {
757
760
  return { tone: "done", code: "completed" };
758
761
  }
@@ -777,6 +780,14 @@ function knownStatus(view) {
777
780
  ...availability.reason === "outside-window" && availability.window ? { window: availability.window } : {}
778
781
  };
779
782
  }
783
+ if (availability.kind === "available" && isCoolingDown(view, now)) {
784
+ return {
785
+ tone: "attention",
786
+ code: "retry-cooldown",
787
+ reason: view.attempt?.status === "rejected" ? view.attempt.reason ?? "" : "",
788
+ retryAt: view.retryAt
789
+ };
790
+ }
780
791
  const ownSubmission = view.trigger.kind === "manual" && view.trigger.actor !== "staff";
781
792
  const submissionFirst = ownSubmission && (availability.kind === "checking" || availability.kind === "needs-review" || availability.kind === "retryable");
782
793
  if (view.counter && availability.kind !== "locked" && !submissionFirst) {
@@ -829,8 +840,8 @@ function knownStatus(view) {
829
840
  } : { tone: "open", code: "ready" };
830
841
  }
831
842
  }
832
- function questStatusText(view) {
833
- const status = knownStatus(view);
843
+ function questStatusText(view, now = Date.now()) {
844
+ const status = knownStatus(view, now);
834
845
  const words = (label, detail) => detail === void 0 ? { ...status, label } : { ...status, label, detail };
835
846
  const rejection = status.reason === void 0 ? null : sentence(status.reason || "That submission wasn't accepted.");
836
847
  switch (status.code) {
@@ -935,12 +946,17 @@ function questStatusText(view) {
935
946
  "Try again",
936
947
  status.reason || "That submission wasn't accepted."
937
948
  );
949
+ case "retry-cooldown":
950
+ return words(
951
+ "Try again soon",
952
+ `${rejection ?? "That submission wasn't accepted."} You can try again ${waitText((status.retryAt ?? now) - now)}.`
953
+ );
938
954
  case "ready":
939
955
  return words("Ready");
940
956
  }
941
957
  }
942
- function canSubmit(view) {
943
- return !isFinished(view) && !(view.counter?.repeat === "once" && view.counter.settled > 0) && !isAutomatic(view) && view.lifecycle === "active" && view.availability.kind === "available";
958
+ function canSubmit(view, now = Date.now()) {
959
+ return !isFinished(view) && !(view.counter?.repeat === "once" && view.counter.settled > 0) && !isAutomatic(view) && view.lifecycle === "active" && view.availability.kind === "available" && !isCoolingDown(view, now);
944
960
  }
945
961
  function progressOf(quests) {
946
962
  const counted = quests.filter(
@@ -951,6 +967,20 @@ function progressOf(quests) {
951
967
  done: counted.filter(isFinished).length
952
968
  };
953
969
  }
970
+ function waitText(ms) {
971
+ const format = new Intl.RelativeTimeFormat("en", { numeric: "always" });
972
+ const seconds = Math.max(1, Math.ceil(ms / 1e3));
973
+ if (seconds < 60) {
974
+ return format.format(seconds, "second");
975
+ }
976
+ if (seconds < 3600) {
977
+ return format.format(Math.ceil(seconds / 60), "minute");
978
+ }
979
+ if (seconds < 86400) {
980
+ return format.format(Math.ceil(seconds / 3600), "hour");
981
+ }
982
+ return format.format(Math.ceil(seconds / 86400), "day");
983
+ }
954
984
  function sentence(text) {
955
985
  const trimmed = text.trim();
956
986
  return /[.!?]$/.test(trimmed) ? trimmed : `${trimmed}.`;
@@ -2087,6 +2117,18 @@ function useQuest(observed) {
2087
2117
  const [receipt, setReceipt] = useState5(null);
2088
2118
  useEffect5(() => setLatest(null), [observed.release]);
2089
2119
  const view = latest ?? observed;
2120
+ const [, setCooledDown] = useState5(0);
2121
+ useEffect5(() => {
2122
+ const wait = view.retryAt === void 0 ? 0 : view.retryAt - Date.now();
2123
+ if (wait <= 0) {
2124
+ return;
2125
+ }
2126
+ const timer = setTimeout(
2127
+ () => setCooledDown((count) => count + 1),
2128
+ wait + 1
2129
+ );
2130
+ return () => clearTimeout(timer);
2131
+ }, [view.retryAt]);
2090
2132
  const { quest, release } = view;
2091
2133
  const completed = isFinished(view) || isAutomatic(view);
2092
2134
  const attempt = view.attempt?.id;
@@ -2994,6 +3036,7 @@ export {
2994
3036
  completionCountText,
2995
3037
  isAutomatic,
2996
3038
  isConnected,
3039
+ isCoolingDown,
2997
3040
  isFinished,
2998
3041
  progressOf,
2999
3042
  questGroups,