@botonic/plugin-flow-builder 0.55.2 → 0.57.0-rslib-esm.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 (565) hide show
  1. package/lib/esm/action/ai-agent-from-user-input.d.ts +2 -2
  2. package/lib/esm/action/ai-agent-from-user-input.js +9 -6
  3. package/lib/esm/action/ai-agent-from-user-input.js.map +1 -1
  4. package/lib/esm/action/context.d.ts +2 -2
  5. package/lib/esm/action/context.js +9 -6
  6. package/lib/esm/action/context.js.map +1 -1
  7. package/lib/esm/action/fallback.d.ts +2 -2
  8. package/lib/esm/action/fallback.js +16 -11
  9. package/lib/esm/action/fallback.js.map +1 -1
  10. package/lib/esm/action/first-interaction.d.ts +2 -2
  11. package/lib/esm/action/first-interaction.js +39 -27
  12. package/lib/esm/action/first-interaction.js.map +1 -1
  13. package/lib/esm/action/get-contents.d.ts +1 -1
  14. package/lib/esm/action/get-contents.js +37 -20
  15. package/lib/esm/action/get-contents.js.map +1 -1
  16. package/lib/esm/action/index.d.ts +1 -1
  17. package/lib/esm/action/index.js +68 -32
  18. package/lib/esm/action/index.js.map +1 -1
  19. package/lib/esm/action/payload.d.ts +2 -2
  20. package/lib/esm/action/payload.js +27 -23
  21. package/lib/esm/action/payload.js.map +1 -1
  22. package/lib/esm/api.d.ts +2 -2
  23. package/lib/esm/api.js +55 -44
  24. package/lib/esm/api.js.map +1 -1
  25. package/lib/esm/constants.js +16 -18
  26. package/lib/esm/constants.js.map +1 -1
  27. package/lib/esm/content-fields/content-fields-base.d.ts +2 -2
  28. package/lib/esm/content-fields/content-fields-base.js +33 -29
  29. package/lib/esm/content-fields/content-fields-base.js.map +1 -1
  30. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +1 -1
  31. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +35 -33
  32. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -1
  33. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +1 -1
  34. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +15 -15
  35. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -1
  36. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +2 -2
  37. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +50 -35
  38. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -1
  39. package/lib/esm/content-fields/flow-ai-agent-base.d.ts +4 -4
  40. package/lib/esm/content-fields/flow-ai-agent-base.js +50 -43
  41. package/lib/esm/content-fields/flow-ai-agent-base.js.map +1 -1
  42. package/lib/esm/content-fields/flow-ai-agent-router.d.ts +5 -5
  43. package/lib/esm/content-fields/flow-ai-agent-router.js +57 -46
  44. package/lib/esm/content-fields/flow-ai-agent-router.js.map +1 -1
  45. package/lib/esm/content-fields/flow-ai-agent.d.ts +4 -4
  46. package/lib/esm/content-fields/flow-ai-agent.js +33 -22
  47. package/lib/esm/content-fields/flow-ai-agent.js.map +1 -1
  48. package/lib/esm/content-fields/flow-bot-action.d.ts +3 -3
  49. package/lib/esm/content-fields/flow-bot-action.js +23 -15
  50. package/lib/esm/content-fields/flow-bot-action.js.map +1 -1
  51. package/lib/esm/content-fields/flow-button.d.ts +5 -5
  52. package/lib/esm/content-fields/flow-button.js +48 -29
  53. package/lib/esm/content-fields/flow-button.js.map +1 -1
  54. package/lib/esm/content-fields/flow-capture-user-input.d.ts +2 -2
  55. package/lib/esm/content-fields/flow-capture-user-input.js +24 -23
  56. package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -1
  57. package/lib/esm/content-fields/flow-carousel.d.ts +4 -4
  58. package/lib/esm/content-fields/flow-carousel.js +99 -58
  59. package/lib/esm/content-fields/flow-carousel.js.map +1 -1
  60. package/lib/esm/content-fields/flow-channel-conditional.d.ts +3 -3
  61. package/lib/esm/content-fields/flow-channel-conditional.js +26 -22
  62. package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -1
  63. package/lib/esm/content-fields/flow-country-conditional.d.ts +3 -3
  64. package/lib/esm/content-fields/flow-country-conditional.js +26 -21
  65. package/lib/esm/content-fields/flow-country-conditional.js.map +1 -1
  66. package/lib/esm/content-fields/flow-custom-conditional.d.ts +3 -3
  67. package/lib/esm/content-fields/flow-custom-conditional.js +31 -33
  68. package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -1
  69. package/lib/esm/content-fields/flow-element.d.ts +4 -4
  70. package/lib/esm/content-fields/flow-element.js +37 -20
  71. package/lib/esm/content-fields/flow-element.js.map +1 -1
  72. package/lib/esm/content-fields/flow-go-to-flow.d.ts +3 -3
  73. package/lib/esm/content-fields/flow-go-to-flow.js +25 -20
  74. package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -1
  75. package/lib/esm/content-fields/flow-handoff.d.ts +3 -3
  76. package/lib/esm/content-fields/flow-handoff.js +30 -19
  77. package/lib/esm/content-fields/flow-handoff.js.map +1 -1
  78. package/lib/esm/content-fields/flow-image.d.ts +2 -2
  79. package/lib/esm/content-fields/flow-image.js +24 -15
  80. package/lib/esm/content-fields/flow-image.js.map +1 -1
  81. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +3 -3
  82. package/lib/esm/content-fields/flow-queue-status-conditional.js +45 -40
  83. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -1
  84. package/lib/esm/content-fields/flow-rating.d.ts +3 -3
  85. package/lib/esm/content-fields/flow-rating.js +62 -40
  86. package/lib/esm/content-fields/flow-rating.js.map +1 -1
  87. package/lib/esm/content-fields/flow-text.d.ts +4 -4
  88. package/lib/esm/content-fields/flow-text.js +51 -29
  89. package/lib/esm/content-fields/flow-text.js.map +1 -1
  90. package/lib/esm/content-fields/flow-video.d.ts +2 -2
  91. package/lib/esm/content-fields/flow-video.js +24 -15
  92. package/lib/esm/content-fields/flow-video.js.map +1 -1
  93. package/lib/esm/content-fields/flow-webview.d.ts +2 -2
  94. package/lib/esm/content-fields/flow-webview.js +31 -28
  95. package/lib/esm/content-fields/flow-webview.js.map +1 -1
  96. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +3 -3
  97. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +91 -52
  98. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
  99. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.d.ts +10 -0
  100. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +51 -0
  101. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
  102. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +3 -2
  103. package/lib/esm/content-fields/flow-whatsapp-template.js +126 -98
  104. package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -1
  105. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +3 -3
  106. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +3 -2
  107. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +1 -1
  108. package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +2 -2
  109. package/lib/esm/content-fields/hubtype-fields/ai-agent.js +3 -2
  110. package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +1 -1
  111. package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +2 -2
  112. package/lib/esm/content-fields/hubtype-fields/bot-action.js +3 -2
  113. package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +1 -1
  114. package/lib/esm/content-fields/hubtype-fields/button.d.ts +1 -1
  115. package/lib/esm/content-fields/hubtype-fields/button.js +3 -2
  116. package/lib/esm/content-fields/hubtype-fields/button.js.map +1 -1
  117. package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +2 -2
  118. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +6 -6
  119. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -1
  120. package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +3 -3
  121. package/lib/esm/content-fields/hubtype-fields/carousel.js +3 -2
  122. package/lib/esm/content-fields/hubtype-fields/carousel.js.map +1 -1
  123. package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +3 -3
  124. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +3 -2
  125. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +1 -1
  126. package/lib/esm/content-fields/hubtype-fields/common.d.ts +2 -2
  127. package/lib/esm/content-fields/hubtype-fields/common.js +3 -2
  128. package/lib/esm/content-fields/hubtype-fields/common.js.map +1 -1
  129. package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +3 -3
  130. package/lib/esm/content-fields/hubtype-fields/country-conditional.js +3 -2
  131. package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -1
  132. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +2 -2
  133. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +15 -15
  134. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -1
  135. package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +3 -3
  136. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +3 -2
  137. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -1
  138. package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +2 -2
  139. package/lib/esm/content-fields/hubtype-fields/fallback.js +3 -2
  140. package/lib/esm/content-fields/hubtype-fields/fallback.js.map +1 -1
  141. package/lib/esm/content-fields/hubtype-fields/function.d.ts +2 -2
  142. package/lib/esm/content-fields/hubtype-fields/function.js +6 -6
  143. package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -1
  144. package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +2 -2
  145. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +3 -2
  146. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +1 -1
  147. package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +2 -2
  148. package/lib/esm/content-fields/hubtype-fields/handoff.js +3 -2
  149. package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -1
  150. package/lib/esm/content-fields/hubtype-fields/image.d.ts +2 -2
  151. package/lib/esm/content-fields/hubtype-fields/image.js +3 -2
  152. package/lib/esm/content-fields/hubtype-fields/image.js.map +1 -1
  153. package/lib/esm/content-fields/hubtype-fields/index.d.ts +27 -26
  154. package/lib/esm/content-fields/hubtype-fields/index.js +56 -29
  155. package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -1
  156. package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +2 -2
  157. package/lib/esm/content-fields/hubtype-fields/keyword.js +3 -2
  158. package/lib/esm/content-fields/hubtype-fields/keyword.js.map +1 -1
  159. package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +1 -0
  160. package/lib/esm/content-fields/hubtype-fields/node-types.js +13 -12
  161. package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
  162. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +24 -23
  163. package/lib/esm/content-fields/hubtype-fields/nodes.js +3 -2
  164. package/lib/esm/content-fields/hubtype-fields/nodes.js.map +1 -1
  165. package/lib/esm/content-fields/hubtype-fields/payload.d.ts +1 -1
  166. package/lib/esm/content-fields/hubtype-fields/payload.js +3 -2
  167. package/lib/esm/content-fields/hubtype-fields/payload.js.map +1 -1
  168. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +3 -3
  169. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +3 -2
  170. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -1
  171. package/lib/esm/content-fields/hubtype-fields/rating.d.ts +2 -2
  172. package/lib/esm/content-fields/hubtype-fields/rating.js +6 -6
  173. package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -1
  174. package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +2 -2
  175. package/lib/esm/content-fields/hubtype-fields/smart-intent.js +3 -2
  176. package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +1 -1
  177. package/lib/esm/content-fields/hubtype-fields/text.d.ts +3 -3
  178. package/lib/esm/content-fields/hubtype-fields/text.js +3 -2
  179. package/lib/esm/content-fields/hubtype-fields/text.js.map +1 -1
  180. package/lib/esm/content-fields/hubtype-fields/url.d.ts +1 -1
  181. package/lib/esm/content-fields/hubtype-fields/url.js +3 -2
  182. package/lib/esm/content-fields/hubtype-fields/url.js.map +1 -1
  183. package/lib/esm/content-fields/hubtype-fields/video.d.ts +2 -2
  184. package/lib/esm/content-fields/hubtype-fields/video.js +3 -2
  185. package/lib/esm/content-fields/hubtype-fields/video.js.map +1 -1
  186. package/lib/esm/content-fields/hubtype-fields/webview.d.ts +2 -2
  187. package/lib/esm/content-fields/hubtype-fields/webview.js +3 -2
  188. package/lib/esm/content-fields/hubtype-fields/webview.js.map +1 -1
  189. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +2 -2
  190. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +3 -2
  191. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -1
  192. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +3 -3
  193. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -2
  194. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -1
  195. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +8 -0
  196. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +4 -0
  197. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
  198. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +7 -3
  199. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +6 -6
  200. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +1 -1
  201. package/lib/esm/content-fields/index.d.ts +25 -24
  202. package/lib/esm/content-fields/index.js +72 -49
  203. package/lib/esm/content-fields/index.js.map +1 -1
  204. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
  205. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +16 -14
  206. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
  207. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +4 -4
  208. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +20 -15
  209. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
  210. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +4 -4
  211. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -26
  212. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
  213. package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -3
  214. package/lib/esm/content-fields/whatsapp-button-list/index.js +11 -9
  215. package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -1
  216. package/lib/esm/filters/index.d.ts +2 -2
  217. package/lib/esm/filters/index.js +8 -9
  218. package/lib/esm/filters/index.js.map +1 -1
  219. package/lib/esm/flow-factory.d.ts +3 -3
  220. package/lib/esm/flow-factory.js +57 -49
  221. package/lib/esm/flow-factory.js.map +1 -1
  222. package/lib/esm/functions/index.d.ts +1 -1
  223. package/lib/esm/functions/index.js +25 -19
  224. package/lib/esm/functions/index.js.map +1 -1
  225. package/lib/esm/index.d.ts +12 -12
  226. package/lib/esm/index.js +94 -77
  227. package/lib/esm/index.js.map +1 -1
  228. package/lib/esm/package.json +3 -0
  229. package/lib/esm/services/hubtype-queues-api.js +14 -14
  230. package/lib/esm/services/hubtype-queues-api.js.map +1 -1
  231. package/lib/esm/structured-output/flow-builder-content.js +14 -13
  232. package/lib/esm/structured-output/flow-builder-content.js.map +1 -1
  233. package/lib/esm/tracking.d.ts +2 -2
  234. package/lib/esm/tracking.js +27 -21
  235. package/lib/esm/tracking.js.map +1 -1
  236. package/lib/esm/types.d.ts +5 -5
  237. package/lib/esm/types.js +9 -9
  238. package/lib/esm/types.js.map +1 -1
  239. package/lib/esm/user-input/capture-user-input-api.d.ts +2 -2
  240. package/lib/esm/user-input/capture-user-input-api.js +44 -33
  241. package/lib/esm/user-input/capture-user-input-api.js.map +1 -1
  242. package/lib/esm/user-input/index.d.ts +2 -2
  243. package/lib/esm/user-input/index.js +23 -14
  244. package/lib/esm/user-input/index.js.map +1 -1
  245. package/lib/esm/user-input/keyword.d.ts +2 -2
  246. package/lib/esm/user-input/keyword.js +31 -26
  247. package/lib/esm/user-input/keyword.js.map +1 -1
  248. package/lib/esm/user-input/smart-intent.d.ts +2 -2
  249. package/lib/esm/user-input/smart-intent.js +36 -32
  250. package/lib/esm/user-input/smart-intent.js.map +1 -1
  251. package/lib/esm/utils/ai-agent.d.ts +3 -3
  252. package/lib/esm/utils/ai-agent.js +17 -12
  253. package/lib/esm/utils/ai-agent.js.map +1 -1
  254. package/lib/esm/utils/authentication.js +10 -7
  255. package/lib/esm/utils/authentication.js.map +1 -1
  256. package/lib/esm/utils/flow-locale.js +14 -18
  257. package/lib/esm/utils/flow-locale.js.map +1 -1
  258. package/lib/esm/utils/get-flow-builder-plugin.d.ts +1 -1
  259. package/lib/esm/utils/get-flow-builder-plugin.js +4 -4
  260. package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -1
  261. package/lib/esm/utils/hubtype-assistant-content.d.ts +1 -1
  262. package/lib/esm/utils/hubtype-assistant-content.js +57 -43
  263. package/lib/esm/utils/hubtype-assistant-content.js.map +1 -1
  264. package/lib/esm/utils/input.js +16 -14
  265. package/lib/esm/utils/input.js.map +1 -1
  266. package/lib/esm/webview/contents-context.d.ts +1 -1
  267. package/lib/esm/webview/contents-context.js +13 -11
  268. package/lib/esm/webview/contents-context.js.map +1 -1
  269. package/lib/esm/webview/index.d.ts +3 -3
  270. package/lib/esm/webview/index.js +10 -9
  271. package/lib/esm/webview/index.js.map +1 -1
  272. package/lib/esm/webview/types.d.ts +1 -1
  273. package/lib/esm/webview/types.js +6 -6
  274. package/lib/esm/webview/types.js.map +1 -1
  275. package/lib/esm/webview/use-webview-contents.d.ts +1 -1
  276. package/lib/esm/webview/use-webview-contents.js +46 -39
  277. package/lib/esm/webview/use-webview-contents.js.map +1 -1
  278. package/package.json +8 -7
  279. package/src/content-fields/flow-whatsapp-request-contact-info.tsx +48 -0
  280. package/src/content-fields/flow-whatsapp-template.tsx +16 -0
  281. package/src/content-fields/hubtype-fields/index.ts +1 -0
  282. package/src/content-fields/hubtype-fields/node-types.ts +1 -0
  283. package/src/content-fields/hubtype-fields/nodes.ts +2 -0
  284. package/src/content-fields/hubtype-fields/whatsapp-request-contact-info.ts +9 -0
  285. package/src/content-fields/hubtype-fields/whatsapp-template.ts +5 -0
  286. package/src/content-fields/index.ts +3 -0
  287. package/src/flow-factory.ts +6 -0
  288. package/src/index.ts +5 -5
  289. package/src/types.ts +6 -6
  290. package/lib/cjs/action/ai-agent-from-user-input.d.ts +0 -3
  291. package/lib/cjs/action/ai-agent-from-user-input.js +0 -32
  292. package/lib/cjs/action/ai-agent-from-user-input.js.map +0 -1
  293. package/lib/cjs/action/context.d.ts +0 -11
  294. package/lib/cjs/action/context.js +0 -17
  295. package/lib/cjs/action/context.js.map +0 -1
  296. package/lib/cjs/action/fallback.d.ts +0 -3
  297. package/lib/cjs/action/fallback.js +0 -36
  298. package/lib/cjs/action/fallback.js.map +0 -1
  299. package/lib/cjs/action/first-interaction.d.ts +0 -3
  300. package/lib/cjs/action/first-interaction.js +0 -88
  301. package/lib/cjs/action/first-interaction.js.map +0 -1
  302. package/lib/cjs/action/get-contents.d.ts +0 -3
  303. package/lib/cjs/action/get-contents.js +0 -39
  304. package/lib/cjs/action/get-contents.js.map +0 -1
  305. package/lib/cjs/action/index.d.ts +0 -25
  306. package/lib/cjs/action/index.js +0 -90
  307. package/lib/cjs/action/index.js.map +0 -1
  308. package/lib/cjs/action/payload.d.ts +0 -3
  309. package/lib/cjs/action/payload.js +0 -74
  310. package/lib/cjs/action/payload.js.map +0 -1
  311. package/lib/cjs/api.d.ts +0 -40
  312. package/lib/cjs/api.js +0 -205
  313. package/lib/cjs/api.js.map +0 -1
  314. package/lib/cjs/constants.d.ts +0 -13
  315. package/lib/cjs/constants.js +0 -19
  316. package/lib/cjs/constants.js.map +0 -1
  317. package/lib/cjs/content-fields/content-fields-base.d.ts +0 -20
  318. package/lib/cjs/content-fields/content-fields-base.js +0 -74
  319. package/lib/cjs/content-fields/content-fields-base.js.map +0 -1
  320. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
  321. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
  322. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
  323. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
  324. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
  325. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
  326. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
  327. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
  328. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
  329. package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +0 -25
  330. package/lib/cjs/content-fields/flow-ai-agent-base.js +0 -93
  331. package/lib/cjs/content-fields/flow-ai-agent-base.js.map +0 -1
  332. package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +0 -21
  333. package/lib/cjs/content-fields/flow-ai-agent-router.js +0 -125
  334. package/lib/cjs/content-fields/flow-ai-agent-router.js.map +0 -1
  335. package/lib/cjs/content-fields/flow-ai-agent.d.ts +0 -17
  336. package/lib/cjs/content-fields/flow-ai-agent.js +0 -64
  337. package/lib/cjs/content-fields/flow-ai-agent.js.map +0 -1
  338. package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -14
  339. package/lib/cjs/content-fields/flow-bot-action.js +0 -45
  340. package/lib/cjs/content-fields/flow-bot-action.js.map +0 -1
  341. package/lib/cjs/content-fields/flow-button.d.ts +0 -31
  342. package/lib/cjs/content-fields/flow-button.js +0 -86
  343. package/lib/cjs/content-fields/flow-button.js.map +0 -1
  344. package/lib/cjs/content-fields/flow-capture-user-input.d.ts +0 -14
  345. package/lib/cjs/content-fields/flow-capture-user-input.js +0 -45
  346. package/lib/cjs/content-fields/flow-capture-user-input.js.map +0 -1
  347. package/lib/cjs/content-fields/flow-carousel.d.ts +0 -22
  348. package/lib/cjs/content-fields/flow-carousel.js +0 -152
  349. package/lib/cjs/content-fields/flow-carousel.js.map +0 -1
  350. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -14
  351. package/lib/cjs/content-fields/flow-channel-conditional.js +0 -57
  352. package/lib/cjs/content-fields/flow-channel-conditional.js.map +0 -1
  353. package/lib/cjs/content-fields/flow-country-conditional.d.ts +0 -13
  354. package/lib/cjs/content-fields/flow-country-conditional.js +0 -59
  355. package/lib/cjs/content-fields/flow-country-conditional.js.map +0 -1
  356. package/lib/cjs/content-fields/flow-custom-conditional.d.ts +0 -17
  357. package/lib/cjs/content-fields/flow-custom-conditional.js +0 -89
  358. package/lib/cjs/content-fields/flow-custom-conditional.js.map +0 -1
  359. package/lib/cjs/content-fields/flow-element.d.ts +0 -22
  360. package/lib/cjs/content-fields/flow-element.js +0 -50
  361. package/lib/cjs/content-fields/flow-element.js.map +0 -1
  362. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +0 -13
  363. package/lib/cjs/content-fields/flow-go-to-flow.js +0 -51
  364. package/lib/cjs/content-fields/flow-go-to-flow.js.map +0 -1
  365. package/lib/cjs/content-fields/flow-handoff.d.ts +0 -17
  366. package/lib/cjs/content-fields/flow-handoff.js +0 -68
  367. package/lib/cjs/content-fields/flow-handoff.js.map +0 -1
  368. package/lib/cjs/content-fields/flow-image.d.ts +0 -10
  369. package/lib/cjs/content-fields/flow-image.js +0 -33
  370. package/lib/cjs/content-fields/flow-image.js.map +0 -1
  371. package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +0 -30
  372. package/lib/cjs/content-fields/flow-queue-status-conditional.js +0 -95
  373. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +0 -1
  374. package/lib/cjs/content-fields/flow-rating.d.ts +0 -15
  375. package/lib/cjs/content-fields/flow-rating.js +0 -66
  376. package/lib/cjs/content-fields/flow-rating.js.map +0 -1
  377. package/lib/cjs/content-fields/flow-text.d.ts +0 -15
  378. package/lib/cjs/content-fields/flow-text.js +0 -60
  379. package/lib/cjs/content-fields/flow-text.js.map +0 -1
  380. package/lib/cjs/content-fields/flow-video.d.ts +0 -10
  381. package/lib/cjs/content-fields/flow-video.js +0 -33
  382. package/lib/cjs/content-fields/flow-video.js.map +0 -1
  383. package/lib/cjs/content-fields/flow-webview.d.ts +0 -16
  384. package/lib/cjs/content-fields/flow-webview.js +0 -78
  385. package/lib/cjs/content-fields/flow-webview.js.map +0 -1
  386. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
  387. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +0 -92
  388. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
  389. package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +0 -36
  390. package/lib/cjs/content-fields/flow-whatsapp-template.js +0 -253
  391. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +0 -1
  392. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
  393. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +0 -3
  394. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
  395. package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
  396. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +0 -3
  397. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +0 -1
  398. package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +0 -10
  399. package/lib/cjs/content-fields/hubtype-fields/bot-action.js +0 -3
  400. package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +0 -1
  401. package/lib/cjs/content-fields/hubtype-fields/button.d.ts +0 -8
  402. package/lib/cjs/content-fields/hubtype-fields/button.js +0 -3
  403. package/lib/cjs/content-fields/hubtype-fields/button.js.map +0 -1
  404. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
  405. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +0 -12
  406. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
  407. package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +0 -17
  408. package/lib/cjs/content-fields/hubtype-fields/carousel.js +0 -3
  409. package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +0 -1
  410. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
  411. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +0 -3
  412. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
  413. package/lib/cjs/content-fields/hubtype-fields/common.d.ts +0 -83
  414. package/lib/cjs/content-fields/hubtype-fields/common.js +0 -3
  415. package/lib/cjs/content-fields/hubtype-fields/common.js.map +0 -1
  416. package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
  417. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +0 -3
  418. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +0 -1
  419. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
  420. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
  421. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
  422. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
  423. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +0 -3
  424. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
  425. package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +0 -9
  426. package/lib/cjs/content-fields/hubtype-fields/fallback.js +0 -3
  427. package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +0 -1
  428. package/lib/cjs/content-fields/hubtype-fields/function.d.ts +0 -30
  429. package/lib/cjs/content-fields/hubtype-fields/function.js +0 -11
  430. package/lib/cjs/content-fields/hubtype-fields/function.js.map +0 -1
  431. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
  432. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +0 -3
  433. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
  434. package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +0 -11
  435. package/lib/cjs/content-fields/hubtype-fields/handoff.js +0 -3
  436. package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +0 -1
  437. package/lib/cjs/content-fields/hubtype-fields/image.d.ts +0 -8
  438. package/lib/cjs/content-fields/hubtype-fields/image.js +0 -3
  439. package/lib/cjs/content-fields/hubtype-fields/image.js.map +0 -1
  440. package/lib/cjs/content-fields/hubtype-fields/index.d.ts +0 -26
  441. package/lib/cjs/content-fields/hubtype-fields/index.js +0 -30
  442. package/lib/cjs/content-fields/hubtype-fields/index.js.map +0 -1
  443. package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +0 -9
  444. package/lib/cjs/content-fields/hubtype-fields/keyword.js +0 -3
  445. package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +0 -1
  446. package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +0 -30
  447. package/lib/cjs/content-fields/hubtype-fields/node-types.js +0 -37
  448. package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +0 -1
  449. package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +0 -25
  450. package/lib/cjs/content-fields/hubtype-fields/nodes.js +0 -3
  451. package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +0 -1
  452. package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +0 -8
  453. package/lib/cjs/content-fields/hubtype-fields/payload.js +0 -3
  454. package/lib/cjs/content-fields/hubtype-fields/payload.js.map +0 -1
  455. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
  456. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
  457. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
  458. package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +0 -23
  459. package/lib/cjs/content-fields/hubtype-fields/rating.js +0 -9
  460. package/lib/cjs/content-fields/hubtype-fields/rating.js.map +0 -1
  461. package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
  462. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +0 -3
  463. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +0 -1
  464. package/lib/cjs/content-fields/hubtype-fields/text.d.ts +0 -11
  465. package/lib/cjs/content-fields/hubtype-fields/text.js +0 -3
  466. package/lib/cjs/content-fields/hubtype-fields/text.js.map +0 -1
  467. package/lib/cjs/content-fields/hubtype-fields/url.d.ts +0 -8
  468. package/lib/cjs/content-fields/hubtype-fields/url.js +0 -3
  469. package/lib/cjs/content-fields/hubtype-fields/url.js.map +0 -1
  470. package/lib/cjs/content-fields/hubtype-fields/video.d.ts +0 -8
  471. package/lib/cjs/content-fields/hubtype-fields/video.js +0 -3
  472. package/lib/cjs/content-fields/hubtype-fields/video.js.map +0 -1
  473. package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +0 -17
  474. package/lib/cjs/content-fields/hubtype-fields/webview.js +0 -3
  475. package/lib/cjs/content-fields/hubtype-fields/webview.js.map +0 -1
  476. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
  477. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
  478. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
  479. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
  480. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
  481. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
  482. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -92
  483. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +0 -9
  484. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
  485. package/lib/cjs/content-fields/index.d.ts +0 -24
  486. package/lib/cjs/content-fields/index.js +0 -50
  487. package/lib/cjs/content-fields/index.js.map +0 -1
  488. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
  489. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -41
  490. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
  491. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
  492. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
  493. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
  494. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
  495. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
  496. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
  497. package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +0 -3
  498. package/lib/cjs/content-fields/whatsapp-button-list/index.js +0 -10
  499. package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +0 -1
  500. package/lib/cjs/filters/index.d.ts +0 -12
  501. package/lib/cjs/filters/index.js +0 -17
  502. package/lib/cjs/filters/index.js.map +0 -1
  503. package/lib/cjs/flow-factory.d.ts +0 -12
  504. package/lib/cjs/flow-factory.js +0 -67
  505. package/lib/cjs/flow-factory.js.map +0 -1
  506. package/lib/cjs/functions/index.d.ts +0 -11
  507. package/lib/cjs/functions/index.js +0 -49
  508. package/lib/cjs/functions/index.js.map +0 -1
  509. package/lib/cjs/index.d.ts +0 -45
  510. package/lib/cjs/index.js +0 -178
  511. package/lib/cjs/index.js.map +0 -1
  512. package/lib/cjs/services/hubtype-queues-api.d.ts +0 -14
  513. package/lib/cjs/services/hubtype-queues-api.js +0 -26
  514. package/lib/cjs/services/hubtype-queues-api.js.map +0 -1
  515. package/lib/cjs/structured-output/flow-builder-content.d.ts +0 -13
  516. package/lib/cjs/structured-output/flow-builder-content.js +0 -15
  517. package/lib/cjs/structured-output/flow-builder-content.js.map +0 -1
  518. package/lib/cjs/tracking.d.ts +0 -16
  519. package/lib/cjs/tracking.js +0 -71
  520. package/lib/cjs/tracking.js.map +0 -1
  521. package/lib/cjs/types.d.ts +0 -62
  522. package/lib/cjs/types.js +0 -14
  523. package/lib/cjs/types.js.map +0 -1
  524. package/lib/cjs/user-input/capture-user-input-api.d.ts +0 -21
  525. package/lib/cjs/user-input/capture-user-input-api.js +0 -88
  526. package/lib/cjs/user-input/capture-user-input-api.js.map +0 -1
  527. package/lib/cjs/user-input/index.d.ts +0 -4
  528. package/lib/cjs/user-input/index.js +0 -37
  529. package/lib/cjs/user-input/index.js.map +0 -1
  530. package/lib/cjs/user-input/keyword.d.ts +0 -27
  531. package/lib/cjs/user-input/keyword.js +0 -84
  532. package/lib/cjs/user-input/keyword.js.map +0 -1
  533. package/lib/cjs/user-input/smart-intent.d.ts +0 -24
  534. package/lib/cjs/user-input/smart-intent.js +0 -89
  535. package/lib/cjs/user-input/smart-intent.js.map +0 -1
  536. package/lib/cjs/utils/ai-agent.d.ts +0 -11
  537. package/lib/cjs/utils/ai-agent.js +0 -28
  538. package/lib/cjs/utils/ai-agent.js.map +0 -1
  539. package/lib/cjs/utils/authentication.d.ts +0 -2
  540. package/lib/cjs/utils/authentication.js +0 -21
  541. package/lib/cjs/utils/authentication.js.map +0 -1
  542. package/lib/cjs/utils/flow-locale.d.ts +0 -22
  543. package/lib/cjs/utils/flow-locale.js +0 -79
  544. package/lib/cjs/utils/flow-locale.js.map +0 -1
  545. package/lib/cjs/utils/get-flow-builder-plugin.d.ts +0 -3
  546. package/lib/cjs/utils/get-flow-builder-plugin.js +0 -16
  547. package/lib/cjs/utils/get-flow-builder-plugin.js.map +0 -1
  548. package/lib/cjs/utils/hubtype-assistant-content.d.ts +0 -12
  549. package/lib/cjs/utils/hubtype-assistant-content.js +0 -173
  550. package/lib/cjs/utils/hubtype-assistant-content.js.map +0 -1
  551. package/lib/cjs/utils/input.d.ts +0 -6
  552. package/lib/cjs/utils/input.js +0 -35
  553. package/lib/cjs/utils/input.js.map +0 -1
  554. package/lib/cjs/webview/contents-context.d.ts +0 -2
  555. package/lib/cjs/webview/contents-context.js +0 -12
  556. package/lib/cjs/webview/contents-context.js.map +0 -1
  557. package/lib/cjs/webview/index.d.ts +0 -3
  558. package/lib/cjs/webview/index.js +0 -10
  559. package/lib/cjs/webview/index.js.map +0 -1
  560. package/lib/cjs/webview/types.d.ts +0 -47
  561. package/lib/cjs/webview/types.js +0 -9
  562. package/lib/cjs/webview/types.js.map +0 -1
  563. package/lib/cjs/webview/use-webview-contents.d.ts +0 -2
  564. package/lib/cjs/webview/use-webview-contents.js +0 -83
  565. package/lib/cjs/webview/use-webview-contents.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"content-fields-base.js","sourceRoot":"","sources":["../../../src/content-fields/content-fields-base.ts"],"names":[],"mappings":";;;AACA,4CAGqB;AACrB,wCAAkD;AAClD,8EAAuE;AAUvE,MAAsB,iBAAiB;IAIr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,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,CAAC,CAAA;QAC5E,CAAC;QAED,OAAO,OAAO;aACX,KAAK,CAAC,GAAG,CAAC;aACV,MAAM,CACL,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,EACnD,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CACnC,CAAA;IACL,CAAC;IAEO,gBAAgB,CAAC,MAAW,EAAE,GAAW;QAC/C,IAAI,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YACxC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;QACpB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAEO,WAAW,CAAC,WAAgB;QAClC,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAClD,OAAO,UAAU,CAAC,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;IAChD,CAAC;CACF;AAlGD,8CAkGC"}
1
+ {"version":3,"file":"content-fields/content-fields-base.js","sources":["../../../src/content-fields/content-fields-base.ts"],"sourcesContent":["import type { BotContext } from '@botonic/core'\nimport {\n ACCESS_TOKEN_VARIABLE_KEY,\n VARIABLE_PATTERN_GLOBAL,\n} from '../constants'\nimport { ContentFilterExecutor } from '../filters'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport type {\n HtMediaFileLocale,\n HtNodeLink,\n HtQueueLocale,\n HtTextLocale,\n HtVideoLocale,\n} from './hubtype-fields'\nimport type { FlowContent } from './index'\n\nexport abstract class ContentFieldsBase {\n public code: string\n public followUp?: HtNodeLink\n\n constructor(public readonly id: string) {}\n\n abstract trackFlow(botContext: BotContext): Promise<void>\n\n abstract processContent(botContext: BotContext): Promise<void>\n\n async filterContent(\n botContext: BotContext,\n content: FlowContent\n ): Promise<FlowContent> {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const contentFilters = flowBuilderPlugin.contentFilters\n const contentFilterExecutor = new ContentFilterExecutor({\n filters: contentFilters,\n })\n const filteredContent = await contentFilterExecutor.filter(\n botContext,\n content\n )\n return filteredContent\n }\n\n static getTextByLocale(locale: string, text: HtTextLocale[]): string {\n const result = text.find(t => t.locale === locale)\n return result?.message ?? ''\n }\n\n static getAssetByLocale(locale: string, asset: HtMediaFileLocale[]): string {\n const result = asset.find(i => i.locale === locale)\n return result?.file ?? ''\n }\n\n static getVideoByLocale(locale: string, video: HtVideoLocale[]): string {\n const result = video.find(v => v.locale === locale)\n return result?.url ?? ''\n }\n\n static getQueueByLocale(\n locale: string,\n queues: HtQueueLocale[]\n ): HtQueueLocale | undefined {\n return queues.find(queue => queue.locale === locale)\n }\n\n replaceVariables(text: string, botContext: BotContext): string {\n if (!botContext) {\n return text\n }\n\n return text.replace(VARIABLE_PATTERN_GLOBAL, match => {\n // remove \\\\ ( escape for _ ) added by text node with markdown\n const keyPath = match.slice(1, -1).replaceAll('\\\\', '')\n\n const botVariable = keyPath.endsWith(ACCESS_TOKEN_VARIABLE_KEY)\n ? match\n : this.getValueFromKeyPath(botContext, keyPath)\n\n return this.isValidType(botVariable) ? String(botVariable) : match\n })\n }\n\n getValueFromKeyPath(botContext: BotContext, keyPath: string): any {\n if (keyPath.startsWith('session.user.contact_info.')) {\n const name = keyPath.split('.').at(-1)\n return botContext.session.user.contact_info?.find(\n contact => contact.name === name\n )?.value\n }\n\n if (keyPath.startsWith('input.') || keyPath.startsWith('session.')) {\n return keyPath\n .split('.')\n .reduce((object, key) => this.resolveObjectKey(object, key), botContext)\n }\n\n return keyPath\n .split('.')\n .reduce(\n (object, key) => this.resolveObjectKey(object, key),\n botContext.session.user.extra_data\n )\n }\n\n private resolveObjectKey(object: any, key: string): any {\n if (object && object[key] !== undefined) {\n return object[key]\n }\n return undefined\n }\n\n private isValidType(botVariable: any): boolean {\n const validTypes = ['boolean', 'string', 'number']\n return validTypes.includes(typeof botVariable)\n }\n}\n"],"names":["ACCESS_TOKEN_VARIABLE_KEY","VARIABLE_PATTERN_GLOBAL","ContentFilterExecutor","getFlowBuilderPlugin","ContentFieldsBase","botContext","content","flowBuilderPlugin","contentFilters","contentFilterExecutor","filteredContent","locale","text","result","t","asset","i","video","v","queues","queue","match","keyPath","botVariable","String","name","contact","object","key","undefined","validTypes","id"],"mappings":";;;;;;;AAIqB;AAC6B;AACqB;AAUhE,MAAeI,iBAAiBA;IAUrC,MAAM,cACJC,UAAsB,EACtBC,OAAoB,EACE;QACtB,MAAMC,oBAAoBJ,oBAAoBA,CAACE,WAAW,OAAO;QACjE,MAAMG,iBAAiBD,kBAAkB,cAAc;QACvD,MAAME,wBAAwB,IAAIP,qBAAqBA,CAAC;YACtD,SAASM;QACX;QACA,MAAME,kBAAkB,MAAMD,sBAAsB,MAAM,CACxDJ,YACAC;QAEF,OAAOI;IACT;IAEA,OAAO,gBAAgBC,MAAc,EAAEC,IAAoB,EAAU;QACnE,MAAMC,SAASD,KAAK,IAAI,CAACE,CAAAA,IAAKA,EAAE,MAAM,KAAKH;QAC3C,OAAOE,QAAQ,WAAW;IAC5B;IAEA,OAAO,iBAAiBF,MAAc,EAAEI,KAA0B,EAAU;QAC1E,MAAMF,SAASE,MAAM,IAAI,CAACC,CAAAA,IAAKA,EAAE,MAAM,KAAKL;QAC5C,OAAOE,QAAQ,QAAQ;IACzB;IAEA,OAAO,iBAAiBF,MAAc,EAAEM,KAAsB,EAAU;QACtE,MAAMJ,SAASI,MAAM,IAAI,CAACC,CAAAA,IAAKA,EAAE,MAAM,KAAKP;QAC5C,OAAOE,QAAQ,OAAO;IACxB;IAEA,OAAO,iBACLF,MAAc,EACdQ,MAAuB,EACI;QAC3B,OAAOA,OAAO,IAAI,CAACC,CAAAA,QAASA,MAAM,MAAM,KAAKT;IAC/C;I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OA,WAAW,QAAQ,CAAC,OAAOP;IACpC;IA7FA,YAA4BQ,EAAU,CAAE;aAAZA,KAAAA;IAAa;AA8F3C"}
@@ -1,4 +1,4 @@
1
- import { BooleanConditionOperator, type HtBooleanCondition, type HtNumberCondition, type HtStringCondition, NumberConditionOperator, StringConditionOperator } from '../hubtype-fields';
1
+ import { BooleanConditionOperator, type HtBooleanCondition, type HtNumberCondition, type HtStringCondition, NumberConditionOperator, StringConditionOperator } from '../hubtype-fields/index.js';
2
2
  type StringEvaluator = (variable: string, value: string) => boolean;
3
3
  type NumberEvaluator = (variable: number, value: number, condition: HtNumberCondition) => boolean;
4
4
  type BooleanEvaluator = (variable: boolean) => boolean;
@@ -1,51 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BOOLEAN_CONDITION_EVALUATORS = exports.NUMBER_CONDITION_EVALUATORS = exports.STRING_CONDITION_EVALUATORS = void 0;
4
- exports.getMinAndMax = getMinAndMax;
5
- exports.evaluateStringCondition = evaluateStringCondition;
6
- exports.evaluateNumberCondition = evaluateNumberCondition;
7
- exports.evaluateBooleanCondition = evaluateBooleanCondition;
8
- const hubtype_fields_1 = require("../hubtype-fields");
1
+ import { BooleanConditionOperator, NumberConditionOperator, StringConditionOperator } from "../hubtype-fields/index.js";
2
+
3
+
4
+
9
5
  function getMinAndMax(condition) {
10
6
  if (condition.min !== undefined && condition.max !== undefined) {
11
- return { min: condition.min, max: condition.max };
7
+ return {
8
+ min: condition.min,
9
+ max: condition.max
10
+ };
12
11
  }
13
12
  throw new Error(`Min or max not found for number condition ${condition.operator}`);
14
13
  }
15
- exports.STRING_CONDITION_EVALUATORS = {
16
- [hubtype_fields_1.StringConditionOperator.Contains]: (variable, value) => variable.includes(value),
17
- [hubtype_fields_1.StringConditionOperator.NotContains]: (variable, value) => !variable.includes(value),
18
- [hubtype_fields_1.StringConditionOperator.EqualsTo]: (variable, value) => variable === value,
19
- [hubtype_fields_1.StringConditionOperator.NotEqualsTo]: (variable, value) => variable !== value,
20
- [hubtype_fields_1.StringConditionOperator.StartsWith]: (variable, value) => variable.startsWith(value),
21
- [hubtype_fields_1.StringConditionOperator.NotStartsWith]: (variable, value) => !variable.startsWith(value),
22
- [hubtype_fields_1.StringConditionOperator.EndsWith]: (variable, value) => variable.endsWith(value),
23
- [hubtype_fields_1.StringConditionOperator.NotEndsWith]: (variable, value) => !variable.endsWith(value),
14
+ const STRING_CONDITION_EVALUATORS = {
15
+ [StringConditionOperator.Contains]: (variable, value)=>variable.includes(value),
16
+ [StringConditionOperator.NotContains]: (variable, value)=>!variable.includes(value),
17
+ [StringConditionOperator.EqualsTo]: (variable, value)=>variable === value,
18
+ [StringConditionOperator.NotEqualsTo]: (variable, value)=>variable !== value,
19
+ [StringConditionOperator.StartsWith]: (variable, value)=>variable.startsWith(value),
20
+ [StringConditionOperator.NotStartsWith]: (variable, value)=>!variable.startsWith(value),
21
+ [StringConditionOperator.EndsWith]: (variable, value)=>variable.endsWith(value),
22
+ [StringConditionOperator.NotEndsWith]: (variable, value)=>!variable.endsWith(value)
24
23
  };
25
- exports.NUMBER_CONDITION_EVALUATORS = {
26
- [hubtype_fields_1.NumberConditionOperator.EqualsTo]: (variable, value) => variable === value,
27
- [hubtype_fields_1.NumberConditionOperator.NotEqualsTo]: (variable, value) => variable !== value,
28
- [hubtype_fields_1.NumberConditionOperator.GreaterThan]: (variable, value) => variable > value,
29
- [hubtype_fields_1.NumberConditionOperator.LessThan]: (variable, value) => variable < value,
30
- [hubtype_fields_1.NumberConditionOperator.GreaterThanOrEqualTo]: (variable, value) => variable >= value,
31
- [hubtype_fields_1.NumberConditionOperator.LessThanOrEqualTo]: (variable, value) => variable <= value,
32
- [hubtype_fields_1.NumberConditionOperator.Between]: (variable, _value, condition) => {
24
+ const NUMBER_CONDITION_EVALUATORS = {
25
+ [NumberConditionOperator.EqualsTo]: (variable, value)=>variable === value,
26
+ [NumberConditionOperator.NotEqualsTo]: (variable, value)=>variable !== value,
27
+ [NumberConditionOperator.GreaterThan]: (variable, value)=>variable > value,
28
+ [NumberConditionOperator.LessThan]: (variable, value)=>variable < value,
29
+ [NumberConditionOperator.GreaterThanOrEqualTo]: (variable, value)=>variable >= value,
30
+ [NumberConditionOperator.LessThanOrEqualTo]: (variable, value)=>variable <= value,
31
+ [NumberConditionOperator.Between]: (variable, _value, condition)=>{
33
32
  const { min, max } = getMinAndMax(condition);
34
33
  return variable >= min && variable <= max;
35
34
  },
36
- [hubtype_fields_1.NumberConditionOperator.NotBetween]: (variable, _value, condition) => {
35
+ [NumberConditionOperator.NotBetween]: (variable, _value, condition)=>{
37
36
  const { min, max } = getMinAndMax(condition);
38
37
  return variable < min || variable > max;
39
- },
38
+ }
40
39
  };
41
- exports.BOOLEAN_CONDITION_EVALUATORS = {
42
- [hubtype_fields_1.BooleanConditionOperator.IsTruthy]: variable => !!variable,
40
+ const BOOLEAN_CONDITION_EVALUATORS = {
41
+ [BooleanConditionOperator.IsTruthy]: (variable)=>!!variable
43
42
  };
44
43
  function evaluateStringCondition(variable, condition) {
45
44
  if (condition.value === undefined) {
46
45
  throw new Error(`Value not found for string condition ${condition.operator}`);
47
46
  }
48
- const evaluator = exports.STRING_CONDITION_EVALUATORS[condition.operator];
47
+ const evaluator = STRING_CONDITION_EVALUATORS[condition.operator];
49
48
  if (!evaluator) {
50
49
  throw new Error(`Invalid string condition operator ${condition.operator}`);
51
50
  }
@@ -55,17 +54,20 @@ function evaluateNumberCondition(variable, condition) {
55
54
  if (condition.value === undefined) {
56
55
  throw new Error(`Value not found for number condition ${condition.operator}`);
57
56
  }
58
- const evaluator = exports.NUMBER_CONDITION_EVALUATORS[condition.operator];
57
+ const evaluator = NUMBER_CONDITION_EVALUATORS[condition.operator];
59
58
  if (!evaluator) {
60
59
  throw new Error(`Invalid number condition operator ${condition.operator}`);
61
60
  }
62
61
  return evaluator(variable, condition.value, condition);
63
62
  }
64
63
  function evaluateBooleanCondition(variable, condition) {
65
- const evaluator = exports.BOOLEAN_CONDITION_EVALUATORS[condition.operator];
64
+ const evaluator = BOOLEAN_CONDITION_EVALUATORS[condition.operator];
66
65
  if (!evaluator) {
67
66
  throw new Error(`Invalid boolean condition operator ${condition.operator}`);
68
67
  }
69
68
  return evaluator(variable);
70
69
  }
70
+
71
+ export { BOOLEAN_CONDITION_EVALUATORS, NUMBER_CONDITION_EVALUATORS, STRING_CONDITION_EVALUATORS, evaluateBooleanCondition, evaluateNumberCondition, evaluateStringCondition, getMinAndMax };
72
+
71
73
  //# sourceMappingURL=custom-conditional-v2-evaluators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-conditional-v2-evaluators.js","sourceRoot":"","sources":["../../../../src/content-fields/custom-conditional/custom-conditional-v2-evaluators.ts"],"names":[],"mappings":";;;AAmBA,oCAUC;AAqDD,0DAcC;AAED,0DAcC;AAED,4DASC;AA3HD,sDAO0B;AAY1B,SAAgB,YAAY,CAAC,SAA4B;IAIvD,IAAI,SAAS,CAAC,GAAG,KAAK,SAAS,IAAI,SAAS,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC/D,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,CAAA;IACnD,CAAC;IACD,MAAM,IAAI,KAAK,CACb,6CAA6C,SAAS,CAAC,QAAQ,EAAE,CAClE,CAAA;AACH,CAAC;AAEY,QAAA,2BAA2B,GAGpC;IACF,CAAC,wCAAuB,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CACtD,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC1B,CAAC,wCAAuB,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CACzD,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC3B,CAAC,wCAAuB,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE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uBAAuB,CACrC,QAAgB,EAChB,SAA4B;IAE5B,IAAI,SAAS,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,wCAAwC,SAAS,CAAC,QAAQ,EAAE,CAC7D,CAAA;IACH,CAAC;IACD,MAAM,SAAS,GAAG,mCAA2B,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IACjE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,qCAAqC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5E,CAAC;IACD,OAAO,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;AACxD,CAAC;AAED,SAAgB,wBAAwB,CACtC,QAAiB,EACjB,SAA6B;IAE7B,MAAM,SAAS,GAAG,oCAA4B,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IAClE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,sCAAsC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC7E,CAAC;IACD,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAA;AAC5B,CAAC"}
1
+ {"version":3,"file":"content-fields/custom-conditional/custom-conditional-v2-evaluators.js","sources":["../../../../src/content-fields/custom-conditional/custom-conditional-v2-evaluators.ts"],"sourcesContent":["import {\n BooleanConditionOperator,\n type HtBooleanCondition,\n type HtNumberCondition,\n type HtStringCondition,\n NumberConditionOperator,\n StringConditionOperator,\n} from '../hubtype-fields'\n\ntype StringEvaluator = (variable: string, value: string) => boolean\n\ntype NumberEvaluator = (\n variable: number,\n value: number,\n condition: HtNumberCondition\n) => boolean\n\ntype BooleanEvaluator = (variable: boolean) => boolean\n\nexport function getMinAndMax(condition: HtNumberCondition): {\n min: number\n max: number\n} {\n if (condition.min !== undefined && condition.max !== undefined) {\n return { min: condition.min, max: condition.max }\n }\n throw new Error(\n `Min or max not found for number condition ${condition.operator}`\n )\n}\n\nexport const STRING_CONDITION_EVALUATORS: Record<\n StringConditionOperator,\n StringEvaluator\n> = {\n [StringConditionOperator.Contains]: (variable, value) =>\n variable.includes(value),\n [StringConditionOperator.NotContains]: (variable, value) =>\n !variable.includes(value),\n [StringConditionOperator.EqualsTo]: (variable, value) => variable === value,\n [StringConditionOperator.NotEqualsTo]: (variable, value) =>\n variable !== value,\n [StringConditionOperator.StartsWith]: (variable, value) =>\n variable.startsWith(value),\n [StringConditionOperator.NotStartsWith]: (variable, value) =>\n !variable.startsWith(value),\n [StringConditionOperator.EndsWith]: (variable, value) =>\n variable.endsWith(value),\n [StringConditionOperator.NotEndsWith]: (variable, value) =>\n !variable.endsWith(value),\n}\n\nexport const NUMBER_CONDITION_EVALUATORS: Record<\n NumberConditionOperator,\n NumberEvaluator\n> = {\n [NumberConditionOperator.EqualsTo]: (variable, value) => variable === value,\n [NumberConditionOperator.NotEqualsTo]: (variable, value) =>\n variable !== value,\n [NumberConditionOperator.GreaterThan]: (variable, value) => variable > value,\n [NumberConditionOperator.LessThan]: (variable, value) => variable < value,\n [NumberConditionOperator.GreaterThanOrEqualTo]: (variable, value) =>\n variable >= value,\n [NumberConditionOperator.LessThanOrEqualTo]: (variable, value) =>\n variable <= value,\n [NumberConditionOperator.Between]: (variable, _value, condition) => {\n const { min, max } = getMinAndMax(condition)\n return variable >= min && variable <= max\n },\n [NumberConditionOperator.NotBetween]: (variable, _value, condition) => {\n const { min, max } = getMinAndMax(condition)\n return variable < min || variable > max\n },\n}\n\nexport const BOOLEAN_CONDITION_EVALUATORS: Record<\n BooleanConditionOperator,\n BooleanEvaluator\n> = {\n [BooleanConditionOperator.IsTruthy]: variable => !!variable,\n}\n\nexport function evaluateStringCondition(\n variable: string,\n condition: HtStringCondition\n): boolean {\n if (condition.value === undefined) {\n throw new Error(\n `Value not found for string condition ${condition.operator}`\n )\n }\n const evaluator = STRING_CONDITION_EVALUATORS[condition.operator]\n if (!evaluator) {\n throw new Error(`Invalid string condition operator ${condition.operator}`)\n }\n return evaluator(variable, condition.value)\n}\n\nexport function evaluateNumberCondition(\n variable: number,\n condition: HtNumberCondition\n): boolean {\n if (condition.value === undefined) {\n throw new Error(\n `Value not found for number condition ${condition.operator}`\n )\n }\n const evaluator = NUMBER_CONDITION_EVALUATORS[condition.operator]\n if (!evaluator) {\n throw new Error(`Invalid number condition operator ${condition.operator}`)\n }\n return evaluator(variable, condition.value, condition)\n}\n\nexport function evaluateBooleanCondition(\n variable: boolean,\n condition: HtBooleanCondition\n): boolean {\n const evaluator = BOOLEAN_CONDITION_EVALUATORS[condition.operator]\n if (!evaluator) {\n throw new Error(`Invalid boolean condition operator ${condition.operator}`)\n }\n return evaluator(variable)\n}\n"],"names":["BooleanConditionOperator","NumberConditionOperator","StringConditionOperator","getMinAndMax","condition","undefined","Error","STRING_CONDITION_EVALUATORS","variable","value","NUMBER_CONDITION_EVALUATORS","_value","min","max","BOOLEAN_CONDITION_EVALUATORS","evaluateStringCondition","evaluator","evaluateNumberCondition","evaluateBooleanCondition"],"mappings":";;;AAO0B;AAYnB,SAASG,YAAYA,CAACC,SAA4B;IAIvD,IAAIA,UAAU,GAAG,KAAKC,aAAaD,UAAU,GAAG,KAAKC,WAAW;QAC9D,OAAO;YAAE,KAAKD,UAAU,GAAG;YAAE,KAAKA,UAAU,GAAG;QAAC;IAClD;IACA,MAAM,IAAIE,MACR,CAAC,0CAA0C,EAAEF,UAAU,QAAQ,EAAE;AAErE;AAEO,MAAMG,2BAA2BA,GAGpC;IACF,CAACL,gCAAgC,CAAC,EAAE,CAACM,UAAUC,QAC7CD,SAAS,QAAQ,CAACC;IACpB,CAACP,mCAAmC,CAAC,EAAE,CAACM,UAAUC,QAChD,CAACD,SAAS,QAAQ,CAACC;IACrB,CAACP,gCAAgC,CAAC,EAAE,CAACM,UAAUC,QAAUD,aAAaC;IACtE,CAACP,mCAAmC,CAAC,EAAE,CAACM,UAAUC,QAChDD,aAAaC;IACf,CAACP,k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,CAAC,qCAAqC,EAAEF,UAAU,QAAQ,EAAE;IAEhE;IACA,MAAMY,YAAYT,2BAA2B,CAACH,UAAU,QAAQ,CAAC;IACjE,IAAI,CAACY,WAAW;QACd,MAAM,IAAIV,MAAM,CAAC,kCAAkC,EAAEF,UAAU,QAAQ,EAAE;IAC3E;IACA,OAAOY,UAAUR,UAAUJ,UAAU,KAAK;AAC5C;AAEO,SAASa,uBAAuBA,CACrCT,QAAgB,EAChBJ,SAA4B;IAE5B,IAAIA,UAAU,KAAK,KAAKC,WAAW;QACjC,MAAM,IAAIC,MACR,CAAC,qCAAqC,EAAEF,UAAU,QAAQ,EAAE;IAEhE;IACA,MAAMY,YAAYN,2BAA2B,CAACN,UAAU,QAAQ,CAAC;IACjE,IAAI,CAACY,WAAW;QACd,MAAM,IAAIV,MAAM,CAAC,kCAAkC,EAAEF,UAAU,QAAQ,EAAE;IAC3E;IACA,OAAOY,UAAUR,UAAUJ,UAAU,KAAK,EAAEA;AAC9C;AAEO,SAASc,wBAAwBA,CACtCV,QAAiB,EACjBJ,SAA6B;IAE7B,MAAMY,YAAYF,4BAA4B,CAACV,UAAU,QAAQ,CAAC;IAClE,IAAI,CAACY,WAAW;QACd,MAAM,IAAIV,MAAM,CAAC,mCAAmC,EAAEF,UAAU,QAAQ,EAAE;IAC5E;IACA,OAAOY,UAAUR;AACnB"}
@@ -1,4 +1,4 @@
1
- import { type HtCondition, type HtNodeLink, VariableFormat } from '../hubtype-fields';
1
+ import { type HtCondition, type HtNodeLink, VariableFormat } from '../hubtype-fields/index.js';
2
2
  export type ConditionMatch = {
3
3
  customResult: string;
4
4
  target: HtNodeLink;
@@ -1,16 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConditionCustomResult = getConditionCustomResult;
4
- exports.findLastMatchingCondition = findLastMatchingCondition;
5
- exports.resolveWithDefaultTarget = resolveWithDefaultTarget;
6
- const hubtype_fields_1 = require("../hubtype-fields");
1
+ import { NumberConditionOperator, VariableFormat } from "../hubtype-fields/index.js";
2
+
3
+
4
+
7
5
  function getConditionCustomResult(condition, variableFormat) {
8
- switch (variableFormat) {
9
- case hubtype_fields_1.VariableFormat.String:
6
+ switch(variableFormat){
7
+ case VariableFormat.String:
10
8
  return String(condition.value);
11
- case hubtype_fields_1.VariableFormat.Number:
9
+ case VariableFormat.Number:
12
10
  return getNumberConditionCustomResult(condition);
13
- case hubtype_fields_1.VariableFormat.Boolean:
11
+ case VariableFormat.Boolean:
14
12
  // Only reached after evaluateBooleanCondition succeeds; today that is isTruthy → 'true'
15
13
  return 'true';
16
14
  default:
@@ -19,15 +17,14 @@ function getConditionCustomResult(condition, variableFormat) {
19
17
  }
20
18
  function getNumberConditionCustomResult(condition) {
21
19
  const numberCondition = condition;
22
- if (numberCondition.operator === hubtype_fields_1.NumberConditionOperator.Between ||
23
- numberCondition.operator === hubtype_fields_1.NumberConditionOperator.NotBetween) {
20
+ if (numberCondition.operator === NumberConditionOperator.Between || numberCondition.operator === NumberConditionOperator.NotBetween) {
24
21
  return `min: ${numberCondition.min} - max: ${numberCondition.max}`;
25
22
  }
26
23
  return String(numberCondition.value);
27
24
  }
28
25
  function findLastMatchingCondition(conditions, variable, variableFormat, evaluate) {
29
26
  let lastMatch;
30
- for (const condition of conditions) {
27
+ for (const condition of conditions){
31
28
  if (!evaluate(variable, condition)) {
32
29
  continue;
33
30
  }
@@ -37,7 +34,7 @@ function findLastMatchingCondition(conditions, variable, variableFormat, evaluat
37
34
  lastMatch = {
38
35
  customResult: getConditionCustomResult(condition, variableFormat),
39
36
  target: condition.target,
40
- operator: condition.operator,
37
+ operator: condition.operator
41
38
  };
42
39
  }
43
40
  return lastMatch;
@@ -52,7 +49,10 @@ function resolveWithDefaultTarget(match, defaultTarget, nodeCode, defaultCustomR
52
49
  return {
53
50
  customResult: defaultCustomResult,
54
51
  target: defaultTarget,
55
- operator: '',
52
+ operator: ''
56
53
  };
57
54
  }
55
+
56
+ export { findLastMatchingCondition, getConditionCustomResult, resolveWithDefaultTarget };
57
+
58
58
  //# sourceMappingURL=custom-conditional-v2-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-conditional-v2-resolver.js","sourceRoot":"","sources":["../../../../src/content-fields/custom-conditional/custom-conditional-v2-resolver.ts"],"names":[],"mappings":";;AAeA,4DAeC;AAaD,8DAyBC;AAED,4DAqBC;AA3FD,sDAO0B;AAQ1B,SAAgB,wBAAwB,CACtC,SAAsB,EACtB,cAA8B;IAE9B,QAAQ,cAAc,EAAE,CAAC;QACvB,KAAK,+BAAc,CAAC,MAAM;YACxB,OAAO,MAAM,CAAE,SAA+B,CAAC,KAAK,CAAC,CAAA;QACvD,KAAK,+BAAc,CAAC,MAAM;YACxB,OAAO,8BAA8B,CAAC,SAA8B,CAAC,CAAA;QACvE,KAAK,+BAAc,CAAC,OAAO;YACzB,wFAAwF;YACxF,OAAO,MAAM,CAAA;QACf;YACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,cAAc,EAAE,CAAC,CAAA;IAChE,CAAC;AACH,CAAC;AAED,SAAS,8BAA8B,CAAC,SAA4B;IAClE,MAAM,eAAe,GAAG,SAA8B,CAAA;IACtD,IACE,eAAe,CAAC,QAAQ,KAAK,wCAAuB,CAAC,OAAO;QAC5D,eAAe,CAAC,QAAQ,KAAK,wCAAuB,CAAC,UAAU,EAC/D,CAAC;QACD,OAAO,QAAQ,eAAe,CAAC,GAAG,WAAW,eAAe,CAAC,GAAG,EAAE,CAAA;IACpE,CAAC;IACD,OAAO,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;AACtC,CAAC;AAED,SAAgB,yBAAyB,CACvC,UAAe,EACf,QAAiB,EACjB,cAA8B,EAC9B,QAAsD;IAEtD,IAAI,SAAqC,CAAA;IAEzC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC;YACnC,SAAQ;QACV,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YACtB,SAAQ;QACV,CAAC;QAED,SAAS,GAAG;YACV,YAAY,EAAE,wBAAwB,CAAC,SAAS,EAAE,cAAc,CAAC;YACjE,MAAM,EAAE,SAAS,CAAC,MAAM;YACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ;SAC7B,CAAA;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAgB,wBAAwB,CACtC,KAAiC,EACjC,aAAyB,EACzB,QAAgB,EAChB,sBAA8B,SAAS;IAEvC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CACb,sDAAsD,QAAQ,EAAE,CACjE,CAAA;IACH,CAAC;IAED,OAAO;QACL,YAAY,EAAE,mBAAmB;QACjC,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"content-fields/custom-conditional/custom-conditional-v2-resolver.js","sources":["../../../../src/content-fields/custom-conditional/custom-conditional-v2-resolver.ts"],"sourcesContent":["import {\n type HtCondition,\n type HtNodeLink,\n type HtNumberCondition,\n type HtStringCondition,\n NumberConditionOperator,\n VariableFormat,\n} from '../hubtype-fields'\n\nexport type ConditionMatch = {\n customResult: string\n target: HtNodeLink\n operator: string\n}\n\nexport function getConditionCustomResult(\n condition: HtCondition,\n variableFormat: VariableFormat\n): string {\n switch (variableFormat) {\n case VariableFormat.String:\n return String((condition as HtStringCondition).value)\n case VariableFormat.Number:\n return getNumberConditionCustomResult(condition as HtNumberCondition)\n case VariableFormat.Boolean:\n // Only reached after evaluateBooleanCondition succeeds; today that is isTruthy → 'true'\n return 'true'\n default:\n throw new Error(`Invalid variable format ${variableFormat}`)\n }\n}\n\nfunction getNumberConditionCustomResult(condition: HtNumberCondition): string {\n const numberCondition = condition as HtNumberCondition\n if (\n numberCondition.operator === NumberConditionOperator.Between ||\n numberCondition.operator === NumberConditionOperator.NotBetween\n ) {\n return `min: ${numberCondition.min} - max: ${numberCondition.max}`\n }\n return String(numberCondition.value)\n}\n\nexport function findLastMatchingCondition<T extends HtCondition>(\n conditions: T[],\n variable: unknown,\n variableFormat: VariableFormat,\n evaluate: (variable: unknown, condition: T) => boolean\n): ConditionMatch | undefined {\n let lastMatch: ConditionMatch | undefined\n\n for (const condition of conditions) {\n if (!evaluate(variable, condition)) {\n continue\n }\n\n if (!condition.target) {\n continue\n }\n\n lastMatch = {\n customResult: getConditionCustomResult(condition, variableFormat),\n target: condition.target,\n operator: condition.operator,\n }\n }\n\n return lastMatch\n}\n\nexport function resolveWithDefaultTarget(\n match: ConditionMatch | undefined,\n defaultTarget: HtNodeLink,\n nodeCode: string,\n defaultCustomResult: string = 'default'\n): ConditionMatch {\n if (match) {\n return match\n }\n\n if (!defaultTarget) {\n throw new Error(\n `Default target not found for custom condition node ${nodeCode}`\n )\n }\n\n return {\n customResult: defaultCustomResult,\n target: defaultTarget,\n operator: '',\n }\n}\n"],"names":["NumberConditionOperator","VariableFormat","getConditionCustomResult","condition","variableFormat","String","getNumberConditionCustomResult","Error","numberCondition","findLastMatchingCondition","conditions","variable","evaluate","lastMatch","resolveWithDefaultTarget","match","defaultTarget","nodeCode","defaultCustomResult"],"mappings":";;;AAO0B;AAQnB,SAASE,wBAAwBA,CACtCC,SAAsB,EACtBC,cAA8B;IAE9B,OAAQA;QACN,KAAKH,qBAAqB;YACxB,OAAOI,OAAQF,UAAgC,KAAK;QACtD,KAAKF,qBAAqB;YACxB,OAAOK,8BAA8BA,CAACH;QACxC,KAAKF,sBAAsB;YACzB,wFAAwF;YACxF,OAAO;QACT;YACE,MAAM,IAAIM,MAAM,CAAC,wBAAwB,EAAEH,gBAAgB;IAC/D;AACF;AAEA,SAASE,8BAA8BA,CAACH,SAA4B;IAClE,MAAMK,kBAAkBL;IACxB,IACEK,gBAAgB,QAAQ,KAAKR,+BAA+B,IAC5DQ,gBAAgB,QAAQ,KAAKR,kCAAkC,EAC/D;QACA,OAAO,CAAC,KAAK,EAAEQ,gBAAgB,GAAG,CAAC,QAAQ,EAAEA,gBAAgB,GAAG,EAAE;IACpE;IACA,OAAOH,OAAOG,gBAAgB,KAAK;AACrC;AAEO,SAASC,yBAAyBA,CACvCC,UAAe,EACfC,QAAiB,EACjBP,cAA8B,EAC9BQ,QAAsD;IAEtD,IAAIC;IAEJ,KAAK,MAAMV,aAAaO,WAAY;QAClC,IAAI,CAACE,SAASD,UAAUR,YAAY;YAClC;QACF;QAEA,IAAI,CAACA,UAAU,MAAM,EAAE;YACrB;QACF;QAEAU,YAAY;YACV,cAAcX,wBAAwBA,CAACC,WAAWC;YAClD,QAAQD,UAAU,MAAM;YACxB,UAAUA,UAAU,QAAQ;QAC9B;IACF;IAEA,OAAOU;AACT;AAEO,SAASC,wBAAwBA,CACtCC,KAAiC,EACjCC,aAAyB,EACzBC,QAAgB,EAChBC,sBAA8B,SAAS;IAEvC,IAAIH,OAAO;QACT,OAAOA;IACT;IAEA,IAAI,CAACC,eAAe;QAClB,MAAM,IAAIT,MACR,CAAC,mDAAmD,EAAEU,UAAU;IAEpE;IAEA,OAAO;QACL,cAAcC;QACd,QAAQF;QACR,UAAU;IACZ;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { type BotContext } from '@botonic/core';
2
- import { ContentFieldsBase } from '../content-fields-base';
3
- import { type HtCondition, type HtCustomConditionalV2Node, type HtNodeLink, VariableFormat } from '../hubtype-fields';
2
+ import { ContentFieldsBase } from '../content-fields-base.js';
3
+ import { type HtCondition, type HtCustomConditionalV2Node, type HtNodeLink, VariableFormat } from '../hubtype-fields/index.js';
4
4
  export declare class FlowCustomConditionalV2 extends ContentFieldsBase {
5
5
  variableFormat: VariableFormat;
6
6
  keyPath: string;
@@ -1,19 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowCustomConditionalV2 = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const core_1 = require("@botonic/core");
6
- const tracking_1 = require("../../tracking");
7
- const content_fields_base_1 = require("../content-fields-base");
8
- const hubtype_fields_1 = require("../hubtype-fields");
9
- const custom_conditional_v2_evaluators_1 = require("./custom-conditional-v2-evaluators");
10
- const custom_conditional_v2_resolver_1 = require("./custom-conditional-v2-resolver");
11
- class FlowCustomConditionalV2 extends content_fields_base_1.ContentFieldsBase {
12
- constructor() {
13
- super(...arguments);
14
- this.customResult = '';
15
- this.resolvedOperator = '';
16
- }
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import { EventAction } from "@botonic/core";
3
+ import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../../tracking.js";
4
+ import { ContentFieldsBase } from "../content-fields-base.js";
5
+ import { VariableFormat } from "../hubtype-fields/index.js";
6
+ import { evaluateBooleanCondition, evaluateNumberCondition, evaluateStringCondition } from "./custom-conditional-v2-evaluators.js";
7
+ import { findLastMatchingCondition, resolveWithDefaultTarget } from "./custom-conditional-v2-resolver.js";
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+ class FlowCustomConditionalV2 extends ContentFieldsBase {
17
24
  static fromHubtypeCMS(component, botContext) {
18
25
  const newCustomConditionalV2 = new FlowCustomConditionalV2(component.id);
19
26
  newCustomConditionalV2.code = component.code;
@@ -32,27 +39,30 @@ class FlowCustomConditionalV2 extends content_fields_base_1.ContentFieldsBase {
32
39
  this.followUp = resolved.target;
33
40
  }
34
41
  evaluateConditions(botVariable) {
35
- switch (this.variableFormat) {
36
- case hubtype_fields_1.VariableFormat.String: {
37
- const match = (0, custom_conditional_v2_resolver_1.findLastMatchingCondition)(this.conditions, botVariable, this.variableFormat, (variable, condition) => (0, custom_conditional_v2_evaluators_1.evaluateStringCondition)(variable, condition));
38
- return (0, custom_conditional_v2_resolver_1.resolveWithDefaultTarget)(match, this.defaultTarget, this.code);
39
- }
40
- case hubtype_fields_1.VariableFormat.Number: {
41
- const match = (0, custom_conditional_v2_resolver_1.findLastMatchingCondition)(this.conditions, botVariable, this.variableFormat, (variable, condition) => (0, custom_conditional_v2_evaluators_1.evaluateNumberCondition)(variable, condition));
42
- return (0, custom_conditional_v2_resolver_1.resolveWithDefaultTarget)(match, this.defaultTarget, this.code);
43
- }
44
- case hubtype_fields_1.VariableFormat.Boolean: {
45
- const match = (0, custom_conditional_v2_resolver_1.findLastMatchingCondition)(this.conditions, botVariable, this.variableFormat, (variable, condition) => (0, custom_conditional_v2_evaluators_1.evaluateBooleanCondition)(variable, condition));
46
- return (0, custom_conditional_v2_resolver_1.resolveWithDefaultTarget)(match, this.defaultTarget, this.code, 'false');
47
- }
42
+ switch(this.variableFormat){
43
+ case VariableFormat.String:
44
+ {
45
+ const match = findLastMatchingCondition(this.conditions, botVariable, this.variableFormat, (variable, condition)=>evaluateStringCondition(variable, condition));
46
+ return resolveWithDefaultTarget(match, this.defaultTarget, this.code);
47
+ }
48
+ case VariableFormat.Number:
49
+ {
50
+ const match = findLastMatchingCondition(this.conditions, botVariable, this.variableFormat, (variable, condition)=>evaluateNumberCondition(variable, condition));
51
+ return resolveWithDefaultTarget(match, this.defaultTarget, this.code);
52
+ }
53
+ case VariableFormat.Boolean:
54
+ {
55
+ const match = findLastMatchingCondition(this.conditions, botVariable, this.variableFormat, (variable, condition)=>evaluateBooleanCondition(variable, condition));
56
+ return resolveWithDefaultTarget(match, this.defaultTarget, this.code, 'false');
57
+ }
48
58
  default:
49
59
  throw new Error(`Invalid variable format ${this.variableFormat} for custom condition node ${this.code}`);
50
60
  }
51
61
  }
52
62
  async trackFlow(botContext) {
53
- const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = (0, tracking_1.getCommonFlowContentEventArgsForContentId)(botContext, this.id);
63
+ const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
54
64
  const eventCustomConditional = {
55
- action: core_1.EventAction.ConditionalCustom,
65
+ action: EventAction.ConditionalCustom,
56
66
  flowThreadId,
57
67
  flowId,
58
68
  flowName,
@@ -61,10 +71,10 @@ class FlowCustomConditionalV2 extends content_fields_base_1.ContentFieldsBase {
61
71
  flowNodeIsMeaningful: false,
62
72
  conditionalVariable: this.customResult,
63
73
  variableFormat: this.variableFormat,
64
- operator: this.resolvedOperator,
74
+ operator: this.resolvedOperator
65
75
  };
66
76
  const { action, ...eventArgs } = eventCustomConditional;
67
- await (0, tracking_1.trackEvent)(botContext, action, eventArgs);
77
+ await trackEvent(botContext, action, eventArgs);
68
78
  }
69
79
  async processContent(botContext) {
70
80
  await this.filterContent(botContext, this);
@@ -72,8 +82,13 @@ class FlowCustomConditionalV2 extends content_fields_base_1.ContentFieldsBase {
72
82
  return;
73
83
  }
74
84
  toBotonic() {
75
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
85
+ return /*#__PURE__*/ jsx(Fragment, {});
86
+ }
87
+ constructor(...args){
88
+ super(...args), this.customResult = '', this.resolvedOperator = '';
76
89
  }
77
90
  }
78
- exports.FlowCustomConditionalV2 = FlowCustomConditionalV2;
91
+
92
+ export { FlowCustomConditionalV2 };
93
+
79
94
  //# sourceMappingURL=flow-custom-condition-v2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flow-custom-condition-v2.js","sourceRoot":"","sources":["../../../../src/content-fields/custom-conditional/flow-custom-condition-v2.tsx"],"names":[],"mappings":";;;;AAAA,wCAIsB;AACtB,6CAGuB;AACvB,gEAA0D;AAC1D,sDAQ0B;AAC1B,yFAI2C;AAC3C,qFAIyC;AAEzC,MAAa,uBAAwB,SAAQ,uCAAiB;IAA9D;;QAKS,iBAAY,GAAG,EAAE,CAAA;QACjB,qBAAgB,GAAG,EAAE,CAAA;IAmG9B,CAAC;IAjGC,MAAM,CAAC,cAAc,CACnB,SAAoC,EACpC,UAAsB;QAEtB,MAAM,sBAAsB,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AU;YACV,iBAAiB;YACjB,oBAAoB,EAAE,KAAK;YAC3B,mBAAmB,EAAE,IAAI,CAAC,YAAY;YACtC,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,QAAQ,EAAE,IAAI,CAAC,gBAAgB;SAChC,CAAA;QACD,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,sBAAsB,CAAA;QACvD,MAAM,IAAA,qBAAU,EAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;IACjD,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,UAAsB;QACzC,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QAChC,OAAM;IACR,CAAC;IAED,SAAS;QACP,OAAO,kDAAK,CAAA;IACd,CAAC;CACF;AAzGD,0DAyGC"}
1
+ {"version":3,"file":"content-fields/custom-conditional/flow-custom-condition-v2.js","sources":["../../../../src/content-fields/custom-conditional/flow-custom-condition-v2.tsx"],"sourcesContent":["import {\n type BotContext,\n EventAction,\n type EventConditionalCustom,\n} from '@botonic/core'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../../tracking'\nimport { ContentFieldsBase } from '../content-fields-base'\nimport {\n type HtBooleanCondition,\n type HtCondition,\n type HtCustomConditionalV2Node,\n type HtNodeLink,\n type HtNumberCondition,\n type HtStringCondition,\n VariableFormat,\n} from '../hubtype-fields'\nimport {\n evaluateBooleanCondition,\n evaluateNumberCondition,\n evaluateStringCondition,\n} from './custom-conditional-v2-evaluators'\nimport {\n type ConditionMatch,\n findLastMatchingCondition,\n resolveWithDefaultTarget,\n} from './custom-conditional-v2-resolver'\n\nexport class FlowCustomConditionalV2 extends ContentFieldsBase {\n public variableFormat: VariableFormat\n public keyPath: string\n public conditions: HtCondition[]\n public defaultTarget: HtNodeLink\n public customResult = ''\n public resolvedOperator = ''\n\n static fromHubtypeCMS(\n component: HtCustomConditionalV2Node,\n botContext: BotContext\n ): FlowCustomConditionalV2 {\n const newCustomConditionalV2 = new FlowCustomConditionalV2(component.id)\n newCustomConditionalV2.code = component.code\n newCustomConditionalV2.variableFormat = component.content.type\n newCustomConditionalV2.keyPath = component.content.key_path\n newCustomConditionalV2.conditions = component.content.conditions\n newCustomConditionalV2.defaultTarget = component.content.default_target\n newCustomConditionalV2.setFollowUp(botContext)\n\n return newCustomConditionalV2\n }\n\n private setFollowUp(botContext: BotContext): void {\n const botVariable = this.getValueFromKeyPath(botContext, this.keyPath)\n const resolved = this.evaluateConditions(botVariable)\n\n this.customResult = resolved.customResult\n this.resolvedOperator = resolved.operator\n this.followUp = resolved.target\n }\n\n private evaluateConditions(botVariable: unknown): ConditionMatch {\n switch (this.variableFormat) {\n case VariableFormat.String: {\n const match = findLastMatchingCondition(\n this.conditions as HtStringCondition[],\n botVariable,\n this.variableFormat,\n (variable, condition) =>\n evaluateStringCondition(variable as string, condition)\n )\n return resolveWithDefaultTarget(match, this.defaultTarget, this.code)\n }\n case VariableFormat.Number: {\n const match = findLastMatchingCondition(\n this.conditions as HtNumberCondition[],\n botVariable,\n this.variableFormat,\n (variable, condition) =>\n evaluateNumberCondition(variable as number, condition)\n )\n return resolveWithDefaultTarget(match, this.defaultTarget, this.code)\n }\n case VariableFormat.Boolean: {\n const match = findLastMatchingCondition(\n this.conditions as HtBooleanCondition[],\n botVariable,\n this.variableFormat,\n (variable, condition) =>\n evaluateBooleanCondition(variable as boolean, condition)\n )\n return resolveWithDefaultTarget(\n match,\n this.defaultTarget,\n this.code,\n 'false'\n )\n }\n default:\n throw new Error(\n `Invalid variable format ${this.variableFormat} for custom condition node ${this.code}`\n )\n }\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n const eventCustomConditional: EventConditionalCustom = {\n action: EventAction.ConditionalCustom,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n conditionalVariable: this.customResult,\n variableFormat: this.variableFormat,\n operator: this.resolvedOperator,\n }\n const { action, ...eventArgs } = eventCustomConditional\n await trackEvent(botContext, action, eventArgs)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic() {\n return <></>\n }\n}\n"],"names":["EventAction","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","VariableFormat","evaluateBooleanCondition","evaluateNumberCondition","evaluateStringCondition","findLastMatchingCondition","resolveWithDefaultTarget","FlowCustomConditionalV2","component","botContext","newCustomConditionalV2","botVariable","resolved","match","variable","condition","Error","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","eventCustomConditional","action","eventArgs"],"mappings":";;;;;;;;;;;;;;;;AAIsB;AAIC;AACmC;AAShC;AAKiB;AAKF;AAElC,MAAMU,uBAAuBA,SAASP,iBAAiBA;IAQ5D,OAAO,eACLQ,SAAoC,EACpCC,UAAsB,EACG;QACzB,MAAMC,yBAAyB,IAAIH,uBAAuBA,CAACC,UAAU,EAAE;QACvEE,uBAAuB,IAAI,GAAGF,UAAU,IAAI;QAC5CE,uBAAuB,cAAc,GAAGF,UAAU,OAAO,CAAC,IAAI;QAC9DE,uBAAuB,OAAO,GAAGF,UAAU,OAAO,CAAC,QAAQ;QAC3DE,uBAAuB,UAAU,GAAGF,UAAU,OAAO,CAAC,UAAU;QAChEE,uBAAuB,aAAa,GAAGF,UAAU,OAAO,CAAC,cAAc;QACvEE,uBAAuB,WAAW,CAACD;QAEnC,OAAOC;IACT;IAEQ,YAAYD,UAAsB,EAAQ;QAChD,MAAME,cAAc,IAAI,CAAC,mBAAmB,CAACF,YAAY,IAAI,CAAC,OAAO;QACrE,MAAMG,WAAW,IAAI,CAAC,kBAAkB,CAACD;QAEzC,IAAI,CAAC,YAAY,GAAGC,S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MAAMa,yBAAiD;YACrD,QAAQzB,6BAA6B;YACrCoB;YACAC;YACAC;YACAC;YACAC;YACA,sBAAsB;YACtB,qBAAqB,IAAI,CAAC,YAAY;YACtC,gBAAgB,IAAI,CAAC,cAAc;YACnC,UAAU,IAAI,CAAC,gBAAgB;QACjC;QACA,MAAM,EAAEE,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMvB,UAAUA,CAACU,YAAYc,QAAQC;IACvC;IAEA,MAAM,eAAef,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAY;QACV,qBAAO;IACT;;QAxGK,qBAKE,eAAe,SACf,mBAAmB;;AAmG5B"}
@@ -1,8 +1,8 @@
1
1
  import { type AgenticOutputMessage, type BotContext, type GuardrailRule, type HubtypeAssistantMessage, type InferenceResponse, VerbosityLevel } from '@botonic/core';
2
- import { type FlowBuilderContentMessage } from '../structured-output/flow-builder-content';
3
- import { ContentFieldsBase } from './content-fields-base';
4
- import type { HtInputGuardrailRule } from './hubtype-fields';
5
- import type { FlowContent } from './index';
2
+ import { type FlowBuilderContentMessage } from '../structured-output/flow-builder-content.js';
3
+ import { ContentFieldsBase } from './content-fields-base.js';
4
+ import type { HtInputGuardrailRule } from './hubtype-fields/index.js';
5
+ import type { FlowContent } from './index.js';
6
6
  export declare abstract class FlowAiAgentBase extends ContentFieldsBase {
7
7
  name: string;
8
8
  instructions: string;
@@ -1,25 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowAiAgentBase = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const core_1 = require("@botonic/core");
6
- const flow_builder_content_1 = require("../structured-output/flow-builder-content");
7
- const get_flow_builder_plugin_1 = require("../utils/get-flow-builder-plugin");
8
- const hubtype_assistant_content_1 = require("../utils/hubtype-assistant-content");
9
- const content_fields_base_1 = require("./content-fields-base");
10
- const flow_carousel_1 = require("./flow-carousel");
11
- const flow_text_1 = require("./flow-text");
12
- class FlowAiAgentBase extends content_fields_base_1.ContentFieldsBase {
13
- constructor() {
14
- super(...arguments);
15
- this.name = '';
16
- this.instructions = '';
17
- this.model = '';
18
- this.verbosity = core_1.VerbosityLevel.Medium;
19
- this.inputGuardrailRules = [];
20
- this.messages = [];
21
- this.jsxElements = [];
22
- }
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import { OutputMessageType, VerbosityLevel } from "@botonic/core";
3
+ import { FlowBuilderOutputMessageType } from "../structured-output/flow-builder-content.js";
4
+ import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
5
+ import { HubtypeAssistantContent } from "../utils/hubtype-assistant-content.js";
6
+ import { ContentFieldsBase } from "./content-fields-base.js";
7
+ import { FlowCarousel } from "./flow-carousel.js";
8
+ import { FlowText } from "./flow-text.js";
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+ class FlowAiAgentBase extends ContentFieldsBase {
23
27
  async resolveAIAgentResponse(botContext, previousContents) {
24
28
  const aiAgentResponse = await this.getAIAgentResponse(botContext, previousContents);
25
29
  if (aiAgentResponse) {
@@ -33,25 +37,23 @@ class FlowAiAgentBase extends content_fields_base_1.ContentFieldsBase {
33
37
  return;
34
38
  }
35
39
  async getFlowContentsByContentId(botContext, contentId) {
36
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(botContext.plugins);
40
+ const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
37
41
  const cmsApi = flowBuilderPlugin.cmsApi;
38
42
  const node = cmsApi.getNodeByContentID(contentId);
39
43
  const flowContents = await flowBuilderPlugin.getContentsByNode(node);
40
44
  return flowContents;
41
45
  }
42
46
  async messagesToBotonicJSXElements(botContext) {
43
- for (const message of this.messages) {
44
- if (message.type === core_1.OutputMessageType.Text ||
45
- message.type === core_1.OutputMessageType.TextWithButtons ||
46
- message.type === core_1.OutputMessageType.BotExecutor) {
47
- this.jsxElements.push(flow_text_1.FlowText.fromAIAgent(this.id, message));
47
+ for (const message of this.messages){
48
+ if (message.type === OutputMessageType.Text || message.type === OutputMessageType.TextWithButtons || message.type === OutputMessageType.BotExecutor) {
49
+ this.jsxElements.push(FlowText.fromAIAgent(this.id, message));
48
50
  }
49
- if (message.type === core_1.OutputMessageType.Carousel) {
50
- this.jsxElements.push(flow_carousel_1.FlowCarousel.fromAIAgent(this.id, message, botContext));
51
+ if (message.type === OutputMessageType.Carousel) {
52
+ this.jsxElements.push(FlowCarousel.fromAIAgent(this.id, message, botContext));
51
53
  }
52
- if (message.type === flow_builder_content_1.FlowBuilderOutputMessageType.FlowBuilderContent) {
54
+ if (message.type === FlowBuilderOutputMessageType.FlowBuilderContent) {
53
55
  const flowContents = await this.getFlowContentsByContentId(botContext, message.contentId);
54
- for (const content of flowContents) {
56
+ for (const content of flowContents){
55
57
  await content.processContent(botContext);
56
58
  this.jsxElements.push(content.toBotonic(botContext));
57
59
  }
@@ -70,24 +72,29 @@ class FlowAiAgentBase extends content_fields_base_1.ContentFieldsBase {
70
72
  return;
71
73
  }
72
74
  toBotonic() {
73
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: this.jsxElements });
75
+ return /*#__PURE__*/ jsx(Fragment, {
76
+ children: this.jsxElements
77
+ });
74
78
  }
75
79
  getPreviousHubtypeContents(previousContents) {
76
- return (previousContents?.map(content => {
80
+ return previousContents?.map((content)=>{
77
81
  return {
78
82
  role: 'assistant',
79
- content: hubtype_assistant_content_1.HubtypeAssistantContent.adapt(content),
83
+ content: HubtypeAssistantContent.adapt(content)
80
84
  };
81
- }) || []);
85
+ }) || [];
82
86
  }
83
87
  getActiveInputGuardrailRules(inputGuardrailRules) {
84
- return (inputGuardrailRules
85
- ?.filter(rule => rule.is_active)
86
- ?.map(rule => ({
87
- name: rule.name,
88
- description: rule.description,
89
- })) || []);
88
+ return inputGuardrailRules?.filter((rule)=>rule.is_active)?.map((rule)=>({
89
+ name: rule.name,
90
+ description: rule.description
91
+ })) || [];
92
+ }
93
+ constructor(...args){
94
+ super(...args), this.name = '', this.instructions = '', this.model = '', this.verbosity = VerbosityLevel.Medium, this.inputGuardrailRules = [], this.messages = [], this.jsxElements = [];
90
95
  }
91
96
  }
92
- exports.FlowAiAgentBase = FlowAiAgentBase;
97
+
98
+ export { FlowAiAgentBase };
99
+
93
100
  //# sourceMappingURL=flow-ai-agent-base.js.map