@wix/himalaya-cli 0.1750.0 → 0.1752.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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +16 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/himi-package.d.ts +478 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/host-compatibility.d.ts +56 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/icon-catalog.generated.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +154 -7
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/index.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/native-engine.d.ts +49 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/copy.generated.d.ts +16 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/feedback.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast-service.d.ts +105 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast.d.ts +116 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/auth.mjs +27 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +326 -13
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +757 -83
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +156 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth/worker.mjs +133 -13
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth.mjs +139 -13
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin → 2671d1cadb15daa5e59440f4c924e30c221ab3d405e8a56a0ab1cdbe4764af3d.bin} +1 -1
- package/dist/browser-plane/sw.js +7 -7
- package/dist/cli.mjs +37219 -33014
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/app-config.md +1 -1
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +4 -0
- package/guides/designing-himi-screens.md +7 -0
- package/guides/getting-started.md +2 -0
- package/guides/headless-loop.md +1 -1
- package/guides/himi-json-output.md +25 -3
- package/guides/himi-skill.md +2 -0
- package/guides/index.json +6 -0
- package/guides/push-cli-onboarding.md +13 -0
- package/guides/qa-builds.md +15 -2
- package/guides/recipe-podcast.md +149 -0
- package/guides/releasing-with-himi-serve.md +51 -0
- package/guides/store-submission.md +46 -1
- package/guides/tier-5-add-a-screen.md +16 -2
- package/guides/wix-business-context.md +29 -0
- package/guides/wix-platform-usage.md +7 -2
- package/package.json +10 -10
- package/template-icons/fitness-gym.png +0 -0
- package/templates/beauty-salon/dev/index.ts +1 -1
- package/templates/beauty-salon/l10n/en.json +1 -1
- package/templates/beauty-salon/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/branded-lite/dev/index.ts +101 -1
- package/templates/branded-lite/l10n/en.json +22 -1
- package/templates/branded-lite/l10n/es.json +22 -0
- package/templates/branded-lite/l10n/fr.json +18 -0
- package/templates/branded-lite/l10n/he.json +15 -0
- package/templates/branded-lite/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/branded-lite/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/branded-lite/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
- package/templates/brandy/README.md +33 -0
- package/templates/brandy/config.ts +51 -7
- package/templates/brandy/dev/index.ts +23 -9
- package/templates/community-club/l10n/en.json +1 -1
- package/templates/community-club/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/community-club/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/events-meetups/l10n/en.json +1 -1
- package/templates/events-meetups/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/events-meetups/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/fitness-gym/README.md +53 -0
- package/templates/fitness-gym/config.ts +560 -0
- package/templates/fitness-gym/dev/index.ts +25787 -0
- package/templates/fitness-gym/himalaya.content.json +64 -0
- package/templates/fitness-gym/himalaya.template.json +15 -0
- package/templates/fitness-gym/icon.png +0 -0
- package/templates/fitness-gym/platforms.json +1 -0
- package/templates/fitness-gym/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/fitness-gym/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/fitness-gym/tier5-src/_shared/booking-session.ts +224 -0
- package/templates/fitness-gym/tier5-src/_shared/branded-lite-hosted.ts +280 -0
- package/templates/fitness-gym/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-presenter.ts +576 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-query.ts +193 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +400 -0
- package/templates/fitness-gym/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/fitness-gym/tier5-src/_shared/engine-intl.ts +523 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-account.ts +194 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-copy.ts +116 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-media.ts +29 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/fitness-gym/tier5-src/_shared/host-events.ts +66 -0
- package/templates/fitness-gym/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/fitness-gym/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/fitness-gym/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/fitness-gym/tier5-src/_shared/member-access.ts +63 -0
- package/templates/fitness-gym/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/fitness-gym/tier5-src/_shared/member-bookings.ts +107 -0
- package/templates/fitness-gym/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/fitness-gym/tier5-src/_shared/notification-target.ts +141 -0
- package/templates/fitness-gym/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/fitness-gym/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/fitness-gym/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/fitness-gym/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/fitness-gym/tier5-src/_shared/pricing-plan-display.ts +64 -0
- package/templates/fitness-gym/tier5-src/_shared/program-description.ts +11 -0
- package/templates/fitness-gym/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/fitness-gym/tier5-src/_shared/program-standing.ts +46 -0
- package/templates/fitness-gym/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/fitness-gym/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/fitness-gym/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/fitness-gym/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/fitness-gym/tier5-src/_shared/weekly-goal.ts +107 -0
- package/templates/fitness-gym/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/fitness-gym/tier5-src/_shared/wix-member-links.ts +114 -0
- package/templates/fitness-gym/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/fitness-gym/tier5-src/business-chat/index.ts +732 -0
- package/templates/fitness-gym/tier5-src/business-contact/index.ts +6 -0
- package/templates/fitness-gym/tier5-src/himi-booking-account/index.ts +267 -0
- package/templates/fitness-gym/tier5-src/himi-booking-bookings/index.ts +468 -0
- package/templates/fitness-gym/tier5-src/himi-booking-service/index.ts +1190 -0
- package/templates/fitness-gym/tier5-src/himi-booking-services/index.ts +791 -0
- package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +1729 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-agenda/index.ts +988 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-member-programs/index.ts +656 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-plans/index.ts +495 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-program/facts.ts +52 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-program/index.ts +845 -0
- package/templates/fitness-gym/tier5-src/himi-fitcoach-goal/index.ts +190 -0
- package/templates/fitness-gym/tier5-src/himi-fitcoach-home/index.ts +619 -0
- package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +1007 -0
- package/templates/fitness-gym/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
- package/templates/fitness-gym/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
- package/templates/fitness-gym/tokens.json +414 -0
- package/templates/gym-fitness/dev/index.ts +1 -1
- package/templates/gym-fitness/l10n/en.json +1 -1
- package/templates/gym-fitness/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/medical-services/dev/index.ts +2 -1
- package/templates/medical-services/tier5-src/himi-booking-account/index.ts +16 -1
- package/templates/nonprofit-cause/l10n/en.json +1 -1
- package/templates/nonprofit-cause/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/personal-fitness-trainer/dev/index.ts +2 -2
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/podcast-creator/dev/index.ts +100 -0
- package/templates/podcast-creator/l10n/en.json +22 -1
- package/templates/podcast-creator/l10n/es.json +22 -0
- package/templates/podcast-creator/l10n/fr.json +18 -0
- package/templates/podcast-creator/l10n/he.json +15 -0
- package/templates/podcast-creator/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/podcast-creator/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
- package/templates/portfolio-creative/l10n/en.json +1 -1
- package/templates/portfolio-creative/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/restaurant/l10n/en.json +1 -1
- package/templates/restaurant/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/restaurant/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/retail-store/l10n/en.json +1 -1
- package/templates/retail-store/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/retail-store/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/salon-spa/dev/index.ts +1 -1
- package/templates/salon-spa/tier5-src/himi-booking-account/index.ts +16 -1
- package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/yoga-studio/dev/index.ts +1 -1
- package/templates/yoga-studio/l10n/en.json +1 -1
- package/templates/yoga-studio/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
|
@@ -0,0 +1,845 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
2
|
+
import { dispatch } from "@himalaya/dispatch";
|
|
3
|
+
import { memberAccess, assertMemberAccess, type MemberAccess } from "../_shared/member-access.js";
|
|
4
|
+
import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
|
|
5
|
+
import { offlineWriteMessage, withOnlineWrites } from "../_shared/online-actions.js";
|
|
6
|
+
// Tier-5 bundle: himi-branded-lite — single online-program detail (design §3.5
|
|
7
|
+
// `programs` vertical, screen full-potential pass).
|
|
8
|
+
//
|
|
9
|
+
// The branded product-detail pattern: a templated `himi_program_<id>` route
|
|
10
|
+
// whose worker loads one program. §8.10 drift discipline: getProgram is the
|
|
11
|
+
// primary read; when the GET path 404s/errors the worker falls back to the
|
|
12
|
+
// programs QUERY (client-side find by id). Only both failing lands in the
|
|
13
|
+
// error card.
|
|
14
|
+
//
|
|
15
|
+
// Phase 2d — enrolling is NATIVE. `joinProgram` covers all three program kinds in
|
|
16
|
+
// the Join Applications API; its compatibility result exposes only confirmed outcomes:
|
|
17
|
+
// a free/open program comes back JOINED with nothing to pay, a paid one comes back
|
|
18
|
+
// PAYMENT_PENDING and settles on the shared in-app pay rail, and a private one comes
|
|
19
|
+
// back APPROVAL_PENDING (the owner approves; there is nothing to charge). Any failure
|
|
20
|
+
// degrades to the site-directing message rather than a dead button.
|
|
21
|
+
//
|
|
22
|
+
// App Store prices, the payment route and the App Store sale come from the shared IAP layer
|
|
23
|
+
// (`createIapCommerce` in @himalaya/iap-checkout). An app that sells nothing through the App Store
|
|
24
|
+
// reads every program as `disabled` and keeps Enrol on its own commerce. An Apple-routed program
|
|
25
|
+
// offers Get access in place of Enrol and sells only through the shared checkout, never through the
|
|
26
|
+
// Wix payment rail.
|
|
27
|
+
import { connectivity, defineService as registerService } from "@himalaya/state";
|
|
28
|
+
import { programImage } from "../_shared/himi-media.js";
|
|
29
|
+
import { WIX_DETAIL_IMAGE } from "@himalaya/wix-media";
|
|
30
|
+
import { descriptionBody } from "../_shared/rich-body.js";
|
|
31
|
+
import { programDescription } from "../_shared/program-description.js";
|
|
32
|
+
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
33
|
+
import {
|
|
34
|
+
cancelJoinApplication,
|
|
35
|
+
getProgram,
|
|
36
|
+
joinProgram,
|
|
37
|
+
payableIdOf,
|
|
38
|
+
participationsByProgram,
|
|
39
|
+
queryJoinApplications,
|
|
40
|
+
queryPrograms,
|
|
41
|
+
searchMemberParticipation,
|
|
42
|
+
type WixJoinApplication,
|
|
43
|
+
type WixParticipant,
|
|
44
|
+
type WixProgram,
|
|
45
|
+
type WixProgramFull,
|
|
46
|
+
} from "@himalaya/wix-online-programs";
|
|
47
|
+
import { standingOf, STATUS, type Standing } from "../_shared/program-standing.js";
|
|
48
|
+
import { createRedirectSession } from "@himalaya/wix-redirects";
|
|
49
|
+
import { getMyMember } from "@himalaya/wix-members";
|
|
50
|
+
import { session as wixPlatformSession, i18n } from "@himalaya/wix-platform";
|
|
51
|
+
import { programFacts, type ProgramFact } from "./facts.js";
|
|
52
|
+
import { cleanTitle, initials } from "../_shared/himi-text.js";
|
|
53
|
+
import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
|
|
54
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
55
|
+
import { formatCurrency } from "../_shared/engine-intl.js";
|
|
56
|
+
import { iapPriceFields, onlineProgramItem, type IapCatalogItem, type IapPollDirective, type IapPriceFields } from "@himalaya/iap";
|
|
57
|
+
import { createIapCommerce, onlineProgramOrders, type IapPurchaseFields } from "@himalaya/iap-checkout";
|
|
58
|
+
import { iapPriceCopy, iapPurchaseCopy, resetUnhydratedKeysOnOlderRuntime } from "../_shared/iap-worker.js";
|
|
59
|
+
|
|
60
|
+
/** Wix Online Programs appDefId — the vertical a participant's cashier order is
|
|
61
|
+
* paid under (mirrors AppDefId.CHALLENGES in Wix's RN apps). */
|
|
62
|
+
const WIX_PROGRAMS_APP_ID = "2936372a-a1ed-4d5c-8f27-0a6a70a1a7d1";
|
|
63
|
+
|
|
64
|
+
interface CancelledApplication { programId: string; id: string; member: MemberAccess }
|
|
65
|
+
interface StandingRead { application?: WixJoinApplication; participant?: WixParticipant }
|
|
66
|
+
|
|
67
|
+
interface State {
|
|
68
|
+
status: "loading" | "ready" | "error";
|
|
69
|
+
/** Outcome line for the Enrol CTA — joined / pending approval / payment / failure. */
|
|
70
|
+
actionMessage: string;
|
|
71
|
+
name: string;
|
|
72
|
+
/** Full readable fallback, plus the bounded Ricos body when present. */
|
|
73
|
+
description: string;
|
|
74
|
+
descriptionJson: string;
|
|
75
|
+
hasDescriptionJson: boolean;
|
|
76
|
+
/** "N sections · M steps" — structure meta line; pace has its own fact row. */
|
|
77
|
+
meta: string;
|
|
78
|
+
facts: ProgramFact[];
|
|
79
|
+
hideFacts: boolean;
|
|
80
|
+
/** Formatted price when the payload carries one ("" for free/absent). */
|
|
81
|
+
priceLine: string;
|
|
82
|
+
image: string;
|
|
83
|
+
initial: string;
|
|
84
|
+
emptyText: string;
|
|
85
|
+
isLoading: boolean;
|
|
86
|
+
notLoading: boolean;
|
|
87
|
+
isErrored: boolean;
|
|
88
|
+
notErrored: boolean;
|
|
89
|
+
noEmpty: boolean;
|
|
90
|
+
hasImage: boolean;
|
|
91
|
+
noImage: boolean;
|
|
92
|
+
hideContent: boolean;
|
|
93
|
+
/** "One-time purchase" beside an App Store price. */
|
|
94
|
+
priceNote: string;
|
|
95
|
+
hidePriceRetry: boolean;
|
|
96
|
+
/** Bound to the Enrol CTA's `disabledPath`; `enroll` re-checks the route itself regardless. */
|
|
97
|
+
enrollDisabled: boolean;
|
|
98
|
+
enrollNote: string;
|
|
99
|
+
/** An App Store program sells through Get access instead. */
|
|
100
|
+
enrollHidden: boolean;
|
|
101
|
+
/** The Enrol CTA's label for the member's standing: Enrol, Request to join or Complete payment. */
|
|
102
|
+
enrollLabel: string;
|
|
103
|
+
/** The member's standing as one line ("Joined", "Pending request"…); empty for a visitor or a new member. */
|
|
104
|
+
standingLine: string;
|
|
105
|
+
/** Withdraws a pending join request; shown only while one is pending. */
|
|
106
|
+
cancelHidden: boolean;
|
|
107
|
+
cancelDisabled: boolean;
|
|
108
|
+
cancelLabel: string;
|
|
109
|
+
/** One member-scoped receipt survives worker recreation while Wix's query catches up. */
|
|
110
|
+
confirmedCancellation: CancelledApplication | null;
|
|
111
|
+
cancellationFeedback: string;
|
|
112
|
+
/** The shared checkout's action (`commerce.purchaseFields`): shown only on the App Store route. */
|
|
113
|
+
buyHidden: boolean;
|
|
114
|
+
buyLabel: string;
|
|
115
|
+
buyDisabled: boolean;
|
|
116
|
+
buyNote: string;
|
|
117
|
+
_poll?: IapPollDirective;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function inputId(): string {
|
|
121
|
+
// WS-C — `himalaya.input.id` is the PRIMARY contract: hosts thread the row's
|
|
122
|
+
// `id` nav param (himi.open { screenId: "himi_program", id }) into worker input.
|
|
123
|
+
// The screenId-slice below is #570 back-compat for pre-params releases with
|
|
124
|
+
// baked `himi_program_<id>` screenIds — do not author against this.
|
|
125
|
+
const input = (globalThis as { himalaya?: { input?: { id?: string; screenId?: string } } }).himalaya?.input;
|
|
126
|
+
if (input?.id) return input.id;
|
|
127
|
+
return input?.screenId?.startsWith("himi_program_") ? input.screenId.slice("himi_program_".length) : "";
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function derive(state: State): State {
|
|
131
|
+
const empty = state.status === "ready" && !state.name;
|
|
132
|
+
const facts = Array.isArray(state.facts) ? state.facts : [];
|
|
133
|
+
return {
|
|
134
|
+
...state,
|
|
135
|
+
facts,
|
|
136
|
+
hideFacts: facts.length === 0,
|
|
137
|
+
hasDescriptionJson: state.descriptionJson !== "",
|
|
138
|
+
isLoading: state.status === "loading",
|
|
139
|
+
notLoading: state.status !== "loading",
|
|
140
|
+
isErrored: state.status === "error",
|
|
141
|
+
notErrored: state.status !== "error",
|
|
142
|
+
noEmpty: state.status !== "ready" || !empty,
|
|
143
|
+
hasImage: !!state.image,
|
|
144
|
+
noImage: !state.image,
|
|
145
|
+
hideContent: state.status !== "ready" || empty,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function titleOf(p: WixProgram): string {
|
|
150
|
+
const desc = (p as { description?: unknown }).description;
|
|
151
|
+
const nested = desc && typeof desc === "object" ? (desc as { title?: string }).title : undefined;
|
|
152
|
+
return cleanTitle(p.settings?.title ?? nested ?? p.title ?? p.details?.title) || copyParam("program.programFallbackName", "Program");
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function metaOf(p: WixProgram): string {
|
|
156
|
+
const summary = (p as { contentSummary?: { stepCount?: number; sectionCount?: number } }).contentSummary;
|
|
157
|
+
const bits: string[] = [];
|
|
158
|
+
const sections = Number(summary?.sectionCount ?? 0);
|
|
159
|
+
const steps = Number(summary?.stepCount ?? 0);
|
|
160
|
+
if (sections) bits.push(`${sections} ${sections === 1 ? "section" : "sections"}`);
|
|
161
|
+
if (steps) bits.push(`${steps} ${steps === 1 ? "step" : "steps"}`);
|
|
162
|
+
return bits.join(" · ");
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function priceOf(p: WixProgram): string {
|
|
166
|
+
const price = (p as WixProgramFull).price;
|
|
167
|
+
const raw = price?.value;
|
|
168
|
+
if (raw == null || raw === "" || Number.isNaN(Number(raw))) return "";
|
|
169
|
+
if (Number(raw) === 0) return "";
|
|
170
|
+
try {
|
|
171
|
+
return formatCurrency(Number(raw), price?.currency || "USD");
|
|
172
|
+
} catch {
|
|
173
|
+
return `${raw}`;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function ready(state: State, p: WixProgram | undefined, locale: string): State {
|
|
178
|
+
const stateOf = ((p?.state ?? p?.status ?? "") as string).toUpperCase();
|
|
179
|
+
if (!p || stateOf === "DRAFT") {
|
|
180
|
+
return derive({ ...state, status: "ready", name: "", description: "", descriptionJson: "", meta: "", facts: [], priceLine: "", image: "", initial: "", emptyText: copyParam("program.emptyText", "This program is no longer available.") });
|
|
181
|
+
}
|
|
182
|
+
const name = titleOf(p);
|
|
183
|
+
const image = programImage(p, WIX_DETAIL_IMAGE);
|
|
184
|
+
const body = descriptionBody(programDescription(p), copyParam("program.descriptionFallback", "Follow this program at your own pace."));
|
|
185
|
+
return derive({
|
|
186
|
+
...state,
|
|
187
|
+
status: "ready",
|
|
188
|
+
name,
|
|
189
|
+
description: body.bodyText,
|
|
190
|
+
descriptionJson: body.bodyJson,
|
|
191
|
+
meta: metaOf(p),
|
|
192
|
+
facts: programFacts(p, locale),
|
|
193
|
+
priceLine: priceOf(p),
|
|
194
|
+
image,
|
|
195
|
+
initial: initials(name),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** §8.10 drift discipline: getProgram is the primary read; when the GET path 404s/errors the
|
|
200
|
+
* programs QUERY is the fallback (client-side find keeps it correct even when the gateway ignores
|
|
201
|
+
* the filter shape). Throws only when both fail. */
|
|
202
|
+
async function fetchProgram(id: string): Promise<WixProgram | undefined> {
|
|
203
|
+
if (!id) return undefined;
|
|
204
|
+
try {
|
|
205
|
+
return (await getProgram(id)).program;
|
|
206
|
+
} catch {
|
|
207
|
+
const response = await queryPrograms({ cursorPaging: { limit: 50 } });
|
|
208
|
+
return (response.programs ?? []).find((candidate) => candidate.id === id);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** Whether the existing commerce flow may start (before the join) and continue (before the Wix
|
|
213
|
+
* payment): a price refresh can move the program onto a route this flow must not charge. */
|
|
214
|
+
interface CommerceGuards {
|
|
215
|
+
withdrawnParticipantId?: string;
|
|
216
|
+
assertMember(): Promise<void>;
|
|
217
|
+
mayStart(): boolean;
|
|
218
|
+
mayContinue(): boolean;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
async function enrollmentMessage(id: string, name: string, guards: CommerceGuards): Promise<string> {
|
|
222
|
+
const blocked = () => iapPriceCopy("program").purchaseUnavailable;
|
|
223
|
+
if (!guards.mayStart()) return blocked();
|
|
224
|
+
let preparationWithdrawn = false;
|
|
225
|
+
try {
|
|
226
|
+
const joined = await joinProgram(id, { withdrawnParticipantId: guards.withdrawnParticipantId, resumeExistingParticipant: false, beforeWrite: guards.assertMember, mayPreparePayment: () => {
|
|
227
|
+
if (!guards.mayContinue()) preparationWithdrawn = true;
|
|
228
|
+
return !preparationWithdrawn;
|
|
229
|
+
} });
|
|
230
|
+
const participant = joined.participant;
|
|
231
|
+
const programState = (participant?.state ?? "").toUpperCase();
|
|
232
|
+
if (programState === "APPROVAL_PENDING") {
|
|
233
|
+
return copyParam("program.approvalPendingMessage", "Request sent — the host will approve your place.");
|
|
234
|
+
}
|
|
235
|
+
if (programState === "ENROLLMENT_PENDING") {
|
|
236
|
+
return copyParam("program.enrollmentPendingMessage", "Your enrollment is processing — check back shortly.");
|
|
237
|
+
}
|
|
238
|
+
const payable = payableIdOf(participant);
|
|
239
|
+
if (programState === "JOINED") {
|
|
240
|
+
// Only a confirmed participant is enrolled; absent payment data is not success.
|
|
241
|
+
return copyTemplate("program.joinedMessage", "You're enrolled in {name}.", { name });
|
|
242
|
+
}
|
|
243
|
+
if (programState !== "PAYMENT_PENDING" || !payable) throw new Error("Program enrollment is not ready");
|
|
244
|
+
const msid = await wixPlatformSession.signedInstanceStatus().then((s) => s.msid ?? "").catch(() => "");
|
|
245
|
+
// Re-read before each step that commits money: a route that settles meanwhile wins.
|
|
246
|
+
let withdrawn = false;
|
|
247
|
+
const stillAllowed = () => {
|
|
248
|
+
if (!guards.mayContinue()) withdrawn = true;
|
|
249
|
+
return !withdrawn;
|
|
250
|
+
};
|
|
251
|
+
if (!stillAllowed()) return blocked();
|
|
252
|
+
await guards.assertMember();
|
|
253
|
+
const pay = await payCashierOrder({
|
|
254
|
+
appId: WIX_PROGRAMS_APP_ID,
|
|
255
|
+
snapshotId: payable,
|
|
256
|
+
msid,
|
|
257
|
+
mayCharge: stillAllowed,
|
|
258
|
+
// Wallet-less apps need a rail too. Without this thunk a paid program was
|
|
259
|
+
// unpayable on any app with no provisioned wallet — `payCashierOrder`
|
|
260
|
+
// returned `failed` and the CTA fell through to the site-directing message,
|
|
261
|
+
// which is precisely the dead-end the two-rail design exists to prevent
|
|
262
|
+
// (and which the cart/plans/events flows each guard with a test).
|
|
263
|
+
//
|
|
264
|
+
// Join Applications returns a Wix Payments order id; the payment-request
|
|
265
|
+
// redirect uses that same order handle on the hosted rail.
|
|
266
|
+
cashierUrl: async () => {
|
|
267
|
+
await guards.assertMember();
|
|
268
|
+
if (!stillAllowed()) return undefined;
|
|
269
|
+
const redirect = await createRedirectSession({
|
|
270
|
+
ecomOrderPaymentRequest: { paymentRequestId: payable },
|
|
271
|
+
callbacks: { postFlowUrl: "himalaya-himi-branded-lite://screen/himi_programs" },
|
|
272
|
+
});
|
|
273
|
+
return redirect.redirectSession?.fullUrl;
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
if (withdrawn) return blocked();
|
|
277
|
+
if (pay.kind === "paid") return pay.pending
|
|
278
|
+
? copyParam("program.paymentPendingMessage", "Payment is processing — enrollment will be confirmed after payment.")
|
|
279
|
+
: copyTemplate("program.joinedMessage", "You're enrolled in {name}.", { name });
|
|
280
|
+
if (pay.kind === "handoff") return "";
|
|
281
|
+
if (pay.kind === "cancelled") return copyParam("program.joinCancelledMessage", "Payment cancelled — you haven't enrolled.");
|
|
282
|
+
if (isPaymentSetupFailure(pay)) return paymentSetupMessage("program");
|
|
283
|
+
} catch (error) {
|
|
284
|
+
if (!connectivity().online) return offlineWriteMessage;
|
|
285
|
+
if (preparationWithdrawn) return blocked();
|
|
286
|
+
if (isPaymentSetupFailure(error)) return paymentSetupMessage("program");
|
|
287
|
+
// fall through to the site-directing message
|
|
288
|
+
}
|
|
289
|
+
return copyTemplate("program.joinOnSiteMessage", "Enrolment happens on the website — visit the site to join {name}.", { name });
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// ── Content, App Store pricing and sale ─────
|
|
293
|
+
//
|
|
294
|
+
// One writer: `load`, `enroll` and `buy` keep their results here and every state
|
|
295
|
+
// change goes through the synchronous `pricingPublish`, which re-reads the latest content, route
|
|
296
|
+
// and checkout state. An async action returning its own state could land after a refresh and
|
|
297
|
+
// revive a stale price, route or purchase.
|
|
298
|
+
|
|
299
|
+
const commerce = createIapCommerce({ adapters: [onlineProgramOrders], onChange: () => { void svc.pricingPublish(); } });
|
|
300
|
+
const pricing = commerce.pricing;
|
|
301
|
+
const PRICING_NOT_HYDRATED = [
|
|
302
|
+
"priceLine", "priceNote", "hidePriceRetry", "enrollDisabled", "enrollNote", "enrollHidden", "enrollLabel", "standingLine", "cancelHidden", "cancelDisabled", "cancelLabel", "buyHidden", "buyLabel", "buyDisabled", "buyNote",
|
|
303
|
+
] as const;
|
|
304
|
+
const CONTENT_KEYS = ["status", "name", "description", "descriptionJson", "meta", "facts", "image", "initial", "emptyText"] as const;
|
|
305
|
+
type Content = Pick<State, (typeof CONTENT_KEYS)[number]>;
|
|
306
|
+
const NO_PRICE: IapPriceFields = { priceText: "", priceNote: "", priceLoading: false, hidePriceRetry: true, actionDisabled: true, actionNote: "" };
|
|
307
|
+
const NOT_APPLE: IapPurchaseFields = { appleRoute: false, accessReady: false, buyLabel: "", buyDisabled: true, buyBusy: false, buyNote: "" };
|
|
308
|
+
let content: Content;
|
|
309
|
+
let pricedItem: IapCatalogItem | undefined;
|
|
310
|
+
let actionMessage = "";
|
|
311
|
+
let loadSeq = 0;
|
|
312
|
+
let commerceStarted = false;
|
|
313
|
+
let enrollmentInFlight = false;
|
|
314
|
+
// Unknown initial standing stays "none"; known standing survives transient reads only
|
|
315
|
+
// for its original program and revalidated member. `joinProgram` still guards every enrollment.
|
|
316
|
+
let standing: Standing = "none";
|
|
317
|
+
let standingContext: { programId: string; member: MemberAccess } | undefined;
|
|
318
|
+
let standingProgramId = "";
|
|
319
|
+
let standingMember: MemberAccess | undefined;
|
|
320
|
+
let pendingApplicationId = "";
|
|
321
|
+
let pendingProgramId = "";
|
|
322
|
+
let pendingMember: MemberAccess | undefined;
|
|
323
|
+
// One confirmed withdrawal, scoped to its program and member. Wix may keep returning the old
|
|
324
|
+
// pending row while cancellation propagates; it must not resurrect that request's cancel action.
|
|
325
|
+
let cancelledApplication: CancelledApplication | undefined;
|
|
326
|
+
let cancellationFeedback = "";
|
|
327
|
+
// A failed attempt belongs only to the pending request that can still be retried.
|
|
328
|
+
let failedCancellationFeedback: (CancelledApplication & { message: string }) | undefined;
|
|
329
|
+
let cancellationReconciliation: (CancelledApplication & { afterSeq: number; confirmed: boolean }) | undefined;
|
|
330
|
+
let standingSeq = 0;
|
|
331
|
+
let latestStandingRead: { programId: string; seq: number; promise: Promise<StandingRead | undefined> } | undefined;
|
|
332
|
+
let programEnded = false;
|
|
333
|
+
let programPrivate = false;
|
|
334
|
+
let programSecret = false;
|
|
335
|
+
let cancelInFlight = false;
|
|
336
|
+
// Presentation dedupe only. The host remains the sole authority to resume a join.
|
|
337
|
+
let openedAuthToken = "";
|
|
338
|
+
let signInPresentation: "sheet" | "full_screen" = "sheet";
|
|
339
|
+
let signInStyle: "page" | "" = "";
|
|
340
|
+
const continuationTarget = (id: string) => `program_enrol:${id}`;
|
|
341
|
+
|
|
342
|
+
async function continuation(operation: "begin" | "check" | "consume" | "cancel", id: string, token = "") {
|
|
343
|
+
try {
|
|
344
|
+
return await dispatch("himi.wix.authContinuation", { operation, target: continuationTarget(id), token }) as { supported?: boolean; confirmed?: boolean; account?: string; token?: string } | null;
|
|
345
|
+
} catch { return { supported: false }; } // Older binaries do not implement this host contract: fail closed.
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function contentOf(state: State): Content {
|
|
349
|
+
return Object.fromEntries(CONTENT_KEYS.map((key) => [key, state[key]])) as Content;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
const programReference = () => onlineProgramItem({ id: inputId() })?.reference;
|
|
353
|
+
const standingForInput = () => standingContext?.programId === inputId();
|
|
354
|
+
const ownsStanding = (context: typeof standingContext, member: MemberAccess, id: string): boolean => {
|
|
355
|
+
const current = standingContext;
|
|
356
|
+
// A same-owner refresh may replace the verdict while identity is read; its keys remain valid.
|
|
357
|
+
return !!context && !!current && context.programId === id && current.programId === id && id === inputId()
|
|
358
|
+
&& context.member.email === member.email && context.member.scope === member.scope
|
|
359
|
+
&& current.member.email === member.email && current.member.scope === member.scope;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
async function load(state: State, arg?: unknown): Promise<undefined> {
|
|
363
|
+
stashCopy(arg);
|
|
364
|
+
const presentation = (arg as { signInPresentation?: unknown } | undefined)?.signInPresentation;
|
|
365
|
+
if (presentation === "sheet" || presentation === "full_screen") {
|
|
366
|
+
signInPresentation = presentation;
|
|
367
|
+
signInStyle = signInPageStyle((arg as { signInSheetStyle?: unknown }).signInSheetStyle);
|
|
368
|
+
}
|
|
369
|
+
const id = inputId();
|
|
370
|
+
const seq = ++loadSeq;
|
|
371
|
+
const [found, locale] = await Promise.all([
|
|
372
|
+
fetchProgram(id).then((program) => ({ program }), () => undefined),
|
|
373
|
+
i18n.locale().catch(() => "en"),
|
|
374
|
+
]);
|
|
375
|
+
if (seq !== loadSeq || inputId() !== id) return undefined;
|
|
376
|
+
content = found ? contentOf(ready(state, found.program, locale)) : { ...content, status: "error" };
|
|
377
|
+
programEnded = found?.program ? programIsEnded(found.program) : false;
|
|
378
|
+
programPrivate = ((found?.program as WixProgramFull | undefined)?.restrictions?.accessType ?? "").toUpperCase() === "PRIVATE";
|
|
379
|
+
programSecret = ((found?.program as WixProgramFull | undefined)?.restrictions?.accessType ?? "").toUpperCase() === "SECRET";
|
|
380
|
+
// A first load can paint content before standing; a warm refresh keeps its owned view.
|
|
381
|
+
// Initial pricing remains guarded until the standing read below settles.
|
|
382
|
+
if (state.status !== "ready") void svc.pricingPublish();
|
|
383
|
+
if (found?.program) await loadStanding(id);
|
|
384
|
+
if (seq !== loadSeq || inputId() !== id) return undefined;
|
|
385
|
+
pricedItem = found?.program ? onlineProgramItem({ id: inputId() }, priceOf(found.program)) : pricedItem;
|
|
386
|
+
void svc.pricingPublish();
|
|
387
|
+
const prices = found?.program ? priceProgram() : Promise.resolve();
|
|
388
|
+
if (seq !== loadSeq || inputId() !== id) return undefined;
|
|
389
|
+
// The host owns the intent across account-scoped worker replacement. The consume is
|
|
390
|
+
// atomic and destructive. A background guest refresh keeps a pending request; the
|
|
391
|
+
// host modal boundary cancels it on dismissal. Route params and hydration never
|
|
392
|
+
// authorize a join. Check prices before spending the one shot.
|
|
393
|
+
const waiting = await continuation("check", id);
|
|
394
|
+
if (waiting?.confirmed && found?.program) {
|
|
395
|
+
await prices;
|
|
396
|
+
if (seq === loadSeq && inputId() === id && standingForInput()) {
|
|
397
|
+
// Authority stays in the host until the last asynchronous prerequisite completes:
|
|
398
|
+
// expiry, cancellation or an intervening account switch can still revoke it.
|
|
399
|
+
const permit = await continuation("consume", id);
|
|
400
|
+
if (inputId() === id && permit?.confirmed && permit.account) await enroll(permit.account, id);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
void resumeCommerce();
|
|
404
|
+
return undefined;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const programIsEnded = (program: WixProgram): boolean => {
|
|
408
|
+
const status = (program.status ?? program.state ?? "").toUpperCase();
|
|
409
|
+
return status === "ENDED" || status === "FINISHED";
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
/** Reads scoped standing. An unknown read preserves a known pending action only after revalidating
|
|
413
|
+
* its owner; a visitor or changed identity makes no standing claim. */
|
|
414
|
+
function loadStanding(id: string): Promise<StandingRead | undefined> {
|
|
415
|
+
const seq = ++standingSeq;
|
|
416
|
+
const promise = readStanding(id, seq);
|
|
417
|
+
if (seq === standingSeq) latestStandingRead = { programId: id, seq, promise };
|
|
418
|
+
return promise;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
async function readStanding(id: string, seq: number): Promise<StandingRead | undefined> {
|
|
422
|
+
const previous = { standing, id: pendingApplicationId, programId: standingProgramId, member: standingMember };
|
|
423
|
+
const cancelled = cancelledApplication;
|
|
424
|
+
const failedFeedback = failedCancellationFeedback;
|
|
425
|
+
let failedFeedbackInvalidated = !!failedFeedback && failedFeedback.programId !== id;
|
|
426
|
+
let next: Standing = "none";
|
|
427
|
+
let applicationId = "";
|
|
428
|
+
let owner: MemberAccess | undefined;
|
|
429
|
+
let read: StandingRead | undefined;
|
|
430
|
+
let readOwner: MemberAccess | undefined;
|
|
431
|
+
let sameCancelledStanding = false;
|
|
432
|
+
let feedbackKnown = false;
|
|
433
|
+
let visitorKnown = false;
|
|
434
|
+
let readIdentity: MemberAccess | undefined;
|
|
435
|
+
try {
|
|
436
|
+
const member = await memberAccess();
|
|
437
|
+
readIdentity = member;
|
|
438
|
+
visitorKnown = !member.email;
|
|
439
|
+
failedFeedbackInvalidated ||= !!failedFeedback && (failedFeedback.member.email !== member.email
|
|
440
|
+
|| failedFeedback.member.scope !== member.scope);
|
|
441
|
+
// Identity alone disproves ownership of the previous confirmation, even when
|
|
442
|
+
// this member's profile/standing cannot be read. The same identity stays unknown.
|
|
443
|
+
feedbackKnown = !!cancelled && (cancelled.programId !== id
|
|
444
|
+
|| cancelled.member.email !== member.email || cancelled.member.scope !== member.scope);
|
|
445
|
+
const memberId = member.email ? (await getMyMember()).member?.id : undefined;
|
|
446
|
+
if (memberId) {
|
|
447
|
+
let participationKnown = true;
|
|
448
|
+
let applicationKnown = true;
|
|
449
|
+
const [participation, applicationRead] = await Promise.all([
|
|
450
|
+
searchMemberParticipation(id, memberId).catch(() => { participationKnown = false; return undefined; }),
|
|
451
|
+
// The query, not `getCurrentJoinApplication`: that read belongs to the join itself, which re-reads it to decide.
|
|
452
|
+
queryJoinApplications({ memberId, programIds: [id] }).then((r) => {
|
|
453
|
+
if (!Array.isArray(r?.joinApplications)) {
|
|
454
|
+
applicationKnown = false;
|
|
455
|
+
return undefined;
|
|
456
|
+
}
|
|
457
|
+
const rows = r.joinApplications;
|
|
458
|
+
const application = rows.find(row => row.memberId === memberId && row.programId === id);
|
|
459
|
+
// A broader/malformed response is not evidence that this member has no application.
|
|
460
|
+
if (rows.length && !application) applicationKnown = false;
|
|
461
|
+
return application;
|
|
462
|
+
}, (): WixJoinApplication | undefined => { applicationKnown = false; return undefined; }),
|
|
463
|
+
]);
|
|
464
|
+
await assertMemberAccess(member);
|
|
465
|
+
// An omitted array cannot prove absence after an unconfirmed write.
|
|
466
|
+
participationKnown &&= Array.isArray(participation?.participants);
|
|
467
|
+
const rows = Array.isArray(participation?.participants) ? participation.participants : [];
|
|
468
|
+
const scoped = rows.filter(row => row.memberId === memberId && row.programId === id);
|
|
469
|
+
if (rows.length && !scoped.length) participationKnown = false;
|
|
470
|
+
const cancelledRow = cancelled?.programId === id && cancelled.id === applicationRead?.id
|
|
471
|
+
&& cancelled.member.email === member.email && cancelled.member.scope === member.scope
|
|
472
|
+
&& applicationRead?.status?.toUpperCase() === "APPROVAL_PENDING";
|
|
473
|
+
const application = cancelledRow ? undefined : applicationRead;
|
|
474
|
+
const participant: WixParticipant | undefined = participationsByProgram(scoped).get(id);
|
|
475
|
+
// Either read can supply standing, but only both known reads can prove an absent
|
|
476
|
+
// application without participation after an unconfirmed cancellation response.
|
|
477
|
+
if (participationKnown && applicationKnown) {
|
|
478
|
+
read = { application: applicationRead, participant };
|
|
479
|
+
readOwner = member;
|
|
480
|
+
}
|
|
481
|
+
sameCancelledStanding = cancelledRow && !participant;
|
|
482
|
+
feedbackKnown ||= applicationKnown || !!participant;
|
|
483
|
+
next = standingOf(programEnded, participant ?? scoped[0], application);
|
|
484
|
+
if (next !== "none") owner = member;
|
|
485
|
+
if (failedFeedback && (applicationKnown || participant)) {
|
|
486
|
+
failedFeedbackInvalidated ||= !!participant || applicationRead?.id !== failedFeedback.id
|
|
487
|
+
|| applicationRead?.status?.toUpperCase() !== "APPROVAL_PENDING";
|
|
488
|
+
}
|
|
489
|
+
if (!participant && application?.status?.toUpperCase() === "APPROVAL_PENDING") {
|
|
490
|
+
applicationId = application.id ?? "";
|
|
491
|
+
owner = member;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
} catch { /* unknown standing */ }
|
|
495
|
+
const previousWithdrawn = cancelled?.programId === id && cancelled.id === previous.id
|
|
496
|
+
&& cancelled.member.email === previous.member?.email && cancelled.member.scope === previous.member?.scope;
|
|
497
|
+
if (!read && next === "none" && previous.standing !== "none" && previous.programId === id && previous.member && !previousWithdrawn) {
|
|
498
|
+
try {
|
|
499
|
+
await assertMemberAccess(previous.member);
|
|
500
|
+
next = previous.standing;
|
|
501
|
+
applicationId = previous.id;
|
|
502
|
+
owner = previous.member;
|
|
503
|
+
} catch { /* never retain another member's standing */ }
|
|
504
|
+
}
|
|
505
|
+
if (seq !== standingSeq || id !== inputId()) return undefined;
|
|
506
|
+
const reconciliation = cancellationReconciliation;
|
|
507
|
+
// A published, owned read started after the write can confirm it, including
|
|
508
|
+
// a screen refresh that superseded the action's own read. Unknown reads cannot undo it.
|
|
509
|
+
if (reconciliation && !reconciliation.confirmed && read && readOwner
|
|
510
|
+
&& seq > reconciliation.afterSeq && id === reconciliation.programId
|
|
511
|
+
&& readOwner.email === reconciliation.member.email && readOwner.scope === reconciliation.member.scope
|
|
512
|
+
&& !read.participant && (!read.application || isCancelledApplication(read.application, reconciliation.id))) {
|
|
513
|
+
reconciliation.confirmed = true;
|
|
514
|
+
cancelledApplication = { programId: id, id: reconciliation.id, member: reconciliation.member };
|
|
515
|
+
}
|
|
516
|
+
if (failedFeedbackInvalidated && failedFeedback === failedCancellationFeedback) {
|
|
517
|
+
if (actionMessage === failedFeedback?.message) actionMessage = "";
|
|
518
|
+
failedCancellationFeedback = undefined;
|
|
519
|
+
}
|
|
520
|
+
if (cancellationFeedback && feedbackKnown && !sameCancelledStanding) {
|
|
521
|
+
if (actionMessage === cancellationFeedback) actionMessage = "";
|
|
522
|
+
cancellationFeedback = "";
|
|
523
|
+
}
|
|
524
|
+
standing = next;
|
|
525
|
+
const knownMember = owner ?? readIdentity;
|
|
526
|
+
standingContext = (visitorKnown || !!read || next !== "none") && knownMember ? { programId: id, member: knownMember } : undefined;
|
|
527
|
+
standingProgramId = next !== "none" ? id : "";
|
|
528
|
+
standingMember = next !== "none" ? owner : undefined;
|
|
529
|
+
pendingApplicationId = applicationId;
|
|
530
|
+
pendingProgramId = applicationId ? id : "";
|
|
531
|
+
pendingMember = applicationId ? owner : undefined;
|
|
532
|
+
return read;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
const isCancelledApplication = (application: WixJoinApplication | undefined, id: string): boolean =>
|
|
536
|
+
application?.id === id && ["CANCELED", "CANCELLED"].includes((application.status ?? "").toUpperCase());
|
|
537
|
+
|
|
538
|
+
/** Withdraws the member's pending join request, then re-reads the standing. */
|
|
539
|
+
async function cancelRequest(): Promise<undefined> {
|
|
540
|
+
const id = inputId();
|
|
541
|
+
const applicationId = pendingApplicationId;
|
|
542
|
+
const owner = pendingMember;
|
|
543
|
+
if (!id || pendingProgramId !== id || !applicationId || !owner || cancelInFlight || enrollmentInFlight) return undefined;
|
|
544
|
+
if (!connectivity().online) {
|
|
545
|
+
actionMessage = offlineWriteMessage;
|
|
546
|
+
void svc.pricingPublish();
|
|
547
|
+
return undefined;
|
|
548
|
+
}
|
|
549
|
+
cancelInFlight = true;
|
|
550
|
+
void svc.pricingPublish();
|
|
551
|
+
try {
|
|
552
|
+
await assertMemberAccess(owner);
|
|
553
|
+
if (id !== inputId()) return undefined;
|
|
554
|
+
const result = await cancelJoinApplication(applicationId);
|
|
555
|
+
const application = result.joinApplication;
|
|
556
|
+
const confirmed = isCancelledApplication(application, applicationId);
|
|
557
|
+
const reconciliation = { programId: id, id: applicationId, member: owner, afterSeq: standingSeq, confirmed };
|
|
558
|
+
cancellationReconciliation = reconciliation;
|
|
559
|
+
// The response confirms the initiating member's write even if the active account
|
|
560
|
+
// changed while it was in flight. Keep the scoped receipt before checking UI ownership.
|
|
561
|
+
if (confirmed) cancelledApplication = { programId: id, id: applicationId, member: owner };
|
|
562
|
+
await assertMemberAccess(owner);
|
|
563
|
+
if (id !== inputId()) return undefined;
|
|
564
|
+
let settledSeq = standingSeq + 1;
|
|
565
|
+
await loadStanding(id);
|
|
566
|
+
// A superseded read is not the end of reconciliation. Join newer refreshes
|
|
567
|
+
// until one settles or a scoped confirmation has already been retained.
|
|
568
|
+
for (;;) {
|
|
569
|
+
await assertMemberAccess(owner);
|
|
570
|
+
if (id !== inputId()) return undefined;
|
|
571
|
+
const latest = latestStandingRead;
|
|
572
|
+
if (reconciliation.confirmed || !latest || latest.programId !== id || latest.seq <= settledSeq) break;
|
|
573
|
+
await latest.promise;
|
|
574
|
+
settledSeq = latest.seq;
|
|
575
|
+
}
|
|
576
|
+
if (id === inputId()) {
|
|
577
|
+
const succeeded = reconciliation.confirmed;
|
|
578
|
+
actionMessage = succeeded ? copyParam("program.requestCancelledMessage", "Your join request was cancelled.")
|
|
579
|
+
: copyParam("program.cancelRequestFailedMessage", "The request could not be cancelled. Try again.");
|
|
580
|
+
cancellationFeedback = succeeded ? actionMessage : "";
|
|
581
|
+
failedCancellationFeedback = succeeded ? undefined : { programId: id, id: applicationId, member: owner, message: actionMessage };
|
|
582
|
+
}
|
|
583
|
+
} catch {
|
|
584
|
+
let stillOwner = false;
|
|
585
|
+
try { await assertMemberAccess(owner); stillOwner = true; } catch { /* no feedback for another member */ }
|
|
586
|
+
if (id === inputId()) {
|
|
587
|
+
if (stillOwner) {
|
|
588
|
+
actionMessage = copyParam("program.cancelRequestFailedMessage", "The request could not be cancelled. Try again.");
|
|
589
|
+
failedCancellationFeedback = { programId: id, id: applicationId, member: owner, message: actionMessage };
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
actionMessage = "";
|
|
593
|
+
cancellationFeedback = "";
|
|
594
|
+
failedCancellationFeedback = undefined;
|
|
595
|
+
await loadStanding(id);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
} finally {
|
|
599
|
+
cancellationReconciliation = undefined;
|
|
600
|
+
cancelInFlight = false;
|
|
601
|
+
void svc.pricingPublish();
|
|
602
|
+
}
|
|
603
|
+
return undefined;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/** First entry recovers held purchases; every later one (a return to the screen) reconciles. */
|
|
607
|
+
async function resumeCommerce(): Promise<void> {
|
|
608
|
+
const first = !commerceStarted;
|
|
609
|
+
commerceStarted = true;
|
|
610
|
+
await (first ? commerce.start() : commerce.reconcile());
|
|
611
|
+
void svc.pricingPublish();
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/** Content never waits on this, and the host scope is re-read each time, so a failed app-info
|
|
615
|
+
* read recovers on the next refresh. */
|
|
616
|
+
async function priceProgram(): Promise<void> {
|
|
617
|
+
if (!pricedItem) return;
|
|
618
|
+
await commerce.loadPrices([pricedItem]);
|
|
619
|
+
void svc.pricingPublish();
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
async function enroll(afterAuthAccount = "", targetId = inputId()): Promise<undefined> {
|
|
623
|
+
const id = targetId;
|
|
624
|
+
if (id !== inputId()) return undefined;
|
|
625
|
+
const reference = programReference();
|
|
626
|
+
const context = standingContext;
|
|
627
|
+
if (!reference || enrollmentInFlight || !standingForInput()) return undefined;
|
|
628
|
+
if (!connectivity().online) {
|
|
629
|
+
actionMessage = offlineWriteMessage;
|
|
630
|
+
void svc.pricingPublish();
|
|
631
|
+
return undefined;
|
|
632
|
+
}
|
|
633
|
+
if (!pricing.checkoutGuard(reference).allowed) {
|
|
634
|
+
actionMessage = pricing.checkoutGuard(reference).route === "resolving" ? "" : iapPriceCopy("program").purchaseUnavailable;
|
|
635
|
+
void svc.pricingPublish();
|
|
636
|
+
return undefined;
|
|
637
|
+
}
|
|
638
|
+
enrollmentInFlight = true;
|
|
639
|
+
void svc.pricingPublish();
|
|
640
|
+
try {
|
|
641
|
+
const member = await memberAccess();
|
|
642
|
+
if (!ownsStanding(context, member, id)) return undefined;
|
|
643
|
+
if (afterAuthAccount && member.email !== afterAuthAccount) return undefined;
|
|
644
|
+
if (!member.email) {
|
|
645
|
+
const request = await continuation("begin", id);
|
|
646
|
+
if (!ownsStanding(context, await memberAccess(), id)) {
|
|
647
|
+
if (request?.token) await continuation("cancel", id, request.token);
|
|
648
|
+
return undefined;
|
|
649
|
+
}
|
|
650
|
+
if (request?.supported !== true || !request.token) {
|
|
651
|
+
actionMessage = copyParam("program.signInUpdateRequired", "Update the app to sign in and continue enrollment.");
|
|
652
|
+
return undefined;
|
|
653
|
+
}
|
|
654
|
+
if (openedAuthToken === request.token) return undefined;
|
|
655
|
+
openedAuthToken = request.token;
|
|
656
|
+
actionMessage = "";
|
|
657
|
+
try {
|
|
658
|
+
await dispatch("himi.open", { screenId: "himi_sign_in", mode: "signin", presentation: signInPresentation, modal: "1", ...signInSheetStyle(signInPresentation, signInStyle), authContinuation: request.token });
|
|
659
|
+
} catch (error) {
|
|
660
|
+
openedAuthToken = "";
|
|
661
|
+
await continuation("cancel", id, request.token);
|
|
662
|
+
throw error;
|
|
663
|
+
}
|
|
664
|
+
return undefined;
|
|
665
|
+
}
|
|
666
|
+
await assertMemberAccess(member);
|
|
667
|
+
let rejoinParticipantId = "";
|
|
668
|
+
{
|
|
669
|
+
// Every join verifies current participation, including after a route change. A
|
|
670
|
+
// display snapshot never authorizes resuming an old admitted application.
|
|
671
|
+
const memberId = (await getMyMember()).member?.id;
|
|
672
|
+
if (!memberId) throw new Error("Current member unavailable");
|
|
673
|
+
const response = await searchMemberParticipation(id, memberId);
|
|
674
|
+
await assertMemberAccess(member);
|
|
675
|
+
if (id !== inputId()) return undefined;
|
|
676
|
+
if (!Array.isArray(response.participants)) throw new Error("Participation unavailable");
|
|
677
|
+
const participant = response.participants[0];
|
|
678
|
+
if (participant) {
|
|
679
|
+
if (participant.memberId !== memberId || participant.programId !== id) throw new Error("Participation identity changed");
|
|
680
|
+
// Withdrawal wins over old completion/failure progress, including AUTO_REMOVED.
|
|
681
|
+
if (!participationsByProgram([participant]).has(id)) {
|
|
682
|
+
if (!participant.id) throw new Error("Withdrawn participant identity unavailable");
|
|
683
|
+
rejoinParticipantId = participant.id;
|
|
684
|
+
} else {
|
|
685
|
+
const status = (participant.enrollmentStatus ?? "").toUpperCase();
|
|
686
|
+
const progress = (participant.progressStatus ?? "").toUpperCase();
|
|
687
|
+
if (status === "JOINED" || ["COMPLETED", "FAILED"].includes(progress)) {
|
|
688
|
+
actionMessage = ["COMPLETED", "FAILED"].includes(progress)
|
|
689
|
+
? copyTemplate("program.participationRecordedMessage", "Your participation in {name} is already recorded.", { name: content.name })
|
|
690
|
+
: copyTemplate("program.joinedMessage", "You're enrolled in {name}.", { name: content.name });
|
|
691
|
+
return undefined;
|
|
692
|
+
}
|
|
693
|
+
actionMessage = copyParam("program.participationUnavailable", "Your current participation cannot be enrolled again.");
|
|
694
|
+
return undefined;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
// joinProgram refreshes the current Join Application before creating anything. Its
|
|
699
|
+
// existing-participant/private/paid and pending-payment guards remain authoritative.
|
|
700
|
+
const message = await enrollmentMessage(id, content.name, {
|
|
701
|
+
withdrawnParticipantId: rejoinParticipantId || undefined,
|
|
702
|
+
assertMember: async () => {
|
|
703
|
+
await assertMemberAccess(member);
|
|
704
|
+
if (id !== inputId()) throw new Error("Program changed");
|
|
705
|
+
if (!connectivity().online) throw new Error(offlineWriteMessage);
|
|
706
|
+
},
|
|
707
|
+
mayStart: () => id === inputId() && pricing.checkoutGuard(reference).allowed,
|
|
708
|
+
mayContinue: () => id === inputId() && pricing.continueCheckoutGuard(reference).allowed,
|
|
709
|
+
});
|
|
710
|
+
if (id === inputId()) actionMessage = message;
|
|
711
|
+
} catch {
|
|
712
|
+
if (id === inputId()) actionMessage = copyTemplate("program.joinOnSiteMessage", "Enrolment happens on the website — visit the site to join {name}.", { name: content.name });
|
|
713
|
+
} finally {
|
|
714
|
+
enrollmentInFlight = false;
|
|
715
|
+
void svc.pricingPublish();
|
|
716
|
+
}
|
|
717
|
+
if (id === inputId()) {
|
|
718
|
+
await loadStanding(id);
|
|
719
|
+
void svc.pricingPublish();
|
|
720
|
+
}
|
|
721
|
+
return undefined;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/** The App Store sale: only through the shared checkout, and only for the route the price shows. */
|
|
725
|
+
async function buy(): Promise<undefined> {
|
|
726
|
+
const id = inputId();
|
|
727
|
+
const reference = programReference();
|
|
728
|
+
const context = standingContext;
|
|
729
|
+
if (!reference || !standingForInput()) return undefined;
|
|
730
|
+
if (!ownsStanding(context, await memberAccess(), id)) return undefined;
|
|
731
|
+
await commerce.buy({ reference });
|
|
732
|
+
void svc.pricingPublish();
|
|
733
|
+
return undefined;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
const canEnrol = (value: Standing): boolean => !programEnded && ((value === "none" && !programSecret) || value === "approved");
|
|
737
|
+
|
|
738
|
+
function enrollLabelFor(value: Standing): string {
|
|
739
|
+
return value === "approved" ? copyParam("memberPrograms.action.pay", "Complete payment")
|
|
740
|
+
: programPrivate ? copyParam("memberPrograms.action.request", "Request to join")
|
|
741
|
+
: copyParam("program.enrolCta", "Enrol");
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
function pricedState(state: State): State {
|
|
745
|
+
const reference = programReference();
|
|
746
|
+
const view = reference && pricing.view(reference);
|
|
747
|
+
const price = view ? iapPriceFields(view, iapPriceCopy("program")) : NO_PRICE;
|
|
748
|
+
const purchase = reference ? commerce.purchaseFields(reference, iapPurchaseCopy("program")) : NOT_APPLE;
|
|
749
|
+
const poll = commerce.pollDirective("himiBrandedProgram.iapPoll");
|
|
750
|
+
return derive({
|
|
751
|
+
...state, ...content,
|
|
752
|
+
actionMessage: purchase.accessReady ? copyTemplate("program.joinedMessage", "You're enrolled in {name}.", { name: content.name }) : actionMessage,
|
|
753
|
+
// `disabled`: this app sells nothing through the App Store, so the program shows its own price.
|
|
754
|
+
priceLine: view?.route === "disabled" ? pricedItem?.commerceDisplayPrice ?? "" : price.priceText, priceNote: price.priceNote, hidePriceRetry: view?.route === "disabled" || (price.hidePriceRetry && commerce.scopeComplete()),
|
|
755
|
+
enrollDisabled: !standingForInput() || price.actionDisabled || enrollmentInFlight || cancelInFlight, enrollNote: price.actionNote,
|
|
756
|
+
// A member who has joined, asked to join or been invited has nothing to enrol in: the standing line
|
|
757
|
+
// says where they are. Only a new member, or one whose payment is owed, sees the CTA.
|
|
758
|
+
enrollHidden: purchase.appleRoute || !canEnrol(standing), enrollLabel: enrollLabelFor(standing),
|
|
759
|
+
standingLine: standing === "none" ? "" : copyParam(STATUS[standing].key, STATUS[standing].fallback),
|
|
760
|
+
cancelHidden: standing !== "pending" || !pendingApplicationId, cancelLabel: copyParam("program.cancelRequestCta", "Cancel request"),
|
|
761
|
+
cancelDisabled: cancelInFlight || enrollmentInFlight,
|
|
762
|
+
confirmedCancellation: cancelledApplication ?? null,
|
|
763
|
+
cancellationFeedback,
|
|
764
|
+
buyHidden: !purchase.appleRoute || purchase.accessReady || !canEnrol(standing), buyLabel: purchase.buyLabel, buyDisabled: !standingForInput() || purchase.buyDisabled, buyNote: purchase.buyNote,
|
|
765
|
+
...(poll ? { _poll: poll } : {}),
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
const INITIAL_STATE: State = derive({
|
|
770
|
+
status: "loading",
|
|
771
|
+
actionMessage: "",
|
|
772
|
+
name: "",
|
|
773
|
+
description: "",
|
|
774
|
+
descriptionJson: "",
|
|
775
|
+
hasDescriptionJson: false,
|
|
776
|
+
meta: "",
|
|
777
|
+
facts: [],
|
|
778
|
+
hideFacts: true,
|
|
779
|
+
priceLine: "",
|
|
780
|
+
image: "",
|
|
781
|
+
initial: "",
|
|
782
|
+
emptyText: copyParam("program.emptyText", "This program is no longer available."),
|
|
783
|
+
isLoading: true,
|
|
784
|
+
notLoading: false,
|
|
785
|
+
isErrored: false,
|
|
786
|
+
notErrored: true,
|
|
787
|
+
noEmpty: true,
|
|
788
|
+
hasImage: false,
|
|
789
|
+
noImage: true,
|
|
790
|
+
hideContent: true,
|
|
791
|
+
priceNote: "",
|
|
792
|
+
hidePriceRetry: true,
|
|
793
|
+
enrollDisabled: true,
|
|
794
|
+
enrollNote: "",
|
|
795
|
+
enrollHidden: false,
|
|
796
|
+
enrollLabel: copyParam("program.enrolCta", "Enrol"),
|
|
797
|
+
standingLine: "",
|
|
798
|
+
cancelHidden: true,
|
|
799
|
+
cancelDisabled: false,
|
|
800
|
+
cancelLabel: copyParam("program.cancelRequestCta", "Cancel request"),
|
|
801
|
+
confirmedCancellation: null,
|
|
802
|
+
cancellationFeedback: "",
|
|
803
|
+
buyHidden: true,
|
|
804
|
+
buyLabel: "",
|
|
805
|
+
buyDisabled: true,
|
|
806
|
+
buyNote: "",
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
type Actions = {
|
|
810
|
+
openLink: (state: State, arg?: unknown) => Promise<undefined>;
|
|
811
|
+
load: (state: State, arg?: unknown) => Promise<State | undefined>;
|
|
812
|
+
enroll: (state: State) => Promise<State | undefined>;
|
|
813
|
+
cancelRequest: (state: State) => Promise<State | undefined>;
|
|
814
|
+
buy: (state: State) => Promise<State | undefined>;
|
|
815
|
+
pricingPublish: (state: State) => State;
|
|
816
|
+
pricingStart: (state: State) => State;
|
|
817
|
+
pricingRefresh: (state: State) => Promise<undefined>;
|
|
818
|
+
iapPoll: (state: State) => Promise<undefined>;
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
const defineService = withOnlineWrites(registerService, ["enroll","cancelRequest","buy"], { derive, messageFields: ["actionMessage"] });
|
|
822
|
+
const svc = defineService<State, Actions>("himiBrandedProgram", {
|
|
823
|
+
state: INITIAL_STATE,
|
|
824
|
+
notHydrated: [...PRICING_NOT_HYDRATED],
|
|
825
|
+
actions: {
|
|
826
|
+
load,
|
|
827
|
+
enroll: () => enroll(),
|
|
828
|
+
cancelRequest,
|
|
829
|
+
buy,
|
|
830
|
+
pricingPublish: pricedState,
|
|
831
|
+
openLink: async (_state, arg) => { await openRichLink(arg); return undefined; },
|
|
832
|
+
pricingStart: pricedState,
|
|
833
|
+
pricingRefresh: async () => { await priceProgram(); return undefined; },
|
|
834
|
+
iapPoll: async () => { await commerce.poll(); void svc.pricingPublish(); return undefined; },
|
|
835
|
+
},
|
|
836
|
+
});
|
|
837
|
+
|
|
838
|
+
content = contentOf(svc.getState());
|
|
839
|
+
cancelledApplication = svc.getState().confirmedCancellation ?? undefined;
|
|
840
|
+
cancellationFeedback = svc.getState().cancellationFeedback ?? "";
|
|
841
|
+
if (svc.getState().actionMessage === cancellationFeedback) actionMessage = cancellationFeedback;
|
|
842
|
+
resetUnhydratedKeysOnOlderRuntime(svc, INITIAL_STATE, PRICING_NOT_HYDRATED);
|
|
843
|
+
void svc.pricingStart();
|
|
844
|
+
|
|
845
|
+
export { svc };
|