@treasuredata/tdx 0.16.2 → 0.16.4

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 (162) 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/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.d.ts +3 -0
  25. package/dist/commands/mcp-command.d.ts.map +1 -1
  26. package/dist/commands/mcp-command.js +1 -1
  27. package/dist/commands/mcp-command.js.map +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/segment-command.js +1 -1
  33. package/dist/commands/segment-create-command.js +1 -1
  34. package/dist/commands/segment-fields-command.js +1 -1
  35. package/dist/commands/segment-pull-command.js +1 -1
  36. package/dist/commands/segment-push-command.js +1 -1
  37. package/dist/commands/segment-update-command.js +1 -1
  38. package/dist/commands/segment-use-command.js +1 -1
  39. package/dist/commands/segment-validate-command.js +1 -1
  40. package/dist/commands/segments.js +1 -1
  41. package/dist/commands/show.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/unset-command.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/command-output.js +1 -1
  49. package/dist/core/config.js +1 -1
  50. package/dist/core/connection-cache.js +1 -1
  51. package/dist/core/constants.js +1 -1
  52. package/dist/core/credential-cache.js +1 -1
  53. package/dist/core/global-context.js +1 -1
  54. package/dist/core/keychain.js +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/project-config.js +1 -1
  57. package/dist/core/session.js +1 -1
  58. package/dist/core/user-cache.js +1 -1
  59. package/dist/core/version.js +1 -1
  60. package/dist/index.js +1 -1
  61. package/dist/mcp/server.js +1 -1
  62. package/dist/mcp/tools/index.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js +1 -1
  64. package/dist/mcp/tools/tdx-search.js +1 -1
  65. package/dist/mcp/utils.js +1 -1
  66. package/dist/proxy/anthropic-adapter.js +1 -1
  67. package/dist/proxy/claude-usage-tracker.js +1 -1
  68. package/dist/proxy/context-signature.js +1 -1
  69. package/dist/proxy/conversation-utils.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/server.js +1 -1
  72. package/dist/proxy/session-cache.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/api.js +1 -1
  83. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  84. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  85. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  86. package/dist/sdk/claude-agent/environment.d.ts +9 -0
  87. package/dist/sdk/claude-agent/environment.d.ts.map +1 -1
  88. package/dist/sdk/claude-agent/environment.js +1 -1
  89. package/dist/sdk/claude-agent/environment.js.map +1 -1
  90. package/dist/sdk/claude-agent/index.js +1 -1
  91. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  92. package/dist/sdk/client/cdp-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/rate-limiter.js +1 -1
  98. package/dist/sdk/client/td-api-client.js +1 -1
  99. package/dist/sdk/client/trino-api-client.js +1 -1
  100. package/dist/sdk/client/workflow-client.js +1 -1
  101. package/dist/sdk/connection-validator.js +1 -1
  102. package/dist/sdk/connection.js +1 -1
  103. package/dist/sdk/engage.js +1 -1
  104. package/dist/sdk/errors.js +1 -1
  105. package/dist/sdk/index.js +1 -1
  106. package/dist/sdk/io/index.js +1 -1
  107. package/dist/sdk/io/node-filesystem.js +1 -1
  108. package/dist/sdk/job.js +1 -1
  109. package/dist/sdk/journey.js +1 -1
  110. package/dist/sdk/llm/chat-cache.js +1 -1
  111. package/dist/sdk/llm/index.js +1 -1
  112. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  113. package/dist/sdk/llm/model-aliases.js +1 -1
  114. package/dist/sdk/llm/model-factors.js +1 -1
  115. package/dist/sdk/query/index.js +1 -1
  116. package/dist/sdk/query/sql-parser.js +1 -1
  117. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/fields-display.js +1 -1
  119. package/dist/sdk/segment/file-discovery.js +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-yaml.js +1 -1
  122. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  123. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  124. package/dist/sdk/segment/pull-workflow.js +1 -1
  125. package/dist/sdk/segment/push-workflow.js +1 -1
  126. package/dist/sdk/segment/resolution-context.js +1 -1
  127. package/dist/sdk/segment/segment-path-parser.js +1 -1
  128. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  129. package/dist/sdk/segment/target-resolution.js +1 -1
  130. package/dist/sdk/segment/tdx-config.js +1 -1
  131. package/dist/sdk/segment/validate-files.js +1 -1
  132. package/dist/sdk/segment/yaml-validator.js +1 -1
  133. package/dist/sdk/segment.js +1 -1
  134. package/dist/sdk/types/index.js +1 -1
  135. package/dist/sdk/types/progress.js +1 -1
  136. package/dist/sdk/user.js +1 -1
  137. package/dist/sdk/util/format-detector.js +1 -1
  138. package/dist/sdk/util/formatters.js +1 -1
  139. package/dist/sdk/util/index.js +1 -1
  140. package/dist/sdk/util/tree-formatter.js +1 -1
  141. package/dist/sdk/workflow/clone-workflow.js +1 -1
  142. package/dist/sdk/workflow/index.js +1 -1
  143. package/dist/sdk/workflow/pull-workflow.js +1 -1
  144. package/dist/sdk/workflow/push-workflow.js +1 -1
  145. package/dist/sdk/workflow/tdx-config.js +1 -1
  146. package/dist/sdk/workflow/workflow-utils.js +1 -1
  147. package/dist/utils/async.js +1 -1
  148. package/dist/utils/colors.js +1 -1
  149. package/dist/utils/diff.js +1 -1
  150. package/dist/utils/file-permissions.js +1 -1
  151. package/dist/utils/json-loader.js +1 -1
  152. package/dist/utils/option-validation.js +1 -1
  153. package/dist/utils/port.js +1 -1
  154. package/dist/utils/process.js +1 -1
  155. package/dist/utils/prompt.js +1 -1
  156. package/dist/utils/spinner.js +1 -1
  157. package/dist/utils/sse-parser.js +1 -1
  158. package/dist/utils/string-utils.js +1 -1
  159. package/dist/utils/table-ref-parser.js +1 -1
  160. package/dist/utils/tdx-logger.js +1 -1
  161. package/dist/utils/version-check.js +1 -1
  162. package/package.json +1 -1
@@ -1 +1 @@
1
- const a111_0x22e1b1=a111_0x3211;(function(_0x44aa72,_0x551fa5){const _0x3243a4=a111_0x3211,_0x34e0d6=_0x44aa72();while(!![]){try{const _0x12146c=parseInt(_0x3243a4(0xcf))/0x1+parseInt(_0x3243a4(0xb3))/0x2*(-parseInt(_0x3243a4(0x11e))/0x3)+parseInt(_0x3243a4(0x10b))/0x4+-parseInt(_0x3243a4(0xfd))/0x5*(parseInt(_0x3243a4(0xf1))/0x6)+parseInt(_0x3243a4(0xe6))/0x7*(-parseInt(_0x3243a4(0x137))/0x8)+-parseInt(_0x3243a4(0xba))/0x9*(parseInt(_0x3243a4(0xe0))/0xa)+parseInt(_0x3243a4(0xab))/0xb*(parseInt(_0x3243a4(0xfb))/0xc);if(_0x12146c===_0x551fa5)break;else _0x34e0d6['push'](_0x34e0d6['shift']());}catch(_0x3d8f46){_0x34e0d6['push'](_0x34e0d6['shift']());}}}(a111_0x1577,0xf014b));import*as a111_0x15b77d from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x1f006d,_0x1f4e42){const _0x4f3a8b=a111_0x3211,_0x4a8b31=_0x1f006d[_0x4f3a8b(0x134)]&&_0x4f3a8b(0x11c)in _0x1f006d[_0x4f3a8b(0x134)]&&_0x1f006d[_0x4f3a8b(0x134)]['type'];return{'type':'segment','name':_0x1f006d[_0x4f3a8b(0xaf)],..._0x1f006d[_0x4f3a8b(0xdf)]&&{'description':_0x1f006d[_0x4f3a8b(0xdf)]},..._0x1f4e42&&{'folder':_0x1f4e42},..._0x4a8b31&&{'rule':apiRuleToYaml(_0x1f006d[_0x4f3a8b(0x134)])},..._0x1f006d[_0x4f3a8b(0x12b)]!==undefined&&{'kind':_0x1f006d['kind']===0x0?'batch':_0x1f006d[_0x4f3a8b(0x12b)]===0x1?_0x4f3a8b(0x112):_0x4f3a8b(0xad)},..._0x1f006d['isVisible']!==undefined&&{'visible':_0x1f006d['isVisible']}};}export async function segmentResponseToDef(_0x4de483,_0x27abd2,_0x58f315){const _0xc9f9ba=a111_0x3211,_0x31590d=segmentResponseToDefSync(_0x4de483,_0x58f315);if(!_0x27abd2||!_0x27abd2[_0xc9f9ba(0xd7)])return _0x31590d;return _0x31590d['rule']&&(_0x31590d['rule']=await resolveRuleSegmentRefs(_0x31590d[_0xc9f9ba(0x134)],_0x27abd2[_0xc9f9ba(0xd7)])),_0x31590d;}export function apiRuleToYaml(_0xf2e09e){const _0x3418f3=a111_0x3211,_0x2a220e=(_0xf2e09e[_0x3418f3(0x119)]||[])[_0x3418f3(0xb0)](apiConditionToYaml);if(_0x2a220e[_0x3418f3(0x105)]===0x1&&!_0xf2e09e[_0x3418f3(0xdf)]&&_0x3418f3(0x11c)in _0x2a220e[0x0]&&(_0x2a220e[0x0][_0x3418f3(0x11c)]===_0x3418f3(0xf6)||_0x2a220e[0x0]['type']==='Or')){const _0x51ae88=_0x2a220e[0x0];if(_0x51ae88[_0x3418f3(0x11c)]===_0xf2e09e[_0x3418f3(0x11c)]&&_0x51ae88[_0x3418f3(0x119)])return{'type':_0xf2e09e['type'],'conditions':_0x51ae88[_0x3418f3(0x119)],..._0x51ae88['description']&&{'description':_0x51ae88[_0x3418f3(0xdf)]}};}return{'type':_0xf2e09e[_0x3418f3(0x11c)],'conditions':_0x2a220e,..._0xf2e09e[_0x3418f3(0xdf)]&&{'description':_0xf2e09e[_0x3418f3(0xdf)]}};}export async function resolveRuleSegmentRefs(_0x3798d6,_0x391a44){const _0x42d104=a111_0x3211,_0xeacbca=await Promise[_0x42d104(0x102)](_0x3798d6[_0x42d104(0x119)][_0x42d104(0xb0)](_0x3bd247=>resolveConditionSegmentRefs(_0x3bd247,_0x391a44)));return{..._0x3798d6,'conditions':_0xeacbca};}async function resolveConditionSegmentRefs(_0x60d067,_0x25bb61){const _0x5d89f4=a111_0x3211;if(_0x5d89f4(0xcb)in _0x60d067&&(_0x60d067[_0x5d89f4(0x11c)]==='include'||_0x60d067['type']===_0x5d89f4(0xe5))){const _0x1fec52=_0x60d067;if(/^\d+$/[_0x5d89f4(0x12a)](_0x1fec52[_0x5d89f4(0xcb)])){const _0xd358fc=await _0x25bb61(_0x1fec52[_0x5d89f4(0xcb)]);return{..._0x1fec52,'segment':_0xd358fc};}return _0x60d067;}if(_0x5d89f4(0x119)in _0x60d067&&_0x60d067[_0x5d89f4(0x119)]){const _0x2ca70e=_0x60d067,_0x590a4d=await Promise[_0x5d89f4(0x102)](_0x2ca70e[_0x5d89f4(0x119)]['map'](_0x2a7728=>resolveConditionSegmentRefs(_0x2a7728,_0x25bb61)));return{..._0x2ca70e,'conditions':_0x590a4d};}if(_0x5d89f4(0xdc)in _0x60d067&&_0x60d067['filter']){const _0x470323=_0x60d067,_0x110b79=await resolveRuleSegmentRefs(_0x470323[_0x5d89f4(0xdc)],_0x25bb61);return{..._0x470323,'filter':_0x110b79};}return _0x60d067;}export async function resolveRuleSegmentIds(_0x42ec39,_0x57f975){const _0xfad8ba=a111_0x3211,_0x3f90bc=await Promise[_0xfad8ba(0x102)](_0x42ec39[_0xfad8ba(0x119)][_0xfad8ba(0xb0)](_0x47ed0e=>resolveConditionSegmentIds(_0x47ed0e,_0x57f975)));return{..._0x42ec39,'conditions':_0x3f90bc};}async function resolveConditionSegmentIds(_0x4d8e25,_0x140554){const _0x56bf28=a111_0x3211;if(_0x56bf28(0xcb)in _0x4d8e25&&(_0x4d8e25[_0x56bf28(0x11c)]===_0x56bf28(0xc3)||_0x4d8e25[_0x56bf28(0x11c)]==='exclude')){const _0x31d81a=_0x4d8e25;if(!/^\d+$/[_0x56bf28(0x12a)](_0x31d81a['segment'])){const _0x48580c=await _0x140554(_0x31d81a[_0x56bf28(0xcb)]);return{..._0x31d81a,'segment':_0x48580c};}return _0x4d8e25;}if(_0x56bf28(0x119)in _0x4d8e25&&_0x4d8e25['conditions']){const _0x53b0b1=_0x4d8e25,_0x101dbc=await Promise[_0x56bf28(0x102)](_0x53b0b1[_0x56bf28(0x119)][_0x56bf28(0xb0)](_0x8b6905=>resolveConditionSegmentIds(_0x8b6905,_0x140554)));return{..._0x53b0b1,'conditions':_0x101dbc};}if(_0x56bf28(0xdc)in _0x4d8e25&&_0x4d8e25[_0x56bf28(0xdc)]){const _0x2046fd=_0x4d8e25,_0x527ccf=await resolveRuleSegmentIds(_0x2046fd[_0x56bf28(0xdc)],_0x140554);return{..._0x2046fd,'filter':_0x527ccf};}return _0x4d8e25;}function apiConditionToYaml(_0x109931){const _0x612320=a111_0x3211;if(_0x109931[_0x612320(0x11c)]===_0x612320(0xf6)||_0x109931[_0x612320(0x11c)]==='Or'){if(_0x109931[_0x612320(0x119)]){const _0x856f27=_0x109931[_0x612320(0x119)][_0x612320(0xb0)](apiConditionToYaml);if(_0x856f27[_0x612320(0x105)]===0x1&&!_0x109931['description'])return _0x856f27[0x0];return{'type':_0x109931[_0x612320(0x11c)],'conditions':_0x856f27,..._0x109931[_0x612320(0xdf)]&&{'description':_0x109931['description']}};}}if(_0x109931['type']===_0x612320(0xc2)&&_0x109931['leftValue']&&_0x109931[_0x612320(0xc9)]){const _0x1f3b90=_0x109931['leftValue']['aggregation']?{'type':_0x109931[_0x612320(0xef)]['aggregation']['type'],..._0x109931['leftValue'][_0x612320(0x101)][_0x612320(0x124)]&&{'groupingColumns':_0x109931[_0x612320(0xef)]['aggregation'][_0x612320(0x124)]}}:undefined;return{'type':_0x612320(0xc2),'attribute':_0x109931[_0x612320(0xef)][_0x612320(0xaf)]||'','operator':apiOperatorToYaml(_0x109931[_0x612320(0xc9)]),..._0x109931[_0x612320(0xc5)]&&_0x109931['arrayMatching']!==_0x612320(0xd5)?{'arrayMatching':_0x109931[_0x612320(0xc5)]}:{},..._0x109931['exclude']?{'exclude':_0x109931['exclude']}:{},..._0x1f3b90?{'aggregation':_0x1f3b90}:{},..._0x109931[_0x612320(0xef)][_0x612320(0xd2)]?{'source':_0x109931['leftValue'][_0x612320(0xd2)]['name']}:{},..._0x109931[_0x612320(0xef)][_0x612320(0xdc)]?{'filter':apiRuleToYaml(_0x109931[_0x612320(0xef)]['filter'])}:{},..._0x109931[_0x612320(0xc6)]!==undefined&&_0x109931['limit']!==null?{'limit':_0x109931['limit']}:{}};}if(_0x109931['type']===_0x612320(0x10c)&&_0x109931['id'])return{'type':_0x109931['exclude']?_0x612320(0xe5):_0x612320(0xc3),'segment':_0x109931['id']};return{'type':_0x612320(0xf6),'conditions':[]};}function isTemporalOperator(_0x5ef823){const _0x5458fd=a111_0x3211;return _0x5ef823===_0x5458fd(0xbb)||_0x5ef823===_0x5458fd(0xa7);}function getEffectiveValue(_0x198003){const _0x1a8716=a111_0x3211,_0x500500=_0x198003[_0x1a8716(0xa5)];return _0x198003[_0x1a8716(0xd8)]??_0x500500;}function apiOperatorToYaml(_0x3caa03){const _0x53a787=a111_0x3211;let _0xc974c8;if(_0x3caa03[_0x53a787(0x111)]&&_0x3caa03['rightValues'][_0x53a787(0x105)]>0x0)_0xc974c8=_0x3caa03[_0x53a787(0x111)];else{if(_0x3caa03[_0x53a787(0x114)]!==undefined)_0xc974c8=_0x3caa03['rightValue'];else isTemporalOperator(_0x3caa03[_0x53a787(0x11c)])&&_0x3caa03[_0x53a787(0xd8)]!==undefined&&(_0xc974c8=_0x3caa03['value']);}return{'type':mapApiOperatorType(_0x3caa03[_0x53a787(0x11c)]),..._0x3caa03['not']&&{'not':_0x3caa03[_0x53a787(0xfc)]},..._0xc974c8!==undefined&&{'value':_0xc974c8},..._0x3caa03[_0x53a787(0xca)]&&{'unit':_0x3caa03[_0x53a787(0xca)]}};}function mapApiOperatorType(_0x221709){return _0x221709;}export function segmentDefToCreateRequest(_0x3afe72,_0x1ef046){const _0x3a35dd=a111_0x3211,_0x122967={'name':_0x3afe72[_0x3a35dd(0xaf)]};return _0x3afe72['description']&&(_0x122967[_0x3a35dd(0xdf)]=_0x3afe72[_0x3a35dd(0xdf)]),_0x3afe72[_0x3a35dd(0x134)]&&(_0x122967[_0x3a35dd(0x134)]=yamlRuleToApi(_0x3afe72['rule'])),_0x3afe72[_0x3a35dd(0x12b)]&&(_0x122967[_0x3a35dd(0x12b)]=_0x3afe72[_0x3a35dd(0x12b)]===_0x3a35dd(0x100)?0x0:_0x3afe72['kind']===_0x3a35dd(0x112)?0x1:0x2),_0x3afe72[_0x3a35dd(0x109)]!==undefined&&(_0x122967['isVisible']=_0x3afe72[_0x3a35dd(0x109)]),_0x1ef046&&(_0x122967[_0x3a35dd(0xdd)]=_0x1ef046),_0x122967;}export function segmentDefToUpdateRequest(_0x4b50dc){const _0x4e0114=a111_0x3211,_0x13b566={'name':_0x4b50dc[_0x4e0114(0xaf)]};return _0x4b50dc['description']!==undefined&&(_0x13b566[_0x4e0114(0xdf)]=_0x4b50dc[_0x4e0114(0xdf)]),_0x4b50dc[_0x4e0114(0x134)]&&(_0x13b566[_0x4e0114(0x134)]=yamlRuleToApi(_0x4b50dc['rule'])),_0x4b50dc[_0x4e0114(0x12b)]&&(_0x13b566[_0x4e0114(0x12b)]=_0x4b50dc[_0x4e0114(0x12b)]===_0x4e0114(0x100)?0x0:_0x4b50dc[_0x4e0114(0x12b)]===_0x4e0114(0x112)?0x1:0x2),_0x13b566;}export function yamlRuleToApi(_0x52750d,_0x1884e1=![]){const _0x3d399a=a111_0x3211,_0x422d16=_0x52750d[_0x3d399a(0x119)][_0x3d399a(0xb0)](yamlConditionToApi);if(_0x1884e1){const _0x235ebe=_0x422d16[_0x3d399a(0x131)](_0x156b4b=>_0x156b4b[_0x3d399a(0x11c)]==='And'||_0x156b4b[_0x3d399a(0x11c)]==='Or');if(!_0x235ebe&&_0x422d16[_0x3d399a(0x105)]>0x0)return{'type':_0x52750d[_0x3d399a(0x11c)],'conditions':[{'type':_0x3d399a(0xf6),'description':_0x52750d[_0x3d399a(0xdf)]||'','conditions':_0x422d16}]};}return{'type':_0x52750d[_0x3d399a(0x11c)],'conditions':_0x422d16,..._0x52750d['description']&&{'description':_0x52750d[_0x3d399a(0xdf)]}};}function yamlConditionToApi(_0x9d5857){const _0x4dc703=a111_0x3211;if('segment'in _0x9d5857&&(_0x9d5857[_0x4dc703(0x11c)]==='include'||_0x9d5857['type']===_0x4dc703(0xe5))){const _0x349146=_0x9d5857;return{'type':_0x4dc703(0x10c),'id':_0x349146[_0x4dc703(0xcb)],'exclude':_0x349146['type']===_0x4dc703(0xe5)};}if(_0x4dc703(0x11c)in _0x9d5857&&(_0x9d5857[_0x4dc703(0x11c)]===_0x4dc703(0xf6)||_0x9d5857['type']==='Or')){const _0x584839=_0x9d5857;return{'type':_0x584839[_0x4dc703(0x11c)],'conditions':_0x584839[_0x4dc703(0x119)]['map'](yamlConditionToApi),..._0x584839[_0x4dc703(0xdf)]&&{'description':_0x584839[_0x4dc703(0xdf)]}};}const _0x7bbe98=_0x9d5857,_0x20ffc1={'type':'Value','leftValue':buildLeftValue(_0x7bbe98),'operator':yamlOperatorToApi(_0x7bbe98[_0x4dc703(0xc9)]),'exclude':_0x7bbe98[_0x4dc703(0xe5)]??![],'arrayMatching':_0x7bbe98[_0x4dc703(0xc5)]??'any'};return _0x7bbe98[_0x4dc703(0xc6)]!==undefined&&(_0x20ffc1[_0x4dc703(0xc6)]=_0x7bbe98[_0x4dc703(0xc6)]),_0x20ffc1;}function buildLeftValue(_0x5a60ea){const _0x4f8e7b=a111_0x3211,_0x52e8bd={'name':_0x5a60ea['attribute']};return _0x5a60ea[_0x4f8e7b(0x101)]&&(_0x52e8bd[_0x4f8e7b(0x101)]={'type':_0x5a60ea[_0x4f8e7b(0x101)]['type'],..._0x5a60ea[_0x4f8e7b(0x101)][_0x4f8e7b(0x124)]&&{'groupingColumns':_0x5a60ea[_0x4f8e7b(0x101)]['groupingColumns']}}),_0x5a60ea[_0x4f8e7b(0xd2)]&&(_0x52e8bd[_0x4f8e7b(0xd2)]={'name':_0x5a60ea[_0x4f8e7b(0xd2)]}),_0x5a60ea['filter']&&(_0x52e8bd['filter']=yamlRuleToApi(_0x5a60ea[_0x4f8e7b(0xdc)])),_0x52e8bd;}function yamlOperatorToApi(_0x3bd075){const _0x118813=a111_0x3211,_0x22f854={'type':mapYamlOperatorType(_0x3bd075[_0x118813(0x11c)]),'not':_0x3bd075[_0x118813(0xfc)]??![]},_0x59fc4a=getEffectiveValue(_0x3bd075);if(_0x59fc4a!==undefined){if(Array[_0x118813(0x125)](_0x59fc4a))_0x22f854[_0x118813(0x111)]=_0x59fc4a;else isTemporalOperator(_0x3bd075[_0x118813(0x11c)])?_0x22f854[_0x118813(0xd8)]=_0x59fc4a:_0x22f854[_0x118813(0x114)]=_0x59fc4a;}return _0x3bd075[_0x118813(0xca)]&&(_0x22f854[_0x118813(0xca)]=_0x3bd075[_0x118813(0xca)]),_0x22f854;}function mapYamlOperatorType(_0x36402f){return _0x36402f;}export function toYamlString(_0xb845f){const _0x114c22=a111_0x3211,_0x48d790=JSON[_0x114c22(0xb5)](JSON['stringify'](_0xb845f)),_0x2788eb=a111_0x15b77d[_0x114c22(0x128)](_0x48d790,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x370399=[_0x114c22(0xf2)];let _0x5d2353=_0x2788eb;for(const _0x310c92 of _0x370399){_0x5d2353=_0x5d2353[_0x114c22(0xbe)](new RegExp('^('+_0x310c92+')','m'),(_0x533b1c,_0x500c1c,_0x699765)=>{if(_0x699765===0x0||_0x5d2353[_0x699765-0x1]==='\x0a'&&_0x5d2353[_0x699765-0x2]==='\x0a')return _0x500c1c;return'\x0a'+_0x500c1c;});}return _0x5d2353;}export function parseYamlString(_0x178fef){const _0x32a630=a111_0x3211,_0x54b91b=a111_0x15b77d[_0x32a630(0xb5)](_0x178fef);if(!_0x54b91b[_0x32a630(0xaf)])throw new Error(_0x32a630(0xb6));if(_0x54b91b[_0x32a630(0x11c)]&&_0x54b91b['type']!=='segment')throw new Error('YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20'+_0x54b91b[_0x32a630(0x11c)]);return _0x54b91b;}export function isSegmentYaml(_0x142181){const _0xb3d036=a111_0x3211;if(typeof _0x142181!==_0xb3d036(0x108)||_0x142181===null)return![];const _0x2c2db8=_0x142181;return _0x2c2db8[_0xb3d036(0x11c)]===_0xb3d036(0xcb)||_0x2c2db8[_0xb3d036(0x11c)]===undefined;}export function generateTemplate(_0xb41918=a111_0x22e1b1(0x121)){const _0x4f9f13=a111_0x22e1b1,_0x347c62={'type':_0x4f9f13(0xcb),'name':_0xb41918,'description':_0x4f9f13(0xbc),'rule':{'type':_0x4f9f13(0xf6),'conditions':[{'type':_0x4f9f13(0xc2),'attribute':_0x4f9f13(0x138),'operator':{'type':_0x4f9f13(0x129),'value':'value'}}]}};return toYamlString(_0x347c62);}export function segmentToYamlString(_0x552104){const _0x5968be=a111_0x22e1b1,_0x30a86f=JSON[_0x5968be(0xb5)](JSON[_0x5968be(0x128)](_0x552104)),_0x149b89=a111_0x15b77d[_0x5968be(0x128)](_0x30a86f,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x231eef=[_0x5968be(0xf2),'activations:'];let _0x2cc048=_0x149b89;for(const _0x2933bd of _0x231eef){_0x2cc048=_0x2cc048['replace'](new RegExp('^('+_0x2933bd+')','m'),(_0x17ce9a,_0x33bc4f,_0x2a7cd9)=>{if(_0x2a7cd9===0x0||_0x2cc048[_0x2a7cd9-0x1]==='\x0a'&&_0x2cc048[_0x2a7cd9-0x2]==='\x0a')return _0x33bc4f;return'\x0a'+_0x33bc4f;});}return _0x2cc048;}export function parseSegmentYamlFile(_0xc67b71){const _0x2e38ad=a111_0x22e1b1,_0x2d7986=a111_0x15b77d[_0x2e38ad(0xb5)](_0xc67b71);if(!_0x2d7986[_0x2e38ad(0xaf)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');return _0x2d7986;}export function normalizeChildSegmentYaml(_0x2d6367){const _0x2e884d=a111_0x22e1b1;return{'type':_0x2e884d(0xcb),'name':_0x2d6367[_0x2e884d(0xaf)],..._0x2d6367[_0x2e884d(0xdf)]!==undefined&&{'description':_0x2d6367['description']},..._0x2d6367[_0x2e884d(0x110)]!==undefined&&{'folder':_0x2d6367['folder']},..._0x2d6367[_0x2e884d(0x134)]&&{'rule':normalizeRule(_0x2d6367['rule'])},..._0x2d6367[_0x2e884d(0x12b)]!==undefined&&{'kind':_0x2d6367[_0x2e884d(0x12b)]},..._0x2d6367[_0x2e884d(0x109)]!==undefined&&{'visible':_0x2d6367['visible']},..._0x2d6367[_0x2e884d(0xc7)]&&{'activations':_0x2d6367['activations'][_0x2e884d(0xb0)](normalizeActivation)}};}export function normalizeRule(_0x42f544){const _0x27d382=a111_0x22e1b1;return{'type':_0x42f544[_0x27d382(0x11c)],'conditions':_0x42f544['conditions']['map'](normalizeCondition),..._0x42f544[_0x27d382(0xdf)]!==undefined&&{'description':_0x42f544[_0x27d382(0xdf)]}};}function normalizeCondition(_0x3bae2f){const _0x4713ca=a111_0x22e1b1;if(_0x4713ca(0xcb)in _0x3bae2f&&(_0x3bae2f['type']===_0x4713ca(0xc3)||_0x3bae2f['type']===_0x4713ca(0xe5))){const _0x2725eb=_0x3bae2f;return{'type':_0x2725eb['type'],'segment':_0x2725eb[_0x4713ca(0xcb)]};}if(_0x4713ca(0x11c)in _0x3bae2f&&(_0x3bae2f[_0x4713ca(0x11c)]===_0x4713ca(0xf6)||_0x3bae2f[_0x4713ca(0x11c)]==='Or')){const _0x1213f6=_0x3bae2f;return{'type':_0x1213f6['type'],'conditions':_0x1213f6['conditions'][_0x4713ca(0xb0)](normalizeCondition),..._0x1213f6[_0x4713ca(0xdf)]!==undefined&&{'description':_0x1213f6[_0x4713ca(0xdf)]}};}const _0x43b208=_0x3bae2f;return{'type':_0x4713ca(0xc2),'attribute':_0x43b208[_0x4713ca(0xfe)],'operator':normalizeOperator(_0x43b208[_0x4713ca(0xc9)]),..._0x43b208['arrayMatching']!==undefined&&{'arrayMatching':_0x43b208[_0x4713ca(0xc5)]},..._0x43b208[_0x4713ca(0xe5)]!==undefined&&{'exclude':_0x43b208[_0x4713ca(0xe5)]},..._0x43b208[_0x4713ca(0x101)]!==undefined&&{'aggregation':_0x43b208['aggregation']},..._0x43b208[_0x4713ca(0xd2)]!==undefined&&{'source':_0x43b208[_0x4713ca(0xd2)]},..._0x43b208[_0x4713ca(0xdc)]!==undefined&&{'filter':normalizeRule(_0x43b208[_0x4713ca(0xdc)])},..._0x43b208[_0x4713ca(0xc6)]!==undefined&&{'limit':_0x43b208[_0x4713ca(0xc6)]}};}function normalizeOperator(_0x487c7c){const _0x2e26f0=a111_0x22e1b1,_0x489563=getEffectiveValue(_0x487c7c);return{'type':_0x487c7c['type'],..._0x487c7c['not']!==undefined&&{'not':_0x487c7c[_0x2e26f0(0xfc)]},..._0x489563!==undefined&&{'value':_0x489563},..._0x487c7c[_0x2e26f0(0x133)]!==undefined&&{'min':_0x487c7c[_0x2e26f0(0x133)]},..._0x487c7c[_0x2e26f0(0xf4)]!==undefined&&{'max':_0x487c7c[_0x2e26f0(0xf4)]},..._0x487c7c[_0x2e26f0(0xca)]!==undefined&&{'unit':_0x487c7c[_0x2e26f0(0xca)]},..._0x487c7c[_0x2e26f0(0xec)]!==undefined&&{'duration':_0x487c7c[_0x2e26f0(0xec)]},..._0x487c7c[_0x2e26f0(0xf3)]!==undefined&&{'from':_0x487c7c[_0x2e26f0(0xf3)]}};}function normalizeActivation(_0x1c54d3){const _0x33e2f0=a111_0x22e1b1;return{'name':_0x1c54d3['name'],'connection':_0x1c54d3[_0x33e2f0(0xbd)],..._0x1c54d3[_0x33e2f0(0xdf)]!==undefined&&{'description':_0x1c54d3['description']},..._0x1c54d3[_0x33e2f0(0x10f)]!==undefined&&{'all_columns':_0x1c54d3['all_columns']},..._0x1c54d3['columns']!==undefined&&{'columns':_0x1c54d3[_0x33e2f0(0xda)]},..._0x1c54d3[_0x33e2f0(0xfa)]!==undefined&&{'behavior':_0x1c54d3['behavior']},..._0x1c54d3[_0x33e2f0(0xc1)]!==undefined&&{'schedule':_0x1c54d3['schedule']},..._0x1c54d3[_0x33e2f0(0xed)]!==undefined&&{'notification':_0x1c54d3[_0x33e2f0(0xed)]},..._0x1c54d3[_0x33e2f0(0xb9)]!==undefined&&{'connector_config':_0x1c54d3[_0x33e2f0(0xb9)]},..._0x1c54d3[_0x33e2f0(0x116)]!==undefined&&{'activation_template_id':_0x1c54d3[_0x33e2f0(0x116)]}};}export function activationResponseToDef(_0x352852,_0x56583c,_0x47a8c0){const _0x28229d=a111_0x22e1b1,_0x5a6d06=_0x352852[_0x28229d(0x104)]||'',_0x59a3bd=_0x47a8c0?.[_0x28229d(0x12e)](_0x5a6d06)??_0x5a6d06,_0x45c1c2={'name':_0x352852[_0x28229d(0xaf)],'connection':_0x59a3bd};_0x352852[_0x28229d(0xdf)]&&(_0x45c1c2[_0x28229d(0xdf)]=_0x352852['description']);let _0xdbcd9b=[];_0x352852[_0x28229d(0xda)]&&_0x352852[_0x28229d(0xda)][_0x28229d(0x105)]>0x0&&(_0xdbcd9b=_0x352852[_0x28229d(0xda)][_0x28229d(0xdc)](_0x27c719=>_0x27c719&&_0x27c719['name'])[_0x28229d(0xb0)](_0xadd7be=>{const _0x53203b=_0x28229d;if(_0xadd7be['type']||_0xadd7be[_0x53203b(0xa9)])return{'name':_0xadd7be[_0x53203b(0xaf)],..._0xadd7be[_0x53203b(0x11c)]&&{'type':_0xadd7be[_0x53203b(0x11c)]},..._0xadd7be[_0x53203b(0xa9)]&&{'visibility':_0xadd7be[_0x53203b(0xa9)]}};return _0xadd7be[_0x53203b(0xaf)];}));_0xdbcd9b[_0x28229d(0x105)]>0x0&&(_0x45c1c2['columns']=_0xdbcd9b);_0x352852[_0x28229d(0xac)]!==undefined&&(_0x352852[_0x28229d(0xac)]===![]&&_0xdbcd9b[_0x28229d(0x105)]===0x0?_0x45c1c2[_0x28229d(0x10f)]=!![]:_0x45c1c2['all_columns']=_0x352852['allColumns']);const _0x1fca78={};let _0xe5e266=![];_0x352852[_0x28229d(0xe3)]&&(_0x1fca78[_0x28229d(0x11c)]=_0x352852[_0x28229d(0xe3)],_0xe5e266=!![]);_0x352852[_0x28229d(0x107)]&&(_0x1fca78[_0x28229d(0x126)]=_0x352852[_0x28229d(0x107)],_0xe5e266=!![]);_0x352852[_0x28229d(0xdb)]!==undefined&&_0x352852['repeatFrequency']!==null&&(_0x1fca78['repeat_frequency']=_0x352852['repeatFrequency'],_0xe5e266=!![]);_0x352852[_0x28229d(0xae)]&&_0x352852[_0x28229d(0xae)][_0x28229d(0x105)]>0x0&&(_0x1fca78[_0x28229d(0xb8)]=_0x352852[_0x28229d(0xae)],_0xe5e266=!![]);_0x352852[_0x28229d(0x11d)]!==undefined&&(_0x1fca78[_0x28229d(0xd4)]=_0x352852['startAt'],_0xe5e266=!![]);_0x352852[_0x28229d(0xee)]!==undefined&&(_0x1fca78[_0x28229d(0xe2)]=_0x352852[_0x28229d(0xee)],_0xe5e266=!![]);_0x352852[_0x28229d(0xf9)]&&(_0x1fca78[_0x28229d(0xf9)]=_0x352852[_0x28229d(0xf9)],_0xe5e266=!![]);_0xe5e266&&(_0x45c1c2[_0x28229d(0xc1)]=_0x1fca78);(_0x352852[_0x28229d(0xa8)]&&_0x352852['notifyOn'][_0x28229d(0x105)]>0x0||_0x352852[_0x28229d(0x135)]&&_0x352852[_0x28229d(0x135)][_0x28229d(0x105)]>0x0)&&(_0x45c1c2[_0x28229d(0xed)]={},_0x352852[_0x28229d(0xa8)]&&_0x352852[_0x28229d(0xa8)][_0x28229d(0x105)]>0x0&&(_0x45c1c2[_0x28229d(0xed)][_0x28229d(0x115)]=_0x352852[_0x28229d(0xa8)]),_0x352852[_0x28229d(0x135)]&&_0x352852['emailRecipients'][_0x28229d(0x105)]>0x0&&(_0x45c1c2['notification'][_0x28229d(0xce)]=_0x352852[_0x28229d(0x135)][_0x28229d(0xb0)](_0x28839e=>{const _0x35c672=_0x56583c?.['get'](_0x28839e);return _0x35c672??String(_0x28839e);})));_0x352852[_0x28229d(0xe7)]&&Object['keys'](_0x352852[_0x28229d(0xe7)])[_0x28229d(0x105)]>0x0&&(_0x45c1c2[_0x28229d(0xb9)]=normalizeConnectorConfigForYaml(_0x352852['connectorConfig']));_0x352852[_0x28229d(0xe8)]&&(_0x45c1c2[_0x28229d(0x116)]=_0x352852['activationTemplateId']);if(_0x352852['syndicationBehavior']){const _0x10cb87={},_0x3313d7=_0x352852[_0x28229d(0x136)];_0x3313d7[_0x28229d(0xda)]&&_0x3313d7[_0x28229d(0xda)][_0x28229d(0x105)]>0x0&&(_0x10cb87[_0x28229d(0xda)]=_0x3313d7[_0x28229d(0xda)]['filter'](_0x1e4ca1=>_0x1e4ca1&&_0x1e4ca1[_0x28229d(0xaf)])[_0x28229d(0xb0)](_0x52a10f=>({'name':_0x52a10f['name'],..._0x52a10f[_0x28229d(0x11c)]&&{'type':_0x52a10f[_0x28229d(0x11c)]},..._0x52a10f[_0x28229d(0xa9)]&&{'visibility':_0x52a10f[_0x28229d(0xa9)]}}))),_0x3313d7[_0x28229d(0xea)]&&(_0x10cb87[_0x28229d(0xf7)]=_0x3313d7[_0x28229d(0xea)]),_0x3313d7[_0x28229d(0x122)]!==undefined&&(_0x10cb87[_0x28229d(0xc8)]=_0x3313d7[_0x28229d(0x122)]),_0x3313d7['joinStrategy']&&(_0x10cb87[_0x28229d(0x123)]=_0x3313d7['joinStrategy']),_0x3313d7[_0x28229d(0x118)]&&(_0x10cb87['formatting']=_0x3313d7['formatting']),_0x3313d7[_0x28229d(0x11a)]&&_0x3313d7[_0x28229d(0x11a)]['length']>0x0&&(_0x10cb87['order_by']=_0x3313d7[_0x28229d(0x11a)]),Object[_0x28229d(0xa6)](_0x10cb87)[_0x28229d(0x105)]>0x0&&(_0x45c1c2['behavior']=_0x10cb87);}return _0x45c1c2;}export function journeyActivationStepToYaml(_0x4324df,_0x573889,_0x3cf6f9){const _0x2c9c98=a111_0x22e1b1,_0x121218=_0x4324df[_0x2c9c98(0x12f)][_0x2c9c98(0xf5)],_0xdb868f=_0x121218[_0x2c9c98(0x104)]||'',_0x56bb7c=_0x3cf6f9?.[_0x2c9c98(0x12e)](_0xdb868f)??_0xdb868f,_0x1f3414={'name':_0x121218[_0x2c9c98(0xaf)]||'','connection':_0x56bb7c};_0x121218[_0x2c9c98(0xdf)]&&(_0x1f3414['description']=_0x121218['description']);let _0x223a70=[];_0x121218[_0x2c9c98(0xda)]&&_0x121218[_0x2c9c98(0xda)][_0x2c9c98(0x105)]>0x0&&(_0x223a70=_0x121218['columns'][_0x2c9c98(0xdc)](_0x315abb=>_0x315abb&&_0x315abb['name'])['map'](_0x6acb6b=>{const _0x5be2ad=_0x2c9c98;if(_0x6acb6b[_0x5be2ad(0x11c)]||_0x6acb6b[_0x5be2ad(0xa9)])return{'name':_0x6acb6b[_0x5be2ad(0xaf)],..._0x6acb6b[_0x5be2ad(0x11c)]&&{'type':_0x6acb6b[_0x5be2ad(0x11c)]},..._0x6acb6b[_0x5be2ad(0xa9)]&&{'visibility':_0x6acb6b[_0x5be2ad(0xa9)]}};return _0x6acb6b[_0x5be2ad(0xaf)];}));_0x223a70[_0x2c9c98(0x105)]>0x0&&(_0x1f3414[_0x2c9c98(0xda)]=_0x223a70);_0x121218[_0x2c9c98(0xac)]!==undefined&&(_0x121218[_0x2c9c98(0xac)]===![]&&_0x223a70['length']===0x0?_0x1f3414[_0x2c9c98(0x10f)]=!![]:_0x1f3414[_0x2c9c98(0x10f)]=_0x121218[_0x2c9c98(0xac)]);const _0x2d2f76={};let _0x45ac63=![];_0x121218[_0x2c9c98(0xe3)]&&(_0x2d2f76[_0x2c9c98(0x11c)]=_0x121218[_0x2c9c98(0xe3)],_0x45ac63=!![]);_0x121218[_0x2c9c98(0x107)]&&(_0x2d2f76['repeat_unit']=_0x121218[_0x2c9c98(0x107)],_0x45ac63=!![]);_0x121218[_0x2c9c98(0xdb)]!==undefined&&_0x121218[_0x2c9c98(0xdb)]!==null&&(_0x2d2f76['repeat_frequency']=_0x121218[_0x2c9c98(0xdb)],_0x45ac63=!![]);_0x121218[_0x2c9c98(0x11d)]!==undefined&&(_0x2d2f76[_0x2c9c98(0xd4)]=_0x121218[_0x2c9c98(0x11d)],_0x45ac63=!![]);_0x121218['endOn']!==undefined&&(_0x2d2f76[_0x2c9c98(0xe2)]=_0x121218[_0x2c9c98(0xee)],_0x45ac63=!![]);_0x121218[_0x2c9c98(0xf9)]&&(_0x2d2f76[_0x2c9c98(0xf9)]=_0x121218[_0x2c9c98(0xf9)],_0x45ac63=!![]);_0x45ac63&&(_0x1f3414[_0x2c9c98(0xc1)]=_0x2d2f76);(_0x121218[_0x2c9c98(0xa8)]&&_0x121218[_0x2c9c98(0xa8)][_0x2c9c98(0x105)]>0x0||_0x121218[_0x2c9c98(0x135)]&&_0x121218[_0x2c9c98(0x135)]['length']>0x0)&&(_0x1f3414[_0x2c9c98(0xed)]={},_0x121218[_0x2c9c98(0xa8)]&&_0x121218[_0x2c9c98(0xa8)][_0x2c9c98(0x105)]>0x0&&(_0x1f3414[_0x2c9c98(0xed)][_0x2c9c98(0x115)]=_0x121218[_0x2c9c98(0xa8)]),_0x121218[_0x2c9c98(0x135)]&&_0x121218[_0x2c9c98(0x135)][_0x2c9c98(0x105)]>0x0&&(_0x1f3414[_0x2c9c98(0xed)][_0x2c9c98(0xce)]=_0x121218[_0x2c9c98(0x135)][_0x2c9c98(0xb0)](_0x3c7484=>{const _0x3b9d64=_0x2c9c98,_0x1b3f48=_0x573889?.[_0x3b9d64(0x12e)](_0x3c7484);return _0x1b3f48??String(_0x3c7484);})));_0x121218[_0x2c9c98(0xe7)]&&Object[_0x2c9c98(0xa6)](_0x121218[_0x2c9c98(0xe7)])[_0x2c9c98(0x105)]>0x0&&(_0x1f3414['connector_config']=normalizeConnectorConfigForYaml(_0x121218['connectorConfig']));_0x121218['activationTemplateId']&&(_0x1f3414['activation_template_id']=_0x121218['activationTemplateId']);if(_0x121218['syndicationBehavior']){const _0x1579b4={},_0x50c464=_0x121218[_0x2c9c98(0x136)];_0x50c464['columns']&&_0x50c464[_0x2c9c98(0xda)]['length']>0x0&&(_0x1579b4[_0x2c9c98(0xda)]=_0x50c464[_0x2c9c98(0xda)][_0x2c9c98(0xdc)](_0x4c338f=>_0x4c338f&&_0x4c338f['name'])[_0x2c9c98(0xb0)](_0x45894b=>({'name':_0x45894b['name'],..._0x45894b[_0x2c9c98(0x11c)]&&{'type':_0x45894b[_0x2c9c98(0x11c)]},..._0x45894b['visibility']&&{'visibility':_0x45894b[_0x2c9c98(0xa9)]}}))),_0x50c464[_0x2c9c98(0xea)]&&(_0x1579b4['behavior_table']=_0x50c464[_0x2c9c98(0xea)]),_0x50c464[_0x2c9c98(0x122)]!==undefined&&(_0x1579b4['join_row']=_0x50c464[_0x2c9c98(0x122)]),_0x50c464[_0x2c9c98(0xd1)]&&(_0x1579b4[_0x2c9c98(0x123)]=_0x50c464[_0x2c9c98(0xd1)]),_0x50c464[_0x2c9c98(0x118)]&&(_0x1579b4['formatting']=_0x50c464[_0x2c9c98(0x118)]),_0x50c464['orderBy']&&_0x50c464['orderBy'][_0x2c9c98(0x105)]>0x0&&(_0x1579b4[_0x2c9c98(0xf0)]=_0x50c464['orderBy']),Object[_0x2c9c98(0xa6)](_0x1579b4)[_0x2c9c98(0x105)]>0x0&&(_0x1f3414[_0x2c9c98(0xfa)]=_0x1579b4);}return _0x1f3414;}export function segmentWithActivationsToYaml(_0x74c4ad,_0x216663,_0x3c2021,_0x1f747d,_0x586c6c){const _0x5e85b5=a111_0x22e1b1,_0x46f347=segmentResponseToDefSync(_0x74c4ad,_0x3c2021);return _0x216663[_0x5e85b5(0x105)]>0x0&&(_0x46f347[_0x5e85b5(0xc7)]=_0x216663[_0x5e85b5(0xb0)](_0x29849e=>activationResponseToDef(_0x29849e,_0x1f747d,_0x586c6c))),_0x46f347;}function normalizeColumn(_0x58ed5c){const _0x18ccdf=a111_0x22e1b1;if(typeof _0x58ed5c===_0x18ccdf(0xeb))return{'name':_0x58ed5c};return{'name':_0x58ed5c[_0x18ccdf(0xaf)],..._0x58ed5c[_0x18ccdf(0x11c)]&&{'type':_0x58ed5c[_0x18ccdf(0x11c)]},..._0x58ed5c[_0x18ccdf(0xa9)]&&{'visibility':_0x58ed5c[_0x18ccdf(0xa9)]}};}export async function activationDefToCreateRequest(_0x10a304,_0x5132fe){const _0x22873f=a111_0x22e1b1,_0x509405=_0x5132fe?.[_0x22873f(0xbf)],_0xd5a64b=_0x5132fe?.[_0x22873f(0x12d)],_0x3712a7=_0x10a304['connection'];let _0x24297f;const _0x2aa180=parseInt(_0x3712a7,0xa);if(!isNaN(_0x2aa180)&&String(_0x2aa180)===_0x3712a7)_0x24297f=_0x2aa180;else{const _0x80499a=_0xd5a64b?.['get'](_0x3712a7);if(_0x80499a===undefined)throw new SDKError(ErrorCode[_0x22873f(0xff)],_0x22873f(0xb1)+_0x3712a7,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x24297f=_0x80499a;}const _0x3fba6d={'name':_0x10a304[_0x22873f(0xaf)],'connectionId':_0x24297f};_0x10a304['description']&&(_0x3fba6d[_0x22873f(0xdf)]=_0x10a304['description']);let _0x73a94c=[];_0x10a304[_0x22873f(0xda)]&&_0x10a304[_0x22873f(0xda)][_0x22873f(0x105)]>0x0&&(_0x73a94c=_0x10a304[_0x22873f(0xda)][_0x22873f(0xdc)](_0x53ca37=>_0x53ca37!=null)[_0x22873f(0xb0)](normalizeColumn));_0x73a94c['length']>0x0&&(_0x3fba6d[_0x22873f(0xda)]=_0x73a94c);_0x10a304['all_columns']!==undefined&&(_0x10a304[_0x22873f(0x10f)]===![]&&_0x73a94c[_0x22873f(0x105)]===0x0?_0x3fba6d[_0x22873f(0xac)]=!![]:_0x3fba6d[_0x22873f(0xac)]=_0x10a304[_0x22873f(0x10f)]);if(_0x10a304[_0x22873f(0xc1)]){const _0x9b5b5f=_0x10a304[_0x22873f(0xc1)];_0x9b5b5f[_0x22873f(0x11c)]&&(_0x3fba6d[_0x22873f(0xe3)]=_0x9b5b5f[_0x22873f(0x11c)]),_0x9b5b5f['repeat_unit']&&(_0x3fba6d[_0x22873f(0x107)]=_0x9b5b5f[_0x22873f(0x126)]),_0x9b5b5f[_0x22873f(0xb4)]!==undefined&&(_0x3fba6d[_0x22873f(0xdb)]=_0x9b5b5f['repeat_frequency']),_0x9b5b5f[_0x22873f(0xb8)]&&(_0x3fba6d[_0x22873f(0xae)]=_0x9b5b5f[_0x22873f(0xb8)]),_0x9b5b5f['start_at']!==undefined&&(_0x3fba6d[_0x22873f(0x11d)]=_0x9b5b5f[_0x22873f(0xd4)]),_0x9b5b5f[_0x22873f(0xe2)]!==undefined&&(_0x3fba6d[_0x22873f(0xee)]=_0x9b5b5f[_0x22873f(0xe2)]),_0x9b5b5f['timezone']&&(_0x3fba6d[_0x22873f(0xf9)]=_0x9b5b5f[_0x22873f(0xf9)]);}_0x10a304[_0x22873f(0xed)]&&(_0x10a304['notification'][_0x22873f(0x115)]&&(_0x3fba6d[_0x22873f(0xa8)]=_0x10a304[_0x22873f(0xed)][_0x22873f(0x115)]),_0x10a304['notification']['email_recipients']&&(_0x3fba6d[_0x22873f(0x135)]=_0x10a304['notification']['email_recipients']['map'](_0x492c5e=>{const _0x2165c1=_0x22873f,_0x24de4d=Number(_0x492c5e);if(!isNaN(_0x24de4d)&&String(_0x24de4d)===_0x492c5e)return _0x24de4d;const _0x43ef21=_0x509405?.['get'](_0x492c5e[_0x2165c1(0xd0)]());if(_0x43ef21===undefined)throw new SDKError(ErrorCode[_0x2165c1(0xb2)],_0x2165c1(0x120)+_0x492c5e+_0x2165c1(0xe1));return _0x43ef21;})));if(_0x10a304[_0x22873f(0xb9)]){const _0x1a2040=_0x5132fe?.['connectionNameToTypeMap']?.['get'](_0x3712a7);if(_0x1a2040&&_0x5132fe?.[_0x22873f(0xcd)])try{const _0xefacaa=await _0x5132fe[_0x22873f(0xcd)](_0x1a2040),_0xd2df3e=validateConnectorConfig(_0x10a304[_0x22873f(0xb9)],_0xefacaa);if(!_0xd2df3e[_0x22873f(0xaa)])throw new SDKError(ErrorCode[_0x22873f(0x12c)],_0x22873f(0x11f)+_0x10a304['name']+_0x22873f(0x106)+formatValidationErrors(_0xd2df3e[_0x22873f(0xd6)]),undefined,{'helpText':_0x22873f(0xde)+_0x1a2040+_0x22873f(0xd9)+formatSchemaAsHelp(_0xefacaa)});if(_0xd2df3e['warnings'][_0x22873f(0x105)]>0x0){const _0x34c31=formatValidationWarnings(_0xd2df3e[_0x22873f(0x127)]);console[_0x22873f(0xd3)](_0x22873f(0x10d)+_0x10a304[_0x22873f(0xaf)]+_0x22873f(0x106)+_0x34c31);}_0x3fba6d['connectorConfig']=transformConfigToLegacy(_0x10a304['connector_config'],_0xefacaa);}catch(_0x673e6f){if(_0x673e6f instanceof SDKError&&_0x673e6f['code']===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x3fba6d[_0x22873f(0xe7)]=_0x10a304[_0x22873f(0xb9)];else throw _0x673e6f;}else _0x3fba6d[_0x22873f(0xe7)]=_0x10a304[_0x22873f(0xb9)];}_0x10a304[_0x22873f(0x116)]!==undefined&&(_0x3fba6d['activationTemplateId']=_0x10a304['activation_template_id']);if(_0x10a304['behavior']){const _0x4e3370=_0x10a304[_0x22873f(0xfa)],_0x5ab42c={};if(_0x4e3370[_0x22873f(0xda)]&&_0x4e3370[_0x22873f(0xda)][_0x22873f(0x105)]>0x0){const _0x426130=_0x4e3370['columns'][_0x22873f(0xdc)](_0xe3543f=>_0xe3543f&&_0xe3543f[_0x22873f(0xaf)]);_0x426130[_0x22873f(0x105)]>0x0&&(_0x5ab42c[_0x22873f(0xda)]=_0x426130);}_0x4e3370['behavior_table']&&(_0x5ab42c['behaviorTableName']=_0x4e3370['behavior_table']),_0x4e3370[_0x22873f(0xc8)]!==undefined&&(_0x5ab42c['joinRow']=_0x4e3370[_0x22873f(0xc8)]),_0x4e3370['join_strategy']&&(_0x5ab42c[_0x22873f(0xd1)]=_0x4e3370['join_strategy']),_0x4e3370[_0x22873f(0x118)]&&(_0x5ab42c[_0x22873f(0x118)]=_0x4e3370[_0x22873f(0x118)]),_0x4e3370['order_by']&&(_0x5ab42c[_0x22873f(0x11a)]=_0x4e3370[_0x22873f(0xf0)]),_0x3fba6d[_0x22873f(0x136)]=_0x5ab42c;}return _0x3fba6d;}export async function activationDefToUpdateRequest(_0x2459ad,_0x3a272d){return activationDefToCreateRequest(_0x2459ad,_0x3a272d);}export function deepSortObject(_0x538fb2){const _0x2dc6f1=a111_0x22e1b1;if(_0x538fb2===null||typeof _0x538fb2!=='object')return _0x538fb2;if(Array[_0x2dc6f1(0x125)](_0x538fb2))return _0x538fb2['map'](deepSortObject)[_0x2dc6f1(0x10a)]((_0x4ffa3f,_0x4a4c4c)=>JSON['stringify'](_0x4ffa3f)[_0x2dc6f1(0xf8)](JSON[_0x2dc6f1(0x128)](_0x4a4c4c)));const _0x1e4dfc={};for(const _0x336b0a of Object[_0x2dc6f1(0xa6)](_0x538fb2)[_0x2dc6f1(0x10a)]()){_0x1e4dfc[_0x336b0a]=deepSortObject(_0x538fb2[_0x336b0a]);}return _0x1e4dfc;}function a111_0x3211(_0x3ef1fc,_0x1262ee){_0x3ef1fc=_0x3ef1fc-0xa5;const _0x1577aa=a111_0x1577();let _0x321192=_0x1577aa[_0x3ef1fc];return _0x321192;}export function serializeRule(_0x32a1b0){const _0x12eb6f=a111_0x22e1b1;return JSON[_0x12eb6f(0x128)](deepSortObject(_0x32a1b0));}export function normalizeRuleForMatching(_0x116c09){return normalizeConditionsForMatching(_0x116c09);}function normalizeConditionsForMatching(_0x35e0b9){const _0x287e53=a111_0x22e1b1;if(_0x35e0b9===null||typeof _0x35e0b9!==_0x287e53(0x108))return _0x35e0b9;if(Array['isArray'](_0x35e0b9))return _0x35e0b9[_0x287e53(0xb0)](normalizeConditionsForMatching);const _0x34e193=_0x35e0b9;if((_0x34e193[_0x287e53(0x11c)]===_0x287e53(0xc3)||_0x34e193[_0x287e53(0x11c)]===_0x287e53(0xe5))&&typeof _0x34e193[_0x287e53(0xcb)]==='string')return{..._0x34e193,'segment':_0x287e53(0xb7)};const _0x3bbc55={};for(const _0x55f8c0 of Object[_0x287e53(0xa6)](_0x34e193)){_0x3bbc55[_0x55f8c0]=normalizeConditionsForMatching(_0x34e193[_0x55f8c0]);}return _0x3bbc55;}export function serializeRuleForMatching(_0x1348fc){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0x1348fc)));}export function expandSegmentReferences(_0x368fa1,_0x45c676,_0x1fde60=new Set()){return expandConditions(_0x368fa1,_0x45c676,_0x1fde60);}function expandConditions(_0x16ff6a,_0x19ec55,_0x484ac3){const _0x17c41a=a111_0x22e1b1;if(_0x16ff6a===null||typeof _0x16ff6a!==_0x17c41a(0x108))return _0x16ff6a;if(Array[_0x17c41a(0x125)](_0x16ff6a))return _0x16ff6a[_0x17c41a(0xb0)](_0x471a28=>expandConditions(_0x471a28,_0x19ec55,_0x484ac3));const _0x4abe99=_0x16ff6a;if((_0x4abe99[_0x17c41a(0x11c)]===_0x17c41a(0xc3)||_0x4abe99['type']===_0x17c41a(0xe5))&&typeof _0x4abe99['segment']===_0x17c41a(0xeb)){const _0x1a20eb=_0x4abe99[_0x17c41a(0xcb)],_0x5079f2=_0x19ec55[_0x17c41a(0x12e)](_0x1a20eb);if(_0x5079f2&&!_0x484ac3[_0x17c41a(0x117)](_0x1a20eb)){const _0x436e4c=new Set(_0x484ac3);_0x436e4c[_0x17c41a(0xe4)](_0x1a20eb);const _0x5235c6=expandConditions(_0x5079f2,_0x19ec55,_0x436e4c);return{'type':_0x4abe99['type'],'expanded_rule':_0x5235c6};}return{'type':_0x4abe99[_0x17c41a(0x11c)],'expanded_rule':'__UNRESOLVED__'};}const _0x1c15e4={};for(const _0x3fed0c of Object[_0x17c41a(0xa6)](_0x4abe99)){_0x1c15e4[_0x3fed0c]=expandConditions(_0x4abe99[_0x3fed0c],_0x19ec55,_0x484ac3);}return _0x1c15e4;}export function serializeExpandedRule(_0x21f437,_0x51e1bd){const _0x3cea71=a111_0x22e1b1,_0x1cbe5e=expandSegmentReferences(_0x21f437,_0x51e1bd);return JSON[_0x3cea71(0x128)](deepSortObject(_0x1cbe5e));}export function createSegmentNameContext(_0x4a3299){const _0x302774=a111_0x22e1b1,_0x2e3462=new Set(),_0x2fa4be=new Map(),_0x5c4097=new Map();if(_0x4a3299)for(const [_0x35bbf2,_0x4cd8c7]of Object[_0x302774(0x103)](_0x4a3299)){if(_0x4cd8c7[_0x302774(0x134)]){const _0x4c7a7d=serializeRule(_0x4cd8c7['rule']);_0x5c4097[_0x302774(0xc4)](_0x4c7a7d,_0x35bbf2),_0x2e3462[_0x302774(0xe4)](_0x35bbf2);}}return{'usedNames':_0x2e3462,'ruleHashToName':_0x2fa4be,'localRuleToName':_0x4a3299?_0x5c4097:undefined};}export function resolveSegmentName(_0x3dc2b1,_0x1b646f,_0x3cb730,_0x53bf1f){const _0x3916aa=a111_0x22e1b1,_0x2635a7=serializeRule(_0x1b646f);if(_0x3cb730[_0x3916aa(0x113)]){const _0x1e3efa=_0x3cb730[_0x3916aa(0x113)][_0x3916aa(0x12e)](_0x2635a7);if(_0x1e3efa)return{'name':_0x1e3efa,'isDuplicate':![],'isLocalMatch':!![]};}const _0x532e13=_0x3cb730[_0x3916aa(0x11b)][_0x3916aa(0x12e)](_0x2635a7);if(_0x532e13)return{'name':_0x532e13,'isDuplicate':!![],'isLocalMatch':![]};const _0x20a19d=_0x53bf1f(_0x3dc2b1);let _0x3a6187=_0x20a19d||_0x3dc2b1,_0x48aa39=_0x3a6187,_0x44e983=0x2;while(_0x3cb730['usedNames'][_0x3916aa(0x117)](_0x48aa39)){_0x48aa39=_0x3a6187+'_'+_0x44e983,_0x44e983++;}return _0x3cb730['usedNames'][_0x3916aa(0xe4)](_0x48aa39),_0x3cb730[_0x3916aa(0x11b)][_0x3916aa(0xc4)](_0x2635a7,_0x48aa39),{'name':_0x48aa39,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x362b47){const _0x30e477=[],_0x39abeb=_0x2f80cc=>{const _0x58e8e7=a111_0x3211;if(!_0x2f80cc||typeof _0x2f80cc!==_0x58e8e7(0x108))return;if(Array[_0x58e8e7(0x125)](_0x2f80cc)){_0x2f80cc['forEach'](_0x39abeb);return;}const _0x47ebbe=_0x2f80cc;(_0x47ebbe[_0x58e8e7(0x11c)]===_0x58e8e7(0xc3)||_0x47ebbe[_0x58e8e7(0x11c)]===_0x58e8e7(0xe5))&&typeof _0x47ebbe[_0x58e8e7(0xcb)]===_0x58e8e7(0xeb)&&_0x30e477[_0x58e8e7(0x130)](_0x47ebbe[_0x58e8e7(0xcb)]);for(const _0x5abef3 of Object['values'](_0x47ebbe)){_0x39abeb(_0x5abef3);}};return _0x39abeb(_0x362b47),_0x30e477;}export function validateSegmentRule(_0x3b1fc5,_0x17ca48){const _0x3dbfc1=a111_0x22e1b1;if(!_0x17ca48||!_0x17ca48[_0x3dbfc1(0x119)])return;for(let _0x3ab880=0x0;_0x3ab880<_0x17ca48['conditions'][_0x3dbfc1(0x105)];_0x3ab880++){const _0x34c8c6=_0x17ca48[_0x3dbfc1(0x119)][_0x3ab880];if(_0x3dbfc1(0x11c)in _0x34c8c6&&_0x34c8c6['type']===_0x3dbfc1(0xc2)){const _0x232116=_0x34c8c6;if(!_0x232116[_0x3dbfc1(0xfe)]||_0x232116['attribute']==='')throw new SDKError(ErrorCode[_0x3dbfc1(0x10e)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x3b1fc5+_0x3dbfc1(0xc0)+(_0x3dbfc1(0xcc)+_0x3ab880+_0x3dbfc1(0x132))+_0x3dbfc1(0xe9));}}}function a111_0x1577(){const _0x13f7c5=['90621YUWMRj','TimeWithinPast','Segment\x20description','connection','replace','emailToIdMap','\x27:\x20','schedule','Value','include','set','arrayMatching','limit','activations','join_row','operator','unit','segment','conditions[','getSchema','email_recipients','985824VEhxwO','toLowerCase','joinStrategy','source','warn','start_at','any','errors','resolveSegmentName','value','\x0a\x0aAvailable\x20fields:\x0a','columns','repeatFrequency','filter','segmentFolderId','Connector:\x20','description','540djIbAd','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','end_on','scheduleType','add','exclude','2362563zaReMC','connectorConfig','activationTemplateId','Please\x20specify\x20a\x20valid\x20attribute\x20name.','behaviorTableName','string','duration','notification','endOn','leftValue','order_by','474hTLYcu','rule:','from','max','activationParams','And','behavior_table','localeCompare','timezone','behavior','12vSftZa','not','57065RZFbzv','attribute','CONNECTION_NOT_FOUND','batch','aggregation','all','entries','connectionId','length','\x22:\x0a','repeatUnit','object','visible','sort','5210524DMetHj','Reference','connector_config\x20for\x20activation\x20\x22','JOURNEY_SYNTAX_ERROR','all_columns','folder','rightValues','realtime','localRuleToName','rightValue','notify_on','activation_template_id','has','formatting','conditions','orderBy','ruleHashToName','type','startAt','111pgqSnO','Invalid\x20connector_config\x20for\x20activation\x20\x22','Unknown\x20email\x20recipient:\x20','New\x20Segment','joinRow','join_strategy','groupingColumns','isArray','repeat_unit','warnings','stringify','Equal','test','kind','CONNECTOR_INVALID_CONFIG','connectionNameToIdMap','get','attributes','push','every','].attribute\x20cannot\x20be\x20empty.\x0a','min','rule','emailRecipients','syndicationBehavior','16qDUVwd','attribute_name','values','keys','TimeWithinNext','notifyOn','visibility','valid','20760575DtYLiR','allColumns','funnel_stage','repeatSubFrequency','name','map','Unknown\x20connection:\x20','INVALID_ARGUMENT','57948wDaeJe','repeat_frequency','parse','YAML\x20config\x20missing\x20required\x20field:\x20name','__SEGMENT_REF__','repeat_sub_frequency','connector_config'];a111_0x1577=function(){return _0x13f7c5;};return a111_0x1577();}
1
+ const a111_0x327adf=a111_0x576c;(function(_0x5130d9,_0x17fd06){const _0x295c7b=a111_0x576c,_0x15acbf=_0x5130d9();while(!![]){try{const _0x35aea4=-parseInt(_0x295c7b(0x1d2))/0x1*(-parseInt(_0x295c7b(0x1dd))/0x2)+-parseInt(_0x295c7b(0x1aa))/0x3*(-parseInt(_0x295c7b(0x1c2))/0x4)+parseInt(_0x295c7b(0x1d6))/0x5*(-parseInt(_0x295c7b(0x16d))/0x6)+parseInt(_0x295c7b(0x1cd))/0x7*(-parseInt(_0x295c7b(0x186))/0x8)+parseInt(_0x295c7b(0x182))/0x9+parseInt(_0x295c7b(0x173))/0xa+parseInt(_0x295c7b(0x176))/0xb*(-parseInt(_0x295c7b(0x16f))/0xc);if(_0x35aea4===_0x17fd06)break;else _0x15acbf['push'](_0x15acbf['shift']());}catch(_0x1b486b){_0x15acbf['push'](_0x15acbf['shift']());}}}(a111_0xed4e,0x78981));import*as a111_0x573623 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x171ad0,_0x3977c3){const _0x21280d=a111_0x576c,_0x4d0609=_0x171ad0['rule']&&_0x21280d(0x1c4)in _0x171ad0[_0x21280d(0x17e)]&&_0x171ad0[_0x21280d(0x17e)][_0x21280d(0x1c4)];return{'type':_0x21280d(0x1b9),'name':_0x171ad0[_0x21280d(0x1d9)],..._0x171ad0[_0x21280d(0x189)]&&{'description':_0x171ad0['description']},..._0x3977c3&&{'folder':_0x3977c3},..._0x4d0609&&{'rule':apiRuleToYaml(_0x171ad0[_0x21280d(0x17e)])},..._0x171ad0[_0x21280d(0x178)]!==undefined&&{'kind':_0x171ad0[_0x21280d(0x178)]===0x0?_0x21280d(0x194):_0x171ad0[_0x21280d(0x178)]===0x1?_0x21280d(0x170):_0x21280d(0x1a2)},..._0x171ad0[_0x21280d(0x1a8)]!==undefined&&{'visible':_0x171ad0[_0x21280d(0x1a8)]}};}export async function segmentResponseToDef(_0x2e153d,_0x53c6a9,_0xfe70ca){const _0x5397ac=a111_0x576c,_0x307575=segmentResponseToDefSync(_0x2e153d,_0xfe70ca);if(!_0x53c6a9||!_0x53c6a9[_0x5397ac(0x1d3)])return _0x307575;return _0x307575['rule']&&(_0x307575['rule']=await resolveRuleSegmentRefs(_0x307575[_0x5397ac(0x17e)],_0x53c6a9[_0x5397ac(0x1d3)])),_0x307575;}export function apiRuleToYaml(_0x4a703e){const _0x1f54d1=a111_0x576c,_0x2b892d=(_0x4a703e[_0x1f54d1(0x1c9)]||[])['map'](apiConditionToYaml);if(_0x2b892d['length']===0x1&&!_0x4a703e[_0x1f54d1(0x189)]&&'type'in _0x2b892d[0x0]&&(_0x2b892d[0x0]['type']===_0x1f54d1(0x1bc)||_0x2b892d[0x0][_0x1f54d1(0x1c4)]==='Or')){const _0xda7f56=_0x2b892d[0x0];if(_0xda7f56[_0x1f54d1(0x1c4)]===_0x4a703e['type']&&_0xda7f56[_0x1f54d1(0x1c9)])return{'type':_0x4a703e[_0x1f54d1(0x1c4)],'conditions':_0xda7f56['conditions'],..._0xda7f56[_0x1f54d1(0x189)]&&{'description':_0xda7f56[_0x1f54d1(0x189)]}};}return{'type':_0x4a703e[_0x1f54d1(0x1c4)],'conditions':_0x2b892d,..._0x4a703e['description']&&{'description':_0x4a703e['description']}};}function a111_0x576c(_0x343157,_0x4c499e){_0x343157=_0x343157-0x15c;const _0xed4eae=a111_0xed4e();let _0x576c17=_0xed4eae[_0x343157];return _0x576c17;}export async function resolveRuleSegmentRefs(_0x37a6d2,_0x1e9e63){const _0x3e2761=a111_0x576c,_0x2acf0a=await Promise[_0x3e2761(0x1da)](_0x37a6d2[_0x3e2761(0x1c9)][_0x3e2761(0x185)](_0x1576a6=>resolveConditionSegmentRefs(_0x1576a6,_0x1e9e63)));return{..._0x37a6d2,'conditions':_0x2acf0a};}async function resolveConditionSegmentRefs(_0x1cebb2,_0x5db2cb){const _0x5da212=a111_0x576c;if(_0x5da212(0x1b9)in _0x1cebb2&&(_0x1cebb2[_0x5da212(0x1c4)]==='include'||_0x1cebb2[_0x5da212(0x1c4)]===_0x5da212(0x1c3))){const _0x2b3083=_0x1cebb2;if(/^\d+$/[_0x5da212(0x167)](_0x2b3083[_0x5da212(0x1b9)])){const _0x3100bc=await _0x5db2cb(_0x2b3083[_0x5da212(0x1b9)]);return{..._0x2b3083,'segment':_0x3100bc};}return _0x1cebb2;}if(_0x5da212(0x1c9)in _0x1cebb2&&_0x1cebb2[_0x5da212(0x1c9)]){const _0x5f4627=_0x1cebb2,_0x4de1f8=await Promise[_0x5da212(0x1da)](_0x5f4627[_0x5da212(0x1c9)][_0x5da212(0x185)](_0x260249=>resolveConditionSegmentRefs(_0x260249,_0x5db2cb)));return{..._0x5f4627,'conditions':_0x4de1f8};}if(_0x5da212(0x1df)in _0x1cebb2&&_0x1cebb2[_0x5da212(0x1df)]){const _0x3a70cb=_0x1cebb2,_0x5e23ec=await resolveRuleSegmentRefs(_0x3a70cb[_0x5da212(0x1df)],_0x5db2cb);return{..._0x3a70cb,'filter':_0x5e23ec};}return _0x1cebb2;}export async function resolveRuleSegmentIds(_0x264669,_0x2b8e2c){const _0x506cd3=a111_0x576c,_0x5002c2=await Promise['all'](_0x264669[_0x506cd3(0x1c9)][_0x506cd3(0x185)](_0x588534=>resolveConditionSegmentIds(_0x588534,_0x2b8e2c)));return{..._0x264669,'conditions':_0x5002c2};}async function resolveConditionSegmentIds(_0x19b447,_0x3eb241){const _0x2d3731=a111_0x576c;if('segment'in _0x19b447&&(_0x19b447['type']===_0x2d3731(0x1cf)||_0x19b447[_0x2d3731(0x1c4)]===_0x2d3731(0x1c3))){const _0x4fb231=_0x19b447;if(!/^\d+$/[_0x2d3731(0x167)](_0x4fb231[_0x2d3731(0x1b9)])){const _0x2e18c8=await _0x3eb241(_0x4fb231[_0x2d3731(0x1b9)]);return{..._0x4fb231,'segment':_0x2e18c8};}return _0x19b447;}if(_0x2d3731(0x1c9)in _0x19b447&&_0x19b447[_0x2d3731(0x1c9)]){const _0xd5f1ba=_0x19b447,_0x821909=await Promise[_0x2d3731(0x1da)](_0xd5f1ba[_0x2d3731(0x1c9)][_0x2d3731(0x185)](_0x60c533=>resolveConditionSegmentIds(_0x60c533,_0x3eb241)));return{..._0xd5f1ba,'conditions':_0x821909};}if(_0x2d3731(0x1df)in _0x19b447&&_0x19b447['filter']){const _0x3f04aa=_0x19b447,_0x39db7b=await resolveRuleSegmentIds(_0x3f04aa['filter'],_0x3eb241);return{..._0x3f04aa,'filter':_0x39db7b};}return _0x19b447;}function apiConditionToYaml(_0x3cda4d){const _0x11d577=a111_0x576c;if(_0x3cda4d[_0x11d577(0x1c4)]===_0x11d577(0x1bc)||_0x3cda4d[_0x11d577(0x1c4)]==='Or'){if(_0x3cda4d[_0x11d577(0x1c9)]){const _0x2a08b8=_0x3cda4d[_0x11d577(0x1c9)][_0x11d577(0x185)](apiConditionToYaml);if(_0x2a08b8[_0x11d577(0x1ab)]===0x1&&!_0x3cda4d['description'])return _0x2a08b8[0x0];return{'type':_0x3cda4d[_0x11d577(0x1c4)],'conditions':_0x2a08b8,..._0x3cda4d['description']&&{'description':_0x3cda4d[_0x11d577(0x189)]}};}}if(_0x3cda4d['type']===_0x11d577(0x1a7)&&_0x3cda4d[_0x11d577(0x181)]&&_0x3cda4d[_0x11d577(0x17d)]){const _0xfbc8b3=_0x3cda4d['leftValue']['aggregation']?{'type':_0x3cda4d[_0x11d577(0x181)][_0x11d577(0x1b4)][_0x11d577(0x1c4)],..._0x3cda4d[_0x11d577(0x181)]['aggregation'][_0x11d577(0x18d)]&&{'groupingColumns':_0x3cda4d['leftValue'][_0x11d577(0x1b4)][_0x11d577(0x18d)]}}:undefined;return{'type':'Value','attribute':_0x3cda4d[_0x11d577(0x181)][_0x11d577(0x1d9)]||'','operator':apiOperatorToYaml(_0x3cda4d[_0x11d577(0x17d)]),..._0x3cda4d[_0x11d577(0x17b)]&&_0x3cda4d['arrayMatching']!==_0x11d577(0x1e9)?{'arrayMatching':_0x3cda4d['arrayMatching']}:{},..._0x3cda4d[_0x11d577(0x1c3)]?{'exclude':_0x3cda4d['exclude']}:{},..._0xfbc8b3?{'aggregation':_0xfbc8b3}:{},..._0x3cda4d[_0x11d577(0x181)][_0x11d577(0x175)]?{'source':_0x3cda4d[_0x11d577(0x181)][_0x11d577(0x175)][_0x11d577(0x1d9)]}:{},..._0x3cda4d[_0x11d577(0x181)][_0x11d577(0x1df)]?{'filter':apiRuleToYaml(_0x3cda4d['leftValue'][_0x11d577(0x1df)])}:{},..._0x3cda4d[_0x11d577(0x1b2)]!==undefined&&_0x3cda4d[_0x11d577(0x1b2)]!==null?{'limit':_0x3cda4d[_0x11d577(0x1b2)]}:{}};}if(_0x3cda4d[_0x11d577(0x1c4)]==='Reference'&&_0x3cda4d['id'])return{'type':_0x3cda4d['exclude']?_0x11d577(0x1c3):_0x11d577(0x1cf),'segment':_0x3cda4d['id']};return{'type':_0x11d577(0x1bc),'conditions':[]};}function isTemporalOperator(_0xd7817b){const _0x362662=a111_0x576c;return _0xd7817b==='TimeWithinPast'||_0xd7817b===_0x362662(0x195);}function getEffectiveValue(_0x1e2947){const _0x5d5635=a111_0x576c,_0x346ca5=_0x1e2947[_0x5d5635(0x19c)];return _0x1e2947[_0x5d5635(0x164)]??_0x346ca5;}function apiOperatorToYaml(_0x1162ae){const _0x1b3e42=a111_0x576c;let _0x39ba1b;if(_0x1162ae[_0x1b3e42(0x16e)]&&_0x1162ae['rightValues'][_0x1b3e42(0x1ab)]>0x0)_0x39ba1b=_0x1162ae[_0x1b3e42(0x16e)];else{if(_0x1162ae['rightValue']!==undefined)_0x39ba1b=_0x1162ae[_0x1b3e42(0x1e3)];else isTemporalOperator(_0x1162ae[_0x1b3e42(0x1c4)])&&_0x1162ae['value']!==undefined&&(_0x39ba1b=_0x1162ae[_0x1b3e42(0x164)]);}return{'type':mapApiOperatorType(_0x1162ae['type']),..._0x1162ae['not']&&{'not':_0x1162ae[_0x1b3e42(0x1e1)]},..._0x39ba1b!==undefined&&{'value':_0x39ba1b},..._0x1162ae[_0x1b3e42(0x17a)]&&{'unit':_0x1162ae['unit']}};}function mapApiOperatorType(_0x82c024){return _0x82c024;}export function segmentDefToCreateRequest(_0xb81e21,_0x571987){const _0x31fb9d=a111_0x576c,_0x45ed96={'name':_0xb81e21[_0x31fb9d(0x1d9)]};return _0xb81e21[_0x31fb9d(0x189)]&&(_0x45ed96[_0x31fb9d(0x189)]=_0xb81e21[_0x31fb9d(0x189)]),_0xb81e21['rule']&&(_0x45ed96[_0x31fb9d(0x17e)]=yamlRuleToApi(_0xb81e21[_0x31fb9d(0x17e)])),_0xb81e21[_0x31fb9d(0x178)]&&(_0x45ed96['kind']=_0xb81e21[_0x31fb9d(0x178)]===_0x31fb9d(0x194)?0x0:_0xb81e21[_0x31fb9d(0x178)]===_0x31fb9d(0x170)?0x1:0x2),_0xb81e21[_0x31fb9d(0x1a3)]!==undefined&&(_0x45ed96[_0x31fb9d(0x1a8)]=_0xb81e21[_0x31fb9d(0x1a3)]),_0x571987&&(_0x45ed96[_0x31fb9d(0x19a)]=_0x571987),_0x45ed96;}export function segmentDefToUpdateRequest(_0x5a0448){const _0x1dc5c6=a111_0x576c,_0x2a4c2d={'name':_0x5a0448['name']};return _0x5a0448[_0x1dc5c6(0x189)]!==undefined&&(_0x2a4c2d[_0x1dc5c6(0x189)]=_0x5a0448[_0x1dc5c6(0x189)]),_0x5a0448[_0x1dc5c6(0x17e)]&&(_0x2a4c2d[_0x1dc5c6(0x17e)]=yamlRuleToApi(_0x5a0448[_0x1dc5c6(0x17e)])),_0x5a0448['kind']&&(_0x2a4c2d[_0x1dc5c6(0x178)]=_0x5a0448[_0x1dc5c6(0x178)]==='batch'?0x0:_0x5a0448[_0x1dc5c6(0x178)]===_0x1dc5c6(0x170)?0x1:0x2),_0x2a4c2d;}export function yamlRuleToApi(_0x59a124,_0xdf5014=![]){const _0x1164cf=a111_0x576c,_0x402211=_0x59a124[_0x1164cf(0x1c9)][_0x1164cf(0x185)](yamlConditionToApi);if(_0xdf5014){const _0x54ca9f=_0x402211[_0x1164cf(0x168)](_0x5dc21a=>_0x5dc21a['type']===_0x1164cf(0x1bc)||_0x5dc21a[_0x1164cf(0x1c4)]==='Or');if(!_0x54ca9f&&_0x402211[_0x1164cf(0x1ab)]>0x0)return{'type':_0x59a124[_0x1164cf(0x1c4)],'conditions':[{'type':_0x1164cf(0x1bc),'description':_0x59a124['description']||'','conditions':_0x402211}]};}return{'type':_0x59a124[_0x1164cf(0x1c4)],'conditions':_0x402211,..._0x59a124[_0x1164cf(0x189)]&&{'description':_0x59a124[_0x1164cf(0x189)]}};}function yamlConditionToApi(_0xba181a){const _0x845afb=a111_0x576c;if('segment'in _0xba181a&&(_0xba181a[_0x845afb(0x1c4)]===_0x845afb(0x1cf)||_0xba181a['type']===_0x845afb(0x1c3))){const _0x31e1b5=_0xba181a;return{'type':'Reference','id':_0x31e1b5[_0x845afb(0x1b9)],'exclude':_0x31e1b5['type']==='exclude'};}if(_0x845afb(0x1c4)in _0xba181a&&(_0xba181a[_0x845afb(0x1c4)]===_0x845afb(0x1bc)||_0xba181a[_0x845afb(0x1c4)]==='Or')){const _0x961d73=_0xba181a;return{'type':_0x961d73['type'],'conditions':_0x961d73['conditions'][_0x845afb(0x185)](yamlConditionToApi),..._0x961d73['description']&&{'description':_0x961d73[_0x845afb(0x189)]}};}const _0x2b8775=_0xba181a,_0x2935ca={'type':_0x845afb(0x1a7),'leftValue':buildLeftValue(_0x2b8775),'operator':yamlOperatorToApi(_0x2b8775[_0x845afb(0x17d)]),'exclude':_0x2b8775['exclude']??![],'arrayMatching':_0x2b8775['arrayMatching']??'any'};return _0x2b8775[_0x845afb(0x1b2)]!==undefined&&(_0x2935ca[_0x845afb(0x1b2)]=_0x2b8775[_0x845afb(0x1b2)]),_0x2935ca;}function buildLeftValue(_0x454d9a){const _0x4dcc16=a111_0x576c,_0x28e67b={'name':_0x454d9a[_0x4dcc16(0x1cb)]};return _0x454d9a[_0x4dcc16(0x1b4)]&&(_0x28e67b[_0x4dcc16(0x1b4)]={'type':_0x454d9a[_0x4dcc16(0x1b4)][_0x4dcc16(0x1c4)],..._0x454d9a[_0x4dcc16(0x1b4)][_0x4dcc16(0x18d)]&&{'groupingColumns':_0x454d9a['aggregation']['groupingColumns']}}),_0x454d9a[_0x4dcc16(0x175)]&&(_0x28e67b[_0x4dcc16(0x175)]={'name':_0x454d9a['source']}),_0x454d9a[_0x4dcc16(0x1df)]&&(_0x28e67b[_0x4dcc16(0x1df)]=yamlRuleToApi(_0x454d9a[_0x4dcc16(0x1df)])),_0x28e67b;}function yamlOperatorToApi(_0x3e983f){const _0x169826=a111_0x576c,_0x15e555={'type':mapYamlOperatorType(_0x3e983f[_0x169826(0x1c4)]),'not':_0x3e983f[_0x169826(0x1e1)]??![]},_0x3f375e=getEffectiveValue(_0x3e983f);if(_0x3f375e!==undefined){if(Array[_0x169826(0x1b6)](_0x3f375e))_0x15e555[_0x169826(0x16e)]=_0x3f375e;else isTemporalOperator(_0x3e983f[_0x169826(0x1c4)])?_0x15e555[_0x169826(0x164)]=_0x3f375e:_0x15e555[_0x169826(0x1e3)]=_0x3f375e;}return _0x3e983f[_0x169826(0x17a)]&&(_0x15e555['unit']=_0x3e983f['unit']),_0x15e555;}function mapYamlOperatorType(_0x1bb64f){return _0x1bb64f;}export function toYamlString(_0x264e5e){const _0x79fb11=a111_0x576c,_0x170e4a=JSON[_0x79fb11(0x16c)](JSON[_0x79fb11(0x1b1)](_0x264e5e)),_0x209ede=a111_0x573623[_0x79fb11(0x1b1)](_0x170e4a,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x5cc74a=[_0x79fb11(0x190)];let _0x100dfe=_0x209ede;for(const _0x54163e of _0x5cc74a){_0x100dfe=_0x100dfe[_0x79fb11(0x161)](new RegExp('^('+_0x54163e+')','m'),(_0x4757a7,_0x407d32,_0x818990)=>{if(_0x818990===0x0||_0x100dfe[_0x818990-0x1]==='\x0a'&&_0x100dfe[_0x818990-0x2]==='\x0a')return _0x407d32;return'\x0a'+_0x407d32;});}return _0x100dfe;}export function parseYamlString(_0x29269a){const _0x5b2fde=a111_0x576c,_0x124da8=a111_0x573623['parse'](_0x29269a);if(!_0x124da8['name'])throw new Error(_0x5b2fde(0x1ac));if(_0x124da8[_0x5b2fde(0x1c4)]&&_0x124da8['type']!==_0x5b2fde(0x1b9))throw new Error('YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20'+_0x124da8[_0x5b2fde(0x1c4)]);return _0x124da8;}export function isSegmentYaml(_0x11d7ed){const _0x2483f6=a111_0x576c;if(typeof _0x11d7ed!==_0x2483f6(0x1e6)||_0x11d7ed===null)return![];const _0x1b7e9c=_0x11d7ed;return _0x1b7e9c[_0x2483f6(0x1c4)]===_0x2483f6(0x1b9)||_0x1b7e9c['type']===undefined;}export function generateTemplate(_0x3e13e1=a111_0x327adf(0x1c7)){const _0x217933=a111_0x327adf,_0x331f8b={'type':_0x217933(0x1b9),'name':_0x3e13e1,'description':_0x217933(0x1cc),'rule':{'type':_0x217933(0x1bc),'conditions':[{'type':'Value','attribute':_0x217933(0x172),'operator':{'type':_0x217933(0x1ed),'value':_0x217933(0x164)}}]}};return toYamlString(_0x331f8b);}export function segmentToYamlString(_0x3d5923){const _0xcc83c5=a111_0x327adf,_0x4d054a=JSON['parse'](JSON[_0xcc83c5(0x1b1)](_0x3d5923)),_0xff2edd=a111_0x573623['stringify'](_0x4d054a,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x31aab1=[_0xcc83c5(0x190),'activations:'];let _0x86a56d=_0xff2edd;for(const _0x1bcc9a of _0x31aab1){_0x86a56d=_0x86a56d[_0xcc83c5(0x161)](new RegExp('^('+_0x1bcc9a+')','m'),(_0x299aca,_0x46c516,_0x26d825)=>{if(_0x26d825===0x0||_0x86a56d[_0x26d825-0x1]==='\x0a'&&_0x86a56d[_0x26d825-0x2]==='\x0a')return _0x46c516;return'\x0a'+_0x46c516;});}return _0x86a56d;}export function parseSegmentYamlFile(_0x5c2b2f){const _0x4f0e69=a111_0x327adf,_0x354ecd=a111_0x573623[_0x4f0e69(0x16c)](_0x5c2b2f);if(!_0x354ecd['name'])throw new Error(_0x4f0e69(0x1ac));return _0x354ecd;}export function normalizeChildSegmentYaml(_0x5c6084){const _0x12fa26=a111_0x327adf;return{'type':_0x12fa26(0x1b9),'name':_0x5c6084['name'],..._0x5c6084[_0x12fa26(0x189)]!==undefined&&{'description':_0x5c6084[_0x12fa26(0x189)]},..._0x5c6084[_0x12fa26(0x1e5)]!==undefined&&{'folder':_0x5c6084[_0x12fa26(0x1e5)]},..._0x5c6084[_0x12fa26(0x17e)]&&{'rule':normalizeRule(_0x5c6084[_0x12fa26(0x17e)])},..._0x5c6084[_0x12fa26(0x178)]!==undefined&&{'kind':_0x5c6084[_0x12fa26(0x178)]},..._0x5c6084[_0x12fa26(0x1a3)]!==undefined&&{'visible':_0x5c6084['visible']},..._0x5c6084[_0x12fa26(0x18a)]&&{'activations':_0x5c6084[_0x12fa26(0x18a)][_0x12fa26(0x185)](normalizeActivation)}};}export function normalizeRule(_0x5c59cc){const _0x50ab53=a111_0x327adf;return{'type':_0x5c59cc[_0x50ab53(0x1c4)],'conditions':_0x5c59cc[_0x50ab53(0x1c9)]['map'](normalizeCondition),..._0x5c59cc['description']!==undefined&&{'description':_0x5c59cc[_0x50ab53(0x189)]}};}function normalizeCondition(_0x414a3a){const _0x90ac01=a111_0x327adf;if(_0x90ac01(0x1b9)in _0x414a3a&&(_0x414a3a[_0x90ac01(0x1c4)]===_0x90ac01(0x1cf)||_0x414a3a[_0x90ac01(0x1c4)]===_0x90ac01(0x1c3))){const _0x20fd40=_0x414a3a;return{'type':_0x20fd40[_0x90ac01(0x1c4)],'segment':_0x20fd40[_0x90ac01(0x1b9)]};}if(_0x90ac01(0x1c4)in _0x414a3a&&(_0x414a3a[_0x90ac01(0x1c4)]==='And'||_0x414a3a['type']==='Or')){const _0x36d07b=_0x414a3a;return{'type':_0x36d07b['type'],'conditions':_0x36d07b['conditions']['map'](normalizeCondition),..._0x36d07b['description']!==undefined&&{'description':_0x36d07b[_0x90ac01(0x189)]}};}const _0x4dc32e=_0x414a3a;return{'type':_0x90ac01(0x1a7),'attribute':_0x4dc32e['attribute'],'operator':normalizeOperator(_0x4dc32e[_0x90ac01(0x17d)]),..._0x4dc32e['arrayMatching']!==undefined&&{'arrayMatching':_0x4dc32e[_0x90ac01(0x17b)]},..._0x4dc32e[_0x90ac01(0x1c3)]!==undefined&&{'exclude':_0x4dc32e[_0x90ac01(0x1c3)]},..._0x4dc32e['aggregation']!==undefined&&{'aggregation':_0x4dc32e[_0x90ac01(0x1b4)]},..._0x4dc32e['source']!==undefined&&{'source':_0x4dc32e['source']},..._0x4dc32e[_0x90ac01(0x1df)]!==undefined&&{'filter':normalizeRule(_0x4dc32e['filter'])},..._0x4dc32e[_0x90ac01(0x1b2)]!==undefined&&{'limit':_0x4dc32e['limit']}};}function normalizeOperator(_0x24811){const _0x244fef=a111_0x327adf,_0xb7ecd0=getEffectiveValue(_0x24811);return{'type':_0x24811[_0x244fef(0x1c4)],..._0x24811[_0x244fef(0x1e1)]!==undefined&&{'not':_0x24811['not']},..._0xb7ecd0!==undefined&&{'value':_0xb7ecd0},..._0x24811[_0x244fef(0x1b8)]!==undefined&&{'min':_0x24811[_0x244fef(0x1b8)]},..._0x24811[_0x244fef(0x1db)]!==undefined&&{'max':_0x24811[_0x244fef(0x1db)]},..._0x24811[_0x244fef(0x17a)]!==undefined&&{'unit':_0x24811[_0x244fef(0x17a)]},..._0x24811[_0x244fef(0x1b5)]!==undefined&&{'duration':_0x24811[_0x244fef(0x1b5)]},..._0x24811[_0x244fef(0x1a9)]!==undefined&&{'from':_0x24811[_0x244fef(0x1a9)]}};}function normalizeActivation(_0x580e89){const _0x2fa031=a111_0x327adf;return{'name':_0x580e89[_0x2fa031(0x1d9)],'connection':_0x580e89['connection'],..._0x580e89[_0x2fa031(0x189)]!==undefined&&{'description':_0x580e89[_0x2fa031(0x189)]},..._0x580e89['all_columns']!==undefined&&{'all_columns':_0x580e89['all_columns']},..._0x580e89['columns']!==undefined&&{'columns':_0x580e89[_0x2fa031(0x199)]},..._0x580e89[_0x2fa031(0x1c0)]!==undefined&&{'behavior':_0x580e89['behavior']},..._0x580e89['schedule']!==undefined&&{'schedule':_0x580e89[_0x2fa031(0x1a5)]},..._0x580e89[_0x2fa031(0x191)]!==undefined&&{'notification':_0x580e89[_0x2fa031(0x191)]},..._0x580e89[_0x2fa031(0x1ad)]!==undefined&&{'connector_config':_0x580e89[_0x2fa031(0x1ad)]},..._0x580e89[_0x2fa031(0x160)]!==undefined&&{'activation_template_id':_0x580e89[_0x2fa031(0x160)]}};}export function activationResponseToDef(_0x3016c9,_0x4e244a,_0x44f985){const _0x596422=a111_0x327adf,_0x2f7aef=_0x3016c9[_0x596422(0x1a6)]||'',_0x59ffbb=_0x44f985?.[_0x596422(0x184)](_0x2f7aef)??_0x2f7aef,_0x8f37f1={'name':_0x3016c9[_0x596422(0x1d9)],'connection':_0x59ffbb};_0x3016c9['description']&&(_0x8f37f1[_0x596422(0x189)]=_0x3016c9[_0x596422(0x189)]);let _0x1e2020=[];_0x3016c9[_0x596422(0x199)]&&_0x3016c9[_0x596422(0x199)][_0x596422(0x1ab)]>0x0&&(_0x1e2020=_0x3016c9[_0x596422(0x199)]['filter'](_0x2ca89e=>_0x2ca89e&&_0x2ca89e['name'])['map'](_0x3a7db3=>{const _0x4233d8=_0x596422;if(_0x3a7db3[_0x4233d8(0x1c4)]||_0x3a7db3[_0x4233d8(0x183)])return{'name':_0x3a7db3[_0x4233d8(0x1d9)],..._0x3a7db3[_0x4233d8(0x1c4)]&&{'type':_0x3a7db3['type']},..._0x3a7db3[_0x4233d8(0x183)]&&{'visibility':_0x3a7db3[_0x4233d8(0x183)]}};return _0x3a7db3[_0x4233d8(0x1d9)];}));_0x1e2020[_0x596422(0x1ab)]>0x0&&(_0x8f37f1[_0x596422(0x199)]=_0x1e2020);_0x3016c9[_0x596422(0x1b0)]!==undefined&&(_0x3016c9[_0x596422(0x1b0)]===![]&&_0x1e2020[_0x596422(0x1ab)]===0x0?_0x8f37f1[_0x596422(0x1c6)]=!![]:_0x8f37f1[_0x596422(0x1c6)]=_0x3016c9[_0x596422(0x1b0)]);const _0x5ed35f={};let _0x2e3d67=![];_0x3016c9[_0x596422(0x17c)]&&(_0x5ed35f['type']=_0x3016c9[_0x596422(0x17c)],_0x2e3d67=!![]);_0x3016c9['repeatUnit']&&(_0x5ed35f[_0x596422(0x1de)]=_0x3016c9[_0x596422(0x17f)],_0x2e3d67=!![]);_0x3016c9['repeatFrequency']!==undefined&&_0x3016c9['repeatFrequency']!==null&&(_0x5ed35f[_0x596422(0x165)]=_0x3016c9[_0x596422(0x1d8)],_0x2e3d67=!![]);_0x3016c9[_0x596422(0x1b3)]&&_0x3016c9[_0x596422(0x1b3)]['length']>0x0&&(_0x5ed35f[_0x596422(0x1d7)]=_0x3016c9[_0x596422(0x1b3)],_0x2e3d67=!![]);_0x3016c9[_0x596422(0x169)]!==undefined&&(_0x5ed35f[_0x596422(0x15c)]=_0x3016c9[_0x596422(0x169)],_0x2e3d67=!![]);_0x3016c9[_0x596422(0x177)]!==undefined&&(_0x5ed35f[_0x596422(0x15f)]=_0x3016c9['endOn'],_0x2e3d67=!![]);_0x3016c9[_0x596422(0x1c5)]&&(_0x5ed35f['timezone']=_0x3016c9[_0x596422(0x1c5)],_0x2e3d67=!![]);_0x2e3d67&&(_0x8f37f1[_0x596422(0x1a5)]=_0x5ed35f);(_0x3016c9[_0x596422(0x1ba)]&&_0x3016c9[_0x596422(0x1ba)]['length']>0x0||_0x3016c9[_0x596422(0x174)]&&_0x3016c9['emailRecipients']['length']>0x0)&&(_0x8f37f1['notification']={},_0x3016c9[_0x596422(0x1ba)]&&_0x3016c9[_0x596422(0x1ba)][_0x596422(0x1ab)]>0x0&&(_0x8f37f1[_0x596422(0x191)][_0x596422(0x1ca)]=_0x3016c9['notifyOn']),_0x3016c9[_0x596422(0x174)]&&_0x3016c9[_0x596422(0x174)][_0x596422(0x1ab)]>0x0&&(_0x8f37f1[_0x596422(0x191)]['email_recipients']=_0x3016c9[_0x596422(0x174)][_0x596422(0x185)](_0x4686a8=>{const _0xe99842=_0x596422,_0x48ac68=_0x4e244a?.[_0xe99842(0x184)](_0x4686a8);return _0x48ac68??String(_0x4686a8);})));_0x3016c9['connectorConfig']&&Object['keys'](_0x3016c9[_0x596422(0x1e2)])['length']>0x0&&(_0x8f37f1['connector_config']=normalizeConnectorConfigForYaml(_0x3016c9[_0x596422(0x1e2)]));_0x3016c9[_0x596422(0x198)]&&(_0x8f37f1[_0x596422(0x160)]=_0x3016c9[_0x596422(0x198)]);if(_0x3016c9[_0x596422(0x1bd)]){const _0x307082={},_0x2508f8=_0x3016c9[_0x596422(0x1bd)];_0x2508f8[_0x596422(0x199)]&&_0x2508f8[_0x596422(0x199)]['length']>0x0&&(_0x307082[_0x596422(0x199)]=_0x2508f8[_0x596422(0x199)]['filter'](_0x455224=>_0x455224&&_0x455224['name'])[_0x596422(0x185)](_0x1c7d62=>({'name':_0x1c7d62[_0x596422(0x1d9)],..._0x1c7d62[_0x596422(0x1c4)]&&{'type':_0x1c7d62['type']},..._0x1c7d62[_0x596422(0x183)]&&{'visibility':_0x1c7d62[_0x596422(0x183)]}}))),_0x2508f8['behaviorTableName']&&(_0x307082[_0x596422(0x1eb)]=_0x2508f8['behaviorTableName']),_0x2508f8[_0x596422(0x1e0)]!==undefined&&(_0x307082['join_row']=_0x2508f8[_0x596422(0x1e0)]),_0x2508f8['joinStrategy']&&(_0x307082[_0x596422(0x19e)]=_0x2508f8[_0x596422(0x1e4)]),_0x2508f8[_0x596422(0x1dc)]&&(_0x307082[_0x596422(0x1dc)]=_0x2508f8[_0x596422(0x1dc)]),_0x2508f8[_0x596422(0x1d4)]&&_0x2508f8[_0x596422(0x1d4)][_0x596422(0x1ab)]>0x0&&(_0x307082[_0x596422(0x1d1)]=_0x2508f8[_0x596422(0x1d4)]),Object['keys'](_0x307082)[_0x596422(0x1ab)]>0x0&&(_0x8f37f1['behavior']=_0x307082);}return _0x8f37f1;}export function journeyActivationStepToYaml(_0x423332,_0x2aa92f,_0x4db513){const _0x4c6a43=a111_0x327adf,_0x5282ef=_0x423332[_0x4c6a43(0x1c1)][_0x4c6a43(0x16b)],_0x39e026=_0x5282ef[_0x4c6a43(0x1a6)]||'',_0xb76ac8=_0x4db513?.[_0x4c6a43(0x184)](_0x39e026)??_0x39e026,_0x4ddd61={'name':_0x5282ef[_0x4c6a43(0x1d9)]||'','connection':_0xb76ac8};_0x5282ef[_0x4c6a43(0x189)]&&(_0x4ddd61['description']=_0x5282ef['description']);let _0x559de1=[];_0x5282ef[_0x4c6a43(0x199)]&&_0x5282ef[_0x4c6a43(0x199)][_0x4c6a43(0x1ab)]>0x0&&(_0x559de1=_0x5282ef[_0x4c6a43(0x199)][_0x4c6a43(0x1df)](_0x43d174=>_0x43d174&&_0x43d174[_0x4c6a43(0x1d9)])['map'](_0x43ad70=>{const _0x782110=_0x4c6a43;if(_0x43ad70['type']||_0x43ad70[_0x782110(0x183)])return{'name':_0x43ad70[_0x782110(0x1d9)],..._0x43ad70[_0x782110(0x1c4)]&&{'type':_0x43ad70[_0x782110(0x1c4)]},..._0x43ad70[_0x782110(0x183)]&&{'visibility':_0x43ad70[_0x782110(0x183)]}};return _0x43ad70['name'];}));_0x559de1[_0x4c6a43(0x1ab)]>0x0&&(_0x4ddd61[_0x4c6a43(0x199)]=_0x559de1);_0x5282ef[_0x4c6a43(0x1b0)]!==undefined&&(_0x5282ef['allColumns']===![]&&_0x559de1[_0x4c6a43(0x1ab)]===0x0?_0x4ddd61[_0x4c6a43(0x1c6)]=!![]:_0x4ddd61['all_columns']=_0x5282ef[_0x4c6a43(0x1b0)]);const _0x49881e={};let _0x5284d8=![];_0x5282ef[_0x4c6a43(0x17c)]&&(_0x49881e['type']=_0x5282ef[_0x4c6a43(0x17c)],_0x5284d8=!![]);_0x5282ef[_0x4c6a43(0x17f)]&&(_0x49881e['repeat_unit']=_0x5282ef['repeatUnit'],_0x5284d8=!![]);_0x5282ef[_0x4c6a43(0x1d8)]!==undefined&&_0x5282ef[_0x4c6a43(0x1d8)]!==null&&(_0x49881e[_0x4c6a43(0x165)]=_0x5282ef['repeatFrequency'],_0x5284d8=!![]);_0x5282ef['startAt']!==undefined&&(_0x49881e[_0x4c6a43(0x15c)]=_0x5282ef[_0x4c6a43(0x169)],_0x5284d8=!![]);_0x5282ef[_0x4c6a43(0x177)]!==undefined&&(_0x49881e[_0x4c6a43(0x15f)]=_0x5282ef[_0x4c6a43(0x177)],_0x5284d8=!![]);_0x5282ef[_0x4c6a43(0x1c5)]&&(_0x49881e[_0x4c6a43(0x1c5)]=_0x5282ef[_0x4c6a43(0x1c5)],_0x5284d8=!![]);_0x5284d8&&(_0x4ddd61['schedule']=_0x49881e);(_0x5282ef['notifyOn']&&_0x5282ef[_0x4c6a43(0x1ba)][_0x4c6a43(0x1ab)]>0x0||_0x5282ef[_0x4c6a43(0x174)]&&_0x5282ef[_0x4c6a43(0x174)]['length']>0x0)&&(_0x4ddd61[_0x4c6a43(0x191)]={},_0x5282ef[_0x4c6a43(0x1ba)]&&_0x5282ef[_0x4c6a43(0x1ba)][_0x4c6a43(0x1ab)]>0x0&&(_0x4ddd61[_0x4c6a43(0x191)][_0x4c6a43(0x1ca)]=_0x5282ef[_0x4c6a43(0x1ba)]),_0x5282ef['emailRecipients']&&_0x5282ef[_0x4c6a43(0x174)][_0x4c6a43(0x1ab)]>0x0&&(_0x4ddd61[_0x4c6a43(0x191)]['email_recipients']=_0x5282ef[_0x4c6a43(0x174)][_0x4c6a43(0x185)](_0x639fbe=>{const _0x107547=_0x4c6a43,_0xa272e3=_0x2aa92f?.[_0x107547(0x184)](_0x639fbe);return _0xa272e3??String(_0x639fbe);})));_0x5282ef[_0x4c6a43(0x1e2)]&&Object[_0x4c6a43(0x1e7)](_0x5282ef[_0x4c6a43(0x1e2)])[_0x4c6a43(0x1ab)]>0x0&&(_0x4ddd61[_0x4c6a43(0x1ad)]=normalizeConnectorConfigForYaml(_0x5282ef['connectorConfig']));_0x5282ef[_0x4c6a43(0x198)]&&(_0x4ddd61['activation_template_id']=_0x5282ef[_0x4c6a43(0x198)]);if(_0x5282ef['syndicationBehavior']){const _0x169624={},_0x2121f5=_0x5282ef[_0x4c6a43(0x1bd)];_0x2121f5[_0x4c6a43(0x199)]&&_0x2121f5[_0x4c6a43(0x199)][_0x4c6a43(0x1ab)]>0x0&&(_0x169624[_0x4c6a43(0x199)]=_0x2121f5[_0x4c6a43(0x199)][_0x4c6a43(0x1df)](_0xda5fc7=>_0xda5fc7&&_0xda5fc7[_0x4c6a43(0x1d9)])[_0x4c6a43(0x185)](_0x307f8a=>({'name':_0x307f8a[_0x4c6a43(0x1d9)],..._0x307f8a['type']&&{'type':_0x307f8a[_0x4c6a43(0x1c4)]},..._0x307f8a[_0x4c6a43(0x183)]&&{'visibility':_0x307f8a[_0x4c6a43(0x183)]}}))),_0x2121f5[_0x4c6a43(0x18e)]&&(_0x169624['behavior_table']=_0x2121f5[_0x4c6a43(0x18e)]),_0x2121f5['joinRow']!==undefined&&(_0x169624[_0x4c6a43(0x192)]=_0x2121f5[_0x4c6a43(0x1e0)]),_0x2121f5[_0x4c6a43(0x1e4)]&&(_0x169624[_0x4c6a43(0x19e)]=_0x2121f5[_0x4c6a43(0x1e4)]),_0x2121f5[_0x4c6a43(0x1dc)]&&(_0x169624['formatting']=_0x2121f5[_0x4c6a43(0x1dc)]),_0x2121f5['orderBy']&&_0x2121f5[_0x4c6a43(0x1d4)][_0x4c6a43(0x1ab)]>0x0&&(_0x169624['order_by']=_0x2121f5[_0x4c6a43(0x1d4)]),Object[_0x4c6a43(0x1e7)](_0x169624)[_0x4c6a43(0x1ab)]>0x0&&(_0x4ddd61[_0x4c6a43(0x1c0)]=_0x169624);}return _0x4ddd61;}export function segmentWithActivationsToYaml(_0x560b61,_0x4a23f9,_0x142a1c,_0x2dd089,_0xd498be){const _0x4d7411=a111_0x327adf,_0x1cf08f=segmentResponseToDefSync(_0x560b61,_0x142a1c);return _0x4a23f9[_0x4d7411(0x1ab)]>0x0&&(_0x1cf08f[_0x4d7411(0x18a)]=_0x4a23f9[_0x4d7411(0x185)](_0x38e52b=>activationResponseToDef(_0x38e52b,_0x2dd089,_0xd498be))),_0x1cf08f;}function normalizeColumn(_0x2f7f21){const _0x41311a=a111_0x327adf;if(typeof _0x2f7f21===_0x41311a(0x1e8))return{'name':_0x2f7f21};return{'name':_0x2f7f21['name'],..._0x2f7f21[_0x41311a(0x1c4)]&&{'type':_0x2f7f21['type']},..._0x2f7f21['visibility']&&{'visibility':_0x2f7f21[_0x41311a(0x183)]}};}export async function activationDefToCreateRequest(_0x233ee5,_0x101b66){const _0x1edc81=a111_0x327adf,_0x48f73d=_0x101b66?.['emailToIdMap'],_0x17da65=_0x101b66?.[_0x1edc81(0x187)],_0x5e9fc3=_0x233ee5['connection'];let _0x882d6f;const _0x1b88f3=parseInt(_0x5e9fc3,0xa);if(!isNaN(_0x1b88f3)&&String(_0x1b88f3)===_0x5e9fc3)_0x882d6f=_0x1b88f3;else{const _0x45ab00=_0x17da65?.[_0x1edc81(0x184)](_0x5e9fc3);if(_0x45ab00===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x1edc81(0x1ea)+_0x5e9fc3,undefined,{'helpText':_0x1edc81(0x188)});_0x882d6f=_0x45ab00;}const _0x270e3a={'name':_0x233ee5[_0x1edc81(0x1d9)],'connectionId':_0x882d6f};_0x233ee5[_0x1edc81(0x189)]&&(_0x270e3a[_0x1edc81(0x189)]=_0x233ee5[_0x1edc81(0x189)]);let _0x4a76e1=[];_0x233ee5[_0x1edc81(0x199)]&&_0x233ee5[_0x1edc81(0x199)][_0x1edc81(0x1ab)]>0x0&&(_0x4a76e1=_0x233ee5['columns'][_0x1edc81(0x1df)](_0x62ec4f=>_0x62ec4f!=null)['map'](normalizeColumn));_0x4a76e1[_0x1edc81(0x1ab)]>0x0&&(_0x270e3a['columns']=_0x4a76e1);_0x233ee5[_0x1edc81(0x1c6)]!==undefined&&(_0x233ee5[_0x1edc81(0x1c6)]===![]&&_0x4a76e1['length']===0x0?_0x270e3a[_0x1edc81(0x1b0)]=!![]:_0x270e3a[_0x1edc81(0x1b0)]=_0x233ee5[_0x1edc81(0x1c6)]);if(_0x233ee5['schedule']){const _0x4c6467=_0x233ee5[_0x1edc81(0x1a5)];_0x4c6467['type']&&(_0x270e3a['scheduleType']=_0x4c6467[_0x1edc81(0x1c4)]),_0x4c6467[_0x1edc81(0x1de)]&&(_0x270e3a[_0x1edc81(0x17f)]=_0x4c6467[_0x1edc81(0x1de)]),_0x4c6467[_0x1edc81(0x165)]!==undefined&&(_0x270e3a['repeatFrequency']=_0x4c6467[_0x1edc81(0x165)]),_0x4c6467[_0x1edc81(0x1d7)]&&(_0x270e3a[_0x1edc81(0x1b3)]=_0x4c6467[_0x1edc81(0x1d7)]),_0x4c6467[_0x1edc81(0x15c)]!==undefined&&(_0x270e3a['startAt']=_0x4c6467['start_at']),_0x4c6467[_0x1edc81(0x15f)]!==undefined&&(_0x270e3a['endOn']=_0x4c6467['end_on']),_0x4c6467['timezone']&&(_0x270e3a[_0x1edc81(0x1c5)]=_0x4c6467[_0x1edc81(0x1c5)]);}_0x233ee5[_0x1edc81(0x191)]&&(_0x233ee5[_0x1edc81(0x191)][_0x1edc81(0x1ca)]&&(_0x270e3a['notifyOn']=_0x233ee5[_0x1edc81(0x191)][_0x1edc81(0x1ca)]),_0x233ee5[_0x1edc81(0x191)]['email_recipients']&&(_0x270e3a[_0x1edc81(0x174)]=_0x233ee5['notification'][_0x1edc81(0x15e)][_0x1edc81(0x185)](_0x1731de=>{const _0x2c57b9=_0x1edc81,_0x282e63=Number(_0x1731de);if(!isNaN(_0x282e63)&&String(_0x282e63)===_0x1731de)return _0x282e63;const _0x555433=_0x48f73d?.[_0x2c57b9(0x184)](_0x1731de[_0x2c57b9(0x19d)]());if(_0x555433===undefined)throw new SDKError(ErrorCode[_0x2c57b9(0x1ce)],'Unknown\x20email\x20recipient:\x20'+_0x1731de+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x555433;})));if(_0x233ee5[_0x1edc81(0x1ad)]){const _0x5099a2=_0x101b66?.[_0x1edc81(0x19f)]?.[_0x1edc81(0x184)](_0x5e9fc3);if(_0x5099a2&&_0x101b66?.[_0x1edc81(0x1bb)])try{const _0xbe4dbd=await _0x101b66[_0x1edc81(0x1bb)](_0x5099a2),_0x4fb09a=validateConnectorConfig(_0x233ee5['connector_config'],_0xbe4dbd);if(!_0x4fb09a[_0x1edc81(0x16a)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],_0x1edc81(0x15d)+_0x233ee5[_0x1edc81(0x1d9)]+_0x1edc81(0x19b)+formatValidationErrors(_0x4fb09a['errors']),undefined,{'helpText':_0x1edc81(0x1a1)+_0x5099a2+_0x1edc81(0x197)+formatSchemaAsHelp(_0xbe4dbd)});if(_0x4fb09a[_0x1edc81(0x166)]['length']>0x0){const _0x55c21d=formatValidationWarnings(_0x4fb09a[_0x1edc81(0x166)]);console[_0x1edc81(0x18f)](_0x1edc81(0x1c8)+_0x233ee5['name']+_0x1edc81(0x19b)+_0x55c21d);}_0x270e3a[_0x1edc81(0x1e2)]=transformConfigToLegacy(_0x233ee5[_0x1edc81(0x1ad)],_0xbe4dbd);}catch(_0x416050){if(_0x416050 instanceof SDKError&&_0x416050[_0x1edc81(0x1a0)]===ErrorCode[_0x1edc81(0x1d5)])_0x270e3a[_0x1edc81(0x1e2)]=_0x233ee5[_0x1edc81(0x1ad)];else throw _0x416050;}else _0x270e3a[_0x1edc81(0x1e2)]=_0x233ee5[_0x1edc81(0x1ad)];}_0x233ee5[_0x1edc81(0x160)]!==undefined&&(_0x270e3a[_0x1edc81(0x198)]=_0x233ee5['activation_template_id']);if(_0x233ee5[_0x1edc81(0x1c0)]){const _0x9970=_0x233ee5['behavior'],_0xde0998={};if(_0x9970[_0x1edc81(0x199)]&&_0x9970[_0x1edc81(0x199)][_0x1edc81(0x1ab)]>0x0){const _0x324075=_0x9970[_0x1edc81(0x199)][_0x1edc81(0x1df)](_0x331470=>_0x331470&&_0x331470['name']);_0x324075['length']>0x0&&(_0xde0998[_0x1edc81(0x199)]=_0x324075);}_0x9970[_0x1edc81(0x1eb)]&&(_0xde0998[_0x1edc81(0x18e)]=_0x9970[_0x1edc81(0x1eb)]),_0x9970[_0x1edc81(0x192)]!==undefined&&(_0xde0998[_0x1edc81(0x1e0)]=_0x9970[_0x1edc81(0x192)]),_0x9970['join_strategy']&&(_0xde0998['joinStrategy']=_0x9970[_0x1edc81(0x19e)]),_0x9970[_0x1edc81(0x1dc)]&&(_0xde0998['formatting']=_0x9970[_0x1edc81(0x1dc)]),_0x9970[_0x1edc81(0x1d1)]&&(_0xde0998[_0x1edc81(0x1d4)]=_0x9970[_0x1edc81(0x1d1)]),_0x270e3a[_0x1edc81(0x1bd)]=_0xde0998;}return _0x270e3a;}export async function activationDefToUpdateRequest(_0x4eb277,_0xa04cb9){return activationDefToCreateRequest(_0x4eb277,_0xa04cb9);}export function deepSortObject(_0x403f48){const _0x5775b9=a111_0x327adf;if(_0x403f48===null||typeof _0x403f48!==_0x5775b9(0x1e6))return _0x403f48;if(Array['isArray'](_0x403f48))return _0x403f48[_0x5775b9(0x185)](deepSortObject)[_0x5775b9(0x163)]((_0x139665,_0x42fe14)=>JSON[_0x5775b9(0x1b1)](_0x139665)[_0x5775b9(0x1a4)](JSON['stringify'](_0x42fe14)));const _0x36a348={};for(const _0x33c80a of Object[_0x5775b9(0x1e7)](_0x403f48)[_0x5775b9(0x163)]()){_0x36a348[_0x33c80a]=deepSortObject(_0x403f48[_0x33c80a]);}return _0x36a348;}export function serializeRule(_0x46721a){const _0x53c4cc=a111_0x327adf;return JSON[_0x53c4cc(0x1b1)](deepSortObject(_0x46721a));}export function normalizeRuleForMatching(_0x34e8f7){return normalizeConditionsForMatching(_0x34e8f7);}function normalizeConditionsForMatching(_0x457b1c){const _0x52e625=a111_0x327adf;if(_0x457b1c===null||typeof _0x457b1c!=='object')return _0x457b1c;if(Array['isArray'](_0x457b1c))return _0x457b1c['map'](normalizeConditionsForMatching);const _0x2b9c6c=_0x457b1c;if((_0x2b9c6c[_0x52e625(0x1c4)]==='include'||_0x2b9c6c[_0x52e625(0x1c4)]===_0x52e625(0x1c3))&&typeof _0x2b9c6c['segment']===_0x52e625(0x1e8))return{..._0x2b9c6c,'segment':_0x52e625(0x196)};const _0x3778a5={};for(const _0x1294dd of Object['keys'](_0x2b9c6c)){_0x3778a5[_0x1294dd]=normalizeConditionsForMatching(_0x2b9c6c[_0x1294dd]);}return _0x3778a5;}export function serializeRuleForMatching(_0x32bab0){const _0x4d541d=a111_0x327adf;return JSON[_0x4d541d(0x1b1)](deepSortObject(normalizeRuleForMatching(_0x32bab0)));}export function expandSegmentReferences(_0x137423,_0x5bd3aa,_0x50fb3d=new Set()){return expandConditions(_0x137423,_0x5bd3aa,_0x50fb3d);}function expandConditions(_0x4451ce,_0x47789d,_0x13c708){const _0x10cf50=a111_0x327adf;if(_0x4451ce===null||typeof _0x4451ce!==_0x10cf50(0x1e6))return _0x4451ce;if(Array[_0x10cf50(0x1b6)](_0x4451ce))return _0x4451ce[_0x10cf50(0x185)](_0x2c53ee=>expandConditions(_0x2c53ee,_0x47789d,_0x13c708));const _0x258c44=_0x4451ce;if((_0x258c44[_0x10cf50(0x1c4)]===_0x10cf50(0x1cf)||_0x258c44[_0x10cf50(0x1c4)]===_0x10cf50(0x1c3))&&typeof _0x258c44[_0x10cf50(0x1b9)]==='string'){const _0x43c401=_0x258c44['segment'],_0x588576=_0x47789d[_0x10cf50(0x184)](_0x43c401);if(_0x588576&&!_0x13c708[_0x10cf50(0x1b7)](_0x43c401)){const _0x419a73=new Set(_0x13c708);_0x419a73['add'](_0x43c401);const _0x5e9f1d=expandConditions(_0x588576,_0x47789d,_0x419a73);return{'type':_0x258c44['type'],'expanded_rule':_0x5e9f1d};}return{'type':_0x258c44[_0x10cf50(0x1c4)],'expanded_rule':_0x10cf50(0x1be)};}const _0x58fc1c={};for(const _0x16075c of Object['keys'](_0x258c44)){_0x58fc1c[_0x16075c]=expandConditions(_0x258c44[_0x16075c],_0x47789d,_0x13c708);}return _0x58fc1c;}export function serializeExpandedRule(_0x2676ea,_0x3c2440){const _0x5e1ee4=a111_0x327adf,_0x152d1c=expandSegmentReferences(_0x2676ea,_0x3c2440);return JSON[_0x5e1ee4(0x1b1)](deepSortObject(_0x152d1c));}export function createSegmentNameContext(_0x45031b){const _0x49c8a5=a111_0x327adf,_0x22e735=new Set(),_0x3f0fe3=new Map(),_0x3f8f7e=new Map();if(_0x45031b)for(const [_0x4238c5,_0x9308b5]of Object[_0x49c8a5(0x1d0)](_0x45031b)){if(_0x9308b5['rule']){const _0x4760ef=serializeRule(_0x9308b5[_0x49c8a5(0x17e)]);_0x3f8f7e[_0x49c8a5(0x1bf)](_0x4760ef,_0x4238c5),_0x22e735['add'](_0x4238c5);}}return{'usedNames':_0x22e735,'ruleHashToName':_0x3f0fe3,'localRuleToName':_0x45031b?_0x3f8f7e:undefined};}export function resolveSegmentName(_0x414e7b,_0xd1e364,_0x3b9868,_0x144f6e){const _0x4c4711=a111_0x327adf,_0x3b877b=serializeRule(_0xd1e364);if(_0x3b9868[_0x4c4711(0x18b)]){const _0x300328=_0x3b9868['localRuleToName']['get'](_0x3b877b);if(_0x300328)return{'name':_0x300328,'isDuplicate':![],'isLocalMatch':!![]};}const _0x382747=_0x3b9868['ruleHashToName']['get'](_0x3b877b);if(_0x382747)return{'name':_0x382747,'isDuplicate':!![],'isLocalMatch':![]};const _0x1c6e71=_0x144f6e(_0x414e7b);let _0x49999e=_0x1c6e71||_0x414e7b,_0x14b7f4=_0x49999e,_0x77e8b9=0x2;while(_0x3b9868[_0x4c4711(0x162)]['has'](_0x14b7f4)){_0x14b7f4=_0x49999e+'_'+_0x77e8b9,_0x77e8b9++;}return _0x3b9868[_0x4c4711(0x162)][_0x4c4711(0x180)](_0x14b7f4),_0x3b9868[_0x4c4711(0x193)]['set'](_0x3b877b,_0x14b7f4),{'name':_0x14b7f4,'isDuplicate':![],'isLocalMatch':![]};}function a111_0xed4e(){const _0x561edf=['rule','repeatUnit','add','leftValue','5534766oZMNFn','visibility','get','map','1005352byOcrM','connectionNameToIdMap','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','description','activations','localRuleToName','JOURNEY_SYNTAX_ERROR','groupingColumns','behaviorTableName','warn','rule:','notification','join_row','ruleHashToName','batch','TimeWithinNext','__SEGMENT_REF__','\x0a\x0aAvailable\x20fields:\x0a','activationTemplateId','columns','segmentFolderId','\x22:\x0a','values','toLowerCase','join_strategy','connectionNameToTypeMap','code','Connector:\x20','funnel_stage','visible','localeCompare','schedule','connectionId','Value','isVisible','from','54531xhkuPi','length','YAML\x20config\x20missing\x20required\x20field:\x20name','connector_config','].attribute\x20cannot\x20be\x20empty.\x0a','\x27:\x20','allColumns','stringify','limit','repeatSubFrequency','aggregation','duration','isArray','has','min','segment','notifyOn','getSchema','And','syndicationBehavior','__UNRESOLVED__','set','behavior','attributes','132XqugpG','exclude','type','timezone','all_columns','New\x20Segment','connector_config\x20for\x20activation\x20\x22','conditions','notify_on','attribute','Segment\x20description','7XPajbn','INVALID_ARGUMENT','include','entries','order_by','493445xwvRYa','resolveSegmentName','orderBy','CONNECTOR_SCHEMA_NOT_FOUND','5moqhRE','repeat_sub_frequency','repeatFrequency','name','all','max','formatting','2ZgrTaj','repeat_unit','filter','joinRow','not','connectorConfig','rightValue','joinStrategy','folder','object','keys','string','any','Unknown\x20connection:\x20','behavior_table','Please\x20specify\x20a\x20valid\x20attribute\x20name.','Equal','push','start_at','Invalid\x20connector_config\x20for\x20activation\x20\x22','email_recipients','end_on','activation_template_id','replace','usedNames','sort','value','repeat_frequency','warnings','test','every','startAt','valid','activationParams','parse','3423534WViXvk','rightValues','17512860BgFzEE','realtime','forEach','attribute_name','9413560OMpXdv','emailRecipients','source','11yaDaIi','endOn','kind','conditions[','unit','arrayMatching','scheduleType','operator'];a111_0xed4e=function(){return _0x561edf;};return a111_0xed4e();}export function collectSegmentRefsFromRule(_0x20b3d9){const _0x3b8a65=[],_0x5f1ff9=_0xfe5bfa=>{const _0xf846aa=a111_0x576c;if(!_0xfe5bfa||typeof _0xfe5bfa!=='object')return;if(Array[_0xf846aa(0x1b6)](_0xfe5bfa)){_0xfe5bfa[_0xf846aa(0x171)](_0x5f1ff9);return;}const _0x33b8ec=_0xfe5bfa;(_0x33b8ec['type']===_0xf846aa(0x1cf)||_0x33b8ec[_0xf846aa(0x1c4)]===_0xf846aa(0x1c3))&&typeof _0x33b8ec['segment']===_0xf846aa(0x1e8)&&_0x3b8a65[_0xf846aa(0x1ee)](_0x33b8ec[_0xf846aa(0x1b9)]);for(const _0x14b2a5 of Object[_0xf846aa(0x19c)](_0x33b8ec)){_0x5f1ff9(_0x14b2a5);}};return _0x5f1ff9(_0x20b3d9),_0x3b8a65;}export function validateSegmentRule(_0x48b7ff,_0x3922cd){const _0x12ab31=a111_0x327adf;if(!_0x3922cd||!_0x3922cd[_0x12ab31(0x1c9)])return;for(let _0x3f487d=0x0;_0x3f487d<_0x3922cd[_0x12ab31(0x1c9)]['length'];_0x3f487d++){const _0x1c289d=_0x3922cd[_0x12ab31(0x1c9)][_0x3f487d];if(_0x12ab31(0x1c4)in _0x1c289d&&_0x1c289d[_0x12ab31(0x1c4)]===_0x12ab31(0x1a7)){const _0x48ea47=_0x1c289d;if(!_0x48ea47[_0x12ab31(0x1cb)]||_0x48ea47[_0x12ab31(0x1cb)]==='')throw new SDKError(ErrorCode[_0x12ab31(0x18c)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x48b7ff+_0x12ab31(0x1af)+(_0x12ab31(0x179)+_0x3f487d+_0x12ab31(0x1ae))+_0x12ab31(0x1ec));}}}
@@ -1 +1 @@
1
- (function(_0x31c323,_0x1fdf6d){const _0x47ebab=a112_0xc70b,_0x2c3bff=_0x31c323();while(!![]){try{const _0x46599f=-parseInt(_0x47ebab(0x1d5))/0x1*(-parseInt(_0x47ebab(0x1de))/0x2)+-parseInt(_0x47ebab(0x1cd))/0x3+-parseInt(_0x47ebab(0x1bc))/0x4+-parseInt(_0x47ebab(0x1d4))/0x5*(parseInt(_0x47ebab(0x1af))/0x6)+parseInt(_0x47ebab(0x1cc))/0x7*(parseInt(_0x47ebab(0x1e3))/0x8)+-parseInt(_0x47ebab(0x1e2))/0x9*(parseInt(_0x47ebab(0x1b3))/0xa)+parseInt(_0x47ebab(0x1d3))/0xb;if(_0x46599f===_0x1fdf6d)break;else _0x2c3bff['push'](_0x2c3bff['shift']());}catch(_0x195884){_0x2c3bff['push'](_0x2c3bff['shift']());}}}(a112_0x492e,0x65eff));import a112_0x23ed9b from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';function a112_0x492e(){const _0x5e432b=['Fetching\x20schema...','query','5163921LWkAJC','5848zTBkdd','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','varchar','execute','84RlLSeK','error','length','groupingName','10WiNhWO','displayName','behavior','key','set','Unknown','cyan','tableName','verbose','2029824HBVeYJ','Behaviors','name','entries','attribute','get','source','extra','setJobId','fields','startsWith','Schema\x20query:\x0a','YES','map','SELECT\x20*\x20FROM\x20(\x0a','column_name','3857RJXKSc','740439lfzweE','parentTableName','parentColumn','\x20\x20\x20\x20','behaviorName','column_type','17935863BkyTuu','193885XbIQgP','255137QBeRSl','size','replace','sort','dim','localeCompare','type','null','bold','2cwlrqm','push'];a112_0x492e=function(){return _0x5e432b;};return a112_0x492e();}export function buildSchemaResult(_0x1b2d7a){const _0x3083ad=a112_0xc70b,_0x56fe90=_0x1b2d7a['columns'][_0x3083ad(0x1c9)](_0xbb283a=>({'column_name':_0xbb283a['name'],'column_type':_0xbb283a[_0x3083ad(0x1db)],'null':_0x3083ad(0x1c8),'key':null,'default':null,'extra':null}));return{..._0x1b2d7a,'columns':[{'name':_0x3083ad(0x1cb),'type':_0x3083ad(0x1ad)},{'name':_0x3083ad(0x1d2),'type':'varchar'},{'name':_0x3083ad(0x1dc),'type':_0x3083ad(0x1ad)},{'name':_0x3083ad(0x1b6),'type':_0x3083ad(0x1ad)},{'name':'default','type':_0x3083ad(0x1ad)},{'name':_0x3083ad(0x1c3),'type':'varchar'}],'data':_0x56fe90};}function a112_0xc70b(_0x241093,_0xf44841){_0x241093=_0x241093-0x1ac;const _0x492e84=a112_0x492e();let _0xc70b63=_0x492e84[_0x241093];return _0xc70b63;}export async function executeSchemaQuery(_0x106df3,_0x5832f7,_0x37a86e){const _0x5b55d3=a112_0xc70b,_0xfdbaaf=_0x106df3['trim']()[_0x5b55d3(0x1d7)](/;+$/,''),_0x115079=_0x5b55d3(0x1ca)+_0xfdbaaf+_0x5b55d3(0x1ac);_0x37a86e[_0x5b55d3(0x1bb)]&&console[_0x5b55d3(0x1b0)](_0x5b55d3(0x1c7)+_0x115079);const _0x486db7=await withProgressSpinner(_0x5b55d3(0x1e0),async _0xa49398=>{const _0x183efd=_0x5b55d3,_0x248ebd=await _0x5832f7[_0x183efd(0x1e1)][_0x183efd(0x1ae)](_0x115079,{'catalog':'td','schema':'information_schema','onJobId':_0x18f9d3=>{const _0x3460d4=_0x183efd;_0xa49398[_0x3460d4(0x1c4)](_0x18f9d3);}});return _0x248ebd;},{'verbose':_0x37a86e[_0x5b55d3(0x1bb)]});return buildSchemaResult(_0x486db7['data']);}export function displayFieldsHumanReadable(_0x35541d,_0x3c275f){const _0x50751d=a112_0xc70b,_0xd5b2c6=_0x35541d['filter'](_0x183e2f=>_0x183e2f['source']===_0x50751d(0x1c0)),_0x2729cc=_0x35541d['filter'](_0x5e7b4f=>_0x5e7b4f[_0x50751d(0x1c2)]===_0x50751d(0x1b5)),_0x27642d=new Map();for(const _0x161334 of _0xd5b2c6){const _0x2a97c2=_0x161334[_0x50751d(0x1b2)]||_0x161334[_0x50751d(0x1ce)]||_0x50751d(0x1b8),_0x40834b=_0x27642d[_0x50751d(0x1c1)](_0x2a97c2);_0x40834b?_0x40834b['fields'][_0x50751d(0x1df)](_0x161334):_0x27642d[_0x50751d(0x1b7)](_0x2a97c2,{'displayName':_0x2a97c2,'tableName':_0x161334['parentTableName'],'fields':[_0x161334]});}const _0x24970d=new Map();for(const _0x562a9f of _0x2729cc){const _0x2c8f2d=_0x562a9f[_0x50751d(0x1d1)]||_0x50751d(0x1b8),_0xa73348=_0x24970d[_0x50751d(0x1c1)](_0x2c8f2d)||[];_0xa73348[_0x50751d(0x1df)](_0x562a9f),_0x24970d[_0x50751d(0x1b7)](_0x2c8f2d,_0xa73348);}console[_0x50751d(0x1b0)]('\x0a'+a112_0x23ed9b[_0x50751d(0x1dd)](_0x3c275f));if(_0x27642d[_0x50751d(0x1d6)]>0x0){console[_0x50751d(0x1b0)]('\x0a'+a112_0x23ed9b[_0x50751d(0x1d9)]('Attributes'));const _0x565621=[..._0x27642d[_0x50751d(0x1bf)]()]['sort']((_0x1df54c,_0x53eba3)=>_0x1df54c[0x0][_0x50751d(0x1da)](_0x53eba3[0x0]));for(const [,_0x3e7c7d]of _0x565621){const _0x1021e3=_0x3e7c7d[_0x50751d(0x1ba)]&&_0x3e7c7d[_0x50751d(0x1ba)]!==_0x3e7c7d['displayName']?'\x20'+a112_0x23ed9b['dim']('('+_0x3e7c7d[_0x50751d(0x1ba)]+')'):'';console['error']('\x20\x20'+a112_0x23ed9b['bold'](_0x3e7c7d[_0x50751d(0x1b4)])+_0x1021e3);const _0x752320=[..._0x3e7c7d[_0x50751d(0x1c5)]][_0x50751d(0x1d8)]((_0x1569fb,_0x47dd6c)=>_0x1569fb[_0x50751d(0x1be)][_0x50751d(0x1da)](_0x47dd6c['name']));for(const _0x3d6ea4 of _0x752320){const _0x5084b3=_0x3d6ea4[_0x50751d(0x1cf)]&&_0x3d6ea4[_0x50751d(0x1cf)]!==_0x3d6ea4[_0x50751d(0x1be)]?'\x20'+a112_0x23ed9b[_0x50751d(0x1d9)]('('+_0x3d6ea4[_0x50751d(0x1cf)]+')'):'';console[_0x50751d(0x1b0)](_0x50751d(0x1d0)+_0x3d6ea4[_0x50751d(0x1be)]+_0x5084b3+':\x20'+a112_0x23ed9b['cyan'](_0x3d6ea4[_0x50751d(0x1db)]));}}}if(_0x24970d['size']>0x0){console['error']('\x0a'+a112_0x23ed9b[_0x50751d(0x1d9)](_0x50751d(0x1bd)));const _0x224594=[..._0x24970d[_0x50751d(0x1bf)]()][_0x50751d(0x1d8)]((_0x48dfcf,_0x440b68)=>_0x48dfcf[0x0][_0x50751d(0x1da)](_0x440b68[0x0]));for(const [_0x1110cc,_0x2013ce]of _0x224594){const _0x151c40=_0x2013ce[0x0],_0x192b9a=_0x151c40?.[_0x50751d(0x1ce)]||'';console[_0x50751d(0x1b0)]('\x20\x20'+a112_0x23ed9b['bold'](_0x1110cc)+(_0x192b9a?'\x20'+a112_0x23ed9b[_0x50751d(0x1d9)]('('+_0x192b9a+')'):''));const _0x1eb4c8=[..._0x2013ce][_0x50751d(0x1d8)]((_0x4d6260,_0x446561)=>_0x4d6260[_0x50751d(0x1be)][_0x50751d(0x1da)](_0x446561[_0x50751d(0x1be)]));for(const _0x49de93 of _0x1eb4c8){const _0x3f85b2=_0x49de93[_0x50751d(0x1be)][_0x50751d(0x1c6)](_0x1110cc+'.')?_0x49de93[_0x50751d(0x1be)]['slice'](_0x1110cc[_0x50751d(0x1b1)]+0x1):_0x49de93['name'],_0x5450a4=_0x49de93[_0x50751d(0x1cf)]&&_0x49de93[_0x50751d(0x1cf)]!==_0x3f85b2?'\x20'+a112_0x23ed9b['dim']('('+_0x49de93[_0x50751d(0x1cf)]+')'):'';console[_0x50751d(0x1b0)]('\x20\x20\x20\x20'+_0x3f85b2+_0x5450a4+':\x20'+a112_0x23ed9b[_0x50751d(0x1b9)](_0x49de93[_0x50751d(0x1db)]));}}}console[_0x50751d(0x1b0)]('');}
1
+ function a112_0x5913(_0x185177,_0x39dbeb){_0x185177=_0x185177-0x156;const _0x1988b5=a112_0x1988();let _0x591314=_0x1988b5[_0x185177];return _0x591314;}(function(_0x46f7db,_0x16bae3){const _0x2694bb=a112_0x5913,_0x2e84f6=_0x46f7db();while(!![]){try{const _0x195e25=-parseInt(_0x2694bb(0x176))/0x1+-parseInt(_0x2694bb(0x15c))/0x2*(parseInt(_0x2694bb(0x17d))/0x3)+-parseInt(_0x2694bb(0x17f))/0x4+-parseInt(_0x2694bb(0x170))/0x5+parseInt(_0x2694bb(0x180))/0x6*(parseInt(_0x2694bb(0x172))/0x7)+-parseInt(_0x2694bb(0x160))/0x8*(parseInt(_0x2694bb(0x167))/0x9)+parseInt(_0x2694bb(0x184))/0xa;if(_0x195e25===_0x16bae3)break;else _0x2e84f6['push'](_0x2e84f6['shift']());}catch(_0x26438b){_0x2e84f6['push'](_0x2e84f6['shift']());}}}(a112_0x1988,0xcc3f3));import a112_0x102a9b from'chalk';function a112_0x1988(){const _0x53b199=['3706893nVWtYH','sort','cyan','push','size','startsWith','get','parentColumn','replace','8092230Dzncbh','error','806512pwfQnH','\x20\x20\x20\x20','entries','YES','1253765OzwAXN','parentTableName','attribute','displayName','set','column_type','tableName','530049fJZjYt','data','1662816EbWEuz','48nBFVOK','filter','bold','behavior','43213910rIIKlB','extra','localeCompare','fields','column_name','query','Fetching\x20schema...','type','columns','dim','name','8VflYfk','verbose','trim','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','8EsCaVu','default','key','Unknown','execute','map','varchar'];a112_0x1988=function(){return _0x53b199;};return a112_0x1988();}import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x3e199b){const _0x38c285=a112_0x5913,_0x2ed957=_0x3e199b[_0x38c285(0x159)][_0x38c285(0x165)](_0xfb618=>({'column_name':_0xfb618[_0x38c285(0x15b)],'column_type':_0xfb618['type'],'null':_0x38c285(0x175),'key':null,'default':null,'extra':null}));return{..._0x3e199b,'columns':[{'name':_0x38c285(0x188),'type':_0x38c285(0x166)},{'name':_0x38c285(0x17b),'type':_0x38c285(0x166)},{'name':'null','type':_0x38c285(0x166)},{'name':_0x38c285(0x162),'type':_0x38c285(0x166)},{'name':_0x38c285(0x161),'type':'varchar'},{'name':_0x38c285(0x185),'type':'varchar'}],'data':_0x2ed957};}export async function executeSchemaQuery(_0x4371fa,_0x4b8c6a,_0x8f59fb){const _0x349650=a112_0x5913,_0x2da4d0=_0x4371fa[_0x349650(0x15e)]()[_0x349650(0x16f)](/;+$/,''),_0x1b48bc='SELECT\x20*\x20FROM\x20(\x0a'+_0x2da4d0+_0x349650(0x15f);_0x8f59fb[_0x349650(0x15d)]&&console['error']('Schema\x20query:\x0a'+_0x1b48bc);const _0x4e01e2=await withProgressSpinner(_0x349650(0x157),async _0xc5f95d=>{const _0x4d746f=_0x349650,_0x3bfeac=await _0x4b8c6a[_0x4d746f(0x156)][_0x4d746f(0x164)](_0x1b48bc,{'catalog':'td','schema':'information_schema','onJobId':_0x58267e=>{_0xc5f95d['setJobId'](_0x58267e);}});return _0x3bfeac;},{'verbose':_0x8f59fb[_0x349650(0x15d)]});return buildSchemaResult(_0x4e01e2[_0x349650(0x17e)]);}export function displayFieldsHumanReadable(_0x55f6c4,_0xe3d334){const _0x28a729=a112_0x5913,_0x1d40de=_0x55f6c4[_0x28a729(0x181)](_0x4d874e=>_0x4d874e['source']===_0x28a729(0x178)),_0x2c8b83=_0x55f6c4[_0x28a729(0x181)](_0x419307=>_0x419307['source']===_0x28a729(0x183)),_0xec1783=new Map();for(const _0x5c51dc of _0x1d40de){const _0x117150=_0x5c51dc['groupingName']||_0x5c51dc[_0x28a729(0x177)]||_0x28a729(0x163),_0x265f8a=_0xec1783[_0x28a729(0x16d)](_0x117150);_0x265f8a?_0x265f8a['fields'][_0x28a729(0x16a)](_0x5c51dc):_0xec1783[_0x28a729(0x17a)](_0x117150,{'displayName':_0x117150,'tableName':_0x5c51dc[_0x28a729(0x177)],'fields':[_0x5c51dc]});}const _0x4ca92e=new Map();for(const _0x10050d of _0x2c8b83){const _0x18fe23=_0x10050d['behaviorName']||_0x28a729(0x163),_0x51ce09=_0x4ca92e['get'](_0x18fe23)||[];_0x51ce09['push'](_0x10050d),_0x4ca92e['set'](_0x18fe23,_0x51ce09);}console['error']('\x0a'+a112_0x102a9b[_0x28a729(0x182)](_0xe3d334));if(_0xec1783[_0x28a729(0x16b)]>0x0){console[_0x28a729(0x171)]('\x0a'+a112_0x102a9b[_0x28a729(0x15a)]('Attributes'));const _0x38a2f3=[..._0xec1783[_0x28a729(0x174)]()][_0x28a729(0x168)]((_0x53bc50,_0x2d941d)=>_0x53bc50[0x0][_0x28a729(0x186)](_0x2d941d[0x0]));for(const [,_0xfa76d7]of _0x38a2f3){const _0x1c5a6c=_0xfa76d7[_0x28a729(0x17c)]&&_0xfa76d7[_0x28a729(0x17c)]!==_0xfa76d7[_0x28a729(0x179)]?'\x20'+a112_0x102a9b[_0x28a729(0x15a)]('('+_0xfa76d7[_0x28a729(0x17c)]+')'):'';console[_0x28a729(0x171)]('\x20\x20'+a112_0x102a9b[_0x28a729(0x182)](_0xfa76d7['displayName'])+_0x1c5a6c);const _0x3c411a=[..._0xfa76d7[_0x28a729(0x187)]]['sort']((_0x36be1c,_0x305101)=>_0x36be1c[_0x28a729(0x15b)][_0x28a729(0x186)](_0x305101[_0x28a729(0x15b)]));for(const _0x573a7f of _0x3c411a){const _0x1e47ea=_0x573a7f['parentColumn']&&_0x573a7f[_0x28a729(0x16e)]!==_0x573a7f['name']?'\x20'+a112_0x102a9b[_0x28a729(0x15a)]('('+_0x573a7f[_0x28a729(0x16e)]+')'):'';console[_0x28a729(0x171)](_0x28a729(0x173)+_0x573a7f['name']+_0x1e47ea+':\x20'+a112_0x102a9b[_0x28a729(0x169)](_0x573a7f[_0x28a729(0x158)]));}}}if(_0x4ca92e[_0x28a729(0x16b)]>0x0){console[_0x28a729(0x171)]('\x0a'+a112_0x102a9b[_0x28a729(0x15a)]('Behaviors'));const _0x40f4f3=[..._0x4ca92e[_0x28a729(0x174)]()]['sort']((_0x19dd11,_0x2f42cd)=>_0x19dd11[0x0]['localeCompare'](_0x2f42cd[0x0]));for(const [_0x34d0f3,_0x5c85b1]of _0x40f4f3){const _0x45d4a4=_0x5c85b1[0x0],_0x3fd1fa=_0x45d4a4?.[_0x28a729(0x177)]||'';console['error']('\x20\x20'+a112_0x102a9b['bold'](_0x34d0f3)+(_0x3fd1fa?'\x20'+a112_0x102a9b['dim']('('+_0x3fd1fa+')'):''));const _0x542567=[..._0x5c85b1][_0x28a729(0x168)]((_0x394aef,_0x1ee4ed)=>_0x394aef['name'][_0x28a729(0x186)](_0x1ee4ed['name']));for(const _0x3ec11c of _0x542567){const _0x103e7f=_0x3ec11c['name'][_0x28a729(0x16c)](_0x34d0f3+'.')?_0x3ec11c[_0x28a729(0x15b)]['slice'](_0x34d0f3['length']+0x1):_0x3ec11c[_0x28a729(0x15b)],_0x223c72=_0x3ec11c['parentColumn']&&_0x3ec11c[_0x28a729(0x16e)]!==_0x103e7f?'\x20'+a112_0x102a9b['dim']('('+_0x3ec11c[_0x28a729(0x16e)]+')'):'';console['error']('\x20\x20\x20\x20'+_0x103e7f+_0x223c72+':\x20'+a112_0x102a9b[_0x28a729(0x169)](_0x3ec11c[_0x28a729(0x158)]));}}}console[_0x28a729(0x171)]('');}
@@ -1 +1 @@
1
- (function(_0x223dc9,_0x1c7d62){const _0x424d37=a113_0x4dc4,_0x3c43d7=_0x223dc9();while(!![]){try{const _0xb568b6=-parseInt(_0x424d37(0x70))/0x1*(parseInt(_0x424d37(0x68))/0x2)+-parseInt(_0x424d37(0x76))/0x3*(-parseInt(_0x424d37(0x6c))/0x4)+-parseInt(_0x424d37(0x7b))/0x5+-parseInt(_0x424d37(0x6e))/0x6+-parseInt(_0x424d37(0x71))/0x7*(-parseInt(_0x424d37(0x78))/0x8)+parseInt(_0x424d37(0x6a))/0x9*(-parseInt(_0x424d37(0x77))/0xa)+parseInt(_0x424d37(0x74))/0xb*(parseInt(_0x424d37(0x79))/0xc);if(_0xb568b6===_0x1c7d62)break;else _0x3c43d7['push'](_0x3c43d7['shift']());}catch(_0xab4139){_0x3c43d7['push'](_0x3c43d7['shift']());}}}(a113_0x3ad5,0x2ba7f));function a113_0x3ad5(){const _0x215642=['348tfvUoX','relative','1674610cqUMCp','name','dirname','25036fGXoJJ','isFile','9xVnDqr','join','8etflzi','endsWith','1922304oMSMvO','.yml','1QNkNWz','14xYVQGk','toLowerCase','map','207196HSEBSF','.yaml','382662KVkrWf','1189910LZSmWy','657112pVLNut'];a113_0x3ad5=function(){return _0x215642;};return a113_0x3ad5();}import{readdirSync,statSync}from'fs';function a113_0x4dc4(_0x3d64c1,_0x32bfab){_0x3d64c1=_0x3d64c1-0x66;const _0x3ad52e=a113_0x3ad5();let _0x4dc44d=_0x3ad52e[_0x3d64c1];return _0x4dc44d;}import a113_0x348da1 from'path';export function findYamlFiles(_0x155658){const _0x3349ff=[];function _0x22ae44(_0x1bc251){const _0x40bb5e=a113_0x4dc4,_0x4e2eb2=readdirSync(_0x1bc251,{'withFileTypes':!![]});for(const _0x63a663 of _0x4e2eb2){const _0x545562=a113_0x348da1[_0x40bb5e(0x6b)](_0x1bc251,_0x63a663[_0x40bb5e(0x66)]);if(_0x63a663['isDirectory']())_0x22ae44(_0x545562);else(_0x63a663[_0x40bb5e(0x66)][_0x40bb5e(0x6d)](_0x40bb5e(0x6f))||_0x63a663['name'][_0x40bb5e(0x6d)]('.yaml'))&&_0x3349ff['push'](_0x545562);}}return _0x22ae44(_0x155658),_0x3349ff;}export function discoverYamlFiles(_0xc781a7){const _0x188e54=a113_0x4dc4,_0x42187f=findYamlFiles(_0xc781a7);return _0x42187f[_0x188e54(0x73)](_0x3ac19f=>{const _0x264125=_0x188e54,_0x397fbb=a113_0x348da1[_0x264125(0x7a)](_0xc781a7,_0x3ac19f),_0x1d1168=a113_0x348da1[_0x264125(0x67)](_0x397fbb);return{'absolutePath':_0x3ac19f,'relativePath':_0x397fbb,'folderPath':_0x1d1168==='.'?'':_0x1d1168};});}export function isYamlFile(_0xd80f65){const _0x27f08d=a113_0x4dc4;try{const _0x143041=statSync(_0xd80f65);if(!_0x143041[_0x27f08d(0x69)]())return![];const _0x5a10bf=a113_0x348da1['extname'](_0xd80f65)[_0x27f08d(0x72)]();return _0x5a10bf===_0x27f08d(0x6f)||_0x5a10bf===_0x27f08d(0x75);}catch{return![];}}
1
+ (function(_0x3d3dd5,_0x460ff5){const _0x16ddf2=a113_0x1a0f,_0xe2b664=_0x3d3dd5();while(!![]){try{const _0x4aa0ff=parseInt(_0x16ddf2(0x13b))/0x1*(parseInt(_0x16ddf2(0x12b))/0x2)+-parseInt(_0x16ddf2(0x131))/0x3+-parseInt(_0x16ddf2(0x135))/0x4+-parseInt(_0x16ddf2(0x12a))/0x5*(-parseInt(_0x16ddf2(0x130))/0x6)+parseInt(_0x16ddf2(0x132))/0x7+parseInt(_0x16ddf2(0x137))/0x8+parseInt(_0x16ddf2(0x12e))/0x9*(-parseInt(_0x16ddf2(0x139))/0xa);if(_0x4aa0ff===_0x460ff5)break;else _0xe2b664['push'](_0xe2b664['shift']());}catch(_0x42671d){_0xe2b664['push'](_0xe2b664['shift']());}}}(a113_0x14a9,0xc4ec8));import{readdirSync,statSync}from'fs';import a113_0xd12547 from'path';export function findYamlFiles(_0x3983f3){const _0x83fe14=[];function _0x486d3f(_0x32a678){const _0x3fa461=a113_0x1a0f,_0x14487c=readdirSync(_0x32a678,{'withFileTypes':!![]});for(const _0xd544a4 of _0x14487c){const _0x2adf9b=a113_0xd12547[_0x3fa461(0x12d)](_0x32a678,_0xd544a4[_0x3fa461(0x12f)]);if(_0xd544a4[_0x3fa461(0x13a)]())_0x486d3f(_0x2adf9b);else(_0xd544a4['name'][_0x3fa461(0x136)](_0x3fa461(0x129))||_0xd544a4[_0x3fa461(0x12f)][_0x3fa461(0x136)]('.yaml'))&&_0x83fe14['push'](_0x2adf9b);}}return _0x486d3f(_0x3983f3),_0x83fe14;}function a113_0x1a0f(_0x33ccc0,_0x4d9f5a){_0x33ccc0=_0x33ccc0-0x129;const _0x14a9e7=a113_0x14a9();let _0x1a0f00=_0x14a9e7[_0x33ccc0];return _0x1a0f00;}export function discoverYamlFiles(_0x28a319){const _0x51c669=a113_0x1a0f,_0x2a0106=findYamlFiles(_0x28a319);return _0x2a0106[_0x51c669(0x133)](_0x2f34b2=>{const _0x340ceb=_0x51c669,_0x29c1e9=a113_0xd12547[_0x340ceb(0x13d)](_0x28a319,_0x2f34b2),_0x12371=a113_0xd12547[_0x340ceb(0x12c)](_0x29c1e9);return{'absolutePath':_0x2f34b2,'relativePath':_0x29c1e9,'folderPath':_0x12371==='.'?'':_0x12371};});}function a113_0x14a9(){const _0x35f4ba=['.yaml','3325328fsACNG','endsWith','11697600lHrKjL','extname','10VjcLDK','isDirectory','320766SKYCwx','isFile','relative','.yml','215aSUxxV','4WGxIan','dirname','join','10133757hDFVOs','name','201564XDramf','3219918LeJxmC','2022559hdApMr','map'];a113_0x14a9=function(){return _0x35f4ba;};return a113_0x14a9();}export function isYamlFile(_0x2db069){const _0x45db47=a113_0x1a0f;try{const _0x1b6e01=statSync(_0x2db069);if(!_0x1b6e01[_0x45db47(0x13c)]())return![];const _0x5916d4=a113_0xd12547[_0x45db47(0x138)](_0x2db069)['toLowerCase']();return _0x5916d4===_0x45db47(0x129)||_0x5916d4===_0x45db47(0x134);}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x27e6d6,_0x195d69){const _0x390d28=a114_0x5d40,_0xe3e0fd=_0x27e6d6();while(!![]){try{const _0xee892f=-parseInt(_0x390d28(0xe8))/0x1*(-parseInt(_0x390d28(0xcb))/0x2)+parseInt(_0x390d28(0xc7))/0x3*(parseInt(_0x390d28(0xe0))/0x4)+-parseInt(_0x390d28(0xe2))/0x5+parseInt(_0x390d28(0xe6))/0x6*(-parseInt(_0x390d28(0xef))/0x7)+-parseInt(_0x390d28(0xf6))/0x8+parseInt(_0x390d28(0xf0))/0x9+parseInt(_0x390d28(0xcf))/0xa;if(_0xee892f===_0x195d69)break;else _0xe3e0fd['push'](_0xe3e0fd['shift']());}catch(_0x401d4b){_0xe3e0fd['push'](_0xe3e0fd['shift']());}}}(a114_0x563f,0x768c5));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;function a114_0x563f(){const _0x545a1f=['some','values','3955896SJBZZm','stages','push','steps','connection','keys','yaml','rule','all_columns','version_number','versionNumber','endsWith','segment','index','connector_config','set','activation','match','.yml','journeyStages','conditions','version','map','journey','include','isArray','wait','stringify','reentry','replace','with','length','60xsmCrJ','schedule','attributes','decision_point','524996cNgUFX','segments','activation_template_id','type','564830xVymaF','bundle_name','trim','join','get','state','startsWith','branches','goal','max','item','slice','object','toLowerCase','find','entry_criteria','sort','112108cgLzjo','null','4000155eSKblj','journeys','latest','string','12RtzvEZ','nameMapping','3qKYnYl','versions','launched','condition','name','entries','merged','436716KnlElr','4503150YXYRhS','exclude','description','behavior'];a114_0x563f=function(){return _0x545a1f;};return a114_0x563f();}export function sanitizeYamlKey(_0x178920){const _0x13e111=a114_0x5d40;return _0x178920[_0x13e111(0xdc)]()[_0x13e111(0xc4)](/\s+/g,'_')[_0x13e111(0xc4)](/[^a-z0-9_]/g,'')[_0x13e111(0xc4)](/_+/g,'_')[_0x13e111(0xc4)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x24e2fe){const _0x560a98=a114_0x5d40,_0x3d5749=_0x24e2fe[_0x560a98(0xb8)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x3d5749){const _0x41ee47=_0x3d5749[0x1][_0x560a98(0xdc)](),_0x36b510=_0x3d5749[0x2],_0x142f8a=_0x36b510['replace'](/-/g,'')['slice'](0x0,0x4)[_0x560a98(0xdc)]();return _0x41ee47+'_'+_0x142f8a;}const _0x22bfac=_0x24e2fe[_0x560a98(0xb8)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x22bfac){const _0xd72d5e=_0x22bfac[0x1],_0x527e93=_0x22bfac[0x2][_0x560a98(0xdc)](),_0x65e632=_0xd72d5e['replace'](/-/g,'')[_0x560a98(0xda)](0x0,0x4)[_0x560a98(0xdc)]();return _0x527e93+'_'+_0x65e632;}return undefined;}function stableStringify(_0x2a5dd1){const _0x4ef883=a114_0x5d40;if(Array[_0x4ef883(0xc0)](_0x2a5dd1))return'['+_0x2a5dd1['map'](_0x33bc7d=>stableStringify(_0x33bc7d))[_0x4ef883(0xd2)](',')+']';if(_0x2a5dd1&&typeof _0x2a5dd1===_0x4ef883(0xdb)){const _0x459cc9=_0x2a5dd1,_0xfc418=Object['keys'](_0x459cc9)[_0x4ef883(0xdf)](),_0x2bb423=_0xfc418[_0x4ef883(0xbd)](_0x2e234d=>'\x22'+_0x2e234d+'\x22:'+stableStringify(_0x459cc9[_0x2e234d]));return'{'+_0x2bb423['join'](',')+'}';}const _0x2fb25a=JSON[_0x4ef883(0xc2)](_0x2a5dd1);return _0x2fb25a===undefined?_0x4ef883(0xe1):_0x2fb25a;}export function consolidateActivationsByContent(_0x330f93){const _0x5d80e3=a114_0x5d40,_0x36fc9d={},_0x416565=new Map(),_0x3a4af2=new Map();for(const _0xb91455 of _0x330f93){if(!_0xb91455)continue;for(const [_0x4f52a2,_0x1f3949]of Object[_0x5d80e3(0xed)](_0xb91455)){const _0x42a2c4={'connection':_0x1f3949[_0x5d80e3(0xfa)],..._0x1f3949[_0x5d80e3(0xaf)]!==undefined&&{'all_columns':_0x1f3949['all_columns']},..._0x1f3949['columns']!==undefined&&{'columns':_0x1f3949['columns']},..._0x1f3949[_0x5d80e3(0xf3)]!==undefined&&{'behavior':_0x1f3949[_0x5d80e3(0xf3)]},..._0x1f3949[_0x5d80e3(0xc8)]!==undefined&&{'schedule':_0x1f3949[_0x5d80e3(0xc8)]},..._0x1f3949['notification']!==undefined&&{'notification':_0x1f3949['notification']},..._0x1f3949[_0x5d80e3(0xb5)]!==undefined&&{'connector_config':_0x1f3949[_0x5d80e3(0xb5)]},..._0x1f3949['activation_template_id']!==undefined&&{'activation_template_id':_0x1f3949[_0x5d80e3(0xcd)]}},_0x43437d=stableStringify(_0x42a2c4),_0x4da9d2=_0x3a4af2[_0x5d80e3(0xd3)](_0x43437d);_0x4da9d2?_0x416565[_0x5d80e3(0xb6)](_0x4f52a2,_0x4da9d2):(_0x36fc9d[_0x4f52a2]=_0x1f3949,_0x416565[_0x5d80e3(0xb6)](_0x4f52a2,_0x4f52a2),_0x3a4af2[_0x5d80e3(0xb6)](_0x43437d,_0x4f52a2));}}return{'merged':_0x36fc9d,'nameMapping':_0x416565};}export function updateActivationReferences(_0x7f9af4,_0x5a774b){const _0x29bb9b=a114_0x5d40;if(!_0x7f9af4)return;for(const _0x16085c of _0x7f9af4){if(!_0x16085c[_0x29bb9b(0xf9)])continue;for(const _0x4de7e2 of _0x16085c['steps']){if(_0x4de7e2[_0x29bb9b(0xce)]===_0x29bb9b(0xb7)&&_0x4de7e2[_0x29bb9b(0xc5)]?.['activation']){const _0x51e595=_0x5a774b[_0x29bb9b(0xd3)](_0x4de7e2[_0x29bb9b(0xc5)]['activation']);_0x51e595&&_0x51e595!==_0x4de7e2['with'][_0x29bb9b(0xb7)]&&(_0x4de7e2[_0x29bb9b(0xc5)][_0x29bb9b(0xb7)]=_0x51e595);}}}}export function consolidateSegmentsByContent(_0x3beaab,_0x2b403a){const _0x2032d3=a114_0x5d40,_0x587807={},_0x27b548=new Map(),_0x8405d0=new Map();for(const _0x4aab0f of _0x3beaab){if(!_0x4aab0f)continue;for(const [_0x560ac4,_0x3aef7a]of Object[_0x2032d3(0xed)](_0x4aab0f)){if(!_0x3aef7a['rule']){_0x587807[_0x560ac4]=_0x3aef7a,_0x27b548[_0x2032d3(0xb6)](_0x560ac4,_0x560ac4);continue;}const _0x3efa63=_0x3aef7a[_0x2032d3(0xf2)]&&_0x3aef7a[_0x2032d3(0xf2)][_0x2032d3(0xd1)]()?_0x3aef7a[_0x2032d3(0xf2)]:undefined,_0x20df2b=JSON[_0x2032d3(0xc2)]({'description':_0x3efa63,'rule':deepSortObject(_0x3aef7a[_0x2032d3(0xfd)])}),_0x3edf6e=_0x8405d0[_0x2032d3(0xd3)](_0x20df2b);if(_0x3edf6e){const _0xc6c3e9={..._0x3aef7a['description']!==undefined&&{'description':_0x3aef7a[_0x2032d3(0xf2)]},'rule':_0x3aef7a[_0x2032d3(0xfd)]?deepSortObject(_0x3aef7a[_0x2032d3(0xfd)]):_0x3aef7a[_0x2032d3(0xfd)]};if(_0x560ac4<_0x3edf6e){_0x587807[_0x560ac4]=_0xc6c3e9,delete _0x587807[_0x3edf6e];for(const [_0x3a1a5d,_0x1656a8]of _0x27b548[_0x2032d3(0xed)]()){_0x1656a8===_0x3edf6e&&_0x27b548[_0x2032d3(0xb6)](_0x3a1a5d,_0x560ac4);}_0x27b548[_0x2032d3(0xb6)](_0x560ac4,_0x560ac4),_0x8405d0[_0x2032d3(0xb6)](_0x20df2b,_0x560ac4);}else _0x587807[_0x3edf6e]=_0xc6c3e9,_0x27b548[_0x2032d3(0xb6)](_0x560ac4,_0x3edf6e);}else{let _0x23e163=_0x560ac4;if(_0x2b403a){const _0x2864fa=_0x2b403a[_0x2032d3(0xd3)](_0x20df2b);_0x2864fa&&_0x2864fa[_0x2032d3(0xc6)]>0x0&&(_0x23e163=_0x2864fa[_0x2032d3(0xda)]()[_0x2032d3(0xdf)]()[0x0]);}const _0x4f6c02={..._0x3aef7a['description']!==undefined&&{'description':_0x3aef7a['description']},'rule':_0x3aef7a[_0x2032d3(0xfd)]?deepSortObject(_0x3aef7a['rule']):_0x3aef7a['rule']};_0x587807[_0x23e163]=_0x4f6c02,_0x27b548[_0x2032d3(0xb6)](_0x560ac4,_0x23e163),_0x8405d0[_0x2032d3(0xb6)](_0x20df2b,_0x23e163);}}}return{'merged':_0x587807,'nameMapping':_0x27b548};}export function updateSegmentReferences(_0x1637a6,_0x4fe10e){const _0x55de36=a114_0x5d40;if(!_0x1637a6)return;for(const _0x424736 of _0x1637a6){if(_0x424736[_0x55de36(0xde)]?.[_0x55de36(0xb3)]){const _0x44cf62=_0x4fe10e['get'](_0x424736[_0x55de36(0xde)][_0x55de36(0xb3)]);_0x44cf62&&(_0x424736[_0x55de36(0xde)][_0x55de36(0xb3)]=_0x44cf62);}if(_0x424736[_0x55de36(0xf9)])for(const _0x407a93 of _0x424736['steps']){if(_0x407a93[_0x55de36(0xce)]===_0x55de36(0xca)&&_0x407a93[_0x55de36(0xc5)]?.[_0x55de36(0xd6)])for(const _0x58c8fd of _0x407a93[_0x55de36(0xc5)][_0x55de36(0xd6)]){if(_0x58c8fd[_0x55de36(0xb3)]){const _0x4b0d27=_0x4fe10e['get'](_0x58c8fd[_0x55de36(0xb3)]);_0x4b0d27&&(_0x58c8fd[_0x55de36(0xb3)]=_0x4b0d27);}}}}}export function updateSegmentRefsInSegments(_0x5edb31,_0x2b4ec0){const _0xb3b64e=a114_0x5d40;for(const _0x3ac278 of Object[_0xb3b64e(0xf5)](_0x5edb31)){_0x3ac278[_0xb3b64e(0xfd)]&&updateSegmentRefsInRule(_0x3ac278['rule'],_0x2b4ec0);}}function updateSegmentRefsInRule(_0x49dcf6,_0x59722f){const _0x8dde0b=a114_0x5d40;if(_0x49dcf6===null||typeof _0x49dcf6!==_0x8dde0b(0xdb))return;if(Array[_0x8dde0b(0xc0)](_0x49dcf6)){for(const _0x9ce996 of _0x49dcf6){updateSegmentRefsInRule(_0x9ce996,_0x59722f);}return;}const _0x16c82b=_0x49dcf6;if((_0x16c82b[_0x8dde0b(0xce)]===_0x8dde0b(0xbf)||_0x16c82b['type']===_0x8dde0b(0xf1))&&typeof _0x16c82b[_0x8dde0b(0xb3)]===_0x8dde0b(0xe5)){const _0x27d1d8=_0x59722f[_0x8dde0b(0xd3)](_0x16c82b[_0x8dde0b(0xb3)]);_0x27d1d8&&(_0x16c82b['segment']=_0x27d1d8);}if(_0x16c82b[_0x8dde0b(0xbb)]&&Array[_0x8dde0b(0xc0)](_0x16c82b[_0x8dde0b(0xbb)]))for(const _0x323be5 of _0x16c82b['conditions']){updateSegmentRefsInRule(_0x323be5,_0x59722f);}}export function buildJourneysArray(_0x1dd668){const _0x56a4d4=a114_0x5d40,_0x5d8362=Math[_0x56a4d4(0xd8)](..._0x1dd668[_0x56a4d4(0xbd)](_0x5bcc85=>_0x5bcc85[_0x56a4d4(0xd9)][_0x56a4d4(0xb1)]||0x0));return _0x1dd668[_0x56a4d4(0xbd)](_0x4f4398=>{const _0x37441c=_0x56a4d4,_0x26abcd=(_0x4f4398[_0x37441c(0xd9)][_0x37441c(0xb1)]||0x0)===_0x5d8362,_0x4f8e20=_0x4f4398[_0x37441c(0xfc)]['journeys']?.[0x0],_0x370f13={'version':_0x4f8e20?.['version']||_0x4f4398[_0x37441c(0xfc)][_0x37441c(0xbc)]||_0x4f4398[_0x37441c(0xd9)][_0x37441c(0xec)],'state':_0x4f4398['item'][_0x37441c(0xd4)]===_0x37441c(0xea)?_0x37441c(0xea):'draft','stages':_0x4f8e20?.[_0x37441c(0xf7)]||_0x4f4398[_0x37441c(0xfc)][_0x37441c(0xf7)]||[],'id':_0x4f8e20?.['id']||_0x4f4398[_0x37441c(0xfc)]['id'],'version_number':_0x4f8e20?.[_0x37441c(0xb0)]||_0x4f4398[_0x37441c(0xfc)][_0x37441c(0xb0)]};return _0x26abcd&&(_0x370f13[_0x37441c(0xe4)]=!![]),_0x370f13;});}export function buildMergedJourneyDef(_0x249ee9,_0x193ec8){const _0x1fa72c=a114_0x5d40,_0x5daed6=_0x249ee9[0x0][_0x1fa72c(0xfc)],_0x1ae5e8=buildJourneysArray(_0x249ee9),{merged:_0x2b46be,nameMapping:_0x4d0ce6}=consolidateSegmentsByContent(_0x249ee9['map'](_0x42593c=>_0x42593c[_0x1fa72c(0xfc)][_0x1fa72c(0xcc)]),_0x193ec8);updateSegmentRefsInSegments(_0x2b46be,_0x4d0ce6);const _0x1778f4=Array['from'](_0x4d0ce6[_0x1fa72c(0xed)]())[_0x1fa72c(0xf4)](([_0x3df0c9,_0x2e4d78])=>_0x3df0c9!==_0x2e4d78&&_0x3df0c9[_0x1fa72c(0xd5)](_0x1fa72c(0xde)));let _0x59ac62=_0x2b46be,_0x381cd=new Map();if(_0x1778f4){const _0x5b47de=consolidateSegmentsByContent([_0x2b46be],_0x193ec8);_0x59ac62=_0x5b47de[_0x1fa72c(0xee)],_0x381cd=_0x5b47de[_0x1fa72c(0xe7)];}const _0x395c2b=new Map(_0x4d0ce6);for(const [_0x5e5b8c,_0x2faaa9]of _0x381cd['entries']()){_0x395c2b['set'](_0x5e5b8c,_0x2faaa9);}for(const [_0x5ca217,_0x5f09f0]of _0x395c2b[_0x1fa72c(0xed)]()){let _0x1abe7b=_0x5f09f0,_0x1bf64d=0x0;while(_0x395c2b['has'](_0x1abe7b)&&_0x395c2b[_0x1fa72c(0xd3)](_0x1abe7b)!==_0x1abe7b&&_0x1bf64d<MAX_MAPPING_CHAIN_DEPTH){_0x1abe7b=_0x395c2b[_0x1fa72c(0xd3)](_0x1abe7b),_0x1bf64d++;}_0x1abe7b!==_0x5f09f0&&_0x395c2b[_0x1fa72c(0xb6)](_0x5ca217,_0x1abe7b);}for(const _0x31f87f of _0x1ae5e8){updateSegmentReferences(_0x31f87f['stages'],_0x395c2b);}const {merged:_0x27bc7b,nameMapping:_0x2f9596}=consolidateActivationsByContent(_0x249ee9[_0x1fa72c(0xbd)](_0xb0a62c=>_0xb0a62c['yaml']['activations']));for(const _0x3a0a72 of _0x1ae5e8){updateActivationReferences(_0x3a0a72[_0x1fa72c(0xf7)],_0x2f9596);}let _0x3ba1d7=_0x5daed6[_0x1fa72c(0xd7)];if(_0x3ba1d7?.['segment']){const _0x1c772c=_0x395c2b[_0x1fa72c(0xd3)](_0x3ba1d7['segment']);_0x1c772c&&(_0x3ba1d7={..._0x3ba1d7,'segment':_0x1c772c});}for(const _0x7b7053 of _0x1ae5e8){if(_0x7b7053[_0x1fa72c(0xd7)]?.[_0x1fa72c(0xb3)]){const _0x4f6300=_0x395c2b[_0x1fa72c(0xd3)](_0x7b7053[_0x1fa72c(0xd7)]['segment']);_0x4f6300&&(_0x7b7053[_0x1fa72c(0xd7)]={..._0x7b7053['goal'],'segment':_0x4f6300});}}return{'type':_0x1fa72c(0xbe),'name':_0x5daed6[_0x1fa72c(0xec)],'description':_0x5daed6[_0x1fa72c(0xf2)],'goal':_0x3ba1d7,'reentry':_0x5daed6[_0x1fa72c(0xc3)],'segments':Object[_0x1fa72c(0xfb)](_0x59ac62)[_0x1fa72c(0xc6)]>0x0?_0x59ac62:undefined,'activations':Object[_0x1fa72c(0xfb)](_0x27bc7b)[_0x1fa72c(0xc6)]>0x0?_0x27bc7b:undefined,'journeys':_0x1ae5e8,'bundle_id':_0x5daed6['bundle_id'],'bundle_name':_0x5daed6[_0x1fa72c(0xd0)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x582345,_0x45379f,_0x537f59,_0x18dd4c){const _0x56fc4d=a114_0x5d40,_0x3b60ae=_0x582345+':'+_0x45379f,_0x27173e=_0x537f59[_0x56fc4d(0xd3)](_0x3b60ae);if(_0x27173e)return _0x27173e;const _0xce0de9=await _0x18dd4c(_0x582345),_0x5a40cc=_0xce0de9[_0x56fc4d(0xc9)]['journeyBundleName']||_0xce0de9[_0x56fc4d(0xc9)][_0x56fc4d(0xec)],_0x81d9a5=_0xce0de9[_0x56fc4d(0xc9)][_0x56fc4d(0xba)][_0x56fc4d(0xdd)](_0x3a27e2=>String(_0x3a27e2['id'])===String(_0x45379f)),_0x371a6a=_0x81d9a5?.[_0x56fc4d(0xec)]||_0x45379f,_0x1f6dc7={'journeyName':_0x5a40cc,'stageName':_0x371a6a};return _0x537f59['set'](_0x3b60ae,_0x1f6dc7),_0x1f6dc7;}function a114_0x5d40(_0x1e7efa,_0x58e345){_0x1e7efa=_0x1e7efa-0xaf;const _0x563f84=a114_0x563f();let _0x5d4009=_0x563f84[_0x1e7efa];return _0x5d4009;}export function formatApiJourneyName(_0x5244b6,_0x5bf94b){return _0x5bf94b+'\x20('+_0x5244b6+')';}export function isLocalJourneyRef(_0x2f0648){const _0x58d9f3=a114_0x5d40;return _0x2f0648[_0x58d9f3(0xb2)](_0x58d9f3(0xb9))||_0x2f0648[_0x58d9f3(0xb2)]('.yaml');}export function buildLocalRuleToNameMapping(_0x2824e0){const _0xc03463=a114_0x5d40,_0x532719=new Map();if(!_0x2824e0)return _0x532719;for(const [_0x327d9f,_0x5dc04e]of Object[_0xc03463(0xed)](_0x2824e0)){if(_0x5dc04e[_0xc03463(0xfd)]){const _0x1919fc=serializeRule(_0x5dc04e[_0xc03463(0xfd)]),_0x4ee47c=_0x532719[_0xc03463(0xd3)](_0x1919fc)||[];_0x4ee47c[_0xc03463(0xf8)](_0x327d9f),_0x532719[_0xc03463(0xb6)](_0x1919fc,_0x4ee47c);}}return _0x532719;}export function buildLocalRuleToNameMappingFromJourney(_0x56338b){const _0x3c6901=a114_0x5d40,_0xa9ac54=_0x56338b[_0x3c6901(0xcc)];if(!_0xa9ac54)return new Map();const _0x5dc0ff=collectSegmentUsageCounts(_0x56338b),_0x2ed044=new Map();let _0x234614=0x0;for(const [_0x449a5b,_0x5ecfc1]of Object[_0x3c6901(0xed)](_0xa9ac54)){if(!_0x5ecfc1[_0x3c6901(0xfd)]){_0x234614++;continue;}const _0x41dfbe=serializeRule(_0x5ecfc1[_0x3c6901(0xfd)]),_0xe0289f=_0x2ed044['get'](_0x41dfbe)||[];_0xe0289f[_0x3c6901(0xf8)]({'name':_0x449a5b,'index':_0x234614}),_0x2ed044[_0x3c6901(0xb6)](_0x41dfbe,_0xe0289f),_0x234614++;}const _0x38cc00=new Map();for(const [_0x1ed14f,_0x46eddb]of _0x2ed044){const _0x20f6db=_0x46eddb[_0x3c6901(0xda)]()[_0x3c6901(0xdf)]((_0x5a1eb0,_0x1cafa1)=>{const _0x5a5624=_0x3c6901,_0x10ba8b=_0x5dc0ff['get'](_0x5a1eb0[_0x5a5624(0xec)])||0x0,_0x937d20=_0x5dc0ff[_0x5a5624(0xd3)](_0x1cafa1[_0x5a5624(0xec)])||0x0;if(_0x10ba8b!==_0x937d20)return _0x937d20-_0x10ba8b;return _0x5a1eb0['index']-_0x1cafa1[_0x5a5624(0xb4)];})[_0x3c6901(0xbd)](_0x6561ab=>_0x6561ab[_0x3c6901(0xec)]);_0x38cc00[_0x3c6901(0xb6)](_0x1ed14f,_0x20f6db);}return _0x38cc00;}export function collectSegmentUsageCounts(_0x2be83a){const _0x240e79=a114_0x5d40,_0x1f8a0c=new Map(),_0x1e8d46=_0x3b5e25=>{const _0x32dd96=a114_0x5d40;if(!_0x3b5e25)return;_0x1f8a0c['set'](_0x3b5e25,(_0x1f8a0c[_0x32dd96(0xd3)](_0x3b5e25)||0x0)+0x1);},_0x2191e7=_0x557fe6=>{const _0x24b1d5=a114_0x5d40;for(const _0x5f3c86 of _0x557fe6){_0x1e8d46(_0x5f3c86['entry_criteria']?.[_0x24b1d5(0xb3)]);if(_0x5f3c86['exit_criteria'])for(const _0x318e4e of _0x5f3c86['exit_criteria']){_0x1e8d46(_0x318e4e[_0x24b1d5(0xb3)]);}_0x1e8d46(_0x5f3c86['milestone']?.[_0x24b1d5(0xb3)]);if(_0x5f3c86[_0x24b1d5(0xf9)])for(const _0x4161b9 of _0x5f3c86[_0x24b1d5(0xf9)]){if(_0x4161b9[_0x24b1d5(0xce)]===_0x24b1d5(0xca))for(const _0x80553b of _0x4161b9['with'][_0x24b1d5(0xd6)]){_0x1e8d46(_0x80553b[_0x24b1d5(0xb3)]);}else _0x4161b9[_0x24b1d5(0xce)]===_0x24b1d5(0xc1)&&_0x1e8d46(_0x4161b9['with'][_0x24b1d5(0xeb)]?.[_0x24b1d5(0xb3)]);}}};_0x1e8d46(_0x2be83a[_0x240e79(0xd7)]?.['segment']);if(_0x2be83a[_0x240e79(0xe3)])for(const _0x25f237 of _0x2be83a[_0x240e79(0xe3)]){_0x1e8d46(_0x25f237[_0x240e79(0xd7)]?.[_0x240e79(0xb3)]),_0x2191e7(_0x25f237[_0x240e79(0xf7)]);}_0x2be83a[_0x240e79(0xf7)]&&_0x2191e7(_0x2be83a[_0x240e79(0xf7)]);if(_0x2be83a[_0x240e79(0xe9)])for(const _0x305064 of _0x2be83a[_0x240e79(0xe9)]){_0x2191e7(_0x305064[_0x240e79(0xf7)]);}return _0x1f8a0c;}
1
+ (function(_0x3cfb0d,_0x39206f){const _0xc2a97=a114_0x30c8,_0x5c5569=_0x3cfb0d();while(!![]){try{const _0x1a7488=-parseInt(_0xc2a97(0x201))/0x1+parseInt(_0xc2a97(0x1e6))/0x2+parseInt(_0xc2a97(0x204))/0x3*(-parseInt(_0xc2a97(0x1d9))/0x4)+parseInt(_0xc2a97(0x217))/0x5*(-parseInt(_0xc2a97(0x1d1))/0x6)+-parseInt(_0xc2a97(0x1ef))/0x7+-parseInt(_0xc2a97(0x206))/0x8*(-parseInt(_0xc2a97(0x1f8))/0x9)+parseInt(_0xc2a97(0x1fb))/0xa;if(_0x1a7488===_0x39206f)break;else _0x5c5569['push'](_0x5c5569['shift']());}catch(_0x46f3f2){_0x5c5569['push'](_0x5c5569['shift']());}}}(a114_0x5d27,0xadfce));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x3b1073){const _0x4c3109=a114_0x30c8;return _0x3b1073[_0x4c3109(0x209)]()[_0x4c3109(0x202)](/\s+/g,'_')[_0x4c3109(0x202)](/[^a-z0-9_]/g,'')['replace'](/_+/g,'_')[_0x4c3109(0x202)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x4e48c8){const _0x5b6ed0=a114_0x30c8,_0x11d868=_0x4e48c8[_0x5b6ed0(0x20b)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x11d868){const _0x90df4f=_0x11d868[0x1][_0x5b6ed0(0x209)](),_0x57d419=_0x11d868[0x2],_0x52d95b=_0x57d419[_0x5b6ed0(0x202)](/-/g,'')[_0x5b6ed0(0x216)](0x0,0x4)['toLowerCase']();return _0x90df4f+'_'+_0x52d95b;}const _0x1078ad=_0x4e48c8['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x1078ad){const _0x5ce3f6=_0x1078ad[0x1],_0x40438a=_0x1078ad[0x2][_0x5b6ed0(0x209)](),_0x8d4154=_0x5ce3f6[_0x5b6ed0(0x202)](/-/g,'')[_0x5b6ed0(0x216)](0x0,0x4)[_0x5b6ed0(0x209)]();return _0x40438a+'_'+_0x8d4154;}return undefined;}function stableStringify(_0x3bf98c){const _0x1db5cf=a114_0x30c8;if(Array['isArray'](_0x3bf98c))return'['+_0x3bf98c['map'](_0x4a9ebd=>stableStringify(_0x4a9ebd))[_0x1db5cf(0x1d7)](',')+']';if(_0x3bf98c&&typeof _0x3bf98c===_0x1db5cf(0x1e9)){const _0x59de96=_0x3bf98c,_0x38ca97=Object[_0x1db5cf(0x205)](_0x59de96)['sort'](),_0x3d3e42=_0x38ca97[_0x1db5cf(0x21b)](_0x3e0cac=>'\x22'+_0x3e0cac+'\x22:'+stableStringify(_0x59de96[_0x3e0cac]));return'{'+_0x3d3e42['join'](',')+'}';}const _0x508dcb=JSON[_0x1db5cf(0x1e2)](_0x3bf98c);return _0x508dcb===undefined?_0x1db5cf(0x1e8):_0x508dcb;}export function consolidateActivationsByContent(_0x5e308b){const _0x49b771=a114_0x30c8,_0x548323={},_0x587957=new Map(),_0x592b68=new Map();for(const _0x45c26a of _0x5e308b){if(!_0x45c26a)continue;for(const [_0x393e43,_0x4ac6b3]of Object[_0x49b771(0x1d6)](_0x45c26a)){const _0x1ad62b={'connection':_0x4ac6b3[_0x49b771(0x1f9)],..._0x4ac6b3[_0x49b771(0x20c)]!==undefined&&{'all_columns':_0x4ac6b3['all_columns']},..._0x4ac6b3[_0x49b771(0x1e5)]!==undefined&&{'columns':_0x4ac6b3[_0x49b771(0x1e5)]},..._0x4ac6b3[_0x49b771(0x1ed)]!==undefined&&{'behavior':_0x4ac6b3['behavior']},..._0x4ac6b3[_0x49b771(0x21d)]!==undefined&&{'schedule':_0x4ac6b3[_0x49b771(0x21d)]},..._0x4ac6b3['notification']!==undefined&&{'notification':_0x4ac6b3['notification']},..._0x4ac6b3['connector_config']!==undefined&&{'connector_config':_0x4ac6b3[_0x49b771(0x20f)]},..._0x4ac6b3['activation_template_id']!==undefined&&{'activation_template_id':_0x4ac6b3['activation_template_id']}},_0x5aabeb=stableStringify(_0x1ad62b),_0xf7bf79=_0x592b68[_0x49b771(0x21c)](_0x5aabeb);_0xf7bf79?_0x587957[_0x49b771(0x213)](_0x393e43,_0xf7bf79):(_0x548323[_0x393e43]=_0x4ac6b3,_0x587957[_0x49b771(0x213)](_0x393e43,_0x393e43),_0x592b68[_0x49b771(0x213)](_0x5aabeb,_0x393e43));}}return{'merged':_0x548323,'nameMapping':_0x587957};}export function updateActivationReferences(_0x5ba8e6,_0x30fb4e){const _0x3fd9a2=a114_0x30c8;if(!_0x5ba8e6)return;for(const _0x5b7df4 of _0x5ba8e6){if(!_0x5b7df4['steps'])continue;for(const _0x2d357c of _0x5b7df4[_0x3fd9a2(0x1f2)]){if(_0x2d357c[_0x3fd9a2(0x1f6)]===_0x3fd9a2(0x1f7)&&_0x2d357c['with']?.['activation']){const _0x2ee6ff=_0x30fb4e[_0x3fd9a2(0x21c)](_0x2d357c[_0x3fd9a2(0x21e)][_0x3fd9a2(0x1f7)]);_0x2ee6ff&&_0x2ee6ff!==_0x2d357c[_0x3fd9a2(0x21e)]['activation']&&(_0x2d357c['with'][_0x3fd9a2(0x1f7)]=_0x2ee6ff);}}}}export function consolidateSegmentsByContent(_0x49fdd3,_0x4416ea){const _0x1d5ca7=a114_0x30c8,_0x1c0b94={},_0xa015fc=new Map(),_0x3a5ffb=new Map();for(const _0x189db6 of _0x49fdd3){if(!_0x189db6)continue;for(const [_0x335ce3,_0x4325c8]of Object[_0x1d5ca7(0x1d6)](_0x189db6)){if(!_0x4325c8['rule']){_0x1c0b94[_0x335ce3]=_0x4325c8,_0xa015fc[_0x1d5ca7(0x213)](_0x335ce3,_0x335ce3);continue;}const _0x2055f2=_0x4325c8[_0x1d5ca7(0x1ee)]&&_0x4325c8[_0x1d5ca7(0x1ee)]['trim']()?_0x4325c8[_0x1d5ca7(0x1ee)]:undefined,_0x51fdb7=JSON[_0x1d5ca7(0x1e2)]({'description':_0x2055f2,'rule':deepSortObject(_0x4325c8[_0x1d5ca7(0x1d2)])}),_0x41e5bc=_0x3a5ffb[_0x1d5ca7(0x21c)](_0x51fdb7);if(_0x41e5bc){const _0x1526b8={..._0x4325c8[_0x1d5ca7(0x1ee)]!==undefined&&{'description':_0x4325c8[_0x1d5ca7(0x1ee)]},'rule':_0x4325c8[_0x1d5ca7(0x1d2)]?deepSortObject(_0x4325c8['rule']):_0x4325c8[_0x1d5ca7(0x1d2)]};if(_0x335ce3<_0x41e5bc){_0x1c0b94[_0x335ce3]=_0x1526b8,delete _0x1c0b94[_0x41e5bc];for(const [_0x1d2056,_0x1275a5]of _0xa015fc[_0x1d5ca7(0x1d6)]()){_0x1275a5===_0x41e5bc&&_0xa015fc[_0x1d5ca7(0x213)](_0x1d2056,_0x335ce3);}_0xa015fc[_0x1d5ca7(0x213)](_0x335ce3,_0x335ce3),_0x3a5ffb['set'](_0x51fdb7,_0x335ce3);}else _0x1c0b94[_0x41e5bc]=_0x1526b8,_0xa015fc['set'](_0x335ce3,_0x41e5bc);}else{let _0x264b41=_0x335ce3;if(_0x4416ea){const _0x44151e=_0x4416ea['get'](_0x51fdb7);_0x44151e&&_0x44151e[_0x1d5ca7(0x1f4)]>0x0&&(_0x264b41=_0x44151e[_0x1d5ca7(0x216)]()[_0x1d5ca7(0x1ec)]()[0x0]);}const _0x5168a0={..._0x4325c8[_0x1d5ca7(0x1ee)]!==undefined&&{'description':_0x4325c8[_0x1d5ca7(0x1ee)]},'rule':_0x4325c8['rule']?deepSortObject(_0x4325c8[_0x1d5ca7(0x1d2)]):_0x4325c8['rule']};_0x1c0b94[_0x264b41]=_0x5168a0,_0xa015fc[_0x1d5ca7(0x213)](_0x335ce3,_0x264b41),_0x3a5ffb[_0x1d5ca7(0x213)](_0x51fdb7,_0x264b41);}}}return{'merged':_0x1c0b94,'nameMapping':_0xa015fc};}export function updateSegmentReferences(_0x3acefb,_0x5df69e){const _0x3acd3e=a114_0x30c8;if(!_0x3acefb)return;for(const _0x43e44e of _0x3acefb){if(_0x43e44e[_0x3acd3e(0x1eb)]?.[_0x3acd3e(0x219)]){const _0x21c170=_0x5df69e[_0x3acd3e(0x21c)](_0x43e44e['entry_criteria'][_0x3acd3e(0x219)]);_0x21c170&&(_0x43e44e[_0x3acd3e(0x1eb)]['segment']=_0x21c170);}if(_0x43e44e[_0x3acd3e(0x1f2)])for(const _0x178302 of _0x43e44e[_0x3acd3e(0x1f2)]){if(_0x178302[_0x3acd3e(0x1f6)]===_0x3acd3e(0x218)&&_0x178302[_0x3acd3e(0x21e)]?.[_0x3acd3e(0x212)])for(const _0x252c75 of _0x178302[_0x3acd3e(0x21e)]['branches']){if(_0x252c75['segment']){const _0x55cfa1=_0x5df69e[_0x3acd3e(0x21c)](_0x252c75[_0x3acd3e(0x219)]);_0x55cfa1&&(_0x252c75['segment']=_0x55cfa1);}}}}}function a114_0x5d27(){const _0x3458dc=['86490RnalqE','connection','launched','8809600KOdjji','exclude','nameMapping','some','goal','journeys','1147230fRUohH','replace','isArray','3DKBvUL','keys','1056brpqCe','values','stages','toLowerCase','versions','match','all_columns','activations','attributes','connector_config','yaml','journey','branches','set','state','latest','slice','11065xeBzow','decision_point','segment','reentry','map','get','schedule','with','has','versionNumber','item','milestone','conditions','index','2634nZeJvR','rule','push','.yml','journeyBundleName','entries','join','version_number','453304OiaWqz','wait','from','bundle_name','version','endsWith','journeyStages','max','startsWith','stringify','name','segments','columns','2674732kYkKTy','.yaml','null','object','exit_criteria','entry_criteria','sort','behavior','description','3794903NsdGDL','include','merged','steps','draft','length','string','type','activation'];a114_0x5d27=function(){return _0x3458dc;};return a114_0x5d27();}export function updateSegmentRefsInSegments(_0x54c489,_0x4179c7){const _0x2ea11c=a114_0x30c8;for(const _0x29852e of Object[_0x2ea11c(0x207)](_0x54c489)){_0x29852e[_0x2ea11c(0x1d2)]&&updateSegmentRefsInRule(_0x29852e['rule'],_0x4179c7);}}function updateSegmentRefsInRule(_0xd40419,_0x38f0b9){const _0x54879e=a114_0x30c8;if(_0xd40419===null||typeof _0xd40419!==_0x54879e(0x1e9))return;if(Array['isArray'](_0xd40419)){for(const _0x105f0a of _0xd40419){updateSegmentRefsInRule(_0x105f0a,_0x38f0b9);}return;}const _0x5d56a8=_0xd40419;if((_0x5d56a8[_0x54879e(0x1f6)]===_0x54879e(0x1f0)||_0x5d56a8[_0x54879e(0x1f6)]===_0x54879e(0x1fc))&&typeof _0x5d56a8[_0x54879e(0x219)]===_0x54879e(0x1f5)){const _0x432592=_0x38f0b9[_0x54879e(0x21c)](_0x5d56a8['segment']);_0x432592&&(_0x5d56a8[_0x54879e(0x219)]=_0x432592);}if(_0x5d56a8['conditions']&&Array[_0x54879e(0x203)](_0x5d56a8['conditions']))for(const _0x262351 of _0x5d56a8[_0x54879e(0x1cf)]){updateSegmentRefsInRule(_0x262351,_0x38f0b9);}}export function buildJourneysArray(_0x546ab2){const _0x15d543=a114_0x30c8,_0x1e2eaa=Math[_0x15d543(0x1e0)](..._0x546ab2['map'](_0x10992c=>_0x10992c[_0x15d543(0x1cd)][_0x15d543(0x220)]||0x0));return _0x546ab2['map'](_0x2f2fb4=>{const _0xd79975=_0x15d543,_0x5064af=(_0x2f2fb4[_0xd79975(0x1cd)]['versionNumber']||0x0)===_0x1e2eaa,_0x3a4ca4=_0x2f2fb4[_0xd79975(0x210)][_0xd79975(0x200)]?.[0x0],_0x2f1c38={'version':_0x3a4ca4?.[_0xd79975(0x1dd)]||_0x2f2fb4['yaml'][_0xd79975(0x1dd)]||_0x2f2fb4['item'][_0xd79975(0x1e3)],'state':_0x2f2fb4[_0xd79975(0x1cd)][_0xd79975(0x214)]===_0xd79975(0x1fa)?'launched':_0xd79975(0x1f3),'stages':_0x3a4ca4?.[_0xd79975(0x208)]||_0x2f2fb4[_0xd79975(0x210)][_0xd79975(0x208)]||[],'id':_0x3a4ca4?.['id']||_0x2f2fb4[_0xd79975(0x210)]['id'],'version_number':_0x3a4ca4?.[_0xd79975(0x1d8)]||_0x2f2fb4['yaml']['version_number']};return _0x5064af&&(_0x2f1c38[_0xd79975(0x215)]=!![]),_0x2f1c38;});}export function buildMergedJourneyDef(_0x2f3729,_0xae7eb5){const _0x514351=a114_0x30c8,_0x390012=_0x2f3729[0x0][_0x514351(0x210)],_0x5d9a9c=buildJourneysArray(_0x2f3729),{merged:_0x2aa831,nameMapping:_0x5a2f03}=consolidateSegmentsByContent(_0x2f3729[_0x514351(0x21b)](_0x3b4346=>_0x3b4346[_0x514351(0x210)]['segments']),_0xae7eb5);updateSegmentRefsInSegments(_0x2aa831,_0x5a2f03);const _0x9da60d=Array[_0x514351(0x1db)](_0x5a2f03[_0x514351(0x1d6)]())[_0x514351(0x1fe)](([_0x28781f,_0x2b4270])=>_0x28781f!==_0x2b4270&&_0x28781f[_0x514351(0x1e1)]('entry_criteria'));let _0x1c4532=_0x2aa831,_0xfd6c35=new Map();if(_0x9da60d){const _0x48a07a=consolidateSegmentsByContent([_0x2aa831],_0xae7eb5);_0x1c4532=_0x48a07a[_0x514351(0x1f1)],_0xfd6c35=_0x48a07a[_0x514351(0x1fd)];}const _0x5062bd=new Map(_0x5a2f03);for(const [_0x162734,_0x5938ca]of _0xfd6c35[_0x514351(0x1d6)]()){_0x5062bd[_0x514351(0x213)](_0x162734,_0x5938ca);}for(const [_0x51c79a,_0x5ca111]of _0x5062bd['entries']()){let _0x45ec84=_0x5ca111,_0x238b5f=0x0;while(_0x5062bd[_0x514351(0x21f)](_0x45ec84)&&_0x5062bd[_0x514351(0x21c)](_0x45ec84)!==_0x45ec84&&_0x238b5f<MAX_MAPPING_CHAIN_DEPTH){_0x45ec84=_0x5062bd['get'](_0x45ec84),_0x238b5f++;}_0x45ec84!==_0x5ca111&&_0x5062bd[_0x514351(0x213)](_0x51c79a,_0x45ec84);}for(const _0x74dd42 of _0x5d9a9c){updateSegmentReferences(_0x74dd42['stages'],_0x5062bd);}const {merged:_0x27cacf,nameMapping:_0xc05742}=consolidateActivationsByContent(_0x2f3729[_0x514351(0x21b)](_0xa649bc=>_0xa649bc[_0x514351(0x210)][_0x514351(0x20d)]));for(const _0x52aaea of _0x5d9a9c){updateActivationReferences(_0x52aaea['stages'],_0xc05742);}let _0x464653=_0x390012['goal'];if(_0x464653?.[_0x514351(0x219)]){const _0x1c6c8a=_0x5062bd[_0x514351(0x21c)](_0x464653['segment']);_0x1c6c8a&&(_0x464653={..._0x464653,'segment':_0x1c6c8a});}for(const _0x5765b8 of _0x5d9a9c){if(_0x5765b8[_0x514351(0x1ff)]?.[_0x514351(0x219)]){const _0x5a1217=_0x5062bd[_0x514351(0x21c)](_0x5765b8[_0x514351(0x1ff)][_0x514351(0x219)]);_0x5a1217&&(_0x5765b8[_0x514351(0x1ff)]={..._0x5765b8[_0x514351(0x1ff)],'segment':_0x5a1217});}}return{'type':_0x514351(0x211),'name':_0x390012[_0x514351(0x1e3)],'description':_0x390012[_0x514351(0x1ee)],'goal':_0x464653,'reentry':_0x390012[_0x514351(0x21a)],'segments':Object[_0x514351(0x205)](_0x1c4532)[_0x514351(0x1f4)]>0x0?_0x1c4532:undefined,'activations':Object[_0x514351(0x205)](_0x27cacf)[_0x514351(0x1f4)]>0x0?_0x27cacf:undefined,'journeys':_0x5d9a9c,'bundle_id':_0x390012['bundle_id'],'bundle_name':_0x390012[_0x514351(0x1dc)]};}export function createJumpTargetCache(){return new Map();}function a114_0x30c8(_0x5a2858,_0x437ad2){_0x5a2858=_0x5a2858-0x1cd;const _0x5d275e=a114_0x5d27();let _0x30c84a=_0x5d275e[_0x5a2858];return _0x30c84a;}export async function resolveJumpTarget(_0x52b7d6,_0x22a2b6,_0x16b337,_0x4378f1){const _0x1db81e=a114_0x30c8,_0x2d2109=_0x52b7d6+':'+_0x22a2b6,_0xb5d14c=_0x16b337[_0x1db81e(0x21c)](_0x2d2109);if(_0xb5d14c)return _0xb5d14c;const _0x7ca852=await _0x4378f1(_0x52b7d6),_0x2e2a1a=_0x7ca852[_0x1db81e(0x20e)][_0x1db81e(0x1d5)]||_0x7ca852[_0x1db81e(0x20e)][_0x1db81e(0x1e3)],_0x35b72a=_0x7ca852[_0x1db81e(0x20e)][_0x1db81e(0x1df)]['find'](_0x56b4f8=>String(_0x56b4f8['id'])===String(_0x22a2b6)),_0x271060=_0x35b72a?.[_0x1db81e(0x1e3)]||_0x22a2b6,_0x342eae={'journeyName':_0x2e2a1a,'stageName':_0x271060};return _0x16b337[_0x1db81e(0x213)](_0x2d2109,_0x342eae),_0x342eae;}export function formatApiJourneyName(_0x59a9c7,_0x5a52e1){return _0x5a52e1+'\x20('+_0x59a9c7+')';}export function isLocalJourneyRef(_0x85097f){const _0xa8b766=a114_0x30c8;return _0x85097f[_0xa8b766(0x1de)](_0xa8b766(0x1d4))||_0x85097f['endsWith'](_0xa8b766(0x1e7));}export function buildLocalRuleToNameMapping(_0x3cd6c5){const _0x1a19ee=a114_0x30c8,_0x1e4b31=new Map();if(!_0x3cd6c5)return _0x1e4b31;for(const [_0x3daac4,_0x2387fb]of Object[_0x1a19ee(0x1d6)](_0x3cd6c5)){if(_0x2387fb[_0x1a19ee(0x1d2)]){const _0x5acb84=serializeRule(_0x2387fb[_0x1a19ee(0x1d2)]),_0x41c208=_0x1e4b31[_0x1a19ee(0x21c)](_0x5acb84)||[];_0x41c208[_0x1a19ee(0x1d3)](_0x3daac4),_0x1e4b31['set'](_0x5acb84,_0x41c208);}}return _0x1e4b31;}export function buildLocalRuleToNameMappingFromJourney(_0x1eb86f){const _0x3522a5=a114_0x30c8,_0x47b5fb=_0x1eb86f[_0x3522a5(0x1e4)];if(!_0x47b5fb)return new Map();const _0x23b28c=collectSegmentUsageCounts(_0x1eb86f),_0x3c6ca8=new Map();let _0xdb660c=0x0;for(const [_0x3a7491,_0xb8bcc8]of Object[_0x3522a5(0x1d6)](_0x47b5fb)){if(!_0xb8bcc8[_0x3522a5(0x1d2)]){_0xdb660c++;continue;}const _0xc2f708=serializeRule(_0xb8bcc8['rule']),_0xb51eaa=_0x3c6ca8[_0x3522a5(0x21c)](_0xc2f708)||[];_0xb51eaa[_0x3522a5(0x1d3)]({'name':_0x3a7491,'index':_0xdb660c}),_0x3c6ca8[_0x3522a5(0x213)](_0xc2f708,_0xb51eaa),_0xdb660c++;}const _0x3ad900=new Map();for(const [_0x2ad0a9,_0x88e51]of _0x3c6ca8){const _0x5a37c9=_0x88e51[_0x3522a5(0x216)]()[_0x3522a5(0x1ec)]((_0x49c96f,_0x2050a5)=>{const _0xe4de97=_0x3522a5,_0x420ef9=_0x23b28c['get'](_0x49c96f[_0xe4de97(0x1e3)])||0x0,_0x36b13a=_0x23b28c['get'](_0x2050a5[_0xe4de97(0x1e3)])||0x0;if(_0x420ef9!==_0x36b13a)return _0x36b13a-_0x420ef9;return _0x49c96f['index']-_0x2050a5[_0xe4de97(0x1d0)];})[_0x3522a5(0x21b)](_0x4d3a24=>_0x4d3a24[_0x3522a5(0x1e3)]);_0x3ad900[_0x3522a5(0x213)](_0x2ad0a9,_0x5a37c9);}return _0x3ad900;}export function collectSegmentUsageCounts(_0x5d3089){const _0x540c25=a114_0x30c8,_0x38bc00=new Map(),_0x51167d=_0x4c3188=>{const _0x57cbd4=a114_0x30c8;if(!_0x4c3188)return;_0x38bc00[_0x57cbd4(0x213)](_0x4c3188,(_0x38bc00['get'](_0x4c3188)||0x0)+0x1);},_0x4d5b60=_0x4a7a4c=>{const _0x52c75c=a114_0x30c8;for(const _0xb86645 of _0x4a7a4c){_0x51167d(_0xb86645[_0x52c75c(0x1eb)]?.[_0x52c75c(0x219)]);if(_0xb86645[_0x52c75c(0x1ea)])for(const _0x1fa372 of _0xb86645[_0x52c75c(0x1ea)]){_0x51167d(_0x1fa372['segment']);}_0x51167d(_0xb86645[_0x52c75c(0x1ce)]?.[_0x52c75c(0x219)]);if(_0xb86645[_0x52c75c(0x1f2)])for(const _0x158bb5 of _0xb86645[_0x52c75c(0x1f2)]){if(_0x158bb5[_0x52c75c(0x1f6)]===_0x52c75c(0x218))for(const _0x4f97bf of _0x158bb5[_0x52c75c(0x21e)][_0x52c75c(0x212)]){_0x51167d(_0x4f97bf['segment']);}else _0x158bb5[_0x52c75c(0x1f6)]===_0x52c75c(0x1da)&&_0x51167d(_0x158bb5[_0x52c75c(0x21e)]['condition']?.[_0x52c75c(0x219)]);}}};_0x51167d(_0x5d3089['goal']?.['segment']);if(_0x5d3089['journeys'])for(const _0x11abb7 of _0x5d3089[_0x540c25(0x200)]){_0x51167d(_0x11abb7['goal']?.['segment']),_0x4d5b60(_0x11abb7[_0x540c25(0x208)]);}_0x5d3089[_0x540c25(0x208)]&&_0x4d5b60(_0x5d3089[_0x540c25(0x208)]);if(_0x5d3089['versions'])for(const _0x158cd3 of _0x5d3089[_0x540c25(0x20a)]){_0x4d5b60(_0x158cd3['stages']);}return _0x38bc00;}