@treasuredata/tdx 2026.3.13 → 2026.3.14

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 (201) 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/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- function a139_0x4d2d(){const _0x2cf58f=['5QTznvF','toISOString','.push-recovery.json','string','23427qvVyuD','basename','journeyName','25267396jbnKCm','ENOENT','utf-8','2402603cFOSgD','820EyphOC','79110bfioer','segments','join','1817aMJooc','parse','12240832XEugkZ','216UFBWfr','stringify','1354gvPOxf','debug','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','warn','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','1534632rlSKTB'];a139_0x4d2d=function(){return _0x2cf58f;};return a139_0x4d2d();}(function(_0x3adf39,_0x23f7f7){const _0x332774=a139_0x4aac,_0x9591b6=_0x3adf39();while(!![]){try{const _0x43c201=-parseInt(_0x332774(0x1c3))/0x1*(parseInt(_0x332774(0x1c8))/0x2)+-parseInt(_0x332774(0x1d3))/0x3*(-parseInt(_0x332774(0x1bf))/0x4)+parseInt(_0x332774(0x1cf))/0x5*(parseInt(_0x332774(0x1ce))/0x6)+-parseInt(_0x332774(0x1d9))/0x7+-parseInt(_0x332774(0x1c5))/0x8+-parseInt(_0x332774(0x1c6))/0x9*(parseInt(_0x332774(0x1c0))/0xa)+parseInt(_0x332774(0x1d6))/0xb;if(_0x43c201===_0x23f7f7)break;else _0x9591b6['push'](_0x9591b6['shift']());}catch(_0xb9482d){_0x9591b6['push'](_0x9591b6['shift']());}}}(a139_0x4d2d,0xd20bb));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a139_0x285a7d from'path';import{Logger}from'../../utils/logger/index.js';function a139_0x4aac(_0x5028ea,_0xb573fc){_0x5028ea=_0x5028ea-0x1bf;const _0x4d2d8f=a139_0x4d2d();let _0x4aac54=_0x4d2d8f[_0x5028ea];return _0x4aac54;}const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0xbafa3a){const _0x414e02=a139_0x4aac,_0x21caa4=a139_0x285a7d['dirname'](_0xbafa3a),_0x5d8546=a139_0x285a7d[_0x414e02(0x1d4)](_0xbafa3a);return a139_0x285a7d[_0x414e02(0x1c2)](_0x21caa4,'.'+_0x5d8546+_0x414e02(0x1d1));}export function readPushRecovery(_0x3bd857){const _0x556d72=a139_0x4aac,_0x43a7b2=getPushRecoveryPath(_0x3bd857);if(!existsSync(_0x43a7b2))return undefined;try{const _0x574233=readFileSync(_0x43a7b2,_0x556d72(0x1d8)),_0x3d04eb=JSON[_0x556d72(0x1c4)](_0x574233);if(_0x3d04eb?.['version']!==0x1||typeof _0x3d04eb['journeyName']!==_0x556d72(0x1d2))return undefined;return _0x3d04eb;}catch(_0x55b9aa){return _0x55b9aa instanceof SyntaxError?logger['debug'](_0x556d72(0x1cb)+_0x55b9aa):logger[_0x556d72(0x1cc)](_0x556d72(0x1cd)+_0x55b9aa),undefined;}}export function writePushRecovery(_0x1aa474,_0xf43fce){const _0x33f43a=a139_0x4aac,_0x2effa3=getPushRecoveryPath(_0x1aa474),_0x2c2dd6=_0x2effa3+'.tmp';writeFileSync(_0x2c2dd6,JSON[_0x33f43a(0x1c7)](_0xf43fce,null,0x2)+'\x0a','utf-8'),renameSync(_0x2c2dd6,_0x2effa3);}export function deletePushRecovery(_0xa58d06){const _0x3a699=a139_0x4aac,_0x4c157f=getPushRecoveryPath(_0xa58d06);try{unlinkSync(_0x4c157f);}catch(_0x4e0799){_0x4e0799['code']!==_0x3a699(0x1d7)&&logger[_0x3a699(0x1c9)](_0x3a699(0x1ca)+_0x4e0799);}}export function saveSegmentToPushRecovery(_0x3e67b7,_0x45a1f7,_0x555bee,_0x3a9218){const _0x252603=a139_0x4aac,_0x170652=readPushRecovery(_0x3e67b7),_0x4a0db5=_0x170652?.[_0x252603(0x1d5)]===_0x45a1f7?{..._0x170652,'updatedAt':new Date()[_0x252603(0x1d0)]()}:{'version':0x1,'journeyName':_0x45a1f7,'updatedAt':new Date()[_0x252603(0x1d0)](),'segments':{}};_0x4a0db5[_0x252603(0x1c1)][_0x555bee]=_0x3a9218,writePushRecovery(_0x3e67b7,_0x4a0db5);}
1
+ (function(_0x4ef94a,_0x105253){const _0x175f18=a139_0x3c0f,_0x53e4db=_0x4ef94a();while(!![]){try{const _0x3274d0=-parseInt(_0x175f18(0x7e))/0x1*(-parseInt(_0x175f18(0x6c))/0x2)+parseInt(_0x175f18(0x6f))/0x3+parseInt(_0x175f18(0x7f))/0x4+parseInt(_0x175f18(0x7c))/0x5*(-parseInt(_0x175f18(0x74))/0x6)+parseInt(_0x175f18(0x84))/0x7+parseInt(_0x175f18(0x7d))/0x8*(parseInt(_0x175f18(0x78))/0x9)+-parseInt(_0x175f18(0x71))/0xa;if(_0x3274d0===_0x105253)break;else _0x53e4db['push'](_0x53e4db['shift']());}catch(_0x2e9a40){_0x53e4db['push'](_0x53e4db['shift']());}}}(a139_0x51d1,0xcf58a));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a139_0x562c4a from'path';import{Logger}from'../../utils/logger/index.js';function a139_0x51d1(){const _0x3a4ef6=['860577VGgJqW','.push-recovery.json','21629620aYIDjD','journeyName','debug','20298kzDzXm','version','basename','toISOString','117eAwmUA','.tmp','ENOENT','string','1445KFoCYz','432032IJlBaY','1cXQbat','4048372MMxUqo','warn','segments','parse','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','11043382MvVyOa','join','stringify','822618BIjWAm','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','code'];a139_0x51d1=function(){return _0x3a4ef6;};return a139_0x51d1();}const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x24f356){const _0x264027=a139_0x3c0f,_0x4685c1=a139_0x562c4a['dirname'](_0x24f356),_0x2fb169=a139_0x562c4a[_0x264027(0x76)](_0x24f356);return a139_0x562c4a[_0x264027(0x6a)](_0x4685c1,'.'+_0x2fb169+_0x264027(0x70));}export function readPushRecovery(_0xf5e46d){const _0xbaaa54=a139_0x3c0f,_0x455272=getPushRecoveryPath(_0xf5e46d);if(!existsSync(_0x455272))return undefined;try{const _0x1e5274=readFileSync(_0x455272,'utf-8'),_0x903490=JSON[_0xbaaa54(0x82)](_0x1e5274);if(_0x903490?.[_0xbaaa54(0x75)]!==0x1||typeof _0x903490[_0xbaaa54(0x72)]!==_0xbaaa54(0x7b))return undefined;return _0x903490;}catch(_0x3c3c09){return _0x3c3c09 instanceof SyntaxError?logger[_0xbaaa54(0x73)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x3c3c09):logger[_0xbaaa54(0x80)](_0xbaaa54(0x6d)+_0x3c3c09),undefined;}}export function writePushRecovery(_0x2e7b8d,_0x146de5){const _0x2fd8e6=a139_0x3c0f,_0x2c1b9e=getPushRecoveryPath(_0x2e7b8d),_0x25907e=_0x2c1b9e+_0x2fd8e6(0x79);writeFileSync(_0x25907e,JSON[_0x2fd8e6(0x6b)](_0x146de5,null,0x2)+'\x0a','utf-8'),renameSync(_0x25907e,_0x2c1b9e);}export function deletePushRecovery(_0x42bd42){const _0x2002f1=a139_0x3c0f,_0x21d728=getPushRecoveryPath(_0x42bd42);try{unlinkSync(_0x21d728);}catch(_0x3e416e){_0x3e416e[_0x2002f1(0x6e)]!==_0x2002f1(0x7a)&&logger['debug'](_0x2002f1(0x83)+_0x3e416e);}}function a139_0x3c0f(_0x5ac23d,_0x36c9c2){_0x5ac23d=_0x5ac23d-0x6a;const _0x51d10e=a139_0x51d1();let _0x3c0f9b=_0x51d10e[_0x5ac23d];return _0x3c0f9b;}export function saveSegmentToPushRecovery(_0x5f42dc,_0x48a8f9,_0x33c7d9,_0x24ae69){const _0x43caa6=a139_0x3c0f,_0x30ded0=readPushRecovery(_0x5f42dc),_0x23b616=_0x30ded0?.[_0x43caa6(0x72)]===_0x48a8f9?{..._0x30ded0,'updatedAt':new Date()[_0x43caa6(0x77)]()}:{'version':0x1,'journeyName':_0x48a8f9,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x23b616[_0x43caa6(0x81)][_0x33c7d9]=_0x24ae69,writePushRecovery(_0x5f42dc,_0x23b616);}
@@ -1 +1 @@
1
- const a140_0x591ef5=a140_0xd9cf;(function(_0x255080,_0x2a1f74){const _0xd982ce=a140_0xd9cf,_0x29ed8b=_0x255080();while(!![]){try{const _0x2b7eb9=-parseInt(_0xd982ce(0x1fa))/0x1*(-parseInt(_0xd982ce(0x17a))/0x2)+parseInt(_0xd982ce(0x181))/0x3+-parseInt(_0xd982ce(0x196))/0x4*(-parseInt(_0xd982ce(0x22a))/0x5)+-parseInt(_0xd982ce(0x17f))/0x6*(-parseInt(_0xd982ce(0x1a3))/0x7)+-parseInt(_0xd982ce(0x242))/0x8*(parseInt(_0xd982ce(0x1f0))/0x9)+parseInt(_0xd982ce(0x1c3))/0xa*(-parseInt(_0xd982ce(0x18c))/0xb)+-parseInt(_0xd982ce(0x1ba))/0xc;if(_0x2b7eb9===_0x2a1f74)break;else _0x29ed8b['push'](_0x29ed8b['shift']());}catch(_0x10ff86){_0x29ed8b['push'](_0x29ed8b['shift']());}}}(a140_0x4c59,0x6a6c8));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a140_0x591ef5(0x225);export const PENDING_ACTIVATION_PREFIX=a140_0x591ef5(0x253);export function createPendingSegmentId(_0x19b833){return''+PENDING_SEGMENT_PREFIX+_0x19b833+'__';}export function isPendingSegmentId(_0x327b61){const _0x2d720c=a140_0x591ef5;return _0x327b61[_0x2d720c(0x20a)](PENDING_SEGMENT_PREFIX)&&!_0x327b61[_0x2d720c(0x20a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x24c062){const _0x2c741b=a140_0x591ef5;return _0x24c062[_0x2c741b(0x1b8)](/^__pending_(.+)__$/,'$1');}function a140_0xd9cf(_0x446992,_0x58687e){_0x446992=_0x446992-0x16b;const _0x4c5996=a140_0x4c59();let _0xd9cfb3=_0x4c5996[_0x446992];return _0xd9cfb3;}export function createPendingActivationId(_0x32e273){return''+PENDING_ACTIVATION_PREFIX+_0x32e273+'__';}export function isPendingActivationId(_0x4ac974){const _0x30af2d=a140_0x591ef5;return _0x4ac974[_0x30af2d(0x20a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2a41a6){const _0x9eb69c=a140_0x591ef5;return _0x2a41a6[_0x9eb69c(0x1b8)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3fc418,_0x345580){const _0x496c1d=a140_0x591ef5,_0x2595ff=_0x3fc418+'::'+(_0x345580[_0x496c1d(0x1cf)]()||_0x496c1d(0x19b)),_0x47e554=createHash(_0x496c1d(0x21a))['update'](_0x2595ff)['digest'](_0x496c1d(0x1d9))[_0x496c1d(0x22b)](0x0,0xc);return _0x496c1d(0x217)+_0x47e554;}export function ensureJourneyDefaults(_0x333e4f){const _0x22dc93=a140_0x591ef5;!_0x333e4f[_0x22dc93(0x1ff)]&&(_0x333e4f[_0x22dc93(0x1ff)]=''),!_0x333e4f[_0x22dc93(0x186)]&&(_0x333e4f[_0x22dc93(0x186)]=_0x22dc93(0x187));}export function injectExistingStageIds(_0xb0ec16,_0x46d56f){const _0x591671=a140_0x591ef5,_0x419834=new Map(_0x46d56f[_0x591671(0x24a)](_0x58085d=>[_0x58085d[_0x591671(0x16c)],_0x58085d['id']]));for(const _0x50044b of _0xb0ec16){if(!_0x50044b['id']){const _0x5b7465=_0x419834[_0x591671(0x248)](_0x50044b[_0x591671(0x16c)]);_0x5b7465&&(_0x50044b['id']=_0x5b7465);}}}export function resolveTDFolderPath(_0xe56b14,_0xc02628,_0x499dc3){const _0x130023=a140_0x591ef5;if(!_0xc02628)return _0xe56b14;if(_0xe56b14===_0x499dc3||_0xe56b14[_0x130023(0x20a)](_0x499dc3+'/'))return _0xe56b14;return _0xe56b14?_0x499dc3+'/'+_0xe56b14:_0x499dc3;}export function addFoldersToCreate(_0x410bfe,_0x2240f4,_0x5bc322){const _0x1247c6=a140_0x591ef5;if(!_0x410bfe)return;if(_0x2240f4['has'](_0x410bfe))return;const _0x427c90=_0x410bfe[_0x1247c6(0x262)]('/');let _0x4b3667='';for(const _0x582389 of _0x427c90){_0x4b3667=_0x4b3667?_0x4b3667+'/'+_0x582389:_0x582389,!_0x2240f4[_0x1247c6(0x202)](_0x4b3667)&&_0x5bc322[_0x1247c6(0x25f)](_0x4b3667);}}export function sortFoldersByDepth(_0x589103){const _0x1bbb7b=a140_0x591ef5;return[..._0x589103][_0x1bbb7b(0x252)]((_0x1a8ea2,_0x577dfb)=>{const _0x3e9161=_0x1bbb7b,_0x495fba=(_0x1a8ea2[_0x3e9161(0x250)](/\//g)||[])[_0x3e9161(0x240)],_0x3f69b8=(_0x577dfb[_0x3e9161(0x250)](/\//g)||[])[_0x3e9161(0x240)];return _0x495fba-_0x3f69b8;});}import*as a140_0x4d8f43 from'yaml';import{readFileSync}from'fs';import a140_0x4f4190 from'path';import{isJourneyDef,parseYamlString as a140_0x37a00a,toYamlString as a140_0x4adfeb,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x5ed508){const _0x82eb87=a140_0x591ef5;if(Array['isArray'](_0x5ed508))return'['+_0x5ed508[_0x82eb87(0x24a)](_0x4d0c69=>stableStringify(_0x4d0c69))[_0x82eb87(0x1f8)](',')+']';if(_0x5ed508&&typeof _0x5ed508===_0x82eb87(0x197)){const _0x508deb=_0x5ed508,_0x143d27=Object[_0x82eb87(0x251)](_0x508deb)['sort'](),_0x329fa3=_0x143d27[_0x82eb87(0x24a)](_0x28026b=>'\x22'+_0x28026b+'\x22:'+stableStringify(_0x508deb[_0x28026b]));return'{'+_0x329fa3['join'](',')+'}';}const _0x57e566=JSON['stringify'](_0x5ed508);return _0x57e566===undefined?_0x82eb87(0x1ac):_0x57e566;}function activationSignature(_0x4e66a7){const _0x1b02bf=a140_0x591ef5,_0x4d2853={'connection':_0x4e66a7[_0x1b02bf(0x1d0)],..._0x4e66a7['all_columns']!==undefined&&{'all_columns':_0x4e66a7['all_columns']},..._0x4e66a7[_0x1b02bf(0x23b)]!==undefined&&{'columns':_0x4e66a7[_0x1b02bf(0x23b)]},..._0x4e66a7['behavior']!==undefined&&{'behavior':_0x4e66a7[_0x1b02bf(0x208)]},..._0x4e66a7[_0x1b02bf(0x234)]!==undefined&&{'schedule':_0x4e66a7[_0x1b02bf(0x234)]},..._0x4e66a7[_0x1b02bf(0x1b9)]!==undefined&&{'notification':_0x4e66a7['notification']},..._0x4e66a7[_0x1b02bf(0x1dd)]!==undefined&&{'connector_config':_0x4e66a7[_0x1b02bf(0x1dd)]},..._0x4e66a7[_0x1b02bf(0x19e)]!==undefined&&{'activation_template_id':_0x4e66a7[_0x1b02bf(0x19e)]}};return stableStringify(_0x4d2853);}async function fetchSegment(_0x4ad310,_0x523cbc,_0x1ea2c5,_0x371f04){const _0x36cfcc=a140_0x591ef5,_0x43ed6b=_0x371f04?.[_0x36cfcc(0x173)](_0x3ff290=>_0x3ff290['id']===_0x1ea2c5);if(_0x43ed6b)return _0x43ed6b;try{return await _0x4ad310[_0x36cfcc(0x19b)]['getSegment'](_0x523cbc,_0x1ea2c5);}catch(_0x1c3ec3){logger[_0x36cfcc(0x16f)]('getSegment\x20failed\x20for\x20'+_0x1ea2c5+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x1c3ec3);try{return await _0x4ad310['segment']['getSegmentEntity'](_0x1ea2c5);}catch(_0x4cfa99){return logger['debug'](_0x36cfcc(0x1b6)+_0x1ea2c5+':\x20'+_0x4cfa99),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5b16e5,_0x46119c,_0x121372){const _0x9cabec=a140_0x591ef5,_0x18197d=readPushRecovery(_0x5b16e5[_0x9cabec(0x1d6)]);if(_0x18197d?.[_0x9cabec(0x190)]===_0x5b16e5[_0x9cabec(0x1f2)]['name'])for(const [_0x1c0f53,_0x45fefa]of Object[_0x9cabec(0x17b)](_0x18197d['segments'])){const _0x1d5c2d=generateDeterministicJourneySegmentName(_0x5b16e5['yamlConfig'][_0x9cabec(0x16c)],_0x1c0f53);_0x45fefa[_0x9cabec(0x1a0)]===_0x1d5c2d&&(_0x46119c[_0x9cabec(0x19a)](_0x1c0f53,_0x45fefa[_0x9cabec(0x18a)]),_0x121372[_0x9cabec(0x19a)](_0x1c0f53,_0x45fefa['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x42b5e7,_0x5c36cc,_0x2dbb7b,_0x47ce46){const _0x5127e3=a140_0x591ef5;let _0x3a8c4c;try{_0x3a8c4c=await _0x42b5e7['segment'][_0x5127e3(0x1f1)]({'name':_0x2dbb7b['uniqueSegmentName'],'description':_0x2dbb7b[_0x5127e3(0x1ff)],'journeyId':_0x2dbb7b['journeyId'],'rule':_0x47ce46(_0x2dbb7b['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x2dbb7b['folderId'],'audienceId':_0x2dbb7b['parentId']});}catch(_0x3f705d){const _0x58446b=_0x3f705d instanceof Error&&_0x3f705d[_0x5127e3(0x1df)][_0x5127e3(0x1e0)]('Name\x20has\x20already\x20been\x20taken');if(_0x58446b){const _0x240396=readPushRecovery(_0x5c36cc[_0x5127e3(0x1d6)]),_0x523821=_0x240396?.[_0x5127e3(0x190)]===_0x5c36cc['yamlConfig'][_0x5127e3(0x16c)]?_0x240396[_0x5127e3(0x194)][_0x2dbb7b['localName']]:undefined;if(_0x523821?.[_0x5127e3(0x1a0)]===_0x2dbb7b[_0x5127e3(0x267)])await _0x42b5e7[_0x5127e3(0x19b)][_0x5127e3(0x269)](_0x2dbb7b[_0x5127e3(0x246)],_0x523821[_0x5127e3(0x18a)],{'description':_0x2dbb7b[_0x5127e3(0x1ff)],'rule':_0x47ce46(_0x2dbb7b['resolvedRule'],!![]),'countPopulation':!![]}),_0x3a8c4c=_0x523821[_0x5127e3(0x18a)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5127e3(0x1e7)+_0x2dbb7b[_0x5127e3(0x1d5)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x5127e3(0x20e)+_0x5c36cc['absolutePath'][_0x5127e3(0x1b8)](/([^/]+)$/,_0x5127e3(0x214))+')\x20')+_0x5127e3(0x22c),_0x3f705d);}else throw _0x3f705d;}return saveSegmentToPushRecovery(_0x5c36cc['absolutePath'],_0x5c36cc[_0x5127e3(0x1f2)][_0x5127e3(0x16c)],_0x2dbb7b[_0x5127e3(0x1d5)],{'segmentId':_0x3a8c4c,'uniqueServerName':_0x2dbb7b['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x3a8c4c;}export async function prepareSegmentFiles(_0x254ef1,_0x2aa930,_0x25923f,_0x16ae6e,_0x735df7){const _0x36e24c=a140_0x591ef5,{activationDefToCreateRequest:_0x2f7064}=await import(_0x36e24c(0x25a)),_0x3ad84f=[],_0x687ebd=new Set();for(const {yamlConfig:_0x319662,folderPath:_0x4eb027,sourcePath:_0x555e8e}of _0x254ef1){const _0x56582e=resolveTDFolderPath(_0x4eb027,_0x16ae6e,_0x735df7),_0x335699=_0x56582e+':'+_0x319662['name'],_0x5ab211=_0x2aa930[_0x36e24c(0x1bb)]['get'](_0x335699),_0x995a2b=_0x5ab211?_0x2aa930[_0x36e24c(0x1dc)][_0x36e24c(0x248)](_0x5ab211['id'])||[]:[];addFoldersToCreate(_0x56582e,_0x2aa930[_0x36e24c(0x1ef)],_0x687ebd);const _0x5674dc=calculateActivationActions(_0x319662[_0x36e24c(0x21b)]||[],_0x995a2b,_0x2aa930[_0x36e24c(0x1ab)],_0x2aa930[_0x36e24c(0x25d)]);for(const _0x2ba775 of _0x5674dc){(_0x2ba775[_0x36e24c(0x215)]===_0x36e24c(0x218)||_0x2ba775[_0x36e24c(0x215)]===_0x36e24c(0x19f))&&_0x2ba775[_0x36e24c(0x23e)]&&(_0x2ba775[_0x36e24c(0x24d)]=await _0x2f7064(_0x2ba775[_0x36e24c(0x23e)],_0x25923f));}const _0x1e0d17=calculateSegmentDiff(_0x319662,_0x5ab211,_0x995a2b,_0x2aa930[_0x36e24c(0x1ab)],_0x2aa930[_0x36e24c(0x25d)]);_0x3ad84f['push']({'relativePath':_0x319662[_0x36e24c(0x16c)],'absolutePath':_0x555e8e,'yamlConfig':_0x319662,'folderPath':_0x56582e,'existingSegment':_0x5ab211,'existingActivations':_0x995a2b,'isNew':_0x1e0d17[_0x36e24c(0x233)],'hasChanges':_0x1e0d17[_0x36e24c(0x1b2)],'diff':_0x1e0d17[_0x36e24c(0x1e3)],'activationActions':_0x5674dc});}return{'segmentFiles':_0x3ad84f,'foldersToCreate':_0x687ebd};}export async function prepareJourneyFiles(_0x596f48,_0x57beb8,_0x227dad,_0x5a6a7d){const _0x37ae1b=a140_0x591ef5,_0x23a2c1=[],_0x153201=new Set();for(const {yamlConfig:_0x5e53e3,folderPath:_0x6e10f7,sourcePath:_0x5b456d}of _0x596f48){const _0x4c0b82=resolveTDFolderPath(_0x6e10f7,_0x227dad,_0x5a6a7d),_0xfa8ce3=_0x4c0b82+':'+_0x5e53e3[_0x37ae1b(0x16c)],_0x1e3801=_0x57beb8[_0x37ae1b(0x211)]['get'](_0xfa8ce3);let _0x465798,_0x2eef54;if(_0x1e3801&&_0x1e3801['length']>0x0){const _0x271a1a=buildLocalExpandedRuleMappings(_0x5e53e3),{createYamlContext:_0x6059ee,prefetchJourneySegments:_0x5bb768}=createPushYamlContextForBundle(_0x57beb8['deps'],_0x57beb8[_0x37ae1b(0x246)],_0x57beb8[_0x37ae1b(0x255)],_0x271a1a,_0x57beb8[_0x37ae1b(0x1ab)],_0x57beb8[_0x37ae1b(0x25d)],_0x57beb8[_0x37ae1b(0x1a9)],_0x57beb8[_0x37ae1b(0x1f7)]);await _0x5bb768(_0x1e3801['map'](_0x58a6fb=>_0x58a6fb['id']));const _0x1b044f=await _0x57beb8[_0x37ae1b(0x16b)][_0x37ae1b(0x17d)]['getLatestJourneyId'](_0x1e3801[0x0][_0x37ae1b(0x18f)]),_0x222cf6=hasMultipleVersions(_0x5e53e3),_0x1cdbbd=async _0x161860=>{const _0x5c0b75=_0x37ae1b,_0x28b219=_0x57beb8[_0x5c0b75(0x1f7)]?.['get'](_0x161860);if(_0x28b219)return _0x28b219;return _0x57beb8['fetchJourney']({'journeyId':_0x161860,'journeyName':_0x5e53e3[_0x5c0b75(0x16c)],'isMultiVersion':_0x1e3801[_0x5c0b75(0x240)]>0x1});};if(_0x222cf6&&_0x1e3801[_0x37ae1b(0x240)]>0x1){const _0x12edfa=[];for(const _0x513d0c of _0x1e3801){const _0x10832b=_0x513d0c[_0x37ae1b(0x1d3)]||0x1;_0x57beb8[_0x37ae1b(0x268)]?.['update']('Fetching\x20'+_0x5e53e3[_0x37ae1b(0x16c)]+'\x20v'+_0x10832b);const _0x445f5f=await _0x1cdbbd(_0x513d0c['id']),_0x2b8326=_0x6059ee(_0x513d0c['id']),_0x17682d=await journeyResponseToDef(_0x445f5f,_0x2b8326);_0x12edfa['push']({'item':_0x513d0c,'yaml':_0x17682d});}const _0x247c57=buildLocalRuleToNameMappingFromJourney(_0x5e53e3);_0x2eef54=buildMergedJourneyDef(_0x12edfa,_0x247c57,_0x1b044f);const _0x8d7050=Math['max'](..._0x12edfa[_0x37ae1b(0x24a)](_0x316b2a=>_0x316b2a['item'][_0x37ae1b(0x1d3)]||0x0)),_0x26e164=_0x1e3801[_0x37ae1b(0x173)](_0x32915e=>(_0x32915e[_0x37ae1b(0x1d3)]||0x0)===_0x8d7050);_0x26e164&&(_0x57beb8[_0x37ae1b(0x268)]?.[_0x37ae1b(0x19f)](_0x37ae1b(0x24f)+_0x5e53e3[_0x37ae1b(0x16c)]+'\x20v'+_0x8d7050),_0x465798=await _0x1cdbbd(_0x26e164['id']));}else{const _0x51e940=_0x1e3801[_0x1e3801['length']-0x1];_0x57beb8[_0x37ae1b(0x268)]?.['update'](_0x37ae1b(0x24f)+_0x5e53e3[_0x37ae1b(0x16c)]),_0x465798=await _0x1cdbbd(_0x51e940['id']);const _0xe12579=_0x6059ee(_0x51e940['id']),_0x2fd792=await journeyResponseToDef(_0x465798,_0xe12579),_0x1a267b=buildLocalRuleToNameMappingFromJourney(_0x5e53e3);_0x2eef54=buildMergedJourneyDef([{'item':_0x51e940,'yaml':_0x2fd792}],_0x1a267b,_0x1b044f);}}addFoldersToCreate(_0x4c0b82,_0x57beb8[_0x37ae1b(0x1ef)],_0x153201);const _0x2d88f6=calculateJourneyDiff(_0x5e53e3,_0x2eef54);_0x23a2c1[_0x37ae1b(0x265)]({'relativePath':_0x5e53e3[_0x37ae1b(0x16c)],'absolutePath':_0x5b456d,'yamlConfig':_0x5e53e3,'folderPath':_0x4c0b82,'existingJourney':_0x465798,'isNew':_0x2d88f6[_0x37ae1b(0x233)],'hasChanges':_0x2d88f6[_0x37ae1b(0x1b2)],'diff':_0x2d88f6[_0x37ae1b(0x1e3)]});}return{'journeyFiles':_0x23a2c1,'foldersToCreate':_0x153201};}export function calculateActivationActions(_0x36bcf6,_0x1045b4,_0xc7e32f,_0x1abdf6){const _0x18221e=a140_0x591ef5,_0x3226f2=[],_0x31466c=new Map();for(const _0x40dade of _0x1045b4){_0x31466c[_0x18221e(0x19a)](_0x40dade['name'],_0x40dade);}const _0x5d955d=new Map();for(const _0x52f131 of _0x36bcf6){_0x5d955d['set'](_0x52f131[_0x18221e(0x16c)],_0x52f131);}for(const _0x195410 of _0x36bcf6){const _0x185a03=_0x31466c[_0x18221e(0x248)](_0x195410['name']);if(!_0x185a03)_0x3226f2[_0x18221e(0x265)]({'type':_0x18221e(0x218),'name':_0x195410[_0x18221e(0x16c)],'yamlActivation':_0x195410});else{const _0x2958d2=activationResponseToDef(_0x185a03,_0xc7e32f,_0x1abdf6),_0x27a6df=a140_0x4d8f43['stringify'](_0x2958d2),_0x276f92=a140_0x4d8f43[_0x18221e(0x1c1)](_0x195410);_0x27a6df!==_0x276f92&&_0x3226f2['push']({'type':_0x18221e(0x19f),'name':_0x195410[_0x18221e(0x16c)],'yamlActivation':_0x195410,'existingActivation':_0x185a03});}}for(const _0xd16fc of _0x1045b4){!_0x5d955d['has'](_0xd16fc[_0x18221e(0x16c)])&&_0x3226f2['push']({'type':_0x18221e(0x16e),'name':_0xd16fc[_0x18221e(0x16c)],'existingActivation':_0xd16fc});}return _0x3226f2;}function calculateYamlDiff(_0x4ebbdc,_0x2c231d){if(_0x2c231d){const _0x2d306f=generateDiff(_0x2c231d,_0x4ebbdc),_0x22d0f3=hasChanges(_0x2d306f);return{'isNew':![],'hasChanges':_0x22d0f3,'diff':_0x22d0f3?formatDiffWithColors(_0x2d306f):undefined};}const _0x3d0be3=generateDiff('',_0x4ebbdc);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3d0be3)};}export function calculateSegmentDiff(_0xcc6588,_0x340ad4,_0x50b6f0,_0x555100,_0x559cac){const _0x2374b8=segmentToYamlString(_0xcc6588),_0x7db760=_0x340ad4?segmentToYamlString(segmentWithActivationsToYaml(_0x340ad4,_0x50b6f0,undefined,_0x555100,_0x559cac)):undefined;return calculateYamlDiff(_0x2374b8,_0x7db760);}export function calculateJourneyDiff(_0x15b3f6,_0x167bf3){const _0x19a256=normalizeJourneyDef(_0x15b3f6,_0x15b3f6),_0x539fe9=a140_0x4adfeb(_0x19a256),_0x165cc4=_0x167bf3?a140_0x4adfeb(normalizeJourneyDef(_0x167bf3,_0x15b3f6)):undefined;return calculateYamlDiff(_0x539fe9,_0x165cc4);}export function findSegmentsToDelete(_0xdc60e3,_0x2787dd,_0x50dcd1,_0x1b5263,_0xec7d86){const _0x4ffadc=a140_0x591ef5,_0x376adf=new Set();for(const {yamlConfig:_0xc9e061,folderPath:_0x10a2fa}of _0x2787dd){_0x376adf[_0x4ffadc(0x25f)](_0x10a2fa+':'+_0xc9e061[_0x4ffadc(0x16c)]);}return _0xdc60e3[_0x4ffadc(0x243)](_0x5ad63d=>{const _0x358107=_0x4ffadc,_0x1341cd=_0x5ad63d[_0x358107(0x191)]?_0x50dcd1['get'](_0x5ad63d['segmentFolderId'][_0x358107(0x180)]())||'':'',_0x3d92b8=_0x1341cd+':'+_0x5ad63d['name'];if(_0x376adf[_0x358107(0x202)](_0x3d92b8))return![];if(_0xec7d86)return _0x1341cd===_0x1b5263||_0x1341cd[_0x358107(0x20a)](_0x1b5263+'/');return!![];});}export function findJourneysToDelete(_0x1b1832,_0x48e0b3,_0x3551c3,_0x4322d0,_0x3bf7e1){const _0x532907=a140_0x591ef5,_0x598329=new Set();for(const {yamlConfig:_0x587ccc,folderPath:_0x262cfe}of _0x48e0b3){_0x598329[_0x532907(0x25f)](_0x262cfe+':'+_0x587ccc[_0x532907(0x16c)]);}return _0x1b1832[_0x532907(0x243)](_0x590ed2=>{const _0x480108=_0x532907,_0x14592e=_0x590ed2[_0x480108(0x1c0)]?_0x3551c3[_0x480108(0x248)](_0x590ed2['folderId'])||'':'',_0x49fa22=_0x14592e+':'+_0x590ed2[_0x480108(0x1da)];if(_0x598329['has'](_0x49fa22))return![];if(_0x3bf7e1)return _0x14592e===_0x4322d0||_0x14592e['startsWith'](_0x4322d0+'/');return!![];});}export function buildSegmentLookupMap(_0x2ae410,_0x5578c5){const _0x1b8cef=a140_0x591ef5,_0x2af1c4=new Map();for(const _0x1c8bbc of _0x2ae410){const _0x6718c1=_0x1c8bbc['segmentFolderId']?_0x5578c5[_0x1b8cef(0x248)](_0x1c8bbc[_0x1b8cef(0x191)][_0x1b8cef(0x180)]())||'':'',_0x592ac5=_0x6718c1+':'+_0x1c8bbc[_0x1b8cef(0x16c)];_0x2af1c4['set'](_0x592ac5,_0x1c8bbc);}return _0x2af1c4;}export function buildSegmentNameToIdMap(_0x8d9ab0){const _0x1479fd=a140_0x591ef5,_0x1786e6=new Map();for(const _0x5d9cf0 of _0x8d9ab0){_0x1786e6[_0x1479fd(0x19a)](_0x5d9cf0['name'],_0x5d9cf0['id']);}return _0x1786e6;}export function buildJourneyBundleLookupMap(_0x1da296,_0x1216fd){const _0x490cd4=a140_0x591ef5,_0x23f7a1=new Map();for(const _0x391092 of _0x1da296){const _0x5662b1=_0x391092[_0x490cd4(0x1c0)]?_0x1216fd[_0x490cd4(0x248)](_0x391092[_0x490cd4(0x1c0)])||'':'',_0x26c94b=_0x5662b1+':'+_0x391092['journeyBundleName'];!_0x23f7a1[_0x490cd4(0x202)](_0x26c94b)&&_0x23f7a1[_0x490cd4(0x19a)](_0x26c94b,[]),_0x23f7a1[_0x490cd4(0x248)](_0x26c94b)[_0x490cd4(0x265)](_0x391092);}for(const _0x31640b of _0x23f7a1[_0x490cd4(0x204)]()){_0x31640b[_0x490cd4(0x252)]((_0x1c30b4,_0x5b4177)=>(_0x1c30b4[_0x490cd4(0x1d3)]||0x0)-(_0x5b4177[_0x490cd4(0x1d3)]||0x0));}return _0x23f7a1;}export function collectFoldersToCreate(_0xb150f6,_0x524da1){const _0x29d287=a140_0x591ef5,_0x42b7c8=new Set();for(const _0x1b926d of _0xb150f6){if(!_0x1b926d)continue;if(_0x524da1[_0x29d287(0x202)](_0x1b926d))continue;const _0x26fed8=_0x1b926d['split']('/');let _0x330023='';for(const _0x3b8ada of _0x26fed8){_0x330023=_0x330023?_0x330023+'/'+_0x3b8ada:_0x3b8ada,!_0x524da1[_0x29d287(0x202)](_0x330023)&&_0x42b7c8[_0x29d287(0x25f)](_0x330023);}}return _0x42b7c8;}export function parseAndClassifyYamlFiles(_0x3e306a,_0x297d48,_0x3a6be2){const _0x2ee67b=a140_0x591ef5,_0x4b0bee=[],_0x4849a7=[];for(const _0x3e7a11 of _0x3e306a){const _0x365633=a140_0x4f4190[_0x2ee67b(0x25c)](_0x297d48,a140_0x4f4190[_0x2ee67b(0x1e8)](_0x3e7a11)),_0x196e95=_0x365633==='.'?'':_0x365633,_0x40d4b4=readFileSync(_0x3e7a11,'utf-8'),_0x52b50a=a140_0x4d8f43['parse'](_0x40d4b4);if(isJourneyDef(_0x52b50a)){const _0x22bf79=a140_0x37a00a(_0x40d4b4);_0x4849a7['push']({'yamlConfig':_0x22bf79,'folderPath':_0x196e95,'sourcePath':_0x3e7a11});}else{if(!_0x3a6be2?.[_0x2ee67b(0x17e)]){const _0x3ab6fb=parseSegmentYamlFile(_0x40d4b4),_0x4cbdf8=normalizeChildSegmentYaml(_0x3ab6fb);_0x4b0bee[_0x2ee67b(0x265)]({'yamlConfig':_0x4cbdf8,'folderPath':_0x196e95,'sourcePath':_0x3e7a11});}}}return{'segments':_0x4b0bee,'journeys':_0x4849a7};}export function validateParsedFiles(_0x1ab680,_0x2cadf4){const _0x298f0b=a140_0x591ef5,_0x164d6c=[];for(const {yamlConfig:_0x8a3a33,sourcePath:_0x2d6502}of _0x1ab680['segments']){const _0x33de2b=readFileSync(_0x2d6502,_0x298f0b(0x266)),_0xae502c=a140_0x4d8f43[_0x298f0b(0x256)](_0x33de2b),_0x475341=validateSegmentDef(_0x8a3a33,{'source':_0x33de2b,'document':_0xae502c},{'skipSchema':!![]});if(!_0x475341['valid']){const _0x17cc94=a140_0x4f4190[_0x298f0b(0x25c)](_0x2cadf4,_0x2d6502);_0x164d6c['push']({'filePath':_0x17cc94,'source':_0x33de2b,'result':_0x475341,'isJourney':![]});}}for(const {yamlConfig:_0x514576,sourcePath:_0x14df17}of _0x1ab680[_0x298f0b(0x1ec)]){const _0x588281=readFileSync(_0x14df17,'utf-8'),_0x3e6c5b=a140_0x4d8f43['parseDocument'](_0x588281),_0x3c5bd2=validateJourneyDef(_0x514576,{'source':_0x588281,'document':_0x3e6c5b},{'skipSchema':!![]});if(!_0x3c5bd2[_0x298f0b(0x20f)]){const _0x564688=a140_0x4f4190['relative'](_0x2cadf4,_0x14df17);_0x164d6c[_0x298f0b(0x265)]({'filePath':_0x564688,'source':_0x588281,'result':_0x3c5bd2,'isJourney':!![]});}}return _0x164d6c;}export function formatValidationErrors(_0x4e9c4e){const _0x540ad9=a140_0x591ef5,_0x55ff50=[];for(const {filePath:_0x39a282,source:_0x378530,result:_0xef86de,isJourney:_0x333f62}of _0x4e9c4e){const _0x2023a1=_0x333f62?_0x540ad9(0x17d):_0x540ad9(0x19b);_0x55ff50[_0x540ad9(0x265)]('\x0a'+_0x39a282+'\x20('+_0x2023a1+'):\x20'+_0xef86de[_0x540ad9(0x261)][_0x540ad9(0x240)]+'\x20error(s)'),_0x55ff50['push'](formatValidationResult(_0xef86de,_0x378530,_0x39a282));}return _0x55ff50[_0x540ad9(0x1f8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x86d8ca){const _0x5d8fda=a140_0x591ef5,_0x921efc=new Set(),_0x62373=new Map(),_0xfc0f72=collectSegmentUsageCounts(_0x86d8ca);if(_0x86d8ca['segments'])for(const [_0x572061,_0x1fb1f1]of Object[_0x5d8fda(0x17b)](_0x86d8ca[_0x5d8fda(0x194)])){_0x921efc['add'](_0x572061);if(_0x1fb1f1[_0x5d8fda(0x22d)]){const _0x2882d6=yamlRuleToApi(_0x1fb1f1['rule']),_0x54e65b=apiRuleToYaml(_0x2882d6);_0x62373[_0x5d8fda(0x19a)](_0x572061,_0x54e65b);}}const _0x1a8211=new Map();let _0x1c5aab=0x0;for(const [_0x36968a,_0x4dc7f2]of _0x62373){const _0x447d02=serializeExpandedRule(_0x4dc7f2,_0x62373),_0x370eb3=_0x1a8211[_0x5d8fda(0x248)](_0x447d02)||[];_0x370eb3[_0x5d8fda(0x265)]({'name':_0x36968a,'index':_0x1c5aab}),_0x1a8211[_0x5d8fda(0x19a)](_0x447d02,_0x370eb3),_0x1c5aab++;}const _0x5089f1=new Map();for(const [_0x32078f,_0x17d0c1]of _0x1a8211){const _0x4a2f84=_0x17d0c1[_0x5d8fda(0x22b)]()['sort']((_0x5a2317,_0x2c65f7)=>{const _0x30163c=_0x5d8fda,_0x5b7965=_0xfc0f72['get'](_0x5a2317[_0x30163c(0x16c)])||0x0,_0x24b3df=_0xfc0f72[_0x30163c(0x248)](_0x2c65f7[_0x30163c(0x16c)])||0x0;if(_0x5b7965!==_0x24b3df)return _0x24b3df-_0x5b7965;return _0x5a2317[_0x30163c(0x21e)]-_0x2c65f7[_0x30163c(0x21e)];})[_0x5d8fda(0x24a)](_0x370700=>_0x370700[_0x5d8fda(0x16c)]),_0x212eef=[];for(const _0x412070 of _0x4a2f84){const _0x3ccdd7=_0xfc0f72['get'](_0x412070)||0x0,_0x45b2fc=Math['max'](_0x3ccdd7,0x1);for(let _0x43dd23=0x0;_0x43dd23<_0x45b2fc;_0x43dd23++){_0x212eef['push'](_0x412070);}}_0x5089f1['set'](_0x32078f,_0x212eef);}return{'existingLocalSegmentNames':_0x921efc,'localSegmentRules':_0x62373,'localExpandedRuleToNames':_0x5089f1};}export function createSegmentIdResolver(_0x22437a,_0x3bdf5c){return async _0x2c2624=>{const _0x95d69e=a140_0xd9cf,_0x4ca76c=_0x22437a[_0x95d69e(0x248)](_0x2c2624);if(!_0x4ca76c)throw new SDKError(ErrorCode[_0x95d69e(0x1be)],_0x95d69e(0x236)+_0x2c2624+_0x95d69e(0x1c4)+_0x3bdf5c+'\x27)');return _0x4ca76c;};}export function extractRootFolderId(_0x244f5f){const _0x5f0d6e=a140_0x591ef5;return _0x244f5f[_0x5f0d6e(0x16d)]?.['parentSegmentFolder']?.['data']?.['id']||_0x244f5f[_0x5f0d6e(0x16d)]?.[_0x5f0d6e(0x1ca)]?.[_0x5f0d6e(0x21d)]?.['id'];}export function buildConnectionMaps(_0x44e7f8){const _0x4104e1=a140_0x591ef5,_0x49aeb3=new Map(),_0x2101dc=new Map(),_0x19e6b4=new Map();for(const _0x32ba40 of _0x44e7f8){_0x49aeb3[_0x4104e1(0x19a)](_0x32ba40['name'],parseInt(_0x32ba40['id'],0xa)),_0x2101dc[_0x4104e1(0x19a)](_0x32ba40['id'],_0x32ba40[_0x4104e1(0x16c)]),_0x19e6b4[_0x4104e1(0x19a)](_0x32ba40[_0x4104e1(0x16c)],_0x32ba40[_0x4104e1(0x215)]);}return{'nameToId':_0x49aeb3,'idToName':_0x2101dc,'nameToType':_0x19e6b4};}export function calculatePushStats(_0x2d89c0,_0x2dd451,_0x451213,_0x1ec02b,_0xb4391a,_0x2992e9,_0xa37b26){const _0x13c17f=a140_0x591ef5,_0x39514f=_0x2d89c0[_0x13c17f(0x243)](_0x38480=>_0x38480[_0x13c17f(0x233)]),_0x5f48ff=_0x2d89c0[_0x13c17f(0x243)](_0x4c1577=>!_0x4c1577[_0x13c17f(0x233)]&&_0x4c1577[_0x13c17f(0x1b2)]),_0x1cf952=_0x2d89c0[_0x13c17f(0x243)](_0x14d254=>!_0x14d254[_0x13c17f(0x233)]&&!_0x14d254[_0x13c17f(0x1b2)]),_0xbbe0b1=_0x2992e9?_0x1ec02b:[],_0xb5cb86=_0x2dd451['filter'](_0x34125e=>_0x34125e[_0x13c17f(0x233)]),_0xe68b78=_0x2dd451['filter'](_0x2a3b35=>!_0x2a3b35[_0x13c17f(0x233)]&&_0x2a3b35['hasChanges']),_0x1e2052=_0x2dd451[_0x13c17f(0x243)](_0x2acf76=>!_0x2acf76[_0x13c17f(0x233)]&&!_0x2acf76[_0x13c17f(0x1b2)]),_0x5b3ce0=_0x2992e9?_0xb4391a:[],_0x12cbef=_0x2d89c0[_0x13c17f(0x25e)](_0x207db4=>_0x207db4[_0x13c17f(0x22e)]),_0x4be2e9=_0x12cbef[_0x13c17f(0x243)](_0x2baa29=>_0x2baa29['type']===_0x13c17f(0x218)),_0xe10923=_0x12cbef['filter'](_0xef09aa=>_0xef09aa[_0x13c17f(0x215)]===_0x13c17f(0x19f)),_0x342091=_0x12cbef[_0x13c17f(0x243)](_0xa30048=>_0xa30048['type']===_0x13c17f(0x16e)),_0x1bc804=Array[_0x13c17f(0x175)](_0x451213)[_0x13c17f(0x252)](),_0x665162=_0xa37b26?![]:_0x39514f['length']>0x0||_0x5f48ff['length']>0x0||_0xbbe0b1[_0x13c17f(0x240)]>0x0,_0x47f003=_0xb5cb86[_0x13c17f(0x240)]>0x0||_0xe68b78[_0x13c17f(0x240)]>0x0||_0x5b3ce0[_0x13c17f(0x240)]>0x0,_0x19b9d0=_0xa37b26?![]:_0x12cbef['length']>0x0,_0x23439f=_0x1bc804[_0x13c17f(0x240)]>0x0;return{'segments':{'new':_0x39514f,'changed':_0x5f48ff,'unchanged':_0x1cf952,'toDelete':_0xbbe0b1},'journeys':{'new':_0xb5cb86,'changed':_0xe68b78,'unchanged':_0x1e2052,'toDelete':_0x5b3ce0},'activations':{'all':_0x12cbef,'toCreate':_0x4be2e9,'toUpdate':_0xe10923,'toDelete':_0x342091},'folders':{'toCreate':_0x1bc804},'counts':{'segments':{'new':_0x39514f[_0x13c17f(0x240)],'changed':_0x5f48ff[_0x13c17f(0x240)],'unchanged':_0x1cf952[_0x13c17f(0x240)],'toDelete':_0xbbe0b1[_0x13c17f(0x240)]},'journeys':{'new':_0xb5cb86[_0x13c17f(0x240)],'changed':_0xe68b78[_0x13c17f(0x240)],'unchanged':_0x1e2052[_0x13c17f(0x240)],'toDelete':_0x5b3ce0[_0x13c17f(0x240)]},'activations':{'create':_0x4be2e9[_0x13c17f(0x240)],'update':_0xe10923[_0x13c17f(0x240)],'delete':_0x342091[_0x13c17f(0x240)]},'folders':_0x1bc804[_0x13c17f(0x240)]},'hasChanges':_0x665162||_0x47f003||_0x19b9d0||_0x23439f};}export async function buildPushExecutionContext(_0x28b982,_0x278874,_0x41c249,_0x4f63fc,_0x17d0d4,_0x3566cd){const _0x515f09=a140_0x591ef5,_0xb011e9=extractRootFolderId(_0x41c249),{pathToId:_0x4f2f0f,idToPath:_0x15c136}=buildFolderMaps(_0x17d0d4),_0x134025=buildSegmentNameToIdMap(_0x4f63fc),_0x37c2f7=new Map(),{batchAsync:_0x4d8b9f}=await import('../../utils/async.js'),[_0x4c71b7,_0x13e51e]=await Promise['all']([_0x28b982[_0x515f09(0x206)][_0x515f09(0x18e)](),_0x28b982[_0x515f09(0x1d0)]['list'](),((async()=>{const _0x3f87ba=_0x515f09;!_0x3566cd&&_0x4f63fc[_0x3f87ba(0x240)]>0x0&&await _0x4d8b9f(_0x4f63fc,async _0x2cc672=>{const _0x4a3f90=_0x3f87ba,_0x395762=await _0x28b982[_0x4a3f90(0x19b)]['listActivations'](_0x278874,_0x2cc672['id']);_0x37c2f7[_0x4a3f90(0x19a)](_0x2cc672['id'],_0x395762);});})())]),{emailToId:_0x245329,idToEmail:_0x1e5ec2}=_0x4c71b7,_0x57b17c=buildConnectionMaps(_0x13e51e);return{'rootFolderId':_0xb011e9,'folderPathToId':_0x4f2f0f,'folderIdToPath':_0x15c136,'segmentNameToId':_0x134025,'activationsBySegmentId':_0x37c2f7,'emailToIdMap':_0x245329,'idToEmailMap':_0x1e5ec2,'connectionNameToIdMap':_0x57b17c[_0x515f09(0x260)],'connectionIdToNameMap':_0x57b17c[_0x515f09(0x23d)],'connectionNameToTypeMap':_0x57b17c['nameToType']};}export function createPushYamlContextForBundle(_0x775851,_0x1f39ac,_0x50d649,_0x4812de,_0x1f911a,_0x4a4613,_0x1553c1,_0x513fbd){const {existingLocalSegmentNames:_0x49488e,localExpandedRuleToNames:_0x288611}=_0x4812de,_0x36af68=new Set(),_0x58cf5a=new Map(),_0x1bf316=new Map(),_0x455f8b=new Map(),_0x4cb359=createJumpTargetCache(),_0x5bbe82=new Map(),_0x5dd7cd=new Map(),_0xced0f5=new Set();let _0x7169be;const _0x8f545f=_0x230c6d=>{const _0x555160={'resolveSegment':async _0x491999=>{const _0x373ec9=a140_0xd9cf,_0x1b59de=_0x455f8b[_0x373ec9(0x248)](_0x491999);if(_0x1b59de!==undefined)return{'name':_0x1b59de,'isJourneyLocal':!![]};try{const _0x35064b=await fetchSegment(_0x775851,_0x1f39ac,_0x491999,_0x50d649);if(!_0x35064b)throw new Error('Segment\x20not\x20found');const _0x47c152=generateJourneyLocalName(_0x35064b[_0x373ec9(0x16c)]),_0x991dd0=_0x35064b[_0x373ec9(0x1cc)]===SEGMENT_KIND_JOURNEY&&_0x47c152!==undefined;let _0x48d590=_0x35064b[_0x373ec9(0x16c)],_0x4afac9;if(_0x991dd0&&_0x35064b[_0x373ec9(0x22d)]){const _0x46cc96=apiRuleToYaml(_0x35064b[_0x373ec9(0x22d)]);_0x5dd7cd[_0x373ec9(0x19a)](_0x491999,_0x46cc96);const _0x26a914=async _0xd6d7f2=>{const _0x2429bd=_0x373ec9,_0x30d964=collectSegmentRefsFromRule(_0xd6d7f2);for(const _0x2e87fc of _0x30d964){if(!_0x5dd7cd[_0x2429bd(0x202)](_0x2e87fc))try{const _0x5b416b=await fetchSegment(_0x775851,_0x1f39ac,_0x2e87fc,_0x50d649);if(_0x5b416b?.[_0x2429bd(0x22d)]){const _0x209c8a=apiRuleToYaml(_0x5b416b[_0x2429bd(0x22d)]);_0x5dd7cd[_0x2429bd(0x19a)](_0x2e87fc,_0x209c8a),await _0x26a914(_0x209c8a);}}catch(_0x3ca862){logger[_0x2429bd(0x16f)](_0x2429bd(0x198)+_0x2e87fc+':\x20'+_0x3ca862);}}};await _0x26a914(_0x46cc96);const _0x22f390=serializeExpandedRule(_0x46cc96,_0x5dd7cd),_0x22ae34=_0x288611[_0x373ec9(0x248)](_0x22f390);if(_0x22ae34&&_0x22ae34[_0x373ec9(0x240)]>0x0){const _0x46137a=_0x58cf5a[_0x373ec9(0x248)](_0x22f390)||0x0,_0x3ef76a=_0x22ae34[_0x46137a]||_0x22ae34[_0x22ae34[_0x373ec9(0x240)]-0x1];_0x58cf5a[_0x373ec9(0x19a)](_0x22f390,_0x46137a+0x1),_0x48d590=_0x3ef76a,_0x36af68[_0x373ec9(0x25f)](_0x48d590),_0x455f8b[_0x373ec9(0x19a)](_0x491999,_0x48d590);const _0x20f568=await resolveRuleSegmentRefs(_0x46cc96,async _0x41b643=>{const _0x5a32f0=_0x373ec9,_0x16043d=_0x455f8b[_0x5a32f0(0x248)](_0x41b643);if(_0x16043d)return _0x16043d;const _0x261d3e=await _0x7169be[_0x5a32f0(0x185)](_0x41b643);return _0x261d3e[_0x5a32f0(0x16c)];});_0x4afac9={'description':_0x35064b[_0x373ec9(0x1ff)],'rule':_0x20f568};}else{const _0x38ce8a=_0x5bbe82[_0x373ec9(0x248)](_0x22f390);if(_0x38ce8a)_0x48d590=_0x38ce8a,_0x455f8b[_0x373ec9(0x19a)](_0x491999,_0x48d590);else{if(_0x47c152){let _0xac5f07=_0x47c152,_0x12bba3=0x2;while(_0x36af68[_0x373ec9(0x202)](_0xac5f07)||_0x49488e[_0x373ec9(0x202)](_0xac5f07)){_0xac5f07=_0x47c152+'_'+_0x12bba3,_0x12bba3++;}_0x36af68['add'](_0xac5f07),_0x48d590=_0xac5f07;}_0x455f8b['set'](_0x491999,_0x48d590),_0x5bbe82['set'](_0x22f390,_0x48d590);const _0x3e4f87=await resolveRuleSegmentRefs(_0x46cc96,async _0x4c5234=>{const _0x2efccf=_0x373ec9,_0x4193ef=_0x455f8b[_0x2efccf(0x248)](_0x4c5234);if(_0x4193ef)return _0x4193ef;const _0x75cd09=await _0x7169be[_0x2efccf(0x185)](_0x4c5234);return _0x75cd09[_0x2efccf(0x16c)];});_0x4afac9={'description':_0x35064b[_0x373ec9(0x1ff)],'rule':_0x3e4f87};}}}return{'name':_0x48d590,'isJourneyLocal':_0x991dd0,'definition':_0x4afac9};}catch(_0x2ad3ab){return logger[_0x373ec9(0x16f)]('Failed\x20to\x20resolve\x20segment\x20'+_0x491999+':\x20'+_0x2ad3ab),{'name':_0x491999,'isJourneyLocal':![]};}},'resolveActivation':async _0x5d27b1=>{const _0x1adec1=a140_0xd9cf,_0x4ba6c9=_0x1bf316['get'](_0x5d27b1);if(_0x4ba6c9!==undefined)return{'name':_0x4ba6c9,'isJourneyLocal':!![]};try{let _0x4d91a4=_0x1553c1?.[_0x1adec1(0x248)](_0x5d27b1);!_0x4d91a4&&(_0x4d91a4=await _0x775851[_0x1adec1(0x17d)]['getActivation'](_0x230c6d,_0x5d27b1));const _0x5ad562=_0x4d91a4[_0x1adec1(0x203)]['activationParams'][_0x1adec1(0x16c)]||_0x5d27b1,_0x439610=sanitizeYamlKey(_0x5ad562)||'activation_'+_0x5d27b1,_0x2077fa=_0x439610;_0x1bf316[_0x1adec1(0x19a)](_0x5d27b1,_0x2077fa);const _0x4d9bbd=journeyActivationStepToYaml(_0x4d91a4,_0x1f911a,_0x4a4613);return{'name':_0x2077fa,'isJourneyLocal':!![],'definition':_0x4d9bbd};}catch(_0x3fd871){return logger[_0x1adec1(0x16f)](_0x1adec1(0x1e2)+_0x5d27b1+':\x20'+_0x3fd871),{'name':_0x5d27b1,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x320c40,_0x4569d8)=>resolveJumpTarget(_0x320c40,_0x4569d8,_0x4cb359,async _0x3fbf21=>{const _0xb3c926=a140_0xd9cf,_0x5ee93f=_0x513fbd?.[_0xb3c926(0x248)](_0x3fbf21);if(_0x5ee93f)return _0x5ee93f;return _0x775851['journey']['getJourney'](_0x3fbf21);})};return _0x7169be=_0x555160,_0x555160;},_0x3fa7fa=async _0x358099=>{const _0x54b2df=a140_0xd9cf,{collectSegmentIdsFromJourneyApi:_0x4aa0f2}=await import(_0x54b2df(0x21c)),{batchAsync:_0x41d46b}=await import(_0x54b2df(0x1a6)),_0x51a9c4=new Set();for(const _0x1282a3 of _0x358099){let _0x5bf42a=_0x513fbd?.[_0x54b2df(0x248)](_0x1282a3);!_0x5bf42a&&(_0x5bf42a=await _0x775851[_0x54b2df(0x17d)]['getJourney'](_0x1282a3));const _0x2902b3=_0x4aa0f2(_0x5bf42a);for(const _0x50d1c2 of _0x2902b3){_0x51a9c4[_0x54b2df(0x25f)](_0x50d1c2);}}let _0x5c7662=Array[_0x54b2df(0x175)](_0x51a9c4);while(_0x5c7662[_0x54b2df(0x240)]>0x0){const _0xbb0bb7=_0x5c7662[_0x54b2df(0x243)](_0x222e04=>!_0xced0f5[_0x54b2df(0x202)](_0x222e04));if(_0xbb0bb7['length']===0x0)break;const _0x4c6c60=await _0x41d46b(_0xbb0bb7,async _0x38e6bf=>{_0xced0f5['add'](_0x38e6bf);const _0x242790=await fetchSegment(_0x775851,_0x1f39ac,_0x38e6bf,_0x50d649);if(!_0x242790)return null;return{'segmentId':_0x38e6bf,'segment':_0x242790};},0xa),_0xdd10ab=new Set();for(const _0xca5f17 of _0x4c6c60){if(!_0xca5f17?.['segment']?.[_0x54b2df(0x22d)])continue;const _0x1d9d04=apiRuleToYaml(_0xca5f17[_0x54b2df(0x19b)][_0x54b2df(0x22d)]);_0x5dd7cd[_0x54b2df(0x19a)](_0xca5f17[_0x54b2df(0x18a)],_0x1d9d04);const _0x1a03b2=collectSegmentRefsFromRule(_0x1d9d04);for(const _0x3b6443 of _0x1a03b2){!_0xced0f5[_0x54b2df(0x202)](_0x3b6443)&&_0xdd10ab['add'](_0x3b6443);}}_0x5c7662=Array[_0x54b2df(0x175)](_0xdd10ab);}};return{'createYamlContext':_0x8f545f,'prefetchJourneySegments':_0x3fa7fa};}function a140_0x4c59(){const _0x264ab0=['activation_deleting','../../utils/async.js','results','createActivation','activationStepsById','createFolder','idToEmailMap','null','activation_creating','createdSegmentIds','embedded_segment_creating','withProgress','JOURNEY_UPDATE_ERROR','hasChanges','milestone','logSuccess','DecisionPoint','getSegmentEntity\x20also\x20failed\x20for\x20','SEGMENT_SYNTAX_ERROR','replace','notification','2123484svIAHE','segmentByFolderAndName','Entry\x20criteria:\x20','logInfo','SEGMENT_NOT_FOUND','action','folderId','stringify','conditions','8020trBWSt','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','existingSegment','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Activation','onProgress','journey_updating','parentFolder','updateActivation','kind','embeddedSegmentNameToId','Deleted\x20activation\x20\x27','trim','connection','\x27\x20milestone','Activation\x20not\x20found:\x20','versionNumber','stages','localName','absolutePath','journeyId','listActivations','hex','journeyBundleName','\x20(referenced\x20in\x20journey\x20','activationsBySegmentId','connector_config','embedded_segment_created','message','includes','stage\x20\x27','Failed\x20to\x20resolve\x20activation\x20','diff','Deleted\x20segment\x20\x27','createdSegmentId','segment_updating','Embedded\x20segment\x20\x27','dirname','waitStepUnit','existingActivation','folderPath','journeys','SEGMENT_UPDATE_ERROR','\x27\x20by\x20rule\x20content','folderPathToId','170820HHmiBX','createJourneySegment','yamlConfig','WaitStep','segment_creating','waitStepType','journeyActivationNameToId','journeyById','join','\x0a\x20\x20','178UnyAEd','embedded_activation_created','some','parse','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','description','Stage\x20\x27','branches','has','attributes','values','journey_updated','user','deleted','behavior','steps','startsWith','getJourney','Updating\x20activation\x20\x27','journey_creating','Delete\x20the\x20push\x20recovery\x20file\x20(','valid','\x27\x20decision\x20point\x20branch\x20\x27','journeyBundlesByFolderAndName','Creating\x20segment\x20\x27','\x20activation\x20\x27','.$1.push-recovery.json','type','reduce','journey_entry_criteria_','create','Condition','sha1','activations','./journey-yaml.js','data','index','activation_deleted','journey_created','folder_created','Created\x20segment\x20\x27','updated','entry_criteria','__pending_','\x27...','Deleting\x20activation\x20\x27','Matched\x20server\x20segment\x20\x27','activationContext','5aotSSm','slice','and\x20the\x20server\x20segment,\x20then\x20retry.','rule','activationActions','effectiveFolderId',').\x20','deleteActivation','NOT_FOUND','isNew','schedule','Creating\x20folder\x20\x27','Segment\x20not\x20found:\x20','all','folder','ACTIVATION_SYNTAX_ERROR','segment_updated','columns','existingJourney','idToName','yamlActivation','\x20journey\x20from\x20file:\x20','length','Failed\x20to\x20','320TafQjn','filter','INTERNAL','\x27\x20wait\x20condition','parentId','folder_creating','get','logWarning','map','Updated\x20segment\x20\x27','entryCriteria','validatedRequest','conditionTimeoutDuration','Fetching\x20','match','keys','sort','__pending_act_','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','existingSegments','parseDocument','exitCriterias','Created\x20activation\x20\x27','Updated\x20activation\x20\x27','./child-segment-yaml.js','\x27\x20to\x20local\x20\x27','relative','connectionIdToNameMap','flatMap','add','nameToId','errors','split','created','segment_deleting','push','utf-8','uniqueSegmentName','progress','updateSegmentById','run_after_journey_refresh','conditionSegmentId','deps','name','relationships','delete','debug','size','\x27\x20for\x20','segmentNameToId','find','journeyStages','from','Updating\x20segment\x20\x27','segment_deleted','logDeleted','rootFolderId','5006qfgCFb','entries','goal','journey','skipSegments','12anOVjJ','toString','689670MoluFA','unchanged','with','journeyActivationStepId','resolveSegment','state','draft','Created\x20folder\x20\x27','createSegment','segmentId','Created\x20journey\x20\x27','2464ZfEEac','ACTIVATION_UPDATE_ERROR','buildUserMaps','journeyBundleId','journeyName','segmentFolderId','entry','Journey\x20\x27','segments','waitStep','1490956INCtcR','object','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20from\x20file:\x20','set','segment','toLowerCase','\x20segment\x20from\x20file:\x20','activation_template_id','update','uniqueServerName','conditionTimeoutUnit','embedded_activation_creating','1762439jvgEVP','verbose'];a140_0x4c59=function(){return _0x264ab0;};return a140_0x4c59();}export async function executePushSegments(_0x335496,_0x3fa7c5,_0x4c9a22,_0x26b825,_0x13800b){const _0x3bda14=a140_0x591ef5,{segmentDefToCreateRequest:_0x1e0ceb,segmentDefToUpdateRequest:_0x386bad}=await import(_0x3bda14(0x25a)),_0x1d49bb=_0x4c9a22[_0x3bda14(0x1ef)],_0x560b64=0x5,_0x188fbe=async _0x3e0d62=>{const _0xb02276=_0x3bda14,_0x431250=_0x3e0d62[_0xb02276(0x1eb)]?_0x1d49bb[_0xb02276(0x248)](_0x3e0d62[_0xb02276(0x1eb)]):undefined;let _0x2571cc;const _0x128f49={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x312df9=_0x3e0d62[_0xb02276(0x1f2)];if(_0x3e0d62[_0xb02276(0x1f2)]['rule']){const _0x127c46=createSegmentIdResolver(_0x4c9a22['segmentNameToId'],_0x3e0d62['yamlConfig'][_0xb02276(0x16c)]),_0x2f9ae7=await resolveRuleSegmentIds(_0x3e0d62[_0xb02276(0x1f2)][_0xb02276(0x22d)],_0x127c46);_0x312df9={..._0x3e0d62['yamlConfig'],'rule':_0x2f9ae7};}try{if(_0x3e0d62[_0xb02276(0x233)]){_0x13800b[_0xb02276(0x1c8)]?.({'type':_0xb02276(0x1f4),'name':_0x3e0d62['yamlConfig'][_0xb02276(0x16c)]});const _0x1aeb54=_0x1e0ceb(_0x312df9,_0x431250),_0x81a794=await _0x13800b['withProgress'](_0xb02276(0x212)+_0x3e0d62['yamlConfig']['name']+_0xb02276(0x226),()=>_0x335496[_0xb02276(0x19b)][_0xb02276(0x189)](_0x26b825[_0xb02276(0x246)],_0x1aeb54));_0x2571cc=_0x81a794[_0xb02276(0x21d)]['id'],_0x4c9a22[_0xb02276(0x172)][_0xb02276(0x19a)](_0x3e0d62['yamlConfig']['name'],_0x2571cc),_0x128f49[_0xb02276(0x1e5)]={'name':_0x3e0d62[_0xb02276(0x1f2)][_0xb02276(0x16c)],'id':_0x2571cc},_0x13800b[_0xb02276(0x1c8)]?.({'type':'segment_created','name':_0x3e0d62[_0xb02276(0x1f2)][_0xb02276(0x16c)],'segmentId':_0x2571cc}),_0x13800b['logSuccess']?.(_0xb02276(0x222)+_0x3e0d62[_0xb02276(0x1f2)]['name']+'\x27'),_0x128f49['created']=0x1;}else{if(_0x3e0d62[_0xb02276(0x1b2)]){_0x13800b[_0xb02276(0x1c8)]?.({'type':_0xb02276(0x1e6),'name':_0x3e0d62[_0xb02276(0x1f2)]['name']});const _0x536c14=_0x386bad(_0x312df9);_0x431250!==_0x3e0d62[_0xb02276(0x1c5)]?.[_0xb02276(0x191)]&&(_0x536c14[_0xb02276(0x191)]=_0x431250?parseInt(_0x431250,0xa):undefined),await _0x13800b['withProgress'](_0xb02276(0x176)+_0x3e0d62['yamlConfig'][_0xb02276(0x16c)]+_0xb02276(0x226),()=>_0x335496[_0xb02276(0x19b)]['updateSegmentById'](_0x26b825[_0xb02276(0x246)],_0x3e0d62[_0xb02276(0x1c5)]['id'],_0x536c14)),_0x2571cc=_0x3e0d62['existingSegment']['id'],_0x13800b[_0xb02276(0x1c8)]?.({'type':_0xb02276(0x23a),'name':_0x3e0d62[_0xb02276(0x1f2)]['name']}),_0x13800b['logSuccess']?.(_0xb02276(0x24b)+_0x3e0d62[_0xb02276(0x1f2)][_0xb02276(0x16c)]+'\x27'),_0x128f49[_0xb02276(0x223)]=0x1;}else _0x2571cc=_0x3e0d62['existingSegment']['id'];}}catch(_0x5574c2){const _0x2db067=isHttp400Error(_0x5574c2),_0x40cadb=_0x2db067?ErrorCode[_0xb02276(0x1b7)]:ErrorCode[_0xb02276(0x1ed)],_0xff5cb=getErrorMessage(_0x5574c2);throw new SDKError(_0x40cadb,_0xb02276(0x241)+(_0x3e0d62[_0xb02276(0x233)]?_0xb02276(0x218):_0xb02276(0x19f))+_0xb02276(0x19d)+_0x3e0d62['absolutePath']+_0xb02276(0x1f9)+_0xff5cb,_0x5574c2);}try{const _0x5b9fca=await syncActivationsForSegment(_0x335496,_0x26b825[_0xb02276(0x246)],_0x2571cc,_0x3e0d62[_0xb02276(0x1f2)][_0xb02276(0x16c)],_0x3e0d62[_0xb02276(0x22e)],_0x13800b,_0x3e0d62[_0xb02276(0x1d6)]);_0x128f49[_0xb02276(0x21b)]=_0x5b9fca;}catch(_0x4823c3){if(_0x4823c3 instanceof SDKError)throw _0x4823c3;throw new SDKError(ErrorCode[_0xb02276(0x18d)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x3e0d62[_0xb02276(0x1f2)]['name']+_0xb02276(0x199)+_0x3e0d62[_0xb02276(0x1d6)]+_0xb02276(0x1f9)+getErrorMessage(_0x4823c3),_0x4823c3);}return _0x128f49;},_0x2465e9=await batchAsync(_0x3fa7c5,_0x188fbe,_0x560b64),_0x1a50e2={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5ba436 of _0x2465e9){_0x1a50e2[_0x3bda14(0x263)]+=_0x5ba436[_0x3bda14(0x263)],_0x1a50e2[_0x3bda14(0x223)]+=_0x5ba436[_0x3bda14(0x223)],_0x5ba436['createdSegmentId']&&_0x1a50e2[_0x3bda14(0x1ae)]['set'](_0x5ba436[_0x3bda14(0x1e5)]['name'],_0x5ba436[_0x3bda14(0x1e5)]['id']),_0x1a50e2['activations'][_0x3bda14(0x263)]+=_0x5ba436['activations'][_0x3bda14(0x263)],_0x1a50e2[_0x3bda14(0x21b)][_0x3bda14(0x223)]+=_0x5ba436[_0x3bda14(0x21b)][_0x3bda14(0x223)],_0x1a50e2[_0x3bda14(0x21b)][_0x3bda14(0x207)]+=_0x5ba436[_0x3bda14(0x21b)]['deleted'];}return _0x1a50e2;}async function syncActivationsForSegment(_0x117af9,_0x5e1ed9,_0x5b308f,_0x143392,_0x10fbcd,_0x5588d0,_0x129313){const _0x50fe5f=a140_0x591ef5,_0x228ec1={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x52a3bb of _0x10fbcd){try{if(_0x52a3bb['type']===_0x50fe5f(0x218)&&_0x52a3bb[_0x50fe5f(0x24d)])_0x5588d0[_0x50fe5f(0x1c8)]?.({'type':_0x50fe5f(0x1ad),'segmentName':_0x143392,'activationName':_0x52a3bb['name']}),await _0x5588d0[_0x50fe5f(0x1b0)]('Creating\x20activation\x20\x27'+_0x52a3bb[_0x50fe5f(0x16c)]+'\x27...',()=>_0x117af9['segment'][_0x50fe5f(0x1a8)](_0x5e1ed9,_0x5b308f,_0x52a3bb[_0x50fe5f(0x24d)])),_0x5588d0[_0x50fe5f(0x1c8)]?.({'type':'activation_created','segmentName':_0x143392,'activationName':_0x52a3bb[_0x50fe5f(0x16c)]}),_0x5588d0['logSuccess']?.(_0x50fe5f(0x258)+_0x52a3bb[_0x50fe5f(0x16c)]+'\x27'),_0x228ec1[_0x50fe5f(0x263)]++;else{if(_0x52a3bb[_0x50fe5f(0x215)]===_0x50fe5f(0x19f)&&_0x52a3bb['validatedRequest']&&_0x52a3bb[_0x50fe5f(0x1ea)])_0x5588d0[_0x50fe5f(0x1c8)]?.({'type':'activation_updating','segmentName':_0x143392,'activationName':_0x52a3bb[_0x50fe5f(0x16c)]}),await _0x5588d0[_0x50fe5f(0x1b0)](_0x50fe5f(0x20c)+_0x52a3bb[_0x50fe5f(0x16c)]+_0x50fe5f(0x226),()=>_0x117af9[_0x50fe5f(0x19b)][_0x50fe5f(0x1cb)](_0x5e1ed9,_0x5b308f,_0x52a3bb[_0x50fe5f(0x1ea)]['id'],_0x52a3bb[_0x50fe5f(0x24d)])),_0x5588d0['onProgress']?.({'type':'activation_updated','segmentName':_0x143392,'activationName':_0x52a3bb[_0x50fe5f(0x16c)]}),_0x5588d0[_0x50fe5f(0x1b4)]?.(_0x50fe5f(0x259)+_0x52a3bb[_0x50fe5f(0x16c)]+'\x27'),_0x228ec1['updated']++;else _0x52a3bb[_0x50fe5f(0x215)]===_0x50fe5f(0x16e)&&_0x52a3bb[_0x50fe5f(0x1ea)]&&(_0x5588d0[_0x50fe5f(0x1c8)]?.({'type':_0x50fe5f(0x1a5),'segmentName':_0x143392,'activationName':_0x52a3bb[_0x50fe5f(0x16c)]}),await _0x5588d0[_0x50fe5f(0x1b0)](_0x50fe5f(0x227)+_0x52a3bb[_0x50fe5f(0x16c)]+_0x50fe5f(0x226),()=>_0x117af9['segment'][_0x50fe5f(0x231)](_0x5e1ed9,_0x5b308f,_0x52a3bb[_0x50fe5f(0x1ea)]['id'])),_0x5588d0[_0x50fe5f(0x1c8)]?.({'type':_0x50fe5f(0x21f),'segmentName':_0x143392,'activationName':_0x52a3bb[_0x50fe5f(0x16c)]}),_0x5588d0[_0x50fe5f(0x178)]?.(_0x50fe5f(0x1ce)+_0x52a3bb[_0x50fe5f(0x16c)]+'\x27'),_0x228ec1[_0x50fe5f(0x207)]++);}}catch(_0x265f0d){const _0x46ac64=isHttp400Error(_0x265f0d),_0x1f1ab9=_0x46ac64?ErrorCode[_0x50fe5f(0x239)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x587193=getErrorMessage(_0x265f0d);throw new SDKError(_0x1f1ab9,_0x50fe5f(0x241)+_0x52a3bb[_0x50fe5f(0x215)]+_0x50fe5f(0x213)+_0x52a3bb[_0x50fe5f(0x16c)]+'\x27\x20from\x20file:\x20'+_0x129313+_0x50fe5f(0x1f9)+_0x587193,_0x265f0d);}}return _0x228ec1;}export async function executePushFolders(_0x3a4c6f,_0x4309e2,_0x188cbd,_0x1a4631,_0xd1f85f){const _0x59d439=a140_0x591ef5,_0xc57e5f=new Map(_0x188cbd),_0xca42bc=sortFoldersByDepth(_0x4309e2);for(const _0x472dfa of _0xca42bc){const _0x391198=_0x472dfa['split']('/'),_0x47fd53=_0x391198[_0x391198['length']-0x1],_0x560c6d=_0x391198['slice'](0x0,-0x1)[_0x59d439(0x1f8)]('/'),_0x20cad3=_0xc57e5f[_0x59d439(0x248)](_0x560c6d);_0xd1f85f[_0x59d439(0x1c8)]?.({'type':_0x59d439(0x247),'folder':_0x472dfa});const _0x1e96dc={'name':_0x47fd53,'parentFolderId':_0x20cad3},_0x2abb7a=await _0xd1f85f[_0x59d439(0x1b0)](_0x59d439(0x235)+_0x472dfa+'\x27...',()=>_0x3a4c6f[_0x59d439(0x19b)][_0x59d439(0x1aa)](_0x1a4631[_0x59d439(0x246)],_0x1e96dc));_0xc57e5f['set'](_0x472dfa,_0x2abb7a[_0x59d439(0x21d)]['id']),_0xd1f85f['onProgress']?.({'type':_0x59d439(0x221),'folder':_0x472dfa,'folderId':_0x2abb7a[_0x59d439(0x21d)]['id']}),_0xd1f85f[_0x59d439(0x1bd)]?.(_0x59d439(0x188)+_0x472dfa+'\x27');}return _0xc57e5f;}export async function executePushSegmentDeletions(_0x592c5f,_0x372a6d,_0x1e2c02){const _0x5dae0f=a140_0x591ef5;if(_0x372a6d[_0x5dae0f(0x240)]===0x0)return 0x0;const {batchAsync:_0xea46b4}=await import(_0x5dae0f(0x1a6)),_0x327d2e=0x5,_0x57e136=await _0xea46b4(_0x372a6d,async _0x1301f6=>{const _0x453367=_0x5dae0f;return _0x1e2c02[_0x453367(0x1c8)]?.({'type':_0x453367(0x264),'name':_0x1301f6[_0x453367(0x16c)]}),await _0x592c5f[_0x453367(0x19b)]['deleteSegment'](_0x1301f6['id']),_0x1e2c02[_0x453367(0x1c8)]?.({'type':_0x453367(0x177),'name':_0x1301f6[_0x453367(0x16c)]}),_0x1e2c02[_0x453367(0x178)]?.(_0x453367(0x1e4)+_0x1301f6[_0x453367(0x16c)]+'\x27'),0x1;},_0x327d2e);return _0x57e136[_0x5dae0f(0x216)]((_0x5b3a50,_0x44f0bf)=>_0x5b3a50+_0x44f0bf,0x0);}export async function executePushJourneys(_0x3b83e9,_0x1f5084,_0x1d2612,_0xc14186,_0x503cd6){const _0x542046=a140_0x591ef5,{journeyDefToRequest:_0x265502}=await import(_0x542046(0x21c)),{activationDefToCreateRequest:_0x248b89,yamlRuleToApi:_0x40c7ac,validateSegmentRule:_0x42a007}=await import(_0x542046(0x25a)),_0x6873d7={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x47a36d=new Map(_0x1d2612[_0x542046(0x172)]),_0x20bc2f=0x5;for(let _0x3a8494=0x0;_0x3a8494<_0x1f5084[_0x542046(0x240)];_0x3a8494+=_0x20bc2f){const _0x10247f=_0x1f5084[_0x542046(0x22b)](_0x3a8494,_0x3a8494+_0x20bc2f),_0x138148=await Promise[_0x542046(0x237)](_0x10247f['map'](async _0x458878=>{const _0x114059=_0x542046;if(!_0x458878[_0x114059(0x233)]&&!_0x458878['hasChanges'])return{'action':_0x114059(0x182),'name':_0x458878[_0x114059(0x1f2)][_0x114059(0x16c)],'journeyId':_0x458878[_0x114059(0x23c)]?.['id']};const _0x688eac=_0x458878[_0x114059(0x1eb)]?_0x1d2612[_0x114059(0x1ef)][_0x114059(0x248)](_0x458878[_0x114059(0x1eb)]):undefined;_0x503cd6[_0x114059(0x1c8)]?.({'type':_0x458878[_0x114059(0x233)]?_0x114059(0x20d):_0x114059(0x1c9),'name':_0x458878[_0x114059(0x1f2)][_0x114059(0x16c)]});try{const _0x42888c=await executeSingleJourneyPush(_0x3b83e9,_0x458878,{..._0x1d2612,'segmentNameToId':_0x47a36d},{'parentId':_0xc14186[_0x114059(0x246)],'rootFolderId':_0xc14186[_0x114059(0x179)],'folderId':_0x688eac,'verbose':_0xc14186[_0x114059(0x1a4)]},_0x503cd6,{'journeyDefToRequest':_0x265502,'activationDefToCreateRequest':_0x248b89,'yamlRuleToApi':_0x40c7ac,'validateSegmentRule':_0x42a007});for(const [_0xdc8653,_0x4d8f9c]of _0x42888c[_0x114059(0x1cd)]){_0x47a36d[_0x114059(0x19a)](_0xdc8653,_0x4d8f9c),_0x6873d7[_0x114059(0x1cd)][_0x114059(0x19a)](_0xdc8653,_0x4d8f9c);}if(_0x42888c[_0x114059(0x1bf)]==='created')_0x503cd6['onProgress']?.({'type':_0x114059(0x220),'name':_0x458878[_0x114059(0x1f2)]['name'],'journeyId':_0x42888c[_0x114059(0x1d7)]}),_0x503cd6[_0x114059(0x1b4)]?.(_0x114059(0x18b)+_0x458878[_0x114059(0x1f2)]['name']+'\x27'),_0x6873d7[_0x114059(0x263)]++;else _0x42888c[_0x114059(0x1bf)]==='updated'&&(_0x503cd6[_0x114059(0x1c8)]?.({'type':_0x114059(0x205),'name':_0x458878[_0x114059(0x1f2)][_0x114059(0x16c)]}),_0x503cd6[_0x114059(0x1b4)]?.('Updated\x20journey\x20\x27'+_0x458878['yamlConfig'][_0x114059(0x16c)]+'\x27'),_0x6873d7[_0x114059(0x223)]++);return{'action':_0x42888c[_0x114059(0x1bf)],'name':_0x458878[_0x114059(0x1f2)][_0x114059(0x16c)],'journeyId':_0x42888c['journeyId']};}catch(_0x5358de){const _0x504215=isHttp400Error(_0x5358de),_0x55474d=_0x504215?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x114059(0x1b1)],_0x9f0a23=getErrorMessage(_0x5358de);throw new SDKError(_0x55474d,_0x114059(0x241)+(_0x458878[_0x114059(0x233)]?_0x114059(0x218):_0x114059(0x19f))+_0x114059(0x23f)+_0x458878[_0x114059(0x1d6)]+'\x0a\x20\x20'+_0x9f0a23,_0x5358de);}}));_0x6873d7[_0x542046(0x1a7)][_0x542046(0x265)](..._0x138148);}return _0x6873d7;}async function matchExistingJourneySegments(_0x73f7b2,_0x29cca3,_0x33740f,_0x1e6dd4,_0x2dbcc6){const _0x5a9145=a140_0x591ef5;if(!_0x29cca3['existingJourney']||!_0x29cca3[_0x5a9145(0x1f2)][_0x5a9145(0x194)])return;const _0x4b3248=new Map(),_0x42116f=new Set();for(const _0x4eff49 of Object[_0x5a9145(0x251)](_0x29cca3[_0x5a9145(0x1f2)][_0x5a9145(0x194)])){const _0x757797=generateDeterministicJourneySegmentName(_0x29cca3[_0x5a9145(0x1f2)][_0x5a9145(0x16c)],_0x4eff49);_0x4b3248['set'](_0x757797,_0x4eff49),_0x42116f['add'](_0x4eff49);}const _0x50020b=[],_0x5394cb=collectSegmentIdsFromJourneyApi(_0x29cca3['existingJourney']);for(const _0x2387cd of _0x5394cb){const _0x3516e4=await fetchSegment(_0x73f7b2,_0x33740f,_0x2387cd,_0x1e6dd4);if(!_0x3516e4?.[_0x5a9145(0x16c)])continue;const _0x28ad29=_0x4b3248[_0x5a9145(0x248)](_0x3516e4[_0x5a9145(0x16c)]);_0x28ad29?(_0x2dbcc6[_0x5a9145(0x19a)](_0x28ad29,_0x2387cd),_0x42116f[_0x5a9145(0x16e)](_0x28ad29)):_0x50020b['push']({'id':_0x2387cd,'seg':_0x3516e4});}if(_0x42116f[_0x5a9145(0x170)]>0x0&&_0x50020b[_0x5a9145(0x240)]>0x0){const {localExpandedRuleToNames:_0x59e5c5}=buildLocalExpandedRuleMappings(_0x29cca3['yamlConfig']),_0x427ac8=new Map();for(const {id:_0x39a332,seg:_0x2c5b20}of _0x50020b){if(_0x2c5b20['rule']){const _0x162fe1=apiRuleToYaml(_0x2c5b20['rule']);_0x427ac8[_0x5a9145(0x19a)](_0x39a332,_0x162fe1);}}for(const {id:_0x16a46b,seg:_0x2cdf81}of _0x50020b){if(!_0x2cdf81[_0x5a9145(0x22d)])continue;const _0x2105ae=_0x427ac8[_0x5a9145(0x248)](_0x16a46b);if(!_0x2105ae)continue;const _0x46a8b4=serializeExpandedRule(_0x2105ae,_0x427ac8),_0x2f2526=_0x59e5c5[_0x5a9145(0x248)](_0x46a8b4);if(_0x2f2526){const _0x1487aa=_0x2f2526[_0x5a9145(0x173)](_0xf89c76=>_0x42116f[_0x5a9145(0x202)](_0xf89c76));_0x1487aa&&(_0x2dbcc6['set'](_0x1487aa,_0x16a46b),_0x42116f[_0x5a9145(0x16e)](_0x1487aa),logger[_0x5a9145(0x16f)](_0x5a9145(0x228)+_0x2cdf81['name']+_0x5a9145(0x25b)+_0x1487aa+_0x5a9145(0x1ee)));}}}}async function executeSingleJourneyPush(_0x494afc,_0x126f39,_0xb09cf8,_0x3c3039,_0x186b23,_0x1d1843){const _0x44d522=a140_0x591ef5,{journeyDefToRequest:_0x425e32,activationDefToCreateRequest:_0x23ddf9,yamlRuleToApi:_0x1969f6,validateSegmentRule:_0x47497f}=_0x1d1843,_0x4830d7=new Map(),_0x2fce38=new Map();recoverSegmentIdsFromPushRecovery(_0x126f39,_0x4830d7,_0xb09cf8[_0x44d522(0x172)]);const _0x277a0a=new Map(),_0x2ce0b9=new Map(),_0x52d1fd=new Map();let _0x580868;const _0x51fbca=async()=>{const _0x30c4e9=_0x44d522;if(_0x580868)return;_0x580868=new Map();if(!_0x126f39[_0x30c4e9(0x23c)])return;const _0x320fcd=await _0x494afc['journey'][_0x30c4e9(0x1d8)](_0x126f39['existingJourney']['id']);for(const _0x1d8d61 of _0x320fcd){const _0x55b0f7=journeyActivationStepToYaml(_0x1d8d61,_0xb09cf8[_0x30c4e9(0x1ab)],_0xb09cf8[_0x30c4e9(0x25d)]),_0xd10fdf=activationSignature(_0x55b0f7);!_0x580868['has'](_0xd10fdf)&&_0x580868['set'](_0xd10fdf,_0x1d8d61['id']),_0x55b0f7[_0x30c4e9(0x16c)]&&_0x2fce38[_0x30c4e9(0x19a)](_0x55b0f7[_0x30c4e9(0x16c)],_0x1d8d61['id']);}};await matchExistingJourneySegments(_0x494afc,_0x126f39,_0x3c3039[_0x44d522(0x246)],_0xb09cf8[_0x44d522(0x255)],_0xb09cf8[_0x44d522(0x172)]);const _0x544bea={'resolveSegmentId':async _0x47fe64=>{const _0x504778=_0x44d522,_0x3dda3d=_0xb09cf8['segmentNameToId'][_0x504778(0x248)](_0x47fe64);if(!_0x3dda3d)throw new SDKError(ErrorCode[_0x504778(0x1be)],'Segment\x20not\x20found:\x20'+_0x47fe64+_0x504778(0x1db)+_0x126f39[_0x504778(0x1f2)][_0x504778(0x16c)]+')');return _0x3dda3d;},'resolveEmbeddedSegmentId':async(_0x504768,_0x599b53)=>{const _0x185720=_0x44d522,_0x1029c2=_0xb09cf8[_0x185720(0x172)]['get'](_0x504768);if(_0x1029c2)return _0x1029c2;const _0x7120a8=_0xb09cf8[_0x185720(0x255)][_0x185720(0x173)](_0x5cd1f1=>_0x5cd1f1[_0x185720(0x16c)]===_0x504768);if(_0x7120a8)return _0xb09cf8[_0x185720(0x172)][_0x185720(0x19a)](_0x504768,_0x7120a8['id']),_0x7120a8['id'];if(_0x126f39[_0x185720(0x233)]){const {stageName:_0x79424c,criteriaName:_0x112bfc}=findSegmentCriteriaLocation(_0x126f39[_0x185720(0x1f2)],_0x504768);return _0x47497f(_0x504768,_0x599b53[_0x185720(0x22d)]),_0x2ce0b9[_0x185720(0x19a)](_0x504768,{'definition':_0x599b53,'stageName':_0x79424c,'criteriaName':_0x112bfc}),createPendingSegmentId(_0x504768);}const _0x252333=_0x126f39[_0x185720(0x23c)]?.['id'];if(!_0x252333)throw new SDKError(ErrorCode[_0x185720(0x244)],_0x185720(0x254));const _0x58cd89=_0x277a0a[_0x185720(0x248)](_0x504768);if(_0x58cd89)return _0x58cd89;const _0x2b577b=((async()=>{const _0x4e5dce=_0x185720;_0x47497f(_0x504768,_0x599b53['rule']);const _0x36ce36=generateDeterministicJourneySegmentName(_0x126f39['yamlConfig']['name'],_0x504768),_0x322867=_0xb09cf8[_0x4e5dce(0x255)][_0x4e5dce(0x173)](_0x5d510c=>_0x5d510c[_0x4e5dce(0x16c)]===_0x36ce36),_0x3ea9b6=createSegmentIdResolver(_0xb09cf8[_0x4e5dce(0x172)],_0x504768),_0x4d75ae=await resolveRuleSegmentIds(_0x599b53[_0x4e5dce(0x22d)],_0x3ea9b6);let _0x1dd2a2;return _0x322867?(await _0x494afc[_0x4e5dce(0x19b)][_0x4e5dce(0x269)](_0x3c3039[_0x4e5dce(0x246)],_0x322867['id'],{'description':_0x599b53[_0x4e5dce(0x1ff)]||_0x4e5dce(0x1bc)+_0x504768,'rule':_0x1969f6(_0x4d75ae,!![]),'countPopulation':!![]}),_0x1dd2a2=_0x322867['id'],saveSegmentToPushRecovery(_0x126f39[_0x4e5dce(0x1d6)],_0x126f39[_0x4e5dce(0x1f2)][_0x4e5dce(0x16c)],_0x504768,{'segmentId':_0x1dd2a2,'uniqueServerName':_0x36ce36,'createdAt':new Date()['toISOString']()})):_0x1dd2a2=await createOrRecoverEmbeddedSegment(_0x494afc,_0x126f39,{'localName':_0x504768,'uniqueSegmentName':_0x36ce36,'description':_0x599b53[_0x4e5dce(0x1ff)]||_0x4e5dce(0x1bc)+_0x504768,'journeyId':_0x252333,'resolvedRule':_0x4d75ae,'parentId':_0x3c3039['parentId'],'folderId':_0x3c3039['rootFolderId']||''},_0x1969f6),_0xb09cf8[_0x4e5dce(0x172)][_0x4e5dce(0x19a)](_0x504768,_0x1dd2a2),_0x4830d7[_0x4e5dce(0x19a)](_0x504768,_0x1dd2a2),_0x1dd2a2;})());_0x277a0a[_0x185720(0x19a)](_0x504768,_0x2b577b);try{return await _0x2b577b;}finally{_0x277a0a[_0x185720(0x16e)](_0x504768);}},'resolveActivationId':async _0x3dc98d=>{const _0x51a216=_0x44d522,_0x4b742a=_0x2fce38['get'](_0x3dc98d);if(_0x4b742a)return _0x4b742a;if(_0x126f39[_0x51a216(0x23c)]){await _0x51fbca();const _0x39a70c=_0x2fce38['get'](_0x3dc98d);if(_0x39a70c)return _0x39a70c;}throw new SDKError(ErrorCode[_0x51a216(0x232)],_0x51a216(0x1d2)+_0x3dc98d+_0x51a216(0x1db)+_0x126f39[_0x51a216(0x1f2)][_0x51a216(0x16c)]+_0x51a216(0x230)+_0x51a216(0x1c6));},'resolveEmbeddedActivationId':async(_0x2fffa4,_0x2ab9e3)=>{const _0x26df53=_0x44d522,_0x56d5f0=_0x2fce38[_0x26df53(0x248)](_0x2fffa4);if(_0x56d5f0)return _0x56d5f0;if(_0x126f39[_0x26df53(0x233)])return _0x52d1fd[_0x26df53(0x19a)](_0x2fffa4,_0x2ab9e3),createPendingActivationId(_0x2fffa4);if(_0x126f39[_0x26df53(0x23c)]){await _0x51fbca();const _0x388fc3=_0x2fce38[_0x26df53(0x248)](_0x2ab9e3[_0x26df53(0x16c)]);if(_0x388fc3)return _0x2fce38[_0x26df53(0x19a)](_0x2fffa4,_0x388fc3),_0x388fc3;const _0x595c0f=activationSignature(_0x2ab9e3),_0x13d2f0=_0x580868?.[_0x26df53(0x248)](_0x595c0f);if(_0x13d2f0)return _0x2fce38[_0x26df53(0x19a)](_0x2fffa4,_0x13d2f0),_0x13d2f0;const _0x3e10c4=await _0x23ddf9(_0x2ab9e3,_0xb09cf8[_0x26df53(0x229)]),_0x428d86={..._0x3e10c4,..._0x2ab9e3['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x2ab9e3['run_after_journey_refresh']}},_0x51765c=await _0x494afc[_0x26df53(0x17d)][_0x26df53(0x1a8)](_0x126f39[_0x26df53(0x23c)]['id'],_0x428d86);return _0x2fce38[_0x26df53(0x19a)](_0x2fffa4,_0x51765c['id']),_0x51765c['id'];}throw new SDKError(ErrorCode[_0x26df53(0x244)],_0x26df53(0x1fe));},'resolveJourneyId':async _0x1819ae=>{const _0x622362=_0x44d522;try{return await _0x494afc[_0x622362(0x17d)]['resolveJourneyId'](_0x3c3039[_0x622362(0x246)],_0x1819ae);}catch(_0x424123){throw new SDKError(ErrorCode[_0x622362(0x232)],_0x622362(0x193)+_0x1819ae+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x126f39[_0x622362(0x1f2)]['name']+'\x27)',_0x424123);}},'resolveStageId':async(_0x4da21b,_0x1b18ea)=>{const _0x484a1e=_0x44d522,_0x30e5b8=await _0x494afc[_0x484a1e(0x17d)][_0x484a1e(0x20b)](_0x4da21b),_0x357e1d=_0x30e5b8[_0x484a1e(0x203)][_0x484a1e(0x174)][_0x484a1e(0x173)](_0x466102=>_0x466102[_0x484a1e(0x16c)][_0x484a1e(0x19c)]()===_0x1b18ea[_0x484a1e(0x19c)]());if(!_0x357e1d?.['id'])throw new SDKError(ErrorCode[_0x484a1e(0x232)],_0x484a1e(0x200)+_0x1b18ea+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x30e5b8[_0x484a1e(0x203)][_0x484a1e(0x1da)]||_0x30e5b8[_0x484a1e(0x203)]['name'])+'\x27');return _0x357e1d['id'];}},_0x1ceeed=await _0x425e32(_0x126f39[_0x44d522(0x1f2)],_0x3c3039[_0x44d522(0x246)],_0x544bea),_0x3f7c50=_0x3c3039['folderId']||_0x3c3039['rootFolderId'];_0x3f7c50&&(_0x1ceeed[_0x44d522(0x16d)]={'parentFolder':{'data':{'id':_0x3f7c50,'type':_0x44d522(0x238)}}});if(_0x126f39[_0x44d522(0x233)]){if(_0x2ce0b9['size']>0x0||_0x52d1fd[_0x44d522(0x170)]>0x0)return await executeThreeStepJourneyCreate(_0x494afc,_0x126f39,_0x1ceeed,{'pendingEmbeddedSegments':_0x2ce0b9,'pendingEmbeddedActivations':_0x52d1fd,'embeddedSegmentNameToId':_0x4830d7,'journeyActivationNameToId':_0x2fce38},{..._0x3c3039,'effectiveFolderId':_0x3f7c50},_0xb09cf8,_0x186b23,_0x1d1843);else{ensureJourneyDefaults(_0x1ceeed[_0x44d522(0x203)]);const _0x30f2c7=await _0x494afc[_0x44d522(0x17d)][_0x44d522(0x218)](_0x1ceeed);return deletePushRecovery(_0x126f39[_0x44d522(0x1d6)]),{'action':'created','journeyId':_0x30f2c7['id'],'embeddedSegmentNameToId':_0x4830d7};}}else{if(_0x126f39['hasChanges']&&_0x126f39[_0x44d522(0x23c)]){_0x1ceeed['id']=_0x126f39[_0x44d522(0x23c)]['id'];const _0x40a68c=_0x1ceeed[_0x44d522(0x203)];_0x126f39[_0x44d522(0x23c)][_0x44d522(0x203)]?.[_0x44d522(0x1da)]&&(_0x40a68c[_0x44d522(0x1da)]=_0x126f39[_0x44d522(0x23c)]['attributes'][_0x44d522(0x1da)]);const _0x221c90=_0x126f39[_0x44d522(0x23c)][_0x44d522(0x203)]?.['journeyStages'];return _0x221c90&&_0x1ceeed[_0x44d522(0x203)][_0x44d522(0x174)]&&injectExistingStageIds(_0x1ceeed[_0x44d522(0x203)][_0x44d522(0x174)],_0x221c90),ensureJourneyDefaults(_0x40a68c),await _0x494afc[_0x44d522(0x17d)]['update'](_0x126f39[_0x44d522(0x23c)]['id'],_0x1ceeed),deletePushRecovery(_0x126f39[_0x44d522(0x1d6)]),{'action':_0x44d522(0x223),'journeyId':_0x126f39[_0x44d522(0x23c)]['id'],'embeddedSegmentNameToId':_0x4830d7};}}return deletePushRecovery(_0x126f39[_0x44d522(0x1d6)]),{'action':_0x44d522(0x182),'journeyId':_0x126f39['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x4830d7};}function findSegmentCriteriaLocation(_0x16635a,_0xcd88a6){const _0x451177=a140_0x591ef5,_0x1df2db=_0x16635a[_0x451177(0x1d4)]||_0x16635a[_0x451177(0x1ec)]?.[0x0]?.[_0x451177(0x1d4)]||[];let _0x243a92=_0x451177(0x192),_0x3fe3ea=_0xcd88a6;const _0x4b7b71=_0x16635a[_0x451177(0x17c)]||_0x16635a[_0x451177(0x1ec)]?.[0x0]?.['goal'];if(_0x4b7b71?.[_0x451177(0x19b)]===_0xcd88a6)return{'stageName':_0x451177(0x17c),'criteriaName':_0x4b7b71[_0x451177(0x16c)]||_0xcd88a6};_0x660c43:for(const _0x41be5d of _0x1df2db){if(_0x41be5d[_0x451177(0x224)]?.[_0x451177(0x19b)]===_0xcd88a6){_0x243a92=_0x41be5d[_0x451177(0x16c)],_0x3fe3ea=_0x41be5d['entry_criteria'][_0x451177(0x16c)]||_0xcd88a6;break;}if(_0x41be5d[_0x451177(0x209)])for(const _0x231498 of _0x41be5d[_0x451177(0x209)]){if(_0x231498[_0x451177(0x215)]==='decision_point'&&_0x231498[_0x451177(0x183)]?.[_0x451177(0x201)])for(const _0x367bde of _0x231498[_0x451177(0x183)]['branches']){if(_0x367bde['segment']===_0xcd88a6){_0x243a92=_0x41be5d[_0x451177(0x16c)],_0x3fe3ea=_0x367bde[_0x451177(0x16c)]||_0xcd88a6;break _0x660c43;}}}}return{'stageName':_0x243a92,'criteriaName':_0x3fe3ea};}async function executeThreeStepJourneyCreate(_0x3e2660,_0x2f8e60,_0x2d37af,_0x4e14bb,_0x53eae3,_0x256ef5,_0x1d05af,_0x26ecb1){const _0x7a4c09=a140_0x591ef5,{activationDefToCreateRequest:_0x2facec,yamlRuleToApi:_0xf294ff}=_0x26ecb1,{pendingEmbeddedSegments:_0x2e75e7,pendingEmbeddedActivations:_0x124f96,embeddedSegmentNameToId:_0x30d2d3}=_0x4e14bb,_0x50b342=JSON[_0x7a4c09(0x1fd)](JSON['stringify'](_0x2d37af));ensureJourneyDefaults(_0x50b342[_0x7a4c09(0x203)]),stripPendingIds(_0x50b342);const _0x3db9a8=await _0x3e2660[_0x7a4c09(0x17d)]['create'](_0x50b342),_0x164e29=_0x3db9a8['id'],_0x1a387d=new Map();for(const _0x365228 of _0x3db9a8[_0x7a4c09(0x203)]['journeyStages']){_0x1a387d[_0x7a4c09(0x19a)](_0x365228[_0x7a4c09(0x16c)][_0x7a4c09(0x19c)](),_0x365228['id']);}recoverSegmentIdsFromPushRecovery(_0x2f8e60,_0x30d2d3,_0x256ef5[_0x7a4c09(0x172)]);for(const [_0x5d697f,{definition:_0x3aad09}]of _0x2e75e7){if(_0x30d2d3['has'](_0x5d697f)){_0x1d05af[_0x7a4c09(0x1c8)]?.({'type':_0x7a4c09(0x1de),'journeyName':_0x2f8e60['yamlConfig']['name'],'segmentName':_0x5d697f});continue;}const _0x20db3b=generateDeterministicJourneySegmentName(_0x2f8e60['yamlConfig'][_0x7a4c09(0x16c)],_0x5d697f);_0x1d05af[_0x7a4c09(0x1c8)]?.({'type':_0x7a4c09(0x1af),'journeyName':_0x2f8e60[_0x7a4c09(0x1f2)]['name'],'segmentName':_0x5d697f});const _0x4bab9c=createSegmentIdResolver(_0x256ef5[_0x7a4c09(0x172)],_0x5d697f),_0x199638=await resolveRuleSegmentIds(_0x3aad09[_0x7a4c09(0x22d)],_0x4bab9c),_0x25d6e3=await createOrRecoverEmbeddedSegment(_0x3e2660,_0x2f8e60,{'localName':_0x5d697f,'uniqueSegmentName':_0x20db3b,'description':_0x3aad09[_0x7a4c09(0x1ff)]||_0x7a4c09(0x1bc)+_0x5d697f,'journeyId':_0x164e29,'resolvedRule':_0x199638,'parentId':_0x53eae3[_0x7a4c09(0x246)],'folderId':_0x53eae3[_0x7a4c09(0x22f)]||''},_0xf294ff);_0x30d2d3['set'](_0x5d697f,_0x25d6e3),_0x256ef5[_0x7a4c09(0x172)][_0x7a4c09(0x19a)](_0x5d697f,_0x25d6e3),_0x1d05af[_0x7a4c09(0x1c8)]?.({'type':_0x7a4c09(0x1de),'journeyName':_0x2f8e60['yamlConfig']['name'],'segmentName':_0x5d697f});}const _0x36218d=new Map();for(const [_0x3eabaa,_0xa5503d]of _0x124f96){_0x1d05af[_0x7a4c09(0x1c8)]?.({'type':_0x7a4c09(0x1a2),'journeyName':_0x2f8e60[_0x7a4c09(0x1f2)][_0x7a4c09(0x16c)],'activationName':_0x3eabaa});const _0x4a2968=await _0x2facec(_0xa5503d,_0x256ef5[_0x7a4c09(0x229)]),_0x35a44b={..._0x4a2968,..._0xa5503d[_0x7a4c09(0x26a)]!==undefined&&{'runAfterJourneyRefresh':_0xa5503d[_0x7a4c09(0x26a)]}},_0x21ba87=await _0x3e2660['journey'][_0x7a4c09(0x1a8)](_0x164e29,_0x35a44b);_0x36218d[_0x7a4c09(0x19a)](_0x3eabaa,_0x21ba87['id']),_0x4e14bb[_0x7a4c09(0x1f6)][_0x7a4c09(0x19a)](_0x3eabaa,_0x21ba87['id']),_0x1d05af[_0x7a4c09(0x1c8)]?.({'type':_0x7a4c09(0x1fb),'journeyName':_0x2f8e60[_0x7a4c09(0x1f2)]['name'],'activationName':_0x3eabaa});}const _0x28b047=JSON[_0x7a4c09(0x1fd)](JSON[_0x7a4c09(0x1c1)](_0x2d37af));return _0x28b047['id']=_0x164e29,ensureJourneyDefaults(_0x28b047['attributes']),resolvePendingIdsInRequest(_0x28b047,_0x2d37af,_0x1a387d,_0x30d2d3,_0x36218d,_0x1d05af),await _0x3e2660[_0x7a4c09(0x17d)][_0x7a4c09(0x19f)](_0x164e29,_0x28b047),deletePushRecovery(_0x2f8e60[_0x7a4c09(0x1d6)]),{'action':_0x7a4c09(0x263),'journeyId':_0x164e29,'embeddedSegmentNameToId':_0x30d2d3};}export function stripWaitStepPendingIds(_0x135f7e){const _0x35df36=a140_0x591ef5,_0x45d9a6=_0x135f7e[_0x35df36(0x26b)]&&isPendingSegmentId(_0x135f7e[_0x35df36(0x26b)]),_0x41aa81=_0x135f7e[_0x35df36(0x1c2)]?.[_0x35df36(0x1fc)](_0x121327=>_0x121327[_0x35df36(0x18a)]&&isPendingSegmentId(_0x121327['segmentId']));(_0x45d9a6||_0x41aa81)&&(_0x135f7e[_0x35df36(0x1f5)]='Duration',_0x135f7e[_0x35df36(0x195)]=0x1,_0x135f7e['waitStepUnit']='day',delete _0x135f7e[_0x35df36(0x26b)],delete _0x135f7e[_0x35df36(0x24e)],delete _0x135f7e[_0x35df36(0x1a1)],delete _0x135f7e[_0x35df36(0x1c2)]);}export function resolveWaitStepPendingIds(_0x14df69,_0x493560,_0x327161,_0x599d7c){const _0x2ffca5=a140_0x591ef5;if(_0x493560[_0x2ffca5(0x26b)]&&isPendingSegmentId(_0x493560[_0x2ffca5(0x26b)])){const _0x526414=_0x327161(_0x493560[_0x2ffca5(0x26b)],'stage\x20\x27'+_0x599d7c+_0x2ffca5(0x245));_0x526414&&(_0x14df69[_0x2ffca5(0x1f5)]=_0x2ffca5(0x219),_0x14df69[_0x2ffca5(0x26b)]=_0x526414,delete _0x14df69[_0x2ffca5(0x195)],delete _0x14df69[_0x2ffca5(0x1e9)],_0x493560[_0x2ffca5(0x24e)]!==undefined&&(_0x14df69['conditionTimeoutDuration']=_0x493560[_0x2ffca5(0x24e)]),_0x493560[_0x2ffca5(0x1a1)]&&(_0x14df69[_0x2ffca5(0x1a1)]=_0x493560[_0x2ffca5(0x1a1)]));}if(_0x493560[_0x2ffca5(0x1c2)]){const _0xa94d48=_0x493560[_0x2ffca5(0x1c2)][_0x2ffca5(0x1fc)](_0x1c7723=>_0x1c7723[_0x2ffca5(0x18a)]&&isPendingSegmentId(_0x1c7723[_0x2ffca5(0x18a)]));if(_0xa94d48){const _0x53eab0=_0x493560[_0x2ffca5(0x1c2)]['map'](_0x2db749=>{const _0x13b1a8=_0x2ffca5;if(_0x2db749[_0x13b1a8(0x18a)]&&isPendingSegmentId(_0x2db749[_0x13b1a8(0x18a)])){const _0x8de7c3=_0x327161(_0x2db749['segmentId'],_0x13b1a8(0x1e1)+_0x599d7c+'\x27\x20wait\x20condition');return{..._0x2db749,'segmentId':_0x8de7c3||_0x2db749[_0x13b1a8(0x18a)]};}return{..._0x2db749};});_0x14df69['waitStepType']=_0x2ffca5(0x219),_0x14df69[_0x2ffca5(0x1c2)]=_0x53eab0,delete _0x14df69['waitStep'],delete _0x14df69[_0x2ffca5(0x1e9)],delete _0x14df69[_0x2ffca5(0x26b)],delete _0x14df69[_0x2ffca5(0x24e)],delete _0x14df69[_0x2ffca5(0x1a1)];}}}function stripPendingIds(_0x50417a){const _0x7cda73=a140_0x591ef5;_0x50417a[_0x7cda73(0x203)][_0x7cda73(0x17c)]?.[_0x7cda73(0x18a)]&&isPendingSegmentId(_0x50417a['attributes'][_0x7cda73(0x17c)][_0x7cda73(0x18a)])&&delete _0x50417a[_0x7cda73(0x203)][_0x7cda73(0x17c)];for(const _0x5db0ab of _0x50417a[_0x7cda73(0x203)]['journeyStages']||[]){_0x5db0ab['entryCriteria']?.[_0x7cda73(0x18a)]&&isPendingSegmentId(_0x5db0ab[_0x7cda73(0x24c)][_0x7cda73(0x18a)])&&delete _0x5db0ab[_0x7cda73(0x24c)];_0x5db0ab[_0x7cda73(0x1b3)]?.[_0x7cda73(0x18a)]&&isPendingSegmentId(_0x5db0ab['milestone'][_0x7cda73(0x18a)])&&delete _0x5db0ab[_0x7cda73(0x1b3)];_0x5db0ab[_0x7cda73(0x257)]&&(_0x5db0ab[_0x7cda73(0x257)]=_0x5db0ab['exitCriterias'][_0x7cda73(0x243)](_0x5a1a3f=>!_0x5a1a3f['segmentId']||!isPendingSegmentId(_0x5a1a3f['segmentId'])));if(_0x5db0ab[_0x7cda73(0x209)])for(const _0x4eed6e of Object[_0x7cda73(0x251)](_0x5db0ab[_0x7cda73(0x209)])){const _0x1bc8c9=_0x5db0ab[_0x7cda73(0x209)][_0x4eed6e];_0x1bc8c9[_0x7cda73(0x215)]===_0x7cda73(0x1c7)&&_0x1bc8c9[_0x7cda73(0x184)]&&isPendingActivationId(_0x1bc8c9['journeyActivationStepId'])&&(_0x1bc8c9[_0x7cda73(0x184)]='');if(_0x1bc8c9[_0x7cda73(0x215)]==='DecisionPoint'&&_0x1bc8c9['branches'])for(const _0x488f0e of _0x1bc8c9[_0x7cda73(0x201)]){_0x488f0e[_0x7cda73(0x18a)]&&isPendingSegmentId(_0x488f0e[_0x7cda73(0x18a)])&&(_0x488f0e[_0x7cda73(0x18a)]='');}_0x1bc8c9[_0x7cda73(0x215)]===_0x7cda73(0x1f3)&&stripWaitStepPendingIds(_0x1bc8c9);}}}function resolvePendingIdsInRequest(_0x21b3ef,_0x26b7d5,_0x24e55f,_0x23b00e,_0x5664a9,_0x20a5ba){const _0x5241cf=a140_0x591ef5,_0x46c249=(_0x49f8d8,_0x1e90b2)=>{const _0x33c1da=a140_0xd9cf;if(!isPendingSegmentId(_0x49f8d8))return _0x49f8d8;const _0xb60765=extractPendingSegmentName(_0x49f8d8),_0x40a9f9=_0x23b00e[_0x33c1da(0x248)](_0xb60765);return!_0x40a9f9&&_0x20a5ba[_0x33c1da(0x249)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0xb60765+_0x33c1da(0x171)+_0x1e90b2),_0x40a9f9;};if(_0x21b3ef[_0x5241cf(0x203)][_0x5241cf(0x17c)]?.[_0x5241cf(0x18a)]&&isPendingSegmentId(_0x21b3ef[_0x5241cf(0x203)][_0x5241cf(0x17c)][_0x5241cf(0x18a)])){const _0x34ba64=_0x46c249(_0x21b3ef[_0x5241cf(0x203)][_0x5241cf(0x17c)]['segmentId'],'goal\x20criteria');_0x34ba64&&(_0x21b3ef[_0x5241cf(0x203)]['goal'][_0x5241cf(0x18a)]=_0x34ba64);}for(const _0x525589 of _0x21b3ef[_0x5241cf(0x203)][_0x5241cf(0x174)]||[]){const _0x5b071c=_0x24e55f[_0x5241cf(0x248)](_0x525589[_0x5241cf(0x16c)][_0x5241cf(0x19c)]());_0x5b071c&&(_0x525589['id']=_0x5b071c);if(_0x525589['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x525589[_0x5241cf(0x24c)][_0x5241cf(0x18a)])){const _0x21cdac=_0x46c249(_0x525589[_0x5241cf(0x24c)][_0x5241cf(0x18a)],'stage\x20\x27'+_0x525589[_0x5241cf(0x16c)]+'\x27\x20entry\x20criteria');_0x21cdac&&(_0x525589['entryCriteria'][_0x5241cf(0x18a)]=_0x21cdac);}if(_0x525589[_0x5241cf(0x257)])for(const _0x180df3 of _0x525589['exitCriterias']){if(_0x180df3[_0x5241cf(0x18a)]&&isPendingSegmentId(_0x180df3[_0x5241cf(0x18a)])){const _0x335178=_0x46c249(_0x180df3[_0x5241cf(0x18a)],_0x5241cf(0x1e1)+_0x525589[_0x5241cf(0x16c)]+'\x27\x20exit\x20criteria');_0x335178&&(_0x180df3[_0x5241cf(0x18a)]=_0x335178);}}if(_0x525589[_0x5241cf(0x1b3)]?.[_0x5241cf(0x18a)]&&isPendingSegmentId(_0x525589[_0x5241cf(0x1b3)][_0x5241cf(0x18a)])){const _0x399110=_0x46c249(_0x525589[_0x5241cf(0x1b3)][_0x5241cf(0x18a)],_0x5241cf(0x1e1)+_0x525589[_0x5241cf(0x16c)]+_0x5241cf(0x1d1));_0x399110&&(_0x525589[_0x5241cf(0x1b3)][_0x5241cf(0x18a)]=_0x399110);}if(_0x525589[_0x5241cf(0x209)]){const _0x386e26=_0x118690=>_0x26b7d5[_0x5241cf(0x203)][_0x5241cf(0x174)]?.['find'](_0x114efd=>_0x114efd[_0x5241cf(0x16c)][_0x5241cf(0x19c)]()===_0x525589['name'][_0x5241cf(0x19c)]())?.[_0x5241cf(0x209)]?.[_0x118690];for(const _0x137c26 of Object[_0x5241cf(0x251)](_0x525589['steps'])){const _0x2ddc0f=_0x525589[_0x5241cf(0x209)][_0x137c26],_0x5cb0c4=_0x386e26(_0x137c26);if(_0x2ddc0f['type']===_0x5241cf(0x1c7)&&_0x2ddc0f[_0x5241cf(0x184)]&&(isPendingActivationId(_0x2ddc0f[_0x5241cf(0x184)])||_0x2ddc0f['journeyActivationStepId']==='')){if(_0x5cb0c4?.['journeyActivationStepId']&&isPendingActivationId(_0x5cb0c4['journeyActivationStepId'])){const _0xf6e870=extractPendingActivationName(_0x5cb0c4['journeyActivationStepId']),_0x165d81=_0x5664a9[_0x5241cf(0x248)](_0xf6e870);_0x165d81&&(_0x2ddc0f[_0x5241cf(0x184)]=_0x165d81);}}if(_0x2ddc0f[_0x5241cf(0x215)]===_0x5241cf(0x1b5)&&_0x2ddc0f[_0x5241cf(0x201)]&&_0x5cb0c4?.[_0x5241cf(0x201)])for(let _0x3cb988=0x0;_0x3cb988<_0x2ddc0f[_0x5241cf(0x201)][_0x5241cf(0x240)];_0x3cb988++){const _0x1f326a=_0x2ddc0f[_0x5241cf(0x201)][_0x3cb988],_0x164b59=_0x5cb0c4[_0x5241cf(0x201)][_0x3cb988];if(_0x164b59?.[_0x5241cf(0x18a)]&&isPendingSegmentId(_0x164b59[_0x5241cf(0x18a)])){const _0x2f9488=_0x46c249(_0x164b59[_0x5241cf(0x18a)],'stage\x20\x27'+_0x525589[_0x5241cf(0x16c)]+_0x5241cf(0x210)+(_0x1f326a['name']||_0x3cb988)+'\x27');_0x2f9488&&(_0x1f326a[_0x5241cf(0x18a)]=_0x2f9488);}}_0x2ddc0f[_0x5241cf(0x215)]==='WaitStep'&&_0x5cb0c4?.[_0x5241cf(0x215)]===_0x5241cf(0x1f3)&&resolveWaitStepPendingIds(_0x2ddc0f,_0x5cb0c4,_0x46c249,_0x525589['name']);}}}}
1
+ const a140_0x164c64=a140_0x2294;(function(_0x2f05e8,_0x230f96){const _0x3c7f97=a140_0x2294,_0x47f860=_0x2f05e8();while(!![]){try{const _0x3b2160=-parseInt(_0x3c7f97(0x213))/0x1+-parseInt(_0x3c7f97(0x23a))/0x2*(parseInt(_0x3c7f97(0x2af))/0x3)+parseInt(_0x3c7f97(0x2a5))/0x4+parseInt(_0x3c7f97(0x20e))/0x5*(parseInt(_0x3c7f97(0x201))/0x6)+parseInt(_0x3c7f97(0x1c0))/0x7+parseInt(_0x3c7f97(0x2a9))/0x8*(-parseInt(_0x3c7f97(0x233))/0x9)+parseInt(_0x3c7f97(0x23e))/0xa*(parseInt(_0x3c7f97(0x21c))/0xb);if(_0x3b2160===_0x230f96)break;else _0x47f860['push'](_0x47f860['shift']());}catch(_0x29d798){_0x47f860['push'](_0x47f860['shift']());}}}(a140_0x1beb,0x47f8b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x164c64(0x29f));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a140_0x164c64(0x1cb);export function createPendingSegmentId(_0x22d490){return''+PENDING_SEGMENT_PREFIX+_0x22d490+'__';}export function isPendingSegmentId(_0x5ea5f5){const _0x5b408a=a140_0x164c64;return _0x5ea5f5[_0x5b408a(0x29d)](PENDING_SEGMENT_PREFIX)&&!_0x5ea5f5[_0x5b408a(0x29d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x48f6a1){const _0x2b8cd=a140_0x164c64;return _0x48f6a1[_0x2b8cd(0x297)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x548b67){return''+PENDING_ACTIVATION_PREFIX+_0x548b67+'__';}export function isPendingActivationId(_0x57d6b8){const _0x2ef091=a140_0x164c64;return _0x57d6b8[_0x2ef091(0x29d)](PENDING_ACTIVATION_PREFIX);}function a140_0x2294(_0x20d1c9,_0x3f358d){_0x20d1c9=_0x20d1c9-0x1bb;const _0x1beb94=a140_0x1beb();let _0x229455=_0x1beb94[_0x20d1c9];return _0x229455;}export function extractPendingActivationName(_0x19e13a){const _0x530b1c=a140_0x164c64;return _0x19e13a[_0x530b1c(0x297)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4762ac,_0x4de5f4){const _0x142828=a140_0x164c64,_0x213439=_0x4762ac+'::'+(_0x4de5f4['trim']()||_0x142828(0x1be)),_0x5d790e=createHash(_0x142828(0x259))[_0x142828(0x248)](_0x213439)['digest'](_0x142828(0x243))[_0x142828(0x2ad)](0x0,0xc);return _0x142828(0x236)+_0x5d790e;}export function ensureJourneyDefaults(_0x29bb0a){const _0x252c0e=a140_0x164c64;!_0x29bb0a[_0x252c0e(0x272)]&&(_0x29bb0a['description']=''),!_0x29bb0a['state']&&(_0x29bb0a[_0x252c0e(0x1eb)]=_0x252c0e(0x255));}export function injectExistingStageIds(_0x4e5819,_0x583b8b){const _0x1d67f7=a140_0x164c64,_0x27f1a8=new Map(_0x583b8b[_0x1d67f7(0x207)](_0x21a08d=>[_0x21a08d['name'],_0x21a08d['id']]));for(const _0x4fc8c3 of _0x4e5819){if(!_0x4fc8c3['id']){const _0x58bbfb=_0x27f1a8[_0x1d67f7(0x24d)](_0x4fc8c3[_0x1d67f7(0x1c9)]);_0x58bbfb&&(_0x4fc8c3['id']=_0x58bbfb);}}}export function resolveTDFolderPath(_0x386d99,_0x57c35d,_0x31f6e7){const _0x1c7618=a140_0x164c64;if(!_0x57c35d)return _0x386d99;if(_0x386d99===_0x31f6e7||_0x386d99[_0x1c7618(0x29d)](_0x31f6e7+'/'))return _0x386d99;return _0x386d99?_0x31f6e7+'/'+_0x386d99:_0x31f6e7;}export function addFoldersToCreate(_0x414dc0,_0x55cdc8,_0x3c8d4e){const _0x51b20d=a140_0x164c64;if(!_0x414dc0)return;if(_0x55cdc8['has'](_0x414dc0))return;const _0x5062bd=_0x414dc0[_0x51b20d(0x285)]('/');let _0x44c649='';for(const _0x11bb8f of _0x5062bd){_0x44c649=_0x44c649?_0x44c649+'/'+_0x11bb8f:_0x11bb8f,!_0x55cdc8[_0x51b20d(0x253)](_0x44c649)&&_0x3c8d4e[_0x51b20d(0x2a4)](_0x44c649);}}export function sortFoldersByDepth(_0x5bac1a){const _0x1ac303=a140_0x164c64;return[..._0x5bac1a][_0x1ac303(0x273)]((_0x594b1e,_0x2eb9a0)=>{const _0x4ce2e8=_0x1ac303,_0x1ca18b=(_0x594b1e['match'](/\//g)||[])[_0x4ce2e8(0x1e6)],_0x13df22=(_0x2eb9a0[_0x4ce2e8(0x26d)](/\//g)||[])[_0x4ce2e8(0x1e6)];return _0x1ca18b-_0x13df22;});}import*as a140_0x5b7330 from'yaml';import{readFileSync}from'fs';import a140_0x3e131c from'path';import{isJourneyDef,parseYamlString as a140_0x138f6e,toYamlString as a140_0x48c97f,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x30a2a7){const _0x480e2d=a140_0x164c64;if(Array[_0x480e2d(0x24b)](_0x30a2a7))return'['+_0x30a2a7[_0x480e2d(0x207)](_0x516827=>stableStringify(_0x516827))[_0x480e2d(0x1ea)](',')+']';if(_0x30a2a7&&typeof _0x30a2a7==='object'){const _0x5a7107=_0x30a2a7,_0x11528f=Object[_0x480e2d(0x238)](_0x5a7107)[_0x480e2d(0x273)](),_0x4e1036=_0x11528f[_0x480e2d(0x207)](_0x4806c5=>'\x22'+_0x4806c5+'\x22:'+stableStringify(_0x5a7107[_0x4806c5]));return'{'+_0x4e1036[_0x480e2d(0x1ea)](',')+'}';}const _0x187b62=JSON[_0x480e2d(0x27b)](_0x30a2a7);return _0x187b62===undefined?_0x480e2d(0x1c8):_0x187b62;}function activationSignature(_0x22c67c){const _0x3c92b9=a140_0x164c64,_0x2e93b6={'connection':_0x22c67c[_0x3c92b9(0x262)],..._0x22c67c['all_columns']!==undefined&&{'all_columns':_0x22c67c['all_columns']},..._0x22c67c['columns']!==undefined&&{'columns':_0x22c67c['columns']},..._0x22c67c[_0x3c92b9(0x295)]!==undefined&&{'behavior':_0x22c67c[_0x3c92b9(0x295)]},..._0x22c67c[_0x3c92b9(0x268)]!==undefined&&{'schedule':_0x22c67c[_0x3c92b9(0x268)]},..._0x22c67c[_0x3c92b9(0x1fb)]!==undefined&&{'notification':_0x22c67c['notification']},..._0x22c67c[_0x3c92b9(0x21e)]!==undefined&&{'connector_config':_0x22c67c[_0x3c92b9(0x21e)]},..._0x22c67c[_0x3c92b9(0x2b2)]!==undefined&&{'activation_template_id':_0x22c67c[_0x3c92b9(0x2b2)]}};return stableStringify(_0x2e93b6);}async function fetchSegment(_0x2b3e31,_0x27eae3,_0x2c5d81,_0x313c63){const _0x5866c1=a140_0x164c64,_0x492c8e=_0x313c63?.['find'](_0x296d31=>_0x296d31['id']===_0x2c5d81);if(_0x492c8e)return _0x492c8e;try{return await _0x2b3e31[_0x5866c1(0x1be)][_0x5866c1(0x24e)](_0x27eae3,_0x2c5d81);}catch(_0x2172cd){logger[_0x5866c1(0x249)](_0x5866c1(0x2b5)+_0x2c5d81+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x2172cd);try{return await _0x2b3e31[_0x5866c1(0x1be)][_0x5866c1(0x2a6)](_0x2c5d81);}catch(_0x4e944d){return logger[_0x5866c1(0x249)](_0x5866c1(0x27f)+_0x2c5d81+':\x20'+_0x4e944d),null;}}}function recoverSegmentIdsFromPushRecovery(_0x409d2a,_0x1d0b12,_0x4fe27b){const _0x5b36b3=a140_0x164c64,_0x13d4a2=readPushRecovery(_0x409d2a[_0x5b36b3(0x1bb)]);if(_0x13d4a2?.[_0x5b36b3(0x1db)]===_0x409d2a[_0x5b36b3(0x221)][_0x5b36b3(0x1c9)])for(const [_0x5d502a,_0x3ae036]of Object['entries'](_0x13d4a2['segments'])){const _0x17b267=generateDeterministicJourneySegmentName(_0x409d2a[_0x5b36b3(0x221)]['name'],_0x5d502a);_0x3ae036[_0x5b36b3(0x208)]===_0x17b267&&(_0x1d0b12[_0x5b36b3(0x1cc)](_0x5d502a,_0x3ae036['segmentId']),_0x4fe27b[_0x5b36b3(0x1cc)](_0x5d502a,_0x3ae036['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x132ba0,_0x2dc294,_0x492d92,_0x12a472){const _0x319b14=a140_0x164c64;let _0x469b10;try{_0x469b10=await _0x132ba0[_0x319b14(0x1be)]['createJourneySegment']({'name':_0x492d92[_0x319b14(0x2ae)],'description':_0x492d92[_0x319b14(0x272)],'journeyId':_0x492d92['journeyId'],'rule':_0x12a472(_0x492d92[_0x319b14(0x2aa)],!![]),'countPopulation':!![],'parentFolderId':_0x492d92[_0x319b14(0x2ab)],'audienceId':_0x492d92[_0x319b14(0x20b)]});}catch(_0x312fe4){const _0x260c4e=_0x312fe4 instanceof Error&&_0x312fe4[_0x319b14(0x240)]['includes'](_0x319b14(0x293));if(_0x260c4e){const _0x49b6ae=readPushRecovery(_0x2dc294[_0x319b14(0x1bb)]),_0x5f06c2=_0x49b6ae?.['journeyName']===_0x2dc294['yamlConfig'][_0x319b14(0x1c9)]?_0x49b6ae[_0x319b14(0x23d)][_0x492d92[_0x319b14(0x21f)]]:undefined;if(_0x5f06c2?.[_0x319b14(0x208)]===_0x492d92[_0x319b14(0x2ae)])await _0x132ba0['segment'][_0x319b14(0x261)](_0x492d92[_0x319b14(0x20b)],_0x5f06c2[_0x319b14(0x279)],{'description':_0x492d92['description'],'rule':_0x12a472(_0x492d92[_0x319b14(0x2aa)],!![]),'countPopulation':!![]}),_0x469b10=_0x5f06c2['segmentId'];else throw new SDKError(ErrorCode[_0x319b14(0x1d0)],_0x319b14(0x1d9)+_0x492d92['localName']+_0x319b14(0x25d)+(_0x319b14(0x265)+_0x2dc294[_0x319b14(0x1bb)][_0x319b14(0x297)](/([^/]+)$/,_0x319b14(0x2b7))+')\x20')+_0x319b14(0x2a0),_0x312fe4);}else throw _0x312fe4;}return saveSegmentToPushRecovery(_0x2dc294[_0x319b14(0x1bb)],_0x2dc294[_0x319b14(0x221)][_0x319b14(0x1c9)],_0x492d92[_0x319b14(0x21f)],{'segmentId':_0x469b10,'uniqueServerName':_0x492d92['uniqueSegmentName'],'createdAt':new Date()[_0x319b14(0x292)]()}),_0x469b10;}export async function prepareSegmentFiles(_0x272b99,_0x45e695,_0x11f11f,_0x32353e,_0x37cdb2){const _0x1558f0=a140_0x164c64,{activationDefToCreateRequest:_0x10d51a}=await import(_0x1558f0(0x294)),_0x5aebb3=[],_0x448995=new Set();for(const {yamlConfig:_0xc22779,folderPath:_0x73e54b,sourcePath:_0x236b0b}of _0x272b99){const _0x4f348c=resolveTDFolderPath(_0x73e54b,_0x32353e,_0x37cdb2),_0x4215f1=_0x4f348c+':'+_0xc22779['name'],_0x1cd09f=_0x45e695[_0x1558f0(0x1ff)][_0x1558f0(0x24d)](_0x4215f1),_0x36c6aa=_0x1cd09f?_0x45e695[_0x1558f0(0x22e)][_0x1558f0(0x24d)](_0x1cd09f['id'])||[]:[];addFoldersToCreate(_0x4f348c,_0x45e695[_0x1558f0(0x1f1)],_0x448995);const _0x245e80=calculateActivationActions(_0xc22779['activations']||[],_0x36c6aa,_0x45e695['idToEmailMap'],_0x45e695['connectionIdToNameMap']);for(const _0xcd043 of _0x245e80){(_0xcd043[_0x1558f0(0x25e)]===_0x1558f0(0x1f4)||_0xcd043[_0x1558f0(0x25e)]===_0x1558f0(0x248))&&_0xcd043['yamlActivation']&&(_0xcd043[_0x1558f0(0x28f)]=await _0x10d51a(_0xcd043[_0x1558f0(0x206)],_0x11f11f));}const _0x43fbe3=calculateSegmentDiff(_0xc22779,_0x1cd09f,_0x36c6aa,_0x45e695[_0x1558f0(0x2b8)],_0x45e695[_0x1558f0(0x20a)]);_0x5aebb3[_0x1558f0(0x1e1)]({'relativePath':_0xc22779[_0x1558f0(0x1c9)],'absolutePath':_0x236b0b,'yamlConfig':_0xc22779,'folderPath':_0x4f348c,'existingSegment':_0x1cd09f,'existingActivations':_0x36c6aa,'isNew':_0x43fbe3['isNew'],'hasChanges':_0x43fbe3[_0x1558f0(0x1cd)],'diff':_0x43fbe3[_0x1558f0(0x251)],'activationActions':_0x245e80});}return{'segmentFiles':_0x5aebb3,'foldersToCreate':_0x448995};}export async function prepareJourneyFiles(_0x12d10f,_0x50cc5b,_0x1102d2,_0x27d1d9){const _0x565e14=a140_0x164c64,_0x42851b=[],_0x19350f=new Set();for(const {yamlConfig:_0x326e7d,folderPath:_0xb5b753,sourcePath:_0x1d5476}of _0x12d10f){const _0xcdb257=resolveTDFolderPath(_0xb5b753,_0x1102d2,_0x27d1d9),_0x3adc34=_0xcdb257+':'+_0x326e7d['name'],_0x2f99a8=_0x50cc5b[_0x565e14(0x2a8)]['get'](_0x3adc34);let _0x1a44c5,_0x2bcd7c;if(_0x2f99a8&&_0x2f99a8[_0x565e14(0x1e6)]>0x0){const _0x18b21c=buildLocalExpandedRuleMappings(_0x326e7d),{createYamlContext:_0x29a71c,prefetchJourneySegments:_0x386990}=createPushYamlContextForBundle(_0x50cc5b[_0x565e14(0x267)],_0x50cc5b['parentId'],_0x50cc5b['existingSegments'],_0x18b21c,_0x50cc5b[_0x565e14(0x2b8)],_0x50cc5b[_0x565e14(0x20a)],_0x50cc5b[_0x565e14(0x252)],_0x50cc5b['journeyById']);await _0x386990(_0x2f99a8[_0x565e14(0x207)](_0x4ebf5a=>_0x4ebf5a['id']));const _0x15372e=await _0x50cc5b[_0x565e14(0x267)]['journey'][_0x565e14(0x234)](_0x2f99a8[0x0][_0x565e14(0x269)]),_0x19b8e3=hasMultipleVersions(_0x326e7d),_0x10be58=async _0x24afd8=>{const _0xadf8f8=_0x565e14,_0x2031b0=_0x50cc5b[_0xadf8f8(0x2a7)]?.[_0xadf8f8(0x24d)](_0x24afd8);if(_0x2031b0)return _0x2031b0;return _0x50cc5b[_0xadf8f8(0x2c0)]({'journeyId':_0x24afd8,'journeyName':_0x326e7d[_0xadf8f8(0x1c9)],'isMultiVersion':_0x2f99a8[_0xadf8f8(0x1e6)]>0x1});};if(_0x19b8e3&&_0x2f99a8['length']>0x1){const _0x2f284a=[];for(const _0x29cd58 of _0x2f99a8){const _0x14a673=_0x29cd58[_0x565e14(0x2c2)]||0x1;_0x50cc5b[_0x565e14(0x250)]?.['update'](_0x565e14(0x276)+_0x326e7d['name']+'\x20v'+_0x14a673);const _0x430e8f=await _0x10be58(_0x29cd58['id']),_0x16f4bc=_0x29a71c(_0x29cd58['id']),_0x1b936d=await journeyResponseToDef(_0x430e8f,_0x16f4bc);_0x2f284a[_0x565e14(0x1e1)]({'item':_0x29cd58,'yaml':_0x1b936d});}const _0x2f0220=buildLocalRuleToNameMappingFromJourney(_0x326e7d);_0x2bcd7c=buildMergedJourneyDef(_0x2f284a,_0x2f0220,_0x15372e);const _0x5d063e=Math[_0x565e14(0x2c1)](..._0x2f284a[_0x565e14(0x207)](_0x31456c=>_0x31456c['item'][_0x565e14(0x2c2)]||0x0)),_0x19adea=_0x2f99a8[_0x565e14(0x271)](_0x1cdacf=>(_0x1cdacf[_0x565e14(0x2c2)]||0x0)===_0x5d063e);_0x19adea&&(_0x50cc5b[_0x565e14(0x250)]?.[_0x565e14(0x248)](_0x565e14(0x276)+_0x326e7d[_0x565e14(0x1c9)]+'\x20v'+_0x5d063e),_0x1a44c5=await _0x10be58(_0x19adea['id']));}else{const _0x1c1370=_0x2f99a8[_0x2f99a8[_0x565e14(0x1e6)]-0x1];_0x50cc5b[_0x565e14(0x250)]?.[_0x565e14(0x248)](_0x565e14(0x276)+_0x326e7d['name']),_0x1a44c5=await _0x10be58(_0x1c1370['id']);const _0x4125b1=_0x29a71c(_0x1c1370['id']),_0x5b7c6c=await journeyResponseToDef(_0x1a44c5,_0x4125b1),_0x4f03c1=buildLocalRuleToNameMappingFromJourney(_0x326e7d);_0x2bcd7c=buildMergedJourneyDef([{'item':_0x1c1370,'yaml':_0x5b7c6c}],_0x4f03c1,_0x15372e);}}addFoldersToCreate(_0xcdb257,_0x50cc5b['folderPathToId'],_0x19350f);const _0x454852=calculateJourneyDiff(_0x326e7d,_0x2bcd7c);_0x42851b['push']({'relativePath':_0x326e7d[_0x565e14(0x1c9)],'absolutePath':_0x1d5476,'yamlConfig':_0x326e7d,'folderPath':_0xcdb257,'existingJourney':_0x1a44c5,'isNew':_0x454852[_0x565e14(0x1da)],'hasChanges':_0x454852[_0x565e14(0x1cd)],'diff':_0x454852[_0x565e14(0x251)]});}return{'journeyFiles':_0x42851b,'foldersToCreate':_0x19350f};}export function calculateActivationActions(_0x13ee90,_0x40f06f,_0x12e8e0,_0x51e9c0){const _0x7b5d86=a140_0x164c64,_0x1a7ff2=[],_0x3f02e6=new Map();for(const _0x1e62fb of _0x40f06f){_0x3f02e6[_0x7b5d86(0x1cc)](_0x1e62fb['name'],_0x1e62fb);}const _0x4fc3d6=new Map();for(const _0x3b2e56 of _0x13ee90){_0x4fc3d6['set'](_0x3b2e56['name'],_0x3b2e56);}for(const _0x129192 of _0x13ee90){const _0xb844d3=_0x3f02e6['get'](_0x129192[_0x7b5d86(0x1c9)]);if(!_0xb844d3)_0x1a7ff2[_0x7b5d86(0x1e1)]({'type':_0x7b5d86(0x1f4),'name':_0x129192[_0x7b5d86(0x1c9)],'yamlActivation':_0x129192});else{const _0x260efa=activationResponseToDef(_0xb844d3,_0x12e8e0,_0x51e9c0),_0x5947dc=a140_0x5b7330[_0x7b5d86(0x27b)](_0x260efa),_0x42d63c=a140_0x5b7330['stringify'](_0x129192);_0x5947dc!==_0x42d63c&&_0x1a7ff2[_0x7b5d86(0x1e1)]({'type':_0x7b5d86(0x248),'name':_0x129192[_0x7b5d86(0x1c9)],'yamlActivation':_0x129192,'existingActivation':_0xb844d3});}}for(const _0x5767a0 of _0x40f06f){!_0x4fc3d6['has'](_0x5767a0[_0x7b5d86(0x1c9)])&&_0x1a7ff2[_0x7b5d86(0x1e1)]({'type':_0x7b5d86(0x1f2),'name':_0x5767a0[_0x7b5d86(0x1c9)],'existingActivation':_0x5767a0});}return _0x1a7ff2;}function calculateYamlDiff(_0x4c6ce0,_0x45f3db){if(_0x45f3db){const _0x5a7068=generateDiff(_0x45f3db,_0x4c6ce0),_0x39f9f2=hasChanges(_0x5a7068);return{'isNew':![],'hasChanges':_0x39f9f2,'diff':_0x39f9f2?formatDiffWithColors(_0x5a7068):undefined};}const _0x227abc=generateDiff('',_0x4c6ce0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x227abc)};}export function calculateSegmentDiff(_0x1efd42,_0x5cb51a,_0x241e88,_0x280202,_0x2b6292){const _0x2eb10f=segmentToYamlString(_0x1efd42),_0x5508cc=_0x5cb51a?segmentToYamlString(segmentWithActivationsToYaml(_0x5cb51a,_0x241e88,undefined,_0x280202,_0x2b6292)):undefined;return calculateYamlDiff(_0x2eb10f,_0x5508cc);}export function calculateJourneyDiff(_0x250ac8,_0x52dbaa){const _0x664a91=normalizeJourneyDef(_0x250ac8,_0x250ac8),_0x184066=a140_0x48c97f(_0x664a91),_0x31b81d=_0x52dbaa?a140_0x48c97f(normalizeJourneyDef(_0x52dbaa,_0x250ac8)):undefined;return calculateYamlDiff(_0x184066,_0x31b81d);}export function findSegmentsToDelete(_0x3d5414,_0x2eea7b,_0x4e4a48,_0x4a29f3,_0x126980){const _0x26b1f4=a140_0x164c64,_0x39e94e=new Set();for(const {yamlConfig:_0x173f06,folderPath:_0x2a28b5}of _0x2eea7b){_0x39e94e['add'](_0x2a28b5+':'+_0x173f06['name']);}return _0x3d5414[_0x26b1f4(0x204)](_0x2f2eea=>{const _0x360e9b=_0x26b1f4,_0x2ada8e=_0x2f2eea[_0x360e9b(0x1de)]?_0x4e4a48['get'](_0x2f2eea[_0x360e9b(0x1de)][_0x360e9b(0x1c4)]())||'':'',_0x176428=_0x2ada8e+':'+_0x2f2eea['name'];if(_0x39e94e[_0x360e9b(0x253)](_0x176428))return![];if(_0x126980)return _0x2ada8e===_0x4a29f3||_0x2ada8e[_0x360e9b(0x29d)](_0x4a29f3+'/');return!![];});}export function findJourneysToDelete(_0x53bddc,_0x855a81,_0xf5610f,_0x2dcb64,_0x212a6f){const _0xd1ec55=a140_0x164c64,_0x18a435=new Set();for(const {yamlConfig:_0x3ef29b,folderPath:_0x3a8904}of _0x855a81){_0x18a435[_0xd1ec55(0x2a4)](_0x3a8904+':'+_0x3ef29b[_0xd1ec55(0x1c9)]);}return _0x53bddc['filter'](_0x125517=>{const _0x34da35=_0xd1ec55,_0x39f060=_0x125517[_0x34da35(0x2ab)]?_0xf5610f['get'](_0x125517[_0x34da35(0x2ab)])||'':'',_0x4211b9=_0x39f060+':'+_0x125517[_0x34da35(0x225)];if(_0x18a435[_0x34da35(0x253)](_0x4211b9))return![];if(_0x212a6f)return _0x39f060===_0x2dcb64||_0x39f060['startsWith'](_0x2dcb64+'/');return!![];});}export function buildSegmentLookupMap(_0x228db6,_0x13d161){const _0x5b960f=a140_0x164c64,_0x139e17=new Map();for(const _0x5b3ed0 of _0x228db6){const _0x402ecb=_0x5b3ed0['segmentFolderId']?_0x13d161['get'](_0x5b3ed0[_0x5b960f(0x1de)]['toString']())||'':'',_0x52c5aa=_0x402ecb+':'+_0x5b3ed0[_0x5b960f(0x1c9)];_0x139e17[_0x5b960f(0x1cc)](_0x52c5aa,_0x5b3ed0);}return _0x139e17;}export function buildSegmentNameToIdMap(_0x2f89d4){const _0x29cc6d=a140_0x164c64,_0x1a25ad=new Map();for(const _0x4ff230 of _0x2f89d4){_0x1a25ad[_0x29cc6d(0x1cc)](_0x4ff230[_0x29cc6d(0x1c9)],_0x4ff230['id']);}return _0x1a25ad;}export function buildJourneyBundleLookupMap(_0x41e4a1,_0x49094f){const _0x407541=a140_0x164c64,_0x244721=new Map();for(const _0x56bed5 of _0x41e4a1){const _0x2bb0a2=_0x56bed5['folderId']?_0x49094f[_0x407541(0x24d)](_0x56bed5[_0x407541(0x2ab)])||'':'',_0x207cc4=_0x2bb0a2+':'+_0x56bed5[_0x407541(0x225)];!_0x244721[_0x407541(0x253)](_0x207cc4)&&_0x244721[_0x407541(0x1cc)](_0x207cc4,[]),_0x244721[_0x407541(0x24d)](_0x207cc4)[_0x407541(0x1e1)](_0x56bed5);}for(const _0x1e66f4 of _0x244721[_0x407541(0x1d6)]()){_0x1e66f4[_0x407541(0x273)]((_0x26033f,_0x1e1eec)=>(_0x26033f[_0x407541(0x2c2)]||0x0)-(_0x1e1eec[_0x407541(0x2c2)]||0x0));}return _0x244721;}function a140_0x1beb(){const _0x5f5296=['entry_criteria','isArray','withProgress','get','getSegment','entryCriteria','progress','diff','activationStepsById','has','data','draft','Segment\x20not\x20found','goal','effectiveFolderId','sha1','Updated\x20activation\x20\x27','createdSegmentId','resolveJourneyId','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','type','existingActivation','activation_updating','updateSegmentById','connection','journey_updating','Stage\x20\x27','Delete\x20the\x20push\x20recovery\x20file\x20(','segment_created','deps','schedule','journeyBundleId','\x20error(s)','steps','Failed\x20to\x20resolve\x20segment\x20','match','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','journeyActivationNameToId','conditionTimeoutUnit','find','description','sort','logDeleted','Failed\x20to\x20','Fetching\x20','folder','logInfo','segmentId','Creating\x20activation\x20\x27','stringify','):\x20','embedded_activation_creating','activation_creating','getSegmentEntity\x20also\x20failed\x20for\x20','\x27\x20wait\x20condition','activation_','\x27\x20from\x20file:\x20','JOURNEY_SYNTAX_ERROR','results','split','relationships','toLowerCase','valid','segment_deleting','dirname','\x20segment\x20from\x20file:\x20','stage\x20\x27','createActivation','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','validatedRequest','deleted','all','toISOString','Name\x20has\x20already\x20been\x20taken','./child-segment-yaml.js','behavior','deleteActivation','replace','\x27\x20exit\x20criteria','deleteSegment','journeyActivationStepId','\x27\x20entry\x20criteria','SEGMENT_SYNTAX_ERROR','startsWith','activations','tdx.sdk.push-workflow','and\x20the\x20server\x20segment,\x20then\x20retry.','with','run_after_journey_refresh','folder_creating','add','1470240mHFjtu','getSegmentEntity','journeyById','journeyBundlesByFolderAndName','5208AJSxwZ','resolvedRule','folderId','Updated\x20segment\x20\x27','slice','uniqueSegmentName','6987qltsTP','logSuccess','existingJourney','activation_template_id','getJourney','Updated\x20journey\x20\x27','getSegment\x20failed\x20for\x20','branches','.$1.push-recovery.json','idToEmailMap','conditionTimeoutDuration','activationParams','rootFolderId','activationContext','skipSegments','folder_created','day','fetchJourney','max','versionNumber','Deleting\x20activation\x20\x27','absolutePath','embedded_activation_created','Created\x20segment\x20\x27','segment','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','2854019kDSpmQ','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','journey','toString','Deleted\x20activation\x20\x27','milestone','\x20journey\x20from\x20file:\x20','null','name','Updating\x20activation\x20\x27','__pending_act_','set','hasChanges','entry','parentSegmentFolder','SEGMENT_UPDATE_ERROR','idToName','onProgress','WaitStep','segmentNameToId','some','values','INTERNAL','NOT_FOUND','Embedded\x20segment\x20\x27','isNew','journeyName','waitStep','relative','segmentFolderId','ACTIVATION_UPDATE_ERROR','journey_creating','push','list','\x27\x20by\x20rule\x20content','exitCriterias','verbose','length','\x20activation\x20\x27','./journey-yaml.js','attributes','join','state','listActivations','index','Segment\x20not\x20found:\x20','buildUserMaps','waitStepType','folderPathToId','delete','segment_updating','create','updated','journeyId','reduce','embedded_segment_creating','conditions','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','notification','action','Matched\x20server\x20segment\x20\x27','activation_created','segmentByFolderAndName','segment_deleted','114wIBlVP','conditionSegmentId','Creating\x20segment\x20\x27','filter','journeys','yamlActivation','map','uniqueServerName','\x0a\x20\x20','connectionIdToNameMap','parentId','parse','\x27...','89230zRYrBt','resolveSegment','rule','\x20(referenced\x20in\x20journey\x20','getActivation','374996AfGpqm','entries','parseDocument','from','../../utils/async.js','Condition','\x27\x20for\x20','existingSegment','\x27\x20decision\x20point\x20branch\x20\x27','2471392vHbsZb','DecisionPoint','connector_config','localName','segment_creating','yamlConfig','stages','Entry\x20criteria:\x20','goal\x20criteria','journeyBundleName','Activation\x20not\x20found:\x20','waitStepUnit','SEGMENT_NOT_FOUND','\x27\x20to\x20local\x20\x27','decision_point','Activation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','embeddedSegmentNameToId','activationsBySegmentId','Journey\x20\x27','embedded_segment_created','size','unchanged','3231QqrqFB','getLatestJourneyId','Failed\x20to\x20resolve\x20activation\x20','journey_entry_criteria_','nameToId','keys','folderPath','374FqXaRk','created','journey_updated','segments','10gdRhCt','existingSegments','message','Duration','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','hex','utf-8','nameToType','errors','journeyStages','update','debug'];a140_0x1beb=function(){return _0x5f5296;};return a140_0x1beb();}export function collectFoldersToCreate(_0x244251,_0x35bc99){const _0x4e013b=a140_0x164c64,_0x22b0a8=new Set();for(const _0x21b5e6 of _0x244251){if(!_0x21b5e6)continue;if(_0x35bc99[_0x4e013b(0x253)](_0x21b5e6))continue;const _0x1c38e3=_0x21b5e6[_0x4e013b(0x285)]('/');let _0x13d9ed='';for(const _0x27ff82 of _0x1c38e3){_0x13d9ed=_0x13d9ed?_0x13d9ed+'/'+_0x27ff82:_0x27ff82,!_0x35bc99[_0x4e013b(0x253)](_0x13d9ed)&&_0x22b0a8[_0x4e013b(0x2a4)](_0x13d9ed);}}return _0x22b0a8;}export function parseAndClassifyYamlFiles(_0x473e0e,_0x17ae47,_0x2d2eaa){const _0x9665d4=a140_0x164c64,_0x3c18c2=[],_0x1735a6=[];for(const _0x2cb45c of _0x473e0e){const _0x39b99d=a140_0x3e131c[_0x9665d4(0x1dd)](_0x17ae47,a140_0x3e131c[_0x9665d4(0x28a)](_0x2cb45c)),_0x8ea561=_0x39b99d==='.'?'':_0x39b99d,_0xa2c3c=readFileSync(_0x2cb45c,_0x9665d4(0x244)),_0x302bcf=a140_0x5b7330[_0x9665d4(0x20c)](_0xa2c3c);if(isJourneyDef(_0x302bcf)){const _0x287d29=a140_0x138f6e(_0xa2c3c);_0x1735a6[_0x9665d4(0x1e1)]({'yamlConfig':_0x287d29,'folderPath':_0x8ea561,'sourcePath':_0x2cb45c});}else{if(!_0x2d2eaa?.[_0x9665d4(0x2bd)]){const _0x318b34=parseSegmentYamlFile(_0xa2c3c),_0x29d7bb=normalizeChildSegmentYaml(_0x318b34);_0x3c18c2[_0x9665d4(0x1e1)]({'yamlConfig':_0x29d7bb,'folderPath':_0x8ea561,'sourcePath':_0x2cb45c});}}}return{'segments':_0x3c18c2,'journeys':_0x1735a6};}export function validateParsedFiles(_0x566716,_0x3fb5f3){const _0x33711c=a140_0x164c64,_0x2d60d0=[];for(const {yamlConfig:_0x5e1595,sourcePath:_0xa739b}of _0x566716[_0x33711c(0x23d)]){const _0x116cbf=readFileSync(_0xa739b,_0x33711c(0x244)),_0xaf75c9=a140_0x5b7330['parseDocument'](_0x116cbf),_0x2d9967=validateSegmentDef(_0x5e1595,{'source':_0x116cbf,'document':_0xaf75c9},{'skipSchema':!![]});if(!_0x2d9967[_0x33711c(0x288)]){const _0xbcefe=a140_0x3e131c['relative'](_0x3fb5f3,_0xa739b);_0x2d60d0['push']({'filePath':_0xbcefe,'source':_0x116cbf,'result':_0x2d9967,'isJourney':![]});}}for(const {yamlConfig:_0x5c43b6,sourcePath:_0x179128}of _0x566716[_0x33711c(0x205)]){const _0x3b3506=readFileSync(_0x179128,_0x33711c(0x244)),_0x34af8d=a140_0x5b7330[_0x33711c(0x215)](_0x3b3506),_0x2d4d73=validateJourneyDef(_0x5c43b6,{'source':_0x3b3506,'document':_0x34af8d},{'skipSchema':!![]});if(!_0x2d4d73[_0x33711c(0x288)]){const _0x1447e5=a140_0x3e131c[_0x33711c(0x1dd)](_0x3fb5f3,_0x179128);_0x2d60d0[_0x33711c(0x1e1)]({'filePath':_0x1447e5,'source':_0x3b3506,'result':_0x2d4d73,'isJourney':!![]});}}return _0x2d60d0;}export function formatValidationErrors(_0x460025){const _0x19d118=a140_0x164c64,_0x31a508=[];for(const {filePath:_0x368fd0,source:_0x37f8a1,result:_0x17e1f8,isJourney:_0x5b471f}of _0x460025){const _0x474cca=_0x5b471f?_0x19d118(0x1c3):_0x19d118(0x1be);_0x31a508[_0x19d118(0x1e1)]('\x0a'+_0x368fd0+'\x20('+_0x474cca+_0x19d118(0x27c)+_0x17e1f8[_0x19d118(0x246)][_0x19d118(0x1e6)]+_0x19d118(0x26a)),_0x31a508[_0x19d118(0x1e1)](formatValidationResult(_0x17e1f8,_0x37f8a1,_0x368fd0));}return _0x31a508[_0x19d118(0x1ea)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x120cb4){const _0x1219bb=a140_0x164c64,_0x469c7b=new Set(),_0x976852=new Map(),_0x38e945=collectSegmentUsageCounts(_0x120cb4);if(_0x120cb4[_0x1219bb(0x23d)])for(const [_0x4634ef,_0x5f5d24]of Object[_0x1219bb(0x214)](_0x120cb4['segments'])){_0x469c7b[_0x1219bb(0x2a4)](_0x4634ef);if(_0x5f5d24[_0x1219bb(0x210)]){const _0x35a169=yamlRuleToApi(_0x5f5d24[_0x1219bb(0x210)]),_0x2cc2f2=apiRuleToYaml(_0x35a169);_0x976852[_0x1219bb(0x1cc)](_0x4634ef,_0x2cc2f2);}}const _0x36eb60=new Map();let _0x4936e6=0x0;for(const [_0x7585f3,_0x53e40a]of _0x976852){const _0x5b44b0=serializeExpandedRule(_0x53e40a,_0x976852),_0x3b6d74=_0x36eb60[_0x1219bb(0x24d)](_0x5b44b0)||[];_0x3b6d74['push']({'name':_0x7585f3,'index':_0x4936e6}),_0x36eb60[_0x1219bb(0x1cc)](_0x5b44b0,_0x3b6d74),_0x4936e6++;}const _0x4bb234=new Map();for(const [_0x5093f3,_0x590405]of _0x36eb60){const _0x6d365c=_0x590405[_0x1219bb(0x2ad)]()[_0x1219bb(0x273)]((_0x37d8de,_0x48a3ca)=>{const _0x226d9f=_0x1219bb,_0x12cdfc=_0x38e945['get'](_0x37d8de[_0x226d9f(0x1c9)])||0x0,_0x47be63=_0x38e945[_0x226d9f(0x24d)](_0x48a3ca[_0x226d9f(0x1c9)])||0x0;if(_0x12cdfc!==_0x47be63)return _0x47be63-_0x12cdfc;return _0x37d8de[_0x226d9f(0x1ed)]-_0x48a3ca['index'];})[_0x1219bb(0x207)](_0x1360be=>_0x1360be[_0x1219bb(0x1c9)]),_0x55313d=[];for(const _0x4546d5 of _0x6d365c){const _0x2e6ac6=_0x38e945['get'](_0x4546d5)||0x0,_0x12e72a=Math['max'](_0x2e6ac6,0x1);for(let _0x4322f1=0x0;_0x4322f1<_0x12e72a;_0x4322f1++){_0x55313d['push'](_0x4546d5);}}_0x4bb234['set'](_0x5093f3,_0x55313d);}return{'existingLocalSegmentNames':_0x469c7b,'localSegmentRules':_0x976852,'localExpandedRuleToNames':_0x4bb234};}export function createSegmentIdResolver(_0x4ff3f0,_0x4fec22){return async _0x17d7ec=>{const _0x27e8cd=a140_0x2294,_0x58016a=_0x4ff3f0['get'](_0x17d7ec);if(!_0x58016a)throw new SDKError(ErrorCode[_0x27e8cd(0x228)],_0x27e8cd(0x1ee)+_0x17d7ec+_0x27e8cd(0x1fa)+_0x4fec22+'\x27)');return _0x58016a;};}export function extractRootFolderId(_0x5cbec2){const _0x5dc993=a140_0x164c64;return _0x5cbec2[_0x5dc993(0x286)]?.[_0x5dc993(0x1cf)]?.[_0x5dc993(0x254)]?.['id']||_0x5cbec2[_0x5dc993(0x286)]?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x16caaf){const _0xca33ba=a140_0x164c64,_0x56d7ff=new Map(),_0x5b580a=new Map(),_0x41eb9b=new Map();for(const _0x15d0b2 of _0x16caaf){_0x56d7ff[_0xca33ba(0x1cc)](_0x15d0b2[_0xca33ba(0x1c9)],parseInt(_0x15d0b2['id'],0xa)),_0x5b580a[_0xca33ba(0x1cc)](_0x15d0b2['id'],_0x15d0b2[_0xca33ba(0x1c9)]),_0x41eb9b[_0xca33ba(0x1cc)](_0x15d0b2[_0xca33ba(0x1c9)],_0x15d0b2['type']);}return{'nameToId':_0x56d7ff,'idToName':_0x5b580a,'nameToType':_0x41eb9b};}export function calculatePushStats(_0x4686d7,_0xe05afc,_0x212c62,_0x4b229c,_0x5bde1f,_0x57935f,_0x889b86){const _0x64881f=a140_0x164c64,_0x58b2ba=_0x4686d7[_0x64881f(0x204)](_0x325718=>_0x325718[_0x64881f(0x1da)]),_0x2c6338=_0x4686d7[_0x64881f(0x204)](_0x35af95=>!_0x35af95['isNew']&&_0x35af95[_0x64881f(0x1cd)]),_0x52120d=_0x4686d7[_0x64881f(0x204)](_0x376a81=>!_0x376a81[_0x64881f(0x1da)]&&!_0x376a81[_0x64881f(0x1cd)]),_0x4f1bdf=_0x57935f?_0x4b229c:[],_0x103375=_0xe05afc[_0x64881f(0x204)](_0x597c73=>_0x597c73[_0x64881f(0x1da)]),_0x26672e=_0xe05afc[_0x64881f(0x204)](_0x2f615d=>!_0x2f615d[_0x64881f(0x1da)]&&_0x2f615d[_0x64881f(0x1cd)]),_0x2f71ac=_0xe05afc[_0x64881f(0x204)](_0x31b7d8=>!_0x31b7d8['isNew']&&!_0x31b7d8[_0x64881f(0x1cd)]),_0x3e2a88=_0x57935f?_0x5bde1f:[],_0x496938=_0x4686d7['flatMap'](_0x59ef42=>_0x59ef42['activationActions']),_0x4e6005=_0x496938['filter'](_0x122d1e=>_0x122d1e[_0x64881f(0x25e)]===_0x64881f(0x1f4)),_0x4ed051=_0x496938[_0x64881f(0x204)](_0x5735ba=>_0x5735ba[_0x64881f(0x25e)]===_0x64881f(0x248)),_0x2c1c4b=_0x496938[_0x64881f(0x204)](_0x4b060b=>_0x4b060b[_0x64881f(0x25e)]===_0x64881f(0x1f2)),_0x230d24=Array['from'](_0x212c62)[_0x64881f(0x273)](),_0x4f6f0d=_0x889b86?![]:_0x58b2ba['length']>0x0||_0x2c6338[_0x64881f(0x1e6)]>0x0||_0x4f1bdf[_0x64881f(0x1e6)]>0x0,_0x43e074=_0x103375[_0x64881f(0x1e6)]>0x0||_0x26672e['length']>0x0||_0x3e2a88[_0x64881f(0x1e6)]>0x0,_0x4b7559=_0x889b86?![]:_0x496938[_0x64881f(0x1e6)]>0x0,_0x300db2=_0x230d24[_0x64881f(0x1e6)]>0x0;return{'segments':{'new':_0x58b2ba,'changed':_0x2c6338,'unchanged':_0x52120d,'toDelete':_0x4f1bdf},'journeys':{'new':_0x103375,'changed':_0x26672e,'unchanged':_0x2f71ac,'toDelete':_0x3e2a88},'activations':{'all':_0x496938,'toCreate':_0x4e6005,'toUpdate':_0x4ed051,'toDelete':_0x2c1c4b},'folders':{'toCreate':_0x230d24},'counts':{'segments':{'new':_0x58b2ba[_0x64881f(0x1e6)],'changed':_0x2c6338[_0x64881f(0x1e6)],'unchanged':_0x52120d['length'],'toDelete':_0x4f1bdf[_0x64881f(0x1e6)]},'journeys':{'new':_0x103375[_0x64881f(0x1e6)],'changed':_0x26672e[_0x64881f(0x1e6)],'unchanged':_0x2f71ac['length'],'toDelete':_0x3e2a88[_0x64881f(0x1e6)]},'activations':{'create':_0x4e6005['length'],'update':_0x4ed051[_0x64881f(0x1e6)],'delete':_0x2c1c4b[_0x64881f(0x1e6)]},'folders':_0x230d24['length']},'hasChanges':_0x4f6f0d||_0x43e074||_0x4b7559||_0x300db2};}export async function buildPushExecutionContext(_0x39f084,_0x2cbe96,_0x27d135,_0x4c1d9f,_0x5c96d5,_0x33b686){const _0x2c8c14=a140_0x164c64,_0x5aa0fe=extractRootFolderId(_0x27d135),{pathToId:_0x428628,idToPath:_0x1dec46}=buildFolderMaps(_0x5c96d5),_0x4f4170=buildSegmentNameToIdMap(_0x4c1d9f),_0x5e108d=new Map(),{batchAsync:_0x3e7199}=await import(_0x2c8c14(0x217)),[_0x5d3642,_0xa1b303]=await Promise[_0x2c8c14(0x291)]([_0x39f084['user'][_0x2c8c14(0x1ef)](),_0x39f084['connection'][_0x2c8c14(0x1e2)](),((async()=>{!_0x33b686&&_0x4c1d9f['length']>0x0&&await _0x3e7199(_0x4c1d9f,async _0x4d0b77=>{const _0x1a4f68=a140_0x2294,_0x27ef1e=await _0x39f084[_0x1a4f68(0x1be)][_0x1a4f68(0x1ec)](_0x2cbe96,_0x4d0b77['id']);_0x5e108d['set'](_0x4d0b77['id'],_0x27ef1e);});})())]),{emailToId:_0x4c2e32,idToEmail:_0x68d7b6}=_0x5d3642,_0x159877=buildConnectionMaps(_0xa1b303);return{'rootFolderId':_0x5aa0fe,'folderPathToId':_0x428628,'folderIdToPath':_0x1dec46,'segmentNameToId':_0x4f4170,'activationsBySegmentId':_0x5e108d,'emailToIdMap':_0x4c2e32,'idToEmailMap':_0x68d7b6,'connectionNameToIdMap':_0x159877[_0x2c8c14(0x237)],'connectionIdToNameMap':_0x159877[_0x2c8c14(0x1d1)],'connectionNameToTypeMap':_0x159877[_0x2c8c14(0x245)]};}export function createPushYamlContextForBundle(_0x4d2a07,_0x1d3963,_0x4bff36,_0x19f425,_0x498878,_0x23a565,_0x34c2ca,_0x222f26){const {existingLocalSegmentNames:_0x14bbfa,localExpandedRuleToNames:_0x46d578}=_0x19f425,_0x552684=new Set(),_0x22e651=new Map(),_0x4881bd=new Map(),_0x511ff0=new Map(),_0xf0c62c=createJumpTargetCache(),_0x257476=new Map(),_0x2a67b5=new Map(),_0x757c46=new Set();let _0x4c447f;const _0x3fad34=_0x391d41=>{const _0xaf042e={'resolveSegment':async _0x550ad6=>{const _0x3d2a0e=a140_0x2294,_0xd45dec=_0x511ff0[_0x3d2a0e(0x24d)](_0x550ad6);if(_0xd45dec!==undefined)return{'name':_0xd45dec,'isJourneyLocal':!![]};try{const _0x5d6e9d=await fetchSegment(_0x4d2a07,_0x1d3963,_0x550ad6,_0x4bff36);if(!_0x5d6e9d)throw new Error(_0x3d2a0e(0x256));const _0x3bebfe=generateJourneyLocalName(_0x5d6e9d[_0x3d2a0e(0x1c9)]),_0x4c0b2f=_0x5d6e9d['kind']===SEGMENT_KIND_JOURNEY&&_0x3bebfe!==undefined;let _0xb973f7=_0x5d6e9d[_0x3d2a0e(0x1c9)],_0x30036c;if(_0x4c0b2f&&_0x5d6e9d[_0x3d2a0e(0x210)]){const _0xc8cefd=apiRuleToYaml(_0x5d6e9d['rule']);_0x2a67b5['set'](_0x550ad6,_0xc8cefd);const _0x4063a1=async _0x142f75=>{const _0x3f687f=_0x3d2a0e,_0x277543=collectSegmentRefsFromRule(_0x142f75);for(const _0x322658 of _0x277543){if(!_0x2a67b5[_0x3f687f(0x253)](_0x322658))try{const _0x1ce0ad=await fetchSegment(_0x4d2a07,_0x1d3963,_0x322658,_0x4bff36);if(_0x1ce0ad?.[_0x3f687f(0x210)]){const _0x126660=apiRuleToYaml(_0x1ce0ad[_0x3f687f(0x210)]);_0x2a67b5['set'](_0x322658,_0x126660),await _0x4063a1(_0x126660);}}catch(_0x55f8f5){logger[_0x3f687f(0x249)](_0x3f687f(0x1c1)+_0x322658+':\x20'+_0x55f8f5);}}};await _0x4063a1(_0xc8cefd);const _0x4af1e5=serializeExpandedRule(_0xc8cefd,_0x2a67b5),_0x3627bc=_0x46d578[_0x3d2a0e(0x24d)](_0x4af1e5);if(_0x3627bc&&_0x3627bc['length']>0x0){const _0x748e69=_0x22e651[_0x3d2a0e(0x24d)](_0x4af1e5)||0x0,_0x4a109d=_0x3627bc[_0x748e69]||_0x3627bc[_0x3627bc['length']-0x1];_0x22e651[_0x3d2a0e(0x1cc)](_0x4af1e5,_0x748e69+0x1),_0xb973f7=_0x4a109d,_0x552684[_0x3d2a0e(0x2a4)](_0xb973f7),_0x511ff0[_0x3d2a0e(0x1cc)](_0x550ad6,_0xb973f7);const _0x4cf34c=await resolveRuleSegmentRefs(_0xc8cefd,async _0x4b007a=>{const _0xd201da=_0x3d2a0e,_0x1f2cac=_0x511ff0[_0xd201da(0x24d)](_0x4b007a);if(_0x1f2cac)return _0x1f2cac;const _0x3d1652=await _0x4c447f[_0xd201da(0x20f)](_0x4b007a);return _0x3d1652[_0xd201da(0x1c9)];});_0x30036c={'description':_0x5d6e9d[_0x3d2a0e(0x272)],'rule':_0x4cf34c};}else{const _0x392b52=_0x257476['get'](_0x4af1e5);if(_0x392b52)_0xb973f7=_0x392b52,_0x511ff0[_0x3d2a0e(0x1cc)](_0x550ad6,_0xb973f7);else{if(_0x3bebfe){let _0x205145=_0x3bebfe,_0x108c25=0x2;while(_0x552684['has'](_0x205145)||_0x14bbfa[_0x3d2a0e(0x253)](_0x205145)){_0x205145=_0x3bebfe+'_'+_0x108c25,_0x108c25++;}_0x552684[_0x3d2a0e(0x2a4)](_0x205145),_0xb973f7=_0x205145;}_0x511ff0[_0x3d2a0e(0x1cc)](_0x550ad6,_0xb973f7),_0x257476[_0x3d2a0e(0x1cc)](_0x4af1e5,_0xb973f7);const _0x11bb13=await resolveRuleSegmentRefs(_0xc8cefd,async _0x51d79b=>{const _0x102a46=_0x3d2a0e,_0x45ba6a=_0x511ff0[_0x102a46(0x24d)](_0x51d79b);if(_0x45ba6a)return _0x45ba6a;const _0x5ddc44=await _0x4c447f[_0x102a46(0x20f)](_0x51d79b);return _0x5ddc44[_0x102a46(0x1c9)];});_0x30036c={'description':_0x5d6e9d['description'],'rule':_0x11bb13};}}}return{'name':_0xb973f7,'isJourneyLocal':_0x4c0b2f,'definition':_0x30036c};}catch(_0x36544e){return logger[_0x3d2a0e(0x249)](_0x3d2a0e(0x26c)+_0x550ad6+':\x20'+_0x36544e),{'name':_0x550ad6,'isJourneyLocal':![]};}},'resolveActivation':async _0x27d5f1=>{const _0x3ed9ef=a140_0x2294,_0x171693=_0x4881bd['get'](_0x27d5f1);if(_0x171693!==undefined)return{'name':_0x171693,'isJourneyLocal':!![]};try{let _0x3c1e8b=_0x34c2ca?.[_0x3ed9ef(0x24d)](_0x27d5f1);!_0x3c1e8b&&(_0x3c1e8b=await _0x4d2a07[_0x3ed9ef(0x1c3)][_0x3ed9ef(0x212)](_0x391d41,_0x27d5f1));const _0xd45107=_0x3c1e8b[_0x3ed9ef(0x1e9)][_0x3ed9ef(0x2ba)]['name']||_0x27d5f1,_0x48bb3a=sanitizeYamlKey(_0xd45107)||_0x3ed9ef(0x281)+_0x27d5f1,_0x12ceaa=_0x48bb3a;_0x4881bd[_0x3ed9ef(0x1cc)](_0x27d5f1,_0x12ceaa);const _0xce9de3=journeyActivationStepToYaml(_0x3c1e8b,_0x498878,_0x23a565);return{'name':_0x12ceaa,'isJourneyLocal':!![],'definition':_0xce9de3};}catch(_0x5d0b54){return logger[_0x3ed9ef(0x249)](_0x3ed9ef(0x235)+_0x27d5f1+':\x20'+_0x5d0b54),{'name':_0x27d5f1,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x464a8f,_0x29a80a)=>resolveJumpTarget(_0x464a8f,_0x29a80a,_0xf0c62c,async _0x1e6ff0=>{const _0x48eb90=a140_0x2294,_0x4bf357=_0x222f26?.[_0x48eb90(0x24d)](_0x1e6ff0);if(_0x4bf357)return _0x4bf357;return _0x4d2a07[_0x48eb90(0x1c3)][_0x48eb90(0x2b3)](_0x1e6ff0);})};return _0x4c447f=_0xaf042e,_0xaf042e;},_0x5b3cb8=async _0x46ddd0=>{const _0x53ac98=a140_0x2294,{collectSegmentIdsFromJourneyApi:_0xa9b021}=await import(_0x53ac98(0x1e8)),{batchAsync:_0xca88a4}=await import(_0x53ac98(0x217)),_0x54d31b=new Set();for(const _0x2fc6f1 of _0x46ddd0){let _0x50ab63=_0x222f26?.[_0x53ac98(0x24d)](_0x2fc6f1);!_0x50ab63&&(_0x50ab63=await _0x4d2a07[_0x53ac98(0x1c3)][_0x53ac98(0x2b3)](_0x2fc6f1));const _0x5d2703=_0xa9b021(_0x50ab63);for(const _0x2da818 of _0x5d2703){_0x54d31b[_0x53ac98(0x2a4)](_0x2da818);}}let _0x20e864=Array[_0x53ac98(0x216)](_0x54d31b);while(_0x20e864['length']>0x0){const _0x2e50ae=_0x20e864['filter'](_0x5cea54=>!_0x757c46[_0x53ac98(0x253)](_0x5cea54));if(_0x2e50ae['length']===0x0)break;const _0x2f8d68=await _0xca88a4(_0x2e50ae,async _0x4bc3b7=>{const _0x46800e=_0x53ac98;_0x757c46[_0x46800e(0x2a4)](_0x4bc3b7);const _0x47e1c3=await fetchSegment(_0x4d2a07,_0x1d3963,_0x4bc3b7,_0x4bff36);if(!_0x47e1c3)return null;return{'segmentId':_0x4bc3b7,'segment':_0x47e1c3};},0xa),_0x3e7d7a=new Set();for(const _0x65216f of _0x2f8d68){if(!_0x65216f?.[_0x53ac98(0x1be)]?.[_0x53ac98(0x210)])continue;const _0x42bdc4=apiRuleToYaml(_0x65216f[_0x53ac98(0x1be)][_0x53ac98(0x210)]);_0x2a67b5['set'](_0x65216f[_0x53ac98(0x279)],_0x42bdc4);const _0x2ae422=collectSegmentRefsFromRule(_0x42bdc4);for(const _0x1478e6 of _0x2ae422){!_0x757c46[_0x53ac98(0x253)](_0x1478e6)&&_0x3e7d7a[_0x53ac98(0x2a4)](_0x1478e6);}}_0x20e864=Array['from'](_0x3e7d7a);}};return{'createYamlContext':_0x3fad34,'prefetchJourneySegments':_0x5b3cb8};}export async function executePushSegments(_0x3aee1b,_0x2866c8,_0x3c8e18,_0x3e7469,_0x19e8fd){const _0x54f2a7=a140_0x164c64,{segmentDefToCreateRequest:_0x4a2143,segmentDefToUpdateRequest:_0x308abd}=await import(_0x54f2a7(0x294)),_0x57db82=_0x3c8e18[_0x54f2a7(0x1f1)],_0x460b23=0x5,_0x38a5d1=async _0x12e3b5=>{const _0x48bbcb=_0x54f2a7,_0x587052=_0x12e3b5[_0x48bbcb(0x239)]?_0x57db82[_0x48bbcb(0x24d)](_0x12e3b5[_0x48bbcb(0x239)]):undefined;let _0x474edc;const _0x51f6b1={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xc981cb=_0x12e3b5[_0x48bbcb(0x221)];if(_0x12e3b5['yamlConfig']['rule']){const _0x4792e0=createSegmentIdResolver(_0x3c8e18[_0x48bbcb(0x1d4)],_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]),_0x1c10c5=await resolveRuleSegmentIds(_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x210)],_0x4792e0);_0xc981cb={..._0x12e3b5[_0x48bbcb(0x221)],'rule':_0x1c10c5};}try{if(_0x12e3b5[_0x48bbcb(0x1da)]){_0x19e8fd['onProgress']?.({'type':_0x48bbcb(0x220),'name':_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]});const _0x2510e7=_0x4a2143(_0xc981cb,_0x587052),_0x4d7e24=await _0x19e8fd[_0x48bbcb(0x24c)](_0x48bbcb(0x203)+_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]+_0x48bbcb(0x20d),()=>_0x3aee1b['segment']['createSegment'](_0x3e7469['parentId'],_0x2510e7));_0x474edc=_0x4d7e24[_0x48bbcb(0x254)]['id'],_0x3c8e18[_0x48bbcb(0x1d4)][_0x48bbcb(0x1cc)](_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)],_0x474edc),_0x51f6b1['createdSegmentId']={'name':_0x12e3b5[_0x48bbcb(0x221)]['name'],'id':_0x474edc},_0x19e8fd[_0x48bbcb(0x1d2)]?.({'type':_0x48bbcb(0x266),'name':_0x12e3b5['yamlConfig']['name'],'segmentId':_0x474edc}),_0x19e8fd[_0x48bbcb(0x2b0)]?.(_0x48bbcb(0x1bd)+_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]+'\x27'),_0x51f6b1[_0x48bbcb(0x23b)]=0x1;}else{if(_0x12e3b5[_0x48bbcb(0x1cd)]){_0x19e8fd[_0x48bbcb(0x1d2)]?.({'type':_0x48bbcb(0x1f3),'name':_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]});const _0x1cc504=_0x308abd(_0xc981cb);_0x587052!==_0x12e3b5[_0x48bbcb(0x21a)]?.[_0x48bbcb(0x1de)]&&(_0x1cc504[_0x48bbcb(0x1de)]=_0x587052?parseInt(_0x587052,0xa):undefined),await _0x19e8fd[_0x48bbcb(0x24c)]('Updating\x20segment\x20\x27'+_0x12e3b5['yamlConfig']['name']+_0x48bbcb(0x20d),()=>_0x3aee1b['segment'][_0x48bbcb(0x261)](_0x3e7469[_0x48bbcb(0x20b)],_0x12e3b5[_0x48bbcb(0x21a)]['id'],_0x1cc504)),_0x474edc=_0x12e3b5[_0x48bbcb(0x21a)]['id'],_0x19e8fd[_0x48bbcb(0x1d2)]?.({'type':'segment_updated','name':_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]}),_0x19e8fd['logSuccess']?.(_0x48bbcb(0x2ac)+_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]+'\x27'),_0x51f6b1['updated']=0x1;}else _0x474edc=_0x12e3b5[_0x48bbcb(0x21a)]['id'];}}catch(_0x2b3a3d){const _0x61b722=isHttp400Error(_0x2b3a3d),_0x507053=_0x61b722?ErrorCode[_0x48bbcb(0x29c)]:ErrorCode[_0x48bbcb(0x1d0)],_0x54b617=getErrorMessage(_0x2b3a3d);throw new SDKError(_0x507053,_0x48bbcb(0x275)+(_0x12e3b5[_0x48bbcb(0x1da)]?_0x48bbcb(0x1f4):_0x48bbcb(0x248))+_0x48bbcb(0x28b)+_0x12e3b5[_0x48bbcb(0x1bb)]+'\x0a\x20\x20'+_0x54b617,_0x2b3a3d);}try{const _0x2f47eb=await syncActivationsForSegment(_0x3aee1b,_0x3e7469[_0x48bbcb(0x20b)],_0x474edc,_0x12e3b5['yamlConfig']['name'],_0x12e3b5['activationActions'],_0x19e8fd,_0x12e3b5['absolutePath']);_0x51f6b1[_0x48bbcb(0x29e)]=_0x2f47eb;}catch(_0x4531ba){if(_0x4531ba instanceof SDKError)throw _0x4531ba;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x48bbcb(0x28e)+_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]+'\x27\x20from\x20file:\x20'+_0x12e3b5[_0x48bbcb(0x1bb)]+'\x0a\x20\x20'+getErrorMessage(_0x4531ba),_0x4531ba);}return _0x51f6b1;},_0x66dfcf=await batchAsync(_0x2866c8,_0x38a5d1,_0x460b23),_0x1b1250={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xe499b1 of _0x66dfcf){_0x1b1250['created']+=_0xe499b1['created'],_0x1b1250[_0x54f2a7(0x1f5)]+=_0xe499b1[_0x54f2a7(0x1f5)],_0xe499b1['createdSegmentId']&&_0x1b1250['createdSegmentIds'][_0x54f2a7(0x1cc)](_0xe499b1['createdSegmentId'][_0x54f2a7(0x1c9)],_0xe499b1[_0x54f2a7(0x25b)]['id']),_0x1b1250['activations'][_0x54f2a7(0x23b)]+=_0xe499b1[_0x54f2a7(0x29e)]['created'],_0x1b1250[_0x54f2a7(0x29e)]['updated']+=_0xe499b1[_0x54f2a7(0x29e)][_0x54f2a7(0x1f5)],_0x1b1250['activations'][_0x54f2a7(0x290)]+=_0xe499b1[_0x54f2a7(0x29e)][_0x54f2a7(0x290)];}return _0x1b1250;}async function syncActivationsForSegment(_0x5becd2,_0x379ab0,_0x1f914f,_0x26510f,_0x2042d9,_0x311069,_0x1ab2f3){const _0x31bd34=a140_0x164c64,_0x404c40={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x17003d of _0x2042d9){try{if(_0x17003d['type']==='create'&&_0x17003d[_0x31bd34(0x28f)])_0x311069[_0x31bd34(0x1d2)]?.({'type':_0x31bd34(0x27e),'segmentName':_0x26510f,'activationName':_0x17003d['name']}),await _0x311069[_0x31bd34(0x24c)](_0x31bd34(0x27a)+_0x17003d[_0x31bd34(0x1c9)]+_0x31bd34(0x20d),()=>_0x5becd2[_0x31bd34(0x1be)]['createActivation'](_0x379ab0,_0x1f914f,_0x17003d['validatedRequest'])),_0x311069['onProgress']?.({'type':_0x31bd34(0x1fe),'segmentName':_0x26510f,'activationName':_0x17003d[_0x31bd34(0x1c9)]}),_0x311069[_0x31bd34(0x2b0)]?.('Created\x20activation\x20\x27'+_0x17003d['name']+'\x27'),_0x404c40['created']++;else{if(_0x17003d[_0x31bd34(0x25e)]===_0x31bd34(0x248)&&_0x17003d[_0x31bd34(0x28f)]&&_0x17003d[_0x31bd34(0x25f)])_0x311069['onProgress']?.({'type':_0x31bd34(0x260),'segmentName':_0x26510f,'activationName':_0x17003d[_0x31bd34(0x1c9)]}),await _0x311069[_0x31bd34(0x24c)](_0x31bd34(0x1ca)+_0x17003d[_0x31bd34(0x1c9)]+_0x31bd34(0x20d),()=>_0x5becd2[_0x31bd34(0x1be)]['updateActivation'](_0x379ab0,_0x1f914f,_0x17003d[_0x31bd34(0x25f)]['id'],_0x17003d[_0x31bd34(0x28f)])),_0x311069[_0x31bd34(0x1d2)]?.({'type':'activation_updated','segmentName':_0x26510f,'activationName':_0x17003d[_0x31bd34(0x1c9)]}),_0x311069['logSuccess']?.(_0x31bd34(0x25a)+_0x17003d[_0x31bd34(0x1c9)]+'\x27'),_0x404c40['updated']++;else _0x17003d[_0x31bd34(0x25e)]===_0x31bd34(0x1f2)&&_0x17003d['existingActivation']&&(_0x311069[_0x31bd34(0x1d2)]?.({'type':'activation_deleting','segmentName':_0x26510f,'activationName':_0x17003d['name']}),await _0x311069['withProgress'](_0x31bd34(0x2c3)+_0x17003d[_0x31bd34(0x1c9)]+'\x27...',()=>_0x5becd2[_0x31bd34(0x1be)][_0x31bd34(0x296)](_0x379ab0,_0x1f914f,_0x17003d[_0x31bd34(0x25f)]['id'])),_0x311069[_0x31bd34(0x1d2)]?.({'type':'activation_deleted','segmentName':_0x26510f,'activationName':_0x17003d[_0x31bd34(0x1c9)]}),_0x311069[_0x31bd34(0x274)]?.(_0x31bd34(0x1c5)+_0x17003d[_0x31bd34(0x1c9)]+'\x27'),_0x404c40['deleted']++);}}catch(_0x2e8ba0){const _0x4e6092=isHttp400Error(_0x2e8ba0),_0x17da9f=_0x4e6092?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x31bd34(0x1df)],_0x476ad6=getErrorMessage(_0x2e8ba0);throw new SDKError(_0x17da9f,_0x31bd34(0x275)+_0x17003d['type']+_0x31bd34(0x1e7)+_0x17003d['name']+_0x31bd34(0x282)+_0x1ab2f3+_0x31bd34(0x209)+_0x476ad6,_0x2e8ba0);}}return _0x404c40;}export async function executePushFolders(_0x55d353,_0x5f3090,_0x2c8d6d,_0x33944f,_0x265f6d){const _0x3a7758=a140_0x164c64,_0x3e112d=new Map(_0x2c8d6d),_0x30ff0e=sortFoldersByDepth(_0x5f3090);for(const _0x38d02e of _0x30ff0e){const _0x4a3fff=_0x38d02e[_0x3a7758(0x285)]('/'),_0x176087=_0x4a3fff[_0x4a3fff['length']-0x1],_0x5e0c07=_0x4a3fff['slice'](0x0,-0x1)['join']('/'),_0x42b004=_0x3e112d[_0x3a7758(0x24d)](_0x5e0c07);_0x265f6d[_0x3a7758(0x1d2)]?.({'type':_0x3a7758(0x2a3),'folder':_0x38d02e});const _0x279795={'name':_0x176087,'parentFolderId':_0x42b004},_0x305333=await _0x265f6d[_0x3a7758(0x24c)]('Creating\x20folder\x20\x27'+_0x38d02e+_0x3a7758(0x20d),()=>_0x55d353['segment']['createFolder'](_0x33944f['parentId'],_0x279795));_0x3e112d[_0x3a7758(0x1cc)](_0x38d02e,_0x305333[_0x3a7758(0x254)]['id']),_0x265f6d[_0x3a7758(0x1d2)]?.({'type':_0x3a7758(0x2be),'folder':_0x38d02e,'folderId':_0x305333[_0x3a7758(0x254)]['id']}),_0x265f6d[_0x3a7758(0x278)]?.('Created\x20folder\x20\x27'+_0x38d02e+'\x27');}return _0x3e112d;}export async function executePushSegmentDeletions(_0x524702,_0x5887f2,_0x2b7953){const _0x4c5d50=a140_0x164c64;if(_0x5887f2[_0x4c5d50(0x1e6)]===0x0)return 0x0;const {batchAsync:_0x1a9b2e}=await import('../../utils/async.js'),_0x4ac3db=0x5,_0x279027=await _0x1a9b2e(_0x5887f2,async _0x207d62=>{const _0x82ee18=_0x4c5d50;return _0x2b7953['onProgress']?.({'type':_0x82ee18(0x289),'name':_0x207d62[_0x82ee18(0x1c9)]}),await _0x524702[_0x82ee18(0x1be)][_0x82ee18(0x299)](_0x207d62['id']),_0x2b7953[_0x82ee18(0x1d2)]?.({'type':_0x82ee18(0x200),'name':_0x207d62[_0x82ee18(0x1c9)]}),_0x2b7953[_0x82ee18(0x274)]?.('Deleted\x20segment\x20\x27'+_0x207d62[_0x82ee18(0x1c9)]+'\x27'),0x1;},_0x4ac3db);return _0x279027[_0x4c5d50(0x1f7)]((_0x235d6a,_0x47bb70)=>_0x235d6a+_0x47bb70,0x0);}export async function executePushJourneys(_0x31115c,_0x34b3ed,_0x500fd2,_0x58f668,_0x1bbec6){const _0x8b584c=a140_0x164c64,{journeyDefToRequest:_0x1441e5}=await import(_0x8b584c(0x1e8)),{activationDefToCreateRequest:_0x1ce11f,yamlRuleToApi:_0x3ef54f,validateSegmentRule:_0x549d95}=await import('./child-segment-yaml.js'),_0x14ea79={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x22df12=new Map(_0x500fd2[_0x8b584c(0x1d4)]),_0x5bfd6b=0x5;for(let _0x345dfc=0x0;_0x345dfc<_0x34b3ed['length'];_0x345dfc+=_0x5bfd6b){const _0x16a28d=_0x34b3ed['slice'](_0x345dfc,_0x345dfc+_0x5bfd6b),_0x2b791a=await Promise[_0x8b584c(0x291)](_0x16a28d['map'](async _0x5a8827=>{const _0x4e2621=_0x8b584c;if(!_0x5a8827[_0x4e2621(0x1da)]&&!_0x5a8827[_0x4e2621(0x1cd)])return{'action':'unchanged','name':_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)],'journeyId':_0x5a8827[_0x4e2621(0x2b1)]?.['id']};const _0x222fcb=_0x5a8827[_0x4e2621(0x239)]?_0x500fd2['folderPathToId']['get'](_0x5a8827[_0x4e2621(0x239)]):undefined;_0x1bbec6[_0x4e2621(0x1d2)]?.({'type':_0x5a8827[_0x4e2621(0x1da)]?_0x4e2621(0x1e0):_0x4e2621(0x263),'name':_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)]});try{const _0x1c9745=await executeSingleJourneyPush(_0x31115c,_0x5a8827,{..._0x500fd2,'segmentNameToId':_0x22df12},{'parentId':_0x58f668[_0x4e2621(0x20b)],'rootFolderId':_0x58f668[_0x4e2621(0x2bb)],'folderId':_0x222fcb,'verbose':_0x58f668[_0x4e2621(0x1e5)]},_0x1bbec6,{'journeyDefToRequest':_0x1441e5,'activationDefToCreateRequest':_0x1ce11f,'yamlRuleToApi':_0x3ef54f,'validateSegmentRule':_0x549d95});for(const [_0x504910,_0x2954ce]of _0x1c9745[_0x4e2621(0x22d)]){_0x22df12[_0x4e2621(0x1cc)](_0x504910,_0x2954ce),_0x14ea79['embeddedSegmentNameToId'][_0x4e2621(0x1cc)](_0x504910,_0x2954ce);}if(_0x1c9745[_0x4e2621(0x1fc)]===_0x4e2621(0x23b))_0x1bbec6['onProgress']?.({'type':'journey_created','name':_0x5a8827['yamlConfig']['name'],'journeyId':_0x1c9745[_0x4e2621(0x1f6)]}),_0x1bbec6[_0x4e2621(0x2b0)]?.('Created\x20journey\x20\x27'+_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)]+'\x27'),_0x14ea79['created']++;else _0x1c9745[_0x4e2621(0x1fc)]===_0x4e2621(0x1f5)&&(_0x1bbec6[_0x4e2621(0x1d2)]?.({'type':_0x4e2621(0x23c),'name':_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)]}),_0x1bbec6[_0x4e2621(0x2b0)]?.(_0x4e2621(0x2b4)+_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)]+'\x27'),_0x14ea79['updated']++);return{'action':_0x1c9745['action'],'name':_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)],'journeyId':_0x1c9745['journeyId']};}catch(_0x3d7a3b){const _0x28bc0f=isHttp400Error(_0x3d7a3b),_0x82e846=_0x28bc0f?ErrorCode[_0x4e2621(0x283)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x4e73a4=getErrorMessage(_0x3d7a3b);throw new SDKError(_0x82e846,_0x4e2621(0x275)+(_0x5a8827['isNew']?'create':_0x4e2621(0x248))+_0x4e2621(0x1c7)+_0x5a8827[_0x4e2621(0x1bb)]+_0x4e2621(0x209)+_0x4e73a4,_0x3d7a3b);}}));_0x14ea79[_0x8b584c(0x284)][_0x8b584c(0x1e1)](..._0x2b791a);}return _0x14ea79;}async function matchExistingJourneySegments(_0x25a151,_0x5a8a8d,_0x5f2931,_0x3a3461,_0x245156){const _0x641045=a140_0x164c64;if(!_0x5a8a8d[_0x641045(0x2b1)]||!_0x5a8a8d[_0x641045(0x221)][_0x641045(0x23d)])return;const _0x4e216d=new Map(),_0x164b86=new Set();for(const _0xaf5e0c of Object[_0x641045(0x238)](_0x5a8a8d[_0x641045(0x221)][_0x641045(0x23d)])){const _0xdb652c=generateDeterministicJourneySegmentName(_0x5a8a8d[_0x641045(0x221)][_0x641045(0x1c9)],_0xaf5e0c);_0x4e216d[_0x641045(0x1cc)](_0xdb652c,_0xaf5e0c),_0x164b86[_0x641045(0x2a4)](_0xaf5e0c);}const _0xebb6ea=[],_0x3071ce=collectSegmentIdsFromJourneyApi(_0x5a8a8d[_0x641045(0x2b1)]);for(const _0x5a1c49 of _0x3071ce){const _0x2f85dc=await fetchSegment(_0x25a151,_0x5f2931,_0x5a1c49,_0x3a3461);if(!_0x2f85dc?.[_0x641045(0x1c9)])continue;const _0x10d1bd=_0x4e216d[_0x641045(0x24d)](_0x2f85dc[_0x641045(0x1c9)]);_0x10d1bd?(_0x245156[_0x641045(0x1cc)](_0x10d1bd,_0x5a1c49),_0x164b86[_0x641045(0x1f2)](_0x10d1bd)):_0xebb6ea[_0x641045(0x1e1)]({'id':_0x5a1c49,'seg':_0x2f85dc});}if(_0x164b86[_0x641045(0x231)]>0x0&&_0xebb6ea[_0x641045(0x1e6)]>0x0){const {localExpandedRuleToNames:_0x2c7b8d}=buildLocalExpandedRuleMappings(_0x5a8a8d[_0x641045(0x221)]),_0x1fde4c=new Map();for(const {id:_0x4ec257,seg:_0xef9b73}of _0xebb6ea){if(_0xef9b73['rule']){const _0xabc8b3=apiRuleToYaml(_0xef9b73[_0x641045(0x210)]);_0x1fde4c[_0x641045(0x1cc)](_0x4ec257,_0xabc8b3);}}for(const {id:_0x44cdef,seg:_0x1ec45f}of _0xebb6ea){if(!_0x1ec45f[_0x641045(0x210)])continue;const _0x1388a2=_0x1fde4c[_0x641045(0x24d)](_0x44cdef);if(!_0x1388a2)continue;const _0x27dcc1=serializeExpandedRule(_0x1388a2,_0x1fde4c),_0x37ad28=_0x2c7b8d[_0x641045(0x24d)](_0x27dcc1);if(_0x37ad28){const _0x366e02=_0x37ad28['find'](_0x37f5ff=>_0x164b86[_0x641045(0x253)](_0x37f5ff));_0x366e02&&(_0x245156['set'](_0x366e02,_0x44cdef),_0x164b86[_0x641045(0x1f2)](_0x366e02),logger[_0x641045(0x249)](_0x641045(0x1fd)+_0x1ec45f[_0x641045(0x1c9)]+_0x641045(0x229)+_0x366e02+_0x641045(0x1e3)));}}}}async function executeSingleJourneyPush(_0x587ebe,_0x302ad6,_0x49590b,_0x29fec0,_0x464fea,_0x16a080){const _0x24c773=a140_0x164c64,{journeyDefToRequest:_0x16cb70,activationDefToCreateRequest:_0x58e9ce,yamlRuleToApi:_0x546d2e,validateSegmentRule:_0xd991c4}=_0x16a080,_0x5c9d7a=new Map(),_0x4a8191=new Map();recoverSegmentIdsFromPushRecovery(_0x302ad6,_0x5c9d7a,_0x49590b[_0x24c773(0x1d4)]);const _0x2e1cd9=new Map(),_0x2bc51e=new Map(),_0x7c2038=new Map();let _0x1409d1;const _0x18edb8=async()=>{const _0xb2d71=_0x24c773;if(_0x1409d1)return;_0x1409d1=new Map();if(!_0x302ad6[_0xb2d71(0x2b1)])return;const _0xe604ed=await _0x587ebe[_0xb2d71(0x1c3)]['listActivations'](_0x302ad6[_0xb2d71(0x2b1)]['id']);for(const _0x2064e9 of _0xe604ed){const _0x1d7c5a=journeyActivationStepToYaml(_0x2064e9,_0x49590b[_0xb2d71(0x2b8)],_0x49590b[_0xb2d71(0x20a)]),_0x331d3d=activationSignature(_0x1d7c5a);!_0x1409d1[_0xb2d71(0x253)](_0x331d3d)&&_0x1409d1[_0xb2d71(0x1cc)](_0x331d3d,_0x2064e9['id']),_0x1d7c5a['name']&&_0x4a8191[_0xb2d71(0x1cc)](_0x1d7c5a[_0xb2d71(0x1c9)],_0x2064e9['id']);}};await matchExistingJourneySegments(_0x587ebe,_0x302ad6,_0x29fec0[_0x24c773(0x20b)],_0x49590b[_0x24c773(0x23f)],_0x49590b[_0x24c773(0x1d4)]);const _0x59917f={'resolveSegmentId':async _0x1b3f32=>{const _0x338b24=_0x24c773,_0x931e6e=_0x49590b['segmentNameToId'][_0x338b24(0x24d)](_0x1b3f32);if(!_0x931e6e)throw new SDKError(ErrorCode[_0x338b24(0x228)],_0x338b24(0x1ee)+_0x1b3f32+_0x338b24(0x211)+_0x302ad6[_0x338b24(0x221)][_0x338b24(0x1c9)]+')');return _0x931e6e;},'resolveEmbeddedSegmentId':async(_0x27254c,_0x1e7e82)=>{const _0x3058c3=_0x24c773,_0x2d2fea=_0x49590b[_0x3058c3(0x1d4)][_0x3058c3(0x24d)](_0x27254c);if(_0x2d2fea)return _0x2d2fea;const _0x353668=_0x49590b['existingSegments'][_0x3058c3(0x271)](_0x3f7c2a=>_0x3f7c2a[_0x3058c3(0x1c9)]===_0x27254c);if(_0x353668)return _0x49590b[_0x3058c3(0x1d4)][_0x3058c3(0x1cc)](_0x27254c,_0x353668['id']),_0x353668['id'];if(_0x302ad6['isNew']){const {stageName:_0x178831,criteriaName:_0x540a57}=findSegmentCriteriaLocation(_0x302ad6[_0x3058c3(0x221)],_0x27254c);return _0xd991c4(_0x27254c,_0x1e7e82['rule']),_0x2bc51e['set'](_0x27254c,{'definition':_0x1e7e82,'stageName':_0x178831,'criteriaName':_0x540a57}),createPendingSegmentId(_0x27254c);}const _0x2a32d1=_0x302ad6[_0x3058c3(0x2b1)]?.['id'];if(!_0x2a32d1)throw new SDKError(ErrorCode['INTERNAL'],_0x3058c3(0x1bf));const _0xd32cae=_0x2e1cd9[_0x3058c3(0x24d)](_0x27254c);if(_0xd32cae)return _0xd32cae;const _0x254b1d=((async()=>{const _0x545d83=_0x3058c3;_0xd991c4(_0x27254c,_0x1e7e82['rule']);const _0xc6a83d=generateDeterministicJourneySegmentName(_0x302ad6[_0x545d83(0x221)][_0x545d83(0x1c9)],_0x27254c),_0x30bfd0=_0x49590b[_0x545d83(0x23f)][_0x545d83(0x271)](_0x8d6d9a=>_0x8d6d9a[_0x545d83(0x1c9)]===_0xc6a83d),_0x5f1cd1=createSegmentIdResolver(_0x49590b[_0x545d83(0x1d4)],_0x27254c),_0x31a44f=await resolveRuleSegmentIds(_0x1e7e82[_0x545d83(0x210)],_0x5f1cd1);let _0x26bddf;return _0x30bfd0?(await _0x587ebe[_0x545d83(0x1be)][_0x545d83(0x261)](_0x29fec0[_0x545d83(0x20b)],_0x30bfd0['id'],{'description':_0x1e7e82[_0x545d83(0x272)]||_0x545d83(0x223)+_0x27254c,'rule':_0x546d2e(_0x31a44f,!![]),'countPopulation':!![]}),_0x26bddf=_0x30bfd0['id'],saveSegmentToPushRecovery(_0x302ad6[_0x545d83(0x1bb)],_0x302ad6[_0x545d83(0x221)][_0x545d83(0x1c9)],_0x27254c,{'segmentId':_0x26bddf,'uniqueServerName':_0xc6a83d,'createdAt':new Date()[_0x545d83(0x292)]()})):_0x26bddf=await createOrRecoverEmbeddedSegment(_0x587ebe,_0x302ad6,{'localName':_0x27254c,'uniqueSegmentName':_0xc6a83d,'description':_0x1e7e82['description']||_0x545d83(0x223)+_0x27254c,'journeyId':_0x2a32d1,'resolvedRule':_0x31a44f,'parentId':_0x29fec0[_0x545d83(0x20b)],'folderId':_0x29fec0[_0x545d83(0x2bb)]||''},_0x546d2e),_0x49590b[_0x545d83(0x1d4)]['set'](_0x27254c,_0x26bddf),_0x5c9d7a[_0x545d83(0x1cc)](_0x27254c,_0x26bddf),_0x26bddf;})());_0x2e1cd9[_0x3058c3(0x1cc)](_0x27254c,_0x254b1d);try{return await _0x254b1d;}finally{_0x2e1cd9[_0x3058c3(0x1f2)](_0x27254c);}},'resolveActivationId':async _0x4563cf=>{const _0x3a714e=_0x24c773,_0x4785e0=_0x4a8191[_0x3a714e(0x24d)](_0x4563cf);if(_0x4785e0)return _0x4785e0;if(_0x302ad6[_0x3a714e(0x2b1)]){await _0x18edb8();const _0x442cc8=_0x4a8191[_0x3a714e(0x24d)](_0x4563cf);if(_0x442cc8)return _0x442cc8;}throw new SDKError(ErrorCode[_0x3a714e(0x1d8)],_0x3a714e(0x226)+_0x4563cf+_0x3a714e(0x211)+_0x302ad6[_0x3a714e(0x221)][_0x3a714e(0x1c9)]+').\x20'+_0x3a714e(0x26e));},'resolveEmbeddedActivationId':async(_0xc966f4,_0x14a42d)=>{const _0x510321=_0x24c773,_0x11b3ac=_0x4a8191[_0x510321(0x24d)](_0xc966f4);if(_0x11b3ac)return _0x11b3ac;if(_0x302ad6['isNew'])return _0x7c2038[_0x510321(0x1cc)](_0xc966f4,_0x14a42d),createPendingActivationId(_0xc966f4);if(_0x302ad6[_0x510321(0x2b1)]){await _0x18edb8();const _0x136b98=_0x4a8191[_0x510321(0x24d)](_0x14a42d['name']);if(_0x136b98)return _0x4a8191[_0x510321(0x1cc)](_0xc966f4,_0x136b98),_0x136b98;const _0x1de494=activationSignature(_0x14a42d),_0x544b8f=_0x1409d1?.[_0x510321(0x24d)](_0x1de494);if(_0x544b8f)return _0x4a8191[_0x510321(0x1cc)](_0xc966f4,_0x544b8f),_0x544b8f;const _0x3ffc3b=await _0x58e9ce(_0x14a42d,_0x49590b[_0x510321(0x2bc)]),_0x25e171={..._0x3ffc3b,..._0x14a42d[_0x510321(0x2a2)]!==undefined&&{'runAfterJourneyRefresh':_0x14a42d[_0x510321(0x2a2)]}},_0x82aab=await _0x587ebe[_0x510321(0x1c3)][_0x510321(0x28d)](_0x302ad6[_0x510321(0x2b1)]['id'],_0x25e171);return _0x4a8191[_0x510321(0x1cc)](_0xc966f4,_0x82aab['id']),_0x82aab['id'];}throw new SDKError(ErrorCode[_0x510321(0x1d7)],_0x510321(0x242));},'resolveJourneyId':async _0x213948=>{const _0x47bf4e=_0x24c773;try{return await _0x587ebe[_0x47bf4e(0x1c3)][_0x47bf4e(0x25c)](_0x29fec0[_0x47bf4e(0x20b)],_0x213948);}catch(_0x7a2c48){throw new SDKError(ErrorCode[_0x47bf4e(0x1d8)],_0x47bf4e(0x22f)+_0x213948+_0x47bf4e(0x1c2)+_0x302ad6[_0x47bf4e(0x221)][_0x47bf4e(0x1c9)]+'\x27)',_0x7a2c48);}},'resolveStageId':async(_0x549a97,_0x110b23)=>{const _0x566fd3=_0x24c773,_0x1b141c=await _0x587ebe['journey'][_0x566fd3(0x2b3)](_0x549a97),_0x505261=_0x1b141c[_0x566fd3(0x1e9)]['journeyStages']['find'](_0x3ede2d=>_0x3ede2d[_0x566fd3(0x1c9)][_0x566fd3(0x287)]()===_0x110b23[_0x566fd3(0x287)]());if(!_0x505261?.['id'])throw new SDKError(ErrorCode[_0x566fd3(0x1d8)],_0x566fd3(0x264)+_0x110b23+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x1b141c[_0x566fd3(0x1e9)][_0x566fd3(0x225)]||_0x1b141c[_0x566fd3(0x1e9)][_0x566fd3(0x1c9)])+'\x27');return _0x505261['id'];}},_0x15c539=await _0x16cb70(_0x302ad6[_0x24c773(0x221)],_0x29fec0['parentId'],_0x59917f),_0x41445d=_0x29fec0[_0x24c773(0x2ab)]||_0x29fec0['rootFolderId'];_0x41445d&&(_0x15c539[_0x24c773(0x286)]={'parentFolder':{'data':{'id':_0x41445d,'type':_0x24c773(0x277)}}});if(_0x302ad6[_0x24c773(0x1da)]){if(_0x2bc51e[_0x24c773(0x231)]>0x0||_0x7c2038[_0x24c773(0x231)]>0x0)return await executeThreeStepJourneyCreate(_0x587ebe,_0x302ad6,_0x15c539,{'pendingEmbeddedSegments':_0x2bc51e,'pendingEmbeddedActivations':_0x7c2038,'embeddedSegmentNameToId':_0x5c9d7a,'journeyActivationNameToId':_0x4a8191},{..._0x29fec0,'effectiveFolderId':_0x41445d},_0x49590b,_0x464fea,_0x16a080);else{ensureJourneyDefaults(_0x15c539[_0x24c773(0x1e9)]);const _0xaec86b=await _0x587ebe['journey'][_0x24c773(0x1f4)](_0x15c539);return deletePushRecovery(_0x302ad6[_0x24c773(0x1bb)]),{'action':_0x24c773(0x23b),'journeyId':_0xaec86b['id'],'embeddedSegmentNameToId':_0x5c9d7a};}}else{if(_0x302ad6[_0x24c773(0x1cd)]&&_0x302ad6[_0x24c773(0x2b1)]){_0x15c539['id']=_0x302ad6[_0x24c773(0x2b1)]['id'];const _0x2d865=_0x15c539[_0x24c773(0x1e9)];_0x302ad6[_0x24c773(0x2b1)][_0x24c773(0x1e9)]?.['journeyBundleName']&&(_0x2d865[_0x24c773(0x225)]=_0x302ad6['existingJourney'][_0x24c773(0x1e9)][_0x24c773(0x225)]);const _0x1a1268=_0x302ad6[_0x24c773(0x2b1)][_0x24c773(0x1e9)]?.[_0x24c773(0x247)];return _0x1a1268&&_0x15c539[_0x24c773(0x1e9)][_0x24c773(0x247)]&&injectExistingStageIds(_0x15c539[_0x24c773(0x1e9)][_0x24c773(0x247)],_0x1a1268),ensureJourneyDefaults(_0x2d865),await _0x587ebe[_0x24c773(0x1c3)][_0x24c773(0x248)](_0x302ad6[_0x24c773(0x2b1)]['id'],_0x15c539),deletePushRecovery(_0x302ad6[_0x24c773(0x1bb)]),{'action':_0x24c773(0x1f5),'journeyId':_0x302ad6[_0x24c773(0x2b1)]['id'],'embeddedSegmentNameToId':_0x5c9d7a};}}return deletePushRecovery(_0x302ad6['absolutePath']),{'action':_0x24c773(0x232),'journeyId':_0x302ad6[_0x24c773(0x2b1)]?.['id'],'embeddedSegmentNameToId':_0x5c9d7a};}function findSegmentCriteriaLocation(_0x289d1e,_0x3c5d7d){const _0x38bf4f=a140_0x164c64,_0x527b05=_0x289d1e[_0x38bf4f(0x222)]||_0x289d1e[_0x38bf4f(0x205)]?.[0x0]?.['stages']||[];let _0x294331=_0x38bf4f(0x1ce),_0x2bfcaa=_0x3c5d7d;const _0x589d80=_0x289d1e[_0x38bf4f(0x257)]||_0x289d1e['journeys']?.[0x0]?.[_0x38bf4f(0x257)];if(_0x589d80?.['segment']===_0x3c5d7d)return{'stageName':'goal','criteriaName':_0x589d80[_0x38bf4f(0x1c9)]||_0x3c5d7d};_0x2a2648:for(const _0x290cd4 of _0x527b05){if(_0x290cd4[_0x38bf4f(0x24a)]?.[_0x38bf4f(0x1be)]===_0x3c5d7d){_0x294331=_0x290cd4[_0x38bf4f(0x1c9)],_0x2bfcaa=_0x290cd4[_0x38bf4f(0x24a)]['name']||_0x3c5d7d;break;}if(_0x290cd4[_0x38bf4f(0x26b)])for(const _0x4b547c of _0x290cd4['steps']){if(_0x4b547c[_0x38bf4f(0x25e)]===_0x38bf4f(0x22a)&&_0x4b547c[_0x38bf4f(0x2a1)]?.[_0x38bf4f(0x2b6)])for(const _0x16e85c of _0x4b547c['with']['branches']){if(_0x16e85c[_0x38bf4f(0x1be)]===_0x3c5d7d){_0x294331=_0x290cd4[_0x38bf4f(0x1c9)],_0x2bfcaa=_0x16e85c[_0x38bf4f(0x1c9)]||_0x3c5d7d;break _0x2a2648;}}}}return{'stageName':_0x294331,'criteriaName':_0x2bfcaa};}async function executeThreeStepJourneyCreate(_0x4d449a,_0x446a59,_0x4731e0,_0x349992,_0x2ce902,_0xc0d4c5,_0x8efb7d,_0x5bf150){const _0x45f37a=a140_0x164c64,{activationDefToCreateRequest:_0x2c246c,yamlRuleToApi:_0x57f525}=_0x5bf150,{pendingEmbeddedSegments:_0x27c58f,pendingEmbeddedActivations:_0x28bb30,embeddedSegmentNameToId:_0x528d53}=_0x349992,_0x4f0c2b=JSON['parse'](JSON[_0x45f37a(0x27b)](_0x4731e0));ensureJourneyDefaults(_0x4f0c2b[_0x45f37a(0x1e9)]),stripPendingIds(_0x4f0c2b);const _0x1b4c0d=await _0x4d449a[_0x45f37a(0x1c3)][_0x45f37a(0x1f4)](_0x4f0c2b),_0x3253e9=_0x1b4c0d['id'],_0x3946ac=new Map();for(const _0x257860 of _0x1b4c0d[_0x45f37a(0x1e9)][_0x45f37a(0x247)]){_0x3946ac[_0x45f37a(0x1cc)](_0x257860[_0x45f37a(0x1c9)][_0x45f37a(0x287)](),_0x257860['id']);}recoverSegmentIdsFromPushRecovery(_0x446a59,_0x528d53,_0xc0d4c5[_0x45f37a(0x1d4)]);for(const [_0x209969,{definition:_0x11630e}]of _0x27c58f){if(_0x528d53['has'](_0x209969)){_0x8efb7d[_0x45f37a(0x1d2)]?.({'type':_0x45f37a(0x230),'journeyName':_0x446a59[_0x45f37a(0x221)]['name'],'segmentName':_0x209969});continue;}const _0x34e899=generateDeterministicJourneySegmentName(_0x446a59['yamlConfig'][_0x45f37a(0x1c9)],_0x209969);_0x8efb7d[_0x45f37a(0x1d2)]?.({'type':_0x45f37a(0x1f8),'journeyName':_0x446a59[_0x45f37a(0x221)][_0x45f37a(0x1c9)],'segmentName':_0x209969});const _0x5e92b0=createSegmentIdResolver(_0xc0d4c5[_0x45f37a(0x1d4)],_0x209969),_0x23bb04=await resolveRuleSegmentIds(_0x11630e['rule'],_0x5e92b0),_0x46f5f3=await createOrRecoverEmbeddedSegment(_0x4d449a,_0x446a59,{'localName':_0x209969,'uniqueSegmentName':_0x34e899,'description':_0x11630e[_0x45f37a(0x272)]||'Entry\x20criteria:\x20'+_0x209969,'journeyId':_0x3253e9,'resolvedRule':_0x23bb04,'parentId':_0x2ce902[_0x45f37a(0x20b)],'folderId':_0x2ce902[_0x45f37a(0x258)]||''},_0x57f525);_0x528d53[_0x45f37a(0x1cc)](_0x209969,_0x46f5f3),_0xc0d4c5['segmentNameToId'][_0x45f37a(0x1cc)](_0x209969,_0x46f5f3),_0x8efb7d['onProgress']?.({'type':_0x45f37a(0x230),'journeyName':_0x446a59[_0x45f37a(0x221)][_0x45f37a(0x1c9)],'segmentName':_0x209969});}const _0x38e409=new Map();for(const [_0x255120,_0x41c630]of _0x28bb30){_0x8efb7d[_0x45f37a(0x1d2)]?.({'type':_0x45f37a(0x27d),'journeyName':_0x446a59[_0x45f37a(0x221)][_0x45f37a(0x1c9)],'activationName':_0x255120});const _0x5e5542=await _0x2c246c(_0x41c630,_0xc0d4c5[_0x45f37a(0x2bc)]),_0x42324e={..._0x5e5542,..._0x41c630['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x41c630['run_after_journey_refresh']}},_0x55eef1=await _0x4d449a[_0x45f37a(0x1c3)][_0x45f37a(0x28d)](_0x3253e9,_0x42324e);_0x38e409[_0x45f37a(0x1cc)](_0x255120,_0x55eef1['id']),_0x349992[_0x45f37a(0x26f)][_0x45f37a(0x1cc)](_0x255120,_0x55eef1['id']),_0x8efb7d[_0x45f37a(0x1d2)]?.({'type':_0x45f37a(0x1bc),'journeyName':_0x446a59[_0x45f37a(0x221)][_0x45f37a(0x1c9)],'activationName':_0x255120});}const _0x5edf58=JSON[_0x45f37a(0x20c)](JSON[_0x45f37a(0x27b)](_0x4731e0));return _0x5edf58['id']=_0x3253e9,ensureJourneyDefaults(_0x5edf58['attributes']),resolvePendingIdsInRequest(_0x5edf58,_0x4731e0,_0x3946ac,_0x528d53,_0x38e409,_0x8efb7d),await _0x4d449a[_0x45f37a(0x1c3)][_0x45f37a(0x248)](_0x3253e9,_0x5edf58),deletePushRecovery(_0x446a59[_0x45f37a(0x1bb)]),{'action':_0x45f37a(0x23b),'journeyId':_0x3253e9,'embeddedSegmentNameToId':_0x528d53};}export function stripWaitStepPendingIds(_0x211c79){const _0x4be00d=a140_0x164c64,_0x57e97d=_0x211c79[_0x4be00d(0x202)]&&isPendingSegmentId(_0x211c79[_0x4be00d(0x202)]),_0x35c42c=_0x211c79['conditions']?.[_0x4be00d(0x1d5)](_0x40f440=>_0x40f440[_0x4be00d(0x279)]&&isPendingSegmentId(_0x40f440[_0x4be00d(0x279)]));(_0x57e97d||_0x35c42c)&&(_0x211c79[_0x4be00d(0x1f0)]=_0x4be00d(0x241),_0x211c79[_0x4be00d(0x1dc)]=0x1,_0x211c79['waitStepUnit']=_0x4be00d(0x2bf),delete _0x211c79[_0x4be00d(0x202)],delete _0x211c79[_0x4be00d(0x2b9)],delete _0x211c79['conditionTimeoutUnit'],delete _0x211c79[_0x4be00d(0x1f9)]);}export function resolveWaitStepPendingIds(_0x1dffb,_0xaa4df5,_0x1025a7,_0x16b434){const _0x51d753=a140_0x164c64;if(_0xaa4df5[_0x51d753(0x202)]&&isPendingSegmentId(_0xaa4df5['conditionSegmentId'])){const _0x33effb=_0x1025a7(_0xaa4df5[_0x51d753(0x202)],_0x51d753(0x28c)+_0x16b434+_0x51d753(0x280));_0x33effb&&(_0x1dffb[_0x51d753(0x1f0)]='Condition',_0x1dffb[_0x51d753(0x202)]=_0x33effb,delete _0x1dffb[_0x51d753(0x1dc)],delete _0x1dffb[_0x51d753(0x227)],_0xaa4df5[_0x51d753(0x2b9)]!==undefined&&(_0x1dffb[_0x51d753(0x2b9)]=_0xaa4df5[_0x51d753(0x2b9)]),_0xaa4df5['conditionTimeoutUnit']&&(_0x1dffb[_0x51d753(0x270)]=_0xaa4df5[_0x51d753(0x270)]));}if(_0xaa4df5[_0x51d753(0x1f9)]){const _0x1dd4d9=_0xaa4df5['conditions'][_0x51d753(0x1d5)](_0x25aa3b=>_0x25aa3b[_0x51d753(0x279)]&&isPendingSegmentId(_0x25aa3b[_0x51d753(0x279)]));if(_0x1dd4d9){const _0x1fa5c9=_0xaa4df5[_0x51d753(0x1f9)][_0x51d753(0x207)](_0x464336=>{const _0xc4c986=_0x51d753;if(_0x464336[_0xc4c986(0x279)]&&isPendingSegmentId(_0x464336['segmentId'])){const _0x573628=_0x1025a7(_0x464336[_0xc4c986(0x279)],'stage\x20\x27'+_0x16b434+_0xc4c986(0x280));return{..._0x464336,'segmentId':_0x573628||_0x464336[_0xc4c986(0x279)]};}return{..._0x464336};});_0x1dffb[_0x51d753(0x1f0)]=_0x51d753(0x218),_0x1dffb['conditions']=_0x1fa5c9,delete _0x1dffb[_0x51d753(0x1dc)],delete _0x1dffb[_0x51d753(0x227)],delete _0x1dffb['conditionSegmentId'],delete _0x1dffb[_0x51d753(0x2b9)],delete _0x1dffb[_0x51d753(0x270)];}}}function stripPendingIds(_0x286f11){const _0x27c6b1=a140_0x164c64;_0x286f11[_0x27c6b1(0x1e9)][_0x27c6b1(0x257)]?.[_0x27c6b1(0x279)]&&isPendingSegmentId(_0x286f11['attributes']['goal'][_0x27c6b1(0x279)])&&delete _0x286f11['attributes'][_0x27c6b1(0x257)];for(const _0x2a2361 of _0x286f11['attributes'][_0x27c6b1(0x247)]||[]){_0x2a2361[_0x27c6b1(0x24f)]?.[_0x27c6b1(0x279)]&&isPendingSegmentId(_0x2a2361[_0x27c6b1(0x24f)][_0x27c6b1(0x279)])&&delete _0x2a2361[_0x27c6b1(0x24f)];_0x2a2361[_0x27c6b1(0x1c6)]?.[_0x27c6b1(0x279)]&&isPendingSegmentId(_0x2a2361['milestone'][_0x27c6b1(0x279)])&&delete _0x2a2361['milestone'];_0x2a2361[_0x27c6b1(0x1e4)]&&(_0x2a2361[_0x27c6b1(0x1e4)]=_0x2a2361[_0x27c6b1(0x1e4)][_0x27c6b1(0x204)](_0x5d0f41=>!_0x5d0f41[_0x27c6b1(0x279)]||!isPendingSegmentId(_0x5d0f41[_0x27c6b1(0x279)])));if(_0x2a2361[_0x27c6b1(0x26b)])for(const _0x9e8b59 of Object[_0x27c6b1(0x238)](_0x2a2361['steps'])){const _0x21254b=_0x2a2361[_0x27c6b1(0x26b)][_0x9e8b59];_0x21254b[_0x27c6b1(0x25e)]===_0x27c6b1(0x22b)&&_0x21254b[_0x27c6b1(0x29a)]&&isPendingActivationId(_0x21254b['journeyActivationStepId'])&&(_0x21254b[_0x27c6b1(0x29a)]='');if(_0x21254b[_0x27c6b1(0x25e)]===_0x27c6b1(0x21d)&&_0x21254b[_0x27c6b1(0x2b6)])for(const _0x2b6d7f of _0x21254b[_0x27c6b1(0x2b6)]){_0x2b6d7f[_0x27c6b1(0x279)]&&isPendingSegmentId(_0x2b6d7f[_0x27c6b1(0x279)])&&(_0x2b6d7f['segmentId']='');}_0x21254b['type']==='WaitStep'&&stripWaitStepPendingIds(_0x21254b);}}}function resolvePendingIdsInRequest(_0x53426a,_0x3e28d1,_0xe121e8,_0xef9b04,_0x5d13cc,_0x3dcc66){const _0x3bbc34=a140_0x164c64,_0x567d99=(_0x179edd,_0x162c33)=>{const _0x3ab9a0=a140_0x2294;if(!isPendingSegmentId(_0x179edd))return _0x179edd;const _0x11a715=extractPendingSegmentName(_0x179edd),_0x56d271=_0xef9b04[_0x3ab9a0(0x24d)](_0x11a715);return!_0x56d271&&_0x3dcc66['logWarning']?.(_0x3ab9a0(0x22c)+_0x11a715+_0x3ab9a0(0x219)+_0x162c33),_0x56d271;};if(_0x53426a[_0x3bbc34(0x1e9)][_0x3bbc34(0x257)]?.[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x53426a[_0x3bbc34(0x1e9)][_0x3bbc34(0x257)][_0x3bbc34(0x279)])){const _0x2ae460=_0x567d99(_0x53426a[_0x3bbc34(0x1e9)][_0x3bbc34(0x257)][_0x3bbc34(0x279)],_0x3bbc34(0x224));_0x2ae460&&(_0x53426a[_0x3bbc34(0x1e9)][_0x3bbc34(0x257)]['segmentId']=_0x2ae460);}for(const _0x1a3f00 of _0x53426a['attributes'][_0x3bbc34(0x247)]||[]){const _0x286152=_0xe121e8[_0x3bbc34(0x24d)](_0x1a3f00[_0x3bbc34(0x1c9)][_0x3bbc34(0x287)]());_0x286152&&(_0x1a3f00['id']=_0x286152);if(_0x1a3f00[_0x3bbc34(0x24f)]?.[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x1a3f00[_0x3bbc34(0x24f)][_0x3bbc34(0x279)])){const _0x14d52e=_0x567d99(_0x1a3f00[_0x3bbc34(0x24f)][_0x3bbc34(0x279)],'stage\x20\x27'+_0x1a3f00[_0x3bbc34(0x1c9)]+_0x3bbc34(0x29b));_0x14d52e&&(_0x1a3f00[_0x3bbc34(0x24f)][_0x3bbc34(0x279)]=_0x14d52e);}if(_0x1a3f00['exitCriterias'])for(const _0x54043e of _0x1a3f00[_0x3bbc34(0x1e4)]){if(_0x54043e[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x54043e['segmentId'])){const _0x5d6e4e=_0x567d99(_0x54043e['segmentId'],'stage\x20\x27'+_0x1a3f00['name']+_0x3bbc34(0x298));_0x5d6e4e&&(_0x54043e['segmentId']=_0x5d6e4e);}}if(_0x1a3f00[_0x3bbc34(0x1c6)]?.[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x1a3f00[_0x3bbc34(0x1c6)][_0x3bbc34(0x279)])){const _0x1513e1=_0x567d99(_0x1a3f00[_0x3bbc34(0x1c6)][_0x3bbc34(0x279)],_0x3bbc34(0x28c)+_0x1a3f00['name']+'\x27\x20milestone');_0x1513e1&&(_0x1a3f00[_0x3bbc34(0x1c6)][_0x3bbc34(0x279)]=_0x1513e1);}if(_0x1a3f00[_0x3bbc34(0x26b)]){const _0xbbbf3c=_0x560155=>_0x3e28d1[_0x3bbc34(0x1e9)]['journeyStages']?.['find'](_0x3a7a8e=>_0x3a7a8e[_0x3bbc34(0x1c9)][_0x3bbc34(0x287)]()===_0x1a3f00[_0x3bbc34(0x1c9)]['toLowerCase']())?.['steps']?.[_0x560155];for(const _0x4a6a2c of Object['keys'](_0x1a3f00[_0x3bbc34(0x26b)])){const _0x431a3e=_0x1a3f00[_0x3bbc34(0x26b)][_0x4a6a2c],_0x11daed=_0xbbbf3c(_0x4a6a2c);if(_0x431a3e['type']==='Activation'&&_0x431a3e[_0x3bbc34(0x29a)]&&(isPendingActivationId(_0x431a3e['journeyActivationStepId'])||_0x431a3e[_0x3bbc34(0x29a)]==='')){if(_0x11daed?.[_0x3bbc34(0x29a)]&&isPendingActivationId(_0x11daed[_0x3bbc34(0x29a)])){const _0x368386=extractPendingActivationName(_0x11daed[_0x3bbc34(0x29a)]),_0x4b3c88=_0x5d13cc['get'](_0x368386);_0x4b3c88&&(_0x431a3e[_0x3bbc34(0x29a)]=_0x4b3c88);}}if(_0x431a3e['type']==='DecisionPoint'&&_0x431a3e[_0x3bbc34(0x2b6)]&&_0x11daed?.[_0x3bbc34(0x2b6)])for(let _0x5d525d=0x0;_0x5d525d<_0x431a3e['branches'][_0x3bbc34(0x1e6)];_0x5d525d++){const _0x4cdb83=_0x431a3e[_0x3bbc34(0x2b6)][_0x5d525d],_0x1ca288=_0x11daed[_0x3bbc34(0x2b6)][_0x5d525d];if(_0x1ca288?.[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x1ca288[_0x3bbc34(0x279)])){const _0x5e87ac=_0x567d99(_0x1ca288[_0x3bbc34(0x279)],'stage\x20\x27'+_0x1a3f00['name']+_0x3bbc34(0x21b)+(_0x4cdb83[_0x3bbc34(0x1c9)]||_0x5d525d)+'\x27');_0x5e87ac&&(_0x4cdb83[_0x3bbc34(0x279)]=_0x5e87ac);}}_0x431a3e[_0x3bbc34(0x25e)]===_0x3bbc34(0x1d3)&&_0x11daed?.[_0x3bbc34(0x25e)]==='WaitStep'&&resolveWaitStepPendingIds(_0x431a3e,_0x11daed,_0x567d99,_0x1a3f00[_0x3bbc34(0x1c9)]);}}}}
@@ -1 +1 @@
1
- (function(_0x4733e3,_0x1254af){const _0x53dc1f=a141_0x1a81,_0x13a174=_0x4733e3();while(!![]){try{const _0x3a4604=parseInt(_0x53dc1f(0x159))/0x1*(-parseInt(_0x53dc1f(0x15c))/0x2)+-parseInt(_0x53dc1f(0x15e))/0x3+parseInt(_0x53dc1f(0x15a))/0x4*(-parseInt(_0x53dc1f(0x161))/0x5)+parseInt(_0x53dc1f(0x163))/0x6*(parseInt(_0x53dc1f(0x15b))/0x7)+-parseInt(_0x53dc1f(0x169))/0x8+parseInt(_0x53dc1f(0x165))/0x9*(parseInt(_0x53dc1f(0x160))/0xa)+parseInt(_0x53dc1f(0x166))/0xb;if(_0x3a4604===_0x1254af)break;else _0x13a174['push'](_0x13a174['shift']());}catch(_0x413b55){_0x13a174['push'](_0x13a174['shift']());}}}(a141_0x3ccb,0x65940));function a141_0x3ccb(){const _0x257f8=['1332026LRpSSR','set','2069283htGhHC','has','7147280KzYoBG','2089685VwheYh','name','710574SLJNPF','add','9WHsguo','9959477SmltHw','get','parentFolderId','180040SVjuTy','1qVwrIC','4ghBiIF','35KXUqPS'];a141_0x3ccb=function(){return _0x257f8;};return a141_0x3ccb();}export function buildFolderIdToPathMap(_0x5bc765){const _0xaba5bc=a141_0x1a81,_0x10e5e6=new Map(),_0x5757cd=new Map();for(const _0x52683e of _0x5bc765){_0x5757cd[_0xaba5bc(0x15d)](_0x52683e['id'],_0x52683e);}const _0x57155f=new Set();for(const _0x9823c5 of _0x5bc765){!_0x9823c5[_0xaba5bc(0x168)]&&_0x57155f[_0xaba5bc(0x164)](_0x9823c5['id']);}function _0x39da30(_0x4cc272){const _0x7539a2=_0xaba5bc;if(_0x10e5e6[_0x7539a2(0x15f)](_0x4cc272['id']))return _0x10e5e6[_0x7539a2(0x167)](_0x4cc272['id']);if(_0x57155f['has'](_0x4cc272['id']))return _0x10e5e6[_0x7539a2(0x15d)](_0x4cc272['id'],''),'';if(_0x4cc272['parentFolderId']){const _0x5c013b=_0x5757cd[_0x7539a2(0x167)](_0x4cc272[_0x7539a2(0x168)]);if(_0x5c013b){const _0x15233d=_0x39da30(_0x5c013b),_0x529295=_0x15233d?_0x15233d+'/'+_0x4cc272[_0x7539a2(0x162)]:_0x4cc272[_0x7539a2(0x162)];return _0x10e5e6[_0x7539a2(0x15d)](_0x4cc272['id'],_0x529295),_0x529295;}}const _0xaec675=_0x4cc272[_0x7539a2(0x162)];return _0x10e5e6[_0x7539a2(0x15d)](_0x4cc272['id'],_0xaec675),_0xaec675;}for(const _0x4ecd4d of _0x5bc765){_0x39da30(_0x4ecd4d);}return _0x10e5e6;}function a141_0x1a81(_0x4b724c,_0x6b4ad9){_0x4b724c=_0x4b724c-0x159;const _0x3ccb06=a141_0x3ccb();let _0x1a8104=_0x3ccb06[_0x4b724c];return _0x1a8104;}export function buildFolderPathToIdMap(_0x27dd87){const _0x163d0c=a141_0x1a81,_0x813b4d=new Map(),_0xb1f6c1=new Map();for(const _0x12926a of _0x27dd87){_0xb1f6c1[_0x163d0c(0x15d)](_0x12926a['id'],_0x12926a);}const _0x5c99c9=new Set();for(const _0x2ec1f7 of _0x27dd87){!_0x2ec1f7[_0x163d0c(0x168)]&&_0x5c99c9[_0x163d0c(0x164)](_0x2ec1f7['id']);}function _0xafcbc1(_0x16d6a8){const _0x3142db=_0x163d0c;if(_0x5c99c9['has'](_0x16d6a8['id']))return'';if(_0x16d6a8[_0x3142db(0x168)]){const _0x1a4960=_0xb1f6c1[_0x3142db(0x167)](_0x16d6a8['parentFolderId']);if(_0x1a4960){const _0x32d511=_0xafcbc1(_0x1a4960);return _0x32d511?_0x32d511+'/'+_0x16d6a8['name']:_0x16d6a8['name'];}}return _0x16d6a8[_0x3142db(0x162)];}for(const _0x6fc333 of _0x27dd87){const _0x589c9b=_0xafcbc1(_0x6fc333);_0x813b4d['set'](_0x589c9b,_0x6fc333['id']);}return _0x813b4d;}export function buildFolderMaps(_0xd1da8e){const _0x2b2ee9=a141_0x1a81,_0x6c2f89=buildFolderIdToPathMap(_0xd1da8e),_0x1e6a74=new Map();for(const [_0x346b3c,_0x5e1342]of _0x6c2f89){_0x1e6a74[_0x2b2ee9(0x15d)](_0x5e1342,_0x346b3c);}return{'idToPath':_0x6c2f89,'pathToId':_0x1e6a74};}export function getFolderPath(_0x1be270,_0x3099db){const _0x2758b0=a141_0x1a81;if(!_0x1be270)return'';return _0x3099db[_0x2758b0(0x167)](_0x1be270)??'';}
1
+ function a141_0x5cc3(){const _0x5822b5=['7DmiwtB','5GqzTtK','set','10188693ajbJQx','1938968HXgyFo','get','7177990CpabUA','add','has','2587506oviyXe','3160184iXsdCm','parentFolderId','59374Fxqjma','66CyuQkY','598265uQEHok','name'];a141_0x5cc3=function(){return _0x5822b5;};return a141_0x5cc3();}(function(_0x84bd68,_0x47a61e){const _0x485e7b=a141_0x23d1,_0xcc5792=_0x84bd68();while(!![]){try{const _0x5484be=-parseInt(_0x485e7b(0x11b))/0x1+parseInt(_0x485e7b(0x129))/0x2*(parseInt(_0x485e7b(0x12a))/0x3)+parseInt(_0x485e7b(0x127))/0x4*(parseInt(_0x485e7b(0x11e))/0x5)+-parseInt(_0x485e7b(0x126))/0x6*(-parseInt(_0x485e7b(0x11d))/0x7)+-parseInt(_0x485e7b(0x121))/0x8+-parseInt(_0x485e7b(0x120))/0x9+parseInt(_0x485e7b(0x123))/0xa;if(_0x5484be===_0x47a61e)break;else _0xcc5792['push'](_0xcc5792['shift']());}catch(_0x10a69f){_0xcc5792['push'](_0xcc5792['shift']());}}}(a141_0x5cc3,0x973e9));export function buildFolderIdToPathMap(_0x446137){const _0x29121a=a141_0x23d1,_0x2ea6fe=new Map(),_0x54dd40=new Map();for(const _0x113188 of _0x446137){_0x54dd40[_0x29121a(0x11f)](_0x113188['id'],_0x113188);}const _0x271e9e=new Set();for(const _0x2cc2c4 of _0x446137){!_0x2cc2c4['parentFolderId']&&_0x271e9e['add'](_0x2cc2c4['id']);}function _0x2ddb51(_0x3b0ccf){const _0x22dd7c=_0x29121a;if(_0x2ea6fe['has'](_0x3b0ccf['id']))return _0x2ea6fe[_0x22dd7c(0x122)](_0x3b0ccf['id']);if(_0x271e9e['has'](_0x3b0ccf['id']))return _0x2ea6fe[_0x22dd7c(0x11f)](_0x3b0ccf['id'],''),'';if(_0x3b0ccf[_0x22dd7c(0x128)]){const _0x16cc36=_0x54dd40[_0x22dd7c(0x122)](_0x3b0ccf[_0x22dd7c(0x128)]);if(_0x16cc36){const _0x2f892b=_0x2ddb51(_0x16cc36),_0x59b83d=_0x2f892b?_0x2f892b+'/'+_0x3b0ccf['name']:_0x3b0ccf['name'];return _0x2ea6fe[_0x22dd7c(0x11f)](_0x3b0ccf['id'],_0x59b83d),_0x59b83d;}}const _0x332d37=_0x3b0ccf['name'];return _0x2ea6fe[_0x22dd7c(0x11f)](_0x3b0ccf['id'],_0x332d37),_0x332d37;}for(const _0xa091df of _0x446137){_0x2ddb51(_0xa091df);}return _0x2ea6fe;}export function buildFolderPathToIdMap(_0x880f8f){const _0x49254b=a141_0x23d1,_0x3a3fd2=new Map(),_0x55221a=new Map();for(const _0x1d11fa of _0x880f8f){_0x55221a[_0x49254b(0x11f)](_0x1d11fa['id'],_0x1d11fa);}const _0x13576b=new Set();for(const _0x33e84e of _0x880f8f){!_0x33e84e[_0x49254b(0x128)]&&_0x13576b[_0x49254b(0x124)](_0x33e84e['id']);}function _0x57b313(_0x4ac497){const _0x53fe3d=_0x49254b;if(_0x13576b[_0x53fe3d(0x125)](_0x4ac497['id']))return'';if(_0x4ac497[_0x53fe3d(0x128)]){const _0x34d49b=_0x55221a['get'](_0x4ac497['parentFolderId']);if(_0x34d49b){const _0x33e575=_0x57b313(_0x34d49b);return _0x33e575?_0x33e575+'/'+_0x4ac497[_0x53fe3d(0x11c)]:_0x4ac497[_0x53fe3d(0x11c)];}}return _0x4ac497['name'];}for(const _0x5ef936 of _0x880f8f){const _0x3f8afc=_0x57b313(_0x5ef936);_0x3a3fd2[_0x49254b(0x11f)](_0x3f8afc,_0x5ef936['id']);}return _0x3a3fd2;}export function buildFolderMaps(_0x1a533d){const _0x167841=a141_0x23d1,_0x270931=buildFolderIdToPathMap(_0x1a533d),_0x4ec719=new Map();for(const [_0x444aa4,_0x2610a7]of _0x270931){_0x4ec719[_0x167841(0x11f)](_0x2610a7,_0x444aa4);}return{'idToPath':_0x270931,'pathToId':_0x4ec719};}function a141_0x23d1(_0x389122,_0x514945){_0x389122=_0x389122-0x11b;const _0x5cc351=a141_0x5cc3();let _0x23d112=_0x5cc351[_0x389122];return _0x23d112;}export function getFolderPath(_0x28ea75,_0x4ee003){if(!_0x28ea75)return'';return _0x4ee003['get'](_0x28ea75)??'';}
@@ -1 +1 @@
1
- (function(_0x59e920,_0x285d7c){const _0x3007a9=a142_0x5c14,_0x5a0a63=_0x59e920();while(!![]){try{const _0x32921c=-parseInt(_0x3007a9(0xc6))/0x1*(-parseInt(_0x3007a9(0xdf))/0x2)+-parseInt(_0x3007a9(0xcd))/0x3+parseInt(_0x3007a9(0xcb))/0x4+parseInt(_0x3007a9(0xc0))/0x5*(-parseInt(_0x3007a9(0xc1))/0x6)+parseInt(_0x3007a9(0xda))/0x7*(-parseInt(_0x3007a9(0xd8))/0x8)+-parseInt(_0x3007a9(0xce))/0x9+-parseInt(_0x3007a9(0xbe))/0xa*(-parseInt(_0x3007a9(0xc2))/0xb);if(_0x32921c===_0x285d7c)break;else _0x5a0a63['push'](_0x5a0a63['shift']());}catch(_0x36e3db){_0x5a0a63['push'](_0x5a0a63['shift']());}}}(a142_0x41d2,0xb9f61));import a142_0x342e54 from'path';import{parse as a142_0x574488}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a142_0x41d2(){const _0x2af29a=['substring','4868960gWgUWU','resolve','3177444JdvjDl','9494874PkqDOR','Path\x20cannot\x20be\x20empty','Path\x20segment\x20cannot\x20be\x20empty','Cannot\x20split\x20empty\x20path','File\x20not\x20found:\x20','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','endsWith','readFile','journey','pop','8ZUEpjM','root','3612763isnMES','parse','push','Relative\x20path\x20cannot\x20be\x20empty','segment','1070EKOfRs','raw','dirname','startsWith','No\x20tdx.json\x20found\x20for\x20file:\x20','Cannot\x20navigate\x20above\x20root','replace','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','type','trim','.yaml','length','slice','split','segments','20BHvmRb','Path\x20attempts\x20to\x20navigate\x20above\x20root','80sbInZS','329172dQVmLn','14093376pVSqVO','isAbsolute','filter','join','916dQffBq','test','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','exists'];a142_0x41d2=function(){return _0x2af29a;};return a142_0x41d2();}export function parsePath(_0x15bd3e){const _0x2c4020=a142_0x5c14;if(!_0x15bd3e||_0x15bd3e[_0x2c4020(0xe9)]()==='')throw new Error(_0x2c4020(0xcf));const _0x284c5a=_0x15bd3e[_0x2c4020(0xe9)]();if(_0x284c5a==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x15bd3e};const _0x524e67=_0x284c5a[_0x2c4020(0xe2)]('/')?_0x284c5a[_0x2c4020(0xca)](0x1):_0x284c5a,_0x5ea68d=_0x524e67[_0x2c4020(0xbc)]('/')[_0x2c4020(0xc4)](_0x54a920=>_0x54a920!=='');if(_0x5ea68d[_0x2c4020(0xba)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x477892=_0x284c5a[_0x2c4020(0xe2)]('/')||!isRelativePathSegment(_0x5ea68d[0x0]);for(const _0x22a399 of _0x5ea68d){validatePathSegment(_0x22a399);}return{'segments':_0x5ea68d,'isAbsolute':_0x477892,'raw':_0x15bd3e};}function isRelativePathSegment(_0x114871){return _0x114871==='.'||_0x114871==='..';}function validatePathSegment(_0xcc4830){const _0x1ff3a9=a142_0x5c14;if(_0xcc4830==='')throw new Error(_0x1ff3a9(0xd0));if(_0xcc4830==='.'||_0xcc4830==='..')return;if(/[\x00-\x1F\x7F]/[_0x1ff3a9(0xc7)](_0xcc4830))throw new Error(_0x1ff3a9(0xe6)+_0xcc4830);if(_0xcc4830!==_0xcc4830[_0x1ff3a9(0xe9)]()){}}export function validatePath(_0x25aff0){const _0x1c901d=a142_0x5c14;if(_0x25aff0['segments'][_0x1c901d(0xba)]===0x0&&!_0x25aff0[_0x1c901d(0xc3)])throw new Error(_0x1c901d(0xdd));if(_0x25aff0[_0x1c901d(0xc3)]){if(_0x25aff0[_0x1c901d(0xbd)][0x0]==='..')throw new Error(_0x1c901d(0xd3));let _0x371ea0=0x0;for(const _0x444ab5 of _0x25aff0[_0x1c901d(0xbd)]){if(_0x444ab5==='..'){if(_0x371ea0===0x0)throw new Error(_0x1c901d(0xbf));_0x371ea0--;}else _0x444ab5!=='.'&&_0x371ea0++;}}}export function joinPaths(_0x4a285e,_0xf37c9a){const _0x15707c=a142_0x5c14;if(!_0x4a285e||_0x4a285e==='/')return _0xf37c9a;if(!_0xf37c9a||_0xf37c9a==='.')return _0x4a285e;if(_0xf37c9a[_0x15707c(0xe2)]('/'))return _0xf37c9a;const _0x4cf0e6=parsePath(_0x4a285e),_0x4b6229=parsePath(_0xf37c9a),_0xbe8f77=[..._0x4cf0e6['segments']];for(const _0x2b8121 of _0x4b6229[_0x15707c(0xbd)]){if(_0x2b8121==='.')continue;else{if(_0x2b8121==='..'){if(_0xbe8f77[_0x15707c(0xba)]===0x0)throw new Error(_0x15707c(0xe4));_0xbe8f77[_0x15707c(0xd7)]();}else _0xbe8f77['push'](_0x2b8121);}}const _0xf592c7=_0xbe8f77[_0x15707c(0xc5)]('/');return _0x4cf0e6[_0x15707c(0xe0)][_0x15707c(0xe2)]('/')?'/'+_0xf592c7:_0xf592c7;}export function normalizePath(_0x2af1db){const _0xd8d95a=a142_0x5c14,_0x42c8c0=parsePath(_0x2af1db),_0xb45117=[];for(const _0x2f0310 of _0x42c8c0['segments']){if(_0x2f0310==='.')continue;else{if(_0x2f0310==='..'){if(_0xb45117[_0xd8d95a(0xba)]===0x0){if(_0x42c8c0[_0xd8d95a(0xc3)])throw new Error(_0xd8d95a(0xe4));_0xb45117[_0xd8d95a(0xdc)]('..');}else _0xb45117[_0xb45117['length']-0x1]==='..'?_0xb45117['push']('..'):_0xb45117[_0xd8d95a(0xd7)]();}else _0xb45117['push'](_0x2f0310);}}if(_0xb45117[_0xd8d95a(0xba)]===0x0)return _0x42c8c0[_0xd8d95a(0xc3)]?'/':'.';const _0x434f67=_0xb45117[_0xd8d95a(0xc5)]('/');return _0x42c8c0[_0xd8d95a(0xe0)][_0xd8d95a(0xe2)]('/')?'/'+_0x434f67:_0x434f67;}export function getParentPath(_0x371764){const _0x4f42c4=a142_0x5c14,_0x268025=parsePath(_0x371764);if(_0x268025['segments']['length']<=0x1)return'/';const _0x293784=_0x268025[_0x4f42c4(0xbd)][_0x4f42c4(0xbb)](0x0,-0x1)['join']('/');return _0x268025[_0x4f42c4(0xe0)][_0x4f42c4(0xe2)]('/')?'/'+_0x293784:_0x293784;}export function getBaseName(_0x4a12bb){const _0x1eba65=a142_0x5c14,_0x5dff3a=parsePath(_0x4a12bb);return _0x5dff3a[_0x1eba65(0xbd)][_0x5dff3a['segments'][_0x1eba65(0xba)]-0x1]||'';}export function isChildPath(_0x2fa583,_0x464a0b){const _0x24fad5=a142_0x5c14,_0x37b09d=parsePath(_0x2fa583),_0x43dd05=parsePath(_0x464a0b);if(_0x37b09d['segments'][_0x24fad5(0xba)]<=_0x43dd05['segments']['length'])return![];for(let _0x4c3464=0x0;_0x4c3464<_0x43dd05[_0x24fad5(0xbd)][_0x24fad5(0xba)];_0x4c3464++){if(_0x37b09d['segments'][_0x4c3464]!==_0x43dd05[_0x24fad5(0xbd)][_0x4c3464])return![];}return!![];}export function splitPath(_0xdb33cc){const _0x567bc4=a142_0x5c14,_0x19a80b=parsePath(_0xdb33cc);if(_0x19a80b[_0x567bc4(0xbd)][_0x567bc4(0xba)]===0x0)throw new Error(_0x567bc4(0xd1));if(_0x19a80b['segments']['length']===0x1)return{'parent':_0x19a80b['segments'][0x0]};return{'parent':_0x19a80b[_0x567bc4(0xbd)][0x0],'child':_0x19a80b[_0x567bc4(0xbd)][_0x567bc4(0xbb)](0x1)[_0x567bc4(0xc5)]('/')};}export function isYamlFilePath(_0x271e24){const _0x2c5b49=a142_0x5c14;return _0x271e24[_0x2c5b49(0xd4)]('.yml')||_0x271e24['endsWith'](_0x2c5b49(0xea));}function a142_0x5c14(_0x3f6d44,_0xff6116){_0x3f6d44=_0x3f6d44-0xba;const _0x41d276=a142_0x41d2();let _0x5c147b=_0x41d276[_0x3f6d44];return _0x5c147b;}export async function resolveYamlFilePath(_0x36eae3,_0x1b7201=nodeFileSystem){const _0x338476=a142_0x5c14,_0x4da8d2=a142_0x342e54[_0x338476(0xcc)](_0x36eae3);if(!await _0x1b7201['exists'](_0x4da8d2))throw new Error(_0x338476(0xd2)+_0x36eae3);let _0x3d3035=a142_0x342e54[_0x338476(0xe1)](_0x4da8d2),_0x738bae=null,_0x415066=null;const _0x127174=a142_0x342e54[_0x338476(0xdb)](_0x3d3035)[_0x338476(0xd9)];while(_0x3d3035!==_0x127174){const _0x4a867d=a142_0x342e54[_0x338476(0xc5)](_0x3d3035,'tdx.json');if(await _0x1b7201[_0x338476(0xc9)](_0x4a867d)){_0x738bae=_0x4a867d,_0x415066=_0x3d3035;break;}_0x3d3035=a142_0x342e54[_0x338476(0xe1)](_0x3d3035);}if(!_0x738bae||!_0x415066)throw new Error(_0x338476(0xe3)+_0x36eae3+'\x0a'+_0x338476(0xe7));const _0x54b5cc=await _0x1b7201[_0x338476(0xd5)](_0x738bae),_0x214d21=JSON[_0x338476(0xdb)](_0x54b5cc),_0x312779=_0x214d21['parent_segment'];if(!_0x312779)throw new Error(_0x338476(0xc8));const _0x32a1d0=await _0x1b7201[_0x338476(0xd5)](_0x4da8d2),_0x117d96=a142_0x574488(_0x32a1d0),_0x5f5afd=_0x117d96['name'];if(!_0x5f5afd)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x36eae3);const _0x262b48=_0x117d96[_0x338476(0xe8)]===_0x338476(0xd6)?_0x338476(0xd6):_0x338476(0xde),_0x4dbf3f=a142_0x342e54['relative'](_0x415066,_0x4da8d2),_0x2d8b9a=a142_0x342e54[_0x338476(0xe1)](_0x4dbf3f),_0x3ea339=_0x2d8b9a==='.'?'':_0x2d8b9a[_0x338476(0xe5)](/\\/g,'/'),_0x31bf80=_0x3ea339?_0x312779+'/'+_0x3ea339+'/'+_0x5f5afd:_0x312779+'/'+_0x5f5afd;return{'parentSegment':_0x312779,'segmentName':_0x5f5afd,'folderPath':_0x3ea339,'fullPath':_0x31bf80,'resourceType':_0x262b48,'content':_0x32a1d0};}
1
+ (function(_0x30512f,_0x29f55e){const _0x4385b1=a142_0xeec2,_0x1d4826=_0x30512f();while(!![]){try{const _0x46017c=-parseInt(_0x4385b1(0x8a))/0x1*(-parseInt(_0x4385b1(0x7f))/0x2)+-parseInt(_0x4385b1(0x85))/0x3+parseInt(_0x4385b1(0x80))/0x4+parseInt(_0x4385b1(0xa6))/0x5*(parseInt(_0x4385b1(0x82))/0x6)+parseInt(_0x4385b1(0x81))/0x7+parseInt(_0x4385b1(0x86))/0x8*(parseInt(_0x4385b1(0x97))/0x9)+-parseInt(_0x4385b1(0xa0))/0xa;if(_0x46017c===_0x29f55e)break;else _0x1d4826['push'](_0x1d4826['shift']());}catch(_0x3de016){_0x1d4826['push'](_0x1d4826['shift']());}}}(a142_0x2ca0,0x8fca6));import a142_0x2355b9 from'path';import{parse as a142_0xb8b21b}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x318cba){const _0x5ec727=a142_0xeec2;if(!_0x318cba||_0x318cba[_0x5ec727(0x8e)]()==='')throw new Error(_0x5ec727(0x88));const _0x370b34=_0x318cba[_0x5ec727(0x8e)]();if(_0x370b34==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x318cba};const _0x3dfec9=_0x370b34[_0x5ec727(0x7d)]('/')?_0x370b34['substring'](0x1):_0x370b34,_0x3924df=_0x3dfec9[_0x5ec727(0x96)]('/')[_0x5ec727(0x7b)](_0xc5a62=>_0xc5a62!=='');if(_0x3924df[_0x5ec727(0x9d)]===0x0)throw new Error(_0x5ec727(0x7c));const _0x309a59=_0x370b34[_0x5ec727(0x7d)]('/')||!isRelativePathSegment(_0x3924df[0x0]);for(const _0x46ebbd of _0x3924df){validatePathSegment(_0x46ebbd);}return{'segments':_0x3924df,'isAbsolute':_0x309a59,'raw':_0x318cba};}function a142_0xeec2(_0x28a58c,_0x2988cc){_0x28a58c=_0x28a58c-0x79;const _0x2ca0c8=a142_0x2ca0();let _0xeec212=_0x2ca0c8[_0x28a58c];return _0xeec212;}function isRelativePathSegment(_0x45b7e3){return _0x45b7e3==='.'||_0x45b7e3==='..';}function validatePathSegment(_0x21cd3b){const _0xc82d9a=a142_0xeec2;if(_0x21cd3b==='')throw new Error(_0xc82d9a(0x79));if(_0x21cd3b==='.'||_0x21cd3b==='..')return;if(/[\x00-\x1F\x7F]/[_0xc82d9a(0xa3)](_0x21cd3b))throw new Error(_0xc82d9a(0x93)+_0x21cd3b);if(_0x21cd3b!==_0x21cd3b[_0xc82d9a(0x8e)]()){}}export function validatePath(_0x2eac37){const _0x3aa20b=a142_0xeec2;if(_0x2eac37[_0x3aa20b(0xa7)][_0x3aa20b(0x9d)]===0x0&&!_0x2eac37['isAbsolute'])throw new Error(_0x3aa20b(0xa9));if(_0x2eac37[_0x3aa20b(0xa2)]){if(_0x2eac37['segments'][0x0]==='..')throw new Error(_0x3aa20b(0x9c));let _0x23a395=0x0;for(const _0x1bad82 of _0x2eac37['segments']){if(_0x1bad82==='..'){if(_0x23a395===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x23a395--;}else _0x1bad82!=='.'&&_0x23a395++;}}}export function joinPaths(_0x340e71,_0x1a7e88){const _0x208945=a142_0xeec2;if(!_0x340e71||_0x340e71==='/')return _0x1a7e88;if(!_0x1a7e88||_0x1a7e88==='.')return _0x340e71;if(_0x1a7e88[_0x208945(0x7d)]('/'))return _0x1a7e88;const _0x5c031d=parsePath(_0x340e71),_0xbd0ea9=parsePath(_0x1a7e88),_0x184bc3=[..._0x5c031d[_0x208945(0xa7)]];for(const _0x4fe64d of _0xbd0ea9[_0x208945(0xa7)]){if(_0x4fe64d==='.')continue;else{if(_0x4fe64d==='..'){if(_0x184bc3['length']===0x0)throw new Error(_0x208945(0xa4));_0x184bc3[_0x208945(0x90)]();}else _0x184bc3[_0x208945(0x7e)](_0x4fe64d);}}const _0x2a81d3=_0x184bc3[_0x208945(0x95)]('/');return _0x5c031d[_0x208945(0x99)][_0x208945(0x7d)]('/')?'/'+_0x2a81d3:_0x2a81d3;}function a142_0x2ca0(){const _0x1df5d8=['4MhjRbO','3458780rLpIcE','328083GXuwpd','400074WNLRVX','parent_segment','type','2536347vKUqQG','3470752zELzia','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Path\x20cannot\x20be\x20empty','replace','154150OdgcHY','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','segment','slice','trim','.yaml','pop','exists','readFile','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','parse','join','split','9rUSmeY','journey','raw','relative','No\x20tdx.json\x20found\x20for\x20file:\x20','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','length','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','endsWith','2859720cBOQSn','dirname','isAbsolute','test','Cannot\x20navigate\x20above\x20root','root','5rntOHn','segments','resolve','Relative\x20path\x20cannot\x20be\x20empty','name','Path\x20segment\x20cannot\x20be\x20empty','File\x20not\x20found:\x20','filter','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','startsWith','push'];a142_0x2ca0=function(){return _0x1df5d8;};return a142_0x2ca0();}export function normalizePath(_0x5bfd6a){const _0x1acdbb=a142_0xeec2,_0x11e4c4=parsePath(_0x5bfd6a),_0x403ea5=[];for(const _0x3a55a2 of _0x11e4c4[_0x1acdbb(0xa7)]){if(_0x3a55a2==='.')continue;else{if(_0x3a55a2==='..'){if(_0x403ea5['length']===0x0){if(_0x11e4c4[_0x1acdbb(0xa2)])throw new Error(_0x1acdbb(0xa4));_0x403ea5['push']('..');}else _0x403ea5[_0x403ea5['length']-0x1]==='..'?_0x403ea5[_0x1acdbb(0x7e)]('..'):_0x403ea5[_0x1acdbb(0x90)]();}else _0x403ea5[_0x1acdbb(0x7e)](_0x3a55a2);}}if(_0x403ea5['length']===0x0)return _0x11e4c4[_0x1acdbb(0xa2)]?'/':'.';const _0x35805e=_0x403ea5['join']('/');return _0x11e4c4[_0x1acdbb(0x99)][_0x1acdbb(0x7d)]('/')?'/'+_0x35805e:_0x35805e;}export function getParentPath(_0x811472){const _0x17eecc=a142_0xeec2,_0x30595d=parsePath(_0x811472);if(_0x30595d[_0x17eecc(0xa7)][_0x17eecc(0x9d)]<=0x1)return'/';const _0xdba40=_0x30595d['segments'][_0x17eecc(0x8d)](0x0,-0x1)[_0x17eecc(0x95)]('/');return _0x30595d[_0x17eecc(0x99)][_0x17eecc(0x7d)]('/')?'/'+_0xdba40:_0xdba40;}export function getBaseName(_0x193154){const _0x1bbfe5=a142_0xeec2,_0x33162d=parsePath(_0x193154);return _0x33162d[_0x1bbfe5(0xa7)][_0x33162d['segments']['length']-0x1]||'';}export function isChildPath(_0x1f7233,_0x15bb44){const _0x541bfd=a142_0xeec2,_0x2f40cd=parsePath(_0x1f7233),_0x401a0b=parsePath(_0x15bb44);if(_0x2f40cd['segments']['length']<=_0x401a0b[_0x541bfd(0xa7)][_0x541bfd(0x9d)])return![];for(let _0x4cd572=0x0;_0x4cd572<_0x401a0b['segments']['length'];_0x4cd572++){if(_0x2f40cd['segments'][_0x4cd572]!==_0x401a0b[_0x541bfd(0xa7)][_0x4cd572])return![];}return!![];}export function splitPath(_0x44ac30){const _0x1e42fc=a142_0xeec2,_0x7d6861=parsePath(_0x44ac30);if(_0x7d6861[_0x1e42fc(0xa7)]['length']===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x7d6861[_0x1e42fc(0xa7)][_0x1e42fc(0x9d)]===0x1)return{'parent':_0x7d6861[_0x1e42fc(0xa7)][0x0]};return{'parent':_0x7d6861[_0x1e42fc(0xa7)][0x0],'child':_0x7d6861['segments'][_0x1e42fc(0x8d)](0x1)[_0x1e42fc(0x95)]('/')};}export function isYamlFilePath(_0x63f144){const _0x543dcf=a142_0xeec2;return _0x63f144[_0x543dcf(0x9f)]('.yml')||_0x63f144['endsWith'](_0x543dcf(0x8f));}export async function resolveYamlFilePath(_0x2ca3f7,_0x551009=nodeFileSystem){const _0x37b654=a142_0xeec2,_0x1238e9=a142_0x2355b9[_0x37b654(0xa8)](_0x2ca3f7);if(!await _0x551009[_0x37b654(0x91)](_0x1238e9))throw new Error(_0x37b654(0x7a)+_0x2ca3f7);let _0x15cc08=a142_0x2355b9[_0x37b654(0xa1)](_0x1238e9),_0x116768=null,_0xb3ba1=null;const _0x136f4b=a142_0x2355b9[_0x37b654(0x94)](_0x15cc08)[_0x37b654(0xa5)];while(_0x15cc08!==_0x136f4b){const _0x1cd7bb=a142_0x2355b9[_0x37b654(0x95)](_0x15cc08,'tdx.json');if(await _0x551009['exists'](_0x1cd7bb)){_0x116768=_0x1cd7bb,_0xb3ba1=_0x15cc08;break;}_0x15cc08=a142_0x2355b9[_0x37b654(0xa1)](_0x15cc08);}if(!_0x116768||!_0xb3ba1)throw new Error(_0x37b654(0x9b)+_0x2ca3f7+'\x0a'+_0x37b654(0x8b));const _0x5d0b62=await _0x551009[_0x37b654(0x92)](_0x116768),_0x4a5bc3=JSON[_0x37b654(0x94)](_0x5d0b62),_0x167669=_0x4a5bc3[_0x37b654(0x83)];if(!_0x167669)throw new Error(_0x37b654(0x87));const _0x3dd827=await _0x551009['readFile'](_0x1238e9),_0xa0000=a142_0xb8b21b(_0x3dd827),_0x5b1112=_0xa0000[_0x37b654(0xaa)];if(!_0x5b1112)throw new Error(_0x37b654(0x9e)+_0x2ca3f7);const _0x57a203=_0xa0000[_0x37b654(0x84)]===_0x37b654(0x98)?_0x37b654(0x98):_0x37b654(0x8c),_0x12c798=a142_0x2355b9[_0x37b654(0x9a)](_0xb3ba1,_0x1238e9),_0x203716=a142_0x2355b9[_0x37b654(0xa1)](_0x12c798),_0x18b921=_0x203716==='.'?'':_0x203716[_0x37b654(0x89)](/\\/g,'/'),_0x2e4d50=_0x18b921?_0x167669+'/'+_0x18b921+'/'+_0x5b1112:_0x167669+'/'+_0x5b1112;return{'parentSegment':_0x167669,'segmentName':_0x5b1112,'folderPath':_0x18b921,'fullPath':_0x2e4d50,'resourceType':_0x57a203,'content':_0x3dd827};}
@@ -1 +1 @@
1
- (function(_0x75384f,_0x556642){const _0x25ca71=a143_0x3e91,_0x2527d6=_0x75384f();while(!![]){try{const _0x19eb80=parseInt(_0x25ca71(0x121))/0x1*(parseInt(_0x25ca71(0x11d))/0x2)+parseInt(_0x25ca71(0x120))/0x3+-parseInt(_0x25ca71(0x123))/0x4+-parseInt(_0x25ca71(0x124))/0x5*(parseInt(_0x25ca71(0x11a))/0x6)+parseInt(_0x25ca71(0x122))/0x7+parseInt(_0x25ca71(0x11e))/0x8+parseInt(_0x25ca71(0x11b))/0x9;if(_0x19eb80===_0x556642)break;else _0x2527d6['push'](_0x2527d6['shift']());}catch(_0xb90bfb){_0x2527d6['push'](_0x2527d6['shift']());}}}(a143_0x155e,0xee799));function a143_0x155e(){const _0x21910c=['6906046TCQGmK','5202804wzQCDo','20bqqVpk','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring','1746630FbucmR','635022vkklfj','.\x20Child\x20name\x20cannot\x20be\x20empty','34870KvRJef','7329584ayxAhv','Invalid\x20segment\x20reference\x20format:\x20','1528965zViaoM','55HWvocS'];a143_0x155e=function(){return _0x21910c;};return a143_0x155e();}function a143_0x3e91(_0x203549,_0xa7e256){_0x203549=_0x203549-0x119;const _0x155e91=a143_0x155e();let _0x3e91e1=_0x155e91[_0x203549];return _0x3e91e1;}export function parseSegmentRef(_0x1c9576){const _0x212665=a143_0x3e91,_0x53f98a=_0x1c9576['indexOf']('/');if(_0x53f98a===-0x1)return{'parentId':_0x1c9576};if(_0x53f98a===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1c9576+_0x212665(0x125));const _0x3c6fb3=_0x1c9576[_0x212665(0x119)](0x0,_0x53f98a),_0x532844=_0x1c9576[_0x212665(0x119)](_0x53f98a+0x1);if(_0x532844==='')throw new Error(_0x212665(0x11f)+_0x1c9576+_0x212665(0x11c));return{'parentId':_0x3c6fb3,'childId':_0x532844};}
1
+ (function(_0x112618,_0x201a1b){const _0x313c0b=a143_0x26d3,_0x32ff15=_0x112618();while(!![]){try{const _0x58ece3=-parseInt(_0x313c0b(0xd8))/0x1*(parseInt(_0x313c0b(0xd4))/0x2)+parseInt(_0x313c0b(0xd1))/0x3*(-parseInt(_0x313c0b(0xdc))/0x4)+-parseInt(_0x313c0b(0xd2))/0x5+parseInt(_0x313c0b(0xd6))/0x6+-parseInt(_0x313c0b(0xd3))/0x7+-parseInt(_0x313c0b(0xd9))/0x8+parseInt(_0x313c0b(0xd7))/0x9;if(_0x58ece3===_0x201a1b)break;else _0x32ff15['push'](_0x32ff15['shift']());}catch(_0x5ef1a4){_0x32ff15['push'](_0x32ff15['shift']());}}}(a143_0x787b,0x1de6a));function a143_0x26d3(_0x27b5ef,_0x4e7119){_0x27b5ef=_0x27b5ef-0xd0;const _0x787b8d=a143_0x787b();let _0x26d3ed=_0x787b8d[_0x27b5ef];return _0x26d3ed;}export function parseSegmentRef(_0x35d678){const _0x56e499=a143_0x26d3,_0x5d6be0=_0x35d678[_0x56e499(0xda)]('/');if(_0x5d6be0===-0x1)return{'parentId':_0x35d678};if(_0x5d6be0===0x0)throw new Error(_0x56e499(0xdb)+_0x35d678+_0x56e499(0xd0));const _0x3ae6bd=_0x35d678['substring'](0x0,_0x5d6be0),_0x4390e8=_0x35d678[_0x56e499(0xd5)](_0x5d6be0+0x1);if(_0x4390e8==='')throw new Error(_0x56e499(0xdb)+_0x35d678+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x3ae6bd,'childId':_0x4390e8};}function a143_0x787b(){const _0x978f34=['88988qSgsaG','.\x20Parent\x20name\x20cannot\x20be\x20empty','3KtkfWZ','608625AweZjQ','1466738roaKcq','2mblpub','substring','216150CMZJrO','4405617EcxVjF','40021mvZCtE','76296iMZyAT','indexOf','Invalid\x20segment\x20reference\x20format:\x20'];a143_0x787b=function(){return _0x978f34;};return a143_0x787b();}