@wix/himalaya-cli 0.1900.0 → 0.1902.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 (203) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +4 -0
  2. package/dist/cli.mjs +5 -2
  3. package/guides/ads.md +3 -2
  4. package/package.json +2 -2
  5. package/templates/beauty-salon/dev/index.ts +2 -1
  6. package/templates/beauty-salon/l10n/ar.json +5 -0
  7. package/templates/beauty-salon/l10n/cs.json +5 -0
  8. package/templates/beauty-salon/l10n/da.json +5 -0
  9. package/templates/beauty-salon/l10n/de.json +5 -0
  10. package/templates/beauty-salon/l10n/el.json +5 -0
  11. package/templates/beauty-salon/l10n/es.json +5 -0
  12. package/templates/beauty-salon/l10n/fi.json +5 -0
  13. package/templates/beauty-salon/l10n/fr.json +5 -0
  14. package/templates/beauty-salon/l10n/he.json +4 -0
  15. package/templates/beauty-salon/l10n/hu.json +5 -0
  16. package/templates/beauty-salon/l10n/id.json +5 -0
  17. package/templates/beauty-salon/l10n/it.json +5 -0
  18. package/templates/beauty-salon/l10n/ja.json +5 -0
  19. package/templates/beauty-salon/l10n/ko.json +5 -0
  20. package/templates/beauty-salon/l10n/lt.json +5 -0
  21. package/templates/beauty-salon/l10n/nl.json +5 -0
  22. package/templates/beauty-salon/l10n/no.json +5 -0
  23. package/templates/beauty-salon/l10n/pl.json +5 -0
  24. package/templates/beauty-salon/l10n/pt.json +5 -0
  25. package/templates/beauty-salon/l10n/ru.json +5 -0
  26. package/templates/beauty-salon/l10n/sv.json +5 -0
  27. package/templates/beauty-salon/l10n/th.json +5 -0
  28. package/templates/beauty-salon/l10n/tr.json +5 -0
  29. package/templates/beauty-salon/l10n/uk.json +5 -0
  30. package/templates/beauty-salon/l10n/vi.json +5 -0
  31. package/templates/beauty-salon/l10n/zh.json +5 -0
  32. package/templates/beauty-salon/tier5-src/_shared/pricing-plan-display.ts +39 -0
  33. package/templates/beauty-salon/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  34. package/templates/beauty-salon/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
  35. package/templates/branded-lite/dev/index.ts +2 -1
  36. package/templates/branded-lite/l10n/ar.json +5 -0
  37. package/templates/branded-lite/l10n/cs.json +5 -0
  38. package/templates/branded-lite/l10n/da.json +5 -0
  39. package/templates/branded-lite/l10n/de.json +5 -0
  40. package/templates/branded-lite/l10n/el.json +5 -0
  41. package/templates/branded-lite/l10n/es.json +5 -0
  42. package/templates/branded-lite/l10n/fi.json +5 -0
  43. package/templates/branded-lite/l10n/fr.json +5 -0
  44. package/templates/branded-lite/l10n/he.json +4 -0
  45. package/templates/branded-lite/l10n/hu.json +5 -0
  46. package/templates/branded-lite/l10n/id.json +5 -0
  47. package/templates/branded-lite/l10n/it.json +5 -0
  48. package/templates/branded-lite/l10n/ja.json +5 -0
  49. package/templates/branded-lite/l10n/ko.json +5 -0
  50. package/templates/branded-lite/l10n/lt.json +5 -0
  51. package/templates/branded-lite/l10n/nl.json +5 -0
  52. package/templates/branded-lite/l10n/no.json +5 -0
  53. package/templates/branded-lite/l10n/pl.json +5 -0
  54. package/templates/branded-lite/l10n/pt.json +5 -0
  55. package/templates/branded-lite/l10n/ru.json +5 -0
  56. package/templates/branded-lite/l10n/sv.json +5 -0
  57. package/templates/branded-lite/l10n/th.json +5 -0
  58. package/templates/branded-lite/l10n/tr.json +5 -0
  59. package/templates/branded-lite/l10n/uk.json +5 -0
  60. package/templates/branded-lite/l10n/vi.json +5 -0
  61. package/templates/branded-lite/l10n/zh.json +5 -0
  62. package/templates/branded-lite/recipes/events-inline.json +2 -2
  63. package/templates/branded-lite/recipes/subscriptions-list.json +2 -1
  64. package/templates/branded-lite/tier5-src/_shared/my-subscriptions-section.ts +6 -8
  65. package/templates/branded-lite/tier5-src/_shared/pricing-plan-display.ts +39 -0
  66. package/templates/branded-lite/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  67. package/templates/branded-lite/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
  68. package/templates/brandy/dev/member-screens.ts +4 -2
  69. package/templates/brandy/tier5-src/_shared/pricing-plan-display.ts +39 -0
  70. package/templates/brandy/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  71. package/templates/brandy/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
  72. package/templates/fitness-gym/dev/index.ts +2 -1
  73. package/templates/fitness-gym/tier5-src/_shared/pricing-plan-display.ts +39 -0
  74. package/templates/fitness-gym/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  75. package/templates/fitness-gym/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
  76. package/templates/gym-fitness/dev/index.ts +2 -1
  77. package/templates/gym-fitness/l10n/ar.json +5 -0
  78. package/templates/gym-fitness/l10n/cs.json +5 -0
  79. package/templates/gym-fitness/l10n/da.json +5 -0
  80. package/templates/gym-fitness/l10n/de.json +5 -0
  81. package/templates/gym-fitness/l10n/el.json +5 -0
  82. package/templates/gym-fitness/l10n/es.json +5 -0
  83. package/templates/gym-fitness/l10n/fi.json +5 -0
  84. package/templates/gym-fitness/l10n/fr.json +5 -0
  85. package/templates/gym-fitness/l10n/he.json +4 -0
  86. package/templates/gym-fitness/l10n/hu.json +5 -0
  87. package/templates/gym-fitness/l10n/id.json +5 -0
  88. package/templates/gym-fitness/l10n/it.json +5 -0
  89. package/templates/gym-fitness/l10n/ja.json +5 -0
  90. package/templates/gym-fitness/l10n/ko.json +5 -0
  91. package/templates/gym-fitness/l10n/lt.json +5 -0
  92. package/templates/gym-fitness/l10n/nl.json +5 -0
  93. package/templates/gym-fitness/l10n/no.json +5 -0
  94. package/templates/gym-fitness/l10n/pl.json +5 -0
  95. package/templates/gym-fitness/l10n/pt.json +5 -0
  96. package/templates/gym-fitness/l10n/ru.json +5 -0
  97. package/templates/gym-fitness/l10n/sv.json +5 -0
  98. package/templates/gym-fitness/l10n/th.json +5 -0
  99. package/templates/gym-fitness/l10n/tr.json +5 -0
  100. package/templates/gym-fitness/l10n/uk.json +5 -0
  101. package/templates/gym-fitness/l10n/vi.json +5 -0
  102. package/templates/gym-fitness/l10n/zh.json +5 -0
  103. package/templates/gym-fitness/tier5-src/_shared/pricing-plan-display.ts +39 -0
  104. package/templates/gym-fitness/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  105. package/templates/gym-fitness/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
  106. package/templates/nonprofit-cause/dev/index.ts +2 -1
  107. package/templates/nonprofit-cause/l10n/ar.json +5 -0
  108. package/templates/nonprofit-cause/l10n/cs.json +5 -0
  109. package/templates/nonprofit-cause/l10n/da.json +5 -0
  110. package/templates/nonprofit-cause/l10n/de.json +5 -0
  111. package/templates/nonprofit-cause/l10n/el.json +5 -0
  112. package/templates/nonprofit-cause/l10n/es.json +5 -0
  113. package/templates/nonprofit-cause/l10n/fi.json +5 -0
  114. package/templates/nonprofit-cause/l10n/fr.json +5 -0
  115. package/templates/nonprofit-cause/l10n/he.json +4 -0
  116. package/templates/nonprofit-cause/l10n/hu.json +5 -0
  117. package/templates/nonprofit-cause/l10n/id.json +5 -0
  118. package/templates/nonprofit-cause/l10n/it.json +5 -0
  119. package/templates/nonprofit-cause/l10n/ja.json +5 -0
  120. package/templates/nonprofit-cause/l10n/ko.json +5 -0
  121. package/templates/nonprofit-cause/l10n/lt.json +5 -0
  122. package/templates/nonprofit-cause/l10n/nl.json +5 -0
  123. package/templates/nonprofit-cause/l10n/no.json +5 -0
  124. package/templates/nonprofit-cause/l10n/pl.json +5 -0
  125. package/templates/nonprofit-cause/l10n/pt.json +5 -0
  126. package/templates/nonprofit-cause/l10n/ru.json +5 -0
  127. package/templates/nonprofit-cause/l10n/sv.json +5 -0
  128. package/templates/nonprofit-cause/l10n/th.json +5 -0
  129. package/templates/nonprofit-cause/l10n/tr.json +5 -0
  130. package/templates/nonprofit-cause/l10n/uk.json +5 -0
  131. package/templates/nonprofit-cause/l10n/vi.json +5 -0
  132. package/templates/nonprofit-cause/l10n/zh.json +5 -0
  133. package/templates/nonprofit-cause/tier5-src/_shared/pricing-plan-display.ts +39 -0
  134. package/templates/nonprofit-cause/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  135. package/templates/nonprofit-cause/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
  136. package/templates/personal-fitness-trainer/dev/index.ts +2 -1
  137. package/templates/personal-fitness-trainer/tier5-src/_shared/pricing-plan-display.ts +39 -0
  138. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  139. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
  140. package/templates/podcast-creator/dev/index.ts +2 -1
  141. package/templates/podcast-creator/l10n/ar.json +5 -0
  142. package/templates/podcast-creator/l10n/cs.json +5 -0
  143. package/templates/podcast-creator/l10n/da.json +5 -0
  144. package/templates/podcast-creator/l10n/de.json +5 -0
  145. package/templates/podcast-creator/l10n/el.json +5 -0
  146. package/templates/podcast-creator/l10n/es.json +5 -0
  147. package/templates/podcast-creator/l10n/fi.json +5 -0
  148. package/templates/podcast-creator/l10n/fr.json +5 -0
  149. package/templates/podcast-creator/l10n/he.json +4 -0
  150. package/templates/podcast-creator/l10n/hu.json +5 -0
  151. package/templates/podcast-creator/l10n/id.json +5 -0
  152. package/templates/podcast-creator/l10n/it.json +5 -0
  153. package/templates/podcast-creator/l10n/ja.json +5 -0
  154. package/templates/podcast-creator/l10n/ko.json +5 -0
  155. package/templates/podcast-creator/l10n/lt.json +5 -0
  156. package/templates/podcast-creator/l10n/nl.json +5 -0
  157. package/templates/podcast-creator/l10n/no.json +5 -0
  158. package/templates/podcast-creator/l10n/pl.json +5 -0
  159. package/templates/podcast-creator/l10n/pt.json +5 -0
  160. package/templates/podcast-creator/l10n/ru.json +5 -0
  161. package/templates/podcast-creator/l10n/sv.json +5 -0
  162. package/templates/podcast-creator/l10n/th.json +5 -0
  163. package/templates/podcast-creator/l10n/tr.json +5 -0
  164. package/templates/podcast-creator/l10n/uk.json +5 -0
  165. package/templates/podcast-creator/l10n/vi.json +5 -0
  166. package/templates/podcast-creator/l10n/zh.json +5 -0
  167. package/templates/podcast-creator/tier5-src/_shared/pricing-plan-display.ts +39 -0
  168. package/templates/podcast-creator/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  169. package/templates/podcast-creator/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
  170. package/templates/professional-services/dev/index.ts +2 -1
  171. package/templates/professional-services/tier5-src/_shared/pricing-plan-display.ts +39 -0
  172. package/templates/professional-services/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  173. package/templates/professional-services/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
  174. package/templates/yoga-studio/dev/index.ts +2 -1
  175. package/templates/yoga-studio/l10n/ar.json +5 -0
  176. package/templates/yoga-studio/l10n/cs.json +5 -0
  177. package/templates/yoga-studio/l10n/da.json +5 -0
  178. package/templates/yoga-studio/l10n/de.json +5 -0
  179. package/templates/yoga-studio/l10n/el.json +5 -0
  180. package/templates/yoga-studio/l10n/es.json +5 -0
  181. package/templates/yoga-studio/l10n/fi.json +5 -0
  182. package/templates/yoga-studio/l10n/fr.json +5 -0
  183. package/templates/yoga-studio/l10n/he.json +4 -0
  184. package/templates/yoga-studio/l10n/hu.json +5 -0
  185. package/templates/yoga-studio/l10n/id.json +5 -0
  186. package/templates/yoga-studio/l10n/it.json +5 -0
  187. package/templates/yoga-studio/l10n/ja.json +5 -0
  188. package/templates/yoga-studio/l10n/ko.json +5 -0
  189. package/templates/yoga-studio/l10n/lt.json +5 -0
  190. package/templates/yoga-studio/l10n/nl.json +5 -0
  191. package/templates/yoga-studio/l10n/no.json +5 -0
  192. package/templates/yoga-studio/l10n/pl.json +5 -0
  193. package/templates/yoga-studio/l10n/pt.json +5 -0
  194. package/templates/yoga-studio/l10n/ru.json +5 -0
  195. package/templates/yoga-studio/l10n/sv.json +5 -0
  196. package/templates/yoga-studio/l10n/th.json +5 -0
  197. package/templates/yoga-studio/l10n/tr.json +5 -0
  198. package/templates/yoga-studio/l10n/uk.json +5 -0
  199. package/templates/yoga-studio/l10n/vi.json +5 -0
  200. package/templates/yoga-studio/l10n/zh.json +5 -0
  201. package/templates/yoga-studio/tier5-src/_shared/pricing-plan-display.ts +39 -0
  202. package/templates/yoga-studio/tier5-src/wix-spaces-my-subscriptions/index.ts +5 -5
  203. package/templates/yoga-studio/tier5-src/wix-spaces-subscription-detail/index.ts +3 -2
@@ -2,12 +2,12 @@ import { defineService } from "@himalaya/state";
2
2
  import { listMyPlanOrders, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
3
3
  import { hostSessionFromGlobal } from "@himalaya/iap";
4
4
  import { memberAccess, assertMemberAccess, memberAccessDenied, memberChanged } from "../_shared/member-access.js";
5
- import { orderDate, orderPrice, orderStatus } from "../_shared/pricing-plan-display.js";
5
+ import { orderPrice, orderStatus, orderValidity } from "../_shared/pricing-plan-display.js";
6
6
  import { descriptionBody } from "../_shared/rich-body.js";
7
7
  import { copyParam, stashCopy } from "../_shared/himi-copy.js";
8
8
  import { isHttp401 } from "../_shared/member-read.js";
9
9
 
10
- interface Row { id: string; name: string; subtitle: string; description: string; price: string; endDate: string; noEndDate: boolean; expired: boolean; dateLabel: string }
10
+ interface Row { id: string; name: string; subtitle: string; description: string; price: string; endDate: string; noEndDate: boolean; openEnded: boolean; expired: boolean; dateLabel: string }
11
11
  interface S {
12
12
  status: string; orders: Row[]; rows: Row[]; allOrders: Row[]; selectedTab: string; nextCursor: string;
13
13
  emptyText: string; hideAccountCta: boolean; noOrders: boolean;
@@ -32,10 +32,10 @@ function project(state: S): S {
32
32
  emptyText: orders.length ? "" : state.selectedTab === "expired" ? copyParam("mySubscriptions.expiredEmpty", "No expired subscriptions") : copyParam("mySubscriptions.activeEmpty", "No active subscriptions") };
33
33
  }
34
34
  function norm(order: WixPlanOrder): Row {
35
- const periodEnd = !order.earliestEndDate && !order.endDate && order.status === "ACTIVE" && (order.pricing?.subscription ?? order.priceDetails?.subscription) ? orderDate(order.currentCycle?.endedDate) : "";
36
- const endDate = orderDate(order.earliestEndDate ?? order.endDate) || periodEnd;
35
+ const validity = orderValidity(order);
37
36
  return { id: order.id, name: order.planName || copyParam("plans.planFallbackName", "Plan"), subtitle: orderStatus(order),
38
- description: descriptionBody(order.planDescription).bodyText, price: orderPrice(order), endDate, noEndDate: !endDate, dateLabel: periodEnd ? copyParam("subscriptionDetail.periodEnd", "Current period ends") : order.status === "CANCELED" ? copyParam("subscriptionDetail.endDate", "End date") : order.status === "ENDED" ? copyParam("mySubscriptions.expiredOn", "Expired on") : copyParam("mySubscriptions.validUntil", "Valid until"),
37
+ description: descriptionBody(order.planDescription).bodyText, price: orderPrice(order),
38
+ endDate: validity.date, noEndDate: validity.hidden, openEnded: validity.openEnded, dateLabel: validity.label,
39
39
  expired: ["ENDED", "CANCELED"].includes(order.status ?? "") };
40
40
  }
41
41
  async function readPage(state: S, reset: boolean): Promise<S | undefined> {
@@ -2,7 +2,7 @@ import { defineService } from "@himalaya/state";
2
2
  import { getMyPlanOrder, requestCancellation, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
3
3
  import { hostSessionFromGlobal } from "@himalaya/iap";
4
4
  import { memberAccess, assertMemberAccess, memberAccessDenied, memberChanged, type MemberAccess } from "../_shared/member-access.js";
5
- import { orderDate, orderPrice, orderStatus, orderFacts } from "../_shared/pricing-plan-display.js";
5
+ import { orderDate, orderPrice, orderStatus, orderFacts, orderOpenEnded } from "../_shared/pricing-plan-display.js";
6
6
  import { presence, presenceAfterError, detailInputId, type PresenceFlags } from "../_shared/detail-presence.js";
7
7
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
8
8
 
@@ -34,7 +34,8 @@ function project(o: WixPlanOrder, message = ""): S {
34
34
  const scheduled = Boolean((o.pricing?.subscription ?? o.priceDetails?.subscription) && o.currentCycle?.endedDate && Date.parse(o.currentCycle.endedDate) > Date.now());
35
35
  const renews = o.status === "ACTIVE" && scheduled ? orderDate(o.currentCycle?.endedDate) : "";
36
36
  return { ...initial(), ...presence("found"), status: "ready", notActive: o.status !== "ACTIVE", isActive: o.status === "ACTIVE", name: o.planName || copyParam("subscriptionDetail.fallbackName", "Subscription"), subtitle: orderStatus(o), price: orderPrice(o),
37
- validity: (o.earliestEndDate || o.autoRenewCanceled || o.cancellation?.effectiveAt === "NEXT_PAYMENT_DATE") && end ? copyTemplate("subscriptionDetail.scheduledEndMessage", "Your subscription ends on {date}.", { date: end }) : renews ? copyTemplate("placeSummary.planRenews", "Renews {date}", { date: renews }) : "",
37
+ validity: (o.earliestEndDate || o.autoRenewCanceled || o.cancellation?.effectiveAt === "NEXT_PAYMENT_DATE") && end ? copyTemplate("subscriptionDetail.scheduledEndMessage", "Your subscription ends on {date}.", { date: end }) : renews ? copyTemplate("placeSummary.planRenews", "Renews {date}", { date: renews })
38
+ : orderOpenEnded(o) ? copyParam("mySubscriptions.validUntilCanceled", "Valid until canceled") : "",
38
39
  facts: orderFacts(o), hideCancel: !canCancel(o) || cancellationsSent.has(cancellationKey(o.id)), noScheduledOption: !scheduled,
39
40
  effectiveAt: scheduled ? "NEXT_PAYMENT_DATE" : "IMMEDIATELY", actionMessage: message };
40
41
  }
@@ -31766,7 +31766,8 @@ const SCREENS = runtimeSetting({
31766
31766
  "type": "Text",
31767
31767
  "props": {
31768
31768
  "text": "$item.endDate",
31769
- "style": "footnoteRegular"
31769
+ "style": "footnoteRegular",
31770
+ "collapseWhenEmpty": true
31770
31771
  }
31771
31772
  }
31772
31773
  }
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "صالح حتى",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "صالح حتى الإلغاء",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "تعذّر تحميل الاشتراكات.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Platí do",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Platí do zrušení",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Předplatná se nepodařilo načíst.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Gyldig til",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Gyldig indtil opsigelse",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Abonnementer kunne ikke indlæses.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Gültig bis",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Gültig bis zur Kündigung",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Abonnements konnten nicht geladen werden.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Ισχύει έως",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Ισχύει έως την ακύρωση",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Δεν ήταν δυνατή η φόρτωση των συνδρομών.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Válido hasta",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Válido hasta su cancelación",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "No se pudieron cargar las suscripciones.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Voimassa asti",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Voimassa toistaiseksi",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Tilauksia ei voitu ladata.",
@@ -5336,6 +5336,11 @@
5336
5336
  "translation": "Valable jusqu'au",
5337
5337
  "origin": "machine"
5338
5338
  },
5339
+ "h_40895070d6bf": {
5340
+ "source": "Valid until canceled",
5341
+ "translation": "Valable jusqu'à résiliation",
5342
+ "origin": "machine"
5343
+ },
5339
5344
  "h_513a2ae3716f": {
5340
5345
  "source": "Subscriptions could not be loaded.",
5341
5346
  "translation": "Impossible de charger les abonnements.",
@@ -4358,6 +4358,10 @@
4358
4358
  "source": "Valid until",
4359
4359
  "translation": "בתוקף עד"
4360
4360
  },
4361
+ "h_40895070d6bf": {
4362
+ "source": "Valid until canceled",
4363
+ "translation": "בתוקף עד לביטול"
4364
+ },
4361
4365
  "h_513a2ae3716f": {
4362
4366
  "source": "Subscriptions could not be loaded.",
4363
4367
  "translation": "לא ניתן לטעון את המנויים."
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Érvényes eddig",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Lemondásig érvényes",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Az előfizetéseket nem sikerült betölteni.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Berlaku hingga",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Berlaku hingga dibatalkan",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Langganan tidak dapat dimuat.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Valido fino al",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Valido fino alla disdetta",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Impossibile caricare gli abbonamenti.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "有効期限",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "解約まで有効",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "サブスクリプションを読み込めませんでした。",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "유효 기간",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "해지 시까지 유효",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "구독을 불러올 수 없어요.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Galioja iki",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Galioja iki atšaukimo",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Nepavyko įkelti prenumeratų.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Geldig tot",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Geldig tot opzegging",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Abonnementen konden niet worden geladen.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Gyldig til",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Gyldig til oppsigelse",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Abonnementene kunne ikke lastes inn.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Ważne do",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Ważne do czasu anulowania",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Nie udało się wczytać subskrypcji.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Válido até",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Válido até o cancelamento",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Não foi possível carregar as assinaturas.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Действует до",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Действует до отмены",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Не удалось загрузить подписки.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Giltig till",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Giltig tills vidare",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Det gick inte att läsa in prenumerationerna.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "ใช้ได้ถึง",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "ใช้ได้จนกว่าจะยกเลิก",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "โหลดการสมัครใช้งานไม่ได้",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Geçerlilik tarihi",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "İptal edilene kadar geçerli",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Abonelikler yüklenemedi.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Діє до",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Діє до скасування",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Не вдалося завантажити підписки.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "Có hiệu lực đến",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "Có hiệu lực đến khi hủy",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "Không thể tải các gói đăng ký.",
@@ -5351,6 +5351,11 @@
5351
5351
  "translation": "有效期限至",
5352
5352
  "origin": "machine"
5353
5353
  },
5354
+ "h_40895070d6bf": {
5355
+ "source": "Valid until canceled",
5356
+ "translation": "有效期至取消为止",
5357
+ "origin": "machine"
5358
+ },
5354
5359
  "h_513a2ae3716f": {
5355
5360
  "source": "Subscriptions could not be loaded.",
5356
5361
  "translation": "無法載入訂閱。",
@@ -20,6 +20,45 @@ export function orderDate(value?: string): string {
20
20
  return value && Number.isFinite(Date.parse(value)) ? formatDateMedium(new Date(value)) : "";
21
21
  }
22
22
 
23
+ /**
24
+ * The order is valid until it is canceled: an ACTIVE single-payment order whose purchased pricing says
25
+ * "unlimited" (`singlePaymentUnlimited`) and that has no end, no scheduled end and no billing cycle.
26
+ * Only the order's own pricing decides it; today's plan is never consulted, because it can have changed.
27
+ */
28
+ export function orderOpenEnded(order: WixPlanOrder): boolean {
29
+ if (order.status !== "ACTIVE" || order.endDate || order.earliestEndDate || order.autoRenewCanceled || order.cancellation?.effectiveAt === "NEXT_PAYMENT_DATE") return false;
30
+ const pricing = order.pricing ?? {};
31
+ const details = order.priceDetails ?? {};
32
+ if (pricing.subscription || details.subscription || pricing.singlePaymentForDuration || details.singlePaymentForDuration) return false;
33
+ return pricing.singlePaymentUnlimited === true || details.singlePaymentUnlimited === true;
34
+ }
35
+
36
+ /** One order's validity line on a subscription card: the label, the date after it, and whether the line shows. */
37
+ export interface OrderValidity {
38
+ /** "Valid until" / "Current period ends" / "End date" / "Expired on", or the whole line "Valid until canceled". */
39
+ label: string;
40
+ /** The formatted date; empty for an open-ended order, whose label says it all. */
41
+ date: string;
42
+ /** True when the order says nothing reliable about its validity: the card hides the line. */
43
+ hidden: boolean;
44
+ openEnded: boolean;
45
+ }
46
+
47
+ export function orderValidity(order: WixPlanOrder): OrderValidity {
48
+ // A subscription with no end date but a running billing cycle is "valid" until the cycle ends.
49
+ const periodEnd = !order.earliestEndDate && !order.endDate && order.status === "ACTIVE" && (order.pricing?.subscription ?? order.priceDetails?.subscription)
50
+ ? orderDate(order.currentCycle?.endedDate) : "";
51
+ const date = orderDate(order.earliestEndDate ?? order.endDate) || periodEnd;
52
+ if (!date && orderOpenEnded(order)) {
53
+ return { label: copyParam("mySubscriptions.validUntilCanceled", "Valid until canceled"), date: "", hidden: false, openEnded: true };
54
+ }
55
+ const label = periodEnd ? copyParam("subscriptionDetail.periodEnd", "Current period ends")
56
+ : order.status === "CANCELED" ? copyParam("subscriptionDetail.endDate", "End date")
57
+ : order.status === "ENDED" ? copyParam("mySubscriptions.expiredOn", "Expired on")
58
+ : copyParam("mySubscriptions.validUntil", "Valid until");
59
+ return { label, date, hidden: !date, openEnded: false };
60
+ }
61
+
23
62
  /** The purchased order owns its price; today's plan is never a price fallback. */
24
63
  export function orderPrice(order: WixPlanOrder): string {
25
64
  const cycle = order.currentCycle?.index ?? 1;
@@ -2,12 +2,12 @@ import { defineService } from "@himalaya/state";
2
2
  import { listMyPlanOrders, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
3
3
  import { hostSessionFromGlobal } from "@himalaya/iap";
4
4
  import { memberAccess, assertMemberAccess, memberAccessDenied, memberChanged } from "../_shared/member-access.js";
5
- import { orderDate, orderPrice, orderStatus } from "../_shared/pricing-plan-display.js";
5
+ import { orderPrice, orderStatus, orderValidity } from "../_shared/pricing-plan-display.js";
6
6
  import { descriptionBody } from "../_shared/rich-body.js";
7
7
  import { copyParam, stashCopy } from "../_shared/himi-copy.js";
8
8
  import { isHttp401 } from "../_shared/member-read.js";
9
9
 
10
- interface Row { id: string; name: string; subtitle: string; description: string; price: string; endDate: string; noEndDate: boolean; expired: boolean; dateLabel: string }
10
+ interface Row { id: string; name: string; subtitle: string; description: string; price: string; endDate: string; noEndDate: boolean; openEnded: boolean; expired: boolean; dateLabel: string }
11
11
  interface S {
12
12
  status: string; orders: Row[]; rows: Row[]; allOrders: Row[]; selectedTab: string; nextCursor: string;
13
13
  emptyText: string; hideAccountCta: boolean; noOrders: boolean;
@@ -32,10 +32,10 @@ function project(state: S): S {
32
32
  emptyText: orders.length ? "" : state.selectedTab === "expired" ? copyParam("mySubscriptions.expiredEmpty", "No expired subscriptions") : copyParam("mySubscriptions.activeEmpty", "No active subscriptions") };
33
33
  }
34
34
  function norm(order: WixPlanOrder): Row {
35
- const periodEnd = !order.earliestEndDate && !order.endDate && order.status === "ACTIVE" && (order.pricing?.subscription ?? order.priceDetails?.subscription) ? orderDate(order.currentCycle?.endedDate) : "";
36
- const endDate = orderDate(order.earliestEndDate ?? order.endDate) || periodEnd;
35
+ const validity = orderValidity(order);
37
36
  return { id: order.id, name: order.planName || copyParam("plans.planFallbackName", "Plan"), subtitle: orderStatus(order),
38
- description: descriptionBody(order.planDescription).bodyText, price: orderPrice(order), endDate, noEndDate: !endDate, dateLabel: periodEnd ? copyParam("subscriptionDetail.periodEnd", "Current period ends") : order.status === "CANCELED" ? copyParam("subscriptionDetail.endDate", "End date") : order.status === "ENDED" ? copyParam("mySubscriptions.expiredOn", "Expired on") : copyParam("mySubscriptions.validUntil", "Valid until"),
37
+ description: descriptionBody(order.planDescription).bodyText, price: orderPrice(order),
38
+ endDate: validity.date, noEndDate: validity.hidden, openEnded: validity.openEnded, dateLabel: validity.label,
39
39
  expired: ["ENDED", "CANCELED"].includes(order.status ?? "") };
40
40
  }
41
41
  async function readPage(state: S, reset: boolean): Promise<S | undefined> {
@@ -2,7 +2,7 @@ import { defineService } from "@himalaya/state";
2
2
  import { getMyPlanOrder, requestCancellation, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
3
3
  import { hostSessionFromGlobal } from "@himalaya/iap";
4
4
  import { memberAccess, assertMemberAccess, memberAccessDenied, memberChanged, type MemberAccess } from "../_shared/member-access.js";
5
- import { orderDate, orderPrice, orderStatus, orderFacts } from "../_shared/pricing-plan-display.js";
5
+ import { orderDate, orderPrice, orderStatus, orderFacts, orderOpenEnded } from "../_shared/pricing-plan-display.js";
6
6
  import { presence, presenceAfterError, detailInputId, type PresenceFlags } from "../_shared/detail-presence.js";
7
7
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
8
8
 
@@ -34,7 +34,8 @@ function project(o: WixPlanOrder, message = ""): S {
34
34
  const scheduled = Boolean((o.pricing?.subscription ?? o.priceDetails?.subscription) && o.currentCycle?.endedDate && Date.parse(o.currentCycle.endedDate) > Date.now());
35
35
  const renews = o.status === "ACTIVE" && scheduled ? orderDate(o.currentCycle?.endedDate) : "";
36
36
  return { ...initial(), ...presence("found"), status: "ready", notActive: o.status !== "ACTIVE", isActive: o.status === "ACTIVE", name: o.planName || copyParam("subscriptionDetail.fallbackName", "Subscription"), subtitle: orderStatus(o), price: orderPrice(o),
37
- validity: (o.earliestEndDate || o.autoRenewCanceled || o.cancellation?.effectiveAt === "NEXT_PAYMENT_DATE") && end ? copyTemplate("subscriptionDetail.scheduledEndMessage", "Your subscription ends on {date}.", { date: end }) : renews ? copyTemplate("placeSummary.planRenews", "Renews {date}", { date: renews }) : "",
37
+ validity: (o.earliestEndDate || o.autoRenewCanceled || o.cancellation?.effectiveAt === "NEXT_PAYMENT_DATE") && end ? copyTemplate("subscriptionDetail.scheduledEndMessage", "Your subscription ends on {date}.", { date: end }) : renews ? copyTemplate("placeSummary.planRenews", "Renews {date}", { date: renews })
38
+ : orderOpenEnded(o) ? copyParam("mySubscriptions.validUntilCanceled", "Valid until canceled") : "",
38
39
  facts: orderFacts(o), hideCancel: !canCancel(o) || cancellationsSent.has(cancellationKey(o.id)), noScheduledOption: !scheduled,
39
40
  effectiveAt: scheduled ? "NEXT_PAYMENT_DATE" : "IMMEDIATELY", actionMessage: message };
40
41
  }
@@ -13673,7 +13673,8 @@ const SCREENS = runtimeSetting({
13673
13673
  "type": "Text",
13674
13674
  "props": {
13675
13675
  "text": "$item.endDate",
13676
- "style": "footnoteRegular"
13676
+ "style": "footnoteRegular",
13677
+ "collapseWhenEmpty": true
13677
13678
  }
13678
13679
  }
13679
13680
  }
@@ -3415,6 +3415,11 @@
3415
3415
  "translation": "صالح حتى",
3416
3416
  "origin": "machine"
3417
3417
  },
3418
+ "h_40895070d6bf": {
3419
+ "source": "Valid until canceled",
3420
+ "translation": "صالح حتى الإلغاء",
3421
+ "origin": "machine"
3422
+ },
3418
3423
  "h_513a2ae3716f": {
3419
3424
  "source": "Subscriptions could not be loaded.",
3420
3425
  "translation": "تعذّر تحميل الاشتراكات.",
@@ -3415,6 +3415,11 @@
3415
3415
  "translation": "Platí do",
3416
3416
  "origin": "machine"
3417
3417
  },
3418
+ "h_40895070d6bf": {
3419
+ "source": "Valid until canceled",
3420
+ "translation": "Platí do zrušení",
3421
+ "origin": "machine"
3422
+ },
3418
3423
  "h_513a2ae3716f": {
3419
3424
  "source": "Subscriptions could not be loaded.",
3420
3425
  "translation": "Předplatná se nepodařilo načíst.",
@@ -3415,6 +3415,11 @@
3415
3415
  "translation": "Gyldig til",
3416
3416
  "origin": "machine"
3417
3417
  },
3418
+ "h_40895070d6bf": {
3419
+ "source": "Valid until canceled",
3420
+ "translation": "Gyldig indtil opsigelse",
3421
+ "origin": "machine"
3422
+ },
3418
3423
  "h_513a2ae3716f": {
3419
3424
  "source": "Subscriptions could not be loaded.",
3420
3425
  "translation": "Abonnementer kunne ikke indlæses.",
@@ -3415,6 +3415,11 @@
3415
3415
  "translation": "Gültig bis",
3416
3416
  "origin": "machine"
3417
3417
  },
3418
+ "h_40895070d6bf": {
3419
+ "source": "Valid until canceled",
3420
+ "translation": "Gültig bis zur Kündigung",
3421
+ "origin": "machine"
3422
+ },
3418
3423
  "h_513a2ae3716f": {
3419
3424
  "source": "Subscriptions could not be loaded.",
3420
3425
  "translation": "Abonnements konnten nicht geladen werden.",
@@ -3415,6 +3415,11 @@
3415
3415
  "translation": "Ισχύει έως",
3416
3416
  "origin": "machine"
3417
3417
  },
3418
+ "h_40895070d6bf": {
3419
+ "source": "Valid until canceled",
3420
+ "translation": "Ισχύει έως την ακύρωση",
3421
+ "origin": "machine"
3422
+ },
3418
3423
  "h_513a2ae3716f": {
3419
3424
  "source": "Subscriptions could not be loaded.",
3420
3425
  "translation": "Δεν ήταν δυνατή η φόρτωση των συνδρομών.",
@@ -3415,6 +3415,11 @@
3415
3415
  "translation": "Válido hasta",
3416
3416
  "origin": "machine"
3417
3417
  },
3418
+ "h_40895070d6bf": {
3419
+ "source": "Valid until canceled",
3420
+ "translation": "Válido hasta su cancelación",
3421
+ "origin": "machine"
3422
+ },
3418
3423
  "h_513a2ae3716f": {
3419
3424
  "source": "Subscriptions could not be loaded.",
3420
3425
  "translation": "No se pudieron cargar las suscripciones.",
@@ -3415,6 +3415,11 @@
3415
3415
  "translation": "Voimassa asti",
3416
3416
  "origin": "machine"
3417
3417
  },
3418
+ "h_40895070d6bf": {
3419
+ "source": "Valid until canceled",
3420
+ "translation": "Voimassa toistaiseksi",
3421
+ "origin": "machine"
3422
+ },
3418
3423
  "h_513a2ae3716f": {
3419
3424
  "source": "Subscriptions could not be loaded.",
3420
3425
  "translation": "Tilauksia ei voitu ladata.",
@@ -3395,6 +3395,11 @@
3395
3395
  "translation": "Valable jusqu'au",
3396
3396
  "origin": "machine"
3397
3397
  },
3398
+ "h_40895070d6bf": {
3399
+ "source": "Valid until canceled",
3400
+ "translation": "Valable jusqu'à résiliation",
3401
+ "origin": "machine"
3402
+ },
3398
3403
  "h_513a2ae3716f": {
3399
3404
  "source": "Subscriptions could not be loaded.",
3400
3405
  "translation": "Impossible de charger les abonnements.",