@wix/himalaya-cli 0.1569.0 → 0.1571.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 (159) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/l10n-strings.d.ts +3 -2
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +8 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/index.d.ts +7 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/business-contact-service.d.ts +17 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/business-contact.d.ts +73 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +3 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/invite-target.d.ts +1 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/invite.d.ts +148 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/blog-v3/src/extensions.d.ts +6 -3
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/auth.mjs +17 -7
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core/validation.mjs +17 -7
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +17 -7
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +575 -91
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/state.mjs +17 -7
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth.mjs +7 -1
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-blog.mjs +1 -0
  17. package/dist/cli.mjs +1897 -1226
  18. package/dist/preview-assets.generated.bin +0 -0
  19. package/guides/base44-app-to-himi-app.md +1 -1
  20. package/guides/capabilities.md +7 -0
  21. package/guides/getting-started.md +5 -0
  22. package/guides/himi-json-output.md +11 -0
  23. package/guides/himi-skill.md +5 -0
  24. package/guides/one-app-to-himi-app.md +267 -8
  25. package/guides/sdk-reference.json +2 -2
  26. package/guides/skill.md +5 -0
  27. package/guides/splash-screens.md +10 -1
  28. package/guides/tier-5-add-a-screen.md +20 -0
  29. package/guides/trim-a-template.md +5 -0
  30. package/guides/wix-business-context.md +11 -2
  31. package/package.json +2 -2
  32. package/templates/beauty-salon/config.ts +8 -1
  33. package/templates/beauty-salon/dev/index.ts +244 -1
  34. package/templates/beauty-salon/himalaya.content.json +3 -0
  35. package/templates/beauty-salon/tier5-src/_shared/member-read.ts +52 -0
  36. package/templates/beauty-salon/tier5-src/_shared/program-description.ts +11 -0
  37. package/templates/beauty-salon/tier5-src/business-contact/index.ts +6 -0
  38. package/templates/beauty-salon/tier5-src/himi-blog-post/index.ts +35 -12
  39. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +3 -3
  40. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +6 -9
  41. package/templates/beauty-salon-owner/config.ts +1 -1
  42. package/templates/branded-lite/config.ts +8 -1
  43. package/templates/branded-lite/dev/index.ts +409 -2
  44. package/templates/branded-lite/himalaya.content.json +3 -0
  45. package/templates/branded-lite/tier5-src/_shared/member-read.ts +52 -0
  46. package/templates/branded-lite/tier5-src/_shared/program-description.ts +11 -0
  47. package/templates/branded-lite/tier5-src/business-contact/index.ts +6 -0
  48. package/templates/branded-lite/tier5-src/himi-blog-post/index.ts +35 -12
  49. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +3 -3
  50. package/templates/branded-lite/tier5-src/himi-branded-lite-notifsettings/index.ts +39 -11
  51. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +16 -14
  52. package/templates/branded-lite/tier5-src/himi-branded-lite-programs/index.ts +3 -7
  53. package/templates/branded-lite/tier5-src/himi-events-my-events/index.ts +76 -42
  54. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +6 -9
  55. package/templates/branded-lite/tier5-src/wix-spaces-chat-thread/index.ts +101 -34
  56. package/templates/branded-lite/tier5-src/wix-spaces-forum-post/index.ts +23 -6
  57. package/templates/branded-lite/tier5-src/wix-spaces-member-detail/index.ts +26 -11
  58. package/templates/community-club/config.ts +8 -1
  59. package/templates/community-club/dev/index.ts +278 -2
  60. package/templates/community-club/himalaya.content.json +3 -0
  61. package/templates/community-club/tier5-src/_shared/branded-load-state.ts +106 -0
  62. package/templates/community-club/tier5-src/_shared/member-read.ts +52 -0
  63. package/templates/community-club/tier5-src/_shared/program-description.ts +11 -0
  64. package/templates/community-club/tier5-src/business-contact/index.ts +6 -0
  65. package/templates/community-club/tier5-src/himi-blog-post/index.ts +35 -12
  66. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +3 -3
  67. package/templates/community-club/tier5-src/himi-events-my-events/index.ts +76 -42
  68. package/templates/community-club-owner/config.ts +1 -1
  69. package/templates/events-meetups/config.ts +8 -1
  70. package/templates/events-meetups/dev/index.ts +278 -2
  71. package/templates/events-meetups/himalaya.content.json +3 -0
  72. package/templates/events-meetups/tier5-src/_shared/branded-load-state.ts +106 -0
  73. package/templates/events-meetups/tier5-src/_shared/member-read.ts +52 -0
  74. package/templates/events-meetups/tier5-src/_shared/program-description.ts +11 -0
  75. package/templates/events-meetups/tier5-src/business-contact/index.ts +6 -0
  76. package/templates/events-meetups/tier5-src/himi-blog-post/index.ts +35 -12
  77. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +3 -3
  78. package/templates/events-meetups/tier5-src/himi-events-my-events/index.ts +76 -42
  79. package/templates/events-meetups-owner/config.ts +1 -1
  80. package/templates/gym-fitness/config.ts +8 -1
  81. package/templates/gym-fitness/dev/index.ts +278 -2
  82. package/templates/gym-fitness/himalaya.content.json +3 -0
  83. package/templates/gym-fitness/tier5-src/_shared/member-read.ts +52 -0
  84. package/templates/gym-fitness/tier5-src/_shared/program-description.ts +11 -0
  85. package/templates/gym-fitness/tier5-src/business-contact/index.ts +6 -0
  86. package/templates/gym-fitness/tier5-src/himi-blog-post/index.ts +35 -12
  87. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +3 -3
  88. package/templates/gym-fitness/tier5-src/himi-events-my-events/index.ts +76 -42
  89. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +6 -9
  90. package/templates/gym-fitness-owner/config.ts +1 -1
  91. package/templates/nonprofit-cause/config.ts +8 -1
  92. package/templates/nonprofit-cause/dev/index.ts +278 -2
  93. package/templates/nonprofit-cause/himalaya.content.json +3 -0
  94. package/templates/nonprofit-cause/tier5-src/_shared/branded-load-state.ts +106 -0
  95. package/templates/nonprofit-cause/tier5-src/_shared/member-read.ts +52 -0
  96. package/templates/nonprofit-cause/tier5-src/_shared/program-description.ts +11 -0
  97. package/templates/nonprofit-cause/tier5-src/business-contact/index.ts +6 -0
  98. package/templates/nonprofit-cause/tier5-src/himi-blog-post/index.ts +35 -12
  99. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +3 -3
  100. package/templates/nonprofit-cause/tier5-src/himi-events-my-events/index.ts +76 -42
  101. package/templates/nonprofit-cause-owner/config.ts +1 -1
  102. package/templates/owner-lite/config.ts +1 -1
  103. package/templates/podcast-creator/config.ts +8 -1
  104. package/templates/podcast-creator/dev/index.ts +278 -2
  105. package/templates/podcast-creator/himalaya.content.json +3 -0
  106. package/templates/podcast-creator/tier5-src/_shared/branded-load-state.ts +106 -0
  107. package/templates/podcast-creator/tier5-src/_shared/member-read.ts +52 -0
  108. package/templates/podcast-creator/tier5-src/_shared/program-description.ts +11 -0
  109. package/templates/podcast-creator/tier5-src/business-contact/index.ts +6 -0
  110. package/templates/podcast-creator/tier5-src/himi-blog-post/index.ts +35 -12
  111. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +3 -3
  112. package/templates/podcast-creator/tier5-src/himi-events-my-events/index.ts +76 -42
  113. package/templates/podcast-creator-owner/config.ts +1 -1
  114. package/templates/portfolio-creative/config.ts +8 -1
  115. package/templates/portfolio-creative/dev/index.ts +278 -2
  116. package/templates/portfolio-creative/himalaya.content.json +3 -0
  117. package/templates/portfolio-creative/tier5-src/_shared/branded-load-state.ts +106 -0
  118. package/templates/portfolio-creative/tier5-src/_shared/member-read.ts +52 -0
  119. package/templates/portfolio-creative/tier5-src/_shared/program-description.ts +11 -0
  120. package/templates/portfolio-creative/tier5-src/business-contact/index.ts +6 -0
  121. package/templates/portfolio-creative/tier5-src/himi-blog-post/index.ts +35 -12
  122. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +3 -3
  123. package/templates/portfolio-creative/tier5-src/himi-events-my-events/index.ts +76 -42
  124. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +6 -9
  125. package/templates/portfolio-creative-owner/config.ts +1 -1
  126. package/templates/restaurant/config.ts +8 -1
  127. package/templates/restaurant/dev/index.ts +278 -2
  128. package/templates/restaurant/himalaya.content.json +3 -0
  129. package/templates/restaurant/tier5-src/_shared/branded-load-state.ts +106 -0
  130. package/templates/restaurant/tier5-src/_shared/member-read.ts +52 -0
  131. package/templates/restaurant/tier5-src/_shared/program-description.ts +11 -0
  132. package/templates/restaurant/tier5-src/business-contact/index.ts +6 -0
  133. package/templates/restaurant/tier5-src/himi-blog-post/index.ts +35 -12
  134. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +3 -3
  135. package/templates/restaurant/tier5-src/himi-events-my-events/index.ts +76 -42
  136. package/templates/restaurant-owner/config.ts +1 -1
  137. package/templates/retail-store/config.ts +8 -1
  138. package/templates/retail-store/dev/index.ts +244 -1
  139. package/templates/retail-store/himalaya.content.json +3 -0
  140. package/templates/retail-store/tier5-src/_shared/branded-load-state.ts +106 -0
  141. package/templates/retail-store/tier5-src/_shared/member-read.ts +52 -0
  142. package/templates/retail-store/tier5-src/_shared/program-description.ts +11 -0
  143. package/templates/retail-store/tier5-src/business-contact/index.ts +6 -0
  144. package/templates/retail-store/tier5-src/himi-blog-post/index.ts +35 -12
  145. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +3 -3
  146. package/templates/retail-store/tier5-src/himi-store-product/index.ts +6 -9
  147. package/templates/retail-store-owner/config.ts +1 -1
  148. package/templates/yoga-studio/config.ts +8 -1
  149. package/templates/yoga-studio/dev/index.ts +306 -2
  150. package/templates/yoga-studio/himalaya.content.json +3 -0
  151. package/templates/yoga-studio/tier5-src/_shared/member-read.ts +52 -0
  152. package/templates/yoga-studio/tier5-src/_shared/program-description.ts +11 -0
  153. package/templates/yoga-studio/tier5-src/business-contact/index.ts +6 -0
  154. package/templates/yoga-studio/tier5-src/himi-blog-post/index.ts +35 -12
  155. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +3 -3
  156. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +16 -14
  157. package/templates/yoga-studio/tier5-src/himi-branded-lite-programs/index.ts +3 -7
  158. package/templates/yoga-studio/tier5-src/himi-events-my-events/index.ts +76 -42
  159. package/templates/yoga-studio-owner/config.ts +1 -1
@@ -74,6 +74,21 @@ function matchesType(type, value) {
74
74
  return true;
75
75
  }
76
76
  }
77
+ var AUTHORED_PATTERN_LIMIT = 64;
78
+ var authoredPatterns = /* @__PURE__ */ new Map();
79
+ function authoredPattern(pattern) {
80
+ const known = authoredPatterns.get(pattern);
81
+ if (known !== void 0) return known;
82
+ let re;
83
+ try {
84
+ re = new RegExp(`^(?:${pattern})$`);
85
+ } catch {
86
+ re = null;
87
+ }
88
+ if (authoredPatterns.size >= AUTHORED_PATTERN_LIMIT) authoredPatterns.delete(authoredPatterns.keys().next().value);
89
+ authoredPatterns.set(pattern, re);
90
+ return re;
91
+ }
77
92
  function validate(rule, rawValue) {
78
93
  if (!rule) return null;
79
94
  const value = rawValue ?? "";
@@ -84,13 +99,8 @@ function validate(rule, rawValue) {
84
99
  return { rule: "type", type: rule.type };
85
100
  }
86
101
  if (rule.regex) {
87
- let ok;
88
- try {
89
- ok = new RegExp(`^(?:${rule.regex})$`).test(value);
90
- } catch {
91
- ok = true;
92
- }
93
- if (!ok) return { rule: "regex" };
102
+ const re = authoredPattern(rule.regex);
103
+ if (re && !re.test(value)) return { rule: "regex" };
94
104
  }
95
105
  if (typeof rule.minLength === "number" && rule.minLength > 0 && value.length < rule.minLength) {
96
106
  return { rule: "minLength", limit: rule.minLength };
@@ -126,6 +136,221 @@ function defineService(name, def) {
126
136
  return himalaya.defineService(name, def);
127
137
  }
128
138
 
139
+ // ../../stdlib/flows/screens/src/business-contact.ts
140
+ var node = (id2, type, props) => ({ id: id2, body: { package: "himalaya", type, props } });
141
+ var clean = (value) => typeof value === "string" ? value.trim() : "";
142
+ function businessContactSettings(source = {}) {
143
+ const defaults = {
144
+ isDescriptionVisible: true,
145
+ isGetInTouchVisible: true,
146
+ isPhoneVisible: true,
147
+ isWebSiteLinkVisible: true,
148
+ isAddressVisible: true
149
+ };
150
+ const empty = Object.keys(source).every((key) => key === "isBusinessProfile");
151
+ if (source.isBusinessProfile) return {
152
+ ...empty ? defaults : {},
153
+ ...source,
154
+ showMap: true,
155
+ isDescriptionVisible: false
156
+ };
157
+ return empty ? defaults : { ...source };
158
+ }
159
+ function businessContactPoint(contact) {
160
+ const p = contact.coordinates;
161
+ return contact.isPhysical !== false && p && typeof p.latitude === "number" && Number.isFinite(p.latitude) && Math.abs(p.latitude) <= 90 && typeof p.longitude === "number" && Number.isFinite(p.longitude) && Math.abs(p.longitude) <= 180 ? { latitude: p.latitude, longitude: p.longitude } : void 0;
162
+ }
163
+ function businessContactLink(kind, value) {
164
+ const text3 = clean(value);
165
+ if (!text3 || /[\u0000-\u001f\u007f]/.test(text3)) return "";
166
+ switch (kind) {
167
+ case "website":
168
+ return /^https?:\/\/[^\s/@]+(?:[/:?#]|$)/i.test(text3) && !/\s/.test(text3) && !/^https?:\/\/[^/]*@/i.test(text3) ? text3 : "";
169
+ case "phone":
170
+ return /^\+?[\d ()\-.]+$/.test(text3) && /\d/.test(text3) ? `tel:${text3.replace(/[ ()\-.]/g, "")}` : "";
171
+ case "email":
172
+ return /^[^\s@?&#]+@[^\s@?&#]+\.[^\s@?&#]+$/.test(text3) ? `mailto:${encodeURIComponent(text3)}` : "";
173
+ case "directions":
174
+ return `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(text3)}`;
175
+ default:
176
+ return "";
177
+ }
178
+ }
179
+ function businessContactSection(opts = {}) {
180
+ const id2 = opts.id ?? "business_contact";
181
+ const contact = opts.contact ?? {};
182
+ const settings = businessContactSettings(opts.settings);
183
+ const copy = { title: "Get in touch", message: "Message", directions: "Directions", unavailable: "Contact details unavailable", memberCountUnavailable: "Member count unavailable", member: "member", members: "members", ...opts.copy };
184
+ const service = opts.service ?? "businessContact";
185
+ const children = [];
186
+ const text3 = (key, value, style = "body") => node(`${id2}.${key}`, "Text", { text: value, style, collapseWhenEmpty: true });
187
+ const link = (key, label, value) => {
188
+ if (businessContactLink(key, value)) children.push(node(`${id2}.${key}`, "Button", {
189
+ title: label,
190
+ style: "secondary",
191
+ fullWidth: true,
192
+ action: { actionId: `tier5.${service}.open`, params: { kind: key, value, failureLabel: copy.unavailable } }
193
+ }));
194
+ };
195
+ if (settings.isDescriptionVisible && clean(contact.description)) children.push(text3("description", clean(contact.description)));
196
+ if (settings.isGetInTouchVisible && opts.chatScreenId) {
197
+ children.push(text3("title", clean(settings.getInTouchTitle) || copy.title, "title3"));
198
+ if (clean(settings.getInTouchDescription)) children.push(text3("subtitle", clean(settings.getInTouchDescription)));
199
+ children.push(node(`${id2}.message`, "Button", {
200
+ title: clean(settings.getInTouchButton) || copy.message,
201
+ style: "primary",
202
+ fullWidth: true,
203
+ action: { actionId: "himi.open", params: { screenId: opts.chatScreenId } }
204
+ }));
205
+ }
206
+ if (settings.isPhoneVisible) link("phone", clean(contact.phone), clean(contact.phone));
207
+ if (settings.isWebSiteLinkVisible) link("website", clean(contact.website), clean(contact.website));
208
+ if (settings.isEmailVisible === true) link("email", clean(contact.email), clean(contact.email));
209
+ if (settings.isAddressVisible) {
210
+ const address = clean(contact.address);
211
+ if (address) children.push(text3("address", address));
212
+ const point = businessContactPoint(contact);
213
+ if (settings.showMap && point) children.push(node(`${id2}.map`, "Map", {
214
+ ...point,
215
+ height: 180,
216
+ zoom: 14,
217
+ interactive: false,
218
+ markers: [{ id: `${id2}.location`, ...point, ...address ? { label: address } : {} }]
219
+ }));
220
+ if (address && contact.isPhysical !== false) link("directions", copy.directions, address);
221
+ }
222
+ const hasContent = children.length > 0;
223
+ if (!(settings.isAddressVisible && clean(contact.address) && contact.isPhysical !== false)) {
224
+ children.push({ ...text3("directions_copy", copy.directions), modifiers: { hidden: true } });
225
+ }
226
+ const unavailable2 = text3("unavailable", copy.unavailable);
227
+ if (hasContent) unavailable2.modifiers = { hidden: true };
228
+ children.push(unavailable2);
229
+ if (opts.showMemberCount !== void 0) {
230
+ const ready = (key, unit) => node(`${id2}.members_${key}`, "HStack", {
231
+ spacing: 4,
232
+ alignment: "center",
233
+ children: [
234
+ text3(`count_${key}`, `$service:${service}.memberCount`, "footnote"),
235
+ text3(`unit_${key}`, unit, "footnote")
236
+ ]
237
+ });
238
+ const count = node(`${id2}.member_count`, "FragmentSlot", {
239
+ casePath: `$service:${service}.memberCountCase`,
240
+ defaultCase: "unavailable",
241
+ cases: [
242
+ { id: "one", content: ready("one", copy.member) },
243
+ { id: "other", content: ready("other", copy.members) },
244
+ { id: "unavailable", content: text3("members_unavailable", copy.memberCountUnavailable, "footnote") }
245
+ ]
246
+ });
247
+ if (opts.showMemberCount === false) count.modifiers = { hidden: true };
248
+ children.push(count);
249
+ }
250
+ children.push(text3("feedback", `$service:${service}.message`, "footnote"));
251
+ return node(id2, "VStack", { spacing: 12, alignment: "leading", children });
252
+ }
253
+
254
+ // ../../core/sdk/dispatch/src/index.ts
255
+ function dispatch(handlerId, params, _options) {
256
+ const himalaya = globalThis.himalaya;
257
+ if (!himalaya) {
258
+ return Promise.reject(
259
+ new Error("@himalaya/dispatch: called outside a Himalaya runtime. This bundle must run inside a JSWorker (Tier 5).")
260
+ );
261
+ }
262
+ const stringParams = {};
263
+ if (params) {
264
+ for (const [k, v] of Object.entries(params)) stringParams[k] = String(v);
265
+ }
266
+ return himalaya.dispatch(handlerId, stringParams);
267
+ }
268
+
269
+ // ../../core/sdk/open-url/src/index.ts
270
+ function defaultMode(url) {
271
+ return /^https?:/i.test(url) ? "in_app_browser" : "external_app";
272
+ }
273
+ async function open(url, mode) {
274
+ if (!url) return { opened: false };
275
+ const r = await dispatch("capability.open_url.open", { url, mode: mode ?? defaultMode(url) });
276
+ return { opened: r?.opened === true };
277
+ }
278
+
279
+ // ../../stdlib/flows/screens/src/business-contact-service.ts
280
+ function createBusinessContactService(opts = {}) {
281
+ const initialState = { message: "", memberCount: null, countStatus: "unrequested", memberCountCase: "unavailable" };
282
+ const currentState = () => svc.getState();
283
+ let loadGeneration = 0;
284
+ let openGeneration = 0;
285
+ const svc = defineService(opts.service ?? "businessContact", {
286
+ state: initialState,
287
+ notHydrated: ["message"],
288
+ perVisit: ["message"],
289
+ actions: {
290
+ load: async (state, arg) => {
291
+ const generation = ++loadGeneration;
292
+ const next = () => {
293
+ const current = currentState();
294
+ return { ...current, message: current === state ? "" : current.message };
295
+ };
296
+ if (arg?.showMemberCount !== true) return { ...next(), memberCount: null, countStatus: "unrequested", memberCountCase: "unavailable" };
297
+ try {
298
+ const count = opts.loadMemberCount ? await opts.loadMemberCount() : arg.memberCount;
299
+ if (generation !== loadGeneration) return currentState();
300
+ if (typeof count !== "number" || !Number.isSafeInteger(count) || count < 0) {
301
+ return { ...next(), memberCount: null, countStatus: "unavailable", memberCountCase: "unavailable" };
302
+ }
303
+ return { ...next(), memberCount: count, countStatus: "ready", memberCountCase: count === 1 ? "one" : "other" };
304
+ } catch {
305
+ if (generation !== loadGeneration) return currentState();
306
+ return { ...next(), memberCount: null, countStatus: "error", memberCountCase: "unavailable" };
307
+ }
308
+ },
309
+ open: async (state, arg) => {
310
+ const generation = ++openGeneration;
311
+ const url = businessContactLink(arg?.kind ?? "", arg?.value);
312
+ if (!url) return { ...currentState(), message: arg?.failureLabel || "This contact link is unavailable." };
313
+ try {
314
+ const result = await open(url, arg?.kind === "phone" || arg?.kind === "email" ? "external_app" : "system_browser");
315
+ if (generation !== openGeneration) return currentState();
316
+ return { ...currentState(), message: result.opened ? "" : arg?.failureLabel || "This contact link could not be opened." };
317
+ } catch {
318
+ if (generation !== openGeneration) return currentState();
319
+ return { ...currentState(), message: arg?.failureLabel || "This contact link could not be opened." };
320
+ }
321
+ }
322
+ }
323
+ });
324
+ return svc;
325
+ }
326
+
327
+ // ../../core/sdk/app-info/src/index.ts
328
+ var PLATFORMS = ["ios", "android", "macos", "web", "react-native"];
329
+ function str(v) {
330
+ return typeof v === "string" ? v.trim() : "";
331
+ }
332
+ async function get() {
333
+ const r = await dispatch("capability.app_info.get");
334
+ const platform = str(r?.platform);
335
+ const releaseId = str(r?.releaseId);
336
+ const serveBaseUrl = str(r?.serveBaseUrl);
337
+ return {
338
+ appId: str(r?.appId),
339
+ bundleId: str(r?.bundleId),
340
+ version: str(r?.version),
341
+ buildNumber: str(r?.buildNumber),
342
+ binaryVersion: str(r?.binaryVersion),
343
+ releaseId: releaseId || null,
344
+ releasePinned: r?.releasePinned === true,
345
+ // Trust the host's own answer; fall back to inferring from whether a serve origin is set.
346
+ environment: str(r?.environment) === "prod" ? "prod" : serveBaseUrl ? "prod" : "dev",
347
+ serveBaseUrl: serveBaseUrl || null,
348
+ platform: PLATFORMS.includes(platform) ? platform : "unknown",
349
+ memberSiteBound: r?.memberSiteBound === true,
350
+ oneAppInviteAvailable: r?.oneAppInviteAvailable === true
351
+ };
352
+ }
353
+
129
354
  // ../../stdlib/flows/auth/src/copy.generated.ts
130
355
  var copy_generated_default = {
131
356
  "auth.gate.title": "Welcome",
@@ -308,7 +533,7 @@ function identityErrors(input, operation, requireName = false) {
308
533
  }
309
534
 
310
535
  // ../../stdlib/flows/auth/src/index.ts
311
- async function dispatch(handlerId, params) {
536
+ async function dispatch2(handlerId, params) {
312
537
  const fn = globalThis.himalaya?.dispatch;
313
538
  if (!fn) throw new Error("@himalaya/auth: host did not install the dispatch bridge");
314
539
  return await fn(handlerId, params);
@@ -328,7 +553,7 @@ function reportedOk(raw) {
328
553
  }
329
554
  async function authState(opts) {
330
555
  try {
331
- const raw = await dispatch(id(opts, "memberIdentity"));
556
+ const raw = await dispatch2(id(opts, "memberIdentity"));
332
557
  if (!reportedOk(raw)) return { signedIn: false, email: "" };
333
558
  const email = emailOf(raw);
334
559
  return { signedIn: !!email, email };
@@ -339,7 +564,7 @@ async function authState(opts) {
339
564
  async function attempt(action2, params, failureText, opts) {
340
565
  let raw;
341
566
  try {
342
- raw = await dispatch(id(opts, action2), params);
567
+ raw = await dispatch2(id(opts, action2), params);
343
568
  } catch (e) {
344
569
  return { ok: false, ...authFailure(e, action2 === "registerDirect" ? "register" : "signIn") };
345
570
  }
@@ -379,25 +604,311 @@ function registerMember(email, password, profile, opts) {
379
604
  }
380
605
  async function signOut(opts) {
381
606
  try {
382
- await dispatch(id(opts, "signOut"));
607
+ await dispatch2(id(opts, "signOut"));
383
608
  } catch {
384
609
  }
385
610
  return !(await authState(opts)).signedIn;
386
611
  }
387
612
 
388
- // ../../core/sdk/dispatch/src/index.ts
389
- function dispatch2(handlerId, params, _options) {
390
- const himalaya = globalThis.himalaya;
391
- if (!himalaya) {
392
- return Promise.reject(
393
- new Error("@himalaya/dispatch: called outside a Himalaya runtime. This bundle must run inside a JSWorker (Tier 5).")
394
- );
613
+ // ../../core/sdk/share/src/index.ts
614
+ async function share(options) {
615
+ const params = {};
616
+ if (options.text) params.text = options.text;
617
+ if (options.url) params.url = options.url;
618
+ if (options.subject) params.subject = options.subject;
619
+ if (options.files && options.files.length > 0) {
620
+ params.files = JSON.stringify(options.files.map((f) => f.uri));
621
+ if (options.files.some((f) => f.ownerScope)) {
622
+ params.fileOwners = JSON.stringify(options.files.map((f) => f.ownerScope ?? ""));
623
+ }
395
624
  }
396
- const stringParams = {};
397
- if (params) {
398
- for (const [k, v] of Object.entries(params)) stringParams[k] = String(v);
625
+ const r = await dispatch("capability.share.share", params);
626
+ return { completed: r?.completed === true };
627
+ }
628
+ async function availability() {
629
+ const r = await dispatch("capability.share.availability");
630
+ return r?.availability ?? "full";
631
+ }
632
+
633
+ // ../../stdlib/flows/screens/src/invite-target.ts
634
+ function inviteTarget(identity) {
635
+ const bytes = [];
636
+ for (let i = 0; i < identity.length; i++) {
637
+ const unit = identity.charCodeAt(i);
638
+ bytes.push(unit & 255, unit >>> 8);
639
+ }
640
+ const K = [
641
+ 1116352408,
642
+ 1899447441,
643
+ 3049323471,
644
+ 3921009573,
645
+ 961987163,
646
+ 1508970993,
647
+ 2453635748,
648
+ 2870763221,
649
+ 3624381080,
650
+ 310598401,
651
+ 607225278,
652
+ 1426881987,
653
+ 1925078388,
654
+ 2162078206,
655
+ 2614888103,
656
+ 3248222580,
657
+ 3835390401,
658
+ 4022224774,
659
+ 264347078,
660
+ 604807628,
661
+ 770255983,
662
+ 1249150122,
663
+ 1555081692,
664
+ 1996064986,
665
+ 2554220882,
666
+ 2821834349,
667
+ 2952996808,
668
+ 3210313671,
669
+ 3336571891,
670
+ 3584528711,
671
+ 113926993,
672
+ 338241895,
673
+ 666307205,
674
+ 773529912,
675
+ 1294757372,
676
+ 1396182291,
677
+ 1695183700,
678
+ 1986661051,
679
+ 2177026350,
680
+ 2456956037,
681
+ 2730485921,
682
+ 2820302411,
683
+ 3259730800,
684
+ 3345764771,
685
+ 3516065817,
686
+ 3600352804,
687
+ 4094571909,
688
+ 275423344,
689
+ 430227734,
690
+ 506948616,
691
+ 659060556,
692
+ 883997877,
693
+ 958139571,
694
+ 1322822218,
695
+ 1537002063,
696
+ 1747873779,
697
+ 1955562222,
698
+ 2024104815,
699
+ 2227730452,
700
+ 2361852424,
701
+ 2428436474,
702
+ 2756734187,
703
+ 3204031479,
704
+ 3329325298
705
+ ];
706
+ const H = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225];
707
+ const padded = Array.from(bytes);
708
+ const bitLen = bytes.length * 8;
709
+ padded.push(128);
710
+ while (padded.length % 64 !== 56) padded.push(0);
711
+ for (let i = 7; i >= 0; i--) padded.push(i >= 4 ? 0 : Math.floor(bitLen / 2 ** (i * 8)) & 255);
712
+ const w = new Array(64);
713
+ for (let off = 0; off < padded.length; off += 64) {
714
+ for (let t = 0; t < 16; t++) w[t] = padded[off + t * 4] << 24 | padded[off + t * 4 + 1] << 16 | padded[off + t * 4 + 2] << 8 | padded[off + t * 4 + 3];
715
+ for (let t = 16; t < 64; t++) {
716
+ const s0 = (w[t - 15] >>> 7 | w[t - 15] << 25) ^ (w[t - 15] >>> 18 | w[t - 15] << 14) ^ w[t - 15] >>> 3;
717
+ const s1 = (w[t - 2] >>> 17 | w[t - 2] << 15) ^ (w[t - 2] >>> 19 | w[t - 2] << 13) ^ w[t - 2] >>> 10;
718
+ w[t] = w[t - 16] + s0 + w[t - 7] + s1 | 0;
719
+ }
720
+ let [a, b, c, d, e, f, g, h] = H;
721
+ for (let t = 0; t < 64; t++) {
722
+ const s1 = (e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7);
723
+ const ch = e & f ^ ~e & g;
724
+ const t1 = h + s1 + ch + K[t] + w[t] | 0;
725
+ const s0 = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10);
726
+ const t2 = s0 + (a & b ^ a & c ^ b & c) | 0;
727
+ h = g;
728
+ g = f;
729
+ f = e;
730
+ e = d + t1 | 0;
731
+ d = c;
732
+ c = b;
733
+ b = a;
734
+ a = t1 + t2 | 0;
735
+ }
736
+ H[0] = H[0] + a | 0;
737
+ H[1] = H[1] + b | 0;
738
+ H[2] = H[2] + c | 0;
739
+ H[3] = H[3] + d | 0;
740
+ H[4] = H[4] + e | 0;
741
+ H[5] = H[5] + f | 0;
742
+ H[6] = H[6] + g | 0;
743
+ H[7] = H[7] + h | 0;
399
744
  }
400
- return himalaya.dispatch(handlerId, stringParams);
745
+ return "invite:" + H.map((word) => (word >>> 0).toString(16).padStart(8, "0")).join("");
746
+ }
747
+
748
+ // ../../stdlib/flows/screens/src/invite.ts
749
+ function inviteAction(opts) {
750
+ if (!opts.screenId.trim()) throw new Error("Invite requires its flow screen.");
751
+ const service = opts.service ?? "invite";
752
+ return {
753
+ id: opts.id ?? "invite",
754
+ icon: "share",
755
+ label: opts.label ?? "Invite",
756
+ accessibilityLabel: opts.label ?? "Invite",
757
+ hiddenPath: `$service:${service}.hidden`,
758
+ onTap: { actionId: "himi.open", params: { screenId: opts.screenId } }
759
+ };
760
+ }
761
+ function inviteButton(opts = {}) {
762
+ const service = opts.service ?? "invite";
763
+ return {
764
+ id: opts.id ?? "invite.share",
765
+ body: { package: "himalaya", type: "Button", props: {
766
+ title: opts.label ?? "Share invitation",
767
+ style: "secondary",
768
+ fullWidth: false,
769
+ action: { actionId: `tier5.${service}.invite` }
770
+ } },
771
+ modifiers: { hiddenPath: `$service:${service}.hidden` }
772
+ };
773
+ }
774
+ function inviteScreen(opts) {
775
+ const service = opts.service ?? "invite";
776
+ return {
777
+ screenId: opts.screenId,
778
+ renderer: "sdui_intent",
779
+ title: opts.title ?? "Invite",
780
+ schemaVersion: 1,
781
+ cacheControl: { maxAge: 0, staleWhileRevalidate: 0 },
782
+ topBar: { actions: [] },
783
+ // The flow must not inherit an Invite action that opens itself.
784
+ logicBundle: { url: opts.bundleUrl, integrity: "", declaredCapabilities: ["share", "wix_api", "app_info"] },
785
+ payload: { id: "root", body: { package: "himalaya", type: "VStack", props: { spacing: 16, alignment: "leading", children: [
786
+ { id: `${service}.error`, body: { package: "himalaya", type: "Text", props: { text: `$service:${service}.error`, style: "body" } } },
787
+ inviteButton({ service, label: opts.shareLabel })
788
+ ] } } }
789
+ };
790
+ }
791
+ var wixApi = () => globalThis.himalaya?.wixApi;
792
+ var businessId = (value) => typeof value === "string" && /^[a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12}$/i.test(value);
793
+ function inviteUrl(value) {
794
+ return typeof value === "string" && value.length <= 8192 && !/[^\x21-\x7e]|\\|%(?![a-f\d]{2})/i.test(value) && /^https:\/\/(?:[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?\.)+[a-z](?:[a-z\d-]{0,61}[a-z\d])?(?::443)?(?:[/?#][^]*)?$/i.test(value);
795
+ }
796
+ async function readInvite(opts) {
797
+ const source = await opts.source();
798
+ if (source?.showInviteButton !== true) return void 0;
799
+ const data = { ...source };
800
+ if (data.url !== void 0) {
801
+ if (!inviteUrl(data.url)) return void 0;
802
+ } else if (!businessId(data.businessId) || !wixApi() || (await get()).oneAppInviteAvailable !== true) {
803
+ return void 0;
804
+ }
805
+ const host = await availability();
806
+ return host === "full" || host === "degraded" ? data : void 0;
807
+ }
808
+ function createInviteAvailabilityService(opts) {
809
+ const svc = defineService(opts.service ?? "invite", {
810
+ state: { hidden: true },
811
+ notHydrated: ["hidden"],
812
+ actions: { load: async () => {
813
+ try {
814
+ return { hidden: !await readInvite(opts) };
815
+ } catch {
816
+ return { hidden: true };
817
+ }
818
+ } }
819
+ });
820
+ void svc.load();
821
+ return svc;
822
+ }
823
+ var accountOf = (email) => email.trim().toLowerCase();
824
+ var target = (data) => inviteTarget(JSON.stringify([data.businessId ?? "", data.url ?? ""]));
825
+ async function continuation(operation, data, token = "") {
826
+ try {
827
+ return await dispatch("himi.wix.authContinuation", { operation, target: target(data), token });
828
+ } catch {
829
+ return null;
830
+ }
831
+ }
832
+ function createInviteService(opts) {
833
+ if (!opts.signInScreenId.trim()) throw new Error("Invite requires the app's sign-in screen.");
834
+ const read2 = () => readInvite(opts);
835
+ const sameSource = async (data) => {
836
+ const current = await read2();
837
+ return current && target(current) === target(data);
838
+ };
839
+ const unavailable2 = (hidden = false) => ({ hidden, error: "Invite is unavailable." });
840
+ let busy = false;
841
+ const perform = async (data, account) => {
842
+ const member = await authState();
843
+ if (!account || !member.signedIn || accountOf(member.email) !== account || !await sameSource(data)) return unavailable2(true);
844
+ const response = data.url ? void 0 : await wixApi().call(
845
+ "POST",
846
+ "https://apps.wix.com/clubs/api/v1/invites",
847
+ { target: { businessId: data.businessId } },
848
+ { "wix-site-id": data.businessId }
849
+ );
850
+ const url = data.url ?? response?.url;
851
+ if (!inviteUrl(url)) return unavailable2();
852
+ const current = await authState();
853
+ if (!current.signedIn || accountOf(current.email) !== account || !await sameSource(data)) return unavailable2(true);
854
+ const result = await share({ url, text: data.text, subject: data.subject });
855
+ return { hidden: false, error: result.completed ? "" : "Sharing was not completed." };
856
+ };
857
+ const svc = defineService(opts.service ?? "invite", {
858
+ state: { hidden: true, error: "" },
859
+ notHydrated: ["hidden", "error"],
860
+ actions: {
861
+ load: async () => {
862
+ if (busy) return void 0;
863
+ busy = true;
864
+ try {
865
+ const data = await read2();
866
+ if (!data) return unavailable2(true);
867
+ const waiting = await continuation("check", data);
868
+ if (waiting?.supported === true && waiting.confirmed === true && waiting.account) {
869
+ const account = accountOf(waiting.account);
870
+ const member = await authState();
871
+ if (!account || !member.signedIn || accountOf(member.email) !== account || !await sameSource(data)) return unavailable2(true);
872
+ const permit = await continuation("consume", data);
873
+ if (permit?.supported === true && permit.confirmed === true && permit.account && accountOf(permit.account) === account) {
874
+ return await perform(data, account);
875
+ }
876
+ }
877
+ return { hidden: false, error: "" };
878
+ } catch {
879
+ return unavailable2();
880
+ } finally {
881
+ busy = false;
882
+ }
883
+ },
884
+ invite: async () => {
885
+ if (busy) return void 0;
886
+ busy = true;
887
+ try {
888
+ const data = await read2();
889
+ if (!data) return unavailable2(true);
890
+ const member = await authState();
891
+ if (member.signedIn) return await perform(data, accountOf(member.email));
892
+ const request = await continuation("begin", data);
893
+ if (request?.supported !== true) return { hidden: false, error: "Update the app to sign in and share an invitation." };
894
+ if (!request.token) return unavailable2();
895
+ try {
896
+ await dispatch("himi.open", { screenId: opts.signInScreenId, presentation: "sheet", modal: "1", mode: "signin", authContinuation: request.token });
897
+ } catch (error) {
898
+ await continuation("cancel", data, request.token);
899
+ throw error;
900
+ }
901
+ return { hidden: false, error: "" };
902
+ } catch {
903
+ return unavailable2();
904
+ } finally {
905
+ busy = false;
906
+ }
907
+ }
908
+ }
909
+ });
910
+ void svc.load();
911
+ return svc;
401
912
  }
402
913
 
403
914
  // ../../core/sdk/wix-cashier/src/index.ts
@@ -415,7 +926,7 @@ function s(v) {
415
926
  return v == null || v === "" ? void 0 : v;
416
927
  }
417
928
  async function isAvailable() {
418
- const r = await dispatch2("capability.wix_cashier.isAvailable");
929
+ const r = await dispatch("capability.wix_cashier.isAvailable");
419
930
  return normalizeAvailability(r?.availability);
420
931
  }
421
932
  async function proceedToPayment(config) {
@@ -434,7 +945,7 @@ async function proceedToPayment(config) {
434
945
  if (label) params.label = label;
435
946
  if (config.allowInPersonPayment) params.allowInPersonPayment = true;
436
947
  if (config.allowManualPayment) params.allowManualPayment = true;
437
- const r = await dispatch2("capability.wix_cashier.proceedToPayment", params);
948
+ const r = await dispatch("capability.wix_cashier.proceedToPayment", params);
438
949
  return {
439
950
  status: normalizeStatus(r?.status),
440
951
  chargeId: s(r?.chargeId),
@@ -460,16 +971,6 @@ function normalizeStatus(raw) {
460
971
  }
461
972
  }
462
973
 
463
- // ../../core/sdk/open-url/src/index.ts
464
- function defaultMode(url) {
465
- return /^https?:/i.test(url) ? "in_app_browser" : "external_app";
466
- }
467
- async function open(url, mode) {
468
- if (!url) return { opened: false };
469
- const r = await dispatch2("capability.open_url.open", { url, mode: mode ?? defaultMode(url) });
470
- return { opened: r?.opened === true };
471
- }
472
-
473
974
  // ../../stdlib/wix-sdk/pricing-plans/src/index.ts
474
975
  function wixCall(method, path, body, readOptions) {
475
976
  if (!globalThis.himalaya?.wixApi) {
@@ -527,8 +1028,8 @@ async function payOrder(req) {
527
1028
  if (!req.snapshotId && !req.cashierUrl && !req.openCashier) {
528
1029
  return { kind: "failed", reason: "no order to settle" };
529
1030
  }
530
- const availability = await isAvailable().catch(() => "unavailable");
531
- if (availability === "full" && req.snapshotId) {
1031
+ const availability2 = await isAvailable().catch(() => "unavailable");
1032
+ if (availability2 === "full" && req.snapshotId) {
532
1033
  if (await req.mayCharge?.() === false) return WITHDRAWN;
533
1034
  const r = await proceedToPayment({
534
1035
  appId: req.appId,
@@ -562,34 +1063,7 @@ async function payOrder(req) {
562
1063
  }
563
1064
  return {
564
1065
  kind: "failed",
565
- reason: availability === "full" ? "the wallet declined and no in-app cashier is configured" : "no payment rail is available"
566
- };
567
- }
568
-
569
- // ../../core/sdk/app-info/src/index.ts
570
- var PLATFORMS = ["ios", "android", "macos", "web", "react-native"];
571
- function str(v) {
572
- return typeof v === "string" ? v.trim() : "";
573
- }
574
- async function get() {
575
- const r = await dispatch2("capability.app_info.get");
576
- const platform = str(r?.platform);
577
- const releaseId = str(r?.releaseId);
578
- const serveBaseUrl = str(r?.serveBaseUrl);
579
- return {
580
- appId: str(r?.appId),
581
- bundleId: str(r?.bundleId),
582
- version: str(r?.version),
583
- buildNumber: str(r?.buildNumber),
584
- binaryVersion: str(r?.binaryVersion),
585
- releaseId: releaseId || null,
586
- releasePinned: r?.releasePinned === true,
587
- // Trust the host's own answer; fall back to inferring from whether a serve origin is set.
588
- environment: str(r?.environment) === "prod" ? "prod" : serveBaseUrl ? "prod" : "dev",
589
- serveBaseUrl: serveBaseUrl || null,
590
- platform: PLATFORMS.includes(platform) ? platform : "unknown",
591
- memberSiteBound: r?.memberSiteBound === true,
592
- oneAppInviteAvailable: r?.oneAppInviteAvailable === true
1066
+ reason: availability2 === "full" ? "the wallet declined and no in-app cashier is configured" : "no payment rail is available"
593
1067
  };
594
1068
  }
595
1069
 
@@ -2065,7 +2539,7 @@ var zeroPrice = (value) => typeof value === "string" && /^0+(?:\.0+)?$/.test(val
2065
2539
  // ../../core/sdk/iap/src/index.ts
2066
2540
  async function getProducts(productIds) {
2067
2541
  if (!productIds || productIds.length === 0) return [];
2068
- const r = await dispatch2("capability.iap.getProducts", {
2542
+ const r = await dispatch("capability.iap.getProducts", {
2069
2543
  // Product ids are reverse-DNS-ish and never contain commas — comma-join
2070
2544
  // matches the @himalaya/push list-param convention.
2071
2545
  productIds: productIds.join(",")
@@ -2073,12 +2547,12 @@ async function getProducts(productIds) {
2073
2547
  return Array.isArray(r?.products) ? r.products : [];
2074
2548
  }
2075
2549
  async function restore() {
2076
- const r = await dispatch2("capability.iap.restore");
2550
+ const r = await dispatch("capability.iap.restore");
2077
2551
  return Array.isArray(r?.entitlements) ? r.entitlements : [];
2078
2552
  }
2079
2553
  async function purchaseForVerification(input) {
2080
2554
  if (!nonempty2(input?.productId) || !isUUID2(input?.appAccountToken)) return failure2("invalidArgument");
2081
- const result = await managedDispatch(() => dispatch2("capability.iap.purchaseForVerification", input));
2555
+ const result = await managedDispatch(() => dispatch("capability.iap.purchaseForVerification", input));
2082
2556
  if (result?.status === "purchased" && isAppleTransaction(result.transaction)) {
2083
2557
  return { status: "purchased", transaction: decodeTransaction(result.transaction) };
2084
2558
  }
@@ -2086,7 +2560,7 @@ async function purchaseForVerification(input) {
2086
2560
  return decodeFailure(result);
2087
2561
  }
2088
2562
  async function getUnfinishedTransactions() {
2089
- const result = await managedDispatch(() => dispatch2("capability.iap.getUnfinishedTransactions"));
2563
+ const result = await managedDispatch(() => dispatch("capability.iap.getUnfinishedTransactions"));
2090
2564
  if (result?.status === "ok" && Array.isArray(result.transactions) && result.transactions.every(isAppleTransaction)) {
2091
2565
  return { status: "ok", transactions: result.transactions.map(decodeTransaction) };
2092
2566
  }
@@ -2094,7 +2568,7 @@ async function getUnfinishedTransactions() {
2094
2568
  }
2095
2569
  async function finishTransaction(input) {
2096
2570
  if (!nonempty2(input?.transactionId)) return failure2("invalidArgument");
2097
- const result = await managedDispatch(() => dispatch2("capability.iap.finishTransaction", input));
2571
+ const result = await managedDispatch(() => dispatch("capability.iap.finishTransaction", input));
2098
2572
  if (result?.status === "finished" || result?.status === "notFound") return { status: result.status };
2099
2573
  return decodeFailure(result);
2100
2574
  }
@@ -2111,7 +2585,7 @@ function hostAppBindingSource() {
2111
2585
  async function readHostBinding() {
2112
2586
  let answer;
2113
2587
  try {
2114
- answer = await dispatch2("capability.iap.appBinding");
2588
+ answer = await dispatch("capability.iap.appBinding");
2115
2589
  } catch (error) {
2116
2590
  if (bindingNotOffered(error)) return null;
2117
2591
  throw new Error("the host could not read the app binding");
@@ -3830,9 +4304,9 @@ async function openBooking(item, bridge, beforeCreate, afterCreate) {
3830
4304
  const metadata = bookingAttendanceOf(service);
3831
4305
  if (classifyForApple(metadata, item.attendance.currency) !== "appleIap" || !samePrice({ amount: metadata.amount, currency: metadata.currency }, item)) return notCreated(CHANGED);
3832
4306
  if (isObject7(service?.onlineBooking) && service.onlineBooking.requireManualApproval === true) return notCreated({ status: "refused", reason: "approvalRequired" });
3833
- const availability = await bridge.call("POST", "/bookings/v1/availability/query", { query: { filter: { serviceId: [item.reference.id], startDate: selected.slot.startDate, endDate: selected.slot.endDate, bookable: true } } });
3834
- if (isRefusal(availability)) return notCreated(attemptRefused(availability));
3835
- const entries = isObject7(availability.body) ? availability.body.availabilityEntries : void 0;
4307
+ const availability2 = await bridge.call("POST", "/bookings/v1/availability/query", { query: { filter: { serviceId: [item.reference.id], startDate: selected.slot.startDate, endDate: selected.slot.endDate, bookable: true } } });
4308
+ if (isRefusal(availability2)) return notCreated(attemptRefused(availability2));
4309
+ const entries = isObject7(availability2.body) ? availability2.body.availabilityEntries : void 0;
3836
4310
  if (!Array.isArray(entries) || !entries.some((entry) => isObject7(entry) && entry.bookable === true && matchesSlot(entry.slot, selected.slot))) return notCreated(CHANGED);
3837
4311
  if (beforeCreate && !beforeCreate(slotGuard(selected.slot))) return notCreated({ status: "refused", reason: "storageUnavailable" });
3838
4312
  const created = await bridge.call("POST", "/bookings/v2/bookings", { booking: { bookedEntity: { slot: selected.slot }, contactDetails: selected.contactDetails, totalParticipants: 1, selectedPaymentOption: "ONLINE", ...selected.formInfo ? { formInfo: selected.formInfo } : {} } });
@@ -4031,14 +4505,14 @@ function createRedirectSession(req = {}, opts) {
4031
4505
 
4032
4506
  // ../../stdlib/flows/screens/src/index.ts
4033
4507
  var PKG = "himalaya";
4034
- var node = (id2, type, props) => ({ id: id2, body: { package: PKG, type, props } });
4508
+ var node2 = (id2, type, props) => ({ id: id2, body: { package: PKG, type, props } });
4035
4509
  var hideWhen = (n, path) => ({
4036
4510
  ...n,
4037
4511
  modifiers: { ...n.modifiers ?? {}, hiddenPath: path }
4038
4512
  });
4039
- var text2 = (id2, value, style = "body") => node(id2, "Text", { text: value, style });
4040
- var vstack = (id2, children, spacing = 12, alignment = "leading") => node(id2, "VStack", { spacing, alignment, children });
4041
- var button = (id2, title, action2, style = "primary") => node(id2, "Button", { title, style, fullWidth: true, action: action2 });
4513
+ var text2 = (id2, value, style = "body") => node2(id2, "Text", { text: value, style });
4514
+ var vstack = (id2, children, spacing = 12, alignment = "leading") => node2(id2, "VStack", { spacing, alignment, children });
4515
+ var button = (id2, title, action2, style = "primary") => node2(id2, "Button", { title, style, fullWidth: true, action: action2 });
4042
4516
  var openScreen = (screenId) => ({ actionId: "himi.open", params: { screenId } });
4043
4517
  function detailedHeader(opts) {
4044
4518
  const id2 = opts.id ?? "detailed_header";
@@ -4046,7 +4520,7 @@ function detailedHeader(opts) {
4046
4520
  if (opts.logoUrl || opts.locationLabel) {
4047
4521
  const identity = [];
4048
4522
  if (opts.logoUrl) {
4049
- identity.push(node(`${id2}.logo`, "Image", {
4523
+ identity.push(node2(`${id2}.logo`, "Image", {
4050
4524
  url: opts.logoUrl,
4051
4525
  width: 56,
4052
4526
  height: 56,
@@ -4057,12 +4531,12 @@ function detailedHeader(opts) {
4057
4531
  }
4058
4532
  if (opts.locationLabel) {
4059
4533
  if (opts.locationAction) {
4060
- identity.push(node(`${id2}.locationGroup`, "HStack", {
4534
+ identity.push(node2(`${id2}.locationGroup`, "HStack", {
4061
4535
  spacing: 8,
4062
4536
  alignment: "center",
4063
4537
  children: [
4064
4538
  text2(`${id2}.location`, opts.locationLabel, "caption"),
4065
- node(`${id2}.location.action`, "Button", {
4539
+ node2(`${id2}.location.action`, "Button", {
4066
4540
  title: opts.locationAction.label,
4067
4541
  style: opts.locationAction.style ?? "plain",
4068
4542
  fullWidth: false,
@@ -4074,10 +4548,10 @@ function detailedHeader(opts) {
4074
4548
  identity.push(text2(`${id2}.location`, opts.locationLabel, "caption"));
4075
4549
  }
4076
4550
  }
4077
- cardChildren.push(node(`${id2}.identity`, "HStack", { spacing: 12, alignment: "center", children: identity }));
4551
+ cardChildren.push(node2(`${id2}.identity`, "HStack", { spacing: 12, alignment: "center", children: identity }));
4078
4552
  }
4079
4553
  if (opts.memberCaption || opts.memberAvatarsPath || opts.memberAvatars?.length) {
4080
- cardChildren.push(node(`${id2}.members`, "AvatarStrip", {
4554
+ cardChildren.push(node2(`${id2}.members`, "AvatarStrip", {
4081
4555
  size: 36,
4082
4556
  maxVisible: 5,
4083
4557
  ...opts.memberCaption ? { caption: opts.memberCaption } : {},
@@ -4092,7 +4566,7 @@ function detailedHeader(opts) {
4092
4566
  ]) {
4093
4567
  if (action2) cardChildren.push(button(`${id2}.${key}`, action2.label, action2.action, action2.style ?? (key === "primary" ? "primary" : "secondary")));
4094
4568
  }
4095
- const card = node(`${id2}.card`, "VStack", {
4569
+ const card = node2(`${id2}.card`, "VStack", {
4096
4570
  spacing: 14,
4097
4571
  alignment: "leading",
4098
4572
  children: cardChildren
@@ -4105,7 +4579,7 @@ function detailedHeader(opts) {
4105
4579
  fillMaxWidth: true
4106
4580
  };
4107
4581
  const fixed = opts.collapsible === false;
4108
- return node(id2, "CollapsingHeader", {
4582
+ return node2(id2, "CollapsingHeader", {
4109
4583
  ...opts.imageUrl ? { imageUrl: opts.imageUrl } : {},
4110
4584
  title: opts.title,
4111
4585
  ...opts.subtitle ? { subtitle: opts.subtitle } : {},
@@ -4131,7 +4605,7 @@ function authScreen(opts) {
4131
4605
  const screenId = opts.screenId ?? "signin";
4132
4606
  const c = opts.copy ?? {};
4133
4607
  const withRegister = opts.register !== false;
4134
- const field = (key, label, action2, extra = {}) => node(`${s2}.${key}`, "TextField", {
4608
+ const field = (key, label, action2, extra = {}) => node2(`${s2}.${key}`, "TextField", {
4135
4609
  label,
4136
4610
  placeholder: label,
4137
4611
  valuePath: `$service:${s2}.${key}`,
@@ -4151,7 +4625,7 @@ function authScreen(opts) {
4151
4625
  `$service:${s2}.signedIn`
4152
4626
  ),
4153
4627
  hideWhen(
4154
- node(`${s2}.submit`, "Button", {
4628
+ node2(`${s2}.submit`, "Button", {
4155
4629
  title: `$service:${s2}.submitCta`,
4156
4630
  style: "primary",
4157
4631
  fullWidth: true,
@@ -4163,7 +4637,7 @@ function authScreen(opts) {
4163
4637
  if (withRegister) {
4164
4638
  children.push(
4165
4639
  hideWhen(
4166
- node(`${s2}.toggle`, "Button", {
4640
+ node2(`${s2}.toggle`, "Button", {
4167
4641
  title: `$service:${s2}.switchCta`,
4168
4642
  style: "secondary",
4169
4643
  fullWidth: true,
@@ -4183,7 +4657,7 @@ function authScreen(opts) {
4183
4657
  }
4184
4658
  children.push(
4185
4659
  hideWhen(
4186
- node(`${s2}.signout`, "Button", {
4660
+ node2(`${s2}.signout`, "Button", {
4187
4661
  title: c.signOutCta ?? "Sign out",
4188
4662
  style: "secondary",
4189
4663
  fullWidth: true,
@@ -4637,7 +5111,7 @@ function checkoutScreen(opts) {
4637
5111
  // someone the thing they are currently paying for is the obvious next bug.
4638
5112
  hideWhen(text2(`${s2}.row_joined`, "$item.joinedLabel", "bodyEmphasis"), "$item.notJoined"),
4639
5113
  hideWhen(
4640
- node(`${s2}.row_join`, "Button", {
5114
+ node2(`${s2}.row_join`, "Button", {
4641
5115
  title: "$item.cta",
4642
5116
  disabledPath: "$item.joinDisabled",
4643
5117
  style: "primary",
@@ -4676,7 +5150,7 @@ function checkoutScreen(opts) {
4676
5150
  }
4677
5151
  children.push(
4678
5152
  hideWhen(
4679
- node(`${s2}.list`, "LazyList", { itemsPath: `$service:${s2}.rows`, spacing: 18, items: [row] }),
5153
+ node2(`${s2}.list`, "LazyList", { itemsPath: `$service:${s2}.rows`, spacing: 18, items: [row] }),
4680
5154
  `$service:${s2}.noRows`
4681
5155
  )
4682
5156
  );
@@ -4689,10 +5163,20 @@ function checkoutScreen(opts) {
4689
5163
  }
4690
5164
  export {
4691
5165
  authScreen,
5166
+ businessContactLink,
5167
+ businessContactPoint,
5168
+ businessContactSection,
5169
+ businessContactSettings,
4692
5170
  checkoutScreen,
4693
5171
  createAuthService,
5172
+ createBusinessContactService,
4694
5173
  createCheckoutService,
5174
+ createInviteAvailabilityService,
5175
+ createInviteService,
4695
5176
  detailedHeader,
4696
- entitlement
5177
+ entitlement,
5178
+ inviteAction,
5179
+ inviteButton,
5180
+ inviteScreen
4697
5181
  };
4698
5182
  //# sourceMappingURL=screens.mjs.map