@treasuredata/tdx 2026.3.25 → 2026.3.27

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 (208) 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/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.d.ts.map +1 -1
  65. package/dist/core/oauth.js +1 -1
  66. package/dist/core/oauth.js.map +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/template-pull.js +1 -1
  110. package/dist/sdk/engage/template-push.js +1 -1
  111. package/dist/sdk/engage/template-validator.js +1 -1
  112. package/dist/sdk/engage/template-yaml.js +1 -1
  113. package/dist/sdk/engage/types/campaign-def.js +1 -1
  114. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  115. package/dist/sdk/engage/types/template-schema.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.js +1 -1
  118. package/dist/sdk/index.js +1 -1
  119. package/dist/sdk/io/index.js +1 -1
  120. package/dist/sdk/io/node-filesystem.js +1 -1
  121. package/dist/sdk/job.js +1 -1
  122. package/dist/sdk/journey.js +1 -1
  123. package/dist/sdk/llm/chat-cache.js +1 -1
  124. package/dist/sdk/llm/index.js +1 -1
  125. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  126. package/dist/sdk/llm/model-factors.js +1 -1
  127. package/dist/sdk/personalization.js +1 -1
  128. package/dist/sdk/policy.js +1 -1
  129. package/dist/sdk/query/index.js +1 -1
  130. package/dist/sdk/query/sql-parser.js +1 -1
  131. package/dist/sdk/realtime.js +1 -1
  132. package/dist/sdk/schedule.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.js +1 -1
  137. package/dist/sdk/segment/journey-validator.js +1 -1
  138. package/dist/sdk/segment/journey-yaml.js +1 -1
  139. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  140. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/pull-workflow.js +1 -1
  142. package/dist/sdk/segment/push-recovery.js +1 -1
  143. package/dist/sdk/segment/push-workflow.js +1 -1
  144. package/dist/sdk/segment/resolution-context.js +1 -1
  145. package/dist/sdk/segment/segment-path-parser.js +1 -1
  146. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  147. package/dist/sdk/segment/segment-validator.js +1 -1
  148. package/dist/sdk/segment/target-resolution.js +1 -1
  149. package/dist/sdk/segment/tdx-config.js +1 -1
  150. package/dist/sdk/segment/types/activation-schema.js +1 -1
  151. package/dist/sdk/segment/types/journey-def.js +1 -1
  152. package/dist/sdk/segment/types/journey-schema.js +1 -1
  153. package/dist/sdk/segment/types/segment-def.js +1 -1
  154. package/dist/sdk/segment/types/segment-schema.js +1 -1
  155. package/dist/sdk/segment/validate-files.js +1 -1
  156. package/dist/sdk/segment/yaml-validator.js +1 -1
  157. package/dist/sdk/segment.d.ts +5 -0
  158. package/dist/sdk/segment.d.ts.map +1 -1
  159. package/dist/sdk/segment.js +1 -1
  160. package/dist/sdk/segment.js.map +1 -1
  161. package/dist/sdk/types/index.js +1 -1
  162. package/dist/sdk/types/progress.js +1 -1
  163. package/dist/sdk/user.js +1 -1
  164. package/dist/sdk/util/format-detector.js +1 -1
  165. package/dist/sdk/util/formatters.js +1 -1
  166. package/dist/sdk/util/index.js +1 -1
  167. package/dist/sdk/util/paginate.js +1 -1
  168. package/dist/sdk/util/tree-formatter.js +1 -1
  169. package/dist/sdk/workflow/archive-validation.js +1 -1
  170. package/dist/sdk/workflow/clone-workflow.js +1 -1
  171. package/dist/sdk/workflow/index.js +1 -1
  172. package/dist/sdk/workflow/pull-workflow.js +1 -1
  173. package/dist/sdk/workflow/push-workflow.js +1 -1
  174. package/dist/sdk/workflow/tdx-config.js +1 -1
  175. package/dist/sdk/workflow/workflow-utils.js +1 -1
  176. package/dist/test-utils/command-runner.js +1 -1
  177. package/dist/test-utils/factories.js +1 -1
  178. package/dist/test-utils/fixtures.js +1 -1
  179. package/dist/test-utils/http-mock.js +1 -1
  180. package/dist/test-utils/index.js +1 -1
  181. package/dist/utils/async.js +1 -1
  182. package/dist/utils/colors.js +1 -1
  183. package/dist/utils/diff.js +1 -1
  184. package/dist/utils/file-permissions.js +1 -1
  185. package/dist/utils/file-reader.js +1 -1
  186. package/dist/utils/github-releases.js +1 -1
  187. package/dist/utils/global-cache.js +1 -1
  188. package/dist/utils/json-loader.js +1 -1
  189. package/dist/utils/local-cache.js +1 -1
  190. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  191. package/dist/utils/logger/formatters/index.js +1 -1
  192. package/dist/utils/logger/handlers/console-handler.js +1 -1
  193. package/dist/utils/logger/handlers/file-handler.js +1 -1
  194. package/dist/utils/logger/handlers/index.js +1 -1
  195. package/dist/utils/logger/handlers/null-handler.js +1 -1
  196. package/dist/utils/logger/index.js +1 -1
  197. package/dist/utils/logger/logger.js +1 -1
  198. package/dist/utils/logger/types.js +1 -1
  199. package/dist/utils/option-validation.js +1 -1
  200. package/dist/utils/process.js +1 -1
  201. package/dist/utils/prompt.js +1 -1
  202. package/dist/utils/spinner.js +1 -1
  203. package/dist/utils/sse-parser.js +1 -1
  204. package/dist/utils/string-utils.js +1 -1
  205. package/dist/utils/table-ref-parser.js +1 -1
  206. package/dist/utils/tdx-logger.js +1 -1
  207. package/dist/utils/version-check.js +1 -1
  208. package/package.json +1 -1
@@ -1 +1 @@
1
- const a141_0x564c60=a141_0x164a;(function(_0x590ddd,_0x370c00){const _0x2f6d1c=a141_0x164a,_0x2ea20d=_0x590ddd();while(!![]){try{const _0xe835aa=-parseInt(_0x2f6d1c(0x145))/0x1*(parseInt(_0x2f6d1c(0x14a))/0x2)+parseInt(_0x2f6d1c(0x143))/0x3*(parseInt(_0x2f6d1c(0x150))/0x4)+-parseInt(_0x2f6d1c(0x140))/0x5+parseInt(_0x2f6d1c(0x14b))/0x6*(parseInt(_0x2f6d1c(0x14c))/0x7)+parseInt(_0x2f6d1c(0x139))/0x8+-parseInt(_0x2f6d1c(0x14d))/0x9+parseInt(_0x2f6d1c(0x13d))/0xa;if(_0xe835aa===_0x370c00)break;else _0x2ea20d['push'](_0x2ea20d['shift']());}catch(_0x5e26e6){_0x2ea20d['push'](_0x2ea20d['shift']());}}}(a141_0x50ad,0x3c540));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x51b228 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a141_0x564c60(0x148));export function getPushRecoveryPath(_0x1651dd){const _0x196740=a141_0x564c60,_0x32b462=a141_0x51b228[_0x196740(0x13f)](_0x1651dd),_0xa30768=a141_0x51b228[_0x196740(0x13e)](_0x1651dd);return a141_0x51b228[_0x196740(0x152)](_0x32b462,'.'+_0xa30768+'.push-recovery.json');}function a141_0x164a(_0x42be80,_0x2f591f){_0x42be80=_0x42be80-0x138;const _0x50ad43=a141_0x50ad();let _0x164a66=_0x50ad43[_0x42be80];return _0x164a66;}function a141_0x50ad(){const _0x560179=['tdx.sdk.push-recovery','utf-8','6gwFbrs','1782474mllUWa','7DDivac','1077300fzsjng','version','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','1772nzLbIy','debug','join','stringify','1370584nLRpPd','segments','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','toISOString','3742350YNNkzB','basename','dirname','1080385iQdAlm','ENOENT','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','723cMsHeb','parse','122173YVVuCu','string','.tmp'];a141_0x50ad=function(){return _0x560179;};return a141_0x50ad();}export function readPushRecovery(_0x15d22b){const _0x98cef3=a141_0x564c60,_0x59163d=getPushRecoveryPath(_0x15d22b);if(!existsSync(_0x59163d))return undefined;try{const _0x2f4dba=readFileSync(_0x59163d,'utf-8'),_0x18ea72=JSON[_0x98cef3(0x144)](_0x2f4dba);if(_0x18ea72?.[_0x98cef3(0x14e)]!==0x1||typeof _0x18ea72['journeyName']!==_0x98cef3(0x146))return undefined;return _0x18ea72;}catch(_0x55e570){return _0x55e570 instanceof SyntaxError?logger[_0x98cef3(0x151)](_0x98cef3(0x142)+_0x55e570):logger['warn'](_0x98cef3(0x14f)+_0x55e570),undefined;}}export function writePushRecovery(_0x5da4cb,_0x4d4992){const _0x340b70=a141_0x564c60,_0x3d1cf8=getPushRecoveryPath(_0x5da4cb),_0x179371=_0x3d1cf8+_0x340b70(0x147);writeFileSync(_0x179371,JSON[_0x340b70(0x138)](_0x4d4992,null,0x2)+'\x0a',_0x340b70(0x149)),renameSync(_0x179371,_0x3d1cf8);}export function deletePushRecovery(_0x57cf34){const _0x3d5ac4=a141_0x564c60,_0x108e03=getPushRecoveryPath(_0x57cf34);try{unlinkSync(_0x108e03);}catch(_0x354d7c){_0x354d7c['code']!==_0x3d5ac4(0x141)&&logger[_0x3d5ac4(0x151)](_0x3d5ac4(0x13b)+_0x354d7c);}}export function saveSegmentToPushRecovery(_0x329b47,_0x50ccef,_0xa99a09,_0x28b56f){const _0x32fd53=a141_0x564c60,_0x2fa5f9=readPushRecovery(_0x329b47),_0x10fede=_0x2fa5f9?.['journeyName']===_0x50ccef?{..._0x2fa5f9,'updatedAt':new Date()[_0x32fd53(0x13c)]()}:{'version':0x1,'journeyName':_0x50ccef,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x10fede[_0x32fd53(0x13a)][_0xa99a09]=_0x28b56f,writePushRecovery(_0x329b47,_0x10fede);}
1
+ const a141_0x3683ad=a141_0x4ac3;(function(_0x286379,_0x276a98){const _0xfe100e=a141_0x4ac3,_0x466a25=_0x286379();while(!![]){try{const _0x3bccbe=-parseInt(_0xfe100e(0x19a))/0x1+parseInt(_0xfe100e(0x1a5))/0x2*(parseInt(_0xfe100e(0x1a3))/0x3)+-parseInt(_0xfe100e(0x18d))/0x4*(parseInt(_0xfe100e(0x19d))/0x5)+-parseInt(_0xfe100e(0x192))/0x6+parseInt(_0xfe100e(0x1a2))/0x7*(-parseInt(_0xfe100e(0x19b))/0x8)+parseInt(_0xfe100e(0x1a6))/0x9+-parseInt(_0xfe100e(0x197))/0xa*(-parseInt(_0xfe100e(0x190))/0xb);if(_0x3bccbe===_0x276a98)break;else _0x466a25['push'](_0x466a25['shift']());}catch(_0x3917ac){_0x466a25['push'](_0x466a25['shift']());}}}(a141_0x4119,0x2852c));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x4df2cc from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a141_0x3683ad(0x19e));export function getPushRecoveryPath(_0x4369ae){const _0x2faf15=a141_0x3683ad,_0x2c9cdf=a141_0x4df2cc['dirname'](_0x4369ae),_0x25767f=a141_0x4df2cc[_0x2faf15(0x1a1)](_0x4369ae);return a141_0x4df2cc[_0x2faf15(0x191)](_0x2c9cdf,'.'+_0x25767f+'.push-recovery.json');}export function readPushRecovery(_0x5f02a6){const _0x1ea89c=a141_0x3683ad,_0x14b071=getPushRecoveryPath(_0x5f02a6);if(!existsSync(_0x14b071))return undefined;try{const _0x27bf1a=readFileSync(_0x14b071,_0x1ea89c(0x1a7)),_0x1c35e9=JSON[_0x1ea89c(0x18e)](_0x27bf1a);if(_0x1c35e9?.[_0x1ea89c(0x196)]!==0x1||typeof _0x1c35e9['journeyName']!==_0x1ea89c(0x1a0))return undefined;return _0x1c35e9;}catch(_0x5f08e5){return _0x5f08e5 instanceof SyntaxError?logger[_0x1ea89c(0x193)](_0x1ea89c(0x195)+_0x5f08e5):logger['warn'](_0x1ea89c(0x198)+_0x5f08e5),undefined;}}export function writePushRecovery(_0x507106,_0x275bae){const _0x468944=a141_0x3683ad,_0x560cee=getPushRecoveryPath(_0x507106),_0x426ddc=_0x560cee+_0x468944(0x18f);writeFileSync(_0x426ddc,JSON[_0x468944(0x19f)](_0x275bae,null,0x2)+'\x0a','utf-8'),renameSync(_0x426ddc,_0x560cee);}function a141_0x4ac3(_0x5792e9,_0x31849a){_0x5792e9=_0x5792e9-0x18d;const _0x4119e8=a141_0x4119();let _0x4ac3d2=_0x4119e8[_0x5792e9];return _0x4ac3d2;}export function deletePushRecovery(_0x572c06){const _0x3f5a4a=a141_0x3683ad,_0xe9de51=getPushRecoveryPath(_0x572c06);try{unlinkSync(_0xe9de51);}catch(_0x511553){_0x511553['code']!==_0x3f5a4a(0x194)&&logger[_0x3f5a4a(0x193)](_0x3f5a4a(0x1a8)+_0x511553);}}function a141_0x4119(){const _0x562103=['parse','.tmp','5575867pqinfO','join','1827012icGUMP','debug','ENOENT','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','version','10oVtTnt','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','toISOString','104188goaxQo','87920mMrNzJ','journeyName','1585630LbrbqW','tdx.sdk.push-recovery','stringify','string','basename','28pJOBeL','3zLXvPv','segments','648682hmCRAh','933318FlmGHN','utf-8','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','4RaWXuw'];a141_0x4119=function(){return _0x562103;};return a141_0x4119();}export function saveSegmentToPushRecovery(_0x49206c,_0x277c2e,_0x18dc13,_0x36b2c4){const _0x9b84fc=a141_0x3683ad,_0x5c7748=readPushRecovery(_0x49206c),_0x2b52d0=_0x5c7748?.[_0x9b84fc(0x19c)]===_0x277c2e?{..._0x5c7748,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x277c2e,'updatedAt':new Date()[_0x9b84fc(0x199)](),'segments':{}};_0x2b52d0[_0x9b84fc(0x1a4)][_0x18dc13]=_0x36b2c4,writePushRecovery(_0x49206c,_0x2b52d0);}
@@ -1 +1 @@
1
- const a142_0x2ccdb5=a142_0x48cb;(function(_0x279447,_0x7312cb){const _0x9e18cd=a142_0x48cb,_0x2ce644=_0x279447();while(!![]){try{const _0x242e8d=parseInt(_0x9e18cd(0x15b))/0x1*(parseInt(_0x9e18cd(0x128))/0x2)+-parseInt(_0x9e18cd(0x153))/0x3+parseInt(_0x9e18cd(0xbe))/0x4+-parseInt(_0x9e18cd(0xa8))/0x5*(-parseInt(_0x9e18cd(0x144))/0x6)+-parseInt(_0x9e18cd(0x123))/0x7+parseInt(_0x9e18cd(0x151))/0x8+-parseInt(_0x9e18cd(0xb6))/0x9;if(_0x242e8d===_0x7312cb)break;else _0x2ce644['push'](_0x2ce644['shift']());}catch(_0x42642c){_0x2ce644['push'](_0x2ce644['shift']());}}}(a142_0x1adc,0x7dd35));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a142_0x2ccdb5(0xd4);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x14cbc6){return''+PENDING_SEGMENT_PREFIX+_0x14cbc6+'__';}export function isPendingSegmentId(_0x5d88cf){const _0x5de874=a142_0x2ccdb5;return _0x5d88cf['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x5d88cf[_0x5de874(0x181)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x2b8c3c){const _0x36be61=a142_0x2ccdb5;return _0x2b8c3c[_0x36be61(0x190)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4e1930){return''+PENDING_ACTIVATION_PREFIX+_0x4e1930+'__';}export function isPendingActivationId(_0x327fab){return _0x327fab['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x324cf7){return _0x324cf7['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x37abde,_0x5181a2){const _0x212b8c=a142_0x2ccdb5,_0x452983=_0x37abde+'::'+(_0x5181a2[_0x212b8c(0x174)]()||_0x212b8c(0xaa)),_0x4cd7a7=createHash(_0x212b8c(0xda))[_0x212b8c(0xc0)](_0x452983)[_0x212b8c(0x156)](_0x212b8c(0xeb))[_0x212b8c(0xb7)](0x0,0xc);return _0x212b8c(0x125)+_0x4cd7a7;}export function ensureJourneyDefaults(_0x1bf84e){const _0x28d800=a142_0x2ccdb5;!_0x1bf84e[_0x28d800(0x10d)]&&(_0x1bf84e[_0x28d800(0x10d)]=''),!_0x1bf84e[_0x28d800(0x157)]&&(_0x1bf84e[_0x28d800(0x157)]=_0x28d800(0x134));}export function injectExistingStageIds(_0xe02864,_0x3ad764){const _0x38b4d0=a142_0x2ccdb5,_0x30c1bd=new Map(_0x3ad764[_0x38b4d0(0x122)](_0x32ba82=>[_0x32ba82[_0x38b4d0(0xed)],_0x32ba82['id']]));for(const _0x2d4ccd of _0xe02864){if(!_0x2d4ccd['id']){const _0x2459df=_0x30c1bd['get'](_0x2d4ccd[_0x38b4d0(0xed)]);_0x2459df&&(_0x2d4ccd['id']=_0x2459df);}}}export function resolveTDFolderPath(_0x276e4c,_0x338141,_0x56b94e){const _0x2969b6=a142_0x2ccdb5;if(!_0x338141)return _0x276e4c;if(_0x276e4c===_0x56b94e||_0x276e4c[_0x2969b6(0x181)](_0x56b94e+'/'))return _0x276e4c;return _0x276e4c?_0x56b94e+'/'+_0x276e4c:_0x56b94e;}export function addFoldersToCreate(_0x1a2ffe,_0x139c50,_0x19e74e){const _0x683ae2=a142_0x2ccdb5;if(!_0x1a2ffe)return;if(_0x139c50[_0x683ae2(0x105)](_0x1a2ffe))return;const _0x522c98=_0x1a2ffe[_0x683ae2(0xbd)]('/');let _0x32d0c6='';for(const _0x45c6f5 of _0x522c98){_0x32d0c6=_0x32d0c6?_0x32d0c6+'/'+_0x45c6f5:_0x45c6f5,!_0x139c50['has'](_0x32d0c6)&&_0x19e74e['add'](_0x32d0c6);}}function a142_0x1adc(){const _0x3e37c9=['15449229xCgWZd','slice','WaitStep','journey_updating','withProgress','includes','createJourneySegment','split','4113320svBffg','Failed\x20to\x20fetch\x20referenced\x20segment\x20','update','diff','flatMap','DecisionPoint','Fetching\x20','activation_deleting','\x27\x20not\x20found\x20in\x20journey\x20\x27','Created\x20activation\x20\x27','waitStep','./journey-yaml.js','segmentFolderId','from','existingJourney','index','conditionTimeoutDuration','behavior','max','\x20journey\x20from\x20file:\x20','folder','Segment\x20not\x20found:\x20','__pending_','existingSegment','goal','isNew','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','size','sha1','Segment\x20not\x20found','Failed\x20to\x20','match','segments','journeyActivationStepId','\x27\x20by\x20rule\x20content','kind','run_after_journey_refresh','debug','parse','values','\x27\x20to\x20local\x20\x27','waitStepUnit','journeyId','journeyBundleId','hasChanges','hex','getJourney','name','journeys','embedded_activation_created','\x27...','rootFolderId','journeyBundleName','dirname','ACTIVATION_UPDATE_ERROR','deleteSegment','conditions','type','journeyActivationNameToId','updated','data','parentFolder','INTERNAL','localName','parseDocument','resolveSegment','Deleted\x20activation\x20\x27','Activation\x20not\x20found:\x20','Creating\x20segment\x20\x27','getLatestJourneyId','segmentNameToId','has','\x27\x20from\x20file:\x20','folder_created','filter','deps','folder_creating','SEGMENT_UPDATE_ERROR','decision_point','description','embeddedSegmentNameToId','activationContext','activationStepsById','toISOString','segmentId','journeyBundlesByFolderAndName','delete','activationActions','entry_criteria','updateSegmentById','add','folderPath','some','reduce','Entry\x20criteria:\x20','notification','yamlConfig','createdSegmentIds','goal\x20criteria','list','map','2177826yytmrD','null','journey_entry_criteria_','created','keys','1319504qOHyoi','JOURNEY_UPDATE_ERROR','valid','journey_created','activation_deleted','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Updated\x20journey\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','\x27\x20decision\x20point\x20branch\x20\x27','relative','journeyStages','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','draft','existingSegments','branches','Condition','uniqueServerName','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Activation','attributes','journey_creating','fetchJourney','uniqueSegmentName','segment_deleting','folderPathToId','deleted','\x27\x20exit\x20criteria','getSegment','12738DTnJDf','versionNumber','activations','deleteActivation','resolveJourneyId','activation_updating','push','absolutePath','\x27\x20milestone','exitCriterias','getSegmentEntity','SEGMENT_SYNTAX_ERROR','milestone','1785864zqGizn','createActivation','747840OlWXoq','\x20activation\x20\x27','SEGMENT_NOT_FOUND','digest','state','conditionSegmentId','createdSegmentId','../../utils/async.js','1cloRAz','JOURNEY_SYNTAX_ERROR','all_columns','utf-8','journeyById','activationsBySegmentId','yamlActivation','stringify','and\x20the\x20server\x20segment,\x20then\x20retry.','activation_creating','validatedRequest','Deleting\x20activation\x20\x27','Failed\x20to\x20resolve\x20activation\x20','Deleted\x20segment\x20\x27','createFolder','idToName','updateActivation',').\x20','connector_config','logWarning','parentId','Duration','entryCriteria','onProgress','listActivations','trim','activation_updated','object','resolvedRule','schedule','journeyName','activation_','Delete\x20the\x20push\x20recovery\x20file\x20(','getSegment\x20failed\x20for\x20','find','Updated\x20segment\x20\x27','activation_created','./child-segment-yaml.js','startsWith','action','buildUserMaps','stages','get','user','activation_template_id','journey','\x0a\x20\x20','logInfo','sort','segmentByFolderAndName','columns','logSuccess','results','replace','Created\x20journey\x20\x27','idToEmailMap','rule','segment_updating','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','stage\x20\x27','existingActivation','relationships',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','createSegment','\x20error(s)','embedded_segment_created','length','entry','\x27\x20entry\x20criteria','waitStepType','Stage\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','toString','\x27\x20wait\x20condition','steps','folderId','conditionTimeoutUnit','2075hMBLkM','create','segment','toLowerCase','nameToType','with','.$1.push-recovery.json','connection','connectionIdToNameMap','embedded_activation_creating','NOT_FOUND','join','set','Journey\x20\x27'];a142_0x1adc=function(){return _0x3e37c9;};return a142_0x1adc();}export function sortFoldersByDepth(_0x110de6){return[..._0x110de6]['sort']((_0x34055c,_0x5b0a6e)=>{const _0x3d3899=a142_0x48cb,_0x52e258=(_0x34055c[_0x3d3899(0xdd)](/\//g)||[])[_0x3d3899(0x19d)],_0x1c9657=(_0x5b0a6e[_0x3d3899(0xdd)](/\//g)||[])['length'];return _0x52e258-_0x1c9657;});}import*as a142_0x79a98e from'yaml';import{readFileSync}from'fs';import a142_0x232f03 from'path';import{isJourneyDef,parseYamlString as a142_0x401a86,toYamlString as a142_0x94e2bd,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';function a142_0x48cb(_0x3f606c,_0x274e6c){_0x3f606c=_0x3f606c-0x9e;const _0x1adcdd=a142_0x1adc();let _0x48cb92=_0x1adcdd[_0x3f606c];return _0x48cb92;}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(_0x330caf){const _0xd9646=a142_0x2ccdb5;if(Array['isArray'](_0x330caf))return'['+_0x330caf[_0xd9646(0x122)](_0x4f4c90=>stableStringify(_0x4f4c90))['join'](',')+']';if(_0x330caf&&typeof _0x330caf===_0xd9646(0x176)){const _0x38be69=_0x330caf,_0x21ed87=Object[_0xd9646(0x127)](_0x38be69)[_0xd9646(0x18b)](),_0x603699=_0x21ed87['map'](_0x81f6fc=>'\x22'+_0x81f6fc+'\x22:'+stableStringify(_0x38be69[_0x81f6fc]));return'{'+_0x603699[_0xd9646(0xb3)](',')+'}';}const _0xe8d876=JSON[_0xd9646(0x162)](_0x330caf);return _0xe8d876===undefined?_0xd9646(0x124):_0xe8d876;}function activationSignature(_0x542416){const _0x3d4aa4=a142_0x2ccdb5,_0x4503cc={'connection':_0x542416[_0x3d4aa4(0xaf)],..._0x542416[_0x3d4aa4(0x15d)]!==undefined&&{'all_columns':_0x542416[_0x3d4aa4(0x15d)]},..._0x542416[_0x3d4aa4(0x18d)]!==undefined&&{'columns':_0x542416[_0x3d4aa4(0x18d)]},..._0x542416[_0x3d4aa4(0xcf)]!==undefined&&{'behavior':_0x542416['behavior']},..._0x542416[_0x3d4aa4(0x178)]!==undefined&&{'schedule':_0x542416[_0x3d4aa4(0x178)]},..._0x542416['notification']!==undefined&&{'notification':_0x542416[_0x3d4aa4(0x11d)]},..._0x542416[_0x3d4aa4(0x16d)]!==undefined&&{'connector_config':_0x542416[_0x3d4aa4(0x16d)]},..._0x542416['activation_template_id']!==undefined&&{'activation_template_id':_0x542416[_0x3d4aa4(0x187)]}};return stableStringify(_0x4503cc);}async function fetchSegment(_0x14a785,_0x348bc3,_0x44781c,_0x80c6e4){const _0xdefd79=a142_0x2ccdb5,_0x3a910c=_0x80c6e4?.[_0xdefd79(0x17d)](_0x63b29c=>_0x63b29c['id']===_0x44781c);if(_0x3a910c)return _0x3a910c;try{return await _0x14a785[_0xdefd79(0xaa)][_0xdefd79(0x143)](_0x348bc3,_0x44781c);}catch(_0x1f6728){logger[_0xdefd79(0xe3)](_0xdefd79(0x17c)+_0x44781c+_0xdefd79(0x199)+_0x1f6728);try{return await _0x14a785[_0xdefd79(0xaa)][_0xdefd79(0x14e)](_0x44781c);}catch(_0x250404){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x44781c+':\x20'+_0x250404),null;}}}function recoverSegmentIdsFromPushRecovery(_0x41a812,_0x3d3f21,_0x2c0b4b){const _0x42c9e9=a142_0x2ccdb5,_0x42cb49=readPushRecovery(_0x41a812['absolutePath']);if(_0x42cb49?.[_0x42c9e9(0x179)]===_0x41a812[_0x42c9e9(0x11e)][_0x42c9e9(0xed)])for(const [_0x10184c,_0x3d05dd]of Object['entries'](_0x42cb49[_0x42c9e9(0xde)])){const _0x4f7ae8=generateDeterministicJourneySegmentName(_0x41a812[_0x42c9e9(0x11e)][_0x42c9e9(0xed)],_0x10184c);_0x3d05dd[_0x42c9e9(0x138)]===_0x4f7ae8&&(_0x3d3f21[_0x42c9e9(0xb4)](_0x10184c,_0x3d05dd[_0x42c9e9(0x112)]),_0x2c0b4b[_0x42c9e9(0xb4)](_0x10184c,_0x3d05dd[_0x42c9e9(0x112)]));}}async function createOrRecoverEmbeddedSegment(_0x196dd3,_0x4e35b5,_0x374ebe,_0x5da0f7){const _0x399806=a142_0x2ccdb5;let _0x306f9e;try{_0x306f9e=await _0x196dd3[_0x399806(0xaa)][_0x399806(0xbc)]({'name':_0x374ebe[_0x399806(0x13e)],'description':_0x374ebe[_0x399806(0x10d)],'journeyId':_0x374ebe[_0x399806(0xe8)],'rule':_0x5da0f7(_0x374ebe[_0x399806(0x177)],!![]),'countPopulation':!![],'parentFolderId':_0x374ebe[_0x399806(0xa6)],'audienceId':_0x374ebe['parentId']});}catch(_0x3ef711){const _0x45ae00=_0x3ef711 instanceof Error&&_0x3ef711['message'][_0x399806(0xbb)]('Name\x20has\x20already\x20been\x20taken');if(_0x45ae00){const _0x56fb03=readPushRecovery(_0x4e35b5[_0x399806(0x14b)]),_0x49b188=_0x56fb03?.[_0x399806(0x179)]===_0x4e35b5['yamlConfig'][_0x399806(0xed)]?_0x56fb03[_0x399806(0xde)][_0x374ebe[_0x399806(0xfd)]]:undefined;if(_0x49b188?.[_0x399806(0x138)]===_0x374ebe[_0x399806(0x13e)])await _0x196dd3[_0x399806(0xaa)][_0x399806(0x117)](_0x374ebe[_0x399806(0x16f)],_0x49b188[_0x399806(0x112)],{'description':_0x374ebe[_0x399806(0x10d)],'rule':_0x5da0f7(_0x374ebe[_0x399806(0x177)],!![]),'countPopulation':!![]}),_0x306f9e=_0x49b188[_0x399806(0x112)];else throw new SDKError(ErrorCode[_0x399806(0x10b)],'Embedded\x20segment\x20\x27'+_0x374ebe[_0x399806(0xfd)]+_0x399806(0x133)+(_0x399806(0x17b)+_0x4e35b5[_0x399806(0x14b)][_0x399806(0x190)](/([^/]+)$/,_0x399806(0xae))+')\x20')+_0x399806(0x163),_0x3ef711);}else throw _0x3ef711;}return saveSegmentToPushRecovery(_0x4e35b5['absolutePath'],_0x4e35b5[_0x399806(0x11e)][_0x399806(0xed)],_0x374ebe[_0x399806(0xfd)],{'segmentId':_0x306f9e,'uniqueServerName':_0x374ebe['uniqueSegmentName'],'createdAt':new Date()[_0x399806(0x111)]()}),_0x306f9e;}export async function prepareSegmentFiles(_0x543ab6,_0x4170e1,_0x8f5bc1,_0x133240,_0x565598){const _0x18e29f=a142_0x2ccdb5,{activationDefToCreateRequest:_0x1ebbf4}=await import('./child-segment-yaml.js'),_0x15aeb4=[],_0x2864b7=new Set();for(const {yamlConfig:_0x29b541,folderPath:_0x404b59,sourcePath:_0x3ed0e9}of _0x543ab6){const _0x221dc9=resolveTDFolderPath(_0x404b59,_0x133240,_0x565598),_0x332d89=_0x221dc9+':'+_0x29b541['name'],_0x4605f6=_0x4170e1[_0x18e29f(0x18c)][_0x18e29f(0x185)](_0x332d89),_0x464cc8=_0x4605f6?_0x4170e1[_0x18e29f(0x160)][_0x18e29f(0x185)](_0x4605f6['id'])||[]:[];addFoldersToCreate(_0x221dc9,_0x4170e1[_0x18e29f(0x140)],_0x2864b7);const _0x27c816=calculateActivationActions(_0x29b541['activations']||[],_0x464cc8,_0x4170e1[_0x18e29f(0x192)],_0x4170e1['connectionIdToNameMap']);for(const _0x38acd1 of _0x27c816){(_0x38acd1[_0x18e29f(0xf7)]==='create'||_0x38acd1['type']===_0x18e29f(0xc0))&&_0x38acd1[_0x18e29f(0x161)]&&(_0x38acd1[_0x18e29f(0x165)]=await _0x1ebbf4(_0x38acd1['yamlActivation'],_0x8f5bc1));}const _0x2b1c75=calculateSegmentDiff(_0x29b541,_0x4605f6,_0x464cc8,_0x4170e1[_0x18e29f(0x192)],_0x4170e1[_0x18e29f(0xb0)]);_0x15aeb4[_0x18e29f(0x14a)]({'relativePath':_0x29b541[_0x18e29f(0xed)],'absolutePath':_0x3ed0e9,'yamlConfig':_0x29b541,'folderPath':_0x221dc9,'existingSegment':_0x4605f6,'existingActivations':_0x464cc8,'isNew':_0x2b1c75[_0x18e29f(0xd7)],'hasChanges':_0x2b1c75['hasChanges'],'diff':_0x2b1c75[_0x18e29f(0xc1)],'activationActions':_0x27c816});}return{'segmentFiles':_0x15aeb4,'foldersToCreate':_0x2864b7};}export async function prepareJourneyFiles(_0x1a45a3,_0x42e5fc,_0x2b2abb,_0x278220){const _0x223927=a142_0x2ccdb5,_0x340ec7=[],_0x1fd269=new Set();for(const {yamlConfig:_0x86d2de,folderPath:_0x35066b,sourcePath:_0x2a1222}of _0x1a45a3){const _0x4d8a98=resolveTDFolderPath(_0x35066b,_0x2b2abb,_0x278220),_0x462d69=_0x4d8a98+':'+_0x86d2de['name'],_0x3838dd=_0x42e5fc[_0x223927(0x113)]['get'](_0x462d69);let _0x16bd4a,_0x505a89;if(_0x3838dd&&_0x3838dd[_0x223927(0x19d)]>0x0){const _0x4e05bc=buildLocalExpandedRuleMappings(_0x86d2de),{createYamlContext:_0x2b6483,prefetchJourneySegments:_0x40a9fd}=createPushYamlContextForBundle(_0x42e5fc[_0x223927(0x109)],_0x42e5fc['parentId'],_0x42e5fc[_0x223927(0x135)],_0x4e05bc,_0x42e5fc[_0x223927(0x192)],_0x42e5fc[_0x223927(0xb0)],_0x42e5fc[_0x223927(0x110)],_0x42e5fc[_0x223927(0x15f)]);await _0x40a9fd(_0x3838dd[_0x223927(0x122)](_0xbea250=>_0xbea250['id']));const _0x2fb278=await _0x42e5fc[_0x223927(0x109)][_0x223927(0x188)][_0x223927(0x103)](_0x3838dd[0x0][_0x223927(0xe9)]),_0xab6ae8=hasMultipleVersions(_0x86d2de),_0x520459=async _0x2a20a5=>{const _0x2d713e=_0x223927,_0x1a2e18=_0x42e5fc['journeyById']?.[_0x2d713e(0x185)](_0x2a20a5);if(_0x1a2e18)return _0x1a2e18;return _0x42e5fc[_0x2d713e(0x13d)]({'journeyId':_0x2a20a5,'journeyName':_0x86d2de[_0x2d713e(0xed)],'isMultiVersion':_0x3838dd[_0x2d713e(0x19d)]>0x1});};if(_0xab6ae8&&_0x3838dd['length']>0x1){const _0x397350=[];for(const _0x16ff41 of _0x3838dd){const _0x11f4a2=_0x16ff41[_0x223927(0x145)]||0x1;_0x42e5fc['progress']?.[_0x223927(0xc0)](_0x223927(0xc4)+_0x86d2de[_0x223927(0xed)]+'\x20v'+_0x11f4a2);const _0x534a69=await _0x520459(_0x16ff41['id']),_0x56dbc1=_0x2b6483(_0x16ff41['id']),_0x505eb9=await journeyResponseToDef(_0x534a69,_0x56dbc1);_0x397350[_0x223927(0x14a)]({'item':_0x16ff41,'yaml':_0x505eb9});}const _0x2fc6c7=buildLocalRuleToNameMappingFromJourney(_0x86d2de);_0x505a89=buildMergedJourneyDef(_0x397350,_0x2fc6c7,_0x2fb278);const _0x111cd0=Math[_0x223927(0xd0)](..._0x397350[_0x223927(0x122)](_0x1fdeb7=>_0x1fdeb7['item'][_0x223927(0x145)]||0x0)),_0x39236e=_0x3838dd['find'](_0x50ebb1=>(_0x50ebb1[_0x223927(0x145)]||0x0)===_0x111cd0);_0x39236e&&(_0x42e5fc['progress']?.[_0x223927(0xc0)](_0x223927(0xc4)+_0x86d2de['name']+'\x20v'+_0x111cd0),_0x16bd4a=await _0x520459(_0x39236e['id']));}else{const _0x449b20=_0x3838dd[_0x3838dd[_0x223927(0x19d)]-0x1];_0x42e5fc['progress']?.[_0x223927(0xc0)](_0x223927(0xc4)+_0x86d2de['name']),_0x16bd4a=await _0x520459(_0x449b20['id']);const _0x5ace31=_0x2b6483(_0x449b20['id']),_0x208790=await journeyResponseToDef(_0x16bd4a,_0x5ace31),_0x29884a=buildLocalRuleToNameMappingFromJourney(_0x86d2de);_0x505a89=buildMergedJourneyDef([{'item':_0x449b20,'yaml':_0x208790}],_0x29884a,_0x2fb278);}}addFoldersToCreate(_0x4d8a98,_0x42e5fc[_0x223927(0x140)],_0x1fd269);const _0x3ea940=calculateJourneyDiff(_0x86d2de,_0x505a89);_0x340ec7[_0x223927(0x14a)]({'relativePath':_0x86d2de['name'],'absolutePath':_0x2a1222,'yamlConfig':_0x86d2de,'folderPath':_0x4d8a98,'existingJourney':_0x16bd4a,'isNew':_0x3ea940['isNew'],'hasChanges':_0x3ea940['hasChanges'],'diff':_0x3ea940['diff']});}return{'journeyFiles':_0x340ec7,'foldersToCreate':_0x1fd269};}export function calculateActivationActions(_0x9fb89d,_0x1df68f,_0x204d34,_0x15f2db){const _0x588d9e=a142_0x2ccdb5,_0x32a236=[],_0xd5b334=new Map();for(const _0x4c8fb8 of _0x1df68f){_0xd5b334['set'](_0x4c8fb8[_0x588d9e(0xed)],_0x4c8fb8);}const _0x2c65aa=new Map();for(const _0x530704 of _0x9fb89d){_0x2c65aa[_0x588d9e(0xb4)](_0x530704[_0x588d9e(0xed)],_0x530704);}for(const _0xe28c10 of _0x9fb89d){const _0x5bff25=_0xd5b334[_0x588d9e(0x185)](_0xe28c10['name']);if(!_0x5bff25)_0x32a236[_0x588d9e(0x14a)]({'type':_0x588d9e(0xa9),'name':_0xe28c10['name'],'yamlActivation':_0xe28c10});else{const _0x49b31f=activationResponseToDef(_0x5bff25,_0x204d34,_0x15f2db),_0x4f4326=a142_0x79a98e[_0x588d9e(0x162)](_0x49b31f),_0x4c0ef6=a142_0x79a98e[_0x588d9e(0x162)](_0xe28c10);_0x4f4326!==_0x4c0ef6&&_0x32a236[_0x588d9e(0x14a)]({'type':_0x588d9e(0xc0),'name':_0xe28c10['name'],'yamlActivation':_0xe28c10,'existingActivation':_0x5bff25});}}for(const _0x5aae8d of _0x1df68f){!_0x2c65aa[_0x588d9e(0x105)](_0x5aae8d[_0x588d9e(0xed)])&&_0x32a236[_0x588d9e(0x14a)]({'type':_0x588d9e(0x114),'name':_0x5aae8d[_0x588d9e(0xed)],'existingActivation':_0x5aae8d});}return _0x32a236;}function calculateYamlDiff(_0x345e46,_0x137abe){if(_0x137abe){const _0x47103d=generateDiff(_0x137abe,_0x345e46),_0x11678a=hasChanges(_0x47103d);return{'isNew':![],'hasChanges':_0x11678a,'diff':_0x11678a?formatDiffWithColors(_0x47103d):undefined};}const _0x76de43=generateDiff('',_0x345e46);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x76de43)};}export function calculateSegmentDiff(_0x56f14d,_0x4a4328,_0x83ac99,_0x323362,_0x5210cd){const _0x4f83f7=segmentToYamlString(_0x56f14d),_0x421964=_0x4a4328?segmentToYamlString(segmentWithActivationsToYaml(_0x4a4328,_0x83ac99,undefined,_0x323362,_0x5210cd)):undefined;return calculateYamlDiff(_0x4f83f7,_0x421964);}export function calculateJourneyDiff(_0x5bf314,_0x4e9605){const _0xd58bf8=normalizeJourneyDef(_0x5bf314,_0x5bf314),_0x17f8fb=a142_0x94e2bd(_0xd58bf8),_0x46bf19=_0x4e9605?a142_0x94e2bd(normalizeJourneyDef(_0x4e9605,_0x5bf314)):undefined;return calculateYamlDiff(_0x17f8fb,_0x46bf19);}export function findSegmentsToDelete(_0x2b7183,_0x17163f,_0x51d65c,_0x4aeac6,_0x18a373){const _0x5cf217=a142_0x2ccdb5,_0x4d7a9d=new Set();for(const {yamlConfig:_0x2e5654,folderPath:_0x332dc9}of _0x17163f){_0x4d7a9d['add'](_0x332dc9+':'+_0x2e5654[_0x5cf217(0xed)]);}return _0x2b7183[_0x5cf217(0x108)](_0x20a7a1=>{const _0x13591f=_0x5cf217,_0x2fa38e=_0x20a7a1[_0x13591f(0xca)]?_0x51d65c[_0x13591f(0x185)](_0x20a7a1[_0x13591f(0xca)]['toString']())||'':'',_0xdcf2f0=_0x2fa38e+':'+_0x20a7a1[_0x13591f(0xed)];if(_0x4d7a9d[_0x13591f(0x105)](_0xdcf2f0))return![];if(_0x18a373)return _0x2fa38e===_0x4aeac6||_0x2fa38e['startsWith'](_0x4aeac6+'/');return!![];});}export function findJourneysToDelete(_0x1cd498,_0x57a213,_0x16e7b3,_0x46abdf,_0x4f06bf){const _0x493cd5=a142_0x2ccdb5,_0x2a36b6=new Set();for(const {yamlConfig:_0x4c8d47,folderPath:_0x3f7f93}of _0x57a213){_0x2a36b6[_0x493cd5(0x118)](_0x3f7f93+':'+_0x4c8d47[_0x493cd5(0xed)]);}return _0x1cd498['filter'](_0x2e5c3b=>{const _0x20bd20=_0x493cd5,_0x1bdc7d=_0x2e5c3b[_0x20bd20(0xa6)]?_0x16e7b3[_0x20bd20(0x185)](_0x2e5c3b[_0x20bd20(0xa6)])||'':'',_0x53f897=_0x1bdc7d+':'+_0x2e5c3b['journeyBundleName'];if(_0x2a36b6[_0x20bd20(0x105)](_0x53f897))return![];if(_0x4f06bf)return _0x1bdc7d===_0x46abdf||_0x1bdc7d[_0x20bd20(0x181)](_0x46abdf+'/');return!![];});}export function buildSegmentLookupMap(_0x1e6a92,_0x5900c6){const _0x9927ee=a142_0x2ccdb5,_0x11cb25=new Map();for(const _0x4f9de3 of _0x1e6a92){const _0x24d90d=_0x4f9de3[_0x9927ee(0xca)]?_0x5900c6[_0x9927ee(0x185)](_0x4f9de3[_0x9927ee(0xca)][_0x9927ee(0xa3)]())||'':'',_0x54a8ee=_0x24d90d+':'+_0x4f9de3[_0x9927ee(0xed)];_0x11cb25[_0x9927ee(0xb4)](_0x54a8ee,_0x4f9de3);}return _0x11cb25;}export function buildSegmentNameToIdMap(_0x25b953){const _0x2ca5b1=a142_0x2ccdb5,_0x41944b=new Map();for(const _0x350772 of _0x25b953){_0x41944b[_0x2ca5b1(0xb4)](_0x350772[_0x2ca5b1(0xed)],_0x350772['id']);}return _0x41944b;}export function buildJourneyBundleLookupMap(_0x40d02c,_0x35184b){const _0x5f32ca=a142_0x2ccdb5,_0x27dc60=new Map();for(const _0x1390a1 of _0x40d02c){const _0x579f15=_0x1390a1['folderId']?_0x35184b[_0x5f32ca(0x185)](_0x1390a1[_0x5f32ca(0xa6)])||'':'',_0x26fcff=_0x579f15+':'+_0x1390a1[_0x5f32ca(0xf2)];!_0x27dc60['has'](_0x26fcff)&&_0x27dc60[_0x5f32ca(0xb4)](_0x26fcff,[]),_0x27dc60['get'](_0x26fcff)[_0x5f32ca(0x14a)](_0x1390a1);}for(const _0x411a20 of _0x27dc60[_0x5f32ca(0xe5)]()){_0x411a20[_0x5f32ca(0x18b)]((_0x5dba9c,_0x2c236b)=>(_0x5dba9c[_0x5f32ca(0x145)]||0x0)-(_0x2c236b[_0x5f32ca(0x145)]||0x0));}return _0x27dc60;}export function collectFoldersToCreate(_0xb297a6,_0x3497c8){const _0x1a41d5=a142_0x2ccdb5,_0x2813b2=new Set();for(const _0x715361 of _0xb297a6){if(!_0x715361)continue;if(_0x3497c8[_0x1a41d5(0x105)](_0x715361))continue;const _0x2fac1c=_0x715361[_0x1a41d5(0xbd)]('/');let _0x14d571='';for(const _0x151602 of _0x2fac1c){_0x14d571=_0x14d571?_0x14d571+'/'+_0x151602:_0x151602,!_0x3497c8[_0x1a41d5(0x105)](_0x14d571)&&_0x2813b2['add'](_0x14d571);}}return _0x2813b2;}export function parseAndClassifyYamlFiles(_0x1cf621,_0x29349e,_0x48b266){const _0x312154=a142_0x2ccdb5,_0x2eff16=[],_0x3e3cf1=[];for(const _0x1523e4 of _0x1cf621){const _0x38aeef=a142_0x232f03['relative'](_0x29349e,a142_0x232f03[_0x312154(0xf3)](_0x1523e4)),_0x392d84=_0x38aeef==='.'?'':_0x38aeef,_0x5358b3=readFileSync(_0x1523e4,_0x312154(0x15e)),_0x2b1020=a142_0x79a98e['parse'](_0x5358b3);if(isJourneyDef(_0x2b1020)){const _0x2bf6eb=a142_0x401a86(_0x5358b3);_0x3e3cf1[_0x312154(0x14a)]({'yamlConfig':_0x2bf6eb,'folderPath':_0x392d84,'sourcePath':_0x1523e4});}else{if(!_0x48b266?.['skipSegments']){const _0x2c8d7a=parseSegmentYamlFile(_0x5358b3),_0x50f387=normalizeChildSegmentYaml(_0x2c8d7a);_0x2eff16['push']({'yamlConfig':_0x50f387,'folderPath':_0x392d84,'sourcePath':_0x1523e4});}}}return{'segments':_0x2eff16,'journeys':_0x3e3cf1};}export function validateParsedFiles(_0x44ccd3,_0x5975e8){const _0x3a6617=a142_0x2ccdb5,_0x14b0bb=[];for(const {yamlConfig:_0x513dfa,sourcePath:_0x4d2b2b}of _0x44ccd3[_0x3a6617(0xde)]){const _0x5b19fc=readFileSync(_0x4d2b2b,_0x3a6617(0x15e)),_0x5636c9=a142_0x79a98e[_0x3a6617(0xfe)](_0x5b19fc),_0x5780a4=validateSegmentDef(_0x513dfa,{'source':_0x5b19fc,'document':_0x5636c9},{'skipSchema':!![]});if(!_0x5780a4['valid']){const _0x4022f0=a142_0x232f03['relative'](_0x5975e8,_0x4d2b2b);_0x14b0bb[_0x3a6617(0x14a)]({'filePath':_0x4022f0,'source':_0x5b19fc,'result':_0x5780a4,'isJourney':![]});}}for(const {yamlConfig:_0x1e2131,sourcePath:_0x273f80}of _0x44ccd3['journeys']){const _0x1601f=readFileSync(_0x273f80,'utf-8'),_0x5e5335=a142_0x79a98e[_0x3a6617(0xfe)](_0x1601f),_0x320b48=validateJourneyDef(_0x1e2131,{'source':_0x1601f,'document':_0x5e5335},{'skipSchema':!![]});if(!_0x320b48[_0x3a6617(0x12a)]){const _0xd2d024=a142_0x232f03[_0x3a6617(0x131)](_0x5975e8,_0x273f80);_0x14b0bb[_0x3a6617(0x14a)]({'filePath':_0xd2d024,'source':_0x1601f,'result':_0x320b48,'isJourney':!![]});}}return _0x14b0bb;}export function formatValidationErrors(_0xdfab6f){const _0x401a91=a142_0x2ccdb5,_0x57475f=[];for(const {filePath:_0x3745bc,source:_0x42f2a1,result:_0x9e683a,isJourney:_0x15d991}of _0xdfab6f){const _0x43f785=_0x15d991?_0x401a91(0x188):'segment';_0x57475f[_0x401a91(0x14a)]('\x0a'+_0x3745bc+'\x20('+_0x43f785+'):\x20'+_0x9e683a['errors'][_0x401a91(0x19d)]+_0x401a91(0x19b)),_0x57475f[_0x401a91(0x14a)](formatValidationResult(_0x9e683a,_0x42f2a1,_0x3745bc));}return _0x57475f[_0x401a91(0xb3)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x56654d){const _0x594a2d=a142_0x2ccdb5,_0x465f1c=new Set(),_0x61efff=new Map(),_0x13c3d1=collectSegmentUsageCounts(_0x56654d);if(_0x56654d[_0x594a2d(0xde)])for(const [_0x5e34c9,_0x598808]of Object['entries'](_0x56654d[_0x594a2d(0xde)])){_0x465f1c['add'](_0x5e34c9);if(_0x598808[_0x594a2d(0x193)]){const _0x46faaa=yamlRuleToApi(_0x598808[_0x594a2d(0x193)]),_0x47b5b7=apiRuleToYaml(_0x46faaa);_0x61efff[_0x594a2d(0xb4)](_0x5e34c9,_0x47b5b7);}}const _0x5f06dc=new Map();let _0x1f6311=0x0;for(const [_0x2b37ef,_0xb7fb9d]of _0x61efff){const _0x53454b=serializeExpandedRule(_0xb7fb9d,_0x61efff),_0x336b92=_0x5f06dc[_0x594a2d(0x185)](_0x53454b)||[];_0x336b92[_0x594a2d(0x14a)]({'name':_0x2b37ef,'index':_0x1f6311}),_0x5f06dc['set'](_0x53454b,_0x336b92),_0x1f6311++;}const _0x2b1fd0=new Map();for(const [_0x49c7a8,_0x3cd95c]of _0x5f06dc){const _0x1ffd74=_0x3cd95c[_0x594a2d(0xb7)]()['sort']((_0x472732,_0x5787ad)=>{const _0x37d7aa=_0x594a2d,_0x46d092=_0x13c3d1[_0x37d7aa(0x185)](_0x472732['name'])||0x0,_0x442823=_0x13c3d1[_0x37d7aa(0x185)](_0x5787ad[_0x37d7aa(0xed)])||0x0;if(_0x46d092!==_0x442823)return _0x442823-_0x46d092;return _0x472732[_0x37d7aa(0xcd)]-_0x5787ad[_0x37d7aa(0xcd)];})[_0x594a2d(0x122)](_0x44374f=>_0x44374f[_0x594a2d(0xed)]),_0x35ca66=[];for(const _0x15bfba of _0x1ffd74){const _0x28955a=_0x13c3d1['get'](_0x15bfba)||0x0,_0x1e527b=Math['max'](_0x28955a,0x1);for(let _0x2ff88b=0x0;_0x2ff88b<_0x1e527b;_0x2ff88b++){_0x35ca66['push'](_0x15bfba);}}_0x2b1fd0[_0x594a2d(0xb4)](_0x49c7a8,_0x35ca66);}return{'existingLocalSegmentNames':_0x465f1c,'localSegmentRules':_0x61efff,'localExpandedRuleToNames':_0x2b1fd0};}export function createSegmentIdResolver(_0x447db3,_0x37a570){return async _0x1a4623=>{const _0x11a085=a142_0x48cb,_0x27111a=_0x447db3[_0x11a085(0x185)](_0x1a4623);if(!_0x27111a)throw new SDKError(ErrorCode[_0x11a085(0x155)],'Segment\x20not\x20found:\x20'+_0x1a4623+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x37a570+'\x27)');return _0x27111a;};}export function extractRootFolderId(_0x146327){const _0x2fa0fe=a142_0x2ccdb5;return _0x146327[_0x2fa0fe(0x198)]?.['parentSegmentFolder']?.[_0x2fa0fe(0xfa)]?.['id']||_0x146327[_0x2fa0fe(0x198)]?.[_0x2fa0fe(0xfb)]?.['data']?.['id'];}export function buildConnectionMaps(_0x3ace90){const _0x34a080=a142_0x2ccdb5,_0x4279d2=new Map(),_0x54c913=new Map(),_0x98619f=new Map();for(const _0x4d1432 of _0x3ace90){_0x4279d2[_0x34a080(0xb4)](_0x4d1432[_0x34a080(0xed)],parseInt(_0x4d1432['id'],0xa)),_0x54c913[_0x34a080(0xb4)](_0x4d1432['id'],_0x4d1432[_0x34a080(0xed)]),_0x98619f[_0x34a080(0xb4)](_0x4d1432['name'],_0x4d1432[_0x34a080(0xf7)]);}return{'nameToId':_0x4279d2,'idToName':_0x54c913,'nameToType':_0x98619f};}export function calculatePushStats(_0x238579,_0xb8e5db,_0x548a34,_0x5d1673,_0x348c3e,_0x10bf79,_0xd428de){const _0x249431=a142_0x2ccdb5,_0x3e74af=_0x238579[_0x249431(0x108)](_0x380020=>_0x380020['isNew']),_0x312ac2=_0x238579[_0x249431(0x108)](_0x55c5c4=>!_0x55c5c4[_0x249431(0xd7)]&&_0x55c5c4[_0x249431(0xea)]),_0x483bd9=_0x238579[_0x249431(0x108)](_0x269e19=>!_0x269e19[_0x249431(0xd7)]&&!_0x269e19['hasChanges']),_0x49ebd4=_0x10bf79?_0x5d1673:[],_0x4ca0=_0xb8e5db[_0x249431(0x108)](_0x1215f8=>_0x1215f8[_0x249431(0xd7)]),_0x3b8210=_0xb8e5db[_0x249431(0x108)](_0xaf46f1=>!_0xaf46f1[_0x249431(0xd7)]&&_0xaf46f1['hasChanges']),_0x50f741=_0xb8e5db[_0x249431(0x108)](_0x5bc4c0=>!_0x5bc4c0['isNew']&&!_0x5bc4c0[_0x249431(0xea)]),_0x12ed6b=_0x10bf79?_0x348c3e:[],_0x5b7fce=_0x238579[_0x249431(0xc2)](_0x16eef7=>_0x16eef7[_0x249431(0x115)]),_0x44abaa=_0x5b7fce[_0x249431(0x108)](_0x17f334=>_0x17f334[_0x249431(0xf7)]===_0x249431(0xa9)),_0x192824=_0x5b7fce['filter'](_0x5b49a6=>_0x5b49a6[_0x249431(0xf7)]===_0x249431(0xc0)),_0x2166fe=_0x5b7fce[_0x249431(0x108)](_0x333afa=>_0x333afa[_0x249431(0xf7)]===_0x249431(0x114)),_0x36aaca=Array[_0x249431(0xcb)](_0x548a34)[_0x249431(0x18b)](),_0x45231b=_0xd428de?![]:_0x3e74af[_0x249431(0x19d)]>0x0||_0x312ac2['length']>0x0||_0x49ebd4['length']>0x0,_0x562124=_0x4ca0['length']>0x0||_0x3b8210[_0x249431(0x19d)]>0x0||_0x12ed6b[_0x249431(0x19d)]>0x0,_0x6223b5=_0xd428de?![]:_0x5b7fce[_0x249431(0x19d)]>0x0,_0x33f266=_0x36aaca['length']>0x0;return{'segments':{'new':_0x3e74af,'changed':_0x312ac2,'unchanged':_0x483bd9,'toDelete':_0x49ebd4},'journeys':{'new':_0x4ca0,'changed':_0x3b8210,'unchanged':_0x50f741,'toDelete':_0x12ed6b},'activations':{'all':_0x5b7fce,'toCreate':_0x44abaa,'toUpdate':_0x192824,'toDelete':_0x2166fe},'folders':{'toCreate':_0x36aaca},'counts':{'segments':{'new':_0x3e74af[_0x249431(0x19d)],'changed':_0x312ac2[_0x249431(0x19d)],'unchanged':_0x483bd9['length'],'toDelete':_0x49ebd4[_0x249431(0x19d)]},'journeys':{'new':_0x4ca0[_0x249431(0x19d)],'changed':_0x3b8210[_0x249431(0x19d)],'unchanged':_0x50f741[_0x249431(0x19d)],'toDelete':_0x12ed6b['length']},'activations':{'create':_0x44abaa[_0x249431(0x19d)],'update':_0x192824[_0x249431(0x19d)],'delete':_0x2166fe[_0x249431(0x19d)]},'folders':_0x36aaca[_0x249431(0x19d)]},'hasChanges':_0x45231b||_0x562124||_0x6223b5||_0x33f266};}export async function buildPushExecutionContext(_0x1406f3,_0x2a5f6a,_0x381fb1,_0x3137ba,_0x3dfb3f,_0x502505){const _0x29294a=a142_0x2ccdb5,_0xa71fc4=extractRootFolderId(_0x381fb1),{pathToId:_0x14559a,idToPath:_0x10b14e}=buildFolderMaps(_0x3dfb3f),_0x1357e8=buildSegmentNameToIdMap(_0x3137ba),_0x57a91a=new Map(),{batchAsync:_0x41e4ef}=await import(_0x29294a(0x15a)),[_0x5ed814,_0x2abb51]=await Promise['all']([_0x1406f3[_0x29294a(0x186)][_0x29294a(0x183)](),_0x1406f3[_0x29294a(0xaf)][_0x29294a(0x121)](),((async()=>{const _0x20fab9=_0x29294a;!_0x502505&&_0x3137ba[_0x20fab9(0x19d)]>0x0&&await _0x41e4ef(_0x3137ba,async _0x5c071c=>{const _0x55ac9e=_0x20fab9,_0x5a3e10=await _0x1406f3[_0x55ac9e(0xaa)][_0x55ac9e(0x173)](_0x2a5f6a,_0x5c071c['id']);_0x57a91a[_0x55ac9e(0xb4)](_0x5c071c['id'],_0x5a3e10);});})())]),{emailToId:_0xfee1cd,idToEmail:_0x3f9590}=_0x5ed814,_0x83fcc6=buildConnectionMaps(_0x2abb51);return{'rootFolderId':_0xa71fc4,'folderPathToId':_0x14559a,'folderIdToPath':_0x10b14e,'segmentNameToId':_0x1357e8,'activationsBySegmentId':_0x57a91a,'emailToIdMap':_0xfee1cd,'idToEmailMap':_0x3f9590,'connectionNameToIdMap':_0x83fcc6['nameToId'],'connectionIdToNameMap':_0x83fcc6[_0x29294a(0x16a)],'connectionNameToTypeMap':_0x83fcc6[_0x29294a(0xac)]};}export function createPushYamlContextForBundle(_0x504a3f,_0x283cc1,_0x107730,_0x548463,_0x16681f,_0x19336b,_0x30da38,_0x30e829){const {existingLocalSegmentNames:_0x1fc4d3,localExpandedRuleToNames:_0xb40a1d}=_0x548463,_0x4e0f34=new Set(),_0x2d0216=new Map(),_0x86b2cf=new Map(),_0x51cc94=new Map(),_0x5acfaa=createJumpTargetCache(),_0x1ba82b=new Map(),_0x36151=new Map(),_0x318850=new Set();let _0x5a2313;const _0x4fc202=_0xa44ac8=>{const _0x38f216={'resolveSegment':async _0x7565f2=>{const _0x13d75a=a142_0x48cb,_0x3774ff=_0x51cc94[_0x13d75a(0x185)](_0x7565f2);if(_0x3774ff!==undefined)return{'name':_0x3774ff,'isJourneyLocal':!![]};try{const _0x494212=await fetchSegment(_0x504a3f,_0x283cc1,_0x7565f2,_0x107730);if(!_0x494212)throw new Error(_0x13d75a(0xdb));const _0x18f905=generateJourneyLocalName(_0x494212[_0x13d75a(0xed)]),_0x110509=_0x494212[_0x13d75a(0xe1)]===SEGMENT_KIND_JOURNEY&&_0x18f905!==undefined;let _0x492f9f=_0x494212[_0x13d75a(0xed)],_0x2d17fb;if(_0x110509&&_0x494212[_0x13d75a(0x193)]){const _0x4bd203=apiRuleToYaml(_0x494212[_0x13d75a(0x193)]);_0x36151[_0x13d75a(0xb4)](_0x7565f2,_0x4bd203);const _0x33a96b=async _0x3d35dd=>{const _0x53333a=_0x13d75a,_0x493edc=collectSegmentRefsFromRule(_0x3d35dd);for(const _0xd929c3 of _0x493edc){if(!_0x36151[_0x53333a(0x105)](_0xd929c3))try{const _0x3ecfcb=await fetchSegment(_0x504a3f,_0x283cc1,_0xd929c3,_0x107730);if(_0x3ecfcb?.['rule']){const _0x515def=apiRuleToYaml(_0x3ecfcb[_0x53333a(0x193)]);_0x36151['set'](_0xd929c3,_0x515def),await _0x33a96b(_0x515def);}}catch(_0x1ae14b){logger[_0x53333a(0xe3)](_0x53333a(0xbf)+_0xd929c3+':\x20'+_0x1ae14b);}}};await _0x33a96b(_0x4bd203);const _0x52e463=serializeExpandedRule(_0x4bd203,_0x36151),_0x4fae48=_0xb40a1d[_0x13d75a(0x185)](_0x52e463);if(_0x4fae48&&_0x4fae48[_0x13d75a(0x19d)]>0x0){const _0x4e68e6=_0x2d0216['get'](_0x52e463)||0x0,_0x53f8fc=_0x4fae48[_0x4e68e6]||_0x4fae48[_0x4fae48['length']-0x1];_0x2d0216['set'](_0x52e463,_0x4e68e6+0x1),_0x492f9f=_0x53f8fc,_0x4e0f34[_0x13d75a(0x118)](_0x492f9f),_0x51cc94['set'](_0x7565f2,_0x492f9f);const _0x55f208=await resolveRuleSegmentRefs(_0x4bd203,async _0x319173=>{const _0x191165=_0x13d75a,_0x496873=_0x51cc94['get'](_0x319173);if(_0x496873)return _0x496873;const _0x4a47ac=await _0x5a2313[_0x191165(0xff)](_0x319173);return _0x4a47ac[_0x191165(0xed)];});_0x2d17fb={'description':_0x494212[_0x13d75a(0x10d)],'rule':_0x55f208};}else{const _0x2f4f2d=_0x1ba82b[_0x13d75a(0x185)](_0x52e463);if(_0x2f4f2d)_0x492f9f=_0x2f4f2d,_0x51cc94['set'](_0x7565f2,_0x492f9f);else{if(_0x18f905){let _0x38a79d=_0x18f905,_0x5a7113=0x2;while(_0x4e0f34['has'](_0x38a79d)||_0x1fc4d3[_0x13d75a(0x105)](_0x38a79d)){_0x38a79d=_0x18f905+'_'+_0x5a7113,_0x5a7113++;}_0x4e0f34['add'](_0x38a79d),_0x492f9f=_0x38a79d;}_0x51cc94[_0x13d75a(0xb4)](_0x7565f2,_0x492f9f),_0x1ba82b['set'](_0x52e463,_0x492f9f);const _0x4b1a26=await resolveRuleSegmentRefs(_0x4bd203,async _0xc8852a=>{const _0x35756b=_0x13d75a,_0x1b919b=_0x51cc94['get'](_0xc8852a);if(_0x1b919b)return _0x1b919b;const _0x4e520d=await _0x5a2313[_0x35756b(0xff)](_0xc8852a);return _0x4e520d[_0x35756b(0xed)];});_0x2d17fb={'description':_0x494212[_0x13d75a(0x10d)],'rule':_0x4b1a26};}}}return{'name':_0x492f9f,'isJourneyLocal':_0x110509,'definition':_0x2d17fb};}catch(_0x21cba6){return logger[_0x13d75a(0xe3)]('Failed\x20to\x20resolve\x20segment\x20'+_0x7565f2+':\x20'+_0x21cba6),{'name':_0x7565f2,'isJourneyLocal':![]};}},'resolveActivation':async _0x831fb3=>{const _0x2aec23=a142_0x48cb,_0x3abcfa=_0x86b2cf[_0x2aec23(0x185)](_0x831fb3);if(_0x3abcfa!==undefined)return{'name':_0x3abcfa,'isJourneyLocal':!![]};try{let _0x2ec141=_0x30da38?.[_0x2aec23(0x185)](_0x831fb3);!_0x2ec141&&(_0x2ec141=await _0x504a3f[_0x2aec23(0x188)]['getActivation'](_0xa44ac8,_0x831fb3));const _0x14ba8c=_0x2ec141[_0x2aec23(0x13b)]['activationParams'][_0x2aec23(0xed)]||_0x831fb3,_0x207733=sanitizeYamlKey(_0x14ba8c)||_0x2aec23(0x17a)+_0x831fb3,_0x51fa56=_0x207733;_0x86b2cf[_0x2aec23(0xb4)](_0x831fb3,_0x51fa56);const _0x226fe9=journeyActivationStepToYaml(_0x2ec141,_0x16681f,_0x19336b);return{'name':_0x51fa56,'isJourneyLocal':!![],'definition':_0x226fe9};}catch(_0x133f29){return logger['debug'](_0x2aec23(0x167)+_0x831fb3+':\x20'+_0x133f29),{'name':_0x831fb3,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5705a2,_0x3af5c0)=>resolveJumpTarget(_0x5705a2,_0x3af5c0,_0x5acfaa,async _0x9023c8=>{const _0x3b093f=a142_0x48cb,_0x457b31=_0x30e829?.[_0x3b093f(0x185)](_0x9023c8);if(_0x457b31)return _0x457b31;return _0x504a3f[_0x3b093f(0x188)][_0x3b093f(0xec)](_0x9023c8);})};return _0x5a2313=_0x38f216,_0x38f216;},_0x3df1c1=async _0x16aee2=>{const _0x2ba5e4=a142_0x48cb,{collectSegmentIdsFromJourneyApi:_0x3a1729}=await import(_0x2ba5e4(0xc9)),{batchAsync:_0x15634f}=await import(_0x2ba5e4(0x15a)),_0x25d098=new Set();for(const _0x2f80ed of _0x16aee2){let _0x372ad9=_0x30e829?.[_0x2ba5e4(0x185)](_0x2f80ed);!_0x372ad9&&(_0x372ad9=await _0x504a3f['journey'][_0x2ba5e4(0xec)](_0x2f80ed));const _0x18af1a=_0x3a1729(_0x372ad9);for(const _0x1223e3 of _0x18af1a){_0x25d098['add'](_0x1223e3);}}let _0x34d2cb=Array['from'](_0x25d098);while(_0x34d2cb['length']>0x0){const _0x5b2748=_0x34d2cb[_0x2ba5e4(0x108)](_0x1c7911=>!_0x318850['has'](_0x1c7911));if(_0x5b2748[_0x2ba5e4(0x19d)]===0x0)break;const _0x11cfd6=await _0x15634f(_0x5b2748,async _0x1d20e0=>{const _0xd78dc6=_0x2ba5e4;_0x318850[_0xd78dc6(0x118)](_0x1d20e0);const _0x479c85=await fetchSegment(_0x504a3f,_0x283cc1,_0x1d20e0,_0x107730);if(!_0x479c85)return null;return{'segmentId':_0x1d20e0,'segment':_0x479c85};},0xa),_0x338032=new Set();for(const _0x4ce449 of _0x11cfd6){if(!_0x4ce449?.[_0x2ba5e4(0xaa)]?.[_0x2ba5e4(0x193)])continue;const _0x4b3210=apiRuleToYaml(_0x4ce449['segment'][_0x2ba5e4(0x193)]);_0x36151[_0x2ba5e4(0xb4)](_0x4ce449[_0x2ba5e4(0x112)],_0x4b3210);const _0x4b10f1=collectSegmentRefsFromRule(_0x4b3210);for(const _0x4fa6d5 of _0x4b10f1){!_0x318850[_0x2ba5e4(0x105)](_0x4fa6d5)&&_0x338032[_0x2ba5e4(0x118)](_0x4fa6d5);}}_0x34d2cb=Array[_0x2ba5e4(0xcb)](_0x338032);}};return{'createYamlContext':_0x4fc202,'prefetchJourneySegments':_0x3df1c1};}export async function executePushSegments(_0x3f752c,_0x3bc1d7,_0x14135d,_0x4c930f,_0xf19740){const _0x26d103=a142_0x2ccdb5,{segmentDefToCreateRequest:_0x552817,segmentDefToUpdateRequest:_0x3dc78b}=await import(_0x26d103(0x180)),_0x4b7f83=_0x14135d[_0x26d103(0x140)],_0x2e2737=0x5,_0x5b6eef=async _0x1d5546=>{const _0x278163=_0x26d103,_0x1c77d0=_0x1d5546[_0x278163(0x119)]?_0x4b7f83[_0x278163(0x185)](_0x1d5546[_0x278163(0x119)]):undefined;let _0x7e0a08;const _0x2b6375={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x5b0416=_0x1d5546[_0x278163(0x11e)];if(_0x1d5546['yamlConfig']['rule']){const _0x321a88=createSegmentIdResolver(_0x14135d[_0x278163(0x104)],_0x1d5546['yamlConfig']['name']),_0xd6bee8=await resolveRuleSegmentIds(_0x1d5546['yamlConfig'][_0x278163(0x193)],_0x321a88);_0x5b0416={..._0x1d5546['yamlConfig'],'rule':_0xd6bee8};}try{if(_0x1d5546['isNew']){_0xf19740[_0x278163(0x172)]?.({'type':'segment_creating','name':_0x1d5546[_0x278163(0x11e)]['name']});const _0x100d3f=_0x552817(_0x5b0416,_0x1c77d0),_0x4fc25b=await _0xf19740[_0x278163(0xba)](_0x278163(0x102)+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+'\x27...',()=>_0x3f752c[_0x278163(0xaa)][_0x278163(0x19a)](_0x4c930f[_0x278163(0x16f)],_0x100d3f));_0x7e0a08=_0x4fc25b['data']['id'],_0x14135d[_0x278163(0x104)]['set'](_0x1d5546['yamlConfig']['name'],_0x7e0a08),_0x2b6375[_0x278163(0x159)]={'name':_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)],'id':_0x7e0a08},_0xf19740[_0x278163(0x172)]?.({'type':'segment_created','name':_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)],'segmentId':_0x7e0a08}),_0xf19740[_0x278163(0x18e)]?.('Created\x20segment\x20\x27'+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+'\x27'),_0x2b6375[_0x278163(0x126)]=0x1;}else{if(_0x1d5546[_0x278163(0xea)]){_0xf19740[_0x278163(0x172)]?.({'type':_0x278163(0x194),'name':_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]});const _0x34423d=_0x3dc78b(_0x5b0416);_0x1c77d0!==_0x1d5546[_0x278163(0xd5)]?.[_0x278163(0xca)]&&(_0x34423d[_0x278163(0xca)]=_0x1c77d0?parseInt(_0x1c77d0,0xa):undefined),await _0xf19740[_0x278163(0xba)]('Updating\x20segment\x20\x27'+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+_0x278163(0xf0),()=>_0x3f752c['segment'][_0x278163(0x117)](_0x4c930f['parentId'],_0x1d5546[_0x278163(0xd5)]['id'],_0x34423d)),_0x7e0a08=_0x1d5546[_0x278163(0xd5)]['id'],_0xf19740['onProgress']?.({'type':'segment_updated','name':_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]}),_0xf19740[_0x278163(0x18e)]?.(_0x278163(0x17e)+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+'\x27'),_0x2b6375[_0x278163(0xf9)]=0x1;}else _0x7e0a08=_0x1d5546['existingSegment']['id'];}}catch(_0x38c4e0){const _0x4237ee=isHttp400Error(_0x38c4e0),_0x225d5e=_0x4237ee?ErrorCode[_0x278163(0x14f)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x44b3da=getErrorMessage(_0x38c4e0);throw new SDKError(_0x225d5e,_0x278163(0xdc)+(_0x1d5546[_0x278163(0xd7)]?_0x278163(0xa9):_0x278163(0xc0))+'\x20segment\x20from\x20file:\x20'+_0x1d5546[_0x278163(0x14b)]+_0x278163(0x189)+_0x44b3da,_0x38c4e0);}try{const _0x218c6f=await syncActivationsForSegment(_0x3f752c,_0x4c930f[_0x278163(0x16f)],_0x7e0a08,_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)],_0x1d5546['activationActions'],_0xf19740,_0x1d5546[_0x278163(0x14b)]);_0x2b6375[_0x278163(0x146)]=_0x218c6f;}catch(_0x1d0894){if(_0x1d0894 instanceof SDKError)throw _0x1d0894;throw new SDKError(ErrorCode[_0x278163(0xf4)],_0x278163(0xa2)+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+_0x278163(0x106)+_0x1d5546['absolutePath']+_0x278163(0x189)+getErrorMessage(_0x1d0894),_0x1d0894);}return _0x2b6375;},_0xc70c8c=await batchAsync(_0x3bc1d7,_0x5b6eef,_0x2e2737),_0x41eb24={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2fa594 of _0xc70c8c){_0x41eb24[_0x26d103(0x126)]+=_0x2fa594[_0x26d103(0x126)],_0x41eb24[_0x26d103(0xf9)]+=_0x2fa594[_0x26d103(0xf9)],_0x2fa594[_0x26d103(0x159)]&&_0x41eb24[_0x26d103(0x11f)][_0x26d103(0xb4)](_0x2fa594['createdSegmentId'][_0x26d103(0xed)],_0x2fa594[_0x26d103(0x159)]['id']),_0x41eb24[_0x26d103(0x146)][_0x26d103(0x126)]+=_0x2fa594[_0x26d103(0x146)][_0x26d103(0x126)],_0x41eb24[_0x26d103(0x146)][_0x26d103(0xf9)]+=_0x2fa594['activations'][_0x26d103(0xf9)],_0x41eb24[_0x26d103(0x146)]['deleted']+=_0x2fa594[_0x26d103(0x146)][_0x26d103(0x141)];}return _0x41eb24;}async function syncActivationsForSegment(_0x3db0d3,_0x1fcc6f,_0x193a6b,_0x3035c9,_0x5421e4,_0x3298a7,_0x8e9833){const _0x37ca20=a142_0x2ccdb5,_0x18acfc={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1a5549 of _0x5421e4){try{if(_0x1a5549[_0x37ca20(0xf7)]===_0x37ca20(0xa9)&&_0x1a5549[_0x37ca20(0x165)])_0x3298a7['onProgress']?.({'type':_0x37ca20(0x164),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),await _0x3298a7[_0x37ca20(0xba)]('Creating\x20activation\x20\x27'+_0x1a5549[_0x37ca20(0xed)]+_0x37ca20(0xf0),()=>_0x3db0d3[_0x37ca20(0xaa)]['createActivation'](_0x1fcc6f,_0x193a6b,_0x1a5549[_0x37ca20(0x165)])),_0x3298a7['onProgress']?.({'type':_0x37ca20(0x17f),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),_0x3298a7[_0x37ca20(0x18e)]?.(_0x37ca20(0xc7)+_0x1a5549[_0x37ca20(0xed)]+'\x27'),_0x18acfc[_0x37ca20(0x126)]++;else{if(_0x1a5549[_0x37ca20(0xf7)]===_0x37ca20(0xc0)&&_0x1a5549['validatedRequest']&&_0x1a5549[_0x37ca20(0x197)])_0x3298a7[_0x37ca20(0x172)]?.({'type':_0x37ca20(0x149),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),await _0x3298a7[_0x37ca20(0xba)]('Updating\x20activation\x20\x27'+_0x1a5549[_0x37ca20(0xed)]+_0x37ca20(0xf0),()=>_0x3db0d3[_0x37ca20(0xaa)][_0x37ca20(0x16b)](_0x1fcc6f,_0x193a6b,_0x1a5549[_0x37ca20(0x197)]['id'],_0x1a5549['validatedRequest'])),_0x3298a7[_0x37ca20(0x172)]?.({'type':_0x37ca20(0x175),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),_0x3298a7[_0x37ca20(0x18e)]?.('Updated\x20activation\x20\x27'+_0x1a5549[_0x37ca20(0xed)]+'\x27'),_0x18acfc[_0x37ca20(0xf9)]++;else _0x1a5549[_0x37ca20(0xf7)]===_0x37ca20(0x114)&&_0x1a5549[_0x37ca20(0x197)]&&(_0x3298a7[_0x37ca20(0x172)]?.({'type':_0x37ca20(0xc5),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),await _0x3298a7['withProgress'](_0x37ca20(0x166)+_0x1a5549['name']+_0x37ca20(0xf0),()=>_0x3db0d3['segment'][_0x37ca20(0x147)](_0x1fcc6f,_0x193a6b,_0x1a5549['existingActivation']['id'])),_0x3298a7[_0x37ca20(0x172)]?.({'type':_0x37ca20(0x12c),'segmentName':_0x3035c9,'activationName':_0x1a5549['name']}),_0x3298a7['logDeleted']?.(_0x37ca20(0x100)+_0x1a5549['name']+'\x27'),_0x18acfc[_0x37ca20(0x141)]++);}}catch(_0x99334c){const _0x22dfec=isHttp400Error(_0x99334c),_0x59a02f=_0x22dfec?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x37ca20(0xf4)],_0x346bd1=getErrorMessage(_0x99334c);throw new SDKError(_0x59a02f,_0x37ca20(0xdc)+_0x1a5549[_0x37ca20(0xf7)]+_0x37ca20(0x154)+_0x1a5549[_0x37ca20(0xed)]+_0x37ca20(0x106)+_0x8e9833+_0x37ca20(0x189)+_0x346bd1,_0x99334c);}}return _0x18acfc;}export async function executePushFolders(_0x404dab,_0x5627fb,_0x53dcfe,_0x4d6d4c,_0x24bf13){const _0x29b362=a142_0x2ccdb5,_0x4d1a32=new Map(_0x53dcfe),_0x2ee878=sortFoldersByDepth(_0x5627fb);for(const _0x1451b3 of _0x2ee878){const _0x4332ac=_0x1451b3[_0x29b362(0xbd)]('/'),_0x2563d3=_0x4332ac[_0x4332ac[_0x29b362(0x19d)]-0x1],_0x5a4caf=_0x4332ac[_0x29b362(0xb7)](0x0,-0x1)[_0x29b362(0xb3)]('/'),_0x40fbac=_0x4d1a32['get'](_0x5a4caf);_0x24bf13['onProgress']?.({'type':_0x29b362(0x10a),'folder':_0x1451b3});const _0x2cbcf9={'name':_0x2563d3,'parentFolderId':_0x40fbac},_0x4eaea1=await _0x24bf13['withProgress']('Creating\x20folder\x20\x27'+_0x1451b3+_0x29b362(0xf0),()=>_0x404dab['segment'][_0x29b362(0x169)](_0x4d6d4c[_0x29b362(0x16f)],_0x2cbcf9));_0x4d1a32[_0x29b362(0xb4)](_0x1451b3,_0x4eaea1[_0x29b362(0xfa)]['id']),_0x24bf13[_0x29b362(0x172)]?.({'type':_0x29b362(0x107),'folder':_0x1451b3,'folderId':_0x4eaea1[_0x29b362(0xfa)]['id']}),_0x24bf13[_0x29b362(0x18a)]?.('Created\x20folder\x20\x27'+_0x1451b3+'\x27');}return _0x4d1a32;}export async function executePushSegmentDeletions(_0x51629f,_0x4273e2,_0x260ca2){const _0xe73fb=a142_0x2ccdb5;if(_0x4273e2[_0xe73fb(0x19d)]===0x0)return 0x0;const {batchAsync:_0x48612d}=await import(_0xe73fb(0x15a)),_0xaad3a0=0x5,_0x1b761f=await _0x48612d(_0x4273e2,async _0x56bfd2=>{const _0x243569=_0xe73fb;return _0x260ca2['onProgress']?.({'type':_0x243569(0x13f),'name':_0x56bfd2[_0x243569(0xed)]}),await _0x51629f[_0x243569(0xaa)][_0x243569(0xf5)](_0x56bfd2['id']),_0x260ca2[_0x243569(0x172)]?.({'type':'segment_deleted','name':_0x56bfd2[_0x243569(0xed)]}),_0x260ca2['logDeleted']?.(_0x243569(0x168)+_0x56bfd2[_0x243569(0xed)]+'\x27'),0x1;},_0xaad3a0);return _0x1b761f[_0xe73fb(0x11b)]((_0x191c42,_0x3bc66b)=>_0x191c42+_0x3bc66b,0x0);}export async function executePushJourneys(_0x134fd0,_0x199273,_0x387204,_0x5ca7f0,_0x3293cc){const _0x59f00d=a142_0x2ccdb5,{journeyDefToRequest:_0x729ea3}=await import(_0x59f00d(0xc9)),{activationDefToCreateRequest:_0x1911bd,yamlRuleToApi:_0x41ab52,validateSegmentRule:_0x4d11d2}=await import(_0x59f00d(0x180)),_0x5d491a={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x9976f=new Map(_0x387204['segmentNameToId']),_0x19d62b=0x5;for(let _0x318d6d=0x0;_0x318d6d<_0x199273[_0x59f00d(0x19d)];_0x318d6d+=_0x19d62b){const _0x250d18=_0x199273[_0x59f00d(0xb7)](_0x318d6d,_0x318d6d+_0x19d62b),_0x1e769f=await Promise['all'](_0x250d18[_0x59f00d(0x122)](async _0x1998df=>{const _0x31cbd7=_0x59f00d;if(!_0x1998df[_0x31cbd7(0xd7)]&&!_0x1998df[_0x31cbd7(0xea)])return{'action':'unchanged','name':_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)],'journeyId':_0x1998df[_0x31cbd7(0xcc)]?.['id']};const _0x5b98bf=_0x1998df['folderPath']?_0x387204[_0x31cbd7(0x140)][_0x31cbd7(0x185)](_0x1998df[_0x31cbd7(0x119)]):undefined;_0x3293cc[_0x31cbd7(0x172)]?.({'type':_0x1998df[_0x31cbd7(0xd7)]?_0x31cbd7(0x13c):_0x31cbd7(0xb9),'name':_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)]});try{const _0x2ea198=await executeSingleJourneyPush(_0x134fd0,_0x1998df,{..._0x387204,'segmentNameToId':_0x9976f},{'parentId':_0x5ca7f0[_0x31cbd7(0x16f)],'rootFolderId':_0x5ca7f0[_0x31cbd7(0xf1)],'folderId':_0x5b98bf,'verbose':_0x5ca7f0['verbose']},_0x3293cc,{'journeyDefToRequest':_0x729ea3,'activationDefToCreateRequest':_0x1911bd,'yamlRuleToApi':_0x41ab52,'validateSegmentRule':_0x4d11d2});for(const [_0x33bda7,_0x12d4f4]of _0x2ea198[_0x31cbd7(0x10e)]){_0x9976f['set'](_0x33bda7,_0x12d4f4),_0x5d491a[_0x31cbd7(0x10e)][_0x31cbd7(0xb4)](_0x33bda7,_0x12d4f4);}if(_0x2ea198[_0x31cbd7(0x182)]===_0x31cbd7(0x126))_0x3293cc[_0x31cbd7(0x172)]?.({'type':_0x31cbd7(0x12b),'name':_0x1998df[_0x31cbd7(0x11e)]['name'],'journeyId':_0x2ea198[_0x31cbd7(0xe8)]}),_0x3293cc['logSuccess']?.(_0x31cbd7(0x191)+_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)]+'\x27'),_0x5d491a[_0x31cbd7(0x126)]++;else _0x2ea198['action']===_0x31cbd7(0xf9)&&(_0x3293cc['onProgress']?.({'type':'journey_updated','name':_0x1998df[_0x31cbd7(0x11e)]['name']}),_0x3293cc[_0x31cbd7(0x18e)]?.(_0x31cbd7(0x12e)+_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)]+'\x27'),_0x5d491a[_0x31cbd7(0xf9)]++);return{'action':_0x2ea198[_0x31cbd7(0x182)],'name':_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)],'journeyId':_0x2ea198[_0x31cbd7(0xe8)]};}catch(_0xf6b755){const _0x41bf1e=isHttp400Error(_0xf6b755),_0x408776=_0x41bf1e?ErrorCode[_0x31cbd7(0x15c)]:ErrorCode[_0x31cbd7(0x129)],_0xcac4b9=getErrorMessage(_0xf6b755);throw new SDKError(_0x408776,'Failed\x20to\x20'+(_0x1998df[_0x31cbd7(0xd7)]?'create':_0x31cbd7(0xc0))+_0x31cbd7(0xd1)+_0x1998df[_0x31cbd7(0x14b)]+_0x31cbd7(0x189)+_0xcac4b9,_0xf6b755);}}));_0x5d491a[_0x59f00d(0x18f)][_0x59f00d(0x14a)](..._0x1e769f);}return _0x5d491a;}async function matchExistingJourneySegments(_0xaed2fc,_0x15130a,_0x35c169,_0x581944,_0x4f7e09){const _0x3b0998=a142_0x2ccdb5;if(!_0x15130a[_0x3b0998(0xcc)]||!_0x15130a[_0x3b0998(0x11e)][_0x3b0998(0xde)])return;const _0x59b6e5=new Map(),_0x4931cd=new Set();for(const _0x771887 of Object[_0x3b0998(0x127)](_0x15130a[_0x3b0998(0x11e)]['segments'])){const _0x28c430=generateDeterministicJourneySegmentName(_0x15130a['yamlConfig']['name'],_0x771887);_0x59b6e5[_0x3b0998(0xb4)](_0x28c430,_0x771887),_0x4931cd['add'](_0x771887);}const _0x963894=[],_0x217b33=collectSegmentIdsFromJourneyApi(_0x15130a[_0x3b0998(0xcc)]);for(const _0x20cac9 of _0x217b33){const _0x24e4b4=await fetchSegment(_0xaed2fc,_0x35c169,_0x20cac9,_0x581944);if(!_0x24e4b4?.['name'])continue;const _0x514730=_0x59b6e5[_0x3b0998(0x185)](_0x24e4b4[_0x3b0998(0xed)]);_0x514730?(_0x4f7e09['set'](_0x514730,_0x20cac9),_0x4931cd[_0x3b0998(0x114)](_0x514730)):_0x963894['push']({'id':_0x20cac9,'seg':_0x24e4b4});}if(_0x4931cd[_0x3b0998(0xd9)]>0x0&&_0x963894[_0x3b0998(0x19d)]>0x0){const {localExpandedRuleToNames:_0x17daeb}=buildLocalExpandedRuleMappings(_0x15130a[_0x3b0998(0x11e)]),_0x50beff=new Map();for(const {id:_0x556b56,seg:_0x14fbd4}of _0x963894){if(_0x14fbd4[_0x3b0998(0x193)]){const _0x1e75d5=apiRuleToYaml(_0x14fbd4[_0x3b0998(0x193)]);_0x50beff[_0x3b0998(0xb4)](_0x556b56,_0x1e75d5);}}for(const {id:_0x3a5e47,seg:_0x7ac8de}of _0x963894){if(!_0x7ac8de['rule'])continue;const _0x14c93c=_0x50beff[_0x3b0998(0x185)](_0x3a5e47);if(!_0x14c93c)continue;const _0x238b2b=serializeExpandedRule(_0x14c93c,_0x50beff),_0x4a2bfa=_0x17daeb[_0x3b0998(0x185)](_0x238b2b);if(_0x4a2bfa){const _0x17fc1f=_0x4a2bfa[_0x3b0998(0x17d)](_0x3c171e=>_0x4931cd[_0x3b0998(0x105)](_0x3c171e));_0x17fc1f&&(_0x4f7e09[_0x3b0998(0xb4)](_0x17fc1f,_0x3a5e47),_0x4931cd[_0x3b0998(0x114)](_0x17fc1f),logger[_0x3b0998(0xe3)]('Matched\x20server\x20segment\x20\x27'+_0x7ac8de[_0x3b0998(0xed)]+_0x3b0998(0xe6)+_0x17fc1f+_0x3b0998(0xe0)));}}}}async function executeSingleJourneyPush(_0x1ce689,_0x326089,_0x4eea23,_0x19e553,_0xe133b9,_0x19ff29){const _0x2372da=a142_0x2ccdb5,{journeyDefToRequest:_0xef77c4,activationDefToCreateRequest:_0x138dc4,yamlRuleToApi:_0x48f44d,validateSegmentRule:_0x560d40}=_0x19ff29,_0x35a7e9=new Map(),_0x33cff4=new Map();recoverSegmentIdsFromPushRecovery(_0x326089,_0x35a7e9,_0x4eea23[_0x2372da(0x104)]);const _0x42fcaf=new Map(),_0x264490=new Map(),_0x57e62f=new Map();let _0x38ec5b;const _0x5a6b6e=async()=>{const _0x52e56b=_0x2372da;if(_0x38ec5b)return;_0x38ec5b=new Map();if(!_0x326089[_0x52e56b(0xcc)])return;const _0x6ba8ba=await _0x1ce689[_0x52e56b(0x188)][_0x52e56b(0x173)](_0x326089[_0x52e56b(0xcc)]['id']);for(const _0x2f58a7 of _0x6ba8ba){const _0xa7c322=journeyActivationStepToYaml(_0x2f58a7,_0x4eea23[_0x52e56b(0x192)],_0x4eea23['connectionIdToNameMap']),_0x36764a=activationSignature(_0xa7c322);!_0x38ec5b[_0x52e56b(0x105)](_0x36764a)&&_0x38ec5b['set'](_0x36764a,_0x2f58a7['id']),_0xa7c322[_0x52e56b(0xed)]&&_0x33cff4[_0x52e56b(0xb4)](_0xa7c322[_0x52e56b(0xed)],_0x2f58a7['id']);}};await matchExistingJourneySegments(_0x1ce689,_0x326089,_0x19e553[_0x2372da(0x16f)],_0x4eea23['existingSegments'],_0x4eea23[_0x2372da(0x104)]);const _0x3c30ff={'resolveSegmentId':async _0x326e2b=>{const _0x5a2f4f=_0x2372da,_0x455286=_0x4eea23[_0x5a2f4f(0x104)]['get'](_0x326e2b);if(!_0x455286)throw new SDKError(ErrorCode[_0x5a2f4f(0x155)],_0x5a2f4f(0xd3)+_0x326e2b+'\x20(referenced\x20in\x20journey\x20'+_0x326089['yamlConfig'][_0x5a2f4f(0xed)]+')');return _0x455286;},'resolveEmbeddedSegmentId':async(_0x14f5a1,_0x5e1df3)=>{const _0x280260=_0x2372da,_0x1185ba=_0x4eea23[_0x280260(0x104)][_0x280260(0x185)](_0x14f5a1);if(_0x1185ba)return _0x1185ba;const _0x1e469a=_0x4eea23['existingSegments']['find'](_0x13b423=>_0x13b423[_0x280260(0xed)]===_0x14f5a1);if(_0x1e469a)return _0x4eea23[_0x280260(0x104)][_0x280260(0xb4)](_0x14f5a1,_0x1e469a['id']),_0x1e469a['id'];if(_0x326089[_0x280260(0xd7)]){const {stageName:_0x1f2339,criteriaName:_0x2a1522}=findSegmentCriteriaLocation(_0x326089['yamlConfig'],_0x14f5a1);return _0x560d40(_0x14f5a1,_0x5e1df3['rule']),_0x264490[_0x280260(0xb4)](_0x14f5a1,{'definition':_0x5e1df3,'stageName':_0x1f2339,'criteriaName':_0x2a1522}),createPendingSegmentId(_0x14f5a1);}const _0x2cb827=_0x326089[_0x280260(0xcc)]?.['id'];if(!_0x2cb827)throw new SDKError(ErrorCode[_0x280260(0xfc)],_0x280260(0xd8));const _0x6b98ae=_0x42fcaf['get'](_0x14f5a1);if(_0x6b98ae)return _0x6b98ae;const _0x1f3960=((async()=>{const _0x4eef2f=_0x280260;_0x560d40(_0x14f5a1,_0x5e1df3[_0x4eef2f(0x193)]);const _0x4c4920=generateDeterministicJourneySegmentName(_0x326089[_0x4eef2f(0x11e)]['name'],_0x14f5a1),_0x124cab=_0x4eea23[_0x4eef2f(0x135)][_0x4eef2f(0x17d)](_0x37c601=>_0x37c601[_0x4eef2f(0xed)]===_0x4c4920),_0x4c5609=createSegmentIdResolver(_0x4eea23['segmentNameToId'],_0x14f5a1),_0x218152=await resolveRuleSegmentIds(_0x5e1df3[_0x4eef2f(0x193)],_0x4c5609);let _0x5875de;return _0x124cab?(await _0x1ce689['segment'][_0x4eef2f(0x117)](_0x19e553[_0x4eef2f(0x16f)],_0x124cab['id'],{'description':_0x5e1df3['description']||_0x4eef2f(0x11c)+_0x14f5a1,'rule':_0x48f44d(_0x218152,!![]),'countPopulation':!![]}),_0x5875de=_0x124cab['id'],saveSegmentToPushRecovery(_0x326089[_0x4eef2f(0x14b)],_0x326089[_0x4eef2f(0x11e)]['name'],_0x14f5a1,{'segmentId':_0x5875de,'uniqueServerName':_0x4c4920,'createdAt':new Date()['toISOString']()})):_0x5875de=await createOrRecoverEmbeddedSegment(_0x1ce689,_0x326089,{'localName':_0x14f5a1,'uniqueSegmentName':_0x4c4920,'description':_0x5e1df3[_0x4eef2f(0x10d)]||_0x4eef2f(0x11c)+_0x14f5a1,'journeyId':_0x2cb827,'resolvedRule':_0x218152,'parentId':_0x19e553[_0x4eef2f(0x16f)],'folderId':_0x19e553[_0x4eef2f(0xf1)]||''},_0x48f44d),_0x4eea23[_0x4eef2f(0x104)][_0x4eef2f(0xb4)](_0x14f5a1,_0x5875de),_0x35a7e9['set'](_0x14f5a1,_0x5875de),_0x5875de;})());_0x42fcaf[_0x280260(0xb4)](_0x14f5a1,_0x1f3960);try{return await _0x1f3960;}finally{_0x42fcaf[_0x280260(0x114)](_0x14f5a1);}},'resolveActivationId':async _0x17ef5b=>{const _0x228715=_0x2372da,_0x554cfc=_0x33cff4[_0x228715(0x185)](_0x17ef5b);if(_0x554cfc)return _0x554cfc;if(_0x326089[_0x228715(0xcc)]){await _0x5a6b6e();const _0x38ea2b=_0x33cff4[_0x228715(0x185)](_0x17ef5b);if(_0x38ea2b)return _0x38ea2b;}throw new SDKError(ErrorCode[_0x228715(0xb2)],_0x228715(0x101)+_0x17ef5b+'\x20(referenced\x20in\x20journey\x20'+_0x326089[_0x228715(0x11e)][_0x228715(0xed)]+_0x228715(0x16c)+_0x228715(0x12d));},'resolveEmbeddedActivationId':async(_0x292818,_0x2cdaa5)=>{const _0x1a83a1=_0x2372da,_0x1487df=_0x33cff4[_0x1a83a1(0x185)](_0x292818);if(_0x1487df)return _0x1487df;if(_0x326089[_0x1a83a1(0xd7)])return _0x57e62f[_0x1a83a1(0xb4)](_0x292818,_0x2cdaa5),createPendingActivationId(_0x292818);if(_0x326089[_0x1a83a1(0xcc)]){await _0x5a6b6e();const _0x464984=_0x33cff4[_0x1a83a1(0x185)](_0x2cdaa5[_0x1a83a1(0xed)]);if(_0x464984)return _0x33cff4['set'](_0x292818,_0x464984),_0x464984;const _0x134bdd=activationSignature(_0x2cdaa5),_0x31fa6f=_0x38ec5b?.[_0x1a83a1(0x185)](_0x134bdd);if(_0x31fa6f)return _0x33cff4[_0x1a83a1(0xb4)](_0x292818,_0x31fa6f),_0x31fa6f;const _0x39336b=await _0x138dc4(_0x2cdaa5,_0x4eea23[_0x1a83a1(0x10f)]),_0x24276d={..._0x39336b,..._0x2cdaa5['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x2cdaa5[_0x1a83a1(0xe2)]}},_0x202913=await _0x1ce689[_0x1a83a1(0x188)][_0x1a83a1(0x152)](_0x326089[_0x1a83a1(0xcc)]['id'],_0x24276d);return _0x33cff4[_0x1a83a1(0xb4)](_0x292818,_0x202913['id']),_0x202913['id'];}throw new SDKError(ErrorCode[_0x1a83a1(0xfc)],_0x1a83a1(0x12f));},'resolveJourneyId':async _0x50d8aa=>{const _0x19e3b2=_0x2372da;try{return await _0x1ce689[_0x19e3b2(0x188)][_0x19e3b2(0x148)](_0x19e553[_0x19e3b2(0x16f)],_0x50d8aa);}catch(_0x5bfab1){throw new SDKError(ErrorCode['NOT_FOUND'],_0x19e3b2(0xb5)+_0x50d8aa+_0x19e3b2(0x139)+_0x326089[_0x19e3b2(0x11e)][_0x19e3b2(0xed)]+'\x27)',_0x5bfab1);}},'resolveStageId':async(_0x95b9cc,_0x4c9892)=>{const _0x3d5344=_0x2372da,_0x2b4112=await _0x1ce689[_0x3d5344(0x188)][_0x3d5344(0xec)](_0x95b9cc),_0x5adc0e=_0x2b4112[_0x3d5344(0x13b)][_0x3d5344(0x132)]['find'](_0x23b177=>_0x23b177[_0x3d5344(0xed)][_0x3d5344(0xab)]()===_0x4c9892[_0x3d5344(0xab)]());if(!_0x5adc0e?.['id'])throw new SDKError(ErrorCode[_0x3d5344(0xb2)],_0x3d5344(0xa1)+_0x4c9892+_0x3d5344(0xc6)+(_0x2b4112['attributes']['journeyBundleName']||_0x2b4112[_0x3d5344(0x13b)][_0x3d5344(0xed)])+'\x27');return _0x5adc0e['id'];}},_0x3b0d9a=await _0xef77c4(_0x326089[_0x2372da(0x11e)],_0x19e553[_0x2372da(0x16f)],_0x3c30ff),_0x13f0d5=_0x19e553[_0x2372da(0xa6)]||_0x19e553[_0x2372da(0xf1)];_0x13f0d5&&(_0x3b0d9a[_0x2372da(0x198)]={'parentFolder':{'data':{'id':_0x13f0d5,'type':_0x2372da(0xd2)}}});if(_0x326089[_0x2372da(0xd7)]){if(_0x264490['size']>0x0||_0x57e62f[_0x2372da(0xd9)]>0x0)return await executeThreeStepJourneyCreate(_0x1ce689,_0x326089,_0x3b0d9a,{'pendingEmbeddedSegments':_0x264490,'pendingEmbeddedActivations':_0x57e62f,'embeddedSegmentNameToId':_0x35a7e9,'journeyActivationNameToId':_0x33cff4},{..._0x19e553,'effectiveFolderId':_0x13f0d5},_0x4eea23,_0xe133b9,_0x19ff29);else{ensureJourneyDefaults(_0x3b0d9a['attributes']);const _0x57d860=await _0x1ce689[_0x2372da(0x188)][_0x2372da(0xa9)](_0x3b0d9a);return deletePushRecovery(_0x326089['absolutePath']),{'action':_0x2372da(0x126),'journeyId':_0x57d860['id'],'embeddedSegmentNameToId':_0x35a7e9};}}else{if(_0x326089[_0x2372da(0xea)]&&_0x326089['existingJourney']){_0x3b0d9a['id']=_0x326089['existingJourney']['id'];const _0x4abc6c=_0x3b0d9a['attributes'];_0x326089[_0x2372da(0xcc)]['attributes']?.['journeyBundleName']&&(_0x4abc6c[_0x2372da(0xf2)]=_0x326089[_0x2372da(0xcc)][_0x2372da(0x13b)][_0x2372da(0xf2)]);const _0x7f215c=_0x326089[_0x2372da(0xcc)][_0x2372da(0x13b)]?.[_0x2372da(0x132)];return _0x7f215c&&_0x3b0d9a[_0x2372da(0x13b)][_0x2372da(0x132)]&&injectExistingStageIds(_0x3b0d9a[_0x2372da(0x13b)][_0x2372da(0x132)],_0x7f215c),ensureJourneyDefaults(_0x4abc6c),await _0x1ce689['journey'][_0x2372da(0xc0)](_0x326089[_0x2372da(0xcc)]['id'],_0x3b0d9a),deletePushRecovery(_0x326089['absolutePath']),{'action':_0x2372da(0xf9),'journeyId':_0x326089[_0x2372da(0xcc)]['id'],'embeddedSegmentNameToId':_0x35a7e9};}}return deletePushRecovery(_0x326089[_0x2372da(0x14b)]),{'action':'unchanged','journeyId':_0x326089[_0x2372da(0xcc)]?.['id'],'embeddedSegmentNameToId':_0x35a7e9};}function findSegmentCriteriaLocation(_0x447467,_0x4e295f){const _0x44418b=a142_0x2ccdb5,_0x186a9b=_0x447467[_0x44418b(0x184)]||_0x447467[_0x44418b(0xee)]?.[0x0]?.[_0x44418b(0x184)]||[];let _0x4ecb01=_0x44418b(0x9e),_0x41aded=_0x4e295f;const _0x54a02b=_0x447467[_0x44418b(0xd6)]||_0x447467[_0x44418b(0xee)]?.[0x0]?.[_0x44418b(0xd6)];if(_0x54a02b?.[_0x44418b(0xaa)]===_0x4e295f)return{'stageName':_0x44418b(0xd6),'criteriaName':_0x54a02b['name']||_0x4e295f};_0x398421:for(const _0x36234b of _0x186a9b){if(_0x36234b[_0x44418b(0x116)]?.[_0x44418b(0xaa)]===_0x4e295f){_0x4ecb01=_0x36234b['name'],_0x41aded=_0x36234b[_0x44418b(0x116)][_0x44418b(0xed)]||_0x4e295f;break;}if(_0x36234b[_0x44418b(0xa5)])for(const _0x2b3eab of _0x36234b[_0x44418b(0xa5)]){if(_0x2b3eab[_0x44418b(0xf7)]===_0x44418b(0x10c)&&_0x2b3eab[_0x44418b(0xad)]?.['branches'])for(const _0x3f4d82 of _0x2b3eab[_0x44418b(0xad)][_0x44418b(0x136)]){if(_0x3f4d82[_0x44418b(0xaa)]===_0x4e295f){_0x4ecb01=_0x36234b[_0x44418b(0xed)],_0x41aded=_0x3f4d82[_0x44418b(0xed)]||_0x4e295f;break _0x398421;}}}}return{'stageName':_0x4ecb01,'criteriaName':_0x41aded};}async function executeThreeStepJourneyCreate(_0x10ab3f,_0x3fa907,_0x2b370e,_0x396acf,_0x36cdfe,_0xef70ed,_0x4fc2ab,_0x1f4eca){const _0x59c201=a142_0x2ccdb5,{activationDefToCreateRequest:_0x2e217a,yamlRuleToApi:_0xf06245}=_0x1f4eca,{pendingEmbeddedSegments:_0x381521,pendingEmbeddedActivations:_0x5831c9,embeddedSegmentNameToId:_0x35ad48}=_0x396acf,_0x373ef3=JSON[_0x59c201(0xe4)](JSON[_0x59c201(0x162)](_0x2b370e));ensureJourneyDefaults(_0x373ef3['attributes']),stripPendingIds(_0x373ef3);const _0x1f552f=await _0x10ab3f[_0x59c201(0x188)]['create'](_0x373ef3),_0x21f2d0=_0x1f552f['id'],_0x51a4e8=new Map();for(const _0x2c1451 of _0x1f552f[_0x59c201(0x13b)]['journeyStages']){_0x51a4e8[_0x59c201(0xb4)](_0x2c1451[_0x59c201(0xed)][_0x59c201(0xab)](),_0x2c1451['id']);}recoverSegmentIdsFromPushRecovery(_0x3fa907,_0x35ad48,_0xef70ed['segmentNameToId']);for(const [_0x1a51c3,{definition:_0x230156}]of _0x381521){if(_0x35ad48[_0x59c201(0x105)](_0x1a51c3)){_0x4fc2ab[_0x59c201(0x172)]?.({'type':'embedded_segment_created','journeyName':_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],'segmentName':_0x1a51c3});continue;}const _0x34f34f=generateDeterministicJourneySegmentName(_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],_0x1a51c3);_0x4fc2ab[_0x59c201(0x172)]?.({'type':'embedded_segment_creating','journeyName':_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],'segmentName':_0x1a51c3});const _0x51a5e1=createSegmentIdResolver(_0xef70ed[_0x59c201(0x104)],_0x1a51c3),_0x3fa508=await resolveRuleSegmentIds(_0x230156['rule'],_0x51a5e1),_0x3674a3=await createOrRecoverEmbeddedSegment(_0x10ab3f,_0x3fa907,{'localName':_0x1a51c3,'uniqueSegmentName':_0x34f34f,'description':_0x230156[_0x59c201(0x10d)]||_0x59c201(0x11c)+_0x1a51c3,'journeyId':_0x21f2d0,'resolvedRule':_0x3fa508,'parentId':_0x36cdfe[_0x59c201(0x16f)],'folderId':_0x36cdfe['effectiveFolderId']||''},_0xf06245);_0x35ad48[_0x59c201(0xb4)](_0x1a51c3,_0x3674a3),_0xef70ed[_0x59c201(0x104)][_0x59c201(0xb4)](_0x1a51c3,_0x3674a3),_0x4fc2ab[_0x59c201(0x172)]?.({'type':_0x59c201(0x19c),'journeyName':_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],'segmentName':_0x1a51c3});}const _0x3e5fda=new Map();for(const [_0xdd4d89,_0x4d1603]of _0x5831c9){_0x4fc2ab['onProgress']?.({'type':_0x59c201(0xb1),'journeyName':_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],'activationName':_0xdd4d89});const _0x4a032e=await _0x2e217a(_0x4d1603,_0xef70ed[_0x59c201(0x10f)]),_0x41fcb4={..._0x4a032e,..._0x4d1603['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x4d1603[_0x59c201(0xe2)]}},_0x1f248c=await _0x10ab3f['journey'][_0x59c201(0x152)](_0x21f2d0,_0x41fcb4);_0x3e5fda[_0x59c201(0xb4)](_0xdd4d89,_0x1f248c['id']),_0x396acf[_0x59c201(0xf8)][_0x59c201(0xb4)](_0xdd4d89,_0x1f248c['id']),_0x4fc2ab['onProgress']?.({'type':_0x59c201(0xef),'journeyName':_0x3fa907[_0x59c201(0x11e)]['name'],'activationName':_0xdd4d89});}const _0x3a299e=JSON[_0x59c201(0xe4)](JSON[_0x59c201(0x162)](_0x2b370e));return _0x3a299e['id']=_0x21f2d0,ensureJourneyDefaults(_0x3a299e[_0x59c201(0x13b)]),resolvePendingIdsInRequest(_0x3a299e,_0x2b370e,_0x51a4e8,_0x35ad48,_0x3e5fda,_0x4fc2ab),await _0x10ab3f[_0x59c201(0x188)][_0x59c201(0xc0)](_0x21f2d0,_0x3a299e),deletePushRecovery(_0x3fa907[_0x59c201(0x14b)]),{'action':_0x59c201(0x126),'journeyId':_0x21f2d0,'embeddedSegmentNameToId':_0x35ad48};}export function stripWaitStepPendingIds(_0x1a7d0c){const _0x2bbbfe=a142_0x2ccdb5,_0x144541=_0x1a7d0c[_0x2bbbfe(0x158)]&&isPendingSegmentId(_0x1a7d0c[_0x2bbbfe(0x158)]),_0x2d2854=_0x1a7d0c[_0x2bbbfe(0xf6)]?.[_0x2bbbfe(0x11a)](_0x293a1c=>_0x293a1c[_0x2bbbfe(0x112)]&&isPendingSegmentId(_0x293a1c[_0x2bbbfe(0x112)]));(_0x144541||_0x2d2854)&&(_0x1a7d0c[_0x2bbbfe(0xa0)]=_0x2bbbfe(0x170),_0x1a7d0c[_0x2bbbfe(0xc8)]=0x1,_0x1a7d0c['waitStepUnit']='day',delete _0x1a7d0c[_0x2bbbfe(0x158)],delete _0x1a7d0c[_0x2bbbfe(0xce)],delete _0x1a7d0c[_0x2bbbfe(0xa7)],delete _0x1a7d0c['conditions']);}export function resolveWaitStepPendingIds(_0xc7b3b7,_0xdae6dd,_0x132656,_0x17fe9a){const _0x217f48=a142_0x2ccdb5;if(_0xdae6dd['conditionSegmentId']&&isPendingSegmentId(_0xdae6dd[_0x217f48(0x158)])){const _0x52e870=_0x132656(_0xdae6dd[_0x217f48(0x158)],_0x217f48(0x196)+_0x17fe9a+_0x217f48(0xa4));_0x52e870&&(_0xc7b3b7[_0x217f48(0xa0)]=_0x217f48(0x137),_0xc7b3b7[_0x217f48(0x158)]=_0x52e870,delete _0xc7b3b7[_0x217f48(0xc8)],delete _0xc7b3b7['waitStepUnit'],_0xdae6dd['conditionTimeoutDuration']!==undefined&&(_0xc7b3b7[_0x217f48(0xce)]=_0xdae6dd[_0x217f48(0xce)]),_0xdae6dd[_0x217f48(0xa7)]&&(_0xc7b3b7[_0x217f48(0xa7)]=_0xdae6dd['conditionTimeoutUnit']));}if(_0xdae6dd[_0x217f48(0xf6)]){const _0x28136c=_0xdae6dd[_0x217f48(0xf6)][_0x217f48(0x11a)](_0x4921fd=>_0x4921fd[_0x217f48(0x112)]&&isPendingSegmentId(_0x4921fd[_0x217f48(0x112)]));if(_0x28136c){const _0x50e5b0=_0xdae6dd['conditions'][_0x217f48(0x122)](_0x3bf19e=>{const _0x2ae8a9=_0x217f48;if(_0x3bf19e[_0x2ae8a9(0x112)]&&isPendingSegmentId(_0x3bf19e['segmentId'])){const _0x2c6416=_0x132656(_0x3bf19e[_0x2ae8a9(0x112)],_0x2ae8a9(0x196)+_0x17fe9a+_0x2ae8a9(0xa4));return{..._0x3bf19e,'segmentId':_0x2c6416||_0x3bf19e[_0x2ae8a9(0x112)]};}return{..._0x3bf19e};});_0xc7b3b7['waitStepType']=_0x217f48(0x137),_0xc7b3b7[_0x217f48(0xf6)]=_0x50e5b0,delete _0xc7b3b7['waitStep'],delete _0xc7b3b7[_0x217f48(0xe7)],delete _0xc7b3b7[_0x217f48(0x158)],delete _0xc7b3b7[_0x217f48(0xce)],delete _0xc7b3b7[_0x217f48(0xa7)];}}}function stripPendingIds(_0x20d3e8){const _0x1aec7a=a142_0x2ccdb5;_0x20d3e8[_0x1aec7a(0x13b)][_0x1aec7a(0xd6)]?.[_0x1aec7a(0x112)]&&isPendingSegmentId(_0x20d3e8[_0x1aec7a(0x13b)][_0x1aec7a(0xd6)][_0x1aec7a(0x112)])&&delete _0x20d3e8[_0x1aec7a(0x13b)]['goal'];for(const _0x49ec9a of _0x20d3e8[_0x1aec7a(0x13b)][_0x1aec7a(0x132)]||[]){_0x49ec9a[_0x1aec7a(0x171)]?.[_0x1aec7a(0x112)]&&isPendingSegmentId(_0x49ec9a['entryCriteria'][_0x1aec7a(0x112)])&&delete _0x49ec9a[_0x1aec7a(0x171)];_0x49ec9a[_0x1aec7a(0x150)]?.[_0x1aec7a(0x112)]&&isPendingSegmentId(_0x49ec9a[_0x1aec7a(0x150)]['segmentId'])&&delete _0x49ec9a['milestone'];_0x49ec9a['exitCriterias']&&(_0x49ec9a[_0x1aec7a(0x14d)]=_0x49ec9a['exitCriterias'][_0x1aec7a(0x108)](_0x2128cc=>!_0x2128cc[_0x1aec7a(0x112)]||!isPendingSegmentId(_0x2128cc[_0x1aec7a(0x112)])));if(_0x49ec9a['steps'])for(const _0xfe088 of Object[_0x1aec7a(0x127)](_0x49ec9a['steps'])){const _0x519e22=_0x49ec9a[_0x1aec7a(0xa5)][_0xfe088];_0x519e22['type']===_0x1aec7a(0x13a)&&_0x519e22[_0x1aec7a(0xdf)]&&isPendingActivationId(_0x519e22[_0x1aec7a(0xdf)])&&(_0x519e22['journeyActivationStepId']='');if(_0x519e22[_0x1aec7a(0xf7)]===_0x1aec7a(0xc3)&&_0x519e22['branches'])for(const _0x4f737d of _0x519e22[_0x1aec7a(0x136)]){_0x4f737d[_0x1aec7a(0x112)]&&isPendingSegmentId(_0x4f737d[_0x1aec7a(0x112)])&&(_0x4f737d[_0x1aec7a(0x112)]='');}_0x519e22['type']===_0x1aec7a(0xb8)&&stripWaitStepPendingIds(_0x519e22);}}}function resolvePendingIdsInRequest(_0x5bf2c,_0x5d38f9,_0x2703a7,_0x5503f8,_0x23c4dc,_0x41357c){const _0x55cba9=a142_0x2ccdb5,_0x32f201=(_0x4adcdc,_0x4e3fc9)=>{const _0x3fbe59=a142_0x48cb;if(!isPendingSegmentId(_0x4adcdc))return _0x4adcdc;const _0x339f6e=extractPendingSegmentName(_0x4adcdc),_0x407488=_0x5503f8[_0x3fbe59(0x185)](_0x339f6e);return!_0x407488&&_0x41357c[_0x3fbe59(0x16e)]?.(_0x3fbe59(0x195)+_0x339f6e+'\x27\x20for\x20'+_0x4e3fc9),_0x407488;};if(_0x5bf2c['attributes']['goal']?.[_0x55cba9(0x112)]&&isPendingSegmentId(_0x5bf2c[_0x55cba9(0x13b)][_0x55cba9(0xd6)][_0x55cba9(0x112)])){const _0x2d4473=_0x32f201(_0x5bf2c[_0x55cba9(0x13b)][_0x55cba9(0xd6)]['segmentId'],_0x55cba9(0x120));_0x2d4473&&(_0x5bf2c['attributes'][_0x55cba9(0xd6)][_0x55cba9(0x112)]=_0x2d4473);}for(const _0x4277df of _0x5bf2c[_0x55cba9(0x13b)]['journeyStages']||[]){const _0x18817b=_0x2703a7['get'](_0x4277df[_0x55cba9(0xed)]['toLowerCase']());_0x18817b&&(_0x4277df['id']=_0x18817b);if(_0x4277df[_0x55cba9(0x171)]?.[_0x55cba9(0x112)]&&isPendingSegmentId(_0x4277df[_0x55cba9(0x171)]['segmentId'])){const _0x2ca077=_0x32f201(_0x4277df[_0x55cba9(0x171)][_0x55cba9(0x112)],_0x55cba9(0x196)+_0x4277df[_0x55cba9(0xed)]+_0x55cba9(0x9f));_0x2ca077&&(_0x4277df[_0x55cba9(0x171)]['segmentId']=_0x2ca077);}if(_0x4277df['exitCriterias'])for(const _0x3a3eff of _0x4277df[_0x55cba9(0x14d)]){if(_0x3a3eff[_0x55cba9(0x112)]&&isPendingSegmentId(_0x3a3eff[_0x55cba9(0x112)])){const _0x213969=_0x32f201(_0x3a3eff[_0x55cba9(0x112)],_0x55cba9(0x196)+_0x4277df[_0x55cba9(0xed)]+_0x55cba9(0x142));_0x213969&&(_0x3a3eff[_0x55cba9(0x112)]=_0x213969);}}if(_0x4277df[_0x55cba9(0x150)]?.[_0x55cba9(0x112)]&&isPendingSegmentId(_0x4277df['milestone']['segmentId'])){const _0x45f459=_0x32f201(_0x4277df['milestone'][_0x55cba9(0x112)],_0x55cba9(0x196)+_0x4277df['name']+_0x55cba9(0x14c));_0x45f459&&(_0x4277df[_0x55cba9(0x150)][_0x55cba9(0x112)]=_0x45f459);}if(_0x4277df[_0x55cba9(0xa5)]){const _0x19bb5a=_0x155fe9=>_0x5d38f9['attributes'][_0x55cba9(0x132)]?.['find'](_0x391d2d=>_0x391d2d[_0x55cba9(0xed)][_0x55cba9(0xab)]()===_0x4277df[_0x55cba9(0xed)]['toLowerCase']())?.['steps']?.[_0x155fe9];for(const _0x2cee54 of Object['keys'](_0x4277df['steps'])){const _0x1b62fa=_0x4277df[_0x55cba9(0xa5)][_0x2cee54],_0xec6453=_0x19bb5a(_0x2cee54);if(_0x1b62fa[_0x55cba9(0xf7)]===_0x55cba9(0x13a)&&_0x1b62fa[_0x55cba9(0xdf)]&&(isPendingActivationId(_0x1b62fa[_0x55cba9(0xdf)])||_0x1b62fa[_0x55cba9(0xdf)]==='')){if(_0xec6453?.['journeyActivationStepId']&&isPendingActivationId(_0xec6453[_0x55cba9(0xdf)])){const _0x26e0bc=extractPendingActivationName(_0xec6453[_0x55cba9(0xdf)]),_0x58fb60=_0x23c4dc[_0x55cba9(0x185)](_0x26e0bc);_0x58fb60&&(_0x1b62fa[_0x55cba9(0xdf)]=_0x58fb60);}}if(_0x1b62fa[_0x55cba9(0xf7)]===_0x55cba9(0xc3)&&_0x1b62fa[_0x55cba9(0x136)]&&_0xec6453?.[_0x55cba9(0x136)])for(let _0x371b32=0x0;_0x371b32<_0x1b62fa[_0x55cba9(0x136)][_0x55cba9(0x19d)];_0x371b32++){const _0x5409aa=_0x1b62fa[_0x55cba9(0x136)][_0x371b32],_0x119765=_0xec6453[_0x55cba9(0x136)][_0x371b32];if(_0x119765?.[_0x55cba9(0x112)]&&isPendingSegmentId(_0x119765['segmentId'])){const _0x258a23=_0x32f201(_0x119765[_0x55cba9(0x112)],'stage\x20\x27'+_0x4277df[_0x55cba9(0xed)]+_0x55cba9(0x130)+(_0x5409aa['name']||_0x371b32)+'\x27');_0x258a23&&(_0x5409aa[_0x55cba9(0x112)]=_0x258a23);}}_0x1b62fa[_0x55cba9(0xf7)]===_0x55cba9(0xb8)&&_0xec6453?.[_0x55cba9(0xf7)]===_0x55cba9(0xb8)&&resolveWaitStepPendingIds(_0x1b62fa,_0xec6453,_0x32f201,_0x4277df[_0x55cba9(0xed)]);}}}}
1
+ const a142_0x119b8a=a142_0x3007;(function(_0x1ca649,_0x2dfb32){const _0x30c3e6=a142_0x3007,_0x4b7dee=_0x1ca649();while(!![]){try{const _0x4cabf0=parseInt(_0x30c3e6(0x220))/0x1+-parseInt(_0x30c3e6(0x27a))/0x2+-parseInt(_0x30c3e6(0x264))/0x3+parseInt(_0x30c3e6(0x1c6))/0x4+-parseInt(_0x30c3e6(0x214))/0x5*(-parseInt(_0x30c3e6(0x2b4))/0x6)+-parseInt(_0x30c3e6(0x1c2))/0x7+-parseInt(_0x30c3e6(0x1ef))/0x8*(-parseInt(_0x30c3e6(0x267))/0x9);if(_0x4cabf0===_0x2dfb32)break;else _0x4b7dee['push'](_0x4b7dee['shift']());}catch(_0x551b5e){_0x4b7dee['push'](_0x4b7dee['shift']());}}}(a142_0x2b21,0x2287b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x119b8a(0x1fc));export const PENDING_SEGMENT_PREFIX=a142_0x119b8a(0x204);export const PENDING_ACTIVATION_PREFIX=a142_0x119b8a(0x235);export function createPendingSegmentId(_0xaef6a3){return''+PENDING_SEGMENT_PREFIX+_0xaef6a3+'__';}export function isPendingSegmentId(_0x2513ee){const _0x5cef88=a142_0x119b8a;return _0x2513ee[_0x5cef88(0x218)](PENDING_SEGMENT_PREFIX)&&!_0x2513ee[_0x5cef88(0x218)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x282171){return _0x282171['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x42dde0){return''+PENDING_ACTIVATION_PREFIX+_0x42dde0+'__';}export function isPendingActivationId(_0x3ace21){return _0x3ace21['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x238eca){return _0x238eca['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2ae7d0,_0x58486a){const _0x31f91d=a142_0x119b8a,_0x1ed5e3=_0x2ae7d0+'::'+(_0x58486a[_0x31f91d(0x28e)]()||_0x31f91d(0x1ea)),_0x5cf252=createHash(_0x31f91d(0x27c))['update'](_0x1ed5e3)[_0x31f91d(0x1d4)]('hex')['slice'](0x0,0xc);return'journey_entry_criteria_'+_0x5cf252;}export function ensureJourneyDefaults(_0x52c78b){const _0x2233a9=a142_0x119b8a;!_0x52c78b[_0x2233a9(0x243)]&&(_0x52c78b[_0x2233a9(0x243)]=''),!_0x52c78b[_0x2233a9(0x2ae)]&&(_0x52c78b['state']=_0x2233a9(0x27f));}export function injectExistingStageIds(_0x51d2ea,_0x40657a){const _0x42844c=a142_0x119b8a,_0x43fa12=new Map(_0x40657a['map'](_0x138069=>[_0x138069[_0x42844c(0x1d5)],_0x138069['id']]));for(const _0xf97af of _0x51d2ea){if(!_0xf97af['id']){const _0x5b5ad0=_0x43fa12[_0x42844c(0x255)](_0xf97af[_0x42844c(0x1d5)]);_0x5b5ad0&&(_0xf97af['id']=_0x5b5ad0);}}}export function resolveTDFolderPath(_0xdcf848,_0xbf2583,_0x3b9b11){const _0x1da9c8=a142_0x119b8a;if(!_0xbf2583)return _0xdcf848;if(_0xdcf848===_0x3b9b11||_0xdcf848[_0x1da9c8(0x218)](_0x3b9b11+'/'))return _0xdcf848;return _0xdcf848?_0x3b9b11+'/'+_0xdcf848:_0x3b9b11;}export function addFoldersToCreate(_0x1389b1,_0x25a50e,_0x1d95bc){const _0x22af9e=a142_0x119b8a;if(!_0x1389b1)return;if(_0x25a50e[_0x22af9e(0x215)](_0x1389b1))return;const _0x3eb2c5=_0x1389b1[_0x22af9e(0x29e)]('/');let _0x272eca='';for(const _0x3fc1d4 of _0x3eb2c5){_0x272eca=_0x272eca?_0x272eca+'/'+_0x3fc1d4:_0x3fc1d4,!_0x25a50e[_0x22af9e(0x215)](_0x272eca)&&_0x1d95bc[_0x22af9e(0x1e8)](_0x272eca);}}export function sortFoldersByDepth(_0x423ce8){const _0x4a6f62=a142_0x119b8a;return[..._0x423ce8][_0x4a6f62(0x1f4)]((_0x4a11b8,_0x556978)=>{const _0xcfed2e=_0x4a6f62,_0x1a4fd2=(_0x4a11b8[_0xcfed2e(0x2b6)](/\//g)||[])['length'],_0x1312d9=(_0x556978[_0xcfed2e(0x2b6)](/\//g)||[])[_0xcfed2e(0x207)];return _0x1a4fd2-_0x1312d9;});}import*as a142_0x47e672 from'yaml';import{readFileSync}from'fs';import a142_0x23e26b from'path';import{isJourneyDef,parseYamlString as a142_0x1b9769,toYamlString as a142_0x407e51,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(_0x36a6be){const _0xddeddc=a142_0x119b8a;if(Array[_0xddeddc(0x1d9)](_0x36a6be))return'['+_0x36a6be[_0xddeddc(0x2b1)](_0x456f62=>stableStringify(_0x456f62))[_0xddeddc(0x265)](',')+']';if(_0x36a6be&&typeof _0x36a6be===_0xddeddc(0x20c)){const _0x17e111=_0x36a6be,_0xdacedf=Object['keys'](_0x17e111)['sort'](),_0x19cb16=_0xdacedf[_0xddeddc(0x2b1)](_0x5ec1eb=>'\x22'+_0x5ec1eb+'\x22:'+stableStringify(_0x17e111[_0x5ec1eb]));return'{'+_0x19cb16['join'](',')+'}';}const _0x138825=JSON[_0xddeddc(0x2a6)](_0x36a6be);return _0x138825===undefined?_0xddeddc(0x210):_0x138825;}function activationSignature(_0x40b23f){const _0x1ea233=a142_0x119b8a,_0x242109={'connection':_0x40b23f['connection'],..._0x40b23f[_0x1ea233(0x292)]!==undefined&&{'all_columns':_0x40b23f[_0x1ea233(0x292)]},..._0x40b23f[_0x1ea233(0x21d)]!==undefined&&{'columns':_0x40b23f[_0x1ea233(0x21d)]},..._0x40b23f[_0x1ea233(0x25d)]!==undefined&&{'behavior':_0x40b23f[_0x1ea233(0x25d)]},..._0x40b23f[_0x1ea233(0x219)]!==undefined&&{'schedule':_0x40b23f['schedule']},..._0x40b23f[_0x1ea233(0x28f)]!==undefined&&{'notification':_0x40b23f[_0x1ea233(0x28f)]},..._0x40b23f[_0x1ea233(0x1f3)]!==undefined&&{'connector_config':_0x40b23f['connector_config']},..._0x40b23f[_0x1ea233(0x242)]!==undefined&&{'activation_template_id':_0x40b23f['activation_template_id']}};return stableStringify(_0x242109);}async function fetchSegment(_0xac2eba,_0x52ccc9,_0xe9a5de,_0x10074d){const _0x14e59c=a142_0x119b8a,_0x1dc9ae=_0x10074d?.[_0x14e59c(0x240)](_0x1fd81a=>_0x1fd81a['id']===_0xe9a5de);if(_0x1dc9ae)return _0x1dc9ae;try{return await _0xac2eba[_0x14e59c(0x1ea)][_0x14e59c(0x205)](_0x52ccc9,_0xe9a5de);}catch(_0x4eae08){logger['debug']('getSegment\x20failed\x20for\x20'+_0xe9a5de+_0x14e59c(0x1f0)+_0x4eae08);try{return await _0xac2eba[_0x14e59c(0x1ea)][_0x14e59c(0x2a4)](_0xe9a5de);}catch(_0x420dde){return logger[_0x14e59c(0x245)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0xe9a5de+':\x20'+_0x420dde),null;}}}function recoverSegmentIdsFromPushRecovery(_0x507d5d,_0x1d0f69,_0x298c9b){const _0x146744=a142_0x119b8a,_0xc50950=readPushRecovery(_0x507d5d[_0x146744(0x1c1)]);if(_0xc50950?.[_0x146744(0x25e)]===_0x507d5d[_0x146744(0x257)][_0x146744(0x1d5)])for(const [_0x190ec9,_0x2ad979]of Object['entries'](_0xc50950[_0x146744(0x1f7)])){const _0x35c1f9=generateDeterministicJourneySegmentName(_0x507d5d[_0x146744(0x257)][_0x146744(0x1d5)],_0x190ec9);_0x2ad979['uniqueServerName']===_0x35c1f9&&(_0x1d0f69[_0x146744(0x1e5)](_0x190ec9,_0x2ad979[_0x146744(0x278)]),_0x298c9b[_0x146744(0x1e5)](_0x190ec9,_0x2ad979[_0x146744(0x278)]));}}async function createOrRecoverEmbeddedSegment(_0x3aba1e,_0x5f4f58,_0x463c7a,_0x4d0606){const _0x2462d3=a142_0x119b8a;let _0x3270af;try{_0x3270af=await _0x3aba1e[_0x2462d3(0x1ea)][_0x2462d3(0x2a0)]({'name':_0x463c7a[_0x2462d3(0x1f6)],'description':_0x463c7a[_0x2462d3(0x243)],'journeyId':_0x463c7a[_0x2462d3(0x276)],'rule':_0x4d0606(_0x463c7a[_0x2462d3(0x1d2)],!![]),'countPopulation':!![],'parentFolderId':_0x463c7a[_0x2462d3(0x275)],'audienceId':_0x463c7a[_0x2462d3(0x24a)]});}catch(_0x81f540){const _0x30a9e4=_0x81f540 instanceof Error&&_0x81f540['message'][_0x2462d3(0x228)](_0x2462d3(0x234));if(_0x30a9e4){const _0x3cecee=readPushRecovery(_0x5f4f58[_0x2462d3(0x1c1)]),_0x29e3b1=_0x3cecee?.['journeyName']===_0x5f4f58[_0x2462d3(0x257)][_0x2462d3(0x1d5)]?_0x3cecee[_0x2462d3(0x1f7)][_0x463c7a[_0x2462d3(0x1be)]]:undefined;if(_0x29e3b1?.[_0x2462d3(0x288)]===_0x463c7a[_0x2462d3(0x1f6)])await _0x3aba1e[_0x2462d3(0x1ea)][_0x2462d3(0x25f)](_0x463c7a[_0x2462d3(0x24a)],_0x29e3b1['segmentId'],{'description':_0x463c7a['description'],'rule':_0x4d0606(_0x463c7a[_0x2462d3(0x1d2)],!![]),'countPopulation':!![]}),_0x3270af=_0x29e3b1[_0x2462d3(0x278)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x2462d3(0x253)+_0x463c7a[_0x2462d3(0x1be)]+_0x2462d3(0x258)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x5f4f58['absolutePath'][_0x2462d3(0x26e)](/([^/]+)$/,_0x2462d3(0x29d))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x81f540);}else throw _0x81f540;}return saveSegmentToPushRecovery(_0x5f4f58['absolutePath'],_0x5f4f58[_0x2462d3(0x257)][_0x2462d3(0x1d5)],_0x463c7a[_0x2462d3(0x1be)],{'segmentId':_0x3270af,'uniqueServerName':_0x463c7a[_0x2462d3(0x1f6)],'createdAt':new Date()[_0x2462d3(0x1ce)]()}),_0x3270af;}export async function prepareSegmentFiles(_0x56101d,_0x6bcdd8,_0x3412a4,_0x3c71a4,_0x105684){const _0x1aa318=a142_0x119b8a,{activationDefToCreateRequest:_0x29a46a}=await import('./child-segment-yaml.js'),_0x5c0940=[],_0xf9bead=new Set();for(const {yamlConfig:_0x3f6c82,folderPath:_0x370875,sourcePath:_0x50160b}of _0x56101d){const _0x5cda9b=resolveTDFolderPath(_0x370875,_0x3c71a4,_0x105684),_0x1eacfc=_0x5cda9b+':'+_0x3f6c82['name'],_0x1b216b=_0x6bcdd8['segmentByFolderAndName'][_0x1aa318(0x255)](_0x1eacfc),_0x5ba356=_0x1b216b?_0x6bcdd8[_0x1aa318(0x272)][_0x1aa318(0x255)](_0x1b216b['id'])||[]:[];addFoldersToCreate(_0x5cda9b,_0x6bcdd8[_0x1aa318(0x2a2)],_0xf9bead);const _0x21006d=calculateActivationActions(_0x3f6c82[_0x1aa318(0x293)]||[],_0x5ba356,_0x6bcdd8['idToEmailMap'],_0x6bcdd8[_0x1aa318(0x1d1)]);for(const _0x4867b9 of _0x21006d){(_0x4867b9['type']===_0x1aa318(0x1cb)||_0x4867b9[_0x1aa318(0x1e7)]===_0x1aa318(0x1ee))&&_0x4867b9[_0x1aa318(0x287)]&&(_0x4867b9[_0x1aa318(0x1f2)]=await _0x29a46a(_0x4867b9[_0x1aa318(0x287)],_0x3412a4));}const _0x2171b7=calculateSegmentDiff(_0x3f6c82,_0x1b216b,_0x5ba356,_0x6bcdd8[_0x1aa318(0x29b)],_0x6bcdd8[_0x1aa318(0x1d1)]);_0x5c0940[_0x1aa318(0x23a)]({'relativePath':_0x3f6c82[_0x1aa318(0x1d5)],'absolutePath':_0x50160b,'yamlConfig':_0x3f6c82,'folderPath':_0x5cda9b,'existingSegment':_0x1b216b,'existingActivations':_0x5ba356,'isNew':_0x2171b7[_0x1aa318(0x1c0)],'hasChanges':_0x2171b7[_0x1aa318(0x295)],'diff':_0x2171b7['diff'],'activationActions':_0x21006d});}return{'segmentFiles':_0x5c0940,'foldersToCreate':_0xf9bead};}export async function prepareJourneyFiles(_0x1c5802,_0x57f358,_0x3c1597,_0x378126){const _0x47314f=a142_0x119b8a,_0x1956cd=[],_0x19aad1=new Set();for(const {yamlConfig:_0x5ada95,folderPath:_0x1b9ff0,sourcePath:_0x2fc5e5}of _0x1c5802){const _0x3be21f=resolveTDFolderPath(_0x1b9ff0,_0x3c1597,_0x378126),_0x52ed79=_0x3be21f+':'+_0x5ada95[_0x47314f(0x1d5)],_0x529e6f=_0x57f358[_0x47314f(0x290)]['get'](_0x52ed79);let _0x352ce3,_0x302d3a;if(_0x529e6f&&_0x529e6f['length']>0x0){const _0x1a2d1b=buildLocalExpandedRuleMappings(_0x5ada95),{createYamlContext:_0x503e91,prefetchJourneySegments:_0x2b6946}=createPushYamlContextForBundle(_0x57f358[_0x47314f(0x1bf)],_0x57f358[_0x47314f(0x24a)],_0x57f358[_0x47314f(0x281)],_0x1a2d1b,_0x57f358[_0x47314f(0x29b)],_0x57f358['connectionIdToNameMap'],_0x57f358[_0x47314f(0x22a)],_0x57f358[_0x47314f(0x232)]);await _0x2b6946(_0x529e6f[_0x47314f(0x2b1)](_0x9ac62e=>_0x9ac62e['id']));const _0x191ad3=await _0x57f358[_0x47314f(0x1bf)][_0x47314f(0x1fa)]['getLatestJourneyId'](_0x529e6f[0x0][_0x47314f(0x285)]),_0x44f31c=hasMultipleVersions(_0x5ada95),_0x450c2f=async _0x68171e=>{const _0x2c38bb=_0x47314f,_0xdd1270=_0x57f358[_0x2c38bb(0x232)]?.['get'](_0x68171e);if(_0xdd1270)return _0xdd1270;return _0x57f358['fetchJourney']({'journeyId':_0x68171e,'journeyName':_0x5ada95[_0x2c38bb(0x1d5)],'isMultiVersion':_0x529e6f[_0x2c38bb(0x207)]>0x1});};if(_0x44f31c&&_0x529e6f[_0x47314f(0x207)]>0x1){const _0x229b93=[];for(const _0x246627 of _0x529e6f){const _0x5f16c0=_0x246627[_0x47314f(0x20d)]||0x1;_0x57f358[_0x47314f(0x271)]?.[_0x47314f(0x1ee)]('Fetching\x20'+_0x5ada95[_0x47314f(0x1d5)]+'\x20v'+_0x5f16c0);const _0x320395=await _0x450c2f(_0x246627['id']),_0x4a7bed=_0x503e91(_0x246627['id']),_0x588f0b=await journeyResponseToDef(_0x320395,_0x4a7bed);_0x229b93['push']({'item':_0x246627,'yaml':_0x588f0b});}const _0x1f7fe7=buildLocalRuleToNameMappingFromJourney(_0x5ada95);_0x302d3a=buildMergedJourneyDef(_0x229b93,_0x1f7fe7,_0x191ad3);const _0x3e927f=Math[_0x47314f(0x259)](..._0x229b93[_0x47314f(0x2b1)](_0x3ce589=>_0x3ce589['item']['versionNumber']||0x0)),_0x33ad44=_0x529e6f[_0x47314f(0x240)](_0xc5d538=>(_0xc5d538[_0x47314f(0x20d)]||0x0)===_0x3e927f);_0x33ad44&&(_0x57f358[_0x47314f(0x271)]?.[_0x47314f(0x1ee)](_0x47314f(0x1c5)+_0x5ada95[_0x47314f(0x1d5)]+'\x20v'+_0x3e927f),_0x352ce3=await _0x450c2f(_0x33ad44['id']));}else{const _0x1615e2=_0x529e6f[_0x529e6f[_0x47314f(0x207)]-0x1];_0x57f358[_0x47314f(0x271)]?.[_0x47314f(0x1ee)](_0x47314f(0x1c5)+_0x5ada95[_0x47314f(0x1d5)]),_0x352ce3=await _0x450c2f(_0x1615e2['id']);const _0x71b6=_0x503e91(_0x1615e2['id']),_0x1b1af7=await journeyResponseToDef(_0x352ce3,_0x71b6),_0x4989f3=buildLocalRuleToNameMappingFromJourney(_0x5ada95);_0x302d3a=buildMergedJourneyDef([{'item':_0x1615e2,'yaml':_0x1b1af7}],_0x4989f3,_0x191ad3);}}addFoldersToCreate(_0x3be21f,_0x57f358[_0x47314f(0x2a2)],_0x19aad1);const _0x20e165=calculateJourneyDiff(_0x5ada95,_0x302d3a);_0x1956cd[_0x47314f(0x23a)]({'relativePath':_0x5ada95['name'],'absolutePath':_0x2fc5e5,'yamlConfig':_0x5ada95,'folderPath':_0x3be21f,'existingJourney':_0x352ce3,'isNew':_0x20e165[_0x47314f(0x1c0)],'hasChanges':_0x20e165['hasChanges'],'diff':_0x20e165['diff']});}return{'journeyFiles':_0x1956cd,'foldersToCreate':_0x19aad1};}export function calculateActivationActions(_0x29971f,_0x2ab93f,_0x444a06,_0x1e5c03){const _0x55b1e2=a142_0x119b8a,_0xd33262=[],_0x4837f3=new Map();for(const _0xdd6182 of _0x2ab93f){_0x4837f3['set'](_0xdd6182['name'],_0xdd6182);}const _0x51cfb0=new Map();for(const _0x373dd3 of _0x29971f){_0x51cfb0[_0x55b1e2(0x1e5)](_0x373dd3[_0x55b1e2(0x1d5)],_0x373dd3);}for(const _0x339181 of _0x29971f){const _0x2c8c19=_0x4837f3['get'](_0x339181[_0x55b1e2(0x1d5)]);if(!_0x2c8c19)_0xd33262[_0x55b1e2(0x23a)]({'type':_0x55b1e2(0x1cb),'name':_0x339181['name'],'yamlActivation':_0x339181});else{const _0x3739fd=activationResponseToDef(_0x2c8c19,_0x444a06,_0x1e5c03),_0x3dfbd4=a142_0x47e672[_0x55b1e2(0x2a6)](_0x3739fd),_0x50e6c7=a142_0x47e672[_0x55b1e2(0x2a6)](_0x339181);_0x3dfbd4!==_0x50e6c7&&_0xd33262['push']({'type':_0x55b1e2(0x1ee),'name':_0x339181['name'],'yamlActivation':_0x339181,'existingActivation':_0x2c8c19});}}for(const _0x564e00 of _0x2ab93f){!_0x51cfb0[_0x55b1e2(0x215)](_0x564e00[_0x55b1e2(0x1d5)])&&_0xd33262[_0x55b1e2(0x23a)]({'type':_0x55b1e2(0x2bc),'name':_0x564e00['name'],'existingActivation':_0x564e00});}return _0xd33262;}function calculateYamlDiff(_0x2e36c8,_0x5d374f){if(_0x5d374f){const _0xa5836=generateDiff(_0x5d374f,_0x2e36c8),_0x2be849=hasChanges(_0xa5836);return{'isNew':![],'hasChanges':_0x2be849,'diff':_0x2be849?formatDiffWithColors(_0xa5836):undefined};}const _0xb1d3a5=generateDiff('',_0x2e36c8);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xb1d3a5)};}export function calculateSegmentDiff(_0x10e762,_0x1aeec1,_0x35620f,_0x162fde,_0x2b0891){const _0x30b5ee=segmentToYamlString(_0x10e762),_0x1e1e0b=_0x1aeec1?segmentToYamlString(segmentWithActivationsToYaml(_0x1aeec1,_0x35620f,undefined,_0x162fde,_0x2b0891)):undefined;return calculateYamlDiff(_0x30b5ee,_0x1e1e0b);}export function calculateJourneyDiff(_0x5487a2,_0x5df1ed){const _0x474042=normalizeJourneyDef(_0x5487a2,_0x5487a2),_0xe74bf2=a142_0x407e51(_0x474042),_0x43fc8d=_0x5df1ed?a142_0x407e51(normalizeJourneyDef(_0x5df1ed,_0x5487a2)):undefined;return calculateYamlDiff(_0xe74bf2,_0x43fc8d);}export function findSegmentsToDelete(_0x3a5ec5,_0x555379,_0x4c23f0,_0x4501f8,_0x295a2a){const _0x400828=a142_0x119b8a,_0x2d08fc=new Set();for(const {yamlConfig:_0x46304f,folderPath:_0x4976ca}of _0x555379){_0x2d08fc[_0x400828(0x1e8)](_0x4976ca+':'+_0x46304f[_0x400828(0x1d5)]);}return _0x3a5ec5[_0x400828(0x2be)](_0x112c06=>{const _0x552967=_0x400828,_0x5c8aeb=_0x112c06[_0x552967(0x21a)]?_0x4c23f0['get'](_0x112c06[_0x552967(0x21a)][_0x552967(0x283)]())||'':'',_0x33c524=_0x5c8aeb+':'+_0x112c06[_0x552967(0x1d5)];if(_0x2d08fc[_0x552967(0x215)](_0x33c524))return![];if(_0x295a2a)return _0x5c8aeb===_0x4501f8||_0x5c8aeb[_0x552967(0x218)](_0x4501f8+'/');return!![];});}export function findJourneysToDelete(_0x5cd6a7,_0x1bfc8f,_0x2a856b,_0x366013,_0x433a0d){const _0x4e875f=a142_0x119b8a,_0x39109a=new Set();for(const {yamlConfig:_0x2c847e,folderPath:_0x146572}of _0x1bfc8f){_0x39109a[_0x4e875f(0x1e8)](_0x146572+':'+_0x2c847e['name']);}return _0x5cd6a7['filter'](_0x341d06=>{const _0x24660e=_0x4e875f,_0x34f7d7=_0x341d06[_0x24660e(0x275)]?_0x2a856b['get'](_0x341d06[_0x24660e(0x275)])||'':'',_0x38f7bc=_0x34f7d7+':'+_0x341d06[_0x24660e(0x297)];if(_0x39109a[_0x24660e(0x215)](_0x38f7bc))return![];if(_0x433a0d)return _0x34f7d7===_0x366013||_0x34f7d7[_0x24660e(0x218)](_0x366013+'/');return!![];});}function a142_0x2b21(){const _0x542ca0=['stringify','activationActions','idToName','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Updating\x20activation\x20\x27','parse','stages','createdSegmentIds','state','branches','Segment\x20not\x20found:\x20','map','Segment\x20not\x20found','conditions','558FoRPTL','conditionTimeoutDuration','match','nameToType','Updating\x20segment\x20\x27','decision_point','parentFolder','stage\x20\x27','delete','Creating\x20folder\x20\x27','filter','listActivations','ACTIVATION_SYNTAX_ERROR','deleteActivation','journeyActivationStepId','SEGMENT_NOT_FOUND','\x27\x20for\x20','localName','deps','isNew','absolutePath','1318849nKYxJx','./child-segment-yaml.js','activation_updated','Fetching\x20','64884Lznxhd','parseDocument','SEGMENT_UPDATE_ERROR','createSegment','journey_created','create','segment_deleting','segment_deleted','toISOString','relationships','Created\x20activation\x20\x27','connectionIdToNameMap','resolvedRule','embedded_activation_creating','digest','name','list','Updated\x20activation\x20\x27','embedded_activation_created','isArray','Creating\x20activation\x20\x27','embeddedSegmentNameToId','results','created','resolveSegment','resolveJourneyId','from','segment_creating','Deleting\x20activation\x20\x27','segmentNameToId','folder_creating','set','\x27\x20entry\x20criteria','type','add','unchanged','segment','goal\x20criteria','createFolder','activation_created','update','87536SJNttT',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','updated','validatedRequest','connector_config','sort','goal','uniqueSegmentName','segments','journeys','folderPath','journey','onProgress','tdx.sdk.push-workflow','Created\x20segment\x20\x27','INTERNAL','Activation\x20not\x20found:\x20','waitStep','journey_creating','toLowerCase','activationContext','__pending_','getSegment','attributes','length','effectiveFolderId','rule','buildUserMaps','Failed\x20to\x20fetch\x20referenced\x20segment\x20','object','versionNumber','reduce','parentSegmentFolder','null','deleted','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','kind','12815cYdYbA','has','Stage\x20\x27','some','startsWith','schedule','segmentFolderId','activation_creating','Failed\x20to\x20resolve\x20segment\x20','columns','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','activation_updating','92217tZmNJl',').\x20','Creating\x20segment\x20\x27','journeyStages','waitStepType','\x0a\x20\x20','segment_updated','\x27\x20from\x20file:\x20','includes','folder_created','activationStepsById','Failed\x20to\x20resolve\x20activation\x20','errors','\x20(referenced\x20in\x20journey\x20','WaitStep','with','run_after_journey_refresh','all','journeyById','rootFolderId','Name\x20has\x20already\x20been\x20taken','__pending_act_','logInfo','milestone','\x27\x20not\x20found\x20in\x20journey\x20\x27','entry_criteria','push','NOT_FOUND','Failed\x20to\x20','getJourney','JOURNEY_UPDATE_ERROR','\x27\x20wait\x20condition','find','withProgress','activation_template_id','description','relative','debug','logWarning','Activation','existingSegment','createActivation','parentId','activationParams','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','waitStepUnit','nameToId','day','\x27\x20milestone','valid','embedded_segment_created','Embedded\x20segment\x20\x27','steps','get','exitCriterias','yamlConfig','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','max','slice','segment_updating','folder','behavior','journeyName','updateSegmentById','SEGMENT_SYNTAX_ERROR','DecisionPoint','embedded_segment_creating','../../utils/async.js','534063zvvXRS','join','flatMap','144UhAKCO','\x27...','logDeleted','entryCriteria','conditionSegmentId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','updateActivation','replace','journey_updated','Deleted\x20activation\x20\x27','progress','activationsBySegmentId','user','size','folderId','journeyId','\x20activation\x20\x27','segmentId','JOURNEY_SYNTAX_ERROR','28012Mooqtj','ACTIVATION_UPDATE_ERROR','sha1','activation_deleted','entry','draft','dirname','existingSegments','Created\x20journey\x20\x27','toString','data','journeyBundleId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','yamlActivation','uniqueServerName','conditionTimeoutUnit','index','existingActivation','createdSegmentId','utf-8','trim','notification','journeyBundlesByFolderAndName','Deleted\x20segment\x20\x27','all_columns','activations','\x20journey\x20from\x20file:\x20','hasChanges','logSuccess','journeyBundleName','journey_updating','existingJourney','keys','idToEmailMap','action','.$1.push-recovery.json','split','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','createJourneySegment','Duration','folderPathToId','Journey\x20\x27','getSegmentEntity','Entry\x20criteria:\x20'];a142_0x2b21=function(){return _0x542ca0;};return a142_0x2b21();}export function buildSegmentLookupMap(_0xf7ce32,_0x5297fe){const _0x38abc3=a142_0x119b8a,_0x4ec330=new Map();for(const _0x418250 of _0xf7ce32){const _0x1cf85b=_0x418250[_0x38abc3(0x21a)]?_0x5297fe[_0x38abc3(0x255)](_0x418250[_0x38abc3(0x21a)]['toString']())||'':'',_0x1759b6=_0x1cf85b+':'+_0x418250[_0x38abc3(0x1d5)];_0x4ec330['set'](_0x1759b6,_0x418250);}return _0x4ec330;}export function buildSegmentNameToIdMap(_0x30fad9){const _0x5ab121=a142_0x119b8a,_0x2ec7c3=new Map();for(const _0x31be53 of _0x30fad9){_0x2ec7c3[_0x5ab121(0x1e5)](_0x31be53['name'],_0x31be53['id']);}return _0x2ec7c3;}export function buildJourneyBundleLookupMap(_0x32c2bc,_0x2494a6){const _0x230110=a142_0x119b8a,_0x159457=new Map();for(const _0xf9b338 of _0x32c2bc){const _0x1bb5d3=_0xf9b338[_0x230110(0x275)]?_0x2494a6['get'](_0xf9b338[_0x230110(0x275)])||'':'',_0x369e0d=_0x1bb5d3+':'+_0xf9b338[_0x230110(0x297)];!_0x159457[_0x230110(0x215)](_0x369e0d)&&_0x159457[_0x230110(0x1e5)](_0x369e0d,[]),_0x159457[_0x230110(0x255)](_0x369e0d)[_0x230110(0x23a)](_0xf9b338);}for(const _0x5882d2 of _0x159457['values']()){_0x5882d2[_0x230110(0x1f4)]((_0xd20ce2,_0x14fa7c)=>(_0xd20ce2['versionNumber']||0x0)-(_0x14fa7c[_0x230110(0x20d)]||0x0));}return _0x159457;}export function collectFoldersToCreate(_0x3c8149,_0x360665){const _0x3305a9=a142_0x119b8a,_0x5b6b31=new Set();for(const _0x568e40 of _0x3c8149){if(!_0x568e40)continue;if(_0x360665['has'](_0x568e40))continue;const _0x500454=_0x568e40[_0x3305a9(0x29e)]('/');let _0x4c67c6='';for(const _0x4ce074 of _0x500454){_0x4c67c6=_0x4c67c6?_0x4c67c6+'/'+_0x4ce074:_0x4ce074,!_0x360665['has'](_0x4c67c6)&&_0x5b6b31[_0x3305a9(0x1e8)](_0x4c67c6);}}return _0x5b6b31;}export function parseAndClassifyYamlFiles(_0x4bda26,_0x1fda52,_0x3367fb){const _0x123c37=a142_0x119b8a,_0x1a6f6e=[],_0x388957=[];for(const _0x418257 of _0x4bda26){const _0x24264b=a142_0x23e26b[_0x123c37(0x244)](_0x1fda52,a142_0x23e26b[_0x123c37(0x280)](_0x418257)),_0x148f6e=_0x24264b==='.'?'':_0x24264b,_0x2209d9=readFileSync(_0x418257,'utf-8'),_0x6a6075=a142_0x47e672[_0x123c37(0x2ab)](_0x2209d9);if(isJourneyDef(_0x6a6075)){const _0x33fb42=a142_0x1b9769(_0x2209d9);_0x388957[_0x123c37(0x23a)]({'yamlConfig':_0x33fb42,'folderPath':_0x148f6e,'sourcePath':_0x418257});}else{if(!_0x3367fb?.['skipSegments']){const _0x5b0adf=parseSegmentYamlFile(_0x2209d9),_0x474384=normalizeChildSegmentYaml(_0x5b0adf);_0x1a6f6e[_0x123c37(0x23a)]({'yamlConfig':_0x474384,'folderPath':_0x148f6e,'sourcePath':_0x418257});}}}return{'segments':_0x1a6f6e,'journeys':_0x388957};}export function validateParsedFiles(_0x2cfa90,_0x1bccfa){const _0x29fc8d=a142_0x119b8a,_0x1826d0=[];for(const {yamlConfig:_0xfbe49a,sourcePath:_0x33ffc3}of _0x2cfa90[_0x29fc8d(0x1f7)]){const _0x191712=readFileSync(_0x33ffc3,_0x29fc8d(0x28d)),_0x21eac6=a142_0x47e672[_0x29fc8d(0x1c7)](_0x191712),_0x4900e6=validateSegmentDef(_0xfbe49a,{'source':_0x191712,'document':_0x21eac6},{'skipSchema':!![]});if(!_0x4900e6[_0x29fc8d(0x251)]){const _0x4f8e2c=a142_0x23e26b[_0x29fc8d(0x244)](_0x1bccfa,_0x33ffc3);_0x1826d0[_0x29fc8d(0x23a)]({'filePath':_0x4f8e2c,'source':_0x191712,'result':_0x4900e6,'isJourney':![]});}}for(const {yamlConfig:_0x322424,sourcePath:_0x2aa0af}of _0x2cfa90[_0x29fc8d(0x1f8)]){const _0x2a0d4a=readFileSync(_0x2aa0af,_0x29fc8d(0x28d)),_0x29d38e=a142_0x47e672[_0x29fc8d(0x1c7)](_0x2a0d4a),_0x34e2f0=validateJourneyDef(_0x322424,{'source':_0x2a0d4a,'document':_0x29d38e},{'skipSchema':!![]});if(!_0x34e2f0['valid']){const _0x26ff6f=a142_0x23e26b[_0x29fc8d(0x244)](_0x1bccfa,_0x2aa0af);_0x1826d0['push']({'filePath':_0x26ff6f,'source':_0x2a0d4a,'result':_0x34e2f0,'isJourney':!![]});}}return _0x1826d0;}export function formatValidationErrors(_0x56f13a){const _0x5c4140=a142_0x119b8a,_0x13b9c7=[];for(const {filePath:_0xd2eb,source:_0x2ea80b,result:_0x3898b5,isJourney:_0x5d490f}of _0x56f13a){const _0x4d0091=_0x5d490f?_0x5c4140(0x1fa):_0x5c4140(0x1ea);_0x13b9c7[_0x5c4140(0x23a)]('\x0a'+_0xd2eb+'\x20('+_0x4d0091+'):\x20'+_0x3898b5[_0x5c4140(0x22c)]['length']+'\x20error(s)'),_0x13b9c7[_0x5c4140(0x23a)](formatValidationResult(_0x3898b5,_0x2ea80b,_0xd2eb));}return _0x13b9c7['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x4a2fe5){const _0x5ace12=a142_0x119b8a,_0x2f38ef=new Set(),_0x4f0685=new Map(),_0x598dc2=collectSegmentUsageCounts(_0x4a2fe5);if(_0x4a2fe5[_0x5ace12(0x1f7)])for(const [_0x22de42,_0x2f7ae9]of Object['entries'](_0x4a2fe5[_0x5ace12(0x1f7)])){_0x2f38ef[_0x5ace12(0x1e8)](_0x22de42);if(_0x2f7ae9[_0x5ace12(0x209)]){const _0x13f0f1=yamlRuleToApi(_0x2f7ae9[_0x5ace12(0x209)]),_0x54f192=apiRuleToYaml(_0x13f0f1);_0x4f0685[_0x5ace12(0x1e5)](_0x22de42,_0x54f192);}}const _0x5d2f08=new Map();let _0x41e366=0x0;for(const [_0x104ac7,_0x46f195]of _0x4f0685){const _0xa0342d=serializeExpandedRule(_0x46f195,_0x4f0685),_0x481a89=_0x5d2f08[_0x5ace12(0x255)](_0xa0342d)||[];_0x481a89[_0x5ace12(0x23a)]({'name':_0x104ac7,'index':_0x41e366}),_0x5d2f08['set'](_0xa0342d,_0x481a89),_0x41e366++;}const _0x5e4d60=new Map();for(const [_0x873fb6,_0x2733ff]of _0x5d2f08){const _0x2d2e35=_0x2733ff[_0x5ace12(0x25a)]()[_0x5ace12(0x1f4)]((_0xfd8502,_0x411eb1)=>{const _0x330c99=_0x5ace12,_0x5e917b=_0x598dc2[_0x330c99(0x255)](_0xfd8502[_0x330c99(0x1d5)])||0x0,_0x4a435a=_0x598dc2[_0x330c99(0x255)](_0x411eb1[_0x330c99(0x1d5)])||0x0;if(_0x5e917b!==_0x4a435a)return _0x4a435a-_0x5e917b;return _0xfd8502[_0x330c99(0x28a)]-_0x411eb1[_0x330c99(0x28a)];})['map'](_0x14b2e1=>_0x14b2e1['name']),_0x26e618=[];for(const _0x22ed73 of _0x2d2e35){const _0x422bcd=_0x598dc2[_0x5ace12(0x255)](_0x22ed73)||0x0,_0x2b4d7b=Math['max'](_0x422bcd,0x1);for(let _0x272ef6=0x0;_0x272ef6<_0x2b4d7b;_0x272ef6++){_0x26e618[_0x5ace12(0x23a)](_0x22ed73);}}_0x5e4d60['set'](_0x873fb6,_0x26e618);}return{'existingLocalSegmentNames':_0x2f38ef,'localSegmentRules':_0x4f0685,'localExpandedRuleToNames':_0x5e4d60};}export function createSegmentIdResolver(_0x5d7938,_0x53fb8b){return async _0x3a5210=>{const _0x4cf928=a142_0x3007,_0x39525c=_0x5d7938['get'](_0x3a5210);if(!_0x39525c)throw new SDKError(ErrorCode[_0x4cf928(0x1bc)],_0x4cf928(0x2b0)+_0x3a5210+_0x4cf928(0x26c)+_0x53fb8b+'\x27)');return _0x39525c;};}export function extractRootFolderId(_0x5aeda4){const _0x17260d=a142_0x119b8a;return _0x5aeda4[_0x17260d(0x1cf)]?.[_0x17260d(0x20f)]?.['data']?.['id']||_0x5aeda4[_0x17260d(0x1cf)]?.[_0x17260d(0x2ba)]?.[_0x17260d(0x284)]?.['id'];}export function buildConnectionMaps(_0x3553b9){const _0x477206=a142_0x119b8a,_0x45a386=new Map(),_0x11ff61=new Map(),_0x4af573=new Map();for(const _0x3835b9 of _0x3553b9){_0x45a386[_0x477206(0x1e5)](_0x3835b9['name'],parseInt(_0x3835b9['id'],0xa)),_0x11ff61[_0x477206(0x1e5)](_0x3835b9['id'],_0x3835b9[_0x477206(0x1d5)]),_0x4af573['set'](_0x3835b9[_0x477206(0x1d5)],_0x3835b9[_0x477206(0x1e7)]);}return{'nameToId':_0x45a386,'idToName':_0x11ff61,'nameToType':_0x4af573};}export function calculatePushStats(_0x4578da,_0x5b6319,_0x1b4a0d,_0x1d0496,_0x18461a,_0x11ab5e,_0x431d33){const _0x30aa2a=a142_0x119b8a,_0x56614f=_0x4578da[_0x30aa2a(0x2be)](_0x10396d=>_0x10396d[_0x30aa2a(0x1c0)]),_0xd2d6db=_0x4578da['filter'](_0x47ca53=>!_0x47ca53['isNew']&&_0x47ca53[_0x30aa2a(0x295)]),_0x1072c4=_0x4578da['filter'](_0x25f9d6=>!_0x25f9d6['isNew']&&!_0x25f9d6['hasChanges']),_0x2ebcb5=_0x11ab5e?_0x1d0496:[],_0xaaef5c=_0x5b6319[_0x30aa2a(0x2be)](_0x511b2d=>_0x511b2d[_0x30aa2a(0x1c0)]),_0x3bb394=_0x5b6319['filter'](_0x350330=>!_0x350330['isNew']&&_0x350330[_0x30aa2a(0x295)]),_0x18f524=_0x5b6319[_0x30aa2a(0x2be)](_0x3d261f=>!_0x3d261f[_0x30aa2a(0x1c0)]&&!_0x3d261f[_0x30aa2a(0x295)]),_0x3c8420=_0x11ab5e?_0x18461a:[],_0x3fb27e=_0x4578da[_0x30aa2a(0x266)](_0x4288af=>_0x4288af[_0x30aa2a(0x2a7)]),_0x571108=_0x3fb27e['filter'](_0x1a971e=>_0x1a971e[_0x30aa2a(0x1e7)]===_0x30aa2a(0x1cb)),_0x3c87e7=_0x3fb27e['filter'](_0x25f0d5=>_0x25f0d5[_0x30aa2a(0x1e7)]===_0x30aa2a(0x1ee)),_0x16ec0c=_0x3fb27e[_0x30aa2a(0x2be)](_0x42ee24=>_0x42ee24['type']===_0x30aa2a(0x2bc)),_0x480fbf=Array['from'](_0x1b4a0d)['sort'](),_0x62afb9=_0x431d33?![]:_0x56614f[_0x30aa2a(0x207)]>0x0||_0xd2d6db[_0x30aa2a(0x207)]>0x0||_0x2ebcb5[_0x30aa2a(0x207)]>0x0,_0x16a7b1=_0xaaef5c[_0x30aa2a(0x207)]>0x0||_0x3bb394['length']>0x0||_0x3c8420[_0x30aa2a(0x207)]>0x0,_0x2cde06=_0x431d33?![]:_0x3fb27e[_0x30aa2a(0x207)]>0x0,_0x7ebbcc=_0x480fbf[_0x30aa2a(0x207)]>0x0;return{'segments':{'new':_0x56614f,'changed':_0xd2d6db,'unchanged':_0x1072c4,'toDelete':_0x2ebcb5},'journeys':{'new':_0xaaef5c,'changed':_0x3bb394,'unchanged':_0x18f524,'toDelete':_0x3c8420},'activations':{'all':_0x3fb27e,'toCreate':_0x571108,'toUpdate':_0x3c87e7,'toDelete':_0x16ec0c},'folders':{'toCreate':_0x480fbf},'counts':{'segments':{'new':_0x56614f[_0x30aa2a(0x207)],'changed':_0xd2d6db[_0x30aa2a(0x207)],'unchanged':_0x1072c4[_0x30aa2a(0x207)],'toDelete':_0x2ebcb5[_0x30aa2a(0x207)]},'journeys':{'new':_0xaaef5c[_0x30aa2a(0x207)],'changed':_0x3bb394['length'],'unchanged':_0x18f524[_0x30aa2a(0x207)],'toDelete':_0x3c8420[_0x30aa2a(0x207)]},'activations':{'create':_0x571108[_0x30aa2a(0x207)],'update':_0x3c87e7[_0x30aa2a(0x207)],'delete':_0x16ec0c[_0x30aa2a(0x207)]},'folders':_0x480fbf[_0x30aa2a(0x207)]},'hasChanges':_0x62afb9||_0x16a7b1||_0x2cde06||_0x7ebbcc};}export async function buildPushExecutionContext(_0x54dafc,_0x49ffcd,_0x3b2556,_0x41a151,_0x2c4f8f,_0x519d38){const _0x132af3=a142_0x119b8a,_0x289455=extractRootFolderId(_0x3b2556),{pathToId:_0x39edd2,idToPath:_0x13ed8b}=buildFolderMaps(_0x2c4f8f),_0x5d2288=buildSegmentNameToIdMap(_0x41a151),_0x216830=new Map(),{batchAsync:_0x571cb5}=await import(_0x132af3(0x263)),[_0x3eb4d4,_0x38e543]=await Promise[_0x132af3(0x231)]([_0x54dafc[_0x132af3(0x273)][_0x132af3(0x20a)](),_0x54dafc['connection'][_0x132af3(0x1d6)](),((async()=>{!_0x519d38&&_0x41a151['length']>0x0&&await _0x571cb5(_0x41a151,async _0x16f051=>{const _0x386333=a142_0x3007,_0xc892b7=await _0x54dafc[_0x386333(0x1ea)][_0x386333(0x2bf)](_0x49ffcd,_0x16f051['id']);_0x216830[_0x386333(0x1e5)](_0x16f051['id'],_0xc892b7);});})())]),{emailToId:_0x4b506f,idToEmail:_0xf261f}=_0x3eb4d4,_0x50d4bb=buildConnectionMaps(_0x38e543);return{'rootFolderId':_0x289455,'folderPathToId':_0x39edd2,'folderIdToPath':_0x13ed8b,'segmentNameToId':_0x5d2288,'activationsBySegmentId':_0x216830,'emailToIdMap':_0x4b506f,'idToEmailMap':_0xf261f,'connectionNameToIdMap':_0x50d4bb[_0x132af3(0x24e)],'connectionIdToNameMap':_0x50d4bb[_0x132af3(0x2a8)],'connectionNameToTypeMap':_0x50d4bb[_0x132af3(0x2b7)]};}export function createPushYamlContextForBundle(_0x5d47ca,_0x152655,_0x11bc00,_0x1ad2f9,_0xded039,_0x1c2fcb,_0x474d25,_0x295344){const {existingLocalSegmentNames:_0x1d3f09,localExpandedRuleToNames:_0xd61fa}=_0x1ad2f9,_0x4f51ee=new Set(),_0x317062=new Map(),_0x4826b0=new Map(),_0x52303b=new Map(),_0x15eea2=createJumpTargetCache(),_0x58f304=new Map(),_0x52b3fc=new Map(),_0x4110fd=new Set();let _0xd5cbb3;const _0x50f83a=_0x16aab6=>{const _0x223b2d={'resolveSegment':async _0x4b9e3b=>{const _0x522685=a142_0x3007,_0x31319a=_0x52303b['get'](_0x4b9e3b);if(_0x31319a!==undefined)return{'name':_0x31319a,'isJourneyLocal':!![]};try{const _0x27e4c9=await fetchSegment(_0x5d47ca,_0x152655,_0x4b9e3b,_0x11bc00);if(!_0x27e4c9)throw new Error(_0x522685(0x2b2));const _0x25a966=generateJourneyLocalName(_0x27e4c9[_0x522685(0x1d5)]),_0x12a095=_0x27e4c9[_0x522685(0x213)]===SEGMENT_KIND_JOURNEY&&_0x25a966!==undefined;let _0x21be9c=_0x27e4c9[_0x522685(0x1d5)],_0x367785;if(_0x12a095&&_0x27e4c9['rule']){const _0x28b35c=apiRuleToYaml(_0x27e4c9['rule']);_0x52b3fc[_0x522685(0x1e5)](_0x4b9e3b,_0x28b35c);const _0x30bf68=async _0x5299f9=>{const _0x441d06=_0x522685,_0x360bc9=collectSegmentRefsFromRule(_0x5299f9);for(const _0x48ec74 of _0x360bc9){if(!_0x52b3fc[_0x441d06(0x215)](_0x48ec74))try{const _0x414ac4=await fetchSegment(_0x5d47ca,_0x152655,_0x48ec74,_0x11bc00);if(_0x414ac4?.[_0x441d06(0x209)]){const _0x53a2f3=apiRuleToYaml(_0x414ac4['rule']);_0x52b3fc['set'](_0x48ec74,_0x53a2f3),await _0x30bf68(_0x53a2f3);}}catch(_0x24a8aa){logger[_0x441d06(0x245)](_0x441d06(0x20b)+_0x48ec74+':\x20'+_0x24a8aa);}}};await _0x30bf68(_0x28b35c);const _0x1b307f=serializeExpandedRule(_0x28b35c,_0x52b3fc),_0x12a612=_0xd61fa[_0x522685(0x255)](_0x1b307f);if(_0x12a612&&_0x12a612[_0x522685(0x207)]>0x0){const _0x3866b9=_0x317062[_0x522685(0x255)](_0x1b307f)||0x0,_0x3be4dd=_0x12a612[_0x3866b9]||_0x12a612[_0x12a612[_0x522685(0x207)]-0x1];_0x317062['set'](_0x1b307f,_0x3866b9+0x1),_0x21be9c=_0x3be4dd,_0x4f51ee[_0x522685(0x1e8)](_0x21be9c),_0x52303b[_0x522685(0x1e5)](_0x4b9e3b,_0x21be9c);const _0x7de080=await resolveRuleSegmentRefs(_0x28b35c,async _0x2a9343=>{const _0x123564=_0x522685,_0x3d3b95=_0x52303b[_0x123564(0x255)](_0x2a9343);if(_0x3d3b95)return _0x3d3b95;const _0x1f95dd=await _0xd5cbb3[_0x123564(0x1de)](_0x2a9343);return _0x1f95dd[_0x123564(0x1d5)];});_0x367785={'description':_0x27e4c9[_0x522685(0x243)],'rule':_0x7de080};}else{const _0x43e561=_0x58f304[_0x522685(0x255)](_0x1b307f);if(_0x43e561)_0x21be9c=_0x43e561,_0x52303b[_0x522685(0x1e5)](_0x4b9e3b,_0x21be9c);else{if(_0x25a966){let _0x543090=_0x25a966,_0x1f8f42=0x2;while(_0x4f51ee[_0x522685(0x215)](_0x543090)||_0x1d3f09[_0x522685(0x215)](_0x543090)){_0x543090=_0x25a966+'_'+_0x1f8f42,_0x1f8f42++;}_0x4f51ee[_0x522685(0x1e8)](_0x543090),_0x21be9c=_0x543090;}_0x52303b[_0x522685(0x1e5)](_0x4b9e3b,_0x21be9c),_0x58f304[_0x522685(0x1e5)](_0x1b307f,_0x21be9c);const _0x165c62=await resolveRuleSegmentRefs(_0x28b35c,async _0x2b7113=>{const _0x49344c=_0x522685,_0x3943a9=_0x52303b['get'](_0x2b7113);if(_0x3943a9)return _0x3943a9;const _0x44c3d8=await _0xd5cbb3[_0x49344c(0x1de)](_0x2b7113);return _0x44c3d8[_0x49344c(0x1d5)];});_0x367785={'description':_0x27e4c9[_0x522685(0x243)],'rule':_0x165c62};}}}return{'name':_0x21be9c,'isJourneyLocal':_0x12a095,'definition':_0x367785};}catch(_0x57fdb2){return logger[_0x522685(0x245)](_0x522685(0x21c)+_0x4b9e3b+':\x20'+_0x57fdb2),{'name':_0x4b9e3b,'isJourneyLocal':![]};}},'resolveActivation':async _0xb83d64=>{const _0x124f3f=a142_0x3007,_0x491431=_0x4826b0[_0x124f3f(0x255)](_0xb83d64);if(_0x491431!==undefined)return{'name':_0x491431,'isJourneyLocal':!![]};try{let _0x4192e4=_0x474d25?.[_0x124f3f(0x255)](_0xb83d64);!_0x4192e4&&(_0x4192e4=await _0x5d47ca[_0x124f3f(0x1fa)]['getActivation'](_0x16aab6,_0xb83d64));const _0x144fd1=_0x4192e4['attributes'][_0x124f3f(0x24b)]['name']||_0xb83d64,_0x139078=sanitizeYamlKey(_0x144fd1)||'activation_'+_0xb83d64,_0x23a3bd=_0x139078;_0x4826b0[_0x124f3f(0x1e5)](_0xb83d64,_0x23a3bd);const _0x20b3bf=journeyActivationStepToYaml(_0x4192e4,_0xded039,_0x1c2fcb);return{'name':_0x23a3bd,'isJourneyLocal':!![],'definition':_0x20b3bf};}catch(_0x5c69de){return logger[_0x124f3f(0x245)](_0x124f3f(0x22b)+_0xb83d64+':\x20'+_0x5c69de),{'name':_0xb83d64,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x7a2ddd,_0xa6a694)=>resolveJumpTarget(_0x7a2ddd,_0xa6a694,_0x15eea2,async _0x27989f=>{const _0x420e5f=a142_0x3007,_0x2e502d=_0x295344?.[_0x420e5f(0x255)](_0x27989f);if(_0x2e502d)return _0x2e502d;return _0x5d47ca[_0x420e5f(0x1fa)][_0x420e5f(0x23d)](_0x27989f);})};return _0xd5cbb3=_0x223b2d,_0x223b2d;},_0x5e2d19=async _0x172206=>{const _0x50f282=a142_0x3007,{collectSegmentIdsFromJourneyApi:_0x4868c5}=await import('./journey-yaml.js'),{batchAsync:_0x1b38d1}=await import(_0x50f282(0x263)),_0x5a531=new Set();for(const _0xc17362 of _0x172206){let _0x2be179=_0x295344?.[_0x50f282(0x255)](_0xc17362);!_0x2be179&&(_0x2be179=await _0x5d47ca[_0x50f282(0x1fa)][_0x50f282(0x23d)](_0xc17362));const _0x311699=_0x4868c5(_0x2be179);for(const _0x1eb03f of _0x311699){_0x5a531['add'](_0x1eb03f);}}let _0x4ec6eb=Array[_0x50f282(0x1e0)](_0x5a531);while(_0x4ec6eb[_0x50f282(0x207)]>0x0){const _0x1dfa7d=_0x4ec6eb['filter'](_0x4b4610=>!_0x4110fd['has'](_0x4b4610));if(_0x1dfa7d[_0x50f282(0x207)]===0x0)break;const _0x4f45ab=await _0x1b38d1(_0x1dfa7d,async _0x8dae75=>{const _0x1d9d05=_0x50f282;_0x4110fd[_0x1d9d05(0x1e8)](_0x8dae75);const _0x3b4dc9=await fetchSegment(_0x5d47ca,_0x152655,_0x8dae75,_0x11bc00);if(!_0x3b4dc9)return null;return{'segmentId':_0x8dae75,'segment':_0x3b4dc9};},0xa),_0x5a7e13=new Set();for(const _0x462a5e of _0x4f45ab){if(!_0x462a5e?.[_0x50f282(0x1ea)]?.['rule'])continue;const _0x14f47d=apiRuleToYaml(_0x462a5e['segment'][_0x50f282(0x209)]);_0x52b3fc['set'](_0x462a5e[_0x50f282(0x278)],_0x14f47d);const _0x302832=collectSegmentRefsFromRule(_0x14f47d);for(const _0x2408e4 of _0x302832){!_0x4110fd[_0x50f282(0x215)](_0x2408e4)&&_0x5a7e13[_0x50f282(0x1e8)](_0x2408e4);}}_0x4ec6eb=Array[_0x50f282(0x1e0)](_0x5a7e13);}};return{'createYamlContext':_0x50f83a,'prefetchJourneySegments':_0x5e2d19};}export async function executePushSegments(_0x10ac81,_0x865481,_0xe40789,_0x3931bf,_0x2a22d5){const _0x419675=a142_0x119b8a,{segmentDefToCreateRequest:_0x286afd,segmentDefToUpdateRequest:_0x66458f}=await import(_0x419675(0x1c3)),_0x2e3bf3=_0xe40789[_0x419675(0x2a2)],_0x545212=0x5,_0x3bd82a=async _0x5e33f3=>{const _0x48ea38=_0x419675,_0xf3e7c3=_0x5e33f3['folderPath']?_0x2e3bf3['get'](_0x5e33f3['folderPath']):undefined;let _0x2fa58c;const _0x33be31={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x5c0abb=_0x5e33f3[_0x48ea38(0x257)];if(_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x209)]){const _0x3848e9=createSegmentIdResolver(_0xe40789[_0x48ea38(0x1e3)],_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]),_0x4eb344=await resolveRuleSegmentIds(_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x209)],_0x3848e9);_0x5c0abb={..._0x5e33f3[_0x48ea38(0x257)],'rule':_0x4eb344};}try{if(_0x5e33f3[_0x48ea38(0x1c0)]){_0x2a22d5[_0x48ea38(0x1fb)]?.({'type':_0x48ea38(0x1e1),'name':_0x5e33f3[_0x48ea38(0x257)]['name']});const _0x19b383=_0x286afd(_0x5c0abb,_0xf3e7c3),_0x52ee9d=await _0x2a22d5[_0x48ea38(0x241)](_0x48ea38(0x222)+_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]+'\x27...',()=>_0x10ac81['segment'][_0x48ea38(0x1c9)](_0x3931bf['parentId'],_0x19b383));_0x2fa58c=_0x52ee9d[_0x48ea38(0x284)]['id'],_0xe40789[_0x48ea38(0x1e3)][_0x48ea38(0x1e5)](_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)],_0x2fa58c),_0x33be31['createdSegmentId']={'name':_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)],'id':_0x2fa58c},_0x2a22d5[_0x48ea38(0x1fb)]?.({'type':'segment_created','name':_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)],'segmentId':_0x2fa58c}),_0x2a22d5['logSuccess']?.(_0x48ea38(0x1fd)+_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]+'\x27'),_0x33be31[_0x48ea38(0x1dd)]=0x1;}else{if(_0x5e33f3[_0x48ea38(0x295)]){_0x2a22d5[_0x48ea38(0x1fb)]?.({'type':_0x48ea38(0x25b),'name':_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]});const _0xafda08=_0x66458f(_0x5c0abb);_0xf3e7c3!==_0x5e33f3[_0x48ea38(0x248)]?.['segmentFolderId']&&(_0xafda08['segmentFolderId']=_0xf3e7c3?parseInt(_0xf3e7c3,0xa):undefined),await _0x2a22d5[_0x48ea38(0x241)](_0x48ea38(0x2b8)+_0x5e33f3[_0x48ea38(0x257)]['name']+_0x48ea38(0x268),()=>_0x10ac81[_0x48ea38(0x1ea)][_0x48ea38(0x25f)](_0x3931bf[_0x48ea38(0x24a)],_0x5e33f3[_0x48ea38(0x248)]['id'],_0xafda08)),_0x2fa58c=_0x5e33f3[_0x48ea38(0x248)]['id'],_0x2a22d5[_0x48ea38(0x1fb)]?.({'type':_0x48ea38(0x226),'name':_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]}),_0x2a22d5[_0x48ea38(0x296)]?.('Updated\x20segment\x20\x27'+_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]+'\x27'),_0x33be31[_0x48ea38(0x1f1)]=0x1;}else _0x2fa58c=_0x5e33f3['existingSegment']['id'];}}catch(_0x24462d){const _0x253317=isHttp400Error(_0x24462d),_0x3cff19=_0x253317?ErrorCode[_0x48ea38(0x260)]:ErrorCode[_0x48ea38(0x1c8)],_0x2470e2=getErrorMessage(_0x24462d);throw new SDKError(_0x3cff19,_0x48ea38(0x23c)+(_0x5e33f3['isNew']?_0x48ea38(0x1cb):'update')+'\x20segment\x20from\x20file:\x20'+_0x5e33f3[_0x48ea38(0x1c1)]+_0x48ea38(0x225)+_0x2470e2,_0x24462d);}try{const _0xc08c69=await syncActivationsForSegment(_0x10ac81,_0x3931bf[_0x48ea38(0x24a)],_0x2fa58c,_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)],_0x5e33f3[_0x48ea38(0x2a7)],_0x2a22d5,_0x5e33f3[_0x48ea38(0x1c1)]);_0x33be31['activations']=_0xc08c69;}catch(_0xbfe1b7){if(_0xbfe1b7 instanceof SDKError)throw _0xbfe1b7;throw new SDKError(ErrorCode[_0x48ea38(0x27b)],_0x48ea38(0x212)+_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]+_0x48ea38(0x227)+_0x5e33f3[_0x48ea38(0x1c1)]+_0x48ea38(0x225)+getErrorMessage(_0xbfe1b7),_0xbfe1b7);}return _0x33be31;},_0x36c58c=await batchAsync(_0x865481,_0x3bd82a,_0x545212),_0x3703fb={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2fa2bd of _0x36c58c){_0x3703fb[_0x419675(0x1dd)]+=_0x2fa2bd[_0x419675(0x1dd)],_0x3703fb['updated']+=_0x2fa2bd[_0x419675(0x1f1)],_0x2fa2bd[_0x419675(0x28c)]&&_0x3703fb[_0x419675(0x2ad)][_0x419675(0x1e5)](_0x2fa2bd[_0x419675(0x28c)][_0x419675(0x1d5)],_0x2fa2bd[_0x419675(0x28c)]['id']),_0x3703fb['activations'][_0x419675(0x1dd)]+=_0x2fa2bd[_0x419675(0x293)][_0x419675(0x1dd)],_0x3703fb[_0x419675(0x293)][_0x419675(0x1f1)]+=_0x2fa2bd['activations'][_0x419675(0x1f1)],_0x3703fb[_0x419675(0x293)][_0x419675(0x211)]+=_0x2fa2bd['activations'][_0x419675(0x211)];}return _0x3703fb;}async function syncActivationsForSegment(_0x4fb354,_0x5ed1ef,_0x5ecf01,_0x20e22f,_0x2ffc24,_0x195937,_0x21fa7e){const _0x5b438f=a142_0x119b8a,_0x1ae6e4={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x199021 of _0x2ffc24){try{if(_0x199021[_0x5b438f(0x1e7)]===_0x5b438f(0x1cb)&&_0x199021[_0x5b438f(0x1f2)])_0x195937[_0x5b438f(0x1fb)]?.({'type':_0x5b438f(0x21b),'segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),await _0x195937[_0x5b438f(0x241)](_0x5b438f(0x1da)+_0x199021[_0x5b438f(0x1d5)]+_0x5b438f(0x268),()=>_0x4fb354[_0x5b438f(0x1ea)][_0x5b438f(0x249)](_0x5ed1ef,_0x5ecf01,_0x199021[_0x5b438f(0x1f2)])),_0x195937['onProgress']?.({'type':_0x5b438f(0x1ed),'segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),_0x195937[_0x5b438f(0x296)]?.(_0x5b438f(0x1d0)+_0x199021['name']+'\x27'),_0x1ae6e4['created']++;else{if(_0x199021[_0x5b438f(0x1e7)]===_0x5b438f(0x1ee)&&_0x199021[_0x5b438f(0x1f2)]&&_0x199021['existingActivation'])_0x195937[_0x5b438f(0x1fb)]?.({'type':_0x5b438f(0x21f),'segmentName':_0x20e22f,'activationName':_0x199021['name']}),await _0x195937[_0x5b438f(0x241)](_0x5b438f(0x2aa)+_0x199021[_0x5b438f(0x1d5)]+_0x5b438f(0x268),()=>_0x4fb354['segment'][_0x5b438f(0x26d)](_0x5ed1ef,_0x5ecf01,_0x199021[_0x5b438f(0x28b)]['id'],_0x199021['validatedRequest'])),_0x195937[_0x5b438f(0x1fb)]?.({'type':_0x5b438f(0x1c4),'segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),_0x195937[_0x5b438f(0x296)]?.(_0x5b438f(0x1d7)+_0x199021[_0x5b438f(0x1d5)]+'\x27'),_0x1ae6e4['updated']++;else _0x199021[_0x5b438f(0x1e7)]==='delete'&&_0x199021[_0x5b438f(0x28b)]&&(_0x195937['onProgress']?.({'type':'activation_deleting','segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),await _0x195937['withProgress'](_0x5b438f(0x1e2)+_0x199021[_0x5b438f(0x1d5)]+_0x5b438f(0x268),()=>_0x4fb354[_0x5b438f(0x1ea)][_0x5b438f(0x1ba)](_0x5ed1ef,_0x5ecf01,_0x199021[_0x5b438f(0x28b)]['id'])),_0x195937[_0x5b438f(0x1fb)]?.({'type':_0x5b438f(0x27d),'segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),_0x195937[_0x5b438f(0x269)]?.(_0x5b438f(0x270)+_0x199021[_0x5b438f(0x1d5)]+'\x27'),_0x1ae6e4['deleted']++);}}catch(_0x2a15e7){const _0x463ee2=isHttp400Error(_0x2a15e7),_0x1b3fb0=_0x463ee2?ErrorCode[_0x5b438f(0x1b9)]:ErrorCode[_0x5b438f(0x27b)],_0x21c9ff=getErrorMessage(_0x2a15e7);throw new SDKError(_0x1b3fb0,'Failed\x20to\x20'+_0x199021[_0x5b438f(0x1e7)]+_0x5b438f(0x277)+_0x199021[_0x5b438f(0x1d5)]+_0x5b438f(0x227)+_0x21fa7e+_0x5b438f(0x225)+_0x21c9ff,_0x2a15e7);}}return _0x1ae6e4;}export async function executePushFolders(_0xce7912,_0x585e4b,_0x52a133,_0x2c03ac,_0x106446){const _0xc0f244=a142_0x119b8a,_0x372d25=new Map(_0x52a133),_0x5798a1=sortFoldersByDepth(_0x585e4b);for(const _0x5de59e of _0x5798a1){const _0x3e0b12=_0x5de59e[_0xc0f244(0x29e)]('/'),_0x351fa4=_0x3e0b12[_0x3e0b12[_0xc0f244(0x207)]-0x1],_0x312efb=_0x3e0b12[_0xc0f244(0x25a)](0x0,-0x1)[_0xc0f244(0x265)]('/'),_0x24c341=_0x372d25[_0xc0f244(0x255)](_0x312efb);_0x106446['onProgress']?.({'type':_0xc0f244(0x1e4),'folder':_0x5de59e});const _0x5970fa={'name':_0x351fa4,'parentFolderId':_0x24c341},_0x2c2cd3=await _0x106446[_0xc0f244(0x241)](_0xc0f244(0x2bd)+_0x5de59e+_0xc0f244(0x268),()=>_0xce7912[_0xc0f244(0x1ea)][_0xc0f244(0x1ec)](_0x2c03ac[_0xc0f244(0x24a)],_0x5970fa));_0x372d25[_0xc0f244(0x1e5)](_0x5de59e,_0x2c2cd3[_0xc0f244(0x284)]['id']),_0x106446[_0xc0f244(0x1fb)]?.({'type':_0xc0f244(0x229),'folder':_0x5de59e,'folderId':_0x2c2cd3[_0xc0f244(0x284)]['id']}),_0x106446[_0xc0f244(0x236)]?.('Created\x20folder\x20\x27'+_0x5de59e+'\x27');}return _0x372d25;}export async function executePushSegmentDeletions(_0x2388da,_0x37563c,_0x264d6f){const _0x858e20=a142_0x119b8a;if(_0x37563c[_0x858e20(0x207)]===0x0)return 0x0;const {batchAsync:_0x51489d}=await import(_0x858e20(0x263)),_0x53ef0d=0x5,_0xd163d5=await _0x51489d(_0x37563c,async _0x2f0e89=>{const _0xc1b39c=_0x858e20;return _0x264d6f[_0xc1b39c(0x1fb)]?.({'type':_0xc1b39c(0x1cc),'name':_0x2f0e89[_0xc1b39c(0x1d5)]}),await _0x2388da[_0xc1b39c(0x1ea)]['deleteSegment'](_0x2f0e89['id']),_0x264d6f[_0xc1b39c(0x1fb)]?.({'type':_0xc1b39c(0x1cd),'name':_0x2f0e89['name']}),_0x264d6f['logDeleted']?.(_0xc1b39c(0x291)+_0x2f0e89[_0xc1b39c(0x1d5)]+'\x27'),0x1;},_0x53ef0d);return _0xd163d5[_0x858e20(0x20e)]((_0x30a12e,_0x3be94c)=>_0x30a12e+_0x3be94c,0x0);}export async function executePushJourneys(_0x3c4613,_0x315ad6,_0x4272f6,_0x5f3140,_0x494c4e){const _0x3dcefb=a142_0x119b8a,{journeyDefToRequest:_0x36a792}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x189d7b,yamlRuleToApi:_0x10d7d7,validateSegmentRule:_0x220102}=await import(_0x3dcefb(0x1c3)),_0x1a9eb4={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1baa63=new Map(_0x4272f6[_0x3dcefb(0x1e3)]),_0x5840e6=0x5;for(let _0x381257=0x0;_0x381257<_0x315ad6[_0x3dcefb(0x207)];_0x381257+=_0x5840e6){const _0x44da6c=_0x315ad6[_0x3dcefb(0x25a)](_0x381257,_0x381257+_0x5840e6),_0x254f7c=await Promise[_0x3dcefb(0x231)](_0x44da6c[_0x3dcefb(0x2b1)](async _0x1ea8f1=>{const _0x4ecce9=_0x3dcefb;if(!_0x1ea8f1[_0x4ecce9(0x1c0)]&&!_0x1ea8f1[_0x4ecce9(0x295)])return{'action':_0x4ecce9(0x1e9),'name':_0x1ea8f1[_0x4ecce9(0x257)][_0x4ecce9(0x1d5)],'journeyId':_0x1ea8f1[_0x4ecce9(0x299)]?.['id']};const _0x2b2a1f=_0x1ea8f1[_0x4ecce9(0x1f9)]?_0x4272f6['folderPathToId'][_0x4ecce9(0x255)](_0x1ea8f1[_0x4ecce9(0x1f9)]):undefined;_0x494c4e[_0x4ecce9(0x1fb)]?.({'type':_0x1ea8f1['isNew']?_0x4ecce9(0x201):_0x4ecce9(0x298),'name':_0x1ea8f1[_0x4ecce9(0x257)][_0x4ecce9(0x1d5)]});try{const _0x440ff7=await executeSingleJourneyPush(_0x3c4613,_0x1ea8f1,{..._0x4272f6,'segmentNameToId':_0x1baa63},{'parentId':_0x5f3140['parentId'],'rootFolderId':_0x5f3140['rootFolderId'],'folderId':_0x2b2a1f,'verbose':_0x5f3140['verbose']},_0x494c4e,{'journeyDefToRequest':_0x36a792,'activationDefToCreateRequest':_0x189d7b,'yamlRuleToApi':_0x10d7d7,'validateSegmentRule':_0x220102});for(const [_0x1534e9,_0x27f226]of _0x440ff7[_0x4ecce9(0x1db)]){_0x1baa63[_0x4ecce9(0x1e5)](_0x1534e9,_0x27f226),_0x1a9eb4[_0x4ecce9(0x1db)][_0x4ecce9(0x1e5)](_0x1534e9,_0x27f226);}if(_0x440ff7[_0x4ecce9(0x29c)]==='created')_0x494c4e['onProgress']?.({'type':_0x4ecce9(0x1ca),'name':_0x1ea8f1[_0x4ecce9(0x257)]['name'],'journeyId':_0x440ff7[_0x4ecce9(0x276)]}),_0x494c4e[_0x4ecce9(0x296)]?.(_0x4ecce9(0x282)+_0x1ea8f1['yamlConfig'][_0x4ecce9(0x1d5)]+'\x27'),_0x1a9eb4[_0x4ecce9(0x1dd)]++;else _0x440ff7[_0x4ecce9(0x29c)]===_0x4ecce9(0x1f1)&&(_0x494c4e[_0x4ecce9(0x1fb)]?.({'type':_0x4ecce9(0x26f),'name':_0x1ea8f1[_0x4ecce9(0x257)][_0x4ecce9(0x1d5)]}),_0x494c4e[_0x4ecce9(0x296)]?.('Updated\x20journey\x20\x27'+_0x1ea8f1[_0x4ecce9(0x257)]['name']+'\x27'),_0x1a9eb4[_0x4ecce9(0x1f1)]++);return{'action':_0x440ff7[_0x4ecce9(0x29c)],'name':_0x1ea8f1['yamlConfig'][_0x4ecce9(0x1d5)],'journeyId':_0x440ff7[_0x4ecce9(0x276)]};}catch(_0x4a4781){const _0x38b3d0=isHttp400Error(_0x4a4781),_0x595417=_0x38b3d0?ErrorCode[_0x4ecce9(0x279)]:ErrorCode[_0x4ecce9(0x23e)],_0x71cfdb=getErrorMessage(_0x4a4781);throw new SDKError(_0x595417,_0x4ecce9(0x23c)+(_0x1ea8f1['isNew']?'create':_0x4ecce9(0x1ee))+_0x4ecce9(0x294)+_0x1ea8f1['absolutePath']+_0x4ecce9(0x225)+_0x71cfdb,_0x4a4781);}}));_0x1a9eb4[_0x3dcefb(0x1dc)][_0x3dcefb(0x23a)](..._0x254f7c);}return _0x1a9eb4;}async function matchExistingJourneySegments(_0x4964ba,_0x4ec620,_0x35b07e,_0x400e59,_0x53b91c){const _0x59c368=a142_0x119b8a;if(!_0x4ec620[_0x59c368(0x299)]||!_0x4ec620[_0x59c368(0x257)][_0x59c368(0x1f7)])return;const _0x741a47=new Map(),_0x3cf898=new Set();for(const _0xb5d5b8 of Object[_0x59c368(0x29a)](_0x4ec620[_0x59c368(0x257)]['segments'])){const _0x2b47a8=generateDeterministicJourneySegmentName(_0x4ec620['yamlConfig'][_0x59c368(0x1d5)],_0xb5d5b8);_0x741a47['set'](_0x2b47a8,_0xb5d5b8),_0x3cf898[_0x59c368(0x1e8)](_0xb5d5b8);}const _0x17895a=[],_0x1acf2a=collectSegmentIdsFromJourneyApi(_0x4ec620[_0x59c368(0x299)]);for(const _0x123be9 of _0x1acf2a){const _0x5494cf=await fetchSegment(_0x4964ba,_0x35b07e,_0x123be9,_0x400e59);if(!_0x5494cf?.[_0x59c368(0x1d5)])continue;const _0xfec926=_0x741a47[_0x59c368(0x255)](_0x5494cf[_0x59c368(0x1d5)]);_0xfec926?(_0x53b91c[_0x59c368(0x1e5)](_0xfec926,_0x123be9),_0x3cf898[_0x59c368(0x2bc)](_0xfec926)):_0x17895a['push']({'id':_0x123be9,'seg':_0x5494cf});}if(_0x3cf898['size']>0x0&&_0x17895a[_0x59c368(0x207)]>0x0){const {localExpandedRuleToNames:_0x1aec61}=buildLocalExpandedRuleMappings(_0x4ec620[_0x59c368(0x257)]),_0x7cea12=new Map();for(const {id:_0x598327,seg:_0x47d5b2}of _0x17895a){if(_0x47d5b2[_0x59c368(0x209)]){const _0x26f026=apiRuleToYaml(_0x47d5b2[_0x59c368(0x209)]);_0x7cea12[_0x59c368(0x1e5)](_0x598327,_0x26f026);}}for(const {id:_0x3ce84e,seg:_0x22f829}of _0x17895a){if(!_0x22f829[_0x59c368(0x209)])continue;const _0x55ab96=_0x7cea12[_0x59c368(0x255)](_0x3ce84e);if(!_0x55ab96)continue;const _0x2e86d7=serializeExpandedRule(_0x55ab96,_0x7cea12),_0x86749=_0x1aec61[_0x59c368(0x255)](_0x2e86d7);if(_0x86749){const _0x2b880d=_0x86749[_0x59c368(0x240)](_0xb51de3=>_0x3cf898[_0x59c368(0x215)](_0xb51de3));_0x2b880d&&(_0x53b91c[_0x59c368(0x1e5)](_0x2b880d,_0x3ce84e),_0x3cf898[_0x59c368(0x2bc)](_0x2b880d),logger[_0x59c368(0x245)]('Matched\x20server\x20segment\x20\x27'+_0x22f829[_0x59c368(0x1d5)]+'\x27\x20to\x20local\x20\x27'+_0x2b880d+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x3b4182,_0x1f2bd6,_0x41e2d8,_0x343f43,_0x1b02cd,_0x23b2d){const _0x146cb6=a142_0x119b8a,{journeyDefToRequest:_0x45aaa5,activationDefToCreateRequest:_0x2db6be,yamlRuleToApi:_0x29c873,validateSegmentRule:_0x24bdea}=_0x23b2d,_0xc0fa1f=new Map(),_0x5ac523=new Map();recoverSegmentIdsFromPushRecovery(_0x1f2bd6,_0xc0fa1f,_0x41e2d8[_0x146cb6(0x1e3)]);const _0x4d445b=new Map(),_0x4c61ad=new Map(),_0x56dfa2=new Map();let _0x27f7e7;const _0x2c61ad=async()=>{const _0x4a66e4=_0x146cb6;if(_0x27f7e7)return;_0x27f7e7=new Map();if(!_0x1f2bd6[_0x4a66e4(0x299)])return;const _0x4f5dd6=await _0x3b4182[_0x4a66e4(0x1fa)][_0x4a66e4(0x2bf)](_0x1f2bd6[_0x4a66e4(0x299)]['id']);for(const _0xff05ad of _0x4f5dd6){const _0x44fe68=journeyActivationStepToYaml(_0xff05ad,_0x41e2d8[_0x4a66e4(0x29b)],_0x41e2d8['connectionIdToNameMap']),_0x1ef10d=activationSignature(_0x44fe68);!_0x27f7e7[_0x4a66e4(0x215)](_0x1ef10d)&&_0x27f7e7['set'](_0x1ef10d,_0xff05ad['id']),_0x44fe68[_0x4a66e4(0x1d5)]&&_0x5ac523[_0x4a66e4(0x1e5)](_0x44fe68[_0x4a66e4(0x1d5)],_0xff05ad['id']);}};await matchExistingJourneySegments(_0x3b4182,_0x1f2bd6,_0x343f43[_0x146cb6(0x24a)],_0x41e2d8[_0x146cb6(0x281)],_0x41e2d8[_0x146cb6(0x1e3)]);const _0x592680={'resolveSegmentId':async _0x414312=>{const _0x8443f2=_0x146cb6,_0x2b26ea=_0x41e2d8[_0x8443f2(0x1e3)][_0x8443f2(0x255)](_0x414312);if(!_0x2b26ea)throw new SDKError(ErrorCode[_0x8443f2(0x1bc)],_0x8443f2(0x2b0)+_0x414312+'\x20(referenced\x20in\x20journey\x20'+_0x1f2bd6[_0x8443f2(0x257)][_0x8443f2(0x1d5)]+')');return _0x2b26ea;},'resolveEmbeddedSegmentId':async(_0xe09e62,_0x950ccd)=>{const _0x1e6ec9=_0x146cb6,_0x100f97=_0x41e2d8[_0x1e6ec9(0x1e3)][_0x1e6ec9(0x255)](_0xe09e62);if(_0x100f97)return _0x100f97;const _0x3ba189=_0x41e2d8[_0x1e6ec9(0x281)][_0x1e6ec9(0x240)](_0xb161d2=>_0xb161d2['name']===_0xe09e62);if(_0x3ba189)return _0x41e2d8[_0x1e6ec9(0x1e3)][_0x1e6ec9(0x1e5)](_0xe09e62,_0x3ba189['id']),_0x3ba189['id'];if(_0x1f2bd6[_0x1e6ec9(0x1c0)]){const {stageName:_0x2c3d10,criteriaName:_0x5955cf}=findSegmentCriteriaLocation(_0x1f2bd6[_0x1e6ec9(0x257)],_0xe09e62);return _0x24bdea(_0xe09e62,_0x950ccd[_0x1e6ec9(0x209)]),_0x4c61ad['set'](_0xe09e62,{'definition':_0x950ccd,'stageName':_0x2c3d10,'criteriaName':_0x5955cf}),createPendingSegmentId(_0xe09e62);}const _0x507b5f=_0x1f2bd6[_0x1e6ec9(0x299)]?.['id'];if(!_0x507b5f)throw new SDKError(ErrorCode['INTERNAL'],_0x1e6ec9(0x29f));const _0x3d762a=_0x4d445b[_0x1e6ec9(0x255)](_0xe09e62);if(_0x3d762a)return _0x3d762a;const _0x20839=((async()=>{const _0x59fa80=_0x1e6ec9;_0x24bdea(_0xe09e62,_0x950ccd[_0x59fa80(0x209)]);const _0x123b49=generateDeterministicJourneySegmentName(_0x1f2bd6['yamlConfig'][_0x59fa80(0x1d5)],_0xe09e62),_0x5f311b=_0x41e2d8[_0x59fa80(0x281)][_0x59fa80(0x240)](_0x2e1185=>_0x2e1185['name']===_0x123b49),_0x504f1a=createSegmentIdResolver(_0x41e2d8[_0x59fa80(0x1e3)],_0xe09e62),_0x31ac50=await resolveRuleSegmentIds(_0x950ccd[_0x59fa80(0x209)],_0x504f1a);let _0x47d279;return _0x5f311b?(await _0x3b4182[_0x59fa80(0x1ea)][_0x59fa80(0x25f)](_0x343f43[_0x59fa80(0x24a)],_0x5f311b['id'],{'description':_0x950ccd[_0x59fa80(0x243)]||_0x59fa80(0x2a5)+_0xe09e62,'rule':_0x29c873(_0x31ac50,!![]),'countPopulation':!![]}),_0x47d279=_0x5f311b['id'],saveSegmentToPushRecovery(_0x1f2bd6[_0x59fa80(0x1c1)],_0x1f2bd6['yamlConfig'][_0x59fa80(0x1d5)],_0xe09e62,{'segmentId':_0x47d279,'uniqueServerName':_0x123b49,'createdAt':new Date()[_0x59fa80(0x1ce)]()})):_0x47d279=await createOrRecoverEmbeddedSegment(_0x3b4182,_0x1f2bd6,{'localName':_0xe09e62,'uniqueSegmentName':_0x123b49,'description':_0x950ccd[_0x59fa80(0x243)]||'Entry\x20criteria:\x20'+_0xe09e62,'journeyId':_0x507b5f,'resolvedRule':_0x31ac50,'parentId':_0x343f43['parentId'],'folderId':_0x343f43[_0x59fa80(0x233)]||''},_0x29c873),_0x41e2d8[_0x59fa80(0x1e3)][_0x59fa80(0x1e5)](_0xe09e62,_0x47d279),_0xc0fa1f['set'](_0xe09e62,_0x47d279),_0x47d279;})());_0x4d445b[_0x1e6ec9(0x1e5)](_0xe09e62,_0x20839);try{return await _0x20839;}finally{_0x4d445b[_0x1e6ec9(0x2bc)](_0xe09e62);}},'resolveActivationId':async _0x1843b5=>{const _0x8dabfe=_0x146cb6,_0x46b3d9=_0x5ac523[_0x8dabfe(0x255)](_0x1843b5);if(_0x46b3d9)return _0x46b3d9;if(_0x1f2bd6['existingJourney']){await _0x2c61ad();const _0x3f5448=_0x5ac523[_0x8dabfe(0x255)](_0x1843b5);if(_0x3f5448)return _0x3f5448;}throw new SDKError(ErrorCode[_0x8dabfe(0x23b)],_0x8dabfe(0x1ff)+_0x1843b5+_0x8dabfe(0x22d)+_0x1f2bd6[_0x8dabfe(0x257)][_0x8dabfe(0x1d5)]+_0x8dabfe(0x221)+_0x8dabfe(0x21e));},'resolveEmbeddedActivationId':async(_0x143653,_0x3e1e78)=>{const _0x3e18a2=_0x146cb6,_0x3315fb=_0x5ac523[_0x3e18a2(0x255)](_0x143653);if(_0x3315fb)return _0x3315fb;if(_0x1f2bd6['isNew'])return _0x56dfa2[_0x3e18a2(0x1e5)](_0x143653,_0x3e1e78),createPendingActivationId(_0x143653);if(_0x1f2bd6[_0x3e18a2(0x299)]){await _0x2c61ad();const _0x519fc4=_0x5ac523[_0x3e18a2(0x255)](_0x3e1e78[_0x3e18a2(0x1d5)]);if(_0x519fc4)return _0x5ac523[_0x3e18a2(0x1e5)](_0x143653,_0x519fc4),_0x519fc4;const _0x2204be=activationSignature(_0x3e1e78),_0x54c550=_0x27f7e7?.['get'](_0x2204be);if(_0x54c550)return _0x5ac523[_0x3e18a2(0x1e5)](_0x143653,_0x54c550),_0x54c550;const _0x456c5e=await _0x2db6be(_0x3e1e78,_0x41e2d8[_0x3e18a2(0x203)]),_0x5a682e={..._0x456c5e,..._0x3e1e78[_0x3e18a2(0x230)]!==undefined&&{'runAfterJourneyRefresh':_0x3e1e78[_0x3e18a2(0x230)]}},_0x441fe0=await _0x3b4182[_0x3e18a2(0x1fa)]['createActivation'](_0x1f2bd6[_0x3e18a2(0x299)]['id'],_0x5a682e);return _0x5ac523[_0x3e18a2(0x1e5)](_0x143653,_0x441fe0['id']),_0x441fe0['id'];}throw new SDKError(ErrorCode[_0x3e18a2(0x1fe)],_0x3e18a2(0x24c));},'resolveJourneyId':async _0x4b49c2=>{const _0x5ab159=_0x146cb6;try{return await _0x3b4182[_0x5ab159(0x1fa)][_0x5ab159(0x1df)](_0x343f43['parentId'],_0x4b49c2);}catch(_0x5e2bce){throw new SDKError(ErrorCode['NOT_FOUND'],_0x5ab159(0x2a3)+_0x4b49c2+_0x5ab159(0x2a9)+_0x1f2bd6[_0x5ab159(0x257)][_0x5ab159(0x1d5)]+'\x27)',_0x5e2bce);}},'resolveStageId':async(_0x14a8fd,_0x45efba)=>{const _0x5105ed=_0x146cb6,_0x1a997c=await _0x3b4182[_0x5105ed(0x1fa)]['getJourney'](_0x14a8fd),_0x71107d=_0x1a997c[_0x5105ed(0x206)][_0x5105ed(0x223)][_0x5105ed(0x240)](_0x89cd1d=>_0x89cd1d[_0x5105ed(0x1d5)]['toLowerCase']()===_0x45efba[_0x5105ed(0x202)]());if(!_0x71107d?.['id'])throw new SDKError(ErrorCode[_0x5105ed(0x23b)],_0x5105ed(0x216)+_0x45efba+_0x5105ed(0x238)+(_0x1a997c[_0x5105ed(0x206)]['journeyBundleName']||_0x1a997c[_0x5105ed(0x206)][_0x5105ed(0x1d5)])+'\x27');return _0x71107d['id'];}},_0x2e77ad=await _0x45aaa5(_0x1f2bd6[_0x146cb6(0x257)],_0x343f43[_0x146cb6(0x24a)],_0x592680),_0x43b432=_0x343f43['folderId']||_0x343f43[_0x146cb6(0x233)];_0x43b432&&(_0x2e77ad[_0x146cb6(0x1cf)]={'parentFolder':{'data':{'id':_0x43b432,'type':_0x146cb6(0x25c)}}});if(_0x1f2bd6[_0x146cb6(0x1c0)]){if(_0x4c61ad['size']>0x0||_0x56dfa2[_0x146cb6(0x274)]>0x0)return await executeThreeStepJourneyCreate(_0x3b4182,_0x1f2bd6,_0x2e77ad,{'pendingEmbeddedSegments':_0x4c61ad,'pendingEmbeddedActivations':_0x56dfa2,'embeddedSegmentNameToId':_0xc0fa1f,'journeyActivationNameToId':_0x5ac523},{..._0x343f43,'effectiveFolderId':_0x43b432},_0x41e2d8,_0x1b02cd,_0x23b2d);else{ensureJourneyDefaults(_0x2e77ad['attributes']);const _0x53212d=await _0x3b4182['journey'][_0x146cb6(0x1cb)](_0x2e77ad);return deletePushRecovery(_0x1f2bd6['absolutePath']),{'action':_0x146cb6(0x1dd),'journeyId':_0x53212d['id'],'embeddedSegmentNameToId':_0xc0fa1f};}}else{if(_0x1f2bd6[_0x146cb6(0x295)]&&_0x1f2bd6[_0x146cb6(0x299)]){_0x2e77ad['id']=_0x1f2bd6['existingJourney']['id'];const _0xf4275b=_0x2e77ad[_0x146cb6(0x206)];_0x1f2bd6[_0x146cb6(0x299)]['attributes']?.['journeyBundleName']&&(_0xf4275b['journeyBundleName']=_0x1f2bd6[_0x146cb6(0x299)]['attributes'][_0x146cb6(0x297)]);const _0x11bffb=_0x1f2bd6[_0x146cb6(0x299)]['attributes']?.[_0x146cb6(0x223)];return _0x11bffb&&_0x2e77ad[_0x146cb6(0x206)]['journeyStages']&&injectExistingStageIds(_0x2e77ad[_0x146cb6(0x206)][_0x146cb6(0x223)],_0x11bffb),ensureJourneyDefaults(_0xf4275b),await _0x3b4182[_0x146cb6(0x1fa)]['update'](_0x1f2bd6[_0x146cb6(0x299)]['id'],_0x2e77ad),deletePushRecovery(_0x1f2bd6['absolutePath']),{'action':_0x146cb6(0x1f1),'journeyId':_0x1f2bd6[_0x146cb6(0x299)]['id'],'embeddedSegmentNameToId':_0xc0fa1f};}}return deletePushRecovery(_0x1f2bd6[_0x146cb6(0x1c1)]),{'action':_0x146cb6(0x1e9),'journeyId':_0x1f2bd6[_0x146cb6(0x299)]?.['id'],'embeddedSegmentNameToId':_0xc0fa1f};}function findSegmentCriteriaLocation(_0x296073,_0x28a46e){const _0x26e7c3=a142_0x119b8a,_0x969d13=_0x296073[_0x26e7c3(0x2ac)]||_0x296073[_0x26e7c3(0x1f8)]?.[0x0]?.[_0x26e7c3(0x2ac)]||[];let _0xbc334d=_0x26e7c3(0x27e),_0x119cb6=_0x28a46e;const _0x4874aa=_0x296073['goal']||_0x296073['journeys']?.[0x0]?.['goal'];if(_0x4874aa?.[_0x26e7c3(0x1ea)]===_0x28a46e)return{'stageName':_0x26e7c3(0x1f5),'criteriaName':_0x4874aa['name']||_0x28a46e};_0x32e0ce:for(const _0x1f2b31 of _0x969d13){if(_0x1f2b31['entry_criteria']?.[_0x26e7c3(0x1ea)]===_0x28a46e){_0xbc334d=_0x1f2b31['name'],_0x119cb6=_0x1f2b31[_0x26e7c3(0x239)]['name']||_0x28a46e;break;}if(_0x1f2b31[_0x26e7c3(0x254)])for(const _0x17b853 of _0x1f2b31[_0x26e7c3(0x254)]){if(_0x17b853[_0x26e7c3(0x1e7)]===_0x26e7c3(0x2b9)&&_0x17b853['with']?.[_0x26e7c3(0x2af)])for(const _0xe4b7af of _0x17b853[_0x26e7c3(0x22f)][_0x26e7c3(0x2af)]){if(_0xe4b7af[_0x26e7c3(0x1ea)]===_0x28a46e){_0xbc334d=_0x1f2b31[_0x26e7c3(0x1d5)],_0x119cb6=_0xe4b7af[_0x26e7c3(0x1d5)]||_0x28a46e;break _0x32e0ce;}}}}return{'stageName':_0xbc334d,'criteriaName':_0x119cb6};}function a142_0x3007(_0xc1ae4e,_0x4ae4e5){_0xc1ae4e=_0xc1ae4e-0x1b9;const _0x2b21b0=a142_0x2b21();let _0x3007db=_0x2b21b0[_0xc1ae4e];return _0x3007db;}async function executeThreeStepJourneyCreate(_0x7becea,_0xb2f641,_0x1b2369,_0x5418c9,_0x3b894d,_0x2f0b84,_0x5465be,_0xf11fee){const _0x13b9d4=a142_0x119b8a,{activationDefToCreateRequest:_0x4450c0,yamlRuleToApi:_0x23df70}=_0xf11fee,{pendingEmbeddedSegments:_0x181fed,pendingEmbeddedActivations:_0x2931eb,embeddedSegmentNameToId:_0x10049c}=_0x5418c9,_0xfa2585=JSON[_0x13b9d4(0x2ab)](JSON['stringify'](_0x1b2369));ensureJourneyDefaults(_0xfa2585['attributes']),stripPendingIds(_0xfa2585);const _0x1178cd=await _0x7becea[_0x13b9d4(0x1fa)]['create'](_0xfa2585),_0x2929e3=_0x1178cd['id'],_0x621450=new Map();for(const _0x5c5aed of _0x1178cd[_0x13b9d4(0x206)]['journeyStages']){_0x621450[_0x13b9d4(0x1e5)](_0x5c5aed[_0x13b9d4(0x1d5)][_0x13b9d4(0x202)](),_0x5c5aed['id']);}recoverSegmentIdsFromPushRecovery(_0xb2f641,_0x10049c,_0x2f0b84[_0x13b9d4(0x1e3)]);for(const [_0xcb288c,{definition:_0x4dd65b}]of _0x181fed){if(_0x10049c[_0x13b9d4(0x215)](_0xcb288c)){_0x5465be[_0x13b9d4(0x1fb)]?.({'type':_0x13b9d4(0x252),'journeyName':_0xb2f641['yamlConfig'][_0x13b9d4(0x1d5)],'segmentName':_0xcb288c});continue;}const _0x5f1637=generateDeterministicJourneySegmentName(_0xb2f641[_0x13b9d4(0x257)][_0x13b9d4(0x1d5)],_0xcb288c);_0x5465be[_0x13b9d4(0x1fb)]?.({'type':_0x13b9d4(0x262),'journeyName':_0xb2f641[_0x13b9d4(0x257)][_0x13b9d4(0x1d5)],'segmentName':_0xcb288c});const _0x4007f0=createSegmentIdResolver(_0x2f0b84[_0x13b9d4(0x1e3)],_0xcb288c),_0x3927cc=await resolveRuleSegmentIds(_0x4dd65b[_0x13b9d4(0x209)],_0x4007f0),_0x424b97=await createOrRecoverEmbeddedSegment(_0x7becea,_0xb2f641,{'localName':_0xcb288c,'uniqueSegmentName':_0x5f1637,'description':_0x4dd65b[_0x13b9d4(0x243)]||_0x13b9d4(0x2a5)+_0xcb288c,'journeyId':_0x2929e3,'resolvedRule':_0x3927cc,'parentId':_0x3b894d[_0x13b9d4(0x24a)],'folderId':_0x3b894d[_0x13b9d4(0x208)]||''},_0x23df70);_0x10049c[_0x13b9d4(0x1e5)](_0xcb288c,_0x424b97),_0x2f0b84[_0x13b9d4(0x1e3)][_0x13b9d4(0x1e5)](_0xcb288c,_0x424b97),_0x5465be[_0x13b9d4(0x1fb)]?.({'type':_0x13b9d4(0x252),'journeyName':_0xb2f641[_0x13b9d4(0x257)]['name'],'segmentName':_0xcb288c});}const _0x109914=new Map();for(const [_0x138c18,_0x1f1b65]of _0x2931eb){_0x5465be['onProgress']?.({'type':_0x13b9d4(0x1d3),'journeyName':_0xb2f641[_0x13b9d4(0x257)][_0x13b9d4(0x1d5)],'activationName':_0x138c18});const _0x262068=await _0x4450c0(_0x1f1b65,_0x2f0b84['activationContext']),_0x3cc25a={..._0x262068,..._0x1f1b65[_0x13b9d4(0x230)]!==undefined&&{'runAfterJourneyRefresh':_0x1f1b65[_0x13b9d4(0x230)]}},_0x1b971e=await _0x7becea[_0x13b9d4(0x1fa)]['createActivation'](_0x2929e3,_0x3cc25a);_0x109914[_0x13b9d4(0x1e5)](_0x138c18,_0x1b971e['id']),_0x5418c9['journeyActivationNameToId'][_0x13b9d4(0x1e5)](_0x138c18,_0x1b971e['id']),_0x5465be[_0x13b9d4(0x1fb)]?.({'type':_0x13b9d4(0x1d8),'journeyName':_0xb2f641[_0x13b9d4(0x257)][_0x13b9d4(0x1d5)],'activationName':_0x138c18});}const _0x942075=JSON[_0x13b9d4(0x2ab)](JSON[_0x13b9d4(0x2a6)](_0x1b2369));return _0x942075['id']=_0x2929e3,ensureJourneyDefaults(_0x942075[_0x13b9d4(0x206)]),resolvePendingIdsInRequest(_0x942075,_0x1b2369,_0x621450,_0x10049c,_0x109914,_0x5465be),await _0x7becea[_0x13b9d4(0x1fa)][_0x13b9d4(0x1ee)](_0x2929e3,_0x942075),deletePushRecovery(_0xb2f641['absolutePath']),{'action':_0x13b9d4(0x1dd),'journeyId':_0x2929e3,'embeddedSegmentNameToId':_0x10049c};}export function stripWaitStepPendingIds(_0x3e7830){const _0x4cd8fd=a142_0x119b8a,_0x12bd6c=_0x3e7830[_0x4cd8fd(0x26b)]&&isPendingSegmentId(_0x3e7830[_0x4cd8fd(0x26b)]),_0xa17fb2=_0x3e7830[_0x4cd8fd(0x2b3)]?.[_0x4cd8fd(0x217)](_0x4cb3aa=>_0x4cb3aa[_0x4cd8fd(0x278)]&&isPendingSegmentId(_0x4cb3aa[_0x4cd8fd(0x278)]));(_0x12bd6c||_0xa17fb2)&&(_0x3e7830[_0x4cd8fd(0x224)]=_0x4cd8fd(0x2a1),_0x3e7830[_0x4cd8fd(0x200)]=0x1,_0x3e7830[_0x4cd8fd(0x24d)]=_0x4cd8fd(0x24f),delete _0x3e7830['conditionSegmentId'],delete _0x3e7830[_0x4cd8fd(0x2b5)],delete _0x3e7830[_0x4cd8fd(0x289)],delete _0x3e7830[_0x4cd8fd(0x2b3)]);}export function resolveWaitStepPendingIds(_0x6a11bf,_0x1e8431,_0x57b0e9,_0x109e8){const _0x3f1145=a142_0x119b8a;if(_0x1e8431[_0x3f1145(0x26b)]&&isPendingSegmentId(_0x1e8431['conditionSegmentId'])){const _0x360176=_0x57b0e9(_0x1e8431[_0x3f1145(0x26b)],_0x3f1145(0x2bb)+_0x109e8+_0x3f1145(0x23f));_0x360176&&(_0x6a11bf['waitStepType']='Condition',_0x6a11bf[_0x3f1145(0x26b)]=_0x360176,delete _0x6a11bf[_0x3f1145(0x200)],delete _0x6a11bf[_0x3f1145(0x24d)],_0x1e8431[_0x3f1145(0x2b5)]!==undefined&&(_0x6a11bf[_0x3f1145(0x2b5)]=_0x1e8431[_0x3f1145(0x2b5)]),_0x1e8431[_0x3f1145(0x289)]&&(_0x6a11bf[_0x3f1145(0x289)]=_0x1e8431[_0x3f1145(0x289)]));}if(_0x1e8431['conditions']){const _0x571b89=_0x1e8431[_0x3f1145(0x2b3)]['some'](_0x33b6fb=>_0x33b6fb[_0x3f1145(0x278)]&&isPendingSegmentId(_0x33b6fb[_0x3f1145(0x278)]));if(_0x571b89){const _0x2ac240=_0x1e8431[_0x3f1145(0x2b3)][_0x3f1145(0x2b1)](_0x5928a9=>{const _0x162c37=_0x3f1145;if(_0x5928a9[_0x162c37(0x278)]&&isPendingSegmentId(_0x5928a9[_0x162c37(0x278)])){const _0x57f2f8=_0x57b0e9(_0x5928a9[_0x162c37(0x278)],_0x162c37(0x2bb)+_0x109e8+'\x27\x20wait\x20condition');return{..._0x5928a9,'segmentId':_0x57f2f8||_0x5928a9['segmentId']};}return{..._0x5928a9};});_0x6a11bf[_0x3f1145(0x224)]='Condition',_0x6a11bf[_0x3f1145(0x2b3)]=_0x2ac240,delete _0x6a11bf[_0x3f1145(0x200)],delete _0x6a11bf[_0x3f1145(0x24d)],delete _0x6a11bf[_0x3f1145(0x26b)],delete _0x6a11bf[_0x3f1145(0x2b5)],delete _0x6a11bf[_0x3f1145(0x289)];}}}function stripPendingIds(_0xefc5f){const _0x5f4d6d=a142_0x119b8a;_0xefc5f[_0x5f4d6d(0x206)][_0x5f4d6d(0x1f5)]?.[_0x5f4d6d(0x278)]&&isPendingSegmentId(_0xefc5f[_0x5f4d6d(0x206)][_0x5f4d6d(0x1f5)][_0x5f4d6d(0x278)])&&delete _0xefc5f[_0x5f4d6d(0x206)]['goal'];for(const _0x357150 of _0xefc5f[_0x5f4d6d(0x206)]['journeyStages']||[]){_0x357150['entryCriteria']?.[_0x5f4d6d(0x278)]&&isPendingSegmentId(_0x357150[_0x5f4d6d(0x26a)][_0x5f4d6d(0x278)])&&delete _0x357150[_0x5f4d6d(0x26a)];_0x357150[_0x5f4d6d(0x237)]?.[_0x5f4d6d(0x278)]&&isPendingSegmentId(_0x357150[_0x5f4d6d(0x237)][_0x5f4d6d(0x278)])&&delete _0x357150['milestone'];_0x357150[_0x5f4d6d(0x256)]&&(_0x357150['exitCriterias']=_0x357150[_0x5f4d6d(0x256)][_0x5f4d6d(0x2be)](_0xb2b311=>!_0xb2b311['segmentId']||!isPendingSegmentId(_0xb2b311[_0x5f4d6d(0x278)])));if(_0x357150[_0x5f4d6d(0x254)])for(const _0x447dcf of Object[_0x5f4d6d(0x29a)](_0x357150[_0x5f4d6d(0x254)])){const _0x3554a9=_0x357150[_0x5f4d6d(0x254)][_0x447dcf];_0x3554a9[_0x5f4d6d(0x1e7)]===_0x5f4d6d(0x247)&&_0x3554a9[_0x5f4d6d(0x1bb)]&&isPendingActivationId(_0x3554a9['journeyActivationStepId'])&&(_0x3554a9['journeyActivationStepId']='');if(_0x3554a9[_0x5f4d6d(0x1e7)]==='DecisionPoint'&&_0x3554a9[_0x5f4d6d(0x2af)])for(const _0x8009df of _0x3554a9[_0x5f4d6d(0x2af)]){_0x8009df[_0x5f4d6d(0x278)]&&isPendingSegmentId(_0x8009df[_0x5f4d6d(0x278)])&&(_0x8009df[_0x5f4d6d(0x278)]='');}_0x3554a9['type']===_0x5f4d6d(0x22e)&&stripWaitStepPendingIds(_0x3554a9);}}}function resolvePendingIdsInRequest(_0x3d57c8,_0x208f0b,_0x2e0519,_0x46ec09,_0x415230,_0x5dd185){const _0x5b9f90=a142_0x119b8a,_0x2cd91d=(_0x3a7edf,_0x93874)=>{const _0x39c5ba=a142_0x3007;if(!isPendingSegmentId(_0x3a7edf))return _0x3a7edf;const _0x4a5a0c=extractPendingSegmentName(_0x3a7edf),_0x870831=_0x46ec09[_0x39c5ba(0x255)](_0x4a5a0c);return!_0x870831&&_0x5dd185[_0x39c5ba(0x246)]?.(_0x39c5ba(0x286)+_0x4a5a0c+_0x39c5ba(0x1bd)+_0x93874),_0x870831;};if(_0x3d57c8[_0x5b9f90(0x206)][_0x5b9f90(0x1f5)]?.[_0x5b9f90(0x278)]&&isPendingSegmentId(_0x3d57c8[_0x5b9f90(0x206)][_0x5b9f90(0x1f5)]['segmentId'])){const _0x4dbb66=_0x2cd91d(_0x3d57c8['attributes'][_0x5b9f90(0x1f5)]['segmentId'],_0x5b9f90(0x1eb));_0x4dbb66&&(_0x3d57c8[_0x5b9f90(0x206)][_0x5b9f90(0x1f5)][_0x5b9f90(0x278)]=_0x4dbb66);}for(const _0x7d2e7f of _0x3d57c8['attributes'][_0x5b9f90(0x223)]||[]){const _0x1acea4=_0x2e0519[_0x5b9f90(0x255)](_0x7d2e7f['name']['toLowerCase']());_0x1acea4&&(_0x7d2e7f['id']=_0x1acea4);if(_0x7d2e7f['entryCriteria']?.[_0x5b9f90(0x278)]&&isPendingSegmentId(_0x7d2e7f[_0x5b9f90(0x26a)][_0x5b9f90(0x278)])){const _0xf57f36=_0x2cd91d(_0x7d2e7f[_0x5b9f90(0x26a)][_0x5b9f90(0x278)],_0x5b9f90(0x2bb)+_0x7d2e7f[_0x5b9f90(0x1d5)]+_0x5b9f90(0x1e6));_0xf57f36&&(_0x7d2e7f['entryCriteria'][_0x5b9f90(0x278)]=_0xf57f36);}if(_0x7d2e7f[_0x5b9f90(0x256)])for(const _0x8a8650 of _0x7d2e7f[_0x5b9f90(0x256)]){if(_0x8a8650['segmentId']&&isPendingSegmentId(_0x8a8650['segmentId'])){const _0x3945d4=_0x2cd91d(_0x8a8650[_0x5b9f90(0x278)],_0x5b9f90(0x2bb)+_0x7d2e7f[_0x5b9f90(0x1d5)]+'\x27\x20exit\x20criteria');_0x3945d4&&(_0x8a8650[_0x5b9f90(0x278)]=_0x3945d4);}}if(_0x7d2e7f[_0x5b9f90(0x237)]?.[_0x5b9f90(0x278)]&&isPendingSegmentId(_0x7d2e7f['milestone'][_0x5b9f90(0x278)])){const _0x4d30e8=_0x2cd91d(_0x7d2e7f['milestone']['segmentId'],'stage\x20\x27'+_0x7d2e7f[_0x5b9f90(0x1d5)]+_0x5b9f90(0x250));_0x4d30e8&&(_0x7d2e7f[_0x5b9f90(0x237)][_0x5b9f90(0x278)]=_0x4d30e8);}if(_0x7d2e7f['steps']){const _0x242301=_0x59983b=>_0x208f0b[_0x5b9f90(0x206)][_0x5b9f90(0x223)]?.[_0x5b9f90(0x240)](_0x5434dd=>_0x5434dd['name'][_0x5b9f90(0x202)]()===_0x7d2e7f[_0x5b9f90(0x1d5)][_0x5b9f90(0x202)]())?.[_0x5b9f90(0x254)]?.[_0x59983b];for(const _0x4c1c48 of Object[_0x5b9f90(0x29a)](_0x7d2e7f[_0x5b9f90(0x254)])){const _0x1fe375=_0x7d2e7f['steps'][_0x4c1c48],_0x2ae32b=_0x242301(_0x4c1c48);if(_0x1fe375[_0x5b9f90(0x1e7)]===_0x5b9f90(0x247)&&_0x1fe375[_0x5b9f90(0x1bb)]&&(isPendingActivationId(_0x1fe375[_0x5b9f90(0x1bb)])||_0x1fe375[_0x5b9f90(0x1bb)]==='')){if(_0x2ae32b?.[_0x5b9f90(0x1bb)]&&isPendingActivationId(_0x2ae32b[_0x5b9f90(0x1bb)])){const _0x25b470=extractPendingActivationName(_0x2ae32b[_0x5b9f90(0x1bb)]),_0x31f601=_0x415230[_0x5b9f90(0x255)](_0x25b470);_0x31f601&&(_0x1fe375['journeyActivationStepId']=_0x31f601);}}if(_0x1fe375['type']===_0x5b9f90(0x261)&&_0x1fe375[_0x5b9f90(0x2af)]&&_0x2ae32b?.[_0x5b9f90(0x2af)])for(let _0x3ae288=0x0;_0x3ae288<_0x1fe375[_0x5b9f90(0x2af)][_0x5b9f90(0x207)];_0x3ae288++){const _0x5a6576=_0x1fe375[_0x5b9f90(0x2af)][_0x3ae288],_0x22ce1a=_0x2ae32b[_0x5b9f90(0x2af)][_0x3ae288];if(_0x22ce1a?.['segmentId']&&isPendingSegmentId(_0x22ce1a[_0x5b9f90(0x278)])){const _0x4c9f86=_0x2cd91d(_0x22ce1a[_0x5b9f90(0x278)],'stage\x20\x27'+_0x7d2e7f[_0x5b9f90(0x1d5)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x5a6576[_0x5b9f90(0x1d5)]||_0x3ae288)+'\x27');_0x4c9f86&&(_0x5a6576[_0x5b9f90(0x278)]=_0x4c9f86);}}_0x1fe375[_0x5b9f90(0x1e7)]===_0x5b9f90(0x22e)&&_0x2ae32b?.[_0x5b9f90(0x1e7)]===_0x5b9f90(0x22e)&&resolveWaitStepPendingIds(_0x1fe375,_0x2ae32b,_0x2cd91d,_0x7d2e7f['name']);}}}}
@@ -1 +1 @@
1
- (function(_0x2e74ec,_0xb16a95){const _0xaf2aa3=a143_0x38c9,_0x2ed477=_0x2e74ec();while(!![]){try{const _0x53a104=parseInt(_0xaf2aa3(0x77))/0x1+-parseInt(_0xaf2aa3(0x76))/0x2+-parseInt(_0xaf2aa3(0x74))/0x3+-parseInt(_0xaf2aa3(0x78))/0x4*(-parseInt(_0xaf2aa3(0x75))/0x5)+-parseInt(_0xaf2aa3(0x70))/0x6+-parseInt(_0xaf2aa3(0x73))/0x7+parseInt(_0xaf2aa3(0x6f))/0x8;if(_0x53a104===_0xb16a95)break;else _0x2ed477['push'](_0x2ed477['shift']());}catch(_0x245cf0){_0x2ed477['push'](_0x2ed477['shift']());}}}(a143_0x3cc9,0xd0307));export function buildFolderIdToPathMap(_0x1d1d36){const _0x1a2ad8=a143_0x38c9,_0x3663a7=new Map(),_0x153330=new Map();for(const _0xffb815 of _0x1d1d36){_0x153330[_0x1a2ad8(0x72)](_0xffb815['id'],_0xffb815);}const _0x219fdc=new Set();for(const _0x4158ed of _0x1d1d36){!_0x4158ed[_0x1a2ad8(0x71)]&&_0x219fdc[_0x1a2ad8(0x7a)](_0x4158ed['id']);}function _0x4aad0a(_0x5c6a85){const _0x41a532=_0x1a2ad8;if(_0x3663a7[_0x41a532(0x7b)](_0x5c6a85['id']))return _0x3663a7[_0x41a532(0x79)](_0x5c6a85['id']);if(_0x219fdc[_0x41a532(0x7b)](_0x5c6a85['id']))return _0x3663a7['set'](_0x5c6a85['id'],''),'';if(_0x5c6a85[_0x41a532(0x71)]){const _0x220b82=_0x153330[_0x41a532(0x79)](_0x5c6a85['parentFolderId']);if(_0x220b82){const _0x2a09ae=_0x4aad0a(_0x220b82),_0xb7c6d1=_0x2a09ae?_0x2a09ae+'/'+_0x5c6a85[_0x41a532(0x7c)]:_0x5c6a85[_0x41a532(0x7c)];return _0x3663a7[_0x41a532(0x72)](_0x5c6a85['id'],_0xb7c6d1),_0xb7c6d1;}}const _0x37f07a=_0x5c6a85[_0x41a532(0x7c)];return _0x3663a7[_0x41a532(0x72)](_0x5c6a85['id'],_0x37f07a),_0x37f07a;}for(const _0x13f14d of _0x1d1d36){_0x4aad0a(_0x13f14d);}return _0x3663a7;}export function buildFolderPathToIdMap(_0x152027){const _0x17678c=a143_0x38c9,_0x555e81=new Map(),_0x5aa9c8=new Map();for(const _0x2358a0 of _0x152027){_0x5aa9c8['set'](_0x2358a0['id'],_0x2358a0);}const _0xda0411=new Set();for(const _0x2ea97b of _0x152027){!_0x2ea97b[_0x17678c(0x71)]&&_0xda0411[_0x17678c(0x7a)](_0x2ea97b['id']);}function _0x2746d6(_0x4bf5ef){const _0x174274=_0x17678c;if(_0xda0411[_0x174274(0x7b)](_0x4bf5ef['id']))return'';if(_0x4bf5ef[_0x174274(0x71)]){const _0x4f3203=_0x5aa9c8[_0x174274(0x79)](_0x4bf5ef[_0x174274(0x71)]);if(_0x4f3203){const _0x34145a=_0x2746d6(_0x4f3203);return _0x34145a?_0x34145a+'/'+_0x4bf5ef[_0x174274(0x7c)]:_0x4bf5ef[_0x174274(0x7c)];}}return _0x4bf5ef[_0x174274(0x7c)];}for(const _0x1814b3 of _0x152027){const _0x3b7852=_0x2746d6(_0x1814b3);_0x555e81['set'](_0x3b7852,_0x1814b3['id']);}return _0x555e81;}function a143_0x38c9(_0x1c52e7,_0xcd695a){_0x1c52e7=_0x1c52e7-0x6f;const _0x3cc9fb=a143_0x3cc9();let _0x38c942=_0x3cc9fb[_0x1c52e7];return _0x38c942;}function a143_0x3cc9(){const _0xdea5=['15465968ErpPPA','5034726TWOUJH','parentFolderId','set','8414658fcZfYt','3391455DeAAij','5MYgEtT','1373330jYbjNl','1169180ADxDYL','6434728spiJSB','get','add','has','name'];a143_0x3cc9=function(){return _0xdea5;};return a143_0x3cc9();}export function buildFolderMaps(_0x2ffc1e){const _0x37946b=a143_0x38c9,_0x49cc53=buildFolderIdToPathMap(_0x2ffc1e),_0x467e58=new Map();for(const [_0x2ac615,_0x436c8]of _0x49cc53){_0x467e58[_0x37946b(0x72)](_0x436c8,_0x2ac615);}return{'idToPath':_0x49cc53,'pathToId':_0x467e58};}export function getFolderPath(_0x3e19fa,_0x3678a4){const _0x12c2f0=a143_0x38c9;if(!_0x3e19fa)return'';return _0x3678a4[_0x12c2f0(0x79)](_0x3e19fa)??'';}
1
+ (function(_0x1db703,_0xc5973){const _0x2c5519=a143_0x27ea,_0x2dd321=_0x1db703();while(!![]){try{const _0x4f3ace=parseInt(_0x2c5519(0x1e7))/0x1+parseInt(_0x2c5519(0x1eb))/0x2+parseInt(_0x2c5519(0x1f0))/0x3*(parseInt(_0x2c5519(0x1ee))/0x4)+-parseInt(_0x2c5519(0x1e5))/0x5+-parseInt(_0x2c5519(0x1f2))/0x6*(-parseInt(_0x2c5519(0x1f4))/0x7)+-parseInt(_0x2c5519(0x1ea))/0x8*(-parseInt(_0x2c5519(0x1ec))/0x9)+-parseInt(_0x2c5519(0x1e9))/0xa*(parseInt(_0x2c5519(0x1f1))/0xb);if(_0x4f3ace===_0xc5973)break;else _0x2dd321['push'](_0x2dd321['shift']());}catch(_0x972687){_0x2dd321['push'](_0x2dd321['shift']());}}}(a143_0x5851,0x9c1c3));function a143_0x27ea(_0x523f84,_0x1c6452){_0x523f84=_0x523f84-0x1e4;const _0x585159=a143_0x5851();let _0x27ea3c=_0x585159[_0x523f84];return _0x27ea3c;}export function buildFolderIdToPathMap(_0x199edf){const _0x256e66=a143_0x27ea,_0x1a20e7=new Map(),_0x249bc9=new Map();for(const _0x20bcec of _0x199edf){_0x249bc9['set'](_0x20bcec['id'],_0x20bcec);}const _0x2ea369=new Set();for(const _0x24534a of _0x199edf){!_0x24534a[_0x256e66(0x1e8)]&&_0x2ea369[_0x256e66(0x1e4)](_0x24534a['id']);}function _0x1d919d(_0x31c96d){const _0x140825=_0x256e66;if(_0x1a20e7[_0x140825(0x1f3)](_0x31c96d['id']))return _0x1a20e7[_0x140825(0x1ef)](_0x31c96d['id']);if(_0x2ea369[_0x140825(0x1f3)](_0x31c96d['id']))return _0x1a20e7[_0x140825(0x1e6)](_0x31c96d['id'],''),'';if(_0x31c96d[_0x140825(0x1e8)]){const _0x4ce514=_0x249bc9[_0x140825(0x1ef)](_0x31c96d[_0x140825(0x1e8)]);if(_0x4ce514){const _0x27181c=_0x1d919d(_0x4ce514),_0x57a20d=_0x27181c?_0x27181c+'/'+_0x31c96d['name']:_0x31c96d['name'];return _0x1a20e7[_0x140825(0x1e6)](_0x31c96d['id'],_0x57a20d),_0x57a20d;}}const _0x3e079b=_0x31c96d[_0x140825(0x1ed)];return _0x1a20e7['set'](_0x31c96d['id'],_0x3e079b),_0x3e079b;}for(const _0x1f5a6a of _0x199edf){_0x1d919d(_0x1f5a6a);}return _0x1a20e7;}function a143_0x5851(){const _0x38085f=['2407160DKnvnw','add','20570bjkurk','set','487854EsKdZI','parentFolderId','5490vhzSDn','161488aPOMZe','2132394gtKvAy','54vBTKQv','name','472tsxTtB','get','6618GXQLvY','39666BKJTnW','12Ruyvhm','has'];a143_0x5851=function(){return _0x38085f;};return a143_0x5851();}export function buildFolderPathToIdMap(_0x2790aa){const _0x1522d8=a143_0x27ea,_0x2657b8=new Map(),_0x400455=new Map();for(const _0x257ab8 of _0x2790aa){_0x400455[_0x1522d8(0x1e6)](_0x257ab8['id'],_0x257ab8);}const _0x58f0a8=new Set();for(const _0xc212ad of _0x2790aa){!_0xc212ad[_0x1522d8(0x1e8)]&&_0x58f0a8[_0x1522d8(0x1e4)](_0xc212ad['id']);}function _0x81d772(_0x195d97){const _0x1f41ff=_0x1522d8;if(_0x58f0a8[_0x1f41ff(0x1f3)](_0x195d97['id']))return'';if(_0x195d97[_0x1f41ff(0x1e8)]){const _0xd3ae2d=_0x400455['get'](_0x195d97[_0x1f41ff(0x1e8)]);if(_0xd3ae2d){const _0x39b9cc=_0x81d772(_0xd3ae2d);return _0x39b9cc?_0x39b9cc+'/'+_0x195d97[_0x1f41ff(0x1ed)]:_0x195d97['name'];}}return _0x195d97[_0x1f41ff(0x1ed)];}for(const _0x1b01a2 of _0x2790aa){const _0x8bd74=_0x81d772(_0x1b01a2);_0x2657b8[_0x1522d8(0x1e6)](_0x8bd74,_0x1b01a2['id']);}return _0x2657b8;}export function buildFolderMaps(_0x4c1953){const _0x3b4cf6=a143_0x27ea,_0x1b86ea=buildFolderIdToPathMap(_0x4c1953),_0x19c569=new Map();for(const [_0x830ec,_0x597256]of _0x1b86ea){_0x19c569[_0x3b4cf6(0x1e6)](_0x597256,_0x830ec);}return{'idToPath':_0x1b86ea,'pathToId':_0x19c569};}export function getFolderPath(_0x513b1f,_0x1152ad){if(!_0x513b1f)return'';return _0x1152ad['get'](_0x513b1f)??'';}
@@ -1 +1 @@
1
- (function(_0x43f3d0,_0x491b2f){const _0x49fac0=a144_0x4ed7,_0x425535=_0x43f3d0();while(!![]){try{const _0x577006=parseInt(_0x49fac0(0x1bf))/0x1+-parseInt(_0x49fac0(0x1b9))/0x2+parseInt(_0x49fac0(0x1d7))/0x3*(parseInt(_0x49fac0(0x1d0))/0x4)+-parseInt(_0x49fac0(0x1c6))/0x5*(-parseInt(_0x49fac0(0x1b4))/0x6)+-parseInt(_0x49fac0(0x1cb))/0x7*(-parseInt(_0x49fac0(0x1cf))/0x8)+parseInt(_0x49fac0(0x1d9))/0x9+-parseInt(_0x49fac0(0x1b1))/0xa;if(_0x577006===_0x491b2f)break;else _0x425535['push'](_0x425535['shift']());}catch(_0x541f2f){_0x425535['push'](_0x425535['shift']());}}}(a144_0x399a,0x9e4d7));import a144_0x4a6314 from'path';import{parse as a144_0x35ad14}from'yaml';function a144_0x399a(){const _0x483b4a=['startsWith','8288838QHIGsg','replace','tdx.json','pop','Cannot\x20navigate\x20above\x20root','29658510umVZNP','relative','trim','3984xZPoGy','filter','join','.yaml','type','162986HpaQjb','Path\x20cannot\x20be\x20empty','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Path\x20segment\x20cannot\x20be\x20empty','readFile','297066ympGYR','exists','File\x20not\x20found:\x20','split','endsWith','isAbsolute','push','5135XJjIni','test','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','name','parse','2233KjIngM','journey','raw','dirname','18376WwoGXb','16KeaWEz','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','resolve','slice','length','segments','No\x20tdx.json\x20found\x20for\x20file:\x20','797274WoQQWL'];a144_0x399a=function(){return _0x483b4a;};return a144_0x399a();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0xb7b523){const _0x39d5c4=a144_0x4ed7;if(!_0xb7b523||_0xb7b523[_0x39d5c4(0x1b3)]()==='')throw new Error(_0x39d5c4(0x1ba));const _0x48f004=_0xb7b523[_0x39d5c4(0x1b3)]();if(_0x48f004==='/')return{'segments':[],'isAbsolute':!![],'raw':_0xb7b523};const _0x4d941b=_0x48f004[_0x39d5c4(0x1d8)]('/')?_0x48f004['substring'](0x1):_0x48f004,_0x4551cd=_0x4d941b[_0x39d5c4(0x1c2)]('/')[_0x39d5c4(0x1b5)](_0x2ee852=>_0x2ee852!=='');if(_0x4551cd[_0x39d5c4(0x1d4)]===0x0)throw new Error(_0x39d5c4(0x1bc));const _0x562d43=_0x48f004[_0x39d5c4(0x1d8)]('/')||!isRelativePathSegment(_0x4551cd[0x0]);for(const _0x4ea946 of _0x4551cd){validatePathSegment(_0x4ea946);}return{'segments':_0x4551cd,'isAbsolute':_0x562d43,'raw':_0xb7b523};}function isRelativePathSegment(_0x130ac6){return _0x130ac6==='.'||_0x130ac6==='..';}function validatePathSegment(_0x1f8f8b){const _0x2dac0f=a144_0x4ed7;if(_0x1f8f8b==='')throw new Error(_0x2dac0f(0x1bd));if(_0x1f8f8b==='.'||_0x1f8f8b==='..')return;if(/[\x00-\x1F\x7F]/[_0x2dac0f(0x1c7)](_0x1f8f8b))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x1f8f8b);if(_0x1f8f8b!==_0x1f8f8b[_0x2dac0f(0x1b3)]()){}}export function validatePath(_0x35d429){const _0x1c8d40=a144_0x4ed7;if(_0x35d429[_0x1c8d40(0x1d5)][_0x1c8d40(0x1d4)]===0x0&&!_0x35d429[_0x1c8d40(0x1c4)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x35d429[_0x1c8d40(0x1c4)]){if(_0x35d429['segments'][0x0]==='..')throw new Error(_0x1c8d40(0x1d1));let _0x355b79=0x0;for(const _0x4d3298 of _0x35d429[_0x1c8d40(0x1d5)]){if(_0x4d3298==='..'){if(_0x355b79===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x355b79--;}else _0x4d3298!=='.'&&_0x355b79++;}}}export function joinPaths(_0x55d0c4,_0xa25b41){const _0x52a659=a144_0x4ed7;if(!_0x55d0c4||_0x55d0c4==='/')return _0xa25b41;if(!_0xa25b41||_0xa25b41==='.')return _0x55d0c4;if(_0xa25b41[_0x52a659(0x1d8)]('/'))return _0xa25b41;const _0x18a818=parsePath(_0x55d0c4),_0x7e1f21=parsePath(_0xa25b41),_0x4e65bc=[..._0x18a818[_0x52a659(0x1d5)]];for(const _0x552650 of _0x7e1f21[_0x52a659(0x1d5)]){if(_0x552650==='.')continue;else{if(_0x552650==='..'){if(_0x4e65bc[_0x52a659(0x1d4)]===0x0)throw new Error(_0x52a659(0x1b0));_0x4e65bc[_0x52a659(0x1dc)]();}else _0x4e65bc['push'](_0x552650);}}const _0x45b8f3=_0x4e65bc['join']('/');return _0x18a818[_0x52a659(0x1cd)][_0x52a659(0x1d8)]('/')?'/'+_0x45b8f3:_0x45b8f3;}export function normalizePath(_0x5ca4cd){const _0x38b7ff=a144_0x4ed7,_0x4530c2=parsePath(_0x5ca4cd),_0x4e43dd=[];for(const _0x4466a0 of _0x4530c2[_0x38b7ff(0x1d5)]){if(_0x4466a0==='.')continue;else{if(_0x4466a0==='..'){if(_0x4e43dd[_0x38b7ff(0x1d4)]===0x0){if(_0x4530c2[_0x38b7ff(0x1c4)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x4e43dd[_0x38b7ff(0x1c5)]('..');}else _0x4e43dd[_0x4e43dd[_0x38b7ff(0x1d4)]-0x1]==='..'?_0x4e43dd[_0x38b7ff(0x1c5)]('..'):_0x4e43dd[_0x38b7ff(0x1dc)]();}else _0x4e43dd[_0x38b7ff(0x1c5)](_0x4466a0);}}if(_0x4e43dd[_0x38b7ff(0x1d4)]===0x0)return _0x4530c2['isAbsolute']?'/':'.';const _0x4df2ec=_0x4e43dd[_0x38b7ff(0x1b6)]('/');return _0x4530c2['raw'][_0x38b7ff(0x1d8)]('/')?'/'+_0x4df2ec:_0x4df2ec;}export function getParentPath(_0x381427){const _0x47bc3d=a144_0x4ed7,_0x3f847b=parsePath(_0x381427);if(_0x3f847b[_0x47bc3d(0x1d5)][_0x47bc3d(0x1d4)]<=0x1)return'/';const _0x5b66b3=_0x3f847b[_0x47bc3d(0x1d5)]['slice'](0x0,-0x1)[_0x47bc3d(0x1b6)]('/');return _0x3f847b[_0x47bc3d(0x1cd)][_0x47bc3d(0x1d8)]('/')?'/'+_0x5b66b3:_0x5b66b3;}export function getBaseName(_0x1c74de){const _0x390e65=a144_0x4ed7,_0xf77be0=parsePath(_0x1c74de);return _0xf77be0['segments'][_0xf77be0[_0x390e65(0x1d5)]['length']-0x1]||'';}export function isChildPath(_0x16c0c6,_0x307f06){const _0x14166d=a144_0x4ed7,_0x3173ab=parsePath(_0x16c0c6),_0x10aeb7=parsePath(_0x307f06);if(_0x3173ab['segments'][_0x14166d(0x1d4)]<=_0x10aeb7[_0x14166d(0x1d5)][_0x14166d(0x1d4)])return![];for(let _0x299746=0x0;_0x299746<_0x10aeb7[_0x14166d(0x1d5)][_0x14166d(0x1d4)];_0x299746++){if(_0x3173ab[_0x14166d(0x1d5)][_0x299746]!==_0x10aeb7['segments'][_0x299746])return![];}return!![];}export function splitPath(_0x574f30){const _0x4c0696=a144_0x4ed7,_0x29f69e=parsePath(_0x574f30);if(_0x29f69e['segments'][_0x4c0696(0x1d4)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x29f69e[_0x4c0696(0x1d5)]['length']===0x1)return{'parent':_0x29f69e[_0x4c0696(0x1d5)][0x0]};return{'parent':_0x29f69e[_0x4c0696(0x1d5)][0x0],'child':_0x29f69e[_0x4c0696(0x1d5)][_0x4c0696(0x1d3)](0x1)['join']('/')};}export function isYamlFilePath(_0x268a45){const _0x243efb=a144_0x4ed7;return _0x268a45[_0x243efb(0x1c3)]('.yml')||_0x268a45['endsWith'](_0x243efb(0x1b7));}function a144_0x4ed7(_0x3765e9,_0x2a71fb){_0x3765e9=_0x3765e9-0x1b0;const _0x399aa8=a144_0x399a();let _0x4ed797=_0x399aa8[_0x3765e9];return _0x4ed797;}export async function resolveYamlFilePath(_0x4d4d75,_0x2fd534=nodeFileSystem){const _0x196d7f=a144_0x4ed7,_0x5391a1=a144_0x4a6314[_0x196d7f(0x1d2)](_0x4d4d75);if(!await _0x2fd534[_0x196d7f(0x1c0)](_0x5391a1))throw new Error(_0x196d7f(0x1c1)+_0x4d4d75);let _0xd7269c=a144_0x4a6314['dirname'](_0x5391a1),_0x2398df=null,_0x50d3e3=null;const _0x15ecb7=a144_0x4a6314['parse'](_0xd7269c)['root'];while(_0xd7269c!==_0x15ecb7){const _0x380d20=a144_0x4a6314[_0x196d7f(0x1b6)](_0xd7269c,_0x196d7f(0x1db));if(await _0x2fd534['exists'](_0x380d20)){_0x2398df=_0x380d20,_0x50d3e3=_0xd7269c;break;}_0xd7269c=a144_0x4a6314[_0x196d7f(0x1ce)](_0xd7269c);}if(!_0x2398df||!_0x50d3e3)throw new Error(_0x196d7f(0x1d6)+_0x4d4d75+'\x0a'+_0x196d7f(0x1c8));const _0x53547b=await _0x2fd534['readFile'](_0x2398df),_0x2ea48d=JSON[_0x196d7f(0x1ca)](_0x53547b),_0x31151f=_0x2ea48d['parent_segment'];if(!_0x31151f)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x2eda11=await _0x2fd534[_0x196d7f(0x1be)](_0x5391a1),_0x5e8754=a144_0x35ad14(_0x2eda11),_0x578bdc=_0x5e8754[_0x196d7f(0x1c9)];if(!_0x578bdc)throw new Error(_0x196d7f(0x1bb)+_0x4d4d75);const _0x5050d7=_0x5e8754[_0x196d7f(0x1b8)]===_0x196d7f(0x1cc)?'journey':'segment',_0x49eb98=a144_0x4a6314[_0x196d7f(0x1b2)](_0x50d3e3,_0x5391a1),_0x35760e=a144_0x4a6314['dirname'](_0x49eb98),_0x15b10f=_0x35760e==='.'?'':_0x35760e[_0x196d7f(0x1da)](/\\/g,'/'),_0x473427=_0x15b10f?_0x31151f+'/'+_0x15b10f+'/'+_0x578bdc:_0x31151f+'/'+_0x578bdc;return{'parentSegment':_0x31151f,'segmentName':_0x578bdc,'folderPath':_0x15b10f,'fullPath':_0x473427,'resourceType':_0x5050d7,'content':_0x2eda11};}
1
+ (function(_0x5d3dea,_0x34d4f6){const _0x2c5e3d=a144_0x4823,_0x4e3839=_0x5d3dea();while(!![]){try{const _0x1f0bfd=parseInt(_0x2c5e3d(0x185))/0x1*(-parseInt(_0x2c5e3d(0x180))/0x2)+parseInt(_0x2c5e3d(0x170))/0x3*(parseInt(_0x2c5e3d(0x16f))/0x4)+parseInt(_0x2c5e3d(0x17e))/0x5*(-parseInt(_0x2c5e3d(0x17f))/0x6)+-parseInt(_0x2c5e3d(0x162))/0x7+parseInt(_0x2c5e3d(0x167))/0x8*(-parseInt(_0x2c5e3d(0x15f))/0x9)+-parseInt(_0x2c5e3d(0x181))/0xa*(-parseInt(_0x2c5e3d(0x166))/0xb)+parseInt(_0x2c5e3d(0x184))/0xc;if(_0x1f0bfd===_0x34d4f6)break;else _0x4e3839['push'](_0x4e3839['shift']());}catch(_0x421704){_0x4e3839['push'](_0x4e3839['shift']());}}}(a144_0x32fd,0x96ec4));function a144_0x32fd(){const _0x3e4acd=['Relative\x20path\x20cannot\x20be\x20empty','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','No\x20tdx.json\x20found\x20for\x20file:\x20','readFile','endsWith','pop','8WPjasL','1182849XdAvCy','relative','slice','name','replace','tdx.json','Cannot\x20split\x20empty\x20path','parse','journey','trim','isAbsolute','root','substring','push','95330FnwHQH','114MfOFEa','16VLuWVK','20wpuNAi','startsWith','Path\x20cannot\x20be\x20empty','1935468HPCQja','10987ZmqLmr','length','join','dirname','filter','Cannot\x20navigate\x20above\x20root','Path\x20attempts\x20to\x20navigate\x20above\x20root','raw','test','4043961ZWSjLB','Path\x20segment\x20cannot\x20be\x20empty','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','480235exBtAE','segments','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','5971559ohetUi','16WQGMIC','exists'];a144_0x32fd=function(){return _0x3e4acd;};return a144_0x32fd();}import a144_0x5c21e7 from'path';import{parse as a144_0x253e61}from'yaml';function a144_0x4823(_0x3ea31b,_0x11581e){_0x3ea31b=_0x3ea31b-0x15c;const _0x32fdca=a144_0x32fd();let _0x482317=_0x32fdca[_0x3ea31b];return _0x482317;}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x2669ce){const _0x2bc0f5=a144_0x4823;if(!_0x2669ce||_0x2669ce[_0x2bc0f5(0x179)]()==='')throw new Error(_0x2bc0f5(0x183));const _0x1c3e52=_0x2669ce[_0x2bc0f5(0x179)]();if(_0x1c3e52==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x2669ce};const _0x3f4f77=_0x1c3e52['startsWith']('/')?_0x1c3e52[_0x2bc0f5(0x17c)](0x1):_0x1c3e52,_0x112f23=_0x3f4f77['split']('/')[_0x2bc0f5(0x189)](_0x2f83e9=>_0x2f83e9!=='');if(_0x112f23[_0x2bc0f5(0x186)]===0x0)throw new Error(_0x2bc0f5(0x16a));const _0x1f71a2=_0x1c3e52[_0x2bc0f5(0x182)]('/')||!isRelativePathSegment(_0x112f23[0x0]);for(const _0x406282 of _0x112f23){validatePathSegment(_0x406282);}return{'segments':_0x112f23,'isAbsolute':_0x1f71a2,'raw':_0x2669ce};}function isRelativePathSegment(_0x7a0e30){return _0x7a0e30==='.'||_0x7a0e30==='..';}function validatePathSegment(_0x2727d7){const _0x3ece6f=a144_0x4823;if(_0x2727d7==='')throw new Error(_0x3ece6f(0x160));if(_0x2727d7==='.'||_0x2727d7==='..')return;if(/[\x00-\x1F\x7F]/[_0x3ece6f(0x15e)](_0x2727d7))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x2727d7);if(_0x2727d7!==_0x2727d7[_0x3ece6f(0x179)]()){}}export function validatePath(_0x3503b4){const _0x21924d=a144_0x4823;if(_0x3503b4[_0x21924d(0x163)][_0x21924d(0x186)]===0x0&&!_0x3503b4[_0x21924d(0x17a)])throw new Error(_0x21924d(0x169));if(_0x3503b4[_0x21924d(0x17a)]){if(_0x3503b4[_0x21924d(0x163)][0x0]==='..')throw new Error(_0x21924d(0x165));let _0x25e914=0x0;for(const _0x1fbf6f of _0x3503b4[_0x21924d(0x163)]){if(_0x1fbf6f==='..'){if(_0x25e914===0x0)throw new Error(_0x21924d(0x15c));_0x25e914--;}else _0x1fbf6f!=='.'&&_0x25e914++;}}}export function joinPaths(_0x5cf140,_0x268567){const _0xff585f=a144_0x4823;if(!_0x5cf140||_0x5cf140==='/')return _0x268567;if(!_0x268567||_0x268567==='.')return _0x5cf140;if(_0x268567['startsWith']('/'))return _0x268567;const _0x5a0ce3=parsePath(_0x5cf140),_0x11f62b=parsePath(_0x268567),_0x55b377=[..._0x5a0ce3[_0xff585f(0x163)]];for(const _0x18433d of _0x11f62b[_0xff585f(0x163)]){if(_0x18433d==='.')continue;else{if(_0x18433d==='..'){if(_0x55b377[_0xff585f(0x186)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x55b377[_0xff585f(0x16e)]();}else _0x55b377[_0xff585f(0x17d)](_0x18433d);}}const _0x820ce2=_0x55b377['join']('/');return _0x5a0ce3[_0xff585f(0x15d)][_0xff585f(0x182)]('/')?'/'+_0x820ce2:_0x820ce2;}export function normalizePath(_0x4ad3ab){const _0x2c4b89=a144_0x4823,_0x2fc83=parsePath(_0x4ad3ab),_0x2433be=[];for(const _0x4f8072 of _0x2fc83[_0x2c4b89(0x163)]){if(_0x4f8072==='.')continue;else{if(_0x4f8072==='..'){if(_0x2433be[_0x2c4b89(0x186)]===0x0){if(_0x2fc83[_0x2c4b89(0x17a)])throw new Error(_0x2c4b89(0x18a));_0x2433be[_0x2c4b89(0x17d)]('..');}else _0x2433be[_0x2433be[_0x2c4b89(0x186)]-0x1]==='..'?_0x2433be['push']('..'):_0x2433be['pop']();}else _0x2433be[_0x2c4b89(0x17d)](_0x4f8072);}}if(_0x2433be[_0x2c4b89(0x186)]===0x0)return _0x2fc83[_0x2c4b89(0x17a)]?'/':'.';const _0x5ea252=_0x2433be[_0x2c4b89(0x187)]('/');return _0x2fc83[_0x2c4b89(0x15d)][_0x2c4b89(0x182)]('/')?'/'+_0x5ea252:_0x5ea252;}export function getParentPath(_0x22cc4a){const _0x2146d2=a144_0x4823,_0x4bad07=parsePath(_0x22cc4a);if(_0x4bad07[_0x2146d2(0x163)][_0x2146d2(0x186)]<=0x1)return'/';const _0x42b7ba=_0x4bad07[_0x2146d2(0x163)][_0x2146d2(0x172)](0x0,-0x1)['join']('/');return _0x4bad07[_0x2146d2(0x15d)]['startsWith']('/')?'/'+_0x42b7ba:_0x42b7ba;}export function getBaseName(_0x46cde8){const _0x1cd383=a144_0x4823,_0x3267f3=parsePath(_0x46cde8);return _0x3267f3[_0x1cd383(0x163)][_0x3267f3[_0x1cd383(0x163)][_0x1cd383(0x186)]-0x1]||'';}export function isChildPath(_0x55cdd7,_0x478f5a){const _0x1018f0=a144_0x4823,_0x25237b=parsePath(_0x55cdd7),_0x7bc13d=parsePath(_0x478f5a);if(_0x25237b[_0x1018f0(0x163)]['length']<=_0x7bc13d[_0x1018f0(0x163)]['length'])return![];for(let _0x5e1ea8=0x0;_0x5e1ea8<_0x7bc13d[_0x1018f0(0x163)]['length'];_0x5e1ea8++){if(_0x25237b['segments'][_0x5e1ea8]!==_0x7bc13d['segments'][_0x5e1ea8])return![];}return!![];}export function splitPath(_0x267e40){const _0x2fbeaf=a144_0x4823,_0x547b17=parsePath(_0x267e40);if(_0x547b17[_0x2fbeaf(0x163)][_0x2fbeaf(0x186)]===0x0)throw new Error(_0x2fbeaf(0x176));if(_0x547b17[_0x2fbeaf(0x163)][_0x2fbeaf(0x186)]===0x1)return{'parent':_0x547b17[_0x2fbeaf(0x163)][0x0]};return{'parent':_0x547b17[_0x2fbeaf(0x163)][0x0],'child':_0x547b17[_0x2fbeaf(0x163)][_0x2fbeaf(0x172)](0x1)[_0x2fbeaf(0x187)]('/')};}export function isYamlFilePath(_0x2d6d32){const _0x3bbc2f=a144_0x4823;return _0x2d6d32[_0x3bbc2f(0x16d)]('.yml')||_0x2d6d32['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x3b027a,_0x1ae8fa=nodeFileSystem){const _0x31e1a9=a144_0x4823,_0x5ff14=a144_0x5c21e7['resolve'](_0x3b027a);if(!await _0x1ae8fa[_0x31e1a9(0x168)](_0x5ff14))throw new Error('File\x20not\x20found:\x20'+_0x3b027a);let _0x3fb070=a144_0x5c21e7['dirname'](_0x5ff14),_0x2df538=null,_0x5135ff=null;const _0x36d473=a144_0x5c21e7[_0x31e1a9(0x177)](_0x3fb070)[_0x31e1a9(0x17b)];while(_0x3fb070!==_0x36d473){const _0x4e7d75=a144_0x5c21e7['join'](_0x3fb070,_0x31e1a9(0x175));if(await _0x1ae8fa[_0x31e1a9(0x168)](_0x4e7d75)){_0x2df538=_0x4e7d75,_0x5135ff=_0x3fb070;break;}_0x3fb070=a144_0x5c21e7[_0x31e1a9(0x188)](_0x3fb070);}if(!_0x2df538||!_0x5135ff)throw new Error(_0x31e1a9(0x16b)+_0x3b027a+'\x0a'+_0x31e1a9(0x161));const _0x23b640=await _0x1ae8fa[_0x31e1a9(0x16c)](_0x2df538),_0x4bfd80=JSON[_0x31e1a9(0x177)](_0x23b640),_0x46a5c8=_0x4bfd80['parent_segment'];if(!_0x46a5c8)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x18f7ff=await _0x1ae8fa[_0x31e1a9(0x16c)](_0x5ff14),_0x3aae7c=a144_0x253e61(_0x18f7ff),_0x45bb4d=_0x3aae7c[_0x31e1a9(0x173)];if(!_0x45bb4d)throw new Error(_0x31e1a9(0x164)+_0x3b027a);const _0x247dc7=_0x3aae7c['type']===_0x31e1a9(0x178)?_0x31e1a9(0x178):'segment',_0x4cec79=a144_0x5c21e7[_0x31e1a9(0x171)](_0x5135ff,_0x5ff14),_0x11d55b=a144_0x5c21e7['dirname'](_0x4cec79),_0x3dec45=_0x11d55b==='.'?'':_0x11d55b[_0x31e1a9(0x174)](/\\/g,'/'),_0x375cfb=_0x3dec45?_0x46a5c8+'/'+_0x3dec45+'/'+_0x45bb4d:_0x46a5c8+'/'+_0x45bb4d;return{'parentSegment':_0x46a5c8,'segmentName':_0x45bb4d,'folderPath':_0x3dec45,'fullPath':_0x375cfb,'resourceType':_0x247dc7,'content':_0x18f7ff};}
@@ -1 +1 @@
1
- (function(_0x5b414b,_0x4eff51){const _0x262af9=a145_0x1306,_0x2940bd=_0x5b414b();while(!![]){try{const _0x1fbc84=parseInt(_0x262af9(0x93))/0x1+-parseInt(_0x262af9(0x9a))/0x2+parseInt(_0x262af9(0x9d))/0x3+parseInt(_0x262af9(0x96))/0x4+-parseInt(_0x262af9(0x98))/0x5*(parseInt(_0x262af9(0x92))/0x6)+parseInt(_0x262af9(0x9b))/0x7+parseInt(_0x262af9(0x99))/0x8*(parseInt(_0x262af9(0x94))/0x9);if(_0x1fbc84===_0x4eff51)break;else _0x2940bd['push'](_0x2940bd['shift']());}catch(_0x511622){_0x2940bd['push'](_0x2940bd['shift']());}}}(a145_0x376e,0xe3f5e));export function parseSegmentRef(_0x8d3302){const _0x2b4e00=a145_0x1306,_0x4c01aa=_0x8d3302['indexOf']('/');if(_0x4c01aa===-0x1)return{'parentId':_0x8d3302};if(_0x4c01aa===0x0)throw new Error(_0x2b4e00(0x9e)+_0x8d3302+_0x2b4e00(0x9c));const _0x200c74=_0x8d3302[_0x2b4e00(0x95)](0x0,_0x4c01aa),_0x3533d7=_0x8d3302['substring'](_0x4c01aa+0x1);if(_0x3533d7==='')throw new Error(_0x2b4e00(0x9e)+_0x8d3302+_0x2b4e00(0x97));return{'parentId':_0x200c74,'childId':_0x3533d7};}function a145_0x1306(_0x10f9f4,_0x5ef74f){_0x10f9f4=_0x10f9f4-0x92;const _0x376e82=a145_0x376e();let _0x13062c=_0x376e82[_0x10f9f4];return _0x13062c;}function a145_0x376e(){const _0x1e4819=['825879fFqDdt','Invalid\x20segment\x20reference\x20format:\x20','2537274BrKXEc','189850vxHave','9djYgFf','substring','2062792NzmdGe','.\x20Child\x20name\x20cannot\x20be\x20empty','20qRORBN','9402968ATOSKF','805612JeZztW','6102852pEkQAY','.\x20Parent\x20name\x20cannot\x20be\x20empty'];a145_0x376e=function(){return _0x1e4819;};return a145_0x376e();}
1
+ (function(_0x197ac3,_0x3508af){const _0x506d20=a145_0x218b,_0x37001d=_0x197ac3();while(!![]){try{const _0x521957=-parseInt(_0x506d20(0x15b))/0x1*(-parseInt(_0x506d20(0x15a))/0x2)+parseInt(_0x506d20(0x166))/0x3*(parseInt(_0x506d20(0x161))/0x4)+-parseInt(_0x506d20(0x160))/0x5+parseInt(_0x506d20(0x159))/0x6*(-parseInt(_0x506d20(0x15d))/0x7)+-parseInt(_0x506d20(0x163))/0x8+-parseInt(_0x506d20(0x15e))/0x9+parseInt(_0x506d20(0x15f))/0xa;if(_0x521957===_0x3508af)break;else _0x37001d['push'](_0x37001d['shift']());}catch(_0x4d8ca3){_0x37001d['push'](_0x37001d['shift']());}}}(a145_0x13c0,0x6fe7b));export function parseSegmentRef(_0x1df5df){const _0x13fc11=a145_0x218b,_0x32af75=_0x1df5df[_0x13fc11(0x162)]('/');if(_0x32af75===-0x1)return{'parentId':_0x1df5df};if(_0x32af75===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1df5df+_0x13fc11(0x165));const _0x1c2527=_0x1df5df[_0x13fc11(0x164)](0x0,_0x32af75),_0x335017=_0x1df5df['substring'](_0x32af75+0x1);if(_0x335017==='')throw new Error(_0x13fc11(0x15c)+_0x1df5df+_0x13fc11(0x167));return{'parentId':_0x1c2527,'childId':_0x335017};}function a145_0x218b(_0x27482a,_0x584940){_0x27482a=_0x27482a-0x159;const _0x13c007=a145_0x13c0();let _0x218be0=_0x13c007[_0x27482a];return _0x218be0;}function a145_0x13c0(){const _0x43bba1=['substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','3138SDQxQY','.\x20Child\x20name\x20cannot\x20be\x20empty','138buajdI','14OnMqaZ','90053DwOAha','Invalid\x20segment\x20reference\x20format:\x20','139951eqBFIm','8165898ytOqky','6120230TkQXMC','13810eEUQtt','3464gUgoeW','indexOf','2559552nOBfxN'];a145_0x13c0=function(){return _0x43bba1;};return a145_0x13c0();}