@wix/himalaya-cli 0.1866.0 → 0.1867.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 (390) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/copy.generated.d.ts +17 -7
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/feedback.d.ts +1 -1
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/auth.mjs +55 -11
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +55 -11
  5. package/dist/browser-plane/assets.json +5 -5
  6. package/dist/browser-plane/preview-deferred/{a60c092217d4c21970ff66e8b63221007e49d0792eb9d5fe66238f8efbce884a.bin → 4a8928bb82fc0db03269e14445bfc09155ceb3cde1f268162ac70b7ceb097b1f.bin} +1 -1
  7. package/dist/browser-plane/sw.js +9 -9
  8. package/dist/cli.mjs +44 -42
  9. package/dist/preview-assets.generated.bin +0 -0
  10. package/guides/designing-himi-screens.md +1 -0
  11. package/package.json +2 -2
  12. package/templates/bare-fashion/tier5-src/_shared/himi-account.ts +14 -1
  13. package/templates/beauty-salon/dev/index.ts +122 -8
  14. package/templates/beauty-salon/l10n/ar.json +5 -0
  15. package/templates/beauty-salon/l10n/cs.json +5 -0
  16. package/templates/beauty-salon/l10n/da.json +5 -0
  17. package/templates/beauty-salon/l10n/de.json +5 -0
  18. package/templates/beauty-salon/l10n/el.json +5 -0
  19. package/templates/beauty-salon/l10n/en.json +1 -1
  20. package/templates/beauty-salon/l10n/es.json +5 -0
  21. package/templates/beauty-salon/l10n/fi.json +5 -0
  22. package/templates/beauty-salon/l10n/fr.json +5 -0
  23. package/templates/beauty-salon/l10n/he.json +4 -0
  24. package/templates/beauty-salon/l10n/hu.json +5 -0
  25. package/templates/beauty-salon/l10n/id.json +5 -0
  26. package/templates/beauty-salon/l10n/it.json +5 -0
  27. package/templates/beauty-salon/l10n/ja.json +5 -0
  28. package/templates/beauty-salon/l10n/ko.json +5 -0
  29. package/templates/beauty-salon/l10n/lt.json +5 -0
  30. package/templates/beauty-salon/l10n/nl.json +5 -0
  31. package/templates/beauty-salon/l10n/no.json +5 -0
  32. package/templates/beauty-salon/l10n/pl.json +5 -0
  33. package/templates/beauty-salon/l10n/pt.json +5 -0
  34. package/templates/beauty-salon/l10n/ru.json +5 -0
  35. package/templates/beauty-salon/l10n/sv.json +5 -0
  36. package/templates/beauty-salon/l10n/th.json +5 -0
  37. package/templates/beauty-salon/l10n/tr.json +5 -0
  38. package/templates/beauty-salon/l10n/uk.json +5 -0
  39. package/templates/beauty-salon/l10n/vi.json +5 -0
  40. package/templates/beauty-salon/l10n/zh.json +5 -0
  41. package/templates/beauty-salon/tier5-src/_shared/himi-account.ts +14 -1
  42. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +192 -28
  43. package/templates/beauty-salon-owner/tier5-src/_shared/himi-account.ts +14 -1
  44. package/templates/branded-lite/dev/index.ts +732 -583
  45. package/templates/branded-lite/l10n/ar.json +5 -0
  46. package/templates/branded-lite/l10n/cs.json +5 -0
  47. package/templates/branded-lite/l10n/da.json +5 -0
  48. package/templates/branded-lite/l10n/de.json +5 -0
  49. package/templates/branded-lite/l10n/el.json +5 -0
  50. package/templates/branded-lite/l10n/en.json +2 -2
  51. package/templates/branded-lite/l10n/es.json +5 -0
  52. package/templates/branded-lite/l10n/fi.json +5 -0
  53. package/templates/branded-lite/l10n/fr.json +5 -0
  54. package/templates/branded-lite/l10n/he.json +4 -0
  55. package/templates/branded-lite/l10n/hu.json +5 -0
  56. package/templates/branded-lite/l10n/id.json +5 -0
  57. package/templates/branded-lite/l10n/it.json +5 -0
  58. package/templates/branded-lite/l10n/ja.json +5 -0
  59. package/templates/branded-lite/l10n/ko.json +5 -0
  60. package/templates/branded-lite/l10n/lt.json +5 -0
  61. package/templates/branded-lite/l10n/nl.json +5 -0
  62. package/templates/branded-lite/l10n/no.json +5 -0
  63. package/templates/branded-lite/l10n/pl.json +5 -0
  64. package/templates/branded-lite/l10n/pt.json +5 -0
  65. package/templates/branded-lite/l10n/ru.json +5 -0
  66. package/templates/branded-lite/l10n/sv.json +5 -0
  67. package/templates/branded-lite/l10n/th.json +5 -0
  68. package/templates/branded-lite/l10n/tr.json +5 -0
  69. package/templates/branded-lite/l10n/uk.json +5 -0
  70. package/templates/branded-lite/l10n/vi.json +5 -0
  71. package/templates/branded-lite/l10n/zh.json +5 -0
  72. package/templates/branded-lite/tier5-src/_shared/business-chat-presenter.ts +11 -0
  73. package/templates/branded-lite/tier5-src/_shared/himi-account.ts +14 -1
  74. package/templates/branded-lite/tier5-src/business-chat/index.ts +20 -6
  75. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +192 -28
  76. package/templates/brandy/tier5-src/_shared/himi-account.ts +14 -1
  77. package/templates/brandy/tier5-src/himi-store-account/index.ts +192 -28
  78. package/templates/community-club/dev/index.ts +122 -8
  79. package/templates/community-club/l10n/ar.json +10 -0
  80. package/templates/community-club/l10n/cs.json +10 -0
  81. package/templates/community-club/l10n/da.json +10 -0
  82. package/templates/community-club/l10n/de.json +10 -0
  83. package/templates/community-club/l10n/el.json +10 -0
  84. package/templates/community-club/l10n/en.json +1 -1
  85. package/templates/community-club/l10n/es.json +10 -0
  86. package/templates/community-club/l10n/fi.json +10 -0
  87. package/templates/community-club/l10n/fr.json +10 -0
  88. package/templates/community-club/l10n/he.json +8 -0
  89. package/templates/community-club/l10n/hu.json +10 -0
  90. package/templates/community-club/l10n/id.json +10 -0
  91. package/templates/community-club/l10n/it.json +10 -0
  92. package/templates/community-club/l10n/ja.json +10 -0
  93. package/templates/community-club/l10n/ko.json +10 -0
  94. package/templates/community-club/l10n/lt.json +10 -0
  95. package/templates/community-club/l10n/nl.json +10 -0
  96. package/templates/community-club/l10n/no.json +10 -0
  97. package/templates/community-club/l10n/pl.json +10 -0
  98. package/templates/community-club/l10n/pt.json +10 -0
  99. package/templates/community-club/l10n/ru.json +10 -0
  100. package/templates/community-club/l10n/sv.json +10 -0
  101. package/templates/community-club/l10n/th.json +10 -0
  102. package/templates/community-club/l10n/tr.json +10 -0
  103. package/templates/community-club/l10n/uk.json +10 -0
  104. package/templates/community-club/l10n/vi.json +10 -0
  105. package/templates/community-club/l10n/zh.json +10 -0
  106. package/templates/community-club/tier5-src/_shared/himi-account.ts +14 -1
  107. package/templates/community-club/tier5-src/himi-store-account/index.ts +192 -28
  108. package/templates/community-club-owner/tier5-src/_shared/himi-account.ts +14 -1
  109. package/templates/conference/dev/index.ts +744 -595
  110. package/templates/conference/tier5-src/_shared/business-chat-presenter.ts +11 -0
  111. package/templates/conference/tier5-src/_shared/himi-account.ts +14 -1
  112. package/templates/conference/tier5-src/business-chat/index.ts +20 -6
  113. package/templates/conference/tier5-src/himi-store-account/index.ts +192 -28
  114. package/templates/events-meetups/dev/index.ts +122 -8
  115. package/templates/events-meetups/l10n/ar.json +10 -0
  116. package/templates/events-meetups/l10n/cs.json +10 -0
  117. package/templates/events-meetups/l10n/da.json +10 -0
  118. package/templates/events-meetups/l10n/de.json +10 -0
  119. package/templates/events-meetups/l10n/el.json +10 -0
  120. package/templates/events-meetups/l10n/en.json +1 -1
  121. package/templates/events-meetups/l10n/es.json +10 -0
  122. package/templates/events-meetups/l10n/fi.json +10 -0
  123. package/templates/events-meetups/l10n/fr.json +10 -0
  124. package/templates/events-meetups/l10n/he.json +8 -0
  125. package/templates/events-meetups/l10n/hu.json +10 -0
  126. package/templates/events-meetups/l10n/id.json +10 -0
  127. package/templates/events-meetups/l10n/it.json +10 -0
  128. package/templates/events-meetups/l10n/ja.json +10 -0
  129. package/templates/events-meetups/l10n/ko.json +10 -0
  130. package/templates/events-meetups/l10n/lt.json +10 -0
  131. package/templates/events-meetups/l10n/nl.json +10 -0
  132. package/templates/events-meetups/l10n/no.json +10 -0
  133. package/templates/events-meetups/l10n/pl.json +10 -0
  134. package/templates/events-meetups/l10n/pt.json +10 -0
  135. package/templates/events-meetups/l10n/ru.json +10 -0
  136. package/templates/events-meetups/l10n/sv.json +10 -0
  137. package/templates/events-meetups/l10n/th.json +10 -0
  138. package/templates/events-meetups/l10n/tr.json +10 -0
  139. package/templates/events-meetups/l10n/uk.json +10 -0
  140. package/templates/events-meetups/l10n/vi.json +10 -0
  141. package/templates/events-meetups/l10n/zh.json +10 -0
  142. package/templates/events-meetups/tier5-src/_shared/himi-account.ts +14 -1
  143. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +192 -28
  144. package/templates/events-meetups-owner/tier5-src/_shared/himi-account.ts +14 -1
  145. package/templates/fitness-gym/dev/index.ts +743 -507
  146. package/templates/fitness-gym/tier5-src/_shared/business-chat-presenter.ts +11 -0
  147. package/templates/fitness-gym/tier5-src/_shared/himi-account.ts +14 -1
  148. package/templates/fitness-gym/tier5-src/business-chat/index.ts +20 -6
  149. package/templates/fitness-gym/tier5-src/himi-booking-account/index.ts +14 -3
  150. package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +192 -28
  151. package/templates/gym-fitness/dev/index.ts +122 -8
  152. package/templates/gym-fitness/l10n/ar.json +5 -0
  153. package/templates/gym-fitness/l10n/cs.json +5 -0
  154. package/templates/gym-fitness/l10n/da.json +5 -0
  155. package/templates/gym-fitness/l10n/de.json +5 -0
  156. package/templates/gym-fitness/l10n/el.json +5 -0
  157. package/templates/gym-fitness/l10n/en.json +1 -1
  158. package/templates/gym-fitness/l10n/es.json +5 -0
  159. package/templates/gym-fitness/l10n/fi.json +5 -0
  160. package/templates/gym-fitness/l10n/fr.json +5 -0
  161. package/templates/gym-fitness/l10n/he.json +4 -0
  162. package/templates/gym-fitness/l10n/hu.json +5 -0
  163. package/templates/gym-fitness/l10n/id.json +5 -0
  164. package/templates/gym-fitness/l10n/it.json +5 -0
  165. package/templates/gym-fitness/l10n/ja.json +5 -0
  166. package/templates/gym-fitness/l10n/ko.json +5 -0
  167. package/templates/gym-fitness/l10n/lt.json +5 -0
  168. package/templates/gym-fitness/l10n/nl.json +5 -0
  169. package/templates/gym-fitness/l10n/no.json +5 -0
  170. package/templates/gym-fitness/l10n/pl.json +5 -0
  171. package/templates/gym-fitness/l10n/pt.json +5 -0
  172. package/templates/gym-fitness/l10n/ru.json +5 -0
  173. package/templates/gym-fitness/l10n/sv.json +5 -0
  174. package/templates/gym-fitness/l10n/th.json +5 -0
  175. package/templates/gym-fitness/l10n/tr.json +5 -0
  176. package/templates/gym-fitness/l10n/uk.json +5 -0
  177. package/templates/gym-fitness/l10n/vi.json +5 -0
  178. package/templates/gym-fitness/l10n/zh.json +5 -0
  179. package/templates/gym-fitness/tier5-src/_shared/himi-account.ts +14 -1
  180. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +192 -28
  181. package/templates/gym-fitness-owner/tier5-src/_shared/himi-account.ts +14 -1
  182. package/templates/medical-services/dev/index.ts +747 -595
  183. package/templates/medical-services/tier5-src/_shared/business-chat-presenter.ts +11 -0
  184. package/templates/medical-services/tier5-src/_shared/himi-account.ts +14 -1
  185. package/templates/medical-services/tier5-src/business-chat/index.ts +20 -6
  186. package/templates/medical-services/tier5-src/himi-booking-account/index.ts +14 -3
  187. package/templates/medical-services/tier5-src/himi-store-account/index.ts +192 -28
  188. package/templates/nonprofit-cause/dev/index.ts +122 -8
  189. package/templates/nonprofit-cause/l10n/ar.json +10 -0
  190. package/templates/nonprofit-cause/l10n/cs.json +10 -0
  191. package/templates/nonprofit-cause/l10n/da.json +10 -0
  192. package/templates/nonprofit-cause/l10n/de.json +10 -0
  193. package/templates/nonprofit-cause/l10n/el.json +10 -0
  194. package/templates/nonprofit-cause/l10n/en.json +1 -1
  195. package/templates/nonprofit-cause/l10n/es.json +10 -0
  196. package/templates/nonprofit-cause/l10n/fi.json +10 -0
  197. package/templates/nonprofit-cause/l10n/fr.json +10 -0
  198. package/templates/nonprofit-cause/l10n/he.json +8 -0
  199. package/templates/nonprofit-cause/l10n/hu.json +10 -0
  200. package/templates/nonprofit-cause/l10n/id.json +10 -0
  201. package/templates/nonprofit-cause/l10n/it.json +10 -0
  202. package/templates/nonprofit-cause/l10n/ja.json +10 -0
  203. package/templates/nonprofit-cause/l10n/ko.json +10 -0
  204. package/templates/nonprofit-cause/l10n/lt.json +10 -0
  205. package/templates/nonprofit-cause/l10n/nl.json +10 -0
  206. package/templates/nonprofit-cause/l10n/no.json +10 -0
  207. package/templates/nonprofit-cause/l10n/pl.json +10 -0
  208. package/templates/nonprofit-cause/l10n/pt.json +10 -0
  209. package/templates/nonprofit-cause/l10n/ru.json +10 -0
  210. package/templates/nonprofit-cause/l10n/sv.json +10 -0
  211. package/templates/nonprofit-cause/l10n/th.json +10 -0
  212. package/templates/nonprofit-cause/l10n/tr.json +10 -0
  213. package/templates/nonprofit-cause/l10n/uk.json +10 -0
  214. package/templates/nonprofit-cause/l10n/vi.json +10 -0
  215. package/templates/nonprofit-cause/l10n/zh.json +10 -0
  216. package/templates/nonprofit-cause/tier5-src/_shared/himi-account.ts +14 -1
  217. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +192 -28
  218. package/templates/nonprofit-cause-owner/tier5-src/_shared/himi-account.ts +14 -1
  219. package/templates/owner-lite/tier5-src/_shared/himi-account.ts +14 -1
  220. package/templates/personal-fitness-trainer/dev/index.ts +760 -602
  221. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-presenter.ts +11 -0
  222. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-account.ts +14 -1
  223. package/templates/personal-fitness-trainer/tier5-src/business-chat/index.ts +20 -6
  224. package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +192 -28
  225. package/templates/podcast-creator/dev/index.ts +122 -8
  226. package/templates/podcast-creator/l10n/ar.json +10 -0
  227. package/templates/podcast-creator/l10n/cs.json +10 -0
  228. package/templates/podcast-creator/l10n/da.json +10 -0
  229. package/templates/podcast-creator/l10n/de.json +10 -0
  230. package/templates/podcast-creator/l10n/el.json +10 -0
  231. package/templates/podcast-creator/l10n/en.json +1 -1
  232. package/templates/podcast-creator/l10n/es.json +10 -0
  233. package/templates/podcast-creator/l10n/fi.json +10 -0
  234. package/templates/podcast-creator/l10n/fr.json +10 -0
  235. package/templates/podcast-creator/l10n/he.json +8 -0
  236. package/templates/podcast-creator/l10n/hu.json +10 -0
  237. package/templates/podcast-creator/l10n/id.json +10 -0
  238. package/templates/podcast-creator/l10n/it.json +10 -0
  239. package/templates/podcast-creator/l10n/ja.json +10 -0
  240. package/templates/podcast-creator/l10n/ko.json +10 -0
  241. package/templates/podcast-creator/l10n/lt.json +10 -0
  242. package/templates/podcast-creator/l10n/nl.json +10 -0
  243. package/templates/podcast-creator/l10n/no.json +10 -0
  244. package/templates/podcast-creator/l10n/pl.json +10 -0
  245. package/templates/podcast-creator/l10n/pt.json +10 -0
  246. package/templates/podcast-creator/l10n/ru.json +10 -0
  247. package/templates/podcast-creator/l10n/sv.json +10 -0
  248. package/templates/podcast-creator/l10n/th.json +10 -0
  249. package/templates/podcast-creator/l10n/tr.json +10 -0
  250. package/templates/podcast-creator/l10n/uk.json +10 -0
  251. package/templates/podcast-creator/l10n/vi.json +10 -0
  252. package/templates/podcast-creator/l10n/zh.json +10 -0
  253. package/templates/podcast-creator/tier5-src/_shared/himi-account.ts +14 -1
  254. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +192 -28
  255. package/templates/podcast-creator-owner/tier5-src/_shared/himi-account.ts +14 -1
  256. package/templates/portfolio-creative/dev/index.ts +122 -8
  257. package/templates/portfolio-creative/l10n/ar.json +10 -0
  258. package/templates/portfolio-creative/l10n/cs.json +10 -0
  259. package/templates/portfolio-creative/l10n/da.json +10 -0
  260. package/templates/portfolio-creative/l10n/de.json +10 -0
  261. package/templates/portfolio-creative/l10n/el.json +10 -0
  262. package/templates/portfolio-creative/l10n/en.json +1 -1
  263. package/templates/portfolio-creative/l10n/es.json +10 -0
  264. package/templates/portfolio-creative/l10n/fi.json +10 -0
  265. package/templates/portfolio-creative/l10n/fr.json +10 -0
  266. package/templates/portfolio-creative/l10n/he.json +8 -0
  267. package/templates/portfolio-creative/l10n/hu.json +10 -0
  268. package/templates/portfolio-creative/l10n/id.json +10 -0
  269. package/templates/portfolio-creative/l10n/it.json +10 -0
  270. package/templates/portfolio-creative/l10n/ja.json +10 -0
  271. package/templates/portfolio-creative/l10n/ko.json +10 -0
  272. package/templates/portfolio-creative/l10n/lt.json +10 -0
  273. package/templates/portfolio-creative/l10n/nl.json +10 -0
  274. package/templates/portfolio-creative/l10n/no.json +10 -0
  275. package/templates/portfolio-creative/l10n/pl.json +10 -0
  276. package/templates/portfolio-creative/l10n/pt.json +10 -0
  277. package/templates/portfolio-creative/l10n/ru.json +10 -0
  278. package/templates/portfolio-creative/l10n/sv.json +10 -0
  279. package/templates/portfolio-creative/l10n/th.json +10 -0
  280. package/templates/portfolio-creative/l10n/tr.json +10 -0
  281. package/templates/portfolio-creative/l10n/uk.json +10 -0
  282. package/templates/portfolio-creative/l10n/vi.json +10 -0
  283. package/templates/portfolio-creative/l10n/zh.json +10 -0
  284. package/templates/portfolio-creative/tier5-src/_shared/himi-account.ts +14 -1
  285. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +192 -28
  286. package/templates/portfolio-creative-owner/tier5-src/_shared/himi-account.ts +14 -1
  287. package/templates/restaurant/dev/index.ts +122 -8
  288. package/templates/restaurant/l10n/ar.json +10 -0
  289. package/templates/restaurant/l10n/cs.json +10 -0
  290. package/templates/restaurant/l10n/da.json +10 -0
  291. package/templates/restaurant/l10n/de.json +10 -0
  292. package/templates/restaurant/l10n/el.json +10 -0
  293. package/templates/restaurant/l10n/en.json +1 -1
  294. package/templates/restaurant/l10n/es.json +10 -0
  295. package/templates/restaurant/l10n/fi.json +10 -0
  296. package/templates/restaurant/l10n/fr.json +10 -0
  297. package/templates/restaurant/l10n/he.json +8 -0
  298. package/templates/restaurant/l10n/hu.json +10 -0
  299. package/templates/restaurant/l10n/id.json +10 -0
  300. package/templates/restaurant/l10n/it.json +10 -0
  301. package/templates/restaurant/l10n/ja.json +10 -0
  302. package/templates/restaurant/l10n/ko.json +10 -0
  303. package/templates/restaurant/l10n/lt.json +10 -0
  304. package/templates/restaurant/l10n/nl.json +10 -0
  305. package/templates/restaurant/l10n/no.json +10 -0
  306. package/templates/restaurant/l10n/pl.json +10 -0
  307. package/templates/restaurant/l10n/pt.json +10 -0
  308. package/templates/restaurant/l10n/ru.json +10 -0
  309. package/templates/restaurant/l10n/sv.json +10 -0
  310. package/templates/restaurant/l10n/th.json +10 -0
  311. package/templates/restaurant/l10n/tr.json +10 -0
  312. package/templates/restaurant/l10n/uk.json +10 -0
  313. package/templates/restaurant/l10n/vi.json +10 -0
  314. package/templates/restaurant/l10n/zh.json +10 -0
  315. package/templates/restaurant/tier5-src/_shared/himi-account.ts +14 -1
  316. package/templates/restaurant/tier5-src/himi-store-account/index.ts +192 -28
  317. package/templates/restaurant-owner/tier5-src/_shared/himi-account.ts +14 -1
  318. package/templates/retail-store/dev/index.ts +122 -8
  319. package/templates/retail-store/l10n/ar.json +10 -0
  320. package/templates/retail-store/l10n/cs.json +10 -0
  321. package/templates/retail-store/l10n/da.json +10 -0
  322. package/templates/retail-store/l10n/de.json +10 -0
  323. package/templates/retail-store/l10n/el.json +10 -0
  324. package/templates/retail-store/l10n/en.json +1 -1
  325. package/templates/retail-store/l10n/es.json +10 -0
  326. package/templates/retail-store/l10n/fi.json +10 -0
  327. package/templates/retail-store/l10n/fr.json +10 -0
  328. package/templates/retail-store/l10n/he.json +8 -0
  329. package/templates/retail-store/l10n/hu.json +10 -0
  330. package/templates/retail-store/l10n/id.json +10 -0
  331. package/templates/retail-store/l10n/it.json +10 -0
  332. package/templates/retail-store/l10n/ja.json +10 -0
  333. package/templates/retail-store/l10n/ko.json +10 -0
  334. package/templates/retail-store/l10n/lt.json +10 -0
  335. package/templates/retail-store/l10n/nl.json +10 -0
  336. package/templates/retail-store/l10n/no.json +10 -0
  337. package/templates/retail-store/l10n/pl.json +10 -0
  338. package/templates/retail-store/l10n/pt.json +10 -0
  339. package/templates/retail-store/l10n/ru.json +10 -0
  340. package/templates/retail-store/l10n/sv.json +10 -0
  341. package/templates/retail-store/l10n/th.json +10 -0
  342. package/templates/retail-store/l10n/tr.json +10 -0
  343. package/templates/retail-store/l10n/uk.json +10 -0
  344. package/templates/retail-store/l10n/vi.json +10 -0
  345. package/templates/retail-store/l10n/zh.json +10 -0
  346. package/templates/retail-store/tier5-src/_shared/himi-account.ts +14 -1
  347. package/templates/retail-store/tier5-src/himi-store-account/index.ts +192 -28
  348. package/templates/retail-store-owner/tier5-src/_shared/himi-account.ts +14 -1
  349. package/templates/salon-spa/dev/index.ts +744 -595
  350. package/templates/salon-spa/tier5-src/_shared/business-chat-presenter.ts +11 -0
  351. package/templates/salon-spa/tier5-src/_shared/himi-account.ts +14 -1
  352. package/templates/salon-spa/tier5-src/business-chat/index.ts +20 -6
  353. package/templates/salon-spa/tier5-src/himi-booking-account/index.ts +14 -3
  354. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +192 -28
  355. package/templates/wholesale-store/dev/index.ts +751 -602
  356. package/templates/wholesale-store/tier5-src/_shared/business-chat-presenter.ts +11 -0
  357. package/templates/wholesale-store/tier5-src/_shared/himi-account.ts +14 -1
  358. package/templates/wholesale-store/tier5-src/business-chat/index.ts +20 -6
  359. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +192 -28
  360. package/templates/yoga-studio/dev/index.ts +122 -8
  361. package/templates/yoga-studio/l10n/ar.json +5 -0
  362. package/templates/yoga-studio/l10n/cs.json +5 -0
  363. package/templates/yoga-studio/l10n/da.json +5 -0
  364. package/templates/yoga-studio/l10n/de.json +5 -0
  365. package/templates/yoga-studio/l10n/el.json +5 -0
  366. package/templates/yoga-studio/l10n/en.json +1 -1
  367. package/templates/yoga-studio/l10n/es.json +5 -0
  368. package/templates/yoga-studio/l10n/fi.json +5 -0
  369. package/templates/yoga-studio/l10n/fr.json +5 -0
  370. package/templates/yoga-studio/l10n/he.json +4 -0
  371. package/templates/yoga-studio/l10n/hu.json +5 -0
  372. package/templates/yoga-studio/l10n/id.json +5 -0
  373. package/templates/yoga-studio/l10n/it.json +5 -0
  374. package/templates/yoga-studio/l10n/ja.json +5 -0
  375. package/templates/yoga-studio/l10n/ko.json +5 -0
  376. package/templates/yoga-studio/l10n/lt.json +5 -0
  377. package/templates/yoga-studio/l10n/nl.json +5 -0
  378. package/templates/yoga-studio/l10n/no.json +5 -0
  379. package/templates/yoga-studio/l10n/pl.json +5 -0
  380. package/templates/yoga-studio/l10n/pt.json +5 -0
  381. package/templates/yoga-studio/l10n/ru.json +5 -0
  382. package/templates/yoga-studio/l10n/sv.json +5 -0
  383. package/templates/yoga-studio/l10n/th.json +5 -0
  384. package/templates/yoga-studio/l10n/tr.json +5 -0
  385. package/templates/yoga-studio/l10n/uk.json +5 -0
  386. package/templates/yoga-studio/l10n/vi.json +5 -0
  387. package/templates/yoga-studio/l10n/zh.json +5 -0
  388. package/templates/yoga-studio/tier5-src/_shared/himi-account.ts +14 -1
  389. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +192 -28
  390. package/templates/yoga-studio-owner/tier5-src/_shared/himi-account.ts +14 -1
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {جلسة حضرتها إجمالًا} other {جلسات حضرتها إجمالًا}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "أرسلنا رابط إعادة التعيين إلى {email}. تحقّق من بريدك الوارد.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Navštívená lekce celkem} few {Navštívené lekce celkem} other {Navštívených lekcí celkem}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Odkaz pro obnovení jsme poslali na {email}. Zkontrolujte svou doručenou poštu.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Session deltaget i alt} other {Sessioner deltaget i alt}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Vi har sendt et nulstillingslink til {email}. Tjek din indbakke.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Session insgesamt besucht} other {Sessions insgesamt besucht}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Wir haben einen Link zum Zurücksetzen an {email} gesendet. Sieh in deinem Posteingang nach.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Συνεδρία στην οποία συμμετείχα συνολικά} other {Συνεδρίες στις οποίες συμμετείχα συνολικά}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Στείλαμε έναν σύνδεσμο επαναφοράς στο {email}. Ελέγξτε τα εισερχόμενά σας.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$source": "en",
3
- "$generated": "2026-11-24T01:53:56.984Z",
3
+ "$generated": "2026-11-24T10:16:11.100Z",
4
4
  "messages": {
5
5
  "h_00234c88e324": {
6
6
  "source": "This site's galleries couldn't be loaded.",
@@ -3839,7 +3839,7 @@
3839
3839
  },
3840
3840
  "h_c21b9303d41d": {
3841
3841
  "source": "Sign in to send a message.",
3842
- "kind": "Worker.copy",
3842
+ "kind": "ErrorState.title",
3843
3843
  "translation": "",
3844
3844
  "key": "businessChat.signInPrompt"
3845
3845
  },
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Sesión a la que asistí en total} other {Sesiones a las que asistí en total}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Enviamos un enlace de restablecimiento a {email}. Revisa tu bandeja de entrada.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Istunto, johon osallistuin yhteensä} other {Istuntoa, joihin osallistuin yhteensä}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Lähetimme nollauslinkin osoitteeseen {email}. Tarkista saapuneet viestit.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Séance suivie au total} other {Séances suivies au total}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Nous avons envoyé un lien de réinitialisation à {email}. Consultez votre boîte de réception.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -8110,6 +8110,10 @@
8110
8110
  "source": "{correct} of {total} answers were right.",
8111
8111
  "translation": "{correct} מתוך {total} תשובות היו נכונות."
8112
8112
  },
8113
+ "h_617d49f47351": {
8114
+ "source": "We sent a reset link to {email}. Check your inbox.",
8115
+ "translation": "שלחנו קישור לאיפוס הסיסמה אל {email}. כדאי לבדוק את תיבת הדואר."
8116
+ },
8113
8117
  "h_27b36f21a125": {
8114
8118
  "source": "Change notifications for this app in your phone's settings.",
8115
8119
  "translation": "אפשר לשנות את ההתראות של האפליקציה בהגדרות הטלפון."
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, other {Alkalom, amelyen részt vettem, összesen}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Visszaállítási linket küldtünk ide: {email}. Nézd meg a beérkezett üzeneteidet.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, other {Sesi yang dihadiri secara total}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Kami telah mengirim tautan reset ke {email}. Periksa kotak masuk Anda.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Sessione frequentata in totale} other {Sessioni frequentate in totale}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Abbiamo inviato un link di reimpostazione a {email}. Controlla la tua casella di posta.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, other {参加したセッションの合計}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "{email} にリセットリンクを送信しました。受信トレイを確認してください。",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, other {총 참석한 세션}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "{email}(으)로 재설정 링크를 보냈어요. 받은편지함을 확인하세요.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Aplankytas seansas iš viso} few {Aplankyti seansai iš viso} other {Aplankytų seansų iš viso}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Atkūrimo nuorodą išsiuntėme adresu {email}. Patikrinkite gautuosius.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Sessie bijgewoond in totaal} other {Sessies bijgewoond in totaal}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "We hebben een resetlink naar {email} gestuurd. Controleer je inbox.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Økt deltatt på totalt} other {Økter deltatt på totalt}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Vi har sendt en lenke for tilbakestilling til {email}. Sjekk innboksen din.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Odbyta sesja łącznie} few {Odbyte sesje łącznie} many {Odbytych sesji łącznie} other {Odbytych sesji łącznie}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Wysłaliśmy link do resetowania hasła na adres {email}. Sprawdź skrzynkę odbiorczą.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Sessão frequentada no total} other {Sessões frequentadas no total}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Enviamos um link de redefinição para {email}. Verifique sua caixa de entrada.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Посещённое занятие всего} few {Посещённых занятия всего} many {Посещённых занятий всего} other {Посещённых занятия всего}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Мы отправили ссылку для сброса на {email}. Проверьте входящие.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Pass bevistat totalt} other {Pass bevistade totalt}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Vi har skickat en återställningslänk till {email}. Kolla din inkorg.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, other {เซสชันที่เข้าร่วมทั้งหมด}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "เราส่งลิงก์รีเซ็ตไปที่ {email} แล้ว ตรวจสอบกล่องจดหมายของคุณ",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Toplamda katıldığım seans} other {Toplamda katıldığım seans}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "{email} adresine bir sıfırlama bağlantısı gönderdik. Gelen kutunuzu kontrol edin.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, one {Відвіданий сеанс загалом} few {Відвідані сеанси загалом} many {Відвіданих сеансів загалом} other {Відвіданого сеансу загалом}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Ми надіслали посилання для скидання на {email}. Перевірте вхідні.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, other {Tổng số buổi đã tham gia}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "Chúng tôi đã gửi liên kết đặt lại đến {email}. Hãy kiểm tra hộp thư của bạn.",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -9946,6 +9946,11 @@
9946
9946
  "source": "{n, plural, one {Session attended in total} other {Sessions attended in total}}",
9947
9947
  "translation": "{n, plural, other {累計出席的課堂}}",
9948
9948
  "origin": "machine"
9949
+ },
9950
+ "h_617d49f47351": {
9951
+ "source": "We sent a reset link to {email}. Check your inbox.",
9952
+ "translation": "我們已將重設連結寄到 {email}。請查看收件匣。",
9953
+ "origin": "machine"
9949
9954
  }
9950
9955
  }
9951
9956
  }
@@ -554,6 +554,17 @@ export function presentBusinessMessages<T extends Pick<BusinessMessage, "id" | "
554
554
  });
555
555
  }
556
556
 
557
+ /** The business's avatar sits only on the last bubble of a run of its messages, as in the member chat thread
558
+ * (member-thread-rows.ts): nothing follows, the member's own message follows, or the next message opens a new day.
559
+ * Every incoming message is the business's (staff and AI sign as the business), so a run is consecutive incoming rows. */
560
+ export function withBusinessAvatarRuns<T extends { mine: boolean; startsDay?: boolean }>(rows: T[]): (T & { showAvatar: boolean; hideAvatar: boolean })[] {
561
+ return rows.map((row, at) => {
562
+ const next = rows[at + 1];
563
+ const showAvatar = !row.mine && (!next || next.mine || !!next.startsDay);
564
+ return { ...row, showAvatar, hideAvatar: !showAvatar };
565
+ });
566
+ }
567
+
557
568
  /** Resolve a suggestion only from the currently normalized rows and only when the server supplied both postback fields. */
558
569
  export function findBusinessSuggestion<T extends { suggestions?: BusinessSuggestion[] }>(rows: T[], suggestionId: string): BusinessSuggestion | undefined {
559
570
  if (!suggestionId) return undefined;
@@ -87,9 +87,22 @@ function profileFromData(data: WixMyData, fallbackEmail = ""): AccountProfile {
87
87
 
88
88
  /** The signed-in site member's name and photo from their member record, or undefined when it
89
89
  * cannot be read or names nobody (the caller then shows the email). */
90
+ /** The host refused a read because the signed-in principal changed while it was in flight. Right
91
+ * after a sign-in on Android, the account screen's first read races the session switch this way. */
92
+ const PRINCIPAL_CHANGED = /PRINCIPAL_CHANGED/;
93
+
90
94
  async function siteMemberProfile(email: string): Promise<AccountProfile | undefined> {
91
95
  try {
92
- const member = (await getMyMember({ fieldsets: ["FULL"] }))?.member;
96
+ const read = () => getMyMember({ fieldsets: ["FULL"] });
97
+ // Asked again once, as the member who is signed in now; otherwise a fresh sign-in shows the
98
+ // member's email where their name belongs until the next refresh. Only for the same member:
99
+ // the name must never come from another account than `email`.
100
+ const member = (await read().catch(async (error: unknown) => {
101
+ if (!PRINCIPAL_CHANGED.test(String((error as { message?: unknown })?.message ?? error))) throw error;
102
+ const now = await memberIdentity();
103
+ if (!now.signedIn || (email && now.email !== email)) throw error;
104
+ return read();
105
+ }))?.member;
93
106
  const name = [member?.contact?.firstName, member?.contact?.lastName].map((part) => (part ?? "").trim()).filter(Boolean).join(" ")
94
107
  || (member?.profile?.nickname ?? "").trim();
95
108
  if (!name) return undefined;
@@ -6,7 +6,7 @@ import type { ChatIdentity } from '../_shared/business-chat-transport.js';
6
6
  import { type MessageRow } from '../_shared/business-chat-message-model.js';
7
7
  import { businessChatSendRejected, messageTimeLabel, sendAnchor, pendingIntentWasObserved, chronologicalMessages, newBusinessChatIntent, type BusinessChatIntent } from '../_shared/business-chat-model.js';
8
8
  import { subscribeRealtime, unsubscribeRealtime, getRealtimeStatus, type RealtimeStatus, type RealtimeEventEnvelope } from '@himalaya/wix-chat';
9
- import { businessInAppRoute, type BusinessArticleAction, dispatchBusinessSuggestion, findBusinessSuggestion, businessRealtimeStatusLabel, businessVisitorOptionSuggestions, presentBusinessMessages, selectExistingBusinessRoom, shouldRefreshBusinessHistory, type BusinessSuggestion, type BusinessVisitorOptions, businessVisitorOptionRequest, businessVisitorOptionsFromAiMessages, newBusinessSelectionId} from '../_shared/business-chat-presenter.js';
9
+ import { businessInAppRoute, type BusinessArticleAction, dispatchBusinessSuggestion, findBusinessSuggestion, businessRealtimeStatusLabel, businessVisitorOptionSuggestions, presentBusinessMessages, selectExistingBusinessRoom, withBusinessAvatarRuns, shouldRefreshBusinessHistory, type BusinessSuggestion, type BusinessVisitorOptions, businessVisitorOptionRequest, businessVisitorOptionsFromAiMessages, newBusinessSelectionId} from '../_shared/business-chat-presenter.js';
10
10
  import { listMessages, streamMessages } from '@himalaya/wix-ai-site-chat';
11
11
  import { smartChatHistory } from '../_shared/business-chat-history.js';
12
12
  import { hostSiteFromInput } from '../_shared/branded-lite-hosted.js';
@@ -23,6 +23,8 @@ type BusinessMessageRow = Pick<MessageRow,'id'|'sender'|'when'|'createdDate'|'mi
23
23
  senderAvatar:string; senderName:string; senderInitials:string; senderBadge:string; imageUrl:string; imageDescription:string; noImage:boolean; bodyText:string; bodyMarkdown:string; suggestions:BusinessSuggestion[]; articleActions:BusinessArticleAction[]; couponCode:string; noCoupon:boolean; notMine:boolean;
24
24
  isCard:boolean; notCard:boolean; noSuggestions:boolean; noActions:boolean; cardTitle:string; cardDetail:string; noCardText:boolean;
25
25
  dayLabel:string; dayHidden:boolean; startsDay:boolean; scrollAnchor:string;
26
+ /** The business avatar shows only on the last bubble of a run (shape() sets it from the row order). */
27
+ showAvatar?:boolean; hideAvatar?:boolean;
26
28
  /** Only the member's own row that the server has not returned yet. */
27
29
  pending?:boolean;
28
30
  /** Confirmed local delivery, retained until the authoritative history returns it. */
@@ -51,6 +53,13 @@ type State = {
51
53
  /** Who signs business messages: the hosted site, else the name the screen's `init` passes. */
52
54
  businessName:string; businessInitials:string;
53
55
  sendDisabled:boolean; sendEnabled:boolean; noLive:boolean; loadingHidden:boolean; errorText:string; loadFailure:string;
56
+ // The line above the composer: a send's own notice, else the error of a refresh or reopen that failed while the
57
+ // transcript stays on screen (the screen shows the load ErrorState only when there are no messages).
58
+ noticeText:string; noErrorNotice:boolean; noInfoNotice:boolean; noLiveLabel:boolean;
59
+ // The load ErrorState shows only for a failed load with nothing on screen (a rejected first send leaves no rows, but
60
+ // phase stays 'ready': its notice says so). With messages on screen a failed load keeps them, and Try again sits
61
+ // under the notice line above the composer, because Send stays off until a load succeeds.
62
+ hideLoadError:boolean; retryHidden:boolean;
54
63
  };
55
64
  // A hosted build serves many businesses: the title is the site the host opened, not the app's own name.
56
65
  const hostedName=hostSiteFromInput((globalThis as {himalaya?:{input?:unknown}}).himalaya?.input)?.name??'';
@@ -68,7 +77,7 @@ function initialsOf(name:string):string{
68
77
  return (words.length>1?`${first(words[0]!)}${first(words[words.length-1]!)}`:first(words[0]??'')).toUpperCase();
69
78
  }
70
79
  const initial:State={hostedName,businessName:hostedName,businessInitials:initialsOf(hostedName),hasHostedName:!!hostedName,noHostedName:!hostedName,phase:'loading',error:'',notice:'',member:false,visitor:false,notVisitor:true,roomId:'',principal:'',scope:'',messages:[],draft:'',busy:false,historySource:'members',historyRevision:0,smartChatEmpty:false,transcriptSource:'members',
71
- liveState:'unavailable',liveReason:'',realtimeEventCount:0,lastRealtimeEventType:'',liveLabel:'',hasActiveRoom:false,noActiveRoom:true,isGuest:false,notGuest:true,realtimeDiagnostic:'',pendingIntent:null,scrollAnchor:'',scrollSend:0,usedSuggestionIds:[],visitorOptions:null,quickReplies:[],hasQuickReplies:false,noQuickReplies:true,noError:true,noNotice:true,noMessages:true,hasMessages:false,noEmpty:true,notLoading:false,sendDisabled:true,sendEnabled:false,noLive:true,loadingHidden:false,errorText:'',loadFailure:''};
80
+ liveState:'unavailable',liveReason:'',realtimeEventCount:0,lastRealtimeEventType:'',liveLabel:'',hasActiveRoom:false,noActiveRoom:true,isGuest:false,notGuest:true,realtimeDiagnostic:'',pendingIntent:null,scrollAnchor:'',scrollSend:0,usedSuggestionIds:[],visitorOptions:null,quickReplies:[],hasQuickReplies:false,noQuickReplies:true,noError:true,noNotice:true,noMessages:true,hasMessages:false,noEmpty:true,notLoading:false,sendDisabled:true,sendEnabled:false,noLive:true,loadingHidden:false,errorText:'',loadFailure:'',noticeText:'',noErrorNotice:true,noInfoNotice:true,noLiveLabel:true,hideLoadError:true,retryHidden:true};
72
81
  let currentIdentity:ChatIdentity|null=null;
73
82
  /** A visitor has no member principal: this one stands in, so a refresh started for the visitor is dropped once someone signs in. */
74
83
  const VISITOR='visitor';
@@ -143,7 +152,7 @@ function pendingRow(intent:PendingIntent):BusinessMessageRow{
143
152
  const when=intent.delivery==='sending'?businessChatCopy('sending'):intent.delivery==='unconfirmed'?businessChatCopy('unconfirmed'):messageTimeLabel(intent.createdDate);
144
153
  return {id:intent.id,sender:'',when,createdDate:intent.createdDate,mine:true,
145
154
  senderAvatar:'',senderName:intent.senderName??'',senderInitials:'',senderBadge:'',imageUrl:'',imageDescription:'',noImage:true,bodyText:intent.text,bodyMarkdown:intent.text,
146
- suggestions:[],articleActions:[],couponCode:'',noCoupon:true,notMine:false,isCard:false,notCard:true,noSuggestions:true,noActions:true,cardTitle:'',cardDetail:'',noCardText:true,dayLabel:'',dayHidden:true,startsDay:false,scrollAnchor:`himi_business_chat.message_${intent.id}`,pending:true,acceptedIntent:intent.delivery==='sent'?intent:undefined};
155
+ suggestions:[],articleActions:[],couponCode:'',noCoupon:true,notMine:false,isCard:false,notCard:true,noSuggestions:true,noActions:true,cardTitle:'',cardDetail:'',noCardText:true,dayLabel:'',dayHidden:true,startsDay:false,showAvatar:false,hideAvatar:true,scrollAnchor:`himi_business_chat.message_${intent.id}`,pending:true,acceptedIntent:intent.delivery==='sent'?intent:undefined};
147
156
  }
148
157
  /** Keep a selected option in its turn while Wix omits its visible text from history. */
149
158
  /** Selected options whose exact record history has returned. A state built from an older snapshot has lost
@@ -164,7 +173,12 @@ function selectedOptionVisible(aiMessages:unknown[],messages:BusinessMessageRow[
164
173
  messages.some(row=>row.id===`smart-chat:${message.id}`&&row.mine&&row.bodyText.trim()===intent.text.trim());
165
174
  });
166
175
  }
167
- function shape(s:State):State{const used=new Set(s.usedSuggestionIds);const messages=s.messages.map(row=>({...row,noSuggestions:s.phase!=='ready'||!(row.suggestions||[]).length,suggestions:(row.suggestions||[]).map(button=>used.has(button.id)?{...button,enabled:false,disabled:true}:button)}));const quickReplies=(s.quickReplies||[]).map(button=>used.has(button.id)?{...button,enabled:false,disabled:true}:button);const quickEnabled=s.phase==='ready'&&quickReplies.some(button=>button.enabled);return {...s,messages,quickReplies,hasQuickReplies:quickEnabled,noQuickReplies:!quickEnabled,scrollAnchor:messages[messages.length-1]?.scrollAnchor||'',liveLabel:s.visitor?'':liveDescription(s.liveState,s.liveReason),hasActiveRoom:!!s.roomId,noActiveRoom:!s.roomId,hasHostedName:!!s.hostedName,noHostedName:!s.hostedName,isGuest:s.phase==='guest',notVisitor:!s.visitor,notGuest:s.phase!=='guest',realtimeDiagnostic:`state=${s.liveState}; reason=${s.liveReason||'none'}; events=${s.realtimeEventCount}; lastType=${/^(message|messagesent)$/i.test(s.lastRealtimeEventType)?s.lastRealtimeEventType:'none'}`,errorText:s.error,loadingHidden:s.phase!=='loading'||!!s.error,noError:!s.error,noNotice:!s.notice,noMessages:!messages.length,hasMessages:!!messages.length,noEmpty:s.phase!=='ready'||!!messages.length,
176
+ function shape(s:State):State{const used=new Set(s.usedSuggestionIds);const messages=withBusinessAvatarRuns(s.messages).map(row=>({...row,noSuggestions:s.phase!=='ready'||!(row.suggestions||[]).length,suggestions:(row.suggestions||[]).map(button=>used.has(button.id)?{...button,enabled:false,disabled:true}:button)}));const quickReplies=(s.quickReplies||[]).map(button=>used.has(button.id)?{...button,enabled:false,disabled:true}:button);const quickEnabled=s.phase==='ready'&&quickReplies.some(button=>button.enabled);const liveLabel=s.visitor?'':liveDescription(s.liveState,s.liveReason);
177
+ // A load failure is one that is not a send's (sends always set a notice), also a realtime or status refresh that kept the
178
+ // phase 'ready'. With nothing on screen it is the load ErrorState; with messages, the notice line plus Try again.
179
+ // A notice with an error is a failure, one without a confirmation.
180
+ const loadFailed=s.phase==='error'||(s.phase==='ready'&&!!s.error&&!s.notice);const loadErrorShown=!messages.length&&loadFailed;const noticeText=s.notice||(s.error&&messages.length?s.error:'');
181
+ return {...s,messages,quickReplies,hasQuickReplies:quickEnabled,noQuickReplies:!quickEnabled,scrollAnchor:messages[messages.length-1]?.scrollAnchor||'',liveLabel,noLiveLabel:!liveLabel,hasActiveRoom:!!s.roomId,noActiveRoom:!s.roomId,hasHostedName:!!s.hostedName,noHostedName:!s.hostedName,isGuest:s.phase==='guest',notVisitor:!s.visitor,notGuest:s.phase!=='guest',realtimeDiagnostic:`state=${s.liveState}; reason=${s.liveReason||'none'}; events=${s.realtimeEventCount}; lastType=${/^(message|messagesent)$/i.test(s.lastRealtimeEventType)?s.lastRealtimeEventType:'none'}`,errorText:s.error,loadingHidden:s.phase!=='loading'||!!s.error,noError:!s.error,hideLoadError:!loadErrorShown,retryHidden:!(loadFailed&&messages.length>0),noticeText,noNotice:!noticeText,noErrorNotice:!noticeText||!s.error,noInfoNotice:!noticeText||!!s.error,noMessages:!messages.length,hasMessages:!!messages.length,noEmpty:s.phase!=='ready'||!!messages.length||loadErrorShown,
168
182
  notLoading:s.phase!=='loading',sendDisabled:!canSend(s,s.draft),sendEnabled:canSend(s,s.draft),noLive:!s.roomId||s.liveState==='connected'};}
169
183
  /** Smart Chat resolves the conversation from the member identity, including the first message.
170
184
  * History must finish loading before Send is offered so delivery has a reliable anchor. */
@@ -731,7 +745,7 @@ const svc=defineService<State,Record<string,(s:State,a?:unknown)=>State|undefine
731
745
  if(refreshFlight){refreshQueued=true;return withLiveDraft(s);}
732
746
  try{return await loadLatest(s);}catch(error){
733
747
  if(startEpoch!==epoch)return undefined;
734
- return /member_sign_in_required|MemberAccessChanged|\b401\b|\b403\b/i.test(String(error))?clearPrivate(s,'guest'):shape({...withLiveDraft(s),error:safeError(error,'load'),loadFailure:typeof (error as {businessLoadFailure?:unknown})?.businessLoadFailure==='string'?(error as {businessLoadFailure:string}).businessLoadFailure:safeLoadFailure(error)});
748
+ return /member_sign_in_required|MemberAccessChanged|\b401\b|\b403\b/i.test(String(error))?clearPrivate(s,'guest'):shape({...withLiveDraft(s),notice:'',error:safeError(error,'load'),loadFailure:typeof (error as {businessLoadFailure?:unknown})?.businessLoadFailure==='string'?(error as {businessLoadFailure:string}).businessLoadFailure:safeLoadFailure(error)});
735
749
  }
736
750
  },
737
751
  onStatus:async(s,a)=>{
@@ -751,7 +765,7 @@ const svc=defineService<State,Record<string,(s:State,a?:unknown)=>State|undefine
751
765
  const newer=statusSeq!==mySeq;
752
766
  return shape({...loaded,liveState:newer?live.liveState:liveState,liveReason:newer?live.liveReason:(liveState==='connected'?'':status?.reason||''),error:''});
753
767
  }
754
- catch(error){if(startEpoch!==epoch)return undefined;const lost=/member_sign_in_required|MemberAccessChanged|\b401\b|\b403\b/i.test(String(error));return lost?clearPrivate(next,'guest'):shape({...withLiveDraft(next),error:safeError(error,'load'),loadFailure:typeof (error as {businessLoadFailure?:unknown})?.businessLoadFailure==='string'?(error as {businessLoadFailure:string}).businessLoadFailure:safeLoadFailure(error)});}
768
+ catch(error){if(startEpoch!==epoch)return undefined;const lost=/member_sign_in_required|MemberAccessChanged|\b401\b|\b403\b/i.test(String(error));return lost?clearPrivate(next,'guest'):shape({...withLiveDraft(next),notice:'',error:safeError(error,'load'),loadFailure:typeof (error as {businessLoadFailure?:unknown})?.businessLoadFailure==='string'?(error as {businessLoadFailure:string}).businessLoadFailure:safeLoadFailure(error)});}
755
769
  },
756
770
  // The visitor's 4 s re-read. A member is live through realtime and never polls; a tick that finds someone
757
771
  // signed in meanwhile hands over to init, which moves the chat to the member.