@medialane/ui 0.183.0 → 0.184.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/dist/components/drop/create/artwork-section.cjs +115 -0
  2. package/dist/components/drop/create/artwork-section.cjs.map +1 -0
  3. package/dist/components/drop/create/artwork-section.d.cts +23 -0
  4. package/dist/components/drop/create/artwork-section.d.ts +23 -0
  5. package/dist/components/drop/create/artwork-section.js +79 -0
  6. package/dist/components/drop/create/artwork-section.js.map +1 -0
  7. package/dist/components/drop/create/details-section.cjs +110 -0
  8. package/dist/components/drop/create/details-section.cjs.map +1 -0
  9. package/dist/components/drop/create/details-section.d.cts +11 -0
  10. package/dist/components/drop/create/details-section.d.ts +11 -0
  11. package/dist/components/drop/create/details-section.js +86 -0
  12. package/dist/components/drop/create/details-section.js.map +1 -0
  13. package/dist/components/drop/create/drop-create.cjs +112 -0
  14. package/dist/components/drop/create/drop-create.cjs.map +1 -0
  15. package/dist/components/drop/create/drop-create.d.cts +22 -0
  16. package/dist/components/drop/create/drop-create.d.ts +22 -0
  17. package/dist/components/drop/create/drop-create.js +77 -0
  18. package/dist/components/drop/create/drop-create.js.map +1 -0
  19. package/dist/components/drop/create/exclusive-fields.cjs +45 -0
  20. package/dist/components/drop/create/exclusive-fields.cjs.map +1 -0
  21. package/dist/components/drop/create/exclusive-fields.d.cts +14 -0
  22. package/dist/components/drop/create/exclusive-fields.d.ts +14 -0
  23. package/dist/components/drop/create/exclusive-fields.js +21 -0
  24. package/dist/components/drop/create/exclusive-fields.js.map +1 -0
  25. package/dist/components/drop/create/launch-dialog.cjs +193 -0
  26. package/dist/components/drop/create/launch-dialog.cjs.map +1 -0
  27. package/dist/components/drop/create/launch-dialog.d.cts +21 -0
  28. package/dist/components/drop/create/launch-dialog.d.ts +21 -0
  29. package/dist/components/drop/create/launch-dialog.js +168 -0
  30. package/dist/components/drop/create/launch-dialog.js.map +1 -0
  31. package/dist/components/drop/create/list-section.cjs +67 -0
  32. package/dist/components/drop/create/list-section.cjs.map +1 -0
  33. package/dist/components/drop/create/list-section.d.cts +11 -0
  34. package/dist/components/drop/create/list-section.d.ts +11 -0
  35. package/dist/components/drop/create/list-section.js +43 -0
  36. package/dist/components/drop/create/list-section.js.map +1 -0
  37. package/dist/components/drop/create/sale-section.cjs +78 -0
  38. package/dist/components/drop/create/sale-section.cjs.map +1 -0
  39. package/dist/components/drop/create/sale-section.d.cts +13 -0
  40. package/dist/components/drop/create/sale-section.d.ts +13 -0
  41. package/dist/components/drop/create/sale-section.js +54 -0
  42. package/dist/components/drop/create/sale-section.js.map +1 -0
  43. package/dist/components/drop/drop-card.cjs +81 -0
  44. package/dist/components/drop/drop-card.cjs.map +1 -0
  45. package/dist/components/drop/drop-card.d.cts +18 -0
  46. package/dist/components/drop/drop-card.d.ts +18 -0
  47. package/dist/components/drop/drop-card.js +45 -0
  48. package/dist/components/drop/drop-card.js.map +1 -0
  49. package/dist/components/drop/drop-listing.cjs +79 -0
  50. package/dist/components/drop/drop-listing.cjs.map +1 -0
  51. package/dist/components/drop/drop-listing.d.cts +10 -0
  52. package/dist/components/drop/drop-listing.d.ts +10 -0
  53. package/dist/components/drop/drop-listing.js +45 -0
  54. package/dist/components/drop/drop-listing.js.map +1 -0
  55. package/dist/components/drop/drop-token-link.cjs +63 -0
  56. package/dist/components/drop/drop-token-link.cjs.map +1 -0
  57. package/dist/components/drop/drop-token-link.d.cts +9 -0
  58. package/dist/components/drop/drop-token-link.d.ts +9 -0
  59. package/dist/components/drop/drop-token-link.js +29 -0
  60. package/dist/components/drop/drop-token-link.js.map +1 -0
  61. package/dist/components/drop/my-drops.cjs +71 -0
  62. package/dist/components/drop/my-drops.cjs.map +1 -0
  63. package/dist/components/drop/my-drops.d.cts +12 -0
  64. package/dist/components/drop/my-drops.d.ts +12 -0
  65. package/dist/components/drop/my-drops.js +37 -0
  66. package/dist/components/drop/my-drops.js.map +1 -0
  67. package/dist/components/drop/page/drop-action-box.cjs +63 -0
  68. package/dist/components/drop/page/drop-action-box.cjs.map +1 -0
  69. package/dist/components/drop/page/drop-action-box.d.cts +16 -0
  70. package/dist/components/drop/page/drop-action-box.d.ts +16 -0
  71. package/dist/components/drop/page/drop-action-box.js +39 -0
  72. package/dist/components/drop/page/drop-action-box.js.map +1 -0
  73. package/dist/components/drop/page/drop-activity.cjs +42 -0
  74. package/dist/components/drop/page/drop-activity.cjs.map +1 -0
  75. package/dist/components/drop/page/drop-activity.d.cts +8 -0
  76. package/dist/components/drop/page/drop-activity.d.ts +8 -0
  77. package/dist/components/drop/page/drop-activity.js +18 -0
  78. package/dist/components/drop/page/drop-activity.js.map +1 -0
  79. package/dist/components/drop/page/drop-manage.cjs +161 -0
  80. package/dist/components/drop/page/drop-manage.cjs.map +1 -0
  81. package/dist/components/drop/page/drop-manage.d.cts +24 -0
  82. package/dist/components/drop/page/drop-manage.d.ts +24 -0
  83. package/dist/components/drop/page/drop-manage.js +137 -0
  84. package/dist/components/drop/page/drop-manage.js.map +1 -0
  85. package/dist/components/drop/page/drop-mint-dialog.cjs +97 -0
  86. package/dist/components/drop/page/drop-mint-dialog.cjs.map +1 -0
  87. package/dist/components/drop/page/drop-mint-dialog.d.cts +15 -0
  88. package/dist/components/drop/page/drop-mint-dialog.d.ts +15 -0
  89. package/dist/components/drop/page/drop-mint-dialog.js +73 -0
  90. package/dist/components/drop/page/drop-mint-dialog.js.map +1 -0
  91. package/dist/components/drop/page/drop-page.cjs +165 -0
  92. package/dist/components/drop/page/drop-page.cjs.map +1 -0
  93. package/dist/components/drop/page/drop-page.d.cts +16 -0
  94. package/dist/components/drop/page/drop-page.d.ts +16 -0
  95. package/dist/components/drop/page/drop-page.js +131 -0
  96. package/dist/components/drop/page/drop-page.js.map +1 -0
  97. package/dist/components/drop-status-display.cjs +7 -38
  98. package/dist/components/drop-status-display.cjs.map +1 -1
  99. package/dist/components/drop-status-display.d.cts +6 -7
  100. package/dist/components/drop-status-display.d.ts +6 -7
  101. package/dist/components/drop-status-display.js +7 -37
  102. package/dist/components/drop-status-display.js.map +1 -1
  103. package/dist/components/image.d.cts +2 -0
  104. package/dist/components/image.d.ts +2 -0
  105. package/dist/index.cjs +46 -27
  106. package/dist/index.cjs.map +1 -1
  107. package/dist/index.d.cts +20 -11
  108. package/dist/index.d.ts +20 -11
  109. package/dist/index.js +31 -25
  110. package/dist/index.js.map +1 -1
  111. package/dist/utils/drop/actions.cjs +76 -0
  112. package/dist/utils/drop/actions.cjs.map +1 -0
  113. package/dist/utils/drop/actions.d.cts +46 -0
  114. package/dist/utils/drop/actions.d.ts +46 -0
  115. package/dist/utils/drop/actions.js +49 -0
  116. package/dist/utils/drop/actions.js.map +1 -0
  117. package/dist/utils/drop/allowlist.cjs +50 -0
  118. package/dist/utils/drop/allowlist.cjs.map +1 -0
  119. package/dist/utils/drop/allowlist.d.cts +10 -0
  120. package/dist/utils/drop/allowlist.d.ts +10 -0
  121. package/dist/utils/drop/allowlist.js +26 -0
  122. package/dist/utils/drop/allowlist.js.map +1 -0
  123. package/dist/utils/drop/chain.cjs +37 -0
  124. package/dist/utils/drop/chain.cjs.map +1 -0
  125. package/dist/utils/drop/chain.d.cts +5 -0
  126. package/dist/utils/drop/chain.d.ts +5 -0
  127. package/dist/utils/drop/chain.js +13 -0
  128. package/dist/utils/drop/chain.js.map +1 -0
  129. package/dist/utils/drop/claim-proof.cjs +48 -0
  130. package/dist/utils/drop/claim-proof.cjs.map +1 -0
  131. package/dist/utils/drop/claim-proof.d.cts +9 -0
  132. package/dist/utils/drop/claim-proof.d.ts +9 -0
  133. package/dist/utils/drop/claim-proof.js +24 -0
  134. package/dist/utils/drop/claim-proof.js.map +1 -0
  135. package/dist/utils/drop/draft.cjs +87 -0
  136. package/dist/utils/drop/draft.cjs.map +1 -0
  137. package/dist/utils/drop/draft.d.cts +32 -0
  138. package/dist/utils/drop/draft.d.ts +32 -0
  139. package/dist/utils/drop/draft.js +61 -0
  140. package/dist/utils/drop/draft.js.map +1 -0
  141. package/dist/utils/drop/metadata.cjs +70 -0
  142. package/dist/utils/drop/metadata.cjs.map +1 -0
  143. package/dist/utils/drop/metadata.d.cts +34 -0
  144. package/dist/utils/drop/metadata.d.ts +34 -0
  145. package/dist/utils/drop/metadata.js +43 -0
  146. package/dist/utils/drop/metadata.js.map +1 -0
  147. package/dist/utils/{drop-status.cjs → drop/preview.cjs} +14 -14
  148. package/dist/utils/drop/preview.cjs.map +1 -0
  149. package/dist/utils/drop/preview.d.cts +4 -0
  150. package/dist/utils/drop/preview.d.ts +4 -0
  151. package/dist/utils/drop/preview.js +13 -0
  152. package/dist/utils/drop/preview.js.map +1 -0
  153. package/dist/utils/drop/receipt.cjs +39 -0
  154. package/dist/utils/drop/receipt.cjs.map +1 -0
  155. package/dist/utils/drop/receipt.d.cts +6 -0
  156. package/dist/utils/drop/receipt.d.ts +6 -0
  157. package/dist/utils/drop/receipt.js +15 -0
  158. package/dist/utils/drop/receipt.js.map +1 -0
  159. package/dist/utils/drop/sale.cjs +108 -0
  160. package/dist/utils/drop/sale.cjs.map +1 -0
  161. package/dist/utils/drop/sale.d.cts +52 -0
  162. package/dist/utils/drop/sale.d.ts +52 -0
  163. package/dist/utils/drop/sale.js +78 -0
  164. package/dist/utils/drop/sale.js.map +1 -0
  165. package/dist/utils/drop/types.cjs +17 -0
  166. package/dist/utils/drop/types.cjs.map +1 -0
  167. package/dist/utils/drop/types.d.cts +20 -0
  168. package/dist/utils/drop/types.d.ts +20 -0
  169. package/dist/utils/drop/types.js +1 -0
  170. package/dist/utils/drop/types.js.map +1 -0
  171. package/dist/utils/drop/upload.cjs +48 -0
  172. package/dist/utils/drop/upload.cjs.map +1 -0
  173. package/dist/utils/drop/upload.d.cts +11 -0
  174. package/dist/utils/drop/upload.d.ts +11 -0
  175. package/dist/utils/drop/upload.js +24 -0
  176. package/dist/utils/drop/upload.js.map +1 -0
  177. package/dist/utils/drop/use-now.cjs +38 -0
  178. package/dist/utils/drop/use-now.cjs.map +1 -0
  179. package/dist/utils/drop/use-now.d.cts +4 -0
  180. package/dist/utils/drop/use-now.d.ts +4 -0
  181. package/dist/utils/drop/use-now.js +14 -0
  182. package/dist/utils/drop/use-now.js.map +1 -0
  183. package/dist/utils/drop/view.cjs +89 -0
  184. package/dist/utils/drop/view.cjs.map +1 -0
  185. package/dist/utils/drop/view.d.cts +34 -0
  186. package/dist/utils/drop/view.d.ts +34 -0
  187. package/dist/utils/drop/view.js +64 -0
  188. package/dist/utils/drop/view.js.map +1 -0
  189. package/dist/utils/launchpad-defaults.cjs +0 -22
  190. package/dist/utils/launchpad-defaults.cjs.map +1 -1
  191. package/dist/utils/launchpad-defaults.d.cts +1 -7
  192. package/dist/utils/launchpad-defaults.d.ts +1 -7
  193. package/dist/utils/launchpad-defaults.js +0 -21
  194. package/dist/utils/launchpad-defaults.js.map +1 -1
  195. package/dist/utils/use-drops.cjs +41 -45
  196. package/dist/utils/use-drops.cjs.map +1 -1
  197. package/dist/utils/use-drops.d.cts +31 -23
  198. package/dist/utils/use-drops.d.ts +31 -23
  199. package/dist/utils/use-drops.js +35 -40
  200. package/dist/utils/use-drops.js.map +1 -1
  201. package/package.json +3 -3
  202. package/dist/components/account/account.test.cjs +0 -86
  203. package/dist/components/account/account.test.cjs.map +0 -1
  204. package/dist/components/account/account.test.d.cts +0 -2
  205. package/dist/components/account/account.test.d.ts +0 -2
  206. package/dist/components/account/account.test.js +0 -85
  207. package/dist/components/account/account.test.js.map +0 -1
  208. package/dist/components/drop-create-form.cjs +0 -341
  209. package/dist/components/drop-create-form.cjs.map +0 -1
  210. package/dist/components/drop-create-form.d.cts +0 -39
  211. package/dist/components/drop-create-form.d.ts +0 -39
  212. package/dist/components/drop-create-form.js +0 -322
  213. package/dist/components/drop-create-form.js.map +0 -1
  214. package/dist/components/drop-preview-card.cjs +0 -106
  215. package/dist/components/drop-preview-card.cjs.map +0 -1
  216. package/dist/components/drop-preview-card.d.cts +0 -17
  217. package/dist/components/drop-preview-card.d.ts +0 -17
  218. package/dist/components/drop-preview-card.js +0 -82
  219. package/dist/components/drop-preview-card.js.map +0 -1
  220. package/dist/components/drop-preview-card.test.cjs +0 -84
  221. package/dist/components/drop-preview-card.test.cjs.map +0 -1
  222. package/dist/components/drop-preview-card.test.d.cts +0 -3
  223. package/dist/components/drop-preview-card.test.d.ts +0 -3
  224. package/dist/components/drop-preview-card.test.js +0 -83
  225. package/dist/components/drop-preview-card.test.js.map +0 -1
  226. package/dist/components/drop-status-display.test.cjs +0 -29
  227. package/dist/components/drop-status-display.test.cjs.map +0 -1
  228. package/dist/components/drop-status-display.test.d.cts +0 -2
  229. package/dist/components/drop-status-display.test.d.ts +0 -2
  230. package/dist/components/drop-status-display.test.js +0 -28
  231. package/dist/components/drop-status-display.test.js.map +0 -1
  232. package/dist/components/exclusive-content-section.cjs +0 -88
  233. package/dist/components/exclusive-content-section.cjs.map +0 -1
  234. package/dist/components/exclusive-content-section.d.cts +0 -10
  235. package/dist/components/exclusive-content-section.d.ts +0 -10
  236. package/dist/components/exclusive-content-section.js +0 -64
  237. package/dist/components/exclusive-content-section.js.map +0 -1
  238. package/dist/data/drop-create-schema.cjs +0 -92
  239. package/dist/data/drop-create-schema.cjs.map +0 -1
  240. package/dist/data/drop-create-schema.d.cts +0 -131
  241. package/dist/data/drop-create-schema.d.ts +0 -131
  242. package/dist/data/drop-create-schema.js +0 -58
  243. package/dist/data/drop-create-schema.js.map +0 -1
  244. package/dist/utils/drop-status.cjs.map +0 -1
  245. package/dist/utils/drop-status.d.cts +0 -12
  246. package/dist/utils/drop-status.d.ts +0 -12
  247. package/dist/utils/drop-status.js +0 -13
  248. package/dist/utils/drop-status.js.map +0 -1
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var my_drops_exports = {};
31
+ __export(my_drops_exports, {
32
+ MyDrops: () => MyDrops
33
+ });
34
+ module.exports = __toCommonJS(my_drops_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_lucide_react = require("lucide-react");
37
+ var import_link = __toESM(require("../link.js"), 1);
38
+ var import_button = require("../button.js");
39
+ var import_tab_empty_state = require("../tab-empty-state.js");
40
+ var import_drop_card = require("./drop-card.js");
41
+ var import_use_drops = require("../../utils/use-drops.js");
42
+ var import_use_now = require("../../utils/drop/use-now.js");
43
+ function MyDrops({
44
+ getClient,
45
+ walletAddress,
46
+ onRequireWallet,
47
+ connectLabel = "Sign in",
48
+ createHref = "/launchpad/drop/create"
49
+ }) {
50
+ const { drops, isLoading } = (0, import_use_drops.useMyDrops)(getClient, walletAddress);
51
+ const now = (0, import_use_now.useNow)(6e4);
52
+ if (!walletAddress) {
53
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4 py-16 text-center", children: [
54
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "Sign in to see the drops you launched." }),
55
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { onClick: onRequireWallet, children: connectLabel })
56
+ ] });
57
+ }
58
+ if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_card.DropGridSkeleton, {});
59
+ if (drops.length === 0) {
60
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
61
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tab_empty_state.TabEmptyState, { icon: import_lucide_react.Package, heading: "No drops yet", body: "Launch an edition or a collection and it will show here." }),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: createHref, className: "text-sm font-semibold text-primary", children: "Create a drop" }) })
63
+ ] });
64
+ }
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_card.DropGrid, { drops, now, manage: true });
66
+ }
67
+ // Annotate the CommonJS export names for ESM import in node:
68
+ 0 && (module.exports = {
69
+ MyDrops
70
+ });
71
+ //# sourceMappingURL=my-drops.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/drop/my-drops.tsx"],"sourcesContent":["\"use client\";\n\nimport { Package } from \"lucide-react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { TabEmptyState } from \"../tab-empty-state.js\";\nimport { DropGrid, DropGridSkeleton } from \"./drop-card.js\";\nimport { useMyDrops } from \"../../utils/use-drops.js\";\nimport { useNow } from \"../../utils/drop/use-now.js\";\n\nexport function MyDrops({\n getClient, walletAddress, onRequireWallet, connectLabel = \"Sign in\", createHref = \"/launchpad/drop/create\",\n}: {\n getClient: () => MedialaneClient;\n walletAddress: string | null;\n onRequireWallet: () => void;\n connectLabel?: string;\n createHref?: string;\n}) {\n const { drops, isLoading } = useMyDrops(getClient, walletAddress);\n const now = useNow(60_000);\n if (!walletAddress) {\n return (\n <div className=\"space-y-4 py-16 text-center\">\n <p className=\"text-sm text-muted-foreground\">Sign in to see the drops you launched.</p>\n <Button onClick={onRequireWallet}>{connectLabel}</Button>\n </div>\n );\n }\n if (isLoading) return <DropGridSkeleton />;\n if (drops.length === 0) {\n return (\n <div className=\"space-y-4\">\n <TabEmptyState icon={Package} heading=\"No drops yet\" body=\"Launch an edition or a collection and it will show here.\" />\n <div className=\"text-center\"><Link href={createHref} className=\"text-sm font-semibold text-primary\">Create a drop</Link></div>\n </div>\n );\n }\n return <DropGrid drops={drops} now={now} manage />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBM;AAtBN,0BAAwB;AAExB,kBAAiB;AACjB,oBAAuB;AACvB,6BAA8B;AAC9B,uBAA2C;AAC3C,uBAA2B;AAC3B,qBAAuB;AAEhB,SAAS,QAAQ;AAAA,EACtB;AAAA,EAAW;AAAA,EAAe;AAAA,EAAiB,eAAe;AAAA,EAAW,aAAa;AACpF,GAMG;AACD,QAAM,EAAE,OAAO,UAAU,QAAI,6BAAW,WAAW,aAAa;AAChE,QAAM,UAAM,uBAAO,GAAM;AACzB,MAAI,CAAC,eAAe;AAClB,WACE,6CAAC,SAAI,WAAU,+BACb;AAAA,kDAAC,OAAE,WAAU,iCAAgC,oDAAsC;AAAA,MACnF,4CAAC,wBAAO,SAAS,iBAAkB,wBAAa;AAAA,OAClD;AAAA,EAEJ;AACA,MAAI,UAAW,QAAO,4CAAC,qCAAiB;AACxC,MAAI,MAAM,WAAW,GAAG;AACtB,WACE,6CAAC,SAAI,WAAU,aACb;AAAA,kDAAC,wCAAc,MAAM,6BAAS,SAAQ,gBAAe,MAAK,4DAA2D;AAAA,MACrH,4CAAC,SAAI,WAAU,eAAc,sDAAC,YAAAA,SAAA,EAAK,MAAM,YAAY,WAAU,sCAAqC,2BAAa,GAAO;AAAA,OAC1H;AAAA,EAEJ;AACA,SAAO,4CAAC,6BAAS,OAAc,KAAU,QAAM,MAAC;AAClD;","names":["Link"]}
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ declare function MyDrops({ getClient, walletAddress, onRequireWallet, connectLabel, createHref, }: {
5
+ getClient: () => MedialaneClient;
6
+ walletAddress: string | null;
7
+ onRequireWallet: () => void;
8
+ connectLabel?: string;
9
+ createHref?: string;
10
+ }): react_jsx_runtime.JSX.Element;
11
+
12
+ export { MyDrops };
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ declare function MyDrops({ getClient, walletAddress, onRequireWallet, connectLabel, createHref, }: {
5
+ getClient: () => MedialaneClient;
6
+ walletAddress: string | null;
7
+ onRequireWallet: () => void;
8
+ connectLabel?: string;
9
+ createHref?: string;
10
+ }): react_jsx_runtime.JSX.Element;
11
+
12
+ export { MyDrops };
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Package } from "lucide-react";
4
+ import Link from "../link.js";
5
+ import { Button } from "../button.js";
6
+ import { TabEmptyState } from "../tab-empty-state.js";
7
+ import { DropGrid, DropGridSkeleton } from "./drop-card.js";
8
+ import { useMyDrops } from "../../utils/use-drops.js";
9
+ import { useNow } from "../../utils/drop/use-now.js";
10
+ function MyDrops({
11
+ getClient,
12
+ walletAddress,
13
+ onRequireWallet,
14
+ connectLabel = "Sign in",
15
+ createHref = "/launchpad/drop/create"
16
+ }) {
17
+ const { drops, isLoading } = useMyDrops(getClient, walletAddress);
18
+ const now = useNow(6e4);
19
+ if (!walletAddress) {
20
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4 py-16 text-center", children: [
21
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Sign in to see the drops you launched." }),
22
+ /* @__PURE__ */ jsx(Button, { onClick: onRequireWallet, children: connectLabel })
23
+ ] });
24
+ }
25
+ if (isLoading) return /* @__PURE__ */ jsx(DropGridSkeleton, {});
26
+ if (drops.length === 0) {
27
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
28
+ /* @__PURE__ */ jsx(TabEmptyState, { icon: Package, heading: "No drops yet", body: "Launch an edition or a collection and it will show here." }),
29
+ /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx(Link, { href: createHref, className: "text-sm font-semibold text-primary", children: "Create a drop" }) })
30
+ ] });
31
+ }
32
+ return /* @__PURE__ */ jsx(DropGrid, { drops, now, manage: true });
33
+ }
34
+ export {
35
+ MyDrops
36
+ };
37
+ //# sourceMappingURL=my-drops.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/drop/my-drops.tsx"],"sourcesContent":["\"use client\";\n\nimport { Package } from \"lucide-react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { TabEmptyState } from \"../tab-empty-state.js\";\nimport { DropGrid, DropGridSkeleton } from \"./drop-card.js\";\nimport { useMyDrops } from \"../../utils/use-drops.js\";\nimport { useNow } from \"../../utils/drop/use-now.js\";\n\nexport function MyDrops({\n getClient, walletAddress, onRequireWallet, connectLabel = \"Sign in\", createHref = \"/launchpad/drop/create\",\n}: {\n getClient: () => MedialaneClient;\n walletAddress: string | null;\n onRequireWallet: () => void;\n connectLabel?: string;\n createHref?: string;\n}) {\n const { drops, isLoading } = useMyDrops(getClient, walletAddress);\n const now = useNow(60_000);\n if (!walletAddress) {\n return (\n <div className=\"space-y-4 py-16 text-center\">\n <p className=\"text-sm text-muted-foreground\">Sign in to see the drops you launched.</p>\n <Button onClick={onRequireWallet}>{connectLabel}</Button>\n </div>\n );\n }\n if (isLoading) return <DropGridSkeleton />;\n if (drops.length === 0) {\n return (\n <div className=\"space-y-4\">\n <TabEmptyState icon={Package} heading=\"No drops yet\" body=\"Launch an edition or a collection and it will show here.\" />\n <div className=\"text-center\"><Link href={createHref} className=\"text-sm font-semibold text-primary\">Create a drop</Link></div>\n </div>\n );\n }\n return <DropGrid drops={drops} now={now} manage />;\n}\n"],"mappings":";AAwBM,SACE,KADF;AAtBN,SAAS,eAAe;AAExB,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,UAAU,wBAAwB;AAC3C,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AAEhB,SAAS,QAAQ;AAAA,EACtB;AAAA,EAAW;AAAA,EAAe;AAAA,EAAiB,eAAe;AAAA,EAAW,aAAa;AACpF,GAMG;AACD,QAAM,EAAE,OAAO,UAAU,IAAI,WAAW,WAAW,aAAa;AAChE,QAAM,MAAM,OAAO,GAAM;AACzB,MAAI,CAAC,eAAe;AAClB,WACE,qBAAC,SAAI,WAAU,+BACb;AAAA,0BAAC,OAAE,WAAU,iCAAgC,oDAAsC;AAAA,MACnF,oBAAC,UAAO,SAAS,iBAAkB,wBAAa;AAAA,OAClD;AAAA,EAEJ;AACA,MAAI,UAAW,QAAO,oBAAC,oBAAiB;AACxC,MAAI,MAAM,WAAW,GAAG;AACtB,WACE,qBAAC,SAAI,WAAU,aACb;AAAA,0BAAC,iBAAc,MAAM,SAAS,SAAQ,gBAAe,MAAK,4DAA2D;AAAA,MACrH,oBAAC,SAAI,WAAU,eAAc,8BAAC,QAAK,MAAM,YAAY,WAAU,sCAAqC,2BAAa,GAAO;AAAA,OAC1H;AAAA,EAEJ;AACA,SAAO,oBAAC,YAAS,OAAc,KAAU,QAAM,MAAC;AAClD;","names":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var drop_action_box_exports = {};
21
+ __export(drop_action_box_exports, {
22
+ DropActionBox: () => DropActionBox
23
+ });
24
+ module.exports = __toCommonJS(drop_action_box_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_lucide_react = require("lucide-react");
27
+ var import_drop_countdown = require("../../drop-countdown.js");
28
+ var import_drop_status_display = require("../../drop-status-display.js");
29
+ var import_gradient_button = require("../../gradient-button.js");
30
+ function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }) {
31
+ const canPick = view.button.action === "mint" && view.maxQuantity > 1n;
32
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-5 rounded-2xl border border-border bg-card p-5", children: [
33
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
34
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_status_display.DropStatusBadge, { phase: view.phase }),
35
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-muted-foreground", children: view.statusText })
36
+ ] }),
37
+ view.countdown && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_countdown.DropCountdown, { targetTs: view.countdown.target, label: view.countdown.label }),
38
+ maxSupply > 0n ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_status_display.DropSupplyProgress, { minted: Number(minted), max: Number(maxSupply) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
39
+ Number(minted).toLocaleString("en-US"),
40
+ " minted"
41
+ ] }),
42
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-end justify-between gap-3", children: [
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
44
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "Price" }),
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xl font-bold", children: view.priceText })
46
+ ] }),
47
+ canPick && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", "aria-label": "Quantity", children: [
48
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Quantity" }),
49
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "rounded-md border border-border p-2", disabled: quantity <= 1n, onClick: () => onQuantity(quantity - 1n), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Minus, { className: "h-3.5 w-3.5" }) }),
50
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "w-8 text-center font-semibold tabular-nums", children: quantity.toString() }),
51
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "rounded-md border border-border p-2", disabled: quantity >= view.maxQuantity, onClick: () => onQuantity(quantity + 1n), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Plus, { className: "h-3.5 w-3.5" }) })
52
+ ] })
53
+ ] }),
54
+ view.totalText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: view.totalText }),
55
+ view.eligibility && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm", children: view.eligibility }),
56
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_gradient_button.GradientButton, { big: true, disabled: view.button.action === "none", onClick: onAction, className: "disabled:opacity-50", children: view.button.label })
57
+ ] });
58
+ }
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ DropActionBox
62
+ });
63
+ //# sourceMappingURL=drop-action-box.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/page/drop-action-box.tsx"],"sourcesContent":["\"use client\";\n\nimport { Minus, Plus } from \"lucide-react\";\nimport { DropCountdown } from \"../../drop-countdown.js\";\nimport { DropStatusBadge, DropSupplyProgress } from \"../../drop-status-display.js\";\nimport { GradientButton } from \"../../gradient-button.js\";\nimport type { ActionBoxView } from \"../../../utils/drop/view.js\";\n\nexport interface DropActionBoxProps {\n view: ActionBoxView;\n minted: bigint;\n maxSupply: bigint;\n quantity: bigint;\n onQuantity: (q: bigint) => void;\n onAction: () => void;\n}\n\nexport function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }: DropActionBoxProps) {\n const canPick = view.button.action === \"mint\" && view.maxQuantity > 1n;\n return (\n <div className=\"space-y-5 rounded-2xl border border-border bg-card p-5\">\n <div className=\"flex items-center justify-between gap-3\">\n <DropStatusBadge phase={view.phase} />\n <span className=\"text-xs text-muted-foreground\">{view.statusText}</span>\n </div>\n {view.countdown && <DropCountdown targetTs={view.countdown.target} label={view.countdown.label} />}\n {maxSupply > 0n\n ? <DropSupplyProgress minted={Number(minted)} max={Number(maxSupply)} />\n : <p className=\"text-sm text-muted-foreground\">{Number(minted).toLocaleString(\"en-US\")} minted</p>}\n <div className=\"flex items-end justify-between gap-3\">\n <div>\n <p className=\"text-xs text-muted-foreground\">Price</p>\n <p className=\"text-xl font-bold\">{view.priceText}</p>\n </div>\n {canPick && (\n <div className=\"flex items-center gap-2\" aria-label=\"Quantity\">\n <span className=\"sr-only\">Quantity</span>\n <button type=\"button\" className=\"rounded-md border border-border p-2\" disabled={quantity <= 1n} onClick={() => onQuantity(quantity - 1n)}><Minus className=\"h-3.5 w-3.5\" /></button>\n <span className=\"w-8 text-center font-semibold tabular-nums\">{quantity.toString()}</span>\n <button type=\"button\" className=\"rounded-md border border-border p-2\" disabled={quantity >= view.maxQuantity} onClick={() => onQuantity(quantity + 1n)}><Plus className=\"h-3.5 w-3.5\" /></button>\n </div>\n )}\n </div>\n {view.totalText && <p className=\"text-sm text-muted-foreground\">{view.totalText}</p>}\n {view.eligibility && <p className=\"text-sm\">{view.eligibility}</p>}\n <GradientButton big disabled={view.button.action === \"none\"} onClick={onAction} className=\"disabled:opacity-50\">\n {view.button.label}\n </GradientButton>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBM;AAnBN,0BAA4B;AAC5B,4BAA8B;AAC9B,iCAAoD;AACpD,6BAA+B;AAYxB,SAAS,cAAc,EAAE,MAAM,QAAQ,WAAW,UAAU,YAAY,SAAS,GAAuB;AAC7G,QAAM,UAAU,KAAK,OAAO,WAAW,UAAU,KAAK,cAAc;AACpE,SACE,6CAAC,SAAI,WAAU,0DACb;AAAA,iDAAC,SAAI,WAAU,2CACb;AAAA,kDAAC,8CAAgB,OAAO,KAAK,OAAO;AAAA,MACpC,4CAAC,UAAK,WAAU,iCAAiC,eAAK,YAAW;AAAA,OACnE;AAAA,IACC,KAAK,aAAa,4CAAC,uCAAc,UAAU,KAAK,UAAU,QAAQ,OAAO,KAAK,UAAU,OAAO;AAAA,IAC/F,YAAY,KACT,4CAAC,iDAAmB,QAAQ,OAAO,MAAM,GAAG,KAAK,OAAO,SAAS,GAAG,IACpE,6CAAC,OAAE,WAAU,iCAAiC;AAAA,aAAO,MAAM,EAAE,eAAe,OAAO;AAAA,MAAE;AAAA,OAAO;AAAA,IAChG,6CAAC,SAAI,WAAU,wCACb;AAAA,mDAAC,SACC;AAAA,oDAAC,OAAE,WAAU,iCAAgC,mBAAK;AAAA,QAClD,4CAAC,OAAE,WAAU,qBAAqB,eAAK,WAAU;AAAA,SACnD;AAAA,MACC,WACC,6CAAC,SAAI,WAAU,2BAA0B,cAAW,YAClD;AAAA,oDAAC,UAAK,WAAU,WAAU,sBAAQ;AAAA,QAClC,4CAAC,YAAO,MAAK,UAAS,WAAU,uCAAsC,UAAU,YAAY,IAAI,SAAS,MAAM,WAAW,WAAW,EAAE,GAAG,sDAAC,6BAAM,WAAU,eAAc,GAAE;AAAA,QAC3K,4CAAC,UAAK,WAAU,8CAA8C,mBAAS,SAAS,GAAE;AAAA,QAClF,4CAAC,YAAO,MAAK,UAAS,WAAU,uCAAsC,UAAU,YAAY,KAAK,aAAa,SAAS,MAAM,WAAW,WAAW,EAAE,GAAG,sDAAC,4BAAK,WAAU,eAAc,GAAE;AAAA,SAC1L;AAAA,OAEJ;AAAA,IACC,KAAK,aAAa,4CAAC,OAAE,WAAU,iCAAiC,eAAK,WAAU;AAAA,IAC/E,KAAK,eAAe,4CAAC,OAAE,WAAU,WAAW,eAAK,aAAY;AAAA,IAC9D,4CAAC,yCAAe,KAAG,MAAC,UAAU,KAAK,OAAO,WAAW,QAAQ,SAAS,UAAU,WAAU,uBACvF,eAAK,OAAO,OACf;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ActionBoxView } from '../../../utils/drop/view.cjs';
3
+ import '@medialane/sdk';
4
+ import '@medialane/sdk/starknet';
5
+
6
+ interface DropActionBoxProps {
7
+ view: ActionBoxView;
8
+ minted: bigint;
9
+ maxSupply: bigint;
10
+ quantity: bigint;
11
+ onQuantity: (q: bigint) => void;
12
+ onAction: () => void;
13
+ }
14
+ declare function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }: DropActionBoxProps): react_jsx_runtime.JSX.Element;
15
+
16
+ export { DropActionBox, type DropActionBoxProps };
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ActionBoxView } from '../../../utils/drop/view.js';
3
+ import '@medialane/sdk';
4
+ import '@medialane/sdk/starknet';
5
+
6
+ interface DropActionBoxProps {
7
+ view: ActionBoxView;
8
+ minted: bigint;
9
+ maxSupply: bigint;
10
+ quantity: bigint;
11
+ onQuantity: (q: bigint) => void;
12
+ onAction: () => void;
13
+ }
14
+ declare function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }: DropActionBoxProps): react_jsx_runtime.JSX.Element;
15
+
16
+ export { DropActionBox, type DropActionBoxProps };
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Minus, Plus } from "lucide-react";
4
+ import { DropCountdown } from "../../drop-countdown.js";
5
+ import { DropStatusBadge, DropSupplyProgress } from "../../drop-status-display.js";
6
+ import { GradientButton } from "../../gradient-button.js";
7
+ function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }) {
8
+ const canPick = view.button.action === "mint" && view.maxQuantity > 1n;
9
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-5 rounded-2xl border border-border bg-card p-5", children: [
10
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
11
+ /* @__PURE__ */ jsx(DropStatusBadge, { phase: view.phase }),
12
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: view.statusText })
13
+ ] }),
14
+ view.countdown && /* @__PURE__ */ jsx(DropCountdown, { targetTs: view.countdown.target, label: view.countdown.label }),
15
+ maxSupply > 0n ? /* @__PURE__ */ jsx(DropSupplyProgress, { minted: Number(minted), max: Number(maxSupply) }) : /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
16
+ Number(minted).toLocaleString("en-US"),
17
+ " minted"
18
+ ] }),
19
+ /* @__PURE__ */ jsxs("div", { className: "flex items-end justify-between gap-3", children: [
20
+ /* @__PURE__ */ jsxs("div", { children: [
21
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Price" }),
22
+ /* @__PURE__ */ jsx("p", { className: "text-xl font-bold", children: view.priceText })
23
+ ] }),
24
+ canPick && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", "aria-label": "Quantity", children: [
25
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Quantity" }),
26
+ /* @__PURE__ */ jsx("button", { type: "button", className: "rounded-md border border-border p-2", disabled: quantity <= 1n, onClick: () => onQuantity(quantity - 1n), children: /* @__PURE__ */ jsx(Minus, { className: "h-3.5 w-3.5" }) }),
27
+ /* @__PURE__ */ jsx("span", { className: "w-8 text-center font-semibold tabular-nums", children: quantity.toString() }),
28
+ /* @__PURE__ */ jsx("button", { type: "button", className: "rounded-md border border-border p-2", disabled: quantity >= view.maxQuantity, onClick: () => onQuantity(quantity + 1n), children: /* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" }) })
29
+ ] })
30
+ ] }),
31
+ view.totalText && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: view.totalText }),
32
+ view.eligibility && /* @__PURE__ */ jsx("p", { className: "text-sm", children: view.eligibility }),
33
+ /* @__PURE__ */ jsx(GradientButton, { big: true, disabled: view.button.action === "none", onClick: onAction, className: "disabled:opacity-50", children: view.button.label })
34
+ ] });
35
+ }
36
+ export {
37
+ DropActionBox
38
+ };
39
+ //# sourceMappingURL=drop-action-box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/page/drop-action-box.tsx"],"sourcesContent":["\"use client\";\n\nimport { Minus, Plus } from \"lucide-react\";\nimport { DropCountdown } from \"../../drop-countdown.js\";\nimport { DropStatusBadge, DropSupplyProgress } from \"../../drop-status-display.js\";\nimport { GradientButton } from \"../../gradient-button.js\";\nimport type { ActionBoxView } from \"../../../utils/drop/view.js\";\n\nexport interface DropActionBoxProps {\n view: ActionBoxView;\n minted: bigint;\n maxSupply: bigint;\n quantity: bigint;\n onQuantity: (q: bigint) => void;\n onAction: () => void;\n}\n\nexport function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }: DropActionBoxProps) {\n const canPick = view.button.action === \"mint\" && view.maxQuantity > 1n;\n return (\n <div className=\"space-y-5 rounded-2xl border border-border bg-card p-5\">\n <div className=\"flex items-center justify-between gap-3\">\n <DropStatusBadge phase={view.phase} />\n <span className=\"text-xs text-muted-foreground\">{view.statusText}</span>\n </div>\n {view.countdown && <DropCountdown targetTs={view.countdown.target} label={view.countdown.label} />}\n {maxSupply > 0n\n ? <DropSupplyProgress minted={Number(minted)} max={Number(maxSupply)} />\n : <p className=\"text-sm text-muted-foreground\">{Number(minted).toLocaleString(\"en-US\")} minted</p>}\n <div className=\"flex items-end justify-between gap-3\">\n <div>\n <p className=\"text-xs text-muted-foreground\">Price</p>\n <p className=\"text-xl font-bold\">{view.priceText}</p>\n </div>\n {canPick && (\n <div className=\"flex items-center gap-2\" aria-label=\"Quantity\">\n <span className=\"sr-only\">Quantity</span>\n <button type=\"button\" className=\"rounded-md border border-border p-2\" disabled={quantity <= 1n} onClick={() => onQuantity(quantity - 1n)}><Minus className=\"h-3.5 w-3.5\" /></button>\n <span className=\"w-8 text-center font-semibold tabular-nums\">{quantity.toString()}</span>\n <button type=\"button\" className=\"rounded-md border border-border p-2\" disabled={quantity >= view.maxQuantity} onClick={() => onQuantity(quantity + 1n)}><Plus className=\"h-3.5 w-3.5\" /></button>\n </div>\n )}\n </div>\n {view.totalText && <p className=\"text-sm text-muted-foreground\">{view.totalText}</p>}\n {view.eligibility && <p className=\"text-sm\">{view.eligibility}</p>}\n <GradientButton big disabled={view.button.action === \"none\"} onClick={onAction} className=\"disabled:opacity-50\">\n {view.button.label}\n </GradientButton>\n </div>\n );\n}\n"],"mappings":";AAqBM,SACE,KADF;AAnBN,SAAS,OAAO,YAAY;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB,0BAA0B;AACpD,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OAAE,WAAU,iCAAiC,eAAK,WAAU;AAAA,IAC/E,KAAK,eAAe,oBAAC,OAAE,WAAU,WAAW,eAAK,aAAY;AAAA,IAC9D,oBAAC,kBAAe,KAAG,MAAC,UAAU,KAAK,OAAO,WAAW,QAAQ,SAAS,UAAU,WAAU,uBACvF,eAAK,OAAO,OACf;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var drop_activity_exports = {};
21
+ __export(drop_activity_exports, {
22
+ DropActivityList: () => DropActivityList
23
+ });
24
+ module.exports = __toCommonJS(drop_activity_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_address_display = require("../../address-display.js");
27
+ var import_time = require("../../../utils/time.js");
28
+ function DropActivityList({ mints }) {
29
+ if (mints.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "py-8 text-center text-sm text-muted-foreground", children: "No mints yet." });
30
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "divide-y divide-border/60", children: mints.map((m) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "flex items-center justify-between gap-3 py-3 text-sm", children: [
31
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex min-w-0 items-center gap-1.5", children: [
32
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: m.wallet, chars: 4, showCopy: false }),
33
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground", children: m.kind === "claim" ? `minted ${m.quantity}` : `received ${m.quantity} as a gift` })
34
+ ] }),
35
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "shrink-0 text-xs text-muted-foreground", children: (0, import_time.timeAgo)(m.createdAt) })
36
+ ] }, `${m.txHash}-${m.firstTokenId}`)) });
37
+ }
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ DropActivityList
41
+ });
42
+ //# sourceMappingURL=drop-activity.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/page/drop-activity.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ApiDropMint } from \"@medialane/sdk\";\nimport { AddressDisplay } from \"../../address-display.js\";\nimport { timeAgo } from \"../../../utils/time.js\";\n\nexport function DropActivityList({ mints }: { mints: ApiDropMint[] }) {\n if (mints.length === 0) return <p className=\"py-8 text-center text-sm text-muted-foreground\">No mints yet.</p>;\n return (\n <ul className=\"divide-y divide-border/60\">\n {mints.map((m) => (\n <li key={`${m.txHash}-${m.firstTokenId}`} className=\"flex items-center justify-between gap-3 py-3 text-sm\">\n <span className=\"flex min-w-0 items-center gap-1.5\">\n <AddressDisplay address={m.wallet} chars={4} showCopy={false} />\n <span className=\"text-muted-foreground\">{m.kind === \"claim\" ? `minted ${m.quantity}` : `received ${m.quantity} as a gift`}</span>\n </span>\n <span className=\"shrink-0 text-xs text-muted-foreground\">{timeAgo(m.createdAt)}</span>\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOiC;AAJjC,6BAA+B;AAC/B,kBAAwB;AAEjB,SAAS,iBAAiB,EAAE,MAAM,GAA6B;AACpE,MAAI,MAAM,WAAW,EAAG,QAAO,4CAAC,OAAE,WAAU,kDAAiD,2BAAa;AAC1G,SACE,4CAAC,QAAG,WAAU,6BACX,gBAAM,IAAI,CAAC,MACV,6CAAC,QAAyC,WAAU,wDAClD;AAAA,iDAAC,UAAK,WAAU,qCACd;AAAA,kDAAC,yCAAe,SAAS,EAAE,QAAQ,OAAO,GAAG,UAAU,OAAO;AAAA,MAC9D,4CAAC,UAAK,WAAU,yBAAyB,YAAE,SAAS,UAAU,UAAU,EAAE,QAAQ,KAAK,YAAY,EAAE,QAAQ,cAAa;AAAA,OAC5H;AAAA,IACA,4CAAC,UAAK,WAAU,0CAA0C,mCAAQ,EAAE,SAAS,GAAE;AAAA,OALxE,GAAG,EAAE,MAAM,IAAI,EAAE,YAAY,EAMtC,CACD,GACH;AAEJ;","names":[]}
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ApiDropMint } from '@medialane/sdk';
3
+
4
+ declare function DropActivityList({ mints }: {
5
+ mints: ApiDropMint[];
6
+ }): react_jsx_runtime.JSX.Element;
7
+
8
+ export { DropActivityList };
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ApiDropMint } from '@medialane/sdk';
3
+
4
+ declare function DropActivityList({ mints }: {
5
+ mints: ApiDropMint[];
6
+ }): react_jsx_runtime.JSX.Element;
7
+
8
+ export { DropActivityList };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { AddressDisplay } from "../../address-display.js";
4
+ import { timeAgo } from "../../../utils/time.js";
5
+ function DropActivityList({ mints }) {
6
+ if (mints.length === 0) return /* @__PURE__ */ jsx("p", { className: "py-8 text-center text-sm text-muted-foreground", children: "No mints yet." });
7
+ return /* @__PURE__ */ jsx("ul", { className: "divide-y divide-border/60", children: mints.map((m) => /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between gap-3 py-3 text-sm", children: [
8
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
9
+ /* @__PURE__ */ jsx(AddressDisplay, { address: m.wallet, chars: 4, showCopy: false }),
10
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: m.kind === "claim" ? `minted ${m.quantity}` : `received ${m.quantity} as a gift` })
11
+ ] }),
12
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: timeAgo(m.createdAt) })
13
+ ] }, `${m.txHash}-${m.firstTokenId}`)) });
14
+ }
15
+ export {
16
+ DropActivityList
17
+ };
18
+ //# sourceMappingURL=drop-activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/page/drop-activity.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ApiDropMint } from \"@medialane/sdk\";\nimport { AddressDisplay } from \"../../address-display.js\";\nimport { timeAgo } from \"../../../utils/time.js\";\n\nexport function DropActivityList({ mints }: { mints: ApiDropMint[] }) {\n if (mints.length === 0) return <p className=\"py-8 text-center text-sm text-muted-foreground\">No mints yet.</p>;\n return (\n <ul className=\"divide-y divide-border/60\">\n {mints.map((m) => (\n <li key={`${m.txHash}-${m.firstTokenId}`} className=\"flex items-center justify-between gap-3 py-3 text-sm\">\n <span className=\"flex min-w-0 items-center gap-1.5\">\n <AddressDisplay address={m.wallet} chars={4} showCopy={false} />\n <span className=\"text-muted-foreground\">{m.kind === \"claim\" ? `minted ${m.quantity}` : `received ${m.quantity} as a gift`}</span>\n </span>\n <span className=\"shrink-0 text-xs text-muted-foreground\">{timeAgo(m.createdAt)}</span>\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";AAOiC,cAKvB,YALuB;AAJjC,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AAEjB,SAAS,iBAAiB,EAAE,MAAM,GAA6B;AACpE,MAAI,MAAM,WAAW,EAAG,QAAO,oBAAC,OAAE,WAAU,kDAAiD,2BAAa;AAC1G,SACE,oBAAC,QAAG,WAAU,6BACX,gBAAM,IAAI,CAAC,MACV,qBAAC,QAAyC,WAAU,wDAClD;AAAA,yBAAC,UAAK,WAAU,qCACd;AAAA,0BAAC,kBAAe,SAAS,EAAE,QAAQ,OAAO,GAAG,UAAU,OAAO;AAAA,MAC9D,oBAAC,UAAK,WAAU,yBAAyB,YAAE,SAAS,UAAU,UAAU,EAAE,QAAQ,KAAK,YAAY,EAAE,QAAQ,cAAa;AAAA,OAC5H;AAAA,IACA,oBAAC,UAAK,WAAU,0CAA0C,kBAAQ,EAAE,SAAS,GAAE;AAAA,OALxE,GAAG,EAAE,MAAM,IAAI,EAAE,YAAY,EAMtC,CACD,GACH;AAEJ;","names":[]}
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var drop_manage_exports = {};
21
+ __export(drop_manage_exports, {
22
+ DropManage: () => DropManage
23
+ });
24
+ module.exports = __toCommonJS(drop_manage_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_starknet = require("@medialane/sdk/starknet");
28
+ var import_sdk = require("@medialane/sdk");
29
+ var import_action_dialog = require("../../action-dialog.js");
30
+ var import_button = require("../../button.js");
31
+ var import_input = require("../../input.js");
32
+ var import_textarea = require("../../textarea.js");
33
+ var import_share_button = require("../../share-button.js");
34
+ var import_stat_tile = require("../../stat-tile.js");
35
+ var import_drop_activity = require("./drop-activity.js");
36
+ var import_exclusive_fields = require("../create/exclusive-fields.js");
37
+ var import_launch_dialog = require("../create/launch-dialog.js");
38
+ var import_describe_error = require("../../../utils/describe-error.js");
39
+ var import_allowlist = require("../../../utils/drop/allowlist.js");
40
+ var import_sale = require("../../../utils/drop/sale.js");
41
+ function DropManage({ contract, indexed, onchain, mints, run, saveExclusive }) {
42
+ const [pending, setPending] = (0, import_react.useState)(null);
43
+ const [busy, setBusy] = (0, import_react.useState)(false);
44
+ const [message, setMessage] = (0, import_react.useState)(null);
45
+ const [listText, setListText] = (0, import_react.useState)("");
46
+ const [links, setLinks] = (0, import_react.useState)([]);
47
+ const [gift, setGift] = (0, import_react.useState)({ to: "", quantity: "1" });
48
+ const [exclusive, setExclusive] = (0, import_react.useState)({ title: "", url: "", type: "" });
49
+ const listed = BigInt(onchain.allowlistRoot) !== 0n;
50
+ const left = onchain.maxSupply === 0n ? null : onchain.maxSupply - onchain.totalMinted;
51
+ const shareUrl = typeof window === "undefined" ? (0, import_sdk.dropHref)(contract) : `${window.location.origin}${(0, import_sdk.dropHref)(contract)}`;
52
+ const confirm = async () => {
53
+ if (!pending) return;
54
+ setBusy(true);
55
+ try {
56
+ await pending.act();
57
+ setMessage(`${pending.title} \u2014 done.`);
58
+ } catch (err) {
59
+ setMessage((0, import_describe_error.describeError)(err, "That didn't go through. Please try again.").message);
60
+ } finally {
61
+ setBusy(false);
62
+ setPending(null);
63
+ }
64
+ };
65
+ const parsed = (0, import_allowlist.parseAllowlist)(listText);
66
+ const list = parsed.addresses.length > 0 ? (0, import_starknet.buildPopAllowlist)(parsed.addresses) : null;
67
+ const sameList = list !== null && BigInt(list.root) === BigInt(onchain.allowlistRoot);
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-8", children: [
69
+ message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "rounded-lg bg-muted/50 px-3 py-2 text-sm", children: message }),
70
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold", children: "Overview" }),
72
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-3", children: [
73
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stat_tile.StatTile, { label: "Minted", value: (0, import_sale.supplyLabel)(onchain.totalMinted.toString(), onchain.maxSupply.toString()) }),
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stat_tile.StatTile, { label: "Revenue", value: (0, import_sale.priceLabel)(indexed?.revenue ?? "0", onchain.paymentToken) }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stat_tile.StatTile, { label: "Collectors", value: indexed?.collectors ?? 0 })
76
+ ] }),
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_activity.DropActivityList, { mints })
78
+ ] }),
79
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
80
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold", children: "Who can mint" }),
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: listed ? "Only wallets on your list can mint." : "Everyone can mint." }),
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_textarea.Textarea, { rows: 5, placeholder: "Paste wallet addresses, one per line", value: listText, onChange: (e) => {
83
+ setListText(e.target.value);
84
+ setLinks([]);
85
+ } }),
86
+ parsed.invalid.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-destructive", children: [
87
+ parsed.invalid.length,
88
+ " line(s) aren't wallet addresses: ",
89
+ parsed.invalid.slice(0, 3).join(", ")
90
+ ] }),
91
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap gap-2", children: [
92
+ list && sameList && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", onClick: () => setLinks((0, import_starknet.dropClaimLinks)(window.location.origin, contract, list)), children: "This is your current list \u2014 get its claim links" }),
93
+ list && !sameList && parsed.invalid.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { onClick: () => setPending({
94
+ title: "List published",
95
+ body: `Only these ${parsed.addresses.length} wallets will be able to mint. Claim links for your previous list stop working for wallets not on this one.`,
96
+ act: async () => {
97
+ await run({ action: "set_allowlist_root", root: list.root });
98
+ setLinks((0, import_starknet.dropClaimLinks)(window.location.origin, contract, list));
99
+ }
100
+ }), children: "Publish this list" }),
101
+ listed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", onClick: () => setPending({
102
+ title: "Drop opened to everyone",
103
+ body: "Anyone will be able to mint, with or without a claim link.",
104
+ act: () => run({ action: "set_allowlist_root", root: "0x0" })
105
+ }), children: "Open to everyone" }),
106
+ links.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", onClick: () => (0, import_launch_dialog.downloadCsv)((0, import_starknet.popClaimLinksCsv)(links), "claim-links.csv"), children: "Download claim links" })
107
+ ] })
108
+ ] }),
109
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
110
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold", children: "Gift" }),
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
112
+ "Mint free tokens to a wallet",
113
+ left !== null ? ` \xB7 ${left.toString()} left` : "",
114
+ ". Gifts don't count toward that wallet's limit."
115
+ ] }),
116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-2", children: [
117
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { placeholder: "Wallet address", value: gift.to, onChange: (e) => setGift({ ...gift, to: e.target.value.trim() }) }),
118
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { className: "w-20", inputMode: "numeric", value: gift.quantity, onChange: (e) => setGift({ ...gift, quantity: e.target.value.trim() }) })
119
+ ] }),
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
121
+ import_button.Button,
122
+ {
123
+ disabled: (0, import_allowlist.parseAllowlist)(gift.to).addresses.length !== 1 || !/^[1-9]\d*$/.test(gift.quantity),
124
+ onClick: () => setPending({
125
+ title: "Gift sent",
126
+ body: `Mint ${gift.quantity} free token(s) to ${gift.to}.`,
127
+ act: () => run({ action: "issue", recipient: gift.to, quantity: gift.quantity })
128
+ }),
129
+ children: "Send gift"
130
+ }
131
+ )
132
+ ] }),
133
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold", children: "Share" }),
135
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-2", children: [
136
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { readOnly: true, value: shareUrl }),
137
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_share_button.ShareButton, { title: indexed?.name ?? "Drop", url: shareUrl, variant: "outline" })
138
+ ] })
139
+ ] }),
140
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold", children: "Exclusive content" }),
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_exclusive_fields.ExclusiveFields, { value: exclusive, onChange: setExclusive }),
143
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-2", children: [
144
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { disabled: !/^https:\/\//.test(exclusive.url), onClick: () => setPending({ title: "Exclusive content saved", body: "Holders will see this link.", act: () => saveExclusive(exclusive) }), children: "Save" }),
145
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", onClick: () => setPending({ title: "Exclusive content removed", body: "Holders will no longer see a link.", act: () => saveExclusive(null) }), children: "Remove" })
146
+ ] })
147
+ ] }),
148
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_dialog.ActionDialog, { open: pending !== null, onClose: () => !busy && setPending(null), width: 460, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4 p-6", children: [
149
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm", children: pending?.body }),
150
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex justify-end gap-2", children: [
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", disabled: busy, onClick: () => setPending(null), children: "Cancel" }),
152
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { disabled: busy, onClick: () => void confirm(), children: busy ? "Working\u2026" : "Confirm" })
153
+ ] })
154
+ ] }) })
155
+ ] });
156
+ }
157
+ // Annotate the CommonJS export names for ESM import in node:
158
+ 0 && (module.exports = {
159
+ DropManage
160
+ });
161
+ //# sourceMappingURL=drop-manage.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/page/drop-manage.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { buildPopAllowlist, dropClaimLinks, popClaimLinksCsv, type DropOnchain } from \"@medialane/sdk/starknet\";\nimport { dropHref, type ApiDrop, type ApiDropMint } from \"@medialane/sdk\";\nimport { ActionDialog } from \"../../action-dialog.js\";\nimport { Button } from \"../../button.js\";\nimport { Input } from \"../../input.js\";\nimport { Textarea } from \"../../textarea.js\";\nimport { ShareButton } from \"../../share-button.js\";\nimport { StatTile } from \"../../stat-tile.js\";\nimport { DropActivityList } from \"./drop-activity.js\";\nimport { ExclusiveFields, type ExclusiveValue } from \"../create/exclusive-fields.js\";\nimport { downloadCsv } from \"../create/launch-dialog.js\";\nimport { describeError } from \"../../../utils/describe-error.js\";\nimport { parseAllowlist } from \"../../../utils/drop/allowlist.js\";\nimport { priceLabel, supplyLabel } from \"../../../utils/drop/sale.js\";\n\nexport interface DropManageProps {\n contract: string;\n indexed: ApiDrop | null;\n onchain: DropOnchain;\n mints: ApiDropMint[];\n /** Runs a manage action as one transaction; resolves when confirmed. */\n run: (params: { action: \"issue\"; recipient: string; quantity: string } | { action: \"set_allowlist_root\"; root: string }) => Promise<void>;\n saveExclusive: (value: ExclusiveValue | null) => Promise<void>;\n}\n\ntype Pending = { title: string; body: string; act: () => Promise<void> } | null;\n\nexport function DropManage({ contract, indexed, onchain, mints, run, saveExclusive }: DropManageProps) {\n const [pending, setPending] = useState<Pending>(null);\n const [busy, setBusy] = useState(false);\n const [message, setMessage] = useState<string | null>(null);\n const [listText, setListText] = useState(\"\");\n const [links, setLinks] = useState<ReturnType<typeof dropClaimLinks>>([]);\n const [gift, setGift] = useState({ to: \"\", quantity: \"1\" });\n const [exclusive, setExclusive] = useState<ExclusiveValue>({ title: \"\", url: \"\", type: \"\" });\n const listed = BigInt(onchain.allowlistRoot) !== 0n;\n const left = onchain.maxSupply === 0n ? null : onchain.maxSupply - onchain.totalMinted;\n const shareUrl = typeof window === \"undefined\" ? dropHref(contract) : `${window.location.origin}${dropHref(contract)}`;\n\n const confirm = async () => {\n if (!pending) return;\n setBusy(true);\n try {\n await pending.act();\n setMessage(`${pending.title} — done.`);\n } catch (err) {\n setMessage(describeError(err, \"That didn't go through. Please try again.\").message);\n } finally {\n setBusy(false);\n setPending(null);\n }\n };\n\n const parsed = parseAllowlist(listText);\n const list = parsed.addresses.length > 0 ? buildPopAllowlist(parsed.addresses) : null;\n const sameList = list !== null && BigInt(list.root) === BigInt(onchain.allowlistRoot);\n\n return (\n <div className=\"space-y-8\">\n {message && <p className=\"rounded-lg bg-muted/50 px-3 py-2 text-sm\">{message}</p>}\n\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold\">Overview</h3>\n <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-3\">\n <StatTile label=\"Minted\" value={supplyLabel(onchain.totalMinted.toString(), onchain.maxSupply.toString())} />\n <StatTile label=\"Revenue\" value={priceLabel(indexed?.revenue ?? \"0\", onchain.paymentToken)} />\n <StatTile label=\"Collectors\" value={indexed?.collectors ?? 0} />\n </div>\n <DropActivityList mints={mints} />\n </section>\n\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold\">Who can mint</h3>\n <p className=\"text-sm text-muted-foreground\">{listed ? \"Only wallets on your list can mint.\" : \"Everyone can mint.\"}</p>\n <Textarea rows={5} placeholder=\"Paste wallet addresses, one per line\" value={listText} onChange={(e) => { setListText(e.target.value); setLinks([]); }} />\n {parsed.invalid.length > 0 && <p className=\"text-xs text-destructive\">{parsed.invalid.length} line(s) aren't wallet addresses: {parsed.invalid.slice(0, 3).join(\", \")}</p>}\n <div className=\"flex flex-wrap gap-2\">\n {list && sameList && (\n <Button variant=\"outline\" onClick={() => setLinks(dropClaimLinks(window.location.origin, contract, list))}>This is your current list — get its claim links</Button>\n )}\n {list && !sameList && parsed.invalid.length === 0 && (\n <Button onClick={() => setPending({\n title: \"List published\",\n body: `Only these ${parsed.addresses.length} wallets will be able to mint. Claim links for your previous list stop working for wallets not on this one.`,\n act: async () => { await run({ action: \"set_allowlist_root\", root: list.root }); setLinks(dropClaimLinks(window.location.origin, contract, list)); },\n })}>Publish this list</Button>\n )}\n {listed && (\n <Button variant=\"outline\" onClick={() => setPending({\n title: \"Drop opened to everyone\",\n body: \"Anyone will be able to mint, with or without a claim link.\",\n act: () => run({ action: \"set_allowlist_root\", root: \"0x0\" }),\n })}>Open to everyone</Button>\n )}\n {links.length > 0 && <Button variant=\"outline\" onClick={() => downloadCsv(popClaimLinksCsv(links), \"claim-links.csv\")}>Download claim links</Button>}\n </div>\n </section>\n\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold\">Gift</h3>\n <p className=\"text-sm text-muted-foreground\">\n Mint free tokens to a wallet{left !== null ? ` · ${left.toString()} left` : \"\"}. Gifts don't count toward that wallet's limit.\n </p>\n <div className=\"flex gap-2\">\n <Input placeholder=\"Wallet address\" value={gift.to} onChange={(e) => setGift({ ...gift, to: e.target.value.trim() })} />\n <Input className=\"w-20\" inputMode=\"numeric\" value={gift.quantity} onChange={(e) => setGift({ ...gift, quantity: e.target.value.trim() })} />\n </div>\n <Button\n disabled={parseAllowlist(gift.to).addresses.length !== 1 || !/^[1-9]\\d*$/.test(gift.quantity)}\n onClick={() => setPending({\n title: \"Gift sent\",\n body: `Mint ${gift.quantity} free token(s) to ${gift.to}.`,\n act: () => run({ action: \"issue\", recipient: gift.to, quantity: gift.quantity }),\n })}\n >Send gift</Button>\n </section>\n\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold\">Share</h3>\n <div className=\"flex gap-2\">\n <Input readOnly value={shareUrl} />\n <ShareButton title={indexed?.name ?? \"Drop\"} url={shareUrl} variant=\"outline\" />\n </div>\n </section>\n\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold\">Exclusive content</h3>\n <ExclusiveFields value={exclusive} onChange={setExclusive} />\n <div className=\"flex gap-2\">\n <Button disabled={!/^https:\\/\\//.test(exclusive.url)} onClick={() => setPending({ title: \"Exclusive content saved\", body: \"Holders will see this link.\", act: () => saveExclusive(exclusive) })}>Save</Button>\n <Button variant=\"outline\" onClick={() => setPending({ title: \"Exclusive content removed\", body: \"Holders will no longer see a link.\", act: () => saveExclusive(null) })}>Remove</Button>\n </div>\n </section>\n\n <ActionDialog open={pending !== null} onClose={() => !busy && setPending(null)} width={460}>\n <div className=\"space-y-4 p-6\">\n <p className=\"text-sm\">{pending?.body}</p>\n <div className=\"flex justify-end gap-2\">\n <Button variant=\"outline\" disabled={busy} onClick={() => setPending(null)}>Cancel</Button>\n <Button disabled={busy} onClick={() => void confirm()}>{busy ? \"Working…\" : \"Confirm\"}</Button>\n </div>\n </div>\n </ActionDialog>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DkB;AA5DlB,mBAAyB;AACzB,sBAAsF;AACtF,iBAAyD;AACzD,2BAA6B;AAC7B,oBAAuB;AACvB,mBAAsB;AACtB,sBAAyB;AACzB,0BAA4B;AAC5B,uBAAyB;AACzB,2BAAiC;AACjC,8BAAqD;AACrD,2BAA4B;AAC5B,4BAA8B;AAC9B,uBAA+B;AAC/B,kBAAwC;AAcjC,SAAS,WAAW,EAAE,UAAU,SAAS,SAAS,OAAO,KAAK,cAAc,GAAoB;AACrG,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAkB,IAAI;AACpD,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,KAAK;AACtC,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAwB,IAAI;AAC1D,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,EAAE;AAC3C,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAA4C,CAAC,CAAC;AACxE,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,EAAE,IAAI,IAAI,UAAU,IAAI,CAAC;AAC1D,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAyB,EAAE,OAAO,IAAI,KAAK,IAAI,MAAM,GAAG,CAAC;AAC3F,QAAM,SAAS,OAAO,QAAQ,aAAa,MAAM;AACjD,QAAM,OAAO,QAAQ,cAAc,KAAK,OAAO,QAAQ,YAAY,QAAQ;AAC3E,QAAM,WAAW,OAAO,WAAW,kBAAc,qBAAS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