@openrails/billing-ui 0.273.0 → 0.274.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 (160) hide show
  1. package/dist/admin/components/customer-search.d.ts +5 -0
  2. package/dist/admin/components/missing-record.d.ts +6 -0
  3. package/dist/admin/components/status-badge.d.ts +1 -0
  4. package/dist/admin/context.d.ts +20 -2
  5. package/dist/admin/lib/api/endpoints.d.ts +3 -1
  6. package/dist/admin/lib/api/index.d.ts +2 -0
  7. package/dist/admin/lib/api/types.d.ts +2 -0
  8. package/dist/admin/lib/capabilities.d.ts +4 -0
  9. package/dist/admin/lib/dialog-width.d.ts +4 -3
  10. package/dist/admin/lib/error-text.d.ts +4 -0
  11. package/dist/admin/lib/mutations.d.ts +6 -1
  12. package/dist/admin/lib/queries.d.ts +3 -0
  13. package/dist/admin/lib/tile-grids.d.ts +6 -0
  14. package/dist/admin/messages.d.ts +89 -0
  15. package/dist/admin/pages/payments/index.d.ts +1 -2
  16. package/dist/admin/pages/subscriptions/index.d.ts +1 -2
  17. package/dist/{admin-attempts-DyDDt-qw.js → admin-attempts-Dzipkstg.js} +145 -144
  18. package/dist/admin-attempts-Dzipkstg.js.map +1 -0
  19. package/dist/{admin-auth-1aZIgXiS.js → admin-auth-BCl_Tv3t.js} +2 -2
  20. package/dist/{admin-auth-1aZIgXiS.js.map → admin-auth-BCl_Tv3t.js.map} +1 -1
  21. package/dist/{admin-badge-pgG6D9-a.js → admin-badge-kmYQM9Ge.js} +2 -2
  22. package/dist/{admin-badge-pgG6D9-a.js.map → admin-badge-kmYQM9Ge.js.map} +1 -1
  23. package/dist/{admin-button-CrcYk5r0.js → admin-button-Cq9ZfX4R.js} +2 -2
  24. package/dist/{admin-button-CrcYk5r0.js.map → admin-button-Cq9ZfX4R.js.map} +1 -1
  25. package/dist/{admin-capabilities-BDcZeHL_.js → admin-capabilities-k5fQZhN9.js} +35 -14
  26. package/dist/admin-capabilities-k5fQZhN9.js.map +1 -0
  27. package/dist/{admin-card-DvTMc5Se.js → admin-card-C8k67jJv.js} +2 -2
  28. package/dist/{admin-card-DvTMc5Se.js.map → admin-card-C8k67jJv.js.map} +1 -1
  29. package/dist/{admin-catalog-BlF5mnu4.js → admin-catalog-CON-GwKL.js} +286 -286
  30. package/dist/{admin-catalog-BlF5mnu4.js.map → admin-catalog-CON-GwKL.js.map} +1 -1
  31. package/dist/{admin-cursor-pager-CIb3Jw2F.js → admin-cursor-pager-DqFruoNu.js} +6 -6
  32. package/dist/{admin-cursor-pager-CIb3Jw2F.js.map → admin-cursor-pager-DqFruoNu.js.map} +1 -1
  33. package/dist/admin-customer-search-CJHB80rg.js +117 -0
  34. package/dist/admin-customer-search-CJHB80rg.js.map +1 -0
  35. package/dist/{admin-customers-EpfoWDh-.js → admin-customers-CWWOrcVR.js} +18 -17
  36. package/dist/{admin-customers-EpfoWDh-.js.map → admin-customers-CWWOrcVR.js.map} +1 -1
  37. package/dist/admin-dashboard-BiShWFk2.js +456 -0
  38. package/dist/admin-dashboard-BiShWFk2.js.map +1 -0
  39. package/dist/admin-data-table-CdsjYJh5.js +107 -0
  40. package/dist/admin-data-table-CdsjYJh5.js.map +1 -0
  41. package/dist/admin-detail-BWSC1aCH.js +338 -0
  42. package/dist/admin-detail-BWSC1aCH.js.map +1 -0
  43. package/dist/admin-detail-CKRtK43V.js +728 -0
  44. package/dist/admin-detail-CKRtK43V.js.map +1 -0
  45. package/dist/admin-detail-CMmhZQ2A.js +346 -0
  46. package/dist/admin-detail-CMmhZQ2A.js.map +1 -0
  47. package/dist/admin-detail-CiONe1Pt.js +1357 -0
  48. package/dist/admin-detail-CiONe1Pt.js.map +1 -0
  49. package/dist/{admin-detail-3wFIDPNB.js → admin-detail-Cyuf_i9U.js} +62 -62
  50. package/dist/{admin-detail-3wFIDPNB.js.map → admin-detail-Cyuf_i9U.js.map} +1 -1
  51. package/dist/{admin-dialog-BSRf9Zre.js → admin-dialog-Ch7rTOCr.js} +3 -3
  52. package/dist/{admin-dialog-BSRf9Zre.js.map → admin-dialog-Ch7rTOCr.js.map} +1 -1
  53. package/dist/admin-dialog-width-CC7QHT1p.js +6 -0
  54. package/dist/admin-dialog-width-CC7QHT1p.js.map +1 -0
  55. package/dist/{admin-dropdown-menu-D0E5rwmn.js → admin-dropdown-menu-Bah3f8AZ.js} +2 -2
  56. package/dist/{admin-dropdown-menu-D0E5rwmn.js.map → admin-dropdown-menu-Bah3f8AZ.js.map} +1 -1
  57. package/dist/{admin-fact-card-BPSVhS15.js → admin-fact-card-Bt__Cd_U.js} +2 -2
  58. package/dist/{admin-fact-card-BPSVhS15.js.map → admin-fact-card-Bt__Cd_U.js.map} +1 -1
  59. package/dist/{admin-health-D0L5Kig7.js → admin-health-pzTO6_0v.js} +249 -248
  60. package/dist/admin-health-pzTO6_0v.js.map +1 -0
  61. package/dist/{admin-imports-CgZB5JAV.js → admin-imports-tT5et8-V.js} +62 -62
  62. package/dist/{admin-imports-CgZB5JAV.js.map → admin-imports-tT5et8-V.js.map} +1 -1
  63. package/dist/{admin-input-DJAK9nmk.js → admin-input-DvRZy_2a.js} +2 -2
  64. package/dist/{admin-input-DJAK9nmk.js.map → admin-input-DvRZy_2a.js.map} +1 -1
  65. package/dist/{admin-label-aviN9Gng.js → admin-label-QZtWJGH-.js} +2 -2
  66. package/dist/{admin-label-aviN9Gng.js.map → admin-label-QZtWJGH-.js.map} +1 -1
  67. package/dist/{admin-linked-table-row-BGr7JXeM.js → admin-linked-table-row-6jkCKwMn.js} +4 -4
  68. package/dist/{admin-linked-table-row-BGr7JXeM.js.map → admin-linked-table-row-6jkCKwMn.js.map} +1 -1
  69. package/dist/{admin-map-dialog-DS2Wz6G3.js → admin-map-dialog-BV54mvMQ.js} +22 -22
  70. package/dist/{admin-map-dialog-DS2Wz6G3.js.map → admin-map-dialog-BV54mvMQ.js.map} +1 -1
  71. package/dist/{admin-metering-D-e-37Jn.js → admin-metering-Bv5EcX6M.js} +306 -306
  72. package/dist/{admin-metering-D-e-37Jn.js.map → admin-metering-Bv5EcX6M.js.map} +1 -1
  73. package/dist/admin-missing-record-BXqGFDt3.js +42 -0
  74. package/dist/admin-missing-record-BXqGFDt3.js.map +1 -0
  75. package/dist/admin-ops-h3RjpcNu.js +356 -0
  76. package/dist/admin-ops-h3RjpcNu.js.map +1 -0
  77. package/dist/admin-orders-DYxPiuTl.js +192 -0
  78. package/dist/admin-orders-DYxPiuTl.js.map +1 -0
  79. package/dist/{admin-parked-B8xHkV2e.js → admin-parked-ClKA60d5.js} +51 -51
  80. package/dist/{admin-parked-B8xHkV2e.js.map → admin-parked-ClKA60d5.js.map} +1 -1
  81. package/dist/admin-payments-BlIuy3wL.js +220 -0
  82. package/dist/admin-payments-BlIuy3wL.js.map +1 -0
  83. package/dist/{admin-price-detail-CSI5oKdb.js → admin-price-detail-BjWYU5A-.js} +98 -98
  84. package/dist/{admin-price-detail-CSI5oKdb.js.map → admin-price-detail-BjWYU5A-.js.map} +1 -1
  85. package/dist/{admin-price-wizard-CBEcNGvP.js → admin-price-wizard-CTbkbmYc.js} +61 -61
  86. package/dist/{admin-price-wizard-CBEcNGvP.js.map → admin-price-wizard-CTbkbmYc.js.map} +1 -1
  87. package/dist/{admin-proposals-Cuj7tvaM.js → admin-proposals-Ci9Q8j7Y.js} +64 -64
  88. package/dist/{admin-proposals-Cuj7tvaM.js.map → admin-proposals-Ci9Q8j7Y.js.map} +1 -1
  89. package/dist/{admin-provider-prices-B6vwnVPi.js → admin-provider-prices-B6Ayq-eN.js} +66 -66
  90. package/dist/{admin-provider-prices-B6vwnVPi.js.map → admin-provider-prices-B6Ayq-eN.js.map} +1 -1
  91. package/dist/{admin-range-picker-De36L-AP.js → admin-range-picker-nfflPp21.js} +9 -9
  92. package/dist/{admin-range-picker-De36L-AP.js.map → admin-range-picker-nfflPp21.js.map} +1 -1
  93. package/dist/{admin-records-H0MlhEVY.js → admin-records-CrTCorWH.js} +43 -43
  94. package/dist/{admin-records-H0MlhEVY.js.map → admin-records-CrTCorWH.js.map} +1 -1
  95. package/dist/{admin-reports-BFGS_PWf.js → admin-reports-BO6wrvtw.js} +50 -50
  96. package/dist/{admin-reports-BFGS_PWf.js.map → admin-reports-BO6wrvtw.js.map} +1 -1
  97. package/dist/{admin-select-BUcEU5Rg.js → admin-select-DvfJ80Rg.js} +2 -2
  98. package/dist/{admin-select-BUcEU5Rg.js.map → admin-select-DvfJ80Rg.js.map} +1 -1
  99. package/dist/{admin-settings-DYC-c7mJ.js → admin-settings-BOoTzhyf.js} +332 -332
  100. package/dist/admin-settings-BOoTzhyf.js.map +1 -0
  101. package/dist/{admin-shared-lfIUEbPY.js → admin-shared-BbGT_qTo.js} +21 -21
  102. package/dist/{admin-shared-lfIUEbPY.js.map → admin-shared-BbGT_qTo.js.map} +1 -1
  103. package/dist/{admin-skeleton-B0yzYY_X.js → admin-skeleton-B2a4ScVE.js} +2 -2
  104. package/dist/{admin-skeleton-B0yzYY_X.js.map → admin-skeleton-B2a4ScVE.js.map} +1 -1
  105. package/dist/admin-status-badge-Bp6cssXY.js +51 -0
  106. package/dist/admin-status-badge-Bp6cssXY.js.map +1 -0
  107. package/dist/admin-subscriptions-D9JmoicC.js +275 -0
  108. package/dist/admin-subscriptions-D9JmoicC.js.map +1 -0
  109. package/dist/{admin-switch-DDorugaw.js → admin-switch-DBBxJRZP.js} +2 -2
  110. package/dist/{admin-switch-DDorugaw.js.map → admin-switch-DBBxJRZP.js.map} +1 -1
  111. package/dist/{admin-table-BU6Tie69.js → admin-table-CPDoVfK4.js} +2 -2
  112. package/dist/{admin-table-BU6Tie69.js.map → admin-table-CPDoVfK4.js.map} +1 -1
  113. package/dist/{admin-tabs-D5lqdVcC.js → admin-tabs-DDUv3kiu.js} +2 -2
  114. package/dist/{admin-tabs-D5lqdVcC.js.map → admin-tabs-DDUv3kiu.js.map} +1 -1
  115. package/dist/{admin-textarea-Dc6lnEub.js → admin-textarea-d3fu_waS.js} +2 -2
  116. package/dist/{admin-textarea-Dc6lnEub.js.map → admin-textarea-d3fu_waS.js.map} +1 -1
  117. package/dist/admin-tile-grids-CzGpidd9.js +6 -0
  118. package/dist/admin-tile-grids-CzGpidd9.js.map +1 -0
  119. package/dist/{admin-typed-confirm-dialog-Bk6XxmPb.js → admin-typed-confirm-dialog-BVklYjFo.js} +11 -11
  120. package/dist/{admin-typed-confirm-dialog-Bk6XxmPb.js.map → admin-typed-confirm-dialog-BVklYjFo.js.map} +1 -1
  121. package/dist/{admin-utils-B9eEBNsR.js → admin-utils-DTT53IpS.js} +266 -223
  122. package/dist/admin-utils-DTT53IpS.js.map +1 -0
  123. package/dist/{admin-widget-viz-8aukE3v_.js → admin-widget-viz-Exsqz3Dw.js} +165 -128
  124. package/dist/admin-widget-viz-Exsqz3Dw.js.map +1 -0
  125. package/dist/admin.css +1 -1
  126. package/dist/admin.js +531 -405
  127. package/dist/admin.js.map +1 -1
  128. package/dist/index.js +1 -1
  129. package/dist/styles.css +1 -1
  130. package/package.json +1 -1
  131. package/dist/admin-attempts-DyDDt-qw.js.map +0 -1
  132. package/dist/admin-capabilities-BDcZeHL_.js.map +0 -1
  133. package/dist/admin-dashboard-CJE63yz4.js +0 -420
  134. package/dist/admin-dashboard-CJE63yz4.js.map +0 -1
  135. package/dist/admin-data-table-hvFcJepL.js +0 -96
  136. package/dist/admin-data-table-hvFcJepL.js.map +0 -1
  137. package/dist/admin-detail-BRP6pL7t.js +0 -328
  138. package/dist/admin-detail-BRP6pL7t.js.map +0 -1
  139. package/dist/admin-detail-CRzFb_pa.js +0 -1331
  140. package/dist/admin-detail-CRzFb_pa.js.map +0 -1
  141. package/dist/admin-detail-QLxU8r-5.js +0 -344
  142. package/dist/admin-detail-QLxU8r-5.js.map +0 -1
  143. package/dist/admin-detail-pPC8Q9l-.js +0 -710
  144. package/dist/admin-detail-pPC8Q9l-.js.map +0 -1
  145. package/dist/admin-dialog-width-BPrgdYlj.js +0 -6
  146. package/dist/admin-dialog-width-BPrgdYlj.js.map +0 -1
  147. package/dist/admin-health-D0L5Kig7.js.map +0 -1
  148. package/dist/admin-ops-CQP4TzWM.js +0 -235
  149. package/dist/admin-ops-CQP4TzWM.js.map +0 -1
  150. package/dist/admin-orders-BJ7W5S8P.js +0 -192
  151. package/dist/admin-orders-BJ7W5S8P.js.map +0 -1
  152. package/dist/admin-payments-CzkzqYA1.js +0 -246
  153. package/dist/admin-payments-CzkzqYA1.js.map +0 -1
  154. package/dist/admin-settings-DYC-c7mJ.js.map +0 -1
  155. package/dist/admin-status-badge-0-K37EfN.js +0 -43
  156. package/dist/admin-status-badge-0-K37EfN.js.map +0 -1
  157. package/dist/admin-subscriptions-CvW-YFs0.js +0 -301
  158. package/dist/admin-subscriptions-CvW-YFs0.js.map +0 -1
  159. package/dist/admin-utils-B9eEBNsR.js.map +0 -1
  160. package/dist/admin-widget-viz-8aukE3v_.js.map +0 -1
@@ -1,710 +0,0 @@
1
- import { C as e, D as t, T as n, c as r, p as i, r as a, s as o } from "./admin-utils-B9eEBNsR.js";
2
- import { t as s } from "./admin-button-CrcYk5r0.js";
3
- import { t as c } from "./admin-input-DJAK9nmk.js";
4
- import { a as l } from "./admin-capabilities-BDcZeHL_.js";
5
- import { i as u, o as d, s as f, u as p } from "./admin-format-DoohJ7Fg.js";
6
- import { t as m } from "./admin-form-field-errors-hbUMIriS.js";
7
- import { a as h, i as g, n as _, r as v, t as y } from "./admin-select-BUcEU5Rg.js";
8
- import { a as b, n as x, o as ee, r as S, s as C, t as w } from "./admin-table-BU6Tie69.js";
9
- import { t as T } from "./admin-badge-pgG6D9-a.js";
10
- import { t as E } from "./admin-status-badge-0-K37EfN.js";
11
- import { a as te, i as ne, n as re, o as ie, r as ae, s as oe, t as se } from "./admin-dialog-BSRf9Zre.js";
12
- import { t as D } from "./admin-label-aviN9Gng.js";
13
- import { t as O } from "./admin-switch-DDorugaw.js";
14
- import { n as ce, r as le } from "./admin-dialog-width-BPrgdYlj.js";
15
- import { n as k } from "./admin-price-format-BVUpDoSC.js";
16
- import { a as ue, o as de, r as fe, t as pe } from "./admin-card-DvTMc5Se.js";
17
- import { t as A } from "./admin-fact-card-BPSVhS15.js";
18
- import { t as j } from "./admin-dunning-B2zgtrOo.js";
19
- import { t as me } from "./admin-typed-confirm-dialog-Bk6XxmPb.js";
20
- import * as M from "react";
21
- import { useMutation as N, useQuery as P, useQueryClient as F } from "@tanstack/react-query";
22
- import { Fragment as he, jsx as I, jsxs as L } from "react/jsx-runtime";
23
- import { HugeiconsIcon as R } from "@hugeicons/react";
24
- import { ArrowLeft01Icon as z } from "@hugeicons/core-free-icons";
25
- import { useForm as B } from "@tanstack/react-form";
26
- //#region src/admin/pages/subscriptions/subscription-change-options.ts
27
- function ge(e) {
28
- let t = e.price, n = `${f(t.unit_amount, t.currency)}${t.quantity ? " per seat" : ""}`;
29
- return [
30
- e.product.display_name,
31
- e.direction,
32
- `${n} ${k(t)}`,
33
- t.key
34
- ].join(" · ");
35
- }
36
- function _e(e, t) {
37
- let n = e.quantity;
38
- return n ? t !== null && t >= n.min && t <= n.max ? t : n.min : null;
39
- }
40
- function ve({ rail: e, status: t, collectionPolicy: n, scheduledChange: r }) {
41
- if (t !== "active" && t !== "past_due") return "Only active or past-due subscriptions can change";
42
- if (r && n !== "engine") return "Its provider already bills a scheduled change";
43
- if (e === "ccbill") return "CCBill changes require customer self-service";
44
- if (e === "solana") return "Solana changes require the customer's wallet signature";
45
- }
46
- function ye({ currentProduct: e, currentPrice: t, currentCurrency: n, products: r, prices: i, scheduledChange: a }) {
47
- let o = e && t && (t.quantity || a) ? [{
48
- direction: "current",
49
- price: t,
50
- product: e
51
- }] : [], s = e?.tier_group?.trim(), c = n?.trim().toLowerCase();
52
- if (!e || !s || !c || a?.source === "migration") return o;
53
- let l = new Map(r.filter((t) => !t.archived && t.id !== e.id && t.tier_group?.trim() === s).map((e) => [e.id, e]));
54
- return o.concat(i.flatMap((t) => {
55
- let n = l.get(t.product_id);
56
- return !n || t.archived || !t.billing_interval_hours || t.currency.trim().toLowerCase() !== c ? [] : [{
57
- direction: n.tier_rank < e.tier_rank ? "downgrade" : "upgrade",
58
- price: t,
59
- product: n
60
- }];
61
- }).sort((e, t) => e.product.tier_rank - t.product.tier_rank || e.product.display_name.localeCompare(t.product.display_name) || e.price.id.localeCompare(t.price.id)));
62
- }
63
- //#endregion
64
- //#region src/admin/pages/subscriptions/change-subscription-dialog.tsx
65
- function be(e) {
66
- let { selectedMerchant: t } = i();
67
- return /* @__PURE__ */ I(V, { ...e }, `${t() ?? ""}:${e.subscriptionId}`);
68
- }
69
- function V({ subscriptionId: r, customerId: a, productId: o, priceId: l, quantity: u, currency: p, collectionPolicy: m, scheduledChange: b, rail: x, status: ee }) {
70
- let { toast: S, toastApiError: C, adminMutations: w, adminQueries: E } = i(), { id: O, text: ce } = t(), [k, ue] = M.useState(!1), [de, fe] = M.useState(""), [pe, A] = M.useState(""), [j, me] = M.useState(""), [he, R] = M.useState(""), z = M.useRef(/* @__PURE__ */ new Map()), B = M.useRef(0);
71
- M.useEffect(() => () => {
72
- B.current++;
73
- }, []);
74
- let be = F(), V = N(w.previewSubscriptionChange(r)), H = N(w.changeSubscription(be, r, a)), U = P({
75
- ...E.allProducts({ errorAction: "Load subscription plans" }),
76
- enabled: k
77
- }), W = P({
78
- ...E.allPrices({ errorAction: "Load subscription prices" }),
79
- enabled: k
80
- }), G = U.data?.data ?? [], xe = W.data?.data ?? [], Se = G.find((e) => e.id === o), Ce = xe.find((e) => e.id === l), K = ye({
81
- currentProduct: Se,
82
- currentPrice: Ce,
83
- currentCurrency: p ?? Ce?.currency,
84
- products: G,
85
- prices: xe,
86
- scheduledChange: b
87
- }), q = K.find((e) => e.price.id === de), J = q?.price.quantity, Y = Number(pe), we = !J || Number.isInteger(Y) && Y >= J.min && Y <= J.max, X = q && we ? {
88
- price_id: q.price.id,
89
- ...J ? { quantity: Y } : {}
90
- } : void 0, Te = q?.direction === "current" && !b && (!J || Y === u), Z = X ? JSON.stringify(X) : "", Q = Z && he === Z ? V.data : void 0, Ee = ve({
91
- rail: x,
92
- status: ee,
93
- collectionPolicy: m,
94
- scheduledChange: b
95
- }), $ = (e) => {
96
- B.current++, ue(e);
97
- }, De = (e) => {
98
- B.current++;
99
- let t = K.find((t) => t.price.id === e)?.price;
100
- fe(e ?? ""), A(String(t ? _e(t, u) ?? "" : "")), R(""), V.reset(), H.reset();
101
- }, Oe = (e) => {
102
- B.current++, A(e), R(""), V.reset(), H.reset();
103
- }, ke = V.error instanceof Error ? V.error.message : "", Ae = H.error instanceof Error ? H.error.message : "", je = H.data?.message, Me = H.data?.next_action?.url ?? void 0;
104
- return /* @__PURE__ */ L(se, {
105
- open: k,
106
- onOpenChange: $,
107
- children: [/* @__PURE__ */ I(oe, { render: /* @__PURE__ */ I(s, {
108
- variant: "outline",
109
- size: "sm",
110
- disabled: !!Ee && !H.variables,
111
- title: Ee,
112
- children: /* @__PURE__ */ I(n, { id: "Change subscription" })
113
- }) }), /* @__PURE__ */ L(re, {
114
- className: le,
115
- children: [
116
- /* @__PURE__ */ L(te, { children: [/* @__PURE__ */ I(ie, { children: /* @__PURE__ */ I(n, { id: "Change subscription" }) }), /* @__PURE__ */ I(ae, { children: /* @__PURE__ */ I(n, { id: "Schedule the customer's plan or seats for the next renewal. No card is charged now. Choosing the current plan and seats clears a pending change. The customer is told." }) })] }),
117
- /* @__PURE__ */ L("div", {
118
- className: "grid gap-5",
119
- children: [
120
- /* @__PURE__ */ L("div", {
121
- className: "grid gap-1.5",
122
- children: [
123
- /* @__PURE__ */ I(D, {
124
- htmlFor: O("subscription-tier"),
125
- children: /* @__PURE__ */ I(n, { id: "New plan" })
126
- }),
127
- /* @__PURE__ */ L(y, {
128
- value: de,
129
- onValueChange: De,
130
- children: [/* @__PURE__ */ I(g, {
131
- id: O("subscription-tier"),
132
- className: "w-full",
133
- disabled: U.isPending || W.isPending,
134
- children: /* @__PURE__ */ I(h, { placeholder: U.isPending || W.isPending ? "Loading plans…" : "Choose a plan" })
135
- }), /* @__PURE__ */ I(_, { children: K.map((e) => /* @__PURE__ */ I(v, {
136
- value: e.price.id,
137
- children: ge(e)
138
- }, e.price.id)) })]
139
- }),
140
- !U.isPending && !W.isPending && !U.isError && !W.isError && K.length === 0 && /* @__PURE__ */ I("p", {
141
- className: "text-xs text-muted-foreground",
142
- children: /* @__PURE__ */ I(n, { id: "No eligible recurring plans share this tier group and currency." })
143
- }),
144
- (U.isError || W.isError) && /* @__PURE__ */ I("p", {
145
- className: "text-xs text-destructive",
146
- role: "alert",
147
- children: /* @__PURE__ */ I(n, { id: "Could not load the available plans." })
148
- })
149
- ]
150
- }),
151
- J && /* @__PURE__ */ L("div", {
152
- className: "grid gap-1.5",
153
- children: [
154
- /* @__PURE__ */ I(D, {
155
- htmlFor: O("subscription-seats"),
156
- children: /* @__PURE__ */ I(n, { id: "Seats" })
157
- }),
158
- /* @__PURE__ */ I(c, {
159
- id: O("subscription-seats"),
160
- type: "number",
161
- inputMode: "numeric",
162
- min: J.min,
163
- max: J.max,
164
- value: pe,
165
- onChange: (e) => Oe(e.target.value)
166
- }),
167
- /* @__PURE__ */ L("p", {
168
- className: "text-xs text-muted-foreground",
169
- children: [
170
- J.min,
171
- /* @__PURE__ */ I(n, { id: " to " }),
172
- J.max,
173
- /* @__PURE__ */ I(n, { id: " seats." })
174
- ]
175
- })
176
- ]
177
- }),
178
- /* @__PURE__ */ L("div", {
179
- className: "grid gap-1.5",
180
- children: [
181
- /* @__PURE__ */ I(D, {
182
- htmlFor: O("subscription-change-reason"),
183
- children: /* @__PURE__ */ I(n, { id: "Reason" })
184
- }),
185
- /* @__PURE__ */ I(c, {
186
- id: O("subscription-change-reason"),
187
- value: j,
188
- maxLength: 500,
189
- placeholder: ce("What the customer asked for"),
190
- onChange: (e) => me(e.target.value)
191
- }),
192
- /* @__PURE__ */ I("p", {
193
- className: "text-xs text-muted-foreground",
194
- children: /* @__PURE__ */ I(n, { id: "Kept with the scheduled change." })
195
- })
196
- ]
197
- }),
198
- Q && q && /* @__PURE__ */ L("div", {
199
- className: "grid gap-3",
200
- "aria-live": "polite",
201
- children: [
202
- /* @__PURE__ */ L("div", {
203
- className: "flex items-center justify-between gap-4",
204
- children: [/* @__PURE__ */ I("span", {
205
- className: "text-sm font-medium",
206
- children: /* @__PURE__ */ I(n, { id: "Review" })
207
- }), /* @__PURE__ */ I(T, {
208
- variant: "secondary",
209
- children: Q.effective === "now" ? "Immediate" : "At renewal"
210
- })]
211
- }),
212
- /* @__PURE__ */ L("dl", {
213
- className: "grid grid-cols-2 gap-x-8 gap-y-3 border-y py-4 text-sm",
214
- children: [
215
- Q.quantity !== null && /* @__PURE__ */ L("div", {
216
- className: "grid gap-1",
217
- children: [/* @__PURE__ */ I("dt", {
218
- className: "text-xs text-muted-foreground",
219
- children: /* @__PURE__ */ I(n, { id: "Seats" })
220
- }), /* @__PURE__ */ I("dd", {
221
- className: "font-medium tabular-nums",
222
- children: Q.quantity
223
- })]
224
- }),
225
- /* @__PURE__ */ L("div", {
226
- className: "grid gap-1",
227
- children: [/* @__PURE__ */ I("dt", {
228
- className: "text-xs text-muted-foreground",
229
- children: /* @__PURE__ */ I(n, { id: "Due now" })
230
- }), /* @__PURE__ */ I("dd", {
231
- className: "font-medium tabular-nums",
232
- children: f(Q.amount_due_now, Q.currency)
233
- })]
234
- }),
235
- /* @__PURE__ */ L("div", {
236
- className: "grid gap-1",
237
- children: [/* @__PURE__ */ I("dt", {
238
- className: "text-xs text-muted-foreground",
239
- children: /* @__PURE__ */ I(n, { id: "Next charge" })
240
- }), /* @__PURE__ */ I("dd", {
241
- className: "font-medium tabular-nums",
242
- children: f(Q.next_charge_amount, Q.currency)
243
- })]
244
- }),
245
- /* @__PURE__ */ L("div", {
246
- className: "grid gap-1",
247
- children: [/* @__PURE__ */ I("dt", {
248
- className: "text-xs text-muted-foreground",
249
- children: /* @__PURE__ */ I(n, { id: "Effective" })
250
- }), /* @__PURE__ */ I("dd", {
251
- className: "font-medium",
252
- children: Q.effective === "now" ? "Immediately" : d(Q.next_charge_date)
253
- })]
254
- }),
255
- /* @__PURE__ */ L("div", {
256
- className: "grid gap-1",
257
- children: [/* @__PURE__ */ I("dt", {
258
- className: "text-xs text-muted-foreground",
259
- children: /* @__PURE__ */ I(n, { id: "Next billing date" })
260
- }), /* @__PURE__ */ I("dd", {
261
- className: "font-medium tabular-nums",
262
- children: d(Q.next_charge_date)
263
- })]
264
- })
265
- ]
266
- }),
267
- Q.is_estimate && /* @__PURE__ */ I("p", {
268
- className: "text-xs text-muted-foreground",
269
- children: /* @__PURE__ */ I(n, { id: "The payment provider calculates the final prorated amount." })
270
- })
271
- ]
272
- }),
273
- (ke || Ae) && /* @__PURE__ */ I("p", {
274
- className: "text-sm text-destructive",
275
- role: "alert",
276
- children: Ae || ke
277
- }),
278
- H.data && H.data.status !== "succeeded" && /* @__PURE__ */ L("div", {
279
- className: "grid gap-2 rounded-lg bg-muted px-3 py-2.5 text-sm",
280
- "aria-live": "polite",
281
- children: [/* @__PURE__ */ I("p", { children: je ?? "This change needs another step." }), Me && /* @__PURE__ */ I("a", {
282
- href: Me,
283
- target: "_blank",
284
- rel: "noreferrer",
285
- className: "w-fit font-medium text-primary underline underline-offset-4",
286
- children: /* @__PURE__ */ I(n, { id: "Continue with payment provider" })
287
- })]
288
- })
289
- ]
290
- }),
291
- /* @__PURE__ */ L(ne, { children: [/* @__PURE__ */ I(s, {
292
- type: "button",
293
- variant: "outline",
294
- onClick: () => $(!1),
295
- children: /* @__PURE__ */ I(n, { id: "Cancel" })
296
- }), Q ? /* @__PURE__ */ I(s, {
297
- type: "button",
298
- disabled: H.isPending || !j.trim() || !!H.data && H.data?.status !== "processing",
299
- onClick: async () => {
300
- if (!X) return;
301
- let t = B.current, n = z.current.get(Z) ?? crypto.randomUUID();
302
- z.current.set(Z, n);
303
- let r = () => {
304
- z.current.get(Z) === n && z.current.delete(Z);
305
- };
306
- try {
307
- let e = await H.mutateAsync({
308
- change: {
309
- ...X,
310
- reason: j.trim()
311
- },
312
- idempotencyKey: n
313
- });
314
- if ((e.status === "succeeded" || e.status === "blocked") && r(), B.current !== t) return;
315
- e.status === "succeeded" && (S.success(e.effective === "now" ? "Subscription changed" : "Change scheduled for the next renewal"), $(!1), fe(""), A(""), me(""), R(""), V.reset(), H.reset()), e.status === "processing" && S.info("The provider is still confirming this change. Check again to read the result.");
316
- } catch (n) {
317
- n instanceof e && (n.status === 402 || n.status === 409 && (n.code === "subscription_change_refused" || n.code === "subscription_change_idempotency_conflict")) && r(), B.current === t && C(n, "Change subscription");
318
- }
319
- },
320
- children: H.isPending ? "Applying…" : H.data ? H.data.status === "processing" ? "Check result" : H.data.status === "blocked" ? "Change blocked" : "Action required" : "Confirm change"
321
- }) : /* @__PURE__ */ I(s, {
322
- type: "button",
323
- disabled: !X || Te || V.isPending,
324
- onClick: async () => {
325
- if (!X) return;
326
- let e = B.current;
327
- try {
328
- if (await V.mutateAsync(X), B.current !== e) return;
329
- R(Z);
330
- } catch (t) {
331
- B.current === e && C(t, "Preview subscription change");
332
- }
333
- },
334
- children: V.isPending ? "Reviewing…" : "Review change"
335
- })] })
336
- ]
337
- })]
338
- });
339
- }
340
- //#endregion
341
- //#region src/admin/pages/subscriptions/detail.tsx
342
- function H() {
343
- let { text: e } = t(), { adminQueries: c } = i(), u = l(), { id: m = "" } = r(), h = o(), { data: g, isPending: _ } = P(c.subscription(m)), { data: v } = P(c.payments({ subscription_id: m }, 20)), y = v?.data ?? [];
344
- if (_) return /* @__PURE__ */ I("p", {
345
- className: "text-sm text-muted-foreground",
346
- children: /* @__PURE__ */ I(n, { id: "Loading…" })
347
- });
348
- if (!g) return /* @__PURE__ */ I("p", {
349
- className: "text-sm text-muted-foreground",
350
- children: /* @__PURE__ */ I(n, { id: "Subscription not found." })
351
- });
352
- let te = g.status === "active" || g.status === "past_due" || g.status === "awaiting_method" || g.status === "unverified", ne = g.status === "canceled" || g.status === "past_due";
353
- return /* @__PURE__ */ L("div", {
354
- className: "flex flex-col gap-4",
355
- children: [
356
- /* @__PURE__ */ L("div", {
357
- className: "flex items-center gap-3",
358
- children: [
359
- /* @__PURE__ */ I(s, {
360
- variant: "ghost",
361
- size: "icon",
362
- onClick: () => h(-1),
363
- "aria-label": e("Back"),
364
- children: /* @__PURE__ */ I(R, {
365
- icon: z,
366
- className: "size-4"
367
- })
368
- }),
369
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ L("h2", {
370
- className: "flex items-center gap-2 text-sm",
371
- children: [
372
- g.id,
373
- " ",
374
- /* @__PURE__ */ I(E, { status: g.status })
375
- ]
376
- }), /* @__PURE__ */ L("p", {
377
- className: "text-xs text-muted-foreground",
378
- children: [
379
- g.rail,
380
- " · ",
381
- g.rail_subscription_id || "no rail id"
382
- ]
383
- })] }),
384
- /* @__PURE__ */ L("div", {
385
- className: "ml-auto flex gap-2",
386
- children: [
387
- u && ne && /* @__PURE__ */ I(W, {
388
- id: g.id,
389
- customerId: g.customer_id
390
- }),
391
- u && /* @__PURE__ */ I(be, {
392
- subscriptionId: g.id,
393
- customerId: g.customer_id,
394
- productId: g.product_id,
395
- priceId: g.price_id,
396
- quantity: g.quantity,
397
- currency: g.price?.currency,
398
- collectionPolicy: g.collection_policy,
399
- scheduledChange: g.scheduled_change,
400
- rail: g.rail,
401
- status: g.status
402
- }),
403
- u && /* @__PURE__ */ I(xe, {
404
- subscriptionId: g.id,
405
- customerId: g.customer_id,
406
- rail: g.rail,
407
- collectionPolicy: g.collection_policy
408
- }),
409
- u && te && /* @__PURE__ */ I(U, {
410
- id: g.id,
411
- customerId: g.customer_id
412
- })
413
- ]
414
- })
415
- ]
416
- }),
417
- /* @__PURE__ */ L("div", {
418
- className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
419
- children: [
420
- /* @__PURE__ */ I(A, {
421
- label: e("Customer"),
422
- children: g.customer_id ? /* @__PURE__ */ I(a, {
423
- className: "text-xs underline-offset-2 hover:underline",
424
- to: `/customers/${g.customer_id}`,
425
- children: p(g.customer_id, 13)
426
- }) : "—"
427
- }),
428
- /* @__PURE__ */ I(A, {
429
- label: e("Started"),
430
- children: d(g.started_at)
431
- }),
432
- /* @__PURE__ */ L(A, {
433
- label: e("Current period"),
434
- children: [
435
- d(g.current_period_starts_at),
436
- " →",
437
- " ",
438
- d(g.current_period_ends_at)
439
- ]
440
- }),
441
- /* @__PURE__ */ I(A, {
442
- label: e("Price"),
443
- children: /* @__PURE__ */ L("div", {
444
- className: "flex flex-col gap-1",
445
- children: [
446
- /* @__PURE__ */ L("span", {
447
- className: "flex items-center gap-2",
448
- children: [g.price?.unit_amount !== void 0 && g.price?.currency ? /* @__PURE__ */ I(a, {
449
- className: "underline-offset-2 hover:underline",
450
- to: `/catalog/prices/${encodeURIComponent(g.price_id)}`,
451
- children: f(g.price.unit_amount, g.price.currency)
452
- }) : /* @__PURE__ */ I(a, {
453
- className: "text-xs underline-offset-2 hover:underline",
454
- to: `/catalog/prices/${encodeURIComponent(g.price_id)}`,
455
- children: p(g.price_id ?? "—", 13)
456
- }), g.price?.archived && /* @__PURE__ */ I(T, {
457
- variant: "secondary",
458
- title: e("Pinned to an archived (prior) version"),
459
- children: /* @__PURE__ */ I(n, { id: "prior version" })
460
- })]
461
- }),
462
- g.price?.key && /* @__PURE__ */ I("span", {
463
- className: "text-xs text-muted-foreground",
464
- children: g.price.key
465
- }),
466
- g.scheduled_change && /* @__PURE__ */ I(Se, { change: g.scheduled_change })
467
- ]
468
- })
469
- }),
470
- g.quantity !== null && /* @__PURE__ */ L(A, {
471
- label: e("Seats"),
472
- children: [g.quantity, g.scheduled_change?.quantity != null && ` → ${g.scheduled_change.quantity} at renewal`]
473
- }),
474
- /* @__PURE__ */ I(A, {
475
- label: e("Dunning"),
476
- children: g.dunning ? j(g.dunning) : "—"
477
- }),
478
- /* @__PURE__ */ I(A, {
479
- label: g.dunning?.waiting_for_new_card ? "Card deadline" : "Final retry",
480
- children: d(g.dunning?.final_retry_at)
481
- }),
482
- /* @__PURE__ */ I(A, {
483
- label: e("Last decline"),
484
- children: g.dunning?.last_failure_reason ?? "—"
485
- }),
486
- /* @__PURE__ */ I(A, {
487
- label: e("Canceled"),
488
- children: g.canceled_at ? `${d(g.canceled_at)} (${g.cancel_type ?? "?"})` : "—"
489
- })
490
- ]
491
- }),
492
- /* @__PURE__ */ L(pe, { children: [/* @__PURE__ */ I(ue, { children: /* @__PURE__ */ I(de, {
493
- className: "text-sm",
494
- children: /* @__PURE__ */ I(n, { id: "Payments" })
495
- }) }), /* @__PURE__ */ I(fe, { children: y.length ? /* @__PURE__ */ L(w, { children: [/* @__PURE__ */ I(ee, { children: /* @__PURE__ */ L(C, {
496
- className: "hover:bg-transparent",
497
- children: [
498
- /* @__PURE__ */ I(b, {
499
- className: "text-muted-foreground",
500
- children: /* @__PURE__ */ I(n, { id: "Payment" })
501
- }),
502
- /* @__PURE__ */ I(b, {
503
- className: "text-muted-foreground",
504
- children: /* @__PURE__ */ I(n, { id: "Status" })
505
- }),
506
- /* @__PURE__ */ I(b, {
507
- className: "text-muted-foreground",
508
- children: /* @__PURE__ */ I(n, { id: "Kind" })
509
- }),
510
- /* @__PURE__ */ I(b, {
511
- className: "text-muted-foreground",
512
- children: /* @__PURE__ */ I(n, { id: "Amount" })
513
- }),
514
- /* @__PURE__ */ I(b, {
515
- className: "text-muted-foreground",
516
- children: /* @__PURE__ */ I(n, { id: "Created" })
517
- })
518
- ]
519
- }) }), /* @__PURE__ */ I(x, { children: y.map((e) => /* @__PURE__ */ L(C, { children: [
520
- /* @__PURE__ */ I(S, { children: /* @__PURE__ */ I(a, {
521
- className: "text-xs underline-offset-2 hover:underline",
522
- to: `/payments/${e.id}`,
523
- children: p(e.id, 13)
524
- }) }),
525
- /* @__PURE__ */ I(S, { children: /* @__PURE__ */ I(E, { status: e.status }) }),
526
- /* @__PURE__ */ I(S, { children: e.kind }),
527
- /* @__PURE__ */ I(S, { children: f(e.amount, e.currency) }),
528
- /* @__PURE__ */ I(S, { children: d(e.created_at) })
529
- ] }, e.id)) })] }) : /* @__PURE__ */ I("p", {
530
- className: "text-sm text-muted-foreground",
531
- children: /* @__PURE__ */ I(n, { id: "No payments recorded." })
532
- }) })] })
533
- ]
534
- });
535
- }
536
- function U({ id: e, customerId: r }) {
537
- let { toast: a, toastApiError: o, adminMutations: l } = i(), { text: u, id: d } = t(), [f, p] = M.useState(!1), m = F(), h = N(l.cancelSubscription(m, e, r)), g = B({ defaultValues: {
538
- reason: "",
539
- revokeAccess: !1
540
- } });
541
- return /* @__PURE__ */ L(he, { children: [/* @__PURE__ */ I(s, {
542
- variant: "destructive",
543
- size: "sm",
544
- onClick: () => p(!0),
545
- children: /* @__PURE__ */ I(n, { id: "Cancel subscription" })
546
- }), /* @__PURE__ */ I(me, {
547
- open: f,
548
- onOpenChange: (e) => {
549
- p(e), e || (g.reset(), h.reset());
550
- },
551
- title: u("Cancel subscription"),
552
- description: u("Terminal cancellation at the payment rail. This is a last resort. Dunning parks subscriptions as past_due without losing entitlements."),
553
- confirmationWord: "CANCEL",
554
- actionLabel: "Cancel subscription",
555
- onConfirm: async () => {
556
- try {
557
- await h.mutateAsync(g.state.values), a.success("Subscription canceled");
558
- } catch (e) {
559
- throw o(e, "Cancel subscription"), e;
560
- }
561
- },
562
- children: /* @__PURE__ */ L("div", {
563
- className: "grid gap-3",
564
- children: [/* @__PURE__ */ I(g.Field, {
565
- name: "reason",
566
- children: (e) => /* @__PURE__ */ L("div", {
567
- className: "grid gap-1.5",
568
- children: [/* @__PURE__ */ I(D, {
569
- htmlFor: d("cancel-reason"),
570
- children: /* @__PURE__ */ I(n, { id: "Reason" })
571
- }), /* @__PURE__ */ I(c, {
572
- id: d("cancel-reason"),
573
- value: e.state.value,
574
- onBlur: e.handleBlur,
575
- onChange: (t) => e.handleChange(t.target.value),
576
- placeholder: u("why is this being canceled?")
577
- })]
578
- })
579
- }), /* @__PURE__ */ I(g.Field, {
580
- name: "revokeAccess",
581
- children: (e) => /* @__PURE__ */ L("div", {
582
- className: "flex items-center gap-2",
583
- children: [/* @__PURE__ */ I(O, {
584
- id: d("cancel-revoke"),
585
- checked: e.state.value,
586
- onCheckedChange: e.handleChange
587
- }), /* @__PURE__ */ I(D, {
588
- htmlFor: d("cancel-revoke"),
589
- children: /* @__PURE__ */ I(n, { id: "Also revoke access immediately" })
590
- })]
591
- })
592
- })]
593
- })
594
- })] });
595
- }
596
- function W({ id: e, customerId: t }) {
597
- let { toast: n, toastApiError: r, adminMutations: a } = i(), o = F(), c = N(a.resumeSubscription(o, e, t));
598
- return /* @__PURE__ */ I(s, {
599
- variant: "outline",
600
- size: "sm",
601
- disabled: c.isPending,
602
- onClick: async () => {
603
- try {
604
- await c.mutateAsync(), n.success("Resume queued");
605
- } catch (e) {
606
- r(e, "Resume subscription");
607
- }
608
- },
609
- children: c.isPending ? "Queuing…" : "Resume"
610
- });
611
- }
612
- var G = "default";
613
- function xe({ subscriptionId: e, customerId: r, rail: a, collectionPolicy: o }) {
614
- let { toast: c, toastApiError: l, adminMutations: d, adminQueries: f } = i(), { id: p, text: b } = t(), [x, ee] = M.useState(!1), S = F(), C = N(d.changeSubscriptionPaymentMethod(S, e, r)), { data: w } = P(f.customerPaymentMethods(x ? r : void 0)), T = B({
615
- defaultValues: { paymentMethodId: "" },
616
- onSubmit: async ({ value: e }) => {
617
- try {
618
- await C.mutateAsync(e.paymentMethodId === G ? null : e.paymentMethodId), c.success("Payment method updated"), E(!1);
619
- } catch (e) {
620
- l(e, "Change payment method");
621
- }
622
- }
623
- }), E = (e) => {
624
- ee(e), e || (T.reset(), C.reset());
625
- }, O = a !== "solana" && (o === "engine" || o === "nmi_schedule");
626
- return /* @__PURE__ */ L(se, {
627
- open: x,
628
- onOpenChange: E,
629
- children: [/* @__PURE__ */ I(oe, { render: /* @__PURE__ */ I(s, {
630
- variant: "outline",
631
- size: "sm",
632
- disabled: !O,
633
- title: O ? void 0 : `Payment-method change is not supported on ${a}`,
634
- children: /* @__PURE__ */ I(n, { id: "Change payment method" })
635
- }) }), /* @__PURE__ */ L(re, {
636
- className: ce,
637
- children: [/* @__PURE__ */ L(te, { children: [/* @__PURE__ */ I(ie, { children: /* @__PURE__ */ I(n, { id: "Change payment method" }) }), /* @__PURE__ */ I(ae, { children: /* @__PURE__ */ I(n, { id: "Points future renewals of this subscription at another of the customer&apos;s stored cards (same rail), or back at their default card for its currency." }) })] }), /* @__PURE__ */ L("form", {
638
- onSubmit: (e) => {
639
- e.preventDefault(), e.stopPropagation(), T.handleSubmit();
640
- },
641
- className: "grid gap-4",
642
- children: [/* @__PURE__ */ I(T.Field, {
643
- name: "paymentMethodId",
644
- validators: { onChange: ({ value: e }) => e ? void 0 : "Pick a stored payment method" },
645
- children: (e) => /* @__PURE__ */ L("div", {
646
- className: "grid gap-1.5",
647
- children: [
648
- /* @__PURE__ */ I(D, {
649
- htmlFor: p("subscription-payment-method"),
650
- children: /* @__PURE__ */ I(n, { id: "Payment method" })
651
- }),
652
- /* @__PURE__ */ L(y, {
653
- value: e.state.value,
654
- onValueChange: (t) => e.handleChange(t ?? ""),
655
- children: [/* @__PURE__ */ I(g, {
656
- className: "w-full",
657
- id: p("subscription-payment-method"),
658
- "aria-invalid": e.state.meta.errors.length > 0,
659
- children: /* @__PURE__ */ I(h, { placeholder: b("Pick a stored payment method") })
660
- }), /* @__PURE__ */ L(_, { children: [/* @__PURE__ */ I(v, {
661
- value: G,
662
- children: /* @__PURE__ */ I(n, { id: "The customer&apos;s default card" })
663
- }), (w ?? []).filter((e) => e.rail === a).map((e) => /* @__PURE__ */ L(v, {
664
- value: e.id,
665
- children: [
666
- u(e.card),
667
- " (",
668
- e.rail,
669
- ")"
670
- ]
671
- }, e.id))] })]
672
- }),
673
- /* @__PURE__ */ I(m, { errors: e.state.meta.errors })
674
- ]
675
- })
676
- }), /* @__PURE__ */ I(ne, { children: /* @__PURE__ */ I(T.Subscribe, {
677
- selector: (e) => [
678
- e.values.paymentMethodId,
679
- e.canSubmit,
680
- e.isSubmitting
681
- ],
682
- children: ([e, t, n]) => /* @__PURE__ */ I(s, {
683
- type: "submit",
684
- disabled: !e || !t || n,
685
- children: n ? "Updating…" : "Update"
686
- })
687
- }) })]
688
- })]
689
- })]
690
- });
691
- }
692
- function Se({ change: e }) {
693
- let { adminQueries: t } = i(), { data: r } = P(t.price(e.price_id));
694
- return /* @__PURE__ */ L(T, {
695
- className: "bg-held-surface text-held",
696
- children: [
697
- e.source === "migration" ? "migrates" : "changes",
698
- /* @__PURE__ */ I(n, { id: " to" }),
699
- " ",
700
- r ? f(r.unit_amount, r.currency) : p(e.price_id, 9),
701
- " ",
702
- /* @__PURE__ */ I(n, { id: "at the first renewal from " }),
703
- d(e.effective_at)
704
- ]
705
- });
706
- }
707
- //#endregion
708
- export { H as SubscriptionDetailPage };
709
-
710
- //# sourceMappingURL=admin-detail-pPC8Q9l-.js.map