@treasuredata/tdx 2026.9.1 → 2026.9.2

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 (363) hide show
  1. package/README.md +1 -8
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +1 -1
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/activations.js +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-test-command.js +1 -1
  11. package/dist/commands/ai-usage-command-base.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/cas-command.js +1 -1
  15. package/dist/commands/cas-segment-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/codex-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/delivery-command.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-campaign-pull-command.js +1 -1
  30. package/dist/commands/engage-campaign-push-command.d.ts +1 -0
  31. package/dist/commands/engage-campaign-push-command.d.ts.map +1 -1
  32. package/dist/commands/engage-campaign-push-command.js +1 -1
  33. package/dist/commands/engage-campaign-push-command.js.map +1 -1
  34. package/dist/commands/engage-campaign-readiness-command.d.ts +8 -0
  35. package/dist/commands/engage-campaign-readiness-command.d.ts.map +1 -0
  36. package/dist/commands/engage-campaign-readiness-command.js +1 -0
  37. package/dist/commands/engage-campaign-readiness-command.js.map +1 -0
  38. package/dist/commands/engage-campaign-validate-command.d.ts +1 -0
  39. package/dist/commands/engage-campaign-validate-command.d.ts.map +1 -1
  40. package/dist/commands/engage-campaign-validate-command.js +1 -1
  41. package/dist/commands/engage-campaign-validate-command.js.map +1 -1
  42. package/dist/commands/engage-command.d.ts +1 -0
  43. package/dist/commands/engage-command.d.ts.map +1 -1
  44. package/dist/commands/engage-command.js +1 -1
  45. package/dist/commands/engage-command.js.map +1 -1
  46. package/dist/commands/engage-in-browser-message-command.js +1 -1
  47. package/dist/commands/engage-landing-page-command.js +1 -1
  48. package/dist/commands/engage-template-pull-command.js +1 -1
  49. package/dist/commands/engage-template-push-command.js +1 -1
  50. package/dist/commands/engage-template-validate-command.js +1 -1
  51. package/dist/commands/engage-workspace-assignment-command.d.ts +55 -0
  52. package/dist/commands/engage-workspace-assignment-command.d.ts.map +1 -0
  53. package/dist/commands/engage-workspace-assignment-command.js +1 -0
  54. package/dist/commands/engage-workspace-assignment-command.js.map +1 -0
  55. package/dist/commands/job-command.js +1 -1
  56. package/dist/commands/journey-command.d.ts.map +1 -1
  57. package/dist/commands/journey-command.js +1 -1
  58. package/dist/commands/journey-command.js.map +1 -1
  59. package/dist/commands/journey-validate-command.js +1 -1
  60. package/dist/commands/llm-command.js +1 -1
  61. package/dist/commands/mcp-command.js +1 -1
  62. package/dist/commands/opencode-command.js +1 -1
  63. package/dist/commands/opencode-usage-command.js +1 -1
  64. package/dist/commands/p13n-command.d.ts +36 -0
  65. package/dist/commands/p13n-command.d.ts.map +1 -1
  66. package/dist/commands/p13n-command.js +1 -1
  67. package/dist/commands/p13n-command.js.map +1 -1
  68. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  69. package/dist/commands/parent-segment-command.js +1 -1
  70. package/dist/commands/parent-segment-command.js.map +1 -1
  71. package/dist/commands/policy-command.js +1 -1
  72. package/dist/commands/profile-command.js +1 -1
  73. package/dist/commands/profiles-command.js +1 -1
  74. package/dist/commands/query-command.js +1 -1
  75. package/dist/commands/schedule-command.js +1 -1
  76. package/dist/commands/segment-command.js +1 -1
  77. package/dist/commands/segment-create-command.js +1 -1
  78. package/dist/commands/segment-fields-command.js +1 -1
  79. package/dist/commands/segment-move-command.js +1 -1
  80. package/dist/commands/segment-pull-command.js +1 -1
  81. package/dist/commands/segment-push-command.js +1 -1
  82. package/dist/commands/segment-update-command.js +1 -1
  83. package/dist/commands/segment-use-command.js +1 -1
  84. package/dist/commands/segment-validate-command.js +1 -1
  85. package/dist/commands/segments.js +1 -1
  86. package/dist/commands/show.js +1 -1
  87. package/dist/commands/status-command.js +1 -1
  88. package/dist/commands/table-deleted.js +1 -1
  89. package/dist/commands/tables.js +1 -1
  90. package/dist/commands/unset-command.js +1 -1
  91. package/dist/commands/upgrade-command.js +1 -1
  92. package/dist/commands/use-command.js +1 -1
  93. package/dist/commands/user-command.js +1 -1
  94. package/dist/commands/work-command.js +1 -1
  95. package/dist/commands/workflow-command.js +1 -1
  96. package/dist/core/auth.js +1 -1
  97. package/dist/core/command-output.js +1 -1
  98. package/dist/core/config.js +1 -1
  99. package/dist/core/connection-cache.js +1 -1
  100. package/dist/core/constants.js +1 -1
  101. package/dist/core/credential-cache.js +1 -1
  102. package/dist/core/global-context.js +1 -1
  103. package/dist/core/keychain.js +1 -1
  104. package/dist/core/oauth-keychain.js +1 -1
  105. package/dist/core/oauth.js +1 -1
  106. package/dist/core/profile.js +1 -1
  107. package/dist/core/project-config.js +1 -1
  108. package/dist/core/session.js +1 -1
  109. package/dist/core/site-mismatch.js +1 -1
  110. package/dist/core/user-cache.js +1 -1
  111. package/dist/core/version.js +1 -1
  112. package/dist/index.js +1 -1
  113. package/dist/mcp/server.js +1 -1
  114. package/dist/mcp/tools/index.js +1 -1
  115. package/dist/mcp/tools/tdx-run.js +1 -1
  116. package/dist/mcp/tools/tdx-search.js +1 -1
  117. package/dist/mcp/tools/work-create-item.js +1 -1
  118. package/dist/mcp/utils.js +1 -1
  119. package/dist/proxy/claude-usage-tracker.js +1 -1
  120. package/dist/proxy/passthrough-server.js +1 -1
  121. package/dist/proxy/sse-usage-parser.js +1 -1
  122. package/dist/sdk/agent/agent-config.js +1 -1
  123. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  124. package/dist/sdk/agent/agent-yaml.js +1 -1
  125. package/dist/sdk/agent/test/evaluator.js +1 -1
  126. package/dist/sdk/agent/test/executor.js +1 -1
  127. package/dist/sdk/agent/test/index.js +1 -1
  128. package/dist/sdk/agent/test/output.js +1 -1
  129. package/dist/sdk/agent/test/parser.js +1 -1
  130. package/dist/sdk/agent/tool-target-registry.js +1 -1
  131. package/dist/sdk/api.js +1 -1
  132. package/dist/sdk/auth-token.js +1 -1
  133. package/dist/sdk/cas/cas-api-client.js +1 -1
  134. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  135. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  136. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  137. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  138. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  139. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  140. package/dist/sdk/cas/index.js +1 -1
  141. package/dist/sdk/cas/pull-workflow.js +1 -1
  142. package/dist/sdk/cas/push-workflow.js +1 -1
  143. package/dist/sdk/cas/validate-files.js +1 -1
  144. package/dist/sdk/client/cdp-api-client.js +1 -1
  145. package/dist/sdk/client/delivery-api-client.d.ts +6 -5
  146. package/dist/sdk/client/delivery-api-client.d.ts.map +1 -1
  147. package/dist/sdk/client/delivery-api-client.js +1 -1
  148. package/dist/sdk/client/delivery-api-client.js.map +1 -1
  149. package/dist/sdk/client/endpoints.js +1 -1
  150. package/dist/sdk/client/engage-api-client.d.ts +20 -2
  151. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  152. package/dist/sdk/client/engage-api-client.js +1 -1
  153. package/dist/sdk/client/engage-api-client.js.map +1 -1
  154. package/dist/sdk/client/http-client.js +1 -1
  155. package/dist/sdk/client/llm-api-client.js +1 -1
  156. package/dist/sdk/client/oauth-refresh.js +1 -1
  157. package/dist/sdk/client/p13n-studio-api-client.d.ts +53 -1
  158. package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -1
  159. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  160. package/dist/sdk/client/p13n-studio-api-client.js.map +1 -1
  161. package/dist/sdk/client/rate-limiter.js +1 -1
  162. package/dist/sdk/client/td-api-client.js +1 -1
  163. package/dist/sdk/client/trino-api-client.js +1 -1
  164. package/dist/sdk/client/workflow-client.js +1 -1
  165. package/dist/sdk/connection-validator.js +1 -1
  166. package/dist/sdk/connection.js +1 -1
  167. package/dist/sdk/delivery.d.ts +19 -22
  168. package/dist/sdk/delivery.d.ts.map +1 -1
  169. package/dist/sdk/delivery.js +1 -1
  170. package/dist/sdk/delivery.js.map +1 -1
  171. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  172. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  173. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  174. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  175. package/dist/sdk/engage/campaign-pull.js +1 -1
  176. package/dist/sdk/engage/campaign-push.js +1 -1
  177. package/dist/sdk/engage/campaign-readiness-workflow.d.ts +44 -0
  178. package/dist/sdk/engage/campaign-readiness-workflow.d.ts.map +1 -0
  179. package/dist/sdk/engage/campaign-readiness-workflow.js +1 -0
  180. package/dist/sdk/engage/campaign-readiness-workflow.js.map +1 -0
  181. package/dist/sdk/engage/campaign-readiness.d.ts +38 -0
  182. package/dist/sdk/engage/campaign-readiness.d.ts.map +1 -0
  183. package/dist/sdk/engage/campaign-readiness.js +1 -0
  184. package/dist/sdk/engage/campaign-readiness.js.map +1 -0
  185. package/dist/sdk/engage/campaign-validator.d.ts +8 -0
  186. package/dist/sdk/engage/campaign-validator.d.ts.map +1 -1
  187. package/dist/sdk/engage/campaign-validator.js +1 -1
  188. package/dist/sdk/engage/campaign-validator.js.map +1 -1
  189. package/dist/sdk/engage/campaign-yaml.js +1 -1
  190. package/dist/sdk/engage/in-browser-message-pull.js +1 -1
  191. package/dist/sdk/engage/in-browser-message-push.js +1 -1
  192. package/dist/sdk/engage/in-browser-message-validator.js +1 -1
  193. package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
  194. package/dist/sdk/engage/landing-page-init.js +1 -1
  195. package/dist/sdk/engage/landing-page-public-asset.js +1 -1
  196. package/dist/sdk/engage/landing-page-pull.js +1 -1
  197. package/dist/sdk/engage/landing-page-push.js +1 -1
  198. package/dist/sdk/engage/landing-page-static-site.js +1 -1
  199. package/dist/sdk/engage/landing-page-validator.js +1 -1
  200. package/dist/sdk/engage/landing-page-workspace.js +1 -1
  201. package/dist/sdk/engage/landing-page-yaml.js +1 -1
  202. package/dist/sdk/engage/list-campaign-schema.d.ts +48 -0
  203. package/dist/sdk/engage/list-campaign-schema.d.ts.map +1 -0
  204. package/dist/sdk/engage/list-campaign-schema.js +1 -0
  205. package/dist/sdk/engage/list-campaign-schema.js.map +1 -0
  206. package/dist/sdk/engage/list-campaign-yaml.d.ts +31 -0
  207. package/dist/sdk/engage/list-campaign-yaml.d.ts.map +1 -0
  208. package/dist/sdk/engage/list-campaign-yaml.js +1 -0
  209. package/dist/sdk/engage/list-campaign-yaml.js.map +1 -0
  210. package/dist/sdk/engage/template-pull.js +1 -1
  211. package/dist/sdk/engage/template-push.js +1 -1
  212. package/dist/sdk/engage/template-validator.js +1 -1
  213. package/dist/sdk/engage/template-yaml.js +1 -1
  214. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  215. package/dist/sdk/engage/types/campaign-def.js +1 -1
  216. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  217. package/dist/sdk/engage/types/in-browser-message-schema.js +1 -1
  218. package/dist/sdk/engage/types/landing-page-schema.js +1 -1
  219. package/dist/sdk/engage/types/template-schema.js +1 -1
  220. package/dist/sdk/engage/workspace-assignments.d.ts +23 -0
  221. package/dist/sdk/engage/workspace-assignments.d.ts.map +1 -0
  222. package/dist/sdk/engage/workspace-assignments.js +1 -0
  223. package/dist/sdk/engage/workspace-assignments.js.map +1 -0
  224. package/dist/sdk/engage.d.ts +40 -2
  225. package/dist/sdk/engage.d.ts.map +1 -1
  226. package/dist/sdk/engage.js +1 -1
  227. package/dist/sdk/engage.js.map +1 -1
  228. package/dist/sdk/errors.js +1 -1
  229. package/dist/sdk/index.d.ts +3 -2
  230. package/dist/sdk/index.d.ts.map +1 -1
  231. package/dist/sdk/index.js +1 -1
  232. package/dist/sdk/index.js.map +1 -1
  233. package/dist/sdk/io/index.js +1 -1
  234. package/dist/sdk/io/node-filesystem.js +1 -1
  235. package/dist/sdk/job.js +1 -1
  236. package/dist/sdk/journey.d.ts +4 -0
  237. package/dist/sdk/journey.d.ts.map +1 -1
  238. package/dist/sdk/journey.js +1 -1
  239. package/dist/sdk/journey.js.map +1 -1
  240. package/dist/sdk/llm/chat-cache.js +1 -1
  241. package/dist/sdk/llm/index.js +1 -1
  242. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  243. package/dist/sdk/llm/model-factors.js +1 -1
  244. package/dist/sdk/llm/user-settings.js +1 -1
  245. package/dist/sdk/p13n-studio-errors.d.ts +47 -1
  246. package/dist/sdk/p13n-studio-errors.d.ts.map +1 -1
  247. package/dist/sdk/p13n-studio-errors.js +1 -1
  248. package/dist/sdk/p13n-studio-errors.js.map +1 -1
  249. package/dist/sdk/p13n-studio.d.ts +180 -12
  250. package/dist/sdk/p13n-studio.d.ts.map +1 -1
  251. package/dist/sdk/p13n-studio.js +1 -1
  252. package/dist/sdk/p13n-studio.js.map +1 -1
  253. package/dist/sdk/personalization.js +1 -1
  254. package/dist/sdk/policy.js +1 -1
  255. package/dist/sdk/query/deleted-table-validation.js +1 -1
  256. package/dist/sdk/query/index.js +1 -1
  257. package/dist/sdk/query/sql-parser.js +1 -1
  258. package/dist/sdk/realtime.js +1 -1
  259. package/dist/sdk/schedule.js +1 -1
  260. package/dist/sdk/segment/audience-context.d.ts +42 -26
  261. package/dist/sdk/segment/audience-context.d.ts.map +1 -1
  262. package/dist/sdk/segment/audience-context.js +1 -1
  263. package/dist/sdk/segment/audience-context.js.map +1 -1
  264. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  265. package/dist/sdk/segment/fields-display.js +1 -1
  266. package/dist/sdk/segment/file-discovery.js +1 -1
  267. package/dist/sdk/segment/journey-utils.js +1 -1
  268. package/dist/sdk/segment/journey-validator.js +1 -1
  269. package/dist/sdk/segment/journey-yaml.js +1 -1
  270. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  271. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  272. package/dist/sdk/segment/pull-workflow.js +1 -1
  273. package/dist/sdk/segment/push-recovery.js +1 -1
  274. package/dist/sdk/segment/push-workflow.js +1 -1
  275. package/dist/sdk/segment/resolution-context.js +1 -1
  276. package/dist/sdk/segment/segment-path-parser.js +1 -1
  277. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  278. package/dist/sdk/segment/segment-validator.js +1 -1
  279. package/dist/sdk/segment/target-resolution.js +1 -1
  280. package/dist/sdk/segment/tdx-config.js +1 -1
  281. package/dist/sdk/segment/types/activation-schema.js +1 -1
  282. package/dist/sdk/segment/types/journey-def.js +1 -1
  283. package/dist/sdk/segment/types/journey-schema.js +1 -1
  284. package/dist/sdk/segment/types/segment-def.js +1 -1
  285. package/dist/sdk/segment/types/segment-schema.js +1 -1
  286. package/dist/sdk/segment/validate-files.d.ts +1 -1
  287. package/dist/sdk/segment/validate-files.js +1 -1
  288. package/dist/sdk/segment/validate-files.js.map +1 -1
  289. package/dist/sdk/segment/yaml-validator.js +1 -1
  290. package/dist/sdk/segment.d.ts +18 -13
  291. package/dist/sdk/segment.d.ts.map +1 -1
  292. package/dist/sdk/segment.js +1 -1
  293. package/dist/sdk/segment.js.map +1 -1
  294. package/dist/sdk/types/engage.d.ts +118 -2
  295. package/dist/sdk/types/engage.d.ts.map +1 -1
  296. package/dist/sdk/types/index.d.ts +2 -2
  297. package/dist/sdk/types/index.d.ts.map +1 -1
  298. package/dist/sdk/types/index.js +1 -1
  299. package/dist/sdk/types/index.js.map +1 -1
  300. package/dist/sdk/types/p13n-studio.d.ts +56 -0
  301. package/dist/sdk/types/p13n-studio.d.ts.map +1 -1
  302. package/dist/sdk/types/progress.js +1 -1
  303. package/dist/sdk/types/workspace.js +1 -1
  304. package/dist/sdk/user.js +1 -1
  305. package/dist/sdk/util/format-detector.js +1 -1
  306. package/dist/sdk/util/formatters.js +1 -1
  307. package/dist/sdk/util/index.js +1 -1
  308. package/dist/sdk/util/paginate.js +1 -1
  309. package/dist/sdk/util/tree-formatter.js +1 -1
  310. package/dist/sdk/util/tree-search.js +1 -1
  311. package/dist/sdk/workflow/archive-validation.js +1 -1
  312. package/dist/sdk/workflow/clone-workflow.js +1 -1
  313. package/dist/sdk/workflow/index.js +1 -1
  314. package/dist/sdk/workflow/pull-workflow.js +1 -1
  315. package/dist/sdk/workflow/push-workflow.js +1 -1
  316. package/dist/sdk/workflow/task-graph.js +1 -1
  317. package/dist/sdk/workflow/tdx-config.js +1 -1
  318. package/dist/sdk/workflow/workflow-utils.js +1 -1
  319. package/dist/sdk/workspace/access-tracker.js +1 -1
  320. package/dist/sdk/workspace/frontmatter.js +1 -1
  321. package/dist/sdk/workspace/git.js +1 -1
  322. package/dist/sdk/workspace/index.js +1 -1
  323. package/dist/sdk/workspace/templates.js +1 -1
  324. package/dist/sdk/workspace/weekly.js +1 -1
  325. package/dist/sdk/workspace/wikilinks.js +1 -1
  326. package/dist/test-utils/command-runner.js +1 -1
  327. package/dist/test-utils/factories.js +1 -1
  328. package/dist/test-utils/fixtures.js +1 -1
  329. package/dist/test-utils/http-mock.d.ts +10 -0
  330. package/dist/test-utils/http-mock.d.ts.map +1 -1
  331. package/dist/test-utils/http-mock.js +1 -1
  332. package/dist/test-utils/http-mock.js.map +1 -1
  333. package/dist/test-utils/index.js +1 -1
  334. package/dist/utils/async.js +1 -1
  335. package/dist/utils/claude-code-state.js +1 -1
  336. package/dist/utils/colors.js +1 -1
  337. package/dist/utils/diff.js +1 -1
  338. package/dist/utils/file-permissions.js +1 -1
  339. package/dist/utils/file-reader.js +1 -1
  340. package/dist/utils/github-releases.js +1 -1
  341. package/dist/utils/global-cache.js +1 -1
  342. package/dist/utils/json-loader.js +1 -1
  343. package/dist/utils/local-cache.js +1 -1
  344. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  345. package/dist/utils/logger/formatters/index.js +1 -1
  346. package/dist/utils/logger/handlers/console-handler.js +1 -1
  347. package/dist/utils/logger/handlers/file-handler.js +1 -1
  348. package/dist/utils/logger/handlers/index.js +1 -1
  349. package/dist/utils/logger/handlers/null-handler.js +1 -1
  350. package/dist/utils/logger/index.js +1 -1
  351. package/dist/utils/logger/logger.js +1 -1
  352. package/dist/utils/logger/types.js +1 -1
  353. package/dist/utils/option-validation.js +1 -1
  354. package/dist/utils/process.js +1 -1
  355. package/dist/utils/prompt.js +1 -1
  356. package/dist/utils/proxy-fetch.js +1 -1
  357. package/dist/utils/spinner.js +1 -1
  358. package/dist/utils/sse-parser.js +1 -1
  359. package/dist/utils/string-utils.js +1 -1
  360. package/dist/utils/table-ref-parser.js +1 -1
  361. package/dist/utils/tdx-logger.js +1 -1
  362. package/dist/utils/version-check.js +1 -1
  363. package/package.json +1 -5
@@ -1 +1 @@
1
- const a186_0x1eb4d5=a186_0x484a;(function(_0x29fe64,_0x522ecf){const _0x5261a9=a186_0x484a,_0x4db6f2=_0x29fe64();while(!![]){try{const _0x586a1b=parseInt(_0x5261a9(0x1ed))/0x1+-parseInt(_0x5261a9(0x279))/0x2*(parseInt(_0x5261a9(0x234))/0x3)+parseInt(_0x5261a9(0x286))/0x4*(parseInt(_0x5261a9(0x23d))/0x5)+-parseInt(_0x5261a9(0x22c))/0x6*(-parseInt(_0x5261a9(0x28a))/0x7)+-parseInt(_0x5261a9(0x241))/0x8+parseInt(_0x5261a9(0x1f6))/0x9*(-parseInt(_0x5261a9(0x287))/0xa)+parseInt(_0x5261a9(0x274))/0xb*(parseInt(_0x5261a9(0x1ea))/0xc);if(_0x586a1b===_0x522ecf)break;else _0x4db6f2['push'](_0x4db6f2['shift']());}catch(_0x37f7a1){_0x4db6f2['push'](_0x4db6f2['shift']());}}}(a186_0x5d02,0x5ffcb));import*as a186_0x4ed2e2 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp,getLegacySettingsField}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a186_0x1eb4d5(0x236),'hourly':a186_0x1eb4d5(0x209),'weekly':a186_0x1eb4d5(0x230),'monthly':a186_0x1eb4d5(0x243),'minutes_interval':a186_0x1eb4d5(0x1e5)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a186_0x1eb4d5(0x1e4),'hour':a186_0x1eb4d5(0x25e),'week':a186_0x1eb4d5(0x285),'month':a186_0x1eb4d5(0x284),'minute':a186_0x1eb4d5(0x293)};function filterRuleAsRuleDef(_0xcf689f){return _0xcf689f;}function ruleDefAsFilterRule(_0x481168){return _0x481168;}export function segmentResponseToDefSync(_0x163727,_0x57f8a8){const _0x3e61be=a186_0x1eb4d5,_0x25845c=_0x163727[_0x3e61be(0x20e)]&&_0x3e61be(0x271)in _0x163727['rule']&&_0x163727['rule']['type'];return{'type':'segment','name':_0x163727[_0x3e61be(0x273)],..._0x163727[_0x3e61be(0x1eb)]&&{'description':_0x163727['description']},..._0x57f8a8&&{'folder':_0x57f8a8},..._0x25845c&&{'rule':apiRuleToYaml(_0x163727[_0x3e61be(0x20e)])},..._0x163727[_0x3e61be(0x204)]!==undefined&&{'kind':_0x163727[_0x3e61be(0x204)]===0x0?_0x3e61be(0x26d):_0x163727['kind']===0x1?'realtime':'funnel_stage'},..._0x163727[_0x3e61be(0x23a)]!==undefined&&{'visible':_0x163727['isVisible']}};}export async function segmentResponseToDef(_0x2b6fdf,_0x2dff2c,_0x323835){const _0x82e376=a186_0x1eb4d5,_0x90e375=segmentResponseToDefSync(_0x2b6fdf,_0x323835);if(!_0x2dff2c||!_0x2dff2c[_0x82e376(0x24e)])return _0x90e375;return _0x90e375[_0x82e376(0x20e)]&&(_0x90e375[_0x82e376(0x20e)]=await resolveRuleSegmentRefs(_0x90e375[_0x82e376(0x20e)],_0x2dff2c['resolveSegmentName'])),_0x90e375;}export function apiRuleToYaml(_0x3d2302){const _0x3380ee=a186_0x1eb4d5;if(_0x3d2302[_0x3380ee(0x271)]===_0x3380ee(0x200))return{'type':_0x3380ee(0x200),'conditions':(_0x3d2302[_0x3380ee(0x275)]||[])[_0x3380ee(0x23f)](apiConditionToYaml),..._0x3d2302['description']!==undefined&&{'description':_0x3d2302[_0x3380ee(0x1eb)]},..._0x3d2302[_0x3380ee(0x1fc)]!==undefined&&{'expr':_0x3d2302[_0x3380ee(0x1fc)]}};const _0x430083=(_0x3d2302[_0x3380ee(0x275)]||[])[_0x3380ee(0x207)](_0x3d5040=>{const _0x5b4120=_0x3380ee,_0x4ccb0e=apiConditionToYaml(_0x3d5040);if(isCompositeType(_0x4ccb0e)&&_0x4ccb0e[_0x5b4120(0x1eb)]!==undefined){const _0x4e5887=_0x4ccb0e;if(_0x4e5887[_0x5b4120(0x275)]['length']===0x1)return _0x4e5887[_0x5b4120(0x275)];return[{'type':_0x4e5887[_0x5b4120(0x271)],'conditions':_0x4e5887['conditions']}];}return[_0x4ccb0e];});if(_0x430083[_0x3380ee(0x22d)]===0x1&&!_0x3d2302[_0x3380ee(0x1eb)]&&isCompositeType(_0x430083[0x0])){const _0x1a1318=_0x430083[0x0];if(_0x1a1318[_0x3380ee(0x271)]===_0x3d2302[_0x3380ee(0x271)]&&_0x1a1318[_0x3380ee(0x275)]&&_0x1a1318[_0x3380ee(0x1eb)]===undefined)return{'type':_0x3d2302[_0x3380ee(0x271)],'conditions':_0x1a1318[_0x3380ee(0x275)]};}return{'type':_0x3d2302[_0x3380ee(0x271)],'conditions':_0x430083};}export async function resolveRuleSegmentRefs(_0x627603,_0x4be3e9){return transformRuleSegmentRefs(_0x627603,_0x4be3e9,_0x52650d=>/^\d+$/['test'](_0x52650d));}async function transformConditionSegmentRefs(_0x55d789,_0x27125f,_0x307861,_0x1660f5){const _0x27dd27=a186_0x1eb4d5;if(_0x27dd27(0x235)in _0x55d789&&(_0x55d789[_0x27dd27(0x271)]===_0x27dd27(0x1fa)||_0x55d789[_0x27dd27(0x271)]==='exclude')){const _0x2d42d0=_0x55d789;if(_0x307861(_0x2d42d0[_0x27dd27(0x235)]))return{..._0x2d42d0,'segment':await _0x27125f(_0x2d42d0[_0x27dd27(0x235)])};return _0x55d789;}if(_0x27dd27(0x275)in _0x55d789&&_0x55d789[_0x27dd27(0x275)]){const _0x41d62a=_0x55d789,_0xf7a853=await Promise[_0x27dd27(0x291)](_0x41d62a['conditions']['map'](_0x46e3b5=>transformConditionSegmentRefs(_0x46e3b5,_0x27125f,_0x307861,_0x1660f5)));return{..._0x41d62a,'conditions':_0xf7a853};}if(_0x27dd27(0x267)in _0x55d789&&_0x55d789['filter']){const _0x43a99a=_0x55d789,_0x18ce20=await _0x1660f5(filterRuleAsRuleDef(_0x43a99a['filter']),_0x27125f);return{..._0x43a99a,'filter':ruleDefAsFilterRule(_0x18ce20)};}return _0x55d789;}async function transformRuleSegmentRefs(_0x59b43c,_0x21add9,_0x484359){const _0x14c9ca=a186_0x1eb4d5,_0x59a82e=(_0xd0061a,_0x1a7866)=>transformRuleSegmentRefs(_0xd0061a,_0x1a7866,_0x484359),_0x389d68=await Promise['all'](_0x59b43c[_0x14c9ca(0x275)][_0x14c9ca(0x23f)](_0x7e33c6=>transformConditionSegmentRefs(_0x7e33c6,_0x21add9,_0x484359,_0x59a82e)));return{..._0x59b43c,'conditions':_0x389d68};}export async function resolveRuleSegmentIds(_0x3cd6ea,_0x26d3ae){const _0x329a1f=a186_0x1eb4d5;return transformRuleSegmentRefs(_0x3cd6ea,_0x26d3ae,_0x1fb868=>!/^\d+$/[_0x329a1f(0x263)](_0x1fb868));}function isCompositeType(_0x59066c){const _0x4b7871=a186_0x1eb4d5;return _0x59066c[_0x4b7871(0x271)]===_0x4b7871(0x25a)||_0x59066c[_0x4b7871(0x271)]==='Or'||_0x59066c[_0x4b7871(0x271)]===_0x4b7871(0x200);}function isBehaviorApiCondition(_0x59809e){const _0x4b5ecb=a186_0x1eb4d5;if(!_0x59809e[_0x4b5ecb(0x217)]?.[_0x4b5ecb(0x294)]?.[_0x4b5ecb(0x273)])return![];return!![];}function apiConditionToYaml(_0x2cc80e){const _0x3f6591=a186_0x1eb4d5;if(_0x2cc80e[_0x3f6591(0x271)]===_0x3f6591(0x25a)||_0x2cc80e[_0x3f6591(0x271)]==='Or'){if(_0x2cc80e[_0x3f6591(0x275)]){const _0x2154de=_0x2cc80e[_0x3f6591(0x275)][_0x3f6591(0x23f)](apiConditionToYaml),_0x1522d1=_0x2cc80e[_0x3f6591(0x1eb)]!==undefined;if(_0x2154de[_0x3f6591(0x22d)]===0x1&&!_0x1522d1)return _0x2154de[0x0];return{'type':_0x2cc80e[_0x3f6591(0x271)],'conditions':_0x2154de,..._0x2cc80e[_0x3f6591(0x1eb)]!==undefined&&{'description':_0x2cc80e[_0x3f6591(0x1eb)]}};}}if(_0x2cc80e[_0x3f6591(0x271)]===_0x3f6591(0x200)&&_0x2cc80e[_0x3f6591(0x275)])return{'type':'Composite','conditions':_0x2cc80e[_0x3f6591(0x275)][_0x3f6591(0x23f)](apiConditionToYaml),..._0x2cc80e[_0x3f6591(0x1eb)]!==undefined&&{'description':_0x2cc80e[_0x3f6591(0x1eb)]},..._0x2cc80e[_0x3f6591(0x1fc)]!==undefined&&{'expr':_0x2cc80e[_0x3f6591(0x1fc)]}};if(_0x2cc80e[_0x3f6591(0x271)]===_0x3f6591(0x219)&&_0x2cc80e[_0x3f6591(0x217)]&&_0x2cc80e[_0x3f6591(0x25d)]){const _0x2dda8a=_0x2cc80e[_0x3f6591(0x217)][_0x3f6591(0x1ee)]?buildAggregationDefFromApi(_0x2cc80e['leftValue'][_0x3f6591(0x1ee)]):undefined;if(isBehaviorApiCondition(_0x2cc80e)){const _0x28e98=_0x2cc80e[_0x3f6591(0x217)]['source'][_0x3f6591(0x273)],{timeWindow:_0x41e012,remainingFilter:_0x17f248}=extractTimeWindow(_0x2cc80e[_0x3f6591(0x217)][_0x3f6591(0x267)]);return{'type':_0x3f6591(0x28f),'attribute':'','operator':apiOperatorToYaml(_0x2cc80e[_0x3f6591(0x25d)]),..._0x2cc80e[_0x3f6591(0x295)]&&_0x2cc80e[_0x3f6591(0x295)]!=='any'?{'arrayMatching':_0x2cc80e[_0x3f6591(0x295)]}:{},..._0x2cc80e['exclude']?{'exclude':_0x2cc80e[_0x3f6591(0x21c)]}:{},..._0x2dda8a?{'aggregation':_0x2dda8a}:{},'source':_0x28e98,..._0x41e012?{'timeWindow':_0x41e012}:{},..._0x17f248?{'filter':apiRuleToYaml(_0x17f248)}:{},..._0x2cc80e[_0x3f6591(0x220)]!==undefined&&_0x2cc80e[_0x3f6591(0x220)]!==null?{'limit':_0x2cc80e['limit']}:{}};}return{'type':'Value','attribute':_0x2cc80e[_0x3f6591(0x217)][_0x3f6591(0x273)]||'','operator':apiOperatorToYaml(_0x2cc80e[_0x3f6591(0x25d)]),..._0x2cc80e[_0x3f6591(0x295)]&&_0x2cc80e[_0x3f6591(0x295)]!=='any'?{'arrayMatching':_0x2cc80e['arrayMatching']}:{},..._0x2cc80e['exclude']?{'exclude':_0x2cc80e['exclude']}:{},..._0x2dda8a?{'aggregation':_0x2dda8a}:{},..._0x2cc80e[_0x3f6591(0x217)][_0x3f6591(0x267)]?{'filter':apiRuleToYaml(_0x2cc80e[_0x3f6591(0x217)][_0x3f6591(0x267)])}:{},..._0x2cc80e[_0x3f6591(0x220)]!==undefined&&_0x2cc80e[_0x3f6591(0x220)]!==null?{'limit':_0x2cc80e['limit']}:{}};}if(_0x2cc80e[_0x3f6591(0x271)]===_0x3f6591(0x278)&&_0x2cc80e['column']&&_0x2cc80e['operator'])return{'type':_0x3f6591(0x278),'column':_0x2cc80e[_0x3f6591(0x232)],'operator':apiOperatorToYaml(_0x2cc80e['operator'])};if(_0x2cc80e[_0x3f6591(0x271)]===_0x3f6591(0x223)&&_0x2cc80e['id'])return{'type':_0x2cc80e[_0x3f6591(0x21c)]?'exclude':_0x3f6591(0x1fa),'segment':_0x2cc80e['id']};return{'type':_0x3f6591(0x25a),'conditions':[]};}function isTemporalOperator(_0x4724a7){const _0x3f2a78=a186_0x1eb4d5;return _0x4724a7===_0x3f2a78(0x22e)||_0x4724a7==='TimeWithinNext';}function isBetweenOperator(_0x578a52){const _0x48bc82=a186_0x1eb4d5;return _0x578a52===_0x48bc82(0x297);}function getEffectiveValue(_0x332573){const _0x24730d=a186_0x1eb4d5,_0x2aad67=_0x332573['values'];return _0x332573[_0x24730d(0x262)]??_0x2aad67;}function parseNumericValue(_0x5012da){const _0x47d78d=a186_0x1eb4d5;if(typeof _0x5012da===_0x47d78d(0x1f3)&&_0x5012da!==null)return _0x5012da;if(_0x5012da==='')return _0x5012da;const _0x496dd7=Number(_0x5012da);return Number[_0x47d78d(0x1e2)](_0x496dd7)?_0x496dd7:_0x5012da;}function apiOperatorToYaml(_0x6816c9){const _0x48c35e=a186_0x1eb4d5;if(isBetweenOperator(_0x6816c9[_0x48c35e(0x271)]))return{'type':mapApiOperatorType(_0x6816c9[_0x48c35e(0x271)]),..._0x6816c9[_0x48c35e(0x25f)]!==undefined&&{'not':_0x6816c9[_0x48c35e(0x25f)]},..._0x6816c9[_0x48c35e(0x1e6)]!==undefined&&{'min':parseNumericValue(_0x6816c9[_0x48c35e(0x1e6)])},..._0x6816c9[_0x48c35e(0x270)]!==undefined&&{'max':parseNumericValue(_0x6816c9['maxValue'])}};if(_0x6816c9[_0x48c35e(0x271)]===_0x48c35e(0x256))return{'type':_0x48c35e(0x256),..._0x6816c9['not']!==undefined&&{'not':_0x6816c9['not']},..._0x6816c9[_0x48c35e(0x208)]!==undefined&&{'duration':_0x6816c9['duration']},..._0x6816c9[_0x48c35e(0x24d)]!==undefined&&{'from':_0x6816c9[_0x48c35e(0x24d)]},..._0x6816c9[_0x48c35e(0x247)]!==undefined&&{'reverse':_0x6816c9[_0x48c35e(0x247)]}};let _0x435cec;if(_0x6816c9[_0x48c35e(0x225)]&&_0x6816c9['rightValues'][_0x48c35e(0x22d)]>0x0)_0x435cec=_0x6816c9[_0x48c35e(0x225)];else{if(_0x6816c9['rightValue']!==undefined)_0x435cec=_0x6816c9[_0x48c35e(0x28e)];else isTemporalOperator(_0x6816c9['type'])&&_0x6816c9['value']!==undefined&&(_0x435cec=_0x6816c9['value']);}return{'type':mapApiOperatorType(_0x6816c9['type']),..._0x6816c9[_0x48c35e(0x25f)]!==undefined&&{'not':_0x6816c9[_0x48c35e(0x25f)]},..._0x435cec!==undefined&&{'value':_0x435cec},..._0x6816c9[_0x48c35e(0x288)]!==undefined&&{'unit':_0x6816c9['unit']}};}function mapApiOperatorType(_0x4b4fe2){return _0x4b4fe2;}export function segmentDefToCreateRequest(_0x3c4c75,_0x5c4f2f){const _0x366011=a186_0x1eb4d5,_0x9ae5b4={'name':_0x3c4c75['name']};return _0x3c4c75[_0x366011(0x1eb)]&&(_0x9ae5b4[_0x366011(0x1eb)]=_0x3c4c75[_0x366011(0x1eb)]),_0x3c4c75['rule']&&(_0x9ae5b4[_0x366011(0x20e)]=yamlRuleToApi(_0x3c4c75[_0x366011(0x20e)])),_0x3c4c75[_0x366011(0x204)]&&(_0x9ae5b4[_0x366011(0x204)]=_0x3c4c75[_0x366011(0x204)]==='batch'?0x0:_0x3c4c75[_0x366011(0x204)]==='realtime'?0x1:0x2),_0x3c4c75[_0x366011(0x26e)]!==undefined&&(_0x9ae5b4[_0x366011(0x23a)]=_0x3c4c75[_0x366011(0x26e)]),_0x5c4f2f&&(_0x9ae5b4[_0x366011(0x23b)]=_0x5c4f2f),_0x9ae5b4;}export function segmentDefToUpdateRequest(_0x13c1c8){const _0x544c45=a186_0x1eb4d5,_0x42910a={'name':_0x13c1c8['name']};return _0x13c1c8[_0x544c45(0x1eb)]!==undefined&&(_0x42910a['description']=_0x13c1c8[_0x544c45(0x1eb)]),_0x13c1c8[_0x544c45(0x20e)]&&(_0x42910a[_0x544c45(0x20e)]=yamlRuleToApi(_0x13c1c8[_0x544c45(0x20e)])),_0x13c1c8[_0x544c45(0x204)]&&(_0x42910a[_0x544c45(0x204)]=_0x13c1c8[_0x544c45(0x204)]===_0x544c45(0x26d)?0x0:_0x13c1c8[_0x544c45(0x204)]===_0x544c45(0x249)?0x1:0x2),_0x42910a;}export function yamlRuleToApi(_0x22dcc1){const _0x2bacc8=a186_0x1eb4d5;if(_0x22dcc1[_0x2bacc8(0x271)]===_0x2bacc8(0x200))return{'type':_0x2bacc8(0x200),'conditions':_0x22dcc1[_0x2bacc8(0x275)][_0x2bacc8(0x23f)](yamlConditionToApi),..._0x22dcc1[_0x2bacc8(0x1eb)]!==undefined&&{'description':_0x22dcc1[_0x2bacc8(0x1eb)]},..._0x22dcc1['expr']!==undefined&&{'expr':_0x22dcc1[_0x2bacc8(0x1fc)]}};const _0x52e90d=_0x22dcc1[_0x2bacc8(0x275)][_0x2bacc8(0x23f)](yamlConditionToApi),_0x44cb38=_0x52e90d[_0x2bacc8(0x23e)](_0x109434=>isCompositeType(_0x109434)&&_0x109434['description']!==undefined);if(!_0x44cb38&&_0x52e90d[_0x2bacc8(0x22d)]>0x0){const _0x23be9d=[];for(const _0x23aa9c of _0x52e90d){isCompositeType(_0x23aa9c)&&_0x23aa9c[_0x2bacc8(0x1eb)]===undefined&&_0x23aa9c[_0x2bacc8(0x275)]&&_0x23aa9c['conditions'][_0x2bacc8(0x23e)](_0x2e2363=>!isCompositeType(_0x2e2363))?_0x23be9d[_0x2bacc8(0x26f)]({'type':_0x23aa9c[_0x2bacc8(0x271)],'description':'','conditions':_0x23aa9c['conditions']}):_0x23be9d['push']({'type':_0x2bacc8(0x25a),'description':_0x22dcc1[_0x2bacc8(0x1eb)]||'','conditions':[_0x23aa9c]});}return{'type':_0x22dcc1[_0x2bacc8(0x271)],'conditions':_0x23be9d};}return{'type':_0x22dcc1['type'],'conditions':_0x52e90d,..._0x22dcc1['description']&&{'description':_0x22dcc1['description']}};}function yamlFilterRuleToApi(_0x228e0e){const _0x43cd27=a186_0x1eb4d5,_0x3f8784=_0x228e0e[_0x43cd27(0x275)]['map'](yamlConditionToApi);return{'type':_0x228e0e[_0x43cd27(0x271)],'conditions':_0x3f8784};}function yamlConditionToApi(_0x3ce5aa){const _0x528c87=a186_0x1eb4d5;if(_0x528c87(0x235)in _0x3ce5aa&&(_0x3ce5aa[_0x528c87(0x271)]===_0x528c87(0x1fa)||_0x3ce5aa['type']===_0x528c87(0x21c))){const _0x2bda09=_0x3ce5aa;return{'type':_0x528c87(0x223),'id':_0x2bda09['segment'],'exclude':_0x2bda09['type']===_0x528c87(0x21c)};}if(_0x3ce5aa['type']===_0x528c87(0x25a)||_0x3ce5aa[_0x528c87(0x271)]==='Or'||_0x3ce5aa[_0x528c87(0x271)]===_0x528c87(0x200)){const _0x3feab2=_0x3ce5aa;return{'type':_0x3feab2[_0x528c87(0x271)],'conditions':_0x3feab2[_0x528c87(0x275)][_0x528c87(0x23f)](yamlConditionToApi),..._0x3feab2[_0x528c87(0x1eb)]&&{'description':_0x3feab2[_0x528c87(0x1eb)]},..._0x3feab2[_0x528c87(0x1fc)]!==undefined&&{'expr':_0x3feab2[_0x528c87(0x1fc)]}};}if(_0x528c87(0x232)in _0x3ce5aa&&_0x3ce5aa['type']===_0x528c87(0x278)){const _0x1b4ef3=_0x3ce5aa;return{'type':_0x528c87(0x278),'column':_0x1b4ef3[_0x528c87(0x232)],'operator':yamlOperatorToApi(_0x1b4ef3[_0x528c87(0x25d)])};}const _0x2e2b03=_0x3ce5aa,_0x5b7e49={'type':_0x528c87(0x219),'leftValue':buildLeftValue(_0x2e2b03),'operator':yamlOperatorToApi(_0x2e2b03[_0x528c87(0x25d)]),'exclude':_0x2e2b03['exclude']??![],'arrayMatching':_0x2e2b03['arrayMatching']??_0x528c87(0x24a)};return _0x2e2b03[_0x528c87(0x220)]!==undefined&&(_0x5b7e49['limit']=_0x2e2b03[_0x528c87(0x220)]),_0x5b7e49;}function buildAggregationDefFromApi(_0x319be6){const _0x37f01a=a186_0x1eb4d5,_0x2f98ce=_0x319be6['type'];if(_0x2f98ce===_0x37f01a(0x26a))return{'type':_0x2f98ce,'columns':_0x319be6[_0x37f01a(0x299)]??[]};if(_0x2f98ce===_0x37f01a(0x261)||_0x2f98ce==='Last')return{'type':_0x2f98ce,'column':_0x319be6['column']??'','orderColumn':_0x319be6[_0x37f01a(0x1fd)]??'',..._0x319be6[_0x37f01a(0x205)]&&{'groupingColumns':_0x319be6['groupingColumns']}};if(_0x2f98ce===_0x37f01a(0x203))return{'type':_0x2f98ce,..._0x319be6[_0x37f01a(0x205)]&&{'groupingColumns':_0x319be6[_0x37f01a(0x205)]}};return{'type':_0x2f98ce,'column':_0x319be6[_0x37f01a(0x232)]??'',..._0x319be6['groupingColumns']&&{'groupingColumns':_0x319be6[_0x37f01a(0x205)]}};}function buildLeftValue(_0xe8aabf){const _0x462909=a186_0x1eb4d5,_0x182433={};_0xe8aabf[_0x462909(0x226)]&&_0xe8aabf[_0x462909(0x271)]!==_0x462909(0x28f)&&(_0x182433[_0x462909(0x273)]=_0xe8aabf[_0x462909(0x226)]);if(_0xe8aabf[_0x462909(0x1ee)]){const _0x12c596=_0xe8aabf[_0x462909(0x1ee)];if(_0x12c596[_0x462909(0x271)]===_0x462909(0x26a))_0x182433['aggregation']={'type':_0x462909(0x26a),'columns':_0x12c596[_0x462909(0x299)]};else{if(_0x12c596[_0x462909(0x271)]===_0x462909(0x261)||_0x12c596['type']===_0x462909(0x280))_0x182433[_0x462909(0x1ee)]={'type':_0x12c596[_0x462909(0x271)],'column':_0x12c596[_0x462909(0x232)],'orderColumn':_0x12c596[_0x462909(0x1fd)],..._0x12c596[_0x462909(0x205)]&&{'groupingColumns':_0x12c596[_0x462909(0x205)]}};else _0x12c596[_0x462909(0x271)]==='Count'?_0x182433[_0x462909(0x1ee)]={'type':'Count',..._0x12c596[_0x462909(0x205)]&&{'groupingColumns':_0x12c596[_0x462909(0x205)]}}:_0x182433[_0x462909(0x1ee)]={'type':_0x12c596[_0x462909(0x271)],'column':_0x12c596[_0x462909(0x232)],..._0x12c596['groupingColumns']&&{'groupingColumns':_0x12c596['groupingColumns']}};}}_0xe8aabf[_0x462909(0x294)]&&(_0x182433[_0x462909(0x294)]={'name':_0xe8aabf[_0x462909(0x294)]});const _0x14aa8a=_0xe8aabf[_0x462909(0x271)]===_0x462909(0x28f)?_0xe8aabf[_0x462909(0x290)]:undefined,_0x245700=_0x14aa8a?[buildTimeWindowCondition(_0x14aa8a)]:[],_0x2b387b=[..._0xe8aabf['filter']?.[_0x462909(0x275)]??[],..._0x245700];return _0x2b387b[_0x462909(0x22d)]>0x0&&(_0x182433['filter']=yamlFilterRuleToApi(filterRuleAsRuleDef({'type':_0x462909(0x25a),'conditions':_0x2b387b}))),_0x182433;}function buildTimeWindowCondition(_0x43ce11){const _0x9582e4=a186_0x1eb4d5;return{'type':_0x9582e4(0x278),'column':_0x9582e4(0x254),'operator':{'type':_0x9582e4(0x22e),'value':_0x43ce11[_0x9582e4(0x208)],'unit':_0x43ce11[_0x9582e4(0x288)]}};}function extractTimeWindow(_0x4689dd){const _0x39e1e7=a186_0x1eb4d5;if(!_0x4689dd?.[_0x39e1e7(0x275)]?.['length'])return{'remainingFilter':_0x4689dd};const _0xfa81de=_0x4689dd[_0x39e1e7(0x275)][_0x39e1e7(0x283)](_0x1d5429=>_0x1d5429[_0x39e1e7(0x271)]==='Column'&&_0x1d5429[_0x39e1e7(0x232)]===_0x39e1e7(0x254)&&_0x1d5429['operator']?.[_0x39e1e7(0x271)]===_0x39e1e7(0x22e)&&!_0x1d5429['operator'][_0x39e1e7(0x25f)]&&typeof _0x1d5429[_0x39e1e7(0x25d)][_0x39e1e7(0x262)]===_0x39e1e7(0x277)&&typeof _0x1d5429[_0x39e1e7(0x25d)][_0x39e1e7(0x288)]===_0x39e1e7(0x233));if(_0xfa81de===-0x1)return{'remainingFilter':_0x4689dd};const _0xc3be85=_0x4689dd[_0x39e1e7(0x275)][_0xfa81de],_0x58e4b4=_0x4689dd[_0x39e1e7(0x275)][_0x39e1e7(0x267)]((_0x22796a,_0x675db2)=>_0x675db2!==_0xfa81de);return{'timeWindow':{'duration':_0xc3be85[_0x39e1e7(0x25d)]['value'],'unit':_0xc3be85[_0x39e1e7(0x25d)]['unit']},'remainingFilter':_0x58e4b4['length']>0x0?{..._0x4689dd,'conditions':_0x58e4b4}:undefined};}function yamlOperatorToApi(_0x47906c){const _0x3326e7=a186_0x1eb4d5,_0xa46112={'type':mapYamlOperatorType(_0x47906c[_0x3326e7(0x271)]),'not':_0x47906c[_0x3326e7(0x25f)]??![]};if(isBetweenOperator(_0x47906c[_0x3326e7(0x271)]))return _0x47906c[_0x3326e7(0x296)]!==undefined&&(_0xa46112[_0x3326e7(0x1e6)]=typeof _0x47906c[_0x3326e7(0x296)]===_0x3326e7(0x1f3)?_0x47906c[_0x3326e7(0x296)]:String(_0x47906c[_0x3326e7(0x296)])),_0x47906c[_0x3326e7(0x224)]!==undefined&&(_0xa46112[_0x3326e7(0x270)]=typeof _0x47906c[_0x3326e7(0x224)]===_0x3326e7(0x1f3)?_0x47906c['max']:String(_0x47906c['max'])),_0xa46112;if(_0x47906c[_0x3326e7(0x271)]==='TimeRange')return _0x47906c['duration']&&(_0xa46112[_0x3326e7(0x208)]=_0x47906c[_0x3326e7(0x208)]),_0x47906c['from']&&(_0xa46112['from']=_0x47906c[_0x3326e7(0x24d)]),_0x47906c[_0x3326e7(0x247)]!==undefined&&(_0xa46112[_0x3326e7(0x247)]=_0x47906c[_0x3326e7(0x247)]),_0xa46112;const _0x2840a8=getEffectiveValue(_0x47906c);if(_0x2840a8!==undefined){if(Array[_0x3326e7(0x21b)](_0x2840a8))_0xa46112['rightValues']=_0x2840a8;else isTemporalOperator(_0x47906c[_0x3326e7(0x271)])?_0xa46112[_0x3326e7(0x262)]=_0x2840a8:_0xa46112[_0x3326e7(0x28e)]=_0x2840a8;}return _0x47906c[_0x3326e7(0x288)]&&(_0xa46112[_0x3326e7(0x288)]=_0x47906c[_0x3326e7(0x288)]),_0xa46112;}function mapYamlOperatorType(_0xf35d6b){return _0xf35d6b;}export function toYamlString(_0x53b688){const _0x35746b=a186_0x1eb4d5,_0xdbf08b=JSON['parse'](JSON[_0x35746b(0x210)](_0x53b688)),_0x1cd2fb=a186_0x4ed2e2[_0x35746b(0x210)](_0xdbf08b,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x260e05=[_0x35746b(0x202)];let _0x1436e7=_0x1cd2fb;for(const _0x3bd663 of _0x260e05){_0x1436e7=_0x1436e7['replace'](new RegExp('^('+_0x3bd663+')','m'),(_0x457e01,_0x51d349,_0x77c0f9)=>{if(_0x77c0f9===0x0||_0x1436e7[_0x77c0f9-0x1]==='\x0a'&&_0x1436e7[_0x77c0f9-0x2]==='\x0a')return _0x51d349;return'\x0a'+_0x51d349;});}return _0x1436e7;}export function parseYamlString(_0x306dee){return parseSegmentYamlFile(_0x306dee);}export function isSegmentYaml(_0xe4b166){const _0x144e7f=a186_0x1eb4d5;if(typeof _0xe4b166!==_0x144e7f(0x1f3)||_0xe4b166===null)return![];const _0x32501b=_0xe4b166;return _0x32501b[_0x144e7f(0x271)]==='segment'||_0x32501b['type']===undefined;}export function generateTemplate(_0x352b81=a186_0x1eb4d5(0x1f4)){const _0x213a7d=a186_0x1eb4d5,_0x4083bb={'type':'segment','name':_0x352b81,'description':_0x213a7d(0x29d),'rule':{'type':_0x213a7d(0x25a),'conditions':[{'type':_0x213a7d(0x219),'attribute':_0x213a7d(0x259),'operator':{'type':_0x213a7d(0x24c),'value':_0x213a7d(0x262)}}]}};return toYamlString(_0x4083bb);}export function segmentToYamlString(_0x161f55){const _0x80bbeb=a186_0x1eb4d5,_0x3d713d=JSON[_0x80bbeb(0x258)](JSON[_0x80bbeb(0x210)](_0x161f55)),_0xd38234=a186_0x4ed2e2[_0x80bbeb(0x210)](_0x3d713d,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x80bbeb(0x244)}),_0x44eb9a=[_0x80bbeb(0x202),'activations:'];let _0x3fbe1f=_0xd38234;for(const _0x572a92 of _0x44eb9a){_0x3fbe1f=_0x3fbe1f[_0x80bbeb(0x266)](new RegExp('^('+_0x572a92+')','m'),(_0x52fcad,_0x41f940,_0x4457d9)=>{if(_0x4457d9===0x0||_0x3fbe1f[_0x4457d9-0x1]==='\x0a'&&_0x3fbe1f[_0x4457d9-0x2]==='\x0a')return _0x41f940;return'\x0a'+_0x41f940;});}return _0x3fbe1f;}export function parseSegmentYamlFile(_0x29e007){return safeParseYaml(_0x29e007,SegmentDefSchema);}function a186_0x5d02(){const _0x1258c6=['notification','minutes_interval','source','arrayMatching','min','Between','provides\x20no\x20getMetadata.\x20This\x20is\x20a\x20wiring\x20bug\x20in\x20tdx,\x20not\x20a\x20problem\x20with\x20your\x20YAML.','columns','activation_template_id','syndicationBehaviors','CONNECTION_NOT_FOUND','Segment\x20description','run_after_journey_refresh','notifyOn','usedNames','isFinite','start_at','daily','minute','minValue','toLowerCase','end_on','repeatUnit','12ksiRhN','description','Unknown\x20connection:\x20','259464WHUXRb','aggregation','].attribute\x20cannot\x20be\x20empty.\x0a','joinRow','CONNECTOR_INVALID_CONFIG','order_by','object','New\x20Segment','schedule','27DnuRdK','\x0a\x0aAvailable\x20fields:\x0a','conditions[','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','include','join_row','expr','orderColumn','folder','startAt','Composite','repeatSubFrequency','rule:','Count','kind','groupingColumns','Unknown\x20email\x20recipient:\x20','flatMap','duration','hour','activations','orderBy','endOn','scheduleType','rule','connectorConfig','stringify','match','join_strategy','Cannot\x20build\x20connector_config\x20for\x20activation\x20\x22','formatting','localeCompare','notify_on','leftValue','allColumns','Value','activationParams','isArray','exclude','connectionId','Connector:\x20','joinStrategy','limit','has','Please\x20specify\x20a\x20valid\x20attribute\x20name.','Reference','max','rightValues','attribute','behavior_table','repeatFrequency','lockEnabled','getMetadata','connector_config','6ShzqAt','length','TimeWithinPast','visibility','week','emailRecipients','column','string','9909fzJZsX','segment','day','nestedWorkflowName','set','behavior','isVisible','segmentFolderId','\x22:\x0a','2208065sjuEsm','every','map','add','1473096JRNDoa','connector_config\x20for\x20activation\x20\x22','month','null','get','getSchema','reverse','Invalid\x20connector_config\x20for\x20activation\x20\x22','realtime','any','forEach','Equal','from','resolveSegmentName','\x22:\x20','behaviors','email_recipients','INTERNAL','behaviorTableName','timestamp','lock_enabled','TimeRange','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','parse','attribute_name','And','nested_workflow_name','cron','operator','hourly','not','emailToIdMap','First','value','test','repeat_unit','activationTemplateId','replace','filter','__UNRESOLVED__','nestedWorkflowProjectName','CountDistinct','\x22\x20is\x20a\x20legacy-style\x20connector,\x20but\x20the\x20activation\x20context\x20','nested_workflow_project_name','batch','visible','push','maxValue','type','code','name','5318951oriHmd','conditions','errors','number','Column','354zyCnHE','localRuleToName','attributes','scheduleOption','all_columns','connection','warnings','Last','repeat_frequency','sort','findIndex','monthly','weekly','4ziQrWU','1123670QFYEVg','unit','entries','2200898exNIuI','timezone','repeat_sub_frequency','keys','rightValue','Behavior','timeWindow','all'];a186_0x5d02=function(){return _0x1258c6;};return a186_0x5d02();}export function normalizeChildSegmentYaml(_0x452650){const _0x147ce4=a186_0x1eb4d5;return{'type':_0x147ce4(0x235),'name':_0x452650['name'],..._0x452650[_0x147ce4(0x1eb)]!==undefined&&{'description':_0x452650[_0x147ce4(0x1eb)]},..._0x452650[_0x147ce4(0x1fe)]!==undefined&&{'folder':_0x452650['folder']},..._0x452650[_0x147ce4(0x20e)]&&{'rule':normalizeRule(_0x452650['rule'])},..._0x452650[_0x147ce4(0x204)]!==undefined&&{'kind':_0x452650[_0x147ce4(0x204)]},..._0x452650['visible']!==undefined&&{'visible':_0x452650[_0x147ce4(0x26e)]},..._0x452650[_0x147ce4(0x20a)]&&{'activations':_0x452650['activations'][_0x147ce4(0x23f)](normalizeActivation)}};}export function normalizeRule(_0x1d7471){const _0x10d8c4=a186_0x1eb4d5;return{'type':_0x1d7471['type'],'conditions':_0x1d7471[_0x10d8c4(0x275)][_0x10d8c4(0x23f)](normalizeCondition),..._0x1d7471['description']!==undefined&&{'description':_0x1d7471['description']},..._0x1d7471[_0x10d8c4(0x1fc)]!==undefined&&{'expr':_0x1d7471['expr']}};}function normalizeCondition(_0x4a17cc){const _0x149815=a186_0x1eb4d5;if(_0x149815(0x235)in _0x4a17cc&&(_0x4a17cc[_0x149815(0x271)]===_0x149815(0x1fa)||_0x4a17cc[_0x149815(0x271)]==='exclude')){const _0x4f4d71=_0x4a17cc;return{'type':_0x4f4d71[_0x149815(0x271)],'segment':_0x4f4d71[_0x149815(0x235)]};}if(_0x4a17cc[_0x149815(0x271)]===_0x149815(0x25a)||_0x4a17cc['type']==='Or'||_0x4a17cc[_0x149815(0x271)]===_0x149815(0x200)){const _0x478670=_0x4a17cc;return{'type':_0x478670[_0x149815(0x271)],'conditions':_0x478670[_0x149815(0x275)][_0x149815(0x23f)](normalizeCondition),..._0x478670[_0x149815(0x1eb)]!==undefined&&{'description':_0x478670['description']},..._0x478670[_0x149815(0x1fc)]!==undefined&&{'expr':_0x478670[_0x149815(0x1fc)]}};}if(_0x149815(0x232)in _0x4a17cc&&_0x4a17cc['type']===_0x149815(0x278)){const _0x5bd3de=_0x4a17cc;return{'type':_0x149815(0x278),'column':_0x5bd3de[_0x149815(0x232)],'operator':normalizeOperator(_0x5bd3de[_0x149815(0x25d)])};}if(_0x4a17cc[_0x149815(0x271)]===_0x149815(0x28f)){const _0x1d844d=_0x4a17cc;return{'type':_0x149815(0x28f),'attribute':_0x1d844d[_0x149815(0x226)],'operator':normalizeOperator(_0x1d844d[_0x149815(0x25d)]),..._0x1d844d[_0x149815(0x295)]!==undefined&&{'arrayMatching':_0x1d844d[_0x149815(0x295)]},..._0x1d844d[_0x149815(0x21c)]!==undefined&&{'exclude':_0x1d844d[_0x149815(0x21c)]},..._0x1d844d[_0x149815(0x1ee)]!==undefined&&{'aggregation':_0x1d844d[_0x149815(0x1ee)]},..._0x1d844d[_0x149815(0x294)]!==undefined&&{'source':_0x1d844d['source']},..._0x1d844d[_0x149815(0x267)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x1d844d['filter'])))},..._0x1d844d[_0x149815(0x290)]!==undefined&&{'timeWindow':_0x1d844d[_0x149815(0x290)]},..._0x1d844d[_0x149815(0x220)]!==undefined&&{'limit':_0x1d844d[_0x149815(0x220)]}};}const _0x23d1b5=_0x4a17cc;return{'type':_0x149815(0x219),'attribute':_0x23d1b5[_0x149815(0x226)],'operator':normalizeOperator(_0x23d1b5[_0x149815(0x25d)]),..._0x23d1b5[_0x149815(0x295)]!==undefined&&{'arrayMatching':_0x23d1b5[_0x149815(0x295)]},..._0x23d1b5[_0x149815(0x21c)]!==undefined&&{'exclude':_0x23d1b5[_0x149815(0x21c)]},..._0x23d1b5[_0x149815(0x1ee)]!==undefined&&{'aggregation':_0x23d1b5[_0x149815(0x1ee)]},..._0x23d1b5[_0x149815(0x294)]!==undefined&&{'source':_0x23d1b5[_0x149815(0x294)]},..._0x23d1b5['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x23d1b5[_0x149815(0x267)])))},..._0x23d1b5['limit']!==undefined&&{'limit':_0x23d1b5['limit']}};}function normalizeOperator(_0x5afb4a){const _0x27bd4f=a186_0x1eb4d5;if(isBetweenOperator(_0x5afb4a[_0x27bd4f(0x271)]))return{'type':_0x5afb4a[_0x27bd4f(0x271)],..._0x5afb4a['not']!==undefined&&{'not':_0x5afb4a['not']},..._0x5afb4a[_0x27bd4f(0x296)]!==undefined&&{'min':_0x5afb4a[_0x27bd4f(0x296)]},..._0x5afb4a['max']!==undefined&&{'max':_0x5afb4a['max']}};const _0xa9140c=getEffectiveValue(_0x5afb4a);return{'type':_0x5afb4a['type'],..._0x5afb4a[_0x27bd4f(0x25f)]!==undefined&&{'not':_0x5afb4a['not']},..._0xa9140c!==undefined&&{'value':_0xa9140c},..._0x5afb4a['unit']!==undefined&&{'unit':_0x5afb4a[_0x27bd4f(0x288)]},..._0x5afb4a[_0x27bd4f(0x208)]!==undefined&&{'duration':_0x5afb4a[_0x27bd4f(0x208)]},..._0x5afb4a[_0x27bd4f(0x24d)]!==undefined&&{'from':_0x5afb4a[_0x27bd4f(0x24d)]},..._0x5afb4a[_0x27bd4f(0x247)]!==undefined&&{'reverse':_0x5afb4a['reverse']}};}function normalizeActivation(_0x2d92fa){const _0x653848=a186_0x1eb4d5;return{'name':_0x2d92fa[_0x653848(0x273)],'connection':_0x2d92fa[_0x653848(0x27e)],..._0x2d92fa[_0x653848(0x1eb)]!==undefined&&{'description':_0x2d92fa[_0x653848(0x1eb)]},..._0x2d92fa[_0x653848(0x27d)]!==undefined&&{'all_columns':_0x2d92fa['all_columns']},..._0x2d92fa['columns']!==undefined&&{'columns':_0x2d92fa[_0x653848(0x299)]},..._0x2d92fa[_0x653848(0x239)]!==undefined&&{'behavior':_0x2d92fa[_0x653848(0x239)]},..._0x2d92fa[_0x653848(0x250)]!==undefined&&{'behaviors':_0x2d92fa[_0x653848(0x250)]},..._0x2d92fa[_0x653848(0x1f5)]!==undefined&&{'schedule':_0x2d92fa[_0x653848(0x1f5)]},..._0x2d92fa[_0x653848(0x292)]!==undefined&&{'notification':_0x2d92fa[_0x653848(0x292)]},..._0x2d92fa[_0x653848(0x22b)]!==undefined&&{'connector_config':_0x2d92fa[_0x653848(0x22b)]},..._0x2d92fa[_0x653848(0x29a)]!==undefined&&{'activation_template_id':_0x2d92fa[_0x653848(0x29a)]},..._0x2d92fa['nested_workflow_project_name']!==undefined&&{'nested_workflow_project_name':_0x2d92fa[_0x653848(0x26c)]},..._0x2d92fa['nested_workflow_name']!==undefined&&{'nested_workflow_name':_0x2d92fa['nested_workflow_name']},..._0x2d92fa[_0x653848(0x255)]!==undefined&&{'lock_enabled':_0x2d92fa['lock_enabled']}};}function getColumnName(_0x478468){const _0x3fa964=a186_0x1eb4d5;return _0x478468[_0x3fa964(0x232)]||_0x478468[_0x3fa964(0x273)];}function behaviorApiToDef(_0x10e569){const _0x2e2e11=a186_0x1eb4d5,_0x2d3f71={};return _0x10e569['columns']&&_0x10e569['columns'][_0x2e2e11(0x22d)]>0x0&&(_0x2d3f71['columns']=_0x10e569[_0x2e2e11(0x299)][_0x2e2e11(0x267)](_0x207764=>_0x207764&&getColumnName(_0x207764))[_0x2e2e11(0x23f)](_0x4eae19=>({'name':getColumnName(_0x4eae19),..._0x4eae19[_0x2e2e11(0x271)]&&{'type':_0x4eae19[_0x2e2e11(0x271)]},..._0x4eae19[_0x2e2e11(0x22f)]&&{'visibility':_0x4eae19[_0x2e2e11(0x22f)]}}))),_0x10e569[_0x2e2e11(0x253)]&&(_0x2d3f71[_0x2e2e11(0x227)]=_0x10e569[_0x2e2e11(0x253)]),_0x10e569[_0x2e2e11(0x1f0)]!==undefined&&(_0x2d3f71[_0x2e2e11(0x1fb)]=_0x10e569[_0x2e2e11(0x1f0)]),_0x10e569[_0x2e2e11(0x21f)]&&(_0x2d3f71[_0x2e2e11(0x212)]=_0x10e569[_0x2e2e11(0x21f)]),_0x10e569[_0x2e2e11(0x214)]&&(_0x2d3f71[_0x2e2e11(0x214)]=_0x10e569[_0x2e2e11(0x214)]),_0x10e569[_0x2e2e11(0x20b)]&&_0x10e569[_0x2e2e11(0x20b)][_0x2e2e11(0x22d)]>0x0&&(_0x2d3f71['order_by']=_0x10e569[_0x2e2e11(0x20b)]),_0x2d3f71;}function behaviorsApiToDef(_0x5ba1a2){const _0x51385c=a186_0x1eb4d5;return _0x5ba1a2[_0x51385c(0x23f)](behaviorApiToDef)[_0x51385c(0x267)](_0x30cf7a=>Object[_0x51385c(0x28d)](_0x30cf7a)[_0x51385c(0x22d)]>0x0);}export function activationResponseToDef(_0x4ea459,_0x4fc8b3,_0x1c66f5){const _0x353fda=a186_0x1eb4d5,_0x542641=_0x4ea459[_0x353fda(0x21d)]||'',_0x1d20e5=_0x1c66f5?.[_0x353fda(0x245)](_0x542641)??_0x542641,_0x5de3c4={'name':_0x4ea459[_0x353fda(0x273)],'connection':_0x1d20e5};_0x4ea459[_0x353fda(0x1eb)]&&(_0x5de3c4[_0x353fda(0x1eb)]=_0x4ea459[_0x353fda(0x1eb)]);let _0x3df2bf=[];_0x4ea459[_0x353fda(0x299)]&&_0x4ea459[_0x353fda(0x299)][_0x353fda(0x22d)]>0x0&&(_0x3df2bf=_0x4ea459[_0x353fda(0x299)][_0x353fda(0x267)](_0x5ae1ed=>_0x5ae1ed&&getColumnName(_0x5ae1ed))[_0x353fda(0x23f)](_0x2ce467=>{const _0x1c49f6=_0x353fda,_0x5a58a3=getColumnName(_0x2ce467);if(_0x2ce467[_0x1c49f6(0x271)]||_0x2ce467['visibility'])return{'name':_0x5a58a3,..._0x2ce467[_0x1c49f6(0x271)]&&{'type':_0x2ce467[_0x1c49f6(0x271)]},..._0x2ce467[_0x1c49f6(0x22f)]&&{'visibility':_0x2ce467['visibility']}};return _0x5a58a3;}));_0x3df2bf[_0x353fda(0x22d)]>0x0&&(_0x5de3c4[_0x353fda(0x299)]=_0x3df2bf);_0x4ea459['allColumns']!==undefined&&(_0x4ea459[_0x353fda(0x218)]===![]&&_0x3df2bf[_0x353fda(0x22d)]===0x0?_0x5de3c4[_0x353fda(0x27d)]=!![]:_0x5de3c4[_0x353fda(0x27d)]=_0x4ea459[_0x353fda(0x218)]);const _0x286fc0={};let _0x1e3982=![];_0x4ea459[_0x353fda(0x20d)]&&(_0x286fc0[_0x353fda(0x271)]=_0x4ea459['scheduleType'],_0x1e3982=!![]);_0x4ea459[_0x353fda(0x1e9)]&&(_0x286fc0[_0x353fda(0x264)]=_0x4ea459[_0x353fda(0x1e9)],_0x1e3982=!![]);_0x4ea459['repeatFrequency']!==undefined&&_0x4ea459[_0x353fda(0x228)]!==null&&(_0x286fc0[_0x353fda(0x281)]=_0x4ea459[_0x353fda(0x228)],_0x1e3982=!![]);_0x4ea459[_0x353fda(0x201)]&&_0x4ea459[_0x353fda(0x201)][_0x353fda(0x22d)]>0x0&&(_0x286fc0[_0x353fda(0x28c)]=_0x4ea459[_0x353fda(0x201)],_0x1e3982=!![]);_0x4ea459[_0x353fda(0x1ff)]!==undefined&&(_0x286fc0[_0x353fda(0x1e3)]=_0x4ea459['startAt'],_0x1e3982=!![]);_0x4ea459['endOn']!==undefined&&(_0x286fc0[_0x353fda(0x1e8)]=_0x4ea459[_0x353fda(0x20c)],_0x1e3982=!![]);_0x4ea459[_0x353fda(0x28b)]&&(_0x286fc0[_0x353fda(0x28b)]=_0x4ea459[_0x353fda(0x28b)],_0x1e3982=!![]);_0x1e3982&&(_0x5de3c4['schedule']=_0x286fc0);(_0x4ea459[_0x353fda(0x29f)]&&_0x4ea459[_0x353fda(0x29f)]['length']>0x0||_0x4ea459['emailRecipients']&&_0x4ea459[_0x353fda(0x231)][_0x353fda(0x22d)]>0x0)&&(_0x5de3c4[_0x353fda(0x292)]={},_0x4ea459[_0x353fda(0x29f)]&&_0x4ea459[_0x353fda(0x29f)][_0x353fda(0x22d)]>0x0&&(_0x5de3c4['notification']['notify_on']=_0x4ea459['notifyOn']),_0x4ea459[_0x353fda(0x231)]&&_0x4ea459['emailRecipients'][_0x353fda(0x22d)]>0x0&&(_0x5de3c4['notification']['email_recipients']=_0x4ea459[_0x353fda(0x231)]['map'](_0x5a88cd=>{const _0x5ba768=_0x353fda,_0x5e1201=_0x4fc8b3?.[_0x5ba768(0x245)](_0x5a88cd);return _0x5e1201??String(_0x5a88cd);})));_0x4ea459[_0x353fda(0x20f)]&&Object[_0x353fda(0x28d)](_0x4ea459[_0x353fda(0x20f)])['length']>0x0&&(_0x5de3c4[_0x353fda(0x22b)]=normalizeConnectorConfigForYaml(_0x4ea459[_0x353fda(0x20f)]));_0x4ea459[_0x353fda(0x265)]&&(_0x5de3c4['activation_template_id']=_0x4ea459[_0x353fda(0x265)]);if(_0x4ea459[_0x353fda(0x29b)]&&_0x4ea459['syndicationBehaviors'][_0x353fda(0x22d)]>0x0){const _0x4aa366=behaviorsApiToDef(_0x4ea459['syndicationBehaviors']);_0x4aa366['length']>0x0&&(_0x5de3c4['behaviors']=_0x4aa366);}return _0x4ea459[_0x353fda(0x269)]&&(_0x5de3c4[_0x353fda(0x26c)]=_0x4ea459['nestedWorkflowProjectName']),_0x4ea459[_0x353fda(0x237)]&&(_0x5de3c4[_0x353fda(0x25b)]=_0x4ea459[_0x353fda(0x237)]),_0x4ea459[_0x353fda(0x229)]!==undefined&&(_0x5de3c4['lock_enabled']=_0x4ea459[_0x353fda(0x229)]),_0x5de3c4;}export function journeyActivationStepToYaml(_0x16b664,_0x39ba35,_0x17f0dd){const _0x11dc44=a186_0x1eb4d5,_0x307bc7=_0x16b664['attributes'][_0x11dc44(0x21a)],_0xde062e=_0x307bc7[_0x11dc44(0x21d)]||'',_0x4d9c1c=_0x17f0dd?.[_0x11dc44(0x245)](_0xde062e)??_0xde062e,_0x22fd40={'name':_0x307bc7['name']||'','connection':_0x4d9c1c};_0x16b664[_0x11dc44(0x27b)]['runAfterJourneyRefresh']&&(_0x22fd40[_0x11dc44(0x29e)]=!![]);_0x307bc7[_0x11dc44(0x1eb)]&&(_0x22fd40['description']=_0x307bc7[_0x11dc44(0x1eb)]);let _0x2d8f35=[];_0x307bc7[_0x11dc44(0x299)]&&_0x307bc7['columns'][_0x11dc44(0x22d)]>0x0&&(_0x2d8f35=_0x307bc7['columns'][_0x11dc44(0x267)](_0x1e39f8=>_0x1e39f8&&getColumnName(_0x1e39f8))[_0x11dc44(0x23f)](_0x3f050b=>{const _0x5ea7bf=_0x11dc44,_0x5ae6a8=getColumnName(_0x3f050b);if(_0x3f050b[_0x5ea7bf(0x271)]||_0x3f050b[_0x5ea7bf(0x22f)])return{'name':_0x5ae6a8,..._0x3f050b[_0x5ea7bf(0x271)]&&{'type':_0x3f050b[_0x5ea7bf(0x271)]},..._0x3f050b[_0x5ea7bf(0x22f)]&&{'visibility':_0x3f050b[_0x5ea7bf(0x22f)]}};return _0x5ae6a8;}));_0x2d8f35['length']>0x0&&(_0x22fd40[_0x11dc44(0x299)]=_0x2d8f35);_0x307bc7[_0x11dc44(0x218)]!==undefined&&(_0x307bc7[_0x11dc44(0x218)]===![]&&_0x2d8f35[_0x11dc44(0x22d)]===0x0?_0x22fd40[_0x11dc44(0x27d)]=!![]:_0x22fd40[_0x11dc44(0x27d)]=_0x307bc7[_0x11dc44(0x218)]);const _0x295f4e={};let _0x1f8e8f=![];_0x307bc7[_0x11dc44(0x20d)]&&(_0x295f4e['type']=_0x307bc7['scheduleType'],_0x1f8e8f=!![]);_0x307bc7['repeatUnit']&&(_0x295f4e[_0x11dc44(0x264)]=_0x307bc7[_0x11dc44(0x1e9)],_0x1f8e8f=!![]);_0x307bc7['repeatFrequency']!==undefined&&_0x307bc7[_0x11dc44(0x228)]!==null&&(_0x295f4e[_0x11dc44(0x281)]=_0x307bc7[_0x11dc44(0x228)],_0x1f8e8f=!![]);_0x307bc7[_0x11dc44(0x1ff)]!==undefined&&(_0x295f4e[_0x11dc44(0x1e3)]=_0x307bc7[_0x11dc44(0x1ff)],_0x1f8e8f=!![]);_0x307bc7[_0x11dc44(0x20c)]!==undefined&&(_0x295f4e[_0x11dc44(0x1e8)]=_0x307bc7[_0x11dc44(0x20c)],_0x1f8e8f=!![]);_0x307bc7['timezone']&&(_0x295f4e['timezone']=_0x307bc7[_0x11dc44(0x28b)],_0x1f8e8f=!![]);_0x1f8e8f&&(_0x22fd40['schedule']=_0x295f4e);(_0x307bc7[_0x11dc44(0x29f)]&&_0x307bc7[_0x11dc44(0x29f)][_0x11dc44(0x22d)]>0x0||_0x307bc7[_0x11dc44(0x231)]&&_0x307bc7[_0x11dc44(0x231)][_0x11dc44(0x22d)]>0x0)&&(_0x22fd40['notification']={},_0x307bc7[_0x11dc44(0x29f)]&&_0x307bc7['notifyOn']['length']>0x0&&(_0x22fd40[_0x11dc44(0x292)]['notify_on']=_0x307bc7[_0x11dc44(0x29f)]),_0x307bc7[_0x11dc44(0x231)]&&_0x307bc7[_0x11dc44(0x231)][_0x11dc44(0x22d)]>0x0&&(_0x22fd40[_0x11dc44(0x292)][_0x11dc44(0x251)]=_0x307bc7[_0x11dc44(0x231)][_0x11dc44(0x23f)](_0x4b2226=>{const _0xfea9c0=_0x11dc44,_0x181470=_0x39ba35?.[_0xfea9c0(0x245)](_0x4b2226);return _0x181470??String(_0x4b2226);})));_0x307bc7[_0x11dc44(0x20f)]&&Object[_0x11dc44(0x28d)](_0x307bc7['connectorConfig'])[_0x11dc44(0x22d)]>0x0&&(_0x22fd40['connector_config']=normalizeConnectorConfigForYaml(_0x307bc7[_0x11dc44(0x20f)]));_0x307bc7[_0x11dc44(0x265)]&&(_0x22fd40[_0x11dc44(0x29a)]=_0x307bc7[_0x11dc44(0x265)]);if(_0x307bc7[_0x11dc44(0x29b)]&&_0x307bc7[_0x11dc44(0x29b)][_0x11dc44(0x22d)]>0x0){const _0x294344=behaviorsApiToDef(_0x307bc7[_0x11dc44(0x29b)]);_0x294344[_0x11dc44(0x22d)]>0x0&&(_0x22fd40['behaviors']=_0x294344);}return _0x22fd40;}export function segmentWithActivationsToYaml(_0x86838c,_0x1d76a3,_0x37116a,_0x210b0e,_0x26af4f){const _0x5a1130=a186_0x1eb4d5,_0x23031a=segmentResponseToDefSync(_0x86838c,_0x37116a);return _0x1d76a3[_0x5a1130(0x22d)]>0x0&&(_0x23031a['activations']=_0x1d76a3[_0x5a1130(0x23f)](_0x56f944=>activationResponseToDef(_0x56f944,_0x210b0e,_0x26af4f))),_0x23031a;}function normalizeColumn(_0x43dec3){const _0xf6b449=a186_0x1eb4d5;if(typeof _0x43dec3===_0xf6b449(0x233))return{'column':_0x43dec3,'source':{'column':_0x43dec3}};return{'column':_0x43dec3[_0xf6b449(0x273)],'source':{'column':_0x43dec3[_0xf6b449(0x273)]},..._0x43dec3['type']&&{'type':_0x43dec3[_0xf6b449(0x271)]},..._0x43dec3[_0xf6b449(0x22f)]&&{'visibility':_0x43dec3[_0xf6b449(0x22f)]}};}function behaviorDefToApi(_0x3fa211){const _0xe131cb=a186_0x1eb4d5,_0x1edb35={};if(_0x3fa211[_0xe131cb(0x299)]&&_0x3fa211[_0xe131cb(0x299)][_0xe131cb(0x22d)]>0x0){const _0x135a7a=_0x3fa211[_0xe131cb(0x299)]['filter'](_0x53e473=>typeof _0x53e473==='string'?_0x53e473:_0x53e473[_0xe131cb(0x273)])[_0xe131cb(0x23f)](normalizeColumn);_0x135a7a['length']>0x0&&(_0x1edb35[_0xe131cb(0x299)]=_0x135a7a);}_0x3fa211['behavior_table']&&(_0x1edb35[_0xe131cb(0x253)]=_0x3fa211['behavior_table']);_0x3fa211[_0xe131cb(0x212)]&&(_0x1edb35['joinStrategy']=_0x3fa211[_0xe131cb(0x212)]);if(_0x3fa211[_0xe131cb(0x1fb)]!==undefined)_0x1edb35['joinRow']=_0x3fa211[_0xe131cb(0x1fb)];else{if(_0x3fa211[_0xe131cb(0x212)]===_0xe131cb(0x280)||_0x3fa211['join_strategy']===_0xe131cb(0x261))_0x1edb35[_0xe131cb(0x1f0)]=0x1;else _0x3fa211[_0xe131cb(0x212)]==='All'&&(_0x1edb35[_0xe131cb(0x1f0)]=null);}return _0x3fa211[_0xe131cb(0x214)]&&(_0x1edb35[_0xe131cb(0x214)]=_0x3fa211[_0xe131cb(0x214)]),_0x3fa211[_0xe131cb(0x1f2)]&&(_0x1edb35[_0xe131cb(0x20b)]=_0x3fa211['order_by']),_0x1edb35;}export async function activationDefToCreateRequest(_0x574044,_0x2f4d48){const _0xdf72a6=a186_0x1eb4d5,_0xb6492=_0x2f4d48?.[_0xdf72a6(0x260)],_0x4c4e0d=_0x2f4d48?.['connectionNameToIdMap'],_0x28d9b9=_0x574044['connection'];let _0xd1e7ee;const _0x3ddf8e=parseInt(_0x28d9b9,0xa);if(!isNaN(_0x3ddf8e)&&String(_0x3ddf8e)===_0x28d9b9)_0xd1e7ee=_0x3ddf8e;else{const _0x331422=_0x4c4e0d?.[_0xdf72a6(0x245)](_0x28d9b9);if(_0x331422===undefined)throw new SDKError(ErrorCode[_0xdf72a6(0x29c)],_0xdf72a6(0x1ec)+_0x28d9b9,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0xd1e7ee=_0x331422;}const _0x2c1555={'name':_0x574044['name'],'connectionId':_0xd1e7ee};_0x574044[_0xdf72a6(0x1eb)]&&(_0x2c1555[_0xdf72a6(0x1eb)]=_0x574044['description']);let _0x495a2b=[];_0x574044[_0xdf72a6(0x299)]&&_0x574044['columns']['length']>0x0&&(_0x495a2b=_0x574044[_0xdf72a6(0x299)]['filter'](_0x4c7e92=>_0x4c7e92!=null)[_0xdf72a6(0x23f)](normalizeColumn));_0x495a2b['length']>0x0&&(_0x2c1555['columns']=_0x495a2b);_0x574044['all_columns']!==undefined&&(_0x574044[_0xdf72a6(0x27d)]===![]&&_0x495a2b[_0xdf72a6(0x22d)]===0x0?_0x2c1555[_0xdf72a6(0x218)]=!![]:_0x2c1555[_0xdf72a6(0x218)]=_0x574044[_0xdf72a6(0x27d)]);if(_0x574044[_0xdf72a6(0x1f5)]){const _0x125cdd=_0x574044[_0xdf72a6(0x1f5)],_0x4d1bc1=_0x125cdd[_0xdf72a6(0x271)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x125cdd[_0xdf72a6(0x264)]];_0x4d1bc1&&(_0x2c1555['scheduleType']=_0x4d1bc1);const _0x45580b=_0x125cdd[_0xdf72a6(0x264)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x125cdd[_0xdf72a6(0x271)]];_0x45580b&&(_0x2c1555[_0xdf72a6(0x1e9)]=_0x45580b);_0x125cdd['repeat_frequency']!==undefined&&(_0x2c1555[_0xdf72a6(0x228)]=_0x125cdd[_0xdf72a6(0x281)]);_0x125cdd[_0xdf72a6(0x28c)]&&(_0x2c1555[_0xdf72a6(0x201)]=_0x125cdd[_0xdf72a6(0x28c)]);_0x125cdd[_0xdf72a6(0x1e3)]!==undefined&&(_0x2c1555['startAt']=_0x125cdd[_0xdf72a6(0x1e3)]);_0x125cdd[_0xdf72a6(0x1e8)]!==undefined&&(_0x2c1555['endOn']=_0x125cdd[_0xdf72a6(0x1e8)]);_0x125cdd[_0xdf72a6(0x28b)]&&(_0x2c1555['timezone']=_0x125cdd['timezone']);if(_0x4d1bc1&&_0x4d1bc1!=='none'&&_0x4d1bc1!==_0xdf72a6(0x25c)&&_0x125cdd[_0xdf72a6(0x1e3)]){const _0x1d5694=_0x125cdd[_0xdf72a6(0x1e3)][_0xdf72a6(0x211)](/T(\d{2}:\d{2})/);_0x1d5694&&(_0x2c1555[_0xdf72a6(0x27c)]=_0x1d5694[0x1]);}}_0x574044[_0xdf72a6(0x292)]&&(_0x574044[_0xdf72a6(0x292)][_0xdf72a6(0x216)]&&(_0x2c1555[_0xdf72a6(0x29f)]=_0x574044[_0xdf72a6(0x292)][_0xdf72a6(0x216)]),_0x574044[_0xdf72a6(0x292)][_0xdf72a6(0x251)]&&(_0x2c1555[_0xdf72a6(0x231)]=_0x574044[_0xdf72a6(0x292)][_0xdf72a6(0x251)][_0xdf72a6(0x23f)](_0x5418a0=>{const _0x51f536=_0xdf72a6,_0x2435f0=Number(_0x5418a0);if(!isNaN(_0x2435f0)&&String(_0x2435f0)===_0x5418a0)return _0x2435f0;const _0x1b5932=_0xb6492?.[_0x51f536(0x245)](_0x5418a0[_0x51f536(0x1e7)]());if(_0x1b5932===undefined)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x51f536(0x206)+_0x5418a0+_0x51f536(0x1f9));return _0x1b5932;})));if(_0x574044['connector_config']){const _0x56fde5=_0x2f4d48?.['connectionNameToTypeMap']?.[_0xdf72a6(0x245)](_0x28d9b9);_0x2c1555[_0xdf72a6(0x20f)]=_0x574044[_0xdf72a6(0x22b)];if(_0x56fde5&&_0x2f4d48?.[_0xdf72a6(0x246)]){let _0x4f67e4;try{_0x4f67e4=await _0x2f4d48['getSchema'](_0x56fde5);const _0x1efac1=validateConnectorConfig(_0x574044[_0xdf72a6(0x22b)],_0x4f67e4);if(!_0x1efac1['valid'])throw new SDKError(ErrorCode[_0xdf72a6(0x1f1)],_0xdf72a6(0x248)+_0x574044[_0xdf72a6(0x273)]+_0xdf72a6(0x23c)+formatValidationErrors(_0x1efac1[_0xdf72a6(0x276)]),undefined,{'helpText':_0xdf72a6(0x21e)+_0x56fde5+_0xdf72a6(0x1f7)+formatSchemaAsHelp(_0x4f67e4)});if(_0x1efac1['warnings'][_0xdf72a6(0x22d)]>0x0){const _0x30464b=formatValidationWarnings(_0x1efac1[_0xdf72a6(0x27f)]);console['warn'](_0xdf72a6(0x242)+_0x574044['name']+_0xdf72a6(0x23c)+_0x30464b);}}catch(_0x5ba0d3){if(!(_0x5ba0d3 instanceof SDKError)||_0x5ba0d3[_0xdf72a6(0x272)]!==ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])throw _0x5ba0d3;}if(_0x4f67e4&&getLegacySettingsField(_0x4f67e4)){if(!_0x2f4d48?.[_0xdf72a6(0x22a)])throw new SDKError(ErrorCode[_0xdf72a6(0x252)],_0xdf72a6(0x213)+_0x574044[_0xdf72a6(0x273)]+_0xdf72a6(0x24f)+('\x22'+_0x56fde5+_0xdf72a6(0x26b))+_0xdf72a6(0x298));const _0x548d04=await _0x2f4d48[_0xdf72a6(0x22a)](_0x56fde5);_0x2c1555[_0xdf72a6(0x20f)]=transformConfigToLegacy(_0x574044[_0xdf72a6(0x22b)],_0x548d04);}}}else _0x2c1555['connectorConfig']={};_0x574044[_0xdf72a6(0x29a)]!==undefined&&(_0x2c1555[_0xdf72a6(0x265)]=_0x574044['activation_template_id']);if(_0x574044[_0xdf72a6(0x250)])_0x2c1555[_0xdf72a6(0x29b)]=_0x574044[_0xdf72a6(0x250)][_0xdf72a6(0x23f)](behaviorDefToApi);else _0x574044[_0xdf72a6(0x239)]&&(_0x2c1555['syndicationBehavior']=behaviorDefToApi(_0x574044[_0xdf72a6(0x239)]));return _0x574044[_0xdf72a6(0x26c)]&&(_0x2c1555[_0xdf72a6(0x269)]=_0x574044[_0xdf72a6(0x26c)]),_0x574044[_0xdf72a6(0x25b)]&&(_0x2c1555[_0xdf72a6(0x237)]=_0x574044[_0xdf72a6(0x25b)]),_0x574044[_0xdf72a6(0x255)]!==undefined&&(_0x2c1555[_0xdf72a6(0x229)]=_0x574044['lock_enabled']),_0x2c1555;}export async function activationDefToUpdateRequest(_0x553e69,_0x1affbd){return activationDefToCreateRequest(_0x553e69,_0x1affbd);}export function deepSortObject(_0x2babf8){const _0x44e564=a186_0x1eb4d5;if(_0x2babf8===null||typeof _0x2babf8!=='object')return _0x2babf8;if(Array[_0x44e564(0x21b)](_0x2babf8))return _0x2babf8['map'](deepSortObject)[_0x44e564(0x282)]((_0x1141bb,_0x5df070)=>JSON[_0x44e564(0x210)](_0x1141bb)[_0x44e564(0x215)](JSON['stringify'](_0x5df070)));const _0x610a72=_0x2babf8;if(_0x610a72[_0x44e564(0x271)]===_0x44e564(0x200)&&Array[_0x44e564(0x21b)](_0x610a72['conditions'])){const _0x478ec2={};for(const _0x3297c9 of Object[_0x44e564(0x28d)](_0x610a72)[_0x44e564(0x282)]()){_0x478ec2[_0x3297c9]=_0x3297c9===_0x44e564(0x275)?_0x610a72[_0x44e564(0x275)][_0x44e564(0x23f)](deepSortObject):deepSortObject(_0x610a72[_0x3297c9]);}return _0x478ec2;}const _0x16f9ee={};for(const _0x56f176 of Object['keys'](_0x2babf8)[_0x44e564(0x282)]()){_0x16f9ee[_0x56f176]=deepSortObject(_0x2babf8[_0x56f176]);}return _0x16f9ee;}export function serializeRule(_0x27136b){const _0x3c622c=a186_0x1eb4d5;return JSON[_0x3c622c(0x210)](deepSortObject(_0x27136b));}export function normalizeRuleForMatching(_0x1a16ff){return normalizeConditionsForMatching(_0x1a16ff);}function normalizeConditionsForMatching(_0x3b8a4a){const _0x1fa51d=a186_0x1eb4d5;if(_0x3b8a4a===null||typeof _0x3b8a4a!==_0x1fa51d(0x1f3))return _0x3b8a4a;if(Array[_0x1fa51d(0x21b)](_0x3b8a4a))return _0x3b8a4a[_0x1fa51d(0x23f)](normalizeConditionsForMatching);const _0x50dbc8=_0x3b8a4a;if((_0x50dbc8[_0x1fa51d(0x271)]==='include'||_0x50dbc8[_0x1fa51d(0x271)]===_0x1fa51d(0x21c))&&typeof _0x50dbc8[_0x1fa51d(0x235)]===_0x1fa51d(0x233))return{..._0x50dbc8,'segment':'__SEGMENT_REF__'};const _0x58ae85={};for(const _0x4a9837 of Object[_0x1fa51d(0x28d)](_0x50dbc8)){_0x58ae85[_0x4a9837]=normalizeConditionsForMatching(_0x50dbc8[_0x4a9837]);}return _0x58ae85;}export function serializeRuleForMatching(_0x5d3274){const _0x2e75ed=a186_0x1eb4d5;return JSON[_0x2e75ed(0x210)](deepSortObject(normalizeRuleForMatching(_0x5d3274)));}export function expandSegmentReferences(_0x460384,_0x323dba,_0x2aa744=new Set()){return expandConditions(_0x460384,_0x323dba,_0x2aa744);}function a186_0x484a(_0x47719a,_0x97b853){_0x47719a=_0x47719a-0x1e1;const _0x5d0229=a186_0x5d02();let _0x484adf=_0x5d0229[_0x47719a];return _0x484adf;}function expandConditions(_0x1553a2,_0x3420d5,_0x1c7165){const _0x35b9ca=a186_0x1eb4d5;if(_0x1553a2===null||typeof _0x1553a2!==_0x35b9ca(0x1f3))return _0x1553a2;if(Array[_0x35b9ca(0x21b)](_0x1553a2))return _0x1553a2['map'](_0x15d8af=>expandConditions(_0x15d8af,_0x3420d5,_0x1c7165));const _0x18cdf7=_0x1553a2;if((_0x18cdf7[_0x35b9ca(0x271)]===_0x35b9ca(0x1fa)||_0x18cdf7['type']==='exclude')&&typeof _0x18cdf7[_0x35b9ca(0x235)]==='string'){const _0x59eb9a=_0x18cdf7['segment'],_0x43b5b9=_0x3420d5[_0x35b9ca(0x245)](_0x59eb9a);if(_0x43b5b9&&!_0x1c7165[_0x35b9ca(0x221)](_0x59eb9a)){const _0x5399cb=new Set(_0x1c7165);_0x5399cb[_0x35b9ca(0x240)](_0x59eb9a);const _0xa553d0=expandConditions(_0x43b5b9,_0x3420d5,_0x5399cb);return{'type':_0x18cdf7[_0x35b9ca(0x271)],'expanded_rule':_0xa553d0};}return{'type':_0x18cdf7[_0x35b9ca(0x271)],'expanded_rule':_0x35b9ca(0x268)};}const _0x11403e={};for(const _0xbcafd9 of Object[_0x35b9ca(0x28d)](_0x18cdf7)){_0x11403e[_0xbcafd9]=expandConditions(_0x18cdf7[_0xbcafd9],_0x3420d5,_0x1c7165);}return _0x11403e;}export function serializeExpandedRule(_0x2bdaae,_0x2d6f00){const _0x27c592=a186_0x1eb4d5,_0x2fe831=expandSegmentReferences(_0x2bdaae,_0x2d6f00);return JSON[_0x27c592(0x210)](deepSortObject(_0x2fe831));}export function createSegmentNameContext(_0x32e2f9){const _0x2e309e=a186_0x1eb4d5,_0x2d5871=new Set(),_0x554a82=new Map(),_0x37ca2b=new Map();if(_0x32e2f9)for(const [_0x467127,_0x1b420e]of Object[_0x2e309e(0x289)](_0x32e2f9)){if(_0x1b420e[_0x2e309e(0x20e)]){const _0x586f01=serializeRule(_0x1b420e[_0x2e309e(0x20e)]);_0x37ca2b[_0x2e309e(0x238)](_0x586f01,_0x467127),_0x2d5871[_0x2e309e(0x240)](_0x467127);}}return{'usedNames':_0x2d5871,'ruleHashToName':_0x554a82,'localRuleToName':_0x32e2f9?_0x37ca2b:undefined};}export function resolveSegmentName(_0x528853,_0x300b9b,_0x589710,_0x4b068b){const _0x303db4=a186_0x1eb4d5,_0x330fb5=serializeRule(_0x300b9b);if(_0x589710[_0x303db4(0x27a)]){const _0x417342=_0x589710[_0x303db4(0x27a)]['get'](_0x330fb5);if(_0x417342)return{'name':_0x417342,'isDuplicate':![],'isLocalMatch':!![]};}const _0x3a1c2d=_0x589710['ruleHashToName']['get'](_0x330fb5);if(_0x3a1c2d)return{'name':_0x3a1c2d,'isDuplicate':!![],'isLocalMatch':![]};const _0x181d98=_0x4b068b(_0x528853);let _0xda3bf8=_0x181d98||_0x528853,_0x2f7b1c=_0xda3bf8,_0xa57bc3=0x2;while(_0x589710[_0x303db4(0x1e1)][_0x303db4(0x221)](_0x2f7b1c)){_0x2f7b1c=_0xda3bf8+'_'+_0xa57bc3,_0xa57bc3++;}return _0x589710[_0x303db4(0x1e1)][_0x303db4(0x240)](_0x2f7b1c),_0x589710['ruleHashToName'][_0x303db4(0x238)](_0x330fb5,_0x2f7b1c),{'name':_0x2f7b1c,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x4dc8ca){const _0x58c64a=[],_0x3277f7=_0x3b96af=>{const _0x5940e0=a186_0x484a;if(!_0x3b96af||typeof _0x3b96af!==_0x5940e0(0x1f3))return;if(Array[_0x5940e0(0x21b)](_0x3b96af)){_0x3b96af[_0x5940e0(0x24b)](_0x3277f7);return;}const _0x3c588b=_0x3b96af;(_0x3c588b['type']===_0x5940e0(0x1fa)||_0x3c588b['type']==='exclude')&&typeof _0x3c588b[_0x5940e0(0x235)]===_0x5940e0(0x233)&&_0x58c64a[_0x5940e0(0x26f)](_0x3c588b[_0x5940e0(0x235)]);for(const _0x286b3b of Object['values'](_0x3c588b)){_0x3277f7(_0x286b3b);}};return _0x3277f7(_0x4dc8ca),_0x58c64a;}export function validateSegmentRule(_0xa4dc46,_0x10fde8){const _0x10f424=a186_0x1eb4d5;if(!_0x10fde8||!_0x10fde8['conditions'])return;for(let _0x314e84=0x0;_0x314e84<_0x10fde8[_0x10f424(0x275)]['length'];_0x314e84++){const _0x59496c=_0x10fde8[_0x10f424(0x275)][_0x314e84];if(_0x10f424(0x271)in _0x59496c&&_0x59496c[_0x10f424(0x271)]===_0x10f424(0x219)){const _0x13640f=_0x59496c,_0x1217b5=_0x13640f[_0x10f424(0x294)]||_0x13640f[_0x10f424(0x1ee)];if((!_0x13640f[_0x10f424(0x226)]||_0x13640f[_0x10f424(0x226)]==='')&&!_0x1217b5)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x10f424(0x257)+_0xa4dc46+'\x27:\x20'+(_0x10f424(0x1f8)+_0x314e84+_0x10f424(0x1ef))+_0x10f424(0x222));}}}
1
+ const a193_0x1454d0=a193_0x2c65;(function(_0x31db93,_0x2704ad){const _0x2cf5d9=a193_0x2c65,_0x4de090=_0x31db93();while(!![]){try{const _0x241f2c=parseInt(_0x2cf5d9(0x201))/0x1+parseInt(_0x2cf5d9(0x1d1))/0x2*(-parseInt(_0x2cf5d9(0x25c))/0x3)+-parseInt(_0x2cf5d9(0x1e2))/0x4+parseInt(_0x2cf5d9(0x263))/0x5+parseInt(_0x2cf5d9(0x24d))/0x6*(-parseInt(_0x2cf5d9(0x1e6))/0x7)+parseInt(_0x2cf5d9(0x22c))/0x8*(-parseInt(_0x2cf5d9(0x256))/0x9)+parseInt(_0x2cf5d9(0x1b1))/0xa;if(_0x241f2c===_0x2704ad)break;else _0x4de090['push'](_0x4de090['shift']());}catch(_0x151bbf){_0x4de090['push'](_0x4de090['shift']());}}}(a193_0x3f4c,0x5a544));import*as a193_0x2e02c5 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp,getLegacySettingsField}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a193_0x1454d0(0x1fa),'hourly':a193_0x1454d0(0x241),'weekly':'week','monthly':'month','minutes_interval':a193_0x1454d0(0x1f8)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a193_0x1454d0(0x1f3),'hour':a193_0x1454d0(0x208),'week':'weekly','month':a193_0x1454d0(0x25b),'minute':a193_0x1454d0(0x1c1)};function filterRuleAsRuleDef(_0x53e748){return _0x53e748;}function ruleDefAsFilterRule(_0x596f5f){return _0x596f5f;}export function segmentResponseToDefSync(_0x2b35bc,_0xed5ae6){const _0x36a78c=a193_0x1454d0,_0x3e8955=_0x2b35bc[_0x36a78c(0x1f4)]&&_0x36a78c(0x1de)in _0x2b35bc[_0x36a78c(0x1f4)]&&_0x2b35bc[_0x36a78c(0x1f4)][_0x36a78c(0x1de)];return{'type':'segment','name':_0x2b35bc[_0x36a78c(0x204)],..._0x2b35bc[_0x36a78c(0x202)]&&{'description':_0x2b35bc[_0x36a78c(0x202)]},..._0xed5ae6&&{'folder':_0xed5ae6},..._0x3e8955&&{'rule':apiRuleToYaml(_0x2b35bc[_0x36a78c(0x1f4)])},..._0x2b35bc[_0x36a78c(0x228)]!==undefined&&{'kind':_0x2b35bc['kind']===0x0?_0x36a78c(0x266):_0x2b35bc[_0x36a78c(0x228)]===0x1?'realtime':_0x36a78c(0x1dd)},..._0x2b35bc['isVisible']!==undefined&&{'visible':_0x2b35bc[_0x36a78c(0x20f)]}};}export async function segmentResponseToDef(_0x57344a,_0x538cfe,_0x34f202){const _0x3b109b=a193_0x1454d0,_0x57bd7f=segmentResponseToDefSync(_0x57344a,_0x34f202);if(!_0x538cfe||!_0x538cfe[_0x3b109b(0x22f)])return _0x57bd7f;return _0x57bd7f[_0x3b109b(0x1f4)]&&(_0x57bd7f['rule']=await resolveRuleSegmentRefs(_0x57bd7f[_0x3b109b(0x1f4)],_0x538cfe[_0x3b109b(0x22f)])),_0x57bd7f;}export function apiRuleToYaml(_0x60b603){const _0x15cebd=a193_0x1454d0;if(_0x60b603['type']===_0x15cebd(0x24e))return{'type':_0x15cebd(0x24e),'conditions':(_0x60b603['conditions']||[])[_0x15cebd(0x1d0)](apiConditionToYaml),..._0x60b603[_0x15cebd(0x202)]!==undefined&&{'description':_0x60b603['description']},..._0x60b603[_0x15cebd(0x1d2)]!==undefined&&{'expr':_0x60b603[_0x15cebd(0x1d2)]}};const _0x44d4cd=(_0x60b603[_0x15cebd(0x244)]||[])[_0x15cebd(0x1fd)](_0xed7453=>{const _0x49cccf=_0x15cebd,_0x38f826=apiConditionToYaml(_0xed7453);if(isCompositeType(_0x38f826)&&_0x38f826[_0x49cccf(0x202)]!==undefined){const _0x5a5be2=_0x38f826;if(_0x5a5be2[_0x49cccf(0x244)][_0x49cccf(0x20d)]===0x1)return _0x5a5be2[_0x49cccf(0x244)];return[{'type':_0x5a5be2[_0x49cccf(0x1de)],'conditions':_0x5a5be2[_0x49cccf(0x244)]}];}return[_0x38f826];});if(_0x44d4cd['length']===0x1&&!_0x60b603['description']&&isCompositeType(_0x44d4cd[0x0])){const _0x398c7d=_0x44d4cd[0x0];if(_0x398c7d[_0x15cebd(0x1de)]===_0x60b603['type']&&_0x398c7d[_0x15cebd(0x244)]&&_0x398c7d[_0x15cebd(0x202)]===undefined)return{'type':_0x60b603[_0x15cebd(0x1de)],'conditions':_0x398c7d[_0x15cebd(0x244)]};}return{'type':_0x60b603[_0x15cebd(0x1de)],'conditions':_0x44d4cd};}export async function resolveRuleSegmentRefs(_0x299161,_0x13102c){const _0x52e03c=a193_0x1454d0;return transformRuleSegmentRefs(_0x299161,_0x13102c,_0x3bfd4a=>/^\d+$/[_0x52e03c(0x264)](_0x3bfd4a));}async function transformConditionSegmentRefs(_0x4bf4c1,_0xcbe83a,_0x5c07aa,_0x1e264d){const _0x5cec69=a193_0x1454d0;if(_0x5cec69(0x247)in _0x4bf4c1&&(_0x4bf4c1[_0x5cec69(0x1de)]===_0x5cec69(0x1db)||_0x4bf4c1['type']===_0x5cec69(0x22b))){const _0x2f641c=_0x4bf4c1;if(_0x5c07aa(_0x2f641c[_0x5cec69(0x247)]))return{..._0x2f641c,'segment':await _0xcbe83a(_0x2f641c[_0x5cec69(0x247)])};return _0x4bf4c1;}if('conditions'in _0x4bf4c1&&_0x4bf4c1[_0x5cec69(0x244)]){const _0x55048a=_0x4bf4c1,_0x41fc2f=await Promise['all'](_0x55048a['conditions'][_0x5cec69(0x1d0)](_0x28eb5d=>transformConditionSegmentRefs(_0x28eb5d,_0xcbe83a,_0x5c07aa,_0x1e264d)));return{..._0x55048a,'conditions':_0x41fc2f};}if(_0x5cec69(0x1f0)in _0x4bf4c1&&_0x4bf4c1[_0x5cec69(0x1f0)]){const _0x5a0c6c=_0x4bf4c1,_0x10c593=await _0x1e264d(filterRuleAsRuleDef(_0x5a0c6c[_0x5cec69(0x1f0)]),_0xcbe83a);return{..._0x5a0c6c,'filter':ruleDefAsFilterRule(_0x10c593)};}return _0x4bf4c1;}async function transformRuleSegmentRefs(_0x126665,_0x49cc57,_0x2d20b5){const _0x573aa5=a193_0x1454d0,_0x310993=(_0x35d296,_0x33fb86)=>transformRuleSegmentRefs(_0x35d296,_0x33fb86,_0x2d20b5),_0x21b849=await Promise['all'](_0x126665[_0x573aa5(0x244)][_0x573aa5(0x1d0)](_0x13d4f=>transformConditionSegmentRefs(_0x13d4f,_0x49cc57,_0x2d20b5,_0x310993)));return{..._0x126665,'conditions':_0x21b849};}function a193_0x3f4c(){const _0x4714a4=['cron','hourly','localRuleToName','string','Between','folder','length','connectorConfig','isVisible','toLowerCase','usedNames','from','rule:','Column','connectionId','behaviors','stringify','activationTemplateId','warn','behaviorTableName','attribute','CONNECTION_NOT_FOUND','rightValues','operator','reverse','warnings','Unknown\x20email\x20recipient:\x20','lock_enabled','attribute_name','Reference','getSchema','Segment\x20description','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','kind','notifyOn','arrayMatching','exclude','752PyYKxm','limit','code','resolveSegmentName','repeat_unit','get','allColumns','TimeWithinNext','__UNRESOLVED__','endOn','all_columns','TimeRange','source','connectionNameToIdMap','repeatFrequency','CONNECTOR_INVALID_CONFIG','unit','timestamp','emailToIdMap','Behavior','timezone','hour','match','runAfterJourneyRefresh','conditions','joinStrategy','has','segment','TimeWithinPast','Last','Please\x20specify\x20a\x20valid\x20attribute\x20name.','number','And','18mtMXjq','Composite','none','joinRow','min','notify_on','end_on','\x22:\x20','CONNECTOR_SCHEMA_NOT_FOUND','7578DLqGQK','run_after_journey_refresh','__SEGMENT_REF__','attributes','formatting','monthly','18807MsyhuJ','email_recipients','maxValue','ruleHashToName','\x22\x20is\x20a\x20legacy-style\x20connector,\x20but\x20the\x20activation\x20context\x20','column','max','2110165pktQZc','test','isArray','batch','nestedWorkflowProjectName','notification','not','10122310dkSpnF','visibility','orderBy','join_row','repeat_sub_frequency','forEach','entries','columns','].attribute\x20cannot\x20be\x20empty.\x0a','timeWindow','leftValue','connector_config\x20for\x20activation\x20\x22','emailRecipients','startAt','scheduleType','every','minutes_interval','INVALID_ARGUMENT','repeat_frequency','INTERNAL','realtime','connector_config','aggregation','rightValue','connectionNameToTypeMap','schedule','CountDistinct','duration','lockEnabled','add','Count','map','202JaCEDO','expr','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','Cannot\x20build\x20connector_config\x20for\x20activation\x20\x22','minValue','behavior','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','keys','set','Value','include','object','funnel_stage','type','conditions[','syndicationBehaviors','values','1532664IbTflp','activations:','activations','activation_template_id','658763wVPxOs','start_at','behavior_table','getMetadata','nested_workflow_name','any','findIndex','repeatUnit','nested_workflow_project_name','sort','filter','repeatSubFrequency','connection','daily','rule','order_by','visible','join_strategy','minute','nestedWorkflowName','day','First','errors','flatMap','\x22:\x0a','push','groupingColumns','313534XenaRM','description','value','name','parse','orderColumn'];a193_0x3f4c=function(){return _0x4714a4;};return a193_0x3f4c();}export async function resolveRuleSegmentIds(_0x4be79a,_0x9265ea){const _0x51a311=a193_0x1454d0;return transformRuleSegmentRefs(_0x4be79a,_0x9265ea,_0x22e704=>!/^\d+$/[_0x51a311(0x264)](_0x22e704));}function isCompositeType(_0x4739b7){const _0x44b453=a193_0x1454d0;return _0x4739b7[_0x44b453(0x1de)]==='And'||_0x4739b7[_0x44b453(0x1de)]==='Or'||_0x4739b7['type']===_0x44b453(0x24e);}function isBehaviorApiCondition(_0x20515c){const _0x5587ab=a193_0x1454d0;if(!_0x20515c[_0x5587ab(0x1bb)]?.[_0x5587ab(0x238)]?.[_0x5587ab(0x204)])return![];return!![];}function apiConditionToYaml(_0xeac229){const _0x31be7c=a193_0x1454d0;if(_0xeac229[_0x31be7c(0x1de)]==='And'||_0xeac229[_0x31be7c(0x1de)]==='Or'){if(_0xeac229[_0x31be7c(0x244)]){const _0x3318ba=_0xeac229[_0x31be7c(0x244)]['map'](apiConditionToYaml),_0x31df79=_0xeac229[_0x31be7c(0x202)]!==undefined;if(_0x3318ba[_0x31be7c(0x20d)]===0x1&&!_0x31df79)return _0x3318ba[0x0];return{'type':_0xeac229[_0x31be7c(0x1de)],'conditions':_0x3318ba,..._0xeac229[_0x31be7c(0x202)]!==undefined&&{'description':_0xeac229['description']}};}}if(_0xeac229[_0x31be7c(0x1de)]===_0x31be7c(0x24e)&&_0xeac229[_0x31be7c(0x244)])return{'type':_0x31be7c(0x24e),'conditions':_0xeac229['conditions'][_0x31be7c(0x1d0)](apiConditionToYaml),..._0xeac229[_0x31be7c(0x202)]!==undefined&&{'description':_0xeac229['description']},..._0xeac229[_0x31be7c(0x1d2)]!==undefined&&{'expr':_0xeac229[_0x31be7c(0x1d2)]}};if(_0xeac229[_0x31be7c(0x1de)]==='Value'&&_0xeac229[_0x31be7c(0x1bb)]&&_0xeac229[_0x31be7c(0x21e)]){const _0x493444=_0xeac229['leftValue'][_0x31be7c(0x1c7)]?buildAggregationDefFromApi(_0xeac229[_0x31be7c(0x1bb)][_0x31be7c(0x1c7)]):undefined;if(isBehaviorApiCondition(_0xeac229)){const _0x188e7a=_0xeac229['leftValue'][_0x31be7c(0x238)][_0x31be7c(0x204)],{timeWindow:_0x165f15,remainingFilter:_0x5c5a30}=extractTimeWindow(_0xeac229[_0x31be7c(0x1bb)]['filter']);return{'type':_0x31be7c(0x23f),'attribute':'','operator':apiOperatorToYaml(_0xeac229['operator']),..._0xeac229[_0x31be7c(0x22a)]&&_0xeac229['arrayMatching']!==_0x31be7c(0x1eb)?{'arrayMatching':_0xeac229['arrayMatching']}:{},..._0xeac229[_0x31be7c(0x22b)]?{'exclude':_0xeac229[_0x31be7c(0x22b)]}:{},..._0x493444?{'aggregation':_0x493444}:{},'source':_0x188e7a,..._0x165f15?{'timeWindow':_0x165f15}:{},..._0x5c5a30?{'filter':apiRuleToYaml(_0x5c5a30)}:{},..._0xeac229[_0x31be7c(0x22d)]!==undefined&&_0xeac229['limit']!==null?{'limit':_0xeac229[_0x31be7c(0x22d)]}:{}};}return{'type':_0x31be7c(0x1da),'attribute':_0xeac229[_0x31be7c(0x1bb)][_0x31be7c(0x204)]||'','operator':apiOperatorToYaml(_0xeac229[_0x31be7c(0x21e)]),..._0xeac229[_0x31be7c(0x22a)]&&_0xeac229[_0x31be7c(0x22a)]!==_0x31be7c(0x1eb)?{'arrayMatching':_0xeac229[_0x31be7c(0x22a)]}:{},..._0xeac229[_0x31be7c(0x22b)]?{'exclude':_0xeac229['exclude']}:{},..._0x493444?{'aggregation':_0x493444}:{},..._0xeac229[_0x31be7c(0x1bb)][_0x31be7c(0x1f0)]?{'filter':apiRuleToYaml(_0xeac229['leftValue']['filter'])}:{},..._0xeac229[_0x31be7c(0x22d)]!==undefined&&_0xeac229[_0x31be7c(0x22d)]!==null?{'limit':_0xeac229[_0x31be7c(0x22d)]}:{}};}if(_0xeac229[_0x31be7c(0x1de)]===_0x31be7c(0x214)&&_0xeac229[_0x31be7c(0x261)]&&_0xeac229[_0x31be7c(0x21e)])return{'type':_0x31be7c(0x214),'column':_0xeac229[_0x31be7c(0x261)],'operator':apiOperatorToYaml(_0xeac229['operator'])};if(_0xeac229[_0x31be7c(0x1de)]===_0x31be7c(0x224)&&_0xeac229['id'])return{'type':_0xeac229[_0x31be7c(0x22b)]?_0x31be7c(0x22b):_0x31be7c(0x1db),'segment':_0xeac229['id']};return{'type':_0x31be7c(0x24c),'conditions':[]};}function isTemporalOperator(_0x2a68a9){const _0x432a7a=a193_0x1454d0;return _0x2a68a9===_0x432a7a(0x248)||_0x2a68a9===_0x432a7a(0x233);}function isBetweenOperator(_0x501faa){const _0x49b7c8=a193_0x1454d0;return _0x501faa===_0x49b7c8(0x20b);}function getEffectiveValue(_0xf5a02c){const _0x43ed78=a193_0x1454d0,_0x2d877d=_0xf5a02c[_0x43ed78(0x1e1)];return _0xf5a02c[_0x43ed78(0x203)]??_0x2d877d;}function parseNumericValue(_0x1bc8e2){const _0x4319c6=a193_0x1454d0;if(typeof _0x1bc8e2===_0x4319c6(0x1dc)&&_0x1bc8e2!==null)return _0x1bc8e2;if(_0x1bc8e2==='')return _0x1bc8e2;const _0x592ec7=Number(_0x1bc8e2);return Number['isFinite'](_0x592ec7)?_0x592ec7:_0x1bc8e2;}function apiOperatorToYaml(_0x4df43c){const _0x183749=a193_0x1454d0;if(isBetweenOperator(_0x4df43c[_0x183749(0x1de)]))return{'type':mapApiOperatorType(_0x4df43c[_0x183749(0x1de)]),..._0x4df43c[_0x183749(0x1b0)]!==undefined&&{'not':_0x4df43c[_0x183749(0x1b0)]},..._0x4df43c[_0x183749(0x1d5)]!==undefined&&{'min':parseNumericValue(_0x4df43c[_0x183749(0x1d5)])},..._0x4df43c[_0x183749(0x25e)]!==undefined&&{'max':parseNumericValue(_0x4df43c['maxValue'])}};if(_0x4df43c[_0x183749(0x1de)]===_0x183749(0x237))return{'type':_0x183749(0x237),..._0x4df43c['not']!==undefined&&{'not':_0x4df43c['not']},..._0x4df43c[_0x183749(0x1cc)]!==undefined&&{'duration':_0x4df43c['duration']},..._0x4df43c['from']!==undefined&&{'from':_0x4df43c[_0x183749(0x212)]},..._0x4df43c[_0x183749(0x21f)]!==undefined&&{'reverse':_0x4df43c[_0x183749(0x21f)]}};let _0x81cb86;if(_0x4df43c[_0x183749(0x21d)]&&_0x4df43c['rightValues'][_0x183749(0x20d)]>0x0)_0x81cb86=_0x4df43c['rightValues'];else{if(_0x4df43c['rightValue']!==undefined)_0x81cb86=_0x4df43c[_0x183749(0x1c8)];else isTemporalOperator(_0x4df43c['type'])&&_0x4df43c[_0x183749(0x203)]!==undefined&&(_0x81cb86=_0x4df43c[_0x183749(0x203)]);}return{'type':mapApiOperatorType(_0x4df43c[_0x183749(0x1de)]),..._0x4df43c[_0x183749(0x1b0)]!==undefined&&{'not':_0x4df43c[_0x183749(0x1b0)]},..._0x81cb86!==undefined&&{'value':_0x81cb86},..._0x4df43c[_0x183749(0x23c)]!==undefined&&{'unit':_0x4df43c[_0x183749(0x23c)]}};}function mapApiOperatorType(_0x277179){return _0x277179;}export function segmentDefToCreateRequest(_0x22843e,_0x3e5bc4){const _0x5820da=a193_0x1454d0,_0x436108={'name':_0x22843e['name']};return _0x22843e[_0x5820da(0x202)]&&(_0x436108[_0x5820da(0x202)]=_0x22843e[_0x5820da(0x202)]),_0x22843e['rule']&&(_0x436108['rule']=yamlRuleToApi(_0x22843e[_0x5820da(0x1f4)])),_0x22843e[_0x5820da(0x228)]&&(_0x436108['kind']=_0x22843e[_0x5820da(0x228)]==='batch'?0x0:_0x22843e['kind']===_0x5820da(0x1c5)?0x1:0x2),_0x22843e[_0x5820da(0x1f6)]!==undefined&&(_0x436108[_0x5820da(0x20f)]=_0x22843e[_0x5820da(0x1f6)]),_0x3e5bc4&&(_0x436108['segmentFolderId']=_0x3e5bc4),_0x436108;}export function segmentDefToUpdateRequest(_0x3f4ccb){const _0x40884a=a193_0x1454d0,_0x266fac={'name':_0x3f4ccb[_0x40884a(0x204)]};return _0x3f4ccb[_0x40884a(0x202)]!==undefined&&(_0x266fac['description']=_0x3f4ccb[_0x40884a(0x202)]),_0x3f4ccb[_0x40884a(0x1f4)]&&(_0x266fac['rule']=yamlRuleToApi(_0x3f4ccb[_0x40884a(0x1f4)])),_0x3f4ccb[_0x40884a(0x228)]&&(_0x266fac['kind']=_0x3f4ccb[_0x40884a(0x228)]==='batch'?0x0:_0x3f4ccb[_0x40884a(0x228)]===_0x40884a(0x1c5)?0x1:0x2),_0x266fac;}export function yamlRuleToApi(_0x452e75){const _0x4c2f1a=a193_0x1454d0;if(_0x452e75[_0x4c2f1a(0x1de)]===_0x4c2f1a(0x24e))return{'type':_0x4c2f1a(0x24e),'conditions':_0x452e75['conditions']['map'](yamlConditionToApi),..._0x452e75['description']!==undefined&&{'description':_0x452e75['description']},..._0x452e75['expr']!==undefined&&{'expr':_0x452e75[_0x4c2f1a(0x1d2)]}};const _0x377ee5=_0x452e75[_0x4c2f1a(0x244)][_0x4c2f1a(0x1d0)](yamlConditionToApi),_0xb570a2=_0x377ee5[_0x4c2f1a(0x1c0)](_0x1f45d3=>isCompositeType(_0x1f45d3)&&_0x1f45d3[_0x4c2f1a(0x202)]!==undefined);if(!_0xb570a2&&_0x377ee5['length']>0x0){const _0x19c61f=[];for(const _0x38cf95 of _0x377ee5){isCompositeType(_0x38cf95)&&_0x38cf95[_0x4c2f1a(0x202)]===undefined&&_0x38cf95[_0x4c2f1a(0x244)]&&_0x38cf95['conditions'][_0x4c2f1a(0x1c0)](_0x5322a6=>!isCompositeType(_0x5322a6))?_0x19c61f[_0x4c2f1a(0x1ff)]({'type':_0x38cf95[_0x4c2f1a(0x1de)],'description':'','conditions':_0x38cf95['conditions']}):_0x19c61f[_0x4c2f1a(0x1ff)]({'type':_0x4c2f1a(0x24c),'description':_0x452e75[_0x4c2f1a(0x202)]||'','conditions':[_0x38cf95]});}return{'type':_0x452e75[_0x4c2f1a(0x1de)],'conditions':_0x19c61f};}return{'type':_0x452e75[_0x4c2f1a(0x1de)],'conditions':_0x377ee5,..._0x452e75[_0x4c2f1a(0x202)]&&{'description':_0x452e75[_0x4c2f1a(0x202)]}};}function yamlFilterRuleToApi(_0x3743c0){const _0x5a3cf4=a193_0x1454d0,_0x5842c9=_0x3743c0[_0x5a3cf4(0x244)][_0x5a3cf4(0x1d0)](yamlConditionToApi);return{'type':_0x3743c0[_0x5a3cf4(0x1de)],'conditions':_0x5842c9};}function yamlConditionToApi(_0x4063d7){const _0x4ae609=a193_0x1454d0;if(_0x4ae609(0x247)in _0x4063d7&&(_0x4063d7[_0x4ae609(0x1de)]==='include'||_0x4063d7[_0x4ae609(0x1de)]===_0x4ae609(0x22b))){const _0x15428=_0x4063d7;return{'type':_0x4ae609(0x224),'id':_0x15428[_0x4ae609(0x247)],'exclude':_0x15428[_0x4ae609(0x1de)]===_0x4ae609(0x22b)};}if(_0x4063d7[_0x4ae609(0x1de)]===_0x4ae609(0x24c)||_0x4063d7[_0x4ae609(0x1de)]==='Or'||_0x4063d7['type']===_0x4ae609(0x24e)){const _0x2ae045=_0x4063d7;return{'type':_0x2ae045[_0x4ae609(0x1de)],'conditions':_0x2ae045['conditions'][_0x4ae609(0x1d0)](yamlConditionToApi),..._0x2ae045['description']&&{'description':_0x2ae045[_0x4ae609(0x202)]},..._0x2ae045['expr']!==undefined&&{'expr':_0x2ae045[_0x4ae609(0x1d2)]}};}if(_0x4ae609(0x261)in _0x4063d7&&_0x4063d7['type']===_0x4ae609(0x214)){const _0x3fe54c=_0x4063d7;return{'type':_0x4ae609(0x214),'column':_0x3fe54c[_0x4ae609(0x261)],'operator':yamlOperatorToApi(_0x3fe54c[_0x4ae609(0x21e)])};}const _0x3c728d=_0x4063d7,_0x53ac1c={'type':_0x4ae609(0x1da),'leftValue':buildLeftValue(_0x3c728d),'operator':yamlOperatorToApi(_0x3c728d[_0x4ae609(0x21e)]),'exclude':_0x3c728d[_0x4ae609(0x22b)]??![],'arrayMatching':_0x3c728d[_0x4ae609(0x22a)]??_0x4ae609(0x1eb)};return _0x3c728d['limit']!==undefined&&(_0x53ac1c['limit']=_0x3c728d[_0x4ae609(0x22d)]),_0x53ac1c;}function buildAggregationDefFromApi(_0x4e5b74){const _0x52e802=a193_0x1454d0,_0x337769=_0x4e5b74[_0x52e802(0x1de)];if(_0x337769===_0x52e802(0x1cb))return{'type':_0x337769,'columns':_0x4e5b74['columns']??[]};if(_0x337769===_0x52e802(0x1fb)||_0x337769===_0x52e802(0x249))return{'type':_0x337769,'column':_0x4e5b74[_0x52e802(0x261)]??'','orderColumn':_0x4e5b74[_0x52e802(0x206)]??'',..._0x4e5b74['groupingColumns']&&{'groupingColumns':_0x4e5b74[_0x52e802(0x200)]}};if(_0x337769==='Count')return{'type':_0x337769,..._0x4e5b74['groupingColumns']&&{'groupingColumns':_0x4e5b74[_0x52e802(0x200)]}};return{'type':_0x337769,'column':_0x4e5b74['column']??'',..._0x4e5b74[_0x52e802(0x200)]&&{'groupingColumns':_0x4e5b74[_0x52e802(0x200)]}};}function buildLeftValue(_0x29284f){const _0x137c4d=a193_0x1454d0,_0x4adfad={};_0x29284f[_0x137c4d(0x21b)]&&_0x29284f[_0x137c4d(0x1de)]!==_0x137c4d(0x23f)&&(_0x4adfad[_0x137c4d(0x204)]=_0x29284f[_0x137c4d(0x21b)]);if(_0x29284f[_0x137c4d(0x1c7)]){const _0x3f00f5=_0x29284f[_0x137c4d(0x1c7)];if(_0x3f00f5[_0x137c4d(0x1de)]===_0x137c4d(0x1cb))_0x4adfad[_0x137c4d(0x1c7)]={'type':'CountDistinct','columns':_0x3f00f5[_0x137c4d(0x1b8)]};else{if(_0x3f00f5[_0x137c4d(0x1de)]==='First'||_0x3f00f5[_0x137c4d(0x1de)]===_0x137c4d(0x249))_0x4adfad[_0x137c4d(0x1c7)]={'type':_0x3f00f5[_0x137c4d(0x1de)],'column':_0x3f00f5[_0x137c4d(0x261)],'orderColumn':_0x3f00f5['orderColumn'],..._0x3f00f5[_0x137c4d(0x200)]&&{'groupingColumns':_0x3f00f5['groupingColumns']}};else _0x3f00f5['type']===_0x137c4d(0x1cf)?_0x4adfad['aggregation']={'type':_0x137c4d(0x1cf),..._0x3f00f5[_0x137c4d(0x200)]&&{'groupingColumns':_0x3f00f5[_0x137c4d(0x200)]}}:_0x4adfad[_0x137c4d(0x1c7)]={'type':_0x3f00f5[_0x137c4d(0x1de)],'column':_0x3f00f5[_0x137c4d(0x261)],..._0x3f00f5[_0x137c4d(0x200)]&&{'groupingColumns':_0x3f00f5[_0x137c4d(0x200)]}};}}_0x29284f['source']&&(_0x4adfad[_0x137c4d(0x238)]={'name':_0x29284f[_0x137c4d(0x238)]});const _0x3a80bf=_0x29284f[_0x137c4d(0x1de)]===_0x137c4d(0x23f)?_0x29284f[_0x137c4d(0x1ba)]:undefined,_0x475386=_0x3a80bf?[buildTimeWindowCondition(_0x3a80bf)]:[],_0x25932d=[..._0x29284f[_0x137c4d(0x1f0)]?.[_0x137c4d(0x244)]??[],..._0x475386];return _0x25932d[_0x137c4d(0x20d)]>0x0&&(_0x4adfad['filter']=yamlFilterRuleToApi(filterRuleAsRuleDef({'type':_0x137c4d(0x24c),'conditions':_0x25932d}))),_0x4adfad;}function buildTimeWindowCondition(_0x38fc28){const _0x8dca90=a193_0x1454d0;return{'type':_0x8dca90(0x214),'column':_0x8dca90(0x23d),'operator':{'type':'TimeWithinPast','value':_0x38fc28['duration'],'unit':_0x38fc28[_0x8dca90(0x23c)]}};}function extractTimeWindow(_0x1bca11){const _0x37b515=a193_0x1454d0;if(!_0x1bca11?.[_0x37b515(0x244)]?.[_0x37b515(0x20d)])return{'remainingFilter':_0x1bca11};const _0xbd145=_0x1bca11['conditions'][_0x37b515(0x1ec)](_0x121965=>_0x121965[_0x37b515(0x1de)]===_0x37b515(0x214)&&_0x121965[_0x37b515(0x261)]===_0x37b515(0x23d)&&_0x121965[_0x37b515(0x21e)]?.[_0x37b515(0x1de)]===_0x37b515(0x248)&&!_0x121965[_0x37b515(0x21e)][_0x37b515(0x1b0)]&&typeof _0x121965['operator'][_0x37b515(0x203)]===_0x37b515(0x24b)&&typeof _0x121965[_0x37b515(0x21e)][_0x37b515(0x23c)]===_0x37b515(0x20a));if(_0xbd145===-0x1)return{'remainingFilter':_0x1bca11};const _0x5f4f23=_0x1bca11['conditions'][_0xbd145],_0x33c277=_0x1bca11[_0x37b515(0x244)]['filter']((_0x151bfb,_0x1e5b17)=>_0x1e5b17!==_0xbd145);return{'timeWindow':{'duration':_0x5f4f23[_0x37b515(0x21e)]['value'],'unit':_0x5f4f23['operator'][_0x37b515(0x23c)]},'remainingFilter':_0x33c277[_0x37b515(0x20d)]>0x0?{..._0x1bca11,'conditions':_0x33c277}:undefined};}function yamlOperatorToApi(_0x1b3661){const _0x2fad84=a193_0x1454d0,_0x91f735={'type':mapYamlOperatorType(_0x1b3661['type']),'not':_0x1b3661[_0x2fad84(0x1b0)]??![]};if(isBetweenOperator(_0x1b3661[_0x2fad84(0x1de)]))return _0x1b3661[_0x2fad84(0x251)]!==undefined&&(_0x91f735[_0x2fad84(0x1d5)]=typeof _0x1b3661[_0x2fad84(0x251)]===_0x2fad84(0x1dc)?_0x1b3661['min']:String(_0x1b3661['min'])),_0x1b3661[_0x2fad84(0x262)]!==undefined&&(_0x91f735['maxValue']=typeof _0x1b3661[_0x2fad84(0x262)]===_0x2fad84(0x1dc)?_0x1b3661[_0x2fad84(0x262)]:String(_0x1b3661[_0x2fad84(0x262)])),_0x91f735;if(_0x1b3661[_0x2fad84(0x1de)]===_0x2fad84(0x237))return _0x1b3661[_0x2fad84(0x1cc)]&&(_0x91f735[_0x2fad84(0x1cc)]=_0x1b3661[_0x2fad84(0x1cc)]),_0x1b3661['from']&&(_0x91f735[_0x2fad84(0x212)]=_0x1b3661[_0x2fad84(0x212)]),_0x1b3661[_0x2fad84(0x21f)]!==undefined&&(_0x91f735['reverse']=_0x1b3661['reverse']),_0x91f735;const _0x48d096=getEffectiveValue(_0x1b3661);if(_0x48d096!==undefined){if(Array[_0x2fad84(0x265)](_0x48d096))_0x91f735[_0x2fad84(0x21d)]=_0x48d096;else isTemporalOperator(_0x1b3661[_0x2fad84(0x1de)])?_0x91f735[_0x2fad84(0x203)]=_0x48d096:_0x91f735['rightValue']=_0x48d096;}return _0x1b3661[_0x2fad84(0x23c)]&&(_0x91f735[_0x2fad84(0x23c)]=_0x1b3661[_0x2fad84(0x23c)]),_0x91f735;}function mapYamlOperatorType(_0x8f27ad){return _0x8f27ad;}export function toYamlString(_0x650547){const _0x34c7ff=a193_0x1454d0,_0x376af0=JSON[_0x34c7ff(0x205)](JSON[_0x34c7ff(0x217)](_0x650547)),_0x33b9bd=a193_0x2e02c5[_0x34c7ff(0x217)](_0x376af0,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x211ebe=['rule:'];let _0x3553aa=_0x33b9bd;for(const _0x2d3aac of _0x211ebe){_0x3553aa=_0x3553aa['replace'](new RegExp('^('+_0x2d3aac+')','m'),(_0x2709b2,_0xfa4d04,_0x3b2ffe)=>{if(_0x3b2ffe===0x0||_0x3553aa[_0x3b2ffe-0x1]==='\x0a'&&_0x3553aa[_0x3b2ffe-0x2]==='\x0a')return _0xfa4d04;return'\x0a'+_0xfa4d04;});}return _0x3553aa;}export function parseYamlString(_0x476478){return parseSegmentYamlFile(_0x476478);}export function isSegmentYaml(_0x156c2a){const _0x2c4a8b=a193_0x1454d0;if(typeof _0x156c2a!==_0x2c4a8b(0x1dc)||_0x156c2a===null)return![];const _0x1aa2dc=_0x156c2a;return _0x1aa2dc[_0x2c4a8b(0x1de)]===_0x2c4a8b(0x247)||_0x1aa2dc[_0x2c4a8b(0x1de)]===undefined;}export function generateTemplate(_0x47383b='New\x20Segment'){const _0x32ca7f=a193_0x1454d0,_0x4abc5c={'type':'segment','name':_0x47383b,'description':_0x32ca7f(0x226),'rule':{'type':_0x32ca7f(0x24c),'conditions':[{'type':_0x32ca7f(0x1da),'attribute':_0x32ca7f(0x223),'operator':{'type':'Equal','value':_0x32ca7f(0x203)}}]}};return toYamlString(_0x4abc5c);}export function segmentToYamlString(_0x34237b){const _0x5706e4=a193_0x1454d0,_0x443cf3=JSON[_0x5706e4(0x205)](JSON[_0x5706e4(0x217)](_0x34237b)),_0x3d01b1=a193_0x2e02c5[_0x5706e4(0x217)](_0x443cf3,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x5d3c23=[_0x5706e4(0x213),_0x5706e4(0x1e3)];let _0x20dfdc=_0x3d01b1;for(const _0x329418 of _0x5d3c23){_0x20dfdc=_0x20dfdc['replace'](new RegExp('^('+_0x329418+')','m'),(_0x66e6ae,_0x302205,_0x7341a)=>{if(_0x7341a===0x0||_0x20dfdc[_0x7341a-0x1]==='\x0a'&&_0x20dfdc[_0x7341a-0x2]==='\x0a')return _0x302205;return'\x0a'+_0x302205;});}return _0x20dfdc;}export function parseSegmentYamlFile(_0x6398c0){return safeParseYaml(_0x6398c0,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x1bcadf){const _0x4626fb=a193_0x1454d0;return{'type':_0x4626fb(0x247),'name':_0x1bcadf[_0x4626fb(0x204)],..._0x1bcadf[_0x4626fb(0x202)]!==undefined&&{'description':_0x1bcadf['description']},..._0x1bcadf['folder']!==undefined&&{'folder':_0x1bcadf[_0x4626fb(0x20c)]},..._0x1bcadf['rule']&&{'rule':normalizeRule(_0x1bcadf['rule'])},..._0x1bcadf[_0x4626fb(0x228)]!==undefined&&{'kind':_0x1bcadf[_0x4626fb(0x228)]},..._0x1bcadf['visible']!==undefined&&{'visible':_0x1bcadf['visible']},..._0x1bcadf['activations']&&{'activations':_0x1bcadf[_0x4626fb(0x1e4)][_0x4626fb(0x1d0)](normalizeActivation)}};}export function normalizeRule(_0x26b0b9){const _0x44514f=a193_0x1454d0;return{'type':_0x26b0b9[_0x44514f(0x1de)],'conditions':_0x26b0b9[_0x44514f(0x244)][_0x44514f(0x1d0)](normalizeCondition),..._0x26b0b9[_0x44514f(0x202)]!==undefined&&{'description':_0x26b0b9[_0x44514f(0x202)]},..._0x26b0b9[_0x44514f(0x1d2)]!==undefined&&{'expr':_0x26b0b9['expr']}};}function normalizeCondition(_0x31a4a1){const _0x4d4556=a193_0x1454d0;if(_0x4d4556(0x247)in _0x31a4a1&&(_0x31a4a1[_0x4d4556(0x1de)]===_0x4d4556(0x1db)||_0x31a4a1[_0x4d4556(0x1de)]==='exclude')){const _0x5b6572=_0x31a4a1;return{'type':_0x5b6572[_0x4d4556(0x1de)],'segment':_0x5b6572[_0x4d4556(0x247)]};}if(_0x31a4a1[_0x4d4556(0x1de)]===_0x4d4556(0x24c)||_0x31a4a1['type']==='Or'||_0x31a4a1[_0x4d4556(0x1de)]==='Composite'){const _0x58249b=_0x31a4a1;return{'type':_0x58249b[_0x4d4556(0x1de)],'conditions':_0x58249b['conditions'][_0x4d4556(0x1d0)](normalizeCondition),..._0x58249b['description']!==undefined&&{'description':_0x58249b[_0x4d4556(0x202)]},..._0x58249b[_0x4d4556(0x1d2)]!==undefined&&{'expr':_0x58249b[_0x4d4556(0x1d2)]}};}if('column'in _0x31a4a1&&_0x31a4a1['type']===_0x4d4556(0x214)){const _0x5d94ac=_0x31a4a1;return{'type':_0x4d4556(0x214),'column':_0x5d94ac[_0x4d4556(0x261)],'operator':normalizeOperator(_0x5d94ac[_0x4d4556(0x21e)])};}if(_0x31a4a1['type']===_0x4d4556(0x23f)){const _0x297080=_0x31a4a1;return{'type':_0x4d4556(0x23f),'attribute':_0x297080[_0x4d4556(0x21b)],'operator':normalizeOperator(_0x297080[_0x4d4556(0x21e)]),..._0x297080[_0x4d4556(0x22a)]!==undefined&&{'arrayMatching':_0x297080[_0x4d4556(0x22a)]},..._0x297080[_0x4d4556(0x22b)]!==undefined&&{'exclude':_0x297080['exclude']},..._0x297080['aggregation']!==undefined&&{'aggregation':_0x297080[_0x4d4556(0x1c7)]},..._0x297080['source']!==undefined&&{'source':_0x297080[_0x4d4556(0x238)]},..._0x297080[_0x4d4556(0x1f0)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x297080[_0x4d4556(0x1f0)])))},..._0x297080[_0x4d4556(0x1ba)]!==undefined&&{'timeWindow':_0x297080['timeWindow']},..._0x297080[_0x4d4556(0x22d)]!==undefined&&{'limit':_0x297080['limit']}};}const _0x331961=_0x31a4a1;return{'type':'Value','attribute':_0x331961[_0x4d4556(0x21b)],'operator':normalizeOperator(_0x331961[_0x4d4556(0x21e)]),..._0x331961[_0x4d4556(0x22a)]!==undefined&&{'arrayMatching':_0x331961[_0x4d4556(0x22a)]},..._0x331961[_0x4d4556(0x22b)]!==undefined&&{'exclude':_0x331961[_0x4d4556(0x22b)]},..._0x331961[_0x4d4556(0x1c7)]!==undefined&&{'aggregation':_0x331961[_0x4d4556(0x1c7)]},..._0x331961[_0x4d4556(0x238)]!==undefined&&{'source':_0x331961['source']},..._0x331961['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x331961[_0x4d4556(0x1f0)])))},..._0x331961[_0x4d4556(0x22d)]!==undefined&&{'limit':_0x331961[_0x4d4556(0x22d)]}};}function normalizeOperator(_0x5a0fed){const _0x1b2945=a193_0x1454d0;if(isBetweenOperator(_0x5a0fed[_0x1b2945(0x1de)]))return{'type':_0x5a0fed[_0x1b2945(0x1de)],..._0x5a0fed[_0x1b2945(0x1b0)]!==undefined&&{'not':_0x5a0fed[_0x1b2945(0x1b0)]},..._0x5a0fed['min']!==undefined&&{'min':_0x5a0fed[_0x1b2945(0x251)]},..._0x5a0fed['max']!==undefined&&{'max':_0x5a0fed[_0x1b2945(0x262)]}};const _0x1e9929=getEffectiveValue(_0x5a0fed);return{'type':_0x5a0fed['type'],..._0x5a0fed[_0x1b2945(0x1b0)]!==undefined&&{'not':_0x5a0fed[_0x1b2945(0x1b0)]},..._0x1e9929!==undefined&&{'value':_0x1e9929},..._0x5a0fed[_0x1b2945(0x23c)]!==undefined&&{'unit':_0x5a0fed[_0x1b2945(0x23c)]},..._0x5a0fed[_0x1b2945(0x1cc)]!==undefined&&{'duration':_0x5a0fed[_0x1b2945(0x1cc)]},..._0x5a0fed['from']!==undefined&&{'from':_0x5a0fed[_0x1b2945(0x212)]},..._0x5a0fed['reverse']!==undefined&&{'reverse':_0x5a0fed[_0x1b2945(0x21f)]}};}function normalizeActivation(_0x2a9ff6){const _0x286ea0=a193_0x1454d0;return{'name':_0x2a9ff6[_0x286ea0(0x204)],'connection':_0x2a9ff6[_0x286ea0(0x1f2)],..._0x2a9ff6[_0x286ea0(0x202)]!==undefined&&{'description':_0x2a9ff6[_0x286ea0(0x202)]},..._0x2a9ff6['all_columns']!==undefined&&{'all_columns':_0x2a9ff6[_0x286ea0(0x236)]},..._0x2a9ff6[_0x286ea0(0x1b8)]!==undefined&&{'columns':_0x2a9ff6[_0x286ea0(0x1b8)]},..._0x2a9ff6[_0x286ea0(0x1d6)]!==undefined&&{'behavior':_0x2a9ff6[_0x286ea0(0x1d6)]},..._0x2a9ff6['behaviors']!==undefined&&{'behaviors':_0x2a9ff6['behaviors']},..._0x2a9ff6[_0x286ea0(0x1ca)]!==undefined&&{'schedule':_0x2a9ff6[_0x286ea0(0x1ca)]},..._0x2a9ff6['notification']!==undefined&&{'notification':_0x2a9ff6['notification']},..._0x2a9ff6['connector_config']!==undefined&&{'connector_config':_0x2a9ff6[_0x286ea0(0x1c6)]},..._0x2a9ff6[_0x286ea0(0x1e5)]!==undefined&&{'activation_template_id':_0x2a9ff6[_0x286ea0(0x1e5)]},..._0x2a9ff6[_0x286ea0(0x1ee)]!==undefined&&{'nested_workflow_project_name':_0x2a9ff6[_0x286ea0(0x1ee)]},..._0x2a9ff6[_0x286ea0(0x1ea)]!==undefined&&{'nested_workflow_name':_0x2a9ff6[_0x286ea0(0x1ea)]},..._0x2a9ff6[_0x286ea0(0x222)]!==undefined&&{'lock_enabled':_0x2a9ff6[_0x286ea0(0x222)]}};}function getColumnName(_0x2aaadc){const _0x401331=a193_0x1454d0;return _0x2aaadc[_0x401331(0x261)]||_0x2aaadc[_0x401331(0x204)];}function behaviorApiToDef(_0x14b882){const _0xbc4506=a193_0x1454d0,_0x3a218f={};return _0x14b882['columns']&&_0x14b882[_0xbc4506(0x1b8)][_0xbc4506(0x20d)]>0x0&&(_0x3a218f[_0xbc4506(0x1b8)]=_0x14b882['columns'][_0xbc4506(0x1f0)](_0x14b0e1=>_0x14b0e1&&getColumnName(_0x14b0e1))['map'](_0x10388a=>({'name':getColumnName(_0x10388a),..._0x10388a[_0xbc4506(0x1de)]&&{'type':_0x10388a['type']},..._0x10388a[_0xbc4506(0x1b2)]&&{'visibility':_0x10388a[_0xbc4506(0x1b2)]}}))),_0x14b882['behaviorTableName']&&(_0x3a218f['behavior_table']=_0x14b882[_0xbc4506(0x21a)]),_0x14b882[_0xbc4506(0x250)]!==undefined&&(_0x3a218f[_0xbc4506(0x1b4)]=_0x14b882['joinRow']),_0x14b882[_0xbc4506(0x245)]&&(_0x3a218f[_0xbc4506(0x1f7)]=_0x14b882[_0xbc4506(0x245)]),_0x14b882[_0xbc4506(0x25a)]&&(_0x3a218f[_0xbc4506(0x25a)]=_0x14b882['formatting']),_0x14b882['orderBy']&&_0x14b882['orderBy'][_0xbc4506(0x20d)]>0x0&&(_0x3a218f[_0xbc4506(0x1f5)]=_0x14b882[_0xbc4506(0x1b3)]),_0x3a218f;}function behaviorsApiToDef(_0x31833b){const _0x463ef9=a193_0x1454d0;return _0x31833b[_0x463ef9(0x1d0)](behaviorApiToDef)['filter'](_0xa1bdc5=>Object[_0x463ef9(0x1d8)](_0xa1bdc5)[_0x463ef9(0x20d)]>0x0);}export function activationResponseToDef(_0x59bd6f,_0x2905b9,_0x1f47d3){const _0x271804=a193_0x1454d0,_0x17964f=_0x59bd6f[_0x271804(0x215)]||'',_0x21e082=_0x1f47d3?.[_0x271804(0x231)](_0x17964f)??_0x17964f,_0x2f96bf={'name':_0x59bd6f[_0x271804(0x204)],'connection':_0x21e082};_0x59bd6f['description']&&(_0x2f96bf[_0x271804(0x202)]=_0x59bd6f[_0x271804(0x202)]);let _0x218afa=[];_0x59bd6f[_0x271804(0x1b8)]&&_0x59bd6f[_0x271804(0x1b8)][_0x271804(0x20d)]>0x0&&(_0x218afa=_0x59bd6f[_0x271804(0x1b8)][_0x271804(0x1f0)](_0x413788=>_0x413788&&getColumnName(_0x413788))['map'](_0x36cfa2=>{const _0x598725=_0x271804,_0x1fd310=getColumnName(_0x36cfa2);if(_0x36cfa2[_0x598725(0x1de)]||_0x36cfa2[_0x598725(0x1b2)])return{'name':_0x1fd310,..._0x36cfa2[_0x598725(0x1de)]&&{'type':_0x36cfa2[_0x598725(0x1de)]},..._0x36cfa2[_0x598725(0x1b2)]&&{'visibility':_0x36cfa2[_0x598725(0x1b2)]}};return _0x1fd310;}));_0x218afa[_0x271804(0x20d)]>0x0&&(_0x2f96bf[_0x271804(0x1b8)]=_0x218afa);_0x59bd6f[_0x271804(0x232)]!==undefined&&(_0x59bd6f[_0x271804(0x232)]===![]&&_0x218afa[_0x271804(0x20d)]===0x0?_0x2f96bf[_0x271804(0x236)]=!![]:_0x2f96bf[_0x271804(0x236)]=_0x59bd6f[_0x271804(0x232)]);const _0x66a4f4={};let _0x16dc4b=![];_0x59bd6f[_0x271804(0x1bf)]&&(_0x66a4f4[_0x271804(0x1de)]=_0x59bd6f[_0x271804(0x1bf)],_0x16dc4b=!![]);_0x59bd6f['repeatUnit']&&(_0x66a4f4[_0x271804(0x230)]=_0x59bd6f[_0x271804(0x1ed)],_0x16dc4b=!![]);_0x59bd6f[_0x271804(0x23a)]!==undefined&&_0x59bd6f['repeatFrequency']!==null&&(_0x66a4f4[_0x271804(0x1c3)]=_0x59bd6f['repeatFrequency'],_0x16dc4b=!![]);_0x59bd6f[_0x271804(0x1f1)]&&_0x59bd6f[_0x271804(0x1f1)][_0x271804(0x20d)]>0x0&&(_0x66a4f4[_0x271804(0x1b5)]=_0x59bd6f[_0x271804(0x1f1)],_0x16dc4b=!![]);_0x59bd6f['startAt']!==undefined&&(_0x66a4f4[_0x271804(0x1e7)]=_0x59bd6f['startAt'],_0x16dc4b=!![]);_0x59bd6f['endOn']!==undefined&&(_0x66a4f4[_0x271804(0x253)]=_0x59bd6f[_0x271804(0x235)],_0x16dc4b=!![]);_0x59bd6f[_0x271804(0x240)]&&(_0x66a4f4[_0x271804(0x240)]=_0x59bd6f[_0x271804(0x240)],_0x16dc4b=!![]);_0x16dc4b&&(_0x2f96bf[_0x271804(0x1ca)]=_0x66a4f4);(_0x59bd6f[_0x271804(0x229)]&&_0x59bd6f[_0x271804(0x229)]['length']>0x0||_0x59bd6f[_0x271804(0x1bd)]&&_0x59bd6f[_0x271804(0x1bd)]['length']>0x0)&&(_0x2f96bf[_0x271804(0x1af)]={},_0x59bd6f[_0x271804(0x229)]&&_0x59bd6f[_0x271804(0x229)][_0x271804(0x20d)]>0x0&&(_0x2f96bf['notification'][_0x271804(0x252)]=_0x59bd6f[_0x271804(0x229)]),_0x59bd6f['emailRecipients']&&_0x59bd6f['emailRecipients'][_0x271804(0x20d)]>0x0&&(_0x2f96bf[_0x271804(0x1af)]['email_recipients']=_0x59bd6f[_0x271804(0x1bd)][_0x271804(0x1d0)](_0xc848d2=>{const _0x7efdc5=_0x271804,_0x4313e8=_0x2905b9?.[_0x7efdc5(0x231)](_0xc848d2);return _0x4313e8??String(_0xc848d2);})));_0x59bd6f[_0x271804(0x20e)]&&Object[_0x271804(0x1d8)](_0x59bd6f[_0x271804(0x20e)])[_0x271804(0x20d)]>0x0&&(_0x2f96bf[_0x271804(0x1c6)]=normalizeConnectorConfigForYaml(_0x59bd6f[_0x271804(0x20e)]));_0x59bd6f[_0x271804(0x218)]&&(_0x2f96bf[_0x271804(0x1e5)]=_0x59bd6f[_0x271804(0x218)]);if(_0x59bd6f[_0x271804(0x1e0)]&&_0x59bd6f['syndicationBehaviors'][_0x271804(0x20d)]>0x0){const _0xefb123=behaviorsApiToDef(_0x59bd6f['syndicationBehaviors']);_0xefb123[_0x271804(0x20d)]>0x0&&(_0x2f96bf[_0x271804(0x216)]=_0xefb123);}return _0x59bd6f[_0x271804(0x1ae)]&&(_0x2f96bf[_0x271804(0x1ee)]=_0x59bd6f[_0x271804(0x1ae)]),_0x59bd6f[_0x271804(0x1f9)]&&(_0x2f96bf[_0x271804(0x1ea)]=_0x59bd6f[_0x271804(0x1f9)]),_0x59bd6f['lockEnabled']!==undefined&&(_0x2f96bf[_0x271804(0x222)]=_0x59bd6f['lockEnabled']),_0x2f96bf;}export function journeyActivationStepToYaml(_0x5e28fd,_0x44d2c7,_0x3e6a37){const _0x53f2b4=a193_0x1454d0,_0xfdf097=_0x5e28fd[_0x53f2b4(0x259)]['activationParams'],_0x5a69ce=_0xfdf097[_0x53f2b4(0x215)]||'',_0x118724=_0x3e6a37?.[_0x53f2b4(0x231)](_0x5a69ce)??_0x5a69ce,_0x5b6d5a={'name':_0xfdf097[_0x53f2b4(0x204)]||'','connection':_0x118724};_0x5e28fd[_0x53f2b4(0x259)][_0x53f2b4(0x243)]&&(_0x5b6d5a[_0x53f2b4(0x257)]=!![]);_0xfdf097[_0x53f2b4(0x202)]&&(_0x5b6d5a['description']=_0xfdf097[_0x53f2b4(0x202)]);let _0x363f13=[];_0xfdf097[_0x53f2b4(0x1b8)]&&_0xfdf097[_0x53f2b4(0x1b8)][_0x53f2b4(0x20d)]>0x0&&(_0x363f13=_0xfdf097['columns'][_0x53f2b4(0x1f0)](_0x286690=>_0x286690&&getColumnName(_0x286690))['map'](_0x38c9af=>{const _0x318b7e=_0x53f2b4,_0x10b00c=getColumnName(_0x38c9af);if(_0x38c9af[_0x318b7e(0x1de)]||_0x38c9af['visibility'])return{'name':_0x10b00c,..._0x38c9af[_0x318b7e(0x1de)]&&{'type':_0x38c9af[_0x318b7e(0x1de)]},..._0x38c9af['visibility']&&{'visibility':_0x38c9af[_0x318b7e(0x1b2)]}};return _0x10b00c;}));_0x363f13[_0x53f2b4(0x20d)]>0x0&&(_0x5b6d5a[_0x53f2b4(0x1b8)]=_0x363f13);_0xfdf097[_0x53f2b4(0x232)]!==undefined&&(_0xfdf097[_0x53f2b4(0x232)]===![]&&_0x363f13['length']===0x0?_0x5b6d5a[_0x53f2b4(0x236)]=!![]:_0x5b6d5a[_0x53f2b4(0x236)]=_0xfdf097[_0x53f2b4(0x232)]);const _0x15d176={};let _0xba13a9=![];_0xfdf097[_0x53f2b4(0x1bf)]&&(_0x15d176[_0x53f2b4(0x1de)]=_0xfdf097[_0x53f2b4(0x1bf)],_0xba13a9=!![]);_0xfdf097[_0x53f2b4(0x1ed)]&&(_0x15d176[_0x53f2b4(0x230)]=_0xfdf097[_0x53f2b4(0x1ed)],_0xba13a9=!![]);_0xfdf097[_0x53f2b4(0x23a)]!==undefined&&_0xfdf097[_0x53f2b4(0x23a)]!==null&&(_0x15d176[_0x53f2b4(0x1c3)]=_0xfdf097['repeatFrequency'],_0xba13a9=!![]);_0xfdf097[_0x53f2b4(0x1be)]!==undefined&&(_0x15d176[_0x53f2b4(0x1e7)]=_0xfdf097['startAt'],_0xba13a9=!![]);_0xfdf097[_0x53f2b4(0x235)]!==undefined&&(_0x15d176[_0x53f2b4(0x253)]=_0xfdf097[_0x53f2b4(0x235)],_0xba13a9=!![]);_0xfdf097['timezone']&&(_0x15d176['timezone']=_0xfdf097[_0x53f2b4(0x240)],_0xba13a9=!![]);_0xba13a9&&(_0x5b6d5a['schedule']=_0x15d176);(_0xfdf097[_0x53f2b4(0x229)]&&_0xfdf097[_0x53f2b4(0x229)][_0x53f2b4(0x20d)]>0x0||_0xfdf097[_0x53f2b4(0x1bd)]&&_0xfdf097[_0x53f2b4(0x1bd)][_0x53f2b4(0x20d)]>0x0)&&(_0x5b6d5a[_0x53f2b4(0x1af)]={},_0xfdf097[_0x53f2b4(0x229)]&&_0xfdf097['notifyOn'][_0x53f2b4(0x20d)]>0x0&&(_0x5b6d5a[_0x53f2b4(0x1af)][_0x53f2b4(0x252)]=_0xfdf097[_0x53f2b4(0x229)]),_0xfdf097['emailRecipients']&&_0xfdf097[_0x53f2b4(0x1bd)][_0x53f2b4(0x20d)]>0x0&&(_0x5b6d5a[_0x53f2b4(0x1af)][_0x53f2b4(0x25d)]=_0xfdf097[_0x53f2b4(0x1bd)][_0x53f2b4(0x1d0)](_0x556698=>{const _0x39caad=_0x53f2b4,_0x5d9955=_0x44d2c7?.[_0x39caad(0x231)](_0x556698);return _0x5d9955??String(_0x556698);})));_0xfdf097[_0x53f2b4(0x20e)]&&Object[_0x53f2b4(0x1d8)](_0xfdf097[_0x53f2b4(0x20e)])[_0x53f2b4(0x20d)]>0x0&&(_0x5b6d5a[_0x53f2b4(0x1c6)]=normalizeConnectorConfigForYaml(_0xfdf097[_0x53f2b4(0x20e)]));_0xfdf097[_0x53f2b4(0x218)]&&(_0x5b6d5a[_0x53f2b4(0x1e5)]=_0xfdf097[_0x53f2b4(0x218)]);if(_0xfdf097[_0x53f2b4(0x1e0)]&&_0xfdf097[_0x53f2b4(0x1e0)][_0x53f2b4(0x20d)]>0x0){const _0x37b80c=behaviorsApiToDef(_0xfdf097[_0x53f2b4(0x1e0)]);_0x37b80c[_0x53f2b4(0x20d)]>0x0&&(_0x5b6d5a['behaviors']=_0x37b80c);}return _0x5b6d5a;}export function segmentWithActivationsToYaml(_0x2f5f0a,_0x453d74,_0x58facc,_0xca496a,_0x1c1012){const _0x47a536=a193_0x1454d0,_0x486d0c=segmentResponseToDefSync(_0x2f5f0a,_0x58facc);return _0x453d74[_0x47a536(0x20d)]>0x0&&(_0x486d0c[_0x47a536(0x1e4)]=_0x453d74[_0x47a536(0x1d0)](_0x189d31=>activationResponseToDef(_0x189d31,_0xca496a,_0x1c1012))),_0x486d0c;}function normalizeColumn(_0x4d5629){const _0xe6d6b5=a193_0x1454d0;if(typeof _0x4d5629===_0xe6d6b5(0x20a))return{'column':_0x4d5629,'source':{'column':_0x4d5629}};return{'column':_0x4d5629[_0xe6d6b5(0x204)],'source':{'column':_0x4d5629[_0xe6d6b5(0x204)]},..._0x4d5629[_0xe6d6b5(0x1de)]&&{'type':_0x4d5629[_0xe6d6b5(0x1de)]},..._0x4d5629[_0xe6d6b5(0x1b2)]&&{'visibility':_0x4d5629[_0xe6d6b5(0x1b2)]}};}function behaviorDefToApi(_0x3d47bc){const _0x3a1b9d=a193_0x1454d0,_0x8a7ab7={};if(_0x3d47bc[_0x3a1b9d(0x1b8)]&&_0x3d47bc['columns'][_0x3a1b9d(0x20d)]>0x0){const _0x51452c=_0x3d47bc[_0x3a1b9d(0x1b8)][_0x3a1b9d(0x1f0)](_0x33e5fb=>typeof _0x33e5fb==='string'?_0x33e5fb:_0x33e5fb[_0x3a1b9d(0x204)])[_0x3a1b9d(0x1d0)](normalizeColumn);_0x51452c[_0x3a1b9d(0x20d)]>0x0&&(_0x8a7ab7['columns']=_0x51452c);}_0x3d47bc[_0x3a1b9d(0x1e8)]&&(_0x8a7ab7['behaviorTableName']=_0x3d47bc[_0x3a1b9d(0x1e8)]);_0x3d47bc['join_strategy']&&(_0x8a7ab7['joinStrategy']=_0x3d47bc[_0x3a1b9d(0x1f7)]);if(_0x3d47bc['join_row']!==undefined)_0x8a7ab7['joinRow']=_0x3d47bc[_0x3a1b9d(0x1b4)];else{if(_0x3d47bc[_0x3a1b9d(0x1f7)]===_0x3a1b9d(0x249)||_0x3d47bc[_0x3a1b9d(0x1f7)]===_0x3a1b9d(0x1fb))_0x8a7ab7[_0x3a1b9d(0x250)]=0x1;else _0x3d47bc[_0x3a1b9d(0x1f7)]==='All'&&(_0x8a7ab7[_0x3a1b9d(0x250)]=null);}return _0x3d47bc['formatting']&&(_0x8a7ab7[_0x3a1b9d(0x25a)]=_0x3d47bc['formatting']),_0x3d47bc[_0x3a1b9d(0x1f5)]&&(_0x8a7ab7[_0x3a1b9d(0x1b3)]=_0x3d47bc[_0x3a1b9d(0x1f5)]),_0x8a7ab7;}export async function activationDefToCreateRequest(_0x4478b9,_0x3563f6){const _0x5b8630=a193_0x1454d0,_0x230295=_0x3563f6?.[_0x5b8630(0x23e)],_0x5c8502=_0x3563f6?.[_0x5b8630(0x239)],_0x4319f8=_0x4478b9[_0x5b8630(0x1f2)];let _0x918f15;const _0x5c6050=parseInt(_0x4319f8,0xa);if(!isNaN(_0x5c6050)&&String(_0x5c6050)===_0x4319f8)_0x918f15=_0x5c6050;else{const _0x202bc0=_0x5c8502?.[_0x5b8630(0x231)](_0x4319f8);if(_0x202bc0===undefined)throw new SDKError(ErrorCode[_0x5b8630(0x21c)],'Unknown\x20connection:\x20'+_0x4319f8,undefined,{'helpText':_0x5b8630(0x1d3)});_0x918f15=_0x202bc0;}const _0x1666f8={'name':_0x4478b9[_0x5b8630(0x204)],'connectionId':_0x918f15};_0x4478b9[_0x5b8630(0x202)]&&(_0x1666f8[_0x5b8630(0x202)]=_0x4478b9[_0x5b8630(0x202)]);let _0x293bb4=[];_0x4478b9['columns']&&_0x4478b9[_0x5b8630(0x1b8)]['length']>0x0&&(_0x293bb4=_0x4478b9[_0x5b8630(0x1b8)]['filter'](_0x5a07bf=>_0x5a07bf!=null)[_0x5b8630(0x1d0)](normalizeColumn));_0x293bb4[_0x5b8630(0x20d)]>0x0&&(_0x1666f8[_0x5b8630(0x1b8)]=_0x293bb4);_0x4478b9['all_columns']!==undefined&&(_0x4478b9['all_columns']===![]&&_0x293bb4[_0x5b8630(0x20d)]===0x0?_0x1666f8['allColumns']=!![]:_0x1666f8[_0x5b8630(0x232)]=_0x4478b9[_0x5b8630(0x236)]);if(_0x4478b9[_0x5b8630(0x1ca)]){const _0x4a9b5b=_0x4478b9['schedule'],_0x3427aa=_0x4a9b5b[_0x5b8630(0x1de)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x4a9b5b[_0x5b8630(0x230)]];_0x3427aa&&(_0x1666f8[_0x5b8630(0x1bf)]=_0x3427aa);const _0x3054a8=_0x4a9b5b[_0x5b8630(0x230)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x4a9b5b['type']];_0x3054a8&&(_0x1666f8[_0x5b8630(0x1ed)]=_0x3054a8);_0x4a9b5b[_0x5b8630(0x1c3)]!==undefined&&(_0x1666f8[_0x5b8630(0x23a)]=_0x4a9b5b[_0x5b8630(0x1c3)]);_0x4a9b5b['repeat_sub_frequency']&&(_0x1666f8[_0x5b8630(0x1f1)]=_0x4a9b5b[_0x5b8630(0x1b5)]);_0x4a9b5b[_0x5b8630(0x1e7)]!==undefined&&(_0x1666f8['startAt']=_0x4a9b5b['start_at']);_0x4a9b5b[_0x5b8630(0x253)]!==undefined&&(_0x1666f8[_0x5b8630(0x235)]=_0x4a9b5b[_0x5b8630(0x253)]);_0x4a9b5b[_0x5b8630(0x240)]&&(_0x1666f8[_0x5b8630(0x240)]=_0x4a9b5b[_0x5b8630(0x240)]);if(_0x3427aa&&_0x3427aa!==_0x5b8630(0x24f)&&_0x3427aa!==_0x5b8630(0x207)&&_0x4a9b5b[_0x5b8630(0x1e7)]){const _0x3ec7ec=_0x4a9b5b[_0x5b8630(0x1e7)][_0x5b8630(0x242)](/T(\d{2}:\d{2})/);_0x3ec7ec&&(_0x1666f8['scheduleOption']=_0x3ec7ec[0x1]);}}_0x4478b9[_0x5b8630(0x1af)]&&(_0x4478b9[_0x5b8630(0x1af)][_0x5b8630(0x252)]&&(_0x1666f8[_0x5b8630(0x229)]=_0x4478b9[_0x5b8630(0x1af)][_0x5b8630(0x252)]),_0x4478b9[_0x5b8630(0x1af)][_0x5b8630(0x25d)]&&(_0x1666f8[_0x5b8630(0x1bd)]=_0x4478b9[_0x5b8630(0x1af)][_0x5b8630(0x25d)][_0x5b8630(0x1d0)](_0x4404e9=>{const _0x38c81b=_0x5b8630,_0x1f4ee7=Number(_0x4404e9);if(!isNaN(_0x1f4ee7)&&String(_0x1f4ee7)===_0x4404e9)return _0x1f4ee7;const _0x648a36=_0x230295?.['get'](_0x4404e9[_0x38c81b(0x210)]());if(_0x648a36===undefined)throw new SDKError(ErrorCode[_0x38c81b(0x1c2)],_0x38c81b(0x221)+_0x4404e9+_0x38c81b(0x1d7));return _0x648a36;})));if(_0x4478b9[_0x5b8630(0x1c6)]){const _0x13d0cd=_0x3563f6?.[_0x5b8630(0x1c9)]?.[_0x5b8630(0x231)](_0x4319f8);_0x1666f8['connectorConfig']=_0x4478b9[_0x5b8630(0x1c6)];if(_0x13d0cd&&_0x3563f6?.['getSchema']){let _0x3d75e4;try{_0x3d75e4=await _0x3563f6[_0x5b8630(0x225)](_0x13d0cd);const _0x254c17=validateConnectorConfig(_0x4478b9[_0x5b8630(0x1c6)],_0x3d75e4);if(!_0x254c17['valid'])throw new SDKError(ErrorCode[_0x5b8630(0x23b)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x4478b9['name']+_0x5b8630(0x1fe)+formatValidationErrors(_0x254c17[_0x5b8630(0x1fc)]),undefined,{'helpText':'Connector:\x20'+_0x13d0cd+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x3d75e4)});if(_0x254c17['warnings'][_0x5b8630(0x20d)]>0x0){const _0x4703e0=formatValidationWarnings(_0x254c17[_0x5b8630(0x220)]);console[_0x5b8630(0x219)](_0x5b8630(0x1bc)+_0x4478b9[_0x5b8630(0x204)]+_0x5b8630(0x1fe)+_0x4703e0);}}catch(_0x59aac8){if(!(_0x59aac8 instanceof SDKError)||_0x59aac8[_0x5b8630(0x22e)]!==ErrorCode[_0x5b8630(0x255)])throw _0x59aac8;}if(_0x3d75e4&&getLegacySettingsField(_0x3d75e4)){if(!_0x3563f6?.['getMetadata'])throw new SDKError(ErrorCode[_0x5b8630(0x1c4)],_0x5b8630(0x1d4)+_0x4478b9['name']+_0x5b8630(0x254)+('\x22'+_0x13d0cd+_0x5b8630(0x260))+'provides\x20no\x20getMetadata.\x20This\x20is\x20a\x20wiring\x20bug\x20in\x20tdx,\x20not\x20a\x20problem\x20with\x20your\x20YAML.');const _0x7240cb=await _0x3563f6[_0x5b8630(0x1e9)](_0x13d0cd);_0x1666f8['connectorConfig']=transformConfigToLegacy(_0x4478b9['connector_config'],_0x7240cb);}}}else _0x1666f8[_0x5b8630(0x20e)]={};_0x4478b9[_0x5b8630(0x1e5)]!==undefined&&(_0x1666f8[_0x5b8630(0x218)]=_0x4478b9['activation_template_id']);if(_0x4478b9[_0x5b8630(0x216)])_0x1666f8[_0x5b8630(0x1e0)]=_0x4478b9[_0x5b8630(0x216)]['map'](behaviorDefToApi);else _0x4478b9[_0x5b8630(0x1d6)]&&(_0x1666f8['syndicationBehavior']=behaviorDefToApi(_0x4478b9[_0x5b8630(0x1d6)]));return _0x4478b9['nested_workflow_project_name']&&(_0x1666f8[_0x5b8630(0x1ae)]=_0x4478b9['nested_workflow_project_name']),_0x4478b9['nested_workflow_name']&&(_0x1666f8[_0x5b8630(0x1f9)]=_0x4478b9['nested_workflow_name']),_0x4478b9['lock_enabled']!==undefined&&(_0x1666f8[_0x5b8630(0x1cd)]=_0x4478b9[_0x5b8630(0x222)]),_0x1666f8;}export async function activationDefToUpdateRequest(_0x1be19b,_0x36725f){return activationDefToCreateRequest(_0x1be19b,_0x36725f);}export function deepSortObject(_0x17bd40){const _0x39ee54=a193_0x1454d0;if(_0x17bd40===null||typeof _0x17bd40!==_0x39ee54(0x1dc))return _0x17bd40;if(Array[_0x39ee54(0x265)](_0x17bd40))return _0x17bd40[_0x39ee54(0x1d0)](deepSortObject)[_0x39ee54(0x1ef)]((_0x255937,_0x58352d)=>JSON['stringify'](_0x255937)['localeCompare'](JSON['stringify'](_0x58352d)));const _0x588d9a=_0x17bd40;if(_0x588d9a[_0x39ee54(0x1de)]===_0x39ee54(0x24e)&&Array[_0x39ee54(0x265)](_0x588d9a[_0x39ee54(0x244)])){const _0x505d46={};for(const _0x45c356 of Object[_0x39ee54(0x1d8)](_0x588d9a)['sort']()){_0x505d46[_0x45c356]=_0x45c356===_0x39ee54(0x244)?_0x588d9a[_0x39ee54(0x244)][_0x39ee54(0x1d0)](deepSortObject):deepSortObject(_0x588d9a[_0x45c356]);}return _0x505d46;}const _0x640a66={};for(const _0x20c436 of Object[_0x39ee54(0x1d8)](_0x17bd40)['sort']()){_0x640a66[_0x20c436]=deepSortObject(_0x17bd40[_0x20c436]);}return _0x640a66;}export function serializeRule(_0x1dacef){return JSON['stringify'](deepSortObject(_0x1dacef));}export function normalizeRuleForMatching(_0x1a8093){return normalizeConditionsForMatching(_0x1a8093);}function normalizeConditionsForMatching(_0x4a9053){const _0x2e1f6d=a193_0x1454d0;if(_0x4a9053===null||typeof _0x4a9053!==_0x2e1f6d(0x1dc))return _0x4a9053;if(Array['isArray'](_0x4a9053))return _0x4a9053[_0x2e1f6d(0x1d0)](normalizeConditionsForMatching);const _0x2ef355=_0x4a9053;if((_0x2ef355[_0x2e1f6d(0x1de)]===_0x2e1f6d(0x1db)||_0x2ef355[_0x2e1f6d(0x1de)]==='exclude')&&typeof _0x2ef355[_0x2e1f6d(0x247)]===_0x2e1f6d(0x20a))return{..._0x2ef355,'segment':_0x2e1f6d(0x258)};const _0x44ab5a={};for(const _0x55e39f of Object[_0x2e1f6d(0x1d8)](_0x2ef355)){_0x44ab5a[_0x55e39f]=normalizeConditionsForMatching(_0x2ef355[_0x55e39f]);}return _0x44ab5a;}export function serializeRuleForMatching(_0x1d86e9){const _0x5edc0e=a193_0x1454d0;return JSON[_0x5edc0e(0x217)](deepSortObject(normalizeRuleForMatching(_0x1d86e9)));}export function expandSegmentReferences(_0x544e8a,_0x163387,_0x557dd9=new Set()){return expandConditions(_0x544e8a,_0x163387,_0x557dd9);}function expandConditions(_0x2db3ef,_0x55227c,_0x169bbb){const _0xab59f4=a193_0x1454d0;if(_0x2db3ef===null||typeof _0x2db3ef!==_0xab59f4(0x1dc))return _0x2db3ef;if(Array['isArray'](_0x2db3ef))return _0x2db3ef[_0xab59f4(0x1d0)](_0x5c4b1e=>expandConditions(_0x5c4b1e,_0x55227c,_0x169bbb));const _0x154d8f=_0x2db3ef;if((_0x154d8f['type']===_0xab59f4(0x1db)||_0x154d8f['type']===_0xab59f4(0x22b))&&typeof _0x154d8f[_0xab59f4(0x247)]===_0xab59f4(0x20a)){const _0x37d41f=_0x154d8f[_0xab59f4(0x247)],_0x4b8f38=_0x55227c[_0xab59f4(0x231)](_0x37d41f);if(_0x4b8f38&&!_0x169bbb[_0xab59f4(0x246)](_0x37d41f)){const _0x20ec87=new Set(_0x169bbb);_0x20ec87[_0xab59f4(0x1ce)](_0x37d41f);const _0x10f24b=expandConditions(_0x4b8f38,_0x55227c,_0x20ec87);return{'type':_0x154d8f[_0xab59f4(0x1de)],'expanded_rule':_0x10f24b};}return{'type':_0x154d8f[_0xab59f4(0x1de)],'expanded_rule':_0xab59f4(0x234)};}const _0x10f139={};for(const _0x2159b4 of Object['keys'](_0x154d8f)){_0x10f139[_0x2159b4]=expandConditions(_0x154d8f[_0x2159b4],_0x55227c,_0x169bbb);}return _0x10f139;}export function serializeExpandedRule(_0x4338e3,_0xef365){const _0x2b2da3=a193_0x1454d0,_0x54d49a=expandSegmentReferences(_0x4338e3,_0xef365);return JSON[_0x2b2da3(0x217)](deepSortObject(_0x54d49a));}export function createSegmentNameContext(_0x2d5dfa){const _0x416b54=a193_0x1454d0,_0x594461=new Set(),_0x3e6810=new Map(),_0x4d57cf=new Map();if(_0x2d5dfa)for(const [_0x4d5ab3,_0x29e26b]of Object[_0x416b54(0x1b7)](_0x2d5dfa)){if(_0x29e26b[_0x416b54(0x1f4)]){const _0x1db03c=serializeRule(_0x29e26b[_0x416b54(0x1f4)]);_0x4d57cf[_0x416b54(0x1d9)](_0x1db03c,_0x4d5ab3),_0x594461['add'](_0x4d5ab3);}}return{'usedNames':_0x594461,'ruleHashToName':_0x3e6810,'localRuleToName':_0x2d5dfa?_0x4d57cf:undefined};}export function resolveSegmentName(_0x117a0f,_0x38ca9d,_0x3520e1,_0x2ee5cc){const _0x4b4309=a193_0x1454d0,_0x32a8a7=serializeRule(_0x38ca9d);if(_0x3520e1[_0x4b4309(0x209)]){const _0x35795b=_0x3520e1[_0x4b4309(0x209)][_0x4b4309(0x231)](_0x32a8a7);if(_0x35795b)return{'name':_0x35795b,'isDuplicate':![],'isLocalMatch':!![]};}const _0x25a7bc=_0x3520e1[_0x4b4309(0x25f)][_0x4b4309(0x231)](_0x32a8a7);if(_0x25a7bc)return{'name':_0x25a7bc,'isDuplicate':!![],'isLocalMatch':![]};const _0x38b4f1=_0x2ee5cc(_0x117a0f);let _0x45a65a=_0x38b4f1||_0x117a0f,_0x3e6f2a=_0x45a65a,_0x237cfb=0x2;while(_0x3520e1[_0x4b4309(0x211)]['has'](_0x3e6f2a)){_0x3e6f2a=_0x45a65a+'_'+_0x237cfb,_0x237cfb++;}return _0x3520e1[_0x4b4309(0x211)]['add'](_0x3e6f2a),_0x3520e1[_0x4b4309(0x25f)][_0x4b4309(0x1d9)](_0x32a8a7,_0x3e6f2a),{'name':_0x3e6f2a,'isDuplicate':![],'isLocalMatch':![]};}function a193_0x2c65(_0x53f0ed,_0x44c9fc){_0x53f0ed=_0x53f0ed-0x1ae;const _0x3f4c9e=a193_0x3f4c();let _0x2c65df=_0x3f4c9e[_0x53f0ed];return _0x2c65df;}export function collectSegmentRefsFromRule(_0x375685){const _0x3f09a7=[],_0x17a8bd=_0x2b6e29=>{const _0x24092b=a193_0x2c65;if(!_0x2b6e29||typeof _0x2b6e29!==_0x24092b(0x1dc))return;if(Array[_0x24092b(0x265)](_0x2b6e29)){_0x2b6e29[_0x24092b(0x1b6)](_0x17a8bd);return;}const _0x161d19=_0x2b6e29;(_0x161d19[_0x24092b(0x1de)]===_0x24092b(0x1db)||_0x161d19[_0x24092b(0x1de)]==='exclude')&&typeof _0x161d19['segment']===_0x24092b(0x20a)&&_0x3f09a7[_0x24092b(0x1ff)](_0x161d19[_0x24092b(0x247)]);for(const _0x37fb60 of Object[_0x24092b(0x1e1)](_0x161d19)){_0x17a8bd(_0x37fb60);}};return _0x17a8bd(_0x375685),_0x3f09a7;}export function validateSegmentRule(_0x5be5a3,_0x5846be){const _0x414659=a193_0x1454d0;if(!_0x5846be||!_0x5846be[_0x414659(0x244)])return;for(let _0x5df954=0x0;_0x5df954<_0x5846be['conditions']['length'];_0x5df954++){const _0x5e8c41=_0x5846be['conditions'][_0x5df954];if(_0x414659(0x1de)in _0x5e8c41&&_0x5e8c41[_0x414659(0x1de)]===_0x414659(0x1da)){const _0x3a9fb9=_0x5e8c41,_0x3b31d8=_0x3a9fb9[_0x414659(0x238)]||_0x3a9fb9[_0x414659(0x1c7)];if((!_0x3a9fb9[_0x414659(0x21b)]||_0x3a9fb9[_0x414659(0x21b)]==='')&&!_0x3b31d8)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x414659(0x227)+_0x5be5a3+'\x27:\x20'+(_0x414659(0x1df)+_0x5df954+_0x414659(0x1b9))+_0x414659(0x24a));}}}
@@ -1 +1 @@
1
- function a187_0x5782(_0x170f84,_0x4d08fb){_0x170f84=_0x170f84-0x182;const _0xb2ea63=a187_0xb2ea();let _0x5782cc=_0xb2ea63[_0x170f84];return _0x5782cc;}(function(_0x446322,_0x2fa902){const _0x21ed0d=a187_0x5782,_0x302846=_0x446322();while(!![]){try{const _0x390917=-parseInt(_0x21ed0d(0x196))/0x1+parseInt(_0x21ed0d(0x18c))/0x2*(-parseInt(_0x21ed0d(0x1b4))/0x3)+-parseInt(_0x21ed0d(0x1b0))/0x4*(-parseInt(_0x21ed0d(0x1b2))/0x5)+parseInt(_0x21ed0d(0x1a3))/0x6*(parseInt(_0x21ed0d(0x19d))/0x7)+parseInt(_0x21ed0d(0x1ae))/0x8+-parseInt(_0x21ed0d(0x1a4))/0x9*(-parseInt(_0x21ed0d(0x19f))/0xa)+-parseInt(_0x21ed0d(0x185))/0xb;if(_0x390917===_0x2fa902)break;else _0x302846['push'](_0x302846['shift']());}catch(_0x2a8631){_0x302846['push'](_0x302846['shift']());}}}(a187_0xb2ea,0xa709f));import a187_0xeb095c from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x36cbe3){const _0x42240c=a187_0x5782,_0x25605c=_0x36cbe3['columns'][_0x42240c(0x182)](_0x1ee6ae=>({'column_name':_0x1ee6ae[_0x42240c(0x193)],'column_type':_0x1ee6ae[_0x42240c(0x18e)],'null':'YES','key':null,'default':null,'extra':null}));return{..._0x36cbe3,'columns':[{'name':_0x42240c(0x1bc),'type':_0x42240c(0x18f)},{'name':_0x42240c(0x1ab),'type':_0x42240c(0x18f)},{'name':_0x42240c(0x1bd),'type':_0x42240c(0x18f)},{'name':_0x42240c(0x1aa),'type':_0x42240c(0x18f)},{'name':'default','type':_0x42240c(0x18f)},{'name':'extra','type':'varchar'}],'data':_0x25605c};}export async function executeSchemaQuery(_0x1852af,_0x12caa1,_0x4bed50){const _0x4779ae=a187_0x5782,_0x87235e=_0x1852af[_0x4779ae(0x188)]()[_0x4779ae(0x19c)](/;+$/,''),_0x5c3f3d=_0x4779ae(0x187)+_0x87235e+_0x4779ae(0x1b1);_0x4bed50[_0x4779ae(0x199)]&&console[_0x4779ae(0x1ad)](_0x4779ae(0x1bb)+_0x5c3f3d);const _0x4849f4=await withProgressSpinner(_0x4779ae(0x197),async _0x477333=>{const _0x120bce=_0x4779ae,_0x3cf6f9=await _0x12caa1['query'][_0x120bce(0x18d)](_0x5c3f3d,{'catalog':'td','schema':_0x120bce(0x1b9),'onJobId':_0x5d4cbb=>{_0x477333['setJobId'](_0x5d4cbb);}});return _0x3cf6f9;},{'verbose':_0x4bed50[_0x4779ae(0x199)]});return buildSchemaResult(_0x4849f4[_0x4779ae(0x19b)]);}function columnName(_0x4758a0){const _0x4d6edb=a187_0x5782;return _0x4758a0[_0x4d6edb(0x1b7)]||_0x4758a0[_0x4d6edb(0x1a6)]||_0x4758a0[_0x4d6edb(0x193)];}function formatFieldLine(_0x35d139,_0x5babf1,_0x5b864f){const _0x3e924f=a187_0x5782,_0x34e2f2=_0x35d139!==_0x5babf1?'\x20'+a187_0xeb095c['dim']('('+_0x5babf1+')'):'';return _0x3e924f(0x1ba)+_0x35d139+_0x34e2f2+':\x20'+a187_0xeb095c[_0x3e924f(0x1b3)](_0x5b864f);}function sortByColumnName(_0x4f837d){const _0x55043a=a187_0x5782;return[..._0x4f837d][_0x55043a(0x18b)]((_0x15377d,_0x57d3c3)=>columnName(_0x15377d)[_0x55043a(0x184)](columnName(_0x57d3c3)));}function a187_0xb2ea(){const _0xbb64d2=['Unknown','sort','1877938qxJTdh','execute','type','varchar','behavior','groupingName','size','name','tableName','bold','838514kTQjNG','Fetching\x20schema...','some','verbose','push','data','replace','21KauNVY','source','708440uLZbIw','startsWith','matrixTableName','entries','1441926jFRqKt','153BFEuuL','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','parentColumn','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','parentTableName','set','key','column_type','Behaviors','error','4548928urYXgU','behaviorName','4775888jHSrwO','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','5HyNetP','cyan','3TqOWuU','displayName','filter','matrixColumnName','dim','information_schema','\x20\x20\x20\x20','Schema\x20query:\x0a','column_name','null','map','length','localeCompare','13488475hbRTsp','fields','SELECT\x20*\x20FROM\x20(\x0a','trim','attribute'];a187_0xb2ea=function(){return _0xbb64d2;};return a187_0xb2ea();}export function displayFieldsHumanReadable(_0x28eb20,_0x524c0c){const _0x12958f=a187_0x5782,_0x422e0e=_0x28eb20[_0x12958f(0x1b6)](_0x142240=>_0x142240[_0x12958f(0x19e)]===_0x12958f(0x189)),_0x2d4365=_0x28eb20['filter'](_0x5071ec=>_0x5071ec[_0x12958f(0x19e)]===_0x12958f(0x190)),_0xa64646=new Map();for(const _0x3c17d6 of _0x422e0e){const _0x8ed671=_0x3c17d6[_0x12958f(0x191)]||_0x3c17d6[_0x12958f(0x1a8)]||_0x12958f(0x18a),_0x46b329=_0xa64646['get'](_0x8ed671);_0x46b329?_0x46b329[_0x12958f(0x186)][_0x12958f(0x19a)](_0x3c17d6):_0xa64646[_0x12958f(0x1a9)](_0x8ed671,{'displayName':_0x8ed671,'tableName':_0x3c17d6[_0x12958f(0x1a8)],'fields':[_0x3c17d6]});}const _0x477cfd=new Map();for(const _0xd6ca45 of _0x2d4365){const _0x12934e=_0xd6ca45[_0x12958f(0x1af)]||'Unknown',_0x18e5b0=_0x477cfd['get'](_0x12934e)||[];_0x18e5b0[_0x12958f(0x19a)](_0xd6ca45),_0x477cfd['set'](_0x12934e,_0x18e5b0);}console[_0x12958f(0x1ad)]('\x0a'+a187_0xeb095c[_0x12958f(0x195)](_0x524c0c));if(_0xa64646[_0x12958f(0x192)]>0x0){console[_0x12958f(0x1ad)]('\x0a'+a187_0xeb095c[_0x12958f(0x1b8)]('Attributes'));const _0x2be42c=[..._0xa64646[_0x12958f(0x1a2)]()]['sort']((_0x2f1b4d,_0x4a4f01)=>_0x2f1b4d[0x0][_0x12958f(0x184)](_0x4a4f01[0x0]));for(const [,_0x552ec2]of _0x2be42c){const _0x5bda9f=_0x552ec2[_0x12958f(0x194)]&&_0x552ec2[_0x12958f(0x194)]!==_0x552ec2[_0x12958f(0x1b5)]?'\x20'+a187_0xeb095c[_0x12958f(0x1b8)]('('+_0x552ec2[_0x12958f(0x194)]+')'):'';console[_0x12958f(0x1ad)]('\x20\x20'+a187_0xeb095c[_0x12958f(0x195)](_0x552ec2[_0x12958f(0x1b5)])+_0x5bda9f);for(const _0x4e709c of sortByColumnName(_0x552ec2[_0x12958f(0x186)])){console[_0x12958f(0x1ad)](formatFieldLine(columnName(_0x4e709c),_0x4e709c['name'],_0x4e709c['type']));}}}if(_0x477cfd['size']>0x0){console['error']('\x0a'+a187_0xeb095c['dim'](_0x12958f(0x1ac)));const _0x579a66=[..._0x477cfd['entries']()][_0x12958f(0x18b)]((_0x12680f,_0x591ad3)=>_0x12680f[0x0][_0x12958f(0x184)](_0x591ad3[0x0]));for(const [_0x23109b,_0x2a6267]of _0x579a66){const _0x30a683=_0x2a6267[0x0],_0x20f456=_0x30a683?.[_0x12958f(0x1a1)];if(_0x20f456){const _0x27e723=_0x20f456!==_0x23109b?'\x20'+a187_0xeb095c[_0x12958f(0x1b8)]('('+_0x23109b+')'):'';console[_0x12958f(0x1ad)]('\x20\x20'+a187_0xeb095c[_0x12958f(0x195)](_0x20f456)+_0x27e723);}else{const _0x36dfb1=_0x30a683?.[_0x12958f(0x1a8)]||'';console[_0x12958f(0x1ad)]('\x20\x20'+a187_0xeb095c[_0x12958f(0x195)](_0x23109b)+(_0x36dfb1?'\x20'+a187_0xeb095c[_0x12958f(0x1b8)]('('+_0x36dfb1+')'):''));}for(const _0x37170c of sortByColumnName(_0x2a6267)){const _0x312f17=_0x37170c[_0x12958f(0x193)][_0x12958f(0x1a0)](_0x23109b+'.')?_0x37170c[_0x12958f(0x193)]['slice'](_0x23109b[_0x12958f(0x183)]+0x1):_0x37170c[_0x12958f(0x193)];console[_0x12958f(0x1ad)](formatFieldLine(columnName(_0x37170c),_0x312f17,_0x37170c['type']));}}}const _0x86fb3e=_0x28eb20[_0x12958f(0x198)](_0x3a47c3=>_0x3a47c3[_0x12958f(0x1b7)]||_0x3a47c3[_0x12958f(0x1a1)]);_0x86fb3e&&(console[_0x12958f(0x1ad)]('\x0a'+a187_0xeb095c[_0x12958f(0x1b8)](_0x12958f(0x1a7))),console['error'](a187_0xeb095c[_0x12958f(0x1b8)](_0x12958f(0x1a5)))),console[_0x12958f(0x1ad)]('');}
1
+ (function(_0x3e8c2e,_0x37d8b4){const _0x474f69=a194_0x23d8,_0x23dba3=_0x3e8c2e();while(!![]){try{const _0x120e59=parseInt(_0x474f69(0x90))/0x1*(-parseInt(_0x474f69(0x6c))/0x2)+parseInt(_0x474f69(0x7e))/0x3*(parseInt(_0x474f69(0x9e))/0x4)+-parseInt(_0x474f69(0x6b))/0x5+-parseInt(_0x474f69(0x6e))/0x6*(-parseInt(_0x474f69(0x94))/0x7)+parseInt(_0x474f69(0x67))/0x8+parseInt(_0x474f69(0x80))/0x9*(-parseInt(_0x474f69(0x65))/0xa)+parseInt(_0x474f69(0x69))/0xb;if(_0x120e59===_0x37d8b4)break;else _0x23dba3['push'](_0x23dba3['shift']());}catch(_0x3fa847){_0x23dba3['push'](_0x23dba3['shift']());}}}(a194_0xe494,0xbbe72));import a194_0x4ec558 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';function a194_0xe494(){const _0x4ce244=['setJobId','extra','dim','parentTableName','null','Schema\x20query:\x0a','129ntjRHh','push','5636151xfpVGt','replace','behavior','behaviorName','matrixTableName','name','Unknown','length','trim','YES','error','displayName','type','Fetching\x20schema...','matrixColumnName','SELECT\x20*\x20FROM\x20(\x0a','13URILlh','column_name','verbose','key','7tDRKjG','attribute','some','source','\x20\x20\x20\x20','cyan','fields','parentColumn','sort','entries','102916HZfKeZ','filter','10xYmvGG','query','8316248tgreSC','columns','1013650uAftDZ','tableName','6806880oVPjGV','17828MfcdSf','set','3810714AAIKAi','default','Attributes','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','execute','varchar','localeCompare','Behaviors','data','bold'];a194_0xe494=function(){return _0x4ce244;};return a194_0xe494();}export function buildSchemaResult(_0x187c47){const _0x4b3d0c=a194_0x23d8,_0x54c991=_0x187c47[_0x4b3d0c(0x68)]['map'](_0x3cdfca=>({'column_name':_0x3cdfca[_0x4b3d0c(0x85)],'column_type':_0x3cdfca['type'],'null':_0x4b3d0c(0x89),'key':null,'default':null,'extra':null}));return{..._0x187c47,'columns':[{'name':_0x4b3d0c(0x91),'type':_0x4b3d0c(0x73)},{'name':'column_type','type':'varchar'},{'name':_0x4b3d0c(0x7c),'type':'varchar'},{'name':_0x4b3d0c(0x93),'type':_0x4b3d0c(0x73)},{'name':_0x4b3d0c(0x6f),'type':_0x4b3d0c(0x73)},{'name':_0x4b3d0c(0x79),'type':_0x4b3d0c(0x73)}],'data':_0x54c991};}export async function executeSchemaQuery(_0x3b75bc,_0x5ddc1a,_0x1a949c){const _0x52ef6f=a194_0x23d8,_0x44fbf2=_0x3b75bc[_0x52ef6f(0x88)]()[_0x52ef6f(0x81)](/;+$/,''),_0x558b0a=_0x52ef6f(0x8f)+_0x44fbf2+'\x0a)\x20AS\x20segment_query\x20LIMIT\x200';_0x1a949c[_0x52ef6f(0x92)]&&console[_0x52ef6f(0x8a)](_0x52ef6f(0x7d)+_0x558b0a);const _0x1050ac=await withProgressSpinner(_0x52ef6f(0x8d),async _0xa4ce9b=>{const _0x4655ec=_0x52ef6f,_0x232519=await _0x5ddc1a[_0x4655ec(0x66)][_0x4655ec(0x72)](_0x558b0a,{'catalog':'td','schema':'information_schema','onJobId':_0x8ca52d=>{const _0x5353cf=_0x4655ec;_0xa4ce9b[_0x5353cf(0x78)](_0x8ca52d);}});return _0x232519;},{'verbose':_0x1a949c[_0x52ef6f(0x92)]});return buildSchemaResult(_0x1050ac[_0x52ef6f(0x76)]);}function columnName(_0x3fbbe2){const _0x18be4d=a194_0x23d8;return _0x3fbbe2['matrixColumnName']||_0x3fbbe2[_0x18be4d(0x9b)]||_0x3fbbe2[_0x18be4d(0x85)];}function formatFieldLine(_0x2ea079,_0x144849,_0x2e656a){const _0x126ecf=a194_0x23d8,_0x17e247=_0x2ea079!==_0x144849?'\x20'+a194_0x4ec558[_0x126ecf(0x7a)]('('+_0x144849+')'):'';return _0x126ecf(0x98)+_0x2ea079+_0x17e247+':\x20'+a194_0x4ec558[_0x126ecf(0x99)](_0x2e656a);}function sortByColumnName(_0x5da44e){const _0x3d11c8=a194_0x23d8;return[..._0x5da44e][_0x3d11c8(0x9c)]((_0x1b3c79,_0x2fbb99)=>columnName(_0x1b3c79)[_0x3d11c8(0x74)](columnName(_0x2fbb99)));}function a194_0x23d8(_0x558d52,_0x277df3){_0x558d52=_0x558d52-0x65;const _0xe494af=a194_0xe494();let _0x23d856=_0xe494af[_0x558d52];return _0x23d856;}export function displayFieldsHumanReadable(_0x23e55a,_0x37033d){const _0x5e9a0f=a194_0x23d8,_0x1ffd26=_0x23e55a[_0x5e9a0f(0x9f)](_0x4e001e=>_0x4e001e[_0x5e9a0f(0x97)]===_0x5e9a0f(0x95)),_0x2baa12=_0x23e55a[_0x5e9a0f(0x9f)](_0x324eaa=>_0x324eaa['source']===_0x5e9a0f(0x82)),_0x592ee7=new Map();for(const _0x2e3dcd of _0x1ffd26){const _0x3a215e=_0x2e3dcd['groupingName']||_0x2e3dcd[_0x5e9a0f(0x7b)]||_0x5e9a0f(0x86),_0x46cbf0=_0x592ee7['get'](_0x3a215e);_0x46cbf0?_0x46cbf0['fields']['push'](_0x2e3dcd):_0x592ee7[_0x5e9a0f(0x6d)](_0x3a215e,{'displayName':_0x3a215e,'tableName':_0x2e3dcd[_0x5e9a0f(0x7b)],'fields':[_0x2e3dcd]});}const _0x1db9ca=new Map();for(const _0x1be816 of _0x2baa12){const _0x37b41d=_0x1be816[_0x5e9a0f(0x83)]||_0x5e9a0f(0x86),_0x3ab807=_0x1db9ca['get'](_0x37b41d)||[];_0x3ab807[_0x5e9a0f(0x7f)](_0x1be816),_0x1db9ca[_0x5e9a0f(0x6d)](_0x37b41d,_0x3ab807);}console[_0x5e9a0f(0x8a)]('\x0a'+a194_0x4ec558[_0x5e9a0f(0x77)](_0x37033d));if(_0x592ee7['size']>0x0){console[_0x5e9a0f(0x8a)]('\x0a'+a194_0x4ec558[_0x5e9a0f(0x7a)](_0x5e9a0f(0x70)));const _0x3e5f28=[..._0x592ee7['entries']()][_0x5e9a0f(0x9c)]((_0x24fdf7,_0x50860b)=>_0x24fdf7[0x0][_0x5e9a0f(0x74)](_0x50860b[0x0]));for(const [,_0x4ad493]of _0x3e5f28){const _0x1e3524=_0x4ad493['tableName']&&_0x4ad493[_0x5e9a0f(0x6a)]!==_0x4ad493[_0x5e9a0f(0x8b)]?'\x20'+a194_0x4ec558[_0x5e9a0f(0x7a)]('('+_0x4ad493[_0x5e9a0f(0x6a)]+')'):'';console[_0x5e9a0f(0x8a)]('\x20\x20'+a194_0x4ec558[_0x5e9a0f(0x77)](_0x4ad493['displayName'])+_0x1e3524);for(const _0x36e76f of sortByColumnName(_0x4ad493[_0x5e9a0f(0x9a)])){console[_0x5e9a0f(0x8a)](formatFieldLine(columnName(_0x36e76f),_0x36e76f[_0x5e9a0f(0x85)],_0x36e76f[_0x5e9a0f(0x8c)]));}}}if(_0x1db9ca['size']>0x0){console[_0x5e9a0f(0x8a)]('\x0a'+a194_0x4ec558[_0x5e9a0f(0x7a)](_0x5e9a0f(0x75)));const _0x2ccc3a=[..._0x1db9ca[_0x5e9a0f(0x9d)]()][_0x5e9a0f(0x9c)]((_0x1969bb,_0x3e7353)=>_0x1969bb[0x0][_0x5e9a0f(0x74)](_0x3e7353[0x0]));for(const [_0x456c8e,_0x1a5724]of _0x2ccc3a){const _0x3f45f3=_0x1a5724[0x0],_0x345769=_0x3f45f3?.[_0x5e9a0f(0x84)];if(_0x345769){const _0x4c9700=_0x345769!==_0x456c8e?'\x20'+a194_0x4ec558[_0x5e9a0f(0x7a)]('('+_0x456c8e+')'):'';console['error']('\x20\x20'+a194_0x4ec558[_0x5e9a0f(0x77)](_0x345769)+_0x4c9700);}else{const _0x19db19=_0x3f45f3?.[_0x5e9a0f(0x7b)]||'';console[_0x5e9a0f(0x8a)]('\x20\x20'+a194_0x4ec558['bold'](_0x456c8e)+(_0x19db19?'\x20'+a194_0x4ec558[_0x5e9a0f(0x7a)]('('+_0x19db19+')'):''));}for(const _0x377730 of sortByColumnName(_0x1a5724)){const _0x281473=_0x377730['name']['startsWith'](_0x456c8e+'.')?_0x377730['name']['slice'](_0x456c8e[_0x5e9a0f(0x87)]+0x1):_0x377730[_0x5e9a0f(0x85)];console[_0x5e9a0f(0x8a)](formatFieldLine(columnName(_0x377730),_0x281473,_0x377730['type']));}}}const _0x2778e2=_0x23e55a[_0x5e9a0f(0x96)](_0x348bd1=>_0x348bd1[_0x5e9a0f(0x8e)]||_0x348bd1[_0x5e9a0f(0x84)]);_0x2778e2&&(console[_0x5e9a0f(0x8a)]('\x0a'+a194_0x4ec558[_0x5e9a0f(0x7a)]('Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).')),console[_0x5e9a0f(0x8a)](a194_0x4ec558[_0x5e9a0f(0x7a)](_0x5e9a0f(0x71)))),console[_0x5e9a0f(0x8a)]('');}
@@ -1 +1 @@
1
- (function(_0x162674,_0x1be630){const _0x8f28df=a188_0x1c2c,_0x53e45e=_0x162674();while(!![]){try{const _0x1ee9bb=-parseInt(_0x8f28df(0x1f0))/0x1+parseInt(_0x8f28df(0x1f6))/0x2+-parseInt(_0x8f28df(0x1f3))/0x3*(parseInt(_0x8f28df(0x1ef))/0x4)+parseInt(_0x8f28df(0x1fe))/0x5+parseInt(_0x8f28df(0x200))/0x6*(parseInt(_0x8f28df(0x1fc))/0x7)+-parseInt(_0x8f28df(0x1fd))/0x8+-parseInt(_0x8f28df(0x201))/0x9;if(_0x1ee9bb===_0x1be630)break;else _0x53e45e['push'](_0x53e45e['shift']());}catch(_0x5175e8){_0x53e45e['push'](_0x53e45e['shift']());}}}(a188_0x1da1,0xd4e47));import{readdirSync,statSync}from'fs';import a188_0x30ff21 from'path';export function findYamlFiles(_0x324725){const _0x4941de=[];function _0x2af3cb(_0x563195){const _0x3b9e9b=a188_0x1c2c,_0x1507a8=readdirSync(_0x563195,{'withFileTypes':!![]});for(const _0x5b5edb of _0x1507a8){const _0x1a2a6e=a188_0x30ff21[_0x3b9e9b(0x1f5)](_0x563195,_0x5b5edb[_0x3b9e9b(0x1ff)]);if(_0x5b5edb[_0x3b9e9b(0x1f4)]())_0x2af3cb(_0x1a2a6e);else(_0x5b5edb['name'][_0x3b9e9b(0x1f8)](_0x3b9e9b(0x1f2))||_0x5b5edb[_0x3b9e9b(0x1ff)]['endsWith'](_0x3b9e9b(0x1fb)))&&_0x4941de['push'](_0x1a2a6e);}}return _0x2af3cb(_0x324725),_0x4941de;}export function discoverYamlFiles(_0x5485b6){const _0x5439a4=a188_0x1c2c,_0x24dbfa=findYamlFiles(_0x5485b6);return _0x24dbfa[_0x5439a4(0x1f9)](_0x24de1b=>{const _0x19be78=_0x5439a4,_0x5d5ead=a188_0x30ff21[_0x19be78(0x1f1)](_0x5485b6,_0x24de1b),_0x17d922=a188_0x30ff21['dirname'](_0x5d5ead);return{'absolutePath':_0x24de1b,'relativePath':_0x5d5ead,'folderPath':_0x17d922==='.'?'':_0x17d922[_0x19be78(0x1fa)](/\\/g,'/')};});}function a188_0x1da1(){const _0x52ea2e=['7NjcbpZ','1750056DpaxoW','5050050njkFoy','name','2052492bCVuez','634887JuGdyJ','isFile','4eQZmZF','154611ZEgnHI','relative','.yml','3210522tpCvrs','isDirectory','join','2068000gMuigc','extname','endsWith','map','replace','.yaml'];a188_0x1da1=function(){return _0x52ea2e;};return a188_0x1da1();}function a188_0x1c2c(_0x2767a0,_0x3c7d94){_0x2767a0=_0x2767a0-0x1ef;const _0x1da181=a188_0x1da1();let _0x1c2cb0=_0x1da181[_0x2767a0];return _0x1c2cb0;}export function isYamlFile(_0x5eafea){const _0x2af670=a188_0x1c2c;try{const _0x4ca295=statSync(_0x5eafea);if(!_0x4ca295[_0x2af670(0x202)]())return![];const _0x4df63b=a188_0x30ff21[_0x2af670(0x1f7)](_0x5eafea)['toLowerCase']();return _0x4df63b===_0x2af670(0x1f2)||_0x4df63b===_0x2af670(0x1fb);}catch{return![];}}
1
+ function a195_0x5106(){const _0x4143d9=['1560635FXcGpL','replace','push','.yaml','605322jYrcBV','isDirectory','map','3190744alQzto','17708540UxfptG','isFile','extname','join','.yml','15942EwQkBQ','550863QwpFMX','6wEAWqk','11IHqkxr','24LvmOTL','endsWith','819ORjwGY','649357xjteTe','name'];a195_0x5106=function(){return _0x4143d9;};return a195_0x5106();}(function(_0x4d48a8,_0x155175){const _0x3c8e6d=a195_0x3740,_0x1790f9=_0x4d48a8();while(!![]){try{const _0x19539a=-parseInt(_0x3c8e6d(0x15f))/0x1+parseInt(_0x3c8e6d(0x170))/0x2*(-parseInt(_0x3c8e6d(0x16f))/0x3)+-parseInt(_0x3c8e6d(0x168))/0x4+parseInt(_0x3c8e6d(0x161))/0x5+-parseInt(_0x3c8e6d(0x16e))/0x6*(-parseInt(_0x3c8e6d(0x174))/0x7)+parseInt(_0x3c8e6d(0x172))/0x8*(parseInt(_0x3c8e6d(0x165))/0x9)+parseInt(_0x3c8e6d(0x169))/0xa*(parseInt(_0x3c8e6d(0x171))/0xb);if(_0x19539a===_0x155175)break;else _0x1790f9['push'](_0x1790f9['shift']());}catch(_0x409f77){_0x1790f9['push'](_0x1790f9['shift']());}}}(a195_0x5106,0x91ed6));function a195_0x3740(_0x593160,_0x221dd7){_0x593160=_0x593160-0x15f;const _0x51067a=a195_0x5106();let _0x3740e8=_0x51067a[_0x593160];return _0x3740e8;}import{readdirSync,statSync}from'fs';import a195_0x97eaf2 from'path';export function findYamlFiles(_0x1fc58d){const _0x8d5487=[];function _0x5ed93c(_0x1679bd){const _0x33bf02=a195_0x3740,_0x418d2e=readdirSync(_0x1679bd,{'withFileTypes':!![]});for(const _0xa7d5eb of _0x418d2e){const _0x10dec2=a195_0x97eaf2[_0x33bf02(0x16c)](_0x1679bd,_0xa7d5eb[_0x33bf02(0x160)]);if(_0xa7d5eb[_0x33bf02(0x166)]())_0x5ed93c(_0x10dec2);else(_0xa7d5eb[_0x33bf02(0x160)][_0x33bf02(0x173)](_0x33bf02(0x16d))||_0xa7d5eb[_0x33bf02(0x160)][_0x33bf02(0x173)](_0x33bf02(0x164)))&&_0x8d5487[_0x33bf02(0x163)](_0x10dec2);}}return _0x5ed93c(_0x1fc58d),_0x8d5487;}export function discoverYamlFiles(_0x47a43a){const _0x227d96=a195_0x3740,_0x386144=findYamlFiles(_0x47a43a);return _0x386144[_0x227d96(0x167)](_0x1d7f77=>{const _0x45e12b=_0x227d96,_0x587f60=a195_0x97eaf2['relative'](_0x47a43a,_0x1d7f77),_0x323836=a195_0x97eaf2['dirname'](_0x587f60);return{'absolutePath':_0x1d7f77,'relativePath':_0x587f60,'folderPath':_0x323836==='.'?'':_0x323836[_0x45e12b(0x162)](/\\/g,'/')};});}export function isYamlFile(_0x1c2435){const _0x487994=a195_0x3740;try{const _0x46ee3f=statSync(_0x1c2435);if(!_0x46ee3f[_0x487994(0x16a)]())return![];const _0x1ad88e=a195_0x97eaf2[_0x487994(0x16b)](_0x1c2435)['toLowerCase']();return _0x1ad88e===_0x487994(0x16d)||_0x1ad88e==='.yaml';}catch{return![];}}
@@ -1 +1 @@
1
- function a189_0xadf8(){const _0x345da7=['toLowerCase','entry_criteria','behavior','push','draft','yaml','null','match','get','184190zFWxzQ','endsWith','connection','set','type','values','activation','exit_criteria','milestone','keys','rule','journeys','sort','notification','wait','.yaml','object','nameMapping','483259spChWG','10qPWNbS','journey','reentry','2143368uVbrUt','trim','item','9KYYJkJ','with','steps','index','all_columns','name','latest','stages','goal','replace','segment','columns','versions','description','conditions','1015516oGsghw','schedule','version_number','journeyBundleName','activations','attributes','8nOgepl','bundle_id','merged','stringify','condition','from','has','journeyStages','version','branches','map','1613370QpIUUm','string','5vkfeUf','length','activation_template_id','launched','join','slice','2422740vSQOft','isArray','entries','2586871asdsAo'];a189_0xadf8=function(){return _0x345da7;};return a189_0xadf8();}(function(_0x113c33,_0x40074f){const _0x7d8da9=a189_0x293e,_0x159e84=_0x113c33();while(!![]){try{const _0x492467=parseInt(_0x7d8da9(0xdc))/0x1+-parseInt(_0x7d8da9(0xca))/0x2*(parseInt(_0x7d8da9(0x95))/0x3)+parseInt(_0x7d8da9(0xa4))/0x4*(parseInt(_0x7d8da9(0xb7))/0x5)+-parseInt(_0x7d8da9(0xbd))/0x6+-parseInt(_0x7d8da9(0xc0))/0x7*(-parseInt(_0x7d8da9(0xaa))/0x8)+parseInt(_0x7d8da9(0xe0))/0x9*(-parseInt(_0x7d8da9(0xdd))/0xa)+parseInt(_0x7d8da9(0xb5))/0xb;if(_0x492467===_0x40074f)break;else _0x159e84['push'](_0x159e84['shift']());}catch(_0x225427){_0x159e84['push'](_0x159e84['shift']());}}}(a189_0xadf8,0x51d1e));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;function a189_0x293e(_0x2f97d4,_0x110c07){_0x2f97d4=_0x2f97d4-0x95;const _0xadf867=a189_0xadf8();let _0x293e36=_0xadf867[_0x2f97d4];return _0x293e36;}export function sanitizeYamlKey(_0x4396a5){const _0x515ae1=a189_0x293e;return _0x4396a5['toLowerCase']()[_0x515ae1(0x9e)](/\s+/g,'_')[_0x515ae1(0x9e)](/[^a-z0-9_\p{L}\p{N}]/gu,'')['replace'](/_+/g,'_')[_0x515ae1(0x9e)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x5459f1){const _0x2b0b87=a189_0x293e,_0x3527a4=_0x5459f1[_0x2b0b87(0xc8)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x3527a4){const _0x4aeb1a=_0x3527a4[0x1][_0x2b0b87(0xc1)](),_0x394c23=_0x3527a4[0x2],_0x3a4cd1=_0x394c23[_0x2b0b87(0x9e)](/-/g,'')[_0x2b0b87(0xbc)](0x0,0x4)[_0x2b0b87(0xc1)]();return _0x4aeb1a+'_'+_0x3a4cd1;}const _0x2214b6=_0x5459f1[_0x2b0b87(0xc8)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x2214b6){const _0x4f63a1=_0x2214b6[0x1],_0x5b67a3=_0x2214b6[0x2][_0x2b0b87(0xc1)](),_0x183fe1=_0x4f63a1['replace'](/-/g,'')[_0x2b0b87(0xbc)](0x0,0x4)[_0x2b0b87(0xc1)]();return _0x5b67a3+'_'+_0x183fe1;}return undefined;}function stableStringify(_0xe7c662){const _0x2afcec=a189_0x293e;if(Array[_0x2afcec(0xbe)](_0xe7c662))return'['+_0xe7c662[_0x2afcec(0xb4)](_0x546bce=>stableStringify(_0x546bce))['join'](',')+']';if(_0xe7c662&&typeof _0xe7c662===_0x2afcec(0xda)){const _0xec7ef9=_0xe7c662,_0x5bf696=Object['keys'](_0xec7ef9)[_0x2afcec(0xd6)](),_0x1e80d2=_0x5bf696[_0x2afcec(0xb4)](_0x2fd5c4=>'\x22'+_0x2fd5c4+'\x22:'+stableStringify(_0xec7ef9[_0x2fd5c4]));return'{'+_0x1e80d2[_0x2afcec(0xbb)](',')+'}';}const _0x5f5749=JSON[_0x2afcec(0xad)](_0xe7c662);return _0x5f5749===undefined?_0x2afcec(0xc7):_0x5f5749;}export function consolidateActivationsByContent(_0xe3f2f7){const _0x414b3d=a189_0x293e,_0x290cd9={},_0x4fd0ff=new Map(),_0x57afaf=new Map();for(const _0x352231 of _0xe3f2f7){if(!_0x352231)continue;for(const [_0x454904,_0x12a8e4]of Object['entries'](_0x352231)){const _0xeebfd1={'name':_0x12a8e4[_0x414b3d(0x9a)],'connection':_0x12a8e4[_0x414b3d(0xcc)],..._0x12a8e4[_0x414b3d(0x99)]!==undefined&&{'all_columns':_0x12a8e4[_0x414b3d(0x99)]},..._0x12a8e4[_0x414b3d(0xa0)]!==undefined&&{'columns':_0x12a8e4[_0x414b3d(0xa0)]},..._0x12a8e4[_0x414b3d(0xc3)]!==undefined&&{'behavior':_0x12a8e4[_0x414b3d(0xc3)]},..._0x12a8e4[_0x414b3d(0xa5)]!==undefined&&{'schedule':_0x12a8e4['schedule']},..._0x12a8e4['notification']!==undefined&&{'notification':_0x12a8e4[_0x414b3d(0xd7)]},..._0x12a8e4['connector_config']!==undefined&&{'connector_config':_0x12a8e4['connector_config']},..._0x12a8e4[_0x414b3d(0xb9)]!==undefined&&{'activation_template_id':_0x12a8e4[_0x414b3d(0xb9)]}},_0xcd2c0=stableStringify(_0xeebfd1),_0xea2670=_0x57afaf[_0x414b3d(0xc9)](_0xcd2c0);_0xea2670?_0x4fd0ff[_0x414b3d(0xcd)](_0x454904,_0xea2670):(_0x290cd9[_0x454904]=_0x12a8e4,_0x4fd0ff['set'](_0x454904,_0x454904),_0x57afaf['set'](_0xcd2c0,_0x454904));}}return{'merged':_0x290cd9,'nameMapping':_0x4fd0ff};}export function updateActivationReferences(_0xf477e9,_0xa341f1){const _0x3d6982=a189_0x293e;if(!_0xf477e9)return;for(const _0x3562df of _0xf477e9){if(!_0x3562df[_0x3d6982(0x97)])continue;for(const _0x5bc091 of _0x3562df[_0x3d6982(0x97)]){if(_0x5bc091[_0x3d6982(0xce)]===_0x3d6982(0xd0)&&_0x5bc091['with']?.[_0x3d6982(0xd0)]){const _0x1f44fb=_0xa341f1[_0x3d6982(0xc9)](_0x5bc091[_0x3d6982(0x96)][_0x3d6982(0xd0)]);_0x1f44fb&&_0x1f44fb!==_0x5bc091[_0x3d6982(0x96)][_0x3d6982(0xd0)]&&(_0x5bc091[_0x3d6982(0x96)][_0x3d6982(0xd0)]=_0x1f44fb);}}}}export function consolidateSegmentsByContent(_0x4a7be7,_0x54764b){const _0x188987=a189_0x293e,_0x33d483={},_0x5b5bbf=new Map(),_0x13e103=new Map();for(const _0x246683 of _0x4a7be7){if(!_0x246683)continue;for(const [_0x137f18,_0x277595]of Object[_0x188987(0xbf)](_0x246683)){if(!_0x277595[_0x188987(0xd4)]){_0x33d483[_0x137f18]=_0x277595,_0x5b5bbf['set'](_0x137f18,_0x137f18);continue;}const _0xd50a38=_0x277595[_0x188987(0xa2)]&&_0x277595[_0x188987(0xa2)][_0x188987(0xe1)]()?_0x277595[_0x188987(0xa2)]:undefined,_0x41f050=JSON[_0x188987(0xad)]({'description':_0xd50a38,'rule':deepSortObject(_0x277595[_0x188987(0xd4)])}),_0x3f935a=_0x13e103[_0x188987(0xc9)](_0x41f050);if(_0x3f935a){const _0x34346b={..._0x277595[_0x188987(0xa2)]!==undefined&&{'description':_0x277595['description']},'rule':_0x277595[_0x188987(0xd4)]?deepSortObject(_0x277595[_0x188987(0xd4)]):_0x277595[_0x188987(0xd4)]};if(_0x137f18<_0x3f935a){_0x33d483[_0x137f18]=_0x34346b,delete _0x33d483[_0x3f935a];for(const [_0x31668f,_0x21ef89]of _0x5b5bbf[_0x188987(0xbf)]()){_0x21ef89===_0x3f935a&&_0x5b5bbf['set'](_0x31668f,_0x137f18);}_0x5b5bbf[_0x188987(0xcd)](_0x137f18,_0x137f18),_0x13e103[_0x188987(0xcd)](_0x41f050,_0x137f18);}else _0x33d483[_0x3f935a]=_0x34346b,_0x5b5bbf[_0x188987(0xcd)](_0x137f18,_0x3f935a);}else{let _0x47e28e=_0x137f18;if(_0x54764b){const _0x397b95=_0x54764b[_0x188987(0xc9)](_0x41f050);_0x397b95&&_0x397b95[_0x188987(0xb8)]>0x0&&(_0x47e28e=_0x397b95[_0x188987(0xbc)]()[_0x188987(0xd6)]()[0x0]);}const _0x52fb6a={..._0x277595[_0x188987(0xa2)]!==undefined&&{'description':_0x277595['description']},'rule':_0x277595[_0x188987(0xd4)]?deepSortObject(_0x277595[_0x188987(0xd4)]):_0x277595['rule']};_0x33d483[_0x47e28e]=_0x52fb6a,_0x5b5bbf[_0x188987(0xcd)](_0x137f18,_0x47e28e),_0x13e103['set'](_0x41f050,_0x47e28e);}}}return{'merged':_0x33d483,'nameMapping':_0x5b5bbf};}export function updateSegmentReferences(_0x12abeb,_0x2fc00b){const _0x582fa0=a189_0x293e;if(!_0x12abeb)return;for(const _0x506bd1 of _0x12abeb){if(_0x506bd1[_0x582fa0(0xc2)]?.[_0x582fa0(0x9f)]){const _0x47cda2=_0x2fc00b[_0x582fa0(0xc9)](_0x506bd1[_0x582fa0(0xc2)]['segment']);_0x47cda2&&(_0x506bd1[_0x582fa0(0xc2)][_0x582fa0(0x9f)]=_0x47cda2);}if(_0x506bd1[_0x582fa0(0xd1)])for(const _0x567511 of _0x506bd1[_0x582fa0(0xd1)]){if(_0x567511[_0x582fa0(0x9f)]){const _0x3614ec=_0x2fc00b['get'](_0x567511[_0x582fa0(0x9f)]);_0x3614ec&&(_0x567511[_0x582fa0(0x9f)]=_0x3614ec);}}if(_0x506bd1['milestone']?.[_0x582fa0(0x9f)]){const _0x59b7d7=_0x2fc00b['get'](_0x506bd1['milestone']['segment']);_0x59b7d7&&(_0x506bd1['milestone'][_0x582fa0(0x9f)]=_0x59b7d7);}if(_0x506bd1['steps'])for(const _0x3e5689 of _0x506bd1[_0x582fa0(0x97)]){if(_0x3e5689[_0x582fa0(0xce)]==='decision_point'&&_0x3e5689[_0x582fa0(0x96)]?.[_0x582fa0(0xb3)])for(const _0x4df6d7 of _0x3e5689[_0x582fa0(0x96)]['branches']){if(_0x4df6d7['segment']){const _0x1adaf6=_0x2fc00b[_0x582fa0(0xc9)](_0x4df6d7[_0x582fa0(0x9f)]);_0x1adaf6&&(_0x4df6d7['segment']=_0x1adaf6);}}if(_0x3e5689[_0x582fa0(0xce)]===_0x582fa0(0xd8)&&_0x3e5689[_0x582fa0(0x96)]?.[_0x582fa0(0xae)]?.[_0x582fa0(0x9f)]){const _0x2ac108=_0x2fc00b['get'](_0x3e5689[_0x582fa0(0x96)]['condition']['segment']);_0x2ac108&&(_0x3e5689[_0x582fa0(0x96)]['condition'][_0x582fa0(0x9f)]=_0x2ac108);}}}}export function updateSegmentRefsInSegments(_0x1ecfe5,_0x296c9d){const _0x2fdb4d=a189_0x293e;for(const _0x3b9aab of Object[_0x2fdb4d(0xcf)](_0x1ecfe5)){_0x3b9aab['rule']&&updateSegmentRefsInRule(_0x3b9aab[_0x2fdb4d(0xd4)],_0x296c9d);}}function updateSegmentRefsInRule(_0x370921,_0x340119){const _0x33498b=a189_0x293e;if(_0x370921===null||typeof _0x370921!==_0x33498b(0xda))return;if(Array[_0x33498b(0xbe)](_0x370921)){for(const _0x3d19fd of _0x370921){updateSegmentRefsInRule(_0x3d19fd,_0x340119);}return;}const _0x1f07ae=_0x370921;if((_0x1f07ae['type']==='include'||_0x1f07ae[_0x33498b(0xce)]==='exclude')&&typeof _0x1f07ae[_0x33498b(0x9f)]===_0x33498b(0xb6)){const _0x4e318a=_0x340119[_0x33498b(0xc9)](_0x1f07ae['segment']);_0x4e318a&&(_0x1f07ae[_0x33498b(0x9f)]=_0x4e318a);}if(_0x1f07ae[_0x33498b(0xa3)]&&Array[_0x33498b(0xbe)](_0x1f07ae['conditions']))for(const _0x2d4710 of _0x1f07ae[_0x33498b(0xa3)]){updateSegmentRefsInRule(_0x2d4710,_0x340119);}}export function buildJourneysArray(_0x3a0d59,_0x123fbc){const _0x3aae24=a189_0x293e;return _0x3a0d59[_0x3aae24(0xb4)](_0x7ed456=>{const _0x3ce8d8=_0x3aae24,_0xcf85db=_0x123fbc?_0x7ed456['item']['id']===_0x123fbc:_0x3a0d59[_0x3ce8d8(0xb8)]===0x1,_0x3219a3=_0x7ed456['yaml'][_0x3ce8d8(0xd5)]?.[0x0],_0x16700e=_0x3219a3?.[_0x3ce8d8(0x9d)]||_0x7ed456['yaml'][_0x3ce8d8(0x9d)],_0x2c4e81={'version':_0x3219a3?.[_0x3ce8d8(0xb2)]||_0x7ed456[_0x3ce8d8(0xc6)][_0x3ce8d8(0xb2)]||_0x7ed456[_0x3ce8d8(0xe2)][_0x3ce8d8(0x9a)],'state':_0x7ed456[_0x3ce8d8(0xe2)]['state']===_0x3ce8d8(0xba)?_0x3ce8d8(0xba):_0x3ce8d8(0xc5),'stages':_0x3219a3?.[_0x3ce8d8(0x9c)]||_0x7ed456['yaml'][_0x3ce8d8(0x9c)]||[],'id':_0x3219a3?.['id']||_0x7ed456['yaml']['id'],'version_number':_0x3219a3?.[_0x3ce8d8(0xa6)]||_0x7ed456[_0x3ce8d8(0xc6)][_0x3ce8d8(0xa6)]};return _0x16700e&&(_0x2c4e81[_0x3ce8d8(0x9d)]=_0x16700e),_0xcf85db&&(_0x2c4e81[_0x3ce8d8(0x9b)]=!![]),_0x2c4e81;});}export function buildMergedJourneyDef(_0x105b82,_0x36b84d,_0x3a094a){const _0x569ec2=a189_0x293e,_0x2fc45b=_0x105b82[0x0][_0x569ec2(0xc6)],_0x3dbc57=buildJourneysArray(_0x105b82,_0x3a094a),{merged:_0x12142c,nameMapping:_0x4b68c7}=consolidateSegmentsByContent(_0x105b82['map'](_0x17c654=>_0x17c654[_0x569ec2(0xc6)]['segments']),_0x36b84d);updateSegmentRefsInSegments(_0x12142c,_0x4b68c7);const _0x5760d9=Array[_0x569ec2(0xaf)](_0x4b68c7[_0x569ec2(0xbf)]())['some'](([_0xfb4f9f,_0xa662d3])=>_0xfb4f9f!==_0xa662d3&&_0xfb4f9f['startsWith']('entry_criteria'));let _0x117b84=_0x12142c,_0x5302f6=new Map();if(_0x5760d9){const _0x2f2703=consolidateSegmentsByContent([_0x12142c],_0x36b84d);_0x117b84=_0x2f2703[_0x569ec2(0xac)],_0x5302f6=_0x2f2703[_0x569ec2(0xdb)];}const _0x7fc17e=new Map(_0x4b68c7);for(const [_0x47e6cf,_0x38609a]of _0x5302f6[_0x569ec2(0xbf)]()){_0x7fc17e[_0x569ec2(0xcd)](_0x47e6cf,_0x38609a);}for(const [_0x4bf8c2,_0x1fa1ef]of _0x7fc17e['entries']()){let _0xc0cd18=_0x1fa1ef,_0x2ce28f=0x0;while(_0x7fc17e[_0x569ec2(0xb0)](_0xc0cd18)&&_0x7fc17e['get'](_0xc0cd18)!==_0xc0cd18&&_0x2ce28f<MAX_MAPPING_CHAIN_DEPTH){_0xc0cd18=_0x7fc17e[_0x569ec2(0xc9)](_0xc0cd18),_0x2ce28f++;}_0xc0cd18!==_0x1fa1ef&&_0x7fc17e['set'](_0x4bf8c2,_0xc0cd18);}for(const _0x417aab of _0x3dbc57){updateSegmentReferences(_0x417aab['stages'],_0x7fc17e);}const {merged:_0x576056,nameMapping:_0x399d7d}=consolidateActivationsByContent(_0x105b82[_0x569ec2(0xb4)](_0x3e967c=>_0x3e967c['yaml'][_0x569ec2(0xa8)]));for(const _0x25a35c of _0x3dbc57){updateActivationReferences(_0x25a35c[_0x569ec2(0x9c)],_0x399d7d);}let _0x2738a0=_0x2fc45b['goal'];if(_0x2738a0?.[_0x569ec2(0x9f)]){const _0x59fdd8=_0x7fc17e[_0x569ec2(0xc9)](_0x2738a0[_0x569ec2(0x9f)]);_0x59fdd8&&(_0x2738a0={..._0x2738a0,'segment':_0x59fdd8});}for(const _0x17f4d5 of _0x3dbc57){if(_0x17f4d5[_0x569ec2(0x9d)]?.[_0x569ec2(0x9f)]){const _0xaf1504=_0x7fc17e['get'](_0x17f4d5[_0x569ec2(0x9d)][_0x569ec2(0x9f)]);_0xaf1504&&(_0x17f4d5['goal']={..._0x17f4d5['goal'],'segment':_0xaf1504});}}return _0x3dbc57['some'](_0x5c22ee=>_0x5c22ee[_0x569ec2(0x9d)])&&(_0x2738a0=undefined),{'type':_0x569ec2(0xde),'name':_0x2fc45b[_0x569ec2(0x9a)],'description':_0x2fc45b[_0x569ec2(0xa2)],'goal':_0x2738a0,'reentry':_0x2fc45b[_0x569ec2(0xdf)],'segments':Object[_0x569ec2(0xd3)](_0x117b84)['length']>0x0?_0x117b84:undefined,'activations':Object[_0x569ec2(0xd3)](_0x576056)[_0x569ec2(0xb8)]>0x0?_0x576056:undefined,'journeys':_0x3dbc57,'bundle_id':_0x2fc45b[_0x569ec2(0xab)],'bundle_name':_0x2fc45b['bundle_name']};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x2bcca4,_0x181d83,_0x536ad6,_0x20fbe1){const _0x41773d=a189_0x293e,_0x39f8e3=_0x2bcca4+':'+_0x181d83,_0x1dbbfd=_0x536ad6[_0x41773d(0xc9)](_0x39f8e3);if(_0x1dbbfd)return _0x1dbbfd;const _0xd281af=await _0x20fbe1(_0x2bcca4),_0x1bd10c=_0xd281af[_0x41773d(0xa9)][_0x41773d(0xa7)]||_0xd281af['attributes'][_0x41773d(0x9a)],_0x536bd5=_0xd281af['attributes'][_0x41773d(0xb1)]['find'](_0x134b23=>String(_0x134b23['id'])===String(_0x181d83)),_0x1bac78=_0x536bd5?.[_0x41773d(0x9a)]||_0x181d83,_0x53b4e6={'journeyName':_0x1bd10c,'stageName':_0x1bac78};return _0x536ad6[_0x41773d(0xcd)](_0x39f8e3,_0x53b4e6),_0x53b4e6;}export function formatApiJourneyName(_0x5ae49c,_0x16fb55){return _0x16fb55+'\x20('+_0x5ae49c+')';}export function isLocalJourneyRef(_0x56edac){const _0x5257ec=a189_0x293e;return _0x56edac[_0x5257ec(0xcb)]('.yml')||_0x56edac[_0x5257ec(0xcb)](_0x5257ec(0xd9));}export function buildLocalRuleToNameMapping(_0x40f59a){const _0x2724c0=a189_0x293e,_0x32ea26=new Map();if(!_0x40f59a)return _0x32ea26;for(const [_0x5623fe,_0x8de85]of Object['entries'](_0x40f59a)){if(_0x8de85[_0x2724c0(0xd4)]){const _0x299f0f=serializeRule(_0x8de85[_0x2724c0(0xd4)]),_0x4c5fa4=_0x32ea26[_0x2724c0(0xc9)](_0x299f0f)||[];_0x4c5fa4[_0x2724c0(0xc4)](_0x5623fe),_0x32ea26[_0x2724c0(0xcd)](_0x299f0f,_0x4c5fa4);}}return _0x32ea26;}export function buildLocalRuleToNameMappingFromJourney(_0x461f67){const _0x20ed8f=a189_0x293e,_0x1c7c56=_0x461f67['segments'];if(!_0x1c7c56)return new Map();const _0x36b63e=collectSegmentUsageCounts(_0x461f67),_0xd66e6f=new Map();let _0x22466d=0x0;for(const [_0x518d10,_0x5e24dd]of Object['entries'](_0x1c7c56)){if(!_0x5e24dd['rule']){_0x22466d++;continue;}const _0xfbc272=serializeRule(_0x5e24dd[_0x20ed8f(0xd4)]),_0x2ff76b=_0xd66e6f['get'](_0xfbc272)||[];_0x2ff76b[_0x20ed8f(0xc4)]({'name':_0x518d10,'index':_0x22466d}),_0xd66e6f['set'](_0xfbc272,_0x2ff76b),_0x22466d++;}const _0xf85b3=new Map();for(const [_0x5adb3b,_0x4935da]of _0xd66e6f){const _0x1a14f3=_0x4935da[_0x20ed8f(0xbc)]()[_0x20ed8f(0xd6)]((_0x37ef5b,_0x1a5f91)=>{const _0x1a121b=_0x20ed8f,_0x1341e0=_0x36b63e[_0x1a121b(0xc9)](_0x37ef5b[_0x1a121b(0x9a)])||0x0,_0x3d0e05=_0x36b63e[_0x1a121b(0xc9)](_0x1a5f91[_0x1a121b(0x9a)])||0x0;if(_0x1341e0!==_0x3d0e05)return _0x3d0e05-_0x1341e0;return _0x37ef5b[_0x1a121b(0x98)]-_0x1a5f91[_0x1a121b(0x98)];})[_0x20ed8f(0xb4)](_0x48e966=>_0x48e966[_0x20ed8f(0x9a)]);_0xf85b3[_0x20ed8f(0xcd)](_0x5adb3b,_0x1a14f3);}return _0xf85b3;}export function collectSegmentUsageCounts(_0x2c9c54){const _0x736864=a189_0x293e,_0x3ffafe=new Map(),_0x4fcb25=_0x4e2de6=>{const _0x4d0eb4=a189_0x293e;if(!_0x4e2de6)return;_0x3ffafe[_0x4d0eb4(0xcd)](_0x4e2de6,(_0x3ffafe[_0x4d0eb4(0xc9)](_0x4e2de6)||0x0)+0x1);},_0x16ff2f=_0x5e6aa1=>{const _0x5d7a25=a189_0x293e;for(const _0x21b199 of _0x5e6aa1){_0x4fcb25(_0x21b199[_0x5d7a25(0xc2)]?.[_0x5d7a25(0x9f)]);if(_0x21b199[_0x5d7a25(0xd1)])for(const _0x5f5162 of _0x21b199[_0x5d7a25(0xd1)]){_0x4fcb25(_0x5f5162['segment']);}_0x4fcb25(_0x21b199[_0x5d7a25(0xd2)]?.['segment']);if(_0x21b199[_0x5d7a25(0x97)])for(const _0x39e060 of _0x21b199[_0x5d7a25(0x97)]){if(_0x39e060[_0x5d7a25(0xce)]==='decision_point')for(const _0x772bb5 of _0x39e060['with']['branches']){_0x4fcb25(_0x772bb5[_0x5d7a25(0x9f)]);}else _0x39e060[_0x5d7a25(0xce)]==='wait'&&_0x4fcb25(_0x39e060[_0x5d7a25(0x96)][_0x5d7a25(0xae)]?.['segment']);}}};_0x4fcb25(_0x2c9c54['goal']?.[_0x736864(0x9f)]);if(_0x2c9c54['journeys'])for(const _0x58e892 of _0x2c9c54[_0x736864(0xd5)]){_0x4fcb25(_0x58e892[_0x736864(0x9d)]?.[_0x736864(0x9f)]),_0x16ff2f(_0x58e892[_0x736864(0x9c)]);}_0x2c9c54[_0x736864(0x9c)]&&_0x16ff2f(_0x2c9c54[_0x736864(0x9c)]);if(_0x2c9c54[_0x736864(0xa1)])for(const _0x1b0e62 of _0x2c9c54[_0x736864(0xa1)]){_0x16ff2f(_0x1b0e62[_0x736864(0x9c)]);}return _0x3ffafe;}
1
+ (function(_0x241977,_0x549b6b){const _0x13b9c1=a196_0x2459,_0x4963fa=_0x241977();while(!![]){try{const _0x3077cb=parseInt(_0x13b9c1(0x14f))/0x1*(-parseInt(_0x13b9c1(0x168))/0x2)+-parseInt(_0x13b9c1(0x156))/0x3+parseInt(_0x13b9c1(0x165))/0x4+parseInt(_0x13b9c1(0x135))/0x5*(parseInt(_0x13b9c1(0x160))/0x6)+parseInt(_0x13b9c1(0x171))/0x7+parseInt(_0x13b9c1(0x17e))/0x8*(parseInt(_0x13b9c1(0x145))/0x9)+parseInt(_0x13b9c1(0x158))/0xa*(-parseInt(_0x13b9c1(0x16a))/0xb);if(_0x3077cb===_0x549b6b)break;else _0x4963fa['push'](_0x4963fa['shift']());}catch(_0x57191a){_0x4963fa['push'](_0x4963fa['shift']());}}}(a196_0x1af9,0xbe617));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x4801df){const _0x4d9046=a196_0x2459;return _0x4801df[_0x4d9046(0x17b)]()[_0x4d9046(0x180)](/\s+/g,'_')[_0x4d9046(0x180)](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x4d9046(0x180)](/_+/g,'_')['replace'](/^_|_$/g,'');}function a196_0x2459(_0x4e9032,_0x36e966){_0x4e9032=_0x4e9032-0x135;const _0x1af9c4=a196_0x1af9();let _0x2459d2=_0x1af9c4[_0x4e9032];return _0x2459d2;}export function generateJourneyLocalName(_0x24683b){const _0x485b6b=a196_0x2459,_0x5e40b5=_0x24683b['match'](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x5e40b5){const _0x4d7b3b=_0x5e40b5[0x1][_0x485b6b(0x17b)](),_0x1ef239=_0x5e40b5[0x2],_0x39dfce=_0x1ef239[_0x485b6b(0x180)](/-/g,'')[_0x485b6b(0x141)](0x0,0x4)[_0x485b6b(0x17b)]();return _0x4d7b3b+'_'+_0x39dfce;}const _0x4c3cf8=_0x24683b['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x4c3cf8){const _0x295920=_0x4c3cf8[0x1],_0x184453=_0x4c3cf8[0x2][_0x485b6b(0x17b)](),_0x57c2de=_0x295920[_0x485b6b(0x180)](/-/g,'')['slice'](0x0,0x4)[_0x485b6b(0x17b)]();return _0x184453+'_'+_0x57c2de;}return undefined;}function stableStringify(_0x35a5a0){const _0x34f1b1=a196_0x2459;if(Array[_0x34f1b1(0x16b)](_0x35a5a0))return'['+_0x35a5a0['map'](_0x2105fd=>stableStringify(_0x2105fd))['join'](',')+']';if(_0x35a5a0&&typeof _0x35a5a0==='object'){const _0xdf3248=_0x35a5a0,_0x1df269=Object[_0x34f1b1(0x13d)](_0xdf3248)['sort'](),_0x220910=_0x1df269[_0x34f1b1(0x139)](_0x4add89=>'\x22'+_0x4add89+'\x22:'+stableStringify(_0xdf3248[_0x4add89]));return'{'+_0x220910[_0x34f1b1(0x14a)](',')+'}';}const _0x2cb7a1=JSON[_0x34f1b1(0x161)](_0x35a5a0);return _0x2cb7a1===undefined?'null':_0x2cb7a1;}export function consolidateActivationsByContent(_0x3c351a){const _0x1d08e4=a196_0x2459,_0x40c3a1={},_0x54c8f6=new Map(),_0x1a8cf1=new Map();for(const _0x1e3ff4 of _0x3c351a){if(!_0x1e3ff4)continue;for(const [_0x11407b,_0x2fb4c5]of Object[_0x1d08e4(0x13c)](_0x1e3ff4)){const _0x41c2b3={'name':_0x2fb4c5[_0x1d08e4(0x164)],'connection':_0x2fb4c5['connection'],..._0x2fb4c5[_0x1d08e4(0x17f)]!==undefined&&{'all_columns':_0x2fb4c5['all_columns']},..._0x2fb4c5[_0x1d08e4(0x15b)]!==undefined&&{'columns':_0x2fb4c5[_0x1d08e4(0x15b)]},..._0x2fb4c5[_0x1d08e4(0x13a)]!==undefined&&{'behavior':_0x2fb4c5['behavior']},..._0x2fb4c5[_0x1d08e4(0x182)]!==undefined&&{'schedule':_0x2fb4c5[_0x1d08e4(0x182)]},..._0x2fb4c5[_0x1d08e4(0x138)]!==undefined&&{'notification':_0x2fb4c5[_0x1d08e4(0x138)]},..._0x2fb4c5['connector_config']!==undefined&&{'connector_config':_0x2fb4c5[_0x1d08e4(0x159)]},..._0x2fb4c5[_0x1d08e4(0x17a)]!==undefined&&{'activation_template_id':_0x2fb4c5['activation_template_id']}},_0x8748c0=stableStringify(_0x41c2b3),_0x1eee66=_0x1a8cf1[_0x1d08e4(0x17c)](_0x8748c0);_0x1eee66?_0x54c8f6[_0x1d08e4(0x154)](_0x11407b,_0x1eee66):(_0x40c3a1[_0x11407b]=_0x2fb4c5,_0x54c8f6['set'](_0x11407b,_0x11407b),_0x1a8cf1[_0x1d08e4(0x154)](_0x8748c0,_0x11407b));}}return{'merged':_0x40c3a1,'nameMapping':_0x54c8f6};}export function updateActivationReferences(_0x3cc3b6,_0x58da5d){const _0x52ab4d=a196_0x2459;if(!_0x3cc3b6)return;for(const _0x4379c1 of _0x3cc3b6){if(!_0x4379c1['steps'])continue;for(const _0x2d4c9c of _0x4379c1['steps']){if(_0x2d4c9c[_0x52ab4d(0x173)]===_0x52ab4d(0x143)&&_0x2d4c9c[_0x52ab4d(0x150)]?.[_0x52ab4d(0x143)]){const _0x4e35fc=_0x58da5d[_0x52ab4d(0x17c)](_0x2d4c9c[_0x52ab4d(0x150)]['activation']);_0x4e35fc&&_0x4e35fc!==_0x2d4c9c[_0x52ab4d(0x150)][_0x52ab4d(0x143)]&&(_0x2d4c9c[_0x52ab4d(0x150)]['activation']=_0x4e35fc);}}}}export function consolidateSegmentsByContent(_0x5560d3,_0xfebd96){const _0x5d5f77=a196_0x2459,_0x3b458d={},_0x20e722=new Map(),_0x2b5fc3=new Map();for(const _0x1d3f52 of _0x5560d3){if(!_0x1d3f52)continue;for(const [_0x2485eb,_0x1d5400]of Object[_0x5d5f77(0x13c)](_0x1d3f52)){if(!_0x1d5400['rule']){_0x3b458d[_0x2485eb]=_0x1d5400,_0x20e722[_0x5d5f77(0x154)](_0x2485eb,_0x2485eb);continue;}const _0x278d04=_0x1d5400[_0x5d5f77(0x14c)]&&_0x1d5400['description'][_0x5d5f77(0x14d)]()?_0x1d5400[_0x5d5f77(0x14c)]:undefined,_0x118aa6=JSON[_0x5d5f77(0x161)]({'description':_0x278d04,'rule':deepSortObject(_0x1d5400['rule'])}),_0x42335d=_0x2b5fc3[_0x5d5f77(0x17c)](_0x118aa6);if(_0x42335d){const _0x3d7c13={..._0x1d5400[_0x5d5f77(0x14c)]!==undefined&&{'description':_0x1d5400['description']},'rule':_0x1d5400[_0x5d5f77(0x140)]?deepSortObject(_0x1d5400[_0x5d5f77(0x140)]):_0x1d5400['rule']};if(_0x2485eb<_0x42335d){_0x3b458d[_0x2485eb]=_0x3d7c13,delete _0x3b458d[_0x42335d];for(const [_0x1fd635,_0x28bbde]of _0x20e722[_0x5d5f77(0x13c)]()){_0x28bbde===_0x42335d&&_0x20e722[_0x5d5f77(0x154)](_0x1fd635,_0x2485eb);}_0x20e722['set'](_0x2485eb,_0x2485eb),_0x2b5fc3[_0x5d5f77(0x154)](_0x118aa6,_0x2485eb);}else _0x3b458d[_0x42335d]=_0x3d7c13,_0x20e722['set'](_0x2485eb,_0x42335d);}else{let _0x6d48fc=_0x2485eb;if(_0xfebd96){const _0x47c07c=_0xfebd96[_0x5d5f77(0x17c)](_0x118aa6);_0x47c07c&&_0x47c07c['length']>0x0&&(_0x6d48fc=_0x47c07c[_0x5d5f77(0x141)]()[_0x5d5f77(0x15a)]()[0x0]);}const _0x1b0356={..._0x1d5400[_0x5d5f77(0x14c)]!==undefined&&{'description':_0x1d5400[_0x5d5f77(0x14c)]},'rule':_0x1d5400[_0x5d5f77(0x140)]?deepSortObject(_0x1d5400[_0x5d5f77(0x140)]):_0x1d5400[_0x5d5f77(0x140)]};_0x3b458d[_0x6d48fc]=_0x1b0356,_0x20e722[_0x5d5f77(0x154)](_0x2485eb,_0x6d48fc),_0x2b5fc3[_0x5d5f77(0x154)](_0x118aa6,_0x6d48fc);}}}return{'merged':_0x3b458d,'nameMapping':_0x20e722};}export function updateSegmentReferences(_0x30cf49,_0x27ab78){const _0x38beef=a196_0x2459;if(!_0x30cf49)return;for(const _0x1ab48a of _0x30cf49){if(_0x1ab48a[_0x38beef(0x153)]?.[_0x38beef(0x16d)]){const _0x286581=_0x27ab78[_0x38beef(0x17c)](_0x1ab48a[_0x38beef(0x153)][_0x38beef(0x16d)]);_0x286581&&(_0x1ab48a[_0x38beef(0x153)][_0x38beef(0x16d)]=_0x286581);}if(_0x1ab48a[_0x38beef(0x142)])for(const _0x7cb374 of _0x1ab48a['exit_criteria']){if(_0x7cb374[_0x38beef(0x16d)]){const _0x4027c5=_0x27ab78[_0x38beef(0x17c)](_0x7cb374['segment']);_0x4027c5&&(_0x7cb374['segment']=_0x4027c5);}}if(_0x1ab48a[_0x38beef(0x179)]?.[_0x38beef(0x16d)]){const _0x356f30=_0x27ab78[_0x38beef(0x17c)](_0x1ab48a['milestone']['segment']);_0x356f30&&(_0x1ab48a[_0x38beef(0x179)][_0x38beef(0x16d)]=_0x356f30);}if(_0x1ab48a[_0x38beef(0x149)])for(const _0x428c04 of _0x1ab48a[_0x38beef(0x149)]){if(_0x428c04[_0x38beef(0x173)]===_0x38beef(0x157)&&_0x428c04[_0x38beef(0x150)]?.[_0x38beef(0x146)])for(const _0x30b212 of _0x428c04[_0x38beef(0x150)][_0x38beef(0x146)]){if(_0x30b212['segment']){const _0x162e38=_0x27ab78[_0x38beef(0x17c)](_0x30b212['segment']);_0x162e38&&(_0x30b212['segment']=_0x162e38);}}if(_0x428c04[_0x38beef(0x173)]===_0x38beef(0x16e)&&_0x428c04[_0x38beef(0x150)]?.['condition']?.[_0x38beef(0x16d)]){const _0x3f97e7=_0x27ab78['get'](_0x428c04['with']['condition'][_0x38beef(0x16d)]);_0x3f97e7&&(_0x428c04[_0x38beef(0x150)][_0x38beef(0x178)][_0x38beef(0x16d)]=_0x3f97e7);}}}}export function updateSegmentRefsInSegments(_0x367777,_0xddee06){const _0x21a1cf=a196_0x2459;for(const _0x58cc2d of Object[_0x21a1cf(0x16f)](_0x367777)){_0x58cc2d[_0x21a1cf(0x140)]&&updateSegmentRefsInRule(_0x58cc2d['rule'],_0xddee06);}}function updateSegmentRefsInRule(_0x2d775a,_0x384e83){const _0x1efd9e=a196_0x2459;if(_0x2d775a===null||typeof _0x2d775a!==_0x1efd9e(0x15c))return;if(Array[_0x1efd9e(0x16b)](_0x2d775a)){for(const _0x1102bf of _0x2d775a){updateSegmentRefsInRule(_0x1102bf,_0x384e83);}return;}const _0x44481f=_0x2d775a;if((_0x44481f['type']==='include'||_0x44481f[_0x1efd9e(0x173)]==='exclude')&&typeof _0x44481f[_0x1efd9e(0x16d)]===_0x1efd9e(0x170)){const _0x4234ea=_0x384e83[_0x1efd9e(0x17c)](_0x44481f[_0x1efd9e(0x16d)]);_0x4234ea&&(_0x44481f[_0x1efd9e(0x16d)]=_0x4234ea);}if(_0x44481f[_0x1efd9e(0x16c)]&&Array['isArray'](_0x44481f[_0x1efd9e(0x16c)]))for(const _0x3ef236 of _0x44481f[_0x1efd9e(0x16c)]){updateSegmentRefsInRule(_0x3ef236,_0x384e83);}}export function buildJourneysArray(_0x5efc21,_0x5f1dad){return _0x5efc21['map'](_0x476bb7=>{const _0x25cc5c=a196_0x2459,_0x2ef04d=_0x5f1dad?_0x476bb7[_0x25cc5c(0x147)]['id']===_0x5f1dad:_0x5efc21[_0x25cc5c(0x15f)]===0x1,_0xa2b985=_0x476bb7[_0x25cc5c(0x169)]['journeys']?.[0x0],_0x21c95b=_0xa2b985?.[_0x25cc5c(0x14e)]||_0x476bb7[_0x25cc5c(0x169)][_0x25cc5c(0x14e)],_0x37ea53={'version':_0xa2b985?.[_0x25cc5c(0x174)]||_0x476bb7['yaml'][_0x25cc5c(0x174)]||_0x476bb7[_0x25cc5c(0x147)][_0x25cc5c(0x164)],'state':_0x476bb7['item'][_0x25cc5c(0x13f)]===_0x25cc5c(0x144)?_0x25cc5c(0x144):_0x25cc5c(0x15e),'stages':_0xa2b985?.[_0x25cc5c(0x152)]||_0x476bb7[_0x25cc5c(0x169)][_0x25cc5c(0x152)]||[],'id':_0xa2b985?.['id']||_0x476bb7['yaml']['id'],'version_number':_0xa2b985?.[_0x25cc5c(0x148)]||_0x476bb7['yaml']['version_number']};return _0x21c95b&&(_0x37ea53[_0x25cc5c(0x14e)]=_0x21c95b),_0x2ef04d&&(_0x37ea53[_0x25cc5c(0x176)]=!![]),_0x37ea53;});}export function buildMergedJourneyDef(_0x411ef0,_0x160239,_0x363f91){const _0x27b55c=a196_0x2459,_0x4dbd92=_0x411ef0[0x0]['yaml'],_0xcbd7da=buildJourneysArray(_0x411ef0,_0x363f91),{merged:_0x9b10e2,nameMapping:_0x1549c1}=consolidateSegmentsByContent(_0x411ef0[_0x27b55c(0x139)](_0x1254eb=>_0x1254eb['yaml'][_0x27b55c(0x136)]),_0x160239);updateSegmentRefsInSegments(_0x9b10e2,_0x1549c1);const _0x4af119=Array['from'](_0x1549c1[_0x27b55c(0x13c)]())[_0x27b55c(0x167)](([_0x4ea21c,_0x513ea7])=>_0x4ea21c!==_0x513ea7&&_0x4ea21c['startsWith'](_0x27b55c(0x153)));let _0x33658d=_0x9b10e2,_0x4734c6=new Map();if(_0x4af119){const _0x4b83a9=consolidateSegmentsByContent([_0x9b10e2],_0x160239);_0x33658d=_0x4b83a9[_0x27b55c(0x155)],_0x4734c6=_0x4b83a9[_0x27b55c(0x137)];}const _0x145071=new Map(_0x1549c1);for(const [_0x290e63,_0x1bcda3]of _0x4734c6[_0x27b55c(0x13c)]()){_0x145071['set'](_0x290e63,_0x1bcda3);}for(const [_0x284b8c,_0x26611a]of _0x145071[_0x27b55c(0x13c)]()){let _0xa8b905=_0x26611a,_0x487e23=0x0;while(_0x145071['has'](_0xa8b905)&&_0x145071[_0x27b55c(0x17c)](_0xa8b905)!==_0xa8b905&&_0x487e23<MAX_MAPPING_CHAIN_DEPTH){_0xa8b905=_0x145071['get'](_0xa8b905),_0x487e23++;}_0xa8b905!==_0x26611a&&_0x145071['set'](_0x284b8c,_0xa8b905);}for(const _0x160a2c of _0xcbd7da){updateSegmentReferences(_0x160a2c[_0x27b55c(0x152)],_0x145071);}const {merged:_0x36dec9,nameMapping:_0x560c00}=consolidateActivationsByContent(_0x411ef0[_0x27b55c(0x139)](_0x2f7265=>_0x2f7265[_0x27b55c(0x169)][_0x27b55c(0x17d)]));for(const _0x5bf19f of _0xcbd7da){updateActivationReferences(_0x5bf19f[_0x27b55c(0x152)],_0x560c00);}let _0x13587f=_0x4dbd92['goal'];if(_0x13587f?.[_0x27b55c(0x16d)]){const _0x43a1e2=_0x145071[_0x27b55c(0x17c)](_0x13587f[_0x27b55c(0x16d)]);_0x43a1e2&&(_0x13587f={..._0x13587f,'segment':_0x43a1e2});}for(const _0x36814b of _0xcbd7da){if(_0x36814b[_0x27b55c(0x14e)]?.[_0x27b55c(0x16d)]){const _0x2043b2=_0x145071[_0x27b55c(0x17c)](_0x36814b[_0x27b55c(0x14e)][_0x27b55c(0x16d)]);_0x2043b2&&(_0x36814b[_0x27b55c(0x14e)]={..._0x36814b[_0x27b55c(0x14e)],'segment':_0x2043b2});}}return _0xcbd7da[_0x27b55c(0x167)](_0x3f9243=>_0x3f9243[_0x27b55c(0x14e)])&&(_0x13587f=undefined),{'type':_0x27b55c(0x175),'name':_0x4dbd92['name'],'description':_0x4dbd92[_0x27b55c(0x14c)],'goal':_0x13587f,'reentry':_0x4dbd92['reentry'],'segments':Object[_0x27b55c(0x13d)](_0x33658d)[_0x27b55c(0x15f)]>0x0?_0x33658d:undefined,'activations':Object[_0x27b55c(0x13d)](_0x36dec9)[_0x27b55c(0x15f)]>0x0?_0x36dec9:undefined,'journeys':_0xcbd7da,'bundle_id':_0x4dbd92['bundle_id'],'bundle_name':_0x4dbd92[_0x27b55c(0x163)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x12cf86,_0x158d32,_0x4a5fdb,_0x28241a){const _0x3c8c9e=a196_0x2459,_0x1cc845=_0x12cf86+':'+_0x158d32,_0x2e96fa=_0x4a5fdb[_0x3c8c9e(0x17c)](_0x1cc845);if(_0x2e96fa)return _0x2e96fa;const _0x250283=await _0x28241a(_0x12cf86),_0x296386=_0x250283[_0x3c8c9e(0x151)][_0x3c8c9e(0x162)]||_0x250283[_0x3c8c9e(0x151)][_0x3c8c9e(0x164)],_0x28f11b=_0x250283['attributes'][_0x3c8c9e(0x13e)][_0x3c8c9e(0x181)](_0x3e8ab7=>String(_0x3e8ab7['id'])===String(_0x158d32)),_0xc9af9a=_0x28f11b?.[_0x3c8c9e(0x164)]||_0x158d32,_0x4a3157={'journeyName':_0x296386,'stageName':_0xc9af9a};return _0x4a5fdb[_0x3c8c9e(0x154)](_0x1cc845,_0x4a3157),_0x4a3157;}function a196_0x1af9(){const _0x2a0a6d=['segment','wait','values','string','1745457bCbaOq','index','type','version','journey','latest','versions','condition','milestone','activation_template_id','toLowerCase','get','activations','2768TqSaUK','all_columns','replace','find','schedule','1300175igEsoi','segments','nameMapping','notification','map','behavior','push','entries','keys','journeyStages','state','rule','slice','exit_criteria','activation','launched','34389lctYMA','branches','item','version_number','steps','join','.yaml','description','trim','goal','4PzSWVH','with','attributes','stages','entry_criteria','set','merged','2377833rlwLSk','decision_point','70hBAtnq','connector_config','sort','columns','object','journeys','draft','length','12VMPPHZ','stringify','journeyBundleName','bundle_name','name','5124944dZgjQq','.yml','some','708458bcBbOz','yaml','602481jVnoYA','isArray','conditions'];a196_0x1af9=function(){return _0x2a0a6d;};return a196_0x1af9();}export function formatApiJourneyName(_0x5106f3,_0x4387f2){return _0x4387f2+'\x20('+_0x5106f3+')';}export function isLocalJourneyRef(_0x261d0b){const _0x4a1f0f=a196_0x2459;return _0x261d0b['endsWith'](_0x4a1f0f(0x166))||_0x261d0b['endsWith'](_0x4a1f0f(0x14b));}export function buildLocalRuleToNameMapping(_0x5d034a){const _0x11c1ee=a196_0x2459,_0x180f28=new Map();if(!_0x5d034a)return _0x180f28;for(const [_0xc5d743,_0x54acff]of Object[_0x11c1ee(0x13c)](_0x5d034a)){if(_0x54acff[_0x11c1ee(0x140)]){const _0x265805=serializeRule(_0x54acff[_0x11c1ee(0x140)]),_0x1a652b=_0x180f28['get'](_0x265805)||[];_0x1a652b[_0x11c1ee(0x13b)](_0xc5d743),_0x180f28['set'](_0x265805,_0x1a652b);}}return _0x180f28;}export function buildLocalRuleToNameMappingFromJourney(_0x3a398f){const _0x1f24c7=a196_0x2459,_0x43159f=_0x3a398f[_0x1f24c7(0x136)];if(!_0x43159f)return new Map();const _0x142b42=collectSegmentUsageCounts(_0x3a398f),_0x35df13=new Map();let _0x26ad4e=0x0;for(const [_0x387ea7,_0x922d56]of Object[_0x1f24c7(0x13c)](_0x43159f)){if(!_0x922d56[_0x1f24c7(0x140)]){_0x26ad4e++;continue;}const _0x4b18f4=serializeRule(_0x922d56[_0x1f24c7(0x140)]),_0x39f0df=_0x35df13[_0x1f24c7(0x17c)](_0x4b18f4)||[];_0x39f0df['push']({'name':_0x387ea7,'index':_0x26ad4e}),_0x35df13[_0x1f24c7(0x154)](_0x4b18f4,_0x39f0df),_0x26ad4e++;}const _0x3110dd=new Map();for(const [_0x25bf58,_0x5f29af]of _0x35df13){const _0x542d66=_0x5f29af[_0x1f24c7(0x141)]()[_0x1f24c7(0x15a)]((_0x3e7911,_0x3d6251)=>{const _0x4ed4ea=_0x1f24c7,_0x2f2b5b=_0x142b42[_0x4ed4ea(0x17c)](_0x3e7911[_0x4ed4ea(0x164)])||0x0,_0x177801=_0x142b42['get'](_0x3d6251[_0x4ed4ea(0x164)])||0x0;if(_0x2f2b5b!==_0x177801)return _0x177801-_0x2f2b5b;return _0x3e7911['index']-_0x3d6251[_0x4ed4ea(0x172)];})[_0x1f24c7(0x139)](_0x132359=>_0x132359['name']);_0x3110dd[_0x1f24c7(0x154)](_0x25bf58,_0x542d66);}return _0x3110dd;}export function collectSegmentUsageCounts(_0x186b4a){const _0xd0f901=a196_0x2459,_0x4ecc6c=new Map(),_0x1465df=_0x5b7fba=>{const _0x5dbcd4=a196_0x2459;if(!_0x5b7fba)return;_0x4ecc6c[_0x5dbcd4(0x154)](_0x5b7fba,(_0x4ecc6c[_0x5dbcd4(0x17c)](_0x5b7fba)||0x0)+0x1);},_0xf2dd64=_0x2766d5=>{const _0x55f627=a196_0x2459;for(const _0x272523 of _0x2766d5){_0x1465df(_0x272523['entry_criteria']?.[_0x55f627(0x16d)]);if(_0x272523[_0x55f627(0x142)])for(const _0x2add2c of _0x272523['exit_criteria']){_0x1465df(_0x2add2c[_0x55f627(0x16d)]);}_0x1465df(_0x272523[_0x55f627(0x179)]?.[_0x55f627(0x16d)]);if(_0x272523['steps'])for(const _0x11e9e9 of _0x272523[_0x55f627(0x149)]){if(_0x11e9e9[_0x55f627(0x173)]==='decision_point')for(const _0xd8e33f of _0x11e9e9[_0x55f627(0x150)][_0x55f627(0x146)]){_0x1465df(_0xd8e33f[_0x55f627(0x16d)]);}else _0x11e9e9[_0x55f627(0x173)]===_0x55f627(0x16e)&&_0x1465df(_0x11e9e9[_0x55f627(0x150)][_0x55f627(0x178)]?.[_0x55f627(0x16d)]);}}};_0x1465df(_0x186b4a[_0xd0f901(0x14e)]?.[_0xd0f901(0x16d)]);if(_0x186b4a[_0xd0f901(0x15d)])for(const _0x5ecada of _0x186b4a[_0xd0f901(0x15d)]){_0x1465df(_0x5ecada[_0xd0f901(0x14e)]?.['segment']),_0xf2dd64(_0x5ecada['stages']);}_0x186b4a['stages']&&_0xf2dd64(_0x186b4a[_0xd0f901(0x152)]);if(_0x186b4a['versions'])for(const _0x5f1247 of _0x186b4a[_0xd0f901(0x177)]){_0xf2dd64(_0x5f1247[_0xd0f901(0x152)]);}return _0x4ecc6c;}