@treasuredata/tdx 2026.3.50 → 2026.3.52

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 (228) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.d.ts.map +1 -1
  66. package/dist/core/global-context.js +1 -1
  67. package/dist/core/global-context.js.map +1 -1
  68. package/dist/core/keychain.js +1 -1
  69. package/dist/core/oauth-keychain.js +1 -1
  70. package/dist/core/oauth.d.ts +1 -0
  71. package/dist/core/oauth.d.ts.map +1 -1
  72. package/dist/core/oauth.js +1 -1
  73. package/dist/core/oauth.js.map +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.d.ts +21 -4
  87. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  88. package/dist/proxy/passthrough-server.js +1 -1
  89. package/dist/proxy/passthrough-server.js.map +1 -1
  90. package/dist/proxy/sse-usage-parser.js +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  93. package/dist/sdk/agent/agent-yaml.js +1 -1
  94. package/dist/sdk/agent/test/evaluator.js +1 -1
  95. package/dist/sdk/agent/test/executor.js +1 -1
  96. package/dist/sdk/agent/test/index.js +1 -1
  97. package/dist/sdk/agent/test/output.js +1 -1
  98. package/dist/sdk/agent/test/parser.js +1 -1
  99. package/dist/sdk/agent/tool-target-registry.js +1 -1
  100. package/dist/sdk/api.js +1 -1
  101. package/dist/sdk/cas/cas-api-client.js +1 -1
  102. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  103. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  104. package/dist/sdk/cas/index.js +1 -1
  105. package/dist/sdk/cas/pull-workflow.js +1 -1
  106. package/dist/sdk/cas/push-workflow.js +1 -1
  107. package/dist/sdk/client/cdp-api-client.js +1 -1
  108. package/dist/sdk/client/delivery-api-client.js +1 -1
  109. package/dist/sdk/client/endpoints.js +1 -1
  110. package/dist/sdk/client/engage-api-client.js +1 -1
  111. package/dist/sdk/client/http-client.js +1 -1
  112. package/dist/sdk/client/llm-api-client.js +1 -1
  113. package/dist/sdk/client/oauth-refresh.js +1 -1
  114. package/dist/sdk/client/rate-limiter.js +1 -1
  115. package/dist/sdk/client/td-api-client.js +1 -1
  116. package/dist/sdk/client/trino-api-client.js +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/connection-validator.js +1 -1
  119. package/dist/sdk/connection.js +1 -1
  120. package/dist/sdk/delivery.js +1 -1
  121. package/dist/sdk/engage/campaign-pull.js +1 -1
  122. package/dist/sdk/engage/campaign-push.js +1 -1
  123. package/dist/sdk/engage/campaign-validator.js +1 -1
  124. package/dist/sdk/engage/campaign-yaml.js +1 -1
  125. package/dist/sdk/engage/template-pull.js +1 -1
  126. package/dist/sdk/engage/template-push.js +1 -1
  127. package/dist/sdk/engage/template-validator.js +1 -1
  128. package/dist/sdk/engage/template-yaml.js +1 -1
  129. package/dist/sdk/engage/types/campaign-def.js +1 -1
  130. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  131. package/dist/sdk/engage/types/template-schema.js +1 -1
  132. package/dist/sdk/engage.js +1 -1
  133. package/dist/sdk/errors.js +1 -1
  134. package/dist/sdk/index.js +1 -1
  135. package/dist/sdk/io/index.js +1 -1
  136. package/dist/sdk/io/node-filesystem.js +1 -1
  137. package/dist/sdk/job.js +1 -1
  138. package/dist/sdk/journey.js +1 -1
  139. package/dist/sdk/llm/chat-cache.js +1 -1
  140. package/dist/sdk/llm/index.js +1 -1
  141. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  142. package/dist/sdk/llm/model-factors.js +1 -1
  143. package/dist/sdk/personalization.js +1 -1
  144. package/dist/sdk/policy.js +1 -1
  145. package/dist/sdk/query/index.js +1 -1
  146. package/dist/sdk/query/sql-parser.js +1 -1
  147. package/dist/sdk/realtime.js +1 -1
  148. package/dist/sdk/schedule.js +1 -1
  149. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/fields-display.js +1 -1
  151. package/dist/sdk/segment/file-discovery.js +1 -1
  152. package/dist/sdk/segment/journey-utils.js +1 -1
  153. package/dist/sdk/segment/journey-validator.js +1 -1
  154. package/dist/sdk/segment/journey-yaml.js +1 -1
  155. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  156. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  157. package/dist/sdk/segment/pull-workflow.js +1 -1
  158. package/dist/sdk/segment/push-recovery.js +1 -1
  159. package/dist/sdk/segment/push-workflow.js +1 -1
  160. package/dist/sdk/segment/resolution-context.js +1 -1
  161. package/dist/sdk/segment/segment-path-parser.js +1 -1
  162. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  163. package/dist/sdk/segment/segment-validator.js +1 -1
  164. package/dist/sdk/segment/target-resolution.js +1 -1
  165. package/dist/sdk/segment/tdx-config.js +1 -1
  166. package/dist/sdk/segment/types/activation-schema.js +1 -1
  167. package/dist/sdk/segment/types/journey-def.js +1 -1
  168. package/dist/sdk/segment/types/journey-schema.js +1 -1
  169. package/dist/sdk/segment/types/segment-def.js +1 -1
  170. package/dist/sdk/segment/types/segment-schema.js +1 -1
  171. package/dist/sdk/segment/validate-files.js +1 -1
  172. package/dist/sdk/segment/yaml-validator.js +1 -1
  173. package/dist/sdk/segment.js +1 -1
  174. package/dist/sdk/types/index.js +1 -1
  175. package/dist/sdk/types/progress.js +1 -1
  176. package/dist/sdk/types/workspace.js +1 -1
  177. package/dist/sdk/user.js +1 -1
  178. package/dist/sdk/util/format-detector.js +1 -1
  179. package/dist/sdk/util/formatters.js +1 -1
  180. package/dist/sdk/util/index.js +1 -1
  181. package/dist/sdk/util/paginate.js +1 -1
  182. package/dist/sdk/util/tree-formatter.js +1 -1
  183. package/dist/sdk/workflow/archive-validation.js +1 -1
  184. package/dist/sdk/workflow/clone-workflow.js +1 -1
  185. package/dist/sdk/workflow/index.js +1 -1
  186. package/dist/sdk/workflow/pull-workflow.js +1 -1
  187. package/dist/sdk/workflow/push-workflow.js +1 -1
  188. package/dist/sdk/workflow/tdx-config.js +1 -1
  189. package/dist/sdk/workflow/workflow-utils.js +1 -1
  190. package/dist/sdk/workspace/frontmatter.js +1 -1
  191. package/dist/sdk/workspace/git.js +1 -1
  192. package/dist/sdk/workspace/index.js +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +1 -1
@@ -1 +1 @@
1
- const a141_0x5735a8=a141_0x112e;(function(_0x3588c7,_0x2a4597){const _0x199b4b=a141_0x112e,_0x3d3f34=_0x3588c7();while(!![]){try{const _0x129f71=parseInt(_0x199b4b(0x106))/0x1*(-parseInt(_0x199b4b(0x82))/0x2)+parseInt(_0x199b4b(0x94))/0x3+-parseInt(_0x199b4b(0x11c))/0x4+parseInt(_0x199b4b(0x103))/0x5+parseInt(_0x199b4b(0x90))/0x6+-parseInt(_0x199b4b(0xc6))/0x7*(parseInt(_0x199b4b(0x11a))/0x8)+parseInt(_0x199b4b(0xbd))/0x9;if(_0x129f71===_0x2a4597)break;else _0x3d3f34['push'](_0x3d3f34['shift']());}catch(_0x406180){_0x3d3f34['push'](_0x3d3f34['shift']());}}}(a141_0x28b8,0x2ce16));import*as a141_0x26f280 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a141_0x5735a8(0xc5),'hourly':a141_0x5735a8(0x100),'weekly':a141_0x5735a8(0x105),'monthly':a141_0x5735a8(0xf2),'minutes_interval':a141_0x5735a8(0xfa)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a141_0x5735a8(0xcd),'hour':a141_0x5735a8(0xdb),'week':a141_0x5735a8(0xad),'month':a141_0x5735a8(0x92),'minute':a141_0x5735a8(0xc0)};function filterRuleAsRuleDef(_0x42fe9f){return _0x42fe9f;}function ruleDefAsFilterRule(_0x4847e7){return _0x4847e7;}export function segmentResponseToDefSync(_0x5c299b,_0x4c67b2){const _0x5b7e89=a141_0x5735a8,_0x3ebedd=_0x5c299b[_0x5b7e89(0xe3)]&&_0x5b7e89(0xfe)in _0x5c299b[_0x5b7e89(0xe3)]&&_0x5c299b['rule'][_0x5b7e89(0xfe)];return{'type':_0x5b7e89(0x7f),'name':_0x5c299b['name'],..._0x5c299b['description']&&{'description':_0x5c299b[_0x5b7e89(0x125)]},..._0x4c67b2&&{'folder':_0x4c67b2},..._0x3ebedd&&{'rule':apiRuleToYaml(_0x5c299b[_0x5b7e89(0xe3)])},..._0x5c299b[_0x5b7e89(0x10a)]!==undefined&&{'kind':_0x5c299b[_0x5b7e89(0x10a)]===0x0?_0x5b7e89(0xb2):_0x5c299b[_0x5b7e89(0x10a)]===0x1?_0x5b7e89(0x79):_0x5b7e89(0xe7)},..._0x5c299b['isVisible']!==undefined&&{'visible':_0x5c299b[_0x5b7e89(0x83)]}};}export async function segmentResponseToDef(_0x292e99,_0x3950f6,_0x5b95f9){const _0x28fecf=a141_0x5735a8,_0x3461d7=segmentResponseToDefSync(_0x292e99,_0x5b95f9);if(!_0x3950f6||!_0x3950f6[_0x28fecf(0x101)])return _0x3461d7;return _0x3461d7['rule']&&(_0x3461d7['rule']=await resolveRuleSegmentRefs(_0x3461d7[_0x28fecf(0xe3)],_0x3950f6[_0x28fecf(0x101)])),_0x3461d7;}export function apiRuleToYaml(_0x26f331){const _0x5ac4b7=a141_0x5735a8,_0x2f0d20=(_0x26f331['conditions']||[])['flatMap'](_0x5022f8=>{const _0x1d6941=a141_0x112e,_0x1e9652=apiConditionToYaml(_0x5022f8);if(isCompositeType(_0x1e9652)&&_0x1e9652[_0x1d6941(0x125)]!==undefined){const _0x2e125c=_0x1e9652;if(_0x2e125c['conditions'][_0x1d6941(0x120)]===0x1)return _0x2e125c[_0x1d6941(0x121)];return[{'type':_0x2e125c[_0x1d6941(0xfe)],'conditions':_0x2e125c['conditions']}];}return[_0x1e9652];});if(_0x2f0d20['length']===0x1&&!_0x26f331[_0x5ac4b7(0x125)]&&isCompositeType(_0x2f0d20[0x0])){const _0x14c479=_0x2f0d20[0x0];if(_0x14c479[_0x5ac4b7(0xfe)]===_0x26f331[_0x5ac4b7(0xfe)]&&_0x14c479['conditions']&&_0x14c479[_0x5ac4b7(0x125)]===undefined)return{'type':_0x26f331[_0x5ac4b7(0xfe)],'conditions':_0x14c479[_0x5ac4b7(0x121)]};}return{'type':_0x26f331[_0x5ac4b7(0xfe)],'conditions':_0x2f0d20};}export async function resolveRuleSegmentRefs(_0x2f6b8f,_0x550d6d){const _0xdac340=a141_0x5735a8;return transformRuleSegmentRefs(_0x2f6b8f,_0x550d6d,_0x9d1e10=>/^\d+$/[_0xdac340(0xb7)](_0x9d1e10));}async function transformConditionSegmentRefs(_0x5bf6b1,_0x32c1a8,_0x519baf,_0x4653f8){const _0x10d792=a141_0x5735a8;if('segment'in _0x5bf6b1&&(_0x5bf6b1[_0x10d792(0xfe)]===_0x10d792(0xe2)||_0x5bf6b1[_0x10d792(0xfe)]==='exclude')){const _0x4f2640=_0x5bf6b1;if(_0x519baf(_0x4f2640[_0x10d792(0x7f)]))return{..._0x4f2640,'segment':await _0x32c1a8(_0x4f2640[_0x10d792(0x7f)])};return _0x5bf6b1;}if(_0x10d792(0x121)in _0x5bf6b1&&_0x5bf6b1[_0x10d792(0x121)]){const _0x23d6d1=_0x5bf6b1,_0x167b70=await Promise[_0x10d792(0xe6)](_0x23d6d1['conditions']['map'](_0x562e40=>transformConditionSegmentRefs(_0x562e40,_0x32c1a8,_0x519baf,_0x4653f8)));return{..._0x23d6d1,'conditions':_0x167b70};}if(_0x10d792(0x115)in _0x5bf6b1&&_0x5bf6b1[_0x10d792(0x115)]){const _0x400663=_0x5bf6b1,_0x195d54=await _0x4653f8(filterRuleAsRuleDef(_0x400663[_0x10d792(0x115)]),_0x32c1a8);return{..._0x400663,'filter':ruleDefAsFilterRule(_0x195d54)};}return _0x5bf6b1;}async function transformRuleSegmentRefs(_0xa21a26,_0x15df74,_0x3d4631){const _0x5bb5db=a141_0x5735a8,_0x5d8eab=(_0x2a7d04,_0x57abc1)=>transformRuleSegmentRefs(_0x2a7d04,_0x57abc1,_0x3d4631),_0x1fc9d3=await Promise['all'](_0xa21a26[_0x5bb5db(0x121)][_0x5bb5db(0xa5)](_0x15e232=>transformConditionSegmentRefs(_0x15e232,_0x15df74,_0x3d4631,_0x5d8eab)));return{..._0xa21a26,'conditions':_0x1fc9d3};}export async function resolveRuleSegmentIds(_0xada9c8,_0x523f36){const _0x238bd6=a141_0x5735a8;return transformRuleSegmentRefs(_0xada9c8,_0x523f36,_0x5479fc=>!/^\d+$/[_0x238bd6(0xb7)](_0x5479fc));}function isCompositeType(_0x29fbb6){const _0x469724=a141_0x5735a8;return _0x29fbb6[_0x469724(0xfe)]===_0x469724(0xf6)||_0x29fbb6[_0x469724(0xfe)]==='Or';}function isBehaviorApiCondition(_0x4b3a16){const _0x4bfb6c=a141_0x5735a8;if(!_0x4b3a16['leftValue']?.['source']?.[_0x4bfb6c(0x7a)])return![];return!![];}function apiConditionToYaml(_0x27d5c3){const _0x4c7a4c=a141_0x5735a8;if(_0x27d5c3[_0x4c7a4c(0xfe)]==='And'||_0x27d5c3[_0x4c7a4c(0xfe)]==='Or'){if(_0x27d5c3[_0x4c7a4c(0x121)]){const _0x14f51a=_0x27d5c3['conditions'][_0x4c7a4c(0xa5)](apiConditionToYaml),_0x32c895=_0x27d5c3[_0x4c7a4c(0x125)]!==undefined;if(_0x14f51a['length']===0x1&&!_0x32c895)return _0x14f51a[0x0];return{'type':_0x27d5c3['type'],'conditions':_0x14f51a,..._0x27d5c3[_0x4c7a4c(0x125)]!==undefined&&{'description':_0x27d5c3[_0x4c7a4c(0x125)]}};}}if(_0x27d5c3[_0x4c7a4c(0xfe)]===_0x4c7a4c(0x11e)&&_0x27d5c3['leftValue']&&_0x27d5c3[_0x4c7a4c(0x81)]){const _0x408b83=_0x27d5c3[_0x4c7a4c(0xb0)][_0x4c7a4c(0x93)]?buildAggregationDefFromApi(_0x27d5c3[_0x4c7a4c(0xb0)]['aggregation']):undefined;if(isBehaviorApiCondition(_0x27d5c3)){const _0x35e796=_0x27d5c3[_0x4c7a4c(0xb0)][_0x4c7a4c(0x80)]['name'];return{'type':_0x4c7a4c(0x123),'attribute':'','operator':apiOperatorToYaml(_0x27d5c3[_0x4c7a4c(0x81)]),..._0x27d5c3[_0x4c7a4c(0x113)]&&_0x27d5c3[_0x4c7a4c(0x113)]!==_0x4c7a4c(0xa9)?{'arrayMatching':_0x27d5c3[_0x4c7a4c(0x113)]}:{},..._0x27d5c3[_0x4c7a4c(0xe8)]?{'exclude':_0x27d5c3[_0x4c7a4c(0xe8)]}:{},..._0x408b83?{'aggregation':_0x408b83}:{},'source':_0x35e796,..._0x27d5c3[_0x4c7a4c(0xb0)]['filter']?{'filter':apiRuleToYaml(_0x27d5c3[_0x4c7a4c(0xb0)][_0x4c7a4c(0x115)])}:{},..._0x27d5c3[_0x4c7a4c(0x86)]!==undefined&&_0x27d5c3[_0x4c7a4c(0x86)]!==null?{'limit':_0x27d5c3['limit']}:{}};}return{'type':'Value','attribute':_0x27d5c3['leftValue'][_0x4c7a4c(0x7a)]||'','operator':apiOperatorToYaml(_0x27d5c3[_0x4c7a4c(0x81)]),..._0x27d5c3[_0x4c7a4c(0x113)]&&_0x27d5c3[_0x4c7a4c(0x113)]!==_0x4c7a4c(0xa9)?{'arrayMatching':_0x27d5c3[_0x4c7a4c(0x113)]}:{},..._0x27d5c3[_0x4c7a4c(0xe8)]?{'exclude':_0x27d5c3[_0x4c7a4c(0xe8)]}:{},..._0x408b83?{'aggregation':_0x408b83}:{},..._0x27d5c3[_0x4c7a4c(0xb0)][_0x4c7a4c(0x115)]?{'filter':apiRuleToYaml(_0x27d5c3[_0x4c7a4c(0xb0)][_0x4c7a4c(0x115)])}:{},..._0x27d5c3[_0x4c7a4c(0x86)]!==undefined&&_0x27d5c3[_0x4c7a4c(0x86)]!==null?{'limit':_0x27d5c3[_0x4c7a4c(0x86)]}:{}};}if(_0x27d5c3[_0x4c7a4c(0xfe)]===_0x4c7a4c(0xf3)&&_0x27d5c3[_0x4c7a4c(0xce)]&&_0x27d5c3[_0x4c7a4c(0x81)])return{'type':_0x4c7a4c(0xf3),'column':_0x27d5c3[_0x4c7a4c(0xce)],'operator':apiOperatorToYaml(_0x27d5c3[_0x4c7a4c(0x81)])};if(_0x27d5c3[_0x4c7a4c(0xfe)]===_0x4c7a4c(0xbb)&&_0x27d5c3['id'])return{'type':_0x27d5c3[_0x4c7a4c(0xe8)]?_0x4c7a4c(0xe8):_0x4c7a4c(0xe2),'segment':_0x27d5c3['id']};return{'type':'And','conditions':[]};}function isTemporalOperator(_0x2efdcd){const _0x1de47b=a141_0x5735a8;return _0x2efdcd===_0x1de47b(0xe1)||_0x2efdcd===_0x1de47b(0x119);}function isBetweenOperator(_0x982521){return _0x982521==='Between';}function getEffectiveValue(_0x226913){const _0x1a000a=a141_0x5735a8,_0x2ea6cb=_0x226913[_0x1a000a(0xfd)];return _0x226913[_0x1a000a(0xa2)]??_0x2ea6cb;}function parseNumericValue(_0x5b366a){const _0x308c0a=a141_0x5735a8;if(typeof _0x5b366a===_0x308c0a(0xe9)&&_0x5b366a!==null)return _0x5b366a;if(_0x5b366a==='')return _0x5b366a;const _0x5b7567=Number(_0x5b366a);return Number[_0x308c0a(0x110)](_0x5b7567)?_0x5b7567:_0x5b366a;}function apiOperatorToYaml(_0x54f6dd){const _0x2a4879=a141_0x5735a8;if(isBetweenOperator(_0x54f6dd[_0x2a4879(0xfe)]))return{'type':mapApiOperatorType(_0x54f6dd[_0x2a4879(0xfe)]),..._0x54f6dd['not']!==undefined&&{'not':_0x54f6dd['not']},..._0x54f6dd['minValue']!==undefined&&{'min':parseNumericValue(_0x54f6dd['minValue'])},..._0x54f6dd[_0x2a4879(0x7c)]!==undefined&&{'max':parseNumericValue(_0x54f6dd['maxValue'])}};if(_0x54f6dd['type']===_0x2a4879(0xa0))return{'type':_0x2a4879(0xa0),..._0x54f6dd['not']!==undefined&&{'not':_0x54f6dd[_0x2a4879(0x8c)]},..._0x54f6dd['duration']!==undefined&&{'duration':_0x54f6dd['duration']},..._0x54f6dd[_0x2a4879(0x8d)]!==undefined&&{'from':_0x54f6dd['from']},..._0x54f6dd[_0x2a4879(0xdc)]!==undefined&&{'reverse':_0x54f6dd[_0x2a4879(0xdc)]}};let _0x1bb82c;if(_0x54f6dd[_0x2a4879(0xe0)]&&_0x54f6dd[_0x2a4879(0xe0)][_0x2a4879(0x120)]>0x0)_0x1bb82c=_0x54f6dd[_0x2a4879(0xe0)];else{if(_0x54f6dd[_0x2a4879(0xd8)]!==undefined)_0x1bb82c=_0x54f6dd[_0x2a4879(0xd8)];else isTemporalOperator(_0x54f6dd[_0x2a4879(0xfe)])&&_0x54f6dd[_0x2a4879(0xa2)]!==undefined&&(_0x1bb82c=_0x54f6dd[_0x2a4879(0xa2)]);}return{'type':mapApiOperatorType(_0x54f6dd[_0x2a4879(0xfe)]),..._0x54f6dd[_0x2a4879(0x8c)]!==undefined&&{'not':_0x54f6dd['not']},..._0x1bb82c!==undefined&&{'value':_0x1bb82c},..._0x54f6dd[_0x2a4879(0xda)]!==undefined&&{'unit':_0x54f6dd[_0x2a4879(0xda)]}};}function mapApiOperatorType(_0xbe7e2d){return _0xbe7e2d;}function a141_0x112e(_0x55c385,_0x3ec6c1){_0x55c385=_0x55c385-0x76;const _0x28b85b=a141_0x28b8();let _0x112ef5=_0x28b85b[_0x55c385];return _0x112ef5;}export function segmentDefToCreateRequest(_0x52bf31,_0x3b6412){const _0x157f2a=a141_0x5735a8,_0x4b439b={'name':_0x52bf31[_0x157f2a(0x7a)]};return _0x52bf31['description']&&(_0x4b439b[_0x157f2a(0x125)]=_0x52bf31[_0x157f2a(0x125)]),_0x52bf31[_0x157f2a(0xe3)]&&(_0x4b439b[_0x157f2a(0xe3)]=yamlRuleToApi(_0x52bf31[_0x157f2a(0xe3)])),_0x52bf31[_0x157f2a(0x10a)]&&(_0x4b439b[_0x157f2a(0x10a)]=_0x52bf31[_0x157f2a(0x10a)]===_0x157f2a(0xb2)?0x0:_0x52bf31['kind']===_0x157f2a(0x79)?0x1:0x2),_0x52bf31[_0x157f2a(0xfb)]!==undefined&&(_0x4b439b[_0x157f2a(0x83)]=_0x52bf31['visible']),_0x3b6412&&(_0x4b439b[_0x157f2a(0xc8)]=_0x3b6412),_0x4b439b;}export function segmentDefToUpdateRequest(_0x1410e3){const _0x17a5c3=a141_0x5735a8,_0x1c394c={'name':_0x1410e3[_0x17a5c3(0x7a)]};return _0x1410e3[_0x17a5c3(0x125)]!==undefined&&(_0x1c394c[_0x17a5c3(0x125)]=_0x1410e3[_0x17a5c3(0x125)]),_0x1410e3[_0x17a5c3(0xe3)]&&(_0x1c394c[_0x17a5c3(0xe3)]=yamlRuleToApi(_0x1410e3[_0x17a5c3(0xe3)])),_0x1410e3[_0x17a5c3(0x10a)]&&(_0x1c394c[_0x17a5c3(0x10a)]=_0x1410e3[_0x17a5c3(0x10a)]===_0x17a5c3(0xb2)?0x0:_0x1410e3[_0x17a5c3(0x10a)]==='realtime'?0x1:0x2),_0x1c394c;}export function yamlRuleToApi(_0x2d061f){const _0x41094e=a141_0x5735a8,_0x4da821=_0x2d061f['conditions'][_0x41094e(0xa5)](yamlConditionToApi),_0x3cca08=_0x4da821[_0x41094e(0xa8)](_0x5004ba=>isCompositeType(_0x5004ba)&&_0x5004ba[_0x41094e(0x125)]!==undefined);if(!_0x3cca08&&_0x4da821[_0x41094e(0x120)]>0x0){const _0x40022e=[];for(const _0x50fde3 of _0x4da821){isCompositeType(_0x50fde3)&&_0x50fde3[_0x41094e(0x125)]===undefined&&_0x50fde3[_0x41094e(0x121)]&&_0x50fde3[_0x41094e(0x121)][_0x41094e(0xa8)](_0x387425=>!isCompositeType(_0x387425))?_0x40022e[_0x41094e(0x7b)]({'type':_0x50fde3[_0x41094e(0xfe)],'description':'','conditions':_0x50fde3[_0x41094e(0x121)]}):_0x40022e[_0x41094e(0x7b)]({'type':_0x41094e(0xf6),'description':_0x2d061f['description']||'','conditions':[_0x50fde3]});}return{'type':_0x2d061f[_0x41094e(0xfe)],'conditions':_0x40022e};}return{'type':_0x2d061f[_0x41094e(0xfe)],'conditions':_0x4da821,..._0x2d061f[_0x41094e(0x125)]&&{'description':_0x2d061f[_0x41094e(0x125)]}};}function yamlFilterRuleToApi(_0x1f3a19){const _0xb7d2c4=a141_0x5735a8,_0x53f5b4=_0x1f3a19[_0xb7d2c4(0x121)]['map'](yamlConditionToApi);return{'type':_0x1f3a19['type'],'conditions':_0x53f5b4};}function yamlConditionToApi(_0x92461d){const _0x553cc8=a141_0x5735a8;if('segment'in _0x92461d&&(_0x92461d[_0x553cc8(0xfe)]===_0x553cc8(0xe2)||_0x92461d[_0x553cc8(0xfe)]===_0x553cc8(0xe8))){const _0x330528=_0x92461d;return{'type':_0x553cc8(0xbb),'id':_0x330528[_0x553cc8(0x7f)],'exclude':_0x330528[_0x553cc8(0xfe)]===_0x553cc8(0xe8)};}if(_0x92461d[_0x553cc8(0xfe)]===_0x553cc8(0xf6)||_0x92461d['type']==='Or'){const _0x211771=_0x92461d;return{'type':_0x211771[_0x553cc8(0xfe)],'conditions':_0x211771['conditions'][_0x553cc8(0xa5)](yamlConditionToApi),..._0x211771[_0x553cc8(0x125)]&&{'description':_0x211771[_0x553cc8(0x125)]}};}if('column'in _0x92461d&&_0x92461d[_0x553cc8(0xfe)]===_0x553cc8(0xf3)){const _0x40b5ed=_0x92461d;return{'type':'Column','column':_0x40b5ed[_0x553cc8(0xce)],'operator':yamlOperatorToApi(_0x40b5ed[_0x553cc8(0x81)])};}const _0x4d47be=_0x92461d,_0x2e22a1={'type':_0x553cc8(0x11e),'leftValue':buildLeftValue(_0x4d47be),'operator':yamlOperatorToApi(_0x4d47be[_0x553cc8(0x81)]),'exclude':_0x4d47be['exclude']??![],'arrayMatching':_0x4d47be[_0x553cc8(0x113)]??_0x553cc8(0xa9)};return _0x4d47be[_0x553cc8(0x86)]!==undefined&&(_0x2e22a1[_0x553cc8(0x86)]=_0x4d47be[_0x553cc8(0x86)]),_0x2e22a1;}function buildAggregationDefFromApi(_0x5e63e9){const _0x7f067a=a141_0x5735a8,_0x5069c7=_0x5e63e9[_0x7f067a(0xfe)];if(_0x5069c7===_0x7f067a(0xc3))return{'type':_0x5069c7,'columns':_0x5e63e9[_0x7f067a(0xec)]??[]};if(_0x5069c7===_0x7f067a(0xed)||_0x5069c7==='Last')return{'type':_0x5069c7,'column':_0x5e63e9['column']??'','orderColumn':_0x5e63e9[_0x7f067a(0x10d)]??'',..._0x5e63e9[_0x7f067a(0x98)]&&{'groupingColumns':_0x5e63e9[_0x7f067a(0x98)]}};if(_0x5069c7===_0x7f067a(0xef))return{'type':_0x5069c7,..._0x5e63e9['groupingColumns']&&{'groupingColumns':_0x5e63e9[_0x7f067a(0x98)]}};return{'type':_0x5069c7,'column':_0x5e63e9['column']??'',..._0x5e63e9['groupingColumns']&&{'groupingColumns':_0x5e63e9[_0x7f067a(0x98)]}};}function buildLeftValue(_0x32c170){const _0x228913=a141_0x5735a8,_0xa63ca7={};_0x32c170[_0x228913(0x7d)]&&_0x32c170[_0x228913(0xfe)]!==_0x228913(0x123)&&(_0xa63ca7[_0x228913(0x7a)]=_0x32c170[_0x228913(0x7d)]);if(_0x32c170[_0x228913(0x93)]){const _0x4619f2=_0x32c170[_0x228913(0x93)];if(_0x4619f2[_0x228913(0xfe)]===_0x228913(0xc3))_0xa63ca7['aggregation']={'type':_0x228913(0xc3),'columns':_0x4619f2[_0x228913(0xec)]};else{if(_0x4619f2[_0x228913(0xfe)]===_0x228913(0xed)||_0x4619f2[_0x228913(0xfe)]==='Last')_0xa63ca7[_0x228913(0x93)]={'type':_0x4619f2[_0x228913(0xfe)],'column':_0x4619f2[_0x228913(0xce)],'orderColumn':_0x4619f2[_0x228913(0x10d)],..._0x4619f2[_0x228913(0x98)]&&{'groupingColumns':_0x4619f2[_0x228913(0x98)]}};else _0x4619f2[_0x228913(0xfe)]===_0x228913(0xef)?_0xa63ca7[_0x228913(0x93)]={'type':_0x228913(0xef),..._0x4619f2[_0x228913(0x98)]&&{'groupingColumns':_0x4619f2[_0x228913(0x98)]}}:_0xa63ca7[_0x228913(0x93)]={'type':_0x4619f2[_0x228913(0xfe)],'column':_0x4619f2[_0x228913(0xce)],..._0x4619f2[_0x228913(0x98)]&&{'groupingColumns':_0x4619f2['groupingColumns']}};}}return _0x32c170[_0x228913(0x80)]&&(_0xa63ca7[_0x228913(0x80)]={'name':_0x32c170[_0x228913(0x80)]}),_0x32c170[_0x228913(0x115)]&&(_0xa63ca7['filter']=yamlFilterRuleToApi(filterRuleAsRuleDef(_0x32c170[_0x228913(0x115)]))),_0xa63ca7;}function yamlOperatorToApi(_0x4557ac){const _0x14fcf9=a141_0x5735a8,_0x1013df={'type':mapYamlOperatorType(_0x4557ac[_0x14fcf9(0xfe)]),'not':_0x4557ac['not']??![]};if(isBetweenOperator(_0x4557ac['type']))return _0x4557ac[_0x14fcf9(0x122)]!==undefined&&(_0x1013df['minValue']=typeof _0x4557ac[_0x14fcf9(0x122)]===_0x14fcf9(0xe9)?_0x4557ac[_0x14fcf9(0x122)]:String(_0x4557ac['min'])),_0x4557ac[_0x14fcf9(0xa6)]!==undefined&&(_0x1013df['maxValue']=typeof _0x4557ac['max']===_0x14fcf9(0xe9)?_0x4557ac[_0x14fcf9(0xa6)]:String(_0x4557ac[_0x14fcf9(0xa6)])),_0x1013df;if(_0x4557ac[_0x14fcf9(0xfe)]===_0x14fcf9(0xa0))return _0x4557ac['duration']&&(_0x1013df[_0x14fcf9(0x85)]=_0x4557ac[_0x14fcf9(0x85)]),_0x4557ac['from']&&(_0x1013df[_0x14fcf9(0x8d)]=_0x4557ac[_0x14fcf9(0x8d)]),_0x4557ac[_0x14fcf9(0xdc)]!==undefined&&(_0x1013df['reverse']=_0x4557ac[_0x14fcf9(0xdc)]),_0x1013df;const _0xcd0782=getEffectiveValue(_0x4557ac);if(_0xcd0782!==undefined){if(Array[_0x14fcf9(0xab)](_0xcd0782))_0x1013df[_0x14fcf9(0xe0)]=_0xcd0782;else isTemporalOperator(_0x4557ac['type'])?_0x1013df[_0x14fcf9(0xa2)]=_0xcd0782:_0x1013df['rightValue']=_0xcd0782;}return _0x4557ac['unit']&&(_0x1013df[_0x14fcf9(0xda)]=_0x4557ac[_0x14fcf9(0xda)]),_0x1013df;}function mapYamlOperatorType(_0x57e693){return _0x57e693;}export function toYamlString(_0x5afd28){const _0xc790a1=a141_0x5735a8,_0x3241cf=JSON[_0xc790a1(0xe5)](JSON['stringify'](_0x5afd28)),_0x4321a9=a141_0x26f280['stringify'](_0x3241cf,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xc790a1(0xff)}),_0x51bd88=[_0xc790a1(0x10c)];let _0x4d93e9=_0x4321a9;for(const _0x465f53 of _0x51bd88){_0x4d93e9=_0x4d93e9['replace'](new RegExp('^('+_0x465f53+')','m'),(_0x515261,_0x560c10,_0x2d1fc9)=>{if(_0x2d1fc9===0x0||_0x4d93e9[_0x2d1fc9-0x1]==='\x0a'&&_0x4d93e9[_0x2d1fc9-0x2]==='\x0a')return _0x560c10;return'\x0a'+_0x560c10;});}return _0x4d93e9;}export function parseYamlString(_0x351246){return parseSegmentYamlFile(_0x351246);}export function isSegmentYaml(_0x39883d){const _0x217aad=a141_0x5735a8;if(typeof _0x39883d!==_0x217aad(0xe9)||_0x39883d===null)return![];const _0x4d042d=_0x39883d;return _0x4d042d['type']===_0x217aad(0x7f)||_0x4d042d[_0x217aad(0xfe)]===undefined;}export function generateTemplate(_0xe4db41=a141_0x5735a8(0x104)){const _0xf6e2a5=a141_0x5735a8,_0x3887b0={'type':_0xf6e2a5(0x7f),'name':_0xe4db41,'description':_0xf6e2a5(0x124),'rule':{'type':'And','conditions':[{'type':_0xf6e2a5(0x11e),'attribute':_0xf6e2a5(0xf5),'operator':{'type':'Equal','value':_0xf6e2a5(0xa2)}}]}};return toYamlString(_0x3887b0);}export function segmentToYamlString(_0x3cca17){const _0xb0ee70=a141_0x5735a8,_0x511c0b=JSON[_0xb0ee70(0xe5)](JSON[_0xb0ee70(0xb1)](_0x3cca17)),_0x1337b5=a141_0x26f280['stringify'](_0x511c0b,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xb0ee70(0xff)}),_0x4446ab=['rule:',_0xb0ee70(0x99)];let _0x289ec9=_0x1337b5;for(const _0x1b2c57 of _0x4446ab){_0x289ec9=_0x289ec9[_0xb0ee70(0x9f)](new RegExp('^('+_0x1b2c57+')','m'),(_0xde1db1,_0x5b3de2,_0x5065c8)=>{if(_0x5065c8===0x0||_0x289ec9[_0x5065c8-0x1]==='\x0a'&&_0x289ec9[_0x5065c8-0x2]==='\x0a')return _0x5b3de2;return'\x0a'+_0x5b3de2;});}return _0x289ec9;}export function parseSegmentYamlFile(_0x4e3ca3){return safeParseYaml(_0x4e3ca3,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x1767be){const _0x191dba=a141_0x5735a8;return{'type':'segment','name':_0x1767be[_0x191dba(0x7a)],..._0x1767be[_0x191dba(0x125)]!==undefined&&{'description':_0x1767be[_0x191dba(0x125)]},..._0x1767be[_0x191dba(0xb9)]!==undefined&&{'folder':_0x1767be[_0x191dba(0xb9)]},..._0x1767be[_0x191dba(0xe3)]&&{'rule':normalizeRule(_0x1767be[_0x191dba(0xe3)])},..._0x1767be['kind']!==undefined&&{'kind':_0x1767be['kind']},..._0x1767be['visible']!==undefined&&{'visible':_0x1767be[_0x191dba(0xfb)]},..._0x1767be['activations']&&{'activations':_0x1767be[_0x191dba(0x11d)]['map'](normalizeActivation)}};}export function normalizeRule(_0x1acc60){const _0x5e4291=a141_0x5735a8;return{'type':_0x1acc60[_0x5e4291(0xfe)],'conditions':_0x1acc60[_0x5e4291(0x121)][_0x5e4291(0xa5)](normalizeCondition),..._0x1acc60[_0x5e4291(0x125)]!==undefined&&{'description':_0x1acc60['description']}};}function normalizeCondition(_0x49c288){const _0x52bf29=a141_0x5735a8;if(_0x52bf29(0x7f)in _0x49c288&&(_0x49c288[_0x52bf29(0xfe)]===_0x52bf29(0xe2)||_0x49c288[_0x52bf29(0xfe)]==='exclude')){const _0x4d5f10=_0x49c288;return{'type':_0x4d5f10[_0x52bf29(0xfe)],'segment':_0x4d5f10[_0x52bf29(0x7f)]};}if(_0x49c288['type']===_0x52bf29(0xf6)||_0x49c288[_0x52bf29(0xfe)]==='Or'){const _0x5bbfba=_0x49c288;return{'type':_0x5bbfba[_0x52bf29(0xfe)],'conditions':_0x5bbfba['conditions'][_0x52bf29(0xa5)](normalizeCondition),..._0x5bbfba[_0x52bf29(0x125)]!==undefined&&{'description':_0x5bbfba['description']}};}if(_0x52bf29(0xce)in _0x49c288&&_0x49c288[_0x52bf29(0xfe)]==='Column'){const _0x27b1a4=_0x49c288;return{'type':_0x52bf29(0xf3),'column':_0x27b1a4['column'],'operator':normalizeOperator(_0x27b1a4[_0x52bf29(0x81)])};}if(_0x49c288[_0x52bf29(0xfe)]==='Behavior'){const _0x259540=_0x49c288;return{'type':_0x52bf29(0x123),'attribute':_0x259540[_0x52bf29(0x7d)],'operator':normalizeOperator(_0x259540[_0x52bf29(0x81)]),..._0x259540[_0x52bf29(0x113)]!==undefined&&{'arrayMatching':_0x259540[_0x52bf29(0x113)]},..._0x259540[_0x52bf29(0xe8)]!==undefined&&{'exclude':_0x259540[_0x52bf29(0xe8)]},..._0x259540[_0x52bf29(0x93)]!==undefined&&{'aggregation':_0x259540[_0x52bf29(0x93)]},..._0x259540[_0x52bf29(0x80)]!==undefined&&{'source':_0x259540[_0x52bf29(0x80)]},..._0x259540[_0x52bf29(0x115)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x259540[_0x52bf29(0x115)])))},..._0x259540[_0x52bf29(0x84)]!==undefined&&{'timeWindow':_0x259540['timeWindow']},..._0x259540[_0x52bf29(0x86)]!==undefined&&{'limit':_0x259540[_0x52bf29(0x86)]}};}const _0x3bf20c=_0x49c288;return{'type':_0x52bf29(0x11e),'attribute':_0x3bf20c[_0x52bf29(0x7d)],'operator':normalizeOperator(_0x3bf20c[_0x52bf29(0x81)]),..._0x3bf20c[_0x52bf29(0x113)]!==undefined&&{'arrayMatching':_0x3bf20c[_0x52bf29(0x113)]},..._0x3bf20c['exclude']!==undefined&&{'exclude':_0x3bf20c[_0x52bf29(0xe8)]},..._0x3bf20c['aggregation']!==undefined&&{'aggregation':_0x3bf20c['aggregation']},..._0x3bf20c['source']!==undefined&&{'source':_0x3bf20c['source']},..._0x3bf20c[_0x52bf29(0x115)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x3bf20c[_0x52bf29(0x115)])))},..._0x3bf20c[_0x52bf29(0x86)]!==undefined&&{'limit':_0x3bf20c[_0x52bf29(0x86)]}};}function normalizeOperator(_0x3732a3){const _0x2a036d=a141_0x5735a8;if(isBetweenOperator(_0x3732a3['type']))return{'type':_0x3732a3[_0x2a036d(0xfe)],..._0x3732a3[_0x2a036d(0x8c)]!==undefined&&{'not':_0x3732a3[_0x2a036d(0x8c)]},..._0x3732a3[_0x2a036d(0x122)]!==undefined&&{'min':_0x3732a3[_0x2a036d(0x122)]},..._0x3732a3[_0x2a036d(0xa6)]!==undefined&&{'max':_0x3732a3[_0x2a036d(0xa6)]}};const _0x5db59e=getEffectiveValue(_0x3732a3);return{'type':_0x3732a3['type'],..._0x3732a3[_0x2a036d(0x8c)]!==undefined&&{'not':_0x3732a3[_0x2a036d(0x8c)]},..._0x5db59e!==undefined&&{'value':_0x5db59e},..._0x3732a3[_0x2a036d(0xda)]!==undefined&&{'unit':_0x3732a3[_0x2a036d(0xda)]},..._0x3732a3[_0x2a036d(0x85)]!==undefined&&{'duration':_0x3732a3['duration']},..._0x3732a3[_0x2a036d(0x8d)]!==undefined&&{'from':_0x3732a3[_0x2a036d(0x8d)]},..._0x3732a3[_0x2a036d(0xdc)]!==undefined&&{'reverse':_0x3732a3[_0x2a036d(0xdc)]}};}function normalizeActivation(_0x533c52){const _0xfd5f51=a141_0x5735a8;return{'name':_0x533c52[_0xfd5f51(0x7a)],'connection':_0x533c52[_0xfd5f51(0xbe)],..._0x533c52[_0xfd5f51(0x125)]!==undefined&&{'description':_0x533c52[_0xfd5f51(0x125)]},..._0x533c52[_0xfd5f51(0xe4)]!==undefined&&{'all_columns':_0x533c52[_0xfd5f51(0xe4)]},..._0x533c52[_0xfd5f51(0xec)]!==undefined&&{'columns':_0x533c52[_0xfd5f51(0xec)]},..._0x533c52[_0xfd5f51(0xc7)]!==undefined&&{'behavior':_0x533c52[_0xfd5f51(0xc7)]},..._0x533c52[_0xfd5f51(0xbc)]!==undefined&&{'schedule':_0x533c52[_0xfd5f51(0xbc)]},..._0x533c52[_0xfd5f51(0x118)]!==undefined&&{'notification':_0x533c52[_0xfd5f51(0x118)]},..._0x533c52[_0xfd5f51(0x107)]!==undefined&&{'connector_config':_0x533c52['connector_config']},..._0x533c52[_0xfd5f51(0x89)]!==undefined&&{'activation_template_id':_0x533c52[_0xfd5f51(0x89)]},..._0x533c52[_0xfd5f51(0xc9)]!==undefined&&{'nested_workflow_project_name':_0x533c52[_0xfd5f51(0xc9)]},..._0x533c52[_0xfd5f51(0xb5)]!==undefined&&{'nested_workflow_name':_0x533c52[_0xfd5f51(0xb5)]},..._0x533c52[_0xfd5f51(0xa3)]!==undefined&&{'lock_enabled':_0x533c52[_0xfd5f51(0xa3)]}};}function getColumnName(_0x14f609){const _0xec1687=a141_0x5735a8;return _0x14f609[_0xec1687(0xce)]||_0x14f609[_0xec1687(0x7a)];}export function activationResponseToDef(_0x19b7cc,_0xd54992,_0x1cc1fe){const _0x1b6fe0=a141_0x5735a8,_0x24d078=_0x19b7cc['connectionId']||'',_0x4fe3b1=_0x1cc1fe?.[_0x1b6fe0(0x9d)](_0x24d078)??_0x24d078,_0x5ded4c={'name':_0x19b7cc['name'],'connection':_0x4fe3b1};_0x19b7cc['description']&&(_0x5ded4c[_0x1b6fe0(0x125)]=_0x19b7cc[_0x1b6fe0(0x125)]);let _0x5b3a70=[];_0x19b7cc[_0x1b6fe0(0xec)]&&_0x19b7cc[_0x1b6fe0(0xec)][_0x1b6fe0(0x120)]>0x0&&(_0x5b3a70=_0x19b7cc[_0x1b6fe0(0xec)]['filter'](_0x44074e=>_0x44074e&&getColumnName(_0x44074e))[_0x1b6fe0(0xa5)](_0x1aabf0=>{const _0x428816=_0x1b6fe0,_0x33a4b3=getColumnName(_0x1aabf0);if(_0x1aabf0[_0x428816(0xfe)]||_0x1aabf0[_0x428816(0x11f)])return{'name':_0x33a4b3,..._0x1aabf0[_0x428816(0xfe)]&&{'type':_0x1aabf0[_0x428816(0xfe)]},..._0x1aabf0[_0x428816(0x11f)]&&{'visibility':_0x1aabf0[_0x428816(0x11f)]}};return _0x33a4b3;}));_0x5b3a70[_0x1b6fe0(0x120)]>0x0&&(_0x5ded4c[_0x1b6fe0(0xec)]=_0x5b3a70);_0x19b7cc[_0x1b6fe0(0x8e)]!==undefined&&(_0x19b7cc[_0x1b6fe0(0x8e)]===![]&&_0x5b3a70[_0x1b6fe0(0x120)]===0x0?_0x5ded4c['all_columns']=!![]:_0x5ded4c['all_columns']=_0x19b7cc['allColumns']);const _0x4b8180={};let _0x236c4b=![];_0x19b7cc['scheduleType']&&(_0x4b8180[_0x1b6fe0(0xfe)]=_0x19b7cc['scheduleType'],_0x236c4b=!![]);_0x19b7cc['repeatUnit']&&(_0x4b8180['repeat_unit']=_0x19b7cc['repeatUnit'],_0x236c4b=!![]);_0x19b7cc[_0x1b6fe0(0x76)]!==undefined&&_0x19b7cc[_0x1b6fe0(0x76)]!==null&&(_0x4b8180['repeat_frequency']=_0x19b7cc['repeatFrequency'],_0x236c4b=!![]);_0x19b7cc[_0x1b6fe0(0xf8)]&&_0x19b7cc['repeatSubFrequency'][_0x1b6fe0(0x120)]>0x0&&(_0x4b8180[_0x1b6fe0(0xf0)]=_0x19b7cc['repeatSubFrequency'],_0x236c4b=!![]);_0x19b7cc[_0x1b6fe0(0x97)]!==undefined&&(_0x4b8180['start_at']=_0x19b7cc[_0x1b6fe0(0x97)],_0x236c4b=!![]);_0x19b7cc[_0x1b6fe0(0xa7)]!==undefined&&(_0x4b8180[_0x1b6fe0(0x9e)]=_0x19b7cc['endOn'],_0x236c4b=!![]);_0x19b7cc[_0x1b6fe0(0xd9)]&&(_0x4b8180[_0x1b6fe0(0xd9)]=_0x19b7cc[_0x1b6fe0(0xd9)],_0x236c4b=!![]);_0x236c4b&&(_0x5ded4c[_0x1b6fe0(0xbc)]=_0x4b8180);(_0x19b7cc['notifyOn']&&_0x19b7cc['notifyOn'][_0x1b6fe0(0x120)]>0x0||_0x19b7cc['emailRecipients']&&_0x19b7cc[_0x1b6fe0(0x7e)][_0x1b6fe0(0x120)]>0x0)&&(_0x5ded4c[_0x1b6fe0(0x118)]={},_0x19b7cc[_0x1b6fe0(0xb6)]&&_0x19b7cc[_0x1b6fe0(0xb6)][_0x1b6fe0(0x120)]>0x0&&(_0x5ded4c['notification'][_0x1b6fe0(0xdd)]=_0x19b7cc[_0x1b6fe0(0xb6)]),_0x19b7cc[_0x1b6fe0(0x7e)]&&_0x19b7cc['emailRecipients'][_0x1b6fe0(0x120)]>0x0&&(_0x5ded4c[_0x1b6fe0(0x118)][_0x1b6fe0(0xcf)]=_0x19b7cc['emailRecipients'][_0x1b6fe0(0xa5)](_0x1a3cc7=>{const _0x37dc5f=_0x1b6fe0,_0x4932c6=_0xd54992?.[_0x37dc5f(0x9d)](_0x1a3cc7);return _0x4932c6??String(_0x1a3cc7);})));_0x19b7cc['connectorConfig']&&Object[_0x1b6fe0(0x9c)](_0x19b7cc[_0x1b6fe0(0xc4)])['length']>0x0&&(_0x5ded4c[_0x1b6fe0(0x107)]=normalizeConnectorConfigForYaml(_0x19b7cc[_0x1b6fe0(0xc4)]));_0x19b7cc[_0x1b6fe0(0xba)]&&(_0x5ded4c['activation_template_id']=_0x19b7cc[_0x1b6fe0(0xba)]);if(_0x19b7cc['syndicationBehavior']){const _0xc254a7={},_0x125fed=_0x19b7cc['syndicationBehavior'];_0x125fed[_0x1b6fe0(0xec)]&&_0x125fed['columns'][_0x1b6fe0(0x120)]>0x0&&(_0xc254a7[_0x1b6fe0(0xec)]=_0x125fed[_0x1b6fe0(0xec)][_0x1b6fe0(0x115)](_0x57470f=>_0x57470f&&getColumnName(_0x57470f))[_0x1b6fe0(0xa5)](_0x62e540=>({'name':getColumnName(_0x62e540),..._0x62e540[_0x1b6fe0(0xfe)]&&{'type':_0x62e540[_0x1b6fe0(0xfe)]},..._0x62e540[_0x1b6fe0(0x11f)]&&{'visibility':_0x62e540[_0x1b6fe0(0x11f)]}}))),_0x125fed[_0x1b6fe0(0x116)]&&(_0xc254a7[_0x1b6fe0(0xee)]=_0x125fed[_0x1b6fe0(0x116)]),_0x125fed[_0x1b6fe0(0xea)]!==undefined&&(_0xc254a7['join_row']=_0x125fed[_0x1b6fe0(0xea)]),_0x125fed[_0x1b6fe0(0x9b)]&&(_0xc254a7['join_strategy']=_0x125fed[_0x1b6fe0(0x9b)]),_0x125fed[_0x1b6fe0(0x91)]&&(_0xc254a7['formatting']=_0x125fed[_0x1b6fe0(0x91)]),_0x125fed[_0x1b6fe0(0x11b)]&&_0x125fed[_0x1b6fe0(0x11b)][_0x1b6fe0(0x120)]>0x0&&(_0xc254a7[_0x1b6fe0(0xbf)]=_0x125fed['orderBy']),Object[_0x1b6fe0(0x9c)](_0xc254a7)[_0x1b6fe0(0x120)]>0x0&&(_0x5ded4c[_0x1b6fe0(0xc7)]=_0xc254a7);}return _0x19b7cc[_0x1b6fe0(0xf9)]&&(_0x5ded4c['nested_workflow_project_name']=_0x19b7cc[_0x1b6fe0(0xf9)]),_0x19b7cc['nestedWorkflowName']&&(_0x5ded4c[_0x1b6fe0(0xb5)]=_0x19b7cc[_0x1b6fe0(0xb8)]),_0x19b7cc[_0x1b6fe0(0xde)]!==undefined&&(_0x5ded4c[_0x1b6fe0(0xa3)]=_0x19b7cc[_0x1b6fe0(0xde)]),_0x5ded4c;}export function journeyActivationStepToYaml(_0x42f96c,_0x1327fb,_0xdfb5a6){const _0x4ff377=a141_0x5735a8,_0x5ce49a=_0x42f96c['attributes']['activationParams'],_0x1ff1c4=_0x5ce49a[_0x4ff377(0x10b)]||'',_0x2aaa83=_0xdfb5a6?.[_0x4ff377(0x9d)](_0x1ff1c4)??_0x1ff1c4,_0x10a68b={'name':_0x5ce49a[_0x4ff377(0x7a)]||'','connection':_0x2aaa83};_0x42f96c[_0x4ff377(0x88)]['runAfterJourneyRefresh']&&(_0x10a68b['run_after_journey_refresh']=!![]);_0x5ce49a['description']&&(_0x10a68b['description']=_0x5ce49a[_0x4ff377(0x125)]);let _0x467d81=[];_0x5ce49a['columns']&&_0x5ce49a[_0x4ff377(0xec)][_0x4ff377(0x120)]>0x0&&(_0x467d81=_0x5ce49a[_0x4ff377(0xec)][_0x4ff377(0x115)](_0x388469=>_0x388469&&getColumnName(_0x388469))[_0x4ff377(0xa5)](_0x5d1d71=>{const _0x41edc6=_0x4ff377,_0x5518aa=getColumnName(_0x5d1d71);if(_0x5d1d71[_0x41edc6(0xfe)]||_0x5d1d71[_0x41edc6(0x11f)])return{'name':_0x5518aa,..._0x5d1d71[_0x41edc6(0xfe)]&&{'type':_0x5d1d71[_0x41edc6(0xfe)]},..._0x5d1d71[_0x41edc6(0x11f)]&&{'visibility':_0x5d1d71[_0x41edc6(0x11f)]}};return _0x5518aa;}));_0x467d81['length']>0x0&&(_0x10a68b[_0x4ff377(0xec)]=_0x467d81);_0x5ce49a['allColumns']!==undefined&&(_0x5ce49a[_0x4ff377(0x8e)]===![]&&_0x467d81[_0x4ff377(0x120)]===0x0?_0x10a68b['all_columns']=!![]:_0x10a68b[_0x4ff377(0xe4)]=_0x5ce49a['allColumns']);const _0x15aa3b={};let _0x518ace=![];_0x5ce49a[_0x4ff377(0x87)]&&(_0x15aa3b[_0x4ff377(0xfe)]=_0x5ce49a[_0x4ff377(0x87)],_0x518ace=!![]);_0x5ce49a[_0x4ff377(0xd2)]&&(_0x15aa3b[_0x4ff377(0xaf)]=_0x5ce49a[_0x4ff377(0xd2)],_0x518ace=!![]);_0x5ce49a['repeatFrequency']!==undefined&&_0x5ce49a[_0x4ff377(0x76)]!==null&&(_0x15aa3b[_0x4ff377(0x127)]=_0x5ce49a[_0x4ff377(0x76)],_0x518ace=!![]);_0x5ce49a[_0x4ff377(0x97)]!==undefined&&(_0x15aa3b[_0x4ff377(0x8b)]=_0x5ce49a['startAt'],_0x518ace=!![]);_0x5ce49a['endOn']!==undefined&&(_0x15aa3b[_0x4ff377(0x9e)]=_0x5ce49a[_0x4ff377(0xa7)],_0x518ace=!![]);_0x5ce49a['timezone']&&(_0x15aa3b[_0x4ff377(0xd9)]=_0x5ce49a[_0x4ff377(0xd9)],_0x518ace=!![]);_0x518ace&&(_0x10a68b['schedule']=_0x15aa3b);(_0x5ce49a[_0x4ff377(0xb6)]&&_0x5ce49a[_0x4ff377(0xb6)][_0x4ff377(0x120)]>0x0||_0x5ce49a[_0x4ff377(0x7e)]&&_0x5ce49a[_0x4ff377(0x7e)]['length']>0x0)&&(_0x10a68b[_0x4ff377(0x118)]={},_0x5ce49a[_0x4ff377(0xb6)]&&_0x5ce49a[_0x4ff377(0xb6)][_0x4ff377(0x120)]>0x0&&(_0x10a68b['notification']['notify_on']=_0x5ce49a[_0x4ff377(0xb6)]),_0x5ce49a[_0x4ff377(0x7e)]&&_0x5ce49a[_0x4ff377(0x7e)]['length']>0x0&&(_0x10a68b['notification']['email_recipients']=_0x5ce49a[_0x4ff377(0x7e)][_0x4ff377(0xa5)](_0x1425ef=>{const _0x5ce941=_0x1327fb?.['get'](_0x1425ef);return _0x5ce941??String(_0x1425ef);})));_0x5ce49a[_0x4ff377(0xc4)]&&Object[_0x4ff377(0x9c)](_0x5ce49a[_0x4ff377(0xc4)])[_0x4ff377(0x120)]>0x0&&(_0x10a68b[_0x4ff377(0x107)]=normalizeConnectorConfigForYaml(_0x5ce49a[_0x4ff377(0xc4)]));_0x5ce49a[_0x4ff377(0xba)]&&(_0x10a68b['activation_template_id']=_0x5ce49a['activationTemplateId']);if(_0x5ce49a[_0x4ff377(0xca)]){const _0x2cdfe1={},_0x500055=_0x5ce49a[_0x4ff377(0xca)];_0x500055['columns']&&_0x500055[_0x4ff377(0xec)]['length']>0x0&&(_0x2cdfe1[_0x4ff377(0xec)]=_0x500055['columns']['filter'](_0x36dbef=>_0x36dbef&&getColumnName(_0x36dbef))['map'](_0x385b5b=>({'name':getColumnName(_0x385b5b),..._0x385b5b[_0x4ff377(0xfe)]&&{'type':_0x385b5b[_0x4ff377(0xfe)]},..._0x385b5b['visibility']&&{'visibility':_0x385b5b[_0x4ff377(0x11f)]}}))),_0x500055[_0x4ff377(0x116)]&&(_0x2cdfe1[_0x4ff377(0xee)]=_0x500055[_0x4ff377(0x116)]),_0x500055[_0x4ff377(0xea)]!==undefined&&(_0x2cdfe1[_0x4ff377(0x109)]=_0x500055['joinRow']),_0x500055[_0x4ff377(0x9b)]&&(_0x2cdfe1['join_strategy']=_0x500055[_0x4ff377(0x9b)]),_0x500055[_0x4ff377(0x91)]&&(_0x2cdfe1[_0x4ff377(0x91)]=_0x500055['formatting']),_0x500055['orderBy']&&_0x500055[_0x4ff377(0x11b)][_0x4ff377(0x120)]>0x0&&(_0x2cdfe1['order_by']=_0x500055[_0x4ff377(0x11b)]),Object[_0x4ff377(0x9c)](_0x2cdfe1)[_0x4ff377(0x120)]>0x0&&(_0x10a68b[_0x4ff377(0xc7)]=_0x2cdfe1);}return _0x10a68b;}export function segmentWithActivationsToYaml(_0x335065,_0x17474f,_0x52f456,_0x4cced5,_0x1d7a1a){const _0x2d6ab9=a141_0x5735a8,_0x80d4db=segmentResponseToDefSync(_0x335065,_0x52f456);return _0x17474f['length']>0x0&&(_0x80d4db[_0x2d6ab9(0x11d)]=_0x17474f['map'](_0x4fdd6a=>activationResponseToDef(_0x4fdd6a,_0x4cced5,_0x1d7a1a))),_0x80d4db;}function normalizeColumn(_0x3dcd6f){const _0x4209c8=a141_0x5735a8;if(typeof _0x3dcd6f==='string')return{'column':_0x3dcd6f,'source':{'column':_0x3dcd6f}};return{'column':_0x3dcd6f[_0x4209c8(0x7a)],'source':{'column':_0x3dcd6f[_0x4209c8(0x7a)]},..._0x3dcd6f[_0x4209c8(0xfe)]&&{'type':_0x3dcd6f['type']},..._0x3dcd6f[_0x4209c8(0x11f)]&&{'visibility':_0x3dcd6f[_0x4209c8(0x11f)]}};}function a141_0x28b8(){const _0x539517=['repeatUnit','\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a','CONNECTOR_INVALID_CONFIG','Unknown\x20email\x20recipient:\x20','join','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','rightValue','timezone','unit','hourly','reverse','notify_on','lockEnabled','forEach','rightValues','TimeWithinPast','include','rule','all_columns','parse','all','funnel_stage','exclude','object','joinRow','entries','columns','First','behavior_table','Count','repeat_sub_frequency','Unknown\x20connection:\x20','month','Column','connectionNameToIdMap','attribute_name','And','ruleHashToName','repeatSubFrequency','nestedWorkflowProjectName','minute','visible','CONNECTOR_SCHEMA_NOT_FOUND','values','type','null','hour','resolveSegmentName','All','1285715clOpjO','New\x20Segment','week','5171eCsMsJ','connector_config','localeCompare','join_row','kind','connectionId','rule:','orderColumn','\x0a\x0aAvailable\x20fields:\x0a','errors','isFinite','Connector:\x20','Warning:\x20activation\x20\x22','arrayMatching','JOURNEY_SYNTAX_ERROR','filter','behaviorTableName','connectionNameToTypeMap','notification','TimeWithinNext','7736jKGieN','orderBy','876708asbrlU','activations','Value','visibility','length','conditions','min','Behavior','Segment\x20description','description','cron','repeat_frequency','join_strategy','string','__UNRESOLVED__','\x22:\x0a','repeatFrequency','\x20\x20-\x20\x22','warnings','realtime','name','push','maxValue','attribute','emailRecipients','segment','source','operator','124TepGYH','isVisible','timeWindow','duration','limit','scheduleType','attributes','activation_template_id','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','start_at','not','from','allColumns','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','1141296heELMk','formatting','monthly','aggregation','219489BhQQgu','Last','add','startAt','groupingColumns','activations:','none','joinStrategy','keys','get','end_on','replace','TimeRange','valid','value','lock_enabled','emailToIdMap','map','max','endOn','every','any','__SEGMENT_REF__','isArray','connector_config\x20for\x20activation\x20\x22','weekly','].attribute\x20cannot\x20be\x20empty.\x0a','repeat_unit','leftValue','stringify','batch','set','localRuleToName','nested_workflow_name','notifyOn','test','nestedWorkflowName','folder','activationTemplateId','Reference','schedule','3803364uFpHaj','connection','order_by','minutes_interval','CONNECTION_NOT_FOUND','sort','CountDistinct','connectorConfig','day','1589VZjWLZ','behavior','segmentFolderId','nested_workflow_project_name','syndicationBehavior','warn','has','daily','column','email_recipients','usedNames','getSchema'];a141_0x28b8=function(){return _0x539517;};return a141_0x28b8();}const KNOWN_ACTIVATION_FIELDS=new Set(Object['keys'](ActivationDefSchema['shape']));export function warnUnrecognizedActivationFields(_0x5dfd56,_0x4eaaa3){const _0x5c55af=a141_0x5735a8,_0x5337bf=Object[_0x5c55af(0x9c)](_0x5dfd56)['filter'](_0x33ded0=>!KNOWN_ACTIVATION_FIELDS[_0x5c55af(0xcc)](_0x33ded0));if(_0x5337bf[_0x5c55af(0x120)]>0x0){const _0x516c96=_0x5337bf['map'](_0x3be2c8=>_0x5c55af(0x77)+_0x3be2c8+'\x22')[_0x5c55af(0xd6)]('\x0a');console['warn'](_0x5c55af(0x112)+_0x4eaaa3+_0x5c55af(0xd3)+_0x516c96);}}export async function activationDefToCreateRequest(_0x12404f,_0x2d13a6){const _0x35cea6=a141_0x5735a8;warnUnrecognizedActivationFields(_0x12404f,_0x12404f['name']);const _0x1840c7=_0x2d13a6?.[_0x35cea6(0xa4)],_0x18976b=_0x2d13a6?.[_0x35cea6(0xf4)],_0x1848bd=_0x12404f[_0x35cea6(0xbe)];let _0x37803f;const _0x5e3be1=parseInt(_0x1848bd,0xa);if(!isNaN(_0x5e3be1)&&String(_0x5e3be1)===_0x1848bd)_0x37803f=_0x5e3be1;else{const _0x28435e=_0x18976b?.[_0x35cea6(0x9d)](_0x1848bd);if(_0x28435e===undefined)throw new SDKError(ErrorCode[_0x35cea6(0xc1)],_0x35cea6(0xf1)+_0x1848bd,undefined,{'helpText':_0x35cea6(0x8f)});_0x37803f=_0x28435e;}const _0x494ffc={'name':_0x12404f['name'],'connectionId':_0x37803f};_0x12404f['description']&&(_0x494ffc['description']=_0x12404f[_0x35cea6(0x125)]);let _0x39dc1a=[];_0x12404f[_0x35cea6(0xec)]&&_0x12404f[_0x35cea6(0xec)][_0x35cea6(0x120)]>0x0&&(_0x39dc1a=_0x12404f[_0x35cea6(0xec)][_0x35cea6(0x115)](_0x28399f=>_0x28399f!=null)['map'](normalizeColumn));_0x39dc1a['length']>0x0&&(_0x494ffc[_0x35cea6(0xec)]=_0x39dc1a);_0x12404f['all_columns']!==undefined&&(_0x12404f[_0x35cea6(0xe4)]===![]&&_0x39dc1a[_0x35cea6(0x120)]===0x0?_0x494ffc['allColumns']=!![]:_0x494ffc[_0x35cea6(0x8e)]=_0x12404f[_0x35cea6(0xe4)]);if(_0x12404f['schedule']){const _0x20cb9e=_0x12404f[_0x35cea6(0xbc)],_0x553ff3=_0x20cb9e['type']??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x20cb9e['repeat_unit']];_0x553ff3&&(_0x494ffc[_0x35cea6(0x87)]=_0x553ff3);const _0x222a85=_0x20cb9e[_0x35cea6(0xaf)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x20cb9e['type']];_0x222a85&&(_0x494ffc[_0x35cea6(0xd2)]=_0x222a85);_0x20cb9e[_0x35cea6(0x127)]!==undefined&&(_0x494ffc[_0x35cea6(0x76)]=_0x20cb9e[_0x35cea6(0x127)]);_0x20cb9e[_0x35cea6(0xf0)]&&(_0x494ffc[_0x35cea6(0xf8)]=_0x20cb9e[_0x35cea6(0xf0)]);_0x20cb9e[_0x35cea6(0x8b)]!==undefined&&(_0x494ffc[_0x35cea6(0x97)]=_0x20cb9e['start_at']);_0x20cb9e[_0x35cea6(0x9e)]!==undefined&&(_0x494ffc[_0x35cea6(0xa7)]=_0x20cb9e[_0x35cea6(0x9e)]);_0x20cb9e[_0x35cea6(0xd9)]&&(_0x494ffc['timezone']=_0x20cb9e[_0x35cea6(0xd9)]);if(_0x553ff3&&_0x553ff3!==_0x35cea6(0x9a)&&_0x553ff3!==_0x35cea6(0x126)&&_0x20cb9e[_0x35cea6(0x8b)]){const _0x5121c3=_0x20cb9e[_0x35cea6(0x8b)]['match'](/T(\d{2}:\d{2})/);_0x5121c3&&(_0x494ffc['scheduleOption']=_0x5121c3[0x1]);}}_0x12404f['notification']&&(_0x12404f[_0x35cea6(0x118)][_0x35cea6(0xdd)]&&(_0x494ffc['notifyOn']=_0x12404f['notification']['notify_on']),_0x12404f[_0x35cea6(0x118)][_0x35cea6(0xcf)]&&(_0x494ffc[_0x35cea6(0x7e)]=_0x12404f[_0x35cea6(0x118)][_0x35cea6(0xcf)][_0x35cea6(0xa5)](_0x4e1cc3=>{const _0x31df53=_0x35cea6,_0x4135da=Number(_0x4e1cc3);if(!isNaN(_0x4135da)&&String(_0x4135da)===_0x4e1cc3)return _0x4135da;const _0x653de5=_0x1840c7?.[_0x31df53(0x9d)](_0x4e1cc3['toLowerCase']());if(_0x653de5===undefined)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x31df53(0xd5)+_0x4e1cc3+_0x31df53(0xd7));return _0x653de5;})));if(_0x12404f[_0x35cea6(0x107)]){const _0x2a9e2b=_0x2d13a6?.[_0x35cea6(0x117)]?.[_0x35cea6(0x9d)](_0x1848bd);if(_0x2a9e2b&&_0x2d13a6?.[_0x35cea6(0xd1)])try{const _0x1f33a9=await _0x2d13a6[_0x35cea6(0xd1)](_0x2a9e2b),_0x5966f2=validateConnectorConfig(_0x12404f['connector_config'],_0x1f33a9);if(!_0x5966f2[_0x35cea6(0xa1)])throw new SDKError(ErrorCode[_0x35cea6(0xd4)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x12404f[_0x35cea6(0x7a)]+'\x22:\x0a'+formatValidationErrors(_0x5966f2[_0x35cea6(0x10f)]),undefined,{'helpText':_0x35cea6(0x111)+_0x2a9e2b+_0x35cea6(0x10e)+formatSchemaAsHelp(_0x1f33a9)});if(_0x5966f2[_0x35cea6(0x78)][_0x35cea6(0x120)]>0x0){const _0x2e98a8=formatValidationWarnings(_0x5966f2[_0x35cea6(0x78)]);console[_0x35cea6(0xcb)](_0x35cea6(0xac)+_0x12404f[_0x35cea6(0x7a)]+_0x35cea6(0x12b)+_0x2e98a8);}_0x494ffc[_0x35cea6(0xc4)]=transformConfigToLegacy(_0x12404f[_0x35cea6(0x107)],_0x1f33a9);}catch(_0x46797f){if(_0x46797f instanceof SDKError&&_0x46797f['code']===ErrorCode[_0x35cea6(0xfc)])_0x494ffc[_0x35cea6(0xc4)]=_0x12404f['connector_config'];else throw _0x46797f;}else _0x494ffc[_0x35cea6(0xc4)]=_0x12404f[_0x35cea6(0x107)];}_0x12404f[_0x35cea6(0x89)]!==undefined&&(_0x494ffc['activationTemplateId']=_0x12404f[_0x35cea6(0x89)]);if(_0x12404f[_0x35cea6(0xc7)]){const _0xbaedf8=_0x12404f['behavior'],_0xfd3161={};if(_0xbaedf8[_0x35cea6(0xec)]&&_0xbaedf8[_0x35cea6(0xec)][_0x35cea6(0x120)]>0x0){const _0x9b3f0=_0xbaedf8[_0x35cea6(0xec)][_0x35cea6(0x115)](_0x1c0481=>_0x1c0481&&_0x1c0481[_0x35cea6(0x7a)])[_0x35cea6(0xa5)](normalizeColumn);_0x9b3f0[_0x35cea6(0x120)]>0x0&&(_0xfd3161[_0x35cea6(0xec)]=_0x9b3f0);}_0xbaedf8[_0x35cea6(0xee)]&&(_0xfd3161[_0x35cea6(0x116)]=_0xbaedf8[_0x35cea6(0xee)]);_0xbaedf8[_0x35cea6(0x128)]&&(_0xfd3161[_0x35cea6(0x9b)]=_0xbaedf8[_0x35cea6(0x128)]);if(_0xbaedf8[_0x35cea6(0x109)]!==undefined)_0xfd3161['joinRow']=_0xbaedf8[_0x35cea6(0x109)];else{if(_0xbaedf8[_0x35cea6(0x128)]===_0x35cea6(0x95)||_0xbaedf8[_0x35cea6(0x128)]===_0x35cea6(0xed))_0xfd3161['joinRow']=0x1;else _0xbaedf8[_0x35cea6(0x128)]===_0x35cea6(0x102)&&(_0xfd3161['joinRow']=null);}_0xbaedf8[_0x35cea6(0x91)]&&(_0xfd3161[_0x35cea6(0x91)]=_0xbaedf8[_0x35cea6(0x91)]),_0xbaedf8['order_by']&&(_0xfd3161[_0x35cea6(0x11b)]=_0xbaedf8[_0x35cea6(0xbf)]),_0x494ffc[_0x35cea6(0xca)]=_0xfd3161;}return _0x12404f[_0x35cea6(0xc9)]&&(_0x494ffc[_0x35cea6(0xf9)]=_0x12404f[_0x35cea6(0xc9)]),_0x12404f[_0x35cea6(0xb5)]&&(_0x494ffc[_0x35cea6(0xb8)]=_0x12404f[_0x35cea6(0xb5)]),_0x12404f[_0x35cea6(0xa3)]!==undefined&&(_0x494ffc[_0x35cea6(0xde)]=_0x12404f[_0x35cea6(0xa3)]),_0x494ffc;}export async function activationDefToUpdateRequest(_0x499a2c,_0x14c9cb){return activationDefToCreateRequest(_0x499a2c,_0x14c9cb);}export function deepSortObject(_0x3b717b){const _0x4d1798=a141_0x5735a8;if(_0x3b717b===null||typeof _0x3b717b!==_0x4d1798(0xe9))return _0x3b717b;if(Array[_0x4d1798(0xab)](_0x3b717b))return _0x3b717b['map'](deepSortObject)[_0x4d1798(0xc2)]((_0x924c37,_0x2f43db)=>JSON[_0x4d1798(0xb1)](_0x924c37)[_0x4d1798(0x108)](JSON[_0x4d1798(0xb1)](_0x2f43db)));const _0xca3af7={};for(const _0x5d7b3b of Object[_0x4d1798(0x9c)](_0x3b717b)[_0x4d1798(0xc2)]()){_0xca3af7[_0x5d7b3b]=deepSortObject(_0x3b717b[_0x5d7b3b]);}return _0xca3af7;}export function serializeRule(_0x9a7fea){const _0x4a029d=a141_0x5735a8;return JSON[_0x4a029d(0xb1)](deepSortObject(_0x9a7fea));}export function normalizeRuleForMatching(_0x2608ac){return normalizeConditionsForMatching(_0x2608ac);}function normalizeConditionsForMatching(_0x4024f6){const _0x161491=a141_0x5735a8;if(_0x4024f6===null||typeof _0x4024f6!==_0x161491(0xe9))return _0x4024f6;if(Array[_0x161491(0xab)](_0x4024f6))return _0x4024f6['map'](normalizeConditionsForMatching);const _0x6b6252=_0x4024f6;if((_0x6b6252[_0x161491(0xfe)]===_0x161491(0xe2)||_0x6b6252[_0x161491(0xfe)]==='exclude')&&typeof _0x6b6252[_0x161491(0x7f)]===_0x161491(0x129))return{..._0x6b6252,'segment':_0x161491(0xaa)};const _0x51da8f={};for(const _0xeaf1b1 of Object[_0x161491(0x9c)](_0x6b6252)){_0x51da8f[_0xeaf1b1]=normalizeConditionsForMatching(_0x6b6252[_0xeaf1b1]);}return _0x51da8f;}export function serializeRuleForMatching(_0x1b7581){const _0x158db6=a141_0x5735a8;return JSON[_0x158db6(0xb1)](deepSortObject(normalizeRuleForMatching(_0x1b7581)));}export function expandSegmentReferences(_0x5230fe,_0x491c39,_0x6e5cc1=new Set()){return expandConditions(_0x5230fe,_0x491c39,_0x6e5cc1);}function expandConditions(_0x947915,_0x442f19,_0x10b308){const _0x26a820=a141_0x5735a8;if(_0x947915===null||typeof _0x947915!==_0x26a820(0xe9))return _0x947915;if(Array[_0x26a820(0xab)](_0x947915))return _0x947915['map'](_0x4a34c0=>expandConditions(_0x4a34c0,_0x442f19,_0x10b308));const _0x3fc4f9=_0x947915;if((_0x3fc4f9[_0x26a820(0xfe)]===_0x26a820(0xe2)||_0x3fc4f9[_0x26a820(0xfe)]===_0x26a820(0xe8))&&typeof _0x3fc4f9['segment']===_0x26a820(0x129)){const _0x511940=_0x3fc4f9[_0x26a820(0x7f)],_0x134c50=_0x442f19[_0x26a820(0x9d)](_0x511940);if(_0x134c50&&!_0x10b308[_0x26a820(0xcc)](_0x511940)){const _0x811ece=new Set(_0x10b308);_0x811ece[_0x26a820(0x96)](_0x511940);const _0x1c9dfc=expandConditions(_0x134c50,_0x442f19,_0x811ece);return{'type':_0x3fc4f9[_0x26a820(0xfe)],'expanded_rule':_0x1c9dfc};}return{'type':_0x3fc4f9[_0x26a820(0xfe)],'expanded_rule':_0x26a820(0x12a)};}const _0x3491bd={};for(const _0x3bdc65 of Object[_0x26a820(0x9c)](_0x3fc4f9)){_0x3491bd[_0x3bdc65]=expandConditions(_0x3fc4f9[_0x3bdc65],_0x442f19,_0x10b308);}return _0x3491bd;}export function serializeExpandedRule(_0x9d643b,_0x1acb88){const _0x13aaeb=a141_0x5735a8,_0x1994a0=expandSegmentReferences(_0x9d643b,_0x1acb88);return JSON[_0x13aaeb(0xb1)](deepSortObject(_0x1994a0));}export function createSegmentNameContext(_0x11f38e){const _0x149ca9=a141_0x5735a8,_0x4851cb=new Set(),_0x1189c9=new Map(),_0x328e04=new Map();if(_0x11f38e)for(const [_0x2423de,_0x553883]of Object[_0x149ca9(0xeb)](_0x11f38e)){if(_0x553883[_0x149ca9(0xe3)]){const _0x177f67=serializeRule(_0x553883[_0x149ca9(0xe3)]);_0x328e04[_0x149ca9(0xb3)](_0x177f67,_0x2423de),_0x4851cb[_0x149ca9(0x96)](_0x2423de);}}return{'usedNames':_0x4851cb,'ruleHashToName':_0x1189c9,'localRuleToName':_0x11f38e?_0x328e04:undefined};}export function resolveSegmentName(_0x425ead,_0x2dc89f,_0x2c6b6a,_0x431808){const _0x262987=a141_0x5735a8,_0x2dcf21=serializeRule(_0x2dc89f);if(_0x2c6b6a[_0x262987(0xb4)]){const _0x1db42e=_0x2c6b6a[_0x262987(0xb4)]['get'](_0x2dcf21);if(_0x1db42e)return{'name':_0x1db42e,'isDuplicate':![],'isLocalMatch':!![]};}const _0x22f126=_0x2c6b6a['ruleHashToName']['get'](_0x2dcf21);if(_0x22f126)return{'name':_0x22f126,'isDuplicate':!![],'isLocalMatch':![]};const _0x5f0720=_0x431808(_0x425ead);let _0x148fb7=_0x5f0720||_0x425ead,_0x4bfd3a=_0x148fb7,_0x2b77f0=0x2;while(_0x2c6b6a[_0x262987(0xd0)][_0x262987(0xcc)](_0x4bfd3a)){_0x4bfd3a=_0x148fb7+'_'+_0x2b77f0,_0x2b77f0++;}return _0x2c6b6a[_0x262987(0xd0)][_0x262987(0x96)](_0x4bfd3a),_0x2c6b6a[_0x262987(0xf7)]['set'](_0x2dcf21,_0x4bfd3a),{'name':_0x4bfd3a,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x555bc6){const _0x4da733=[],_0x5726c8=_0x1e2eb6=>{const _0x2d6ede=a141_0x112e;if(!_0x1e2eb6||typeof _0x1e2eb6!=='object')return;if(Array[_0x2d6ede(0xab)](_0x1e2eb6)){_0x1e2eb6[_0x2d6ede(0xdf)](_0x5726c8);return;}const _0x537b24=_0x1e2eb6;(_0x537b24['type']===_0x2d6ede(0xe2)||_0x537b24['type']===_0x2d6ede(0xe8))&&typeof _0x537b24[_0x2d6ede(0x7f)]===_0x2d6ede(0x129)&&_0x4da733[_0x2d6ede(0x7b)](_0x537b24[_0x2d6ede(0x7f)]);for(const _0x55907b of Object[_0x2d6ede(0xfd)](_0x537b24)){_0x5726c8(_0x55907b);}};return _0x5726c8(_0x555bc6),_0x4da733;}export function validateSegmentRule(_0x43e5c8,_0x5773e6){const _0x53e06c=a141_0x5735a8;if(!_0x5773e6||!_0x5773e6['conditions'])return;for(let _0x14dc3c=0x0;_0x14dc3c<_0x5773e6['conditions'][_0x53e06c(0x120)];_0x14dc3c++){const _0x6a2b8=_0x5773e6['conditions'][_0x14dc3c];if(_0x53e06c(0xfe)in _0x6a2b8&&_0x6a2b8[_0x53e06c(0xfe)]===_0x53e06c(0x11e)){const _0x5449f3=_0x6a2b8,_0xb6e4ea=_0x5449f3[_0x53e06c(0x80)]||_0x5449f3[_0x53e06c(0x93)];if((!_0x5449f3[_0x53e06c(0x7d)]||_0x5449f3[_0x53e06c(0x7d)]==='')&&!_0xb6e4ea)throw new SDKError(ErrorCode[_0x53e06c(0x114)],_0x53e06c(0x8a)+_0x43e5c8+'\x27:\x20'+('conditions['+_0x14dc3c+_0x53e06c(0xae))+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
1
+ const a141_0x5b1b60=a141_0x1ec6;(function(_0x2bdc4a,_0x2ffc2b){const _0x55bae1=a141_0x1ec6,_0x319862=_0x2bdc4a();while(!![]){try{const _0x5d6e62=parseInt(_0x55bae1(0x229))/0x1*(-parseInt(_0x55bae1(0x273))/0x2)+parseInt(_0x55bae1(0x241))/0x3*(parseInt(_0x55bae1(0x1ed))/0x4)+-parseInt(_0x55bae1(0x23d))/0x5+parseInt(_0x55bae1(0x1ee))/0x6+-parseInt(_0x55bae1(0x217))/0x7+-parseInt(_0x55bae1(0x202))/0x8*(-parseInt(_0x55bae1(0x221))/0x9)+parseInt(_0x55bae1(0x1f6))/0xa*(parseInt(_0x55bae1(0x267))/0xb);if(_0x5d6e62===_0x2ffc2b)break;else _0x319862['push'](_0x319862['shift']());}catch(_0x2581e1){_0x319862['push'](_0x319862['shift']());}}}(a141_0x11b6,0xccbca));function a141_0x1ec6(_0x4afb60,_0x2558d8){_0x4afb60=_0x4afb60-0x1d2;const _0x11b6db=a141_0x11b6();let _0x1ec6ea=_0x11b6db[_0x4afb60];return _0x1ec6ea;}import*as a141_0x3d3e4a from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a141_0x5b1b60(0x226),'hourly':a141_0x5b1b60(0x1f9),'weekly':a141_0x5b1b60(0x246),'monthly':a141_0x5b1b60(0x250),'minutes_interval':a141_0x5b1b60(0x262)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':'daily','hour':a141_0x5b1b60(0x1f5),'week':a141_0x5b1b60(0x247),'month':a141_0x5b1b60(0x26f),'minute':a141_0x5b1b60(0x282)};function filterRuleAsRuleDef(_0x4e2dd8){return _0x4e2dd8;}function ruleDefAsFilterRule(_0x3824c6){return _0x3824c6;}export function segmentResponseToDefSync(_0x538cb5,_0x458a16){const _0xa261c6=a141_0x5b1b60,_0x3bebf8=_0x538cb5[_0xa261c6(0x1fe)]&&_0xa261c6(0x1e4)in _0x538cb5['rule']&&_0x538cb5['rule'][_0xa261c6(0x1e4)];return{'type':_0xa261c6(0x22e),'name':_0x538cb5[_0xa261c6(0x21d)],..._0x538cb5[_0xa261c6(0x268)]&&{'description':_0x538cb5['description']},..._0x458a16&&{'folder':_0x458a16},..._0x3bebf8&&{'rule':apiRuleToYaml(_0x538cb5[_0xa261c6(0x1fe)])},..._0x538cb5[_0xa261c6(0x1e1)]!==undefined&&{'kind':_0x538cb5[_0xa261c6(0x1e1)]===0x0?_0xa261c6(0x21a):_0x538cb5['kind']===0x1?_0xa261c6(0x25b):_0xa261c6(0x20f)},..._0x538cb5[_0xa261c6(0x27c)]!==undefined&&{'visible':_0x538cb5[_0xa261c6(0x27c)]}};}export async function segmentResponseToDef(_0x5b66c2,_0x4e3c3f,_0x7381c8){const _0x42830b=a141_0x5b1b60,_0x4f9aca=segmentResponseToDefSync(_0x5b66c2,_0x7381c8);if(!_0x4e3c3f||!_0x4e3c3f[_0x42830b(0x204)])return _0x4f9aca;return _0x4f9aca[_0x42830b(0x1fe)]&&(_0x4f9aca[_0x42830b(0x1fe)]=await resolveRuleSegmentRefs(_0x4f9aca['rule'],_0x4e3c3f[_0x42830b(0x204)])),_0x4f9aca;}export function apiRuleToYaml(_0x3d76c4){const _0x1ea73c=a141_0x5b1b60,_0x1e98c6=(_0x3d76c4[_0x1ea73c(0x277)]||[])[_0x1ea73c(0x25d)](_0x2ece44=>{const _0x316f0e=_0x1ea73c,_0x82a726=apiConditionToYaml(_0x2ece44);if(isCompositeType(_0x82a726)&&_0x82a726[_0x316f0e(0x268)]!==undefined){const _0x38db23=_0x82a726;if(_0x38db23['conditions'][_0x316f0e(0x228)]===0x1)return _0x38db23[_0x316f0e(0x277)];return[{'type':_0x38db23[_0x316f0e(0x1e4)],'conditions':_0x38db23[_0x316f0e(0x277)]}];}return[_0x82a726];});if(_0x1e98c6['length']===0x1&&!_0x3d76c4[_0x1ea73c(0x268)]&&isCompositeType(_0x1e98c6[0x0])){const _0x30e617=_0x1e98c6[0x0];if(_0x30e617[_0x1ea73c(0x1e4)]===_0x3d76c4['type']&&_0x30e617[_0x1ea73c(0x277)]&&_0x30e617[_0x1ea73c(0x268)]===undefined)return{'type':_0x3d76c4[_0x1ea73c(0x1e4)],'conditions':_0x30e617[_0x1ea73c(0x277)]};}return{'type':_0x3d76c4[_0x1ea73c(0x1e4)],'conditions':_0x1e98c6};}export async function resolveRuleSegmentRefs(_0x84df3,_0x8b149b){const _0x5c7942=a141_0x5b1b60;return transformRuleSegmentRefs(_0x84df3,_0x8b149b,_0x533da3=>/^\d+$/[_0x5c7942(0x220)](_0x533da3));}async function transformConditionSegmentRefs(_0x5a5d8a,_0x26f048,_0x4c59ea,_0x38cb10){const _0x475730=a141_0x5b1b60;if(_0x475730(0x22e)in _0x5a5d8a&&(_0x5a5d8a[_0x475730(0x1e4)]===_0x475730(0x27a)||_0x5a5d8a[_0x475730(0x1e4)]===_0x475730(0x207))){const _0x309ddd=_0x5a5d8a;if(_0x4c59ea(_0x309ddd[_0x475730(0x22e)]))return{..._0x309ddd,'segment':await _0x26f048(_0x309ddd[_0x475730(0x22e)])};return _0x5a5d8a;}if(_0x475730(0x277)in _0x5a5d8a&&_0x5a5d8a[_0x475730(0x277)]){const _0x4f0527=_0x5a5d8a,_0x577609=await Promise['all'](_0x4f0527[_0x475730(0x277)][_0x475730(0x1eb)](_0x48a832=>transformConditionSegmentRefs(_0x48a832,_0x26f048,_0x4c59ea,_0x38cb10)));return{..._0x4f0527,'conditions':_0x577609};}if(_0x475730(0x272)in _0x5a5d8a&&_0x5a5d8a[_0x475730(0x272)]){const _0x2fc0a3=_0x5a5d8a,_0x16296e=await _0x38cb10(filterRuleAsRuleDef(_0x2fc0a3[_0x475730(0x272)]),_0x26f048);return{..._0x2fc0a3,'filter':ruleDefAsFilterRule(_0x16296e)};}return _0x5a5d8a;}async function transformRuleSegmentRefs(_0xfcd7fa,_0x1f6dec,_0x2d15ec){const _0x317ca6=a141_0x5b1b60,_0x2d66cc=(_0x3a00fc,_0x30cb32)=>transformRuleSegmentRefs(_0x3a00fc,_0x30cb32,_0x2d15ec),_0x3b9b59=await Promise['all'](_0xfcd7fa[_0x317ca6(0x277)][_0x317ca6(0x1eb)](_0x405620=>transformConditionSegmentRefs(_0x405620,_0x1f6dec,_0x2d15ec,_0x2d66cc)));return{..._0xfcd7fa,'conditions':_0x3b9b59};}export async function resolveRuleSegmentIds(_0x2ef8d8,_0xbb9a13){const _0x2aa9d1=a141_0x5b1b60;return transformRuleSegmentRefs(_0x2ef8d8,_0xbb9a13,_0x404fc9=>!/^\d+$/[_0x2aa9d1(0x220)](_0x404fc9));}function isCompositeType(_0x26b7d7){return _0x26b7d7['type']==='And'||_0x26b7d7['type']==='Or';}function isBehaviorApiCondition(_0x5f4106){const _0x31e67e=a141_0x5b1b60;if(!_0x5f4106['leftValue']?.['source']?.[_0x31e67e(0x21d)])return![];return!![];}function apiConditionToYaml(_0x56d624){const _0x1ea9a9=a141_0x5b1b60;if(_0x56d624[_0x1ea9a9(0x1e4)]===_0x1ea9a9(0x244)||_0x56d624[_0x1ea9a9(0x1e4)]==='Or'){if(_0x56d624[_0x1ea9a9(0x277)]){const _0x4a5f4d=_0x56d624[_0x1ea9a9(0x277)]['map'](apiConditionToYaml),_0x493e65=_0x56d624[_0x1ea9a9(0x268)]!==undefined;if(_0x4a5f4d[_0x1ea9a9(0x228)]===0x1&&!_0x493e65)return _0x4a5f4d[0x0];return{'type':_0x56d624[_0x1ea9a9(0x1e4)],'conditions':_0x4a5f4d,..._0x56d624['description']!==undefined&&{'description':_0x56d624['description']}};}}if(_0x56d624[_0x1ea9a9(0x1e4)]===_0x1ea9a9(0x243)&&_0x56d624[_0x1ea9a9(0x208)]&&_0x56d624['operator']){const _0x284cbf=_0x56d624[_0x1ea9a9(0x208)][_0x1ea9a9(0x1e8)]?buildAggregationDefFromApi(_0x56d624[_0x1ea9a9(0x208)][_0x1ea9a9(0x1e8)]):undefined;if(isBehaviorApiCondition(_0x56d624)){const _0x224ee1=_0x56d624['leftValue'][_0x1ea9a9(0x1f0)]['name'];return{'type':'Behavior','attribute':'','operator':apiOperatorToYaml(_0x56d624[_0x1ea9a9(0x24b)]),..._0x56d624['arrayMatching']&&_0x56d624[_0x1ea9a9(0x23a)]!==_0x1ea9a9(0x245)?{'arrayMatching':_0x56d624[_0x1ea9a9(0x23a)]}:{},..._0x56d624['exclude']?{'exclude':_0x56d624['exclude']}:{},..._0x284cbf?{'aggregation':_0x284cbf}:{},'source':_0x224ee1,..._0x56d624[_0x1ea9a9(0x208)][_0x1ea9a9(0x272)]?{'filter':apiRuleToYaml(_0x56d624[_0x1ea9a9(0x208)][_0x1ea9a9(0x272)])}:{},..._0x56d624[_0x1ea9a9(0x22b)]!==undefined&&_0x56d624[_0x1ea9a9(0x22b)]!==null?{'limit':_0x56d624[_0x1ea9a9(0x22b)]}:{}};}return{'type':'Value','attribute':_0x56d624['leftValue'][_0x1ea9a9(0x21d)]||'','operator':apiOperatorToYaml(_0x56d624['operator']),..._0x56d624[_0x1ea9a9(0x23a)]&&_0x56d624['arrayMatching']!==_0x1ea9a9(0x245)?{'arrayMatching':_0x56d624[_0x1ea9a9(0x23a)]}:{},..._0x56d624[_0x1ea9a9(0x207)]?{'exclude':_0x56d624[_0x1ea9a9(0x207)]}:{},..._0x284cbf?{'aggregation':_0x284cbf}:{},..._0x56d624[_0x1ea9a9(0x208)]['filter']?{'filter':apiRuleToYaml(_0x56d624[_0x1ea9a9(0x208)][_0x1ea9a9(0x272)])}:{},..._0x56d624[_0x1ea9a9(0x22b)]!==undefined&&_0x56d624['limit']!==null?{'limit':_0x56d624[_0x1ea9a9(0x22b)]}:{}};}if(_0x56d624[_0x1ea9a9(0x1e4)]==='Column'&&_0x56d624[_0x1ea9a9(0x1e6)]&&_0x56d624['operator'])return{'type':_0x1ea9a9(0x25a),'column':_0x56d624['column'],'operator':apiOperatorToYaml(_0x56d624[_0x1ea9a9(0x24b)])};if(_0x56d624[_0x1ea9a9(0x1e4)]==='Reference'&&_0x56d624['id'])return{'type':_0x56d624[_0x1ea9a9(0x207)]?_0x1ea9a9(0x207):_0x1ea9a9(0x27a),'segment':_0x56d624['id']};return{'type':_0x1ea9a9(0x244),'conditions':[]};}function isTemporalOperator(_0x4cccaf){const _0xa3babe=a141_0x5b1b60;return _0x4cccaf===_0xa3babe(0x24f)||_0x4cccaf===_0xa3babe(0x24d);}function isBetweenOperator(_0x13af0c){const _0x3b7f33=a141_0x5b1b60;return _0x13af0c===_0x3b7f33(0x278);}function getEffectiveValue(_0x52bb80){const _0x5ddcc5=a141_0x5b1b60,_0x196d02=_0x52bb80[_0x5ddcc5(0x259)];return _0x52bb80[_0x5ddcc5(0x236)]??_0x196d02;}function parseNumericValue(_0x2fc8a9){const _0x2d2292=a141_0x5b1b60;if(typeof _0x2fc8a9===_0x2d2292(0x281)&&_0x2fc8a9!==null)return _0x2fc8a9;if(_0x2fc8a9==='')return _0x2fc8a9;const _0x475f36=Number(_0x2fc8a9);return Number[_0x2d2292(0x205)](_0x475f36)?_0x475f36:_0x2fc8a9;}function apiOperatorToYaml(_0x1b6c30){const _0x1effb2=a141_0x5b1b60;if(isBetweenOperator(_0x1b6c30[_0x1effb2(0x1e4)]))return{'type':mapApiOperatorType(_0x1b6c30[_0x1effb2(0x1e4)]),..._0x1b6c30[_0x1effb2(0x248)]!==undefined&&{'not':_0x1b6c30[_0x1effb2(0x248)]},..._0x1b6c30[_0x1effb2(0x218)]!==undefined&&{'min':parseNumericValue(_0x1b6c30[_0x1effb2(0x218)])},..._0x1b6c30[_0x1effb2(0x23f)]!==undefined&&{'max':parseNumericValue(_0x1b6c30[_0x1effb2(0x23f)])}};if(_0x1b6c30[_0x1effb2(0x1e4)]===_0x1effb2(0x209))return{'type':_0x1effb2(0x209),..._0x1b6c30[_0x1effb2(0x248)]!==undefined&&{'not':_0x1b6c30['not']},..._0x1b6c30[_0x1effb2(0x201)]!==undefined&&{'duration':_0x1b6c30['duration']},..._0x1b6c30['from']!==undefined&&{'from':_0x1b6c30['from']},..._0x1b6c30[_0x1effb2(0x22f)]!==undefined&&{'reverse':_0x1b6c30[_0x1effb2(0x22f)]}};let _0x521faf;if(_0x1b6c30[_0x1effb2(0x270)]&&_0x1b6c30[_0x1effb2(0x270)]['length']>0x0)_0x521faf=_0x1b6c30[_0x1effb2(0x270)];else{if(_0x1b6c30[_0x1effb2(0x27e)]!==undefined)_0x521faf=_0x1b6c30[_0x1effb2(0x27e)];else isTemporalOperator(_0x1b6c30[_0x1effb2(0x1e4)])&&_0x1b6c30[_0x1effb2(0x236)]!==undefined&&(_0x521faf=_0x1b6c30[_0x1effb2(0x236)]);}return{'type':mapApiOperatorType(_0x1b6c30['type']),..._0x1b6c30[_0x1effb2(0x248)]!==undefined&&{'not':_0x1b6c30['not']},..._0x521faf!==undefined&&{'value':_0x521faf},..._0x1b6c30[_0x1effb2(0x1e2)]!==undefined&&{'unit':_0x1b6c30[_0x1effb2(0x1e2)]}};}function mapApiOperatorType(_0x478d03){return _0x478d03;}export function segmentDefToCreateRequest(_0x37f567,_0x5481d6){const _0x58132f=a141_0x5b1b60,_0x401b52={'name':_0x37f567[_0x58132f(0x21d)]};return _0x37f567[_0x58132f(0x268)]&&(_0x401b52[_0x58132f(0x268)]=_0x37f567['description']),_0x37f567[_0x58132f(0x1fe)]&&(_0x401b52['rule']=yamlRuleToApi(_0x37f567[_0x58132f(0x1fe)])),_0x37f567[_0x58132f(0x1e1)]&&(_0x401b52[_0x58132f(0x1e1)]=_0x37f567[_0x58132f(0x1e1)]==='batch'?0x0:_0x37f567[_0x58132f(0x1e1)]===_0x58132f(0x25b)?0x1:0x2),_0x37f567['visible']!==undefined&&(_0x401b52['isVisible']=_0x37f567['visible']),_0x5481d6&&(_0x401b52[_0x58132f(0x28b)]=_0x5481d6),_0x401b52;}export function segmentDefToUpdateRequest(_0x5bb21e){const _0x5ca0a3=a141_0x5b1b60,_0x2a78d4={'name':_0x5bb21e['name']};return _0x5bb21e['description']!==undefined&&(_0x2a78d4[_0x5ca0a3(0x268)]=_0x5bb21e[_0x5ca0a3(0x268)]),_0x5bb21e['rule']&&(_0x2a78d4['rule']=yamlRuleToApi(_0x5bb21e['rule'])),_0x5bb21e[_0x5ca0a3(0x1e1)]&&(_0x2a78d4['kind']=_0x5bb21e['kind']===_0x5ca0a3(0x21a)?0x0:_0x5bb21e[_0x5ca0a3(0x1e1)]===_0x5ca0a3(0x25b)?0x1:0x2),_0x2a78d4;}export function yamlRuleToApi(_0x5159ef){const _0x3ac99b=a141_0x5b1b60,_0x437188=_0x5159ef[_0x3ac99b(0x277)][_0x3ac99b(0x1eb)](yamlConditionToApi),_0x1d8ac9=_0x437188[_0x3ac99b(0x1e9)](_0x1d7fea=>isCompositeType(_0x1d7fea)&&_0x1d7fea[_0x3ac99b(0x268)]!==undefined);if(!_0x1d8ac9&&_0x437188[_0x3ac99b(0x228)]>0x0){const _0x377a74=[];for(const _0x518f7f of _0x437188){isCompositeType(_0x518f7f)&&_0x518f7f[_0x3ac99b(0x268)]===undefined&&_0x518f7f[_0x3ac99b(0x277)]&&_0x518f7f[_0x3ac99b(0x277)][_0x3ac99b(0x1e9)](_0x3175ea=>!isCompositeType(_0x3175ea))?_0x377a74['push']({'type':_0x518f7f[_0x3ac99b(0x1e4)],'description':'','conditions':_0x518f7f[_0x3ac99b(0x277)]}):_0x377a74[_0x3ac99b(0x1d9)]({'type':'And','description':_0x5159ef['description']||'','conditions':[_0x518f7f]});}return{'type':_0x5159ef[_0x3ac99b(0x1e4)],'conditions':_0x377a74};}return{'type':_0x5159ef[_0x3ac99b(0x1e4)],'conditions':_0x437188,..._0x5159ef[_0x3ac99b(0x268)]&&{'description':_0x5159ef[_0x3ac99b(0x268)]}};}function yamlFilterRuleToApi(_0x4cf0c0){const _0x7a72be=a141_0x5b1b60,_0x16bc1b=_0x4cf0c0[_0x7a72be(0x277)][_0x7a72be(0x1eb)](yamlConditionToApi);return{'type':_0x4cf0c0['type'],'conditions':_0x16bc1b};}function yamlConditionToApi(_0x22c08a){const _0x29a0c5=a141_0x5b1b60;if(_0x29a0c5(0x22e)in _0x22c08a&&(_0x22c08a[_0x29a0c5(0x1e4)]==='include'||_0x22c08a[_0x29a0c5(0x1e4)]===_0x29a0c5(0x207))){const _0x1b91fb=_0x22c08a;return{'type':'Reference','id':_0x1b91fb[_0x29a0c5(0x22e)],'exclude':_0x1b91fb[_0x29a0c5(0x1e4)]==='exclude'};}if(_0x22c08a[_0x29a0c5(0x1e4)]==='And'||_0x22c08a[_0x29a0c5(0x1e4)]==='Or'){const _0x57f146=_0x22c08a;return{'type':_0x57f146[_0x29a0c5(0x1e4)],'conditions':_0x57f146[_0x29a0c5(0x277)][_0x29a0c5(0x1eb)](yamlConditionToApi),..._0x57f146[_0x29a0c5(0x268)]&&{'description':_0x57f146[_0x29a0c5(0x268)]}};}if(_0x29a0c5(0x1e6)in _0x22c08a&&_0x22c08a[_0x29a0c5(0x1e4)]===_0x29a0c5(0x25a)){const _0x29ad12=_0x22c08a;return{'type':_0x29a0c5(0x25a),'column':_0x29ad12[_0x29a0c5(0x1e6)],'operator':yamlOperatorToApi(_0x29ad12[_0x29a0c5(0x24b)])};}const _0x521b37=_0x22c08a,_0x5b8f5f={'type':_0x29a0c5(0x243),'leftValue':buildLeftValue(_0x521b37),'operator':yamlOperatorToApi(_0x521b37[_0x29a0c5(0x24b)]),'exclude':_0x521b37['exclude']??![],'arrayMatching':_0x521b37[_0x29a0c5(0x23a)]??'any'};return _0x521b37[_0x29a0c5(0x22b)]!==undefined&&(_0x5b8f5f['limit']=_0x521b37[_0x29a0c5(0x22b)]),_0x5b8f5f;}function buildAggregationDefFromApi(_0x3e133c){const _0x2dd830=a141_0x5b1b60,_0x55b434=_0x3e133c[_0x2dd830(0x1e4)];if(_0x55b434===_0x2dd830(0x1e7))return{'type':_0x55b434,'columns':_0x3e133c[_0x2dd830(0x22d)]??[]};if(_0x55b434===_0x2dd830(0x27d)||_0x55b434===_0x2dd830(0x20d))return{'type':_0x55b434,'column':_0x3e133c['column']??'','orderColumn':_0x3e133c['orderColumn']??'',..._0x3e133c[_0x2dd830(0x1f1)]&&{'groupingColumns':_0x3e133c[_0x2dd830(0x1f1)]}};if(_0x55b434===_0x2dd830(0x1f8))return{'type':_0x55b434,..._0x3e133c[_0x2dd830(0x1f1)]&&{'groupingColumns':_0x3e133c[_0x2dd830(0x1f1)]}};return{'type':_0x55b434,'column':_0x3e133c[_0x2dd830(0x1e6)]??'',..._0x3e133c[_0x2dd830(0x1f1)]&&{'groupingColumns':_0x3e133c[_0x2dd830(0x1f1)]}};}function buildLeftValue(_0x160666){const _0x5504ab=a141_0x5b1b60,_0x22eb2c={};_0x160666[_0x5504ab(0x1d7)]&&_0x160666['type']!==_0x5504ab(0x26e)&&(_0x22eb2c[_0x5504ab(0x21d)]=_0x160666[_0x5504ab(0x1d7)]);if(_0x160666['aggregation']){const _0x2d37bb=_0x160666[_0x5504ab(0x1e8)];if(_0x2d37bb[_0x5504ab(0x1e4)]==='CountDistinct')_0x22eb2c[_0x5504ab(0x1e8)]={'type':'CountDistinct','columns':_0x2d37bb['columns']};else{if(_0x2d37bb[_0x5504ab(0x1e4)]===_0x5504ab(0x27d)||_0x2d37bb['type']===_0x5504ab(0x20d))_0x22eb2c[_0x5504ab(0x1e8)]={'type':_0x2d37bb[_0x5504ab(0x1e4)],'column':_0x2d37bb[_0x5504ab(0x1e6)],'orderColumn':_0x2d37bb['orderColumn'],..._0x2d37bb['groupingColumns']&&{'groupingColumns':_0x2d37bb[_0x5504ab(0x1f1)]}};else _0x2d37bb['type']===_0x5504ab(0x1f8)?_0x22eb2c['aggregation']={'type':'Count',..._0x2d37bb[_0x5504ab(0x1f1)]&&{'groupingColumns':_0x2d37bb[_0x5504ab(0x1f1)]}}:_0x22eb2c[_0x5504ab(0x1e8)]={'type':_0x2d37bb[_0x5504ab(0x1e4)],'column':_0x2d37bb['column'],..._0x2d37bb[_0x5504ab(0x1f1)]&&{'groupingColumns':_0x2d37bb[_0x5504ab(0x1f1)]}};}}return _0x160666[_0x5504ab(0x1f0)]&&(_0x22eb2c[_0x5504ab(0x1f0)]={'name':_0x160666['source']}),_0x160666[_0x5504ab(0x272)]&&(_0x22eb2c[_0x5504ab(0x272)]=yamlFilterRuleToApi(filterRuleAsRuleDef(_0x160666[_0x5504ab(0x272)]))),_0x22eb2c;}function yamlOperatorToApi(_0x1a38f3){const _0x212229=a141_0x5b1b60,_0x1333b5={'type':mapYamlOperatorType(_0x1a38f3[_0x212229(0x1e4)]),'not':_0x1a38f3[_0x212229(0x248)]??![]};if(isBetweenOperator(_0x1a38f3[_0x212229(0x1e4)]))return _0x1a38f3[_0x212229(0x1da)]!==undefined&&(_0x1333b5[_0x212229(0x218)]=typeof _0x1a38f3[_0x212229(0x1da)]==='object'?_0x1a38f3[_0x212229(0x1da)]:String(_0x1a38f3['min'])),_0x1a38f3[_0x212229(0x24e)]!==undefined&&(_0x1333b5[_0x212229(0x23f)]=typeof _0x1a38f3[_0x212229(0x24e)]===_0x212229(0x281)?_0x1a38f3[_0x212229(0x24e)]:String(_0x1a38f3['max'])),_0x1333b5;if(_0x1a38f3[_0x212229(0x1e4)]===_0x212229(0x209))return _0x1a38f3['duration']&&(_0x1333b5[_0x212229(0x201)]=_0x1a38f3[_0x212229(0x201)]),_0x1a38f3[_0x212229(0x214)]&&(_0x1333b5[_0x212229(0x214)]=_0x1a38f3[_0x212229(0x214)]),_0x1a38f3[_0x212229(0x22f)]!==undefined&&(_0x1333b5[_0x212229(0x22f)]=_0x1a38f3[_0x212229(0x22f)]),_0x1333b5;const _0x4f444f=getEffectiveValue(_0x1a38f3);if(_0x4f444f!==undefined){if(Array[_0x212229(0x254)](_0x4f444f))_0x1333b5[_0x212229(0x270)]=_0x4f444f;else isTemporalOperator(_0x1a38f3[_0x212229(0x1e4)])?_0x1333b5[_0x212229(0x236)]=_0x4f444f:_0x1333b5[_0x212229(0x27e)]=_0x4f444f;}return _0x1a38f3['unit']&&(_0x1333b5[_0x212229(0x1e2)]=_0x1a38f3[_0x212229(0x1e2)]),_0x1333b5;}function mapYamlOperatorType(_0x114af1){return _0x114af1;}export function toYamlString(_0x291d69){const _0x26d499=a141_0x5b1b60,_0x5eddf2=JSON[_0x26d499(0x264)](JSON['stringify'](_0x291d69)),_0x3621e6=a141_0x3d3e4a[_0x26d499(0x258)](_0x5eddf2,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x1152ef=[_0x26d499(0x266)];let _0x538409=_0x3621e6;for(const _0x20008a of _0x1152ef){_0x538409=_0x538409[_0x26d499(0x26b)](new RegExp('^('+_0x20008a+')','m'),(_0x28112d,_0x13bec5,_0x4cfede)=>{if(_0x4cfede===0x0||_0x538409[_0x4cfede-0x1]==='\x0a'&&_0x538409[_0x4cfede-0x2]==='\x0a')return _0x13bec5;return'\x0a'+_0x13bec5;});}return _0x538409;}export function parseYamlString(_0x539eb8){return parseSegmentYamlFile(_0x539eb8);}export function isSegmentYaml(_0x2a7a97){const _0x23e8b3=a141_0x5b1b60;if(typeof _0x2a7a97!==_0x23e8b3(0x281)||_0x2a7a97===null)return![];const _0x47cb7f=_0x2a7a97;return _0x47cb7f[_0x23e8b3(0x1e4)]===_0x23e8b3(0x22e)||_0x47cb7f[_0x23e8b3(0x1e4)]===undefined;}export function generateTemplate(_0x4233d3='New\x20Segment'){const _0x80b4a1=a141_0x5b1b60,_0x260a9b={'type':_0x80b4a1(0x22e),'name':_0x4233d3,'description':_0x80b4a1(0x28a),'rule':{'type':_0x80b4a1(0x244),'conditions':[{'type':'Value','attribute':_0x80b4a1(0x203),'operator':{'type':_0x80b4a1(0x242),'value':_0x80b4a1(0x236)}}]}};return toYamlString(_0x260a9b);}export function segmentToYamlString(_0x2a4f5d){const _0x20f4b9=a141_0x5b1b60,_0x406351=JSON[_0x20f4b9(0x264)](JSON[_0x20f4b9(0x258)](_0x2a4f5d)),_0x43e30c=a141_0x3d3e4a[_0x20f4b9(0x258)](_0x406351,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x15c528=['rule:',_0x20f4b9(0x239)];let _0x33f01c=_0x43e30c;for(const _0x438976 of _0x15c528){_0x33f01c=_0x33f01c['replace'](new RegExp('^('+_0x438976+')','m'),(_0x1fb2a6,_0x3217e8,_0x4b6539)=>{if(_0x4b6539===0x0||_0x33f01c[_0x4b6539-0x1]==='\x0a'&&_0x33f01c[_0x4b6539-0x2]==='\x0a')return _0x3217e8;return'\x0a'+_0x3217e8;});}return _0x33f01c;}export function parseSegmentYamlFile(_0x3d5f1d){return safeParseYaml(_0x3d5f1d,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x2792f0){const _0x4c942d=a141_0x5b1b60;return{'type':_0x4c942d(0x22e),'name':_0x2792f0[_0x4c942d(0x21d)],..._0x2792f0['description']!==undefined&&{'description':_0x2792f0[_0x4c942d(0x268)]},..._0x2792f0[_0x4c942d(0x233)]!==undefined&&{'folder':_0x2792f0[_0x4c942d(0x233)]},..._0x2792f0['rule']&&{'rule':normalizeRule(_0x2792f0['rule'])},..._0x2792f0[_0x4c942d(0x1e1)]!==undefined&&{'kind':_0x2792f0[_0x4c942d(0x1e1)]},..._0x2792f0[_0x4c942d(0x288)]!==undefined&&{'visible':_0x2792f0[_0x4c942d(0x288)]},..._0x2792f0[_0x4c942d(0x289)]&&{'activations':_0x2792f0[_0x4c942d(0x289)][_0x4c942d(0x1eb)](normalizeActivation)}};}export function normalizeRule(_0x1367f2){const _0x489191=a141_0x5b1b60;return{'type':_0x1367f2['type'],'conditions':_0x1367f2[_0x489191(0x277)]['map'](normalizeCondition),..._0x1367f2[_0x489191(0x268)]!==undefined&&{'description':_0x1367f2[_0x489191(0x268)]}};}function normalizeCondition(_0x4ad9e7){const _0x6246ae=a141_0x5b1b60;if('segment'in _0x4ad9e7&&(_0x4ad9e7[_0x6246ae(0x1e4)]===_0x6246ae(0x27a)||_0x4ad9e7[_0x6246ae(0x1e4)]==='exclude')){const _0x1d7118=_0x4ad9e7;return{'type':_0x1d7118[_0x6246ae(0x1e4)],'segment':_0x1d7118['segment']};}if(_0x4ad9e7[_0x6246ae(0x1e4)]===_0x6246ae(0x244)||_0x4ad9e7[_0x6246ae(0x1e4)]==='Or'){const _0x454482=_0x4ad9e7;return{'type':_0x454482['type'],'conditions':_0x454482[_0x6246ae(0x277)]['map'](normalizeCondition),..._0x454482[_0x6246ae(0x268)]!==undefined&&{'description':_0x454482['description']}};}if(_0x6246ae(0x1e6)in _0x4ad9e7&&_0x4ad9e7[_0x6246ae(0x1e4)]===_0x6246ae(0x25a)){const _0x28a7ea=_0x4ad9e7;return{'type':_0x6246ae(0x25a),'column':_0x28a7ea[_0x6246ae(0x1e6)],'operator':normalizeOperator(_0x28a7ea['operator'])};}if(_0x4ad9e7[_0x6246ae(0x1e4)]===_0x6246ae(0x26e)){const _0x12bc8d=_0x4ad9e7;return{'type':_0x6246ae(0x26e),'attribute':_0x12bc8d[_0x6246ae(0x1d7)],'operator':normalizeOperator(_0x12bc8d[_0x6246ae(0x24b)]),..._0x12bc8d[_0x6246ae(0x23a)]!==undefined&&{'arrayMatching':_0x12bc8d[_0x6246ae(0x23a)]},..._0x12bc8d[_0x6246ae(0x207)]!==undefined&&{'exclude':_0x12bc8d[_0x6246ae(0x207)]},..._0x12bc8d['aggregation']!==undefined&&{'aggregation':_0x12bc8d['aggregation']},..._0x12bc8d[_0x6246ae(0x1f0)]!==undefined&&{'source':_0x12bc8d[_0x6246ae(0x1f0)]},..._0x12bc8d['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x12bc8d[_0x6246ae(0x272)])))},..._0x12bc8d[_0x6246ae(0x22a)]!==undefined&&{'timeWindow':_0x12bc8d['timeWindow']},..._0x12bc8d[_0x6246ae(0x22b)]!==undefined&&{'limit':_0x12bc8d[_0x6246ae(0x22b)]}};}const _0x32956b=_0x4ad9e7;return{'type':'Value','attribute':_0x32956b['attribute'],'operator':normalizeOperator(_0x32956b[_0x6246ae(0x24b)]),..._0x32956b[_0x6246ae(0x23a)]!==undefined&&{'arrayMatching':_0x32956b[_0x6246ae(0x23a)]},..._0x32956b[_0x6246ae(0x207)]!==undefined&&{'exclude':_0x32956b['exclude']},..._0x32956b[_0x6246ae(0x1e8)]!==undefined&&{'aggregation':_0x32956b['aggregation']},..._0x32956b['source']!==undefined&&{'source':_0x32956b[_0x6246ae(0x1f0)]},..._0x32956b[_0x6246ae(0x272)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x32956b[_0x6246ae(0x272)])))},..._0x32956b[_0x6246ae(0x22b)]!==undefined&&{'limit':_0x32956b[_0x6246ae(0x22b)]}};}function normalizeOperator(_0x394179){const _0x3f54cb=a141_0x5b1b60;if(isBetweenOperator(_0x394179['type']))return{'type':_0x394179[_0x3f54cb(0x1e4)],..._0x394179[_0x3f54cb(0x248)]!==undefined&&{'not':_0x394179[_0x3f54cb(0x248)]},..._0x394179[_0x3f54cb(0x1da)]!==undefined&&{'min':_0x394179[_0x3f54cb(0x1da)]},..._0x394179[_0x3f54cb(0x24e)]!==undefined&&{'max':_0x394179[_0x3f54cb(0x24e)]}};const _0xf047ff=getEffectiveValue(_0x394179);return{'type':_0x394179[_0x3f54cb(0x1e4)],..._0x394179[_0x3f54cb(0x248)]!==undefined&&{'not':_0x394179['not']},..._0xf047ff!==undefined&&{'value':_0xf047ff},..._0x394179[_0x3f54cb(0x1e2)]!==undefined&&{'unit':_0x394179['unit']},..._0x394179[_0x3f54cb(0x201)]!==undefined&&{'duration':_0x394179[_0x3f54cb(0x201)]},..._0x394179[_0x3f54cb(0x214)]!==undefined&&{'from':_0x394179[_0x3f54cb(0x214)]},..._0x394179[_0x3f54cb(0x22f)]!==undefined&&{'reverse':_0x394179[_0x3f54cb(0x22f)]}};}function normalizeActivation(_0x488595){const _0x23ab53=a141_0x5b1b60;return{'name':_0x488595[_0x23ab53(0x21d)],'connection':_0x488595[_0x23ab53(0x279)],..._0x488595[_0x23ab53(0x268)]!==undefined&&{'description':_0x488595[_0x23ab53(0x268)]},..._0x488595[_0x23ab53(0x20e)]!==undefined&&{'all_columns':_0x488595[_0x23ab53(0x20e)]},..._0x488595[_0x23ab53(0x22d)]!==undefined&&{'columns':_0x488595[_0x23ab53(0x22d)]},..._0x488595[_0x23ab53(0x284)]!==undefined&&{'behavior':_0x488595[_0x23ab53(0x284)]},..._0x488595[_0x23ab53(0x216)]!==undefined&&{'schedule':_0x488595[_0x23ab53(0x216)]},..._0x488595[_0x23ab53(0x237)]!==undefined&&{'notification':_0x488595[_0x23ab53(0x237)]},..._0x488595[_0x23ab53(0x219)]!==undefined&&{'connector_config':_0x488595[_0x23ab53(0x219)]},..._0x488595['activation_template_id']!==undefined&&{'activation_template_id':_0x488595['activation_template_id']},..._0x488595['nested_workflow_project_name']!==undefined&&{'nested_workflow_project_name':_0x488595['nested_workflow_project_name']},..._0x488595[_0x23ab53(0x257)]!==undefined&&{'nested_workflow_name':_0x488595['nested_workflow_name']},..._0x488595[_0x23ab53(0x280)]!==undefined&&{'lock_enabled':_0x488595[_0x23ab53(0x280)]}};}function getColumnName(_0x561f15){const _0x21f1b7=a141_0x5b1b60;return _0x561f15[_0x21f1b7(0x1e6)]||_0x561f15[_0x21f1b7(0x21d)];}export function activationResponseToDef(_0x8690ea,_0x271b80,_0x543362){const _0x1b4e69=a141_0x5b1b60,_0x33b8a6=_0x8690ea[_0x1b4e69(0x240)]||'',_0x3378ba=_0x543362?.[_0x1b4e69(0x21f)](_0x33b8a6)??_0x33b8a6,_0x5d69ed={'name':_0x8690ea[_0x1b4e69(0x21d)],'connection':_0x3378ba};_0x8690ea[_0x1b4e69(0x268)]&&(_0x5d69ed[_0x1b4e69(0x268)]=_0x8690ea[_0x1b4e69(0x268)]);let _0x8578ae=[];_0x8690ea[_0x1b4e69(0x22d)]&&_0x8690ea['columns'][_0x1b4e69(0x228)]>0x0&&(_0x8578ae=_0x8690ea[_0x1b4e69(0x22d)][_0x1b4e69(0x272)](_0x8d55a5=>_0x8d55a5&&getColumnName(_0x8d55a5))[_0x1b4e69(0x1eb)](_0x519439=>{const _0x3bfa5b=_0x1b4e69,_0x2ca144=getColumnName(_0x519439);if(_0x519439[_0x3bfa5b(0x1e4)]||_0x519439[_0x3bfa5b(0x222)])return{'name':_0x2ca144,..._0x519439[_0x3bfa5b(0x1e4)]&&{'type':_0x519439[_0x3bfa5b(0x1e4)]},..._0x519439[_0x3bfa5b(0x222)]&&{'visibility':_0x519439[_0x3bfa5b(0x222)]}};return _0x2ca144;}));_0x8578ae['length']>0x0&&(_0x5d69ed[_0x1b4e69(0x22d)]=_0x8578ae);_0x8690ea['allColumns']!==undefined&&(_0x8690ea['allColumns']===![]&&_0x8578ae['length']===0x0?_0x5d69ed[_0x1b4e69(0x20e)]=!![]:_0x5d69ed[_0x1b4e69(0x20e)]=_0x8690ea[_0x1b4e69(0x21b)]);const _0x3b7aab={};let _0x1b16fc=![];_0x8690ea[_0x1b4e69(0x27b)]&&(_0x3b7aab[_0x1b4e69(0x1e4)]=_0x8690ea[_0x1b4e69(0x27b)],_0x1b16fc=!![]);_0x8690ea[_0x1b4e69(0x230)]&&(_0x3b7aab[_0x1b4e69(0x25e)]=_0x8690ea[_0x1b4e69(0x230)],_0x1b16fc=!![]);_0x8690ea[_0x1b4e69(0x213)]!==undefined&&_0x8690ea[_0x1b4e69(0x213)]!==null&&(_0x3b7aab[_0x1b4e69(0x261)]=_0x8690ea[_0x1b4e69(0x213)],_0x1b16fc=!![]);_0x8690ea['repeatSubFrequency']&&_0x8690ea[_0x1b4e69(0x283)]['length']>0x0&&(_0x3b7aab[_0x1b4e69(0x275)]=_0x8690ea[_0x1b4e69(0x283)],_0x1b16fc=!![]);_0x8690ea['startAt']!==undefined&&(_0x3b7aab['start_at']=_0x8690ea[_0x1b4e69(0x223)],_0x1b16fc=!![]);_0x8690ea[_0x1b4e69(0x249)]!==undefined&&(_0x3b7aab[_0x1b4e69(0x224)]=_0x8690ea[_0x1b4e69(0x249)],_0x1b16fc=!![]);_0x8690ea[_0x1b4e69(0x234)]&&(_0x3b7aab['timezone']=_0x8690ea[_0x1b4e69(0x234)],_0x1b16fc=!![]);_0x1b16fc&&(_0x5d69ed['schedule']=_0x3b7aab);(_0x8690ea[_0x1b4e69(0x206)]&&_0x8690ea[_0x1b4e69(0x206)][_0x1b4e69(0x228)]>0x0||_0x8690ea[_0x1b4e69(0x24a)]&&_0x8690ea[_0x1b4e69(0x24a)]['length']>0x0)&&(_0x5d69ed[_0x1b4e69(0x237)]={},_0x8690ea[_0x1b4e69(0x206)]&&_0x8690ea[_0x1b4e69(0x206)][_0x1b4e69(0x228)]>0x0&&(_0x5d69ed[_0x1b4e69(0x237)][_0x1b4e69(0x1ef)]=_0x8690ea[_0x1b4e69(0x206)]),_0x8690ea[_0x1b4e69(0x24a)]&&_0x8690ea[_0x1b4e69(0x24a)]['length']>0x0&&(_0x5d69ed[_0x1b4e69(0x237)][_0x1b4e69(0x212)]=_0x8690ea[_0x1b4e69(0x24a)][_0x1b4e69(0x1eb)](_0x31238a=>{const _0x19b565=_0x1b4e69,_0xf3575=_0x271b80?.[_0x19b565(0x21f)](_0x31238a);return _0xf3575??String(_0x31238a);})));_0x8690ea['connectorConfig']&&Object[_0x1b4e69(0x225)](_0x8690ea[_0x1b4e69(0x1f3)])['length']>0x0&&(_0x5d69ed['connector_config']=normalizeConnectorConfigForYaml(_0x8690ea[_0x1b4e69(0x1f3)]));_0x8690ea['activationTemplateId']&&(_0x5d69ed['activation_template_id']=_0x8690ea[_0x1b4e69(0x1df)]);if(_0x8690ea[_0x1b4e69(0x1dd)]){const _0x446acd={},_0x42d1c2=_0x8690ea['syndicationBehavior'];_0x42d1c2[_0x1b4e69(0x22d)]&&_0x42d1c2['columns']['length']>0x0&&(_0x446acd[_0x1b4e69(0x22d)]=_0x42d1c2[_0x1b4e69(0x22d)]['filter'](_0x187c75=>_0x187c75&&getColumnName(_0x187c75))[_0x1b4e69(0x1eb)](_0x13cb8d=>({'name':getColumnName(_0x13cb8d),..._0x13cb8d['type']&&{'type':_0x13cb8d[_0x1b4e69(0x1e4)]},..._0x13cb8d['visibility']&&{'visibility':_0x13cb8d[_0x1b4e69(0x222)]}}))),_0x42d1c2['behaviorTableName']&&(_0x446acd[_0x1b4e69(0x211)]=_0x42d1c2['behaviorTableName']),_0x42d1c2[_0x1b4e69(0x271)]!==undefined&&(_0x446acd[_0x1b4e69(0x1fc)]=_0x42d1c2['joinRow']),_0x42d1c2[_0x1b4e69(0x21c)]&&(_0x446acd[_0x1b4e69(0x26a)]=_0x42d1c2[_0x1b4e69(0x21c)]),_0x42d1c2[_0x1b4e69(0x1e5)]&&(_0x446acd['formatting']=_0x42d1c2['formatting']),_0x42d1c2['orderBy']&&_0x42d1c2['orderBy'][_0x1b4e69(0x228)]>0x0&&(_0x446acd[_0x1b4e69(0x253)]=_0x42d1c2['orderBy']),Object[_0x1b4e69(0x225)](_0x446acd)['length']>0x0&&(_0x5d69ed[_0x1b4e69(0x284)]=_0x446acd);}return _0x8690ea[_0x1b4e69(0x1f4)]&&(_0x5d69ed[_0x1b4e69(0x269)]=_0x8690ea['nestedWorkflowProjectName']),_0x8690ea['nestedWorkflowName']&&(_0x5d69ed['nested_workflow_name']=_0x8690ea[_0x1b4e69(0x27f)]),_0x8690ea[_0x1b4e69(0x1fd)]!==undefined&&(_0x5d69ed['lock_enabled']=_0x8690ea[_0x1b4e69(0x1fd)]),_0x5d69ed;}export function journeyActivationStepToYaml(_0x460974,_0xc57090,_0x27b158){const _0x2d4935=a141_0x5b1b60,_0x42f125=_0x460974['attributes'][_0x2d4935(0x235)],_0x22ba37=_0x42f125['connectionId']||'',_0x403947=_0x27b158?.[_0x2d4935(0x21f)](_0x22ba37)??_0x22ba37,_0x45228d={'name':_0x42f125['name']||'','connection':_0x403947};_0x460974[_0x2d4935(0x22c)][_0x2d4935(0x255)]&&(_0x45228d[_0x2d4935(0x215)]=!![]);_0x42f125[_0x2d4935(0x268)]&&(_0x45228d[_0x2d4935(0x268)]=_0x42f125[_0x2d4935(0x268)]);let _0x1360bb=[];_0x42f125[_0x2d4935(0x22d)]&&_0x42f125['columns']['length']>0x0&&(_0x1360bb=_0x42f125[_0x2d4935(0x22d)][_0x2d4935(0x272)](_0x53d84f=>_0x53d84f&&getColumnName(_0x53d84f))[_0x2d4935(0x1eb)](_0x52b96a=>{const _0x3bf24d=_0x2d4935,_0x129889=getColumnName(_0x52b96a);if(_0x52b96a['type']||_0x52b96a[_0x3bf24d(0x222)])return{'name':_0x129889,..._0x52b96a[_0x3bf24d(0x1e4)]&&{'type':_0x52b96a[_0x3bf24d(0x1e4)]},..._0x52b96a[_0x3bf24d(0x222)]&&{'visibility':_0x52b96a['visibility']}};return _0x129889;}));_0x1360bb[_0x2d4935(0x228)]>0x0&&(_0x45228d['columns']=_0x1360bb);_0x42f125[_0x2d4935(0x21b)]!==undefined&&(_0x42f125[_0x2d4935(0x21b)]===![]&&_0x1360bb[_0x2d4935(0x228)]===0x0?_0x45228d[_0x2d4935(0x20e)]=!![]:_0x45228d[_0x2d4935(0x20e)]=_0x42f125[_0x2d4935(0x21b)]);const _0x59ca89={};let _0x6561a5=![];_0x42f125[_0x2d4935(0x27b)]&&(_0x59ca89[_0x2d4935(0x1e4)]=_0x42f125[_0x2d4935(0x27b)],_0x6561a5=!![]);_0x42f125['repeatUnit']&&(_0x59ca89[_0x2d4935(0x25e)]=_0x42f125[_0x2d4935(0x230)],_0x6561a5=!![]);_0x42f125[_0x2d4935(0x213)]!==undefined&&_0x42f125[_0x2d4935(0x213)]!==null&&(_0x59ca89['repeat_frequency']=_0x42f125[_0x2d4935(0x213)],_0x6561a5=!![]);_0x42f125['startAt']!==undefined&&(_0x59ca89['start_at']=_0x42f125[_0x2d4935(0x223)],_0x6561a5=!![]);_0x42f125[_0x2d4935(0x249)]!==undefined&&(_0x59ca89[_0x2d4935(0x224)]=_0x42f125['endOn'],_0x6561a5=!![]);_0x42f125[_0x2d4935(0x234)]&&(_0x59ca89[_0x2d4935(0x234)]=_0x42f125['timezone'],_0x6561a5=!![]);_0x6561a5&&(_0x45228d[_0x2d4935(0x216)]=_0x59ca89);(_0x42f125[_0x2d4935(0x206)]&&_0x42f125[_0x2d4935(0x206)][_0x2d4935(0x228)]>0x0||_0x42f125[_0x2d4935(0x24a)]&&_0x42f125[_0x2d4935(0x24a)][_0x2d4935(0x228)]>0x0)&&(_0x45228d[_0x2d4935(0x237)]={},_0x42f125[_0x2d4935(0x206)]&&_0x42f125[_0x2d4935(0x206)][_0x2d4935(0x228)]>0x0&&(_0x45228d['notification'][_0x2d4935(0x1ef)]=_0x42f125[_0x2d4935(0x206)]),_0x42f125['emailRecipients']&&_0x42f125[_0x2d4935(0x24a)][_0x2d4935(0x228)]>0x0&&(_0x45228d[_0x2d4935(0x237)]['email_recipients']=_0x42f125[_0x2d4935(0x24a)][_0x2d4935(0x1eb)](_0x4722eb=>{const _0x5caaaa=_0x2d4935,_0x34d842=_0xc57090?.[_0x5caaaa(0x21f)](_0x4722eb);return _0x34d842??String(_0x4722eb);})));_0x42f125[_0x2d4935(0x1f3)]&&Object[_0x2d4935(0x225)](_0x42f125[_0x2d4935(0x1f3)])['length']>0x0&&(_0x45228d['connector_config']=normalizeConnectorConfigForYaml(_0x42f125[_0x2d4935(0x1f3)]));_0x42f125[_0x2d4935(0x1df)]&&(_0x45228d[_0x2d4935(0x276)]=_0x42f125[_0x2d4935(0x1df)]);if(_0x42f125[_0x2d4935(0x1dd)]){const _0x5167b6={},_0x3e6cea=_0x42f125[_0x2d4935(0x1dd)];_0x3e6cea[_0x2d4935(0x22d)]&&_0x3e6cea[_0x2d4935(0x22d)][_0x2d4935(0x228)]>0x0&&(_0x5167b6['columns']=_0x3e6cea[_0x2d4935(0x22d)]['filter'](_0x50d7bf=>_0x50d7bf&&getColumnName(_0x50d7bf))[_0x2d4935(0x1eb)](_0x141896=>({'name':getColumnName(_0x141896),..._0x141896['type']&&{'type':_0x141896[_0x2d4935(0x1e4)]},..._0x141896[_0x2d4935(0x222)]&&{'visibility':_0x141896[_0x2d4935(0x222)]}}))),_0x3e6cea['behaviorTableName']&&(_0x5167b6[_0x2d4935(0x211)]=_0x3e6cea[_0x2d4935(0x265)]),_0x3e6cea[_0x2d4935(0x271)]!==undefined&&(_0x5167b6[_0x2d4935(0x1fc)]=_0x3e6cea['joinRow']),_0x3e6cea[_0x2d4935(0x21c)]&&(_0x5167b6[_0x2d4935(0x26a)]=_0x3e6cea['joinStrategy']),_0x3e6cea['formatting']&&(_0x5167b6['formatting']=_0x3e6cea[_0x2d4935(0x1e5)]),_0x3e6cea[_0x2d4935(0x287)]&&_0x3e6cea['orderBy'][_0x2d4935(0x228)]>0x0&&(_0x5167b6[_0x2d4935(0x253)]=_0x3e6cea[_0x2d4935(0x287)]),Object['keys'](_0x5167b6)[_0x2d4935(0x228)]>0x0&&(_0x45228d['behavior']=_0x5167b6);}return _0x45228d;}export function segmentWithActivationsToYaml(_0x5dec61,_0x6542e9,_0x22fe91,_0x1efcb9,_0x3d83d3){const _0x1951d5=a141_0x5b1b60,_0x1e377c=segmentResponseToDefSync(_0x5dec61,_0x22fe91);return _0x6542e9[_0x1951d5(0x228)]>0x0&&(_0x1e377c['activations']=_0x6542e9['map'](_0x55a664=>activationResponseToDef(_0x55a664,_0x1efcb9,_0x3d83d3))),_0x1e377c;}function normalizeColumn(_0x4ac44d){const _0x15ebfc=a141_0x5b1b60;if(typeof _0x4ac44d===_0x15ebfc(0x1d5))return{'column':_0x4ac44d,'source':{'column':_0x4ac44d}};return{'column':_0x4ac44d[_0x15ebfc(0x21d)],'source':{'column':_0x4ac44d['name']},..._0x4ac44d['type']&&{'type':_0x4ac44d[_0x15ebfc(0x1e4)]},..._0x4ac44d['visibility']&&{'visibility':_0x4ac44d['visibility']}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object[a141_0x5b1b60(0x225)](ActivationDefSchema[a141_0x5b1b60(0x252)]));export function warnUnrecognizedActivationFields(_0x3c9ceb,_0x27bf04){const _0x8af37a=a141_0x5b1b60,_0x1901e4=Object[_0x8af37a(0x225)](_0x3c9ceb)[_0x8af37a(0x272)](_0x37b760=>!KNOWN_ACTIVATION_FIELDS[_0x8af37a(0x1d8)](_0x37b760));if(_0x1901e4[_0x8af37a(0x228)]>0x0){const _0x53df4a=_0x1901e4['map'](_0x44c6eb=>'\x20\x20-\x20\x22'+_0x44c6eb+'\x22')[_0x8af37a(0x1f7)]('\x0a');console[_0x8af37a(0x23b)](_0x8af37a(0x1e3)+_0x27bf04+_0x8af37a(0x1e0)+_0x53df4a);}}export async function activationDefToCreateRequest(_0x255a96,_0x2e7f58){const _0x1fa14f=a141_0x5b1b60;warnUnrecognizedActivationFields(_0x255a96,_0x255a96[_0x1fa14f(0x21d)]);const _0x13221e=_0x2e7f58?.[_0x1fa14f(0x24c)],_0xacea34=_0x2e7f58?.['connectionNameToIdMap'],_0x10df6b=_0x255a96[_0x1fa14f(0x279)];let _0x5529af;const _0x48e63f=parseInt(_0x10df6b,0xa);if(!isNaN(_0x48e63f)&&String(_0x48e63f)===_0x10df6b)_0x5529af=_0x48e63f;else{const _0x44ad11=_0xacea34?.['get'](_0x10df6b);if(_0x44ad11===undefined)throw new SDKError(ErrorCode[_0x1fa14f(0x260)],_0x1fa14f(0x227)+_0x10df6b,undefined,{'helpText':_0x1fa14f(0x20b)});_0x5529af=_0x44ad11;}const _0x21e7a1={'name':_0x255a96[_0x1fa14f(0x21d)],'connectionId':_0x5529af};_0x255a96[_0x1fa14f(0x268)]&&(_0x21e7a1[_0x1fa14f(0x268)]=_0x255a96[_0x1fa14f(0x268)]);let _0x1b9881=[];_0x255a96[_0x1fa14f(0x22d)]&&_0x255a96['columns'][_0x1fa14f(0x228)]>0x0&&(_0x1b9881=_0x255a96[_0x1fa14f(0x22d)]['filter'](_0x2737a6=>_0x2737a6!=null)[_0x1fa14f(0x1eb)](normalizeColumn));_0x1b9881[_0x1fa14f(0x228)]>0x0&&(_0x21e7a1[_0x1fa14f(0x22d)]=_0x1b9881);_0x255a96[_0x1fa14f(0x20e)]!==undefined&&(_0x255a96[_0x1fa14f(0x20e)]===![]&&_0x1b9881[_0x1fa14f(0x228)]===0x0?_0x21e7a1[_0x1fa14f(0x21b)]=!![]:_0x21e7a1[_0x1fa14f(0x21b)]=_0x255a96[_0x1fa14f(0x20e)]);if(_0x255a96[_0x1fa14f(0x216)]){const _0x4e5ef1=_0x255a96[_0x1fa14f(0x216)],_0x36f457=_0x4e5ef1[_0x1fa14f(0x1e4)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x4e5ef1[_0x1fa14f(0x25e)]];_0x36f457&&(_0x21e7a1[_0x1fa14f(0x27b)]=_0x36f457);const _0x1ac485=_0x4e5ef1[_0x1fa14f(0x25e)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x4e5ef1[_0x1fa14f(0x1e4)]];_0x1ac485&&(_0x21e7a1[_0x1fa14f(0x230)]=_0x1ac485);_0x4e5ef1[_0x1fa14f(0x261)]!==undefined&&(_0x21e7a1['repeatFrequency']=_0x4e5ef1[_0x1fa14f(0x261)]);_0x4e5ef1[_0x1fa14f(0x275)]&&(_0x21e7a1['repeatSubFrequency']=_0x4e5ef1['repeat_sub_frequency']);_0x4e5ef1[_0x1fa14f(0x286)]!==undefined&&(_0x21e7a1[_0x1fa14f(0x223)]=_0x4e5ef1[_0x1fa14f(0x286)]);_0x4e5ef1['end_on']!==undefined&&(_0x21e7a1[_0x1fa14f(0x249)]=_0x4e5ef1[_0x1fa14f(0x224)]);_0x4e5ef1[_0x1fa14f(0x234)]&&(_0x21e7a1[_0x1fa14f(0x234)]=_0x4e5ef1[_0x1fa14f(0x234)]);if(_0x36f457&&_0x36f457!==_0x1fa14f(0x238)&&_0x36f457!==_0x1fa14f(0x263)&&_0x4e5ef1[_0x1fa14f(0x286)]){const _0x1e4ec4=_0x4e5ef1['start_at'][_0x1fa14f(0x1ec)](/T(\d{2}:\d{2})/);_0x1e4ec4&&(_0x21e7a1[_0x1fa14f(0x1d6)]=_0x1e4ec4[0x1]);}}_0x255a96[_0x1fa14f(0x237)]&&(_0x255a96[_0x1fa14f(0x237)][_0x1fa14f(0x1ef)]&&(_0x21e7a1[_0x1fa14f(0x206)]=_0x255a96['notification'][_0x1fa14f(0x1ef)]),_0x255a96[_0x1fa14f(0x237)][_0x1fa14f(0x212)]&&(_0x21e7a1['emailRecipients']=_0x255a96[_0x1fa14f(0x237)][_0x1fa14f(0x212)]['map'](_0x312bcd=>{const _0xef8fd7=_0x1fa14f,_0x17c34d=Number(_0x312bcd);if(!isNaN(_0x17c34d)&&String(_0x17c34d)===_0x312bcd)return _0x17c34d;const _0x2d9047=_0x13221e?.[_0xef8fd7(0x21f)](_0x312bcd[_0xef8fd7(0x1d3)]());if(_0x2d9047===undefined)throw new SDKError(ErrorCode[_0xef8fd7(0x231)],_0xef8fd7(0x1dc)+_0x312bcd+_0xef8fd7(0x232));return _0x2d9047;})));if(_0x255a96[_0x1fa14f(0x219)]){const _0x4261ac=_0x2e7f58?.[_0x1fa14f(0x210)]?.[_0x1fa14f(0x21f)](_0x10df6b);if(_0x4261ac&&_0x2e7f58?.[_0x1fa14f(0x1f2)])try{const _0x2e8bdb=await _0x2e7f58[_0x1fa14f(0x1f2)](_0x4261ac),_0x1b0186=validateConnectorConfig(_0x255a96[_0x1fa14f(0x219)],_0x2e8bdb);if(!_0x1b0186[_0x1fa14f(0x200)])throw new SDKError(ErrorCode[_0x1fa14f(0x23e)],_0x1fa14f(0x20a)+_0x255a96[_0x1fa14f(0x21d)]+'\x22:\x0a'+formatValidationErrors(_0x1b0186['errors']),undefined,{'helpText':'Connector:\x20'+_0x4261ac+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x2e8bdb)});if(_0x1b0186[_0x1fa14f(0x1db)][_0x1fa14f(0x228)]>0x0){const _0x1b9682=formatValidationWarnings(_0x1b0186['warnings']);console[_0x1fa14f(0x23b)]('connector_config\x20for\x20activation\x20\x22'+_0x255a96[_0x1fa14f(0x21d)]+_0x1fa14f(0x256)+_0x1b9682);}_0x21e7a1[_0x1fa14f(0x1f3)]=transformConfigToLegacy(_0x255a96['connector_config'],_0x2e8bdb);}catch(_0x2b27c3){if(_0x2b27c3 instanceof SDKError&&_0x2b27c3[_0x1fa14f(0x1fb)]===ErrorCode[_0x1fa14f(0x1ea)])_0x21e7a1[_0x1fa14f(0x1f3)]=_0x255a96['connector_config'];else throw _0x2b27c3;}else _0x21e7a1[_0x1fa14f(0x1f3)]=_0x255a96['connector_config'];}_0x255a96[_0x1fa14f(0x276)]!==undefined&&(_0x21e7a1[_0x1fa14f(0x1df)]=_0x255a96[_0x1fa14f(0x276)]);if(_0x255a96[_0x1fa14f(0x284)]){const _0x4bc1ef=_0x255a96[_0x1fa14f(0x284)],_0x2aa56e={};if(_0x4bc1ef[_0x1fa14f(0x22d)]&&_0x4bc1ef[_0x1fa14f(0x22d)][_0x1fa14f(0x228)]>0x0){const _0xe0291=_0x4bc1ef[_0x1fa14f(0x22d)][_0x1fa14f(0x272)](_0x17b19d=>_0x17b19d&&_0x17b19d['name'])['map'](normalizeColumn);_0xe0291[_0x1fa14f(0x228)]>0x0&&(_0x2aa56e[_0x1fa14f(0x22d)]=_0xe0291);}_0x4bc1ef['behavior_table']&&(_0x2aa56e[_0x1fa14f(0x265)]=_0x4bc1ef[_0x1fa14f(0x211)]);_0x4bc1ef[_0x1fa14f(0x26a)]&&(_0x2aa56e[_0x1fa14f(0x21c)]=_0x4bc1ef[_0x1fa14f(0x26a)]);if(_0x4bc1ef[_0x1fa14f(0x1fc)]!==undefined)_0x2aa56e[_0x1fa14f(0x271)]=_0x4bc1ef[_0x1fa14f(0x1fc)];else{if(_0x4bc1ef[_0x1fa14f(0x26a)]===_0x1fa14f(0x20d)||_0x4bc1ef[_0x1fa14f(0x26a)]==='First')_0x2aa56e[_0x1fa14f(0x271)]=0x1;else _0x4bc1ef[_0x1fa14f(0x26a)]===_0x1fa14f(0x251)&&(_0x2aa56e[_0x1fa14f(0x271)]=null);}_0x4bc1ef[_0x1fa14f(0x1e5)]&&(_0x2aa56e[_0x1fa14f(0x1e5)]=_0x4bc1ef[_0x1fa14f(0x1e5)]),_0x4bc1ef[_0x1fa14f(0x253)]&&(_0x2aa56e['orderBy']=_0x4bc1ef[_0x1fa14f(0x253)]),_0x21e7a1[_0x1fa14f(0x1dd)]=_0x2aa56e;}return _0x255a96[_0x1fa14f(0x269)]&&(_0x21e7a1[_0x1fa14f(0x1f4)]=_0x255a96['nested_workflow_project_name']),_0x255a96[_0x1fa14f(0x257)]&&(_0x21e7a1[_0x1fa14f(0x27f)]=_0x255a96[_0x1fa14f(0x257)]),_0x255a96[_0x1fa14f(0x280)]!==undefined&&(_0x21e7a1[_0x1fa14f(0x1fd)]=_0x255a96[_0x1fa14f(0x280)]),_0x21e7a1;}export async function activationDefToUpdateRequest(_0x13adaf,_0x585252){return activationDefToCreateRequest(_0x13adaf,_0x585252);}export function deepSortObject(_0x3e2baa){const _0x5a1ca3=a141_0x5b1b60;if(_0x3e2baa===null||typeof _0x3e2baa!==_0x5a1ca3(0x281))return _0x3e2baa;if(Array[_0x5a1ca3(0x254)](_0x3e2baa))return _0x3e2baa[_0x5a1ca3(0x1eb)](deepSortObject)[_0x5a1ca3(0x274)]((_0x621d20,_0x3fabe2)=>JSON['stringify'](_0x621d20)[_0x5a1ca3(0x1d2)](JSON[_0x5a1ca3(0x258)](_0x3fabe2)));const _0x1ceebb={};for(const _0x508924 of Object[_0x5a1ca3(0x225)](_0x3e2baa)[_0x5a1ca3(0x274)]()){_0x1ceebb[_0x508924]=deepSortObject(_0x3e2baa[_0x508924]);}return _0x1ceebb;}export function serializeRule(_0x3066d3){const _0x232194=a141_0x5b1b60;return JSON[_0x232194(0x258)](deepSortObject(_0x3066d3));}export function normalizeRuleForMatching(_0x3e42b5){return normalizeConditionsForMatching(_0x3e42b5);}function normalizeConditionsForMatching(_0x22bf6a){const _0x5c6ca1=a141_0x5b1b60;if(_0x22bf6a===null||typeof _0x22bf6a!==_0x5c6ca1(0x281))return _0x22bf6a;if(Array['isArray'](_0x22bf6a))return _0x22bf6a[_0x5c6ca1(0x1eb)](normalizeConditionsForMatching);const _0x532ae0=_0x22bf6a;if((_0x532ae0[_0x5c6ca1(0x1e4)]===_0x5c6ca1(0x27a)||_0x532ae0[_0x5c6ca1(0x1e4)]==='exclude')&&typeof _0x532ae0['segment']===_0x5c6ca1(0x1d5))return{..._0x532ae0,'segment':_0x5c6ca1(0x21e)};const _0x197a4b={};for(const _0x22bc81 of Object['keys'](_0x532ae0)){_0x197a4b[_0x22bc81]=normalizeConditionsForMatching(_0x532ae0[_0x22bc81]);}return _0x197a4b;}function a141_0x11b6(){const _0x4db7e5=['activations','Segment\x20description','segmentFolderId','localeCompare','toLowerCase','conditions[','string','scheduleOption','attribute','has','push','min','warnings','Unknown\x20email\x20recipient:\x20','syndicationBehavior','ruleHashToName','activationTemplateId','\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a','kind','unit','Warning:\x20activation\x20\x22','type','formatting','column','CountDistinct','aggregation','every','CONNECTOR_SCHEMA_NOT_FOUND','map','match','18428EbSUVl','1313238Gbrtsz','notify_on','source','groupingColumns','getSchema','connectorConfig','nestedWorkflowProjectName','hourly','1570dLUZlk','join','Count','hour','usedNames','code','join_row','lockEnabled','rule','\x27:\x20','valid','duration','24XRXKOl','attribute_name','resolveSegmentName','isFinite','notifyOn','exclude','leftValue','TimeRange','Invalid\x20connector_config\x20for\x20activation\x20\x22','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','Please\x20specify\x20a\x20valid\x20attribute\x20name.','Last','all_columns','funnel_stage','connectionNameToTypeMap','behavior_table','email_recipients','repeatFrequency','from','run_after_journey_refresh','schedule','8786274nfpcIa','minValue','connector_config','batch','allColumns','joinStrategy','name','__SEGMENT_REF__','get','test','132165dugbis','visibility','startAt','end_on','keys','day','Unknown\x20connection:\x20','length','216yPttCH','timeWindow','limit','attributes','columns','segment','reverse','repeatUnit','INVALID_ARGUMENT','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','folder','timezone','activationParams','value','notification','none','activations:','arrayMatching','warn','add','978600QtHvgX','CONNECTOR_INVALID_CONFIG','maxValue','connectionId','471pNdqIa','Equal','Value','And','any','week','weekly','not','endOn','emailRecipients','operator','emailToIdMap','TimeWithinNext','max','TimeWithinPast','month','All','shape','order_by','isArray','runAfterJourneyRefresh','\x22:\x0a','nested_workflow_name','stringify','values','Column','realtime','entries','flatMap','repeat_unit','localRuleToName','CONNECTION_NOT_FOUND','repeat_frequency','minute','cron','parse','behaviorTableName','rule:','134035vDMKBX','description','nested_workflow_project_name','join_strategy','replace','JOURNEY_SYNTAX_ERROR','set','Behavior','monthly','rightValues','joinRow','filter','5646mjCThe','sort','repeat_sub_frequency','activation_template_id','conditions','Between','connection','include','scheduleType','isVisible','First','rightValue','nestedWorkflowName','lock_enabled','object','minutes_interval','repeatSubFrequency','behavior','].attribute\x20cannot\x20be\x20empty.\x0a','start_at','orderBy','visible'];a141_0x11b6=function(){return _0x4db7e5;};return a141_0x11b6();}export function serializeRuleForMatching(_0x5891ee){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0x5891ee)));}export function expandSegmentReferences(_0x4ac7a,_0xec9d36,_0x5a02ae=new Set()){return expandConditions(_0x4ac7a,_0xec9d36,_0x5a02ae);}function expandConditions(_0x144d90,_0x29ae11,_0x305ad5){const _0x4cc259=a141_0x5b1b60;if(_0x144d90===null||typeof _0x144d90!==_0x4cc259(0x281))return _0x144d90;if(Array[_0x4cc259(0x254)](_0x144d90))return _0x144d90[_0x4cc259(0x1eb)](_0x51c439=>expandConditions(_0x51c439,_0x29ae11,_0x305ad5));const _0x452532=_0x144d90;if((_0x452532['type']===_0x4cc259(0x27a)||_0x452532[_0x4cc259(0x1e4)]===_0x4cc259(0x207))&&typeof _0x452532[_0x4cc259(0x22e)]===_0x4cc259(0x1d5)){const _0x45c6ae=_0x452532[_0x4cc259(0x22e)],_0x25be6d=_0x29ae11[_0x4cc259(0x21f)](_0x45c6ae);if(_0x25be6d&&!_0x305ad5[_0x4cc259(0x1d8)](_0x45c6ae)){const _0x24438f=new Set(_0x305ad5);_0x24438f[_0x4cc259(0x23c)](_0x45c6ae);const _0x24e60c=expandConditions(_0x25be6d,_0x29ae11,_0x24438f);return{'type':_0x452532[_0x4cc259(0x1e4)],'expanded_rule':_0x24e60c};}return{'type':_0x452532[_0x4cc259(0x1e4)],'expanded_rule':'__UNRESOLVED__'};}const _0x59face={};for(const _0xe94bb1 of Object[_0x4cc259(0x225)](_0x452532)){_0x59face[_0xe94bb1]=expandConditions(_0x452532[_0xe94bb1],_0x29ae11,_0x305ad5);}return _0x59face;}export function serializeExpandedRule(_0x1f3155,_0x587a36){const _0x200307=a141_0x5b1b60,_0x2cf61d=expandSegmentReferences(_0x1f3155,_0x587a36);return JSON[_0x200307(0x258)](deepSortObject(_0x2cf61d));}export function createSegmentNameContext(_0x10e886){const _0x21a837=a141_0x5b1b60,_0x35eccc=new Set(),_0x330ed2=new Map(),_0x4b8d9e=new Map();if(_0x10e886)for(const [_0x31a680,_0x4b1f5d]of Object[_0x21a837(0x25c)](_0x10e886)){if(_0x4b1f5d[_0x21a837(0x1fe)]){const _0x1e3a07=serializeRule(_0x4b1f5d[_0x21a837(0x1fe)]);_0x4b8d9e[_0x21a837(0x26d)](_0x1e3a07,_0x31a680),_0x35eccc[_0x21a837(0x23c)](_0x31a680);}}return{'usedNames':_0x35eccc,'ruleHashToName':_0x330ed2,'localRuleToName':_0x10e886?_0x4b8d9e:undefined};}export function resolveSegmentName(_0x50cc8d,_0x7707e1,_0x208496,_0x1809ab){const _0x1450b9=a141_0x5b1b60,_0x295edb=serializeRule(_0x7707e1);if(_0x208496[_0x1450b9(0x25f)]){const _0x57e866=_0x208496[_0x1450b9(0x25f)][_0x1450b9(0x21f)](_0x295edb);if(_0x57e866)return{'name':_0x57e866,'isDuplicate':![],'isLocalMatch':!![]};}const _0xd03a2e=_0x208496[_0x1450b9(0x1de)]['get'](_0x295edb);if(_0xd03a2e)return{'name':_0xd03a2e,'isDuplicate':!![],'isLocalMatch':![]};const _0x3a0a6c=_0x1809ab(_0x50cc8d);let _0x660b22=_0x3a0a6c||_0x50cc8d,_0x5830a9=_0x660b22,_0x313d19=0x2;while(_0x208496[_0x1450b9(0x1fa)][_0x1450b9(0x1d8)](_0x5830a9)){_0x5830a9=_0x660b22+'_'+_0x313d19,_0x313d19++;}return _0x208496[_0x1450b9(0x1fa)][_0x1450b9(0x23c)](_0x5830a9),_0x208496['ruleHashToName'][_0x1450b9(0x26d)](_0x295edb,_0x5830a9),{'name':_0x5830a9,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x248d75){const _0x186c4c=[],_0x48bd92=_0x105f66=>{const _0x47d92e=a141_0x1ec6;if(!_0x105f66||typeof _0x105f66!==_0x47d92e(0x281))return;if(Array[_0x47d92e(0x254)](_0x105f66)){_0x105f66['forEach'](_0x48bd92);return;}const _0x9725bf=_0x105f66;(_0x9725bf['type']==='include'||_0x9725bf[_0x47d92e(0x1e4)]===_0x47d92e(0x207))&&typeof _0x9725bf[_0x47d92e(0x22e)]===_0x47d92e(0x1d5)&&_0x186c4c[_0x47d92e(0x1d9)](_0x9725bf[_0x47d92e(0x22e)]);for(const _0x1fad0e of Object[_0x47d92e(0x259)](_0x9725bf)){_0x48bd92(_0x1fad0e);}};return _0x48bd92(_0x248d75),_0x186c4c;}export function validateSegmentRule(_0x4817c2,_0x4c3c69){const _0x176c7b=a141_0x5b1b60;if(!_0x4c3c69||!_0x4c3c69[_0x176c7b(0x277)])return;for(let _0x3c243e=0x0;_0x3c243e<_0x4c3c69[_0x176c7b(0x277)]['length'];_0x3c243e++){const _0x22db07=_0x4c3c69[_0x176c7b(0x277)][_0x3c243e];if(_0x176c7b(0x1e4)in _0x22db07&&_0x22db07['type']===_0x176c7b(0x243)){const _0xbf3e1=_0x22db07,_0x93f16=_0xbf3e1[_0x176c7b(0x1f0)]||_0xbf3e1['aggregation'];if((!_0xbf3e1['attribute']||_0xbf3e1[_0x176c7b(0x1d7)]==='')&&!_0x93f16)throw new SDKError(ErrorCode[_0x176c7b(0x26c)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x4817c2+_0x176c7b(0x1ff)+(_0x176c7b(0x1d4)+_0x3c243e+_0x176c7b(0x285))+_0x176c7b(0x20c));}}}
@@ -1 +1 @@
1
- (function(_0x13bc02,_0x51c5d1){const _0x2c41e0=a142_0x17bd,_0x14f4b5=_0x13bc02();while(!![]){try{const _0x1c89a2=parseInt(_0x2c41e0(0x86))/0x1+parseInt(_0x2c41e0(0xae))/0x2+-parseInt(_0x2c41e0(0xb0))/0x3*(parseInt(_0x2c41e0(0xaf))/0x4)+-parseInt(_0x2c41e0(0x8c))/0x5+-parseInt(_0x2c41e0(0x95))/0x6+parseInt(_0x2c41e0(0xba))/0x7*(-parseInt(_0x2c41e0(0xa9))/0x8)+parseInt(_0x2c41e0(0xa8))/0x9*(parseInt(_0x2c41e0(0xb5))/0xa);if(_0x1c89a2===_0x51c5d1)break;else _0x14f4b5['push'](_0x14f4b5['shift']());}catch(_0x276fb0){_0x14f4b5['push'](_0x14f4b5['shift']());}}}(a142_0x371c,0xa5ed3));function a142_0x17bd(_0x2d0b50,_0x2d87df){_0x2d0b50=_0x2d0b50-0x80;const _0x371cf4=a142_0x371c();let _0x17bd2b=_0x371cf4[_0x2d0b50];return _0x17bd2b;}import a142_0x527cbb from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x122109){const _0x31ef0e=a142_0x17bd,_0x44a098=_0x122109[_0x31ef0e(0xa7)][_0x31ef0e(0x81)](_0x224bbc=>({'column_name':_0x224bbc[_0x31ef0e(0xb7)],'column_type':_0x224bbc[_0x31ef0e(0xa2)],'null':_0x31ef0e(0x89),'key':null,'default':null,'extra':null}));return{..._0x122109,'columns':[{'name':_0x31ef0e(0xad),'type':_0x31ef0e(0x82)},{'name':_0x31ef0e(0xb1),'type':_0x31ef0e(0x82)},{'name':_0x31ef0e(0xa0),'type':_0x31ef0e(0x82)},{'name':'key','type':'varchar'},{'name':_0x31ef0e(0x93),'type':_0x31ef0e(0x82)},{'name':'extra','type':'varchar'}],'data':_0x44a098};}export async function executeSchemaQuery(_0x3fa45b,_0xf1b646,_0x40dc1a){const _0x1a7260=a142_0x17bd,_0x65aade=_0x3fa45b[_0x1a7260(0x8f)]()[_0x1a7260(0x90)](/;+$/,''),_0x225903=_0x1a7260(0xbb)+_0x65aade+_0x1a7260(0x85);_0x40dc1a[_0x1a7260(0x83)]&&console[_0x1a7260(0x88)]('Schema\x20query:\x0a'+_0x225903);const _0x17cb5a=await withProgressSpinner(_0x1a7260(0x8e),async _0x261a5f=>{const _0x54d4e3=_0x1a7260,_0x521f63=await _0xf1b646[_0x54d4e3(0x84)][_0x54d4e3(0x91)](_0x225903,{'catalog':'td','schema':'information_schema','onJobId':_0xc05b79=>{const _0x2b5900=_0x54d4e3;_0x261a5f[_0x2b5900(0x87)](_0xc05b79);}});return _0x521f63;},{'verbose':_0x40dc1a[_0x1a7260(0x83)]});return buildSchemaResult(_0x17cb5a[_0x1a7260(0x98)]);}function columnName(_0x33763e){const _0xc04ce3=a142_0x17bd;return _0x33763e[_0xc04ce3(0xa4)]||_0x33763e['parentColumn']||_0x33763e[_0xc04ce3(0xb7)];}function formatFieldLine(_0xbb4512,_0x32e208,_0x38ba59){const _0x482fbd=a142_0x17bd,_0x5aa0fd=_0xbb4512!==_0x32e208?'\x20'+a142_0x527cbb[_0x482fbd(0x80)]('('+_0x32e208+')'):'';return _0x482fbd(0xa1)+_0xbb4512+_0x5aa0fd+':\x20'+a142_0x527cbb['cyan'](_0x38ba59);}function sortByColumnName(_0x585dbf){const _0x42eda5=a142_0x17bd;return[..._0x585dbf][_0x42eda5(0x9c)]((_0x31f46d,_0x3a19d5)=>columnName(_0x31f46d)[_0x42eda5(0x9e)](columnName(_0x3a19d5)));}export function displayFieldsHumanReadable(_0x31daee,_0x109af8){const _0x5d2829=a142_0x17bd,_0x14fac4=_0x31daee[_0x5d2829(0xb4)](_0x262cd3=>_0x262cd3[_0x5d2829(0xb3)]===_0x5d2829(0xb2)),_0x1a97ab=_0x31daee[_0x5d2829(0xb4)](_0x439bfd=>_0x439bfd[_0x5d2829(0xb3)]===_0x5d2829(0xa6)),_0x154ca5=new Map();for(const _0x238a6d of _0x14fac4){const _0xf03fc0=_0x238a6d[_0x5d2829(0xb9)]||_0x238a6d['parentTableName']||_0x5d2829(0xac),_0x1a6f77=_0x154ca5['get'](_0xf03fc0);_0x1a6f77?_0x1a6f77['fields'][_0x5d2829(0x8d)](_0x238a6d):_0x154ca5[_0x5d2829(0x9d)](_0xf03fc0,{'displayName':_0xf03fc0,'tableName':_0x238a6d[_0x5d2829(0xa5)],'fields':[_0x238a6d]});}const _0x4556b3=new Map();for(const _0x38bf3b of _0x1a97ab){const _0x29112f=_0x38bf3b[_0x5d2829(0x92)]||_0x5d2829(0xac),_0x362eea=_0x4556b3[_0x5d2829(0xa3)](_0x29112f)||[];_0x362eea[_0x5d2829(0x8d)](_0x38bf3b),_0x4556b3['set'](_0x29112f,_0x362eea);}console[_0x5d2829(0x88)]('\x0a'+a142_0x527cbb[_0x5d2829(0xb6)](_0x109af8));if(_0x154ca5[_0x5d2829(0x97)]>0x0){console[_0x5d2829(0x88)]('\x0a'+a142_0x527cbb[_0x5d2829(0x80)](_0x5d2829(0x96)));const _0x1fb0cd=[..._0x154ca5[_0x5d2829(0x9f)]()][_0x5d2829(0x9c)]((_0x221107,_0x17d9d7)=>_0x221107[0x0][_0x5d2829(0x9e)](_0x17d9d7[0x0]));for(const [,_0x3505d5]of _0x1fb0cd){const _0x252687=_0x3505d5[_0x5d2829(0x9a)]&&_0x3505d5[_0x5d2829(0x9a)]!==_0x3505d5[_0x5d2829(0xaa)]?'\x20'+a142_0x527cbb[_0x5d2829(0x80)]('('+_0x3505d5['tableName']+')'):'';console['error']('\x20\x20'+a142_0x527cbb[_0x5d2829(0xb6)](_0x3505d5[_0x5d2829(0xaa)])+_0x252687);for(const _0x283b74 of sortByColumnName(_0x3505d5[_0x5d2829(0xb8)])){console[_0x5d2829(0x88)](formatFieldLine(columnName(_0x283b74),_0x283b74['name'],_0x283b74[_0x5d2829(0xa2)]));}}}if(_0x4556b3[_0x5d2829(0x97)]>0x0){console[_0x5d2829(0x88)]('\x0a'+a142_0x527cbb[_0x5d2829(0x80)](_0x5d2829(0x8b)));const _0x3b228f=[..._0x4556b3[_0x5d2829(0x9f)]()][_0x5d2829(0x9c)]((_0x3906fe,_0x39cf74)=>_0x3906fe[0x0][_0x5d2829(0x9e)](_0x39cf74[0x0]));for(const [_0x5e4753,_0x3385e1]of _0x3b228f){const _0xeda6d1=_0x3385e1[0x0],_0x12d205=_0xeda6d1?.[_0x5d2829(0x8a)];if(_0x12d205){const _0x42b59f=_0x12d205!==_0x5e4753?'\x20'+a142_0x527cbb[_0x5d2829(0x80)]('('+_0x5e4753+')'):'';console[_0x5d2829(0x88)]('\x20\x20'+a142_0x527cbb[_0x5d2829(0xb6)](_0x12d205)+_0x42b59f);}else{const _0x36b3bd=_0xeda6d1?.[_0x5d2829(0xa5)]||'';console[_0x5d2829(0x88)]('\x20\x20'+a142_0x527cbb[_0x5d2829(0xb6)](_0x5e4753)+(_0x36b3bd?'\x20'+a142_0x527cbb[_0x5d2829(0x80)]('('+_0x36b3bd+')'):''));}for(const _0x411d69 of sortByColumnName(_0x3385e1)){const _0x3fd2d7=_0x411d69[_0x5d2829(0xb7)][_0x5d2829(0x99)](_0x5e4753+'.')?_0x411d69['name'][_0x5d2829(0xab)](_0x5e4753[_0x5d2829(0x9b)]+0x1):_0x411d69['name'];console[_0x5d2829(0x88)](formatFieldLine(columnName(_0x411d69),_0x3fd2d7,_0x411d69[_0x5d2829(0xa2)]));}}}const _0x4c62f5=_0x31daee['some'](_0x41efe9=>_0x41efe9[_0x5d2829(0xa4)]||_0x41efe9[_0x5d2829(0x8a)]);_0x4c62f5&&(console[_0x5d2829(0x88)]('\x0a'+a142_0x527cbb['dim'](_0x5d2829(0x94))),console[_0x5d2829(0x88)](a142_0x527cbb[_0x5d2829(0x80)]('\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.'))),console['error']('');}function a142_0x371c(){const _0x320e15=['columns','30224709EuFPZU','238512CSaLWl','displayName','slice','Unknown','column_name','688272cuqvlZ','1095880hzqrrv','6zJZGAF','column_type','attribute','source','filter','10BuCKNK','bold','name','fields','groupingName','280NBfRRU','SELECT\x20*\x20FROM\x20(\x0a','dim','map','varchar','verbose','query','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','330606GTOEoZ','setJobId','error','YES','matrixTableName','Behaviors','2006825PeVKDM','push','Fetching\x20schema...','trim','replace','execute','behaviorName','default','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','7269258uZquFJ','Attributes','size','data','startsWith','tableName','length','sort','set','localeCompare','entries','null','\x20\x20\x20\x20','type','get','matrixColumnName','parentTableName','behavior'];a142_0x371c=function(){return _0x320e15;};return a142_0x371c();}
1
+ (function(_0x9f6c42,_0x2b975a){const _0xa8529=a142_0xeecb,_0x12159a=_0x9f6c42();while(!![]){try{const _0x20a451=-parseInt(_0xa8529(0x194))/0x1*(parseInt(_0xa8529(0x1ba))/0x2)+parseInt(_0xa8529(0x19a))/0x3+-parseInt(_0xa8529(0x1ab))/0x4*(-parseInt(_0xa8529(0x193))/0x5)+parseInt(_0xa8529(0x1ae))/0x6+-parseInt(_0xa8529(0x1a8))/0x7+-parseInt(_0xa8529(0x19b))/0x8*(-parseInt(_0xa8529(0x19e))/0x9)+-parseInt(_0xa8529(0x1a2))/0xa*(parseInt(_0xa8529(0x1a0))/0xb);if(_0x20a451===_0x2b975a)break;else _0x12159a['push'](_0x12159a['shift']());}catch(_0x498ceb){_0x12159a['push'](_0x12159a['shift']());}}}(a142_0x4a42,0xa7d86));import a142_0x4dac2b from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x2584cd){const _0x4fa4eb=a142_0xeecb,_0x1e9941=_0x2584cd[_0x4fa4eb(0x197)][_0x4fa4eb(0x1b4)](_0x5b9460=>({'column_name':_0x5b9460[_0x4fa4eb(0x1c4)],'column_type':_0x5b9460[_0x4fa4eb(0x1b6)],'null':_0x4fa4eb(0x1a9),'key':null,'default':null,'extra':null}));return{..._0x2584cd,'columns':[{'name':_0x4fa4eb(0x1b1),'type':_0x4fa4eb(0x196)},{'name':_0x4fa4eb(0x1ad),'type':'varchar'},{'name':_0x4fa4eb(0x199),'type':_0x4fa4eb(0x196)},{'name':_0x4fa4eb(0x1c7),'type':'varchar'},{'name':'default','type':_0x4fa4eb(0x196)},{'name':_0x4fa4eb(0x1b8),'type':_0x4fa4eb(0x196)}],'data':_0x1e9941};}function a142_0x4a42(){const _0x46eef6=['name','cyan','setJobId','key','information_schema','push','query','tableName','Behaviors','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','12020QowsWS','1CjfSGB','fields','varchar','columns','behavior','null','169260nvRMKq','8995080vVlOXJ','length','entries','9MmatuP','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','19481bwyOqZ','parentTableName','5750NmqfYj','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','source','trim','verbose','slice','6961850tGoZBZ','YES','get','1040zbjPIo','set','column_type','7335930GMjLFs','dim','error','column_name','size','execute','map','Fetching\x20schema...','type','replace','extra','bold','656262PhZGpo','\x20\x20\x20\x20','groupingName','sort','matrixColumnName','parentColumn','Unknown','attribute','displayName','matrixTableName'];a142_0x4a42=function(){return _0x46eef6;};return a142_0x4a42();}export async function executeSchemaQuery(_0x2cecdf,_0x1e4815,_0x351dc2){const _0x4f6fdd=a142_0xeecb,_0x53d97a=_0x2cecdf[_0x4f6fdd(0x1a5)]()[_0x4f6fdd(0x1b7)](/;+$/,''),_0x285ad8='SELECT\x20*\x20FROM\x20(\x0a'+_0x53d97a+_0x4f6fdd(0x19f);_0x351dc2[_0x4f6fdd(0x1a6)]&&console[_0x4f6fdd(0x1b0)]('Schema\x20query:\x0a'+_0x285ad8);const _0x24d564=await withProgressSpinner(_0x4f6fdd(0x1b5),async _0x760a62=>{const _0x20545f=_0x4f6fdd,_0x2a9fc7=await _0x1e4815[_0x20545f(0x18f)][_0x20545f(0x1b3)](_0x285ad8,{'catalog':'td','schema':_0x20545f(0x1c8),'onJobId':_0x8f8157=>{const _0x79b4f1=_0x20545f;_0x760a62[_0x79b4f1(0x1c6)](_0x8f8157);}});return _0x2a9fc7;},{'verbose':_0x351dc2['verbose']});return buildSchemaResult(_0x24d564['data']);}function columnName(_0xeee48a){const _0x17ef08=a142_0xeecb;return _0xeee48a[_0x17ef08(0x1be)]||_0xeee48a[_0x17ef08(0x1bf)]||_0xeee48a[_0x17ef08(0x1c4)];}function a142_0xeecb(_0x3304db,_0x522093){_0x3304db=_0x3304db-0x18e;const _0x4a4227=a142_0x4a42();let _0xeecba2=_0x4a4227[_0x3304db];return _0xeecba2;}function formatFieldLine(_0x1e1f90,_0x7b529e,_0x57e9d7){const _0x4a7bd0=a142_0xeecb,_0x1589e4=_0x1e1f90!==_0x7b529e?'\x20'+a142_0x4dac2b[_0x4a7bd0(0x1af)]('('+_0x7b529e+')'):'';return _0x4a7bd0(0x1bb)+_0x1e1f90+_0x1589e4+':\x20'+a142_0x4dac2b[_0x4a7bd0(0x1c5)](_0x57e9d7);}function sortByColumnName(_0x3f55c7){const _0x321de9=a142_0xeecb;return[..._0x3f55c7][_0x321de9(0x1bd)]((_0x14b88e,_0x323006)=>columnName(_0x14b88e)['localeCompare'](columnName(_0x323006)));}export function displayFieldsHumanReadable(_0xc66903,_0x2a6d22){const _0xe3d34c=a142_0xeecb,_0x3b2fa6=_0xc66903['filter'](_0x4917cb=>_0x4917cb['source']===_0xe3d34c(0x1c1)),_0x41b10a=_0xc66903['filter'](_0x456e25=>_0x456e25[_0xe3d34c(0x1a4)]===_0xe3d34c(0x198)),_0x43f018=new Map();for(const _0x4b3055 of _0x3b2fa6){const _0x5f56ec=_0x4b3055[_0xe3d34c(0x1bc)]||_0x4b3055[_0xe3d34c(0x1a1)]||_0xe3d34c(0x1c0),_0x158fa3=_0x43f018[_0xe3d34c(0x1aa)](_0x5f56ec);_0x158fa3?_0x158fa3[_0xe3d34c(0x195)][_0xe3d34c(0x18e)](_0x4b3055):_0x43f018[_0xe3d34c(0x1ac)](_0x5f56ec,{'displayName':_0x5f56ec,'tableName':_0x4b3055[_0xe3d34c(0x1a1)],'fields':[_0x4b3055]});}const _0x3a3b36=new Map();for(const _0x5ccb01 of _0x41b10a){const _0x5236a6=_0x5ccb01['behaviorName']||_0xe3d34c(0x1c0),_0x46930c=_0x3a3b36[_0xe3d34c(0x1aa)](_0x5236a6)||[];_0x46930c['push'](_0x5ccb01),_0x3a3b36[_0xe3d34c(0x1ac)](_0x5236a6,_0x46930c);}console['error']('\x0a'+a142_0x4dac2b['bold'](_0x2a6d22));if(_0x43f018[_0xe3d34c(0x1b2)]>0x0){console[_0xe3d34c(0x1b0)]('\x0a'+a142_0x4dac2b['dim']('Attributes'));const _0x407f1d=[..._0x43f018[_0xe3d34c(0x19d)]()][_0xe3d34c(0x1bd)]((_0x40c46,_0xd6c83a)=>_0x40c46[0x0]['localeCompare'](_0xd6c83a[0x0]));for(const [,_0x7414b5]of _0x407f1d){const _0x592321=_0x7414b5[_0xe3d34c(0x190)]&&_0x7414b5['tableName']!==_0x7414b5['displayName']?'\x20'+a142_0x4dac2b[_0xe3d34c(0x1af)]('('+_0x7414b5[_0xe3d34c(0x190)]+')'):'';console[_0xe3d34c(0x1b0)]('\x20\x20'+a142_0x4dac2b[_0xe3d34c(0x1b9)](_0x7414b5[_0xe3d34c(0x1c2)])+_0x592321);for(const _0x5978b8 of sortByColumnName(_0x7414b5[_0xe3d34c(0x195)])){console['error'](formatFieldLine(columnName(_0x5978b8),_0x5978b8[_0xe3d34c(0x1c4)],_0x5978b8[_0xe3d34c(0x1b6)]));}}}if(_0x3a3b36['size']>0x0){console[_0xe3d34c(0x1b0)]('\x0a'+a142_0x4dac2b[_0xe3d34c(0x1af)](_0xe3d34c(0x191)));const _0x2fcc3e=[..._0x3a3b36[_0xe3d34c(0x19d)]()][_0xe3d34c(0x1bd)]((_0x4560a3,_0x365c16)=>_0x4560a3[0x0]['localeCompare'](_0x365c16[0x0]));for(const [_0x39b2cc,_0x3f05e3]of _0x2fcc3e){const _0x10a6d0=_0x3f05e3[0x0],_0x147b8a=_0x10a6d0?.[_0xe3d34c(0x1c3)];if(_0x147b8a){const _0x36916b=_0x147b8a!==_0x39b2cc?'\x20'+a142_0x4dac2b[_0xe3d34c(0x1af)]('('+_0x39b2cc+')'):'';console[_0xe3d34c(0x1b0)]('\x20\x20'+a142_0x4dac2b[_0xe3d34c(0x1b9)](_0x147b8a)+_0x36916b);}else{const _0x1edcc9=_0x10a6d0?.[_0xe3d34c(0x1a1)]||'';console['error']('\x20\x20'+a142_0x4dac2b['bold'](_0x39b2cc)+(_0x1edcc9?'\x20'+a142_0x4dac2b[_0xe3d34c(0x1af)]('('+_0x1edcc9+')'):''));}for(const _0x5c7b5a of sortByColumnName(_0x3f05e3)){const _0x5d802b=_0x5c7b5a[_0xe3d34c(0x1c4)]['startsWith'](_0x39b2cc+'.')?_0x5c7b5a['name'][_0xe3d34c(0x1a7)](_0x39b2cc[_0xe3d34c(0x19c)]+0x1):_0x5c7b5a[_0xe3d34c(0x1c4)];console[_0xe3d34c(0x1b0)](formatFieldLine(columnName(_0x5c7b5a),_0x5d802b,_0x5c7b5a[_0xe3d34c(0x1b6)]));}}}const _0x15cc17=_0xc66903['some'](_0x20caae=>_0x20caae['matrixColumnName']||_0x20caae[_0xe3d34c(0x1c3)]);_0x15cc17&&(console[_0xe3d34c(0x1b0)]('\x0a'+a142_0x4dac2b[_0xe3d34c(0x1af)](_0xe3d34c(0x192))),console[_0xe3d34c(0x1b0)](a142_0x4dac2b[_0xe3d34c(0x1af)](_0xe3d34c(0x1a3)))),console[_0xe3d34c(0x1b0)]('');}
@@ -1 +1 @@
1
- function a143_0x3e91(){const _0xa0bcdb=['extname','1504249QjYViY','isDirectory','471200OKvjvg','3534pIPEsh','12523sWluPS','endsWith','70758lMWdaf','833308JDLRSc','join','toLowerCase','1464tsOdJK','isFile','2286276IvDqLr','3380697EbCqix','.yaml','name','dirname','map','.yml','relative'];a143_0x3e91=function(){return _0xa0bcdb;};return a143_0x3e91();}(function(_0x2ca8ce,_0xe87c22){const _0x232789=a143_0x38db,_0x3670b1=_0x2ca8ce();while(!![]){try{const _0x4189b0=-parseInt(_0x232789(0xfd))/0x1+parseInt(_0x232789(0xef))/0x2+-parseInt(_0x232789(0xf5))/0x3+parseInt(_0x232789(0xf4))/0x4+-parseInt(_0x232789(0xff))/0x5+-parseInt(_0x232789(0x100))/0x6*(-parseInt(_0x232789(0x101))/0x7)+parseInt(_0x232789(0xf2))/0x8*(parseInt(_0x232789(0xee))/0x9);if(_0x4189b0===_0xe87c22)break;else _0x3670b1['push'](_0x3670b1['shift']());}catch(_0x182148){_0x3670b1['push'](_0x3670b1['shift']());}}}(a143_0x3e91,0xb8666));import{readdirSync,statSync}from'fs';function a143_0x38db(_0x360ad6,_0x4f511b){_0x360ad6=_0x360ad6-0xee;const _0x3e910d=a143_0x3e91();let _0x38db07=_0x3e910d[_0x360ad6];return _0x38db07;}import a143_0x59ace3 from'path';export function findYamlFiles(_0xaff7f3){const _0x2febc7=[];function _0x216e5a(_0x1607ee){const _0x2ea03a=a143_0x38db,_0x2355af=readdirSync(_0x1607ee,{'withFileTypes':!![]});for(const _0x37c9f9 of _0x2355af){const _0x22139d=a143_0x59ace3[_0x2ea03a(0xf0)](_0x1607ee,_0x37c9f9[_0x2ea03a(0xf7)]);if(_0x37c9f9[_0x2ea03a(0xfe)]())_0x216e5a(_0x22139d);else(_0x37c9f9[_0x2ea03a(0xf7)][_0x2ea03a(0x102)](_0x2ea03a(0xfa))||_0x37c9f9[_0x2ea03a(0xf7)]['endsWith'](_0x2ea03a(0xf6)))&&_0x2febc7['push'](_0x22139d);}}return _0x216e5a(_0xaff7f3),_0x2febc7;}export function discoverYamlFiles(_0x6d1acc){const _0x406d15=a143_0x38db,_0x492df0=findYamlFiles(_0x6d1acc);return _0x492df0[_0x406d15(0xf9)](_0x24500e=>{const _0x3bdfb7=_0x406d15,_0x23452b=a143_0x59ace3[_0x3bdfb7(0xfb)](_0x6d1acc,_0x24500e),_0x42d652=a143_0x59ace3[_0x3bdfb7(0xf8)](_0x23452b);return{'absolutePath':_0x24500e,'relativePath':_0x23452b,'folderPath':_0x42d652==='.'?'':_0x42d652};});}export function isYamlFile(_0x136274){const _0x371739=a143_0x38db;try{const _0x117121=statSync(_0x136274);if(!_0x117121[_0x371739(0xf3)]())return![];const _0x274750=a143_0x59ace3[_0x371739(0xfc)](_0x136274)[_0x371739(0xf1)]();return _0x274750===_0x371739(0xfa)||_0x274750===_0x371739(0xf6);}catch{return![];}}
1
+ (function(_0x2f7f87,_0x5d3b4a){const _0xb7676c=a143_0x194a,_0x57b6c2=_0x2f7f87();while(!![]){try{const _0x44c418=parseInt(_0xb7676c(0x13d))/0x1+parseInt(_0xb7676c(0x12d))/0x2+-parseInt(_0xb7676c(0x139))/0x3+parseInt(_0xb7676c(0x12a))/0x4*(-parseInt(_0xb7676c(0x12c))/0x5)+parseInt(_0xb7676c(0x137))/0x6*(-parseInt(_0xb7676c(0x12f))/0x7)+parseInt(_0xb7676c(0x13c))/0x8*(-parseInt(_0xb7676c(0x134))/0x9)+parseInt(_0xb7676c(0x13a))/0xa;if(_0x44c418===_0x5d3b4a)break;else _0x57b6c2['push'](_0x57b6c2['shift']());}catch(_0x34769b){_0x57b6c2['push'](_0x57b6c2['shift']());}}}(a143_0x41d0,0x44d19));function a143_0x41d0(){const _0x1ea102=['1098WmzmEU','dirname','1677216rgydgI','9068350WOYwAz','name','1245248zUOrQV','433857ZsYIHL','endsWith','12awQsyp','.yml','412655DhIbYY','564698aUamgp','relative','2583xRBbVS','toLowerCase','extname','isDirectory','join','27BqbKNf','.yaml','map'];a143_0x41d0=function(){return _0x1ea102;};return a143_0x41d0();}import{readdirSync,statSync}from'fs';import a143_0x5c6c13 from'path';export function findYamlFiles(_0x4629d7){const _0x8b8433=[];function _0x999781(_0x240b4b){const _0x4891bf=a143_0x194a,_0xa8f33d=readdirSync(_0x240b4b,{'withFileTypes':!![]});for(const _0x1340a3 of _0xa8f33d){const _0x35bdb3=a143_0x5c6c13[_0x4891bf(0x133)](_0x240b4b,_0x1340a3[_0x4891bf(0x13b)]);if(_0x1340a3[_0x4891bf(0x132)]())_0x999781(_0x35bdb3);else(_0x1340a3[_0x4891bf(0x13b)]['endsWith'](_0x4891bf(0x12b))||_0x1340a3['name'][_0x4891bf(0x13e)](_0x4891bf(0x135)))&&_0x8b8433['push'](_0x35bdb3);}}return _0x999781(_0x4629d7),_0x8b8433;}function a143_0x194a(_0x461d2a,_0xd733){_0x461d2a=_0x461d2a-0x12a;const _0x41d0f2=a143_0x41d0();let _0x194aef=_0x41d0f2[_0x461d2a];return _0x194aef;}export function discoverYamlFiles(_0x314126){const _0x43f77f=a143_0x194a,_0x5bde8a=findYamlFiles(_0x314126);return _0x5bde8a[_0x43f77f(0x136)](_0x1f895c=>{const _0x2b1a29=_0x43f77f,_0x49201b=a143_0x5c6c13[_0x2b1a29(0x12e)](_0x314126,_0x1f895c),_0x3d4382=a143_0x5c6c13[_0x2b1a29(0x138)](_0x49201b);return{'absolutePath':_0x1f895c,'relativePath':_0x49201b,'folderPath':_0x3d4382==='.'?'':_0x3d4382};});}export function isYamlFile(_0x2869c2){const _0x5973dc=a143_0x194a;try{const _0x5bd73f=statSync(_0x2869c2);if(!_0x5bd73f['isFile']())return![];const _0xf84cf5=a143_0x5c6c13[_0x5973dc(0x131)](_0x2869c2)[_0x5973dc(0x130)]();return _0xf84cf5===_0x5973dc(0x12b)||_0xf84cf5===_0x5973dc(0x135);}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x942ac2,_0x101f2b){const _0x2de650=a144_0x3368,_0x3c8d35=_0x942ac2();while(!![]){try{const _0x2999a6=parseInt(_0x2de650(0x208))/0x1*(parseInt(_0x2de650(0x214))/0x2)+parseInt(_0x2de650(0x23f))/0x3+parseInt(_0x2de650(0x23c))/0x4+-parseInt(_0x2de650(0x236))/0x5+parseInt(_0x2de650(0x203))/0x6+-parseInt(_0x2de650(0x1ff))/0x7+-parseInt(_0x2de650(0x215))/0x8;if(_0x2999a6===_0x101f2b)break;else _0x3c8d35['push'](_0x3c8d35['shift']());}catch(_0x303b25){_0x3c8d35['push'](_0x3c8d35['shift']());}}}(a144_0x2cf2,0x4b8ef));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x9c1d51){const _0x4f793a=a144_0x3368;return _0x9c1d51[_0x4f793a(0x1fb)]()[_0x4f793a(0x235)](/\s+/g,'_')[_0x4f793a(0x235)](/[^a-z0-9_\p{L}\p{N}]/gu,'')['replace'](/_+/g,'_')[_0x4f793a(0x235)](/^_|_$/g,'');}function a144_0x2cf2(){const _0x553a23=['join','yaml','columns','nameMapping','goal','branches','startsWith','has','name','object','push','journeys','merged','bundle_name','some','replace','459025heVBcT','steps','reentry','version','string','keys','875420OSBjbH','get','conditions','31593bEtBso','.yml','item','isArray','null','sort','schedule','with','toLowerCase','notification','exclude','from','1900423NrOsZa','match','stringify','wait','2563662WuOFIN','decision_point','length','segment','connector_config','317375ubVyil','version_number','include','endsWith','find','latest','slice','versions','set','stages','description','condition','2mlBUGP','2410056cLeYAB','values','milestone','map','exit_criteria','activation','index','entries','all_columns','behavior','type','trim','rule','launched','activation_template_id','journey','entry_criteria'];a144_0x2cf2=function(){return _0x553a23;};return a144_0x2cf2();}export function generateJourneyLocalName(_0x5901c7){const _0x2ca359=a144_0x3368,_0x104323=_0x5901c7[_0x2ca359(0x200)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x104323){const _0x54c39a=_0x104323[0x1][_0x2ca359(0x1fb)](),_0xad9fff=_0x104323[0x2],_0x21c6dd=_0xad9fff[_0x2ca359(0x235)](/-/g,'')[_0x2ca359(0x20e)](0x0,0x4)[_0x2ca359(0x1fb)]();return _0x54c39a+'_'+_0x21c6dd;}const _0x10df20=_0x5901c7['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x10df20){const _0x785e89=_0x10df20[0x1],_0x46c7bf=_0x10df20[0x2][_0x2ca359(0x1fb)](),_0x31ee70=_0x785e89[_0x2ca359(0x235)](/-/g,'')['slice'](0x0,0x4)['toLowerCase']();return _0x46c7bf+'_'+_0x31ee70;}return undefined;}function stableStringify(_0xb7b28){const _0x53f09d=a144_0x3368;if(Array[_0x53f09d(0x1f6)](_0xb7b28))return'['+_0xb7b28[_0x53f09d(0x218)](_0x3c56b1=>stableStringify(_0x3c56b1))['join'](',')+']';if(_0xb7b28&&typeof _0xb7b28==='object'){const _0x10ee8a=_0xb7b28,_0x529d71=Object['keys'](_0x10ee8a)[_0x53f09d(0x1f8)](),_0x2995dd=_0x529d71[_0x53f09d(0x218)](_0x220211=>'\x22'+_0x220211+'\x22:'+stableStringify(_0x10ee8a[_0x220211]));return'{'+_0x2995dd[_0x53f09d(0x226)](',')+'}';}const _0x28846a=JSON[_0x53f09d(0x201)](_0xb7b28);return _0x28846a===undefined?_0x53f09d(0x1f7):_0x28846a;}export function consolidateActivationsByContent(_0x357840){const _0x2e0ca4=a144_0x3368,_0x998329={},_0x11cd99=new Map(),_0x48aae3=new Map();for(const _0x29a9dd of _0x357840){if(!_0x29a9dd)continue;for(const [_0xee2fb1,_0x3e8d28]of Object[_0x2e0ca4(0x21c)](_0x29a9dd)){const _0x12528c={'name':_0x3e8d28['name'],'connection':_0x3e8d28['connection'],..._0x3e8d28[_0x2e0ca4(0x21d)]!==undefined&&{'all_columns':_0x3e8d28[_0x2e0ca4(0x21d)]},..._0x3e8d28[_0x2e0ca4(0x228)]!==undefined&&{'columns':_0x3e8d28['columns']},..._0x3e8d28[_0x2e0ca4(0x21e)]!==undefined&&{'behavior':_0x3e8d28[_0x2e0ca4(0x21e)]},..._0x3e8d28[_0x2e0ca4(0x1f9)]!==undefined&&{'schedule':_0x3e8d28[_0x2e0ca4(0x1f9)]},..._0x3e8d28[_0x2e0ca4(0x1fc)]!==undefined&&{'notification':_0x3e8d28[_0x2e0ca4(0x1fc)]},..._0x3e8d28[_0x2e0ca4(0x207)]!==undefined&&{'connector_config':_0x3e8d28[_0x2e0ca4(0x207)]},..._0x3e8d28['activation_template_id']!==undefined&&{'activation_template_id':_0x3e8d28[_0x2e0ca4(0x223)]}},_0x1ea23d=stableStringify(_0x12528c),_0x5712b5=_0x48aae3[_0x2e0ca4(0x23d)](_0x1ea23d);_0x5712b5?_0x11cd99[_0x2e0ca4(0x210)](_0xee2fb1,_0x5712b5):(_0x998329[_0xee2fb1]=_0x3e8d28,_0x11cd99[_0x2e0ca4(0x210)](_0xee2fb1,_0xee2fb1),_0x48aae3['set'](_0x1ea23d,_0xee2fb1));}}return{'merged':_0x998329,'nameMapping':_0x11cd99};}export function updateActivationReferences(_0x41fc6b,_0x53cc36){const _0x40cde8=a144_0x3368;if(!_0x41fc6b)return;for(const _0x8ba17c of _0x41fc6b){if(!_0x8ba17c['steps'])continue;for(const _0x5d1ba2 of _0x8ba17c['steps']){if(_0x5d1ba2[_0x40cde8(0x21f)]===_0x40cde8(0x21a)&&_0x5d1ba2[_0x40cde8(0x1fa)]?.[_0x40cde8(0x21a)]){const _0x24eec4=_0x53cc36['get'](_0x5d1ba2[_0x40cde8(0x1fa)][_0x40cde8(0x21a)]);_0x24eec4&&_0x24eec4!==_0x5d1ba2['with']['activation']&&(_0x5d1ba2[_0x40cde8(0x1fa)][_0x40cde8(0x21a)]=_0x24eec4);}}}}export function consolidateSegmentsByContent(_0x2f6cf7,_0x53222c){const _0x42d726=a144_0x3368,_0x48a236={},_0x37b5a7=new Map(),_0x8f58ca=new Map();for(const _0x3266dc of _0x2f6cf7){if(!_0x3266dc)continue;for(const [_0x2d78dd,_0x16bed4]of Object['entries'](_0x3266dc)){if(!_0x16bed4[_0x42d726(0x221)]){_0x48a236[_0x2d78dd]=_0x16bed4,_0x37b5a7['set'](_0x2d78dd,_0x2d78dd);continue;}const _0x1ba6a9=_0x16bed4[_0x42d726(0x212)]&&_0x16bed4[_0x42d726(0x212)][_0x42d726(0x220)]()?_0x16bed4[_0x42d726(0x212)]:undefined,_0x13c990=JSON['stringify']({'description':_0x1ba6a9,'rule':deepSortObject(_0x16bed4['rule'])}),_0x5074e1=_0x8f58ca[_0x42d726(0x23d)](_0x13c990);if(_0x5074e1){const _0x57ea97={..._0x16bed4[_0x42d726(0x212)]!==undefined&&{'description':_0x16bed4['description']},'rule':_0x16bed4[_0x42d726(0x221)]?deepSortObject(_0x16bed4[_0x42d726(0x221)]):_0x16bed4['rule']};if(_0x2d78dd<_0x5074e1){_0x48a236[_0x2d78dd]=_0x57ea97,delete _0x48a236[_0x5074e1];for(const [_0x210afc,_0x5d8b9a]of _0x37b5a7['entries']()){_0x5d8b9a===_0x5074e1&&_0x37b5a7[_0x42d726(0x210)](_0x210afc,_0x2d78dd);}_0x37b5a7[_0x42d726(0x210)](_0x2d78dd,_0x2d78dd),_0x8f58ca[_0x42d726(0x210)](_0x13c990,_0x2d78dd);}else _0x48a236[_0x5074e1]=_0x57ea97,_0x37b5a7[_0x42d726(0x210)](_0x2d78dd,_0x5074e1);}else{let _0x2624c2=_0x2d78dd;if(_0x53222c){const _0x3dfe1f=_0x53222c['get'](_0x13c990);_0x3dfe1f&&_0x3dfe1f[_0x42d726(0x205)]>0x0&&(_0x2624c2=_0x3dfe1f['slice']()['sort']()[0x0]);}const _0x2cb73f={..._0x16bed4['description']!==undefined&&{'description':_0x16bed4[_0x42d726(0x212)]},'rule':_0x16bed4[_0x42d726(0x221)]?deepSortObject(_0x16bed4['rule']):_0x16bed4[_0x42d726(0x221)]};_0x48a236[_0x2624c2]=_0x2cb73f,_0x37b5a7[_0x42d726(0x210)](_0x2d78dd,_0x2624c2),_0x8f58ca[_0x42d726(0x210)](_0x13c990,_0x2624c2);}}}return{'merged':_0x48a236,'nameMapping':_0x37b5a7};}export function updateSegmentReferences(_0x520fa1,_0x51ff2e){const _0x19fd17=a144_0x3368;if(!_0x520fa1)return;for(const _0x10ff66 of _0x520fa1){if(_0x10ff66[_0x19fd17(0x225)]?.[_0x19fd17(0x206)]){const _0x1d650a=_0x51ff2e[_0x19fd17(0x23d)](_0x10ff66[_0x19fd17(0x225)][_0x19fd17(0x206)]);_0x1d650a&&(_0x10ff66['entry_criteria'][_0x19fd17(0x206)]=_0x1d650a);}if(_0x10ff66[_0x19fd17(0x219)])for(const _0x18894d of _0x10ff66[_0x19fd17(0x219)]){if(_0x18894d[_0x19fd17(0x206)]){const _0x39d11f=_0x51ff2e['get'](_0x18894d[_0x19fd17(0x206)]);_0x39d11f&&(_0x18894d[_0x19fd17(0x206)]=_0x39d11f);}}if(_0x10ff66[_0x19fd17(0x217)]?.[_0x19fd17(0x206)]){const _0x20be80=_0x51ff2e[_0x19fd17(0x23d)](_0x10ff66['milestone'][_0x19fd17(0x206)]);_0x20be80&&(_0x10ff66[_0x19fd17(0x217)]['segment']=_0x20be80);}if(_0x10ff66['steps'])for(const _0x35912b of _0x10ff66[_0x19fd17(0x237)]){if(_0x35912b[_0x19fd17(0x21f)]==='decision_point'&&_0x35912b[_0x19fd17(0x1fa)]?.['branches'])for(const _0x1138e8 of _0x35912b[_0x19fd17(0x1fa)][_0x19fd17(0x22b)]){if(_0x1138e8[_0x19fd17(0x206)]){const _0xdd7528=_0x51ff2e[_0x19fd17(0x23d)](_0x1138e8[_0x19fd17(0x206)]);_0xdd7528&&(_0x1138e8[_0x19fd17(0x206)]=_0xdd7528);}}if(_0x35912b[_0x19fd17(0x21f)]===_0x19fd17(0x202)&&_0x35912b['with']?.['condition']?.[_0x19fd17(0x206)]){const _0x103cba=_0x51ff2e['get'](_0x35912b['with'][_0x19fd17(0x213)][_0x19fd17(0x206)]);_0x103cba&&(_0x35912b[_0x19fd17(0x1fa)][_0x19fd17(0x213)]['segment']=_0x103cba);}}}}export function updateSegmentRefsInSegments(_0x45cac7,_0x475567){const _0x785f0c=a144_0x3368;for(const _0x1ff83b of Object[_0x785f0c(0x216)](_0x45cac7)){_0x1ff83b[_0x785f0c(0x221)]&&updateSegmentRefsInRule(_0x1ff83b[_0x785f0c(0x221)],_0x475567);}}function updateSegmentRefsInRule(_0x3519e0,_0x598638){const _0x53198b=a144_0x3368;if(_0x3519e0===null||typeof _0x3519e0!==_0x53198b(0x22f))return;if(Array[_0x53198b(0x1f6)](_0x3519e0)){for(const _0x398eba of _0x3519e0){updateSegmentRefsInRule(_0x398eba,_0x598638);}return;}const _0x12b449=_0x3519e0;if((_0x12b449[_0x53198b(0x21f)]===_0x53198b(0x20a)||_0x12b449['type']===_0x53198b(0x1fd))&&typeof _0x12b449['segment']===_0x53198b(0x23a)){const _0x51fdaf=_0x598638[_0x53198b(0x23d)](_0x12b449[_0x53198b(0x206)]);_0x51fdaf&&(_0x12b449[_0x53198b(0x206)]=_0x51fdaf);}if(_0x12b449['conditions']&&Array[_0x53198b(0x1f6)](_0x12b449[_0x53198b(0x23e)]))for(const _0x5c01de of _0x12b449['conditions']){updateSegmentRefsInRule(_0x5c01de,_0x598638);}}function a144_0x3368(_0x5ba1a8,_0x2c7101){_0x5ba1a8=_0x5ba1a8-0x1f4;const _0x2cf248=a144_0x2cf2();let _0x3368f2=_0x2cf248[_0x5ba1a8];return _0x3368f2;}export function buildJourneysArray(_0x2a05d7,_0x2cba60){const _0x40fe8a=a144_0x3368;return _0x2a05d7[_0x40fe8a(0x218)](_0xcd85a5=>{const _0x2df23f=_0x40fe8a,_0x812d47=_0x2cba60?_0xcd85a5[_0x2df23f(0x1f5)]['id']===_0x2cba60:_0x2a05d7[_0x2df23f(0x205)]===0x1,_0x823554=_0xcd85a5[_0x2df23f(0x227)][_0x2df23f(0x231)]?.[0x0],_0x555f17=_0x823554?.[_0x2df23f(0x22a)]||_0xcd85a5['yaml']['goal'],_0x4d44f3={'version':_0x823554?.[_0x2df23f(0x239)]||_0xcd85a5[_0x2df23f(0x227)][_0x2df23f(0x239)]||_0xcd85a5[_0x2df23f(0x1f5)][_0x2df23f(0x22e)],'state':_0xcd85a5[_0x2df23f(0x1f5)]['state']===_0x2df23f(0x222)?_0x2df23f(0x222):'draft','stages':_0x823554?.[_0x2df23f(0x211)]||_0xcd85a5[_0x2df23f(0x227)][_0x2df23f(0x211)]||[],'id':_0x823554?.['id']||_0xcd85a5[_0x2df23f(0x227)]['id'],'version_number':_0x823554?.[_0x2df23f(0x209)]||_0xcd85a5[_0x2df23f(0x227)][_0x2df23f(0x209)]};return _0x555f17&&(_0x4d44f3[_0x2df23f(0x22a)]=_0x555f17),_0x812d47&&(_0x4d44f3[_0x2df23f(0x20d)]=!![]),_0x4d44f3;});}export function buildMergedJourneyDef(_0x360ade,_0x4cb625,_0x1cca71){const _0x294bc1=a144_0x3368,_0x319cd1=_0x360ade[0x0][_0x294bc1(0x227)],_0x1e9049=buildJourneysArray(_0x360ade,_0x1cca71),{merged:_0x26696a,nameMapping:_0x20a313}=consolidateSegmentsByContent(_0x360ade[_0x294bc1(0x218)](_0x48504f=>_0x48504f[_0x294bc1(0x227)]['segments']),_0x4cb625);updateSegmentRefsInSegments(_0x26696a,_0x20a313);const _0x46ab16=Array[_0x294bc1(0x1fe)](_0x20a313[_0x294bc1(0x21c)]())[_0x294bc1(0x234)](([_0x1b05bd,_0x33d429])=>_0x1b05bd!==_0x33d429&&_0x1b05bd[_0x294bc1(0x22c)](_0x294bc1(0x225)));let _0xb77a0=_0x26696a,_0x3c5761=new Map();if(_0x46ab16){const _0x5df1ce=consolidateSegmentsByContent([_0x26696a],_0x4cb625);_0xb77a0=_0x5df1ce[_0x294bc1(0x232)],_0x3c5761=_0x5df1ce[_0x294bc1(0x229)];}const _0xc2c175=new Map(_0x20a313);for(const [_0x5cbd4a,_0x2161a7]of _0x3c5761['entries']()){_0xc2c175['set'](_0x5cbd4a,_0x2161a7);}for(const [_0xace33,_0x8b3452]of _0xc2c175[_0x294bc1(0x21c)]()){let _0x352943=_0x8b3452,_0x4d05f2=0x0;while(_0xc2c175[_0x294bc1(0x22d)](_0x352943)&&_0xc2c175[_0x294bc1(0x23d)](_0x352943)!==_0x352943&&_0x4d05f2<MAX_MAPPING_CHAIN_DEPTH){_0x352943=_0xc2c175[_0x294bc1(0x23d)](_0x352943),_0x4d05f2++;}_0x352943!==_0x8b3452&&_0xc2c175[_0x294bc1(0x210)](_0xace33,_0x352943);}for(const _0x584da3 of _0x1e9049){updateSegmentReferences(_0x584da3[_0x294bc1(0x211)],_0xc2c175);}const {merged:_0xff308b,nameMapping:_0x914b1a}=consolidateActivationsByContent(_0x360ade[_0x294bc1(0x218)](_0x401314=>_0x401314[_0x294bc1(0x227)]['activations']));for(const _0x8aeaf3 of _0x1e9049){updateActivationReferences(_0x8aeaf3[_0x294bc1(0x211)],_0x914b1a);}let _0x1232c2=_0x319cd1['goal'];if(_0x1232c2?.['segment']){const _0x1f00bb=_0xc2c175[_0x294bc1(0x23d)](_0x1232c2[_0x294bc1(0x206)]);_0x1f00bb&&(_0x1232c2={..._0x1232c2,'segment':_0x1f00bb});}for(const _0x39b037 of _0x1e9049){if(_0x39b037['goal']?.[_0x294bc1(0x206)]){const _0x113d61=_0xc2c175['get'](_0x39b037[_0x294bc1(0x22a)][_0x294bc1(0x206)]);_0x113d61&&(_0x39b037[_0x294bc1(0x22a)]={..._0x39b037[_0x294bc1(0x22a)],'segment':_0x113d61});}}return _0x1e9049[_0x294bc1(0x234)](_0x2b267e=>_0x2b267e['goal'])&&(_0x1232c2=undefined),{'type':_0x294bc1(0x224),'name':_0x319cd1[_0x294bc1(0x22e)],'description':_0x319cd1['description'],'goal':_0x1232c2,'reentry':_0x319cd1[_0x294bc1(0x238)],'segments':Object[_0x294bc1(0x23b)](_0xb77a0)[_0x294bc1(0x205)]>0x0?_0xb77a0:undefined,'activations':Object[_0x294bc1(0x23b)](_0xff308b)[_0x294bc1(0x205)]>0x0?_0xff308b:undefined,'journeys':_0x1e9049,'bundle_id':_0x319cd1['bundle_id'],'bundle_name':_0x319cd1[_0x294bc1(0x233)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x15da04,_0x277f3d,_0x263ade,_0x350edf){const _0x281160=a144_0x3368,_0x5e9887=_0x15da04+':'+_0x277f3d,_0x2ba2a6=_0x263ade[_0x281160(0x23d)](_0x5e9887);if(_0x2ba2a6)return _0x2ba2a6;const _0x4c6a31=await _0x350edf(_0x15da04),_0x386790=_0x4c6a31['attributes']['journeyBundleName']||_0x4c6a31['attributes'][_0x281160(0x22e)],_0x2aa159=_0x4c6a31['attributes']['journeyStages'][_0x281160(0x20c)](_0x4c4252=>String(_0x4c4252['id'])===String(_0x277f3d)),_0x2e0d2e=_0x2aa159?.[_0x281160(0x22e)]||_0x277f3d,_0x23abb={'journeyName':_0x386790,'stageName':_0x2e0d2e};return _0x263ade[_0x281160(0x210)](_0x5e9887,_0x23abb),_0x23abb;}export function formatApiJourneyName(_0x2d270c,_0x2b0ee4){return _0x2b0ee4+'\x20('+_0x2d270c+')';}export function isLocalJourneyRef(_0xe02987){const _0xabf069=a144_0x3368;return _0xe02987[_0xabf069(0x20b)](_0xabf069(0x1f4))||_0xe02987['endsWith']('.yaml');}export function buildLocalRuleToNameMapping(_0x3fcad8){const _0x22f7c4=a144_0x3368,_0xe0fa3c=new Map();if(!_0x3fcad8)return _0xe0fa3c;for(const [_0x1bc1ee,_0x51732e]of Object[_0x22f7c4(0x21c)](_0x3fcad8)){if(_0x51732e[_0x22f7c4(0x221)]){const _0x57f0f3=serializeRule(_0x51732e[_0x22f7c4(0x221)]),_0x56aa9d=_0xe0fa3c['get'](_0x57f0f3)||[];_0x56aa9d[_0x22f7c4(0x230)](_0x1bc1ee),_0xe0fa3c[_0x22f7c4(0x210)](_0x57f0f3,_0x56aa9d);}}return _0xe0fa3c;}export function buildLocalRuleToNameMappingFromJourney(_0x4e4975){const _0x249111=a144_0x3368,_0x210251=_0x4e4975['segments'];if(!_0x210251)return new Map();const _0x5360f1=collectSegmentUsageCounts(_0x4e4975),_0x1459ce=new Map();let _0x3ab6d4=0x0;for(const [_0x241ddc,_0x75290]of Object['entries'](_0x210251)){if(!_0x75290['rule']){_0x3ab6d4++;continue;}const _0x368c63=serializeRule(_0x75290[_0x249111(0x221)]),_0x58b723=_0x1459ce[_0x249111(0x23d)](_0x368c63)||[];_0x58b723[_0x249111(0x230)]({'name':_0x241ddc,'index':_0x3ab6d4}),_0x1459ce['set'](_0x368c63,_0x58b723),_0x3ab6d4++;}const _0x26ab83=new Map();for(const [_0x3b63ea,_0x182b5f]of _0x1459ce){const _0x3d1df0=_0x182b5f['slice']()[_0x249111(0x1f8)]((_0x47e2e9,_0x5a1759)=>{const _0x5f528c=_0x249111,_0xc3436d=_0x5360f1[_0x5f528c(0x23d)](_0x47e2e9[_0x5f528c(0x22e)])||0x0,_0x26ba3e=_0x5360f1[_0x5f528c(0x23d)](_0x5a1759[_0x5f528c(0x22e)])||0x0;if(_0xc3436d!==_0x26ba3e)return _0x26ba3e-_0xc3436d;return _0x47e2e9[_0x5f528c(0x21b)]-_0x5a1759[_0x5f528c(0x21b)];})['map'](_0x17bc6a=>_0x17bc6a[_0x249111(0x22e)]);_0x26ab83['set'](_0x3b63ea,_0x3d1df0);}return _0x26ab83;}export function collectSegmentUsageCounts(_0x1461ca){const _0x355318=a144_0x3368,_0x3840e5=new Map(),_0x1028b9=_0x52851e=>{const _0x4add03=a144_0x3368;if(!_0x52851e)return;_0x3840e5[_0x4add03(0x210)](_0x52851e,(_0x3840e5['get'](_0x52851e)||0x0)+0x1);},_0x5b09a1=_0x52378f=>{const _0x572f56=a144_0x3368;for(const _0x48b3a5 of _0x52378f){_0x1028b9(_0x48b3a5[_0x572f56(0x225)]?.[_0x572f56(0x206)]);if(_0x48b3a5[_0x572f56(0x219)])for(const _0x4ef15d of _0x48b3a5[_0x572f56(0x219)]){_0x1028b9(_0x4ef15d[_0x572f56(0x206)]);}_0x1028b9(_0x48b3a5['milestone']?.['segment']);if(_0x48b3a5['steps'])for(const _0x463860 of _0x48b3a5[_0x572f56(0x237)]){if(_0x463860[_0x572f56(0x21f)]===_0x572f56(0x204))for(const _0x54f229 of _0x463860[_0x572f56(0x1fa)]['branches']){_0x1028b9(_0x54f229['segment']);}else _0x463860[_0x572f56(0x21f)]===_0x572f56(0x202)&&_0x1028b9(_0x463860[_0x572f56(0x1fa)][_0x572f56(0x213)]?.['segment']);}}};_0x1028b9(_0x1461ca[_0x355318(0x22a)]?.[_0x355318(0x206)]);if(_0x1461ca['journeys'])for(const _0x17e2b9 of _0x1461ca[_0x355318(0x231)]){_0x1028b9(_0x17e2b9[_0x355318(0x22a)]?.[_0x355318(0x206)]),_0x5b09a1(_0x17e2b9[_0x355318(0x211)]);}_0x1461ca['stages']&&_0x5b09a1(_0x1461ca['stages']);if(_0x1461ca[_0x355318(0x20f)])for(const _0x58f28e of _0x1461ca['versions']){_0x5b09a1(_0x58f28e['stages']);}return _0x3840e5;}
1
+ (function(_0x4031e0,_0x387f31){const _0x164256=a144_0x1659,_0x5c2d33=_0x4031e0();while(!![]){try{const _0x2dfbdb=-parseInt(_0x164256(0xa1))/0x1*(-parseInt(_0x164256(0xbb))/0x2)+parseInt(_0x164256(0xa3))/0x3+-parseInt(_0x164256(0x8b))/0x4+parseInt(_0x164256(0x94))/0x5*(parseInt(_0x164256(0xac))/0x6)+-parseInt(_0x164256(0xba))/0x7+parseInt(_0x164256(0x92))/0x8+parseInt(_0x164256(0xae))/0x9*(-parseInt(_0x164256(0x7d))/0xa);if(_0x2dfbdb===_0x387f31)break;else _0x5c2d33['push'](_0x5c2d33['shift']());}catch(_0x191edc){_0x5c2d33['push'](_0x5c2d33['shift']());}}}(a144_0x2a56,0x67f4f));function a144_0x1659(_0x510c69,_0x39e44b){_0x510c69=_0x510c69-0x76;const _0x2a564d=a144_0x2a56();let _0x1659b5=_0x2a564d[_0x510c69];return _0x1659b5;}import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x5abd44){const _0x1d37d9=a144_0x1659;return _0x5abd44[_0x1d37d9(0xbf)]()[_0x1d37d9(0x79)](/\s+/g,'_')[_0x1d37d9(0x79)](/[^a-z0-9_\p{L}\p{N}]/gu,'')['replace'](/_+/g,'_')[_0x1d37d9(0x79)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x523750){const _0x27e70a=a144_0x1659,_0x5cb944=_0x523750[_0x27e70a(0x8c)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x5cb944){const _0x29805f=_0x5cb944[0x1][_0x27e70a(0xbf)](),_0x26408f=_0x5cb944[0x2],_0x1a5f0f=_0x26408f[_0x27e70a(0x79)](/-/g,'')[_0x27e70a(0xa5)](0x0,0x4)[_0x27e70a(0xbf)]();return _0x29805f+'_'+_0x1a5f0f;}const _0x2db60d=_0x523750[_0x27e70a(0x8c)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x2db60d){const _0x1a43af=_0x2db60d[0x1],_0x28bce9=_0x2db60d[0x2][_0x27e70a(0xbf)](),_0x157c4e=_0x1a43af[_0x27e70a(0x79)](/-/g,'')[_0x27e70a(0xa5)](0x0,0x4)[_0x27e70a(0xbf)]();return _0x28bce9+'_'+_0x157c4e;}return undefined;}function stableStringify(_0x74eeed){const _0x46c995=a144_0x1659;if(Array[_0x46c995(0x9e)](_0x74eeed))return'['+_0x74eeed[_0x46c995(0xb7)](_0x2d4943=>stableStringify(_0x2d4943))[_0x46c995(0x9d)](',')+']';if(_0x74eeed&&typeof _0x74eeed===_0x46c995(0x98)){const _0x3e0e10=_0x74eeed,_0x4d42c6=Object['keys'](_0x3e0e10)[_0x46c995(0x84)](),_0x46a123=_0x4d42c6['map'](_0x2af674=>'\x22'+_0x2af674+'\x22:'+stableStringify(_0x3e0e10[_0x2af674]));return'{'+_0x46a123['join'](',')+'}';}const _0x1427e3=JSON[_0x46c995(0x81)](_0x74eeed);return _0x1427e3===undefined?'null':_0x1427e3;}export function consolidateActivationsByContent(_0x1f9f36){const _0x41b58c=a144_0x1659,_0x258dfa={},_0x56e123=new Map(),_0x2b2ab7=new Map();for(const _0xa92b6e of _0x1f9f36){if(!_0xa92b6e)continue;for(const [_0x3a5762,_0x3ecba7]of Object[_0x41b58c(0xb5)](_0xa92b6e)){const _0x54bd17={'name':_0x3ecba7['name'],'connection':_0x3ecba7[_0x41b58c(0x8d)],..._0x3ecba7[_0x41b58c(0x9b)]!==undefined&&{'all_columns':_0x3ecba7[_0x41b58c(0x9b)]},..._0x3ecba7['columns']!==undefined&&{'columns':_0x3ecba7['columns']},..._0x3ecba7['behavior']!==undefined&&{'behavior':_0x3ecba7[_0x41b58c(0xab)]},..._0x3ecba7[_0x41b58c(0xa4)]!==undefined&&{'schedule':_0x3ecba7[_0x41b58c(0xa4)]},..._0x3ecba7[_0x41b58c(0x95)]!==undefined&&{'notification':_0x3ecba7['notification']},..._0x3ecba7[_0x41b58c(0xad)]!==undefined&&{'connector_config':_0x3ecba7[_0x41b58c(0xad)]},..._0x3ecba7[_0x41b58c(0xb2)]!==undefined&&{'activation_template_id':_0x3ecba7[_0x41b58c(0xb2)]}},_0x3c0f74=stableStringify(_0x54bd17),_0x3d0b42=_0x2b2ab7[_0x41b58c(0xb6)](_0x3c0f74);_0x3d0b42?_0x56e123[_0x41b58c(0x77)](_0x3a5762,_0x3d0b42):(_0x258dfa[_0x3a5762]=_0x3ecba7,_0x56e123['set'](_0x3a5762,_0x3a5762),_0x2b2ab7[_0x41b58c(0x77)](_0x3c0f74,_0x3a5762));}}return{'merged':_0x258dfa,'nameMapping':_0x56e123};}export function updateActivationReferences(_0x165fe0,_0x5a3e56){const _0x445912=a144_0x1659;if(!_0x165fe0)return;for(const _0x8bef4f of _0x165fe0){if(!_0x8bef4f['steps'])continue;for(const _0x5992a6 of _0x8bef4f[_0x445912(0xb9)]){if(_0x5992a6[_0x445912(0xa8)]==='activation'&&_0x5992a6[_0x445912(0x9c)]?.[_0x445912(0xbc)]){const _0x33adaf=_0x5a3e56[_0x445912(0xb6)](_0x5992a6[_0x445912(0x9c)]['activation']);_0x33adaf&&_0x33adaf!==_0x5992a6[_0x445912(0x9c)][_0x445912(0xbc)]&&(_0x5992a6[_0x445912(0x9c)][_0x445912(0xbc)]=_0x33adaf);}}}}function a144_0x2a56(){const _0x35c0f8=['222520SHVhrn','match','connection','bundle_id','rule','version_number','stages','6221344MzRzmF','journeys','1236405roAtje','notification','bundle_name','has','object','state','description','all_columns','with','join','isArray','.yml','journeyBundleName','1KvSoBt','nameMapping','1989141AzSSnp','schedule','slice','push','activations','type','condition','segment','behavior','12OjZwBu','connector_config','223848Jjmnbf','length','milestone','include','activation_template_id','launched','startsWith','entries','get','map','exit_criteria','steps','2325659ORjdhU','243994KMbptu','activation','conditions','some','toLowerCase','draft','index','merged','goal','attributes','segments','branches','set','endsWith','replace','name','version','yaml','500QfeAwr','entry_criteria','keys','from','stringify','journey','decision_point','sort','item','wait','find','.yaml','versions','trim'];a144_0x2a56=function(){return _0x35c0f8;};return a144_0x2a56();}export function consolidateSegmentsByContent(_0x4af917,_0xb4ad52){const _0x57c030=a144_0x1659,_0x5bbb4b={},_0xda5662=new Map(),_0x5b2565=new Map();for(const _0x31f559 of _0x4af917){if(!_0x31f559)continue;for(const [_0x4aad68,_0x3f1e4c]of Object['entries'](_0x31f559)){if(!_0x3f1e4c[_0x57c030(0x8f)]){_0x5bbb4b[_0x4aad68]=_0x3f1e4c,_0xda5662[_0x57c030(0x77)](_0x4aad68,_0x4aad68);continue;}const _0x24aa75=_0x3f1e4c[_0x57c030(0x9a)]&&_0x3f1e4c[_0x57c030(0x9a)][_0x57c030(0x8a)]()?_0x3f1e4c['description']:undefined,_0x21384e=JSON['stringify']({'description':_0x24aa75,'rule':deepSortObject(_0x3f1e4c[_0x57c030(0x8f)])}),_0x3646a1=_0x5b2565[_0x57c030(0xb6)](_0x21384e);if(_0x3646a1){const _0x5bba49={..._0x3f1e4c[_0x57c030(0x9a)]!==undefined&&{'description':_0x3f1e4c['description']},'rule':_0x3f1e4c[_0x57c030(0x8f)]?deepSortObject(_0x3f1e4c[_0x57c030(0x8f)]):_0x3f1e4c[_0x57c030(0x8f)]};if(_0x4aad68<_0x3646a1){_0x5bbb4b[_0x4aad68]=_0x5bba49,delete _0x5bbb4b[_0x3646a1];for(const [_0x3afd7d,_0x159ca6]of _0xda5662[_0x57c030(0xb5)]()){_0x159ca6===_0x3646a1&&_0xda5662[_0x57c030(0x77)](_0x3afd7d,_0x4aad68);}_0xda5662[_0x57c030(0x77)](_0x4aad68,_0x4aad68),_0x5b2565[_0x57c030(0x77)](_0x21384e,_0x4aad68);}else _0x5bbb4b[_0x3646a1]=_0x5bba49,_0xda5662[_0x57c030(0x77)](_0x4aad68,_0x3646a1);}else{let _0x10279b=_0x4aad68;if(_0xb4ad52){const _0x273701=_0xb4ad52['get'](_0x21384e);_0x273701&&_0x273701['length']>0x0&&(_0x10279b=_0x273701[_0x57c030(0xa5)]()['sort']()[0x0]);}const _0x1f1082={..._0x3f1e4c['description']!==undefined&&{'description':_0x3f1e4c[_0x57c030(0x9a)]},'rule':_0x3f1e4c['rule']?deepSortObject(_0x3f1e4c['rule']):_0x3f1e4c[_0x57c030(0x8f)]};_0x5bbb4b[_0x10279b]=_0x1f1082,_0xda5662[_0x57c030(0x77)](_0x4aad68,_0x10279b),_0x5b2565['set'](_0x21384e,_0x10279b);}}}return{'merged':_0x5bbb4b,'nameMapping':_0xda5662};}export function updateSegmentReferences(_0x2569ef,_0x54142f){const _0x3388d6=a144_0x1659;if(!_0x2569ef)return;for(const _0x279595 of _0x2569ef){if(_0x279595[_0x3388d6(0x7e)]?.[_0x3388d6(0xaa)]){const _0x239f17=_0x54142f[_0x3388d6(0xb6)](_0x279595['entry_criteria'][_0x3388d6(0xaa)]);_0x239f17&&(_0x279595['entry_criteria'][_0x3388d6(0xaa)]=_0x239f17);}if(_0x279595[_0x3388d6(0xb8)])for(const _0x3a8b34 of _0x279595[_0x3388d6(0xb8)]){if(_0x3a8b34[_0x3388d6(0xaa)]){const _0x4899fc=_0x54142f['get'](_0x3a8b34[_0x3388d6(0xaa)]);_0x4899fc&&(_0x3a8b34[_0x3388d6(0xaa)]=_0x4899fc);}}if(_0x279595[_0x3388d6(0xb0)]?.[_0x3388d6(0xaa)]){const _0x5bee2f=_0x54142f[_0x3388d6(0xb6)](_0x279595[_0x3388d6(0xb0)][_0x3388d6(0xaa)]);_0x5bee2f&&(_0x279595[_0x3388d6(0xb0)]['segment']=_0x5bee2f);}if(_0x279595['steps'])for(const _0x3fb4af of _0x279595[_0x3388d6(0xb9)]){if(_0x3fb4af[_0x3388d6(0xa8)]===_0x3388d6(0x83)&&_0x3fb4af[_0x3388d6(0x9c)]?.[_0x3388d6(0x76)])for(const _0x4b2eb0 of _0x3fb4af[_0x3388d6(0x9c)][_0x3388d6(0x76)]){if(_0x4b2eb0[_0x3388d6(0xaa)]){const _0xc03833=_0x54142f['get'](_0x4b2eb0[_0x3388d6(0xaa)]);_0xc03833&&(_0x4b2eb0[_0x3388d6(0xaa)]=_0xc03833);}}if(_0x3fb4af[_0x3388d6(0xa8)]===_0x3388d6(0x86)&&_0x3fb4af[_0x3388d6(0x9c)]?.[_0x3388d6(0xa9)]?.[_0x3388d6(0xaa)]){const _0x5c50cf=_0x54142f[_0x3388d6(0xb6)](_0x3fb4af['with'][_0x3388d6(0xa9)]['segment']);_0x5c50cf&&(_0x3fb4af[_0x3388d6(0x9c)][_0x3388d6(0xa9)]['segment']=_0x5c50cf);}}}}export function updateSegmentRefsInSegments(_0x1be4f3,_0x5dc7bd){const _0x534107=a144_0x1659;for(const _0x43d138 of Object['values'](_0x1be4f3)){_0x43d138['rule']&&updateSegmentRefsInRule(_0x43d138[_0x534107(0x8f)],_0x5dc7bd);}}function updateSegmentRefsInRule(_0x4f0f57,_0x159fa8){const _0x12ae8e=a144_0x1659;if(_0x4f0f57===null||typeof _0x4f0f57!=='object')return;if(Array['isArray'](_0x4f0f57)){for(const _0x5ab5bf of _0x4f0f57){updateSegmentRefsInRule(_0x5ab5bf,_0x159fa8);}return;}const _0x1e905c=_0x4f0f57;if((_0x1e905c[_0x12ae8e(0xa8)]===_0x12ae8e(0xb1)||_0x1e905c[_0x12ae8e(0xa8)]==='exclude')&&typeof _0x1e905c[_0x12ae8e(0xaa)]==='string'){const _0xce63ea=_0x159fa8[_0x12ae8e(0xb6)](_0x1e905c[_0x12ae8e(0xaa)]);_0xce63ea&&(_0x1e905c[_0x12ae8e(0xaa)]=_0xce63ea);}if(_0x1e905c['conditions']&&Array[_0x12ae8e(0x9e)](_0x1e905c[_0x12ae8e(0xbd)]))for(const _0x257288 of _0x1e905c[_0x12ae8e(0xbd)]){updateSegmentRefsInRule(_0x257288,_0x159fa8);}}export function buildJourneysArray(_0xf7f46e,_0x1c3d85){const _0x12c218=a144_0x1659;return _0xf7f46e[_0x12c218(0xb7)](_0x2a17de=>{const _0x544240=_0x12c218,_0x196161=_0x1c3d85?_0x2a17de[_0x544240(0x85)]['id']===_0x1c3d85:_0xf7f46e[_0x544240(0xaf)]===0x1,_0x311897=_0x2a17de[_0x544240(0x7c)][_0x544240(0x93)]?.[0x0],_0x4b047d=_0x311897?.[_0x544240(0xc3)]||_0x2a17de[_0x544240(0x7c)]['goal'],_0xfcd0ac={'version':_0x311897?.[_0x544240(0x7b)]||_0x2a17de[_0x544240(0x7c)]['version']||_0x2a17de[_0x544240(0x85)]['name'],'state':_0x2a17de['item'][_0x544240(0x99)]===_0x544240(0xb3)?_0x544240(0xb3):_0x544240(0xc0),'stages':_0x311897?.['stages']||_0x2a17de[_0x544240(0x7c)][_0x544240(0x91)]||[],'id':_0x311897?.['id']||_0x2a17de[_0x544240(0x7c)]['id'],'version_number':_0x311897?.[_0x544240(0x90)]||_0x2a17de[_0x544240(0x7c)]['version_number']};return _0x4b047d&&(_0xfcd0ac[_0x544240(0xc3)]=_0x4b047d),_0x196161&&(_0xfcd0ac['latest']=!![]),_0xfcd0ac;});}export function buildMergedJourneyDef(_0x285dc5,_0x346e11,_0x51e8a2){const _0x6cbe94=a144_0x1659,_0x459bad=_0x285dc5[0x0][_0x6cbe94(0x7c)],_0x3b6a72=buildJourneysArray(_0x285dc5,_0x51e8a2),{merged:_0x31d1b9,nameMapping:_0x23e9c6}=consolidateSegmentsByContent(_0x285dc5['map'](_0x4c9cb7=>_0x4c9cb7[_0x6cbe94(0x7c)][_0x6cbe94(0xc5)]),_0x346e11);updateSegmentRefsInSegments(_0x31d1b9,_0x23e9c6);const _0x15ca81=Array[_0x6cbe94(0x80)](_0x23e9c6['entries']())[_0x6cbe94(0xbe)](([_0x30c09c,_0x47cb4f])=>_0x30c09c!==_0x47cb4f&&_0x30c09c[_0x6cbe94(0xb4)](_0x6cbe94(0x7e)));let _0x47e9db=_0x31d1b9,_0x1c5440=new Map();if(_0x15ca81){const _0x41e135=consolidateSegmentsByContent([_0x31d1b9],_0x346e11);_0x47e9db=_0x41e135[_0x6cbe94(0xc2)],_0x1c5440=_0x41e135[_0x6cbe94(0xa2)];}const _0x526cab=new Map(_0x23e9c6);for(const [_0x7d708f,_0xb1e35a]of _0x1c5440['entries']()){_0x526cab['set'](_0x7d708f,_0xb1e35a);}for(const [_0x514697,_0x163c5f]of _0x526cab[_0x6cbe94(0xb5)]()){let _0x2f95e9=_0x163c5f,_0x1bce45=0x0;while(_0x526cab[_0x6cbe94(0x97)](_0x2f95e9)&&_0x526cab[_0x6cbe94(0xb6)](_0x2f95e9)!==_0x2f95e9&&_0x1bce45<MAX_MAPPING_CHAIN_DEPTH){_0x2f95e9=_0x526cab['get'](_0x2f95e9),_0x1bce45++;}_0x2f95e9!==_0x163c5f&&_0x526cab[_0x6cbe94(0x77)](_0x514697,_0x2f95e9);}for(const _0x3887bc of _0x3b6a72){updateSegmentReferences(_0x3887bc[_0x6cbe94(0x91)],_0x526cab);}const {merged:_0x85c1f8,nameMapping:_0x2de40e}=consolidateActivationsByContent(_0x285dc5['map'](_0x1af331=>_0x1af331[_0x6cbe94(0x7c)][_0x6cbe94(0xa7)]));for(const _0x368af2 of _0x3b6a72){updateActivationReferences(_0x368af2[_0x6cbe94(0x91)],_0x2de40e);}let _0x2bb82e=_0x459bad['goal'];if(_0x2bb82e?.[_0x6cbe94(0xaa)]){const _0x4915ab=_0x526cab[_0x6cbe94(0xb6)](_0x2bb82e[_0x6cbe94(0xaa)]);_0x4915ab&&(_0x2bb82e={..._0x2bb82e,'segment':_0x4915ab});}for(const _0x5dae61 of _0x3b6a72){if(_0x5dae61[_0x6cbe94(0xc3)]?.[_0x6cbe94(0xaa)]){const _0x1f0764=_0x526cab['get'](_0x5dae61[_0x6cbe94(0xc3)][_0x6cbe94(0xaa)]);_0x1f0764&&(_0x5dae61[_0x6cbe94(0xc3)]={..._0x5dae61[_0x6cbe94(0xc3)],'segment':_0x1f0764});}}return _0x3b6a72[_0x6cbe94(0xbe)](_0x520fd5=>_0x520fd5[_0x6cbe94(0xc3)])&&(_0x2bb82e=undefined),{'type':_0x6cbe94(0x82),'name':_0x459bad[_0x6cbe94(0x7a)],'description':_0x459bad['description'],'goal':_0x2bb82e,'reentry':_0x459bad['reentry'],'segments':Object[_0x6cbe94(0x7f)](_0x47e9db)[_0x6cbe94(0xaf)]>0x0?_0x47e9db:undefined,'activations':Object['keys'](_0x85c1f8)['length']>0x0?_0x85c1f8:undefined,'journeys':_0x3b6a72,'bundle_id':_0x459bad[_0x6cbe94(0x8e)],'bundle_name':_0x459bad[_0x6cbe94(0x96)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x262833,_0xcc485e,_0x5c4a43,_0x239f06){const _0x425459=a144_0x1659,_0x16cf25=_0x262833+':'+_0xcc485e,_0x1c232a=_0x5c4a43[_0x425459(0xb6)](_0x16cf25);if(_0x1c232a)return _0x1c232a;const _0x38e134=await _0x239f06(_0x262833),_0x4a3d42=_0x38e134[_0x425459(0xc4)][_0x425459(0xa0)]||_0x38e134[_0x425459(0xc4)][_0x425459(0x7a)],_0x5af075=_0x38e134[_0x425459(0xc4)]['journeyStages'][_0x425459(0x87)](_0x233da1=>String(_0x233da1['id'])===String(_0xcc485e)),_0x49215d=_0x5af075?.[_0x425459(0x7a)]||_0xcc485e,_0x29d225={'journeyName':_0x4a3d42,'stageName':_0x49215d};return _0x5c4a43[_0x425459(0x77)](_0x16cf25,_0x29d225),_0x29d225;}export function formatApiJourneyName(_0x366c9f,_0x4fb143){return _0x4fb143+'\x20('+_0x366c9f+')';}export function isLocalJourneyRef(_0x128a0a){const _0x4cdd34=a144_0x1659;return _0x128a0a[_0x4cdd34(0x78)](_0x4cdd34(0x9f))||_0x128a0a['endsWith'](_0x4cdd34(0x88));}export function buildLocalRuleToNameMapping(_0x54176c){const _0x3a927a=a144_0x1659,_0x2a35d3=new Map();if(!_0x54176c)return _0x2a35d3;for(const [_0x5486d7,_0x1e96aa]of Object[_0x3a927a(0xb5)](_0x54176c)){if(_0x1e96aa[_0x3a927a(0x8f)]){const _0x1e732b=serializeRule(_0x1e96aa[_0x3a927a(0x8f)]),_0x153218=_0x2a35d3[_0x3a927a(0xb6)](_0x1e732b)||[];_0x153218[_0x3a927a(0xa6)](_0x5486d7),_0x2a35d3[_0x3a927a(0x77)](_0x1e732b,_0x153218);}}return _0x2a35d3;}export function buildLocalRuleToNameMappingFromJourney(_0xe3ebb8){const _0x32abdf=a144_0x1659,_0x4f7c31=_0xe3ebb8[_0x32abdf(0xc5)];if(!_0x4f7c31)return new Map();const _0x4efa45=collectSegmentUsageCounts(_0xe3ebb8),_0x1d7b42=new Map();let _0x16f720=0x0;for(const [_0x5413ee,_0x142999]of Object['entries'](_0x4f7c31)){if(!_0x142999[_0x32abdf(0x8f)]){_0x16f720++;continue;}const _0x28912a=serializeRule(_0x142999[_0x32abdf(0x8f)]),_0x30c9bb=_0x1d7b42[_0x32abdf(0xb6)](_0x28912a)||[];_0x30c9bb[_0x32abdf(0xa6)]({'name':_0x5413ee,'index':_0x16f720}),_0x1d7b42[_0x32abdf(0x77)](_0x28912a,_0x30c9bb),_0x16f720++;}const _0x552fcb=new Map();for(const [_0x97052a,_0x556290]of _0x1d7b42){const _0x145437=_0x556290['slice']()['sort']((_0xe7bd68,_0x5348a0)=>{const _0x39a950=_0x32abdf,_0x507daf=_0x4efa45[_0x39a950(0xb6)](_0xe7bd68[_0x39a950(0x7a)])||0x0,_0x1e0268=_0x4efa45['get'](_0x5348a0[_0x39a950(0x7a)])||0x0;if(_0x507daf!==_0x1e0268)return _0x1e0268-_0x507daf;return _0xe7bd68[_0x39a950(0xc1)]-_0x5348a0['index'];})[_0x32abdf(0xb7)](_0x141d7a=>_0x141d7a[_0x32abdf(0x7a)]);_0x552fcb[_0x32abdf(0x77)](_0x97052a,_0x145437);}return _0x552fcb;}export function collectSegmentUsageCounts(_0x21761a){const _0x139c64=a144_0x1659,_0x234975=new Map(),_0x26ba94=_0x137cda=>{const _0x5e162b=a144_0x1659;if(!_0x137cda)return;_0x234975[_0x5e162b(0x77)](_0x137cda,(_0x234975['get'](_0x137cda)||0x0)+0x1);},_0x1bb0e7=_0x3e86ad=>{const _0x33f6d7=a144_0x1659;for(const _0x4b8ae5 of _0x3e86ad){_0x26ba94(_0x4b8ae5[_0x33f6d7(0x7e)]?.[_0x33f6d7(0xaa)]);if(_0x4b8ae5[_0x33f6d7(0xb8)])for(const _0x2123db of _0x4b8ae5['exit_criteria']){_0x26ba94(_0x2123db[_0x33f6d7(0xaa)]);}_0x26ba94(_0x4b8ae5['milestone']?.[_0x33f6d7(0xaa)]);if(_0x4b8ae5[_0x33f6d7(0xb9)])for(const _0x4b7cc5 of _0x4b8ae5[_0x33f6d7(0xb9)]){if(_0x4b7cc5[_0x33f6d7(0xa8)]===_0x33f6d7(0x83))for(const _0x481554 of _0x4b7cc5[_0x33f6d7(0x9c)]['branches']){_0x26ba94(_0x481554[_0x33f6d7(0xaa)]);}else _0x4b7cc5[_0x33f6d7(0xa8)]==='wait'&&_0x26ba94(_0x4b7cc5[_0x33f6d7(0x9c)][_0x33f6d7(0xa9)]?.[_0x33f6d7(0xaa)]);}}};_0x26ba94(_0x21761a[_0x139c64(0xc3)]?.['segment']);if(_0x21761a[_0x139c64(0x93)])for(const _0x3e2731 of _0x21761a[_0x139c64(0x93)]){_0x26ba94(_0x3e2731[_0x139c64(0xc3)]?.['segment']),_0x1bb0e7(_0x3e2731[_0x139c64(0x91)]);}_0x21761a[_0x139c64(0x91)]&&_0x1bb0e7(_0x21761a[_0x139c64(0x91)]);if(_0x21761a[_0x139c64(0x89)])for(const _0x1bd892 of _0x21761a[_0x139c64(0x89)]){_0x1bb0e7(_0x1bd892[_0x139c64(0x91)]);}return _0x234975;}