@taskon/widget-react 0.0.1-beta.5 → 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 +9 -1
  3. package/dist/EligibilityInfo.css +46 -42
  4. package/dist/LeaderboardWidget.css +73 -71
  5. package/dist/PageBuilder.css +5 -0
  6. package/dist/Quest.css +18 -14
  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-CrMvOB8w.js → CommunityTaskList-Hde2OKHH.js} +360 -154
  12. package/dist/chunks/{EligibilityInfo-Beww12QX.js → EligibilityInfo-BV0Z2TgY.js} +533 -561
  13. package/dist/chunks/{LeaderboardWidget-DwuSpVl0.js → LeaderboardWidget-BNGRD5Bu.js} +270 -249
  14. package/dist/chunks/{PageBuilder-DsX6Tv0N.js → PageBuilder-C5DSHiW9.js} +5 -5
  15. package/dist/chunks/{Quest-CuD2LElS.js → Quest-DG9zfXJo.js} +72 -50
  16. package/dist/chunks/{TaskOnProvider-xUeP2Nro.js → TaskOnProvider-BhamHIyY.js} +34 -17
  17. package/dist/chunks/{ThemeProvider-Bt4UZ33y.js → ThemeProvider-mXLdLSkq.js} +81 -18
  18. package/dist/chunks/{UserCenterWidget-CvU6K4AC.js → UserCenterWidget-D5ttw4hO.js} +1328 -1337
  19. package/dist/chunks/{UserCenterWidget-CB0hnj-L.js → UserCenterWidget-jDO5zTN1.js} +298 -231
  20. package/dist/chunks/{dynamic-import-helper-WmIF58Sb.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-DhySaZL8.js → communitytask-ru-CZm2CPoV.js} +211 -1
  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-D-b5xcme.js → quest-es-Dyyy0zaw.js} +8 -93
  30. package/dist/chunks/{quest-ja-Dxd2vqBF.js → quest-ja-Depog33y.js} +8 -93
  31. package/dist/chunks/{quest-ko-CSmRWgK_.js → quest-ko-BMu3uRQJ.js} +8 -93
  32. package/dist/chunks/{quest-ru-CkEKv1_F.js → quest-ru-xne814Rw.js} +8 -93
  33. package/dist/chunks/usercenter-es-Dz3Wp2vV.js +512 -0
  34. package/dist/chunks/usercenter-ja-CKE4DJC6.js +512 -0
  35. package/dist/chunks/usercenter-ko-Dtpkn2qb.js +512 -0
  36. package/dist/chunks/usercenter-ru-DnBGee45.js +512 -0
  37. package/dist/community-task.d.ts +0 -390
  38. package/dist/community-task.js +2 -7
  39. package/dist/core.d.ts +29 -5
  40. package/dist/core.js +8 -9
  41. package/dist/index.d.ts +29 -701
  42. package/dist/index.js +18 -29
  43. package/dist/leaderboard.d.ts +0 -498
  44. package/dist/leaderboard.js +2 -16
  45. package/dist/page-builder.js +1 -1
  46. package/dist/quest.d.ts +0 -971
  47. package/dist/quest.js +2 -7
  48. package/dist/user-center.d.ts +0 -1610
  49. package/dist/user-center.js +2 -494
  50. package/package.json +2 -2
  51. package/dist/chunks/communitytask-es-1zawvXEX.js +0 -311
  52. package/dist/chunks/communitytask-ja-CmW6nP-L.js +0 -311
  53. package/dist/chunks/communitytask-ko-BD0hzQSi.js +0 -311
  54. package/dist/chunks/createLocaleLoader-BameiEhU.js +0 -65
  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,11 +1,10 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
- import React__default, { isValidElement, cloneElement, Fragment as Fragment$1, 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";
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$2, 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-CvU6K4AC.js";
6
- import { q as TaskOnContext, t as useTaskOnPortalContainer, u as useTaskOnAuth, b as useWidgetLocale } from "./ThemeProvider-Bt4UZ33y.js";
7
- import { u as useTranslation, c as createLocaleLoader } from "./createLocaleLoader-BameiEhU.js";
8
- import { D as Dialog, _ as __variableDynamicImportRuntimeHelper } from "./dynamic-import-helper-WmIF58Sb.js";
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";
9
8
  import '../EligibilityInfo.css';const SLOT_TOKEN_PREFIX = "__TASKON_I18NT_SLOT_";
10
9
  const SLOT_TOKEN_SUFFIX = "__";
11
10
  const SLOT_TOKEN_REGEXP = /__TASKON_I18NT_SLOT_([A-Za-z0-9_]+)__/g;
@@ -84,221 +83,6 @@ function I18nT({
84
83
  }
85
84
  return /* @__PURE__ */ jsx(WrapperElement, { children: content2 });
86
85
  }
87
- 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;
88
- 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;
89
- function getNoticeIcon(type) {
90
- if (type === "success") {
91
- return successIconUrl;
92
- }
93
- if (type === "warn") {
94
- return warnIconUrl;
95
- }
96
- return null;
97
- }
98
- function ConfirmNoticeDialog({
99
- open: open2,
100
- onOpenChange,
101
- type = "default",
102
- title,
103
- desc,
104
- col = false,
105
- cancelButton,
106
- confirmButton,
107
- onCancel,
108
- onConfirm,
109
- onClose,
110
- closeOnCancel = true,
111
- closeOnConfirm = true,
112
- cancelDisabled = false,
113
- confirmDisabled = false,
114
- showCloseButton = false,
115
- closeOnOverlayClick = true,
116
- closeOnEscapeKey = true,
117
- maxWidth = 470,
118
- className,
119
- contentClassName,
120
- children,
121
- actions,
122
- footer,
123
- accessibilityTitle,
124
- accessibilityDescription
125
- }) {
126
- const noticeIcon = getNoticeIcon(type);
127
- const shouldRenderDefaultActions = !actions && Boolean(cancelButton || confirmButton);
128
- const closeDialog = React__default.useCallback(() => {
129
- onOpenChange(false);
130
- onClose == null ? void 0 : onClose();
131
- }, [onOpenChange, onClose]);
132
- const handleOpenChange = React__default.useCallback(
133
- (nextOpen) => {
134
- onOpenChange(nextOpen);
135
- if (!nextOpen) {
136
- onClose == null ? void 0 : onClose();
137
- }
138
- },
139
- [onOpenChange, onClose]
140
- );
141
- const handleCancel = React__default.useCallback(() => {
142
- onCancel == null ? void 0 : onCancel();
143
- if (closeOnCancel) {
144
- closeDialog();
145
- }
146
- }, [onCancel, closeOnCancel, closeDialog]);
147
- const handleConfirm = React__default.useCallback(() => {
148
- onConfirm == null ? void 0 : onConfirm();
149
- if (closeOnConfirm) {
150
- closeDialog();
151
- }
152
- }, [onConfirm, closeOnConfirm, closeDialog]);
153
- const ariaTitle = accessibilityTitle ?? (typeof title === "string" ? title : "Confirm notice");
154
- return /* @__PURE__ */ jsx(
155
- Dialog,
156
- {
157
- open: open2,
158
- onOpenChange: handleOpenChange,
159
- title: ariaTitle,
160
- description: accessibilityDescription,
161
- showCloseButton,
162
- closeOnOverlayClick,
163
- closeOnEscapeKey,
164
- maxWidth,
165
- contentClassName: `taskon-confirm-notice-dialog ${contentClassName || ""}`.trim(),
166
- children: /* @__PURE__ */ jsxs(
167
- "div",
168
- {
169
- className: `taskon-confirm-notice taskon-confirm-notice--${type} ${className || ""}`.trim(),
170
- children: [
171
- noticeIcon && /* @__PURE__ */ jsx(
172
- "img",
173
- {
174
- className: "taskon-confirm-notice-icon",
175
- src: noticeIcon,
176
- alt: ""
177
- }
178
- ),
179
- title && /* @__PURE__ */ jsx("h3", { className: "taskon-confirm-notice-title", children: title }),
180
- desc && /* @__PURE__ */ jsx("p", { className: "taskon-confirm-notice-desc", children: desc }),
181
- children,
182
- (actions || shouldRenderDefaultActions) && /* @__PURE__ */ jsx(
183
- "div",
184
- {
185
- className: `taskon-confirm-notice-buttons ${col ? "taskon-confirm-notice-buttons--col" : ""}`.trim(),
186
- children: actions || /* @__PURE__ */ jsxs(Fragment, { children: [
187
- cancelButton && /* @__PURE__ */ jsx(
188
- "button",
189
- {
190
- type: "button",
191
- className: "taskon-confirm-notice-button taskon-confirm-notice-button--cancel",
192
- onClick: handleCancel,
193
- disabled: cancelDisabled,
194
- children: cancelButton
195
- }
196
- ),
197
- confirmButton && /* @__PURE__ */ jsx(
198
- "button",
199
- {
200
- type: "button",
201
- className: "taskon-confirm-notice-button taskon-confirm-notice-button--confirm",
202
- onClick: handleConfirm,
203
- disabled: confirmDisabled,
204
- children: confirmButton
205
- }
206
- )
207
- ] })
208
- }
209
- ),
210
- footer
211
- ]
212
- }
213
- )
214
- }
215
- );
216
- }
217
- const Textarea = forwardRef(
218
- function Textarea2({
219
- value: value2,
220
- onChange,
221
- maxLength,
222
- showCount = false,
223
- disabled = false,
224
- placeholder,
225
- hasError = false,
226
- className,
227
- rows,
228
- autoFocus = false
229
- }, ref) {
230
- const textareaRef = useRef(null);
231
- useEffect(() => {
232
- var _a;
233
- if (autoFocus) {
234
- (_a = textareaRef.current) == null ? void 0 : _a.focus();
235
- }
236
- }, [autoFocus]);
237
- const focus = useCallback(() => {
238
- var _a;
239
- (_a = textareaRef.current) == null ? void 0 : _a.focus();
240
- }, []);
241
- const focusAtStart = useCallback(() => {
242
- var _a;
243
- const el = textareaRef.current;
244
- if (el) {
245
- el.focus();
246
- (_a = el.setSelectionRange) == null ? void 0 : _a.call(el, 0, 0);
247
- el.scrollTop = 0;
248
- }
249
- }, []);
250
- const moveCursorToStart = useCallback(() => {
251
- var _a;
252
- const el = textareaRef.current;
253
- if (el) {
254
- (_a = el.setSelectionRange) == null ? void 0 : _a.call(el, 0, 0);
255
- el.scrollTop = 0;
256
- }
257
- }, []);
258
- const getElement = useCallback(() => {
259
- return textareaRef.current;
260
- }, []);
261
- useImperativeHandle(
262
- ref,
263
- () => ({
264
- focus,
265
- focusAtStart,
266
- moveCursorToStart,
267
- getElement
268
- }),
269
- [focus, focusAtStart, moveCursorToStart, getElement]
270
- );
271
- const handleChange = useCallback(
272
- (e) => {
273
- onChange(e.target.value);
274
- },
275
- [onChange]
276
- );
277
- const shouldShowCount = showCount && maxLength !== void 0;
278
- return /* @__PURE__ */ jsxs("div", { className: "taskon-textarea-wrap", children: [
279
- /* @__PURE__ */ jsx(
280
- "textarea",
281
- {
282
- ref: textareaRef,
283
- className: `taskon-textarea ${hasError ? "taskon-textarea--error" : ""} ${className || ""}`,
284
- value: value2,
285
- onChange: handleChange,
286
- maxLength,
287
- disabled,
288
- placeholder,
289
- rows
290
- }
291
- ),
292
- shouldShowCount && /* @__PURE__ */ jsxs("div", { className: "taskon-textarea-count", children: [
293
- /* @__PURE__ */ jsx("span", { className: "taskon-textarea-count-current", children: value2.length }),
294
- /* @__PURE__ */ jsxs("span", { children: [
295
- "/",
296
- maxLength
297
- ] })
298
- ] })
299
- ] });
300
- }
301
- );
302
86
  function detectEthereumProvider() {
303
87
  if (typeof window === "undefined") return false;
304
88
  return Boolean(window.ethereum);
@@ -590,253 +374,221 @@ function useBindWallet({
590
374
  hasAdapter
591
375
  };
592
376
  }
593
- function isNftRewardType(type) {
594
- return type === RewardType.Nft || type === RewardType.BMintedNft || type === RewardType.Cap;
595
- }
596
- function buildFallbackLayer(reward2) {
597
- return {
598
- winner_index: 0,
599
- layer_no: 0,
600
- reward: [reward2]
601
- };
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;
602
387
  }
603
- function useNftClaimFlow(options) {
604
- const {
605
- campaignId,
606
- targetType,
607
- onClaimSuccess,
608
- onClaimError,
609
- onWalletError,
610
- messages
611
- } = options;
612
- const { toast } = useToast();
613
- const { chainMap } = useChainMap();
614
- const [isClaimDialogOpen, setIsClaimDialogOpen] = useState(false);
615
- const [isWalletDialogOpen, setIsWalletDialogOpen] = useState(false);
616
- const [isPendingDialogOpen, setIsPendingDialogOpen] = useState(false);
617
- const [pendingTxDialogState, setPendingTxDialogState] = useState(null);
618
- const [pendingWalletClaimTarget, setPendingWalletClaimTarget] = useState(null);
619
- const pendingDecisionResolverRef = useRef(null);
620
- const resolvePendingDecision = useCallback((claimAgain) => {
621
- const resolver = pendingDecisionResolverRef.current;
622
- if (resolver) {
623
- pendingDecisionResolverRef.current = null;
624
- resolver(claimAgain);
625
- }
626
- }, []);
627
- useEffect(() => {
628
- return () => {
629
- resolvePendingDecision(false);
630
- };
631
- }, [resolvePendingDecision]);
632
- const {
633
- status: claimStatus,
634
- error: claimError,
635
- txHash: claimTxHash,
636
- claimingNft,
637
- claimNft,
638
- reset: resetClaim
639
- } = useNftClaim({
640
- onSuccess: (txHash, item) => {
641
- void (onClaimSuccess == null ? void 0 : onClaimSuccess(txHash, item.sourceReward, item.sourceLayer));
642
- },
643
- onError: (error, item) => {
644
- void (onClaimError == null ? void 0 : onClaimError(error, item.sourceReward, item.sourceLayer));
645
- },
646
- onPendingFound: async (pendingKey, txHash, chainName, item) => {
647
- const rewardValue = item.reward_value;
648
- const receiveAddress = typeof rewardValue.receiver_address === "string" ? rewardValue.receiver_address : void 0;
649
- resolvePendingDecision(false);
650
- setIsClaimDialogOpen(false);
651
- setPendingTxDialogState({
652
- pendingKey,
653
- txHash,
654
- chainName,
655
- receiveAddress
656
- });
657
- setIsPendingDialogOpen(true);
658
- return new Promise((resolve) => {
659
- pendingDecisionResolverRef.current = resolve;
660
- });
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
+ }
661
428
  },
662
- onNeedWalletDialog: () => {
663
- setIsClaimDialogOpen(false);
664
- setIsWalletDialogOpen(true);
665
- }
666
- });
667
- const claimExplorerUrl = useMemo(() => {
668
- if (!claimTxHash || !claimingNft) {
669
- return void 0;
670
- }
671
- const chainInfo = chainMap[claimingNft.chainName.toLowerCase()];
672
- if (!chainInfo) {
673
- return void 0;
429
+ [onOpenChange, onClose]
430
+ );
431
+ const handleCancel = React__default.useCallback(() => {
432
+ onCancel == null ? void 0 : onCancel();
433
+ if (closeOnCancel) {
434
+ closeDialog();
674
435
  }
675
- return getTxExplorerUrl(chainInfo, claimTxHash);
676
- }, [claimTxHash, claimingNft, chainMap]);
677
- const pendingExplorerUrl = useMemo(() => {
678
- if (!(pendingTxDialogState == null ? void 0 : pendingTxDialogState.txHash)) {
679
- return void 0;
436
+ }, [onCancel, closeOnCancel, closeDialog]);
437
+ const handleConfirm = React__default.useCallback(() => {
438
+ onConfirm == null ? void 0 : onConfirm();
439
+ if (closeOnConfirm) {
440
+ closeDialog();
680
441
  }
681
- const chainInfo = chainMap[pendingTxDialogState.chainName.toLowerCase()];
682
- if (!chainInfo) {
683
- 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
+ )
684
504
  }
685
- return getTxExplorerUrl(chainInfo, pendingTxDialogState.txHash);
686
- }, [pendingTxDialogState, chainMap]);
687
- const claimNftReward = useCallback(
688
- async (reward2, layer) => {
689
- if (!isNftRewardType(reward2.reward_type)) {
690
- return;
691
- }
692
- const targetLayer = layer ?? buildFallbackLayer(reward2);
693
- const target = {
694
- campaign_id: campaignId,
695
- target_type: targetType,
696
- reward_type: reward2.reward_type,
697
- reward_value: reward2.reward_value,
698
- reward_id: reward2.reward_id,
699
- sourceReward: reward2,
700
- sourceLayer: targetLayer
701
- };
702
- setPendingWalletClaimTarget(target);
703
- setIsClaimDialogOpen(true);
704
- await claimNft(target);
705
- },
706
- [campaignId, targetType, claimNft]
707
505
  );
708
- const isSupportedNftRewardType = useCallback((rewardType) => {
709
- return isNftRewardType(rewardType);
710
- }, []);
711
- const handleWalletConnect = useCallback(
712
- async (address, provider) => {
713
- const target = pendingWalletClaimTarget ?? (claimingNft == null ? void 0 : claimingNft.item);
714
- if (!target) {
715
- 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();
716
525
  }
717
- if (!provider || typeof provider.request !== "function") {
718
- 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;
719
538
  }
720
- const popupAdapter = createEthereumAdapterFromProvider(
721
- provider,
722
- {
723
- address
724
- }
725
- );
726
- setIsWalletDialogOpen(false);
727
- setIsClaimDialogOpen(true);
728
- await claimNft(target, popupAdapter);
729
- },
730
- [pendingWalletClaimTarget, claimingNft, claimNft]
731
- );
732
- const handleWalletError = useCallback(
733
- (errorMessage) => {
734
- onWalletError == null ? void 0 : onWalletError(errorMessage);
735
- if (!onWalletError) {
736
- 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;
737
546
  }
738
- },
739
- [onWalletError, toast]
740
- );
741
- const handlePendingContinueWaiting = useCallback(() => {
742
- setIsPendingDialogOpen(false);
743
- setPendingTxDialogState(null);
744
- setPendingWalletClaimTarget(null);
745
- resetClaim();
746
- resolvePendingDecision(false);
747
- }, [resetClaim, resolvePendingDecision]);
748
- const handlePendingClaimAgain = useCallback(() => {
749
- setIsPendingDialogOpen(false);
750
- setPendingTxDialogState(null);
751
- setIsClaimDialogOpen(true);
752
- resolvePendingDecision(true);
753
- }, [resolvePendingDecision]);
754
- const handleCloseClaimDialog = useCallback(() => {
755
- setIsClaimDialogOpen(false);
756
- setTimeout(() => {
757
- resetClaim();
758
- setPendingWalletClaimTarget(null);
759
- }, 200);
760
- }, [resetClaim]);
761
- const handleRetryClaim = useCallback(() => {
762
- if (!claimingNft) {
763
- return;
764
- }
765
- resetClaim();
766
- setPendingWalletClaimTarget(claimingNft.item);
767
- void claimNft(claimingNft.item);
768
- }, [claimingNft, resetClaim, claimNft]);
769
- const isClaiming = useMemo(() => {
770
- return ["checking", "connecting", "switching", "signing", "confirming", "pending"].includes(
771
- 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]
772
560
  );
773
- }, [claimStatus]);
774
- const dialogs = useMemo(() => {
775
- return /* @__PURE__ */ jsxs(Fragment, { children: [
776
- /* @__PURE__ */ jsx(
777
- ClaimNftDialog,
778
- {
779
- open: isClaimDialogOpen,
780
- onClose: handleCloseClaimDialog,
781
- status: claimStatus,
782
- error: claimError,
783
- txHash: claimTxHash,
784
- claimingNft,
785
- explorerUrl: claimExplorerUrl,
786
- messages: messages == null ? void 0 : messages.claimDialog,
787
- onRetry: handleRetryClaim
788
- }
789
- ),
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: [
790
569
  /* @__PURE__ */ jsx(
791
- PendingTxDialog,
570
+ "textarea",
792
571
  {
793
- open: isPendingDialogOpen,
794
- onClose: handlePendingContinueWaiting,
795
- onClaimAgain: handlePendingClaimAgain,
796
- onContinueWaiting: handlePendingContinueWaiting,
797
- txHash: pendingTxDialogState == null ? void 0 : pendingTxDialogState.txHash,
798
- explorerUrl: pendingExplorerUrl,
799
- receiveAddress: pendingTxDialogState == null ? void 0 : pendingTxDialogState.receiveAddress,
800
- 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
801
580
  }
802
581
  ),
803
- /* @__PURE__ */ jsx(
804
- BindWalletDialog,
805
- {
806
- open: isWalletDialogOpen,
807
- onOpenChange: setIsWalletDialogOpen,
808
- onConnect: handleWalletConnect,
809
- onError: handleWalletError
810
- }
811
- )
812
- ] });
813
- }, [
814
- isClaimDialogOpen,
815
- handleCloseClaimDialog,
816
- claimStatus,
817
- claimError,
818
- claimTxHash,
819
- claimingNft,
820
- claimExplorerUrl,
821
- messages,
822
- handleRetryClaim,
823
- isPendingDialogOpen,
824
- handlePendingContinueWaiting,
825
- handlePendingClaimAgain,
826
- pendingTxDialogState,
827
- pendingExplorerUrl,
828
- isWalletDialogOpen,
829
- handleWalletConnect,
830
- handleWalletError
831
- ]);
832
- return {
833
- claimNftReward,
834
- isSupportedNftRewardType,
835
- dialogs,
836
- claimingNft,
837
- isClaiming
838
- };
839
- }
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
+ ] })
589
+ ] });
590
+ }
591
+ );
840
592
  async function copyToClipboard(text2) {
841
593
  try {
842
594
  if (navigator.clipboard && navigator.clipboard.writeText) {
@@ -2146,6 +1898,286 @@ function CardDescExpress({
2146
1898
  }
2147
1899
  );
2148
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
+ }
2149
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;
2150
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;
2151
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;
@@ -2263,8 +2295,8 @@ function formatTime$1(ms) {
2263
2295
  const totalMinutes = Math.floor(totalSeconds / 60);
2264
2296
  const totalHours = Math.floor(totalMinutes / 60);
2265
2297
  if (totalHours > 24) {
2266
- const days2 = Math.ceil(ms / (1e3 * 60 * 60 * 24));
2267
- return `${days2} days`;
2298
+ const days = Math.ceil(ms / (1e3 * 60 * 60 * 24));
2299
+ return `${days} days`;
2268
2300
  }
2269
2301
  const hours = totalHours;
2270
2302
  const minutes = totalMinutes % 60;
@@ -2346,7 +2378,7 @@ const submit_param_enter_label = "Enter {paramName}";
2346
2378
  const submit_param_enter_placeholder = "Enter your {paramName}";
2347
2379
  const cancel = "Cancel";
2348
2380
  const confirm$1 = "Confirm";
2349
- const completed = "Completed";
2381
+ const completed$1 = "Completed";
2350
2382
  const interact_with_contract = "Interact With Contract";
2351
2383
  const points$1 = "Points";
2352
2384
  const proof_of_work = "Proof of Work";
@@ -2427,7 +2459,7 @@ const enMessages$1 = {
2427
2459
  submit_param_enter_placeholder,
2428
2460
  cancel,
2429
2461
  confirm: confirm$1,
2430
- completed,
2462
+ completed: completed$1,
2431
2463
  interact_with_contract,
2432
2464
  points: points$1,
2433
2465
  proof_of_work,
@@ -3172,7 +3204,6 @@ const VerifyButton = forwardRef(
3172
3204
  onError,
3173
3205
  className
3174
3206
  }, ref) {
3175
- const { toast } = useToast();
3176
3207
  const { t } = useTaskWidgetLocale();
3177
3208
  const [verifyFailedNotice, setVerifyFailedNotice] = useState(null);
3178
3209
  const {
@@ -3235,7 +3266,12 @@ const VerifyButton = forwardRef(
3235
3266
  );
3236
3267
  const handleClick = async () => {
3237
3268
  if (needLink && !isLinkClicked2) {
3238
- toast.error(t("please_view_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
+ });
3239
3275
  return;
3240
3276
  }
3241
3277
  if (onBeforeVerify) {
@@ -5132,7 +5168,6 @@ const tasks_quest_verified_valid_some_tasks_may_verified_quest = "All the tasks
5132
5168
  const available = "Available";
5133
5169
  const awesome_already_meet_requirements = "Awesome! You already meet the requirements.";
5134
5170
  const babt_holder = "BABT holder";
5135
- const before_join_please_meet = "Before you join please meet";
5136
5171
  const binance_account_bound_token_bab = "Binance Account Bound Token (BAB)";
5137
5172
  const bind = "Bind";
5138
5173
  const bind_required_accounts = "Bind Required Accounts";
@@ -5156,13 +5191,12 @@ const claiming_nft = "Claiming NFT...";
5156
5191
  const close = "Close";
5157
5192
  const complete_campaign = "Complete Campaign";
5158
5193
  const complete_action_first = "Complete action first";
5159
- const complete = "Complete all";
5160
5194
  const complete_campaign_2 = "Complete the Campaign";
5161
5195
  const complete_qualify_rewards = "Complete to qualify for rewards!";
5162
5196
  const complete_milestone_name_first = "Complete {milestone_name} first";
5163
5197
  const completing = "Completing...";
5164
5198
  const congratulations = "Congratulations!";
5165
- const connect_wallet_participate = "Connect Wallet to Participate";
5199
+ const start_to_earn = "Start Earning";
5166
5200
  const connecting_wallet = "Connecting wallet...";
5167
5201
  const continue_waiting = "Continue Waiting";
5168
5202
  const contract_address = "Contract Address";
@@ -5172,7 +5206,6 @@ const holder_own_least_one_token = "DID Holder(own at least one DID token)";
5172
5206
  const discord = "Discord";
5173
5207
  const discord_account_linked = "Discord Account Not Linked";
5174
5208
  const discord_role = "Discord Role";
5175
- const discord_role_2 = "Discord Role:";
5176
5209
  const ens_domains_eth = "ENS Domains (.eth)";
5177
5210
  const evm_chain = "EVM Chain";
5178
5211
  const exp_winner = "EXP/Winner";
@@ -5201,7 +5234,6 @@ const leaderboard = "Leaderboard";
5201
5234
  const limited_spots_gas_free_claiming = "Limited spots for gas free claiming!";
5202
5235
  const link_wallet_address = "Link Wallet Address";
5203
5236
  const link_copied = "Link copied!";
5204
- const loading_quest = "Loading quest...";
5205
5237
  const loading = "Loading...";
5206
5238
  const lucky_draw = "Lucky Draw";
5207
5239
  const manually_upload = "Manually Upload";
@@ -5218,7 +5250,6 @@ const no_participants = "No participants yet";
5218
5250
  const no_winners = "No winners yet";
5219
5251
  const qualified = "Not Qualified";
5220
5252
  const tasks_successfully_verified_better_luck_next_time = "Not all tasks are successfully verified, better luck next time!";
5221
- const sybil_database = "Not in Sybil database";
5222
5253
  const included_public_sybil_address_database = "Not included in a public sybil address database.";
5223
5254
  const ok = "OK";
5224
5255
  const only = "ONLY";
@@ -5233,11 +5264,8 @@ const oops_seems_like_already_finished_quest_2 = "Oops! Seems like you already f
5233
5264
  const oops_better_luck_next_time_2 = "Oops, Better Luck Next Time!";
5234
5265
  const open_blind_box = "Open Blind Box";
5235
5266
  const open = "Open to All";
5236
- const own = "Own";
5237
- const own_least = "Own at least";
5238
5267
  const own_least_amount_token_name_chain_label = "Own at least {amount} {token_name} on {chain_label}";
5239
5268
  const own_amount_name_nft_chain = "Own {amount} {name} NFT On {chain}";
5240
- const participants = "Participants";
5241
5269
  const participants_info = "Participants Info";
5242
5270
  const participants_any_user_who_complete_least_1_task_quest = "Participants: any user who complete at least 1 task of this quest.";
5243
5271
  const pending_transaction = "Pending Transaction";
@@ -5271,7 +5299,6 @@ const reward = "Reward";
5271
5299
  const reward_amount_revealed_once_quest_ends = "Reward amount will be revealed once quest ends.";
5272
5300
  const rewards = "Rewards";
5273
5301
  const rewards_missed = "Rewards Missed";
5274
- const role = "Role";
5275
5302
  const save = "Save";
5276
5303
  const share = "Share";
5277
5304
  const share_qr_code = "Share QR Code";
@@ -5289,6 +5316,7 @@ const switching_network = "Switching network...";
5289
5316
  const system_drawing_winners = "System is Drawing Winners...";
5290
5317
  const system_automatically_select_winners = "System will automatically select winners in";
5291
5318
  const task = "Task";
5319
+ const completed = "Completed";
5292
5320
  const taskon_lv_level_higher = "TaskOn LV {level} or Higher";
5293
5321
  const taskon_lv_val = "TaskOn LV {val}";
5294
5322
  const taskon_poh_level_score_label = "Taskon POH Level {score_label}";
@@ -5353,19 +5381,14 @@ const estimated_rewards = "Your Estimated Rewards";
5353
5381
  const final_rewards = "Your Final Rewards";
5354
5382
  const ranking = "Your Ranking";
5355
5383
  const complete_task = "Your did not complete task:";
5356
- const own_discord_role = "Your do not own a Discord Role";
5357
5384
  const own_discord_role_community = "Your do not own a Discord Role {role} in {community}";
5358
5385
  const completed_task = "Your have completed task:";
5359
- const own_discord_role_2 = "Your own a Discord Role";
5360
5386
  const own_discord_role_community_2 = "Your own a Discord Role {role} in {community}";
5361
5387
  const name_lv_lt_count = "Your {name} Lv is ≥/< {count}";
5362
5388
  const val_wallet_address_allowlist = "Your {val} wallet address is in the allowlist";
5363
5389
  const zkme_citizenship_nft_holder = "ZKMe Citizenship NFT holder";
5364
- const after = "after";
5365
- const tasks_reviewed = "all tasks have been reviewed.";
5366
5390
  const better_luck = "better luck";
5367
5391
  const recaptcha_verification_required = "reCAPTCHA verification required";
5368
- const following_eligibilities = "the following Eligibilities";
5369
5392
  const val_higher = "{val} or Higher";
5370
5393
  const official = "⚠️ Not Official";
5371
5394
  const winners_2 = "👑 Winners";
@@ -5375,21 +5398,16 @@ const any = "ANY";
5375
5398
  const winners_announced = "All winners are to be announced by";
5376
5399
  const least_count_transaction_s_chain = "At least {count} transaction(s) on {chain}";
5377
5400
  const click_copy_address = "Click to copy: {address}";
5378
- const complete_2 = "Complete";
5401
+ const complete = "Complete";
5379
5402
  const complete_onchain_action_number_actionid = "Complete Onchain Action #{actionId}";
5380
5403
  const completed_current_required_optional_tasks = "Completed: {current} / {required} optional tasks";
5381
5404
  const confirm = "Confirm";
5382
5405
  const did = "DID";
5383
- const holder_own_least_one = "DID Holder(own at least one";
5384
5406
  const earned_current_required_points = "Earned: {current} / {required} points";
5385
5407
  const equivalent_amounts_token_name = "Equivalent amounts of {token_name}";
5386
5408
  const link_discord_account = "Link Discord Account";
5387
- const lv = "Lv is";
5388
5409
  const meet_eligibilities_below = "Meet Eligibilities Below";
5389
- const member_discord_server = "Member of Discord server:";
5390
5410
  const multiple_rewards_detail = "Multiple Rewards Detail";
5391
- const included_public_sybil_address = "Not included in a public sybil address";
5392
- const chain_label = "On {chain_label}";
5393
5411
  const poh_verification = "POH Verification";
5394
5412
  const please_earn_least_count_points_optional_tasks = "Please earn at least {count} points from optional tasks";
5395
5413
  const please_move_key_blind_box_open_blind_box = "Please move the key to the blind box to open the blind box";
@@ -5397,11 +5415,9 @@ const points = "Points";
5397
5415
  const qualifier = "Qualifier";
5398
5416
  const quest = "Quest";
5399
5417
  const required = "REQUIRED";
5400
- const reviewed_tasks = "Reviewed All Tasks";
5401
5418
  const rewards_per_winner = "Rewards Per Winner";
5402
5419
  const taskon_poh_level = "Taskon POH Level";
5403
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.";
5404
- const quest_includes_proof_work_pow_tasks_which = "This quest includes Proof of Work (POW) tasks, which";
5405
5421
  const tier_index = "Tier {index}";
5406
5422
  const top_percent = "Top {from}%-{to}%";
5407
5423
  const top = "Top {from}-{to}";
@@ -5409,19 +5425,11 @@ const top_2 = "Top {to}";
5409
5425
  const top_percent_2 = "Top {to}%";
5410
5426
  const total_pointname = "Total {pointName}";
5411
5427
  const usd_token_name = "USD in {token_name}";
5412
- const waiting = "Waiting for";
5413
5428
  const x_account_created_months_ago = "X account created more than {months} months ago";
5414
5429
  const x_account_count_followers = "X account with more than {count} followers";
5415
- const your = "Your";
5416
5430
  const database = "database";
5417
- const days = "days";
5418
- const first = "first";
5419
- const least = "for at least";
5420
- const is = "is";
5421
5431
  const participants_2 = "participants";
5422
- const tasks_secure_valid_ranking = "tasks to secure a valid ranking.";
5423
5432
  const token = "token)";
5424
- const review_winners_selected = "will review. Winners will be selected";
5425
5433
  const pointsname_collected_tasks_completed_during_quest = "{pointsName} collected from all tasks completed during the quest.";
5426
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.';
5427
5435
  const fcfs = "FCFS";
@@ -5447,7 +5455,6 @@ const enMessages = {
5447
5455
  available,
5448
5456
  awesome_already_meet_requirements,
5449
5457
  babt_holder,
5450
- before_join_please_meet,
5451
5458
  binance_account_bound_token_bab,
5452
5459
  bind,
5453
5460
  bind_required_accounts,
@@ -5471,13 +5478,12 @@ const enMessages = {
5471
5478
  close,
5472
5479
  complete_campaign,
5473
5480
  complete_action_first,
5474
- complete,
5475
5481
  complete_campaign_2,
5476
5482
  complete_qualify_rewards,
5477
5483
  complete_milestone_name_first,
5478
5484
  completing,
5479
5485
  congratulations,
5480
- connect_wallet_participate,
5486
+ start_to_earn,
5481
5487
  connecting_wallet,
5482
5488
  continue_waiting,
5483
5489
  contract_address,
@@ -5487,7 +5493,6 @@ const enMessages = {
5487
5493
  discord,
5488
5494
  discord_account_linked,
5489
5495
  discord_role,
5490
- discord_role_2,
5491
5496
  ens_domains_eth,
5492
5497
  evm_chain,
5493
5498
  exp_winner,
@@ -5516,7 +5521,6 @@ const enMessages = {
5516
5521
  limited_spots_gas_free_claiming,
5517
5522
  link_wallet_address,
5518
5523
  link_copied,
5519
- loading_quest,
5520
5524
  loading,
5521
5525
  lucky_draw,
5522
5526
  manually_upload,
@@ -5533,7 +5537,6 @@ const enMessages = {
5533
5537
  no_winners,
5534
5538
  qualified,
5535
5539
  tasks_successfully_verified_better_luck_next_time,
5536
- sybil_database,
5537
5540
  included_public_sybil_address_database,
5538
5541
  ok,
5539
5542
  only,
@@ -5548,11 +5551,8 @@ const enMessages = {
5548
5551
  oops_better_luck_next_time_2,
5549
5552
  open_blind_box,
5550
5553
  open,
5551
- own,
5552
- own_least,
5553
5554
  own_least_amount_token_name_chain_label,
5554
5555
  own_amount_name_nft_chain,
5555
- participants,
5556
5556
  participants_info,
5557
5557
  participants_any_user_who_complete_least_1_task_quest,
5558
5558
  pending_transaction,
@@ -5586,7 +5586,6 @@ const enMessages = {
5586
5586
  reward_amount_revealed_once_quest_ends,
5587
5587
  rewards,
5588
5588
  rewards_missed,
5589
- role,
5590
5589
  save,
5591
5590
  share,
5592
5591
  share_qr_code,
@@ -5604,6 +5603,7 @@ const enMessages = {
5604
5603
  system_drawing_winners,
5605
5604
  system_automatically_select_winners,
5606
5605
  task,
5606
+ completed,
5607
5607
  taskon_lv_level_higher,
5608
5608
  taskon_lv_val,
5609
5609
  taskon_poh_level_score_label,
@@ -5668,19 +5668,14 @@ const enMessages = {
5668
5668
  final_rewards,
5669
5669
  ranking,
5670
5670
  complete_task,
5671
- own_discord_role,
5672
5671
  own_discord_role_community,
5673
5672
  completed_task,
5674
- own_discord_role_2,
5675
5673
  own_discord_role_community_2,
5676
5674
  name_lv_lt_count,
5677
5675
  val_wallet_address_allowlist,
5678
5676
  zkme_citizenship_nft_holder,
5679
- after,
5680
- tasks_reviewed,
5681
5677
  better_luck,
5682
5678
  recaptcha_verification_required,
5683
- following_eligibilities,
5684
5679
  val_higher,
5685
5680
  official,
5686
5681
  winners_2,
@@ -5690,21 +5685,16 @@ const enMessages = {
5690
5685
  winners_announced,
5691
5686
  least_count_transaction_s_chain,
5692
5687
  click_copy_address,
5693
- complete_2,
5688
+ complete,
5694
5689
  complete_onchain_action_number_actionid,
5695
5690
  completed_current_required_optional_tasks,
5696
5691
  confirm,
5697
5692
  did,
5698
- holder_own_least_one,
5699
5693
  earned_current_required_points,
5700
5694
  equivalent_amounts_token_name,
5701
5695
  link_discord_account,
5702
- lv,
5703
5696
  meet_eligibilities_below,
5704
- member_discord_server,
5705
5697
  multiple_rewards_detail,
5706
- included_public_sybil_address,
5707
- chain_label,
5708
5698
  poh_verification,
5709
5699
  please_earn_least_count_points_optional_tasks,
5710
5700
  please_move_key_blind_box_open_blind_box,
@@ -5712,11 +5702,9 @@ const enMessages = {
5712
5702
  qualifier,
5713
5703
  quest,
5714
5704
  required,
5715
- reviewed_tasks,
5716
5705
  rewards_per_winner,
5717
5706
  taskon_poh_level,
5718
5707
  rankings_based_total_pointsname_earned_tasks_within_quest_instances,
5719
- quest_includes_proof_work_pow_tasks_which,
5720
5708
  tier_index,
5721
5709
  top_percent,
5722
5710
  top,
@@ -5724,20 +5712,11 @@ const enMessages = {
5724
5712
  top_percent_2,
5725
5713
  total_pointname,
5726
5714
  usd_token_name,
5727
- waiting,
5728
5715
  x_account_created_months_ago,
5729
5716
  x_account_count_followers,
5730
- your,
5731
5717
  database,
5732
- days,
5733
- first,
5734
- least,
5735
- "in": "in",
5736
- is,
5737
5718
  participants_2,
5738
- tasks_secure_valid_ranking,
5739
5719
  token,
5740
- review_winners_selected,
5741
5720
  pointsname_collected_tasks_completed_during_quest,
5742
5721
  claim_again_send_new_transaction_recommended_when_sure_there,
5743
5722
  fcfs,
@@ -5759,16 +5738,16 @@ const enMessages = {
5759
5738
  const loadMessages = createLocaleLoader(
5760
5739
  enMessages,
5761
5740
  {
5762
- ko: () => import("./quest-ko-CSmRWgK_.js").then((module2) => ({
5741
+ ko: () => import("./quest-ko-BMu3uRQJ.js").then((module2) => ({
5763
5742
  default: module2.default
5764
5743
  })),
5765
- ja: () => import("./quest-ja-Dxd2vqBF.js").then((module2) => ({
5744
+ ja: () => import("./quest-ja-Depog33y.js").then((module2) => ({
5766
5745
  default: module2.default
5767
5746
  })),
5768
- ru: () => import("./quest-ru-CkEKv1_F.js").then((module2) => ({
5747
+ ru: () => import("./quest-ru-xne814Rw.js").then((module2) => ({
5769
5748
  default: module2.default
5770
5749
  })),
5771
- es: () => import("./quest-es-D-b5xcme.js").then((module2) => ({
5750
+ es: () => import("./quest-es-Dyyy0zaw.js").then((module2) => ({
5772
5751
  default: module2.default
5773
5752
  }))
5774
5753
  }
@@ -5790,11 +5769,7 @@ function RewardModuleDialog({
5790
5769
  const isToken = type === "token";
5791
5770
  const isPoints = type === "points";
5792
5771
  const isNft = type === "nft";
5793
- const { messages, isLoading } = useWidgetLocale({
5794
- widgetId: "UserCenterWidget",
5795
- defaultMessages: enMessages$2,
5796
- loadMessages: (locale) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../../../UserCenter/locales/en.json": () => import("./UserCenterWidget-CvU6K4AC.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)
5797
- });
5772
+ const { messages, isLoading } = useUserCenterLocale();
5798
5773
  const tokenAssets = useTokenAssets({
5799
5774
  autoLoad: open2 && isToken
5800
5775
  });
@@ -5821,16 +5796,16 @@ function RewardModuleDialog({
5821
5796
  autoLoad: open2 && isPoints && Boolean(pointsInfo == null ? void 0 : pointsInfo.points_id)
5822
5797
  });
5823
5798
  const dialogTitle = useMemo(() => {
5824
- if (isToken) return messages.rewardToken ?? t("token_name");
5825
- if (isPoints) return messages.pointsHistory ?? t("points_history");
5799
+ if (isToken) return messages.reward_token ?? t("token_name");
5800
+ if (isPoints) return messages.points_history ?? t("points_history");
5826
5801
  if (isNft) return "NFT";
5827
5802
  return "";
5828
5803
  }, [
5829
5804
  isToken,
5830
5805
  isPoints,
5831
5806
  isNft,
5832
- messages.rewardToken,
5833
- messages.pointsHistory,
5807
+ messages.reward_token,
5808
+ messages.points_history,
5834
5809
  t
5835
5810
  ]);
5836
5811
  const handleOpenChange = useCallback(
@@ -5865,7 +5840,6 @@ function RewardModuleDialog({
5865
5840
  tokenHistoryLoading: tokenHistory.loading,
5866
5841
  tokenHistoryError: tokenHistory.error,
5867
5842
  tokenHistoryPagination: tokenHistory.pagination,
5868
- messages,
5869
5843
  onWithdraw: handleWithdraw,
5870
5844
  onBatchWithdraw: handleBatchWithdraw
5871
5845
  }
@@ -5877,18 +5851,16 @@ function RewardModuleDialog({
5877
5851
  data: pointsHistory.data,
5878
5852
  loading: pointsHistory.loading,
5879
5853
  error: pointsHistory.error,
5880
- pagination: pointsHistory.pagination,
5881
- messages
5854
+ pagination: pointsHistory.pagination
5882
5855
  }
5883
- ) : /* @__PURE__ */ jsx(EmptyState, { message: messages.emptyPoints })),
5856
+ ) : /* @__PURE__ */ jsx(EmptyState, { message: messages.empty_points })),
5884
5857
  isNft && /* @__PURE__ */ jsx(
5885
5858
  NftRewardContent,
5886
5859
  {
5887
5860
  nftList: nftHistory.data,
5888
5861
  loading: nftHistory.loading,
5889
5862
  error: nftHistory.error,
5890
- pagination: nftHistory.pagination,
5891
- messages
5863
+ pagination: nftHistory.pagination
5892
5864
  }
5893
5865
  )
5894
5866
  ] })
@@ -5898,7 +5870,6 @@ function RewardModuleDialog({
5898
5870
  WithdrawForm,
5899
5871
  {
5900
5872
  open: showWithdrawForm,
5901
- messages,
5902
5873
  tokenAssets: tokenAssets.data,
5903
5874
  tokenAssetsLoading: tokenAssets.loading,
5904
5875
  initialTokenId: selectedTokenForWithdraw == null ? void 0 : selectedTokenForWithdraw.token_id,
@@ -8081,7 +8052,7 @@ function requireLottie() {
8081
8052
  _stopped = true;
8082
8053
  }
8083
8054
  }
8084
- function first2(nowTime) {
8055
+ function first(nowTime) {
8085
8056
  initTime = nowTime;
8086
8057
  window.requestAnimationFrame(resume);
8087
8058
  }
@@ -8148,7 +8119,7 @@ function requireLottie() {
8148
8119
  function activate() {
8149
8120
  if (!_isFrozen && playingAnimationsNum) {
8150
8121
  if (_stopped) {
8151
- window.requestAnimationFrame(first2);
8122
+ window.requestAnimationFrame(first);
8152
8123
  _stopped = false;
8153
8124
  }
8154
8125
  }
@@ -12050,11 +12021,11 @@ function requireLottie() {
12050
12021
  }
12051
12022
  function getCodePoint(string) {
12052
12023
  var codePoint = 0;
12053
- var first2 = string.charCodeAt(0);
12054
- if (first2 >= 55296 && first2 <= 56319) {
12024
+ var first = string.charCodeAt(0);
12025
+ if (first >= 55296 && first <= 56319) {
12055
12026
  var second = string.charCodeAt(1);
12056
12027
  if (second >= 56320 && second <= 57343) {
12057
- codePoint = (first2 - 55296) * 1024 + second - 56320 + 65536;
12028
+ codePoint = (first - 55296) * 1024 + second - 56320 + 65536;
12058
12029
  }
12059
12030
  }
12060
12031
  return codePoint;
@@ -23036,7 +23007,8 @@ const BlindBoxDialog = forwardRef(
23036
23007
  hasOpened && "taskon-quest-blindbox-chest--open"
23037
23008
  ].filter(Boolean).join(" ");
23038
23009
  return /* @__PURE__ */ jsxs("div", { className: "taskon-quest-blindbox-dialog", children: [
23039
- /* @__PURE__ */ jsx("h2", { className: "taskon-quest-blindbox-dialog-title", children: t("please_move_key_blind_box_open_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") }),
23040
23012
  /* @__PURE__ */ jsxs("div", { ref: stageRef, className: "taskon-quest-blindbox-stage", children: [
23041
23013
  showBackground && /* @__PURE__ */ jsx("div", { className: "taskon-quest-blindbox-bg", children: /* @__PURE__ */ jsx("img", { src: bgImageUrl, alt: "", draggable: false }) }),
23042
23014
  /* @__PURE__ */ jsx("div", { ref: dropZoneRef, className: "taskon-quest-blindbox-dropzone" }),
@@ -23426,8 +23398,8 @@ function OnChainVerify({
23426
23398
  ] });
23427
23399
  }
23428
23400
  function getMonthFromMillSec(ms) {
23429
- const days2 = Math.floor(ms / (1e3 * 60 * 60 * 24));
23430
- return Math.floor(days2 / 30);
23401
+ const days = Math.floor(ms / (1e3 * 60 * 60 * 24));
23402
+ return Math.floor(days / 30);
23431
23403
  }
23432
23404
  function XAccountVerify({
23433
23405
  params
@@ -23870,19 +23842,19 @@ function EligibilityInfo({
23870
23842
  }
23871
23843
  export {
23872
23844
  BlindBoxDialog as B,
23873
- ConfirmNoticeDialog as C,
23845
+ CardDescExpress as C,
23874
23846
  EligibilityInfo as E,
23875
23847
  I18nT as I,
23876
23848
  RewardModuleDialog as R,
23877
23849
  TitleExpress as T,
23878
- useBindWallet as a,
23879
- CardDescExpress as b,
23880
- useNftClaimFlow as c,
23881
- TaskItem as d,
23882
- Textarea as e,
23883
- useTaskWidgetLocale as f,
23884
- EligibilityList as g,
23885
- getDefaultExportFromCjs as h,
23850
+ useNftClaimFlow as a,
23851
+ TaskItem as b,
23852
+ Textarea as c,
23853
+ useTaskWidgetLocale as d,
23854
+ useQuestLocale as e,
23855
+ EligibilityList as f,
23856
+ getDefaultExportFromCjs as g,
23857
+ ConfirmNoticeDialog as h,
23886
23858
  sanitizeHtml as s,
23887
- useQuestLocale as u
23859
+ useBindWallet as u
23888
23860
  };