@aglyn/aglyn 1.0.0-beta.217 → 1.0.0-beta.219

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 (348) hide show
  1. package/package.json +14 -14
  2. package/src/lib/app-utils/actions.d.ts +25 -374
  3. package/src/lib/app-utils/actions.js +101 -561
  4. package/src/lib/app-utils/actions.js.map +1 -1
  5. package/src/lib/app-utils/activity-presenter.d.ts +3 -3
  6. package/src/lib/app-utils/activity-presenter.js +36 -52
  7. package/src/lib/app-utils/activity-presenter.js.map +1 -1
  8. package/src/lib/app-utils/admin-audit-index.js +2 -2
  9. package/src/lib/app-utils/admin-audit-index.js.map +1 -1
  10. package/src/lib/app-utils/analytics-events.d.ts +11 -2
  11. package/src/lib/app-utils/analytics-events.js +11 -2
  12. package/src/lib/app-utils/analytics-events.js.map +1 -1
  13. package/src/lib/app-utils/analytics-provider.d.ts +182 -0
  14. package/src/lib/app-utils/analytics-provider.js +133 -0
  15. package/src/lib/app-utils/analytics-provider.js.map +1 -0
  16. package/src/lib/app-utils/api-plugins.d.ts +46 -0
  17. package/src/lib/app-utils/api-plugins.js +19 -0
  18. package/src/lib/app-utils/api-plugins.js.map +1 -1
  19. package/src/lib/app-utils/{marketplace-overrides.d.ts → artifact-overrides.d.ts} +9 -6
  20. package/src/lib/app-utils/{marketplace-overrides.js → artifact-overrides.js} +10 -7
  21. package/src/lib/app-utils/artifact-overrides.js.map +1 -0
  22. package/src/lib/app-utils/{marketplace-provenance.d.ts → artifact-provenance.d.ts} +12 -10
  23. package/src/lib/app-utils/{marketplace-provenance.js → artifact-provenance.js} +9 -7
  24. package/src/lib/app-utils/artifact-provenance.js.map +1 -0
  25. package/src/lib/app-utils/assist-credits.js +2 -1
  26. package/src/lib/app-utils/assist-credits.js.map +1 -1
  27. package/src/lib/app-utils/binding-token-catalog.d.ts +5 -13
  28. package/src/lib/app-utils/binding-token-catalog.js +17 -41
  29. package/src/lib/app-utils/binding-token-catalog.js.map +1 -1
  30. package/src/lib/app-utils/binding-tokens.js +1 -1
  31. package/src/lib/app-utils/binding-tokens.js.map +1 -1
  32. package/src/lib/app-utils/brand-support-line.d.ts +36 -0
  33. package/src/lib/app-utils/brand-support-line.js +38 -0
  34. package/src/lib/app-utils/brand-support-line.js.map +1 -0
  35. package/src/lib/app-utils/campaign-touch.d.ts +5 -5
  36. package/src/lib/app-utils/campaign-touch.js +8 -8
  37. package/src/lib/app-utils/campaign-touch.js.map +1 -1
  38. package/src/lib/app-utils/collection-entries.d.ts +2 -2
  39. package/src/lib/app-utils/collection-entries.js.map +1 -1
  40. package/src/lib/app-utils/consent-group-change.d.ts +4 -0
  41. package/src/lib/app-utils/consent-group-change.js.map +1 -1
  42. package/src/lib/app-utils/console-record-links.d.ts +10 -89
  43. package/src/lib/app-utils/console-record-links.js +3 -107
  44. package/src/lib/app-utils/console-record-links.js.map +1 -1
  45. package/src/lib/app-utils/console-routes.d.ts +16 -7
  46. package/src/lib/app-utils/console-routes.js +9 -3
  47. package/src/lib/app-utils/console-routes.js.map +1 -1
  48. package/src/lib/app-utils/contacts.d.ts +23 -1
  49. package/src/lib/app-utils/contacts.js +21 -5
  50. package/src/lib/app-utils/contacts.js.map +1 -1
  51. package/src/lib/app-utils/cross-pool-desync.d.ts +39 -0
  52. package/src/lib/app-utils/cross-pool-desync.js +47 -0
  53. package/src/lib/app-utils/cross-pool-desync.js.map +1 -0
  54. package/src/lib/app-utils/csv-upload.d.ts +29 -0
  55. package/src/lib/app-utils/csv-upload.js +29 -0
  56. package/src/lib/app-utils/csv-upload.js.map +1 -0
  57. package/src/lib/app-utils/dataset-models.d.ts +5 -5
  58. package/src/lib/app-utils/dataset-models.js +19 -2
  59. package/src/lib/app-utils/dataset-models.js.map +1 -1
  60. package/src/lib/app-utils/datasets.d.ts +65 -11
  61. package/src/lib/app-utils/datasets.js +74 -11
  62. package/src/lib/app-utils/datasets.js.map +1 -1
  63. package/src/lib/app-utils/docs-deflection.d.ts +6 -6
  64. package/src/lib/app-utils/docs-deflection.js.map +1 -1
  65. package/src/lib/app-utils/docs-help.generated.d.ts +12 -6
  66. package/src/lib/app-utils/docs-help.generated.js +21 -6
  67. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  68. package/src/lib/app-utils/docs-index.generated.d.ts +2 -2
  69. package/src/lib/app-utils/docs-index.generated.js +514 -318
  70. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  71. package/src/lib/app-utils/docs-retrieval.d.ts +3 -3
  72. package/src/lib/app-utils/docs-retrieval.js +14 -10
  73. package/src/lib/app-utils/docs-retrieval.js.map +1 -1
  74. package/src/lib/app-utils/duplicate-resource.d.ts +4 -1
  75. package/src/lib/app-utils/duplicate-resource.js +7 -4
  76. package/src/lib/app-utils/duplicate-resource.js.map +1 -1
  77. package/src/lib/app-utils/dynamic-list-rule.d.ts +1 -1
  78. package/src/lib/app-utils/dynamic-list-rule.js.map +1 -1
  79. package/src/lib/app-utils/element-ui.d.ts +1 -1
  80. package/src/lib/app-utils/element-ui.js +1 -1
  81. package/src/lib/app-utils/element-ui.js.map +1 -1
  82. package/src/lib/app-utils/email-starter-policy.js +3 -3
  83. package/src/lib/app-utils/email-starter-policy.js.map +1 -1
  84. package/src/lib/app-utils/entity-picker-context.d.ts +10 -5
  85. package/src/lib/app-utils/entity-picker-context.js.map +1 -1
  86. package/src/lib/app-utils/error-beacon.d.ts +75 -6
  87. package/src/lib/app-utils/error-beacon.js +160 -21
  88. package/src/lib/app-utils/error-beacon.js.map +1 -1
  89. package/src/lib/app-utils/expand-repeatables.d.ts +10 -10
  90. package/src/lib/app-utils/expand-repeatables.js +10 -10
  91. package/src/lib/app-utils/expand-repeatables.js.map +1 -1
  92. package/src/lib/app-utils/host-events.d.ts +82 -0
  93. package/src/lib/app-utils/host-events.js +62 -0
  94. package/src/lib/app-utils/host-events.js.map +1 -0
  95. package/src/lib/app-utils/lockdown.d.ts +33 -1
  96. package/src/lib/app-utils/lockdown.js +45 -4
  97. package/src/lib/app-utils/lockdown.js.map +1 -1
  98. package/src/lib/app-utils/margin-utilization.d.ts +4 -69
  99. package/src/lib/app-utils/margin-utilization.js +82 -69
  100. package/src/lib/app-utils/margin-utilization.js.map +1 -1
  101. package/src/lib/app-utils/node-definition-sanitizer.d.ts +16 -16
  102. package/src/lib/app-utils/node-definition-sanitizer.js +24 -20
  103. package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -1
  104. package/src/lib/app-utils/node-interactions.d.ts +7 -7
  105. package/src/lib/app-utils/node-interactions.js.map +1 -1
  106. package/src/lib/app-utils/notifications.d.ts +78 -47
  107. package/src/lib/app-utils/notifications.js +63 -44
  108. package/src/lib/app-utils/notifications.js.map +1 -1
  109. package/src/lib/app-utils/payments-configured.d.ts +8 -21
  110. package/src/lib/app-utils/payments-configured.js +8 -23
  111. package/src/lib/app-utils/payments-configured.js.map +1 -1
  112. package/src/lib/app-utils/plan-entitlements.d.ts +43 -128
  113. package/src/lib/app-utils/plan-entitlements.js +145 -304
  114. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  115. package/src/lib/app-utils/platform-brand.d.ts +10 -0
  116. package/src/lib/app-utils/platform-brand.js +14 -3
  117. package/src/lib/app-utils/platform-brand.js.map +1 -1
  118. package/src/lib/app-utils/plugin-api-rate-limit.d.ts +7 -1
  119. package/src/lib/app-utils/plugin-api-rate-limit.js +11 -3
  120. package/src/lib/app-utils/plugin-api-rate-limit.js.map +1 -1
  121. package/src/lib/app-utils/plugin-bundle-checks.js +2 -2
  122. package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -1
  123. package/src/lib/app-utils/plugin-host-events.generated.d.ts +12 -0
  124. package/src/lib/app-utils/plugin-host-events.generated.js +169 -0
  125. package/src/lib/app-utils/plugin-host-events.generated.js.map +1 -0
  126. package/src/lib/app-utils/plugin-release-flags.generated.d.ts +12 -0
  127. package/src/lib/app-utils/plugin-release-flags.generated.js +106 -0
  128. package/src/lib/app-utils/plugin-release-flags.generated.js.map +1 -0
  129. package/src/lib/app-utils/realm-host-surface.generated.js +2 -0
  130. package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -1
  131. package/src/lib/app-utils/release-flags.d.ts +14 -5
  132. package/src/lib/app-utils/release-flags.js +21 -125
  133. package/src/lib/app-utils/release-flags.js.map +1 -1
  134. package/src/lib/app-utils/repeat-sources.d.ts +9 -0
  135. package/src/lib/app-utils/repeat-sources.js.map +1 -1
  136. package/src/lib/app-utils/retained-refusals.d.ts +73 -0
  137. package/src/lib/app-utils/retained-refusals.js +186 -0
  138. package/src/lib/app-utils/retained-refusals.js.map +1 -0
  139. package/src/lib/app-utils/scope-tokens.d.ts +27 -0
  140. package/src/lib/app-utils/scope-tokens.js +61 -0
  141. package/src/lib/app-utils/scope-tokens.js.map +1 -1
  142. package/src/lib/app-utils/screen-link-context.js +3 -3
  143. package/src/lib/app-utils/screen-link-context.js.map +1 -1
  144. package/src/lib/app-utils/screen-route.d.ts +15 -0
  145. package/src/lib/app-utils/screen-route.js +21 -1
  146. package/src/lib/app-utils/screen-route.js.map +1 -1
  147. package/src/lib/app-utils/seo-audit.d.ts +132 -0
  148. package/src/lib/app-utils/seo-audit.js +246 -0
  149. package/src/lib/app-utils/seo-audit.js.map +1 -0
  150. package/src/lib/app-utils/seo-keywords.d.ts +48 -0
  151. package/src/lib/app-utils/seo-keywords.js +60 -0
  152. package/src/lib/app-utils/seo-keywords.js.map +1 -0
  153. package/src/lib/app-utils/seo-page-facts.d.ts +66 -0
  154. package/src/lib/app-utils/seo-page-facts.js +155 -0
  155. package/src/lib/app-utils/seo-page-facts.js.map +1 -0
  156. package/src/lib/app-utils/seo-site-scan.d.ts +126 -0
  157. package/src/lib/app-utils/seo-site-scan.js +162 -0
  158. package/src/lib/app-utils/seo-site-scan.js.map +1 -0
  159. package/src/lib/app-utils/seo-title-variables.js +1 -1
  160. package/src/lib/app-utils/seo-title-variables.js.map +1 -1
  161. package/src/lib/app-utils/server.d.ts +6 -9
  162. package/src/lib/app-utils/server.js +17 -27
  163. package/src/lib/app-utils/server.js.map +1 -1
  164. package/src/lib/app-utils/site-interactions.d.ts +501 -0
  165. package/src/lib/app-utils/site-interactions.js +554 -0
  166. package/src/lib/app-utils/site-interactions.js.map +1 -0
  167. package/src/lib/app-utils/{marketplace-theme.d.ts → site-theme.d.ts} +13 -2
  168. package/src/lib/app-utils/{marketplace-theme.js → site-theme.js} +5 -2
  169. package/src/lib/app-utils/site-theme.js.map +1 -0
  170. package/src/lib/app-utils/sitemap.d.ts +4 -3
  171. package/src/lib/app-utils/sitemap.js +9 -7
  172. package/src/lib/app-utils/sitemap.js.map +1 -1
  173. package/src/lib/app-utils/stale-build-error.d.ts +51 -0
  174. package/src/lib/app-utils/stale-build-error.js +100 -1
  175. package/src/lib/app-utils/stale-build-error.js.map +1 -1
  176. package/src/lib/app-utils/starter-templates.d.ts +20 -0
  177. package/src/lib/app-utils/starter-templates.js +49 -0
  178. package/src/lib/app-utils/starter-templates.js.map +1 -1
  179. package/src/lib/app-utils/tax-jurisdiction-figures.d.ts +118 -0
  180. package/src/lib/app-utils/tax-jurisdiction-figures.js +123 -0
  181. package/src/lib/app-utils/tax-jurisdiction-figures.js.map +1 -0
  182. package/src/lib/app-utils/theme-library.d.ts +10 -3
  183. package/src/lib/app-utils/theme-library.js +13 -4
  184. package/src/lib/app-utils/theme-library.js.map +1 -1
  185. package/src/lib/app-utils/{campaign-attribution.d.ts → utm-attribution.d.ts} +11 -6
  186. package/src/lib/app-utils/{campaign-attribution.js → utm-attribution.js} +13 -8
  187. package/src/lib/app-utils/utm-attribution.js.map +1 -0
  188. package/src/lib/app-utils/{campaign-forwarding.d.ts → utm-forwarding.d.ts} +14 -14
  189. package/src/lib/app-utils/{campaign-forwarding.js → utm-forwarding.js} +26 -26
  190. package/src/lib/app-utils/utm-forwarding.js.map +1 -0
  191. package/src/lib/app-utils/video-object.js +6 -5
  192. package/src/lib/app-utils/video-object.js.map +1 -1
  193. package/src/lib/app-utils/visitor-consent.d.ts +41 -164
  194. package/src/lib/app-utils/visitor-consent.js +66 -277
  195. package/src/lib/app-utils/visitor-consent.js.map +1 -1
  196. package/src/lib/app-utils/web-vitals-rum.d.ts +7 -7
  197. package/src/lib/app-utils/web-vitals-rum.js +31 -63
  198. package/src/lib/app-utils/web-vitals-rum.js.map +1 -1
  199. package/src/lib/app-utils/where-used.d.ts +11 -6
  200. package/src/lib/app-utils/where-used.js +3 -8
  201. package/src/lib/app-utils/where-used.js.map +1 -1
  202. package/src/lib/canvas-manager/canvas-manager.js +3 -3
  203. package/src/lib/canvas-manager/canvas-manager.js.map +1 -1
  204. package/src/lib/foundation/definitions/components.types.d.ts +1 -1
  205. package/src/lib/foundation/definitions/components.types.js +1 -1
  206. package/src/lib/foundation/definitions/components.types.js.map +1 -1
  207. package/src/lib/foundation/definitions/org-billing.types.d.ts +18 -135
  208. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
  209. package/src/lib/foundation/definitions/organization.types.d.ts +6 -3
  210. package/src/lib/foundation/definitions/organization.types.js.map +1 -1
  211. package/src/lib/foundation/definitions/platform.types.d.ts +27 -5
  212. package/src/lib/foundation/definitions/platform.types.js.map +1 -1
  213. package/src/lib/foundation/definitions/write-deny-coverage.util.d.ts +16 -0
  214. package/src/lib/foundation/definitions/write-deny-coverage.util.js +20 -0
  215. package/src/lib/foundation/definitions/write-deny-coverage.util.js.map +1 -1
  216. package/src/lib/foundation/index.d.ts +1 -1
  217. package/src/lib/foundation/index.js.map +1 -1
  218. package/src/lib/plugin-manager/besigner-documents.d.ts +96 -0
  219. package/src/lib/plugin-manager/besigner-documents.js +61 -0
  220. package/src/lib/plugin-manager/besigner-documents.js.map +1 -0
  221. package/src/lib/plugin-manager/computed-variables.d.ts +71 -0
  222. package/src/lib/plugin-manager/computed-variables.js +74 -0
  223. package/src/lib/plugin-manager/computed-variables.js.map +1 -0
  224. package/src/lib/plugin-manager/custom-fields.d.ts +29 -2
  225. package/src/lib/plugin-manager/custom-fields.js +47 -1
  226. package/src/lib/plugin-manager/custom-fields.js.map +1 -1
  227. package/src/lib/plugin-manager/feature-plugins.d.ts +292 -20
  228. package/src/lib/plugin-manager/feature-plugins.js +105 -17
  229. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  230. package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +123 -0
  231. package/src/lib/plugin-manager/first-party-plugins.generated.js +785 -14
  232. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
  233. package/src/lib/plugin-manager/plugin-activity-actions.d.ts +12 -0
  234. package/src/lib/plugin-manager/plugin-activity-actions.js +25 -0
  235. package/src/lib/plugin-manager/plugin-activity-actions.js.map +1 -1
  236. package/src/lib/plugin-manager/plugin-contributions.d.ts +1 -1
  237. package/src/lib/plugin-manager/plugin-contributions.js.map +1 -1
  238. package/src/lib/plugin-manager/plugin-declarations-repair.d.ts +36 -0
  239. package/src/lib/plugin-manager/plugin-declarations-repair.js +64 -0
  240. package/src/lib/plugin-manager/plugin-declarations-repair.js.map +1 -0
  241. package/src/lib/plugin-manager/plugin-dependents.d.ts +101 -0
  242. package/src/lib/plugin-manager/plugin-dependents.js +75 -0
  243. package/src/lib/plugin-manager/plugin-dependents.js.map +1 -0
  244. package/src/lib/plugin-manager/plugin-distribution.d.ts +55 -0
  245. package/src/lib/plugin-manager/plugin-distribution.js +45 -0
  246. package/src/lib/plugin-manager/plugin-distribution.js.map +1 -0
  247. package/src/lib/plugin-manager/plugin-host-collections.d.ts +17 -0
  248. package/src/lib/plugin-manager/plugin-host-collections.js +6 -0
  249. package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -1
  250. package/src/lib/plugin-manager/plugin-host-resources.d.ts +133 -0
  251. package/src/lib/plugin-manager/plugin-host-resources.js +52 -0
  252. package/src/lib/plugin-manager/plugin-host-resources.js.map +1 -0
  253. package/src/lib/plugin-manager/plugin-org-erasure.d.ts +28 -2
  254. package/src/lib/plugin-manager/plugin-org-erasure.js +61 -2
  255. package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -1
  256. package/src/lib/plugin-manager/plugin-plan-entitlements.d.ts +123 -0
  257. package/src/lib/plugin-manager/plugin-plan-entitlements.js +101 -0
  258. package/src/lib/plugin-manager/plugin-plan-entitlements.js.map +1 -0
  259. package/src/lib/plugin-manager/plugin-record-index.d.ts +95 -0
  260. package/src/lib/plugin-manager/plugin-record-index.js +51 -0
  261. package/src/lib/plugin-manager/plugin-record-index.js.map +1 -0
  262. package/src/lib/plugin-manager/plugin-record-written.d.ts +58 -0
  263. package/src/lib/plugin-manager/plugin-record-written.js +42 -0
  264. package/src/lib/plugin-manager/plugin-record-written.js.map +1 -0
  265. package/src/lib/plugin-manager/plugin-revenue-sources.d.ts +213 -0
  266. package/src/lib/plugin-manager/plugin-revenue-sources.js +194 -0
  267. package/src/lib/plugin-manager/plugin-revenue-sources.js.map +1 -0
  268. package/src/lib/plugin-manager/plugin-site-bundle.d.ts +145 -0
  269. package/src/lib/plugin-manager/plugin-site-bundle.js +78 -0
  270. package/src/lib/plugin-manager/plugin-site-bundle.js.map +1 -0
  271. package/src/lib/plugin-manager/plugin-site-cache.d.ts +12 -0
  272. package/src/lib/plugin-manager/plugin-site-cache.js.map +1 -1
  273. package/src/lib/plugin-manager/plugin-site-export.d.ts +81 -0
  274. package/src/lib/plugin-manager/plugin-site-export.js +40 -0
  275. package/src/lib/plugin-manager/plugin-site-export.js.map +1 -0
  276. package/src/lib/plugin-manager/plugin-sitemap-sections.d.ts +88 -0
  277. package/src/lib/plugin-manager/plugin-sitemap-sections.js +29 -0
  278. package/src/lib/plugin-manager/plugin-sitemap-sections.js.map +1 -0
  279. package/src/lib/plugin-manager/plugin-tax-profile.d.ts +20 -4
  280. package/src/lib/plugin-manager/plugin-tax-profile.js.map +1 -1
  281. package/src/lib/plugin-manager/plugin-tax-return-sources.d.ts +255 -0
  282. package/src/lib/plugin-manager/plugin-tax-return-sources.js +191 -0
  283. package/src/lib/plugin-manager/plugin-tax-return-sources.js.map +1 -0
  284. package/src/lib/plugin-manager/plugin-template-sources.d.ts +75 -0
  285. package/src/lib/plugin-manager/plugin-template-sources.js +37 -0
  286. package/src/lib/plugin-manager/plugin-template-sources.js.map +1 -0
  287. package/src/lib/plugin-manager/plugin-usage-axes.d.ts +107 -0
  288. package/src/lib/plugin-manager/plugin-usage-axes.js +107 -0
  289. package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -0
  290. package/src/lib/plugin-manager/plugin-zones.d.ts +4 -5
  291. package/src/lib/plugin-manager/plugin-zones.js.map +1 -1
  292. package/src/lib/plugin-manager/realm-host-aglyn.generated.js +2 -0
  293. package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -1
  294. package/src/lib/plugin-manager/record-captured-contact.d.ts +1 -14
  295. package/src/lib/plugin-manager/record-captured-contact.js +10 -32
  296. package/src/lib/plugin-manager/record-captured-contact.js.map +1 -1
  297. package/src/lib/plugin-manager/repeat-rows.d.ts +124 -0
  298. package/src/lib/plugin-manager/repeat-rows.js +108 -0
  299. package/src/lib/plugin-manager/repeat-rows.js.map +1 -0
  300. package/src/lib/plugin-manager/submission-record-target.d.ts +144 -0
  301. package/src/lib/plugin-manager/submission-record-target.js +125 -0
  302. package/src/lib/plugin-manager/submission-record-target.js.map +1 -0
  303. package/src/lib/plugin-manager/video-embed-provider.d.ts +108 -0
  304. package/src/lib/plugin-manager/video-embed-provider.js +165 -0
  305. package/src/lib/plugin-manager/video-embed-provider.js.map +1 -0
  306. package/src/lib/types/nodes.d.ts +2 -2
  307. package/src/lib/types/nodes.js.map +1 -1
  308. package/src/lib/app-utils/campaign-attribution.js.map +0 -1
  309. package/src/lib/app-utils/campaign-forwarding.js.map +0 -1
  310. package/src/lib/app-utils/contact-holder.d.ts +0 -68
  311. package/src/lib/app-utils/contact-holder.js +0 -129
  312. package/src/lib/app-utils/contact-holder.js.map +0 -1
  313. package/src/lib/app-utils/contact-merge.d.ts +0 -136
  314. package/src/lib/app-utils/contact-merge.js +0 -412
  315. package/src/lib/app-utils/contact-merge.js.map +0 -1
  316. package/src/lib/app-utils/crm-csv.d.ts +0 -239
  317. package/src/lib/app-utils/crm-csv.js +0 -467
  318. package/src/lib/app-utils/crm-csv.js.map +0 -1
  319. package/src/lib/app-utils/crm-digest.d.ts +0 -185
  320. package/src/lib/app-utils/crm-digest.js +0 -272
  321. package/src/lib/app-utils/crm-digest.js.map +0 -1
  322. package/src/lib/app-utils/form-dataset-binding.d.ts +0 -50
  323. package/src/lib/app-utils/form-dataset-binding.js +0 -74
  324. package/src/lib/app-utils/form-dataset-binding.js.map +0 -1
  325. package/src/lib/app-utils/list-import.d.ts +0 -158
  326. package/src/lib/app-utils/list-import.js +0 -332
  327. package/src/lib/app-utils/list-import.js.map +0 -1
  328. package/src/lib/app-utils/marketplace-listing-visibility.d.ts +0 -122
  329. package/src/lib/app-utils/marketplace-listing-visibility.js +0 -147
  330. package/src/lib/app-utils/marketplace-listing-visibility.js.map +0 -1
  331. package/src/lib/app-utils/marketplace-overrides.js.map +0 -1
  332. package/src/lib/app-utils/marketplace-provenance.js.map +0 -1
  333. package/src/lib/app-utils/marketplace-theme.js.map +0 -1
  334. package/src/lib/app-utils/marketplace-update-state.d.ts +0 -119
  335. package/src/lib/app-utils/marketplace-update-state.js +0 -132
  336. package/src/lib/app-utils/marketplace-update-state.js.map +0 -1
  337. package/src/lib/app-utils/publisher-agreement.d.ts +0 -289
  338. package/src/lib/app-utils/publisher-agreement.js +0 -321
  339. package/src/lib/app-utils/publisher-agreement.js.map +0 -1
  340. package/src/lib/app-utils/wistia-embed.d.ts +0 -104
  341. package/src/lib/app-utils/wistia-embed.js +0 -138
  342. package/src/lib/app-utils/wistia-embed.js.map +0 -1
  343. package/src/lib/app-utils/workflows.d.ts +0 -136
  344. package/src/lib/app-utils/workflows.js +0 -346
  345. package/src/lib/app-utils/workflows.js.map +0 -1
  346. package/src/lib/plugin-manager/commerce-zone-props.d.ts +0 -172
  347. package/src/lib/plugin-manager/commerce-zone-props.js +0 -31
  348. package/src/lib/plugin-manager/commerce-zone-props.js.map +0 -1
@@ -0,0 +1,554 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { resolveAuthoredEventName, sanitizeEventParams } from "./analytics-events.js";
17
+ import { sanitizeAuthorHtml } from "./author-html.js";
18
+ import { PLUGIN_INTERACTION_STEPS_DECLARED } from "../plugin-manager/first-party-plugins.generated.js";
19
+ /**
20
+ * SITE INTERACTIONS: what a published page does when a visitor does something.
21
+ *
22
+ * An interaction is a trigger and an ordered step list. The trigger names an
23
+ * event — a SITE event the page runtime watches for itself (a click, a hover,
24
+ * an element scrolled into view, exit intent), or an event raised on the
25
+ * server — narrowed by payload conditions and capped in how often it fires.
26
+ * The steps the platform knows are the ones a page carries out in the
27
+ * visitor's own browser: showing and hiding elements, opening menus and
28
+ * drawers, classes and ARIA attributes, scrolling, playing a video, an alert,
29
+ * a redirect, an analytics event, author HTML and script.
30
+ *
31
+ * An interaction is stored on the element that carries it
32
+ * (`node-interactions.ts`) or as a row of `hosts/{hostId}/actions`, and the
33
+ * same shape holds more than the platform's own steps. A plugin adds steps of
34
+ * its own — the workflows plugin's server steps, which a page hands to
35
+ * `/api/events/dispatch` for the host-event listener that owns them. The
36
+ * platform types only its own steps ({@link ClientInteractionStep}), knows any
37
+ * other step only by its `type`, and treats every step that is not one of its
38
+ * client steps as the server's to run. A plugin that wants one of its steps
39
+ * offered in the interaction builder DECLARES it, under `interactionSteps` in
40
+ * `plugins.config.json` ({@link InteractionStepDeclaration}); nothing here
41
+ * names a plugin.
42
+ */ /**
43
+ * Client-side site events (AGL-256) the tenant page runtime emits:
44
+ * element interactions, scroll behavior, dwell time, and exit intent.
45
+ * Trigger config (selector/threshold/path) rides the interaction's trigger.
46
+ */ export const SITE_EVENT_TYPES = [
47
+ 'scrollDepth',
48
+ 'scrollToElement',
49
+ 'elementClick',
50
+ 'elementVisible',
51
+ // Hover choreography (AGL-562): delegated enter/leave on the trigger
52
+ // selector — the nav-menu/drawer show-hide building blocks.
53
+ 'elementHoverEnter',
54
+ 'elementHoverLeave',
55
+ 'exitIntent',
56
+ 'timeOnPage',
57
+ 'pageVisit'
58
+ ];
59
+ /** Site events that watch a specific element and need a selector. */ export const ELEMENT_SCOPED_SITE_EVENTS = [
60
+ 'scrollToElement',
61
+ 'elementClick',
62
+ 'elementVisible',
63
+ 'elementHoverEnter',
64
+ 'elementHoverLeave'
65
+ ];
66
+ export function isSiteEventType(event) {
67
+ return SITE_EVENT_TYPES.includes(event);
68
+ }
69
+ /** Structured condition operators (AGL-557). */ export const TRIGGER_CONDITION_OPS = [
70
+ 'equals',
71
+ 'contains',
72
+ 'notEmpty'
73
+ ];
74
+ /**
75
+ * Evaluates a structured trigger condition (AGL-557). String-coerces the
76
+ * payload value; `equals`/`contains` compare trimmed + case-insensitive
77
+ * so checkbox values like "Yes" match an author-typed "yes". A missing
78
+ * field never matches (and is "empty" for `notEmpty`); an absent or
79
+ * field-less condition always passes, mirroring the filter's default.
80
+ */ export function evaluateTriggerCondition(condition, payload) {
81
+ var _condition_value;
82
+ var _condition_field;
83
+ const field = condition == null ? void 0 : (_condition_field = condition.field) == null ? void 0 : _condition_field.trim();
84
+ if (!condition || !field) return true;
85
+ const raw = (payload != null ? payload : {})[field];
86
+ const actual = (raw == null ? '' : String(raw)).trim().toLowerCase();
87
+ if (condition.op === 'notEmpty') return actual.length > 0;
88
+ const expected = String((_condition_value = condition.value) != null ? _condition_value : '').trim().toLowerCase();
89
+ if (condition.op === 'equals') return actual === expected;
90
+ if (condition.op === 'contains') {
91
+ return expected.length > 0 && actual.includes(expected);
92
+ }
93
+ return false;
94
+ }
95
+ /** How chained trigger conditions combine (AGL-565). */ export const TRIGGER_COMBINATORS = [
96
+ 'and',
97
+ 'or'
98
+ ];
99
+ /** Cap on chained conditions per trigger (AGL-565). */ export const ACTION_MAX_CONDITIONS = 5;
100
+ /**
101
+ * Normalizes a trigger's condition clauses to a list (AGL-565): the
102
+ * `conditions` array wins when present; a legacy single `condition`
103
+ * (AGL-557) becomes a one-element list. Read-time only — persisted docs
104
+ * are never migrated, so pre-565 single-condition docs keep working
105
+ * unchanged.
106
+ */ export function normalizeTriggerConditions(trigger) {
107
+ const conditions = trigger == null ? void 0 : trigger.conditions;
108
+ if (Array.isArray(conditions)) return conditions.filter(Boolean);
109
+ return (trigger == null ? void 0 : trigger.condition) ? [
110
+ trigger.condition
111
+ ] : [];
112
+ }
113
+ /**
114
+ * Evaluates a trigger's condition list with its combinator (AGL-565):
115
+ * `and` (the default) requires every condition to pass, `or` any one.
116
+ * Per-condition semantics are unchanged from AGL-557
117
+ * (`evaluateTriggerCondition`), and an empty list always passes — which
118
+ * covers every pre-565 doc without conditions.
119
+ */ export function evaluateTriggerConditions(trigger, payload) {
120
+ const conditions = normalizeTriggerConditions(trigger);
121
+ if (!conditions.length) return true;
122
+ return (trigger == null ? void 0 : trigger.combinator) === 'or' ? conditions.some((condition)=>evaluateTriggerCondition(condition, payload)) : conditions.every((condition)=>evaluateTriggerCondition(condition, payload));
123
+ }
124
+ /**
125
+ * Evaluates a step's own guard, with the trigger's semantics.
126
+ *
127
+ * An absent or clause-less guard passes, exactly as an absent trigger
128
+ * condition does — so every step written before guards existed keeps running.
129
+ */ export function evaluateStepGuard(guard, scope) {
130
+ var _ref;
131
+ const conditions = ((_ref = guard == null ? void 0 : guard.conditions) != null ? _ref : []).filter(Boolean);
132
+ if (!conditions.length) return true;
133
+ return (guard == null ? void 0 : guard.combinator) === 'or' ? conditions.some((condition)=>evaluateTriggerCondition(condition, scope)) : conditions.every((condition)=>evaluateTriggerCondition(condition, scope));
134
+ }
135
+ /** Steps the tenant page runtime executes client-side (AGL-257). */ export const CLIENT_ACTION_STEP_TYPES = new Set([
136
+ 'showOverlay',
137
+ 'stickyNav',
138
+ 'addClass',
139
+ 'removeClass',
140
+ 'toggleClass',
141
+ 'showElement',
142
+ 'hideElement',
143
+ 'toggleElement',
144
+ 'openDrawer',
145
+ 'closeDrawer',
146
+ 'toggleDrawer',
147
+ 'openMenu',
148
+ 'closeMenu',
149
+ 'toggleMenu',
150
+ 'setAttribute',
151
+ 'removeAttribute',
152
+ 'scrollTo',
153
+ 'playVideo',
154
+ 'showHtml',
155
+ 'runJs',
156
+ 'redirect',
157
+ 'trackGaEvent',
158
+ 'siteAlert'
159
+ ]);
160
+ export function isClientActionStep(step) {
161
+ return CLIENT_ACTION_STEP_TYPES.has(step.type);
162
+ }
163
+ /**
164
+ * Basic presentational interactions (AGL-577): the subset of client steps
165
+ * that are pure DOM choreography — menu/drawer open-close, element
166
+ * show/hide, class toggles, sticky nav, navigation, and client-only
167
+ * alerts. They carry NO server cost and touch NO data, so they run on
168
+ * every plan (the `interactions` feature, on by default everywhere).
169
+ *
170
+ * The powerful client steps stay behind the `actions` entitlement:
171
+ * `showOverlay` (marketing overlays), `showHtml` (arbitrary HTML
172
+ * injection), and `trackGaEvent` (analytics). `runJs` keeps its own
173
+ * higher `webhooks` (Business) gate. A step that is not a client step is
174
+ * the server's, and is re-checked against `actions` where it runs.
175
+ */ export const BASIC_CLIENT_ACTION_STEP_TYPES = new Set([
176
+ 'stickyNav',
177
+ 'addClass',
178
+ 'removeClass',
179
+ 'toggleClass',
180
+ 'showElement',
181
+ 'hideElement',
182
+ 'toggleElement',
183
+ 'openDrawer',
184
+ 'closeDrawer',
185
+ 'toggleDrawer',
186
+ 'openMenu',
187
+ 'closeMenu',
188
+ 'toggleMenu',
189
+ 'setAttribute',
190
+ 'removeAttribute',
191
+ // Moving the page and pressing a player the author placed: no data, no
192
+ // server, and nothing a Video element's own poster does not already do
193
+ // on every plan.
194
+ 'scrollTo',
195
+ 'playVideo',
196
+ 'redirect',
197
+ 'siteAlert'
198
+ ]);
199
+ /** A client step available on all plans (no `actions` entitlement). */ export function isBasicClientActionStep(step) {
200
+ return BASIC_CLIENT_ACTION_STEP_TYPES.has(step.type);
201
+ }
202
+ /**
203
+ * Whether a client step may run for the given entitlement tier (AGL-577).
204
+ * This is the single source of truth the page enricher uses to trim the
205
+ * client-automation payload per plan:
206
+ *
207
+ * - Basic presentational steps → always (every plan).
208
+ * - `runJs` → `allowJs` (Business `webhooks` tier).
209
+ * - Remaining advanced client steps (overlay / showHtml / analytics) →
210
+ * `actionsEntitled` (`actions` tier).
211
+ *
212
+ * Server steps are not client steps and always return false here; they
213
+ * are dispatched and re-authorized server-side.
214
+ */ export function isClientStepEntitled(step, entitlements) {
215
+ if (!isClientActionStep(step)) return false;
216
+ if (isBasicClientActionStep(step)) return true;
217
+ if (step.type === 'runJs') return entitlements.allowJs;
218
+ return entitlements.actionsEntitled;
219
+ }
220
+ /** The longest step list an interaction may hold. */ export const ACTION_MAX_STEPS = 10;
221
+ /**
222
+ * Cap on the parameters one `trackGaEvent` step may carry (AGL-1587).
223
+ *
224
+ * Not a storage concern. These pairs are the least trustworthy analytics
225
+ * input on the platform — both halves are typed by a site author and land in
226
+ * that site's own GA4 property — and a bounded list is one an author can read
227
+ * back in full before publishing, which is the only review a parameter ever
228
+ * gets. GA4 caps custom parameters per event as well and drops the overflow
229
+ * without saying so, so an unbounded editor would let an author configure
230
+ * parameters that are never delivered and never explained. Ten, the same
231
+ * ceiling {@link ACTION_MAX_STEPS} puts on the step list itself.
232
+ */ export const ACTION_MAX_EVENT_PARAMS = 10;
233
+ /**
234
+ * Longest analytics parameter NAME GA4 accepts; it drops a longer one on
235
+ * arrival, so a name over this is silence rather than a truncated dimension.
236
+ * The value half is capped by `ANALYTICS_PARAM_MAX_LENGTH`, which truncates
237
+ * instead of dropping.
238
+ */ export const ACTION_EVENT_PARAM_NAME_MAX_LENGTH = 40;
239
+ /** Self-dismiss triggers for shown elements (AGL-589). */ export const ELEMENT_DISMISS_OPTIONS = [
240
+ 'escape',
241
+ 'outsideClick'
242
+ ];
243
+ /** Visibility grace-delay ceiling — enough for hover travel, no dead UIs. */ export const ELEMENT_VISIBILITY_MAX_DELAY_MS = 5000;
244
+ /**
245
+ * How a `scrollTo` step moves the page. Stored in documents; never rename a
246
+ * value. `instant` rather than the DOM's `auto`, because `auto` defers to the
247
+ * site's CSS `scroll-behavior` — a site that sets `smooth` there would animate
248
+ * a scroll the author asked to be instant.
249
+ */ export const SCROLL_TO_BEHAVIORS = [
250
+ 'smooth',
251
+ 'instant'
252
+ ];
253
+ /**
254
+ * The largest offset a `scrollTo` step may leave above its target.
255
+ *
256
+ * The offset exists to clear a sticky header, which is tens of pixels and
257
+ * rarely more than a few hundred with an announcement bar stacked on it. A
258
+ * thousand leaves room for any header while still refusing the extra digit
259
+ * that would park the target off the bottom of the screen.
260
+ */ export const SCROLL_TO_MAX_OFFSET_PX = 1000;
261
+ /** Custom event names: short, no collision with built-ins. */ export const CUSTOM_EVENT_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]{1,39}$/;
262
+ /**
263
+ * The attribute names an interaction may write (AGL-2546).
264
+ *
265
+ * An unrestricted attribute setter is a self-XSS vector authored through the
266
+ * interactions UI: it reaches `href`, `src`, `onclick`, `formaction` and
267
+ * `style`, and on a site with collaborators the author and the victim need
268
+ * not be the same person. `aria-*` and `data-*` carry the entire
269
+ * accessibility use case and none of that exposure.
270
+ *
271
+ * Deliberately NOT solved by an entitlement gate. `runJs` is Business-gated
272
+ * because it is dangerous at any tier; this has to work on every plan,
273
+ * because a screen-reader user's access to a menu is not a paid feature.
274
+ */ export const INTERACTION_ATTRIBUTE_NAME_PATTERN = /^(?:aria|data)-[a-z][a-z0-9-]*$/;
275
+ /**
276
+ * Whether an interaction is allowed to write this attribute name.
277
+ *
278
+ * Case-insensitive because HTML attribute names are, and a rejected name is
279
+ * a no-op rather than an error: a step that cannot run must not break the
280
+ * steps after it in the same interaction.
281
+ */ export function isInteractionAttributeAllowed(name) {
282
+ return typeof name === 'string' && INTERACTION_ATTRIBUTE_NAME_PATTERN.test(name.trim().toLowerCase());
283
+ }
284
+ /** Every step the first-party plugins declare, in `plugins.config.json` order. */ export function declaredInteractionSteps() {
285
+ return PLUGIN_INTERACTION_STEPS_DECLARED;
286
+ }
287
+ /** The declared step of this type, or `null` for one no plugin declares. */ export function declaredInteractionStep(type, declarations = PLUGIN_INTERACTION_STEPS_DECLARED) {
288
+ var _declarations_find;
289
+ return (_declarations_find = declarations.find((declaration)=>declaration.type === type)) != null ? _declarations_find : null;
290
+ }
291
+ /**
292
+ * Validates an interaction's shape; returns a human-readable error or null.
293
+ * Every surface that writes one shares this, so a bad step never persists or
294
+ * runs.
295
+ *
296
+ * The platform checks what is its own: the name, the trigger and its
297
+ * conditions, the step count, each step's guard, its client steps, and the
298
+ * pick of every declared step that picks a record. A step it does not know is
299
+ * left to its owner, through `validateStep`.
300
+ */ export function validateInteraction(interaction, options = {}) {
301
+ var _ref, _interaction_steps;
302
+ var _interaction_name, _interaction_trigger_event, _interaction_trigger, _interaction_trigger_selector, _interaction_trigger1, _interaction_trigger2, _interaction_trigger3, _interaction_trigger4;
303
+ if (!((_interaction_name = interaction.name) == null ? void 0 : _interaction_name.trim())) return 'Name the action';
304
+ const event = (_ref = (_interaction_trigger = interaction.trigger) == null ? void 0 : (_interaction_trigger_event = _interaction_trigger.event) == null ? void 0 : _interaction_trigger_event.trim()) != null ? _ref : '';
305
+ if (!event) return 'Pick a trigger event';
306
+ // A server event or a custom one fired by another step is, like a site
307
+ // event, a name; every built-in server event fits the custom pattern.
308
+ if (!isSiteEventType(event) && !CUSTOM_EVENT_PATTERN.test(event)) {
309
+ return 'Custom event names are 2–40 letters, digits, dashes';
310
+ }
311
+ // Site-event trigger config (AGL-256; hover events AGL-562).
312
+ if (ELEMENT_SCOPED_SITE_EVENTS.includes(event) && !((_interaction_trigger1 = interaction.trigger) == null ? void 0 : (_interaction_trigger_selector = _interaction_trigger1.selector) == null ? void 0 : _interaction_trigger_selector.trim())) {
313
+ return 'This trigger needs a CSS selector';
314
+ }
315
+ if ([
316
+ 'scrollDepth',
317
+ 'timeOnPage'
318
+ ].includes(event) && !(Number((_interaction_trigger2 = interaction.trigger) == null ? void 0 : _interaction_trigger2.threshold) > 0)) {
319
+ return event === 'scrollDepth' ? 'Set the scroll percentage (1–100)' : 'Set the seconds on page';
320
+ }
321
+ // Frequency caps (AGL-274).
322
+ if (((_interaction_trigger3 = interaction.trigger) == null ? void 0 : _interaction_trigger3.cooldownMinutes) != null && !(Number(interaction.trigger.cooldownMinutes) >= 1)) {
323
+ return 'Cooldown must be at least 1 minute';
324
+ }
325
+ // Structured payload conditions (AGL-557; chained AGL-565).
326
+ const combinator = (_interaction_trigger4 = interaction.trigger) == null ? void 0 : _interaction_trigger4.combinator;
327
+ if (combinator != null && !TRIGGER_COMBINATORS.includes(combinator)) {
328
+ return 'Combine conditions with AND or OR';
329
+ }
330
+ const conditions = normalizeTriggerConditions(interaction.trigger);
331
+ if (conditions.length > ACTION_MAX_CONDITIONS) {
332
+ return `Conditions are capped at ${ACTION_MAX_CONDITIONS}`;
333
+ }
334
+ for (const [index, condition] of conditions.entries()){
335
+ var _condition_field, _condition_value;
336
+ // Single-condition messages stay exactly as AGL-557 shipped them;
337
+ // the row marker only appears once there are rows to tell apart.
338
+ const where = conditions.length > 1 ? ` (condition ${index + 1})` : '';
339
+ if (!TRIGGER_CONDITION_OPS.includes(condition.op)) {
340
+ return `Pick a condition operator${where}`;
341
+ }
342
+ if (!((_condition_field = condition.field) == null ? void 0 : _condition_field.trim())) {
343
+ return `Name the field the condition checks${where}`;
344
+ }
345
+ if (condition.op !== 'notEmpty' && !((_condition_value = condition.value) == null ? void 0 : _condition_value.trim())) {
346
+ return `Enter the value the condition compares against${where}`;
347
+ }
348
+ }
349
+ const steps = (_interaction_steps = interaction.steps) != null ? _interaction_steps : [];
350
+ if (!steps.length) return 'Add at least one step';
351
+ if (steps.length > ACTION_MAX_STEPS) {
352
+ return `Actions are capped at ${ACTION_MAX_STEPS} steps`;
353
+ }
354
+ for (const [index, step] of steps.entries()){
355
+ var _ref1;
356
+ var _step_when, _step_when1;
357
+ const label = `Step ${index + 1}`;
358
+ // A step's own guard, checked with the same messages the trigger's
359
+ // clauses get — one condition editor, one set of complaints about it.
360
+ const guardClauses = ((_ref1 = (_step_when = step.when) == null ? void 0 : _step_when.conditions) != null ? _ref1 : []).filter(Boolean);
361
+ if (guardClauses.length > ACTION_MAX_CONDITIONS) {
362
+ return `${label}: conditions are capped at ${ACTION_MAX_CONDITIONS}`;
363
+ }
364
+ if (((_step_when1 = step.when) == null ? void 0 : _step_when1.combinator) != null && !TRIGGER_COMBINATORS.includes(step.when.combinator)) {
365
+ return `${label}: combine conditions with AND or OR`;
366
+ }
367
+ for (const clause of guardClauses){
368
+ var _clause_field, _clause_value;
369
+ if (!TRIGGER_CONDITION_OPS.includes(clause.op)) {
370
+ return `${label}: pick a condition operator`;
371
+ }
372
+ if (!((_clause_field = clause.field) == null ? void 0 : _clause_field.trim())) {
373
+ return `${label}: name the field the condition checks`;
374
+ }
375
+ if (clause.op !== 'notEmpty' && !((_clause_value = clause.value) == null ? void 0 : _clause_value.trim())) {
376
+ return `${label}: enter the value the condition compares against`;
377
+ }
378
+ }
379
+ const owned = options.validateStep == null ? void 0 : options.validateStep.call(options, step, label);
380
+ if (owned) return owned;
381
+ const declared = declaredInteractionStep(step.type, options.declarations);
382
+ if (declared == null ? void 0 : declared.picks) {
383
+ const id = step[declared.picks.idField];
384
+ const name = step[declared.picks.nameField];
385
+ if (!(typeof id === 'string' && id.trim()) && !(typeof name === 'string' && name.trim())) {
386
+ return `${label}: ${declared.picks.missing}`;
387
+ }
388
+ }
389
+ if (isClientActionStep(step)) {
390
+ const problem = clientStepProblem(step, label);
391
+ if (problem) return problem;
392
+ }
393
+ }
394
+ return null;
395
+ }
396
+ /** A client step's own complaint, or null. The step's guard is checked by the caller. */ function clientStepProblem(step, label) {
397
+ var _step_message, _step_selector, _step_selector1, _step_code, _step_url;
398
+ if (step.type === 'siteAlert' && !((_step_message = step.message) == null ? void 0 : _step_message.trim())) {
399
+ return `${label}: enter the alert message`;
400
+ }
401
+ if (step.type === 'addClass' || step.type === 'removeClass' || step.type === 'toggleClass') {
402
+ var _step_selector2, _step_className;
403
+ if (!((_step_selector2 = step.selector) == null ? void 0 : _step_selector2.trim())) return `${label}: enter a CSS selector`;
404
+ if (!((_step_className = step.className) == null ? void 0 : _step_className.trim())) return `${label}: enter the class name`;
405
+ }
406
+ // Element show/hide steps (AGL-562) always target a selector; drawer
407
+ // (AGL-562) and menu (AGL-568) commands may omit the target (the
408
+ // page's first drawer/menu answers).
409
+ if ((step.type === 'showElement' || step.type === 'hideElement' || step.type === 'toggleElement') && !((_step_selector = step.selector) == null ? void 0 : _step_selector.trim())) {
410
+ return `${label}: pick the element to show or hide`;
411
+ }
412
+ if (step.type === 'showElement' || step.type === 'hideElement' || step.type === 'toggleElement') {
413
+ // Choreography options (AGL-589).
414
+ const delay = step.delayMs;
415
+ if (delay != null && !(Number.isInteger(delay) && delay >= 0 && delay <= ELEMENT_VISIBILITY_MAX_DELAY_MS)) {
416
+ return `${label}: delay must be 0–${ELEMENT_VISIBILITY_MAX_DELAY_MS}ms`;
417
+ }
418
+ const dismiss = step.dismissOn;
419
+ if (dismiss != null && !(Array.isArray(dismiss) && dismiss.every((option)=>ELEMENT_DISMISS_OPTIONS.includes(option)))) {
420
+ return `${label}: dismiss options are escape and outsideClick`;
421
+ }
422
+ }
423
+ // One-target steps (AGL-2867). The runtime does nothing for a target it
424
+ // cannot find, so a missing one is refused here, where it can be fixed.
425
+ if (step.type === 'scrollTo') {
426
+ var _step_selector3;
427
+ if (!((_step_selector3 = step.selector) == null ? void 0 : _step_selector3.trim())) {
428
+ return `${label}: pick the element to scroll to`;
429
+ }
430
+ const behavior = step.behavior;
431
+ if (behavior != null && !SCROLL_TO_BEHAVIORS.includes(behavior)) {
432
+ return `${label}: scroll smoothly or instantly`;
433
+ }
434
+ const offset = step.offsetPx;
435
+ if (offset != null && !(Number.isInteger(offset) && offset >= 0 && offset <= SCROLL_TO_MAX_OFFSET_PX)) {
436
+ return `${label}: the offset must be 0–${SCROLL_TO_MAX_OFFSET_PX}px`;
437
+ }
438
+ }
439
+ if (step.type === 'playVideo' && !((_step_selector1 = step.selector) == null ? void 0 : _step_selector1.trim())) {
440
+ return `${label}: pick the video to play`;
441
+ }
442
+ if (step.type === 'showHtml') {
443
+ var _step_html;
444
+ if (!((_step_html = step.html) == null ? void 0 : _step_html.trim())) return `${label}: enter the HTML`;
445
+ // AGL-2486: the author-facing half of the runtime sanitizer, exactly as
446
+ // the reserved analytics name below is the author-facing half of the
447
+ // runtime refusal. `site-runtime.tsx` runs this HTML through
448
+ // `sanitizeAuthorHtml` for a VISITOR, where the only thing it can do
449
+ // with markup it refuses is drop it and say nothing — so an author who
450
+ // pastes an embed snippet gets a step that runs, reports success, and
451
+ // shows nothing. The refusal is reported HERE, where the person who
452
+ // can fix it is looking, and it is the SAME function that will run at
453
+ // render rather than a second description of its rules.
454
+ const removals = [];
455
+ const safe = sanitizeAuthorHtml(step.html, removals);
456
+ if (!safe.trim()) {
457
+ var _ref;
458
+ var _removals_;
459
+ return `${label}: none of this HTML can be shown on a published page — ${(_ref = (_removals_ = removals[0]) == null ? void 0 : _removals_.message) != null ? _ref : 'it is removed by the sanitizer.'}`;
460
+ }
461
+ if (removals.length) {
462
+ return `${label}: ${removals[0].message}${removals.length > 1 ? ` (+${removals.length - 1} more)` : ''}`;
463
+ }
464
+ }
465
+ if (step.type === 'runJs' && !((_step_code = step.code) == null ? void 0 : _step_code.trim())) {
466
+ return `${label}: enter the JavaScript`;
467
+ }
468
+ if (step.type === 'redirect' && !((_step_url = step.url) == null ? void 0 : _step_url.trim()) && !step.screenId) {
469
+ return `${label}: pick a page or enter the destination URL`;
470
+ }
471
+ if (step.type === 'trackGaEvent') {
472
+ var _step_params, _step_params1;
473
+ var _step_eventName;
474
+ if (!((_step_eventName = step.eventName) == null ? void 0 : _step_eventName.trim())) {
475
+ return `${label}: name the analytics event`;
476
+ }
477
+ // AGL-1587: the author-facing half of the runtime refusal. The runtime
478
+ // can only drop a bad name silently — it is executing for a VISITOR —
479
+ // so the name is checked HERE, where the person who can fix it is.
480
+ const resolved = resolveAuthoredEventName(step.eventName);
481
+ if (resolved.reason === 'reserved') {
482
+ return `${label}: "${step.eventName.trim()}" is a reserved analytics event name — pick another`;
483
+ }
484
+ if (!resolved.name) {
485
+ return `${label}: the analytics event name must start with a letter`;
486
+ }
487
+ const params = Object.entries((_step_params = step.params) != null ? _step_params : {});
488
+ if (params.length > ACTION_MAX_EVENT_PARAMS) {
489
+ return `${label}: analytics parameters are capped at ${ACTION_MAX_EVENT_PARAMS}`;
490
+ }
491
+ for (const [key, value] of params){
492
+ if (!key.trim()) return `${label}: name every analytics parameter`;
493
+ if (key.trim().length > ACTION_EVENT_PARAM_NAME_MAX_LENGTH) {
494
+ return `${label}: the "${key.trim().slice(0, 16)}…" parameter name is over ${ACTION_EVENT_PARAM_NAME_MAX_LENGTH} characters, which GA4 drops`;
495
+ }
496
+ if (!String(value != null ? value : '').trim()) {
497
+ return `${label}: enter a value for the "${key.trim()}" parameter`;
498
+ }
499
+ }
500
+ // The author-facing half of the runtime sanitizer, the same shape the
501
+ // reserved name above and the `showHtml` check take. `trackAuthoredEvent`
502
+ // strips a parameter that can carry personal data and says nothing about
503
+ // it, because it is executing for a VISITOR — so an author who binds a
504
+ // form field into a parameter gets a step that runs, reports success,
505
+ // and delivers an event missing the dimension it was created for. The
506
+ // strip is reported HERE, by running the REAL `sanitizeEventParams`
507
+ // rather than a second description of its rules, so the two can never
508
+ // disagree about which parameter survives.
509
+ const kept = sanitizeEventParams((_step_params1 = step.params) != null ? _step_params1 : undefined);
510
+ const stripped = params.find(([key])=>!(key in kept));
511
+ if (stripped) {
512
+ return `${label}: the "${stripped[0]}" parameter is never sent — an analytics parameter must not carry a visitor's own details`;
513
+ }
514
+ }
515
+ return null;
516
+ }
517
+ /**
518
+ * How many LIVE action documents one host may hold (AGL-2266).
519
+ *
520
+ * `hosts/{hostId}/actions` was in NO exclusion list in
521
+ * `cloud/firebase-firestore.rules`, so the host catch-all's `allow create`
522
+ * granted it to any editor, client-direct, on any plan — and the import
523
+ * route's own table said so in as many words: *"no `RESOURCES` entry and no
524
+ * quota key anywhere; all three creators write the document client-direct."*
525
+ * A free org could therefore mint unbounded Firestore documents from the
526
+ * browser against a $0 subscription. Unbounded infrastructure, not a bypass of
527
+ * anything we sell, which is `WEBHOOK_MAX_PER_HOST`'s (AGL-1360) and
528
+ * `NON_PAGE_SCREEN_MAX_PER_HOST`'s (AGL-1399) shape exactly: a flat PLATFORM
529
+ * cap with no `OrgEntitlements` key, no variation by plan, and nothing on the
530
+ * price list to explain.
531
+ *
532
+ * ## Not gated on the `actions` entitlement, deliberately
533
+ *
534
+ * `actions` is a Pro feature and `interactions` is free, and BOTH write this
535
+ * collection — the interaction builder and the besigner's preset wiring create
536
+ * the same document type the Pro actions card does. Gating creation on the
537
+ * paid flag would take element interactions away from every free and starter
538
+ * site, which is a pricing change wearing a cap's clothes. The runtime already
539
+ * checks the entitlement where it decides what may RUN
540
+ * (`run-event-actions.ts`), which is the right place for it.
541
+ *
542
+ * ## Why 500
543
+ *
544
+ * Sized to the busiest plausible site rather than to today's data. An action
545
+ * is authored per interactive element, so a heavy marketing site with dropdown
546
+ * choreography on every section reaches tens; presets wire a handful at a
547
+ * time. 500 is far past anything authoring produces and well short of what a
548
+ * script in a loop wants, which is the only property a flat cap needs. Live
549
+ * documents only — the interactions provider soft-deletes with `deletedAt`, so
550
+ * counting tombstones would be AGL-1173's bug one collection over, where
551
+ * removing an interaction never frees its slot.
552
+ */ export const ACTIONS_MAX_PER_HOST = 500;
553
+
554
+ //# sourceMappingURL=site-interactions.js.map