@wix/himalaya-cli 0.1777.0 → 0.1779.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 (331) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/webview-embedded.d.ts +8 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +5 -0
  3. package/dist/cli.mjs +1322 -154
  4. package/guides/himi-test.md +57 -0
  5. package/guides/one-app-section-mappings.md +5 -8
  6. package/guides/one-app-to-himi-app.md +21 -7
  7. package/guides/release-notes.md +15 -0
  8. package/package.json +2 -2
  9. package/templates/beauty-salon/l10n/ar.json +5 -0
  10. package/templates/beauty-salon/l10n/cs.json +5 -0
  11. package/templates/beauty-salon/l10n/da.json +5 -0
  12. package/templates/beauty-salon/l10n/de.json +5 -0
  13. package/templates/beauty-salon/l10n/el.json +5 -0
  14. package/templates/beauty-salon/l10n/es.json +5 -0
  15. package/templates/beauty-salon/l10n/fi.json +5 -0
  16. package/templates/beauty-salon/l10n/fr.json +5 -0
  17. package/templates/beauty-salon/l10n/he.json +4 -0
  18. package/templates/beauty-salon/l10n/hu.json +5 -0
  19. package/templates/beauty-salon/l10n/id.json +5 -0
  20. package/templates/beauty-salon/l10n/it.json +5 -0
  21. package/templates/beauty-salon/l10n/ja.json +5 -0
  22. package/templates/beauty-salon/l10n/ko.json +5 -0
  23. package/templates/beauty-salon/l10n/lt.json +5 -0
  24. package/templates/beauty-salon/l10n/nl.json +5 -0
  25. package/templates/beauty-salon/l10n/no.json +5 -0
  26. package/templates/beauty-salon/l10n/pl.json +5 -0
  27. package/templates/beauty-salon/l10n/pt.json +5 -0
  28. package/templates/beauty-salon/l10n/ru.json +5 -0
  29. package/templates/beauty-salon/l10n/sv.json +5 -0
  30. package/templates/beauty-salon/l10n/th.json +5 -0
  31. package/templates/beauty-salon/l10n/tr.json +5 -0
  32. package/templates/beauty-salon/l10n/uk.json +5 -0
  33. package/templates/beauty-salon/l10n/vi.json +5 -0
  34. package/templates/beauty-salon/l10n/zh.json +5 -0
  35. package/templates/beauty-salon/tier5-src/_shared/weekly-goal.ts +7 -3
  36. package/templates/branded-lite/l10n/ar.json +15 -0
  37. package/templates/branded-lite/l10n/cs.json +15 -0
  38. package/templates/branded-lite/l10n/da.json +15 -0
  39. package/templates/branded-lite/l10n/de.json +15 -0
  40. package/templates/branded-lite/l10n/el.json +15 -0
  41. package/templates/branded-lite/l10n/es.json +15 -0
  42. package/templates/branded-lite/l10n/fi.json +15 -0
  43. package/templates/branded-lite/l10n/fr.json +15 -0
  44. package/templates/branded-lite/l10n/he.json +12 -0
  45. package/templates/branded-lite/l10n/hu.json +15 -0
  46. package/templates/branded-lite/l10n/id.json +15 -0
  47. package/templates/branded-lite/l10n/it.json +15 -0
  48. package/templates/branded-lite/l10n/ja.json +15 -0
  49. package/templates/branded-lite/l10n/ko.json +15 -0
  50. package/templates/branded-lite/l10n/lt.json +15 -0
  51. package/templates/branded-lite/l10n/nl.json +15 -0
  52. package/templates/branded-lite/l10n/no.json +15 -0
  53. package/templates/branded-lite/l10n/pl.json +15 -0
  54. package/templates/branded-lite/l10n/pt.json +15 -0
  55. package/templates/branded-lite/l10n/ru.json +15 -0
  56. package/templates/branded-lite/l10n/sv.json +15 -0
  57. package/templates/branded-lite/l10n/th.json +15 -0
  58. package/templates/branded-lite/l10n/tr.json +15 -0
  59. package/templates/branded-lite/l10n/uk.json +15 -0
  60. package/templates/branded-lite/l10n/vi.json +15 -0
  61. package/templates/branded-lite/l10n/zh.json +15 -0
  62. package/templates/branded-lite/recipes/blog-categories.json +115 -0
  63. package/templates/branded-lite/recipes/event-schedule.json +114 -0
  64. package/templates/branded-lite/recipes/groups-newsfeed.json +245 -0
  65. package/templates/branded-lite/recipes/loyalty-offering.json +241 -0
  66. package/templates/branded-lite/recipes/loyalty-status.json +173 -0
  67. package/templates/branded-lite/recipes/members-carousel.json +144 -0
  68. package/templates/branded-lite/recipes/performance-tracker.json +325 -0
  69. package/templates/branded-lite/recipes/podcasts-widget.json +280 -0
  70. package/templates/branded-lite/recipes/products-search-bar.json +139 -0
  71. package/templates/branded-lite/recipes/wishlist-grid.json +236 -0
  72. package/templates/branded-lite/tier5-src/_shared/blog-categories.ts +62 -0
  73. package/templates/branded-lite/tier5-src/_shared/event-agenda.ts +122 -0
  74. package/templates/branded-lite/tier5-src/_shared/event-schedule-section.ts +91 -0
  75. package/templates/branded-lite/tier5-src/_shared/group-feed-section.ts +2 -2
  76. package/templates/branded-lite/tier5-src/_shared/groups-newsfeed-section.ts +105 -0
  77. package/templates/branded-lite/tier5-src/_shared/loyalty-offering-section.ts +88 -0
  78. package/templates/branded-lite/tier5-src/_shared/loyalty-status-section.ts +88 -0
  79. package/templates/branded-lite/tier5-src/_shared/members-directory.ts +9 -3
  80. package/templates/branded-lite/tier5-src/_shared/performance-tracker-section.ts +120 -0
  81. package/templates/branded-lite/tier5-src/_shared/performance-tracker-weeks.ts +71 -0
  82. package/templates/branded-lite/tier5-src/_shared/podcast-section.ts +131 -0
  83. package/templates/branded-lite/tier5-src/_shared/saved-products-section.ts +64 -0
  84. package/templates/branded-lite/tier5-src/_shared/weekly-goal.ts +7 -3
  85. package/templates/community-club/l10n/ar.json +5 -0
  86. package/templates/community-club/l10n/cs.json +5 -0
  87. package/templates/community-club/l10n/da.json +5 -0
  88. package/templates/community-club/l10n/de.json +5 -0
  89. package/templates/community-club/l10n/el.json +5 -0
  90. package/templates/community-club/l10n/es.json +5 -0
  91. package/templates/community-club/l10n/fi.json +5 -0
  92. package/templates/community-club/l10n/fr.json +5 -0
  93. package/templates/community-club/l10n/he.json +4 -0
  94. package/templates/community-club/l10n/hu.json +5 -0
  95. package/templates/community-club/l10n/id.json +5 -0
  96. package/templates/community-club/l10n/it.json +5 -0
  97. package/templates/community-club/l10n/ja.json +5 -0
  98. package/templates/community-club/l10n/ko.json +5 -0
  99. package/templates/community-club/l10n/lt.json +5 -0
  100. package/templates/community-club/l10n/nl.json +5 -0
  101. package/templates/community-club/l10n/no.json +5 -0
  102. package/templates/community-club/l10n/pl.json +5 -0
  103. package/templates/community-club/l10n/pt.json +5 -0
  104. package/templates/community-club/l10n/ru.json +5 -0
  105. package/templates/community-club/l10n/sv.json +5 -0
  106. package/templates/community-club/l10n/th.json +5 -0
  107. package/templates/community-club/l10n/tr.json +5 -0
  108. package/templates/community-club/l10n/uk.json +5 -0
  109. package/templates/community-club/l10n/vi.json +5 -0
  110. package/templates/community-club/l10n/zh.json +5 -0
  111. package/templates/community-club/tier5-src/_shared/weekly-goal.ts +7 -3
  112. package/templates/events-meetups/l10n/ar.json +5 -0
  113. package/templates/events-meetups/l10n/cs.json +5 -0
  114. package/templates/events-meetups/l10n/da.json +5 -0
  115. package/templates/events-meetups/l10n/de.json +5 -0
  116. package/templates/events-meetups/l10n/el.json +5 -0
  117. package/templates/events-meetups/l10n/es.json +5 -0
  118. package/templates/events-meetups/l10n/fi.json +5 -0
  119. package/templates/events-meetups/l10n/fr.json +5 -0
  120. package/templates/events-meetups/l10n/he.json +4 -0
  121. package/templates/events-meetups/l10n/hu.json +5 -0
  122. package/templates/events-meetups/l10n/id.json +5 -0
  123. package/templates/events-meetups/l10n/it.json +5 -0
  124. package/templates/events-meetups/l10n/ja.json +5 -0
  125. package/templates/events-meetups/l10n/ko.json +5 -0
  126. package/templates/events-meetups/l10n/lt.json +5 -0
  127. package/templates/events-meetups/l10n/nl.json +5 -0
  128. package/templates/events-meetups/l10n/no.json +5 -0
  129. package/templates/events-meetups/l10n/pl.json +5 -0
  130. package/templates/events-meetups/l10n/pt.json +5 -0
  131. package/templates/events-meetups/l10n/ru.json +5 -0
  132. package/templates/events-meetups/l10n/sv.json +5 -0
  133. package/templates/events-meetups/l10n/th.json +5 -0
  134. package/templates/events-meetups/l10n/tr.json +5 -0
  135. package/templates/events-meetups/l10n/uk.json +5 -0
  136. package/templates/events-meetups/l10n/vi.json +5 -0
  137. package/templates/events-meetups/l10n/zh.json +5 -0
  138. package/templates/events-meetups/tier5-src/_shared/weekly-goal.ts +7 -3
  139. package/templates/fitness-gym/tier5-src/_shared/weekly-goal.ts +7 -3
  140. package/templates/gym-fitness/l10n/ar.json +5 -0
  141. package/templates/gym-fitness/l10n/cs.json +5 -0
  142. package/templates/gym-fitness/l10n/da.json +5 -0
  143. package/templates/gym-fitness/l10n/de.json +5 -0
  144. package/templates/gym-fitness/l10n/el.json +5 -0
  145. package/templates/gym-fitness/l10n/es.json +5 -0
  146. package/templates/gym-fitness/l10n/fi.json +5 -0
  147. package/templates/gym-fitness/l10n/fr.json +5 -0
  148. package/templates/gym-fitness/l10n/he.json +4 -0
  149. package/templates/gym-fitness/l10n/hu.json +5 -0
  150. package/templates/gym-fitness/l10n/id.json +5 -0
  151. package/templates/gym-fitness/l10n/it.json +5 -0
  152. package/templates/gym-fitness/l10n/ja.json +5 -0
  153. package/templates/gym-fitness/l10n/ko.json +5 -0
  154. package/templates/gym-fitness/l10n/lt.json +5 -0
  155. package/templates/gym-fitness/l10n/nl.json +5 -0
  156. package/templates/gym-fitness/l10n/no.json +5 -0
  157. package/templates/gym-fitness/l10n/pl.json +5 -0
  158. package/templates/gym-fitness/l10n/pt.json +5 -0
  159. package/templates/gym-fitness/l10n/ru.json +5 -0
  160. package/templates/gym-fitness/l10n/sv.json +5 -0
  161. package/templates/gym-fitness/l10n/th.json +5 -0
  162. package/templates/gym-fitness/l10n/tr.json +5 -0
  163. package/templates/gym-fitness/l10n/uk.json +5 -0
  164. package/templates/gym-fitness/l10n/vi.json +5 -0
  165. package/templates/gym-fitness/l10n/zh.json +5 -0
  166. package/templates/gym-fitness/tier5-src/_shared/weekly-goal.ts +7 -3
  167. package/templates/medical-services/tier5-src/_shared/weekly-goal.ts +7 -3
  168. package/templates/nonprofit-cause/l10n/ar.json +5 -0
  169. package/templates/nonprofit-cause/l10n/cs.json +5 -0
  170. package/templates/nonprofit-cause/l10n/da.json +5 -0
  171. package/templates/nonprofit-cause/l10n/de.json +5 -0
  172. package/templates/nonprofit-cause/l10n/el.json +5 -0
  173. package/templates/nonprofit-cause/l10n/es.json +5 -0
  174. package/templates/nonprofit-cause/l10n/fi.json +5 -0
  175. package/templates/nonprofit-cause/l10n/fr.json +5 -0
  176. package/templates/nonprofit-cause/l10n/he.json +4 -0
  177. package/templates/nonprofit-cause/l10n/hu.json +5 -0
  178. package/templates/nonprofit-cause/l10n/id.json +5 -0
  179. package/templates/nonprofit-cause/l10n/it.json +5 -0
  180. package/templates/nonprofit-cause/l10n/ja.json +5 -0
  181. package/templates/nonprofit-cause/l10n/ko.json +5 -0
  182. package/templates/nonprofit-cause/l10n/lt.json +5 -0
  183. package/templates/nonprofit-cause/l10n/nl.json +5 -0
  184. package/templates/nonprofit-cause/l10n/no.json +5 -0
  185. package/templates/nonprofit-cause/l10n/pl.json +5 -0
  186. package/templates/nonprofit-cause/l10n/pt.json +5 -0
  187. package/templates/nonprofit-cause/l10n/ru.json +5 -0
  188. package/templates/nonprofit-cause/l10n/sv.json +5 -0
  189. package/templates/nonprofit-cause/l10n/th.json +5 -0
  190. package/templates/nonprofit-cause/l10n/tr.json +5 -0
  191. package/templates/nonprofit-cause/l10n/uk.json +5 -0
  192. package/templates/nonprofit-cause/l10n/vi.json +5 -0
  193. package/templates/nonprofit-cause/l10n/zh.json +5 -0
  194. package/templates/nonprofit-cause/tier5-src/_shared/weekly-goal.ts +7 -3
  195. package/templates/personal-fitness-trainer/tier5-src/_shared/weekly-goal.ts +7 -3
  196. package/templates/podcast-creator/l10n/ar.json +5 -0
  197. package/templates/podcast-creator/l10n/cs.json +5 -0
  198. package/templates/podcast-creator/l10n/da.json +5 -0
  199. package/templates/podcast-creator/l10n/de.json +5 -0
  200. package/templates/podcast-creator/l10n/el.json +5 -0
  201. package/templates/podcast-creator/l10n/es.json +5 -0
  202. package/templates/podcast-creator/l10n/fi.json +5 -0
  203. package/templates/podcast-creator/l10n/fr.json +5 -0
  204. package/templates/podcast-creator/l10n/he.json +4 -0
  205. package/templates/podcast-creator/l10n/hu.json +5 -0
  206. package/templates/podcast-creator/l10n/id.json +5 -0
  207. package/templates/podcast-creator/l10n/it.json +5 -0
  208. package/templates/podcast-creator/l10n/ja.json +5 -0
  209. package/templates/podcast-creator/l10n/ko.json +5 -0
  210. package/templates/podcast-creator/l10n/lt.json +5 -0
  211. package/templates/podcast-creator/l10n/nl.json +5 -0
  212. package/templates/podcast-creator/l10n/no.json +5 -0
  213. package/templates/podcast-creator/l10n/pl.json +5 -0
  214. package/templates/podcast-creator/l10n/pt.json +5 -0
  215. package/templates/podcast-creator/l10n/ru.json +5 -0
  216. package/templates/podcast-creator/l10n/sv.json +5 -0
  217. package/templates/podcast-creator/l10n/th.json +5 -0
  218. package/templates/podcast-creator/l10n/tr.json +5 -0
  219. package/templates/podcast-creator/l10n/uk.json +5 -0
  220. package/templates/podcast-creator/l10n/vi.json +5 -0
  221. package/templates/podcast-creator/l10n/zh.json +5 -0
  222. package/templates/podcast-creator/tier5-src/_shared/weekly-goal.ts +7 -3
  223. package/templates/portfolio-creative/l10n/ar.json +5 -0
  224. package/templates/portfolio-creative/l10n/cs.json +5 -0
  225. package/templates/portfolio-creative/l10n/da.json +5 -0
  226. package/templates/portfolio-creative/l10n/de.json +5 -0
  227. package/templates/portfolio-creative/l10n/el.json +5 -0
  228. package/templates/portfolio-creative/l10n/es.json +5 -0
  229. package/templates/portfolio-creative/l10n/fi.json +5 -0
  230. package/templates/portfolio-creative/l10n/fr.json +5 -0
  231. package/templates/portfolio-creative/l10n/he.json +4 -0
  232. package/templates/portfolio-creative/l10n/hu.json +5 -0
  233. package/templates/portfolio-creative/l10n/id.json +5 -0
  234. package/templates/portfolio-creative/l10n/it.json +5 -0
  235. package/templates/portfolio-creative/l10n/ja.json +5 -0
  236. package/templates/portfolio-creative/l10n/ko.json +5 -0
  237. package/templates/portfolio-creative/l10n/lt.json +5 -0
  238. package/templates/portfolio-creative/l10n/nl.json +5 -0
  239. package/templates/portfolio-creative/l10n/no.json +5 -0
  240. package/templates/portfolio-creative/l10n/pl.json +5 -0
  241. package/templates/portfolio-creative/l10n/pt.json +5 -0
  242. package/templates/portfolio-creative/l10n/ru.json +5 -0
  243. package/templates/portfolio-creative/l10n/sv.json +5 -0
  244. package/templates/portfolio-creative/l10n/th.json +5 -0
  245. package/templates/portfolio-creative/l10n/tr.json +5 -0
  246. package/templates/portfolio-creative/l10n/uk.json +5 -0
  247. package/templates/portfolio-creative/l10n/vi.json +5 -0
  248. package/templates/portfolio-creative/l10n/zh.json +5 -0
  249. package/templates/portfolio-creative/tier5-src/_shared/weekly-goal.ts +7 -3
  250. package/templates/restaurant/l10n/ar.json +5 -0
  251. package/templates/restaurant/l10n/cs.json +5 -0
  252. package/templates/restaurant/l10n/da.json +5 -0
  253. package/templates/restaurant/l10n/de.json +5 -0
  254. package/templates/restaurant/l10n/el.json +5 -0
  255. package/templates/restaurant/l10n/es.json +5 -0
  256. package/templates/restaurant/l10n/fi.json +5 -0
  257. package/templates/restaurant/l10n/fr.json +5 -0
  258. package/templates/restaurant/l10n/he.json +4 -0
  259. package/templates/restaurant/l10n/hu.json +5 -0
  260. package/templates/restaurant/l10n/id.json +5 -0
  261. package/templates/restaurant/l10n/it.json +5 -0
  262. package/templates/restaurant/l10n/ja.json +5 -0
  263. package/templates/restaurant/l10n/ko.json +5 -0
  264. package/templates/restaurant/l10n/lt.json +5 -0
  265. package/templates/restaurant/l10n/nl.json +5 -0
  266. package/templates/restaurant/l10n/no.json +5 -0
  267. package/templates/restaurant/l10n/pl.json +5 -0
  268. package/templates/restaurant/l10n/pt.json +5 -0
  269. package/templates/restaurant/l10n/ru.json +5 -0
  270. package/templates/restaurant/l10n/sv.json +5 -0
  271. package/templates/restaurant/l10n/th.json +5 -0
  272. package/templates/restaurant/l10n/tr.json +5 -0
  273. package/templates/restaurant/l10n/uk.json +5 -0
  274. package/templates/restaurant/l10n/vi.json +5 -0
  275. package/templates/restaurant/l10n/zh.json +5 -0
  276. package/templates/restaurant/tier5-src/_shared/weekly-goal.ts +7 -3
  277. package/templates/retail-store/l10n/ar.json +5 -0
  278. package/templates/retail-store/l10n/cs.json +5 -0
  279. package/templates/retail-store/l10n/da.json +5 -0
  280. package/templates/retail-store/l10n/de.json +5 -0
  281. package/templates/retail-store/l10n/el.json +5 -0
  282. package/templates/retail-store/l10n/es.json +5 -0
  283. package/templates/retail-store/l10n/fi.json +5 -0
  284. package/templates/retail-store/l10n/fr.json +5 -0
  285. package/templates/retail-store/l10n/he.json +4 -0
  286. package/templates/retail-store/l10n/hu.json +5 -0
  287. package/templates/retail-store/l10n/id.json +5 -0
  288. package/templates/retail-store/l10n/it.json +5 -0
  289. package/templates/retail-store/l10n/ja.json +5 -0
  290. package/templates/retail-store/l10n/ko.json +5 -0
  291. package/templates/retail-store/l10n/lt.json +5 -0
  292. package/templates/retail-store/l10n/nl.json +5 -0
  293. package/templates/retail-store/l10n/no.json +5 -0
  294. package/templates/retail-store/l10n/pl.json +5 -0
  295. package/templates/retail-store/l10n/pt.json +5 -0
  296. package/templates/retail-store/l10n/ru.json +5 -0
  297. package/templates/retail-store/l10n/sv.json +5 -0
  298. package/templates/retail-store/l10n/th.json +5 -0
  299. package/templates/retail-store/l10n/tr.json +5 -0
  300. package/templates/retail-store/l10n/uk.json +5 -0
  301. package/templates/retail-store/l10n/vi.json +5 -0
  302. package/templates/retail-store/l10n/zh.json +5 -0
  303. package/templates/retail-store/tier5-src/_shared/weekly-goal.ts +7 -3
  304. package/templates/salon-spa/tier5-src/_shared/weekly-goal.ts +7 -3
  305. package/templates/yoga-studio/l10n/ar.json +5 -0
  306. package/templates/yoga-studio/l10n/cs.json +5 -0
  307. package/templates/yoga-studio/l10n/da.json +5 -0
  308. package/templates/yoga-studio/l10n/de.json +5 -0
  309. package/templates/yoga-studio/l10n/el.json +5 -0
  310. package/templates/yoga-studio/l10n/es.json +5 -0
  311. package/templates/yoga-studio/l10n/fi.json +5 -0
  312. package/templates/yoga-studio/l10n/fr.json +5 -0
  313. package/templates/yoga-studio/l10n/he.json +4 -0
  314. package/templates/yoga-studio/l10n/hu.json +5 -0
  315. package/templates/yoga-studio/l10n/id.json +5 -0
  316. package/templates/yoga-studio/l10n/it.json +5 -0
  317. package/templates/yoga-studio/l10n/ja.json +5 -0
  318. package/templates/yoga-studio/l10n/ko.json +5 -0
  319. package/templates/yoga-studio/l10n/lt.json +5 -0
  320. package/templates/yoga-studio/l10n/nl.json +5 -0
  321. package/templates/yoga-studio/l10n/no.json +5 -0
  322. package/templates/yoga-studio/l10n/pl.json +5 -0
  323. package/templates/yoga-studio/l10n/pt.json +5 -0
  324. package/templates/yoga-studio/l10n/ru.json +5 -0
  325. package/templates/yoga-studio/l10n/sv.json +5 -0
  326. package/templates/yoga-studio/l10n/th.json +5 -0
  327. package/templates/yoga-studio/l10n/tr.json +5 -0
  328. package/templates/yoga-studio/l10n/uk.json +5 -0
  329. package/templates/yoga-studio/l10n/vi.json +5 -0
  330. package/templates/yoga-studio/l10n/zh.json +5 -0
  331. package/templates/yoga-studio/tier5-src/_shared/weekly-goal.ts +7 -3
package/dist/cli.mjs CHANGED
@@ -264,7 +264,7 @@ var init_client = __esm({
264
264
  * One probe costs one extra request only for files that were already going to fail. */
265
265
  async telemetrySend(events2) {
266
266
  const post = (batch) => this.request("telemetry", "POST", "/v1/telemetry/ingest", { body: batch, headers: this.telHeaders() });
267
- const settle2 = (r3, posted) => {
267
+ const settle3 = (r3, posted) => {
268
268
  const j2 = r3.json && typeof r3.json === "object" ? r3.json : null;
269
269
  const n2 = (k3) => typeof j2?.[k3] === "number" ? j2[k3] : 0;
270
270
  const counted = typeof j2?.accepted === "number";
@@ -274,11 +274,11 @@ var init_client = __esm({
274
274
  return { ...r3, ok: false, json: { ...j2 ?? {}, ok: false } };
275
275
  };
276
276
  const first = await post(events2);
277
- if (first.status !== 413 || events2.length <= 1) return settle2(first, events2.length);
277
+ if (first.status !== 413 || events2.length <= 1) return settle3(first, events2.length);
278
278
  const body = first.json;
279
- if (!body || body.error !== "batch_too_large") return settle2(first, events2.length);
279
+ if (!body || body.error !== "batch_too_large") return settle3(first, events2.length);
280
280
  const limit = typeof body.limit === "number" && Number.isInteger(body.limit) && body.limit > 0 ? body.limit : null;
281
- if (limit === null || limit >= events2.length) return settle2(first, events2.length);
281
+ if (limit === null || limit >= events2.length) return settle3(first, events2.length);
282
282
  const totals = { accepted: 0, dropped: 0, failed: 0 };
283
283
  const add = (r3) => {
284
284
  const j2 = r3.json;
@@ -294,14 +294,14 @@ var init_client = __esm({
294
294
  last = await post(chunk2);
295
295
  add(last);
296
296
  if (!last.ok) {
297
- return settle2(
297
+ return settle3(
298
298
  { ...last, json: { ...last.json ?? {}, ...totals, batched: { limit, sent, ...totals, failedAt: i2 } } },
299
299
  events2.length
300
300
  );
301
301
  }
302
302
  sent += chunk2.length;
303
303
  }
304
- return settle2(
304
+ return settle3(
305
305
  { ...last, json: { ...last.json ?? {}, ...totals, batched: { limit, sent, ...totals } } },
306
306
  events2.length
307
307
  );
@@ -7238,6 +7238,10 @@ function collectWebViews(descriptor) {
7238
7238
  for (const r3 of roots(descriptor)) visit(r3.c, r3.path, false, { parentType: null, scrollAncestor: null, inVerticalScroll: false });
7239
7239
  return sites;
7240
7240
  }
7241
+ function bridgedWebViews(descriptor) {
7242
+ if (!isRec2(descriptor)) return [];
7243
+ return collectWebViews(descriptor).filter((s5) => isBridged(s5.props)).map((s5) => ({ id: s5.id, path: s5.path, props: s5.props, inTemplate: s5.inTemplate }));
7244
+ }
7241
7245
  function mountable(c2, inTemplate = false) {
7242
7246
  const type2 = typeOf(c2);
7243
7247
  const props2 = propsOf2(c2);
@@ -22261,6 +22265,7 @@ async function bootBundleWorker(bundleJs, opts) {
22261
22265
  input: opts.input ?? {},
22262
22266
  connectivity: { current: opts.connectivity ?? (() => ({ online: true })) },
22263
22267
  ...opts.capabilities ? { capabilities: [...opts.capabilities] } : {},
22268
+ ...opts.webview && grants(opts.capabilities ?? [], "webview") ? { webview: opts.webview } : {},
22264
22269
  wixApi,
22265
22270
  // v1 best-effort stubs — a visitor-scoped load() reads Wix, not device-local state.
22266
22271
  storage: opts.storage ? hostStorage(opts.storage) : { get: () => "", set: () => {
@@ -32853,6 +32858,28 @@ var init_page_methods_generated = __esm({
32853
32858
  }
32854
32859
  });
32855
32860
 
32861
+ // ../../core/sdk/webview/src/page-method-requires.ts
32862
+ var METHOD_REQUIRES;
32863
+ var init_page_method_requires = __esm({
32864
+ "../../core/sdk/webview/src/page-method-requires.ts"() {
32865
+ init_define_HHP_CATALOG();
32866
+ METHOD_REQUIRES = {
32867
+ "presigned_upload.putFile": ["files"],
32868
+ // `prepareImage` decodes and writes its outputs into the `files` substrate.
32869
+ "camera.prepareImage": ["files"],
32870
+ // #4688 — `writeImage` reads the image out of the `files` substrate.
32871
+ "clipboard.writeImage": ["files"],
32872
+ // `addMonitoredRegion` registers an OS geofence, which every bridge gates on `location_background`
32873
+ // (JSWorker.actionRequirements); a companion without it would advertise a call that is refused.
32874
+ "location.addMonitoredRegion": ["location_background"],
32875
+ // The on-device ML image verbs read their image out of the `files` substrate.
32876
+ "text_recognition.recognize": ["files"],
32877
+ "image_labeling.label": ["files"],
32878
+ "barcode_detection.detect": ["files"]
32879
+ };
32880
+ }
32881
+ });
32882
+
32856
32883
  // ../../core/sdk/webview/src/page-worker.ts
32857
32884
  import { createHash as createHash10 } from "node:crypto";
32858
32885
  function companionMethods(id, ids2) {
@@ -32894,25 +32921,12 @@ function companionBundleName(capabilities) {
32894
32921
  const ids2 = [...new Set(capabilities)].sort();
32895
32922
  return `himi-webview-page-${createHash10("sha256").update(ids2.join(",")).digest("hex").slice(0, 10)}`;
32896
32923
  }
32897
- var METHOD_REQUIRES, PAGE_CAPABILITIES, identifier;
32924
+ var PAGE_CAPABILITIES, identifier;
32898
32925
  var init_page_worker = __esm({
32899
32926
  "../../core/sdk/webview/src/page-worker.ts"() {
32900
32927
  init_define_HHP_CATALOG();
32901
32928
  init_page_methods_generated();
32902
- METHOD_REQUIRES = {
32903
- "presigned_upload.putFile": ["files"],
32904
- // `prepareImage` decodes and writes its outputs into the `files` substrate.
32905
- "camera.prepareImage": ["files"],
32906
- // #4688 — `writeImage` reads the image out of the `files` substrate.
32907
- "clipboard.writeImage": ["files"],
32908
- // `addMonitoredRegion` registers an OS geofence, which every bridge gates on `location_background`
32909
- // (JSWorker.actionRequirements); a companion without it would advertise a call that is refused.
32910
- "location.addMonitoredRegion": ["location_background"],
32911
- // The on-device ML image verbs read their image out of the `files` substrate.
32912
- "text_recognition.recognize": ["files"],
32913
- "image_labeling.label": ["files"],
32914
- "barcode_detection.detect": ["files"]
32915
- };
32929
+ init_page_method_requires();
32916
32930
  PAGE_CAPABILITIES = Object.keys(PAGE_METHODS);
32917
32931
  identifier = (id) => "cap_" + id.replace(/[^a-z0-9_]/g, "_");
32918
32932
  }
@@ -40188,7 +40202,6 @@ function resolveIdiom(tokens2, ctx = {}) {
40188
40202
  var IDIOM_CONTEXTS, UNSAFE_KEYS;
40189
40203
  var init_idiom = __esm({
40190
40204
  "../../core/ts/src/idiom.ts"() {
40191
- "use strict";
40192
40205
  init_define_HHP_CATALOG();
40193
40206
  IDIOM_CONTEXTS = {
40194
40207
  ios: { native: ["ios"] },
@@ -40403,9 +40416,9 @@ function springCurve(spring, durationMs2) {
40403
40416
  const x2 = springStep(response, zeta);
40404
40417
  const step = response / 64;
40405
40418
  const envelope = springEnvelope(response, zeta, x2);
40406
- let settle2 = 0;
40407
- for (let t2 = 0; t2 <= SPRING_MAX_SECS && envelope(t2) > SPRING_SETTLE_TOLERANCE; t2 += step) if (Math.abs(1 - x2(t2)) > SPRING_SETTLE_TOLERANCE) settle2 = t2;
40408
- const secs = Math.min(settle2 + step, SPRING_MAX_SECS);
40419
+ let settle3 = 0;
40420
+ for (let t2 = 0; t2 <= SPRING_MAX_SECS && envelope(t2) > SPRING_SETTLE_TOLERANCE; t2 += step) if (Math.abs(1 - x2(t2)) > SPRING_SETTLE_TOLERANCE) settle3 = t2;
40421
+ const secs = Math.min(settle3 + step, SPRING_MAX_SECS);
40409
40422
  const samples = Math.min(200, Math.max(24, Math.ceil(12 * secs / response)));
40410
40423
  const points = [];
40411
40424
  for (let i2 = 0; i2 <= samples; i2++) points.push(i2 === 0 ? 0 : i2 === samples ? 1 : Number(x2(secs * i2 / samples).toFixed(3)));
@@ -45226,7 +45239,7 @@ var init_preview2 = __esm({
45226
45239
  const out2 = [];
45227
45240
  const err = [];
45228
45241
  let settled = false;
45229
- const settle2 = (fn2, v2) => {
45242
+ const settle3 = (fn2, v2) => {
45230
45243
  if (settled) return;
45231
45244
  settled = true;
45232
45245
  clearTimeout(timer);
@@ -45237,14 +45250,14 @@ var init_preview2 = __esm({
45237
45250
  child3.kill("SIGKILL");
45238
45251
  } catch {
45239
45252
  }
45240
- settle2(reject, new Error(`${cmd} ${args[0] ?? ""} timed out after ${timeoutMs}ms`));
45253
+ settle3(reject, new Error(`${cmd} ${args[0] ?? ""} timed out after ${timeoutMs}ms`));
45241
45254
  }, timeoutMs);
45242
45255
  child3.stdout.on("data", (b3) => out2.push(b3));
45243
45256
  child3.stderr.on("data", (b3) => err.push(b3));
45244
- child3.on("error", (e2) => settle2(reject, e2));
45257
+ child3.on("error", (e2) => settle3(reject, e2));
45245
45258
  child3.on("close", (code2) => {
45246
- if (code2 === 0) settle2(resolve130, Buffer.concat(out2));
45247
- else settle2(reject, new Error(`${cmd} exited ${code2}: ${Buffer.concat(err).toString("utf8")}`));
45259
+ if (code2 === 0) settle3(resolve130, Buffer.concat(out2));
45260
+ else settle3(reject, new Error(`${cmd} exited ${code2}: ${Buffer.concat(err).toString("utf8")}`));
45248
45261
  });
45249
45262
  });
45250
45263
  },
@@ -47233,10 +47246,10 @@ function useImageSource(url, box) {
47233
47246
  React4.useEffect(() => {
47234
47247
  if (!url || !load6 || policy !== "ownerScoped" || !adapter) return;
47235
47248
  const controller = new AbortController();
47236
- const settle2 = (next, failed3 = false) => {
47249
+ const settle3 = (next, failed3 = false) => {
47237
47250
  if (!controller.signal.aborted) setResolved({ source: url, adapter, url: next, failed: failed3 });
47238
47251
  };
47239
- adapter.load(load6, controller.signal).then((next) => settle2(next), () => settle2(null, true));
47252
+ adapter.load(load6, controller.signal).then((next) => settle3(next), () => settle3(null, true));
47240
47253
  return () => controller.abort();
47241
47254
  }, [url, load6, policy, adapter, attempt2]);
47242
47255
  const current = resolved3?.source === url && resolved3.adapter === adapter && policy === "ownerScoped" ? resolved3 : null;
@@ -51792,17 +51805,17 @@ var init_controls = __esm({
51792
51805
  if (ni2 !== selIdx) select2(ni2);
51793
51806
  };
51794
51807
  const pagerRef = React16.useRef(null);
51795
- const settle2 = React16.useRef(void 0);
51808
+ const settle3 = React16.useRef(void 0);
51796
51809
  React16.useEffect(() => {
51797
51810
  const el2 = pagerRef.current;
51798
51811
  if (!el2 || !el2.clientWidth) return;
51799
51812
  const x2 = selIdx * el2.clientWidth;
51800
51813
  if (Math.abs(el2.scrollLeft - x2) > 1) el2.scrollTo?.({ left: x2, behavior: "smooth" });
51801
51814
  }, [selIdx, pages2]);
51802
- React16.useEffect(() => () => clearTimeout(settle2.current), []);
51815
+ React16.useEffect(() => () => clearTimeout(settle3.current), []);
51803
51816
  const onPagerScroll = () => {
51804
- clearTimeout(settle2.current);
51805
- settle2.current = setTimeout(() => {
51817
+ clearTimeout(settle3.current);
51818
+ settle3.current = setTimeout(() => {
51806
51819
  const el2 = pagerRef.current;
51807
51820
  if (!el2 || !el2.clientWidth) return;
51808
51821
  const i2 = Math.round(el2.scrollLeft / el2.clientWidth);
@@ -135325,7 +135338,7 @@ function lottieRuntime(lib) {
135325
135338
  } catch {
135326
135339
  }
135327
135340
  };
135328
- const settle2 = (el2) => {
135341
+ const settle3 = (el2) => {
135329
135342
  const anim = lottieAnims.get(el2);
135330
135343
  const host = el2;
135331
135344
  const played = host.dataset.himalayaLottiePlayed;
@@ -135394,7 +135407,7 @@ function lottieRuntime(lib) {
135394
135407
  const stamp = host.getAttribute("data-himalaya-lottie-play");
135395
135408
  if (!anim) return;
135396
135409
  if (!stamp) {
135397
- settle2(el2);
135410
+ settle3(el2);
135398
135411
  return;
135399
135412
  }
135400
135413
  if (host.dataset.himalayaLottiePlayed === stamp) return;
@@ -135411,7 +135424,7 @@ function lottieRuntime(lib) {
135411
135424
  if (r3.type !== "attributes" || !(r3.target instanceof Element)) continue;
135412
135425
  if (r3.attributeName === "data-himalaya-lottie") remount(r3.target);
135413
135426
  else if (r3.attributeName === "data-himalaya-lottie-reduce") applyReduce(r3.target);
135414
- else if (r3.attributeName === "data-himalaya-lottie-gen") settle2(r3.target);
135427
+ else if (r3.attributeName === "data-himalaya-lottie-gen") settle3(r3.target);
135415
135428
  else if (r3.attributeName === "data-himalaya-lottie-loop") applyLoop(r3.target);
135416
135429
  else replay(r3.target);
135417
135430
  }
@@ -140274,7 +140287,7 @@ var init_renderNode = __esm({
140274
140287
  if (!retypeSrc) return;
140275
140288
  let live4 = true;
140276
140289
  let made = null;
140277
- const settle2 = (r3) => {
140290
+ const settle3 = (r3) => {
140278
140291
  const u2 = r3?.url ?? null;
140279
140292
  made = u2;
140280
140293
  if (!live4) {
@@ -140283,7 +140296,7 @@ var init_renderNode = __esm({
140283
140296
  }
140284
140297
  setRetyped({ from: retypeSrc, url: u2, pageCount: r3?.pageCount ?? null });
140285
140298
  };
140286
- loadPdfFetch().then((m2) => m2.retypeAsPdfCounted(retypeSrc)).then(settle2, () => settle2(null));
140299
+ loadPdfFetch().then((m2) => m2.retypeAsPdfCounted(retypeSrc)).then(settle3, () => settle3(null));
140287
140300
  return () => {
140288
140301
  live4 = false;
140289
140302
  if (made) URL.revokeObjectURL(made);
@@ -143667,7 +143680,7 @@ var init_renderNode = __esm({
143667
143680
  const selectedId = isBinding(props2.selectedId) ? boundSel : props2.selectedId;
143668
143681
  const selIdx = Math.max(0, opts.findIndex((o2) => o2?.id === selectedId));
143669
143682
  const viewport = React21.useRef(null);
143670
- const settle2 = React21.useRef(void 0);
143683
+ const settle3 = React21.useRef(void 0);
143671
143684
  const pickerId = React21.useId();
143672
143685
  const interactive = !!ctx.onAction && !!props2.onChange;
143673
143686
  const emit = (index) => {
@@ -143678,7 +143691,7 @@ var init_renderNode = __esm({
143678
143691
  React21.useEffect(() => {
143679
143692
  if (viewport.current) viewport.current.scrollTop = selIdx * 32;
143680
143693
  }, [selIdx, opts.length]);
143681
- React21.useEffect(() => () => clearTimeout(settle2.current), []);
143694
+ React21.useEffect(() => () => clearTimeout(settle3.current), []);
143682
143695
  return /* @__PURE__ */ jsxs11("div", { style: { position: "relative", width: "100%", maxWidth: 220, height: 160, overflow: "hidden", background: C2("surfaceSecondary", "#f5f7fa"), borderRadius: 12, ...wrap }, children: [
143683
143696
  /* @__PURE__ */ jsx14("div", { "aria-hidden": "true", style: { position: "absolute", top: 64, left: 8, right: 8, height: 32, background: C2("surfacePrimary", "#fff"), borderRadius: 8, boxShadow: "inset 0 0 0 1px rgba(0,0,0,.06)" } }),
143684
143697
  /* @__PURE__ */ jsx14(
@@ -143698,8 +143711,8 @@ var init_renderNode = __esm({
143698
143711
  }
143699
143712
  },
143700
143713
  onScroll: () => {
143701
- clearTimeout(settle2.current);
143702
- settle2.current = setTimeout(() => emit(Math.max(0, Math.min(opts.length - 1, Math.round((viewport.current?.scrollTop ?? 0) / 32)))), 120);
143714
+ clearTimeout(settle3.current);
143715
+ settle3.current = setTimeout(() => emit(Math.max(0, Math.min(opts.length - 1, Math.round((viewport.current?.scrollTop ?? 0) / 32)))), 120);
143703
143716
  },
143704
143717
  style: { position: "relative", height: "100%", overflowY: "auto", scrollbarWidth: "none", scrollSnapType: "y mandatory", padding: "64px 0", boxSizing: "border-box" },
143705
143718
  children: opts.map((o2, index) => /* @__PURE__ */ jsx14(
@@ -152207,6 +152220,587 @@ var init_base44_crawl_data = __esm({
152207
152220
  }
152208
152221
  });
152209
152222
 
152223
+ // ../../core/dev-server/src/webview-bridge-crawl.ts
152224
+ function logicBundleOf(descriptor) {
152225
+ if (!isRec3(descriptor)) return null;
152226
+ const lb = descriptor.logicBundle ?? descriptor.logic_bundle;
152227
+ return isRec3(lb) ? lb : null;
152228
+ }
152229
+ function declaredOf(descriptor) {
152230
+ const lb = logicBundleOf(descriptor);
152231
+ const list5 = lb ? lb.declaredCapabilities ?? lb.declared_capabilities : void 0;
152232
+ return Array.isArray(list5) ? list5.filter((c2) => typeof c2 === "string") : [];
152233
+ }
152234
+ function bridgedPages(screenId, descriptor) {
152235
+ if (!isRec3(descriptor)) return { pages: [], templatePages: 0 };
152236
+ const pages2 = [];
152237
+ const renderer = typeof descriptor.renderer === "string" ? descriptor.renderer : "";
152238
+ if (T3_WEBVIEW_RENDERERS.has(renderer) && logicBundleOf(descriptor)) {
152239
+ pages2.push({ node: "(screen)", instanceId: "", path: "", props: {} });
152240
+ }
152241
+ const input = isRec3(descriptor.input) ? descriptor.input : void 0;
152242
+ let templatePages = 0;
152243
+ for (const s5 of bridgedWebViews(descriptor)) {
152244
+ if (s5.inTemplate) {
152245
+ templatePages++;
152246
+ continue;
152247
+ }
152248
+ const explicit3 = typeof s5.props.instanceId === "string" && !s5.props.instanceId.startsWith("$") ? s5.props.instanceId : void 0;
152249
+ pages2.push({ node: s5.id || s5.path, instanceId: effectiveWebViewInstanceId(screenId, input, s5.id, explicit3), path: s5.path, props: s5.props });
152250
+ }
152251
+ return { pages: pages2, templatePages };
152252
+ }
152253
+ function serializationProblem(value2, at2 = "result") {
152254
+ const seen = /* @__PURE__ */ new Set();
152255
+ const walk5 = (v2, path2) => {
152256
+ if (typeof v2 === "bigint") return { fatal: true, what: `a BigInt at ${path2}` };
152257
+ if (typeof v2 === "function") return { fatal: false, what: `a function at ${path2} (JSON drops it)` };
152258
+ if (typeof v2 === "symbol") return { fatal: false, what: `a symbol at ${path2} (JSON drops it)` };
152259
+ if (typeof v2 === "number" && !Number.isFinite(v2)) return { fatal: false, what: `${String(v2)} at ${path2} (JSON sends null)` };
152260
+ if (!v2 || typeof v2 !== "object") return null;
152261
+ if (seen.has(v2)) return { fatal: true, what: `a cycle at ${path2}` };
152262
+ if (typeof v2.toJSON === "function") return null;
152263
+ const tag = tagOf(v2);
152264
+ if (tag === "Map" || tag === "Set" || tag === "WeakMap" || tag === "WeakSet") {
152265
+ return { fatal: false, what: `a ${tag} at ${path2} (JSON sends {})` };
152266
+ }
152267
+ seen.add(v2);
152268
+ try {
152269
+ if (Array.isArray(v2)) {
152270
+ for (let i2 = 0; i2 < v2.length; i2++) {
152271
+ const p2 = walk5(v2[i2], `${path2}[${i2}]`);
152272
+ if (p2) return p2;
152273
+ }
152274
+ return null;
152275
+ }
152276
+ for (const [k3, child3] of Object.entries(v2)) {
152277
+ const p2 = walk5(child3, `${path2}.${k3}`);
152278
+ if (p2) return p2;
152279
+ }
152280
+ return null;
152281
+ } finally {
152282
+ seen.delete(v2);
152283
+ }
152284
+ };
152285
+ return walk5(value2, at2);
152286
+ }
152287
+ function createPageHost() {
152288
+ let pageHandler = null;
152289
+ let lifecycleHandler = null;
152290
+ const outbox = [];
152291
+ let live4 = null;
152292
+ const runtime = {
152293
+ postToPage(msg, instanceId) {
152294
+ const rec = isRec3(msg) ? msg : { value: msg };
152295
+ const field = "result" in rec ? "result" : "chunk" in rec ? "chunk" : "data" in rec ? "data" : null;
152296
+ let problem = field ? serializationProblem(rec[field], field) : null;
152297
+ if (!problem) {
152298
+ try {
152299
+ JSON.stringify(msg);
152300
+ } catch (e2) {
152301
+ problem = { fatal: true, what: String(e2?.message ?? e2) };
152302
+ }
152303
+ }
152304
+ const posted = { iid: typeof instanceId === "string" ? instanceId : "", msg: rec, problem };
152305
+ outbox.push(posted);
152306
+ try {
152307
+ live4?.(posted);
152308
+ } catch {
152309
+ }
152310
+ },
152311
+ onPageMessage(cb) {
152312
+ pageHandler = typeof cb === "function" ? cb : null;
152313
+ },
152314
+ onPageLifecycle(cb) {
152315
+ lifecycleHandler = typeof cb === "function" ? cb : null;
152316
+ }
152317
+ };
152318
+ return {
152319
+ runtime,
152320
+ outbox,
152321
+ listening: () => pageHandler !== null,
152322
+ attach(cb) {
152323
+ live4 = cb;
152324
+ },
152325
+ send(msg, iid) {
152326
+ if (!pageHandler) return null;
152327
+ try {
152328
+ pageHandler(overTheWire(msg), iid);
152329
+ return null;
152330
+ } catch (e2) {
152331
+ return String(e2?.message ?? e2);
152332
+ }
152333
+ },
152334
+ lifecycle(state, iid) {
152335
+ try {
152336
+ lifecycleHandler?.({ v: 1, sys: "lifecycle", iid, state }, iid);
152337
+ } catch {
152338
+ }
152339
+ }
152340
+ };
152341
+ }
152342
+ async function settle(done, ms2) {
152343
+ const end2 = Date.now() + ms2;
152344
+ do
152345
+ await new Promise((r3) => setTimeout(r3, 0));
152346
+ while (!done() && Date.now() < end2);
152347
+ }
152348
+ function bindingValue(state, binding2) {
152349
+ const m2 = /^\$service:([^.[]+)(?:\.(.+))?$/.exec(binding2);
152350
+ if (!m2) return void 0;
152351
+ const svc = state[m2[1]];
152352
+ return m2[2] ? pathValue(svc, m2[2]) : svc;
152353
+ }
152354
+ function typeMismatch(value2, expect) {
152355
+ if (value2 === void 0) return false;
152356
+ if (expect === "boolean") return typeof value2 !== "boolean";
152357
+ if (expect === "number") return typeof value2 !== "number" || !Number.isFinite(value2);
152358
+ return !(typeof value2 === "string" || typeof value2 === "number" || typeof value2 === "boolean");
152359
+ }
152360
+ async function crawlWebViewBridge(o2) {
152361
+ const { screenId, descriptor } = o2;
152362
+ const { pages: pages2, templatePages } = bridgedPages(screenId, descriptor);
152363
+ if (!pages2.length && !templatePages) return null;
152364
+ const declared = declaredOf(descriptor);
152365
+ if (!grants(declared, "webview")) return null;
152366
+ const budgetMs = o2.budgetMs && o2.budgetMs > 0 ? o2.budgetMs : 2e3;
152367
+ if (!pages2.length) {
152368
+ return { screen: screenId, pages: [], templatePages, listening: false, manifest: null, calls: [], probes: { sent: 0, threw: 0 }, events: [], findings: [] };
152369
+ }
152370
+ const host = createPageHost();
152371
+ const w2 = await o2.boot(host.runtime);
152372
+ if (!w2) return null;
152373
+ const findings = [];
152374
+ const calls = [];
152375
+ const seen = /* @__PURE__ */ new Set();
152376
+ const add = (f2) => {
152377
+ const k3 = `${f2.invariant}|${f2.at ?? ""}|${f2.message}`;
152378
+ if (seen.has(k3)) return;
152379
+ seen.add(k3);
152380
+ findings.push({ screen: screenId, trigger: "boot", axis: "webview:bridge", ...f2 });
152381
+ };
152382
+ const page = pages2[0];
152383
+ let seq3 = 0;
152384
+ const nextId = () => `himi-test-${++seq3}`;
152385
+ const answerTo = (id) => host.outbox.find((p2) => p2.msg.id === id && "ok" in p2.msg);
152386
+ try {
152387
+ for (const p2 of pages2) for (const state of ["mounted", "loaded", "active"]) host.lifecycle(state, p2.instanceId);
152388
+ await settle(() => false, DRAIN_MS);
152389
+ const handshake = async (iid) => {
152390
+ const id = nextId();
152391
+ host.send({ v: 1, id, capability: "himalaya", method: "capabilities", args: [] }, iid);
152392
+ await settle(() => !!answerTo(id), budgetMs);
152393
+ const res = answerTo(id)?.msg;
152394
+ const caps = res?.ok === true && isRec3(res.result) && isRec3(res.result.capabilities) ? res.result.capabilities : null;
152395
+ if (!caps) return null;
152396
+ const out2 = {};
152397
+ for (const [k3, v2] of Object.entries(caps)) if (Array.isArray(v2)) out2[k3] = Array.from(v2).filter((m2) => typeof m2 === "string");
152398
+ return out2;
152399
+ };
152400
+ const listening = host.listening();
152401
+ const manifest2 = listening ? await handshake(page.instanceId) : null;
152402
+ if (!listening) {
152403
+ add({
152404
+ invariant: "webview-page-unheard",
152405
+ severity: "warning",
152406
+ at: page.path || void 0,
152407
+ message: `the page of ${page.node === "(screen)" ? "this WebView screen" : `WebView "${page.node}"`} has a worker channel, but the worker never listens on it \u2014 every \`himalaya.*\` call the page makes is unanswered`,
152408
+ hint: `Register the page surface during the bundle's setup: exposeCapabilitiesToPage({...}), onPageRequest(namespace, handlers) or onPageMessage(cb) from @himalaya/webview. If the page needs no native calls, drop bridge: "worker".`
152409
+ });
152410
+ }
152411
+ const staticallyUndeclared = /* @__PURE__ */ new Set();
152412
+ for (const [ns2, methods] of Object.entries(manifest2 ?? {})) {
152413
+ const sdk = PAGE_METHODS[ns2];
152414
+ if (!sdk) continue;
152415
+ if (!grants(declared, ns2)) {
152416
+ staticallyUndeclared.add(ns2);
152417
+ add({
152418
+ invariant: "capability-undeclared",
152419
+ severity: "error",
152420
+ message: `the worker exposes "${ns2}" to the page, but logicBundle.declaredCapabilities does not grant it \u2014 the native registry refuses every call, so the page's ${ns2}.* calls all fail`,
152421
+ hint: `Add "${ns2}" to declaredCapabilities (and to the app config's capabilities), or stop exposing it.`
152422
+ });
152423
+ continue;
152424
+ }
152425
+ for (const m2 of methods) {
152426
+ const missing4 = (METHOD_REQUIRES[`${ns2}.${m2}`] ?? []).filter((r3) => !grants(declared, r3));
152427
+ if (missing4.length) {
152428
+ add({
152429
+ invariant: "capability-undeclared",
152430
+ severity: "error",
152431
+ message: `the page is offered ${ns2}.${m2}, which also needs ${missing4.map((c2) => `"${c2}"`).join(", ")} \u2014 not granted by logicBundle.declaredCapabilities, so the call is refused on device`,
152432
+ hint: `Declare ${missing4.join(", ")} too, or drop "${m2}" from the exposed methods (the generated companion leaves it out).`
152433
+ });
152434
+ }
152435
+ }
152436
+ const also = sdk.dispatchesAlso.filter((c2) => !grants(declared, c2));
152437
+ if (also.length) {
152438
+ add({
152439
+ invariant: "capability-undeclared",
152440
+ severity: "warning",
152441
+ message: `"${ns2}" is exposed to the page, and its package also dispatches ${also.map((c2) => `"${c2}"`).join(", ")}, which logicBundle.declaredCapabilities does not grant \u2014 the methods that use it are refused on device`,
152442
+ hint: `The generated companion declares ${["webview", ns2, ...sdk.dispatchesAlso].join(", ")}.`
152443
+ });
152444
+ }
152445
+ }
152446
+ const loaded2 = [];
152447
+ const notLoaded = [];
152448
+ if (o2.pages && listening) {
152449
+ for (const p2 of pages2) {
152450
+ const src = pageSource(p2, descriptor);
152451
+ if (!src) {
152452
+ notLoaded.push({ node: p2.node, why: "no inlineHtml or url" });
152453
+ continue;
152454
+ }
152455
+ if (src.url && !o2.pages.live) {
152456
+ notLoaded.push({ node: p2.node, why: `remote url ${src.url} \u2014 pass --webview-live to load it` });
152457
+ continue;
152458
+ }
152459
+ try {
152460
+ loaded2.push(await playPage(o2.pages, p2, src, descriptor, host, w2, manifest2, declared, add, staticallyUndeclared));
152461
+ } catch (e2) {
152462
+ notLoaded.push({ node: p2.node, why: String(e2?.message ?? e2).split("\n")[0] });
152463
+ }
152464
+ }
152465
+ } else if (o2.pages && !listening) {
152466
+ for (const p2 of pages2) notLoaded.push({ node: p2.node, why: "the worker never listens on the page channel" });
152467
+ }
152468
+ const inputCrashes = /* @__PURE__ */ new Map();
152469
+ const call = async (iid, ns2, method, args) => {
152470
+ const kind = PAGE_METHODS[ns2] ? "capability" : "namespace";
152471
+ const id = nextId();
152472
+ const deniedBefore = w2.deniedCapabilities.length;
152473
+ const from = host.outbox.length;
152474
+ host.send({ v: 1, id, capability: ns2, method, args }, iid);
152475
+ await settle(() => !!answerTo(id), budgetMs);
152476
+ const answer = answerTo(id);
152477
+ const denied2 = w2.deniedCapabilities.slice(deniedBefore);
152478
+ if (!answer) return { capability: ns2, method, kind, outcome: "unanswered", denied: denied2 };
152479
+ const res = answer.msg;
152480
+ if (res.stream === true) {
152481
+ const isChunk = (p2) => p2.msg.sid === id;
152482
+ const ended = () => host.outbox.slice(from).some((p2) => isChunk(p2) && ("end" in p2.msg || "error" in p2.msg));
152483
+ await settle(ended, budgetMs);
152484
+ const chunks = host.outbox.slice(from).filter((p2) => isChunk(p2) && "chunk" in p2.msg);
152485
+ if (!ended()) host.send({ v: 1, sys: "cancel", sid: id }, iid);
152486
+ const problem = chunks.map((c2) => c2.problem).find(Boolean) ?? null;
152487
+ return { capability: ns2, method, kind, outcome: "stream", chunks: chunks.length, problem, denied: denied2 };
152488
+ }
152489
+ if (res.ok === true) return { capability: ns2, method, kind, outcome: "ok", problem: answer.problem, denied: denied2 };
152490
+ const err = isRec3(res.error) ? res.error : {};
152491
+ return {
152492
+ capability: ns2,
152493
+ method,
152494
+ kind,
152495
+ outcome: "error",
152496
+ denied: denied2,
152497
+ ...typeof err.code === "string" ? { code: err.code } : {},
152498
+ ...typeof err.message === "string" ? { message: err.message } : {}
152499
+ };
152500
+ };
152501
+ for (const pg of manifest2 ? pages2 : []) for (const [ns2, methods] of Object.entries(manifest2 ?? {})) {
152502
+ for (const method of methods) {
152503
+ const r3 = await call(pg.instanceId, ns2, method, []);
152504
+ calls.push({ capability: r3.capability, method: r3.method, kind: r3.kind, outcome: r3.outcome, ...r3.code ? { code: r3.code } : {}, ...r3.chunks !== void 0 ? { chunks: r3.chunks } : {}, ...pages2.length > 1 ? { instanceId: pg.instanceId } : {} });
152505
+ const label4 = `${ns2}.${method}`;
152506
+ if (r3.denied.length && !staticallyUndeclared.has(ns2)) {
152507
+ const ids2 = [...new Set(r3.denied.map((d2) => d2.replace(/^capability\./, "").split(".")[0]))];
152508
+ add({
152509
+ invariant: "capability-undeclared",
152510
+ severity: "error",
152511
+ message: `the page's call ${label4}() reached ${ids2.join(", ")}, which logicBundle.declaredCapabilities does not grant \u2014 refused on device`,
152512
+ hint: `Declare ${ids2.join(", ")}, or stop exposing ${label4}.`
152513
+ });
152514
+ }
152515
+ if (r3.outcome === "unanswered") {
152516
+ const sdk = PAGE_METHODS[ns2];
152517
+ const notExported = sdk && !sdk.methods.includes(method);
152518
+ add({
152519
+ invariant: "webview-call-unanswered",
152520
+ severity: notExported ? "error" : "warning",
152521
+ message: notExported ? `the page is offered ${label4}, but ${sdk.package} has no page-callable "${method}" \u2014 the dispatcher finds no function and never answers, so the page's promise hangs forever` : `the page's call ${label4}() was never answered within the crawl's budget \u2014 a page awaiting it hangs`,
152522
+ hint: notExported ? `${ns2} offers: ${sdk.methods.join(", ")}. Fix the name in exposeCapabilitiesToPage's methods list.` : r3.kind === "namespace" ? "An onPageRequest handler must return or throw; one that waits for something the page never sends leaves the call pending forever. Return a stream (openPageStream) for long-lived answers." : "The exposed SDK call never settled on the crawl's capability bus."
152523
+ });
152524
+ }
152525
+ if (r3.problem) {
152526
+ add({
152527
+ invariant: "webview-answer-unserializable",
152528
+ severity: r3.problem.fatal ? "error" : "warning",
152529
+ message: r3.problem.fatal ? `${label4}() answers ${r3.problem.what} \u2014 the device's bridge cannot JSON-encode it, so the answer is never delivered and the page's promise hangs` : `${label4}() answers ${r3.problem.what} \u2014 the page receives something other than what the worker returned`,
152530
+ hint: "Return plain JSON data from page handlers: objects, arrays, strings, finite numbers, booleans, null."
152531
+ });
152532
+ }
152533
+ if (r3.kind === "namespace") {
152534
+ if (r3.outcome === "error" && r3.message && INPUT_CRASH.test(r3.message)) inputCrashes.set(label4, `() \u2192 ${r3.message}`);
152535
+ for (const args of HOSTILE_ARGS) {
152536
+ if (inputCrashes.has(label4)) break;
152537
+ const h2 = await call(pg.instanceId, ns2, method, args);
152538
+ if (h2.outcome === "error" && h2.message && INPUT_CRASH.test(h2.message)) inputCrashes.set(label4, `(${JSON.stringify(args).slice(1, -1)}) \u2192 ${h2.message}`);
152539
+ }
152540
+ }
152541
+ }
152542
+ }
152543
+ if (inputCrashes.size) {
152544
+ add({
152545
+ invariant: "webview-page-input-crash",
152546
+ severity: "warning",
152547
+ message: `${inputCrashes.size} page handler(s) crash on page input instead of answering a typed error: ${[...inputCrashes].map(([m2, why]) => `${m2}${why}`).join("; ")}`,
152548
+ hint: "The page is untrusted (RFC 0073 \xA75.3). Validate args in each onPageRequest handler and throw an Error with a `code` the page can branch on."
152549
+ });
152550
+ }
152551
+ let threw = 0;
152552
+ const threwOn = [];
152553
+ if (listening) {
152554
+ for (const pg of pages2) for (const probe2 of PROBES) {
152555
+ const err = host.send(probe2.msg, pg.instanceId);
152556
+ if (err !== null) {
152557
+ threw++;
152558
+ threwOn.push(`${probe2.label} (${err})`);
152559
+ }
152560
+ }
152561
+ await settle(() => false, DRAIN_MS);
152562
+ if (threw) {
152563
+ add({
152564
+ invariant: "webview-page-input-crash",
152565
+ severity: "warning",
152566
+ message: `worker code threw on ${threw} malformed page message(s): ${threwOn.slice(0, 4).join("; ")}${threwOn.length > 4 ? "; \u2026" : ""}`,
152567
+ hint: "An onPageMessage handler receives whatever the page posts. Check the shape before reading fields."
152568
+ });
152569
+ }
152570
+ if (manifest2 && (await Promise.all(pages2.map((pg) => handshake(pg.instanceId)))).some((m2) => !m2)) {
152571
+ add({
152572
+ invariant: "webview-call-unanswered",
152573
+ severity: "error",
152574
+ message: "the page channel answered the handshake, then stopped answering after malformed page messages \u2014 one bad message from the page breaks every later call",
152575
+ hint: "Something the page sent corrupted the worker's channel state. Re-run with the probes in webview-bridge-crawl.ts to find which."
152576
+ });
152577
+ }
152578
+ }
152579
+ for (const p2 of pages2) {
152580
+ for (const b3 of BINDING_TYPES) {
152581
+ const binding2 = p2.props[b3.prop];
152582
+ if (typeof binding2 !== "string" || !binding2.startsWith("$service:")) continue;
152583
+ const value2 = bindingValue(w2.state, binding2);
152584
+ if (!typeMismatch(value2, b3.expect)) continue;
152585
+ add({
152586
+ invariant: "webview-binding-type",
152587
+ severity: "warning",
152588
+ at: `${p2.path}.body.props.${b3.prop}`,
152589
+ message: `WebView "${p2.node}" ${b3.prop} "${binding2}" resolves to ${JSON.stringify(value2) ?? String(value2)} \u2014 the host reads ${b3.reads}`,
152590
+ hint: `Keep ${binding2.slice("$service:".length)} as ${b3.reads} in the worker state.`
152591
+ });
152592
+ }
152593
+ }
152594
+ for (const p2 of pages2) host.lifecycle("unmounted", p2.instanceId);
152595
+ const events2 = [...new Set(host.outbox.filter((p2) => typeof p2.msg.ev === "string").map((p2) => `${String(p2.msg.ns)}.${String(p2.msg.ev)}`))].sort();
152596
+ return {
152597
+ screen: screenId,
152598
+ pages: pages2.map((p2) => ({ node: p2.node, instanceId: p2.instanceId })),
152599
+ templatePages,
152600
+ listening,
152601
+ manifest: manifest2,
152602
+ calls,
152603
+ probes: { sent: listening ? PROBES.length * pages2.length : 0, threw },
152604
+ events: events2,
152605
+ ...o2.pages ? { loaded: loaded2, notLoaded } : {},
152606
+ findings
152607
+ };
152608
+ } finally {
152609
+ w2.dispose();
152610
+ }
152611
+ }
152612
+ function pageSource(p2, descriptor) {
152613
+ if (p2.node === "(screen)") {
152614
+ const url = isRec3(descriptor) && typeof descriptor.url === "string" ? descriptor.url : "";
152615
+ return url ? { url } : null;
152616
+ }
152617
+ if (typeof p2.props.inlineHtml === "string" && p2.props.inlineHtml) return { html: p2.props.inlineHtml };
152618
+ if (typeof p2.props.url === "string" && p2.props.url) return { url: p2.props.url };
152619
+ return null;
152620
+ }
152621
+ function allowedOriginsOf2(p2, descriptor) {
152622
+ const config = p2.node === "(screen)" ? isRec3(descriptor) && isRec3(descriptor.webViewConfig) ? descriptor.webViewConfig : {} : isRec3(p2.props.config) ? p2.props.config : {};
152623
+ return Array.isArray(config.allowedOrigins) ? config.allowedOrigins.filter((o2) => typeof o2 === "string") : [];
152624
+ }
152625
+ async function playPage(opt3, p2, src, descriptor, host, w2, manifest2, declared, add, staticallyUndeclared) {
152626
+ const where = p2.node === "(screen)" ? "this WebView screen's page" : `WebView "${p2.node}"'s page`;
152627
+ const requests = [];
152628
+ let traffic = 0;
152629
+ let rawTraffic = 0;
152630
+ const outboxFrom = host.outbox.length;
152631
+ const deniedFrom = w2.deniedCapabilities.length;
152632
+ let session = null;
152633
+ let chain = Promise.resolve();
152634
+ const early = [];
152635
+ const deliver = (posted) => {
152636
+ const s5 = session;
152637
+ chain = chain.then(() => s5.deliver(posted.msg)).catch(() => {
152638
+ });
152639
+ };
152640
+ host.attach((posted) => {
152641
+ if (posted.iid !== p2.instanceId) return;
152642
+ traffic++;
152643
+ if (typeof posted.msg.id !== "string" && typeof posted.msg.sid !== "string" && typeof posted.msg.ev !== "string") rawTraffic++;
152644
+ if (session) deliver(posted);
152645
+ else early.push(posted);
152646
+ });
152647
+ const result = {
152648
+ node: p2.node,
152649
+ source: src.html !== void 0 ? "inline" : "url",
152650
+ calls: [],
152651
+ pageErrors: [],
152652
+ consoleErrors: 0,
152653
+ links: { total: 0, offAllowlist: 0 },
152654
+ blockedRequests: 0
152655
+ };
152656
+ try {
152657
+ session = await opt3.driver.open({
152658
+ ...src,
152659
+ budgetMs: opt3.budgetMs ?? 3e3,
152660
+ network: opt3.live,
152661
+ toWorker: (msg) => {
152662
+ traffic++;
152663
+ if (isRec3(msg) && msg.v === 1 && typeof msg.id === "string" && typeof msg.capability === "string" && typeof msg.method === "string") {
152664
+ requests.push({ id: msg.id, capability: msg.capability, method: msg.method });
152665
+ }
152666
+ host.send(msg, p2.instanceId);
152667
+ }
152668
+ });
152669
+ for (const posted of early.splice(0)) deliver(posted);
152670
+ await session.settle(() => traffic);
152671
+ await chain;
152672
+ const report9 = await session.report();
152673
+ if (report9.loadError) {
152674
+ add({
152675
+ invariant: "webview-page-error",
152676
+ severity: "warning",
152677
+ at: p2.path || void 0,
152678
+ message: `${where} did not load in the crawl's browser: ${report9.loadError}`,
152679
+ hint: "The bridge pass still ran against the worker; only the page's own behaviour is unverified."
152680
+ });
152681
+ }
152682
+ result.pageErrors = report9.pageErrors.slice(0, 10);
152683
+ result.consoleErrors = report9.consoleErrors.length;
152684
+ result.blockedRequests = report9.blockedRequests;
152685
+ const allowed2 = allowedOriginsOf2(p2, descriptor);
152686
+ const httpLinks = report9.links.filter((h2) => originOf2(h2));
152687
+ result.links = {
152688
+ total: httpLinks.length,
152689
+ offAllowlist: allowed2.length ? httpLinks.filter((h2) => !webViewOriginAllowed(h2, allowed2)).length : 0
152690
+ };
152691
+ if (report9.pageErrors.length) {
152692
+ add({
152693
+ invariant: "webview-page-error",
152694
+ severity: "warning",
152695
+ at: p2.path || void 0,
152696
+ message: `${where} threw ${report9.pageErrors.length} uncaught error(s) while loading: ${report9.pageErrors.slice(0, 3).join("; ")}`,
152697
+ hint: report9.blockedRequests ? `Uncaught page errors usually mean a feature silently stopped. ${report9.blockedRequests} network request(s) the page made were refused to keep the run hermetic \u2014 if the errors come from those, --webview-live lets them through.` : "Uncaught page errors usually mean a feature silently stopped. They ran against the real worker, with the crawl's data."
152698
+ });
152699
+ }
152700
+ } finally {
152701
+ host.attach(null);
152702
+ await session?.close().catch(() => {
152703
+ });
152704
+ }
152705
+ const answers2 = host.outbox.slice(outboxFrom).filter((x2) => x2.iid === p2.instanceId && typeof x2.msg.id === "string" && "ok" in x2.msg);
152706
+ const unknownMethods = [];
152707
+ for (const r3 of requests) {
152708
+ if (r3.capability === "himalaya") continue;
152709
+ const a3 = answers2.find((x2) => x2.msg.id === r3.id)?.msg;
152710
+ const outcome = !a3 ? "unanswered" : a3.ok !== true ? "error" : a3.stream === true ? "stream" : "ok";
152711
+ const code2 = a3 && a3.ok !== true && isRec3(a3.error) && typeof a3.error.code === "string" ? a3.error.code : void 0;
152712
+ result.calls.push({ capability: r3.capability, method: r3.method, outcome, ...code2 ? { code: code2 } : {} });
152713
+ const label4 = `${r3.capability}.${r3.method}`;
152714
+ if (outcome === "unanswered") {
152715
+ const offered = manifest2?.[r3.capability];
152716
+ const certain = !!manifest2 && !offered && rawTraffic === 0;
152717
+ add({
152718
+ invariant: "webview-call-unanswered",
152719
+ severity: certain ? "error" : "warning",
152720
+ at: p2.path || void 0,
152721
+ message: certain ? `${where} calls ${label4}() while loading, but the worker does not offer "${r3.capability}" \u2014 the call is never answered and the page's promise hangs` : `${where} calls ${label4}() while loading, and it was not answered within the crawl's budget`,
152722
+ hint: certain ? `The worker offers: ${Object.keys(manifest2 ?? {}).join(", ") || "nothing"}. Expose it (exposeCapabilitiesToPage / onPageRequest), or have the page check himalaya.isEnabled("${r3.capability}", "${r3.method}") first.` : "A page awaiting it hangs; return or throw from the handler, or answer with a stream."
152723
+ });
152724
+ }
152725
+ if (code2 === "unknown_method") unknownMethods.push(label4);
152726
+ }
152727
+ if (unknownMethods.length) {
152728
+ add({
152729
+ invariant: "webview-call-unanswered",
152730
+ severity: "warning",
152731
+ at: p2.path || void 0,
152732
+ message: `${where} calls methods its worker's namespace does not have: ${[...new Set(unknownMethods)].join(", ")} \u2014 each answers unknown_method`,
152733
+ hint: "Add the handler to onPageRequest, or fix the page's method name."
152734
+ });
152735
+ }
152736
+ const denied2 = [...new Set(w2.deniedCapabilities.slice(deniedFrom).map((d2) => d2.replace(/^capability\./, "").split(".")[0]))].filter((c2) => !staticallyUndeclared.has(c2) && !grants(declared, c2));
152737
+ if (denied2.length) {
152738
+ add({
152739
+ invariant: "capability-undeclared",
152740
+ severity: "error",
152741
+ at: p2.path || void 0,
152742
+ message: `${where} drove the worker into ${denied2.join(", ")}, which logicBundle.declaredCapabilities does not grant \u2014 refused on device`,
152743
+ hint: `Declare ${denied2.join(", ")}, or stop exposing what reaches it.`
152744
+ });
152745
+ }
152746
+ return result;
152747
+ }
152748
+ var T3_WEBVIEW_RENDERERS, isRec3, tagOf, overTheWire, DRAIN_MS, INPUT_CRASH, PROBES, HOSTILE_ARGS, BINDING_TYPES, originOf2;
152749
+ var init_webview_bridge_crawl = __esm({
152750
+ "../../core/dev-server/src/webview-bridge-crawl.ts"() {
152751
+ init_define_HHP_CATALOG();
152752
+ init_validate_descriptor_core();
152753
+ init_webview_embedded();
152754
+ init_webview_origin();
152755
+ init_page_methods_generated();
152756
+ init_page_method_requires();
152757
+ init_implications();
152758
+ T3_WEBVIEW_RENDERERS = /* @__PURE__ */ new Set(["webview_native_bridge", "webview_ds"]);
152759
+ isRec3 = (v2) => !!v2 && typeof v2 === "object" && !Array.isArray(v2);
152760
+ tagOf = (v2) => Object.prototype.toString.call(v2).slice(8, -1);
152761
+ overTheWire = (msg) => msg === void 0 ? void 0 : JSON.parse(JSON.stringify(msg));
152762
+ DRAIN_MS = 10;
152763
+ INPUT_CRASH = /Cannot read propert|Cannot destructure|is not a function|is not iterable|undefined is not an object|null is not an object|Cannot convert undefined or null/;
152764
+ PROBES = [
152765
+ { label: "null", msg: null },
152766
+ { label: "a string", msg: "hello" },
152767
+ { label: "a number", msg: 42 },
152768
+ { label: "an array", msg: [1, 2] },
152769
+ { label: "an empty object", msg: {} },
152770
+ { label: "{ v: 1 } alone", msg: { v: 1 } },
152771
+ { label: "a request without args", msg: { v: 1, id: "probe-noargs", capability: "himalaya", method: "capabilities" } },
152772
+ { label: "args that is not an array", msg: { v: 1, id: "probe-args", capability: "himalaya", method: "capabilities", args: "x" } },
152773
+ { label: "13 args", msg: { v: 1, id: "probe-13", capability: "himalaya", method: "capabilities", args: Array.from({ length: 13 }, () => 0) } },
152774
+ { label: "a __proto__ capability", msg: { v: 1, id: "probe-proto", capability: "__proto__", method: "toString", args: [] } },
152775
+ { label: "a cancel for an unknown stream", msg: { v: 1, sys: "cancel", sid: "probe-nostream" } },
152776
+ { label: "a forged lifecycle", msg: { v: 1, sys: "lifecycle", state: "unmounted" } },
152777
+ { label: "a console message with odd args", msg: { v: 1, sys: "console", level: "error", args: "not-an-array" } },
152778
+ { label: "a malformed site report", msg: { v: 1, sys: "site", cart: "lots", member: 7 } },
152779
+ { label: "a deeply nested object", msg: (() => {
152780
+ let o2 = { leaf: true };
152781
+ for (let i2 = 0; i2 < 120; i2++) o2 = { o: o2 };
152782
+ return o2;
152783
+ })() },
152784
+ { label: "a 200 KB string", msg: { v: 1, text: "x".repeat(2e5) } }
152785
+ ];
152786
+ HOSTILE_ARGS = [[null], [{}], ["<img src=x onerror=alert(1)>"]];
152787
+ BINDING_TYPES = [
152788
+ { prop: "activePath", expect: "boolean", reads: "a boolean (false = inactive)" },
152789
+ { prop: "mutedPath", expect: "boolean", reads: "a boolean (true = muted)" },
152790
+ { prop: "heightPath", expect: "number", reads: "a finite number of points/dp" },
152791
+ { prop: "reloadKeyPath", expect: "scalar", reads: "a string, number or boolean" }
152792
+ ];
152793
+ originOf2 = (href) => {
152794
+ try {
152795
+ const u2 = new URL(href);
152796
+ return u2.protocol === "http:" || u2.protocol === "https:" ? u2.origin : null;
152797
+ } catch {
152798
+ return null;
152799
+ }
152800
+ };
152801
+ }
152802
+ });
152803
+
152210
152804
  // ../../core/web-host/src/persistence/query.ts
152211
152805
  function isScalar(v2) {
152212
152806
  return typeof v2 === "string" || typeof v2 === "number" || typeof v2 === "boolean";
@@ -152585,6 +153179,7 @@ __export(screen_crawl_exports, {
152585
153179
  crawlScreenHostile: () => crawlScreenHostile,
152586
153180
  crawlScreenJourney: () => crawlScreenJourney,
152587
153181
  crawlScreenRelations: () => crawlScreenRelations,
153182
+ crawlScreenWebView: () => crawlScreenWebView,
152588
153183
  crawlSignature: () => crawlSignature,
152589
153184
  declaredCapabilitiesOf: () => declaredCapabilitiesOf,
152590
153185
  deepStateSignature: () => deepStateSignature,
@@ -153497,7 +154092,8 @@ async function bootScreenWorker(opts) {
153497
154092
  seed: opts.seed ?? 1,
153498
154093
  skipLoad: opts.authoredLoadOnly === true || !!(appear && parseWorkerAction(appear.actionId)),
153499
154094
  settleAuthoredActions: opts.authoredLoadOnly === true,
153500
- ...opts.evaluator ? { evaluator: opts.evaluator } : {}
154095
+ ...opts.evaluator ? { evaluator: opts.evaluator } : {},
154096
+ ...opts.webview ? { webview: opts.webview } : {}
153501
154097
  });
153502
154098
  let deadLifecycle;
153503
154099
  if (appear) {
@@ -153592,6 +154188,40 @@ async function crawlScreenCapabilitySuccess(opts) {
153592
154188
  };
153593
154189
  });
153594
154190
  }
154191
+ async function crawlScreenWebView(opts) {
154192
+ if (!opts.bundleJs) return null;
154193
+ let realm;
154194
+ try {
154195
+ realm = resolveActionEvaluator(opts.evaluator);
154196
+ } catch {
154197
+ return null;
154198
+ }
154199
+ if (realm.runWithActions) return null;
154200
+ const bundleJs = opts.bundleJs;
154201
+ return withSwallowedRejections(() => crawlWebViewBridge({
154202
+ screenId: opts.screenId,
154203
+ descriptor: opts.descriptor,
154204
+ ...opts.webviewPages ? { pages: opts.webviewPages } : {},
154205
+ ...opts.budgetMs ? { budgetMs: opts.budgetMs } : {},
154206
+ boot: (webview) => {
154207
+ const { call: wixCall } = layeredTransport({ rules: opts.rules, cmsSeed: opts.cmsSeed, canned: opts.canned });
154208
+ return bootScreenWorker({
154209
+ bundleJs,
154210
+ descriptor: opts.descriptor,
154211
+ wixCall,
154212
+ screenId: opts.screenId,
154213
+ inputOverride: opts.inputOverride,
154214
+ budgetMs: opts.budgetMs,
154215
+ clock: opts.clock,
154216
+ seed: opts.seed,
154217
+ localDbSchema: opts.localDbSchema,
154218
+ l10n: opts.l10n,
154219
+ base44Data: opts.base44Data,
154220
+ webview
154221
+ });
154222
+ }
154223
+ }));
154224
+ }
153595
154225
  async function crawlScreen(opts) {
153596
154226
  return withSwallowedRejections(async () => {
153597
154227
  const result = await crawlScreenInner(opts);
@@ -155134,6 +155764,7 @@ var init_screen_crawl = __esm({
155134
155764
  init_bindings();
155135
155765
  init_capability_fixtures();
155136
155766
  init_base44_crawl_data();
155767
+ init_webview_bridge_crawl();
155137
155768
  init_query();
155138
155769
  init_crawl_input();
155139
155770
  init_crawl_relations();
@@ -155940,7 +156571,7 @@ function gitSha() {
155940
156571
  return "dev";
155941
156572
  }
155942
156573
  }
155943
- function logicBundleOf(descriptor) {
156574
+ function logicBundleOf2(descriptor) {
155944
156575
  return descriptor?.logicBundle ?? descriptor?.logic_bundle ?? null;
155945
156576
  }
155946
156577
  function collectComponentTypes(value2, into = /* @__PURE__ */ new Set()) {
@@ -156280,7 +156911,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
156280
156911
  const pinnedLanguage = pinnedLanguageSwap(config.locale, preloaded.dir);
156281
156912
  const workerSources = /* @__PURE__ */ new Map();
156282
156913
  const workerSourceOf = (descriptor) => {
156283
- const url = logicBundleOf(descriptor)?.url;
156914
+ const url = logicBundleOf2(descriptor)?.url;
156284
156915
  const name = typeof url === "string" ? bundleNameFromUrl(url) : null;
156285
156916
  if (!name) return void 0;
156286
156917
  if (!workerSources.has(name)) {
@@ -156749,7 +157380,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
156749
157380
  assertComponentMinVersions(screenId, descriptor);
156750
157381
  collectNativeComponents(descriptor, requiredNativeComponents);
156751
157382
  let bundleName = null;
156752
- const lb = logicBundleOf(descriptor);
157383
+ const lb = logicBundleOf2(descriptor);
156753
157384
  if (lb) {
156754
157385
  bundleName = bundleNameFromUrl(lb.url);
156755
157386
  if (bundleName) {
@@ -156834,7 +157465,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
156834
157465
  const descriptor = await res.json();
156835
157466
  bakePinnedLanguage?.(descriptor);
156836
157467
  delete descriptor.etag;
156837
- const lb = logicBundleOf(descriptor);
157468
+ const lb = logicBundleOf2(descriptor);
156838
157469
  const bundleName = lb ? bundleNameFromUrl(lb.url) : null;
156839
157470
  if (collect2?.lint) {
156840
157471
  const bundleJs = bundleName ? readBundle(bundleName) : void 0;
@@ -156875,7 +157506,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
156875
157506
  continue;
156876
157507
  }
156877
157508
  const descriptor = await res.json();
156878
- const lb = logicBundleOf(descriptor);
157509
+ const lb = logicBundleOf2(descriptor);
156879
157510
  const bundleName = lb ? bundleNameFromUrl(lb.url) : null;
156880
157511
  if (bundleName && !bundles[bundleName]) await addressBundle(bundleName);
156881
157512
  const declared = lb?.declaredCapabilities ?? lb?.declared_capabilities;
@@ -156945,7 +157576,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
156945
157576
  assertComponentMinVersions(screenId, descriptor);
156946
157577
  collectNativeComponents(descriptor, requiredNativeComponents);
156947
157578
  let bundleName = null;
156948
- const lb = logicBundleOf(descriptor);
157579
+ const lb = logicBundleOf2(descriptor);
156949
157580
  if (lb) {
156950
157581
  bundleName = bundleNameFromUrl(lb.url);
156951
157582
  if (bundleName) {
@@ -159420,6 +160051,7 @@ async function loadAuthoring() {
159420
160051
  crawlScreenHostile: crawl.crawlScreenHostile,
159421
160052
  crawlScreenRelations: crawl.crawlScreenRelations,
159422
160053
  crawlScreenCapabilitySuccess: crawl.crawlScreenCapabilitySuccess,
160054
+ crawlScreenWebView: crawl.crawlScreenWebView,
159423
160055
  findingKey: crawl.findingKey,
159424
160056
  startWorkerCoverage: cov.startWorkerCoverage,
159425
160057
  uncoveredFunctions: cov.uncoveredFunctions,
@@ -170255,7 +170887,7 @@ __export(template_evaluate_exports, {
170255
170887
  evaluatedView: () => evaluatedView,
170256
170888
  templatedLabel: () => templatedLabel
170257
170889
  });
170258
- async function settle(work, what) {
170890
+ async function settle2(work, what) {
170259
170891
  let timer;
170260
170892
  try {
170261
170893
  return await Promise.race([
@@ -170309,18 +170941,18 @@ async function buildTemplated(t2, ctx) {
170309
170941
  const placeholder3 = Array.from({ length: Math.max(1, captureCount(t2.pattern)) }, () => ID_PLACEHOLDER);
170310
170942
  let error;
170311
170943
  try {
170312
- const built = await settle(() => t2.build(ctx, placeholder3), `the templated route ${t2.display}`);
170944
+ const built = await settle2(() => t2.build(ctx, placeholder3), `the templated route ${t2.display}`);
170313
170945
  if (built) return { built };
170314
170946
  } catch (e2) {
170315
170947
  error = message(e2);
170316
170948
  }
170317
170949
  if (typeof t2.seedIds === "function") {
170318
170950
  try {
170319
- const ids2 = await settle(() => t2.seedIds(ctx), `seedIds of ${t2.display}`);
170951
+ const ids2 = await settle2(() => t2.seedIds(ctx), `seedIds of ${t2.display}`);
170320
170952
  for (const id of Array.isArray(ids2) ? ids2.slice(0, 20) : []) {
170321
170953
  const m2 = typeof id === "string" ? t2.pattern.exec(id) : null;
170322
170954
  if (!m2) continue;
170323
- const built = await settle(() => t2.build(ctx, m2.slice(1)), `the templated route ${t2.display}`);
170955
+ const built = await settle2(() => t2.build(ctx, m2.slice(1)), `the templated route ${t2.display}`);
170324
170956
  if (built) return { built };
170325
170957
  }
170326
170958
  } catch (e2) {
@@ -170343,7 +170975,7 @@ async function evaluatedView(dir) {
170343
170975
  const routes = [];
170344
170976
  for (const [id, build3] of Object.entries(m2.screens?.exact ?? {})) {
170345
170977
  try {
170346
- const built = await settle(() => build3(ctx), `the screen ${id}`);
170978
+ const built = await settle2(() => build3(ctx), `the screen ${id}`);
170347
170979
  routes.push(built ? row(id, "screen", built) : row(id, "screen", void 0, "the builder returned no descriptor"));
170348
170980
  } catch (e2) {
170349
170981
  routes.push(row(id, "screen", void 0, message(e2)));
@@ -190800,6 +191432,8 @@ async function runCrawl(opts) {
190800
191432
  const bundleOf = new Map(descriptors.map((d2) => [d2.screenId, d2]));
190801
191433
  const hostileFindings = [];
190802
191434
  const relationFindings = [];
191435
+ const webviewFindings = [];
191436
+ const webviewScreens = [];
190803
191437
  let relationsChecked = 0;
190804
191438
  let capabilityModelled = 0;
190805
191439
  const capabilityCoverageByScreen = [];
@@ -190932,6 +191566,14 @@ async function runCrawl(opts) {
190932
191566
  }
190933
191567
  }
190934
191568
  }
191569
+ if (deps.crawlScreenWebView && baked.bundleJs) {
191570
+ const wr2 = await deps.crawlScreenWebView({ ...args, ...opts.webviewPages ? { webviewPages: opts.webviewPages } : {} });
191571
+ if (wr2) {
191572
+ const { findings: wf2, ...row2 } = wr2;
191573
+ webviewFindings.push(...wf2);
191574
+ webviewScreens.push(row2);
191575
+ }
191576
+ }
190935
191577
  await finishScreenCoverage();
190936
191578
  }
190937
191579
  const keep = (f2) => {
@@ -191044,7 +191686,7 @@ async function runCrawl(opts) {
191044
191686
  message: issue3.message,
191045
191687
  hint: "Fix the value in the tokens file; `himi validate` reports the same finding."
191046
191688
  }));
191047
- const all = [...results.flatMap((r3) => r3.findings), ...hostileFindings, ...deepFindings, ...journeyFindings, ...edgeFindings, ...relationFindings, ...writeFindings, ...tokenFindings].filter((f2) => {
191689
+ const all = [...results.flatMap((r3) => r3.findings), ...hostileFindings, ...deepFindings, ...journeyFindings, ...edgeFindings, ...relationFindings, ...webviewFindings, ...writeFindings, ...tokenFindings].filter((f2) => {
191048
191690
  if (f2.invariant === "no-request-issued" && !f2.axis && fetchProven.has(f2.screen)) {
191049
191691
  const by = fetchProven.get(f2.screen);
191050
191692
  if (!retired.some((x2) => x2.screen === f2.screen)) retired.push({ screen: f2.screen, from: by.from, params: by.params });
@@ -191088,6 +191730,7 @@ async function runCrawl(opts) {
191088
191730
  failures,
191089
191731
  warnings,
191090
191732
  unverifiable: results.flatMap((r3) => r3.unverifiable),
191733
+ ...webviewScreens.length ? { webview: webviewScreens } : {},
191091
191734
  ...suppressed.length ? { suppressed } : {},
191092
191735
  ...unknownScreens.length ? { unknownScreens } : {},
191093
191736
  ...notCrawled.length ? { notCrawled } : {},
@@ -191196,12 +191839,40 @@ function formatReport(r3) {
191196
191839
  out2.push(" not verifiable headless (verify on the pushed preview or a sim):");
191197
191840
  for (const [screen, nodes2] of [...unverifiableByScreen].sort(([a3], [b3]) => a3.localeCompare(b3))) {
191198
191841
  for (const n2 of nodes2) {
191199
- const why = n2.why === "native-only" ? "native-only \u2014 does not paint in a web render, but DOES render on device" : "renders blank on device when bound (known renderer gap)";
191842
+ const bridged = n2.type === "WebView" && r3.webview?.some((w2) => w2.screen === screen);
191843
+ const why = n2.why === "native-only" ? bridged ? r3.webview?.some((w2) => w2.screen === screen && w2.loaded?.length) ? "native-only \u2014 pixels not judged; the page WAS loaded in a browser against its worker (see WebView bridge)" : "native-only \u2014 the page was not loaded; its worker channel WAS played (see WebView bridge)" : "native-only \u2014 does not paint in a web render, but DOES render on device" : "renders blank on device when bound (known renderer gap)";
191200
191844
  out2.push(` ${screen} ${n2.node} ${why}`);
191201
191845
  }
191202
191846
  }
191203
191847
  out2.push("");
191204
191848
  }
191849
+ if (r3.webview?.length) {
191850
+ out2.push(" WebView bridge \u2014 the crawl played each bridged page's side of the worker channel:");
191851
+ for (const w2 of [...r3.webview].sort((a3, b3) => a3.screen.localeCompare(b3.screen))) {
191852
+ const pages2 = w2.pages.map((p2) => p2.node === "(screen)" ? "the screen's page" : p2.node).join(", ");
191853
+ if (!w2.pages.length) {
191854
+ out2.push(` ${w2.screen} ${w2.templatePages} bridged WebView(s) in item templates \u2014 not played (one channel per row, keyed by row data)`);
191855
+ continue;
191856
+ }
191857
+ if (!w2.listening) {
191858
+ out2.push(` ${w2.screen} ${pages2}: the worker never listens on the page channel`);
191859
+ continue;
191860
+ }
191861
+ const surface = Object.entries(w2.manifest ?? {}).map(([ns2, ms2]) => `${ns2}.{${ms2.join(",")}}`).join(" ") || "(raw onPageMessage only)";
191862
+ const byOutcome = /* @__PURE__ */ new Map();
191863
+ for (const c2 of w2.calls) byOutcome.set(c2.outcome, (byOutcome.get(c2.outcome) ?? 0) + 1);
191864
+ const answered3 = [...byOutcome].map(([o2, n2]) => `${n2} ${o2}`).join(", ") || "no calls";
191865
+ out2.push(` ${w2.screen} ${pages2}: ${surface}`);
191866
+ out2.push(` ${w2.calls.length} method(s) called as the page \u2014 ${answered3}; ${w2.probes.sent} hostile message(s), ${w2.probes.threw} threw${w2.events.length ? `; events seen: ${w2.events.join(", ")}` : ""}`);
191867
+ if (w2.templatePages) out2.push(` ${w2.templatePages} bridged WebView(s) in item templates not played (one channel per row)`);
191868
+ for (const l3 of w2.loaded ?? []) {
191869
+ const calls = l3.calls.map((c2) => `${c2.capability}.${c2.method}\u2192${c2.outcome}${c2.code ? `(${c2.code})` : ""}`).join(", ") || "no calls";
191870
+ out2.push(` page ${l3.node === "(screen)" ? "(screen)" : l3.node} loaded (${l3.source}): ${calls}; ${l3.pageErrors.length} uncaught error(s), ${l3.consoleErrors} console error(s), ${l3.links.total} link(s)${l3.links.offAllowlist ? ` (${l3.links.offAllowlist} off the allowlist)` : ""}${l3.blockedRequests ? `; ${l3.blockedRequests} network request(s) refused (hermetic; --webview-live allows them)` : ""}`);
191871
+ }
191872
+ for (const n2 of w2.notLoaded ?? []) out2.push(` page ${n2.node} not loaded: ${n2.why}`);
191873
+ }
191874
+ out2.push("");
191875
+ }
191205
191876
  if (r3.writes?.length || r3.unreachedWrites?.length) {
191206
191877
  out2.push(` Writes to Wix (${r3.writes.length}) \u2014 every write the crawl saw a worker attempt (none reached Wix). A write behind a form or a selection shows only under --deep or a journey:`);
191207
191878
  const byScreenW = /* @__PURE__ */ new Map();
@@ -229208,9 +229879,9 @@ async function startConnectServer(opts) {
229208
229879
  const token = randomBytes17(16).toString("hex");
229209
229880
  const prefix = `/c/${token}`;
229210
229881
  const startedAt = now();
229211
- let settle2;
229882
+ let settle3;
229212
229883
  const done = new Promise((resolve130) => {
229213
- settle2 = resolve130;
229884
+ settle3 = resolve130;
229214
229885
  });
229215
229886
  let closed;
229216
229887
  let hostHeader = "";
@@ -229250,7 +229921,7 @@ async function startConnectServer(opts) {
229250
229921
  }
229251
229922
  if (closing || !busy2 && now() - startedAt > ttlMs) {
229252
229923
  await send2(res, 410, "This page has expired.", false);
229253
- settle2("expired");
229924
+ settle3("expired");
229254
229925
  void close();
229255
229926
  return;
229256
229927
  }
@@ -229285,7 +229956,7 @@ async function startConnectServer(opts) {
229285
229956
  consumed = true;
229286
229957
  await send2(res, out2.status, out2.html);
229287
229958
  if (out2.done) {
229288
- settle2("done");
229959
+ settle3("done");
229289
229960
  void close();
229290
229961
  }
229291
229962
  } catch (err) {
@@ -229303,7 +229974,7 @@ async function startConnectServer(opts) {
229303
229974
  if (holding) {
229304
229975
  busy2 = false;
229305
229976
  if (expireWhenIdle && !consumed) {
229306
- settle2("expired");
229977
+ settle3("expired");
229307
229978
  void close();
229308
229979
  }
229309
229980
  }
@@ -229329,12 +230000,12 @@ async function startConnectServer(opts) {
229329
230000
  if (busy2) {
229330
230001
  expireWhenIdle = true;
229331
230002
  grace = setTimeout(() => {
229332
- settle2(consumed ? "done" : "expired");
230003
+ settle3(consumed ? "done" : "expired");
229333
230004
  void close();
229334
230005
  }, graceMs);
229335
230006
  grace.unref();
229336
230007
  } else {
229337
- settle2("expired");
230008
+ settle3("expired");
229338
230009
  void close();
229339
230010
  }
229340
230011
  }, ttlMs);
@@ -229345,7 +230016,7 @@ async function startConnectServer(opts) {
229345
230016
  clearTimeout(timer);
229346
230017
  if (grace)
229347
230018
  clearTimeout(grace);
229348
- settle2("expired");
230019
+ settle3("expired");
229349
230020
  server.close(() => resolve130());
229350
230021
  server.closeAllConnections();
229351
230022
  });
@@ -229528,7 +230199,7 @@ async function runConnectFlow(opts) {
229528
230199
  return { ...show2(), done: true };
229529
230200
  };
229530
230201
  const fail16 = (reason) => finish3({ status: "failed", reason, ...refusal2 ? { signinRefusal: refusal2 } : {} });
229531
- async function settle2(attempt2) {
230202
+ async function settle3(attempt2) {
229532
230203
  await attempt2.next();
229533
230204
  if (over) {
229534
230205
  attempt2.cancel();
@@ -229580,7 +230251,7 @@ async function runConnectFlow(opts) {
229580
230251
  log(`Signing in ${appleId}`);
229581
230252
  const attempt2 = begin({ appleId, password, sms, phoneId, previous, base: base2 });
229582
230253
  password = "";
229583
- return settle2(attempt2);
230254
+ return settle3(attempt2);
229584
230255
  }
229585
230256
  async function onCode(st2, form) {
229586
230257
  if (form.get("method") === "sms") {
@@ -229592,7 +230263,7 @@ async function runConnectFlow(opts) {
229592
230263
  await attempt2.next();
229593
230264
  const next = begin({ appleId: attempt2.appleId, password, sms: true, previous: attempt2.previous, base: base2 });
229594
230265
  password = "";
229595
- return settle2(next);
230266
+ return settle3(next);
229596
230267
  }
229597
230268
  const code2 = (form.get("code") ?? "").replace(/\s+/g, "");
229598
230269
  form.delete("code");
@@ -229601,7 +230272,7 @@ async function runConnectFlow(opts) {
229601
230272
  return show2();
229602
230273
  }
229603
230274
  st2.attempt.answer(code2);
229604
- return settle2(st2.attempt);
230275
+ return settle3(st2.attempt);
229605
230276
  }
229606
230277
  async function signedIn(session) {
229607
230278
  if (over)
@@ -232857,7 +233528,7 @@ async function recordAccepted(inv) {
232857
233528
  await store.markAccepted(hash3, `the published agreement; the portal shows ${accepted.id} accepted on ${accepted.accepted}`);
232858
233529
  return { hash: hash3 };
232859
233530
  }
232860
- var createHash68, mkdir19, readFile20, writeFile15, join131, PROBES, SLUG, AgreementCache, cache3, webClient, AGREEMENT_COMMANDS;
233531
+ var createHash68, mkdir19, readFile20, writeFile15, join131, PROBES2, SLUG, AgreementCache, cache3, webClient, AGREEMENT_COMMANDS;
232861
233532
  var init_commands_agreements = __esm({
232862
233533
  "../../node_modules/@wix/asc/dist/commands-agreements.js"() {
232863
233534
  init_define_HHP_CATALOG();
@@ -232868,7 +233539,7 @@ var init_commands_agreements = __esm({
232868
233539
  ({ createHash: createHash68 } = __ascBuiltin068);
232869
233540
  ({ mkdir: mkdir19, readFile: readFile20, writeFile: writeFile15 } = __ascBuiltin144);
232870
233541
  ({ join: join131 } = __ascBuiltin223);
232871
- PROBES = [
233542
+ PROBES2 = [
232872
233543
  { capability: "apps, versions, metadata, builds, TestFlight, submissions", path: "/v1/apps", query: { limit: "1" } },
232873
233544
  { capability: "certificates, provisioning profiles, bundle IDs, devices", path: "/v1/certificates", query: { limit: "1" } },
232874
233545
  { capability: "in-app purchases, subscriptions, pricing", path: (id) => `/v1/apps/${id}/inAppPurchasesV2`, query: { limit: "1" }, needsApp: true }
@@ -232927,7 +233598,7 @@ var init_commands_agreements = __esm({
232927
233598
  let appId3;
232928
233599
  const rows = [];
232929
233600
  const blocking = /* @__PURE__ */ new Map();
232930
- for (const probe2 of PROBES) {
233601
+ for (const probe2 of PROBES2) {
232931
233602
  if (probe2.needsApp) {
232932
233603
  appId3 ??= inv.opts.app ? (await api4.apps.find(String(inv.opts.app))).id : void 0;
232933
233604
  if (!appId3) {
@@ -234433,8 +235104,8 @@ import * as __ascBuiltin146 from "node:http";
234433
235104
  async function startCallback(timeoutMs) {
234434
235105
  const path2 = `/callback/${b64url3(randomBytes18(16))}`;
234435
235106
  let expected;
234436
- let settle2;
234437
- const result = new Promise((resolve130, reject) => settle2 = { resolve: resolve130, reject });
235107
+ let settle3;
235108
+ const result = new Promise((resolve130, reject) => settle3 = { resolve: resolve130, reject });
234438
235109
  result.catch(() => {
234439
235110
  });
234440
235111
  const page = (status2, text32) => ({ status: status2, body: `<!doctype html><meta charset="utf-8"><title>asc-node</title><p>${text32}</p>` });
@@ -234456,14 +235127,14 @@ async function startCallback(timeoutMs) {
234456
235127
  const code2 = url.searchParams.get("code");
234457
235128
  if (error || !code2) {
234458
235129
  send2(page(400, "Sign-in did not finish. You can close this tab."));
234459
- return settle2.reject(new AscError("auth", `sign-in was not completed (${error ?? "no code"})`));
235130
+ return settle3.reject(new AscError("auth", `sign-in was not completed (${error ?? "no code"})`));
234460
235131
  }
234461
235132
  send2(page(200, "Signed in. You can close this tab and go back to the terminal."));
234462
- settle2.resolve(code2);
235133
+ settle3.resolve(code2);
234463
235134
  });
234464
235135
  await new Promise((resolve130) => server.listen(0, "127.0.0.1", resolve130));
234465
235136
  const port = server.address().port;
234466
- const timer = setTimeout(() => settle2.reject(new AscError("auth", `sign-in to the worker's gateway was not finished within ${Math.round(timeoutMs / 1e3)}s`)), timeoutMs);
235137
+ const timer = setTimeout(() => settle3.reject(new AscError("auth", `sign-in to the worker's gateway was not finished within ${Math.round(timeoutMs / 1e3)}s`)), timeoutMs);
234467
235138
  timer.unref?.();
234468
235139
  return {
234469
235140
  redirect: `http://127.0.0.1:${port}${path2}`,
@@ -244683,10 +245354,10 @@ function deriveRequirements(evidenceDir) {
244683
245354
  }
244684
245355
  }
244685
245356
  for (const page of screen.pages) {
244686
- const pageSource = `${screen.pointer}/layout/items/${page.arrayIndex}`;
244687
- add("route", pageSource, `Page ${page.title ?? page.layoutItemId}${obj7(page.settings).hideFromNavigation === true ? " (hidden)" : ""}`, void 0, page.layoutItemId);
244688
- access3(`${pageSource}/permissions`, page.permissions);
244689
- access3(`${pageSource}/settings`, visibilitySettings(page.settings));
245357
+ const pageSource2 = `${screen.pointer}/layout/items/${page.arrayIndex}`;
245358
+ add("route", pageSource2, `Page ${page.title ?? page.layoutItemId}${obj7(page.settings).hideFromNavigation === true ? " (hidden)" : ""}`, void 0, page.layoutItemId);
245359
+ access3(`${pageSource2}/permissions`, page.permissions);
245360
+ access3(`${pageSource2}/settings`, visibilitySettings(page.settings));
244690
245361
  for (const item2 of page.placements) placement(item2);
244691
245362
  }
244692
245363
  const topBarButton = (button, pointer3, platform) => {
@@ -246237,6 +246908,139 @@ var init_coverage2 = __esm({
246237
246908
  }
246238
246909
  });
246239
246910
 
246911
+ // ../../core/sdk/webview-page/src/page-client.generated.ts
246912
+ var PAGE_CLIENT_SOURCE;
246913
+ var init_page_client_generated = __esm({
246914
+ "../../core/sdk/webview-page/src/page-client.generated.ts"() {
246915
+ init_define_HHP_CATALOG();
246916
+ PAGE_CLIENT_SOURCE = '(function () {\nvar __himalayaPageClientModule = (() => {\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === "object" || typeof from === "function") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\n\n // src/client.ts\n var client_exports = {};\n __export(client_exports, {\n createPageClient: () => createPageClient\n });\n var TIMEOUT_PREFIX = "Himalaya capability call timed out";\n function pageError(error) {\n const out = new Error(error?.message ?? "Himalaya capability call failed");\n if (error?.code) Object.assign(out, { code: error.code });\n return out;\n }\n function createPageClient(getBridge) {\n const pending = /* @__PURE__ */ new Map();\n const abandoned = /* @__PURE__ */ new Set();\n const streams = /* @__PURE__ */ new Map();\n const listeners = /* @__PURE__ */ new Map();\n let installedOn;\n let nextId = 1;\n const clientTag = Math.random().toString(36).slice(2, 10) || "0";\n function workerBridge() {\n const bridge = getBridge();\n if (!bridge || typeof bridge.post !== "function" || typeof bridge.onMessage !== "function") {\n throw new Error(\n "@himalaya/webview-page: this page is not inside a worker-backed Himalaya WebView."\n );\n }\n if (installedOn !== bridge) {\n bridge.onMessage(receive);\n installedOn = bridge;\n }\n return bridge;\n }\n function receive(message) {\n if (!message || typeof message !== "object" || message.v !== 1) return;\n const m = message;\n if (typeof m.id === "string" && typeof m.ok === "boolean") return respond(m);\n if (typeof m.ev === "string" && typeof m.ns === "string") return emit(m);\n if (typeof m.sid === "string") return feed(m);\n }\n function respond(message) {\n const call2 = pending.get(message.id);\n if (!call2) {\n if (abandoned.delete(message.id) && message.ok && message.stream === true) cancelStream(message.id);\n return;\n }\n pending.delete(message.id);\n clearTimeout(call2.timeout);\n if (!message.ok) return call2.reject(pageError(message.error));\n if (message.stream === true) return call2.resolve(openStream(message.id));\n call2.resolve(message.result);\n }\n function emit(event) {\n const handlers = listeners.get(event.ns)?.get(event.ev);\n if (!handlers) return;\n for (const handler of [...handlers]) {\n try {\n handler(event.data);\n } catch {\n }\n }\n }\n function feed(envelope) {\n const state = streams.get(envelope.sid);\n if (!state) return;\n if (!("chunk" in envelope) && !("end" in envelope && envelope.end === true) && !("error" in envelope && envelope.error)) return;\n if ("chunk" in envelope) {\n const waiter = state.waiters.shift();\n if (waiter) waiter.resolve({ value: envelope.chunk, done: false });\n else state.queue.push(envelope.chunk);\n return;\n }\n streams.delete(envelope.sid);\n if ("error" in envelope && envelope.error) {\n state.error = pageError(envelope.error);\n if (state.waiters.length > 0) {\n for (const waiter of state.waiters.splice(0)) waiter.reject(state.error);\n state.error = void 0;\n state.done = true;\n }\n } else if ("end" in envelope && envelope.end === true) {\n state.done = true;\n for (const waiter of state.waiters.splice(0)) waiter.resolve({ value: void 0, done: true });\n }\n }\n function cancelStream(sid) {\n try {\n installedOn?.post({ v: 1, sys: "cancel", sid });\n } catch {\n }\n }\n function openStream(sid) {\n const state = { queue: [], waiters: [], done: false, error: void 0 };\n streams.set(sid, state);\n const iterator = {\n next() {\n if (state.queue.length > 0) return Promise.resolve({ value: state.queue.shift(), done: false });\n if (state.error) {\n const error = state.error;\n state.error = void 0;\n state.done = true;\n return Promise.reject(error);\n }\n if (state.done) return Promise.resolve({ value: void 0, done: true });\n return new Promise((resolve, reject) => state.waiters.push({ resolve, reject }));\n },\n return() {\n if (streams.get(sid) === state) {\n streams.delete(sid);\n cancelStream(sid);\n }\n state.done = true;\n state.queue.length = 0;\n for (const waiter of state.waiters.splice(0)) waiter.resolve({ value: void 0, done: true });\n return Promise.resolve({ value: void 0, done: true });\n }\n };\n return { [Symbol.asyncIterator]: () => iterator };\n }\n function call(capability, method, args = [], timeoutMs = 3e4) {\n const bridge = workerBridge();\n const id = `page-${Date.now().toString(36)}-${clientTag}-${nextId++}`;\n const request = { v: 1, id, capability, method, args };\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n pending.delete(id);\n abandoned.add(id);\n if (abandoned.size > 256) abandoned.delete(abandoned.values().next().value);\n reject(new Error(`${TIMEOUT_PREFIX}: ${capability}.${method}`));\n }, timeoutMs);\n pending.set(id, { resolve, reject, timeout });\n if (!bridge.post(request)) {\n clearTimeout(timeout);\n pending.delete(id);\n reject(new Error("@himalaya/webview-page: the native page-to-worker bridge refused the request."));\n }\n });\n }\n function on(namespace2, event, handler) {\n workerBridge();\n if (typeof handler !== "function") throw new Error("@himalaya/webview-page: on() needs a handler function");\n let byEvent = listeners.get(namespace2);\n if (!byEvent) listeners.set(namespace2, byEvent = /* @__PURE__ */ new Map());\n let handlers = byEvent.get(event);\n if (!handlers) byEvent.set(event, handlers = /* @__PURE__ */ new Set());\n const entry = (data) => handler(data);\n handlers.add(entry);\n return () => {\n handlers.delete(entry);\n };\n }\n let manifest;\n function currentBridge() {\n try {\n return workerBridge();\n } catch {\n return void 0;\n }\n }\n function timedOut(error) {\n return error instanceof Error && error.message.startsWith(TIMEOUT_PREFIX);\n }\n let asking;\n function askShared(target, budget) {\n const until = Date.now() + budget;\n if (asking?.on === target) {\n asking.until = Math.max(asking.until, until);\n return asking.answer;\n }\n const state = { on: target, until, answer: Promise.resolve(null) };\n asking = state;\n state.answer = new Promise((resolve) => {\n let done = false;\n const finish = (list) => {\n if (done) return;\n done = true;\n clearInterval(again);\n if (asking === state) asking = void 0;\n if (list) manifest = { on: target, list };\n resolve(list);\n };\n const ask = () => {\n if (done) return;\n const left = state.until - Date.now();\n if (left <= 0 || currentBridge() !== target) return finish(null);\n call("himalaya", "capabilities", [], Math.max(1, Math.min(2e3, left))).then(\n (reply) => finish(reply?.capabilities ?? null),\n // A timed-out question is not an answer; the deadline decides. Anything else is final.\n (error) => {\n if (!timedOut(error)) finish(null);\n }\n );\n };\n const again = setInterval(ask, 500);\n ask();\n });\n return state.answer;\n }\n async function enabledCapabilities(timeoutMs = 3e3) {\n const bridge = currentBridge();\n if (!bridge) return null;\n if (manifest?.on === bridge) return manifest.list;\n if (!(timeoutMs > 0)) return null;\n const budget = Math.min(timeoutMs, 2147483647);\n const answer = askShared(bridge, budget);\n return new Promise((resolve) => {\n const stop = setTimeout(() => resolve(manifest?.on === bridge ? manifest.list : null), budget);\n void answer.then((list) => {\n clearTimeout(stop);\n resolve(list);\n });\n });\n }\n async function isEnabled(capability, method, timeoutMs = 3e3) {\n const enabled = await enabledCapabilities(timeoutMs);\n return enabled?.[capability]?.includes(method) ?? false;\n }\n async function probe(capability, method, args = [], timeoutMs = 3e3) {\n if (!currentBridge()) return false;\n try {\n const result = await call(capability, method, args, timeoutMs);\n const iterate = result?.[Symbol.asyncIterator];\n if (typeof iterate === "function") void iterate.call(result).return?.();\n return true;\n } catch (error) {\n if (error.code === "unknown_method") return false;\n return !(timedOut(error) || /refused the request/.test(error.message));\n }\n }\n const members = /* @__PURE__ */ new Map();\n function pageMember(capability, path) {\n const key = `${capability}:${path.join(".")}`;\n let member = members.get(key);\n if (member) return member;\n const label = `[himalaya.${[capability, ...path].join(".")}]`;\n member = new Proxy((() => {\n }), {\n get(_target, property) {\n if (typeof property !== "string" || property === "then") return void 0;\n if (property === "toString" || property === "valueOf") return () => label;\n if (path.length === 0 && property === "on") {\n return (event, handler) => on(capability, event, handler);\n }\n return pageMember(capability, [...path, property]);\n },\n apply(_target, _thisArg, args) {\n if (path.length === 0) throw new Error(`Himalaya capability namespace is not callable: ${capability}`);\n return call(capability, path.join("."), args);\n }\n });\n members.set(key, member);\n return member;\n }\n const namespace = (capability) => pageMember(capability, []);\n const SITE_FIELDS = ["title", "route", "cart", "member"];\n const site = Object.freeze({\n report(fields) {\n const bridge = currentBridge();\n if (!bridge || !fields || typeof fields !== "object") return false;\n const data = {};\n for (const name of SITE_FIELDS) {\n if (Object.prototype.hasOwnProperty.call(fields, name)) data[name] = fields[name];\n }\n if (Object.keys(data).length === 0) return false;\n try {\n return bridge.post({ v: 1, sys: "site", ev: "report", data }) === true;\n } catch {\n return false;\n }\n }\n });\n function merge(target) {\n const own = { call, on, enabledCapabilities, isEnabled, probe, site, version: 1 };\n for (const name of Object.keys(own)) {\n if (!Object.prototype.hasOwnProperty.call(target, name)) {\n Object.defineProperty(target, name, { value: own[name], enumerable: true, writable: false, configurable: false });\n }\n }\n Object.freeze(target);\n return new Proxy(target, {\n get(t, property, receiver) {\n if (typeof property !== "string" || property in t) return Reflect.get(t, property, receiver);\n if (property === "then") return void 0;\n return namespace(property);\n }\n });\n }\n return { call, on, enabledCapabilities, isEnabled, probe, namespace, site, merge };\n }\n return __toCommonJS(client_exports);\n})();\nreturn __himalayaPageClientModule.createPageClient;\n})()';
246917
+ }
246918
+ });
246919
+
246920
+ // ../../core/dev-server/src/webview-page-driver.ts
246921
+ var webview_page_driver_exports = {};
246922
+ __export(webview_page_driver_exports, {
246923
+ INLINE_PAGE_ORIGIN: () => INLINE_PAGE_ORIGIN,
246924
+ createWebViewPageDriver: () => createWebViewPageDriver,
246925
+ pageShimSource: () => pageShimSource
246926
+ });
246927
+ function pageShimSource() {
246928
+ return `(function () {
246929
+ var cbs = [];
246930
+ var worker = Object.freeze({
246931
+ onMessage: function (cb) { if (typeof cb === 'function') cbs.push(cb); },
246932
+ post: function (msg) {
246933
+ try { window.${POST_BINDING}(JSON.stringify(msg)); return true; } catch (e) { return false; }
246934
+ },
246935
+ __deliver: function (msg) { cbs.forEach(function (cb) { try { cb(msg); } catch (e) {} }); }
246936
+ });
246937
+ Object.defineProperty(window, 'HimalayaWorker', { value: worker, writable: false, configurable: false, enumerable: true });
246938
+ var createPageClient = ${PAGE_CLIENT_SOURCE};
246939
+ var himalaya = createPageClient(function () { return worker; }).merge({});
246940
+ Object.defineProperty(window, 'himalaya', { value: himalaya, writable: false, configurable: false, enumerable: true });
246941
+ })();`;
246942
+ }
246943
+ async function createWebViewPageDriver() {
246944
+ const launched = await launchPngBrowser();
246945
+ if (!launched) return null;
246946
+ const shim = pageShimSource();
246947
+ return {
246948
+ close: () => launched.close(),
246949
+ async open(spec) {
246950
+ const context = await launched.browser.newContext({ viewport: { width: 390, height: 844 }, serviceWorkers: "block" });
246951
+ const page = await context.newPage();
246952
+ const pageErrors = [];
246953
+ const consoleErrors = [];
246954
+ let loadError;
246955
+ page.on("pageerror", (e2) => pageErrors.push(String(e2?.message ?? e2)));
246956
+ page.on("console", (m2) => {
246957
+ if (m2.type() === "error") consoleErrors.push(m2.text());
246958
+ });
246959
+ await page.exposeBinding(POST_BINDING, (_source, json9) => {
246960
+ if (typeof json9 !== "string") return;
246961
+ let msg;
246962
+ try {
246963
+ msg = JSON.parse(json9);
246964
+ } catch {
246965
+ return;
246966
+ }
246967
+ spec.toWorker(msg);
246968
+ });
246969
+ await page.addInitScript({ content: shim });
246970
+ const target = spec.html !== void 0 ? `${INLINE_PAGE_ORIGIN}/` : spec.url;
246971
+ let blockedRequests = 0;
246972
+ let requests = 0;
246973
+ page.on("request", () => {
246974
+ requests++;
246975
+ });
246976
+ const html = spec.html;
246977
+ await page.route("**/*", (route) => {
246978
+ const url = route.request().url();
246979
+ if (html !== void 0 && url === target) return route.fulfill({ status: 200, contentType: "text/html; charset=utf-8", body: html });
246980
+ if (url.startsWith(`${INLINE_PAGE_ORIGIN}/`)) return route.fulfill({ status: 404, body: "" });
246981
+ if (spec.network || url.startsWith("data:") || url.startsWith("blob:")) return route.continue();
246982
+ blockedRequests++;
246983
+ return route.abort("blockedbyclient");
246984
+ });
246985
+ try {
246986
+ await page.goto(target, { waitUntil: "load", timeout: Math.max(1e3, spec.budgetMs) });
246987
+ } catch (e2) {
246988
+ loadError = String(e2?.message ?? e2).split("\n")[0];
246989
+ }
246990
+ const started = Date.now();
246991
+ return {
246992
+ async deliver(msg) {
246993
+ await page.evaluate((m2) => {
246994
+ globalThis.HimalayaWorker.__deliver(m2);
246995
+ }, msg);
246996
+ },
246997
+ async settle(bridgeActivity) {
246998
+ const activity = () => bridgeActivity() + requests;
246999
+ let last = activity();
247000
+ let quietSince = Date.now();
247001
+ while (Date.now() - started < spec.budgetMs) {
247002
+ await new Promise((r3) => setTimeout(r3, 100));
247003
+ const now = activity();
247004
+ if (now !== last) {
247005
+ last = now;
247006
+ quietSince = Date.now();
247007
+ continue;
247008
+ }
247009
+ if (Date.now() - quietSince >= 400) break;
247010
+ }
247011
+ },
247012
+ async report() {
247013
+ let links = [];
247014
+ if (!loadError) {
247015
+ try {
247016
+ links = await page.evaluate(() => {
247017
+ const doc = globalThis.document;
247018
+ return Array.from(doc.querySelectorAll("a[href]")).map((a3) => a3.href);
247019
+ });
247020
+ } catch {
247021
+ }
247022
+ }
247023
+ return { ...loadError ? { loadError } : {}, pageErrors, consoleErrors, links, blockedRequests };
247024
+ },
247025
+ async close() {
247026
+ await context.close().catch(() => {
247027
+ });
247028
+ }
247029
+ };
247030
+ }
247031
+ };
247032
+ }
247033
+ var INLINE_PAGE_ORIGIN, POST_BINDING;
247034
+ var init_webview_page_driver = __esm({
247035
+ "../../core/dev-server/src/webview-page-driver.ts"() {
247036
+ init_define_HHP_CATALOG();
247037
+ init_render_descriptor();
247038
+ init_page_client_generated();
247039
+ INLINE_PAGE_ORIGIN = "https://webview.himi-test.invalid";
247040
+ POST_BINDING = "__himiTestWorkerPost";
247041
+ }
247042
+ });
247043
+
246240
247044
  // src/commands/render.ts
246241
247045
  import { readFileSync as readFileSync137 } from "node:fs";
246242
247046
  import { join as join150, resolve as resolve95 } from "node:path";
@@ -269587,6 +270391,45 @@ var init_recipes = __esm({
269587
270391
  }
269588
270392
  });
269589
270393
 
270394
+ // ../../stdlib/flows/screens/src/podcast.ts
270395
+ function publicHttpHost(raw) {
270396
+ if (!raw || raw.length > MAX_URL_LENGTH || CONTROL.test(raw)) return "";
270397
+ const match = /^https?:\/\/([^/?#]*)/i.exec(raw);
270398
+ const authority = match?.[1] ?? "";
270399
+ if (!authority || authority.includes("@")) return "";
270400
+ const parts = /^([a-z0-9.-]+)(?::([0-9]+))?$/i.exec(authority);
270401
+ if (!parts || parts[2] && (Number(parts[2]) < 1 || Number(parts[2]) > 65535)) return "";
270402
+ const host = parts[1].toLowerCase();
270403
+ if (host.split(".").some((label4) => !/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(label4))) return "";
270404
+ if (/\d$/.test(host)) {
270405
+ const octets = host.split(".");
270406
+ if (octets.length !== 4 || octets.some((part5) => !/^(?:0|[1-9][0-9]{0,2})$/.test(part5) || Number(part5) > 255)) return "";
270407
+ }
270408
+ return host;
270409
+ }
270410
+ function isPrivateHost(host) {
270411
+ if (host.startsWith("[")) return true;
270412
+ if (host === "localhost" || /\.(?:localhost|local|internal|lan|home|arpa)$/.test(host) || !host.includes(".")) return true;
270413
+ const ip = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(host);
270414
+ if (!ip) return false;
270415
+ const [a3, b3] = [Number(ip[1]), Number(ip[2])];
270416
+ return a3 === 0 || a3 === 10 || a3 === 127 || a3 === 100 && b3 >= 64 && b3 <= 127 || a3 === 169 && b3 === 254 || a3 === 172 && b3 >= 16 && b3 <= 31 || a3 === 192 && b3 === 168 || a3 >= 224;
270417
+ }
270418
+ function podcastFeedUrl(raw) {
270419
+ const url = typeof raw === "string" ? raw.trim() : "";
270420
+ if (!url) return { ok: false, code: "feed_not_configured" };
270421
+ const host = publicHttpHost(url);
270422
+ return host && !isPrivateHost(host) ? { ok: true, url } : { ok: false, code: "invalid_feed_url" };
270423
+ }
270424
+ var MAX_URL_LENGTH, CONTROL;
270425
+ var init_podcast = __esm({
270426
+ "../../stdlib/flows/screens/src/podcast.ts"() {
270427
+ init_define_HHP_CATALOG();
270428
+ MAX_URL_LENGTH = 2048;
270429
+ CONTROL = /[\u0000- \u007f]/;
270430
+ }
270431
+ });
270432
+
269590
270433
  // src/one-app/tab-ids.ts
269591
270434
  function tabIdFor(tab, taken2) {
269592
270435
  const base2 = (tab.screenId.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "tab").slice(0, 32);
@@ -269602,6 +270445,20 @@ var init_tab_ids = __esm({
269602
270445
  });
269603
270446
 
269604
270447
  // src/one-app/generate.ts
270448
+ function blogCarouselScreenGaps(st2) {
270449
+ const content = obj11(st2.contentSettings), limit = countOf2(content.postsPerCategory), category = str16(content.categoryId).trim();
270450
+ return [
270451
+ ...category && category !== "all" ? [`the source shows only the posts of category ${category}; himi_blog does not open on a given category and shows every post`] : [],
270452
+ ...content.featuredOnly === true ? ["the source shows only featured posts; himi_blog shows every post"] : [],
270453
+ "the source shows its posts as a carousel; himi_blog is the full post list",
270454
+ ...limit !== void 0 ? [`the source shows only ${limit} post(s); himi_blog lists every post`] : []
270455
+ ];
270456
+ }
270457
+ function chosenBlogCategories(st2) {
270458
+ const content = obj11(st2.categoryContentSettings);
270459
+ if (content.showAllCategories === true) return [];
270460
+ return arr(content.categories).flatMap((entry) => obj11(entry).selected === true && str16(obj11(entry)._id) ? [str16(obj11(entry)._id)] : []);
270461
+ }
269605
270462
  function webUrl(value2) {
269606
270463
  try {
269607
270464
  const url = new URL(value2.trim());
@@ -269618,6 +270475,18 @@ function withoutNode(node3, id) {
269618
270475
  };
269619
270476
  return walk5(node3);
269620
270477
  }
270478
+ function withoutTap(node3, id) {
270479
+ const walk5 = (value2) => {
270480
+ if (Array.isArray(value2)) return value2.map(walk5);
270481
+ if (!value2 || typeof value2 !== "object") return value2;
270482
+ const entry = value2;
270483
+ const next = Object.fromEntries(Object.entries(entry).map(([k3, v2]) => [k3, walk5(v2)]));
270484
+ if (entry.id !== id) return next;
270485
+ const { onTap: _onTap, pressFeedback: _pressFeedback, ...modifiers } = obj11(next.modifiers);
270486
+ return { ...next, modifiers };
270487
+ };
270488
+ return walk5(node3);
270489
+ }
269621
270490
  function plansSection(id, s5, index, ctx, options2) {
269622
270491
  if (!ctx.hasScreen("himi_plan")) throw new RecipeError("this scaffold has no himi_plan screen for a plan card to open");
269623
270492
  const svc = ctx.uses("plans", `plans${index}`, { ...options2 });
@@ -269630,6 +270499,10 @@ function plansSection(id, s5, index, ctx, options2) {
269630
270499
  function textAlign(alignment) {
269631
270500
  return alignment === "center" ? "center" : alignment === "right" || alignment === "end" ? "trailing" : "leading";
269632
270501
  }
270502
+ function membersDirectory(id, s5, index, ctx) {
270503
+ const svc = ctx.uses("members", `members${index}`, { showRole: true, showActivity: true, showBadges: true, showFollow: true, letterBands: true });
270504
+ return composed2(id, s5, svc, ctx.recipeNodes("members-list", { svc, id, detailScreen: "himi_member" }));
270505
+ }
269633
270506
  function loadOnAppear(nodes2, svc) {
269634
270507
  const at2 = nodes2.findIndex((n2) => !obj11(n2.modifiers).hiddenPath);
269635
270508
  if (at2 < 0) return false;
@@ -269653,6 +270526,16 @@ function programsLimit(section3, settings) {
269653
270526
  if (authored2 === void 0 || authored2 === null) return PROGRAMS_DEFAULT_LIMIT;
269654
270527
  return void 0;
269655
270528
  }
270529
+ function galleryCards(id, s5, index, ctx, options2) {
270530
+ if (!ctx.hasScreen("himi_gallery")) throw new RecipeError("this scaffold has no himi_gallery screen for a gallery card to open, so the section keeps its title and a See All link.");
270531
+ const svc = ctx.uses("galleries", `galleries${index}`, { ...options2.limit !== void 0 ? { limit: options2.limit } : {}, showName: options2.showName });
270532
+ const children2 = [];
270533
+ const title = str16(s5.title).trim();
270534
+ const viewAll = ctx.hasScreen("himi_galleries") ? node(`${id}.all`, "Button", { title: "View All", style: "secondary", size: "md", fullWidth: true, action: { actionId: "himi.open", params: { screenId: "himi_galleries" } } }, { hiddenPath: `$service:${svc}.noMore` }) : void 0;
270535
+ if (s5.showTitle !== false && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
270536
+ children2.push(ctx.recipe(options2.layout, { svc, id }), ...viewAll ? [viewAll] : [], ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
270537
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
270538
+ }
269656
270539
  function groupsSection(recipe, type2) {
269657
270540
  return (id, s5, st2, index, ctx, sectionId) => {
269658
270541
  if (!ctx.hasScreen("himi_group")) return ctx.unsupported(sectionId, type2, "this scaffold has no himi_group screen for a row to open");
@@ -269709,6 +270592,33 @@ function productsSection(kind) {
269709
270592
  return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
269710
270593
  };
269711
270594
  }
270595
+ function productsSearchSection(id, s5, st2, _index, ctx, sectionId) {
270596
+ const type2 = "stores_products_search_section";
270597
+ if (!ctx.hasScreen("himi_shop")) return ctx.unsupported(sectionId, type2, "this scaffold has no himi_shop screen for the search bar to open");
270598
+ const filters = st2.isFilterVisible === true || st2.isSortVisible === true;
270599
+ const bar = ctx.recipe("products-search-bar", { id, placeholder: str16(st2.placeholder).trim() || "Search products", shopScreen: "himi_shop", shopAll: SHOP_ALL });
270600
+ ctx.linksTemplate("himi_shop");
270601
+ ctx.gap(sectionId, type2, `the source opens its own search screen from the bar${filters ? " and its sort and filter button" : ""}; ${filters ? "both open" : "the bar opens"} the shop on all products, where the search field, filters and sort are the shop's own`);
270602
+ const title = str16(s5.title).trim();
270603
+ return vstack(`${id}.box`, [...s5.showTitle === true && title ? [text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0))] : [], filters ? bar : withoutNode(bar, `${id}.filter`)], 12, inset(16, 16));
270604
+ }
270605
+ function wishlistSection(id, s5, st2, index, ctx, sectionId) {
270606
+ const type2 = "stores_wishlist_section";
270607
+ const hasSaved = ctx.hasScreen("himi_saved_products"), hasShop = ctx.hasScreen("himi_shop");
270608
+ const svc = ctx.uses("savedProducts", `wishlist${index}`, hasSaved ? { limit: WISHLIST_INLINE } : {});
270609
+ const imageMode = st2.imageResizeMode === "contain" ? "fit" : "fill";
270610
+ const button = st2.showEmptyStateButton === true && hasShop;
270611
+ let list5 = ctx.recipe("wishlist-grid", { svc, id, imageMode, emptyButton: str16(st2.buttonText).trim() || "Shop now", shopScreen: "himi_shop", shopAll: SHOP_ALL, seeAllLabel: "See All", seeAllScreen: "himi_saved_products" });
270612
+ if (!hasSaved) list5 = withoutNode(list5, `${id}.more`);
270613
+ if (button) ctx.linksTemplate("himi_shop");
270614
+ else list5 = withoutNode(list5, `${id}.empty.shop`);
270615
+ ctx.gap(sectionId, type2, `the source shows the member's account wishlist, kept on their Wix account and sign-in gated; the section shows the products saved on this device (the shop's heart keeps them), so products saved in the One App are not here${hasSaved ? `, and it shows the first ${WISHLIST_INLINE} with a See All button to the saved-products screen` : ""}`);
270616
+ const children2 = [];
270617
+ const title = str16(s5.title).trim();
270618
+ if (s5.showTitle === true && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
270619
+ children2.push(list5, ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
270620
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
270621
+ }
269712
270622
  function blogOptions(st2) {
269713
270623
  const content = obj11(st2.contentSettings);
269714
270624
  const display = obj11(st2.displayOptions);
@@ -269760,6 +270670,21 @@ function blogSection(id, s5, st2, index, ctx, sectionId, type2) {
269760
270670
  }
269761
270671
  return out2;
269762
270672
  }
270673
+ function blogCarousel(type2, layoutGaps) {
270674
+ return (id, s5, st2, index, ctx, sectionId) => {
270675
+ const { base: base2, limit } = blogOptions(st2);
270676
+ const shown3 = Math.min(limit ?? BLOG_HERO_MAX, BLOG_HERO_MAX);
270677
+ if (limit === void 0 || limit > BLOG_HERO_MAX) ctx.gap(sectionId, type2, `the source carousel is not limited to ${BLOG_HERO_MAX} posts; the app shows the latest ${shown3}`);
270678
+ for (const reason of layoutGaps(st2)) ctx.gap(sectionId, type2, reason);
270679
+ const svc = ctx.uses("blog", `blog${index}`, { ...base2, limit: shown3 });
270680
+ const children2 = [];
270681
+ const title = str16(s5.title).trim();
270682
+ if (s5.showTitle === true && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
270683
+ children2.push(node(`${id}.loading`, "Skeleton", { height: 200, count: 1, cornerRadius: 12 }, { padding: { leading: 0, trailing: 0, top: 0, bottom: 0 }, hiddenPath: `$service:${svc}.notLoading` }));
270684
+ children2.push(ctx.recipe("blog-hero", { svc, id, detailScreen: "himi_blog_post" }), ...ctx.optionalRecipe("section-error", { svc, id, action: "retry" }));
270685
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
270686
+ };
270687
+ }
269763
270688
  function eventsInline(id, s5, index, ctx) {
269764
270689
  const svc = ctx.uses("events", `events${index}`, {});
269765
270690
  const card2 = withoutNode(ctx.recipe("events-inline", { svc, id, shareLabel: "Share", seeAllLabel: "", seeAllScreen: "himi_events" }), `${id}.see_all`);
@@ -269775,6 +270700,33 @@ function formIdOf(settings) {
269775
270700
  const legacy = typeof settings.shortId === "number" ? String(settings.shortId) : str16(settings.shortId).trim();
269776
270701
  return /^\d+$/.test(legacy) ? legacy : "";
269777
270702
  }
270703
+ function groupFeedSection(type2) {
270704
+ return (id, s5, st2, index, ctx, elementId) => {
270705
+ const groupId = str16(st2.groupId);
270706
+ if (!groupId) return ctx.unsupported(elementId, type2, "the section names no group");
270707
+ if (!ctx.hasScreen("himi_group")) return ctx.unsupported(elementId, type2, "this scaffold has no himi_group screen to open the group in");
270708
+ const openLabel = str16(st2.seeAllButtonText).trim() || "Open group";
270709
+ const title = str16(s5.title).trim();
270710
+ const children2 = [];
270711
+ if (s5.showTitle !== false && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
270712
+ let onAppear, svc = "";
270713
+ try {
270714
+ const limit = countOf2(st2.postNumber);
270715
+ svc = ctx.uses("groupFeed", `groupFeed${index}`, { groupId, ...limit !== void 0 ? { limit } : {} });
270716
+ children2.push(ctx.recipe("group-feed", { svc, id, detailScreen: "himi_group", groupId, openLabel }), ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
270717
+ onAppear = { actionId: `tier5.${svc}.load`, params: {} };
270718
+ if (limit !== void 0 && limit > GROUP_FEED_POSTS_MAX) ctx.gap(elementId, type2, `the source shows ${limit} posts; the section shows the latest ${GROUP_FEED_POSTS_MAX}`);
270719
+ if (str16(st2.topicsLayout).trim()) ctx.gap(elementId, type2, `the source filters the posts by topic (${str16(st2.topicsLayout).toLowerCase()} layout); the section shows the group's latest posts without the topic filter`);
270720
+ ctx.gap(elementId, type2, "the source's posts have reactions, comments and a composer; the section shows the posts read-only, and the group opens from its button");
270721
+ } catch (error) {
270722
+ if (!(error instanceof RecipeError)) throw error;
270723
+ if (svc) ctx.release(svc);
270724
+ ctx.gap(elementId, type2, "the group's posts are not shown inline: this scaffold does not ship the group feed recipe or module; the section opens the group");
270725
+ children2.push(node(`${id}.open`, "Button", { title: openLabel, style: "secondary", size: "md", fullWidth: true, action: { actionId: "himi.open", params: { screenId: "himi_group", id: groupId } } }));
270726
+ }
270727
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), ...onAppear ? { onAppear } : {} });
270728
+ };
270729
+ }
269778
270730
  function screenIdFor(label4, taken2) {
269779
270731
  let base2 = label4.normalize("NFKD").replace(/[^\x00-\x7f]/g, "").replace(/['\u2019]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
269780
270732
  if (!base2 || !/^[a-z]/.test(base2)) base2 = `page_${base2}`.replace(/_$/, "");
@@ -269850,6 +270802,7 @@ function generateScreens(input) {
269850
270802
  tabs: [],
269851
270803
  pages: [],
269852
270804
  routeRows: [],
270805
+ screenParams: [],
269853
270806
  evidence: { ...str16(raw.revision) ? { revision: str16(raw.revision) } : {}, ...str16(raw.publishedDate) ? { publishedDate: str16(raw.publishedDate) } : {} }
269854
270807
  };
269855
270808
  const assemble = (screenId, title, children2, uses) => {
@@ -269896,7 +270849,11 @@ function generateScreens(input) {
269896
270849
  out2.routes.push({ layoutItemId, label: label4, kind: "empty" });
269897
270850
  continue;
269898
270851
  }
269899
- const verticals = new Set(elements2.map((e2) => TEMPLATE_VERTICALS[str16(obj11(sections2[str16(e2.elementId)]).sectionDefinitionId)]));
270852
+ const verticalOf = (e2) => {
270853
+ const section3 = obj11(sections2[str16(e2.elementId)]), type2 = str16(section3.sectionDefinitionId);
270854
+ return type2 === "groups_feed_section" && arr(obj11(section3.settings).groupsToShow).length ? void 0 : TEMPLATE_VERTICALS[type2];
270855
+ };
270856
+ const verticals = new Set(elements2.map(verticalOf));
269900
270857
  const distinctLinks = elements2.length > 1 && elements2.every((e2) => FALLBACK_TARGETS[str16(obj11(sections2[str16(e2.elementId)]).sectionDefinitionId)]?.params) && new Set(elements2.map((e2) => {
269901
270858
  const section3 = obj11(sections2[str16(e2.elementId)]);
269902
270859
  return JSON.stringify(TEMPLATE_PARAMS[str16(section3.sectionDefinitionId)]?.(section3, obj11(section3.settings)) ?? {});
@@ -269909,9 +270866,6 @@ function generateScreens(input) {
269909
270866
  const extraId = str16(extra.elementId);
269910
270867
  out2.gaps.push({ page: label4, sectionId: extraId, sectionDefinitionId: str16(obj11(sections2[extraId]).sectionDefinitionId), reason: "this page has several sections of the same template screen; it opens that screen once, so this section is not shown on its own" });
269911
270868
  }
269912
- if (type2 === "groups_feed_section" && arr(obj11(first.settings).groupsToShow).length) {
269913
- out2.unmapped.push({ page: label4, sectionId: str16(elements2[0].elementId), sectionDefinitionId: type2, reason: "a groups feed limited to chosen groups is not supported by the template feed" });
269914
- }
269915
270869
  let screenId2 = [...verticals][0];
269916
270870
  const present = input.takenScreenIds;
269917
270871
  const fallback = TEMPLATE_FALLBACKS[screenId2];
@@ -269978,6 +270932,14 @@ function generateScreens(input) {
269978
270932
  },
269979
270933
  extraScreen: (id, title, children3, extraUses) => {
269980
270934
  extras.push({ screenId: id, title, children: children3, uses: extraUses });
270935
+ },
270936
+ claimScreenParam: (screenId2, key4, value2) => {
270937
+ const claimed = out2.screenParams.find((entry) => entry.screenId === screenId2);
270938
+ if (!claimed) {
270939
+ out2.screenParams.push({ screenId: screenId2, params: { [key4]: value2 } });
270940
+ return true;
270941
+ }
270942
+ return claimed.params[key4] === value2;
269981
270943
  }
269982
270944
  };
269983
270945
  const children2 = [];
@@ -270284,18 +271246,20 @@ function addNavigation(out2, plan, taken2, pageIconOf) {
270284
271246
  out2.routes.push({ layoutItemId: "(more)", label: "More", screenId, kind: "generated" });
270285
271247
  out2.tabs.push({ layoutItemId: "(more)", label: "More", screenId });
270286
271248
  }
270287
- var TEMPLATE_HOME_SCREEN, TEMPLATE_SCREEN_PARAM_KEYS, SYSTEM_ALL_PRODUCTS_ID, collectionParams, TEMPLATE_PARAMS, countOf2, SCREEN_ADAPTATIONS, FALLBACK_TARGETS, NO_INLINE_SECTION, ROUTE_PLACEHOLDER, BOTTOM_TABS_BEFORE_MORE, TEMPLATE_VERTICALS, PAGE_TYPE_ICONS, HOME_TAB_ICON, TEMPLATE_FALLBACKS, MODULES, obj11, arr, str16, node, text28, vstack, hstack, inset, openUrl2, youtubeIdOf, DIRECT_VIDEO_FILE, dialUrl, mailUrl, BUSINESS_CHAT_SCREEN, sourceTap, SUBSCRIPTIONS_MAX, selectedPlanIds, PROGRAMS_DEFAULT_LIMIT, PROGRAMS_INLINE_MAX, GALLERIES_INLINE_MAX, BLOG_HERO_MAX, BLOG_SEARCH_POSTS, SHOP_ALL, SERVICES_INLINE, UPCOMING_INLINE, PRODUCTS_INLINE, GROUP_FEED_POSTS_MAX, VIDEOS_INLINE_DEFAULT, VIDEOS_INLINE_MAX, SOCIAL_NETWORKS, HANDLERS, MERGED_PAGES_BUNDLE, chevron;
271249
+ var TEMPLATE_HOME_SCREEN, TEMPLATE_SCREEN_PARAM_KEYS, SYSTEM_ALL_PRODUCTS_ID, collectionParams, TEMPLATE_PARAMS, countOf2, SCREEN_ADAPTATIONS, FALLBACK_TARGETS, NO_INLINE_SECTION, ROUTE_PLACEHOLDER, BOTTOM_TABS_BEFORE_MORE, TEMPLATE_VERTICALS, PAGE_TYPE_ICONS, HOME_TAB_ICON, TEMPLATE_FALLBACKS, MODULES, obj11, arr, str16, node, text28, vstack, hstack, inset, openUrl2, youtubeIdOf, DIRECT_VIDEO_FILE, dialUrl, mailUrl, BUSINESS_CHAT_SCREEN, sourceTap, SUBSCRIPTIONS_MAX, selectedPlanIds, MEMBERS_RAIL, PROGRAMS_DEFAULT_LIMIT, PROGRAMS_INLINE_MAX, PODCAST_INLINE, GALLERIES_INLINE_MAX, GALLERIES_LIST_INLINE, BLOG_HERO_MAX, BLOG_SEARCH_POSTS, EVENT_SCHEDULE_INLINE, SHOP_ALL, SERVICES_INLINE, UPCOMING_INLINE, PRODUCTS_INLINE, GROUP_FEED_POSTS_MAX, NEWSFEED_GROUPS_MAX, LOYALTY_TIERS_INLINE, VIDEOS_INLINE_DEFAULT, VIDEOS_INLINE_MAX, WISHLIST_INLINE, SOCIAL_NETWORKS, HANDLERS, MERGED_PAGES_BUNDLE, chevron;
270288
271250
  var init_generate2 = __esm({
270289
271251
  "src/one-app/generate.ts"() {
270290
271252
  init_define_HHP_CATALOG();
270291
271253
  init_recipes();
270292
271254
  init_recipes();
271255
+ init_podcast();
270293
271256
  init_tab_ids();
270294
271257
  TEMPLATE_HOME_SCREEN = "himi_branded_home";
270295
271258
  TEMPLATE_SCREEN_PARAM_KEYS = {
270296
271259
  himi_shop: ["categoryId"],
270297
271260
  himi_groups_feed: ["title", "groupListLabel", "pageSize"],
270298
- himi_groups: ["title", "groupListLabel", "pageSize"]
271261
+ himi_groups: ["title", "groupListLabel", "pageSize"],
271262
+ himi_podcasts: ["feedUrl"]
270299
271263
  };
270300
271264
  SYSTEM_ALL_PRODUCTS_ID = "00000000-000000-000000-000000000001";
270301
271265
  collectionParams = (st2) => {
@@ -270342,13 +271306,13 @@ var init_generate2 = __esm({
270342
271306
  ...Object.keys(obj11(st2.categories)).length ? ["the source limits its questions to chosen categories; himi_faq takes no category selection and lists every category"] : []
270343
271307
  ];
270344
271308
  },
270345
- newBlog_postlist_carousel_full_section: (st2) => {
270346
- const content = obj11(st2.contentSettings), limit = countOf2(content.postsPerCategory), category = str16(content.categoryId).trim();
271309
+ newBlog_postlist_carousel_full_section: (st2) => blogCarouselScreenGaps(st2),
271310
+ newBlog_postlist_carousel_section: (st2) => blogCarouselScreenGaps(st2),
271311
+ newBlog_category_list_vertical_section: (st2) => {
271312
+ const chosen = chosenBlogCategories(st2).length;
270347
271313
  return [
270348
- ...category && category !== "all" ? [`the source shows only the posts of category ${category}; himi_blog does not open on a given category and shows every post`] : [],
270349
- ...content.featuredOnly === true ? ["the source shows only featured posts; himi_blog shows every post"] : [],
270350
- "the source shows its posts as a carousel; himi_blog is the full post list",
270351
- ...limit !== void 0 ? [`the source shows only ${limit} post(s); himi_blog lists every post`] : []
271314
+ ...chosen ? [`the source lists only its ${chosen} chosen categor${chosen === 1 ? "y" : "ies"}; himi_blog has a chip for every category that has posts`] : [],
271315
+ "the source lists the categories and opens one category's posts; himi_blog shows the categories as chips above every post"
270352
271316
  ];
270353
271317
  }
270354
271318
  };
@@ -270364,16 +271328,24 @@ var init_generate2 = __esm({
270364
271328
  vod_carousel_section: { screen: "himi_videos", needsScreen: true },
270365
271329
  memberships_plan_cards_carousel: { screen: "himi_plans", needsScreen: true },
270366
271330
  progallery_carousel_section: { screen: "himi_galleries", needsScreen: true },
271331
+ // A Pro Gallery list inline needs `himi_gallery` for a card to open; without it the section keeps its title and a link to the galleries screen.
271332
+ proGallery_gallery_list_section: { screen: "himi_galleries", needsScreen: true },
271333
+ // Galleries shared with members: not the site's Pro Gallery, so the page keeps the source's title and a link to the template's galleries screen.
271334
+ shared_gallery_list_section: { screen: "himi_galleries", needsScreen: true },
270367
271335
  achievements_participant_carousel_section: { screen: "himi_member_programs", needsScreen: true },
270368
271336
  groups_cards_section: { screen: "himi_groups", needsScreen: true },
270369
271337
  newBlog_search_section: { screen: "himi_blog", needsScreen: true },
270370
271338
  // Sections that ARE a template screen (`TEMPLATE_VERTICALS`): on a page of other sections they keep their place as a title and a link.
270371
271339
  upcoming_bookings_section: { screen: "himi_bookings", needsScreen: true },
271340
+ // Its numbers are the member's bookings: a scaffold without the recipe keeps the title and a link to My Bookings.
271341
+ performance_tracker_section: { screen: "himi_bookings", needsScreen: true },
270372
271342
  memberships_packages_section: { screen: "himi_my_subscriptions", needsScreen: true },
270373
271343
  platform_paid_plans_section: { screen: "himi_plans", needsScreen: true },
270374
271344
  groups_list_section: { screen: "himi_groups", needsScreen: true },
270375
271345
  faq_list_section: { screen: "himi_faq", needsScreen: true },
270376
271346
  newBlog_postlist_carousel_full_section: { screen: "himi_blog", needsScreen: true },
271347
+ newBlog_postlist_carousel_section: { screen: "himi_blog", needsScreen: true },
271348
+ newBlog_category_list_vertical_section: { screen: "himi_blog", needsScreen: true },
270377
271349
  stores_products_grid_section: { screen: "himi_shop", needsScreen: true, params: collectionParams },
270378
271350
  stores_products_carousel_section: { screen: "himi_shop", needsScreen: true, params: collectionParams },
270379
271351
  // Sections the census found on the most apps with no rule at all: each opens the template screen that shows its data.
@@ -270383,10 +271355,18 @@ var init_generate2 = __esm({
270383
271355
  loyalty_status_section: { screen: "himi_loyalty", needsScreen: true },
270384
271356
  loyalty_offering_section: { screen: "himi_loyalty", needsScreen: true },
270385
271357
  platform_general_members_section: { screen: "himi_members", needsScreen: true },
271358
+ member_horizontal_list_section: { screen: "himi_members", needsScreen: true },
270386
271359
  // `himi_groups_feed` is a newer template screen: a scaffold without it links `himi_groups` (`TEMPLATE_FALLBACKS`), as a page of only this section opens it.
270387
271360
  groups_feed_section: { screen: "himi_groups_feed", needsScreen: true },
270388
271361
  // Link only when the scaffold has the events screen: without it the link would open nothing, so the section is reported instead.
270389
- events_carousel_section: { sibling: "events_list_section", screen: "himi_events", needsScreen: true }
271362
+ events_carousel_section: { sibling: "events_list_section", screen: "himi_events", needsScreen: true },
271363
+ // Upcoming sessions of the business (the Bookings widget): the template's agenda screen lists the site's upcoming class and course sessions.
271364
+ platform_general_upcoming_section: { screen: "himi_agenda", needsScreen: true },
271365
+ // One event's schedule inline needs `himi_event` for View All to open; without it (or with no event chosen) the section keeps its title and a link to the events screen.
271366
+ events_schedule_section: { screen: "himi_events", needsScreen: true },
271367
+ // The store search bar opens the shop; the wishlist's device-local list is the saved-products screen.
271368
+ stores_products_search_section: { screen: "himi_shop", needsScreen: true },
271369
+ stores_wishlist_section: { screen: "himi_saved_products", needsScreen: true }
270390
271370
  };
270391
271371
  NO_INLINE_SECTION = "its data has no inline section yet";
270392
271372
  ROUTE_PLACEHOLDER = "@route:";
@@ -270405,9 +271385,15 @@ var init_generate2 = __esm({
270405
271385
  groups_list_section: "himi_groups",
270406
271386
  faq_list_section: "himi_faq",
270407
271387
  newBlog_postlist_carousel_full_section: "himi_blog",
271388
+ // The source section is the Pro Gallery galleries screen itself (`progallery.screen.Galleries`).
271389
+ proGallery_gallery_list_section: "himi_galleries",
271390
+ newBlog_postlist_carousel_section: "himi_blog",
271391
+ newBlog_category_list_vertical_section: "himi_blog",
270408
271392
  // The channel list IS the template's videos screen, and the bookings agenda IS its agenda screen (a calendar of the site's sessions).
270409
271393
  vod_list_section: "himi_videos",
270410
- bookings_agenda_section: "himi_agenda"
271394
+ bookings_agenda_section: "himi_agenda",
271395
+ // The source's upcoming strip is the Bookings member widget (its `about` origin is fed by Bookings alone): the site's next sessions, which is what the agenda screen lists.
271396
+ platform_general_upcoming_section: "himi_agenda"
270411
271397
  };
270412
271398
  PAGE_TYPE_ICONS = {
270413
271399
  forum: "appEditor.outline.forum",
@@ -270466,6 +271452,7 @@ var init_generate2 = __esm({
270466
271452
  programs: { file: "programs-section", register: "registerProgramsSection", capabilities: ["wix_api", "iap", "app_info"] },
270467
271453
  members: { file: "members-directory", register: "registerMembersDirectory", capabilities: ["wix_api"] },
270468
271454
  blog: { file: "blog-list", register: "registerBlogList", capabilities: ["wix_api"] },
271455
+ blogCategories: { file: "blog-categories", register: "registerBlogCategories", capabilities: ["wix_api"] },
270469
271456
  plans: { file: "plans-section", register: "registerPlansSection", capabilities: ["wix_api"] },
270470
271457
  // A link tapped in the rich body opens through `capability.open_url`, which the page's screen must declare too.
270471
271458
  announcements: { file: "announcement-section", register: "registerAnnouncementSection", capabilities: ["wix_api", "open_url"] },
@@ -270475,13 +271462,24 @@ var init_generate2 = __esm({
270475
271462
  faq: { file: "faq-list", register: "registerFaqList", capabilities: ["wix_api", "open_url"] },
270476
271463
  groups: { file: "groups-section", register: "registerGroupsSection", capabilities: ["wix_api"] },
270477
271464
  groupFeed: { file: "group-feed-section", register: "registerGroupFeedSection", capabilities: ["wix_api"] },
271465
+ groupsNewsfeed: { file: "groups-newsfeed-section", register: "registerGroupsNewsfeedSection", capabilities: ["wix_api"] },
271466
+ // The public rewards program, and the member's own points (read only for a member the host proves to Wix).
271467
+ loyaltyOffering: { file: "loyalty-offering-section", register: "registerLoyaltyOfferingSection", capabilities: ["wix_api"] },
271468
+ loyaltyStatus: { file: "loyalty-status-section", register: "registerLoyaltyStatusSection", capabilities: ["wix_api"] },
270478
271469
  products: { file: "products-section", register: "registerProductsSection", capabilities: ["wix_api"] },
270479
271470
  galleries: { file: "galleries-section", register: "registerGalleriesSection", capabilities: ["wix_api"] },
271471
+ eventSchedule: { file: "event-schedule-section", register: "registerEventScheduleSection", capabilities: ["wix_api"] },
270480
271472
  subscriptions: { file: "my-subscriptions-section", register: "registerSubscriptionsSection", capabilities: ["wix_api"] },
270481
271473
  services: { file: "services-section", register: "registerServicesSection", capabilities: ["wix_api"] },
270482
271474
  // The member's own bookings: the read goes through the same member identity as My Bookings.
270483
271475
  upcomingBookings: { file: "upcoming-bookings-section", register: "registerUpcomingBookingsSection", capabilities: ["wix_api"] },
270484
- videos: { file: "videos-section", register: "registerVideosSection", capabilities: ["wix_api"] }
271476
+ // The member's weekly goal, streak and all-time sessions, counted from the same member-scoped bookings (and the same rule) as My Bookings.
271477
+ performanceTracker: { file: "performance-tracker-section", register: "registerPerformanceTrackerSection", capabilities: ["wix_api"] },
271478
+ videos: { file: "videos-section", register: "registerVideosSection", capabilities: ["wix_api"] },
271479
+ // The feed is read through the public Wix Podcasts gateway, a first-party target of the wix_api bridge (no playback: the template screen plays).
271480
+ podcast: { file: "podcast-section", register: "registerPodcastSection", capabilities: ["wix_api"] },
271481
+ // The products saved on this device: the module reads the app's own storage, never the Wix API.
271482
+ savedProducts: { file: "saved-products-section", register: "registerSavedProductsSection", capabilities: [] }
270485
271483
  };
270486
271484
  obj11 = (v2) => v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
270487
271485
  arr = (v2) => Array.isArray(v2) ? v2 : [];
@@ -270518,18 +271516,25 @@ var init_generate2 = __esm({
270518
271516
  };
270519
271517
  SUBSCRIPTIONS_MAX = 5;
270520
271518
  selectedPlanIds = (st2) => arr(st2.selectedPlanIds).filter((v2) => typeof v2 === "string" && !!v2);
271519
+ MEMBERS_RAIL = 10;
270521
271520
  PROGRAMS_DEFAULT_LIMIT = 2;
270522
271521
  PROGRAMS_INLINE_MAX = 20;
271522
+ PODCAST_INLINE = 3;
270523
271523
  GALLERIES_INLINE_MAX = 30;
271524
+ GALLERIES_LIST_INLINE = 10;
270524
271525
  BLOG_HERO_MAX = 10;
270525
271526
  BLOG_SEARCH_POSTS = 100;
271527
+ EVENT_SCHEDULE_INLINE = 10;
270526
271528
  SHOP_ALL = "all";
270527
271529
  SERVICES_INLINE = 6;
270528
271530
  UPCOMING_INLINE = 3;
270529
271531
  PRODUCTS_INLINE = { carousel: 8, grid: 6 };
270530
271532
  GROUP_FEED_POSTS_MAX = 20;
271533
+ NEWSFEED_GROUPS_MAX = 5;
271534
+ LOYALTY_TIERS_INLINE = 3;
270531
271535
  VIDEOS_INLINE_DEFAULT = 8;
270532
271536
  VIDEOS_INLINE_MAX = 20;
271537
+ WISHLIST_INLINE = 6;
270533
271538
  SOCIAL_NETWORKS = {
270534
271539
  instagram: "Instagram",
270535
271540
  facebook: "Facebook",
@@ -270724,6 +271729,35 @@ var init_generate2 = __esm({
270724
271729
  children2.push(...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
270725
271730
  return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
270726
271731
  },
271732
+ // A podcast: the show's header and its latest episodes from the source's own RSS feed, as the One App's widget shows them (its three newest,
271733
+ // and "View all episodes" when the feed has more). A row and that link open the template Podcasts screen, which lists and PLAYS the feed.
271734
+ // That screen reads one feed per app, so only the sections that show the app's first feed link to it; the rest list their episodes only.
271735
+ podcasts_widget_section: (id, s5, st2, index, ctx, sectionId) => {
271736
+ const type2 = "podcasts_widget_section";
271737
+ const feedUrl = str16(st2.feedUrl).trim() || str16(st2.originalFeedUrl).trim();
271738
+ if (!/^https?:\/\//i.test(feedUrl)) {
271739
+ ctx.gap(sectionId, type2, "the source section has no podcast feed link, so it shows no podcast; the section is left out");
271740
+ return null;
271741
+ }
271742
+ if (!podcastFeedUrl(feedUrl).ok) {
271743
+ ctx.gap(sectionId, type2, "the source section's podcast link is not a public web address (a private or local host, or one that carries a user name), which the template Podcasts screen refuses too; the section is left out");
271744
+ return null;
271745
+ }
271746
+ const svc = ctx.uses("podcast", `podcast${index}`, { feedUrl, limit: PODCAST_INLINE });
271747
+ let list5 = ctx.recipe("podcasts-widget", { svc, id, episodesScreen: "himi_podcasts" });
271748
+ const hasScreen2 = ctx.hasScreen("himi_podcasts");
271749
+ if (!(hasScreen2 && ctx.claimScreenParam("himi_podcasts", "feedUrl", feedUrl))) {
271750
+ list5 = withoutTap(withoutNode(list5, `${id}.more`), `${id}.row`);
271751
+ ctx.gap(sectionId, type2, hasScreen2 ? "the source opens an episode's page from this podcast; the template Podcasts screen plays one feed per app, and it shows another podcast's feed, so these episodes and the View all episodes link do not open it" : "the source opens an episode's page from this podcast; this scaffold has no himi_podcasts screen to play it, so the episodes are listed without a tap and without View all episodes");
271752
+ } else {
271753
+ ctx.gap(sectionId, type2, "the source opens an episode's own page from the list; the section opens the template Podcasts screen (every episode, with its player) instead");
271754
+ }
271755
+ const title = str16(s5.title).trim();
271756
+ const children2 = [];
271757
+ if (s5.showTitle === true && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
271758
+ children2.push(list5, ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
271759
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
271760
+ },
270727
271761
  // The selected plans as cards: name, pitch, price, validity, a details button and the benefits list (unless the source hides it).
270728
271762
  // A scaffold without the plans recipe keeps the title and a link to the template's plans screen, as every data section does.
270729
271763
  memberships_plan_cards_carousel: (id, s5, st2, index, ctx) => plansSection(id, s5, index, ctx, { planIds: selectedPlanIds(st2), showBenefits: st2.shouldDisplayBenefitsList !== false }),
@@ -270740,17 +271774,16 @@ var init_generate2 = __esm({
270740
271774
  // the source's `maxGalleries`. A card opens the template's gallery screen and View All its galleries screen: a scaffold without either
270741
271775
  // keeps the title and a link, as every data section does.
270742
271776
  progallery_carousel_section: (id, s5, st2, index, ctx, sectionId) => {
270743
- if (!ctx.hasScreen("himi_gallery")) throw new RecipeError("this scaffold has no himi_gallery screen for a gallery card to open, so the section keeps its title and a See All link.");
270744
271777
  const asked = typeof st2.maxGalleries === "number" && st2.maxGalleries >= 1 ? Math.floor(st2.maxGalleries) : void 0;
270745
271778
  const limit = asked !== void 0 ? Math.min(asked, GALLERIES_INLINE_MAX) : void 0;
270746
271779
  if (asked !== void 0 && limit !== asked) ctx.gap(sectionId, "progallery_carousel_section", `the source shows ${asked} galleries; the section shows the first ${limit}`);
270747
- const svc = ctx.uses("galleries", `galleries${index}`, { ...limit !== void 0 ? { limit } : {}, showName: st2.isShowName !== false });
270748
- const children2 = [];
270749
- const title = str16(s5.title).trim();
270750
- const viewAll = ctx.hasScreen("himi_galleries") ? node(`${id}.all`, "Button", { title: "View All", style: "secondary", size: "md", fullWidth: true, action: { actionId: "himi.open", params: { screenId: "himi_galleries" } } }, { hiddenPath: `$service:${svc}.noMore` }) : void 0;
270751
- if (s5.showTitle !== false && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
270752
- children2.push(ctx.recipe(st2.isCarousel === false ? "galleries-list" : "galleries-carousel", { svc, id }), ...viewAll ? [viewAll] : [], ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
270753
- return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
271780
+ return galleryCards(id, s5, index, ctx, { layout: st2.isCarousel === false ? "galleries-list" : "galleries-carousel", showName: st2.isShowName !== false, ...limit !== void 0 ? { limit } : {} });
271781
+ },
271782
+ // The Pro Gallery list section is the source's whole galleries screen and has no settings of its own (no count, layout or names switch),
271783
+ // so it shows the site's first galleries as full-width cards with every name, and View All opens the galleries screen for the rest.
271784
+ proGallery_gallery_list_section: (id, s5, _st, index, ctx, sectionId) => {
271785
+ ctx.gap(sectionId, "proGallery_gallery_list_section", `the source lists every gallery; the section shows the first ${GALLERIES_LIST_INLINE} and View All opens the galleries screen`);
271786
+ return galleryCards(id, s5, index, ctx, { layout: "galleries-list", showName: true, limit: GALLERIES_LIST_INLINE });
270754
271787
  },
270755
271788
  // The signed-in member's active plan orders as cards that open the subscription, with the section's See All. A guest sees a sign-in
270756
271789
  // prompt (never an error). The source's package balances and session credits have no equivalent here, so they are reported.
@@ -270796,17 +271829,32 @@ var init_generate2 = __esm({
270796
271829
  },
270797
271830
  // The latest posts as a snapping carousel. A carousel is a handful of posts, so an unlimited source is capped; the source's
270798
271831
  // title-over-image look is the one thing the recipe lays out differently, and both adaptations are reported.
270799
- newBlog_postlist_carousel_full_section: (id, s5, st2, index, ctx, sectionId) => {
270800
- const { base: base2, limit } = blogOptions(st2);
270801
- const shown3 = Math.min(limit ?? BLOG_HERO_MAX, BLOG_HERO_MAX);
270802
- if (limit === void 0 || limit > BLOG_HERO_MAX) ctx.gap(sectionId, "newBlog_postlist_carousel_full_section", `the source carousel is not limited to ${BLOG_HERO_MAX} posts; the app shows the latest ${shown3}`);
270803
- ctx.gap(sectionId, "newBlog_postlist_carousel_full_section", "the source lays each post's title over its image; the title sits under the image");
270804
- const svc = ctx.uses("blog", `blog${index}`, { ...base2, limit: shown3 });
271832
+ newBlog_postlist_carousel_full_section: blogCarousel("newBlog_postlist_carousel_full_section", () => ["the source lays each post's title over its image; the title sits under the image"]),
271833
+ // The "classic" carousel (cards: cover, then title, excerpt and counts) and the "full" one (title over the image) are the same snapping
271834
+ // carousel here; what the cards show beyond cover, title and time is reported.
271835
+ newBlog_postlist_carousel_section: blogCarousel("newBlog_postlist_carousel_section", (st2) => {
271836
+ if (st2.carouselLayout === "full") return ["the source lays each post's title over its image; the title sits under the image"];
271837
+ const display = obj11(st2.displayOptions);
271838
+ const extras = [display.excerpt === true && "the excerpt", display.author === true && "the author", display.likes === true && "the likes", display.times_viewed === true && "the views", display.comments === true && "the comments"].filter(Boolean);
271839
+ return extras.length ? [`the source's cards also show ${extras.join(", ")}; the carousel shows the cover, the title and the time`] : [];
271840
+ }),
271841
+ // The blog's categories as an inline vertical list. Each row opens himi_blog, whose chips are the same categories: the template screen
271842
+ // does not open on a given category, so that difference is reported. The source's image and description have no row field here.
271843
+ newBlog_category_list_vertical_section: (id, s5, st2, index, ctx, sectionId) => {
271844
+ const type2 = "newBlog_category_list_vertical_section";
271845
+ if (!ctx.hasScreen("himi_blog")) return ctx.unsupported(sectionId, type2, "this scaffold has no himi_blog screen for a category row to open");
271846
+ const content = obj11(st2.categoryContentSettings), display = obj11(st2.categoryListDisplayOptions);
271847
+ const chosen = chosenBlogCategories(st2);
271848
+ if (content.showAllCategories !== true && arr(content.categories).length && !chosen.length) ctx.gap(sectionId, type2, "the source selects no category; the section lists every category that has posts");
271849
+ ctx.gap(sectionId, type2, "a category row opens the blog, which lists every post with a chip per category; the source opens that category's posts");
271850
+ const dropped = [display.image === true && "image", display.description === true && "description"].filter(Boolean);
271851
+ if (dropped.length) ctx.gap(sectionId, type2, `the source shows each category's ${dropped.join(" and ")}; the section shows its name${display.postsCount === true ? " and post count" : ""}`);
271852
+ const svc = ctx.uses("blogCategories", `blogCategories${index}`, { ...chosen.length ? { categoryIds: chosen } : {}, showCount: display.postsCount === true });
270805
271853
  const children2 = [];
270806
271854
  const title = str16(s5.title).trim();
270807
271855
  if (s5.showTitle === true && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
270808
- children2.push(node(`${id}.loading`, "Skeleton", { height: 200, count: 1, cornerRadius: 12 }, { padding: { leading: 0, trailing: 0, top: 0, bottom: 0 }, hiddenPath: `$service:${svc}.notLoading` }));
270809
- children2.push(ctx.recipe("blog-hero", { svc, id, detailScreen: "himi_blog_post" }), ...ctx.optionalRecipe("section-error", { svc, id, action: "retry" }));
271856
+ children2.push(node(`${id}.loading`, "Skeleton", { height: 44, count: 3, cornerRadius: 12 }, { padding: { leading: 0, trailing: 0, top: 0, bottom: 0 }, hiddenPath: `$service:${svc}.notLoading` }));
271857
+ children2.push(ctx.recipe("blog-categories", { svc, id, blogScreen: "himi_blog" }), ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
270810
271858
  return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
270811
271859
  },
270812
271860
  // The FAQ: questions grouped by category as disclosure rows, with the source's own settings. What the recipe has no control for is reported.
@@ -270835,32 +271883,60 @@ var init_generate2 = __esm({
270835
271883
  groups_cards_section: groupsSection("groups-cards", "groups_cards_section"),
270836
271884
  stores_products_carousel_section: productsSection("carousel"),
270837
271885
  stores_products_grid_section: productsSection("grid"),
271886
+ stores_products_search_section: productsSearchSection,
271887
+ stores_wishlist_section: wishlistSection,
270838
271888
  // One chosen group's latest posts, and the source's own button that opens the group. A group that is not public shows the state the
270839
271889
  // group screen shows a non-member, never its posts. A scaffold without the feed module keeps the title and the button.
270840
- single_group_feed_section: (id, s5, st2, index, ctx, elementId) => {
270841
- const groupId = str16(st2.groupId);
270842
- if (!groupId) return ctx.unsupported(elementId, "single_group_feed_section", "the section names no group");
270843
- if (!ctx.hasScreen("himi_group")) return ctx.unsupported(elementId, "single_group_feed_section", "this scaffold has no himi_group screen to open the group in");
270844
- const openLabel = str16(st2.seeAllButtonText).trim() || "Open group";
271890
+ single_group_feed_section: groupFeedSection("single_group_feed_section"),
271891
+ // The groups newsfeed: the latest posts across the site's public groups (every group when the source chose none). One chosen group is the
271892
+ // single-group feed above, with the source's own See All text on its button; several or all go through the groups newsfeed module.
271893
+ groups_feed_section: (id, s5, st2, index, ctx, elementId) => {
271894
+ const type2 = "groups_feed_section";
271895
+ const chosen = arr(st2.groupsToShow).filter((v2) => typeof v2 === "string" && !!v2);
271896
+ const heading = str16(st2.sectionTitle).trim();
271897
+ const titled = heading ? { ...s5, title: heading, showTitle: true } : s5;
271898
+ if (chosen.length === 1) return groupFeedSection(type2)(id, titled, { ...st2, groupId: chosen[0] }, index, ctx, elementId);
271899
+ if (!ctx.hasScreen("himi_group")) return ctx.unsupported(elementId, type2, "this scaffold has no himi_group screen to open a post's group in");
271900
+ const limit = countOf2(st2.postNumber);
271901
+ const listLabel = str16(st2.openGroupListButtonText).trim() || "Group list";
271902
+ const svc = ctx.uses("groupsNewsfeed", `groupsNewsfeed${index}`, { ...chosen.length ? { groupIds: chosen } : {}, ...limit !== void 0 ? { limit } : {} });
271903
+ const children2 = [];
271904
+ const title = str16(titled.title).trim();
271905
+ if (titled.showTitle !== false && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
271906
+ const feed = ctx.recipe("groups-newsfeed", { svc, id, detailScreen: "himi_group", groupListLabel: listLabel, groupListScreen: "himi_groups" });
271907
+ children2.push(ctx.hasScreen("himi_groups") ? feed : withoutNode(feed, `${id}.groups`), ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
271908
+ if (limit !== void 0 && limit > GROUP_FEED_POSTS_MAX) ctx.gap(elementId, type2, `the source shows ${limit} posts; the section shows the latest ${GROUP_FEED_POSTS_MAX}`);
271909
+ ctx.gap(elementId, type2, `the section reads the latest posts of the first ${NEWSFEED_GROUPS_MAX} public groups${chosen.length ? " it was set to show" : ""} and merges them by time; a group that is not public is never read`);
271910
+ ctx.gap(elementId, type2, `the source's posts have reactions, comments, a composer and a "${str16(st2.seeAllButtonText).trim() || "See All"}" button; the section shows the posts read-only, a post opens its group, and the "${listLabel}" button opens the groups list`);
271911
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
271912
+ },
271913
+ // The rewards program's offering: tiers (when the program has them), the ways to earn points and the rewards, read from the public program,
271914
+ // and a button to the Rewards screen. The section has no settings of its own (title only).
271915
+ loyalty_offering_section: (id, s5, _st, index, ctx, sectionId) => {
271916
+ const type2 = "loyalty_offering_section";
271917
+ const currency = str16(obj11(ctx.business).paymentCurrency);
271918
+ const svc = ctx.uses("loyaltyOffering", `loyaltyOffering${index}`, /^[A-Z]{3}$/.test(currency) ? { currency } : {});
271919
+ const children2 = [];
270845
271920
  const title = str16(s5.title).trim();
271921
+ if (s5.showTitle === true && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
271922
+ const offering = ctx.recipe("loyalty-offering", { svc, id, loyaltyScreen: "himi_loyalty" });
271923
+ const hasScreen2 = ctx.hasScreen("himi_loyalty");
271924
+ children2.push(hasScreen2 ? offering : withoutNode(offering, `${id}.view`), ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
271925
+ ctx.gap(sectionId, type2, `the section shows the first ${LOYALTY_TIERS_INLINE} tiers of the program${hasScreen2 ? ", and a button opens the Rewards screen (every tier, redeeming)" : ""}`);
271926
+ if (!/^[A-Z]{3}$/.test(currency)) ctx.gap(sectionId, type2, `the business's currency is not in the collected evidence, so a rule or reward priced in money reads "Points details unavailable"`);
271927
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
271928
+ },
271929
+ // The signed-in member's points and tier, or a sign-in card for a visitor.
271930
+ loyalty_status_section: (id, s5, _st, index, ctx, sectionId) => {
271931
+ const type2 = "loyalty_status_section";
271932
+ const svc = ctx.uses("loyaltyStatus", `loyaltyStatus${index}`, {});
270846
271933
  const children2 = [];
270847
- if (s5.showTitle !== false && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
270848
- let onAppear, svc = "";
270849
- try {
270850
- const limit = countOf2(st2.postNumber);
270851
- svc = ctx.uses("groupFeed", `groupFeed${index}`, { groupId, ...limit !== void 0 ? { limit } : {} });
270852
- children2.push(ctx.recipe("group-feed", { svc, id, detailScreen: "himi_group", groupId, openLabel }), ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
270853
- onAppear = { actionId: `tier5.${svc}.load`, params: {} };
270854
- if (limit !== void 0 && limit > GROUP_FEED_POSTS_MAX) ctx.gap(elementId, "single_group_feed_section", `the source shows ${limit} posts; the section shows the latest ${GROUP_FEED_POSTS_MAX}`);
270855
- if (str16(st2.topicsLayout).trim()) ctx.gap(elementId, "single_group_feed_section", `the source filters the posts by topic (${str16(st2.topicsLayout).toLowerCase()} layout); the section shows the group's latest posts without the topic filter`);
270856
- ctx.gap(elementId, "single_group_feed_section", "the source's posts have reactions, comments and a composer; the section shows the posts read-only, and the group opens from its button");
270857
- } catch (error) {
270858
- if (!(error instanceof RecipeError)) throw error;
270859
- if (svc) ctx.release(svc);
270860
- ctx.gap(elementId, "single_group_feed_section", "the group's posts are not shown inline: this scaffold does not ship the group feed recipe or module; the section opens the group");
270861
- children2.push(node(`${id}.open`, "Button", { title: openLabel, style: "secondary", size: "md", fullWidth: true, action: { actionId: "himi.open", params: { screenId: "himi_group", id: groupId } } }));
270862
- }
270863
- return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), ...onAppear ? { onAppear } : {} });
271934
+ const title = str16(s5.title).trim();
271935
+ if (s5.showTitle === true && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
271936
+ const status2 = ctx.recipe("loyalty-status", { svc, id, signInScreen: "himi_sign_in" });
271937
+ children2.push(ctx.hasScreen("himi_sign_in") ? status2 : withoutNode(status2, `${id}.signin`), ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
271938
+ ctx.gap(sectionId, type2, `the section shows the member's points and tier; the points' expiry and the "Rewards available (N)" line are not shown (the Rewards screen shows them)`);
271939
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
270864
271940
  },
270865
271941
  pages_section: (id, _s2, _st, index, ctx, elementId) => {
270866
271942
  const placement = ctx.placements.get(`${ctx.page.layoutItemId}:${elementId}:${index}`);
@@ -270906,6 +271982,27 @@ var init_generate2 = __esm({
270906
271982
  children2.push(list5, ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
270907
271983
  return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
270908
271984
  },
271985
+ // The member's weekly goal, streak and all-time sessions. The source reads a private fitness service: the section counts the same
271986
+ // member-scoped bookings as My Bookings, and every number that differs from the source's is reported.
271987
+ performance_tracker_section: (id, s5, st2, index, ctx, sectionId) => {
271988
+ const type2 = "performance_tracker_section";
271989
+ if (!ctx.hasScreen("himi_bookings")) return ctx.unsupported(sectionId, type2, "this scaffold has no himi_bookings screen for the section to open");
271990
+ const display = obj11(st2.displaySettings);
271991
+ const goal = countOf2(obj11(display.defaultWeeklyGoal).value);
271992
+ const showTotal = obj11(display.totalNumberOfSessions).show !== false;
271993
+ const mode = str16(obj11(st2.progressCalculation).calculationMode).trim();
271994
+ ctx.gap(sectionId, type2, `the section counts the member's confirmed bookings that already took place (the rule of My Bookings' "This week"), not the source's tracker service; a weekly goal of ${goal ?? "2"} is used for everyone (the source lets a member set their own), and a See All button opens My Bookings`);
271995
+ ctx.gap(sectionId, type2, mode === "all" ? "the source counts every scheduled session in the week, including those still to come; the section counts only those that took place" : "the source counts only sessions marked attended; a visitor cannot read attendance, so the section counts every confirmed session that took place");
271996
+ if (obj11(st2.dailyActivity).enabled === true) ctx.gap(sectionId, type2, "the source shows the member's daily activity from Apple Health; the section has no health data");
271997
+ const svc = ctx.uses("performanceTracker", `performanceTracker${index}`, { ...goal !== void 0 ? { goal } : {}, showTotal });
271998
+ const children2 = [];
271999
+ const title = str16(s5.title).trim();
272000
+ if (s5.showTitle === true && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
272001
+ let card2 = ctx.recipe("performance-tracker", { svc, id, signInScreen: "himi_sign_in", seeAllLabel: "See All", seeAllScreen: "himi_bookings" });
272002
+ if (!ctx.hasScreen("himi_sign_in")) card2 = withoutNode(card2, `${id}.signin.button`);
272003
+ children2.push(card2, ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
272004
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
272005
+ },
270909
272006
  // The programs carousel: the shared programs module in carousel layout, configured from the section's own settings.
270910
272007
  achievements_carousel_section: (id, s5, st2, index, ctx) => {
270911
272008
  const sorting = obj11(st2.sortingSettings);
@@ -270965,9 +272062,27 @@ var init_generate2 = __esm({
270965
272062
  // layout, with the source's own empty text. A visitor is asked to sign in, as on the template's member programs screen.
270966
272063
  // The members directory: search with the member count, flat rows, letter bands, role, activity, badges and Follow. The
270967
272064
  // section has no settings of its own, so the native defaults are the contract: every extra is on.
270968
- member_list_section: (id, s5, _st, index, ctx) => {
270969
- const svc = ctx.uses("members", `members${index}`, { showRole: true, showActivity: true, showBadges: true, showFollow: true, letterBands: true });
270970
- return composed2(id, s5, svc, ctx.recipeNodes("members-list", { svc, id, detailScreen: "himi_member" }));
272065
+ member_list_section: (id, s5, _st, index, ctx) => membersDirectory(id, s5, index, ctx),
272066
+ // The same directory on a page of other sections. Its one setting, `showMembers`, has only ever been "all" in the sites collected:
272067
+ // any other value is a filter this generator does not know, so it is reported instead of guessed.
272068
+ platform_general_members_section: (id, s5, st2, index, ctx, sectionId) => {
272069
+ const show2 = str16(st2.showMembers).trim();
272070
+ if (show2 && show2 !== "all") return ctx.unsupported(sectionId, "platform_general_members_section", `its members filter ${JSON.stringify(show2)} is not one this generator knows`);
272071
+ return membersDirectory(id, s5, index, ctx);
272072
+ },
272073
+ // The members rail: avatar cards from the members directory module in rail mode. `display` picks the members: everyone (also when the
272074
+ // source set none), or only those who hold a badge. Followers and admins have no read the directory makes, so those two are reported.
272075
+ member_horizontal_list_section: (id, s5, st2, index, ctx, sectionId) => {
272076
+ const type2 = "member_horizontal_list_section", display = str16(st2.display).trim() || "all-members";
272077
+ if (display !== "all-members" && display !== "members-with-badges") return ctx.unsupported(sectionId, type2, `its "${display}" list needs a read the members directory does not make (followers, admins)`);
272078
+ const onlyWithBadges = display === "members-with-badges";
272079
+ const svc = ctx.uses("members", `membersRail${index}`, { showBadges: onlyWithBadges, rail: { limit: MEMBERS_RAIL, ...onlyWithBadges ? { onlyWithBadges } : {} } });
272080
+ const children2 = [];
272081
+ const title = str16(s5.title).trim();
272082
+ if (s5.showTitle === true && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
272083
+ children2.push(ctx.recipe("members-carousel", { svc, id, detailScreen: "himi_member" }), ...ctx.optionalRecipe("section-error", { svc, id, action: "retry" }));
272084
+ ctx.gap(sectionId, type2, `the source lists its members in a horizontal list; the section shows the first ${MEMBERS_RAIL} as a rail${onlyWithBadges ? ", picked from the first page of members (those who hold a badge)" : ""}`);
272085
+ return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
270971
272086
  },
270972
272087
  // A blog list: the shared blog-list module configured from the section's own settings; unlimited follows the cursor,
270973
272088
  // a limited list shows N posts and offers "See All Posts" for the full list in the same category.
@@ -270980,6 +272095,24 @@ var init_generate2 = __esm({
270980
272095
  }
270981
272096
  return eventsInline(id, s5, index, ctx);
270982
272097
  },
272098
+ // One event's schedule (the source's `eventId`): its first sessions as rows (day and time in the event's zone, name, stage), and View All
272099
+ // opens the event, whose full schedule lists every session. The whole section hides when the event has no schedule. A section with no
272100
+ // event chosen, or in a scaffold without the event screen or recipe, keeps its title and a link to the events screen.
272101
+ events_schedule_section: (id, s5, st2, index, ctx, sectionId) => {
272102
+ const eventId = str16(st2.eventId).trim();
272103
+ if (!eventId) return ctx.unsupported(sectionId, "events_schedule_section", "the source section has no event chosen, so there is no schedule to show");
272104
+ if (!ctx.hasScreen("himi_event")) throw new RecipeError("this scaffold has no himi_event screen for View All to open, so the section keeps its title and a See All link.");
272105
+ const svc = ctx.uses("eventSchedule", `eventSchedule${index}`, { eventId });
272106
+ ctx.gap(sectionId, "events_schedule_section", `the section lists the event's first ${EVENT_SCHEDULE_INLINE} sessions and View All opens the event; the source's My Agenda bookmarks are not shown`);
272107
+ ctx.gap(sectionId, "events_schedule_section", "the source shows a message when the event has no schedule; the section hides itself instead");
272108
+ const children2 = [];
272109
+ const title = str16(s5.title).trim();
272110
+ if (s5.showTitle !== false && title) children2.push(text28(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
272111
+ const viewAll = node(`${id}.all`, "Button", { title: "View All", style: "secondary", size: "md", fullWidth: true, action: { actionId: "himi.open", params: { screenId: "himi_event", id: eventId } } }, { hiddenPath: `$service:${svc}.noMore` });
272112
+ children2.push(ctx.recipe("event-schedule", { svc, id }), viewAll, ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
272113
+ const box = vstack(`${id}.box`, children2, 12, { ...inset(16, 16), hiddenPath: `$service:${svc}.hideSection` });
272114
+ return vstack(`${id}.loader`, [box], 0, { onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
272115
+ },
270983
272116
  // The business contact section: its own title and description, and only the rows the source switches on.
270984
272117
  platform_general_contact_section: (id, s5, st2, _i2, ctx) => {
270985
272118
  const profile = obj11(ctx.raw.businessProfile);
@@ -271005,10 +272138,12 @@ var init_generate2 = __esm({
271005
272138
  // The data of these is a template screen of its own (`TEMPLATE_VERTICALS`): beside other sections the page keeps the source's title and a link to it.
271006
272139
  vod_list_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "vod_list_section", NO_INLINE_SECTION),
271007
272140
  bookings_agenda_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "bookings_agenda_section", NO_INLINE_SECTION),
271008
- loyalty_status_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "loyalty_status_section", NO_INLINE_SECTION),
271009
- loyalty_offering_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "loyalty_offering_section", NO_INLINE_SECTION),
271010
- platform_general_members_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "platform_general_members_section", NO_INLINE_SECTION),
271011
- groups_feed_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "groups_feed_section", NO_INLINE_SECTION),
272141
+ // The source strip is the Bookings member widget: the business's next 3 bookable sessions with the member's booked status, whatever its
272142
+ // `interval` setting says (the Bookings provider reads only the business). The agenda screen lists the site's upcoming sessions.
272143
+ platform_general_upcoming_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "platform_general_upcoming_section", "the source strip shows the business's next 3 bookable sessions with the member's booked status; the agenda screen lists the site's upcoming sessions, so the section is not shown inline"),
272144
+ // Shared galleries are the members' Shared Gallery, a different data source from the Pro Gallery list the shared loader reads (the
272145
+ // migration guide says not to substitute it), so the section is not shown inline: it keeps its title and links to the galleries screen.
272146
+ shared_gallery_list_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "shared_gallery_list_section", "the source's shared galleries are the members' Shared Gallery, a different data source from the site's Pro Gallery, so they are not shown inline; the link opens the site's galleries, not the members' shared ones"),
271012
272147
  // The events carousel. `filter` is the source's choice of events: 0 every event, 1 by category, "manual" chosen events (read off the 45
271013
272148
  // carousels collected from the top apps). The shared events section has no event or category filter, so a chosen selection is reported and
271014
272149
  // keeps its place as a link; an unfiltered carousel shows the next events as cards, which is the one thing it cannot lay out as a rail.
@@ -272524,7 +273659,8 @@ async function runOneAppGenerate(args, io2) {
272524
273659
  if (cleared === "set") templateParams.push({ screenId: route.screenId, params: {}, status: cleared });
272525
273660
  }
272526
273661
  }
272527
- const targeted = new Set(result.routes.flatMap((route) => route.kind === "template" && route.screenId ? [route.screenId] : []));
273662
+ for (const { screenId, params } of result.screenParams) templateParams.push({ screenId, params, status: applyScreenParams(options2.contentDir, screenId, params, false, TEMPLATE_SCREEN_PARAM_KEYS[screenId] ?? []) });
273663
+ const targeted = /* @__PURE__ */ new Set([...result.routes.flatMap((route) => route.kind === "template" && route.screenId ? [route.screenId] : []), ...result.screenParams.map((entry) => entry.screenId)]);
272528
273664
  for (const [screenId, keys2] of Object.entries(TEMPLATE_SCREEN_PARAM_KEYS)) {
272529
273665
  if (targeted.has(screenId)) continue;
272530
273666
  let cleared = "absent";
@@ -280474,7 +281610,7 @@ function nativeCapture(devices, opts) {
280474
281610
  if (SYSTEM_WINDOW.test(focus) || owner !== void 0 && owner !== player) return `a system window covered the Player (${focus})`;
280475
281611
  return "";
280476
281612
  }
280477
- async function settle2(platform, id, file2, notFrame) {
281613
+ async function settle3(platform, id, file2, notFrame) {
280478
281614
  let previous;
280479
281615
  let why = "the screen did not stop changing";
280480
281616
  for (let waited = 0; ; waited += settleMs) {
@@ -280515,15 +281651,15 @@ function nativeCapture(devices, opts) {
280515
281651
  await apply2(platform, id, variant);
280516
281652
  await open6(platform, id, `himi://app/${encodeURIComponent(picker)}`);
280517
281653
  const file2 = join207(outDir, `${screen}.${variant}.${platform}.png`);
280518
- const pickerFrame = (await settle2(platform, id, file2)).frame;
281654
+ const pickerFrame = (await settle3(platform, id, file2)).frame;
280519
281655
  await open6(platform, id, screenLink(opts.appId, screen, entry, opts.release));
280520
- const { unsettled } = await settle2(platform, id, file2, pickerFrame);
281656
+ const { unsettled } = await settle3(platform, id, file2, pickerFrame);
280521
281657
  if (unsettled) {
280522
281658
  frames.push({ surface: platform, screen, variant, skipped: { reason: `capture_unsettled: ${unsettled}` } });
280523
281659
  continue;
280524
281660
  }
280525
281661
  if (platform === "android" && await blackFraction(file2) > 0.95) {
280526
- const retry = await settle2(platform, id, file2, pickerFrame);
281662
+ const retry = await settle3(platform, id, file2, pickerFrame);
280527
281663
  if (retry.unsettled) {
280528
281664
  frames.push({ surface: platform, screen, variant, skipped: { reason: `capture_unsettled: ${retry.unsettled}` } });
280529
281665
  continue;
@@ -281448,7 +282584,9 @@ var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
281448
282584
  "no-frame",
281449
282585
  "resume",
281450
282586
  "site-pages",
281451
- "all-himi"
282587
+ "all-himi",
282588
+ "no-webview-pages",
282589
+ "webview-live"
281452
282590
  ]);
281453
282591
  var SWITCH_FLAGS = new Set([...BOOLEAN_FLAGS].filter((name) => name !== "deep"));
281454
282592
  var SWITCH_CONSEQUENCE = {
@@ -281624,7 +282762,7 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
281624
282762
  type issues warn normally, fail under --strict. When it
281625
282763
  passes after a source change it refreshes the home picture
281626
282764
  (offline render, 30s budget; homePicture: {image} or {skipped})
281627
- himi test [<screenId>\u2026] [--content <dir>] [--net <file>] [--deep [n]] [--record] [--native [ios|android]] [--no-shots] [--offline] [--no-hostile] [--input-evidence] [--json]
282765
+ himi test [<screenId>\u2026] [--content <dir>] [--net <file>] [--deep [n]] [--record] [--native [ios|android]] [--no-shots] [--no-webview-pages] [--webview-live] [--offline] [--no-hostile] [--input-evidence] [--json]
281628
282766
  behavioral crawl \u2014 NO test files: dispatches every action
281629
282767
  your descriptors already declare against the real worker,
281630
282768
  on hermetic data (your mocks -> cms seed rows -> canned
@@ -282530,7 +283668,7 @@ var COMMANDS = [
282530
283668
  { name: "functions", summary: "inspect/invoke server functions and operate durable jobs or schedules", required: "list|describe|openapi|invoke | jobs list|get|cancel|retry|dlq | schedule describe|invoke [--app <a>] [--environment preview|production] [--release <id>]" },
282531
283669
  { name: "eject", summary: "take ownership of a shared flow module (auth|checkout|screens): copies its source into tier5-src/_ejected/ and repoints this package's imports at the copy. The ladder's escape hatch \u2014 for when the factory options cannot express what you need. AFTER EJECTING, CENTRAL FIXES NO LONGER REACH THIS APP, including future corrections to the fail-closed entitlement and confirm-the-session rules. The floor is unaffected: credentials still go only through the native auth actions and money only through the cashier rail.", required: "<auth|checkout|screens> [--content <dir>]" },
282532
283670
  { name: "validate", summary: 'lint the content package (no push): fixed-contract TypeScript checking for tier5-src workers + schema/proto + token refs + component allowlist + $service bindings + strict-enum foot-guns + capability decls + worker boot dry-run + build/compile failures + copied tier5-src/_shared files that differ from this CLI\'s (a `stale-shared` warning, never promoted by --strict; `// himi:forked` in a file skips it). Type issues are advisory warnings normally; --strict promotes them and hygiene warnings to errors. Exit 1 on any error. Off-repo, the CLI supplies its compiler and SDK declarations. A PASSING validate after a source change also refreshes the home picture: exactly `himi render <homeScreenId> --png --mocks --device iphone` (offline, never --live; with recorded data \u2014 dev/net-mocks.json or cms seed rows \u2014 the picture shows it, and without, its postcard calls it an offline preview), run as a child it kills after 30 seconds, writing .himi/shots/<home>.png \u2014 whose own postcard logic then journals "First look at your app" or, after ten minutes of postcard silence, "Still building" \u2014 reported as `homePicture: {image}` (with `postcard` when one was journaled) or `{skipped: <reason>}`, never a failed validate. Skipped for a validate with errors, a home shot already current, CI or a test runner, and code nobody asked to run: a --remote template still unchanged since init.', required: "[--content <dir>] [--strict]" },
282533
- { name: "test", summary: "DERIVED behavioral crawl \u2014 no test files to write. Boots each screen's real worker, replays its onAppear, then dispatches every action site the descriptor already declares (each from a fresh boot) and checks a narrow set of unambiguous invariants: no uncaught throw, never stuck on `loading`, no `$service:` token or NaN/undefined/[object Object] reaching visible text, no binding aimed at state the worker never defines, no nav param silently dropped, no dead nav target. Catches what validate/render cannot \u2014 a WRONG REDUCER passes both with ok:true. Runs the worker in a DEVICE-PARITY sandbox (no setTimeout/setInterval, as on JSC/WebView) so a bundle that would die on device fails here. Crawls on HERMETIC DATA by default \u2014 zero network: the app's own dev/net-mocks.json first (--net <file> overrides), then the config's CMS `seed:` rows, then a canned fixture of frozen real vertical responses shipped with the CLI (exercises code paths, not API-contract truth) \u2014 so the success/mapping path runs, not just the failure UI. Two boot-only HOSTILE passes (every list empty; every request 500) then check the failure/empty day \u2014 corpus-proven, so their findings are errors. NAV EDGES are followed too: every himi.open site ($item params resolved against row 0 of its list, $service against worker state) and worker _nav directive is harvested, and each baked target is booted WITH the params the source sends \u2014 detail screens finally run their content arm; edge findings are errors tagged edge:<source>. --native runs both real native decoders over the exact baked JSON bytes; --native ios or --native android selects one. It is explicit, runs only from a Himalaya SOURCE CHECKOUT (the decoder oracles are that tree's own HimalayaCore Swift package and Gradle harness, which a published install does not ship), and needs the selected local toolchain. From a source checkout, default runs name missing native verdicts in the coverage ledger; elsewhere the ledger stays silent about them rather than offering a remedy you cannot run. --offline strips all data layers (the old reject-all axis); --no-hostile skips the hostile passes. --record (EXPLICIT, never automatic) refreshes dev/net-mocks.json from live reads first: it boots each screen (load + root onAppear ONLY \u2014 nothing the app's own launch would not fire; the tap/action crawl never sees the live transport, and only proven reads \u2014 GET, or read-shaped POST (/query, /search, /list*, \u2026) \u2014 ever reach the wire), freezes the round-trips, then crawls hermetically on the fresh fixture; record against a QA site, not production. --input-evidence --json adds versioned actual typed-input probes and journey receipts bound to the tested release/config/run; these are observations, not required-behavior acceptance or benign-warning waivers. Nodes it cannot judge headless are named, never silently passed. Exit 1 on any error. The CLI carries the authoring runtime off-repo; no per-app SDK install is required. --browser runs the whole loop (build \u2192 extract \u2192 validate \u2192 render \u2192 test) in YOUR browser instead of here, so the source never reaches a pod: it opens one screen's worker + descriptor in a tab, blocks on a loopback callback, and prints the report it posts back. One screen per tab \u2014 name it. --no-open prints the URL rather than launching a browser (SSH); --timeout <ms> bounds the wait, which matters because the page has no execution deadline of its own and an infinite loop in the worker hangs the tab.", required: "[<screenId>\u2026] [--content <dir>] [--net <file>] [--budget <ms>] [--deep [n]] [--record] [--native [ios|android]] [--no-shots] [--offline] [--no-hostile] [--all-screens] [--browser] [--no-open] [--timeout <ms>] [--input-evidence] [--json]" },
283671
+ { name: "test", summary: "DERIVED behavioral crawl \u2014 no test files to write. Boots each screen's real worker, replays its onAppear, then dispatches every action site the descriptor already declares (each from a fresh boot) and checks a narrow set of unambiguous invariants: no uncaught throw, never stuck on `loading`, no `$service:` token or NaN/undefined/[object Object] reaching visible text, no binding aimed at state the worker never defines, no nav param silently dropped, no dead nav target. Catches what validate/render cannot \u2014 a WRONG REDUCER passes both with ok:true. Runs the worker in a DEVICE-PARITY sandbox (no setTimeout/setInterval, as on JSC/WebView) so a bundle that would die on device fails here. Crawls on HERMETIC DATA by default \u2014 zero network: the app's own dev/net-mocks.json first (--net <file> overrides), then the config's CMS `seed:` rows, then a canned fixture of frozen real vertical responses shipped with the CLI (exercises code paths, not API-contract truth) \u2014 so the success/mapping path runs, not just the failure UI. Two boot-only HOSTILE passes (every list empty; every request 500) then check the failure/empty day \u2014 corpus-proven, so their findings are errors. NAV EDGES are followed too: every himi.open site ($item params resolved against row 0 of its list, $service against worker state) and worker _nav directive is harvested, and each baked target is booted WITH the params the source sends \u2014 detail screens finally run their content arm; edge findings are errors tagged edge:<source>. --native runs both real native decoders over the exact baked JSON bytes; --native ios or --native android selects one. It is explicit, runs only from a Himalaya SOURCE CHECKOUT (the decoder oracles are that tree's own HimalayaCore Swift package and Gradle harness, which a published install does not ship), and needs the selected local toolchain. From a source checkout, default runs name missing native verdicts in the coverage ledger; elsewhere the ledger stays silent about them rather than offering a remedy you cannot run. --offline strips all data layers (the old reject-all axis); --no-hostile skips the hostile passes. --record (EXPLICIT, never automatic) refreshes dev/net-mocks.json from live reads first: it boots each screen (load + root onAppear ONLY \u2014 nothing the app's own launch would not fire; the tap/action crawl never sees the live transport, and only proven reads \u2014 GET, or read-shaped POST (/query, /search, /list*, \u2026) \u2014 ever reach the wire), freezes the round-trips, then crawls hermetically on the fresh fixture; record against a QA site, not production. --input-evidence --json adds versioned actual typed-input probes and journey receipts bound to the tested release/config/run; these are observations, not required-behavior acceptance or benign-warning waivers. WEBVIEW PAGES: for every bridge: 'worker' WebView it boots the worker with a device-shaped page channel and plays the page \u2014 the handshake, every exposed capability against declaredCapabilities, every advertised method called once, hostile page input \u2014 and, when the headless browser is installed, loads each inlineHtml page with the native host's HimalayaWorker shim wired to the real worker (--webview-live also loads url pages from the network; --no-webview-pages skips the browser step). Nodes it cannot judge headless are named, never silently passed. Exit 1 on any error. The CLI carries the authoring runtime off-repo; no per-app SDK install is required. --browser runs the whole loop (build \u2192 extract \u2192 validate \u2192 render \u2192 test) in YOUR browser instead of here, so the source never reaches a pod: it opens one screen's worker + descriptor in a tab, blocks on a loopback callback, and prints the report it posts back. One screen per tab \u2014 name it. --no-open prints the URL rather than launching a browser (SSH); --timeout <ms> bounds the wait, which matters because the page has no execution deadline of its own and an infinite loop in the worker hangs the tab.", required: "[<screenId>\u2026] [--content <dir>] [--net <file>] [--budget <ms>] [--deep [n]] [--record] [--native [ios|android]] [--no-shots] [--no-webview-pages] [--webview-live] [--offline] [--no-hostile] [--all-screens] [--browser] [--no-open] [--timeout <ms>] [--input-evidence] [--json]" },
282534
283672
  { name: "ux", summary: "audit or record mobile UX evidence. `audit` checks the public-safe contract, seeded blank acceptance rows, placeholder source copy, app-specific mocks, and iOS/Android audit records. It warns while existing templates migrate; `--strict` promotes missing evidence. `record` stores checks performed on an installed iOS/Android build: `--checks` is required for passed|failed and empty for unavailable, which drove nothing and needs a `--reason` instead. `record` also STAMPS the release it audited (it resolves the id from a build, the same one a push would publish), because an unforced `himi push` of a release with screens refuses when no drive is recorded for THAT release, or when the one that is recorded says `failed` \u2014 the artifact stopped being advice nobody reads (#2955). `unavailable` still satisfies it; only `failed` refuses. An `unavailable` record is the honest close for an agent with no device: `audit` (strict or not) lists it under `disclosedGaps` with a `<platform>-audit-not-run` warning, and `push` names it in `uxNotDriven` \u2014 a disclosed gap, never a pass (#5607).", required: "audit [--content <dir>] [--strict] [--json] | record --content <dir> --platform ios|android --status passed|failed|unavailable [--checks back,keyboard,...] [--reason <text>]" },
282535
283673
  { name: "progress", summary: 'the build JOURNAL an agent keeps for the owner while it works. `himi progress "<what changed>" --step <1-8|name> --image <png>` appends one postcard to .himi/progress.jsonl \u2014 the step is one of the customer journey\'s eight (discover, classify, plan, implement, brand, validate, review, download) \u2014 and COPIES each image, content-addressed, into .himi/history/, because .himi/shots/ is overwritten by every render and cleared by every full `himi test`, so a path into it would later show a different picture than the one the owner was sent. --image repeats. With NO --image, the home screen\'s current shot is attached automatically, only when it is no older than the last source change and not the picture the latest journaled postcard already shows \u2014 and never a shot that landed on loading placeholders, an empty or an error state (.himi/shot-states.json): then the newest home picture of the current source that shows content goes on instead (its .himi/history copy, `imageNote` saying so), or none \u2014 except on the HANDOVER card (`--step review`), where a repeat is the point and it attaches anyway; that card\'s output also names the making-of (`makingOf`, .himi/making-of.html, rebuilt when missing or older than the journal so it ends on this card) and its `next` says to hand it to the owner beside the preview link; `imageAttached` in the output says whether the postcard carries a picture (with `imageNote` saying why not, or which picture went on instead), and `--no-image` sends a text-only postcard. --notify also raises a best-effort desktop notification for an owner who stepped away. A bare `himi progress` prints the journal with the current step and elapsed time \u2014 also how an agent recovers its place after its context was compacted. APPROVALS: `--approve <gate> "<what>"` records one the customer just gave (gates: site-create, connect, private-data, draft, promote, push-signing, qa-build) in .himi/approvals.jsonl, and `--done <gate>` / `--drop <gate>` closes it \u2014 an approval is owed until then, and the chat that held it does not survive a new session. `--brief` prints plain text for a session start: the current step, the last postcard, every open approval, and whether this app\'s agent files are stale \u2014 the SessionStart hook `himi agent-init` installs runs exactly this. The CLI also journals milestones by itself \u2014 the first PNG render of the home screen (for an app a current `himi init` started: once as the template\'s "Starting point" while the source is what init wrote, then once as "First look at your app" after it diverges, Markdown edits not counting; once per app otherwise), a `himi test` crawl whose outcome changed since the last one (its counts or its home picture; an identical re-run writes none, and a repeat names what changed: "The home screen changed since the last crawl." or the changed counts, was \u2192 now), every draft push (with the home picture only when that shot is newer than the last source edit \u2014 otherwise the postcard says why and names `himi render <home> --png`), and ONE rule for a long silence: a successful home `render --png` more than ten minutes after the newest postcard of any kind, with a picture the latest postcard does not show, journals "Still building: here\'s the home screen now." with it (never twice within the window). When a crawl\'s or a draft\'s home picture is the first of an app whose source diverged, "First look at your app" is journaled first, from that shot, once. All are marked `"by": "himi"`; they never move the journey step, carry no link or credential, and step aside (folded out of every reader) when the agent journals the same step or picture within five minutes. Local only: nothing is sent anywhere.', required: '["<message>" [--step <1-8|name>] [--image <png>]\u2026 [--no-image] [--notify]] [--content <dir>] | --approve|--done|--drop <gate> ["<note>"] | --brief' },
282536
283674
  { name: "studio", summary: "open the BUILD BOARD \u2014 one local page the owner can leave open while an agent builds their app, which fills itself in: every screen as it renders (NEW/CHANGED badges, and each earlier version kept for a filmstrip), the journey stepper and the latest postcard from `himi progress`, the validate/test/UX/draft checks as they run, the site next to the app's home screen with its palette, and the navigation the test crawl followed. Writes .himi/studio/index.html and opens it; the page re-reads its state every two seconds, so nothing needs to be served. OPT-IN BY EXISTENCE: until this command (or `himi init`, which makes the board for every app it creates, without opening a browser) has run, no other command touches .himi/studio/ \u2014 after it, render/test/validate/push/icon/site/ux/progress each refresh the board as they finish (best-effort; never fails a command). Every image is a content-addressed copy in .himi/history/, never a live path into .himi/shots/. Local only, no secrets: it never reads a preview token, handover code or control token. --no-open prints the path instead (SSH, CI). `himi studio reel` writes the MAKING-OF: one self-contained HTML file (every image inlined, nothing fetched) with a flipbook of the home screen version by version, captioned by the postcard in effect at the time, the final screens, and every postcard \u2014 sized to stay attachable, thinning frames first. Defaults to .himi/making-of.html (never archived by push), which every successful `himi push --draft` also rebuilds and names as `reel` in its output; --out to put it elsewhere. The output names that file as the one to hand the owner (`handover: {file, hint}` in JSON; two plain lines at a terminal) \u2014 beside the preview link, never instead of it.", required: "[--content <dir>] [--no-open] | reel [--out <file>] [--no-open]" },
@@ -284576,7 +285714,7 @@ async function testCommand(ctx) {
284576
285714
  return results.every((result2) => result2.ok) ? 0 : 1;
284577
285715
  }
284578
285716
  const app2 = await appId(dir);
284579
- const { buildContentBundles: buildContentBundles2, buildReleaseFromContent: buildReleaseFromContent2, bundleOutDir: bundleOutDir2, crawlScreen: crawlScreen2, crawlScreenJourney: crawlScreenJourney2, crawlScreenHostile: crawlScreenHostile2, crawlScreenRelations: crawlScreenRelations2, crawlScreenCapabilitySuccess: crawlScreenCapabilitySuccess2, findingKey: findingKey2, startWorkerCoverage: startWorkerCoverage2, uncoveredFunctions: uncoveredFunctions2, crawlScreenDeep: crawlScreenDeep2, crawlSignature: crawlSignature2, recordScreenTraffic: recordScreenTraffic2, mintVisitor: mintVisitor2, mintOneAppVisitorToken: mintOneAppVisitorToken2, webWixCall: webWixCall2, freezeTrafficToMocks: freezeTrafficToMocks2, bootAndSnapshotState: bootAndSnapshotState2, isUnservedRequest: isUnservedRequest2, renderDescriptorWeb: renderDescriptorWeb2, renderPngBatch: renderPngBatch2, pngAvailable: pngAvailable2, crawlBlockingPasses } = await loadAuthoring();
285717
+ const { buildContentBundles: buildContentBundles2, buildReleaseFromContent: buildReleaseFromContent2, bundleOutDir: bundleOutDir2, crawlScreen: crawlScreen2, crawlScreenJourney: crawlScreenJourney2, crawlScreenHostile: crawlScreenHostile2, crawlScreenRelations: crawlScreenRelations2, crawlScreenCapabilitySuccess: crawlScreenCapabilitySuccess2, crawlScreenWebView: crawlScreenWebView2, findingKey: findingKey2, startWorkerCoverage: startWorkerCoverage2, uncoveredFunctions: uncoveredFunctions2, crawlScreenDeep: crawlScreenDeep2, crawlSignature: crawlSignature2, recordScreenTraffic: recordScreenTraffic2, mintVisitor: mintVisitor2, mintOneAppVisitorToken: mintOneAppVisitorToken2, webWixCall: webWixCall2, freezeTrafficToMocks: freezeTrafficToMocks2, bootAndSnapshotState: bootAndSnapshotState2, isUnservedRequest: isUnservedRequest2, renderDescriptorWeb: renderDescriptorWeb2, renderPngBatch: renderPngBatch2, pngAvailable: pngAvailable2, crawlBlockingPasses } = await loadAuthoring();
284580
285718
  const { readTestConfig: readTestConfig2, runCrawl: runCrawl2, formatReport: formatReport2, readCannedResponses: readCannedResponses2, makeRecordingWixCall: makeRecordingWixCall2, runRecordPass: runRecordPass2, runShotsPass: runShotsPass2, defaultNetRules: defaultNetRules2, readNetRules: readNetRules2, scopeDescriptors: scopeDescriptors2, writeRecordedMocks: writeRecordedMocks2 } = await Promise.resolve().then(() => (init_test(), test_exports));
284581
285719
  let config;
284582
285720
  let capturedConfig;
@@ -284634,6 +285772,10 @@ async function testCommand(ctx) {
284634
285772
  io2.error(JSON.stringify({ error: "--record writes dev/net-mocks.json and the crawl then reads it \u2014 an explicit --net would shadow what was just recorded; drop one of the flags" }));
284635
285773
  return 2;
284636
285774
  }
285775
+ if (flags["webview-live"] === true && (flags.offline === true || flags["no-webview-pages"] === true)) {
285776
+ io2.error(JSON.stringify({ code: "invalid_usage", error: `--webview-live loads url WebView pages from the live network; it cannot be combined with ${flags.offline === true ? "--offline" : "--no-webview-pages"}` }));
285777
+ return 2;
285778
+ }
284637
285779
  let nativeAvailabilities = [];
284638
285780
  if (flags.native !== void 0) {
284639
285781
  if (flags.browser === true) {
@@ -284676,7 +285818,7 @@ async function testCommand(ctx) {
284676
285818
  );
284677
285819
  if (flags.browser === true) {
284678
285820
  const { runBrowserAuthoring: runBrowserAuthoring2, collectWorkerSources: collectWorkerSources2, collectSdkModules: collectSdkModules2, sdkSubpathReader: sdkSubpathReader2 } = await Promise.resolve().then(() => (init_browser_authoring(), browser_authoring_exports));
284679
- const ignored = ["record", "net", "offline", "no-hostile", "deep", "budget", "no-shots", "native"].filter((f2) => flags[f2] !== void 0);
285821
+ const ignored = ["record", "net", "offline", "no-hostile", "deep", "budget", "no-shots", "native", "no-webview-pages", "webview-live"].filter((f2) => flags[f2] !== void 0);
284680
285822
  if (ignored.length) {
284681
285823
  io2.error(JSON.stringify({
284682
285824
  error: `--browser cannot honour ${ignored.map((f2) => `--${f2}`).join(", ")}: the loop runs in the page, which has its own data layers and no record pass. Drop ${ignored.length > 1 ? "them" : "it"} or drop --browser.`
@@ -284829,8 +285971,10 @@ async function testCommand(ctx) {
284829
285971
  const appServices = appLevelServices2(dir);
284830
285972
  let result;
284831
285973
  io2.checkpoint?.("checking");
285974
+ const webviewPages = flags["no-webview-pages"] === true ? null : await lazyWebViewPageDriver();
284832
285975
  try {
284833
285976
  result = await runCrawl2({
285977
+ ...webviewPages ? { webviewPages: { driver: webviewPages.driver, live: flags["webview-live"] === true, ...budgetMs ? { budgetMs: Math.max(budgetMs, 1500) } : {} } } : {},
284834
285978
  ...captureInputEvidence ? { captureInputEvidence: true } : {},
284835
285979
  dir,
284836
285980
  app: app2,
@@ -284857,11 +286001,13 @@ async function testCommand(ctx) {
284857
286001
  ...deep ? { deep } : {},
284858
286002
  ...offline ? { offline: true } : {},
284859
286003
  ...offline || flags["no-hostile"] === true ? { hostile: false } : {},
284860
- deps: { crawlScreen: crawlScreen2, crawlScreenJourney: crawlScreenJourney2, crawlScreenHostile: crawlScreenHostile2, crawlScreenRelations: crawlScreenRelations2, crawlScreenCapabilitySuccess: crawlScreenCapabilitySuccess2, findingKey: findingKey2, startWorkerCoverage: startWorkerCoverage2, uncoveredFunctions: uncoveredFunctions2, crawlScreenDeep: crawlScreenDeep2, crawlSignature: crawlSignature2 }
286004
+ deps: { crawlScreen: crawlScreen2, crawlScreenJourney: crawlScreenJourney2, crawlScreenHostile: crawlScreenHostile2, crawlScreenRelations: crawlScreenRelations2, crawlScreenCapabilitySuccess: crawlScreenCapabilitySuccess2, crawlScreenWebView: crawlScreenWebView2, findingKey: findingKey2, startWorkerCoverage: startWorkerCoverage2, uncoveredFunctions: uncoveredFunctions2, crawlScreenDeep: crawlScreenDeep2, crawlSignature: crawlSignature2 }
284861
286005
  });
284862
286006
  } catch (e2) {
284863
286007
  io2.error(JSON.stringify({ error: e2.message }));
284864
286008
  return 2;
286009
+ } finally {
286010
+ await webviewPages?.close();
284865
286011
  }
284866
286012
  const release4 = await loadReleaseFromDir(app2, out2);
284867
286013
  if (nativeAvailabilities.length > 0) {
@@ -285011,6 +286157,28 @@ ${[...afterRun.next, ...testReminder ? [testReminder] : []].join("\n")}`);
285011
286157
  if (result.navGraph) await leaveForBoard(dir, "map", result.navGraph);
285012
286158
  return result.ok ? 0 : 1;
285013
286159
  }
286160
+ async function lazyWebViewPageDriver() {
286161
+ let mod;
286162
+ try {
286163
+ mod = await Promise.resolve().then(() => (init_webview_page_driver(), webview_page_driver_exports));
286164
+ } catch {
286165
+ return null;
286166
+ }
286167
+ let launched = null;
286168
+ const real = () => launched ??= mod.createWebViewPageDriver();
286169
+ return {
286170
+ driver: {
286171
+ async open(spec) {
286172
+ const d2 = await real();
286173
+ if (!d2) throw new Error("no headless browser \u2014 install the CLI's Playwright Chromium (the --shots ledger names the command), or pass --no-webview-pages");
286174
+ return d2.open(spec);
286175
+ }
286176
+ },
286177
+ close: async () => {
286178
+ if (launched) await (await launched)?.close();
286179
+ }
286180
+ };
286181
+ }
285014
286182
 
285015
286183
  // src/cli.ts
285016
286184
  init_render();