@wix/himalaya-cli 0.1748.0 → 0.1750.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 (327) hide show
  1. package/bin/himi +16 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +9 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +2 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/l10n.mjs +1 -1
  6. package/dist/browser-plane/assets.json +7 -7
  7. package/dist/browser-plane/preview-deferred/{63821bbb8f637899037252154a5587f0596e4b537173c7f50551f9e44f7c22c0.bin → b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin} +1 -1
  8. package/dist/browser-plane/sw.js +6 -6
  9. package/dist/browser-plane/t5-frame.html +1 -1
  10. package/dist/browser-plane/t5-worker-frame.html +1 -1
  11. package/dist/cli.mjs +13464 -8217
  12. package/dist/preview-assets.generated.bin +0 -0
  13. package/guides/component-reference.json +1 -1
  14. package/guides/component-reference.md +9 -0
  15. package/guides/getting-started.md +3 -1
  16. package/guides/himi-json-output.md +54 -1
  17. package/guides/himi-skill.md +3 -1
  18. package/guides/one-app-to-himi-app.md +31 -8
  19. package/guides/skill.md +3 -1
  20. package/guides/store-submission.md +149 -34
  21. package/guides/wix-business-context.md +14 -0
  22. package/package.json +10 -10
  23. package/template-icons/medical-services.png +0 -0
  24. package/template-icons/personal-fitness-trainer.png +0 -0
  25. package/templates/beauty-salon/config.ts +12 -0
  26. package/templates/beauty-salon/dev/index.ts +1 -0
  27. package/templates/beauty-salon/l10n/en.json +6 -0
  28. package/templates/beauty-salon/l10n/fr.json +11 -0
  29. package/templates/beauty-salon/l10n/he.json +9 -0
  30. package/templates/beauty-salon/tier5-src/_shared/booking-session.ts +3 -1
  31. package/templates/beauty-salon/tier5-src/_shared/business-chat-transport.ts +148 -0
  32. package/templates/beauty-salon/tier5-src/_shared/header-badges.ts +113 -0
  33. package/templates/beauty-salon/tier5-src/_shared/location-pin.ts +97 -0
  34. package/templates/beauty-salon/tier5-src/_shared/member-access.ts +17 -6
  35. package/templates/beauty-salon/tier5-src/_shared/member-bookings.ts +17 -4
  36. package/templates/beauty-salon/tier5-src/_shared/source-badges.ts +72 -0
  37. package/templates/beauty-salon/tier5-src/_shared/staff-name.ts +18 -0
  38. package/templates/beauty-salon/tier5-src/himi-booking-bookings/index.ts +6 -2
  39. package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +7 -2
  40. package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +6 -4
  41. package/templates/beauty-salon/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  42. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +13 -4
  43. package/templates/beauty-salon/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  44. package/templates/beauty-salon-owner/dev/index.ts +54 -0
  45. package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +30 -4
  46. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  47. package/templates/branded-lite/config.ts +12 -0
  48. package/templates/branded-lite/dev/index.ts +1 -0
  49. package/templates/branded-lite/l10n/fr.json +10 -0
  50. package/templates/branded-lite/l10n/he.json +8 -0
  51. package/templates/branded-lite/tier5-src/_shared/booking-session.ts +3 -1
  52. package/templates/branded-lite/tier5-src/_shared/location-pin.ts +97 -0
  53. package/templates/branded-lite/tier5-src/_shared/member-access.ts +17 -6
  54. package/templates/branded-lite/tier5-src/_shared/member-bookings.ts +17 -4
  55. package/templates/branded-lite/tier5-src/_shared/staff-name.ts +18 -0
  56. package/templates/branded-lite/tier5-src/himi-booking-bookings/index.ts +6 -2
  57. package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +7 -2
  58. package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +6 -4
  59. package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +10 -5
  60. package/templates/branded-lite/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  61. package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +12 -1
  62. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +13 -4
  63. package/templates/branded-lite/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  64. package/templates/community-club/dev/index.ts +1 -0
  65. package/templates/community-club/tier5-src/_shared/member-access.ts +17 -6
  66. package/templates/community-club/tier5-src/_shared/member-bookings.ts +17 -4
  67. package/templates/community-club/tier5-src/himi-store-account/index.ts +13 -4
  68. package/templates/community-club/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  69. package/templates/community-club-owner/dev/index.ts +54 -0
  70. package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +30 -4
  71. package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  72. package/templates/conference/dev/index.ts +1 -0
  73. package/templates/conference/tier5-src/_shared/member-access.ts +17 -6
  74. package/templates/conference/tier5-src/himi-store-account/index.ts +13 -4
  75. package/templates/events-meetups/dev/index.ts +1 -0
  76. package/templates/events-meetups/tier5-src/_shared/member-access.ts +17 -6
  77. package/templates/events-meetups/tier5-src/_shared/member-bookings.ts +17 -4
  78. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +13 -4
  79. package/templates/events-meetups/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  80. package/templates/events-meetups-owner/dev/index.ts +54 -0
  81. package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +30 -4
  82. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  83. package/templates/gym-fitness/config.ts +12 -0
  84. package/templates/gym-fitness/dev/index.ts +1 -0
  85. package/templates/gym-fitness/l10n/en.json +6 -0
  86. package/templates/gym-fitness/l10n/fr.json +11 -0
  87. package/templates/gym-fitness/l10n/he.json +9 -0
  88. package/templates/gym-fitness/tier5-src/_shared/booking-session.ts +3 -1
  89. package/templates/gym-fitness/tier5-src/_shared/business-chat-transport.ts +148 -0
  90. package/templates/gym-fitness/tier5-src/_shared/header-badges.ts +113 -0
  91. package/templates/gym-fitness/tier5-src/_shared/location-pin.ts +97 -0
  92. package/templates/gym-fitness/tier5-src/_shared/member-access.ts +17 -6
  93. package/templates/gym-fitness/tier5-src/_shared/member-bookings.ts +17 -4
  94. package/templates/gym-fitness/tier5-src/_shared/source-badges.ts +72 -0
  95. package/templates/gym-fitness/tier5-src/_shared/staff-name.ts +18 -0
  96. package/templates/gym-fitness/tier5-src/himi-booking-bookings/index.ts +6 -2
  97. package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +7 -2
  98. package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +6 -4
  99. package/templates/gym-fitness/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  100. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +13 -4
  101. package/templates/gym-fitness/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  102. package/templates/gym-fitness-owner/dev/index.ts +54 -0
  103. package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +30 -4
  104. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  105. package/templates/medical-services/README.md +53 -0
  106. package/templates/medical-services/config.ts +320 -0
  107. package/templates/medical-services/dev/index.ts +17783 -0
  108. package/templates/medical-services/himalaya.content.json +46 -0
  109. package/templates/medical-services/himalaya.template.json +14 -0
  110. package/templates/medical-services/icon.png +0 -0
  111. package/templates/medical-services/platforms.json +1 -0
  112. package/templates/medical-services/tier5-src/_shared/app-locale.ts +61 -0
  113. package/templates/medical-services/tier5-src/_shared/booking-location.ts +147 -0
  114. package/templates/medical-services/tier5-src/_shared/booking-session.ts +224 -0
  115. package/templates/medical-services/tier5-src/_shared/branded-lite-hosted.ts +280 -0
  116. package/templates/medical-services/tier5-src/_shared/branded-load-state.ts +109 -0
  117. package/templates/medical-services/tier5-src/_shared/business-chat-copy.ts +40 -0
  118. package/templates/medical-services/tier5-src/_shared/business-chat-history.ts +51 -0
  119. package/templates/medical-services/tier5-src/_shared/business-chat-message-model.ts +177 -0
  120. package/templates/medical-services/tier5-src/_shared/business-chat-model.ts +56 -0
  121. package/templates/medical-services/tier5-src/_shared/business-chat-presenter.ts +576 -0
  122. package/templates/medical-services/tier5-src/_shared/business-chat-transport.ts +148 -0
  123. package/templates/medical-services/tier5-src/_shared/collection-contract.ts +228 -0
  124. package/templates/medical-services/tier5-src/_shared/collection-query.ts +193 -0
  125. package/templates/medical-services/tier5-src/_shared/collection-service.ts +400 -0
  126. package/templates/medical-services/tier5-src/_shared/engine-intl.ts +523 -0
  127. package/templates/medical-services/tier5-src/_shared/faq-list.ts +405 -0
  128. package/templates/medical-services/tier5-src/_shared/himi-account.ts +194 -0
  129. package/templates/medical-services/tier5-src/_shared/himi-booking-saved.ts +88 -0
  130. package/templates/medical-services/tier5-src/_shared/himi-bookings.ts +318 -0
  131. package/templates/medical-services/tier5-src/_shared/himi-copy.ts +116 -0
  132. package/templates/medical-services/tier5-src/_shared/himi-store.ts +7 -0
  133. package/templates/medical-services/tier5-src/_shared/himi-text.ts +24 -0
  134. package/templates/medical-services/tier5-src/_shared/host-events.ts +66 -0
  135. package/templates/medical-services/tier5-src/_shared/hosted-checkout.ts +70 -0
  136. package/templates/medical-services/tier5-src/_shared/iap-attendance-form.ts +106 -0
  137. package/templates/medical-services/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
  138. package/templates/medical-services/tier5-src/_shared/iap-attendance.ts +38 -0
  139. package/templates/medical-services/tier5-src/_shared/iap-worker.ts +127 -0
  140. package/templates/medical-services/tier5-src/_shared/inbox-rooms.ts +68 -0
  141. package/templates/medical-services/tier5-src/_shared/local-preferences.ts +38 -0
  142. package/templates/medical-services/tier5-src/_shared/member-access.ts +63 -0
  143. package/templates/medical-services/tier5-src/_shared/member-account-routes.ts +52 -0
  144. package/templates/medical-services/tier5-src/_shared/member-bookings.ts +107 -0
  145. package/templates/medical-services/tier5-src/_shared/member-screen.ts +99 -0
  146. package/templates/medical-services/tier5-src/_shared/notification-target.ts +141 -0
  147. package/templates/medical-services/tier5-src/_shared/offset-page.ts +10 -0
  148. package/templates/medical-services/tier5-src/_shared/online-actions.ts +76 -0
  149. package/templates/medical-services/tier5-src/_shared/owner-load-error.ts +348 -0
  150. package/templates/medical-services/tier5-src/_shared/payment-setup.ts +6 -0
  151. package/templates/medical-services/tier5-src/_shared/rich-body.ts +78 -0
  152. package/templates/medical-services/tier5-src/_shared/rich-content-link.ts +34 -0
  153. package/templates/medical-services/tier5-src/_shared/sign-in-sheet.ts +18 -0
  154. package/templates/medical-services/tier5-src/_shared/staff-name.ts +18 -0
  155. package/templates/medical-services/tier5-src/_shared/weekly-goal.ts +107 -0
  156. package/templates/medical-services/tier5-src/_shared/wix-bi.ts +85 -0
  157. package/templates/medical-services/tier5-src/_shared/wix-member-links.ts +114 -0
  158. package/templates/medical-services/tier5-src/_shared/wix-service-price.ts +146 -0
  159. package/templates/medical-services/tier5-src/business-chat/index.ts +732 -0
  160. package/templates/medical-services/tier5-src/himi-booking-account/index.ts +252 -0
  161. package/templates/medical-services/tier5-src/himi-booking-bookings/index.ts +468 -0
  162. package/templates/medical-services/tier5-src/himi-booking-service/index.ts +1190 -0
  163. package/templates/medical-services/tier5-src/himi-booking-services/index.ts +791 -0
  164. package/templates/medical-services/tier5-src/himi-booking-time/index.ts +1729 -0
  165. package/templates/medical-services/tier5-src/himi-branded-lite-faq/index.ts +6 -0
  166. package/templates/medical-services/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
  167. package/templates/medical-services/tier5-src/himi-clinic-home/index.ts +389 -0
  168. package/templates/medical-services/tier5-src/himi-store-account/index.ts +1007 -0
  169. package/templates/medical-services/tokens.json +418 -0
  170. package/templates/nonprofit-cause/dev/index.ts +1 -0
  171. package/templates/nonprofit-cause/tier5-src/_shared/member-access.ts +17 -6
  172. package/templates/nonprofit-cause/tier5-src/_shared/member-bookings.ts +17 -4
  173. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +13 -4
  174. package/templates/nonprofit-cause/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  175. package/templates/nonprofit-cause-owner/dev/index.ts +54 -0
  176. package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +30 -4
  177. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  178. package/templates/owner-lite/dev/index.ts +54 -0
  179. package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +30 -4
  180. package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  181. package/templates/personal-fitness-trainer/README.md +51 -0
  182. package/templates/personal-fitness-trainer/config.ts +343 -0
  183. package/templates/personal-fitness-trainer/dev/index.ts +24813 -0
  184. package/templates/personal-fitness-trainer/himalaya.content.json +79 -0
  185. package/templates/personal-fitness-trainer/himalaya.template.json +14 -0
  186. package/templates/personal-fitness-trainer/icon.png +0 -0
  187. package/templates/personal-fitness-trainer/platforms.json +3 -0
  188. package/templates/personal-fitness-trainer/splash.json +3 -0
  189. package/templates/personal-fitness-trainer/tier5-src/_shared/app-locale.ts +61 -0
  190. package/templates/personal-fitness-trainer/tier5-src/_shared/booking-location.ts +147 -0
  191. package/templates/personal-fitness-trainer/tier5-src/_shared/booking-session.ts +224 -0
  192. package/templates/personal-fitness-trainer/tier5-src/_shared/branded-lite-hosted.ts +280 -0
  193. package/templates/personal-fitness-trainer/tier5-src/_shared/branded-load-state.ts +109 -0
  194. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-copy.ts +40 -0
  195. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-history.ts +51 -0
  196. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-message-model.ts +177 -0
  197. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-model.ts +56 -0
  198. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-presenter.ts +576 -0
  199. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-transport.ts +148 -0
  200. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-contract.ts +228 -0
  201. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-query.ts +193 -0
  202. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-service.ts +400 -0
  203. package/templates/personal-fitness-trainer/tier5-src/_shared/detail-presence.ts +51 -0
  204. package/templates/personal-fitness-trainer/tier5-src/_shared/empty-flags.ts +33 -0
  205. package/templates/personal-fitness-trainer/tier5-src/_shared/engine-intl.ts +523 -0
  206. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-account.ts +194 -0
  207. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-booking-saved.ts +88 -0
  208. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-bookings.ts +318 -0
  209. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-copy.ts +116 -0
  210. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-layouts.ts +142 -0
  211. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-store.ts +7 -0
  212. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-text.ts +24 -0
  213. package/templates/personal-fitness-trainer/tier5-src/_shared/host-events.ts +66 -0
  214. package/templates/personal-fitness-trainer/tier5-src/_shared/hosted-checkout.ts +70 -0
  215. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-form.ts +106 -0
  216. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
  217. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance.ts +38 -0
  218. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-worker.ts +127 -0
  219. package/templates/personal-fitness-trainer/tier5-src/_shared/inbox-rooms.ts +68 -0
  220. package/templates/personal-fitness-trainer/tier5-src/_shared/local-preferences.ts +38 -0
  221. package/templates/personal-fitness-trainer/tier5-src/_shared/member-access.ts +63 -0
  222. package/templates/personal-fitness-trainer/tier5-src/_shared/member-account-routes.ts +52 -0
  223. package/templates/personal-fitness-trainer/tier5-src/_shared/member-bookings.ts +107 -0
  224. package/templates/personal-fitness-trainer/tier5-src/_shared/member-screen.ts +99 -0
  225. package/templates/personal-fitness-trainer/tier5-src/_shared/offset-page.ts +10 -0
  226. package/templates/personal-fitness-trainer/tier5-src/_shared/online-actions.ts +76 -0
  227. package/templates/personal-fitness-trainer/tier5-src/_shared/owner-load-error.ts +348 -0
  228. package/templates/personal-fitness-trainer/tier5-src/_shared/payment-setup.ts +6 -0
  229. package/templates/personal-fitness-trainer/tier5-src/_shared/pricing-plan-display.ts +64 -0
  230. package/templates/personal-fitness-trainer/tier5-src/_shared/rich-body.ts +78 -0
  231. package/templates/personal-fitness-trainer/tier5-src/_shared/rich-content-link.ts +34 -0
  232. package/templates/personal-fitness-trainer/tier5-src/_shared/sign-in-sheet.ts +18 -0
  233. package/templates/personal-fitness-trainer/tier5-src/_shared/staff-name.ts +18 -0
  234. package/templates/personal-fitness-trainer/tier5-src/_shared/video-caption.ts +21 -0
  235. package/templates/personal-fitness-trainer/tier5-src/_shared/weekly-goal.ts +107 -0
  236. package/templates/personal-fitness-trainer/tier5-src/_shared/wix-bi.ts +85 -0
  237. package/templates/personal-fitness-trainer/tier5-src/_shared/wix-service-price.ts +146 -0
  238. package/templates/personal-fitness-trainer/tier5-src/business-chat/index.ts +732 -0
  239. package/templates/personal-fitness-trainer/tier5-src/business-contact/index.ts +6 -0
  240. package/templates/personal-fitness-trainer/tier5-src/himi-booking-bookings/index.ts +468 -0
  241. package/templates/personal-fitness-trainer/tier5-src/himi-booking-service/index.ts +1190 -0
  242. package/templates/personal-fitness-trainer/tier5-src/himi-booking-services/index.ts +791 -0
  243. package/templates/personal-fitness-trainer/tier5-src/himi-booking-time/index.ts +1729 -0
  244. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  245. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/index.ts +1094 -0
  246. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-agenda/index.ts +955 -0
  247. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-appearance/index.ts +94 -0
  248. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
  249. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-plans/index.ts +495 -0
  250. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  251. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +226 -0
  252. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-videos/index.ts +145 -0
  253. package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-home/index.ts +70 -0
  254. package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-profile/index.ts +53 -0
  255. package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +1007 -0
  256. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-app-language/index.ts +73 -0
  257. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  258. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
  259. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
  260. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-view-profile/index.ts +119 -0
  261. package/templates/personal-fitness-trainer/tokens.json +381 -0
  262. package/templates/podcast-creator/dev/index.ts +1 -0
  263. package/templates/podcast-creator/tier5-src/_shared/member-access.ts +17 -6
  264. package/templates/podcast-creator/tier5-src/_shared/member-bookings.ts +17 -4
  265. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +13 -4
  266. package/templates/podcast-creator/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  267. package/templates/podcast-creator-owner/dev/index.ts +54 -0
  268. package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +30 -4
  269. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  270. package/templates/portfolio-creative/dev/index.ts +1 -0
  271. package/templates/portfolio-creative/tier5-src/_shared/member-access.ts +17 -6
  272. package/templates/portfolio-creative/tier5-src/_shared/member-bookings.ts +17 -4
  273. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +13 -4
  274. package/templates/portfolio-creative/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  275. package/templates/portfolio-creative-owner/dev/index.ts +54 -0
  276. package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +30 -4
  277. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  278. package/templates/restaurant/dev/index.ts +1 -0
  279. package/templates/restaurant/tier5-src/_shared/member-access.ts +17 -6
  280. package/templates/restaurant/tier5-src/_shared/member-bookings.ts +17 -4
  281. package/templates/restaurant/tier5-src/himi-store-account/index.ts +13 -4
  282. package/templates/restaurant/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  283. package/templates/restaurant-owner/dev/index.ts +54 -0
  284. package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +30 -4
  285. package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  286. package/templates/retail-store/dev/index.ts +1 -0
  287. package/templates/retail-store/tier5-src/_shared/member-access.ts +17 -6
  288. package/templates/retail-store/tier5-src/_shared/member-bookings.ts +17 -4
  289. package/templates/retail-store/tier5-src/himi-store-account/index.ts +13 -4
  290. package/templates/retail-store/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  291. package/templates/retail-store-owner/dev/index.ts +54 -0
  292. package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +30 -4
  293. package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  294. package/templates/salon-spa/dev/index.ts +1 -0
  295. package/templates/salon-spa/tier5-src/_shared/booking-session.ts +3 -1
  296. package/templates/salon-spa/tier5-src/_shared/member-access.ts +17 -6
  297. package/templates/salon-spa/tier5-src/_shared/member-bookings.ts +17 -4
  298. package/templates/salon-spa/tier5-src/_shared/staff-name.ts +18 -0
  299. package/templates/salon-spa/tier5-src/himi-booking-bookings/index.ts +6 -2
  300. package/templates/salon-spa/tier5-src/himi-booking-service/index.ts +7 -2
  301. package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +6 -4
  302. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +13 -4
  303. package/templates/wholesale-store/dev/index.ts +1 -0
  304. package/templates/wholesale-store/tier5-src/_shared/member-access.ts +17 -6
  305. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +13 -4
  306. package/templates/yoga-studio/config.ts +12 -0
  307. package/templates/yoga-studio/dev/index.ts +1 -0
  308. package/templates/yoga-studio/l10n/en.json +6 -0
  309. package/templates/yoga-studio/l10n/fr.json +11 -0
  310. package/templates/yoga-studio/l10n/he.json +9 -0
  311. package/templates/yoga-studio/tier5-src/_shared/booking-session.ts +3 -1
  312. package/templates/yoga-studio/tier5-src/_shared/business-chat-transport.ts +148 -0
  313. package/templates/yoga-studio/tier5-src/_shared/header-badges.ts +113 -0
  314. package/templates/yoga-studio/tier5-src/_shared/location-pin.ts +97 -0
  315. package/templates/yoga-studio/tier5-src/_shared/member-access.ts +17 -6
  316. package/templates/yoga-studio/tier5-src/_shared/member-bookings.ts +17 -4
  317. package/templates/yoga-studio/tier5-src/_shared/source-badges.ts +72 -0
  318. package/templates/yoga-studio/tier5-src/_shared/staff-name.ts +18 -0
  319. package/templates/yoga-studio/tier5-src/himi-booking-bookings/index.ts +6 -2
  320. package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +7 -2
  321. package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +6 -4
  322. package/templates/yoga-studio/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  323. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +13 -4
  324. package/templates/yoga-studio/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  325. package/templates/yoga-studio-owner/dev/index.ts +54 -0
  326. package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +30 -4
  327. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
@@ -1491,6 +1491,7 @@ export interface AriaChatCore {
1491
1491
  load(s: AriaChatState): Promise<AriaChatState>;
1492
1492
  submit(s: AriaChatState, arg?: AriaActionArg): Promise<AriaChatState>;
1493
1493
  submitPrompt(s: AriaChatState, arg?: AriaActionArg): Promise<AriaChatState>;
1494
+ submitQuickReply(s: AriaChatState, arg?: AriaActionArg): Promise<AriaChatState>;
1494
1495
  newChat(s: AriaChatState): Promise<AriaChatState>;
1495
1496
  /** Mirror the composer's text into state. Not cosmetic: the renderers only
1496
1497
  * clear a text field when its BOUND value transitions, so a composer whose
@@ -2799,6 +2800,7 @@ export function createAriaChat(o: AriaChatOptions): AriaChatCore {
2799
2800
  /** The quick replies last painted, so an unchanged list keeps its identity and
2800
2801
  * a reducer that changed nothing still returns the SAME state object. */
2801
2802
  let paintedReplies: AriaQuickReply[] = [];
2803
+ let quickReplyOffer = 0;
2802
2804
 
2803
2805
  /** Ask the host to open the stream for a turn that was just sent, and reset
2804
2806
  * the live model to it. `turnId` may be empty (a service that named no id);
@@ -2867,13 +2869,21 @@ export function createAriaChat(o: AriaChatOptions): AriaChatCore {
2867
2869
  return out;
2868
2870
  };
2869
2871
 
2872
+ const quickReplyLabel = (label: string): string => {
2873
+ const characters = Array.from(label);
2874
+ return characters.length > 30 ? characters.slice(0, 29).join("") + "…" : label;
2875
+ };
2876
+
2870
2877
  /** The current turn's quick replies, as rows. */
2871
2878
  const repliesFor = (s: AriaChatState): AriaQuickReply[] => {
2872
2879
  const offered = !!s._turnId && live.turnId === s._turnId && live.conversationId === s._convId
2873
2880
  ? live.quickReplies() : [];
2874
2881
  const same = offered.length === paintedReplies.length
2875
- && offered.every((r, i) => paintedReplies[i].label === r.label && paintedReplies[i].reply === r.reply);
2876
- if (!same) paintedReplies = offered.map((r, i) => ({ id: `qr${i + 1}`, label: r.label, reply: r.reply }));
2882
+ && offered.every((r, i) => paintedReplies[i].label === quickReplyLabel(r.label) && paintedReplies[i].reply === r.reply);
2883
+ if (!same) {
2884
+ quickReplyOffer += 1;
2885
+ paintedReplies = offered.map((r, i) => ({ id: `${s._convId}:${s._turnId}:${quickReplyOffer}:qr${i + 1}`, label: quickReplyLabel(r.label), reply: r.reply }));
2886
+ }
2877
2887
  return paintedReplies;
2878
2888
  };
2879
2889
 
@@ -3361,8 +3371,9 @@ export function createAriaChat(o: AriaChatOptions): AriaChatCore {
3361
3371
  : { ...actioned, attachments: chips, attachmentsHidden };
3362
3372
  if (out.mention !== mentionViewNow) out = { ...out, mention: mentionViewNow };
3363
3373
  const quickReplies = repliesFor(out);
3364
- if (out.quickReplies !== quickReplies || out.quickRepliesHidden !== (quickReplies.length === 0)) {
3365
- out = { ...out, quickReplies, quickRepliesHidden: quickReplies.length === 0 };
3374
+ const quickRepliesHidden = out.status !== "ready" || quickReplies.length === 0;
3375
+ if (out.quickReplies !== quickReplies || out.quickRepliesHidden !== quickRepliesHidden) {
3376
+ out = { ...out, quickReplies, quickRepliesHidden };
3366
3377
  }
3367
3378
  if (out._realtime !== realtime) out = { ...out, _realtime: realtime };
3368
3379
  // Every state the runtime commits passes through here (an `undefined`
@@ -3651,6 +3662,14 @@ export function createAriaChat(o: AriaChatOptions): AriaChatCore {
3651
3662
  return send(s, content, chips);
3652
3663
  },
3653
3664
 
3665
+ submitQuickReply: async (s, arg) => {
3666
+ if (s.status !== "ready" || s._siteId !== siteOf()) return s;
3667
+ const id = typeof arg === "string" ? arg : firstString(arg?.id);
3668
+ const offered = repliesFor(s).find((reply) => reply.id === id);
3669
+ if (!offered) return s;
3670
+ return impl.submitPrompt(s, { text: offered.reply });
3671
+ },
3672
+
3654
3673
  // A suggested-prompt chip submits its own text through the SAME path a typed
3655
3674
  // message takes — never by dispatching `submit` through the service handle,
3656
3675
  // which exposes actions as direct methods and has no `.actions` member on
@@ -4440,6 +4459,7 @@ export function createAriaChat(o: AriaChatOptions): AriaChatCore {
4440
4459
  // turn running, and a tick resolving around it must go on reporting that
4441
4460
  // turn normally.
4442
4461
  turnSeq += 1;
4462
+ live.reset("", "");
4443
4463
  return slow(withDraft(
4444
4464
  { ...s, status: "ready", statusText: stoppedText(), error: "", _pending: "", _abortId: "" }, typedAt));
4445
4465
  },
@@ -4599,6 +4619,12 @@ export function createAriaChat(o: AriaChatOptions): AriaChatCore {
4599
4619
  return gated(revision !== draftSeq && next.input === s.input && committed
4600
4620
  ? { ...next, input: committed.input } : next);
4601
4621
  },
4622
+ submitQuickReply: async (s, arg) => {
4623
+ const revision = draftSeq;
4624
+ const next = await impl.submitQuickReply(s, arg);
4625
+ return gated(revision !== draftSeq && next.input === s.input && committed
4626
+ ? { ...next, input: committed.input } : next);
4627
+ },
4602
4628
  newChat: (s) => impl.newChat(s).then(gated),
4603
4629
  typing: (s, arg) => gated(impl.typing(s, arg)),
4604
4630
  tick: (s) => impl.tick(s).then((r) => (r ? gated(r) : r)),
@@ -55,6 +55,8 @@ import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
55
55
  import { OWNER_MODULES, ownerModuleIds, ownerModuleScreen } from "../_shared/owner-modules.js";
56
56
 
57
57
  const SERVICE = "himiOwnerLiteAria";
58
+ /** The current turn's quick-reply row — this run's state only, never restored. */
59
+ const QUICK_REPLY_KEYS: Array<"quickReplies" | "quickRepliesHidden"> = ["quickReplies", "quickRepliesHidden"];
58
60
 
59
61
  // Cadence for the reply ladder. `fast` while a reply is outstanding; `idle`
60
62
  // afterwards, because a worker cannot CANCEL a poll — PollDirective has no stop
@@ -477,6 +479,7 @@ const svc = defineService<AriaChatState, {
477
479
  load: (s: AriaChatState, arg?: AriaActionArg) => Promise<AriaChatState>;
478
480
  submit: (s: AriaChatState, arg?: AriaActionArg) => Promise<AriaChatState>;
479
481
  submitPrompt: (s: AriaChatState, arg?: AriaActionArg) => Promise<AriaChatState>;
482
+ submitQuickReply: (s: AriaChatState, arg?: AriaActionArg) => Promise<AriaChatState>;
480
483
  newChat: (s: AriaChatState) => Promise<AriaChatState>;
481
484
  typing: (s: AriaChatState, arg?: AriaActionArg) => AriaChatState;
482
485
  // `undefined` is part of the contract, not sloppiness: a tick whose read was
@@ -527,6 +530,10 @@ const svc = defineService<AriaChatState, {
527
530
  suggestionsSettled: (s: AriaChatState, arg?: AriaActionArg) => AriaChatState | undefined;
528
531
  }>(SERVICE, {
529
532
  state: core.initialState,
533
+ // Quick replies belong to the turn that is live in THIS run's realtime model. A
534
+ // persisted row would paint (and announce) last session's offers before `load`,
535
+ // and every tap on them would be refused, because the live model starts empty.
536
+ notHydrated: QUICK_REPLY_KEYS,
530
537
  actions: {
531
538
  // `load` is the onAppear dispatch, so it is where the copy pack arrives.
532
539
  load: (s, arg) => { mentionDraftRevision += 1; mentionTriggerPrefixes = []; pendingMentionTrigger = null; previousMentionRaw = ""; adoptedMentionDraft = null; stashCopy(arg); stashTargets(arg); stashRealtimeUrl(arg); return core.load(s); },
@@ -552,6 +559,18 @@ const svc = defineService<AriaChatState, {
552
559
  }
553
560
  return next;
554
561
  },
562
+ // A server-offered quick reply sends through submitPrompt in the core, so it
563
+ // settles the mention draft exactly as a suggested-prompt tap does.
564
+ submitQuickReply: async (s, arg) => {
565
+ const previousPrefixes = mentionTriggerPrefixes; const previousTrigger = pendingMentionTrigger;
566
+ const revision = mentionDraftRevision;
567
+ const next = await core.submitQuickReply(s, arg);
568
+ if (revision === mentionDraftRevision) {
569
+ if (next.input && next.input === s.input) { mentionTriggerPrefixes = previousPrefixes; pendingMentionTrigger = previousTrigger; }
570
+ else { mentionTriggerPrefixes = []; pendingMentionTrigger = null; previousMentionRaw = ""; adoptedMentionDraft = null; }
571
+ }
572
+ return next;
573
+ },
555
574
  newChat: (s) => { mentionDraftRevision += 1; mentionTriggerPrefixes = []; pendingMentionTrigger = null; previousMentionRaw = ""; adoptedMentionDraft = null; return core.newChat(s); },
556
575
  // The composer's onChange. Mirrors the draft into state so `submit` can
557
576
  // empty it and the field actually clears.
@@ -648,6 +667,16 @@ const svc = defineService<AriaChatState, {
648
667
  },
649
668
  });
650
669
 
670
+ // A binary older than `notHydrated` restores the persisted row anyway; put those keys
671
+ // back to their declared values before any action runs (as iap-worker's
672
+ // resetUnhydratedKeysOnOlderRuntime does), so no host paints a previous run's offers.
673
+ if ((globalThis as { himalaya?: { hydrationOptOut?: unknown } }).himalaya?.hydrationOptOut !== true) {
674
+ const booted = svc.getState() as unknown as Record<string, unknown> | undefined;
675
+ if (booted && typeof booted === "object") {
676
+ for (const key of QUICK_REPLY_KEYS) booted[key] = (core.initialState as unknown as Record<string, unknown>)[key];
677
+ }
678
+ }
679
+
651
680
  // NO module-scope `svc.load()`, deliberately — the descriptor's `onAppear` is the
652
681
  // only entry point, and on Android the self-kick did not merely duplicate it, it
653
682
  // DISABLED the screen.
@@ -7,6 +7,7 @@ import config from "../config.js";
7
7
  const runtimeSetting = (value: unknown): unknown => {
8
8
  if (value === "__HIMI_PODCAST_FEED_URL__") return process.env.PODCAST_FEED_URL?.trim() || "";
9
9
  if (value === "__HIMI_MEMBER_SITE_URL__") return String((config as { auth?: { config?: { siteUrl?: unknown } } }).auth?.config?.siteUrl ?? "").trim();
10
+ if (typeof value === "string" && value.startsWith("__HIMI_MEMBER_SITE_URL__/")) return String((config as { auth?: { config?: { siteUrl?: unknown } } }).auth?.config?.siteUrl ?? "").trim().replace(/\/+$/, "") + value.slice(24);
10
11
  if (Array.isArray(value)) return value.map(runtimeSetting);
11
12
  if (!value || typeof value !== "object") return value;
12
13
  return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, runtimeSetting(child)]));
@@ -1,33 +1,44 @@
1
1
  import { dispatch } from "@himalaya/dispatch";
2
2
  import { getMyData } from "@himalaya/wix-users";
3
3
 
4
- export interface MemberAccess { email: string; scope: string; }
4
+ export interface MemberAccess { email: string; scope: string; signedIn?: boolean; }
5
5
  export function memberAccessChanged(): Error {
6
6
  const error = new Error("Member access changed"); error.name = "MemberAccessChanged"; return error;
7
7
  }
8
- export async function memberAccess(): Promise<MemberAccess> {
8
+ export async function memberAccess(options: { throwOnUnavailable?: boolean } = {}): Promise<MemberAccess> {
9
9
  let email = "";
10
+ let signedIn = false;
10
11
  let identityUnavailable = false;
11
12
  try {
12
- const value = await dispatch("himi.wix.memberIdentity") as { email?: unknown; payload?: { email?: unknown } } | null;
13
+ const value = await dispatch("himi.wix.memberIdentity") as { status?: unknown; ok?: unknown; email?: unknown; signedIn?: unknown; payload?: { email?: unknown; signedIn?: unknown } } | null;
14
+ if (value?.status === "error" || value?.ok === false) throw value;
13
15
  const raw = value?.email ?? value?.payload?.email;
14
16
  email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
17
+ signedIn = (value?.signedIn ?? value?.payload?.signedIn) === true;
15
18
  } catch { identityUnavailable = true; }
16
19
  // Older native hosts predate the memberIdentity action but can still expose
17
20
  // the authenticated profile through wix-users. Only a missing action uses
18
- // that rung: an explicit empty current-session response remains a visitor.
21
+ // that rung. A successful host response is authoritative, including a signed-in
22
+ // session whose email has not arrived yet; it must not consult owner records.
19
23
  if (!email && identityUnavailable) {
20
24
  try {
21
25
  const profile = await getMyData();
22
26
  const raw = profile.email ?? profile.contactEmail;
23
27
  email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
24
- } catch { /* A visitor or an unavailable legacy profile remains anonymous. */ }
28
+ } catch (error) {
29
+ const failure = error as { status?: unknown; statusCode?: unknown; code?: unknown } | null;
30
+ const anonymous = failure?.status === 401 || failure?.statusCode === 401 || failure?.code === "UNAUTHENTICATED";
31
+ // Legacy bridges can lose the structured status. An unknown failure is
32
+ // unavailable in strict consumers, never evidence of a signed-out session.
33
+ if (options.throwOnUnavailable && !anonymous) throw error;
34
+ }
25
35
  }
26
36
  const input = (globalThis as { himalaya?: { input?: Record<string, unknown> } }).himalaya?.input;
27
37
  const account = input?.__himiPreferenceAccount, business = input?.__himiPreferenceBusiness;
28
38
  const valid = (v: unknown): v is string => typeof v === "string" && /^[A-Za-z0-9_.:-]{1,128}$/.test(v) && v !== "default";
29
39
  // These fields are overwritten by authenticated hosts. Older binaries stay online-only.
30
- return { email, scope: email && valid(account) && valid(business) ? JSON.stringify([account, business, email]) : "" };
40
+ // A session signal does not grant an email-scoped cache or private query.
41
+ return { email, signedIn: signedIn || Boolean(email), scope: email && valid(account) && valid(business) ? JSON.stringify([account, business, email]) : "" };
31
42
  }
32
43
  export async function assertMemberAccess(member: MemberAccess): Promise<void> {
33
44
  const current = await memberAccess();
@@ -565,6 +565,9 @@ interface S extends IapRestoreFields {
565
565
  lastNameFocus: string;
566
566
  emailFocus: string;
567
567
  message: string;
568
+ hideMessage: boolean;
569
+ messageKind: "error" | "success";
570
+ resetSent: boolean;
568
571
  isLoading: boolean;
569
572
  notLoading: boolean;
570
573
  isRegistering: boolean;
@@ -640,6 +643,9 @@ function derive(s: S): S {
640
643
  const name = s.isMember ? greetingName(s.memberName) : "";
641
644
  return {
642
645
  ...s,
646
+ hideMessage: !s.message,
647
+ messageKind: s.resetSent ? "success" : "error",
648
+ resetSent: !!s.message && !!s.resetSent,
643
649
  greeting: name
644
650
  ? copyTemplate("storeAccount.greetingMember", "Hey, {name}", { name })
645
651
  : copyParam("storeAccount.greetingGuest", "Hey, guest"),
@@ -815,7 +821,7 @@ const svc = defineService<S, {
815
821
  restorePublish: (s: S) => S;
816
822
  iapRestore: (s: S) => Promise<undefined>;
817
823
  }>("himiStoreAccount", {
818
- notHydrated: ["password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
824
+ notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
819
825
  state: derive({
820
826
  status: "loading",
821
827
  isMember: false,
@@ -846,6 +852,9 @@ const svc = defineService<S, {
846
852
  lastNameFocus: "",
847
853
  emailFocus: "",
848
854
  message: "",
855
+ hideMessage: true,
856
+ messageKind: "error",
857
+ resetSent: false,
849
858
  isLoading: true,
850
859
  notLoading: false,
851
860
  // The form's first paint is already on its route's mode: only sign-in's route has `mode`.
@@ -942,10 +951,10 @@ const svc = defineService<S, {
942
951
  rejectResult(raw, "reset");
943
952
  if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
944
953
  return derive({ ...svc.getState(), authBusy: false, isRecovering: false,
945
- message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
954
+ resetSent: true, message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
946
955
  } catch (error) {
947
956
  return derive({ ...svc.getState(), authBusy: false,
948
- message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
957
+ resetSent: false, message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
949
958
  } finally { authInFlight = false; }
950
959
  },
951
960
  signIn: (s) => authenticate(s, "signIn"),
@@ -991,7 +1000,7 @@ const svc = defineService<S, {
991
1000
  },
992
1001
  });
993
1002
 
994
- resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), [...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
1003
+ resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
995
1004
  // `boot` tells settle this is not a visit: the host drops this call's navigation, and the
996
1005
  // appear refresh does the visit's moves.
997
1006
  svc.load({ boot: "1" });
@@ -8,6 +8,7 @@ const runtimeSetting = (value: unknown): unknown => {
8
8
  if (value === "__HIMI_PODCAST_FEED_URL__") return process.env.PODCAST_FEED_URL?.trim() || "";
9
9
  if (value === "__HIMI_MEMBER_PHOTO_UPLOAD_FUNCTION__") return process.env.HIMI_BRANDED_LITE_MEMBER_PHOTO_UPLOAD_FUNCTION?.trim() || "";
10
10
  if (value === "__HIMI_MEMBER_SITE_URL__") return String((config as { auth?: { config?: { siteUrl?: unknown } } }).auth?.config?.siteUrl ?? "").trim();
11
+ if (typeof value === "string" && value.startsWith("__HIMI_MEMBER_SITE_URL__/")) return String((config as { auth?: { config?: { siteUrl?: unknown } } }).auth?.config?.siteUrl ?? "").trim().replace(/\/+$/, "") + value.slice(24);
11
12
  if (Array.isArray(value)) return value.map(runtimeSetting);
12
13
  if (!value || typeof value !== "object") return value;
13
14
  return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, runtimeSetting(child)]));
@@ -1,33 +1,44 @@
1
1
  import { dispatch } from "@himalaya/dispatch";
2
2
  import { getMyData } from "@himalaya/wix-users";
3
3
 
4
- export interface MemberAccess { email: string; scope: string; }
4
+ export interface MemberAccess { email: string; scope: string; signedIn?: boolean; }
5
5
  export function memberAccessChanged(): Error {
6
6
  const error = new Error("Member access changed"); error.name = "MemberAccessChanged"; return error;
7
7
  }
8
- export async function memberAccess(): Promise<MemberAccess> {
8
+ export async function memberAccess(options: { throwOnUnavailable?: boolean } = {}): Promise<MemberAccess> {
9
9
  let email = "";
10
+ let signedIn = false;
10
11
  let identityUnavailable = false;
11
12
  try {
12
- const value = await dispatch("himi.wix.memberIdentity") as { email?: unknown; payload?: { email?: unknown } } | null;
13
+ const value = await dispatch("himi.wix.memberIdentity") as { status?: unknown; ok?: unknown; email?: unknown; signedIn?: unknown; payload?: { email?: unknown; signedIn?: unknown } } | null;
14
+ if (value?.status === "error" || value?.ok === false) throw value;
13
15
  const raw = value?.email ?? value?.payload?.email;
14
16
  email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
17
+ signedIn = (value?.signedIn ?? value?.payload?.signedIn) === true;
15
18
  } catch { identityUnavailable = true; }
16
19
  // Older native hosts predate the memberIdentity action but can still expose
17
20
  // the authenticated profile through wix-users. Only a missing action uses
18
- // that rung: an explicit empty current-session response remains a visitor.
21
+ // that rung. A successful host response is authoritative, including a signed-in
22
+ // session whose email has not arrived yet; it must not consult owner records.
19
23
  if (!email && identityUnavailable) {
20
24
  try {
21
25
  const profile = await getMyData();
22
26
  const raw = profile.email ?? profile.contactEmail;
23
27
  email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
24
- } catch { /* A visitor or an unavailable legacy profile remains anonymous. */ }
28
+ } catch (error) {
29
+ const failure = error as { status?: unknown; statusCode?: unknown; code?: unknown } | null;
30
+ const anonymous = failure?.status === 401 || failure?.statusCode === 401 || failure?.code === "UNAUTHENTICATED";
31
+ // Legacy bridges can lose the structured status. An unknown failure is
32
+ // unavailable in strict consumers, never evidence of a signed-out session.
33
+ if (options.throwOnUnavailable && !anonymous) throw error;
34
+ }
25
35
  }
26
36
  const input = (globalThis as { himalaya?: { input?: Record<string, unknown> } }).himalaya?.input;
27
37
  const account = input?.__himiPreferenceAccount, business = input?.__himiPreferenceBusiness;
28
38
  const valid = (v: unknown): v is string => typeof v === "string" && /^[A-Za-z0-9_.:-]{1,128}$/.test(v) && v !== "default";
29
39
  // These fields are overwritten by authenticated hosts. Older binaries stay online-only.
30
- return { email, scope: email && valid(account) && valid(business) ? JSON.stringify([account, business, email]) : "" };
40
+ // A session signal does not grant an email-scoped cache or private query.
41
+ return { email, signedIn: signedIn || Boolean(email), scope: email && valid(account) && valid(business) ? JSON.stringify([account, business, email]) : "" };
31
42
  }
32
43
  export async function assertMemberAccess(member: MemberAccess): Promise<void> {
33
44
  const current = await memberAccess();
@@ -10,6 +10,17 @@ import { dayKey } from "@himalaya/time";
10
10
  * booking is in exactly one tab. */
11
11
  export const CANCELLED_STATUSES = ["CANCELED", "CANCELLED", "DECLINED"];
12
12
 
13
+ /** Wix made the booking, but no checkout confirmed it: a paid booking the member did not pay
14
+ * for, or left in the payment page, stays here. It holds no place and the business does not
15
+ * see it in its booking calendar, so it is not an appointment. */
16
+ export const UNCONFIRMED_STATUSES = ["CREATED"];
17
+
18
+ export interface FetchMemberBookingsOptions {
19
+ /** Keep the unconfirmed bookings (`UNCONFIRMED_STATUSES`). Only a list that marks them as
20
+ * not confirmed may ask for them; Home and every count leave them out. */
21
+ includeUnconfirmed?: boolean;
22
+ }
23
+
13
24
  export interface MemberBookingRow {
14
25
  id: string; title: string; subtitle: string; status: string; revision: string;
15
26
  start: string; end: string; day: string; serviceId: string;
@@ -70,7 +81,7 @@ export function memberBookingRow(booking: WixBooking): MemberBookingRow {
70
81
  courseStart: instant(schedule?.firstSessionStart),
71
82
  courseEnd: instant(schedule?.lastSessionEnd) };
72
83
  }
73
- export async function fetchMemberBookings(criteria: CollectionQuery, cursor: string, now: string, expected?: MemberAccess) {
84
+ export async function fetchMemberBookings(criteria: CollectionQuery, cursor: string, now: string, expected?: MemberAccess, options: FetchMemberBookingsOptions = {}) {
74
85
  const member = expected ?? await memberAccess();
75
86
  const metadata = { email: member.email, scope: member.scope, needsSignIn: !member.email };
76
87
  if (!member.email) return { items: [] as MemberBookingRow[], nextCursor: "", metadata };
@@ -79,9 +90,10 @@ export async function fetchMemberBookings(criteria: CollectionQuery, cursor: str
79
90
  const filter: Record<string, unknown> = { "contactDetails.email": { $eq: member.email } };
80
91
  if (criteria.query) filter.id = { $eq: criteria.query };
81
92
  if (criteria.filter === "saved") filter.id = criteria.query ? { $in: criteria.savedIds.filter(id => id === criteria.query) } : { $in: criteria.savedIds };
82
- if (criteria.filter === "value:Upcoming") { filter.startDate = { $gte: now }; filter.status = { $nin: CANCELLED_STATUSES }; }
93
+ const notListed = options.includeUnconfirmed ? CANCELLED_STATUSES : [...CANCELLED_STATUSES, ...UNCONFIRMED_STATUSES];
94
+ if (criteria.filter === "value:Upcoming") { filter.startDate = { $gte: now }; filter.status = { $nin: notListed }; }
83
95
  // Past is what took place: a canceled or declined booking is in the Canceled tab only.
84
- if (criteria.filter === "value:Past") { filter.startDate = { $lt: now }; filter.status = { $nin: CANCELLED_STATUSES }; }
96
+ if (criteria.filter === "value:Past") { filter.startDate = { $lt: now }; filter.status = { $nin: notListed }; }
85
97
  if (criteria.filter === "value:Cancelled") filter.status = { $in: CANCELLED_STATUSES };
86
98
  const response = await queryBookings({ query: { filter, paging: { limit: 50, offset: Number(cursor || 0) },
87
99
  sort: [{ fieldName: "startDate", order: criteria.sort === "za" ? "DESC" : "ASC" }, { fieldName: "id", order: "ASC" }] } });
@@ -89,6 +101,7 @@ export async function fetchMemberBookings(criteria: CollectionQuery, cursor: str
89
101
  const raw = response.bookings ?? [];
90
102
  // Server authorization remains authoritative. This guard also rejects a
91
103
  // malformed/cross-member row before any UI projection. No private disk cache.
92
- const items = raw.filter(booking => booking.id && booking.contactDetails?.email?.trim().toLowerCase() === member.email).map(memberBookingRow);
104
+ const items = raw.filter(booking => booking.id && booking.contactDetails?.email?.trim().toLowerCase() === member.email).map(memberBookingRow)
105
+ .filter(row => options.includeUnconfirmed || !UNCONFIRMED_STATUSES.includes(row.statusKey));
93
106
  return { items, ...offsetPage(cursor, raw.length, 50, response.pagingMetadata), metadata };
94
107
  }
@@ -565,6 +565,9 @@ interface S extends IapRestoreFields {
565
565
  lastNameFocus: string;
566
566
  emailFocus: string;
567
567
  message: string;
568
+ hideMessage: boolean;
569
+ messageKind: "error" | "success";
570
+ resetSent: boolean;
568
571
  isLoading: boolean;
569
572
  notLoading: boolean;
570
573
  isRegistering: boolean;
@@ -640,6 +643,9 @@ function derive(s: S): S {
640
643
  const name = s.isMember ? greetingName(s.memberName) : "";
641
644
  return {
642
645
  ...s,
646
+ hideMessage: !s.message,
647
+ messageKind: s.resetSent ? "success" : "error",
648
+ resetSent: !!s.message && !!s.resetSent,
643
649
  greeting: name
644
650
  ? copyTemplate("storeAccount.greetingMember", "Hey, {name}", { name })
645
651
  : copyParam("storeAccount.greetingGuest", "Hey, guest"),
@@ -815,7 +821,7 @@ const svc = defineService<S, {
815
821
  restorePublish: (s: S) => S;
816
822
  iapRestore: (s: S) => Promise<undefined>;
817
823
  }>("himiStoreAccount", {
818
- notHydrated: ["password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
824
+ notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
819
825
  state: derive({
820
826
  status: "loading",
821
827
  isMember: false,
@@ -846,6 +852,9 @@ const svc = defineService<S, {
846
852
  lastNameFocus: "",
847
853
  emailFocus: "",
848
854
  message: "",
855
+ hideMessage: true,
856
+ messageKind: "error",
857
+ resetSent: false,
849
858
  isLoading: true,
850
859
  notLoading: false,
851
860
  // The form's first paint is already on its route's mode: only sign-in's route has `mode`.
@@ -942,10 +951,10 @@ const svc = defineService<S, {
942
951
  rejectResult(raw, "reset");
943
952
  if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
944
953
  return derive({ ...svc.getState(), authBusy: false, isRecovering: false,
945
- message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
954
+ resetSent: true, message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
946
955
  } catch (error) {
947
956
  return derive({ ...svc.getState(), authBusy: false,
948
- message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
957
+ resetSent: false, message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
949
958
  } finally { authInFlight = false; }
950
959
  },
951
960
  signIn: (s) => authenticate(s, "signIn"),
@@ -991,7 +1000,7 @@ const svc = defineService<S, {
991
1000
  },
992
1001
  });
993
1002
 
994
- resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), [...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
1003
+ resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
995
1004
  // `boot` tells settle this is not a visit: the host drops this call's navigation, and the
996
1005
  // appear refresh does the visit's moves.
997
1006
  svc.load({ boot: "1" });
@@ -11,7 +11,7 @@ import { getMyData, displayName } from "@himalaya/wix-users";
11
11
  // `load` has resolved a member, so a guest never glimpses the placeholder avatar while
12
12
  // the membership check is still running; `hideLoading` is false for exactly that moment,
13
13
  // so the screen shows a loading line instead of going blank.
14
- interface S { status: "loading" | "ready"; name: string; handle: string; about: string; initial: string; photo: string; needsSignIn: boolean; noSignIn: boolean; profileHidden: boolean; hideLoading: boolean }
14
+ interface S { status: "loading" | "ready"; name: string; handle: string; about: string; initial: string; photo: string; needsSignIn: boolean; noSignIn: boolean; profileHidden: boolean; hideLoading: boolean; hideError: boolean; hideAbout: boolean }
15
15
 
16
16
  const EMPTY: S = {
17
17
  status: "loading",
@@ -24,6 +24,8 @@ const EMPTY: S = {
24
24
  noSignIn: true,
25
25
  profileHidden: true,
26
26
  hideLoading: false,
27
+ hideError: true,
28
+ hideAbout: false,
27
29
  };
28
30
 
29
31
  // The SAME member check create-post and orders use (`memberAccess`: the host's
@@ -41,66 +43,77 @@ function fromParts(name: string, handleRaw: string, about: string, photo = ""):
41
43
  const clean = name.trim();
42
44
  const handle = "@" + (handleRaw || clean || "member").replace(/\s+/g, "").replace(/^@+/, "").toLowerCase();
43
45
  const initial = (clean.split(/\s+/).filter(Boolean).map((w) => w[0]).join("").slice(0, 2) || "?").toUpperCase();
44
- return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo, needsSignIn: false, noSignIn: true, profileHidden: false, hideLoading: true };
46
+ return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo, needsSignIn: false, noSignIn: true, profileHidden: false, hideLoading: true, hideError: true, hideAbout: false };
45
47
  }
46
48
 
47
- const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesViewProfile", {
49
+ async function readProfile(): Promise<S> {
50
+ const email = await sessionEmail();
51
+ if (!email) {
52
+ return {
53
+ status: "ready",
54
+ // Kept for hosts without the shared member gate (the Spaces clone renders these
55
+ // fields directly); branded-lite hides the profile block behind `profileHidden`.
56
+ name: "Sign in to view your profile",
57
+ handle: "",
58
+ about: "Your public profile is available after you sign in from Account.",
59
+ initial: "?",
60
+ photo: "",
61
+ needsSignIn: true,
62
+ noSignIn: false,
63
+ profileHidden: true,
64
+ hideLoading: true,
65
+ hideError: true,
66
+ hideAbout: false,
67
+ };
68
+ }
69
+ try {
70
+ const api = wixApi();
71
+ if (api) {
72
+ const res = (await api.call("GET", "/members/v1/members/my?fieldSet=FULL")) as {
73
+ member?: {
74
+ loginEmail?: string;
75
+ contact?: { firstName?: string; lastName?: string };
76
+ profile?: { nickname?: string; slug?: string; title?: string; photo?: { url?: string } };
77
+ };
78
+ };
79
+ const m = res.member;
80
+ if (m) {
81
+ const nick = m.profile?.nickname?.trim() || "";
82
+ const full = [m.contact?.firstName, m.contact?.lastName].filter(Boolean).join(" ").trim();
83
+ const name = full || nick || m.loginEmail || email;
84
+ const slug = m.profile?.slug || nick || name;
85
+ const about = m.profile?.title || "No info to display.";
86
+ return fromParts(name, slug, about, m.profile?.photo?.url || "");
87
+ }
88
+ }
89
+ } catch { /* fall through to users my-data / email */ }
90
+ try {
91
+ const d = await getMyData();
92
+ const name = displayName(d) || email;
93
+ const dd = d as unknown as { nickname?: string; slug?: string; about?: string; aboutPlain?: string; profile?: { photo?: { url?: string } }; photo?: { url?: string } };
94
+ return fromParts(
95
+ name,
96
+ dd.slug || dd.nickname || name,
97
+ dd.aboutPlain || dd.about || "No info to display.",
98
+ dd.profile?.photo?.url || dd.photo?.url || "",
99
+ );
100
+ } catch {
101
+ // Session identity is still known; missing profile data is not an empty biography.
102
+ return { ...fromParts(email, email.split("@")[0] || email, ""), about: "Profile details could not be loaded. Please try again.", hideError: false, hideAbout: true };
103
+ }
104
+ }
105
+ let generation = 0;
106
+ const svc = defineService<S, { load: (s: S) => Promise<S | undefined> }>("spacesViewProfile", {
48
107
  state: { ...EMPTY },
108
+ notHydrated: Object.keys(EMPTY) as (keyof S & string)[],
49
109
  actions: {
50
110
  load: async () => {
51
- const email = await sessionEmail();
52
- if (!email) {
53
- return {
54
- status: "ready",
55
- // Kept for hosts without the shared member gate (the Spaces clone renders these
56
- // fields directly); branded-lite hides the profile block behind `profileHidden`.
57
- name: "Sign in to view your profile",
58
- handle: "",
59
- about: "Your public profile is available after you sign in from Account.",
60
- initial: "?",
61
- photo: "",
62
- needsSignIn: true,
63
- noSignIn: false,
64
- profileHidden: true,
65
- hideLoading: true,
66
- };
67
- }
68
- try {
69
- const api = wixApi();
70
- if (api) {
71
- const res = (await api.call("GET", "/members/v1/members/my?fieldSet=FULL")) as {
72
- member?: {
73
- loginEmail?: string;
74
- contact?: { firstName?: string; lastName?: string };
75
- profile?: { nickname?: string; slug?: string; title?: string; photo?: { url?: string } };
76
- };
77
- };
78
- const m = res.member;
79
- if (m) {
80
- const nick = m.profile?.nickname?.trim() || "";
81
- const full = [m.contact?.firstName, m.contact?.lastName].filter(Boolean).join(" ").trim();
82
- const name = full || nick || m.loginEmail || email;
83
- const slug = m.profile?.slug || nick || name;
84
- const about = m.profile?.title || "No info to display.";
85
- return fromParts(name, slug, about, m.profile?.photo?.url || "");
86
- }
87
- }
88
- } catch { /* fall through to users my-data / email */ }
89
- try {
90
- const d = await getMyData();
91
- const name = displayName(d) || email;
92
- const dd = d as unknown as { nickname?: string; slug?: string; about?: string; aboutPlain?: string; profile?: { photo?: { url?: string } }; photo?: { url?: string } };
93
- return fromParts(
94
- name,
95
- dd.slug || dd.nickname || name,
96
- dd.aboutPlain || dd.about || "No info to display.",
97
- dd.profile?.photo?.url || dd.photo?.url || "",
98
- );
99
- } catch {
100
- return fromParts(email, email.split("@")[0] || email, "No info to display.");
101
- }
111
+ const request = ++generation;
112
+ const next = await readProfile();
113
+ return request === generation ? next : undefined;
102
114
  },
103
115
  },
104
116
  });
105
- svc.load();
117
+ if (!(globalThis as { himalaya?: { hydrationOptOut?: boolean } }).himalaya?.hydrationOptOut) Object.assign(svc.getState(), EMPTY);
118
+ void svc.load();
106
119
  export { svc };