@taskon/widget-react 0.0.1-beta.4 → 0.0.1-beta.6

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 (58) hide show
  1. package/README.md +13 -4
  2. package/dist/CommunityTaskList.css +119 -111
  3. package/dist/EligibilityInfo.css +114 -110
  4. package/dist/LeaderboardWidget.css +73 -71
  5. package/dist/PageBuilder.css +5 -0
  6. package/dist/Quest.css +259 -255
  7. package/dist/TaskOnProvider.css +2 -0
  8. package/dist/UserCenterWidget.css +6 -6
  9. package/dist/UserCenterWidget2.css +1626 -1601
  10. package/dist/{dynamic-import-helper.css → WidgetShell.css} +2 -2
  11. package/dist/chunks/{CommunityTaskList-C9Gv8KOF.js → CommunityTaskList-Hde2OKHH.js} +1070 -580
  12. package/dist/chunks/{EligibilityInfo-D-Fuy9GE.js → EligibilityInfo-BV0Z2TgY.js} +1972 -1028
  13. package/dist/chunks/{LeaderboardWidget-BV2D2q1N.js → LeaderboardWidget-BNGRD5Bu.js} +270 -249
  14. package/dist/chunks/{PageBuilder-DQoU4Mwf.js → PageBuilder-C5DSHiW9.js} +5 -5
  15. package/dist/chunks/{Quest-B5NyVr3o.js → Quest-DG9zfXJo.js} +723 -513
  16. package/dist/chunks/{TaskOnProvider-93UxARFo.js → TaskOnProvider-BhamHIyY.js} +98 -68
  17. package/dist/chunks/{ThemeProvider-CPI_roeh.js → ThemeProvider-mXLdLSkq.js} +107 -20
  18. package/dist/chunks/{UserCenterWidget-cADBSVg7.js → UserCenterWidget-D5ttw4hO.js} +1328 -1337
  19. package/dist/chunks/{UserCenterWidget-BRtigY_S.js → UserCenterWidget-jDO5zTN1.js} +358 -254
  20. package/dist/chunks/{dynamic-import-helper-DwXlQC0S.js → WidgetShell-D7yC894Y.js} +447 -457
  21. package/dist/chunks/communitytask-es-CBNnS4o2.js +521 -0
  22. package/dist/chunks/communitytask-ja-GRf9cbdx.js +521 -0
  23. package/dist/chunks/communitytask-ko-Bf24PQKI.js +521 -0
  24. package/dist/chunks/communitytask-ru-CZm2CPoV.js +521 -0
  25. package/dist/chunks/leaderboardwidget-es-vKjrjQaz.js +146 -0
  26. package/dist/chunks/leaderboardwidget-ja-Q6u0HxKG.js +146 -0
  27. package/dist/chunks/leaderboardwidget-ko-CG6SWgxf.js +146 -0
  28. package/dist/chunks/leaderboardwidget-ru-DCcHcJGz.js +146 -0
  29. package/dist/chunks/quest-es-Dyyy0zaw.js +863 -0
  30. package/dist/chunks/quest-ja-Depog33y.js +863 -0
  31. package/dist/chunks/quest-ko-BMu3uRQJ.js +863 -0
  32. package/dist/chunks/quest-ru-xne814Rw.js +863 -0
  33. package/dist/chunks/taskwidget-es-Do9b3Mqw.js +245 -0
  34. package/dist/chunks/taskwidget-ja-CqSu-yWA.js +245 -0
  35. package/dist/chunks/taskwidget-ko-EHgXFV4B.js +245 -0
  36. package/dist/chunks/taskwidget-ru-CMbLQDK4.js +245 -0
  37. package/dist/chunks/usercenter-es-Dz3Wp2vV.js +512 -0
  38. package/dist/chunks/usercenter-ja-CKE4DJC6.js +512 -0
  39. package/dist/chunks/usercenter-ko-Dtpkn2qb.js +512 -0
  40. package/dist/chunks/usercenter-ru-DnBGee45.js +512 -0
  41. package/dist/community-task.d.ts +0 -390
  42. package/dist/community-task.js +2 -7
  43. package/dist/core.d.ts +46 -10
  44. package/dist/core.js +11 -11
  45. package/dist/index.d.ts +46 -667
  46. package/dist/index.js +19 -28
  47. package/dist/leaderboard.d.ts +0 -498
  48. package/dist/leaderboard.js +2 -16
  49. package/dist/page-builder.js +1 -1
  50. package/dist/quest.d.ts +0 -289
  51. package/dist/quest.js +2 -5
  52. package/dist/user-center.d.ts +0 -1608
  53. package/dist/user-center.js +2 -494
  54. package/package.json +5 -2
  55. package/dist/chunks/leaderboardwidget-ja-Bj6gz6y1.js +0 -119
  56. package/dist/chunks/leaderboardwidget-ko-f1cLO9ic.js +0 -119
  57. package/dist/chunks/usercenter-ja-B2465c1O.js +0 -326
  58. package/dist/chunks/usercenter-ko-xAEYxqLg.js +0 -326
@@ -1,225 +1,88 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import React__default, { forwardRef, useRef, useEffect, useCallback, useImperativeHandle, useMemo, useContext, useState } from "react";
3
- import { createUserApi, ChainType, getTxExplorerUrl, RewardType, parseTitleExpress, UserIdentityType, SnsType, createQuestApi, isUnauthorizedError, ErrorCode, ApiError, createCommonApi, powIcon, contractInteractiveIcon, getSwapDexTitleExpress, EligibilityTemplateId, UserEligibleStatus } from "@taskon/core";
1
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
+ import React__default, { isValidElement, cloneElement, Fragment as Fragment$1, useMemo, useContext, useState, useRef, useCallback, forwardRef, useEffect, useImperativeHandle } from "react";
3
+ import { createUserApi, ChainType, parseTitleExpress, getTxExplorerUrl, RewardType, UserIdentityType, SnsType, createQuestApi, isUnauthorizedError, ErrorCode, ApiError, createCommonApi, powIcon, contractInteractiveIcon, getSwapDexTitleExpress, EligibilityTemplateId, UserEligibleStatus } from "@taskon/core";
4
4
  import { u as useWallet, d as useToast, e as createEthereumAdapterFromProvider } from "./useToast-CaRkylKe.js";
5
- import { k as useIsMobile, l as useChainMap, m as useNftClaim, C as ClaimNftDialog, n as PendingTxDialog, B as BindWalletDialog, R as Root2, o as Trigger, p as Portal, q as Content2, r as Arrow2, s as TipPopover, g as useBindSocialAccount, j as enMessages, a as useTokenAssets, u as useRewardDetails, c as usePointsHistory, L as LoadingState, i as TokenRewardContent, h as PointsList, E as EmptyState, N as NftRewardContent, W as WithdrawForm } from "./UserCenterWidget-cADBSVg7.js";
6
- import { p as TaskOnContext, s as useTaskOnPortalContainer, u as useTaskOnAuth, b as useWidgetLocale } from "./ThemeProvider-CPI_roeh.js";
7
- import { D as Dialog, _ as __variableDynamicImportRuntimeHelper } from "./dynamic-import-helper-DwXlQC0S.js";
8
- import '../EligibilityInfo.css';const successIconUrl = new URL("data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='23'%20cy='23'%20r='23'%20fill='%2331FF90'/%3e%3cpath%20d='M16.4281%2022.8899L20.6446%2027.1063L29.6798%2018.0711'%20stroke='black'%20stroke-width='5'%20stroke-linecap='square'%20stroke-linejoin='round'/%3e%3c/svg%3e", import.meta.url).href;
9
- const warnIconUrl = new URL("data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.9783%200.0225143C10.2876%200.0225143%200%2010.3101%200%2023.0006C0%2035.6903%2010.2876%2045.9776%2022.9783%2045.9776C35.6682%2045.9776%2045.9556%2035.6903%2045.9556%2023.0006C45.9558%2010.3101%2035.6682%200.0225143%2022.9783%200.0225143ZM21.797%209.85031C21.797%209.01328%2022.4783%208.33197%2023.3154%208.33197C24.1524%208.33197%2024.8337%209.01328%2024.8337%209.85031V11.729C24.8337%2012.5662%2024.1524%2013.2475%2023.3154%2013.2475C22.4783%2013.2475%2021.797%2012.5662%2021.797%2011.7292V9.85031ZM12.0443%2023.1095H10.1657C9.32842%2023.1095%208.64717%2022.4282%208.64717%2021.5912C8.64717%2020.7541%209.32842%2020.0729%2010.1657%2020.0729H12.0443C12.8814%2020.0729%2013.5627%2020.7541%2013.5627%2021.5912C13.5627%2022.4282%2012.8819%2023.1095%2012.0443%2023.1095ZM12.6546%2014.9563C12.368%2014.6697%2012.2098%2014.2882%2012.2098%2013.8823C12.2098%2013.477%2012.3678%2013.0957%2012.6546%2012.8086C12.9411%2012.522%2013.3223%2012.3638%2013.7282%2012.3638C14.134%2012.3638%2014.515%2012.5216%2014.8021%2012.8086L16.1305%2014.137C16.4173%2014.4241%2016.5753%2014.8054%2016.5753%2015.2107C16.5753%2015.6165%2016.4171%2015.9976%2016.1305%2016.2847C15.843%2016.5715%2015.4617%2016.7295%2015.0565%2016.7295C14.6511%2016.7295%2014.2698%2016.5715%2013.9828%2016.2847L12.6546%2014.9563ZM24.2545%2039.3233H22.3764C21.5389%2039.3233%2020.8574%2038.642%2020.8574%2037.8045C20.8574%2036.9674%2021.5389%2036.2861%2022.3764%2036.2861H24.2545C25.0916%2036.2861%2025.7731%2036.9674%2025.7731%2037.8045C25.7732%2038.6421%2025.0916%2039.3233%2024.2545%2039.3233ZM26.1334%2035.8432H20.4976C19.6603%2035.8432%2018.9792%2035.1622%2018.9792%2034.3253C18.9792%2033.4875%2019.6603%2032.8063%2020.4976%2032.8063H26.133C26.9701%2032.8063%2027.6513%2033.4878%2027.6513%2034.3253C27.6518%2035.1624%2026.9705%2035.8432%2026.1334%2035.8432ZM23.3154%2032.033C18.335%2032.033%2014.2826%2027.9809%2014.2826%2023C14.2826%2018.0196%2018.3345%2013.9671%2023.3154%2013.9671C28.2958%2013.9671%2032.3478%2018.0191%2032.3478%2023C32.3478%2027.9809%2028.2958%2032.033%2023.3154%2032.033ZM31.574%2016.7295C31.1682%2016.7295%2030.7867%2016.5713%2030.5%2016.2843C29.9086%2015.6924%2029.9086%2014.7293%2030.5%2014.1374L31.8288%2012.8086C32.1155%2012.522%2032.4972%2012.364%2032.9026%2012.364C33.3082%2012.364%2033.6895%2012.522%2033.9762%2012.8084C34.568%2013.4009%2034.5676%2014.364%2033.9762%2014.9559L32.6478%2016.2843C32.3613%2016.5715%2031.98%2016.7295%2031.574%2016.7295ZM36.4652%2023.1095H34.5862C33.7491%2023.1095%2033.0678%2022.4282%2033.0678%2021.5912C33.0678%2020.7541%2033.7491%2020.0729%2034.5862%2020.0729H36.4652C37.3025%2020.0729%2037.9835%2020.7541%2037.9835%2021.5912C37.9836%2022.4282%2037.3025%2023.1095%2036.4652%2023.1095Z'%20fill='%23F89D35'/%3e%3c/svg%3e", import.meta.url).href;
10
- function getNoticeIcon(type) {
11
- if (type === "success") {
12
- return successIconUrl;
13
- }
14
- if (type === "warn") {
15
- return warnIconUrl;
16
- }
17
- return null;
5
+ import { h as useIsMobile, R as Root2, i as Trigger, j as Portal, C as Content2, k as Arrow2, l as useChainMap, m as useNftClaim, n as ClaimNftDialog, o as enMessages$2, p as PendingTxDialog, B as BindWalletDialog, q as TipPopover, a as useBindSocialAccount, u as useUserCenterLocale, c as useTokenAssets, d as useRewardDetails, e as usePointsHistory, L as LoadingState, T as TokenRewardContent, g as PointsList, E as EmptyState, N as NftRewardContent, W as WithdrawForm } from "./UserCenterWidget-D5ttw4hO.js";
6
+ import { v as TaskOnContext, x as useTaskOnPortalContainer, c as useTranslation, e as createLocaleLoader, u as useTaskOnAuth } from "./ThemeProvider-mXLdLSkq.js";
7
+ import { D as Dialog } from "./WidgetShell-D7yC894Y.js";
8
+ import '../EligibilityInfo.css';const SLOT_TOKEN_PREFIX = "__TASKON_I18NT_SLOT_";
9
+ const SLOT_TOKEN_SUFFIX = "__";
10
+ const SLOT_TOKEN_REGEXP = /__TASKON_I18NT_SLOT_([A-Za-z0-9_]+)__/g;
11
+ function createSlotToken(name2) {
12
+ return `${SLOT_TOKEN_PREFIX}${name2}${SLOT_TOKEN_SUFFIX}`;
18
13
  }
19
- function ConfirmNoticeDialog({
20
- open,
21
- onOpenChange,
22
- type = "default",
23
- title,
24
- desc,
25
- col = false,
26
- cancelButton,
27
- confirmButton,
28
- onCancel,
29
- onConfirm,
30
- onClose,
31
- closeOnCancel = true,
32
- closeOnConfirm = true,
33
- cancelDisabled = false,
34
- confirmDisabled = false,
35
- showCloseButton = false,
36
- closeOnOverlayClick = true,
37
- closeOnEscapeKey = true,
38
- maxWidth = 470,
39
- className,
40
- contentClassName,
41
- children,
42
- actions,
43
- footer,
44
- accessibilityTitle,
45
- accessibilityDescription
46
- }) {
47
- const noticeIcon = getNoticeIcon(type);
48
- const shouldRenderDefaultActions = !actions && Boolean(cancelButton || confirmButton);
49
- const closeDialog = React__default.useCallback(() => {
50
- onOpenChange(false);
51
- onClose == null ? void 0 : onClose();
52
- }, [onOpenChange, onClose]);
53
- const handleOpenChange = React__default.useCallback(
54
- (nextOpen) => {
55
- onOpenChange(nextOpen);
56
- if (!nextOpen) {
57
- onClose == null ? void 0 : onClose();
58
- }
59
- },
60
- [onOpenChange, onClose]
61
- );
62
- const handleCancel = React__default.useCallback(() => {
63
- onCancel == null ? void 0 : onCancel();
64
- if (closeOnCancel) {
65
- closeDialog();
14
+ function renderRichTemplate(template, components, textClassName) {
15
+ const nodes = [];
16
+ let cursor = 0;
17
+ let tokenMatch = SLOT_TOKEN_REGEXP.exec(template);
18
+ let nodeIndex = 0;
19
+ const pushTextNode = (text2) => {
20
+ if (!text2) return;
21
+ if (!textClassName) {
22
+ nodes.push(text2);
23
+ return;
66
24
  }
67
- }, [onCancel, closeOnCancel, closeDialog]);
68
- const handleConfirm = React__default.useCallback(() => {
69
- onConfirm == null ? void 0 : onConfirm();
70
- if (closeOnConfirm) {
71
- closeDialog();
25
+ nodes.push(
26
+ /* @__PURE__ */ jsx("span", { className: textClassName, children: text2 }, `i18nt-text-${nodeIndex}`)
27
+ );
28
+ nodeIndex += 1;
29
+ };
30
+ while (tokenMatch) {
31
+ const tokenStart = tokenMatch.index;
32
+ const tokenText = tokenMatch[0];
33
+ const slotName = tokenMatch[1];
34
+ pushTextNode(template.slice(cursor, tokenStart));
35
+ if (!slotName) {
36
+ cursor = tokenStart + tokenText.length;
37
+ tokenMatch = SLOT_TOKEN_REGEXP.exec(template);
38
+ continue;
72
39
  }
73
- }, [onConfirm, closeOnConfirm, closeDialog]);
74
- const ariaTitle = accessibilityTitle ?? (typeof title === "string" ? title : "Confirm notice");
75
- return /* @__PURE__ */ jsx(
76
- Dialog,
77
- {
78
- open,
79
- onOpenChange: handleOpenChange,
80
- title: ariaTitle,
81
- description: accessibilityDescription,
82
- showCloseButton,
83
- closeOnOverlayClick,
84
- closeOnEscapeKey,
85
- maxWidth,
86
- contentClassName: `taskon-confirm-notice-dialog ${contentClassName || ""}`.trim(),
87
- children: /* @__PURE__ */ jsxs(
88
- "div",
89
- {
90
- className: `taskon-confirm-notice taskon-confirm-notice--${type} ${className || ""}`.trim(),
91
- children: [
92
- noticeIcon && /* @__PURE__ */ jsx(
93
- "img",
94
- {
95
- className: "taskon-confirm-notice-icon",
96
- src: noticeIcon,
97
- alt: ""
98
- }
99
- ),
100
- title && /* @__PURE__ */ jsx("h3", { className: "taskon-confirm-notice-title", children: title }),
101
- desc && /* @__PURE__ */ jsx("p", { className: "taskon-confirm-notice-desc", children: desc }),
102
- children,
103
- (actions || shouldRenderDefaultActions) && /* @__PURE__ */ jsx(
104
- "div",
105
- {
106
- className: `taskon-confirm-notice-buttons ${col ? "taskon-confirm-notice-buttons--col" : ""}`.trim(),
107
- children: actions || /* @__PURE__ */ jsxs(Fragment, { children: [
108
- cancelButton && /* @__PURE__ */ jsx(
109
- "button",
110
- {
111
- type: "button",
112
- className: "taskon-confirm-notice-button taskon-confirm-notice-button--cancel",
113
- onClick: handleCancel,
114
- disabled: cancelDisabled,
115
- children: cancelButton
116
- }
117
- ),
118
- confirmButton && /* @__PURE__ */ jsx(
119
- "button",
120
- {
121
- type: "button",
122
- className: "taskon-confirm-notice-button taskon-confirm-notice-button--confirm",
123
- onClick: handleConfirm,
124
- disabled: confirmDisabled,
125
- children: confirmButton
126
- }
127
- )
128
- ] })
129
- }
130
- ),
131
- footer
132
- ]
133
- }
134
- )
40
+ const slotNode = components[slotName];
41
+ if (slotNode !== void 0 && slotNode !== null) {
42
+ if (isValidElement(slotNode)) {
43
+ nodes.push(cloneElement(slotNode, { key: `i18nt-slot-${nodeIndex}` }));
44
+ } else {
45
+ nodes.push(
46
+ /* @__PURE__ */ jsx(Fragment$1, { children: slotNode }, `i18nt-slot-${nodeIndex}`)
47
+ );
48
+ }
49
+ nodeIndex += 1;
135
50
  }
136
- );
51
+ cursor = tokenStart + tokenText.length;
52
+ tokenMatch = SLOT_TOKEN_REGEXP.exec(template);
53
+ }
54
+ pushTextNode(template.slice(cursor));
55
+ return nodes;
137
56
  }
138
- const Textarea = forwardRef(
139
- function Textarea2({
140
- value: value2,
141
- onChange,
142
- maxLength,
143
- showCount = false,
144
- disabled = false,
145
- placeholder,
146
- hasError = false,
147
- className,
148
- rows,
149
- autoFocus = false
150
- }, ref) {
151
- const textareaRef = useRef(null);
152
- useEffect(() => {
153
- var _a;
154
- if (autoFocus) {
155
- (_a = textareaRef.current) == null ? void 0 : _a.focus();
156
- }
157
- }, [autoFocus]);
158
- const focus = useCallback(() => {
159
- var _a;
160
- (_a = textareaRef.current) == null ? void 0 : _a.focus();
161
- }, []);
162
- const focusAtStart = useCallback(() => {
163
- var _a;
164
- const el = textareaRef.current;
165
- if (el) {
166
- el.focus();
167
- (_a = el.setSelectionRange) == null ? void 0 : _a.call(el, 0, 0);
168
- el.scrollTop = 0;
169
- }
170
- }, []);
171
- const moveCursorToStart = useCallback(() => {
172
- var _a;
173
- const el = textareaRef.current;
174
- if (el) {
175
- (_a = el.setSelectionRange) == null ? void 0 : _a.call(el, 0, 0);
176
- el.scrollTop = 0;
177
- }
178
- }, []);
179
- const getElement = useCallback(() => {
180
- return textareaRef.current;
181
- }, []);
182
- useImperativeHandle(
183
- ref,
184
- () => ({
185
- focus,
186
- focusAtStart,
187
- moveCursorToStart,
188
- getElement
189
- }),
190
- [focus, focusAtStart, moveCursorToStart, getElement]
191
- );
192
- const handleChange = useCallback(
193
- (e) => {
194
- onChange(e.target.value);
195
- },
196
- [onChange]
197
- );
198
- const shouldShowCount = showCount && maxLength !== void 0;
199
- return /* @__PURE__ */ jsxs("div", { className: "taskon-textarea-wrap", children: [
200
- /* @__PURE__ */ jsx(
201
- "textarea",
202
- {
203
- ref: textareaRef,
204
- className: `taskon-textarea ${hasError ? "taskon-textarea--error" : ""} ${className || ""}`,
205
- value: value2,
206
- onChange: handleChange,
207
- maxLength,
208
- disabled,
209
- placeholder,
210
- rows
211
- }
212
- ),
213
- shouldShowCount && /* @__PURE__ */ jsxs("div", { className: "taskon-textarea-count", children: [
214
- /* @__PURE__ */ jsx("span", { className: "taskon-textarea-count-current", children: value2.length }),
215
- /* @__PURE__ */ jsxs("span", { children: [
216
- "/",
217
- maxLength
218
- ] })
219
- ] })
220
- ] });
57
+ function I18nT({
58
+ t,
59
+ i18nKey,
60
+ values,
61
+ components,
62
+ textClassName,
63
+ as: Wrapper,
64
+ className
65
+ }) {
66
+ const slotValues = {
67
+ ...values || {}
68
+ };
69
+ if (components) {
70
+ Object.keys(components).forEach((name2) => {
71
+ slotValues[name2] = createSlotToken(name2);
72
+ });
221
73
  }
222
- );
74
+ const translated = t(i18nKey, slotValues);
75
+ const hasRichSlots = !!components && Object.keys(components).length > 0;
76
+ const content2 = hasRichSlots ? renderRichTemplate(translated, components, textClassName) : textClassName ? /* @__PURE__ */ jsx("span", { className: textClassName, children: translated }) : translated;
77
+ if (!Wrapper) {
78
+ return /* @__PURE__ */ jsx(Fragment, { children: content2 });
79
+ }
80
+ const WrapperElement = Wrapper;
81
+ if (className) {
82
+ return /* @__PURE__ */ jsx(WrapperElement, { className, children: content2 });
83
+ }
84
+ return /* @__PURE__ */ jsx(WrapperElement, { children: content2 });
85
+ }
223
86
  function detectEthereumProvider() {
224
87
  if (typeof window === "undefined") return false;
225
88
  return Boolean(window.ethereum);
@@ -511,253 +374,221 @@ function useBindWallet({
511
374
  hasAdapter
512
375
  };
513
376
  }
514
- function isNftRewardType(type) {
515
- return type === RewardType.Nft || type === RewardType.BMintedNft || type === RewardType.Cap;
516
- }
517
- function buildFallbackLayer(reward) {
518
- return {
519
- winner_index: 0,
520
- layer_no: 0,
521
- reward: [reward]
522
- };
377
+ const successIconUrl = new URL("data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='23'%20cy='23'%20r='23'%20fill='%2331FF90'/%3e%3cpath%20d='M16.4281%2022.8899L20.6446%2027.1063L29.6798%2018.0711'%20stroke='black'%20stroke-width='5'%20stroke-linecap='square'%20stroke-linejoin='round'/%3e%3c/svg%3e", import.meta.url).href;
378
+ const warnIconUrl = new URL("data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.9783%200.0225143C10.2876%200.0225143%200%2010.3101%200%2023.0006C0%2035.6903%2010.2876%2045.9776%2022.9783%2045.9776C35.6682%2045.9776%2045.9556%2035.6903%2045.9556%2023.0006C45.9558%2010.3101%2035.6682%200.0225143%2022.9783%200.0225143ZM21.797%209.85031C21.797%209.01328%2022.4783%208.33197%2023.3154%208.33197C24.1524%208.33197%2024.8337%209.01328%2024.8337%209.85031V11.729C24.8337%2012.5662%2024.1524%2013.2475%2023.3154%2013.2475C22.4783%2013.2475%2021.797%2012.5662%2021.797%2011.7292V9.85031ZM12.0443%2023.1095H10.1657C9.32842%2023.1095%208.64717%2022.4282%208.64717%2021.5912C8.64717%2020.7541%209.32842%2020.0729%2010.1657%2020.0729H12.0443C12.8814%2020.0729%2013.5627%2020.7541%2013.5627%2021.5912C13.5627%2022.4282%2012.8819%2023.1095%2012.0443%2023.1095ZM12.6546%2014.9563C12.368%2014.6697%2012.2098%2014.2882%2012.2098%2013.8823C12.2098%2013.477%2012.3678%2013.0957%2012.6546%2012.8086C12.9411%2012.522%2013.3223%2012.3638%2013.7282%2012.3638C14.134%2012.3638%2014.515%2012.5216%2014.8021%2012.8086L16.1305%2014.137C16.4173%2014.4241%2016.5753%2014.8054%2016.5753%2015.2107C16.5753%2015.6165%2016.4171%2015.9976%2016.1305%2016.2847C15.843%2016.5715%2015.4617%2016.7295%2015.0565%2016.7295C14.6511%2016.7295%2014.2698%2016.5715%2013.9828%2016.2847L12.6546%2014.9563ZM24.2545%2039.3233H22.3764C21.5389%2039.3233%2020.8574%2038.642%2020.8574%2037.8045C20.8574%2036.9674%2021.5389%2036.2861%2022.3764%2036.2861H24.2545C25.0916%2036.2861%2025.7731%2036.9674%2025.7731%2037.8045C25.7732%2038.6421%2025.0916%2039.3233%2024.2545%2039.3233ZM26.1334%2035.8432H20.4976C19.6603%2035.8432%2018.9792%2035.1622%2018.9792%2034.3253C18.9792%2033.4875%2019.6603%2032.8063%2020.4976%2032.8063H26.133C26.9701%2032.8063%2027.6513%2033.4878%2027.6513%2034.3253C27.6518%2035.1624%2026.9705%2035.8432%2026.1334%2035.8432ZM23.3154%2032.033C18.335%2032.033%2014.2826%2027.9809%2014.2826%2023C14.2826%2018.0196%2018.3345%2013.9671%2023.3154%2013.9671C28.2958%2013.9671%2032.3478%2018.0191%2032.3478%2023C32.3478%2027.9809%2028.2958%2032.033%2023.3154%2032.033ZM31.574%2016.7295C31.1682%2016.7295%2030.7867%2016.5713%2030.5%2016.2843C29.9086%2015.6924%2029.9086%2014.7293%2030.5%2014.1374L31.8288%2012.8086C32.1155%2012.522%2032.4972%2012.364%2032.9026%2012.364C33.3082%2012.364%2033.6895%2012.522%2033.9762%2012.8084C34.568%2013.4009%2034.5676%2014.364%2033.9762%2014.9559L32.6478%2016.2843C32.3613%2016.5715%2031.98%2016.7295%2031.574%2016.7295ZM36.4652%2023.1095H34.5862C33.7491%2023.1095%2033.0678%2022.4282%2033.0678%2021.5912C33.0678%2020.7541%2033.7491%2020.0729%2034.5862%2020.0729H36.4652C37.3025%2020.0729%2037.9835%2020.7541%2037.9835%2021.5912C37.9836%2022.4282%2037.3025%2023.1095%2036.4652%2023.1095Z'%20fill='%23F89D35'/%3e%3c/svg%3e", import.meta.url).href;
379
+ function getNoticeIcon(type) {
380
+ if (type === "success") {
381
+ return successIconUrl;
382
+ }
383
+ if (type === "warn") {
384
+ return warnIconUrl;
385
+ }
386
+ return null;
523
387
  }
524
- function useNftClaimFlow(options) {
525
- const {
526
- campaignId,
527
- targetType,
528
- onClaimSuccess,
529
- onClaimError,
530
- onWalletError,
531
- messages
532
- } = options;
533
- const { toast } = useToast();
534
- const { chainMap } = useChainMap();
535
- const [isClaimDialogOpen, setIsClaimDialogOpen] = useState(false);
536
- const [isWalletDialogOpen, setIsWalletDialogOpen] = useState(false);
537
- const [isPendingDialogOpen, setIsPendingDialogOpen] = useState(false);
538
- const [pendingTxDialogState, setPendingTxDialogState] = useState(null);
539
- const [pendingWalletClaimTarget, setPendingWalletClaimTarget] = useState(null);
540
- const pendingDecisionResolverRef = useRef(null);
541
- const resolvePendingDecision = useCallback((claimAgain) => {
542
- const resolver = pendingDecisionResolverRef.current;
543
- if (resolver) {
544
- pendingDecisionResolverRef.current = null;
545
- resolver(claimAgain);
546
- }
547
- }, []);
548
- useEffect(() => {
549
- return () => {
550
- resolvePendingDecision(false);
551
- };
552
- }, [resolvePendingDecision]);
553
- const {
554
- status: claimStatus,
555
- error: claimError,
556
- txHash: claimTxHash,
557
- claimingNft,
558
- claimNft,
559
- reset: resetClaim
560
- } = useNftClaim({
561
- onSuccess: (txHash, item) => {
562
- void (onClaimSuccess == null ? void 0 : onClaimSuccess(txHash, item.sourceReward, item.sourceLayer));
563
- },
564
- onError: (error, item) => {
565
- void (onClaimError == null ? void 0 : onClaimError(error, item.sourceReward, item.sourceLayer));
566
- },
567
- onPendingFound: async (pendingKey, txHash, chainName, item) => {
568
- const rewardValue = item.reward_value;
569
- const receiveAddress = typeof rewardValue.receiver_address === "string" ? rewardValue.receiver_address : void 0;
570
- resolvePendingDecision(false);
571
- setIsClaimDialogOpen(false);
572
- setPendingTxDialogState({
573
- pendingKey,
574
- txHash,
575
- chainName,
576
- receiveAddress
577
- });
578
- setIsPendingDialogOpen(true);
579
- return new Promise((resolve) => {
580
- pendingDecisionResolverRef.current = resolve;
581
- });
388
+ function ConfirmNoticeDialog({
389
+ open: open2,
390
+ onOpenChange,
391
+ type = "default",
392
+ title,
393
+ desc,
394
+ col = false,
395
+ cancelButton,
396
+ confirmButton,
397
+ onCancel,
398
+ onConfirm,
399
+ onClose,
400
+ closeOnCancel = true,
401
+ closeOnConfirm = true,
402
+ cancelDisabled = false,
403
+ confirmDisabled = false,
404
+ showCloseButton = false,
405
+ closeOnOverlayClick = true,
406
+ closeOnEscapeKey = true,
407
+ maxWidth = 470,
408
+ className,
409
+ contentClassName,
410
+ children,
411
+ actions,
412
+ footer,
413
+ accessibilityTitle,
414
+ accessibilityDescription
415
+ }) {
416
+ const noticeIcon = getNoticeIcon(type);
417
+ const shouldRenderDefaultActions = !actions && Boolean(cancelButton || confirmButton);
418
+ const closeDialog = React__default.useCallback(() => {
419
+ onOpenChange(false);
420
+ onClose == null ? void 0 : onClose();
421
+ }, [onOpenChange, onClose]);
422
+ const handleOpenChange = React__default.useCallback(
423
+ (nextOpen) => {
424
+ onOpenChange(nextOpen);
425
+ if (!nextOpen) {
426
+ onClose == null ? void 0 : onClose();
427
+ }
582
428
  },
583
- onNeedWalletDialog: () => {
584
- setIsClaimDialogOpen(false);
585
- setIsWalletDialogOpen(true);
586
- }
587
- });
588
- const claimExplorerUrl = useMemo(() => {
589
- if (!claimTxHash || !claimingNft) {
590
- return void 0;
591
- }
592
- const chainInfo = chainMap[claimingNft.chainName.toLowerCase()];
593
- if (!chainInfo) {
594
- return void 0;
429
+ [onOpenChange, onClose]
430
+ );
431
+ const handleCancel = React__default.useCallback(() => {
432
+ onCancel == null ? void 0 : onCancel();
433
+ if (closeOnCancel) {
434
+ closeDialog();
595
435
  }
596
- return getTxExplorerUrl(chainInfo, claimTxHash);
597
- }, [claimTxHash, claimingNft, chainMap]);
598
- const pendingExplorerUrl = useMemo(() => {
599
- if (!(pendingTxDialogState == null ? void 0 : pendingTxDialogState.txHash)) {
600
- return void 0;
436
+ }, [onCancel, closeOnCancel, closeDialog]);
437
+ const handleConfirm = React__default.useCallback(() => {
438
+ onConfirm == null ? void 0 : onConfirm();
439
+ if (closeOnConfirm) {
440
+ closeDialog();
601
441
  }
602
- const chainInfo = chainMap[pendingTxDialogState.chainName.toLowerCase()];
603
- if (!chainInfo) {
604
- return void 0;
442
+ }, [onConfirm, closeOnConfirm, closeDialog]);
443
+ const ariaTitle = accessibilityTitle ?? (typeof title === "string" ? title : "Confirm notice");
444
+ return /* @__PURE__ */ jsx(
445
+ Dialog,
446
+ {
447
+ open: open2,
448
+ onOpenChange: handleOpenChange,
449
+ title: ariaTitle,
450
+ description: accessibilityDescription,
451
+ showCloseButton,
452
+ closeOnOverlayClick,
453
+ closeOnEscapeKey,
454
+ maxWidth,
455
+ contentClassName: `taskon-confirm-notice-dialog ${contentClassName || ""}`.trim(),
456
+ children: /* @__PURE__ */ jsxs(
457
+ "div",
458
+ {
459
+ className: `taskon-confirm-notice taskon-confirm-notice--${type} ${className || ""}`.trim(),
460
+ children: [
461
+ noticeIcon && /* @__PURE__ */ jsx(
462
+ "img",
463
+ {
464
+ className: "taskon-confirm-notice-icon",
465
+ src: noticeIcon,
466
+ alt: ""
467
+ }
468
+ ),
469
+ title && /* @__PURE__ */ jsx("h3", { className: "taskon-confirm-notice-title", children: title }),
470
+ desc && /* @__PURE__ */ jsx("p", { className: "taskon-confirm-notice-desc", children: desc }),
471
+ children,
472
+ (actions || shouldRenderDefaultActions) && /* @__PURE__ */ jsx(
473
+ "div",
474
+ {
475
+ className: `taskon-confirm-notice-buttons ${col ? "taskon-confirm-notice-buttons--col" : ""}`.trim(),
476
+ children: actions || /* @__PURE__ */ jsxs(Fragment, { children: [
477
+ cancelButton && /* @__PURE__ */ jsx(
478
+ "button",
479
+ {
480
+ type: "button",
481
+ className: "taskon-confirm-notice-button taskon-confirm-notice-button--cancel",
482
+ onClick: handleCancel,
483
+ disabled: cancelDisabled,
484
+ children: cancelButton
485
+ }
486
+ ),
487
+ confirmButton && /* @__PURE__ */ jsx(
488
+ "button",
489
+ {
490
+ type: "button",
491
+ className: "taskon-confirm-notice-button taskon-confirm-notice-button--confirm",
492
+ onClick: handleConfirm,
493
+ disabled: confirmDisabled,
494
+ children: confirmButton
495
+ }
496
+ )
497
+ ] })
498
+ }
499
+ ),
500
+ footer
501
+ ]
502
+ }
503
+ )
605
504
  }
606
- return getTxExplorerUrl(chainInfo, pendingTxDialogState.txHash);
607
- }, [pendingTxDialogState, chainMap]);
608
- const claimNftReward = useCallback(
609
- async (reward, layer) => {
610
- if (!isNftRewardType(reward.reward_type)) {
611
- return;
612
- }
613
- const targetLayer = layer ?? buildFallbackLayer(reward);
614
- const target = {
615
- campaign_id: campaignId,
616
- target_type: targetType,
617
- reward_type: reward.reward_type,
618
- reward_value: reward.reward_value,
619
- reward_id: reward.reward_id,
620
- sourceReward: reward,
621
- sourceLayer: targetLayer
622
- };
623
- setPendingWalletClaimTarget(target);
624
- setIsClaimDialogOpen(true);
625
- await claimNft(target);
626
- },
627
- [campaignId, targetType, claimNft]
628
505
  );
629
- const isSupportedNftRewardType = useCallback((rewardType) => {
630
- return isNftRewardType(rewardType);
631
- }, []);
632
- const handleWalletConnect = useCallback(
633
- async (address, provider) => {
634
- const target = pendingWalletClaimTarget ?? (claimingNft == null ? void 0 : claimingNft.item);
635
- if (!target) {
636
- throw new Error("No pending NFT claim target found");
506
+ }
507
+ const Textarea = forwardRef(
508
+ function Textarea2({
509
+ value: value2,
510
+ onChange,
511
+ maxLength,
512
+ showCount = false,
513
+ disabled = false,
514
+ placeholder,
515
+ hasError = false,
516
+ className,
517
+ rows,
518
+ autoFocus = false
519
+ }, ref) {
520
+ const textareaRef = useRef(null);
521
+ useEffect(() => {
522
+ var _a;
523
+ if (autoFocus) {
524
+ (_a = textareaRef.current) == null ? void 0 : _a.focus();
637
525
  }
638
- if (!provider || typeof provider.request !== "function") {
639
- throw new Error("Invalid wallet provider");
526
+ }, [autoFocus]);
527
+ const focus = useCallback(() => {
528
+ var _a;
529
+ (_a = textareaRef.current) == null ? void 0 : _a.focus();
530
+ }, []);
531
+ const focusAtStart = useCallback(() => {
532
+ var _a;
533
+ const el = textareaRef.current;
534
+ if (el) {
535
+ el.focus();
536
+ (_a = el.setSelectionRange) == null ? void 0 : _a.call(el, 0, 0);
537
+ el.scrollTop = 0;
640
538
  }
641
- const popupAdapter = createEthereumAdapterFromProvider(
642
- provider,
643
- {
644
- address
645
- }
646
- );
647
- setIsWalletDialogOpen(false);
648
- setIsClaimDialogOpen(true);
649
- await claimNft(target, popupAdapter);
650
- },
651
- [pendingWalletClaimTarget, claimingNft, claimNft]
652
- );
653
- const handleWalletError = useCallback(
654
- (errorMessage) => {
655
- onWalletError == null ? void 0 : onWalletError(errorMessage);
656
- if (!onWalletError) {
657
- toast.error(errorMessage);
539
+ }, []);
540
+ const moveCursorToStart = useCallback(() => {
541
+ var _a;
542
+ const el = textareaRef.current;
543
+ if (el) {
544
+ (_a = el.setSelectionRange) == null ? void 0 : _a.call(el, 0, 0);
545
+ el.scrollTop = 0;
658
546
  }
659
- },
660
- [onWalletError, toast]
661
- );
662
- const handlePendingContinueWaiting = useCallback(() => {
663
- setIsPendingDialogOpen(false);
664
- setPendingTxDialogState(null);
665
- setPendingWalletClaimTarget(null);
666
- resetClaim();
667
- resolvePendingDecision(false);
668
- }, [resetClaim, resolvePendingDecision]);
669
- const handlePendingClaimAgain = useCallback(() => {
670
- setIsPendingDialogOpen(false);
671
- setPendingTxDialogState(null);
672
- setIsClaimDialogOpen(true);
673
- resolvePendingDecision(true);
674
- }, [resolvePendingDecision]);
675
- const handleCloseClaimDialog = useCallback(() => {
676
- setIsClaimDialogOpen(false);
677
- setTimeout(() => {
678
- resetClaim();
679
- setPendingWalletClaimTarget(null);
680
- }, 200);
681
- }, [resetClaim]);
682
- const handleRetryClaim = useCallback(() => {
683
- if (!claimingNft) {
684
- return;
685
- }
686
- resetClaim();
687
- setPendingWalletClaimTarget(claimingNft.item);
688
- void claimNft(claimingNft.item);
689
- }, [claimingNft, resetClaim, claimNft]);
690
- const isClaiming = useMemo(() => {
691
- return ["checking", "connecting", "switching", "signing", "confirming", "pending"].includes(
692
- claimStatus
547
+ }, []);
548
+ const getElement = useCallback(() => {
549
+ return textareaRef.current;
550
+ }, []);
551
+ useImperativeHandle(
552
+ ref,
553
+ () => ({
554
+ focus,
555
+ focusAtStart,
556
+ moveCursorToStart,
557
+ getElement
558
+ }),
559
+ [focus, focusAtStart, moveCursorToStart, getElement]
693
560
  );
694
- }, [claimStatus]);
695
- const dialogs = useMemo(() => {
696
- return /* @__PURE__ */ jsxs(Fragment, { children: [
697
- /* @__PURE__ */ jsx(
698
- ClaimNftDialog,
699
- {
700
- open: isClaimDialogOpen,
701
- onClose: handleCloseClaimDialog,
702
- status: claimStatus,
703
- error: claimError,
704
- txHash: claimTxHash,
705
- claimingNft,
706
- explorerUrl: claimExplorerUrl,
707
- messages: messages == null ? void 0 : messages.claimDialog,
708
- onRetry: handleRetryClaim
709
- }
710
- ),
561
+ const handleChange = useCallback(
562
+ (e) => {
563
+ onChange(e.target.value);
564
+ },
565
+ [onChange]
566
+ );
567
+ const shouldShowCount = showCount && maxLength !== void 0;
568
+ return /* @__PURE__ */ jsxs("div", { className: "taskon-textarea-wrap", children: [
711
569
  /* @__PURE__ */ jsx(
712
- PendingTxDialog,
570
+ "textarea",
713
571
  {
714
- open: isPendingDialogOpen,
715
- onClose: handlePendingContinueWaiting,
716
- onClaimAgain: handlePendingClaimAgain,
717
- onContinueWaiting: handlePendingContinueWaiting,
718
- txHash: pendingTxDialogState == null ? void 0 : pendingTxDialogState.txHash,
719
- explorerUrl: pendingExplorerUrl,
720
- receiveAddress: pendingTxDialogState == null ? void 0 : pendingTxDialogState.receiveAddress,
721
- messages: messages == null ? void 0 : messages.pendingDialog
572
+ ref: textareaRef,
573
+ className: `taskon-textarea ${hasError ? "taskon-textarea--error" : ""} ${className || ""}`,
574
+ value: value2,
575
+ onChange: handleChange,
576
+ maxLength,
577
+ disabled,
578
+ placeholder,
579
+ rows
722
580
  }
723
581
  ),
724
- /* @__PURE__ */ jsx(
725
- BindWalletDialog,
726
- {
727
- open: isWalletDialogOpen,
728
- onOpenChange: setIsWalletDialogOpen,
729
- onConnect: handleWalletConnect,
730
- onError: handleWalletError
731
- }
732
- )
582
+ shouldShowCount && /* @__PURE__ */ jsxs("div", { className: "taskon-textarea-count", children: [
583
+ /* @__PURE__ */ jsx("span", { className: "taskon-textarea-count-current", children: value2.length }),
584
+ /* @__PURE__ */ jsxs("span", { children: [
585
+ "/",
586
+ maxLength
587
+ ] })
588
+ ] })
733
589
  ] });
734
- }, [
735
- isClaimDialogOpen,
736
- handleCloseClaimDialog,
737
- claimStatus,
738
- claimError,
739
- claimTxHash,
740
- claimingNft,
741
- claimExplorerUrl,
742
- messages,
743
- handleRetryClaim,
744
- isPendingDialogOpen,
745
- handlePendingContinueWaiting,
746
- handlePendingClaimAgain,
747
- pendingTxDialogState,
748
- pendingExplorerUrl,
749
- isWalletDialogOpen,
750
- handleWalletConnect,
751
- handleWalletError
752
- ]);
753
- return {
754
- claimNftReward,
755
- isSupportedNftRewardType,
756
- dialogs,
757
- claimingNft,
758
- isClaiming
759
- };
760
- }
590
+ }
591
+ );
761
592
  async function copyToClipboard(text2) {
762
593
  try {
763
594
  if (navigator.clipboard && navigator.clipboard.writeText) {
@@ -783,8 +614,8 @@ function CopyableText({
783
614
  copyText
784
615
  }) {
785
616
  const portalContainer = useTaskOnPortalContainer();
786
- const [copied, setCopied] = useState(false);
787
- const [open, setOpen] = useState(false);
617
+ const [copied2, setCopied] = useState(false);
618
+ const [open2, setOpen] = useState(false);
788
619
  const closeTimerRef = useRef(null);
789
620
  const clearCloseTimer = useCallback(() => {
790
621
  if (closeTimerRef.current) {
@@ -817,7 +648,7 @@ function CopyableText({
817
648
  },
818
649
  [copyText]
819
650
  );
820
- return /* @__PURE__ */ jsxs(Root2, { open, onOpenChange: setOpen, children: [
651
+ return /* @__PURE__ */ jsxs(Root2, { open: open2, onOpenChange: setOpen, children: [
821
652
  /* @__PURE__ */ jsx(Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
822
653
  "span",
823
654
  {
@@ -837,7 +668,7 @@ function CopyableText({
837
668
  onMouseLeave: handleMouseLeave,
838
669
  onClick: handleCopy,
839
670
  children: [
840
- copied ? /* @__PURE__ */ jsxs(Fragment, { children: [
671
+ copied2 ? /* @__PURE__ */ jsxs(Fragment, { children: [
841
672
  /* @__PURE__ */ jsx(CopiedIcon, {}),
842
673
  /* @__PURE__ */ jsx("span", { children: "COPIED" })
843
674
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -2067,6 +1898,286 @@ function CardDescExpress({
2067
1898
  }
2068
1899
  );
2069
1900
  }
1901
+ const DEFAULT_CLAIM_DIALOG_MESSAGES = {
1902
+ claimNft: enMessages$2.claim_nft,
1903
+ claimingNft: enMessages$2.claiming_nft,
1904
+ claimConnectingWallet: enMessages$2.claim_connecting_wallet,
1905
+ claimSwitchingNetwork: enMessages$2.claim_switching_network,
1906
+ claimGettingSignature: enMessages$2.claim_getting_signature,
1907
+ claimConfirmInWallet: enMessages$2.claim_confirm_in_wallet,
1908
+ claimTransactionPending: enMessages$2.claim_transaction_pending,
1909
+ claimSuccess: enMessages$2.claim_success,
1910
+ claimFailed: enMessages$2.claim_failed,
1911
+ claimCanceled: enMessages$2.claim_canceled,
1912
+ viewOnExplorer: enMessages$2.view_on_explorer,
1913
+ retry: enMessages$2.retry,
1914
+ close: enMessages$2.close
1915
+ };
1916
+ const DEFAULT_PENDING_DIALOG_MESSAGES = {
1917
+ pendingTransaction: enMessages$2.pending_transaction,
1918
+ claimPendingTitle: enMessages$2.claim_pending_title,
1919
+ claimPendingCheckExplorer: enMessages$2.claim_pending_check_explorer,
1920
+ claimPendingHashLabel: enMessages$2.claim_pending_hash_label,
1921
+ claimPendingClaimAgainWarn: enMessages$2.claim_pending_claim_again_warn,
1922
+ claimPendingReceiveAddressNoChange: enMessages$2.claim_pending_receive_address_no_change,
1923
+ claimAgain: enMessages$2.claim_again,
1924
+ continueWaiting: enMessages$2.continue_waiting
1925
+ };
1926
+ function isNftRewardType(type) {
1927
+ return type === RewardType.Nft || type === RewardType.BMintedNft || type === RewardType.Cap;
1928
+ }
1929
+ function buildFallbackLayer(reward2) {
1930
+ return {
1931
+ winner_index: 0,
1932
+ layer_no: 0,
1933
+ reward: [reward2]
1934
+ };
1935
+ }
1936
+ function useNftClaimFlow(options) {
1937
+ const {
1938
+ campaignId,
1939
+ targetType,
1940
+ onClaimSuccess,
1941
+ onClaimError,
1942
+ onWalletError,
1943
+ messages
1944
+ } = options;
1945
+ const { toast } = useToast();
1946
+ const { chainMap } = useChainMap();
1947
+ const [isClaimDialogOpen, setIsClaimDialogOpen] = useState(false);
1948
+ const [isWalletDialogOpen, setIsWalletDialogOpen] = useState(false);
1949
+ const [isPendingDialogOpen, setIsPendingDialogOpen] = useState(false);
1950
+ const [pendingTxDialogState, setPendingTxDialogState] = useState(null);
1951
+ const [pendingWalletClaimTarget, setPendingWalletClaimTarget] = useState(null);
1952
+ const pendingDecisionResolverRef = useRef(null);
1953
+ const resolvePendingDecision = useCallback((claimAgain) => {
1954
+ const resolver = pendingDecisionResolverRef.current;
1955
+ if (resolver) {
1956
+ pendingDecisionResolverRef.current = null;
1957
+ resolver(claimAgain);
1958
+ }
1959
+ }, []);
1960
+ useEffect(() => {
1961
+ return () => {
1962
+ resolvePendingDecision(false);
1963
+ };
1964
+ }, [resolvePendingDecision]);
1965
+ const {
1966
+ status: claimStatus,
1967
+ error: claimError,
1968
+ txHash: claimTxHash,
1969
+ claimingNft,
1970
+ claimNft,
1971
+ reset: resetClaim
1972
+ } = useNftClaim({
1973
+ onSuccess: (txHash, item) => {
1974
+ void (onClaimSuccess == null ? void 0 : onClaimSuccess(txHash, item.sourceReward, item.sourceLayer));
1975
+ },
1976
+ onError: (error, item) => {
1977
+ void (onClaimError == null ? void 0 : onClaimError(error, item.sourceReward, item.sourceLayer));
1978
+ },
1979
+ onPendingFound: async (pendingKey, txHash, chainName, item) => {
1980
+ const rewardValue = item.reward_value;
1981
+ const receiveAddress = typeof rewardValue.receiver_address === "string" ? rewardValue.receiver_address : void 0;
1982
+ resolvePendingDecision(false);
1983
+ setIsClaimDialogOpen(false);
1984
+ setPendingTxDialogState({
1985
+ pendingKey,
1986
+ txHash,
1987
+ chainName,
1988
+ receiveAddress
1989
+ });
1990
+ setIsPendingDialogOpen(true);
1991
+ return new Promise((resolve) => {
1992
+ pendingDecisionResolverRef.current = resolve;
1993
+ });
1994
+ },
1995
+ onNeedWalletDialog: () => {
1996
+ setIsClaimDialogOpen(false);
1997
+ setIsWalletDialogOpen(true);
1998
+ }
1999
+ });
2000
+ const claimExplorerUrl = useMemo(() => {
2001
+ if (!claimTxHash || !claimingNft) {
2002
+ return void 0;
2003
+ }
2004
+ const chainInfo = chainMap[claimingNft.chainName.toLowerCase()];
2005
+ if (!chainInfo) {
2006
+ return void 0;
2007
+ }
2008
+ return getTxExplorerUrl(chainInfo, claimTxHash);
2009
+ }, [claimTxHash, claimingNft, chainMap]);
2010
+ const pendingExplorerUrl = useMemo(() => {
2011
+ if (!(pendingTxDialogState == null ? void 0 : pendingTxDialogState.txHash)) {
2012
+ return void 0;
2013
+ }
2014
+ const chainInfo = chainMap[pendingTxDialogState.chainName.toLowerCase()];
2015
+ if (!chainInfo) {
2016
+ return void 0;
2017
+ }
2018
+ return getTxExplorerUrl(chainInfo, pendingTxDialogState.txHash);
2019
+ }, [pendingTxDialogState, chainMap]);
2020
+ const claimNftReward = useCallback(
2021
+ async (reward2, layer) => {
2022
+ if (!isNftRewardType(reward2.reward_type)) {
2023
+ return;
2024
+ }
2025
+ const targetLayer = layer ?? buildFallbackLayer(reward2);
2026
+ const target = {
2027
+ campaign_id: campaignId,
2028
+ target_type: targetType,
2029
+ reward_type: reward2.reward_type,
2030
+ reward_value: reward2.reward_value,
2031
+ reward_id: reward2.reward_id,
2032
+ sourceReward: reward2,
2033
+ sourceLayer: targetLayer
2034
+ };
2035
+ setPendingWalletClaimTarget(target);
2036
+ setIsClaimDialogOpen(true);
2037
+ await claimNft(target);
2038
+ },
2039
+ [campaignId, targetType, claimNft]
2040
+ );
2041
+ const isSupportedNftRewardType = useCallback(
2042
+ (rewardType) => {
2043
+ return isNftRewardType(rewardType);
2044
+ },
2045
+ []
2046
+ );
2047
+ const handleWalletConnect = useCallback(
2048
+ async (address, provider) => {
2049
+ const target = pendingWalletClaimTarget ?? (claimingNft == null ? void 0 : claimingNft.item);
2050
+ if (!target) {
2051
+ throw new Error("No pending NFT claim target found");
2052
+ }
2053
+ if (!provider || typeof provider.request !== "function") {
2054
+ throw new Error("Invalid wallet provider");
2055
+ }
2056
+ const popupAdapter = createEthereumAdapterFromProvider(
2057
+ provider,
2058
+ {
2059
+ address
2060
+ }
2061
+ );
2062
+ setIsWalletDialogOpen(false);
2063
+ setIsClaimDialogOpen(true);
2064
+ await claimNft(target, popupAdapter);
2065
+ },
2066
+ [pendingWalletClaimTarget, claimingNft, claimNft]
2067
+ );
2068
+ const handleWalletError = useCallback(
2069
+ (errorMessage) => {
2070
+ onWalletError == null ? void 0 : onWalletError(errorMessage);
2071
+ if (!onWalletError) {
2072
+ toast.error(errorMessage);
2073
+ }
2074
+ },
2075
+ [onWalletError, toast]
2076
+ );
2077
+ const handlePendingContinueWaiting = useCallback(() => {
2078
+ setIsPendingDialogOpen(false);
2079
+ setPendingTxDialogState(null);
2080
+ setPendingWalletClaimTarget(null);
2081
+ resetClaim();
2082
+ resolvePendingDecision(false);
2083
+ }, [resetClaim, resolvePendingDecision]);
2084
+ const handlePendingClaimAgain = useCallback(() => {
2085
+ setIsPendingDialogOpen(false);
2086
+ setPendingTxDialogState(null);
2087
+ setIsClaimDialogOpen(true);
2088
+ resolvePendingDecision(true);
2089
+ }, [resolvePendingDecision]);
2090
+ const handleCloseClaimDialog = useCallback(() => {
2091
+ setIsClaimDialogOpen(false);
2092
+ setTimeout(() => {
2093
+ resetClaim();
2094
+ setPendingWalletClaimTarget(null);
2095
+ }, 200);
2096
+ }, [resetClaim]);
2097
+ const handleRetryClaim = useCallback(() => {
2098
+ if (!claimingNft) {
2099
+ return;
2100
+ }
2101
+ resetClaim();
2102
+ setPendingWalletClaimTarget(claimingNft.item);
2103
+ void claimNft(claimingNft.item);
2104
+ }, [claimingNft, resetClaim, claimNft]);
2105
+ const isClaiming = useMemo(() => {
2106
+ return [
2107
+ "checking",
2108
+ "connecting",
2109
+ "switching",
2110
+ "signing",
2111
+ "confirming",
2112
+ "pending"
2113
+ ].includes(claimStatus);
2114
+ }, [claimStatus]);
2115
+ const dialogs = useMemo(() => {
2116
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2117
+ /* @__PURE__ */ jsx(
2118
+ ClaimNftDialog,
2119
+ {
2120
+ open: isClaimDialogOpen,
2121
+ onClose: handleCloseClaimDialog,
2122
+ status: claimStatus,
2123
+ error: claimError,
2124
+ txHash: claimTxHash,
2125
+ claimingNft,
2126
+ explorerUrl: claimExplorerUrl,
2127
+ messages: (messages == null ? void 0 : messages.claimDialog) ?? DEFAULT_CLAIM_DIALOG_MESSAGES,
2128
+ onRetry: handleRetryClaim
2129
+ }
2130
+ ),
2131
+ /* @__PURE__ */ jsx(
2132
+ PendingTxDialog,
2133
+ {
2134
+ open: isPendingDialogOpen,
2135
+ onClose: handlePendingContinueWaiting,
2136
+ onClaimAgain: handlePendingClaimAgain,
2137
+ onContinueWaiting: handlePendingContinueWaiting,
2138
+ txHash: pendingTxDialogState == null ? void 0 : pendingTxDialogState.txHash,
2139
+ explorerUrl: pendingExplorerUrl,
2140
+ receiveAddress: pendingTxDialogState == null ? void 0 : pendingTxDialogState.receiveAddress,
2141
+ messages: (messages == null ? void 0 : messages.pendingDialog) ?? DEFAULT_PENDING_DIALOG_MESSAGES
2142
+ }
2143
+ ),
2144
+ /* @__PURE__ */ jsx(
2145
+ BindWalletDialog,
2146
+ {
2147
+ open: isWalletDialogOpen,
2148
+ onOpenChange: setIsWalletDialogOpen,
2149
+ onConnect: handleWalletConnect,
2150
+ onError: handleWalletError
2151
+ }
2152
+ )
2153
+ ] });
2154
+ }, [
2155
+ isClaimDialogOpen,
2156
+ handleCloseClaimDialog,
2157
+ claimStatus,
2158
+ claimError,
2159
+ claimTxHash,
2160
+ claimingNft,
2161
+ claimExplorerUrl,
2162
+ messages,
2163
+ handleRetryClaim,
2164
+ isPendingDialogOpen,
2165
+ handlePendingContinueWaiting,
2166
+ handlePendingClaimAgain,
2167
+ pendingTxDialogState,
2168
+ pendingExplorerUrl,
2169
+ isWalletDialogOpen,
2170
+ handleWalletConnect,
2171
+ handleWalletError
2172
+ ]);
2173
+ return {
2174
+ claimNftReward,
2175
+ isSupportedNftRewardType,
2176
+ dialogs,
2177
+ claimingNft,
2178
+ isClaiming
2179
+ };
2180
+ }
2070
2181
  const twitterIconUrl = new URL("data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='25'%20cy='25'%20r='25'%20fill='%2358AFFF'/%3e%3cpath%20d='M36%2018.9643C35.5742%2019.75%2034.8645%2020.5357%2033.871%2021.0595V21.5833C33.871%2028.131%2028.0516%2033.5%2020.9548%2033.5C18.5419%2033.5%2016.129%2032.8452%2014%2031.6667C14.4258%2031.6667%2014.7097%2031.7976%2015.1355%2031.6667C17.2645%2031.6667%2019.2516%2031.0119%2020.8129%2029.8333C18.8258%2029.8333%2017.1226%2028.6548%2016.5548%2026.9524C16.8387%2026.9524%2017.1226%2027.0833%2017.4065%2027.0833C17.8323%2027.0833%2018.2581%2027.0833%2018.5419%2026.9524C16.4129%2026.5595%2014.8516%2024.8571%2014.8516%2022.8929C15.4194%2023.1548%2016.129%2023.4167%2016.8387%2023.4167C15.7032%2022.631%2014.9935%2021.3214%2014.9935%2019.881C14.9935%2019.0952%2015.2774%2018.4405%2015.5613%2017.7857C17.8323%2020.4048%2021.2387%2021.9762%2024.929%2022.1071C24.7871%2021.8452%2024.7871%2021.4524%2024.7871%2021.1905C24.7871%2018.8333%2026.7742%2017%2029.329%2017C30.6065%2017%2031.7419%2017.5238%2032.5935%2018.3095C33.5871%2018.1786%2034.5806%2017.7857%2035.4323%2017.2619C35.1484%2018.1786%2034.4387%2019.0952%2033.4452%2019.619C34.2968%2019.4881%2035.2903%2019.2262%2036%2018.9643Z'%20fill='black'/%3e%3c/svg%3e", import.meta.url).href;
2071
2182
  const retweetIconUrl = new URL("data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='25'%20cy='25'%20r='25'%20fill='%2358AFFF'/%3e%3cpath%20d='M27.6047%2016C27.1048%2016%2026.605%2016.3999%2026.605%2017.2296V20.3986L26.0401%2020.4286C23.5018%2020.5001%2021.0516%2021.3751%2019.0423%2022.9279C16.5081%2024.9972%2014.4787%2028.4562%2014.0088%2032.9098C13.9745%2033.1614%2014.0408%2033.4165%2014.1934%2033.6195C14.3459%2033.8226%2014.5724%2033.9573%2014.8236%2033.9945C14.8666%2034.0015%2014.9105%2034.0015%2014.9536%2033.9945C15.1097%2033.9982%2015.2638%2033.9587%2015.3988%2033.8801C15.5338%2033.8016%2015.6444%2033.6872%2015.7183%2033.5496C18.1526%2030.0507%2023.356%2029.4958%2025.9102%2029.4958H26.61V32.8898C26.6025%2033.0314%2026.6239%2033.173%2026.6726%2033.3061C26.7214%2033.4392%2026.7967%2033.561%2026.8938%2033.6642C26.991%2033.7674%2027.108%2033.8499%2027.2379%2033.9067C27.3678%2033.9634%2027.5079%2033.9933%2027.6496%2033.9945C27.803%2033.9913%2027.9541%2033.9574%2028.0941%2033.8947C28.234%2033.832%2028.36%2033.7419%2028.4644%2033.6296L35.3173%2026.3868C36.197%2025.4721%2036.242%2024.5224%2035.3623%2023.6077L28.3294%2016.3149C28.2364%2016.2159%2028.1241%2016.1369%2027.9995%2016.0828C27.8749%2016.0287%2027.7405%2016.0005%2027.6047%2016Z'%20fill='black'/%3e%3c/svg%3e", import.meta.url).href;
2072
2183
  const discordIconUrl = new URL("data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='25'%20cy='25'%20r='25'%20fill='%236671FF'/%3e%3cpath%20d='M33.2655%2018.9902C30.7797%2017.2501%2028.4181%2017.1258%2028.0452%2017.1258L27.7966%2017.3744C30.6554%2018.1202%2032.2712%2019.4874%2032.3955%2019.6117C27.9209%2017.3744%2022.9492%2017.2501%2018.4746%2018.9902C17.8531%2019.2388%2017.4802%2019.4874%2017.3559%2019.4874C17.6045%2019.3631%2019.096%2017.9959%2022.2034%2017.2501L21.9548%2017.0015C21.9548%2017.0015%2019.4689%2016.8772%2016.7345%2018.8659C16.7345%2018.8659%2014%2023.4648%2014%2029.3066C14%2029.3066%2015.6158%2031.9168%2019.7175%2032.0411C19.7175%2032.0411%2020.339%2031.2953%2020.9605%2030.5496C18.8475%2029.9281%2017.8531%2028.5609%2017.7288%2028.4366L18.4746%2028.8095C20.7119%2029.6795%2023.0734%2030.9225%2027.4237%2030.1767C28.2938%2030.0524%2029.2881%2029.8038%2030.1582%2029.4309C30.7797%2029.058%2031.5254%2028.8095%2032.2712%2028.3123C32.1469%2028.4366%2031.1525%2029.8038%2028.9153%2030.4253C29.4124%2031.171%2030.1582%2031.9168%2030.1582%2031.9168C34.3842%2031.7925%2036%2029.1823%2036%2029.4309C36%2023.7134%2033.2655%2018.9902%2033.2655%2018.9902ZM21.5819%2027.4422C20.5876%2027.4422%2019.7175%2026.5722%2019.7175%2025.4535C19.7175%2024.3349%2020.5876%2023.4648%2021.5819%2023.4648C22.5763%2023.4648%2023.4463%2024.4592%2023.4463%2025.4535C23.4463%2026.5722%2022.5763%2027.4422%2021.5819%2027.4422ZM28.4181%2027.4422C27.4237%2027.4422%2026.5537%2026.5722%2026.5537%2025.4535C26.5537%2024.3349%2027.4237%2023.4648%2028.4181%2023.4648C29.5367%2023.4648%2030.4068%2024.4592%2030.4068%2025.4535C30.4068%2026.5722%2029.5367%2027.4422%2028.4181%2027.4422Z'%20fill='black'/%3e%3c/svg%3e", import.meta.url).href;
@@ -2224,18 +2335,205 @@ function CooldownTimer({
2224
2335
  }
2225
2336
  return /* @__PURE__ */ jsx("span", { className: `taskon-cooldown-timer ${className || ""}`, children: formatTime$1(remaining) });
2226
2337
  }
2227
- function getTaskPointDesc(pointsName) {
2228
- return `Complete tasks to earn ${pointsName}, which accumulate and are displayed in the ranking or lottery. The more ${pointsName} you have, the higher your chances of winning. Your total ${pointsName} will determine your ranking or lottery outcome at the end of the quest.`;
2338
+ const mandatory_tasks = "Mandatory Tasks";
2339
+ const optional_tasks = "Optional Tasks";
2340
+ const min_required = "(Min. {count} Required)";
2341
+ const min_points_required = "(Min. {count} Points Required)";
2342
+ const no_tasks_available = "No tasks available";
2343
+ const task_point_desc = "Complete tasks to earn {pointsName}, which accumulate and are displayed in the ranking or lottery. The more {pointsName} you have, the higher your chances of winning. Your total {pointsName} will determine your ranking or lottery outcome at the end of the quest.";
2344
+ const points_per_time = "/Time";
2345
+ const you_have_earned = "You have earned";
2346
+ const recurrence_daily = "Daily";
2347
+ const recurrence_weekly = "Weekly";
2348
+ const recurrence_monthly = "Monthly";
2349
+ const recurrence_unlimited = "Unlimited";
2350
+ const all_steps_completed = "All Steps Completed";
2351
+ const steps_completed = "{completed}/{total} Steps Completed";
2352
+ const please_view_link_before_verifying = "Please view the link before verifying.";
2353
+ const link_and_verify = "Link & Verify";
2354
+ const verify = "Verify";
2355
+ const verifying = "Verifying...";
2356
+ const verify_failed_title = "Verify Failed";
2357
+ const verify_failed_message = "Oops! You did not pass this task.";
2358
+ const not_eligible_title = "Not Eligible";
2359
+ const campaign_ineligibility_message = "You do not meet the campaign eligibility requirements.";
2360
+ const unknown_error = "Unknown error";
2361
+ const quest_api_not_initialized = "Quest API not initialized";
2362
+ const invite_not_reach_message = "You have invited {invited} users, but need {remaining} more to complete this task.";
2363
+ const show_more = "Show more";
2364
+ const show_less$1 = "Show less";
2365
+ const between = "Between";
2366
+ const dynamic_times_suffix = "/ {minTimes} times";
2367
+ const dynamic_max_suffix = "/ Max. {max}";
2368
+ const unlimited = "Unlimited";
2369
+ const max_points_title = "Max. {pointName}";
2370
+ const your_points_title = "Your {pointName}";
2371
+ const dynamic_tip_max_points = "Maximum points available for this task.";
2372
+ const dynamic_tip_your_points = "Points you've earned so far. Final rewards will be calculated when the quest ends.";
2373
+ const this_field_required = "This field is required";
2374
+ const submit_param_title = "Submit {paramName}";
2375
+ const submit_param_warning = "Warning: Please make sure you enter the correct {paramName}. Once submitted, it cannot be changed.";
2376
+ const submit_param_desc = "Enter your {paramName} to complete the verification. The system will use this information to verify your task completion.";
2377
+ const submit_param_enter_label = "Enter {paramName}";
2378
+ const submit_param_enter_placeholder = "Enter your {paramName}";
2379
+ const cancel = "Cancel";
2380
+ const confirm$1 = "Confirm";
2381
+ const completed$1 = "Completed";
2382
+ const interact_with_contract = "Interact With Contract";
2383
+ const points$1 = "Points";
2384
+ const proof_of_work = "Proof of Work";
2385
+ const please_enter_content = "Please enter content";
2386
+ const please_enter_valid_url = "Please enter a valid URL";
2387
+ const submit_successfully = "Submit successfully";
2388
+ const submission_failed = "Submission failed";
2389
+ const please_upload_image_file = "Please upload an image file";
2390
+ const image_size_limit = "Image size must be less than 10MB";
2391
+ const upload_api_not_initialized = "Upload API not initialized";
2392
+ const upload_failed = "Upload failed";
2393
+ const resubmit = "Resubmit";
2394
+ const submit = "Submit";
2395
+ const submitting = "Submitting...";
2396
+ const pow_title_tip = "This task needs to be verified after submission.";
2397
+ const pow_points_tip = "The point rewards will be distributed to you after the quest ends if your task is verified as completed.";
2398
+ const enter_url = "Enter URL";
2399
+ const enter_here = "Enter here";
2400
+ const uploaded_image_alt = "Uploaded";
2401
+ const image_upload_hint = "JPG, PNG, SVG, WEBP, GIF.\nMAX 10MB.";
2402
+ const average_review_default = "{ownerName} handles task verification.";
2403
+ const average_review_minutes = "{ownerName} handles task verification, taking an average of {minutes} minute(s) after submission.";
2404
+ const average_review_hours = "{ownerName} handles task verification, taking an average of {hours} hour(s) after submission.";
2405
+ const rules = "Rules";
2406
+ const instructions = "Instructions";
2407
+ const swap_rule_every = "Every";
2408
+ const swap_rule_will_give = "will give you";
2409
+ const points_name_fallback = "Points";
2410
+ const fsl_id = "FSL ID";
2411
+ const verify_failed_twitter_delay = "This is usually due to X (Twitter) delays.\nPlease try again in 30 seconds and make sure you used your linked X account{nameSuffix}.";
2412
+ const verify_failed_discord_delay = "This is usually due to Discord delays.\nPlease try again in 30 seconds and make sure you used your linked Discord account{nameSuffix}.";
2413
+ const verify_failed_telegram_delay = "This is usually due to Telegram delays.\nPlease try again in 30 seconds and make sure you used your linked Telegram account{nameSuffix}.";
2414
+ const verify_failed_toast_prefix = "Oops! Verification Failed!";
2415
+ const between_time_range = "Between {start} - {end}";
2416
+ const swap_rule_sentence = "Every {volume} will give you {points} {pointName}{maxText}";
2417
+ const you_have_earned_with_points_name = "You have earned {totalPoints} {pointsName}";
2418
+ const enMessages$1 = {
2419
+ mandatory_tasks,
2420
+ optional_tasks,
2421
+ min_required,
2422
+ min_points_required,
2423
+ no_tasks_available,
2424
+ task_point_desc,
2425
+ points_per_time,
2426
+ you_have_earned,
2427
+ recurrence_daily,
2428
+ recurrence_weekly,
2429
+ recurrence_monthly,
2430
+ recurrence_unlimited,
2431
+ all_steps_completed,
2432
+ steps_completed,
2433
+ please_view_link_before_verifying,
2434
+ link_and_verify,
2435
+ verify,
2436
+ verifying,
2437
+ verify_failed_title,
2438
+ verify_failed_message,
2439
+ not_eligible_title,
2440
+ campaign_ineligibility_message,
2441
+ unknown_error,
2442
+ quest_api_not_initialized,
2443
+ invite_not_reach_message,
2444
+ show_more,
2445
+ show_less: show_less$1,
2446
+ between,
2447
+ dynamic_times_suffix,
2448
+ dynamic_max_suffix,
2449
+ unlimited,
2450
+ max_points_title,
2451
+ your_points_title,
2452
+ dynamic_tip_max_points,
2453
+ dynamic_tip_your_points,
2454
+ this_field_required,
2455
+ submit_param_title,
2456
+ submit_param_warning,
2457
+ submit_param_desc,
2458
+ submit_param_enter_label,
2459
+ submit_param_enter_placeholder,
2460
+ cancel,
2461
+ confirm: confirm$1,
2462
+ completed: completed$1,
2463
+ interact_with_contract,
2464
+ points: points$1,
2465
+ proof_of_work,
2466
+ please_enter_content,
2467
+ please_enter_valid_url,
2468
+ submit_successfully,
2469
+ submission_failed,
2470
+ please_upload_image_file,
2471
+ image_size_limit,
2472
+ upload_api_not_initialized,
2473
+ upload_failed,
2474
+ resubmit,
2475
+ submit,
2476
+ submitting,
2477
+ pow_title_tip,
2478
+ pow_points_tip,
2479
+ enter_url,
2480
+ enter_here,
2481
+ uploaded_image_alt,
2482
+ image_upload_hint,
2483
+ average_review_default,
2484
+ average_review_minutes,
2485
+ average_review_hours,
2486
+ rules,
2487
+ instructions,
2488
+ swap_rule_every,
2489
+ swap_rule_will_give,
2490
+ points_name_fallback,
2491
+ fsl_id,
2492
+ verify_failed_twitter_delay,
2493
+ verify_failed_discord_delay,
2494
+ verify_failed_telegram_delay,
2495
+ verify_failed_toast_prefix,
2496
+ between_time_range,
2497
+ swap_rule_sentence,
2498
+ you_have_earned_with_points_name
2499
+ };
2500
+ const loadMessages$1 = createLocaleLoader(
2501
+ enMessages$1,
2502
+ {
2503
+ ko: () => import("./taskwidget-ko-EHgXFV4B.js").then((module2) => ({
2504
+ default: module2.default
2505
+ })),
2506
+ ja: () => import("./taskwidget-ja-CqSu-yWA.js").then((module2) => ({
2507
+ default: module2.default
2508
+ })),
2509
+ ru: () => import("./taskwidget-ru-CMbLQDK4.js").then((module2) => ({
2510
+ default: module2.default
2511
+ })),
2512
+ es: () => import("./taskwidget-es-Do9b3Mqw.js").then((module2) => ({
2513
+ default: module2.default
2514
+ }))
2515
+ }
2516
+ );
2517
+ function useTaskWidgetLocale() {
2518
+ return useTranslation({
2519
+ widgetId: "TaskWidget",
2520
+ defaultMessages: enMessages$1,
2521
+ loadMessages: loadMessages$1
2522
+ });
2229
2523
  }
2230
2524
  function PointsDisplay({
2231
- points,
2525
+ points: points2,
2232
2526
  isPeriodic,
2233
2527
  tip,
2234
2528
  isCompleted = false,
2235
- pointsName = "Points"
2529
+ pointsName
2236
2530
  }) {
2237
- if (!points) return null;
2238
- const pointsDesc = getTaskPointDesc(pointsName);
2531
+ const { t } = useTaskWidgetLocale();
2532
+ if (!points2) return null;
2533
+ const resolvedPointsName = pointsName || t("points_name_fallback");
2534
+ const pointsDesc = t("task_point_desc", {
2535
+ pointsName: resolvedPointsName
2536
+ });
2239
2537
  return /* @__PURE__ */ jsxs("span", { className: "taskon-task-item-points", children: [
2240
2538
  /* @__PURE__ */ jsx(TipPopover, { content: pointsDesc, children: /* @__PURE__ */ jsxs(
2241
2539
  "span",
@@ -2243,24 +2541,33 @@ function PointsDisplay({
2243
2541
  className: `taskon-task-item-points-value ${isCompleted ? "taskon-task-item-points-value--completed" : ""}`,
2244
2542
  children: [
2245
2543
  "+",
2246
- points
2544
+ points2
2247
2545
  ]
2248
2546
  }
2249
2547
  ) }),
2250
- isPeriodic && /* @__PURE__ */ jsx("span", { className: "taskon-task-item-points-time", children: "/Time" }),
2548
+ isPeriodic && /* @__PURE__ */ jsx("span", { className: "taskon-task-item-points-time", children: t("points_per_time") }),
2251
2549
  tip && /* @__PURE__ */ jsx(TipPopover, { content: tip, className: "taskon-task-item-tip" })
2252
2550
  ] });
2253
2551
  }
2254
2552
  function TotalEarnPoint({
2255
2553
  totalPoints,
2256
- pointsName = "points"
2554
+ pointsName
2257
2555
  }) {
2556
+ const { t } = useTaskWidgetLocale();
2258
2557
  if (!totalPoints || totalPoints <= 0) return null;
2259
- return /* @__PURE__ */ jsxs("div", { className: "taskon-task-item-total-earn", children: [
2260
- /* @__PURE__ */ jsx("span", { className: "taskon-task-item-total-earn-text", children: "You have earned" }),
2261
- /* @__PURE__ */ jsx("span", { className: "taskon-task-item-total-earn-value", children: totalPoints }),
2262
- /* @__PURE__ */ jsx("span", { className: "taskon-task-item-total-earn-text", children: pointsName })
2263
- ] });
2558
+ const resolvedPointsName = pointsName || t("points_name_fallback");
2559
+ return /* @__PURE__ */ jsx("div", { className: "taskon-task-item-total-earn", children: /* @__PURE__ */ jsx(
2560
+ I18nT,
2561
+ {
2562
+ t,
2563
+ i18nKey: "you_have_earned_with_points_name",
2564
+ textClassName: "taskon-task-item-total-earn-text",
2565
+ components: {
2566
+ totalPoints: /* @__PURE__ */ jsx("span", { className: "taskon-task-item-total-earn-value", children: totalPoints }),
2567
+ pointsName: /* @__PURE__ */ jsx("span", { className: "taskon-task-item-total-earn-text", children: resolvedPointsName })
2568
+ }
2569
+ }
2570
+ ) });
2264
2571
  }
2265
2572
  function RecurrenceBadge({
2266
2573
  type,
@@ -2268,6 +2575,7 @@ function RecurrenceBadge({
2268
2575
  coolDownRemaining,
2269
2576
  onCooldownComplete
2270
2577
  }) {
2578
+ const { t } = useTaskWidgetLocale();
2271
2579
  const [cooldownDone, setCooldownDone] = useState(false);
2272
2580
  useEffect(() => {
2273
2581
  if (coolDownRemaining && coolDownRemaining > 0) {
@@ -2290,10 +2598,10 @@ function RecurrenceBadge({
2290
2598
  }
2291
2599
  if (!isCurrentDone || cooldownDone) {
2292
2600
  const badgeText = {
2293
- Daily: "Daily",
2294
- Weekly: "Weekly",
2295
- Monthly: "Monthly",
2296
- Unlimited: "Unlimited"
2601
+ Daily: t("recurrence_daily"),
2602
+ Weekly: t("recurrence_weekly"),
2603
+ Monthly: t("recurrence_monthly"),
2604
+ Unlimited: t("recurrence_unlimited")
2297
2605
  };
2298
2606
  return /* @__PURE__ */ jsx("div", { className: "taskon-task-item-recurrence", children: badgeText[type] || type });
2299
2607
  }
@@ -2437,12 +2745,8 @@ function getSnsTypeFromIdentity(identityType) {
2437
2745
  return void 0;
2438
2746
  }
2439
2747
  }
2440
- const VERIFY_FAILED_TITLE = "Verify Failed";
2441
- const ELIGIBILITY_FAILED_TITLE = "Not Eligible";
2442
- const DEFAULT_VERIFY_FAILED_MESSAGE = "Oops! You did not pass this task.";
2443
- const DEFAULT_ELIGIBILITY_FAILED_MESSAGE = "You do not meet the campaign eligibility requirements.";
2444
2748
  const CAMPAIGN_INELIGIBILITY_CODE = "CAMPAIGN_INELIGIBILITY";
2445
- function extractErrorMessage(error) {
2749
+ function extractErrorMessage(error, fallbackMessage) {
2446
2750
  if (error instanceof Error) {
2447
2751
  return error.message;
2448
2752
  }
@@ -2455,9 +2759,9 @@ function extractErrorMessage(error) {
2455
2759
  return maybeMessage;
2456
2760
  }
2457
2761
  }
2458
- return "Unknown error";
2762
+ return fallbackMessage;
2459
2763
  }
2460
- function buildInviteNotReachMessage(errorData) {
2764
+ function buildInviteNotReachMessage(errorData, template) {
2461
2765
  if (!errorData || typeof errorData !== "object") {
2462
2766
  return null;
2463
2767
  }
@@ -2466,7 +2770,7 @@ function buildInviteNotReachMessage(errorData) {
2466
2770
  return null;
2467
2771
  }
2468
2772
  const remaining = Math.max(0, data2.min_required - data2.invited);
2469
- return `You have invited ${data2.invited} users, but need ${remaining} more to complete this task.`;
2773
+ return template.replace("{invited}", String(data2.invited)).replace("{remaining}", String(remaining));
2470
2774
  }
2471
2775
  function useTaskSubmit({
2472
2776
  campaignId,
@@ -2485,6 +2789,7 @@ function useTaskSubmit({
2485
2789
  const client = (context == null ? void 0 : context.client) ?? null;
2486
2790
  const userInfo = (context == null ? void 0 : context.userInfo) ?? null;
2487
2791
  const { toast } = useToast();
2792
+ const { t } = useTaskWidgetLocale();
2488
2793
  const [isSubmitting, setIsSubmitting] = useState(false);
2489
2794
  const [error, setError] = useState(null);
2490
2795
  const [coolDown, setCoolDown] = useState(null);
@@ -2515,22 +2820,25 @@ function useTaskSubmit({
2515
2820
  (taskPlatform) => {
2516
2821
  if (taskPlatform === "Twitter") {
2517
2822
  const name2 = getSnsUserName("Twitter");
2518
- return `This is usually due to X(Twitter) delays.
2519
- Please try again in 30 seconds and make sure you used your linked X account${name2 ? `, ${name2}` : ""}.`;
2823
+ return t("verify_failed_twitter_delay", {
2824
+ nameSuffix: name2 ? ` (${name2})` : ""
2825
+ });
2520
2826
  }
2521
2827
  if (taskPlatform === "Discord") {
2522
2828
  const name2 = getSnsUserName("Discord");
2523
- return `This is usually due to Discord delays.
2524
- Please try again in 30 seconds and make sure you used your linked Discord account${name2 ? `, ${name2}` : ""}.`;
2829
+ return t("verify_failed_discord_delay", {
2830
+ nameSuffix: name2 ? ` (${name2})` : ""
2831
+ });
2525
2832
  }
2526
2833
  if (taskPlatform === "Telegram") {
2527
2834
  const name2 = getSnsUserName("Telegram");
2528
- return `This is usually due to Telegram delays.
2529
- Please try again in 30 seconds and make sure you used your linked Telegram account${name2 ? `, ${name2}` : ""}.`;
2835
+ return t("verify_failed_telegram_delay", {
2836
+ nameSuffix: name2 ? ` (${name2})` : ""
2837
+ });
2530
2838
  }
2531
- return DEFAULT_VERIFY_FAILED_MESSAGE;
2839
+ return t("verify_failed_message");
2532
2840
  },
2533
- [getSnsUserName]
2841
+ [getSnsUserName, t]
2534
2842
  );
2535
2843
  const notifyVerifyFailed = useCallback(
2536
2844
  (notice) => {
@@ -2539,17 +2847,17 @@ Please try again in 30 seconds and make sure you used your linked Telegram accou
2539
2847
  return;
2540
2848
  }
2541
2849
  if (notice.source === "verify_failed") {
2542
- if (notice.message === DEFAULT_VERIFY_FAILED_MESSAGE) {
2543
- toast.error(DEFAULT_VERIFY_FAILED_MESSAGE);
2850
+ if (notice.message === t("verify_failed_message")) {
2851
+ toast.error(t("verify_failed_message"));
2544
2852
  return;
2545
2853
  }
2546
- toast.error(`Oops! Verification Failed!
2854
+ toast.error(`${t("verify_failed_toast_prefix")}
2547
2855
  ${notice.message}`, 1e4);
2548
2856
  return;
2549
2857
  }
2550
2858
  toast.error(notice.message);
2551
2859
  },
2552
- [onVerifyFailedNotice, toast]
2860
+ [onVerifyFailedNotice, t, toast]
2553
2861
  );
2554
2862
  const {
2555
2863
  bindIfNeed: bindSns,
@@ -2562,8 +2870,8 @@ ${notice.message}`, 1e4);
2562
2870
  await doSubmit();
2563
2871
  },
2564
2872
  // Re-auth success: resubmit task with OAuth token (same as Vue flow)
2565
- onAuthSuccess: async (token) => {
2566
- await doSubmit(token);
2873
+ onAuthSuccess: async (token2) => {
2874
+ await doSubmit(token2);
2567
2875
  },
2568
2876
  onFailed: (err) => {
2569
2877
  setError(err);
@@ -2591,10 +2899,10 @@ ${notice.message}`, 1e4);
2591
2899
  async (overrideValue) => {
2592
2900
  var _a;
2593
2901
  if (!questApi) {
2594
- const err = "Quest API not initialized";
2902
+ const err = t("quest_api_not_initialized");
2595
2903
  setError(err);
2596
2904
  notifyVerifyFailed({
2597
- title: VERIFY_FAILED_TITLE,
2905
+ title: t("verify_failed_title"),
2598
2906
  message: err,
2599
2907
  source: "api_error",
2600
2908
  platform,
@@ -2617,7 +2925,7 @@ ${notice.message}`, 1e4);
2617
2925
  const verifyFailedMessage = buildVerifyFailedMessage(platform);
2618
2926
  setError(verifyFailedMessage);
2619
2927
  notifyVerifyFailed({
2620
- title: VERIFY_FAILED_TITLE,
2928
+ title: t("verify_failed_title"),
2621
2929
  message: verifyFailedMessage,
2622
2930
  source: "verify_failed",
2623
2931
  platform
@@ -2627,19 +2935,19 @@ ${notice.message}`, 1e4);
2627
2935
  } catch (e) {
2628
2936
  const apiError = e instanceof ApiError ? e : null;
2629
2937
  const errorCode = apiError == null ? void 0 : apiError.code;
2630
- const rawErrorMessage = extractErrorMessage(e);
2938
+ const rawErrorMessage = extractErrorMessage(e, t("unknown_error"));
2631
2939
  if (errorCode && isUnauthorizedError(errorCode) && needsSnsBinding) {
2632
2940
  await reAuth();
2633
2941
  return;
2634
2942
  }
2635
2943
  if (errorCode === CAMPAIGN_INELIGIBILITY_CODE) {
2636
- const eligibilityMessage = rawErrorMessage || DEFAULT_ELIGIBILITY_FAILED_MESSAGE;
2944
+ const eligibilityMessage = rawErrorMessage || t("campaign_ineligibility_message");
2637
2945
  setError(eligibilityMessage);
2638
2946
  if (onCampaignIneligibility) {
2639
2947
  await onCampaignIneligibility();
2640
2948
  } else {
2641
2949
  notifyVerifyFailed({
2642
- title: ELIGIBILITY_FAILED_TITLE,
2950
+ title: t("not_eligible_title"),
2643
2951
  message: eligibilityMessage,
2644
2952
  source: "api_error",
2645
2953
  platform,
@@ -2650,11 +2958,17 @@ ${notice.message}`, 1e4);
2650
2958
  return;
2651
2959
  }
2652
2960
  if (errorCode === ErrorCode.INVITE_JOIN_IS_NOT_REACH) {
2653
- const inviteNotReachMessage = buildInviteNotReachMessage(apiError == null ? void 0 : apiError.data);
2961
+ const inviteNotReachMessage = buildInviteNotReachMessage(
2962
+ apiError == null ? void 0 : apiError.data,
2963
+ t("invite_not_reach_message", {
2964
+ invited: "{invited}",
2965
+ remaining: "{remaining}"
2966
+ })
2967
+ );
2654
2968
  const inviteErrorMessage = inviteNotReachMessage || rawErrorMessage;
2655
2969
  setError(inviteErrorMessage);
2656
2970
  notifyVerifyFailed({
2657
- title: VERIFY_FAILED_TITLE,
2971
+ title: t("verify_failed_title"),
2658
2972
  message: inviteErrorMessage,
2659
2973
  source: "verify_failed",
2660
2974
  platform,
@@ -2665,7 +2979,7 @@ ${notice.message}`, 1e4);
2665
2979
  }
2666
2980
  setError(rawErrorMessage);
2667
2981
  notifyVerifyFailed({
2668
- title: VERIFY_FAILED_TITLE,
2982
+ title: t("verify_failed_title"),
2669
2983
  message: rawErrorMessage,
2670
2984
  source: "api_error",
2671
2985
  platform,
@@ -2687,10 +3001,11 @@ ${notice.message}`, 1e4);
2687
3001
  buildVerifyFailedMessage,
2688
3002
  notifyVerifyFailed,
2689
3003
  needsSnsBinding,
2690
- reAuth
3004
+ reAuth,
3005
+ t
2691
3006
  ]
2692
3007
  );
2693
- const submit = useCallback(
3008
+ const submit2 = useCallback(
2694
3009
  async (overrideValue) => {
2695
3010
  setError(null);
2696
3011
  setCoolDown(null);
@@ -2721,7 +3036,7 @@ ${notice.message}`, 1e4);
2721
3036
  setError(null);
2722
3037
  }, []);
2723
3038
  return {
2724
- submit,
3039
+ submit: submit2,
2725
3040
  isSubmitting: isSubmitting || isWaitingAuth || isBindingWallet,
2726
3041
  error,
2727
3042
  coolDown,
@@ -2819,30 +3134,31 @@ function useLinkTaskTracker(taskId, isLinkTask) {
2819
3134
  needClickLink
2820
3135
  };
2821
3136
  }
2822
- const DEFAULT_TITLE = "Verify Failed";
2823
- const DEFAULT_MESSAGE = "Oops! You did not pass this task.";
2824
3137
  function TaskVerifyFailedDialog({
2825
- open,
2826
- title = DEFAULT_TITLE,
2827
- message = DEFAULT_MESSAGE,
3138
+ open: open2,
3139
+ title,
3140
+ message,
2828
3141
  onClose
2829
3142
  }) {
3143
+ const { t } = useTaskWidgetLocale();
3144
+ const resolvedTitle = title || t("verify_failed_title");
3145
+ const resolvedMessage = message || t("verify_failed_message");
2830
3146
  return /* @__PURE__ */ jsx(
2831
3147
  ConfirmNoticeDialog,
2832
3148
  {
2833
- open,
3149
+ open: open2,
2834
3150
  onOpenChange: (nextOpen) => {
2835
3151
  if (!nextOpen) {
2836
3152
  onClose();
2837
3153
  }
2838
3154
  },
2839
3155
  type: "warn",
2840
- title,
3156
+ title: resolvedTitle,
2841
3157
  showCloseButton: true,
2842
3158
  contentClassName: "taskon-task-verify-failed-dialog",
2843
- accessibilityTitle: title,
2844
- accessibilityDescription: message,
2845
- children: /* @__PURE__ */ jsx("div", { className: "taskon-task-verify-failed-dialog-message", children: message })
3159
+ accessibilityTitle: resolvedTitle,
3160
+ accessibilityDescription: resolvedMessage,
3161
+ children: /* @__PURE__ */ jsx("div", { className: "taskon-task-verify-failed-dialog-message", children: resolvedMessage })
2846
3162
  }
2847
3163
  );
2848
3164
  }
@@ -2888,10 +3204,10 @@ const VerifyButton = forwardRef(
2888
3204
  onError,
2889
3205
  className
2890
3206
  }, ref) {
2891
- const { toast } = useToast();
3207
+ const { t } = useTaskWidgetLocale();
2892
3208
  const [verifyFailedNotice, setVerifyFailedNotice] = useState(null);
2893
3209
  const {
2894
- submit,
3210
+ submit: submit2,
2895
3211
  isSubmitting,
2896
3212
  clearError,
2897
3213
  isSnsBindingRequired,
@@ -2950,7 +3266,12 @@ const VerifyButton = forwardRef(
2950
3266
  );
2951
3267
  const handleClick = async () => {
2952
3268
  if (needLink && !isLinkClicked2) {
2953
- toast.error("Please view the link before verifying.");
3269
+ setVerifyFailedNotice({
3270
+ title: t("verify_failed_title"),
3271
+ message: t("please_view_link_before_verifying"),
3272
+ source: "verify_failed",
3273
+ platform
3274
+ });
2954
3275
  return;
2955
3276
  }
2956
3277
  if (onBeforeVerify) {
@@ -2965,7 +3286,7 @@ const VerifyButton = forwardRef(
2965
3286
  }
2966
3287
  }
2967
3288
  clearError();
2968
- await submit();
3289
+ await submit2();
2969
3290
  };
2970
3291
  const closeVerifyFailedDialog = useCallback(() => {
2971
3292
  setVerifyFailedNotice(null);
@@ -2975,10 +3296,10 @@ const VerifyButton = forwardRef(
2975
3296
  const buttonLabel = React__default.useMemo(() => {
2976
3297
  if (label) return label;
2977
3298
  if (isSnsBindingRequired || isWalletBindingRequired) {
2978
- return "Link & Verify";
3299
+ return t("link_and_verify");
2979
3300
  }
2980
- return "Verify";
2981
- }, [label, isSnsBindingRequired, isWalletBindingRequired]);
3301
+ return t("verify");
3302
+ }, [label, isSnsBindingRequired, isWalletBindingRequired, t]);
2982
3303
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2983
3304
  /* @__PURE__ */ jsxs("div", { className: "taskon-verify-btn-wrap", children: [
2984
3305
  /* @__PURE__ */ jsxs(
@@ -2991,7 +3312,7 @@ const VerifyButton = forwardRef(
2991
3312
  "aria-busy": isLoading,
2992
3313
  children: [
2993
3314
  isLoading && /* @__PURE__ */ jsx(SpinnerIcon, {}),
2994
- /* @__PURE__ */ jsx("span", { children: isLoading ? "Verifying..." : buttonLabel })
3315
+ /* @__PURE__ */ jsx("span", { children: isLoading ? t("verifying") : buttonLabel })
2995
3316
  ]
2996
3317
  }
2997
3318
  ),
@@ -3018,16 +3339,19 @@ const VerifyButton = forwardRef(
3018
3339
  function ExpandableContent({
3019
3340
  children,
3020
3341
  maxHeight = 21,
3021
- showMoreText = "Show more",
3022
- showLessText = "Show less",
3342
+ showMoreText,
3343
+ showLessText,
3023
3344
  className,
3024
3345
  animated = true,
3025
3346
  animationDuration = 300
3026
3347
  }) {
3348
+ const { t } = useTaskWidgetLocale();
3027
3349
  const contentRef = useRef(null);
3028
3350
  const [isExpanded, setIsExpanded] = useState(false);
3029
3351
  const [needsExpand, setNeedsExpand] = useState(false);
3030
3352
  const [contentHeight, setContentHeight] = useState(0);
3353
+ const resolvedShowMoreText = showMoreText || t("show_more");
3354
+ const resolvedShowLessText = showLessText || t("show_less");
3031
3355
  const measureContent = useCallback(() => {
3032
3356
  if (contentRef.current) {
3033
3357
  const scrollHeight = contentRef.current.scrollHeight;
@@ -3094,7 +3418,7 @@ function ExpandableContent({
3094
3418
  onClick: handleToggle,
3095
3419
  "aria-expanded": isExpanded,
3096
3420
  children: [
3097
- /* @__PURE__ */ jsx("span", { className: "taskon-expandable-toggle-text", children: isExpanded ? showLessText : showMoreText }),
3421
+ /* @__PURE__ */ jsx("span", { className: "taskon-expandable-toggle-text", children: isExpanded ? resolvedShowLessText : resolvedShowMoreText }),
3098
3422
  /* @__PURE__ */ jsx(
3099
3423
  "svg",
3100
3424
  {
@@ -3135,11 +3459,12 @@ function TimeRange({
3135
3459
  end,
3136
3460
  className
3137
3461
  }) {
3138
- const timeRangeText = `${formatTime(start)} - ${formatTime(end)}`;
3139
- return /* @__PURE__ */ jsxs("div", { className: `taskon-task-time-range ${className || ""}`, children: [
3140
- /* @__PURE__ */ jsx("span", { className: "taskon-task-time-range-label", children: "Between " }),
3141
- /* @__PURE__ */ jsx("span", { className: "taskon-task-time-range-value", children: timeRangeText })
3142
- ] });
3462
+ const { t } = useTaskWidgetLocale();
3463
+ const timeRangeText = t("between_time_range", {
3464
+ start: formatTime(start),
3465
+ end: formatTime(end)
3466
+ });
3467
+ return /* @__PURE__ */ jsx("div", { className: `taskon-task-time-range ${className || ""}`, children: /* @__PURE__ */ jsx("span", { className: "taskon-task-time-range-value", children: timeRangeText }) });
3143
3468
  }
3144
3469
  const VUE_RATE_LIMIT_TWITTER_TASK_IDS = /* @__PURE__ */ new Set([
3145
3470
  "FollowTwitter",
@@ -3216,7 +3541,7 @@ function TaskContent({
3216
3541
  }
3217
3542
  function TemplateTask({
3218
3543
  campaignId,
3219
- task,
3544
+ task: task2,
3220
3545
  userStatus,
3221
3546
  onCompleted,
3222
3547
  onBeforeVerify,
@@ -3249,11 +3574,11 @@ function TemplateTask({
3249
3574
  }, [coolDownEnd]);
3250
3575
  const params = useMemo(() => {
3251
3576
  try {
3252
- return JSON.parse(task.params);
3577
+ return JSON.parse(task2.params);
3253
3578
  } catch {
3254
3579
  return {};
3255
3580
  }
3256
- }, [task.params]);
3581
+ }, [task2.params]);
3257
3582
  const snsType = useMemo(
3258
3583
  () => getSnsTypeFromIdentity(params.user_identity_type),
3259
3584
  [params.user_identity_type]
@@ -3261,18 +3586,18 @@ function TemplateTask({
3261
3586
  const chainType = useChainType(params.network);
3262
3587
  const shouldStartVerifyFailCooldown = useMemo(() => {
3263
3588
  return shouldEnableVueVerifyFailCooldown(
3264
- task.template_id,
3589
+ task2.template_id,
3265
3590
  Boolean(snsType),
3266
3591
  Boolean(chainType)
3267
3592
  );
3268
- }, [task.template_id, snsType, chainType]);
3593
+ }, [task2.template_id, snsType, chainType]);
3269
3594
  const isLinkTask = Boolean(params.is_link_task);
3270
3595
  const {
3271
3596
  hasClicked: isLinkClicked2,
3272
3597
  markClicked: markLinkClicked2,
3273
3598
  resetClicked: resetLinkClicked,
3274
3599
  needClickLink
3275
- } = useLinkTaskTracker(task.id, isLinkTask);
3600
+ } = useLinkTaskTracker(task2.id, isLinkTask);
3276
3601
  const prevCurrentDoneRef = useRef(isCurrentDone);
3277
3602
  useEffect(() => {
3278
3603
  if (prevCurrentDoneRef.current && !isCurrentDone && isLinkTask) {
@@ -3291,9 +3616,9 @@ function TemplateTask({
3291
3616
  if (params.title_express) {
3292
3617
  return params.title_express;
3293
3618
  }
3294
- if (task.name) return task.name;
3295
- return task.template_id;
3296
- }, [params, task.name, task.template_id]);
3619
+ if (task2.name) return task2.name;
3620
+ return task2.template_id;
3621
+ }, [params, task2.name, task2.template_id]);
3297
3622
  const renderedTitle = useMemo(() => {
3298
3623
  if (params.title_express) {
3299
3624
  return /* @__PURE__ */ jsx(
@@ -3309,9 +3634,9 @@ function TemplateTask({
3309
3634
  const handleVerifySuccess = useCallback(
3310
3635
  (result) => {
3311
3636
  setIsLoading(false);
3312
- onCompleted == null ? void 0 : onCompleted(task.id, result);
3637
+ onCompleted == null ? void 0 : onCompleted(task2.id, result);
3313
3638
  },
3314
- [task.id, onCompleted]
3639
+ [task2.id, onCompleted]
3315
3640
  );
3316
3641
  const handleVerifyError = useCallback((error) => {
3317
3642
  var _a2;
@@ -3325,7 +3650,7 @@ function TemplateTask({
3325
3650
  setCoolDownEnd(null);
3326
3651
  onCooldownComplete == null ? void 0 : onCooldownComplete();
3327
3652
  }, [onCooldownComplete]);
3328
- const isPeriodic = task.recurrence && task.recurrence !== "Once";
3653
+ const isPeriodic = task2.recurrence && task2.recurrence !== "Once";
3329
3654
  const showVerifyButton = useMemo(() => {
3330
3655
  if (noVerify) {
3331
3656
  return false;
@@ -3353,8 +3678,8 @@ function TemplateTask({
3353
3678
  return /* @__PURE__ */ jsx(
3354
3679
  TaskCardBase,
3355
3680
  {
3356
- taskId: task.id,
3357
- templateId: task.template_id,
3681
+ taskId: task2.id,
3682
+ templateId: task2.template_id,
3358
3683
  title: renderedTitle,
3359
3684
  targetUrl: titleLinkUrl,
3360
3685
  onTitleLinkClick: isLinkTask ? markLinkClicked2 : void 0,
@@ -3364,13 +3689,13 @@ function TemplateTask({
3364
3689
  isSubmitted,
3365
3690
  isLoading,
3366
3691
  disabled,
3367
- recurrenceType: task.recurrence,
3692
+ recurrenceType: task2.recurrence,
3368
3693
  isPeriodic,
3369
3694
  isCurrentDone,
3370
3695
  coolDownRemaining,
3371
3696
  onCooldownComplete: handleCooldownComplete,
3372
- pointsValue: (_a = task.points) == null ? void 0 : _a.amount,
3373
- pointsName: (_b = task.points) == null ? void 0 : _b.points_name,
3697
+ pointsValue: (_a = task2.points) == null ? void 0 : _a.amount,
3698
+ pointsName: (_b = task2.points) == null ? void 0 : _b.points_name,
3374
3699
  totalEarnedPoints: userStatus == null ? void 0 : userStatus.total_points,
3375
3700
  className,
3376
3701
  actionSlot: showVerifyButton ? /* @__PURE__ */ jsx(
@@ -3378,10 +3703,10 @@ function TemplateTask({
3378
3703
  {
3379
3704
  ref: verifyButtonRef,
3380
3705
  campaignId,
3381
- taskId: task.id,
3706
+ taskId: task2.id,
3382
3707
  snsType,
3383
3708
  chainType,
3384
- platform: task.platform,
3709
+ platform: task2.platform,
3385
3710
  isLoading,
3386
3711
  disabled: isInCooldown,
3387
3712
  needLink: needClickLink,
@@ -3424,20 +3749,21 @@ function AverageReviewTime({
3424
3749
  time: time2,
3425
3750
  ownerName
3426
3751
  }) {
3752
+ const { t } = useTaskWidgetLocale();
3427
3753
  const getText = () => {
3428
3754
  if (!time2)
3429
- return `${ownerName} Handles The Task Verification`;
3755
+ return t("average_review_default", { ownerName });
3430
3756
  if (time2 < HOUR_MS) {
3431
3757
  const minutes = Math.max(1, Math.round(time2 / MINUTE_MS));
3432
- return `${ownerName} handles the task verification, taking an average of ${minutes} minute(s) after submission.`;
3758
+ return t("average_review_minutes", { ownerName, minutes });
3433
3759
  }
3434
3760
  const hours = +(time2 / HOUR_MS).toFixed(1);
3435
- return `${ownerName} handles the task verification, taking an average of ${hours} hour(s) after submission.`;
3761
+ return t("average_review_hours", { ownerName, hours });
3436
3762
  };
3437
3763
  return /* @__PURE__ */ jsx("div", { className: "taskon-pow-review-time", children: getText() });
3438
3764
  }
3439
3765
  function PowTask({
3440
- task,
3766
+ task: task2,
3441
3767
  userStatus,
3442
3768
  onCompleted,
3443
3769
  onBeforeVerify,
@@ -3453,6 +3779,7 @@ function PowTask({
3453
3779
  const context = useContext(TaskOnContext);
3454
3780
  const client = (context == null ? void 0 : context.client) ?? null;
3455
3781
  const { toast } = useToast();
3782
+ const { t } = useTaskWidgetLocale();
3456
3783
  const fileInputRef = useRef(null);
3457
3784
  const [isSubmitting, setIsSubmitting] = useState(false);
3458
3785
  const [isCheckingEligibility, setIsCheckingEligibility] = useState(false);
@@ -3464,18 +3791,18 @@ function PowTask({
3464
3791
  const [isUploading, setIsUploading] = useState(false);
3465
3792
  const params = useMemo(() => {
3466
3793
  try {
3467
- return JSON.parse(task.params);
3794
+ return JSON.parse(task2.params);
3468
3795
  } catch {
3469
3796
  return {
3470
3797
  desc: "",
3471
3798
  type: PowTaskType.Text
3472
3799
  };
3473
3800
  }
3474
- }, [task.params]);
3801
+ }, [task2.params]);
3475
3802
  const isCompleted = (userStatus == null ? void 0 : userStatus.is_qualifier) || false;
3476
3803
  const isSubmitted = (userStatus == null ? void 0 : userStatus.is_submitter) || false;
3477
3804
  const isCurrentDone = (userStatus == null ? void 0 : userStatus.current_done) || false;
3478
- const isPeriodic = task.recurrence && task.recurrence !== "Once";
3805
+ const isPeriodic = task2.recurrence && task2.recurrence !== "Once";
3479
3806
  const coolDownRemaining = useMemo(() => {
3480
3807
  if (userStatus == null ? void 0 : userStatus.next_time) {
3481
3808
  const remaining = userStatus.next_time - Date.now();
@@ -3486,14 +3813,14 @@ function PowTask({
3486
3813
  const validateContent = useCallback(
3487
3814
  (value2) => {
3488
3815
  if (!value2.trim()) {
3489
- return "Please enter content";
3816
+ return t("please_enter_content");
3490
3817
  }
3491
3818
  if (params.type === PowTaskType.URL && !isValidUrl(value2.trim())) {
3492
- return "Please enter a valid URL";
3819
+ return t("please_enter_valid_url");
3493
3820
  }
3494
3821
  return null;
3495
3822
  },
3496
- [params.type]
3823
+ [params.type, t]
3497
3824
  );
3498
3825
  const handleInputChange = (e) => {
3499
3826
  const value2 = e.target.value;
@@ -3538,7 +3865,7 @@ function PowTask({
3538
3865
  }
3539
3866
  const submitValue = value2 || content2;
3540
3867
  if (!questApi) {
3541
- setError("Quest API not initialized");
3868
+ setError(t("quest_api_not_initialized"));
3542
3869
  return;
3543
3870
  }
3544
3871
  const validationError = validateContent(submitValue);
@@ -3550,23 +3877,32 @@ function PowTask({
3550
3877
  setError(null);
3551
3878
  try {
3552
3879
  const result = await questApi.submitTask({
3553
- task_ids: [task.id],
3880
+ task_ids: [task2.id],
3554
3881
  value: submitValue.trim()
3555
3882
  });
3556
3883
  if ((_a2 = result.success_tasks) == null ? void 0 : _a2.length) {
3557
3884
  setContent("");
3558
- toast.success("Submit successfully");
3559
- onCompleted == null ? void 0 : onCompleted(task.id, result);
3885
+ toast.success(t("submit_successfully"));
3886
+ onCompleted == null ? void 0 : onCompleted(task2.id, result);
3560
3887
  } else {
3561
- setError("Submission failed");
3888
+ setError(t("submission_failed"));
3562
3889
  }
3563
3890
  } catch (e) {
3564
- toast.error(e instanceof Error ? e.message : "Unknown error");
3891
+ toast.error(e instanceof Error ? e.message : t("unknown_error"));
3565
3892
  } finally {
3566
3893
  setIsSubmitting(false);
3567
3894
  }
3568
3895
  },
3569
- [questApi, task.id, content2, validateContent, onCompleted, onBeforeVerify, toast]
3896
+ [
3897
+ content2,
3898
+ onBeforeVerify,
3899
+ onCompleted,
3900
+ questApi,
3901
+ t,
3902
+ task2.id,
3903
+ toast,
3904
+ validateContent
3905
+ ]
3570
3906
  );
3571
3907
  const handleImageUpload = async (e) => {
3572
3908
  var _a2;
@@ -3574,11 +3910,11 @@ function PowTask({
3574
3910
  if (!file) return;
3575
3911
  const validTypes = ["image/jpeg", "image/jpg", "image/png", "image/svg+xml", "image/webp", "image/gif"];
3576
3912
  if (!validTypes.some((type) => file.type === type || file.type.startsWith("image/"))) {
3577
- setError("Please upload an image file");
3913
+ setError(t("please_upload_image_file"));
3578
3914
  return;
3579
3915
  }
3580
3916
  if (file.size > 10 * 1024 * 1024) {
3581
- setError("Image size must be less than 10MB");
3917
+ setError(t("image_size_limit"));
3582
3918
  return;
3583
3919
  }
3584
3920
  const reader = new FileReader();
@@ -3587,7 +3923,7 @@ function PowTask({
3587
3923
  };
3588
3924
  reader.readAsDataURL(file);
3589
3925
  if (!commonApi) {
3590
- setError("Upload API not initialized");
3926
+ setError(t("upload_api_not_initialized"));
3591
3927
  return;
3592
3928
  }
3593
3929
  setIsUploading(true);
@@ -3601,7 +3937,7 @@ function PowTask({
3601
3937
  setUploadedImageUrl(result.cdn_url);
3602
3938
  await handleSubmit(result.cdn_url);
3603
3939
  } catch (err) {
3604
- setError(err instanceof Error ? err.message : "Upload failed");
3940
+ setError(err instanceof Error ? err.message : t("upload_failed"));
3605
3941
  setUploadedImage(null);
3606
3942
  setUploadedImageUrl(null);
3607
3943
  } finally {
@@ -3616,12 +3952,12 @@ function PowTask({
3616
3952
  };
3617
3953
  const buttonLabel = useMemo(() => {
3618
3954
  if (userStatus == null ? void 0 : userStatus.is_submitter) {
3619
- return "Resubmit";
3955
+ return t("resubmit");
3620
3956
  }
3621
- return "Submit";
3622
- }, [userStatus == null ? void 0 : userStatus.is_submitter]);
3957
+ return t("submit");
3958
+ }, [t, userStatus == null ? void 0 : userStatus.is_submitter]);
3623
3959
  const title = useMemo(() => {
3624
- const titleText = task.custom_name || "Proof of Work";
3960
+ const titleText = task2.custom_name || t("proof_of_work");
3625
3961
  if (params.task_url) {
3626
3962
  return /* @__PURE__ */ jsx(
3627
3963
  "a",
@@ -3636,7 +3972,7 @@ function PowTask({
3636
3972
  );
3637
3973
  }
3638
3974
  return titleText;
3639
- }, [task.custom_name, params.task_url]);
3975
+ }, [params.task_url, t, task2.custom_name]);
3640
3976
  const inputDisabled = disabled || isCompleted;
3641
3977
  const showSubmitArea = useMemo(() => {
3642
3978
  if (isCompleted) {
@@ -3655,22 +3991,22 @@ function PowTask({
3655
3991
  return /* @__PURE__ */ jsx("div", { className: `taskon-pow-task ${className || ""}`, children: /* @__PURE__ */ jsx(
3656
3992
  TaskCardBase,
3657
3993
  {
3658
- taskId: task.id,
3659
- templateId: task.template_id,
3994
+ taskId: task2.id,
3995
+ templateId: task2.template_id,
3660
3996
  title,
3661
- titleTip: "This task needs to be verified after submission.",
3997
+ titleTip: t("pow_title_tip"),
3662
3998
  icon: powIcon,
3663
3999
  isCompleted,
3664
4000
  isSubmitted,
3665
4001
  isLoading: isSubmitting,
3666
4002
  disabled,
3667
- recurrenceType: task.recurrence,
4003
+ recurrenceType: task2.recurrence,
3668
4004
  isPeriodic,
3669
4005
  isCurrentDone,
3670
4006
  coolDownRemaining,
3671
4007
  onCooldownComplete,
3672
- pointsValue: (_a = task.points) == null ? void 0 : _a.amount,
3673
- pointsTip: "The point rewards will be distributed to you after the quest ends if your task is verified as completed.",
4008
+ pointsValue: (_a = task2.points) == null ? void 0 : _a.amount,
4009
+ pointsTip: t("pow_points_tip"),
3674
4010
  children: /* @__PURE__ */ jsxs(ExpandableContent, { children: [
3675
4011
  params.desc && /* @__PURE__ */ jsx(CardDescExpress, { label: params.desc, noMaxHeight: true }),
3676
4012
  showSubmitArea && /* @__PURE__ */ jsxs("div", { className: "taskon-pow-input-area", children: [
@@ -3680,7 +4016,7 @@ function PowTask({
3680
4016
  {
3681
4017
  type: "text",
3682
4018
  className: "taskon-pow-input",
3683
- placeholder: "Enter URL",
4019
+ placeholder: t("enter_url"),
3684
4020
  value: content2,
3685
4021
  onChange: handleInputChange,
3686
4022
  onBlur: handleContentBlur,
@@ -3693,7 +4029,7 @@ function PowTask({
3693
4029
  className: `taskon-verify-btn ${isLoading ? "taskon-verify-btn--loading" : ""}`,
3694
4030
  onClick: () => handleSubmit(),
3695
4031
  disabled: !canSubmit || isLoading || inputDisabled,
3696
- children: isLoading ? "Submitting..." : buttonLabel
4032
+ children: isLoading ? t("submitting") : buttonLabel
3697
4033
  }
3698
4034
  )
3699
4035
  ] }),
@@ -3706,7 +4042,7 @@ function PowTask({
3706
4042
  maxLength: 500,
3707
4043
  showCount: true,
3708
4044
  disabled: inputDisabled,
3709
- placeholder: "Enter here"
4045
+ placeholder: t("enter_here")
3710
4046
  }
3711
4047
  ),
3712
4048
  /* @__PURE__ */ jsx(
@@ -3715,7 +4051,7 @@ function PowTask({
3715
4051
  className: `taskon-verify-btn ${isLoading ? "taskon-verify-btn--loading" : ""}`,
3716
4052
  onClick: () => handleSubmit(),
3717
4053
  disabled: !canSubmit || isLoading || inputDisabled,
3718
- children: isLoading ? "Submitting..." : buttonLabel
4054
+ children: isLoading ? t("submitting") : buttonLabel
3719
4055
  }
3720
4056
  )
3721
4057
  ] }),
@@ -3745,22 +4081,21 @@ function PowTask({
3745
4081
  },
3746
4082
  children: [
3747
4083
  uploadedImage ? /* @__PURE__ */ jsxs(Fragment, { children: [
3748
- /* @__PURE__ */ jsx("img", { className: "taskon-pow-image-preview", src: uploadedImage, alt: "Uploaded" }),
4084
+ /* @__PURE__ */ jsx(
4085
+ "img",
4086
+ {
4087
+ className: "taskon-pow-image-preview",
4088
+ src: uploadedImage,
4089
+ alt: t("uploaded_image_alt")
4090
+ }
4091
+ ),
3749
4092
  /* @__PURE__ */ jsxs("div", { className: "taskon-pow-image-mask", children: [
3750
4093
  /* @__PURE__ */ jsx("svg", { className: "taskon-pow-image-upload-icon", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M13 9L10 6M10 6L7 9M10 6V14M19 10C19 14.9706 14.9706 19 10 19C5.02944 19 1 14.9706 1 10C1 5.02944 5.02944 1 10 1C14.9706 1 19 5.02944 19 10Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
3751
- /* @__PURE__ */ jsxs("div", { className: "taskon-pow-image-upload-tip", children: [
3752
- "JPG, PNG, SVG, WEBP, GIF.",
3753
- "\n",
3754
- "MAX 10MB."
3755
- ] })
4094
+ /* @__PURE__ */ jsx("div", { className: "taskon-pow-image-upload-tip", children: t("image_upload_hint") })
3756
4095
  ] })
3757
4096
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3758
4097
  /* @__PURE__ */ jsx("svg", { className: "taskon-pow-image-upload-icon", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M13 9L10 6M10 6L7 9M10 6V14M19 10C19 14.9706 14.9706 19 10 19C5.02944 19 1 14.9706 1 10C1 5.02944 5.02944 1 10 1C14.9706 1 19 5.02944 19 10Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
3759
- /* @__PURE__ */ jsxs("div", { className: "taskon-pow-image-upload-tip", children: [
3760
- "JPG, PNG, SVG, WEBP, GIF.",
3761
- "\n",
3762
- "MAX 10MB."
3763
- ] })
4098
+ /* @__PURE__ */ jsx("div", { className: "taskon-pow-image-upload-tip", children: t("image_upload_hint") })
3764
4099
  ] }),
3765
4100
  isUploading && /* @__PURE__ */ jsx("div", { className: "taskon-pow-image-progress-bar", children: /* @__PURE__ */ jsx(
3766
4101
  "div",
@@ -3782,7 +4117,7 @@ function PowTask({
3782
4117
  }
3783
4118
  function ContractInteractiveTask({
3784
4119
  campaignId,
3785
- task,
4120
+ task: task2,
3786
4121
  userStatus,
3787
4122
  onCompleted,
3788
4123
  onBeforeVerify,
@@ -3794,9 +4129,10 @@ function ContractInteractiveTask({
3794
4129
  className
3795
4130
  }) {
3796
4131
  var _a;
4132
+ const { t } = useTaskWidgetLocale();
3797
4133
  const params = useMemo(() => {
3798
4134
  try {
3799
- return JSON.parse(task.params);
4135
+ return JSON.parse(task2.params);
3800
4136
  } catch {
3801
4137
  return {
3802
4138
  chain: "",
@@ -3809,11 +4145,11 @@ function ContractInteractiveTask({
3809
4145
  task_name: ""
3810
4146
  };
3811
4147
  }
3812
- }, [task.params]);
4148
+ }, [task2.params]);
3813
4149
  const isCompleted = (userStatus == null ? void 0 : userStatus.is_qualifier) || false;
3814
4150
  const isSubmitted = (userStatus == null ? void 0 : userStatus.is_submitter) || false;
3815
4151
  const isCurrentDone = (userStatus == null ? void 0 : userStatus.current_done) || false;
3816
- const isPeriodic = task.recurrence && task.recurrence !== "Once";
4152
+ const isPeriodic = task2.recurrence && task2.recurrence !== "Once";
3817
4153
  const coolDownRemaining = useMemo(() => {
3818
4154
  if (userStatus == null ? void 0 : userStatus.next_time) {
3819
4155
  const remaining = userStatus.next_time - Date.now();
@@ -3833,7 +4169,7 @@ function ContractInteractiveTask({
3833
4169
  const autoSubmitAttemptedRef = useRef(false);
3834
4170
  useEffect(() => {
3835
4171
  autoSubmitAttemptedRef.current = false;
3836
- }, [task.id]);
4172
+ }, [task2.id]);
3837
4173
  useEffect(() => {
3838
4174
  if (!questApi) {
3839
4175
  return;
@@ -3853,14 +4189,14 @@ function ContractInteractiveTask({
3853
4189
  var _a2;
3854
4190
  try {
3855
4191
  const result = await questApi.submitTask({
3856
- task_ids: [task.id],
4192
+ task_ids: [task2.id],
3857
4193
  value: ""
3858
4194
  });
3859
4195
  if (cancelled) {
3860
4196
  return;
3861
4197
  }
3862
4198
  if ((_a2 = result.success_tasks) == null ? void 0 : _a2.length) {
3863
- onCompleted == null ? void 0 : onCompleted(task.id, result);
4199
+ onCompleted == null ? void 0 : onCompleted(task2.id, result);
3864
4200
  }
3865
4201
  } catch (error) {
3866
4202
  if (cancelled) {
@@ -3881,20 +4217,20 @@ function ContractInteractiveTask({
3881
4217
  userStatus,
3882
4218
  disabled,
3883
4219
  isSubmitted,
3884
- task.id,
4220
+ task2.id,
3885
4221
  onCompleted,
3886
4222
  onBeforeVerify
3887
4223
  ]);
3888
4224
  const handleVerifySuccess = useCallback(
3889
4225
  (result) => {
3890
- onCompleted == null ? void 0 : onCompleted(task.id, result);
4226
+ onCompleted == null ? void 0 : onCompleted(task2.id, result);
3891
4227
  },
3892
- [task.id, onCompleted]
4228
+ [task2.id, onCompleted]
3893
4229
  );
3894
4230
  const handleVerifyError = useCallback((error) => {
3895
4231
  console.error("Verify failed:", error);
3896
4232
  }, []);
3897
- const title = params.task_name || "Interact With Contract";
4233
+ const title = params.task_name || t("interact_with_contract");
3898
4234
  const needShowVerify = useMemo(() => {
3899
4235
  if (noVerify) {
3900
4236
  return false;
@@ -3920,29 +4256,29 @@ function ContractInteractiveTask({
3920
4256
  return /* @__PURE__ */ jsx("div", { className: `taskon-contract-task ${className || ""}`, children: /* @__PURE__ */ jsx(
3921
4257
  TaskCardBase,
3922
4258
  {
3923
- taskId: task.id,
3924
- templateId: task.template_id,
4259
+ taskId: task2.id,
4260
+ templateId: task2.template_id,
3925
4261
  title,
3926
4262
  targetUrl: params.task_url,
3927
4263
  icon: contractInteractiveIcon,
3928
4264
  isCompleted,
3929
4265
  isSubmitted,
3930
4266
  disabled,
3931
- recurrenceType: task.recurrence,
4267
+ recurrenceType: task2.recurrence,
3932
4268
  isPeriodic,
3933
4269
  isCurrentDone,
3934
4270
  coolDownRemaining,
3935
4271
  onCooldownComplete,
3936
- pointsValue: (_a = task.points) == null ? void 0 : _a.amount,
4272
+ pointsValue: (_a = task2.points) == null ? void 0 : _a.amount,
3937
4273
  actionSlot: (
3938
4274
  /* Verify button - 复用通用 VerifyButton,统一异常弹窗与绑定逻辑 */
3939
4275
  needShowVerify ? /* @__PURE__ */ jsx(
3940
4276
  VerifyButton,
3941
4277
  {
3942
4278
  campaignId,
3943
- taskId: task.id,
4279
+ taskId: task2.id,
3944
4280
  chainType,
3945
- platform: task.platform,
4281
+ platform: task2.platform,
3946
4282
  onBeforeVerify,
3947
4283
  onSuccess: handleVerifySuccess,
3948
4284
  onError: handleVerifyError
@@ -3978,7 +4314,7 @@ function DynamicPoints({
3978
4314
  max,
3979
4315
  userTimes,
3980
4316
  minTimes,
3981
- pointName = "Points",
4317
+ pointName,
3982
4318
  tipTitle,
3983
4319
  tipDesc,
3984
4320
  noTipTitle = false,
@@ -3990,11 +4326,13 @@ function DynamicPoints({
3990
4326
  className
3991
4327
  }) {
3992
4328
  const { requestLogin } = useTaskOnAuth();
4329
+ const { t } = useTaskWidgetLocale();
3993
4330
  const [isCoolingDown, setIsCoolingDown] = useState(false);
3994
4331
  const [coolDownLeft, setCoolDownLeft] = useState(coolDown / 1e3);
3995
4332
  const [isAnimating, setIsAnimating] = useState(false);
3996
4333
  const timerRef = useRef(null);
3997
4334
  const isTimesMode = userTimes !== void 0 && minTimes !== void 0;
4335
+ const resolvedPointName = pointName || t("points_name_fallback");
3998
4336
  useEffect(() => {
3999
4337
  return () => {
4000
4338
  if (timerRef.current) {
@@ -4011,33 +4349,33 @@ function DynamicPoints({
4011
4349
  }, [isTimesMode, isLoggedIn, userTimes, userPoint]);
4012
4350
  const maxLabel = React__default.useMemo(() => {
4013
4351
  if (isTimesMode) {
4014
- return `/ ${minTimes} times`;
4352
+ return t("dynamic_times_suffix", { minTimes });
4015
4353
  }
4016
4354
  if (max === void 0) return null;
4017
- const maxText = max === -1 ? "Unlimited" : max;
4018
- return `/ Max. ${maxText}`;
4019
- }, [isTimesMode, minTimes, max]);
4355
+ const maxText = max === -1 ? t("unlimited") : max;
4356
+ return t("dynamic_max_suffix", { max: maxText });
4357
+ }, [isTimesMode, max, minTimes, t]);
4020
4358
  const computedTipTitle = React__default.useMemo(() => {
4021
4359
  if (noTipTitle) return "";
4022
4360
  if (tipTitle) return tipTitle;
4023
4361
  if (!isLoggedIn) {
4024
- if (max !== void 0 && pointName) {
4025
- return `Max. ${pointName}`;
4362
+ if (max !== void 0 && resolvedPointName) {
4363
+ return t("max_points_title", { pointName: resolvedPointName });
4026
4364
  }
4027
4365
  } else {
4028
- if (pointName) {
4029
- return `Your ${pointName}`;
4366
+ if (resolvedPointName) {
4367
+ return t("your_points_title", { pointName: resolvedPointName });
4030
4368
  }
4031
4369
  }
4032
4370
  return "";
4033
- }, [noTipTitle, tipTitle, isLoggedIn, max, pointName]);
4371
+ }, [isLoggedIn, max, noTipTitle, resolvedPointName, t, tipTitle]);
4034
4372
  const computedTipDesc = React__default.useMemo(() => {
4035
4373
  if (tipDesc) return tipDesc;
4036
4374
  if (isStarted) {
4037
- return "Points you've earned so far. Final rewards will be calculated when the quest ends.";
4375
+ return t("dynamic_tip_your_points");
4038
4376
  }
4039
- return "Maximum points available for this task.";
4040
- }, [tipDesc, isStarted]);
4377
+ return t("dynamic_tip_max_points");
4378
+ }, [isStarted, t, tipDesc]);
4041
4379
  const tipContent = React__default.useMemo(() => {
4042
4380
  if (noTipTitle) return computedTipDesc;
4043
4381
  if (computedTipTitle) {
@@ -4114,7 +4452,7 @@ ${computedTipDesc}`;
4114
4452
  }
4115
4453
  function SwapDexTask({
4116
4454
  campaignId,
4117
- task,
4455
+ task: task2,
4118
4456
  userStatus,
4119
4457
  onCompleted,
4120
4458
  onVerifyAttempted,
@@ -4129,20 +4467,21 @@ function SwapDexTask({
4129
4467
  className
4130
4468
  }) {
4131
4469
  var _a, _b, _c, _d, _e;
4470
+ const { t } = useTaskWidgetLocale();
4132
4471
  const context = useContext(TaskOnContext);
4133
4472
  const communityInfo = context == null ? void 0 : context.communityInfo;
4134
4473
  const { isLoggedIn } = useTaskOnAuth();
4135
4474
  const params = useMemo(() => {
4136
4475
  try {
4137
- return JSON.parse(task.params);
4476
+ return JSON.parse(task2.params);
4138
4477
  } catch {
4139
4478
  return {};
4140
4479
  }
4141
- }, [task.params]);
4480
+ }, [task2.params]);
4142
4481
  const isCompleted = (userStatus == null ? void 0 : userStatus.is_qualifier) || false;
4143
4482
  const isSubmitted = (userStatus == null ? void 0 : userStatus.is_submitter) || false;
4144
4483
  const isCurrentDone = (userStatus == null ? void 0 : userStatus.current_done) || false;
4145
- const isPeriodic = task.recurrence && task.recurrence !== "Once";
4484
+ const isPeriodic = task2.recurrence && task2.recurrence !== "Once";
4146
4485
  const coolDownRemaining = useMemo(() => {
4147
4486
  if (userStatus == null ? void 0 : userStatus.next_time) {
4148
4487
  const remaining = userStatus.next_time - Date.now();
@@ -4167,24 +4506,24 @@ function SwapDexTask({
4167
4506
  }, [params]);
4168
4507
  const useLegacyVerifyFlow = isDynamicPoint || isDynamicTimes;
4169
4508
  const [verifyFailedNotice, setVerifyFailedNotice] = useState(null);
4170
- const { submit, isSubmitting } = useTaskSubmit({
4509
+ const { submit: submit2, isSubmitting } = useTaskSubmit({
4171
4510
  campaignId,
4172
- taskId: task.id,
4511
+ taskId: task2.id,
4173
4512
  chainType,
4174
4513
  // 钱包绑定:从 params.chain 获取
4175
- platform: task.platform,
4514
+ platform: task2.platform,
4176
4515
  onSuccess: (result) => {
4177
4516
  if (!useLegacyVerifyFlow) {
4178
4517
  return;
4179
4518
  }
4180
- onCompleted == null ? void 0 : onCompleted(task.id, result);
4181
- onVerifyAttempted == null ? void 0 : onVerifyAttempted(task.id, true, result);
4519
+ onCompleted == null ? void 0 : onCompleted(task2.id, result);
4520
+ onVerifyAttempted == null ? void 0 : onVerifyAttempted(task2.id, true, result);
4182
4521
  },
4183
4522
  onError: () => {
4184
4523
  if (!useLegacyVerifyFlow) {
4185
4524
  return;
4186
4525
  }
4187
- onVerifyAttempted == null ? void 0 : onVerifyAttempted(task.id, false);
4526
+ onVerifyAttempted == null ? void 0 : onVerifyAttempted(task2.id, false);
4188
4527
  },
4189
4528
  // 当后端返回 CAMPAIGN_INELIGIBILITY 时,复用现有 eligibility 检查逻辑
4190
4529
  onCampaignIneligibility: onBeforeVerify,
@@ -4212,18 +4551,18 @@ function SwapDexTask({
4212
4551
  setIsCheckingEligibility(false);
4213
4552
  }
4214
4553
  }
4215
- await submit();
4216
- }, [useLegacyVerifyFlow, onBeforeVerify, submit]);
4554
+ await submit2();
4555
+ }, [useLegacyVerifyFlow, onBeforeVerify, submit2]);
4217
4556
  const handleVerifyButtonSuccess = useCallback(
4218
4557
  (result) => {
4219
- onCompleted == null ? void 0 : onCompleted(task.id, result);
4220
- onVerifyAttempted == null ? void 0 : onVerifyAttempted(task.id, true, result);
4558
+ onCompleted == null ? void 0 : onCompleted(task2.id, result);
4559
+ onVerifyAttempted == null ? void 0 : onVerifyAttempted(task2.id, true, result);
4221
4560
  },
4222
- [task.id, onCompleted, onVerifyAttempted]
4561
+ [task2.id, onCompleted, onVerifyAttempted]
4223
4562
  );
4224
4563
  const handleVerifyButtonError = useCallback(() => {
4225
- onVerifyAttempted == null ? void 0 : onVerifyAttempted(task.id, false);
4226
- }, [task.id, onVerifyAttempted]);
4564
+ onVerifyAttempted == null ? void 0 : onVerifyAttempted(task2.id, false);
4565
+ }, [task2.id, onVerifyAttempted]);
4227
4566
  const titleExpress = useMemo(() => {
4228
4567
  return getSwapDexTitleExpress({
4229
4568
  tokenOutList: params.token_out_list,
@@ -4240,7 +4579,7 @@ function SwapDexTask({
4240
4579
  const title = useMemo(() => {
4241
4580
  return /* @__PURE__ */ jsx(TitleExpress, { express: titleExpress });
4242
4581
  }, [titleExpress]);
4243
- const pointsName = ((_a = task.points) == null ? void 0 : _a.points_name) || "Points";
4582
+ const pointsName = ((_a = task2.points) == null ? void 0 : _a.points_name) || t("points_name_fallback");
4244
4583
  const rulesMaxText = useMemo(() => {
4245
4584
  if (typeof params.swap_receive_max_points === "number" && params.swap_receive_max_points >= 0) {
4246
4585
  return `(Max ${params.swap_receive_max_points} ${pointsName})`;
@@ -4256,21 +4595,21 @@ function SwapDexTask({
4256
4595
  }, [isDynamicTimes, params.min_trades_times]);
4257
4596
  const dynamicMaxPoint = useMemo(() => {
4258
4597
  var _a2;
4259
- if (!isDynamicPoint) return (_a2 = task.points) == null ? void 0 : _a2.amount;
4598
+ if (!isDynamicPoint) return (_a2 = task2.points) == null ? void 0 : _a2.amount;
4260
4599
  return typeof params.swap_receive_max_points === "number" ? params.swap_receive_max_points : -1;
4261
- }, [isDynamicPoint, params.swap_receive_max_points, (_b = task.points) == null ? void 0 : _b.amount]);
4600
+ }, [isDynamicPoint, params.swap_receive_max_points, (_b = task2.points) == null ? void 0 : _b.amount]);
4262
4601
  const pointTip = useMemo(() => {
4263
4602
  if (!isStarted) {
4264
4603
  return {
4265
- title: `Max. ${pointsName}`,
4266
- content: "Maximum points available for this task."
4604
+ title: t("max_points_title", { pointName: pointsName }),
4605
+ content: t("dynamic_tip_max_points")
4267
4606
  };
4268
4607
  }
4269
4608
  return {
4270
- title: `Your ${pointsName}`,
4271
- content: "Points you've earned so far. Final rewards will be calculated when the quest ends."
4609
+ title: t("your_points_title", { pointName: pointsName }),
4610
+ content: t("dynamic_tip_your_points")
4272
4611
  };
4273
- }, [isStarted, pointsName]);
4612
+ }, [isStarted, pointsName, t]);
4274
4613
  const handleRefresh = useCallback(() => {
4275
4614
  handleVerify();
4276
4615
  }, [handleVerify]);
@@ -4307,24 +4646,26 @@ function SwapDexTask({
4307
4646
  onRefresh: handleRefresh
4308
4647
  }
4309
4648
  ),
4310
- ((_a2 = task.points) == null ? void 0 : _a2.amount) != null && task.points.amount > 0 && /* @__PURE__ */ jsxs("span", { className: "taskon-task-item-points", children: [
4649
+ ((_a2 = task2.points) == null ? void 0 : _a2.amount) != null && task2.points.amount > 0 && /* @__PURE__ */ jsxs("span", { className: "taskon-task-item-points", children: [
4311
4650
  /* @__PURE__ */ jsx(
4312
4651
  TipPopover,
4313
4652
  {
4314
- content: `Complete tasks to earn ${pointsName}, which accumulate and are displayed in the ranking or lottery. The more ${pointsName} you have, the higher your chances of winning. Your total ${pointsName} will determine your ranking or lottery outcome at the end of the quest.`,
4653
+ content: t("task_point_desc", {
4654
+ pointsName
4655
+ }),
4315
4656
  children: /* @__PURE__ */ jsxs(
4316
4657
  "span",
4317
4658
  {
4318
4659
  className: `taskon-task-item-points-value ${isCompleted ? "taskon-task-item-points-value--completed" : ""}`,
4319
4660
  children: [
4320
4661
  "+",
4321
- task.points.amount
4662
+ task2.points.amount
4322
4663
  ]
4323
4664
  }
4324
4665
  )
4325
4666
  }
4326
4667
  ),
4327
- isPeriodic && /* @__PURE__ */ jsx("span", { className: "taskon-task-item-points-time", children: "/Time" })
4668
+ isPeriodic && /* @__PURE__ */ jsx("span", { className: "taskon-task-item-points-time", children: t("points_per_time") })
4328
4669
  ] })
4329
4670
  ] });
4330
4671
  }
@@ -4342,9 +4683,10 @@ function SwapDexTask({
4342
4683
  isActive,
4343
4684
  isLoggedIn,
4344
4685
  handleRefresh,
4345
- (_c = task.points) == null ? void 0 : _c.amount,
4686
+ (_c = task2.points) == null ? void 0 : _c.amount,
4346
4687
  isPeriodic,
4347
- isCompleted
4688
+ isCompleted,
4689
+ t
4348
4690
  ]);
4349
4691
  const showVerifyButton = useMemo(() => {
4350
4692
  if (isDynamicPoint || isDynamicTimes) {
@@ -4377,30 +4719,30 @@ function SwapDexTask({
4377
4719
  /* @__PURE__ */ jsx("div", { className: `taskon-swap-task ${className || ""}`, children: /* @__PURE__ */ jsx(
4378
4720
  TaskCardBase,
4379
4721
  {
4380
- taskId: task.id,
4381
- templateId: task.template_id,
4722
+ taskId: task2.id,
4723
+ templateId: task2.template_id,
4382
4724
  title,
4383
4725
  icon: communityLogo,
4384
4726
  isCompleted,
4385
4727
  isSubmitted,
4386
4728
  isLoading,
4387
4729
  disabled,
4388
- recurrenceType: task.recurrence,
4730
+ recurrenceType: task2.recurrence,
4389
4731
  isPeriodic,
4390
4732
  isCurrentDone,
4391
4733
  coolDownRemaining,
4392
4734
  onCooldownComplete,
4393
- pointsValue: isDynamicPoint || isDynamicTimes ? void 0 : (_d = task.points) == null ? void 0 : _d.amount,
4735
+ pointsValue: isDynamicPoint || isDynamicTimes ? void 0 : (_d = task2.points) == null ? void 0 : _d.amount,
4394
4736
  pointsSlot: dynamicPointsSlot,
4395
- pointsName: (_e = task.points) == null ? void 0 : _e.points_name,
4737
+ pointsName: (_e = task2.points) == null ? void 0 : _e.points_name,
4396
4738
  totalEarnedPoints: userStatus == null ? void 0 : userStatus.total_points,
4397
4739
  actionSlot: showVerifyButton ? /* @__PURE__ */ jsx(
4398
4740
  VerifyButton,
4399
4741
  {
4400
4742
  campaignId,
4401
- taskId: task.id,
4743
+ taskId: task2.id,
4402
4744
  chainType,
4403
- platform: task.platform,
4745
+ platform: task2.platform,
4404
4746
  onBeforeVerify,
4405
4747
  onSuccess: handleVerifyButtonSuccess,
4406
4748
  onError: handleVerifyButtonError
@@ -4408,25 +4750,27 @@ function SwapDexTask({
4408
4750
  ) : void 0,
4409
4751
  children: hasContent && /* @__PURE__ */ jsx(ExpandableContent, { children: /* @__PURE__ */ jsxs("div", { className: "taskon-swap-content", children: [
4410
4752
  isDynamicPoint && /* @__PURE__ */ jsxs("div", { className: "taskon-swap-rules-section", children: [
4411
- /* @__PURE__ */ jsx("div", { className: "taskon-swap-rules-title", children: "Rules" }),
4412
- /* @__PURE__ */ jsxs("div", { className: "taskon-swap-rules-content", children: [
4413
- /* @__PURE__ */ jsx("span", { children: "Every " }),
4414
- /* @__PURE__ */ jsxs("span", { className: "taskon-swap-rules-highlight", children: [
4415
- "$",
4416
- params.each_trading_volume || "0",
4417
- " USD"
4418
- ] }),
4419
- /* @__PURE__ */ jsx("span", { children: " will give you " }),
4420
- /* @__PURE__ */ jsx("span", { className: "taskon-swap-rules-highlight", children: params.each_receive_points }),
4421
- /* @__PURE__ */ jsxs("span", { className: "taskon-swap-rules-point-name", children: [
4422
- " ",
4423
- pointsName,
4424
- rulesMaxText && /* @__PURE__ */ jsx("span", { className: "taskon-swap-rules-max", children: rulesMaxText })
4425
- ] })
4426
- ] })
4753
+ /* @__PURE__ */ jsx("div", { className: "taskon-swap-rules-title", children: t("rules") }),
4754
+ /* @__PURE__ */ jsx("div", { className: "taskon-swap-rules-content", children: /* @__PURE__ */ jsx(
4755
+ I18nT,
4756
+ {
4757
+ t,
4758
+ i18nKey: "swap_rule_sentence",
4759
+ components: {
4760
+ volume: /* @__PURE__ */ jsxs("span", { className: "taskon-swap-rules-highlight", children: [
4761
+ "$",
4762
+ params.each_trading_volume || "0",
4763
+ " USD"
4764
+ ] }),
4765
+ points: /* @__PURE__ */ jsx("span", { className: "taskon-swap-rules-highlight", children: params.each_receive_points }),
4766
+ pointName: /* @__PURE__ */ jsx("span", { className: "taskon-swap-rules-point-name", children: pointsName }),
4767
+ maxText: rulesMaxText ? /* @__PURE__ */ jsx("span", { className: "taskon-swap-rules-max", children: rulesMaxText }) : null
4768
+ }
4769
+ }
4770
+ ) })
4427
4771
  ] }),
4428
4772
  params.desc && /* @__PURE__ */ jsxs("div", { className: "taskon-swap-instructions-section", children: [
4429
- /* @__PURE__ */ jsx("div", { className: "taskon-swap-instructions-title", children: "Instructions" }),
4773
+ /* @__PURE__ */ jsx("div", { className: "taskon-swap-instructions-title", children: t("instructions") }),
4430
4774
  /* @__PURE__ */ jsx("div", { className: "taskon-swap-instructions-content", children: /* @__PURE__ */ jsx(CardDescExpress, { label: params.desc, noMaxHeight: true }) })
4431
4775
  ] })
4432
4776
  ] }) })
@@ -4476,22 +4820,23 @@ function WarningIcon({ className }) {
4476
4820
  );
4477
4821
  }
4478
4822
  function CustomizedParamDialog({
4479
- open,
4823
+ open: open2,
4480
4824
  paramName,
4481
4825
  onConfirm,
4482
4826
  onCancel
4483
4827
  }) {
4828
+ const { t } = useTaskWidgetLocale();
4484
4829
  const [value2, setValue] = useState("");
4485
4830
  const [error, setError] = useState("");
4486
4831
  const handleConfirm = useCallback(() => {
4487
4832
  if (!value2.trim()) {
4488
- setError("This field is required");
4833
+ setError(t("this_field_required"));
4489
4834
  return;
4490
4835
  }
4491
4836
  onConfirm(value2.trim());
4492
4837
  setValue("");
4493
4838
  setError("");
4494
- }, [value2, onConfirm]);
4839
+ }, [onConfirm, t, value2]);
4495
4840
  const handleCancel = useCallback(() => {
4496
4841
  setValue("");
4497
4842
  setError("");
@@ -4504,35 +4849,21 @@ function CustomizedParamDialog({
4504
4849
  return /* @__PURE__ */ jsx(
4505
4850
  Dialog,
4506
4851
  {
4507
- open,
4852
+ open: open2,
4508
4853
  onOpenChange: (isOpen) => {
4509
4854
  if (!isOpen) handleCancel();
4510
4855
  },
4511
- title: `Submit ${paramName}`,
4856
+ title: t("submit_param_title", { paramName }),
4512
4857
  maxWidth: 440,
4513
4858
  children: /* @__PURE__ */ jsxs("div", { className: "taskon-outer-point-api-dialog", children: [
4514
- /* @__PURE__ */ jsxs("h3", { className: "taskon-outer-point-api-dialog-title", children: [
4515
- "Submit ",
4516
- paramName
4517
- ] }),
4859
+ /* @__PURE__ */ jsx("h3", { className: "taskon-outer-point-api-dialog-title", children: t("submit_param_title", { paramName }) }),
4518
4860
  /* @__PURE__ */ jsxs("div", { className: "taskon-outer-point-api-dialog-warning", children: [
4519
4861
  /* @__PURE__ */ jsx(WarningIcon, { className: "taskon-outer-point-api-dialog-warning-icon" }),
4520
- /* @__PURE__ */ jsxs("span", { children: [
4521
- "Warning: Please make sure you enter the correct ",
4522
- paramName,
4523
- ". Once submitted, it cannot be changed."
4524
- ] })
4525
- ] }),
4526
- /* @__PURE__ */ jsxs("p", { className: "taskon-outer-point-api-dialog-desc", children: [
4527
- "Enter your ",
4528
- paramName,
4529
- " to complete the verification. The system will use this information to verify your task completion."
4862
+ /* @__PURE__ */ jsx("span", { children: t("submit_param_warning", { paramName }) })
4530
4863
  ] }),
4864
+ /* @__PURE__ */ jsx("p", { className: "taskon-outer-point-api-dialog-desc", children: t("submit_param_desc", { paramName }) }),
4531
4865
  /* @__PURE__ */ jsxs("div", { className: "taskon-outer-point-api-dialog-input-wrap", children: [
4532
- /* @__PURE__ */ jsxs("label", { className: "taskon-outer-point-api-dialog-label", children: [
4533
- "Enter ",
4534
- paramName
4535
- ] }),
4866
+ /* @__PURE__ */ jsx("label", { className: "taskon-outer-point-api-dialog-label", children: t("submit_param_enter_label", { paramName }) }),
4536
4867
  /* @__PURE__ */ jsx(
4537
4868
  "input",
4538
4869
  {
@@ -4540,7 +4871,7 @@ function CustomizedParamDialog({
4540
4871
  className: `taskon-outer-point-api-dialog-input ${error ? "taskon-outer-point-api-dialog-input--error" : ""}`,
4541
4872
  value: value2,
4542
4873
  onChange: handleChange,
4543
- placeholder: `Enter your ${paramName}`
4874
+ placeholder: t("submit_param_enter_placeholder", { paramName })
4544
4875
  }
4545
4876
  ),
4546
4877
  error && /* @__PURE__ */ jsx("span", { className: "taskon-outer-point-api-dialog-error", children: error })
@@ -4552,7 +4883,7 @@ function CustomizedParamDialog({
4552
4883
  type: "button",
4553
4884
  className: "taskon-outer-point-api-dialog-btn taskon-outer-point-api-dialog-btn--cancel",
4554
4885
  onClick: handleCancel,
4555
- children: "Cancel"
4886
+ children: t("cancel")
4556
4887
  }
4557
4888
  ),
4558
4889
  /* @__PURE__ */ jsx(
@@ -4561,7 +4892,7 @@ function CustomizedParamDialog({
4561
4892
  type: "button",
4562
4893
  className: "taskon-outer-point-api-dialog-btn taskon-outer-point-api-dialog-btn--confirm",
4563
4894
  onClick: handleConfirm,
4564
- children: "Confirm"
4895
+ children: t("confirm")
4565
4896
  }
4566
4897
  )
4567
4898
  ] })
@@ -4571,7 +4902,7 @@ function CustomizedParamDialog({
4571
4902
  }
4572
4903
  function OuterPointAPITask({
4573
4904
  campaignId,
4574
- task,
4905
+ task: task2,
4575
4906
  userStatus,
4576
4907
  onCompleted,
4577
4908
  onVerifyAttempted,
@@ -4583,18 +4914,19 @@ function OuterPointAPITask({
4583
4914
  className
4584
4915
  }) {
4585
4916
  var _a;
4917
+ const { t } = useTaskWidgetLocale();
4586
4918
  const { isLoggedIn } = useTaskOnAuth();
4587
4919
  const params = useMemo(() => {
4588
4920
  try {
4589
- return JSON.parse(task.params);
4921
+ return JSON.parse(task2.params);
4590
4922
  } catch {
4591
4923
  return {};
4592
4924
  }
4593
- }, [task.params]);
4925
+ }, [task2.params]);
4594
4926
  const isCompleted = (userStatus == null ? void 0 : userStatus.is_qualifier) || false;
4595
4927
  const isSubmitted = (userStatus == null ? void 0 : userStatus.is_submitter) || false;
4596
4928
  const isCurrentDone = (userStatus == null ? void 0 : userStatus.current_done) || false;
4597
- const isPeriodic = task.recurrence && task.recurrence !== "Once";
4929
+ const isPeriodic = task2.recurrence && task2.recurrence !== "Once";
4598
4930
  const coolDownRemaining = useMemo(() => {
4599
4931
  if (userStatus == null ? void 0 : userStatus.next_time) {
4600
4932
  const remaining = userStatus.next_time - Date.now();
@@ -4613,18 +4945,18 @@ function OuterPointAPITask({
4613
4945
  params.account_type !== "SNS" && !hasCustomizedParam ? params.network : void 0
4614
4946
  );
4615
4947
  const [verifyFailedNotice, setVerifyFailedNotice] = useState(null);
4616
- const { submit, isSubmitting } = useTaskSubmit({
4948
+ const { submit: submit2, isSubmitting } = useTaskSubmit({
4617
4949
  campaignId,
4618
- taskId: task.id,
4950
+ taskId: task2.id,
4619
4951
  snsType,
4620
4952
  chainType,
4621
- platform: task.platform,
4953
+ platform: task2.platform,
4622
4954
  onSuccess: (result) => {
4623
- onCompleted == null ? void 0 : onCompleted(task.id, result);
4624
- onVerifyAttempted == null ? void 0 : onVerifyAttempted(task.id, true, result);
4955
+ onCompleted == null ? void 0 : onCompleted(task2.id, result);
4956
+ onVerifyAttempted == null ? void 0 : onVerifyAttempted(task2.id, true, result);
4625
4957
  },
4626
4958
  onError: () => {
4627
- onVerifyAttempted == null ? void 0 : onVerifyAttempted(task.id, false);
4959
+ onVerifyAttempted == null ? void 0 : onVerifyAttempted(task2.id, false);
4628
4960
  },
4629
4961
  // 当后端返回 CAMPAIGN_INELIGIBILITY 时,复用现有 eligibility 检查逻辑
4630
4962
  onCampaignIneligibility: onBeforeVerify,
@@ -4646,8 +4978,8 @@ function OuterPointAPITask({
4646
4978
  setIsCheckingEligibility(false);
4647
4979
  }
4648
4980
  }
4649
- await submit(overrideValue);
4650
- }, [onBeforeVerify, submit]);
4981
+ await submit2(overrideValue);
4982
+ }, [onBeforeVerify, submit2]);
4651
4983
  const [isDialogOpen, setIsDialogOpen] = useState(false);
4652
4984
  const handleRefresh = useCallback(() => {
4653
4985
  const currentPoint = (userStatus == null ? void 0 : userStatus.total_points) || 0;
@@ -4664,32 +4996,32 @@ function OuterPointAPITask({
4664
4996
  const handleDialogCancel = useCallback(() => {
4665
4997
  setIsDialogOpen(false);
4666
4998
  }, []);
4667
- const pointsName = ((_a = task.points) == null ? void 0 : _a.points_name) || "Points";
4999
+ const pointsName = ((_a = task2.points) == null ? void 0 : _a.points_name) || t("points_name_fallback");
4668
5000
  const titleExpress = useMemo(() => {
4669
- const title = params.title || task.name;
5001
+ const title = params.title || task2.name;
4670
5002
  if (params.target_url && title) {
4671
5003
  return `{${title}}[link=${params.target_url}]`;
4672
5004
  }
4673
5005
  return void 0;
4674
- }, [params.title, params.target_url, task.name]);
5006
+ }, [params.title, params.target_url, task2.name]);
4675
5007
  const renderedTitle = useMemo(() => {
4676
5008
  if (titleExpress) {
4677
5009
  return /* @__PURE__ */ jsx(TitleExpress, { express: titleExpress });
4678
5010
  }
4679
- return params.title || task.name || task.template_id;
4680
- }, [titleExpress, params.title, task.name, task.template_id]);
5011
+ return params.title || task2.name || task2.template_id;
5012
+ }, [titleExpress, params.title, task2.name, task2.template_id]);
4681
5013
  const pointTip = useMemo(() => {
4682
5014
  if (!isStarted) {
4683
5015
  return {
4684
- title: `Max. ${pointsName}`,
4685
- content: "Maximum points available for this task."
5016
+ title: t("max_points_title", { pointName: pointsName }),
5017
+ content: t("dynamic_tip_max_points")
4686
5018
  };
4687
5019
  }
4688
5020
  return {
4689
- title: `Your ${pointsName}`,
4690
- content: "Points you've earned so far. Final rewards will be calculated when the quest ends."
5021
+ title: t("your_points_title", { pointName: pointsName }),
5022
+ content: t("dynamic_tip_your_points")
4691
5023
  };
4692
- }, [isStarted, pointsName]);
5024
+ }, [isStarted, pointsName, t]);
4693
5025
  const userDynamicPoint = (userStatus == null ? void 0 : userStatus.total_points) || 0;
4694
5026
  const dynamicPointsSlot = useMemo(() => {
4695
5027
  return /* @__PURE__ */ jsx(
@@ -4719,15 +5051,15 @@ function OuterPointAPITask({
4719
5051
  /* @__PURE__ */ jsx(
4720
5052
  TaskCardBase,
4721
5053
  {
4722
- taskId: task.id,
4723
- templateId: task.template_id,
5054
+ taskId: task2.id,
5055
+ templateId: task2.template_id,
4724
5056
  title: renderedTitle,
4725
5057
  icon: params.icon,
4726
5058
  isCompleted,
4727
5059
  isSubmitted,
4728
5060
  isLoading,
4729
5061
  disabled,
4730
- recurrenceType: task.recurrence,
5062
+ recurrenceType: task2.recurrence,
4731
5063
  isPeriodic,
4732
5064
  isCurrentDone,
4733
5065
  coolDownRemaining,
@@ -4788,7 +5120,7 @@ function getTaskComponent(templateId) {
4788
5120
  }
4789
5121
  function TaskItem({
4790
5122
  campaignId,
4791
- task,
5123
+ task: task2,
4792
5124
  userStatus,
4793
5125
  onCompleted,
4794
5126
  onVerifyAttempted,
@@ -4805,13 +5137,13 @@ function TaskItem({
4805
5137
  className
4806
5138
  }) {
4807
5139
  const TaskComponent = useMemo(() => {
4808
- return getTaskComponent(task.template_id);
4809
- }, [task.template_id]);
5140
+ return getTaskComponent(task2.template_id);
5141
+ }, [task2.template_id]);
4810
5142
  return /* @__PURE__ */ jsx(
4811
5143
  TaskComponent,
4812
5144
  {
4813
5145
  campaignId,
4814
- task,
5146
+ task: task2,
4815
5147
  userStatus,
4816
5148
  onCompleted,
4817
5149
  onVerifyAttempted,
@@ -4829,35 +5161,630 @@ function TaskItem({
4829
5161
  }
4830
5162
  );
4831
5163
  }
4832
- function RewardModuleDialog({
5164
+ const gte_100_least_1_kyc = ">=100 (At least 1 KYC)";
5165
+ const gte_20_basic_filtering_bot = ">=20 (Basic filtering bot)";
5166
+ const qualified_users_receive_reward = "All qualified users receive reward";
5167
+ const tasks_quest_verified_valid_some_tasks_may_verified_quest = "All the tasks of this quest is verified as valid, some tasks may verified by quest creator not by TaskOn.";
5168
+ const available = "Available";
5169
+ const awesome_already_meet_requirements = "Awesome! You already meet the requirements.";
5170
+ const babt_holder = "BABT holder";
5171
+ const binance_account_bound_token_bab = "Binance Account Bound Token (BAB)";
5172
+ const bind = "Bind";
5173
+ const bind_required_accounts = "Bind Required Accounts";
5174
+ const binding = "Binding...";
5175
+ const blind_box_reward = "Blind Box Reward";
5176
+ const bonus = "Bonus";
5177
+ const bound = "Bound";
5178
+ const campaign_id_required_please_provide_campaignid_via_props_widgetid = "Campaign ID is required. Please provide campaignId via props or widgetId.";
5179
+ const cap_airdropped_soon = "Cap will be airdropped soon...";
5180
+ const check_claim = "Check & Claim";
5181
+ const check_cap_element = "Check CAP on Element";
5182
+ const check_collection_opensea = "Check Collection on OpenSea";
5183
+ const chest_key = "Chest key";
5184
+ const claim = "Claim";
5185
+ const claim_again = "Claim Again";
5186
+ const claim_nft = "Claim NFT";
5187
+ const claim_failed = "Claim failed";
5188
+ const claim_successful = "Claim successful!";
5189
+ const claimed = "Claimed";
5190
+ const claiming_nft = "Claiming NFT...";
5191
+ const close = "Close";
5192
+ const complete_campaign = "Complete Campaign";
5193
+ const complete_action_first = "Complete action first";
5194
+ const complete_campaign_2 = "Complete the Campaign";
5195
+ const complete_qualify_rewards = "Complete to qualify for rewards!";
5196
+ const complete_milestone_name_first = "Complete {milestone_name} first";
5197
+ const completing = "Completing...";
5198
+ const congratulations = "Congratulations!";
5199
+ const start_to_earn = "Start Earning";
5200
+ const connecting_wallet = "Connecting wallet...";
5201
+ const continue_waiting = "Continue Waiting";
5202
+ const contract_address = "Contract Address";
5203
+ const copied = "Copied!";
5204
+ const copy_link = "Copy Link";
5205
+ const holder_own_least_one_token = "DID Holder(own at least one DID token)";
5206
+ const discord = "Discord";
5207
+ const discord_account_linked = "Discord Account Not Linked";
5208
+ const discord_role = "Discord Role";
5209
+ const ens_domains_eth = "ENS Domains (.eth)";
5210
+ const evm_chain = "EVM Chain";
5211
+ const exp_winner = "EXP/Winner";
5212
+ const ended = "Ended";
5213
+ const ending = "Ending in";
5214
+ const ends = "Ends In";
5215
+ const extra_reward_winners = "Extra reward for winners";
5216
+ const failed_claim_nft = "Failed to claim NFT";
5217
+ const failed_complete_quest = "Failed to complete quest";
5218
+ const failed_copy_nft_address = "Failed to copy NFT address:";
5219
+ const failed_download_poster = "Failed to download poster:";
5220
+ const failed_load_leaderboard = "Failed to load leaderboard";
5221
+ const failed_load_quest_detail = "Failed to load quest detail";
5222
+ const failed_load_quest_status = "Failed to load quest status";
5223
+ const failed_load_user_status = "Failed to load user status";
5224
+ const failed_load_winners = "Failed to load winners";
5225
+ const first_complete_gets_reward = "First to complete gets the reward";
5226
+ const getting_signature = "Getting signature...";
5227
+ const hold_tokens_one_following_service_providers = "Hold tokens from one of the following DID service providers:";
5228
+ const how_winner_selected = "How is winner be selected?";
5229
+ const resident_specific_countries_regions = "Is NOT a resident of specific countries/regions";
5230
+ const resident_specific_countries_regions_2 = "Is a resident of specific countries/regions";
5231
+ const join_quest_earlier_next_time = "Join the quest earlier next time!";
5232
+ const join_campaignname_me = "Join the {campaignName} with me 🙌";
5233
+ const leaderboard = "Leaderboard";
5234
+ const limited_spots_gas_free_claiming = "Limited spots for gas free claiming!";
5235
+ const link_wallet_address = "Link Wallet Address";
5236
+ const link_copied = "Link copied!";
5237
+ const loading = "Loading...";
5238
+ const lucky_draw = "Lucky Draw";
5239
+ const manually_upload = "Manually Upload";
5240
+ const points_required = "More Points Required";
5241
+ const tasks_required = "More Tasks Required";
5242
+ const na = "N/A";
5243
+ const nft_preview = "NFT Preview";
5244
+ const nft_airdropped_soon = "NFT will be airdropped soon...";
5245
+ const network_error_please_try_again = "Network error, please try again";
5246
+ const new_user_milestone = "New user of this milestone";
5247
+ const new_user_taskon = "New user to TaskOn";
5248
+ const no_data = "No Data";
5249
+ const no_participants = "No participants yet";
5250
+ const no_winners = "No winners yet";
5251
+ const qualified = "Not Qualified";
5252
+ const tasks_successfully_verified_better_luck_next_time = "Not all tasks are successfully verified, better luck next time!";
5253
+ const included_public_sybil_address_database = "Not included in a public sybil address database.";
5254
+ const ok = "OK";
5255
+ const only = "ONLY";
5256
+ const chain_verification = "On-chain Verification";
5257
+ const once_qualified_every_point_counts_toward_better_rewards = "Once qualified, every point counts toward better rewards!";
5258
+ const ongoing = "Ongoing";
5259
+ const qualifier_selected_winner_select_method_depends_settings_fcfs = "Only Qualifier can be selected as winner, the select method depends on the settings such as FCFS.";
5260
+ const oops = "Oops!";
5261
+ const oops_better_luck_next_time = "Oops! Better Luck Next Time!";
5262
+ const oops_seems_like_already_finished_quest = "Oops! Seems like You already finished this quest";
5263
+ const oops_seems_like_already_finished_quest_2 = "Oops! Seems like you already finished this quest";
5264
+ const oops_better_luck_next_time_2 = "Oops, Better Luck Next Time!";
5265
+ const open_blind_box = "Open Blind Box";
5266
+ const open = "Open to All";
5267
+ const own_least_amount_token_name_chain_label = "Own at least {amount} {token_name} on {chain_label}";
5268
+ const own_amount_name_nft_chain = "Own {amount} {name} NFT On {chain}";
5269
+ const participants_info = "Participants Info";
5270
+ const participants_any_user_who_complete_least_1_task_quest = "Participants: any user who complete at least 1 task of this quest.";
5271
+ const pending_transaction = "Pending Transaction";
5272
+ const please_bind_following_accounts_verify_eligibility = "Please bind the following accounts to verify eligibility.";
5273
+ const please_complete_mandatory_tasks = "Please complete all mandatory tasks";
5274
+ const please_complete_required_tasks_before_continuing = "Please complete all required tasks before continuing.";
5275
+ const please_complete_optional_tasks = "Please complete more optional tasks";
5276
+ const please_confirm_wallet = "Please confirm in your wallet";
5277
+ const please_keep_participating_tasks_e_g_keep_following_x = "Please keep participating in tasks (e.g. keep following on X) to stay eligible for winner draws!";
5278
+ const please_link_following_wallet_addresses_receive_rewards_required_fcfs = "Please link the following wallet addresses to receive rewards. This is required for FCFS rewards.";
5279
+ const please_link_following_wallet_addresses_receive_rewards_skip_step = "Please link the following wallet addresses to receive rewards. You can skip this step and link later before the campaign ends.";
5280
+ const points_history = "Points History";
5281
+ const points_winner = "Points/Winner";
5282
+ const position = "Position";
5283
+ const project_owner_selects_winners = "Project owner selects winners";
5284
+ const qr_code = "QR Code";
5285
+ const qualifier_point = "Qualifier Point";
5286
+ const qualifiers = "Qualifiers";
5287
+ const quest_eligibility = "Quest Eligibility";
5288
+ const quest_rewards = "Quest Rewards";
5289
+ const quest_found = "Quest not found";
5290
+ const random_amount = "Random Amount";
5291
+ const reach_poh_requirements = "Reach All POH Requirements";
5292
+ const reach_any_poh_requirements = "Reach Any POH Requirements";
5293
+ const read = "Read more";
5294
+ const refresh = "Refresh";
5295
+ const refresh_eligibility_status = "Refresh eligibility status";
5296
+ const refreshing = "Refreshing...";
5297
+ const retry = "Retry";
5298
+ const reward = "Reward";
5299
+ const reward_amount_revealed_once_quest_ends = "Reward amount will be revealed once quest ends.";
5300
+ const rewards = "Rewards";
5301
+ const rewards_missed = "Rewards Missed";
5302
+ const save = "Save";
5303
+ const share = "Share";
5304
+ const share_qr_code = "Share QR Code";
5305
+ const show_less = "Show less";
5306
+ const smart_blind_box = "Smart Blind Box";
5307
+ const social_accounts = "Social Accounts";
5308
+ const sorry_late = "Sorry you are late.";
5309
+ const space_id_domains_bnb_arb = "Space ID Domains (.bnb & .arb)";
5310
+ const starting = "Starting in";
5311
+ const starts = "Starts In";
5312
+ const stay_tuned_verified_users_eligible_compete_rewards = "Stay tuned! Only verified users are eligible to compete for rewards.";
5313
+ const submitters = "Submitters";
5314
+ const successfully_entered = "Successfully Entered!";
5315
+ const switching_network = "Switching network...";
5316
+ const system_drawing_winners = "System is Drawing Winners...";
5317
+ const system_automatically_select_winners = "System will automatically select winners in";
5318
+ const task = "Task";
5319
+ const completed = "Completed";
5320
+ const taskon_lv_level_higher = "TaskOn LV {level} or Higher";
5321
+ const taskon_lv_val = "TaskOn LV {val}";
5322
+ const taskon_poh_level_score_label = "Taskon POH Level {score_label}";
5323
+ const taskon_val_level_lv = "Taskon {val} Level {lv}";
5324
+ const tasks_incomplete = "Tasks Incomplete";
5325
+ const receive_address_t_changed = "This receive address can’t be changed:";
5326
+ const tier = "Tier";
5327
+ const ensure_fair_experience_submissions_identical_wallet_addresses_x_discord = "To ensure a fair experience, submissions with identical wallet addresses, X, Discord, or Telegram accounts, and email addresses are not permitted.";
5328
+ const receive_discord_role_reward_need_link_discord_account = "To receive the Discord Role reward, you need to link your Discord account.";
5329
+ const token_name = "Token Name";
5330
+ const token_rewards_pool = "Token Rewards Pool";
5331
+ const top_100 = "Top 100";
5332
+ const top_40_percent_50_percent = "Top 40%-50%";
5333
+ const top_ranked_users_win = "Top ranked users win";
5334
+ const total_rewards_pool = "Total Rewards Pool";
5335
+ const transaction_hash = "Transaction hash:";
5336
+ const transaction_pending = "Transaction pending...";
5337
+ const transaction_rejected_user = "Transaction was rejected by user.";
5338
+ const twitter = "Twitter";
5339
+ const txn_hash = "Txn Hash:";
5340
+ const unranked = "Unranked";
5341
+ const upcoming = "Upcoming";
5342
+ const user = "User";
5343
+ const validation_failed = "Validation Failed";
5344
+ const view_leaderboard = "View Leaderboard";
5345
+ const view_explorer = "View on Explorer";
5346
+ const view_participants_info_details = "View participants info details";
5347
+ const view_winners_list = "View winners list";
5348
+ const waiting_final_ranking_stay_tuned_see_win = "Waiting For Final Ranking, Stay tuned to see if you win!";
5349
+ const waiting_task_verification = "Waiting For Task Verification";
5350
+ const waiting_drawing_winners = "Waiting for drawing winners";
5351
+ const waiting_drawing_winners_stay_tuned_see_win = "Waiting for drawing winners, Stay tuned to see if you win!";
5352
+ const waiting_final_ranking_stay_tuned_see_win_2 = "Waiting for final ranking. Stay tuned to see if you win!";
5353
+ const waiting_project_owner_upload_winner_list_stay_tuned_see = "Waiting for project owner to upload the winner list, Stay tuned to see if you win!";
5354
+ const waiting_project_owner_upload_winner_list_stay_tuned_see_2 = "Waiting for project owner to upload the winner list. Stay tuned to see if you win!";
5355
+ const wallet_address = "Wallet Address";
5356
+ const wallet_addresses_sybil_lists_these_protocols = "Wallet addresses are not in the Sybil lists from these protocols:";
5357
+ const what_participants = "What is Participants?";
5358
+ const whitelist = "Whitelist";
5359
+ const whitelist_description = "Whitelist Description";
5360
+ const who_completes_least_1_task = "Who completes at least 1 task.";
5361
+ const who_completes_quest = "Who completes the quest.";
5362
+ const winner_bonus = "Winner Bonus";
5363
+ const winner_generated_following_chart = "Winner is generated from the following chart.";
5364
+ const winners = "Winners";
5365
+ const winners_randomly_selected = "Winners are randomly selected";
5366
+ const withdraw = "Withdraw";
5367
+ const x_twitter = "X (Twitter)";
5368
+ const x_account_verification = "X account Verification";
5369
+ const x_account_don_t_use_default_profile_image = "X account don't use default profile image";
5370
+ const you = "YOU";
5371
+ const won = "You Have Won";
5372
+ const here = "You are here";
5373
+ const qualified_rewards_tier = "You are not qualified for rewards in this tier.";
5374
+ const ranked = "You are not ranked yet.";
5375
+ const check_transaction_explorer = "You can check this transaction on explorer:";
5376
+ const complete_campaign_without_linking_won_t_able_claim_discord = "You can still complete the campaign without linking, but you won&apos;t be able to claim the Discord Role reward.";
5377
+ const already_claimed_nft_please_wait_transaction_confirmed = "You have already claimed this NFT, please wait for this transaction to be confirmed.";
5378
+ const won_multiple_rewards = "You have won multiple rewards!";
5379
+ const ranked_after_completing_mandatory_tasks_quest = "You will be ranked only after completing all mandatory tasks in this quest.";
5380
+ const estimated_rewards = "Your Estimated Rewards";
5381
+ const final_rewards = "Your Final Rewards";
5382
+ const ranking = "Your Ranking";
5383
+ const complete_task = "Your did not complete task:";
5384
+ const own_discord_role_community = "Your do not own a Discord Role {role} in {community}";
5385
+ const completed_task = "Your have completed task:";
5386
+ const own_discord_role_community_2 = "Your own a Discord Role {role} in {community}";
5387
+ const name_lv_lt_count = "Your {name} Lv is ≥/< {count}";
5388
+ const val_wallet_address_allowlist = "Your {val} wallet address is in the allowlist";
5389
+ const zkme_citizenship_nft_holder = "ZKMe Citizenship NFT holder";
5390
+ const better_luck = "better luck";
5391
+ const recaptcha_verification_required = "reCAPTCHA verification required";
5392
+ const val_higher = "{val} or Higher";
5393
+ const official = "⚠️ Not Official";
5394
+ const winners_2 = "👑 Winners";
5395
+ const eq_total_rewards_pool_pointname_total_pointname = "= Total Rewards Pool * Your {pointName} / Total {pointName}";
5396
+ const all = "ALL";
5397
+ const any = "ANY";
5398
+ const winners_announced = "All winners are to be announced by";
5399
+ const least_count_transaction_s_chain = "At least {count} transaction(s) on {chain}";
5400
+ const click_copy_address = "Click to copy: {address}";
5401
+ const complete = "Complete";
5402
+ const complete_onchain_action_number_actionid = "Complete Onchain Action #{actionId}";
5403
+ const completed_current_required_optional_tasks = "Completed: {current} / {required} optional tasks";
5404
+ const confirm = "Confirm";
5405
+ const did = "DID";
5406
+ const earned_current_required_points = "Earned: {current} / {required} points";
5407
+ const equivalent_amounts_token_name = "Equivalent amounts of {token_name}";
5408
+ const link_discord_account = "Link Discord Account";
5409
+ const meet_eligibilities_below = "Meet Eligibilities Below";
5410
+ const multiple_rewards_detail = "Multiple Rewards Detail";
5411
+ const poh_verification = "POH Verification";
5412
+ const please_earn_least_count_points_optional_tasks = "Please earn at least {count} points from optional tasks";
5413
+ const please_move_key_blind_box_open_blind_box = "Please move the key to the blind box to open the blind box";
5414
+ const points = "Points";
5415
+ const qualifier = "Qualifier";
5416
+ const quest = "Quest";
5417
+ const required = "REQUIRED";
5418
+ const rewards_per_winner = "Rewards Per Winner";
5419
+ const taskon_poh_level = "Taskon POH Level";
5420
+ const rankings_based_total_pointsname_earned_tasks_within_quest_instances = "The rankings are based on the total {pointsName} earned from all tasks within this quest. In instances of tied {pointsName}, submitters are ranked according to chronological order.";
5421
+ const tier_index = "Tier {index}";
5422
+ const top_percent = "Top {from}%-{to}%";
5423
+ const top = "Top {from}-{to}";
5424
+ const top_2 = "Top {to}";
5425
+ const top_percent_2 = "Top {to}%";
5426
+ const total_pointname = "Total {pointName}";
5427
+ const usd_token_name = "USD in {token_name}";
5428
+ const x_account_created_months_ago = "X account created more than {months} months ago";
5429
+ const x_account_count_followers = "X account with more than {count} followers";
5430
+ const database = "database";
5431
+ const participants_2 = "participants";
5432
+ const token = "token)";
5433
+ const pointsname_collected_tasks_completed_during_quest = "{pointsName} collected from all tasks completed during the quest.";
5434
+ const claim_again_send_new_transaction_recommended_when_sure_there = '"Claim Again" will send a new transaction it is only recommended when you are sure there is something wrong with the current transaction.';
5435
+ const fcfs = "FCFS";
5436
+ const ranking_2 = "Ranking";
5437
+ const before_join_please_meet_express_following_eligibilities = "Before you join please meet {express} the following Eligibilities";
5438
+ const complete_required_tasks_secure_valid_ranking = "Complete all {required} tasks to secure a valid ranking.";
5439
+ const holder_own_least_one_token_2 = "DID Holder(own at least one {did} token)";
5440
+ const member_discord_server_least_days = "Member of Discord server: {server} for at least {days} days";
5441
+ const included_public_sybil_address_database_2 = "Not included in a public sybil address {database}";
5442
+ const quest_includes_proof_work_pow_tasks_which_community_review = "This quest includes Proof of Work (POW) tasks, which {community} will review. Winners will be selected {only} after all tasks have been reviewed.";
5443
+ const waiting_community_reviewed_tasks = "Waiting for {community} Reviewed All Tasks";
5444
+ const lv_operator_count = "Your Lv is {operator} {count}";
5445
+ const name_lv_operator_count = "Your {name} Lv is {operator} {count}";
5446
+ const name_operator_count = "Your {name} is {operator} {count}";
5447
+ const pointname = "Your {pointName}";
5448
+ const amount_qualifier_pointsname = "{amount} Qualifier {pointsName}";
5449
+ const days_2 = "{days} days";
5450
+ const enMessages = {
5451
+ gte_100_least_1_kyc,
5452
+ gte_20_basic_filtering_bot,
5453
+ qualified_users_receive_reward,
5454
+ tasks_quest_verified_valid_some_tasks_may_verified_quest,
5455
+ available,
5456
+ awesome_already_meet_requirements,
5457
+ babt_holder,
5458
+ binance_account_bound_token_bab,
5459
+ bind,
5460
+ bind_required_accounts,
5461
+ binding,
5462
+ blind_box_reward,
5463
+ bonus,
5464
+ bound,
5465
+ campaign_id_required_please_provide_campaignid_via_props_widgetid,
5466
+ cap_airdropped_soon,
5467
+ check_claim,
5468
+ check_cap_element,
5469
+ check_collection_opensea,
5470
+ chest_key,
5471
+ claim,
5472
+ claim_again,
5473
+ claim_nft,
5474
+ claim_failed,
5475
+ claim_successful,
5476
+ claimed,
5477
+ claiming_nft,
5478
+ close,
5479
+ complete_campaign,
5480
+ complete_action_first,
5481
+ complete_campaign_2,
5482
+ complete_qualify_rewards,
5483
+ complete_milestone_name_first,
5484
+ completing,
5485
+ congratulations,
5486
+ start_to_earn,
5487
+ connecting_wallet,
5488
+ continue_waiting,
5489
+ contract_address,
5490
+ copied,
5491
+ copy_link,
5492
+ holder_own_least_one_token,
5493
+ discord,
5494
+ discord_account_linked,
5495
+ discord_role,
5496
+ ens_domains_eth,
5497
+ evm_chain,
5498
+ exp_winner,
5499
+ ended,
5500
+ ending,
5501
+ ends,
5502
+ extra_reward_winners,
5503
+ failed_claim_nft,
5504
+ failed_complete_quest,
5505
+ failed_copy_nft_address,
5506
+ failed_download_poster,
5507
+ failed_load_leaderboard,
5508
+ failed_load_quest_detail,
5509
+ failed_load_quest_status,
5510
+ failed_load_user_status,
5511
+ failed_load_winners,
5512
+ first_complete_gets_reward,
5513
+ getting_signature,
5514
+ hold_tokens_one_following_service_providers,
5515
+ how_winner_selected,
5516
+ resident_specific_countries_regions,
5517
+ resident_specific_countries_regions_2,
5518
+ join_quest_earlier_next_time,
5519
+ join_campaignname_me,
5520
+ leaderboard,
5521
+ limited_spots_gas_free_claiming,
5522
+ link_wallet_address,
5523
+ link_copied,
5524
+ loading,
5525
+ lucky_draw,
5526
+ manually_upload,
5527
+ points_required,
5528
+ tasks_required,
5529
+ na,
5530
+ nft_preview,
5531
+ nft_airdropped_soon,
5532
+ network_error_please_try_again,
5533
+ new_user_milestone,
5534
+ new_user_taskon,
5535
+ no_data,
5536
+ no_participants,
5537
+ no_winners,
5538
+ qualified,
5539
+ tasks_successfully_verified_better_luck_next_time,
5540
+ included_public_sybil_address_database,
5541
+ ok,
5542
+ only,
5543
+ chain_verification,
5544
+ once_qualified_every_point_counts_toward_better_rewards,
5545
+ ongoing,
5546
+ qualifier_selected_winner_select_method_depends_settings_fcfs,
5547
+ oops,
5548
+ oops_better_luck_next_time,
5549
+ oops_seems_like_already_finished_quest,
5550
+ oops_seems_like_already_finished_quest_2,
5551
+ oops_better_luck_next_time_2,
5552
+ open_blind_box,
4833
5553
  open,
5554
+ own_least_amount_token_name_chain_label,
5555
+ own_amount_name_nft_chain,
5556
+ participants_info,
5557
+ participants_any_user_who_complete_least_1_task_quest,
5558
+ pending_transaction,
5559
+ please_bind_following_accounts_verify_eligibility,
5560
+ please_complete_mandatory_tasks,
5561
+ please_complete_required_tasks_before_continuing,
5562
+ please_complete_optional_tasks,
5563
+ please_confirm_wallet,
5564
+ please_keep_participating_tasks_e_g_keep_following_x,
5565
+ please_link_following_wallet_addresses_receive_rewards_required_fcfs,
5566
+ please_link_following_wallet_addresses_receive_rewards_skip_step,
5567
+ points_history,
5568
+ points_winner,
5569
+ position,
5570
+ project_owner_selects_winners,
5571
+ qr_code,
5572
+ qualifier_point,
5573
+ qualifiers,
5574
+ quest_eligibility,
5575
+ quest_rewards,
5576
+ quest_found,
5577
+ random_amount,
5578
+ reach_poh_requirements,
5579
+ reach_any_poh_requirements,
5580
+ read,
5581
+ refresh,
5582
+ refresh_eligibility_status,
5583
+ refreshing,
5584
+ retry,
5585
+ reward,
5586
+ reward_amount_revealed_once_quest_ends,
5587
+ rewards,
5588
+ rewards_missed,
5589
+ save,
5590
+ share,
5591
+ share_qr_code,
5592
+ show_less,
5593
+ smart_blind_box,
5594
+ social_accounts,
5595
+ sorry_late,
5596
+ space_id_domains_bnb_arb,
5597
+ starting,
5598
+ starts,
5599
+ stay_tuned_verified_users_eligible_compete_rewards,
5600
+ submitters,
5601
+ successfully_entered,
5602
+ switching_network,
5603
+ system_drawing_winners,
5604
+ system_automatically_select_winners,
5605
+ task,
5606
+ completed,
5607
+ taskon_lv_level_higher,
5608
+ taskon_lv_val,
5609
+ taskon_poh_level_score_label,
5610
+ taskon_val_level_lv,
5611
+ tasks_incomplete,
5612
+ receive_address_t_changed,
5613
+ tier,
5614
+ ensure_fair_experience_submissions_identical_wallet_addresses_x_discord,
5615
+ receive_discord_role_reward_need_link_discord_account,
5616
+ token_name,
5617
+ token_rewards_pool,
5618
+ top_100,
5619
+ top_40_percent_50_percent,
5620
+ top_ranked_users_win,
5621
+ total_rewards_pool,
5622
+ transaction_hash,
5623
+ transaction_pending,
5624
+ transaction_rejected_user,
5625
+ twitter,
5626
+ txn_hash,
5627
+ unranked,
5628
+ upcoming,
5629
+ user,
5630
+ validation_failed,
5631
+ view_leaderboard,
5632
+ view_explorer,
5633
+ view_participants_info_details,
5634
+ view_winners_list,
5635
+ waiting_final_ranking_stay_tuned_see_win,
5636
+ waiting_task_verification,
5637
+ waiting_drawing_winners,
5638
+ waiting_drawing_winners_stay_tuned_see_win,
5639
+ waiting_final_ranking_stay_tuned_see_win_2,
5640
+ waiting_project_owner_upload_winner_list_stay_tuned_see,
5641
+ waiting_project_owner_upload_winner_list_stay_tuned_see_2,
5642
+ wallet_address,
5643
+ wallet_addresses_sybil_lists_these_protocols,
5644
+ what_participants,
5645
+ whitelist,
5646
+ whitelist_description,
5647
+ who_completes_least_1_task,
5648
+ who_completes_quest,
5649
+ winner_bonus,
5650
+ winner_generated_following_chart,
5651
+ winners,
5652
+ winners_randomly_selected,
5653
+ withdraw,
5654
+ x_twitter,
5655
+ x_account_verification,
5656
+ x_account_don_t_use_default_profile_image,
5657
+ you,
5658
+ won,
5659
+ here,
5660
+ qualified_rewards_tier,
5661
+ ranked,
5662
+ check_transaction_explorer,
5663
+ complete_campaign_without_linking_won_t_able_claim_discord,
5664
+ already_claimed_nft_please_wait_transaction_confirmed,
5665
+ won_multiple_rewards,
5666
+ ranked_after_completing_mandatory_tasks_quest,
5667
+ estimated_rewards,
5668
+ final_rewards,
5669
+ ranking,
5670
+ complete_task,
5671
+ own_discord_role_community,
5672
+ completed_task,
5673
+ own_discord_role_community_2,
5674
+ name_lv_lt_count,
5675
+ val_wallet_address_allowlist,
5676
+ zkme_citizenship_nft_holder,
5677
+ better_luck,
5678
+ recaptcha_verification_required,
5679
+ val_higher,
5680
+ official,
5681
+ winners_2,
5682
+ eq_total_rewards_pool_pointname_total_pointname,
5683
+ all,
5684
+ any,
5685
+ winners_announced,
5686
+ least_count_transaction_s_chain,
5687
+ click_copy_address,
5688
+ complete,
5689
+ complete_onchain_action_number_actionid,
5690
+ completed_current_required_optional_tasks,
5691
+ confirm,
5692
+ did,
5693
+ earned_current_required_points,
5694
+ equivalent_amounts_token_name,
5695
+ link_discord_account,
5696
+ meet_eligibilities_below,
5697
+ multiple_rewards_detail,
5698
+ poh_verification,
5699
+ please_earn_least_count_points_optional_tasks,
5700
+ please_move_key_blind_box_open_blind_box,
5701
+ points,
5702
+ qualifier,
5703
+ quest,
5704
+ required,
5705
+ rewards_per_winner,
5706
+ taskon_poh_level,
5707
+ rankings_based_total_pointsname_earned_tasks_within_quest_instances,
5708
+ tier_index,
5709
+ top_percent,
5710
+ top,
5711
+ top_2,
5712
+ top_percent_2,
5713
+ total_pointname,
5714
+ usd_token_name,
5715
+ x_account_created_months_ago,
5716
+ x_account_count_followers,
5717
+ database,
5718
+ participants_2,
5719
+ token,
5720
+ pointsname_collected_tasks_completed_during_quest,
5721
+ claim_again_send_new_transaction_recommended_when_sure_there,
5722
+ fcfs,
5723
+ ranking_2,
5724
+ before_join_please_meet_express_following_eligibilities,
5725
+ complete_required_tasks_secure_valid_ranking,
5726
+ holder_own_least_one_token_2,
5727
+ member_discord_server_least_days,
5728
+ included_public_sybil_address_database_2,
5729
+ quest_includes_proof_work_pow_tasks_which_community_review,
5730
+ waiting_community_reviewed_tasks,
5731
+ lv_operator_count,
5732
+ name_lv_operator_count,
5733
+ name_operator_count,
5734
+ pointname,
5735
+ amount_qualifier_pointsname,
5736
+ days_2
5737
+ };
5738
+ const loadMessages = createLocaleLoader(
5739
+ enMessages,
5740
+ {
5741
+ ko: () => import("./quest-ko-BMu3uRQJ.js").then((module2) => ({
5742
+ default: module2.default
5743
+ })),
5744
+ ja: () => import("./quest-ja-Depog33y.js").then((module2) => ({
5745
+ default: module2.default
5746
+ })),
5747
+ ru: () => import("./quest-ru-xne814Rw.js").then((module2) => ({
5748
+ default: module2.default
5749
+ })),
5750
+ es: () => import("./quest-es-Dyyy0zaw.js").then((module2) => ({
5751
+ default: module2.default
5752
+ }))
5753
+ }
5754
+ );
5755
+ function useQuestLocale() {
5756
+ return useTranslation({
5757
+ widgetId: "Quest",
5758
+ defaultMessages: enMessages,
5759
+ loadMessages
5760
+ });
5761
+ }
5762
+ function RewardModuleDialog({
5763
+ open: open2,
4834
5764
  onOpenChange,
4835
5765
  type,
4836
5766
  pointsInfo
4837
5767
  }) {
5768
+ const { t } = useQuestLocale();
4838
5769
  const isToken = type === "token";
4839
5770
  const isPoints = type === "points";
4840
5771
  const isNft = type === "nft";
4841
- const { messages, isLoading } = useWidgetLocale({
4842
- widgetId: "UserCenterWidget",
4843
- defaultMessages: enMessages,
4844
- loadMessages: (locale) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../../../UserCenter/locales/en.json": () => import("./UserCenterWidget-cADBSVg7.js").then((n) => n.w), "../../../../UserCenter/locales/ja.json": () => import("./usercenter-ja-B2465c1O.js"), "../../../../UserCenter/locales/ko.json": () => import("./usercenter-ko-xAEYxqLg.js") }), `../../../../UserCenter/locales/${locale}.json`, 7)
4845
- });
5772
+ const { messages, isLoading } = useUserCenterLocale();
4846
5773
  const tokenAssets = useTokenAssets({
4847
- autoLoad: open && isToken
5774
+ autoLoad: open2 && isToken
4848
5775
  });
4849
5776
  const tokenHistory = useRewardDetails({
4850
5777
  rewardType: RewardType.Token,
4851
- autoLoad: open && isToken
5778
+ autoLoad: open2 && isToken
4852
5779
  });
4853
5780
  const nftHistory = useRewardDetails({
4854
5781
  rewardType: RewardType.Nft,
4855
- autoLoad: open && isNft
5782
+ autoLoad: open2 && isNft
4856
5783
  });
4857
5784
  const [showWithdrawForm, setShowWithdrawForm] = useState(false);
4858
5785
  const [selectedTokenForWithdraw, setSelectedTokenForWithdraw] = useState(null);
4859
- const handleWithdraw = useCallback((token) => {
4860
- setSelectedTokenForWithdraw(token);
5786
+ const handleWithdraw = useCallback((token2) => {
5787
+ setSelectedTokenForWithdraw(token2);
4861
5788
  setShowWithdrawForm(true);
4862
5789
  }, []);
4863
5790
  const handleBatchWithdraw = useCallback(() => {
@@ -4866,14 +5793,21 @@ function RewardModuleDialog({
4866
5793
  }, []);
4867
5794
  const pointsHistory = usePointsHistory({
4868
5795
  pointsId: (pointsInfo == null ? void 0 : pointsInfo.points_id) ?? 0,
4869
- autoLoad: open && isPoints && Boolean(pointsInfo == null ? void 0 : pointsInfo.points_id)
5796
+ autoLoad: open2 && isPoints && Boolean(pointsInfo == null ? void 0 : pointsInfo.points_id)
4870
5797
  });
4871
5798
  const dialogTitle = useMemo(() => {
4872
- if (isToken) return messages.rewardToken ?? "Token";
4873
- if (isPoints) return messages.pointsHistory ?? "Points History";
4874
- if (isNft) return messages.rewardNft ?? "NFT";
5799
+ if (isToken) return messages.reward_token ?? t("token_name");
5800
+ if (isPoints) return messages.points_history ?? t("points_history");
5801
+ if (isNft) return "NFT";
4875
5802
  return "";
4876
- }, [isToken, isPoints, isNft, messages.rewardToken, messages.pointsHistory, messages.rewardNft]);
5803
+ }, [
5804
+ isToken,
5805
+ isPoints,
5806
+ isNft,
5807
+ messages.reward_token,
5808
+ messages.points_history,
5809
+ t
5810
+ ]);
4877
5811
  const handleOpenChange = useCallback(
4878
5812
  (nextOpen) => {
4879
5813
  if (!nextOpen) {
@@ -4888,7 +5822,7 @@ function RewardModuleDialog({
4888
5822
  /* @__PURE__ */ jsx(
4889
5823
  Dialog,
4890
5824
  {
4891
- open,
5825
+ open: open2,
4892
5826
  onOpenChange: handleOpenChange,
4893
5827
  title: dialogTitle,
4894
5828
  showCloseButton: true,
@@ -4906,7 +5840,6 @@ function RewardModuleDialog({
4906
5840
  tokenHistoryLoading: tokenHistory.loading,
4907
5841
  tokenHistoryError: tokenHistory.error,
4908
5842
  tokenHistoryPagination: tokenHistory.pagination,
4909
- messages,
4910
5843
  onWithdraw: handleWithdraw,
4911
5844
  onBatchWithdraw: handleBatchWithdraw
4912
5845
  }
@@ -4918,18 +5851,16 @@ function RewardModuleDialog({
4918
5851
  data: pointsHistory.data,
4919
5852
  loading: pointsHistory.loading,
4920
5853
  error: pointsHistory.error,
4921
- pagination: pointsHistory.pagination,
4922
- messages
5854
+ pagination: pointsHistory.pagination
4923
5855
  }
4924
- ) : /* @__PURE__ */ jsx(EmptyState, { message: messages.emptyPoints })),
5856
+ ) : /* @__PURE__ */ jsx(EmptyState, { message: messages.empty_points })),
4925
5857
  isNft && /* @__PURE__ */ jsx(
4926
5858
  NftRewardContent,
4927
5859
  {
4928
5860
  nftList: nftHistory.data,
4929
5861
  loading: nftHistory.loading,
4930
5862
  error: nftHistory.error,
4931
- pagination: nftHistory.pagination,
4932
- messages
5863
+ pagination: nftHistory.pagination
4933
5864
  }
4934
5865
  )
4935
5866
  ] })
@@ -4939,7 +5870,6 @@ function RewardModuleDialog({
4939
5870
  WithdrawForm,
4940
5871
  {
4941
5872
  open: showWithdrawForm,
4942
- messages,
4943
5873
  tokenAssets: tokenAssets.data,
4944
5874
  tokenAssetsLoading: tokenAssets.loading,
4945
5875
  initialTokenId: selectedTokenForWithdraw == null ? void 0 : selectedTokenForWithdraw.token_id,
@@ -7296,8 +8226,8 @@ function requireLottie() {
7296
8226
  }
7297
8227
  return aGuessT;
7298
8228
  }
7299
- function BezierEasing(points) {
7300
- this._p = points;
8229
+ function BezierEasing(points2) {
8230
+ this._p = points2;
7301
8231
  this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
7302
8232
  this._precomputed = false;
7303
8233
  this.get = this.get.bind(this);
@@ -9541,13 +10471,13 @@ function requireLottie() {
9541
10471
  }
9542
10472
  shapePath.setXYAt(pt4[0], pt4[1], "v", pos + 1);
9543
10473
  };
9544
- TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
9545
- shapePath.setXYAt(points[1], points[5], "o", pos);
9546
- shapePath.setXYAt(points[2], points[6], "i", pos + 1);
10474
+ TrimModifier.prototype.addSegmentFromArray = function(points2, shapePath, pos, newShape) {
10475
+ shapePath.setXYAt(points2[1], points2[5], "o", pos);
10476
+ shapePath.setXYAt(points2[2], points2[6], "i", pos + 1);
9547
10477
  if (newShape) {
9548
- shapePath.setXYAt(points[0], points[4], "v", pos);
10478
+ shapePath.setXYAt(points2[0], points2[4], "v", pos);
9549
10479
  }
9550
- shapePath.setXYAt(points[3], points[7], "v", pos + 1);
10480
+ shapePath.setXYAt(points2[3], points2[7], "v", pos + 1);
9551
10481
  };
9552
10482
  TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
9553
10483
  var pathsData = shapeData.pathsData;
@@ -12687,12 +13617,12 @@ function requireLottie() {
12687
13617
  this.k = this.prop.k;
12688
13618
  this.getValue(true);
12689
13619
  }
12690
- GradientProperty.prototype.comparePoints = function(values, points) {
13620
+ GradientProperty.prototype.comparePoints = function(values, points2) {
12691
13621
  var i = 0;
12692
13622
  var len = this.o.length / 2;
12693
13623
  var diff;
12694
13624
  while (i < len) {
12695
- diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
13625
+ diff = Math.abs(values[i * 4] - values[points2 * 4 + i * 2]);
12696
13626
  if (diff > 0.01) {
12697
13627
  return false;
12698
13628
  }
@@ -14138,7 +15068,7 @@ function requireLottie() {
14138
15068
  var pointInd;
14139
15069
  var segmentInd;
14140
15070
  var prevPoint;
14141
- var points;
15071
+ var points2;
14142
15072
  var segments;
14143
15073
  var partialLength;
14144
15074
  var totalLength;
@@ -14186,21 +15116,21 @@ function requireLottie() {
14186
15116
  currentLength = -Math.abs(currentLength) % pathInfo.tLength;
14187
15117
  }
14188
15118
  segmentInd = segments.length - 1;
14189
- points = segments[segmentInd].points;
14190
- pointInd = points.length - 1;
15119
+ points2 = segments[segmentInd].points;
15120
+ pointInd = points2.length - 1;
14191
15121
  while (currentLength < 0) {
14192
- currentLength += points[pointInd].partialLength;
15122
+ currentLength += points2[pointInd].partialLength;
14193
15123
  pointInd -= 1;
14194
15124
  if (pointInd < 0) {
14195
15125
  segmentInd -= 1;
14196
- points = segments[segmentInd].points;
14197
- pointInd = points.length - 1;
15126
+ points2 = segments[segmentInd].points;
15127
+ pointInd = points2.length - 1;
14198
15128
  }
14199
15129
  }
14200
15130
  }
14201
- points = segments[segmentInd].points;
14202
- prevPoint = points[pointInd - 1];
14203
- currentPoint = points[pointInd];
15131
+ points2 = segments[segmentInd].points;
15132
+ prevPoint = points2[pointInd - 1];
15133
+ currentPoint = points2[pointInd];
14204
15134
  partialLength = currentPoint.partialLength;
14205
15135
  }
14206
15136
  len = letters.length;
@@ -14290,9 +15220,9 @@ function requireLottie() {
14290
15220
  if (this._hasMaskedPath) {
14291
15221
  segmentInd = initSegmentInd;
14292
15222
  pointInd = initPointInd;
14293
- points = segments[segmentInd].points;
14294
- prevPoint = points[pointInd - 1];
14295
- currentPoint = points[pointInd];
15223
+ points2 = segments[segmentInd].points;
15224
+ prevPoint = points2[pointInd - 1];
15225
+ currentPoint = points2[pointInd];
14296
15226
  partialLength = currentPoint.partialLength;
14297
15227
  segmentLength = 0;
14298
15228
  }
@@ -14350,34 +15280,34 @@ function requireLottie() {
14350
15280
  currentLength += this._pathData.f.v;
14351
15281
  }
14352
15282
  while (flag) {
14353
- if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
15283
+ if (segmentLength + partialLength >= currentLength + animatorOffset || !points2) {
14354
15284
  perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
14355
15285
  xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
14356
15286
  yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
14357
15287
  matrixHelper.translate(-alignment[0] * letters[i].an * 5e-3, -(alignment[1] * yOff) * 0.01);
14358
15288
  flag = false;
14359
- } else if (points) {
15289
+ } else if (points2) {
14360
15290
  segmentLength += currentPoint.partialLength;
14361
15291
  pointInd += 1;
14362
- if (pointInd >= points.length) {
15292
+ if (pointInd >= points2.length) {
14363
15293
  pointInd = 0;
14364
15294
  segmentInd += 1;
14365
15295
  if (!segments[segmentInd]) {
14366
15296
  if (mask2.v.c) {
14367
15297
  pointInd = 0;
14368
15298
  segmentInd = 0;
14369
- points = segments[segmentInd].points;
15299
+ points2 = segments[segmentInd].points;
14370
15300
  } else {
14371
15301
  segmentLength -= currentPoint.partialLength;
14372
- points = null;
15302
+ points2 = null;
14373
15303
  }
14374
15304
  } else {
14375
- points = segments[segmentInd].points;
15305
+ points2 = segments[segmentInd].points;
14376
15306
  }
14377
15307
  }
14378
- if (points) {
15308
+ if (points2) {
14379
15309
  prevPoint = currentPoint;
14380
- currentPoint = points[pointInd];
15310
+ currentPoint = points2[pointInd];
14381
15311
  partialLength = currentPoint.partialLength;
14382
15312
  }
14383
15313
  }
@@ -18590,9 +19520,9 @@ function requireLottie() {
18590
19520
  var rndm = BMMath.random();
18591
19521
  return min + rndm * (max - min);
18592
19522
  }
18593
- function createPath(points, inTangents, outTangents, closed) {
19523
+ function createPath(points2, inTangents, outTangents, closed) {
18594
19524
  var i;
18595
- var len = points.length;
19525
+ var len = points2.length;
18596
19526
  var path = shapePool.newElement();
18597
19527
  path.setPathData(!!closed, len);
18598
19528
  var arrPlaceholder = [0, 0];
@@ -18601,7 +19531,7 @@ function requireLottie() {
18601
19531
  for (i = 0; i < len; i += 1) {
18602
19532
  inVertexPoint = inTangents && inTangents[i] ? inTangents[i] : arrPlaceholder;
18603
19533
  outVertexPoint = outTangents && outTangents[i] ? outTangents[i] : arrPlaceholder;
18604
- path.setTripleAt(points[i][0], points[i][1], outVertexPoint[0] + points[i][0], outVertexPoint[1] + points[i][1], inVertexPoint[0] + points[i][0], inVertexPoint[1] + points[i][1], i, true);
19534
+ path.setTripleAt(points2[i][0], points2[i][1], outVertexPoint[0] + points2[i][0], outVertexPoint[1] + points2[i][1], inVertexPoint[0] + points2[i][0], inVertexPoint[1] + points2[i][1], i, true);
18605
19535
  }
18606
19536
  return path;
18607
19537
  }
@@ -20538,18 +21468,18 @@ function requireLottie() {
20538
21468
  var i;
20539
21469
  var len = shapePath._length;
20540
21470
  var vertices2 = shapePath[prop];
20541
- var points = shapePath.v;
21471
+ var points2 = shapePath.v;
20542
21472
  var arr = createSizedArray(len);
20543
21473
  for (i = 0; i < len; i += 1) {
20544
21474
  if (prop === "i" || prop === "o") {
20545
- arr[i] = [vertices2[i][0] - points[i][0], vertices2[i][1] - points[i][1]];
21475
+ arr[i] = [vertices2[i][0] - points2[i][0], vertices2[i][1] - points2[i][1]];
20546
21476
  } else {
20547
21477
  arr[i] = [vertices2[i][0], vertices2[i][1]];
20548
21478
  }
20549
21479
  }
20550
21480
  return arr;
20551
21481
  },
20552
- points: function points(time2) {
21482
+ points: function points2(time2) {
20553
21483
  return this.vertices("v", time2);
20554
21484
  },
20555
21485
  inTangents: function inTangents(time2) {
@@ -21507,15 +22437,15 @@ var useLottie = function useLottie2(props, style) {
21507
22437
  };
21508
22438
  };
21509
22439
  function getContainerVisibility(container) {
21510
- var _container$getBoundin = container.getBoundingClientRect(), top = _container$getBoundin.top, height2 = _container$getBoundin.height;
21511
- var current = window.innerHeight - top;
22440
+ var _container$getBoundin = container.getBoundingClientRect(), top2 = _container$getBoundin.top, height2 = _container$getBoundin.height;
22441
+ var current = window.innerHeight - top2;
21512
22442
  var max = window.innerHeight + height2;
21513
22443
  return current / max;
21514
22444
  }
21515
22445
  function getContainerCursorPosition(container, cursorX, cursorY) {
21516
- var _container$getBoundin2 = container.getBoundingClientRect(), top = _container$getBoundin2.top, left = _container$getBoundin2.left, width2 = _container$getBoundin2.width, height2 = _container$getBoundin2.height;
22446
+ var _container$getBoundin2 = container.getBoundingClientRect(), top2 = _container$getBoundin2.top, left = _container$getBoundin2.left, width2 = _container$getBoundin2.width, height2 = _container$getBoundin2.height;
21517
22447
  var x = (cursorX - left) / width2;
21518
- var y = (cursorY - top) / height2;
22448
+ var y = (cursorY - top2) / height2;
21519
22449
  return {
21520
22450
  x,
21521
22451
  y
@@ -21741,6 +22671,7 @@ const bgImageUrl = new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgwAAA
21741
22671
  const BlindBoxDialog = forwardRef(
21742
22672
  function BlindBoxDialog2(props, ref) {
21743
22673
  const { onClose, onOpened } = props;
22674
+ const { t } = useQuestLocale();
21744
22675
  const stageRef = useRef(null);
21745
22676
  const dropZoneRef = useRef(null);
21746
22677
  const lottieRef = useRef(null);
@@ -22076,7 +23007,8 @@ const BlindBoxDialog = forwardRef(
22076
23007
  hasOpened && "taskon-quest-blindbox-chest--open"
22077
23008
  ].filter(Boolean).join(" ");
22078
23009
  return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-blindbox-dialog", children: [
22079
- /* @__PURE__ */ jsx("h2", { className: "taskon-quest-blindbox-dialog-title", children: "Please move the key to the blind box to open the blind box" }),
23010
+ /* @__PURE__ */ jsx("h2", { className: "taskon-quest-blindbox-dialog-title", children: t("open_blind_box") }),
23011
+ /* @__PURE__ */ jsx("p", { className: "taskon-quest-blindbox-dialog-subtitle", children: t("please_move_key_blind_box_open_blind_box") }),
22080
23012
  /* @__PURE__ */ jsxs("div", { ref: stageRef, className: "taskon-quest-blindbox-stage", children: [
22081
23013
  showBackground && /* @__PURE__ */ jsx("div", { className: "taskon-quest-blindbox-bg", children: /* @__PURE__ */ jsx("img", { src: bgImageUrl, alt: "", draggable: false }) }),
22082
23014
  /* @__PURE__ */ jsx("div", { ref: dropZoneRef, className: "taskon-quest-blindbox-dropzone" }),
@@ -22096,7 +23028,7 @@ const BlindBoxDialog = forwardRef(
22096
23028
  className: keyClassNames,
22097
23029
  style: keyStyle,
22098
23030
  src: keyImageUrl,
22099
- alt: "Chest key",
23031
+ alt: t("chest_key"),
22100
23032
  draggable: false,
22101
23033
  onPointerDown: handlePointerDown,
22102
23034
  onLoad: handleKeyLoad
@@ -22109,70 +23041,73 @@ const BlindBoxDialog = forwardRef(
22109
23041
  function TokenBalance({
22110
23042
  params
22111
23043
  }) {
22112
- return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22113
- "Own at least ",
22114
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.amount }),
22115
- " ",
22116
- params.token_name,
22117
- " on ",
22118
- params.chain_label
22119
- ] });
23044
+ const { t } = useQuestLocale();
23045
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("own_least_amount_token_name_chain_label", {
23046
+ amount: params.amount,
23047
+ token_name: params.token_name,
23048
+ chain_label: params.chain_label
23049
+ }) });
22120
23050
  }
22121
23051
  function NftHolder({
22122
23052
  params
22123
23053
  }) {
22124
- const [copied, setCopied] = useState(false);
23054
+ const { t } = useQuestLocale();
23055
+ const [copied2, setCopied] = useState(false);
22125
23056
  const handleCopy = async () => {
22126
23057
  try {
22127
23058
  await navigator.clipboard.writeText(params.nft_address);
22128
23059
  setCopied(true);
22129
23060
  setTimeout(() => setCopied(false), 2e3);
22130
23061
  } catch (err) {
22131
- console.error("Failed to copy NFT address:", err);
23062
+ console.error("failed_copy_nft_address", err);
22132
23063
  }
22133
23064
  };
22134
- return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22135
- "Own ",
22136
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.amount }),
22137
- " ",
22138
- /* @__PURE__ */ jsxs(
22139
- "span",
22140
- {
22141
- className: "taskon-quest-eligs-nft-name",
22142
- onClick: handleCopy,
22143
- title: copied ? "Copied!" : `Click to copy: ${params.nft_address}`,
22144
- children: [
22145
- params.nft_name,
22146
- copied && /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-copied", children: "Copied!" })
22147
- ]
23065
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: /* @__PURE__ */ jsx(
23066
+ I18nT,
23067
+ {
23068
+ t,
23069
+ i18nKey: "own_amount_name_nft_chain",
23070
+ values: {
23071
+ amount: params.amount,
23072
+ chain: params.chain_label
23073
+ },
23074
+ components: {
23075
+ name: /* @__PURE__ */ jsxs(
23076
+ "span",
23077
+ {
23078
+ className: "taskon-quest-eligs-nft-name",
23079
+ onClick: handleCopy,
23080
+ title: copied2 ? t("copied") : t("click_copy_address", { address: params.nft_address }),
23081
+ children: [
23082
+ params.nft_name,
23083
+ copied2 && /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-copied", children: t("copied") })
23084
+ ]
23085
+ }
23086
+ )
22148
23087
  }
22149
- ),
22150
- " ",
22151
- "NFT On ",
22152
- params.chain_label
22153
- ] });
23088
+ }
23089
+ ) });
22154
23090
  }
22155
23091
  function UserLevel({
22156
23092
  params
22157
23093
  }) {
22158
- return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22159
- "TaskOn LV",
22160
- " ",
22161
- /* @__PURE__ */ jsxs("span", { className: "taskon-quest-eligs-highlight", children: [
22162
- params.level,
22163
- " or Higher"
22164
- ] })
22165
- ] });
23094
+ const { t } = useQuestLocale();
23095
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("taskon_lv_level_higher", {
23096
+ level: params.level
23097
+ }) });
22166
23098
  }
22167
23099
  function NewUser() {
22168
- return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: "New user to TaskOn" });
23100
+ const { t } = useQuestLocale();
23101
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("new_user_taskon") });
22169
23102
  }
22170
23103
  function MilestoneNewUser() {
22171
- return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: "New user of this milestone" });
23104
+ const { t } = useQuestLocale();
23105
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("new_user_milestone") });
22172
23106
  }
22173
23107
  function SupportedCountry({
22174
23108
  params
22175
23109
  }) {
23110
+ const { t } = useQuestLocale();
22176
23111
  const [showTooltip, setShowTooltip] = useState(false);
22177
23112
  const countryLabel = params.supported_country.map((item) => item.name).join(", ");
22178
23113
  const isInclude = params.type === "Include";
@@ -22183,7 +23118,7 @@ function SupportedCountry({
22183
23118
  onMouseEnter: () => setShowTooltip(true),
22184
23119
  onMouseLeave: () => setShowTooltip(false),
22185
23120
  children: [
22186
- /* @__PURE__ */ jsx("span", { children: isInclude ? "Is a resident of specific countries/regions" : "Is NOT a resident of specific countries/regions" }),
23121
+ /* @__PURE__ */ jsx("span", { children: isInclude ? t("resident_specific_countries_regions_2") : t("resident_specific_countries_regions") }),
22187
23122
  showTooltip && countryLabel && /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-tooltip", children: countryLabel })
22188
23123
  ]
22189
23124
  }
@@ -22192,43 +23127,39 @@ function SupportedCountry({
22192
23127
  function CommunityPoint({
22193
23128
  params
22194
23129
  }) {
23130
+ const { t } = useQuestLocale();
22195
23131
  const isGte = params.operator === "Gte";
22196
- return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22197
- "Your",
22198
- " ",
22199
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.points.points_name }),
22200
- " ",
22201
- "is ",
22202
- isGte ? "≥" : "<",
22203
- " ",
22204
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.points.amount })
22205
- ] });
23132
+ const operatorLabel = isGte ? "" : "<";
23133
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("name_operator_count", {
23134
+ name: params.points.points_name,
23135
+ operator: operatorLabel,
23136
+ count: params.points.amount
23137
+ }) });
22206
23138
  }
22207
23139
  const TASKON_CLUB_COMMUNITY_ID = 2;
22208
23140
  function CommunityLevel({
22209
23141
  params
22210
23142
  }) {
23143
+ const { t } = useQuestLocale();
22211
23144
  const isGte = params.operator === "Gte";
23145
+ const operatorLabel = isGte ? "≥" : "<";
22212
23146
  const showName = params.community_id === TASKON_CLUB_COMMUNITY_ID && params.points_name;
22213
- return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22214
- "Your",
22215
- " ",
22216
- showName && /* @__PURE__ */ jsxs(Fragment, { children: [
22217
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.points_name }),
22218
- " "
22219
- ] }),
22220
- "Lv is ",
22221
- isGte ? "≥" : "<",
22222
- " ",
22223
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.level })
22224
- ] });
23147
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: showName ? t("name_lv_operator_count", {
23148
+ name: params.points_name || "",
23149
+ operator: operatorLabel,
23150
+ count: params.level
23151
+ }) : t("lv_operator_count", {
23152
+ operator: operatorLabel,
23153
+ count: params.level
23154
+ }) });
22225
23155
  }
22226
23156
  function CommunityTask({
22227
23157
  params
22228
23158
  }) {
23159
+ const { t } = useQuestLocale();
22229
23160
  const isNot = params.operator === "Not";
22230
23161
  return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22231
- isNot ? "Your did not complete task:" : "Your have completed task:",
23162
+ isNot ? t("complete_task") : t("completed_task"),
22232
23163
  " ",
22233
23164
  /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.task_name })
22234
23165
  ] });
@@ -22236,61 +23167,62 @@ function CommunityTask({
22236
23167
  function CommunityMilestone({
22237
23168
  params
22238
23169
  }) {
22239
- return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22240
- "Complete",
22241
- " ",
22242
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.milestone_name }),
22243
- " ",
22244
- "first"
22245
- ] });
23170
+ const { t } = useQuestLocale();
23171
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("complete_milestone_name_first", {
23172
+ milestone_name: params.milestone_name
23173
+ }) });
22246
23174
  }
22247
23175
  function JoinDiscord({
22248
23176
  params
22249
23177
  }) {
22250
- return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22251
- "Member of Discord server:",
22252
- " ",
22253
- /* @__PURE__ */ jsx(
22254
- "a",
22255
- {
22256
- className: "taskon-quest-eligs-link",
22257
- href: params.discord_link,
22258
- target: "_blank",
22259
- rel: "noopener noreferrer",
22260
- children: params.server_name
23178
+ const { t } = useQuestLocale();
23179
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: /* @__PURE__ */ jsx(
23180
+ I18nT,
23181
+ {
23182
+ t,
23183
+ i18nKey: "member_discord_server_least_days",
23184
+ values: { days: params.joined_days },
23185
+ components: {
23186
+ server: /* @__PURE__ */ jsx(
23187
+ "a",
23188
+ {
23189
+ className: "taskon-quest-eligs-link",
23190
+ href: params.discord_link,
23191
+ target: "_blank",
23192
+ rel: "noopener noreferrer",
23193
+ children: params.server_name
23194
+ }
23195
+ )
22261
23196
  }
22262
- ),
22263
- " ",
22264
- "for at least",
22265
- " ",
22266
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.joined_days }),
22267
- " ",
22268
- "days"
22269
- ] });
23197
+ }
23198
+ ) });
22270
23199
  }
22271
23200
  function DiscordRole({
22272
23201
  params,
22273
23202
  communityName
22274
23203
  }) {
23204
+ const { t } = useQuestLocale();
22275
23205
  const isNot = params.operator === "Not";
22276
- return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22277
- isNot ? "Your do not own a Discord Role" : "Your own a Discord Role",
22278
- " ",
22279
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.role }),
22280
- " ",
22281
- "in",
22282
- " ",
22283
- params.server_url ? /* @__PURE__ */ jsx(
22284
- "a",
22285
- {
22286
- className: "taskon-quest-eligs-link",
22287
- href: params.server_url,
22288
- target: "_blank",
22289
- rel: "noopener noreferrer",
22290
- children: communityName
22291
- }
22292
- ) : /* @__PURE__ */ jsx("span", { children: communityName })
22293
- ] });
23206
+ const i18nKey = isNot ? "own_discord_role_community" : "own_discord_role_community_2";
23207
+ const communityNode = params.server_url ? /* @__PURE__ */ jsx(
23208
+ "a",
23209
+ {
23210
+ className: "taskon-quest-eligs-link",
23211
+ href: params.server_url,
23212
+ target: "_blank",
23213
+ rel: "noopener noreferrer",
23214
+ children: communityName
23215
+ }
23216
+ ) : /* @__PURE__ */ jsx("span", { children: communityName });
23217
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: /* @__PURE__ */ jsx(
23218
+ I18nT,
23219
+ {
23220
+ t,
23221
+ i18nKey,
23222
+ values: { role: params.role },
23223
+ components: { community: communityNode }
23224
+ }
23225
+ ) });
22294
23226
  }
22295
23227
  function capitalizeFirstLetter(str) {
22296
23228
  if (!str) return str;
@@ -22303,11 +23235,10 @@ function formatChainType(type) {
22303
23235
  function Whitelist({
22304
23236
  params
22305
23237
  }) {
22306
- return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22307
- "Your ",
22308
- formatChainType(params.chain_type),
22309
- " wallet address is in the allowlist"
22310
- ] });
23238
+ const { t } = useQuestLocale();
23239
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("val_wallet_address_allowlist", {
23240
+ val: formatChainType(params.chain_type)
23241
+ }) });
22311
23242
  }
22312
23243
  function ArrowIcon$1({ expanded }) {
22313
23244
  return /* @__PURE__ */ jsx(
@@ -22370,91 +23301,98 @@ const SYBIL_LINKS = {
22370
23301
  Optimism: "https://docs.google.com/spreadsheets/d/1kUAt-vrkID0yBkic72djWRxdliK8W_5rBGxq6-Iv3cg/edit?gid=822397105#gid=822397105"
22371
23302
  };
22372
23303
  const DID_LINKS = {
22373
- "ENS Domains (.eth)": "https://ens.domains/",
22374
- "Binance Account Bound Token (BAB)": "https://www.binance.com/en/babt",
22375
- "Space ID Domains (.bnb & .arb)": "https://space.id/"
23304
+ "ens_domains_eth": "https://ens.domains/",
23305
+ "binance_account_bound_token_bab": "https://www.binance.com/en/babt",
23306
+ "space_id_domains_bnb_arb": "https://space.id/"
22376
23307
  };
22377
23308
  function SybilDataBase() {
23309
+ const { t } = useQuestLocale();
22378
23310
  const [showTooltip, setShowTooltip] = useState(false);
22379
- return /* @__PURE__ */ jsxs("span", { className: "taskon-quest-eligs-onchain-item", children: [
22380
- "Not included in a public sybil address",
22381
- " ",
22382
- /* @__PURE__ */ jsxs(
22383
- "span",
22384
- {
22385
- className: "taskon-quest-eligs-onchain-link",
22386
- onMouseEnter: () => setShowTooltip(true),
22387
- onMouseLeave: () => setShowTooltip(false),
22388
- children: [
22389
- "database",
22390
- showTooltip && /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-onchain-tooltip", children: [
22391
- /* @__PURE__ */ jsx("p", { children: "Wallet addresses are not in the Sybil lists from these protocols:" }),
22392
- /* @__PURE__ */ jsx("ul", { children: Object.entries(SYBIL_LINKS).map(([name2, url]) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
22393
- "a",
22394
- {
22395
- href: url,
22396
- target: "_blank",
22397
- rel: "noopener noreferrer",
22398
- className: "taskon-quest-eligs-onchain-tooltip-link",
22399
- children: name2
22400
- }
22401
- ) }, name2)) })
22402
- ] })
22403
- ]
23311
+ return /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-onchain-item", children: /* @__PURE__ */ jsx(
23312
+ I18nT,
23313
+ {
23314
+ t,
23315
+ i18nKey: "included_public_sybil_address_database_2",
23316
+ components: {
23317
+ database: /* @__PURE__ */ jsxs(
23318
+ "span",
23319
+ {
23320
+ className: "taskon-quest-eligs-onchain-link",
23321
+ onMouseEnter: () => setShowTooltip(true),
23322
+ onMouseLeave: () => setShowTooltip(false),
23323
+ children: [
23324
+ t("database"),
23325
+ showTooltip && /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-onchain-tooltip", children: [
23326
+ /* @__PURE__ */ jsx("p", { children: t("wallet_addresses_sybil_lists_these_protocols") }),
23327
+ /* @__PURE__ */ jsx("ul", { children: Object.entries(SYBIL_LINKS).map(([name2, url]) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
23328
+ "a",
23329
+ {
23330
+ href: url,
23331
+ target: "_blank",
23332
+ rel: "noopener noreferrer",
23333
+ className: "taskon-quest-eligs-onchain-tooltip-link",
23334
+ children: name2
23335
+ }
23336
+ ) }, name2)) })
23337
+ ] })
23338
+ ]
23339
+ }
23340
+ )
22404
23341
  }
22405
- )
22406
- ] });
23342
+ }
23343
+ ) });
22407
23344
  }
22408
23345
  function DIDDataBase() {
23346
+ const { t } = useQuestLocale();
22409
23347
  const [showTooltip, setShowTooltip] = useState(false);
22410
- return /* @__PURE__ */ jsxs("span", { className: "taskon-quest-eligs-onchain-item", children: [
22411
- "DID Holder(own at least one",
22412
- " ",
22413
- /* @__PURE__ */ jsxs(
22414
- "span",
22415
- {
22416
- className: "taskon-quest-eligs-onchain-link",
22417
- onMouseEnter: () => setShowTooltip(true),
22418
- onMouseLeave: () => setShowTooltip(false),
22419
- children: [
22420
- "DID",
22421
- showTooltip && /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-onchain-tooltip", children: [
22422
- /* @__PURE__ */ jsx("p", { children: "Hold tokens from one of the following DID service providers:" }),
22423
- /* @__PURE__ */ jsx("ul", { children: Object.entries(DID_LINKS).map(([name2, url]) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
22424
- "a",
22425
- {
22426
- href: url,
22427
- target: "_blank",
22428
- rel: "noopener noreferrer",
22429
- className: "taskon-quest-eligs-onchain-tooltip-link",
22430
- children: name2
22431
- }
22432
- ) }, name2)) })
22433
- ] })
22434
- ]
23348
+ return /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-onchain-item", children: /* @__PURE__ */ jsx(
23349
+ I18nT,
23350
+ {
23351
+ t,
23352
+ i18nKey: "holder_own_least_one_token_2",
23353
+ components: {
23354
+ did: /* @__PURE__ */ jsxs(
23355
+ "span",
23356
+ {
23357
+ className: "taskon-quest-eligs-onchain-link",
23358
+ onMouseEnter: () => setShowTooltip(true),
23359
+ onMouseLeave: () => setShowTooltip(false),
23360
+ children: [
23361
+ t("did"),
23362
+ showTooltip && /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-onchain-tooltip", children: [
23363
+ /* @__PURE__ */ jsx("p", { children: t("hold_tokens_one_following_service_providers") }),
23364
+ /* @__PURE__ */ jsx("ul", { children: Object.entries(DID_LINKS).map(([name2, url]) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
23365
+ "a",
23366
+ {
23367
+ href: url,
23368
+ target: "_blank",
23369
+ rel: "noopener noreferrer",
23370
+ className: "taskon-quest-eligs-onchain-tooltip-link",
23371
+ children: name2
23372
+ }
23373
+ ) }, name2)) })
23374
+ ] })
23375
+ ]
23376
+ }
23377
+ )
22435
23378
  }
22436
- ),
22437
- " ",
22438
- "token)"
22439
- ] });
23379
+ }
23380
+ ) });
22440
23381
  }
22441
23382
  function OnChainVerify({
22442
23383
  params
22443
23384
  }) {
22444
23385
  var _a, _b;
23386
+ const { t } = useQuestLocale();
22445
23387
  const hasConditions = ((_a = params.tx_num_verify) == null ? void 0 : _a.tx_num) || params.sybil_address_verify || params.did_holder_verify;
22446
23388
  if (!hasConditions) {
22447
- return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: "On-chain Verification" });
23389
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("chain_verification") });
22448
23390
  }
22449
- return /* @__PURE__ */ jsxs(SubEligsContainer, { label: "On-chain Verification", children: [
22450
- ((_b = params.tx_num_verify) == null ? void 0 : _b.tx_num) != null && params.tx_num_verify.tx_num > 0 && /* @__PURE__ */ jsxs("li", { children: [
22451
- "At least",
22452
- " ",
22453
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.tx_num_verify.tx_num }),
22454
- " ",
22455
- "transaction(s) on ",
22456
- params.tx_num_verify.chain
22457
- ] }),
23391
+ return /* @__PURE__ */ jsxs(SubEligsContainer, { label: t("chain_verification"), children: [
23392
+ ((_b = params.tx_num_verify) == null ? void 0 : _b.tx_num) != null && params.tx_num_verify.tx_num > 0 && /* @__PURE__ */ jsx("li", { children: t("least_count_transaction_s_chain", {
23393
+ count: params.tx_num_verify.tx_num,
23394
+ chain: params.tx_num_verify.chain
23395
+ }) }),
22458
23396
  params.sybil_address_verify && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SybilDataBase, {}) }),
22459
23397
  params.did_holder_verify && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(DIDDataBase, {}) })
22460
23398
  ] });
@@ -22466,48 +23404,42 @@ function getMonthFromMillSec(ms) {
22466
23404
  function XAccountVerify({
22467
23405
  params
22468
23406
  }) {
23407
+ const { t } = useQuestLocale();
22469
23408
  const hasConditions = params.default_avatar_verify || params.min_followers || params.account_created_before;
22470
23409
  if (!hasConditions) {
22471
- return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: "X account Verification" });
23410
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("x_account_verification") });
22472
23411
  }
22473
- return /* @__PURE__ */ jsxs(SubEligsContainer, { label: "X account Verification", children: [
22474
- params.default_avatar_verify && /* @__PURE__ */ jsx("li", { children: "X account don't use default profile image" }),
22475
- params.min_followers && /* @__PURE__ */ jsxs("li", { children: [
22476
- "X account with more than",
22477
- " ",
22478
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: params.min_followers }),
22479
- " ",
22480
- "followers"
22481
- ] }),
22482
- params.account_created_before && /* @__PURE__ */ jsxs("li", { children: [
22483
- "X account created more than",
22484
- " ",
22485
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: getMonthFromMillSec(params.account_created_before) }),
22486
- " ",
22487
- "months ago"
22488
- ] })
23412
+ return /* @__PURE__ */ jsxs(SubEligsContainer, { label: t("x_account_verification"), children: [
23413
+ params.default_avatar_verify && /* @__PURE__ */ jsx("li", { children: t("x_account_don_t_use_default_profile_image") }),
23414
+ params.min_followers && /* @__PURE__ */ jsx("li", { children: t("x_account_count_followers", {
23415
+ count: params.min_followers
23416
+ }) }),
23417
+ params.account_created_before && /* @__PURE__ */ jsx("li", { children: t("x_account_created_months_ago", {
23418
+ months: getMonthFromMillSec(params.account_created_before)
23419
+ }) })
22489
23420
  ] });
22490
23421
  }
22491
23422
  function Poh({
22492
23423
  params
22493
23424
  }) {
22494
23425
  var _a;
23426
+ const { t } = useQuestLocale();
22495
23427
  const isAnd = params.provider_express === "and";
22496
- const title = isAnd ? "Reach All POH Requirements" : "Reach Any POH Requirements";
23428
+ const title = isAnd ? t("reach_poh_requirements") : t("reach_any_poh_requirements");
22497
23429
  const providers = ((_a = params.providers) == null ? void 0 : _a.filter(
22498
23430
  (item) => item.type !== "KYC_NFT"
22499
23431
  )) || [];
22500
23432
  if (providers.length === 0) {
22501
- return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: "POH Verification" });
23433
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("poh_verification") });
22502
23434
  }
22503
23435
  return /* @__PURE__ */ jsx(SubEligsContainer, { label: title, children: providers.map((provider) => /* @__PURE__ */ jsx("li", { className: "taskon-quest-eligs-poh-provider", children: provider.title }, provider.provider_id)) });
22504
23436
  }
22505
- function getScoreTypeLabel(scoreType) {
23437
+ function getScoreTypeLabel(scoreType, t) {
22506
23438
  switch (scoreType) {
22507
23439
  case "BasicFilteringBot":
22508
- return ">=20 (Basic filtering bot)";
23440
+ return t("gte_20_basic_filtering_bot");
22509
23441
  case "AtLeast1KYC":
22510
- return ">=100 (At least 1 KYC)";
23442
+ return t("gte_100_least_1_kyc");
22511
23443
  default:
22512
23444
  return scoreType;
22513
23445
  }
@@ -22515,9 +23447,13 @@ function getScoreTypeLabel(scoreType) {
22515
23447
  function TaskonPohScore({
22516
23448
  params
22517
23449
  }) {
22518
- const scoreLabel = getScoreTypeLabel(params.score_type);
23450
+ const { t } = useQuestLocale();
23451
+ const scoreLabel = getScoreTypeLabel(
23452
+ params.score_type,
23453
+ t
23454
+ );
22519
23455
  return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-type", children: [
22520
- "Taskon POH Level",
23456
+ t("taskon_poh_level"),
22521
23457
  " ",
22522
23458
  /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-highlight", children: scoreLabel })
22523
23459
  ] });
@@ -22525,6 +23461,7 @@ function TaskonPohScore({
22525
23461
  function BABTHolder({
22526
23462
  params
22527
23463
  }) {
23464
+ const { t } = useQuestLocale();
22528
23465
  return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: /* @__PURE__ */ jsx(
22529
23466
  "a",
22530
23467
  {
@@ -22532,20 +23469,19 @@ function BABTHolder({
22532
23469
  href: "https://www.binance.com/en/BABT",
22533
23470
  target: "_blank",
22534
23471
  rel: "noopener noreferrer",
22535
- children: params.description || "BABT holder"
23472
+ children: params.description || t("babt_holder")
22536
23473
  }
22537
23474
  ) });
22538
23475
  }
22539
23476
  function ZKMeNftHolder() {
22540
- return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: "ZKMe Citizenship NFT holder" });
23477
+ const { t } = useQuestLocale();
23478
+ return /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-type", children: t("zkme_citizenship_nft_holder") });
22541
23479
  }
22542
23480
  function SubmitAction({
22543
23481
  params
22544
23482
  }) {
22545
- return /* @__PURE__ */ jsx(SubEligsContainer, { label: "Complete action first", children: /* @__PURE__ */ jsxs("li", { children: [
22546
- "Complete Onchain Action #",
22547
- params.action_id
22548
- ] }) });
23483
+ const { t } = useQuestLocale();
23484
+ return /* @__PURE__ */ jsx(SubEligsContainer, { label: t("complete_action_first"), children: /* @__PURE__ */ jsx("li", { children: t("complete_onchain_action_number_actionid", { actionId: params.action_id }) }) });
22549
23485
  }
22550
23486
  function PassedIcon$1() {
22551
23487
  return /* @__PURE__ */ jsxs(
@@ -22786,19 +23722,20 @@ function FailedIcon() {
22786
23722
  );
22787
23723
  }
22788
23724
  function RefreshButton({
22789
- loading,
23725
+ loading: loading2,
22790
23726
  onClick
22791
23727
  }) {
23728
+ const { t } = useQuestLocale();
22792
23729
  return /* @__PURE__ */ jsx(
22793
23730
  "button",
22794
23731
  {
22795
- className: `taskon-quest-eligs-refresh ${loading ? "taskon-quest-eligs-refresh--loading" : ""}`,
23732
+ className: `taskon-quest-eligs-refresh ${loading2 ? "taskon-quest-eligs-refresh--loading" : ""}`,
22796
23733
  onClick: (e) => {
22797
23734
  e.stopPropagation();
22798
23735
  onClick == null ? void 0 : onClick();
22799
23736
  },
22800
- disabled: loading,
22801
- title: "Refresh eligibility status",
23737
+ disabled: loading2,
23738
+ title: t("refresh_eligibility_status"),
22802
23739
  children: /* @__PURE__ */ jsx(
22803
23740
  "svg",
22804
23741
  {
@@ -22837,6 +23774,7 @@ function EligibilityInfo({
22837
23774
  defaultExpanded = false,
22838
23775
  showAnimation = false
22839
23776
  }) {
23777
+ const { t } = useQuestLocale();
22840
23778
  const [expanded, setExpanded] = useState(defaultExpanded);
22841
23779
  const status = useMemo(() => {
22842
23780
  return campaignEligible || null;
@@ -22873,13 +23811,16 @@ function EligibilityInfo({
22873
23811
  },
22874
23812
  children: [
22875
23813
  renderStatusIcon(),
22876
- /* @__PURE__ */ jsxs("div", { className: "taskon-quest-eligs-header-text", children: [
22877
- "Meet",
22878
- " ",
22879
- /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-header-express", children: express === "and" ? "ALL" : "ANY" }),
22880
- " ",
22881
- "Requirement Below"
22882
- ] }),
23814
+ /* @__PURE__ */ jsx("div", { className: "taskon-quest-eligs-header-text", children: /* @__PURE__ */ jsx(
23815
+ I18nT,
23816
+ {
23817
+ t,
23818
+ i18nKey: "before_join_please_meet_express_following_eligibilities",
23819
+ components: {
23820
+ express: /* @__PURE__ */ jsx("span", { className: "taskon-quest-eligs-header-express", children: express === "and" ? t("all") : t("any") })
23821
+ }
23822
+ }
23823
+ ) }),
22883
23824
  showRefresh && /* @__PURE__ */ jsx(RefreshButton, { loading: isRefreshing, onClick: onRefresh }),
22884
23825
  /* @__PURE__ */ jsx(ArrowIcon, { expanded })
22885
23826
  ]
@@ -22901,16 +23842,19 @@ function EligibilityInfo({
22901
23842
  }
22902
23843
  export {
22903
23844
  BlindBoxDialog as B,
22904
- ConfirmNoticeDialog as C,
23845
+ CardDescExpress as C,
22905
23846
  EligibilityInfo as E,
23847
+ I18nT as I,
22906
23848
  RewardModuleDialog as R,
22907
23849
  TitleExpress as T,
22908
- CardDescExpress as a,
22909
- useNftClaimFlow as b,
22910
- TaskItem as c,
22911
- Textarea as d,
22912
- EligibilityList as e,
23850
+ useNftClaimFlow as a,
23851
+ TaskItem as b,
23852
+ Textarea as c,
23853
+ useTaskWidgetLocale as d,
23854
+ useQuestLocale as e,
23855
+ EligibilityList as f,
22913
23856
  getDefaultExportFromCjs as g,
23857
+ ConfirmNoticeDialog as h,
22914
23858
  sanitizeHtml as s,
22915
23859
  useBindWallet as u
22916
23860
  };