@treasuredata/tdx 0.29.2 → 0.29.3

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 (187) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/upgrade-command.js +1 -1
  47. package/dist/commands/use-command.js +1 -1
  48. package/dist/commands/user-command.js +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/command-output.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/constants.js +1 -1
  55. package/dist/core/credential-cache.js +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/keychain.js +1 -1
  58. package/dist/core/profile.js +1 -1
  59. package/dist/core/project-config.js +1 -1
  60. package/dist/core/session.js +1 -1
  61. package/dist/core/user-cache.js +1 -1
  62. package/dist/core/version.js +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/mcp/server.js +1 -1
  65. package/dist/mcp/tools/index.js +1 -1
  66. package/dist/mcp/tools/tdx-run.js +1 -1
  67. package/dist/mcp/tools/tdx-search.js +1 -1
  68. package/dist/mcp/utils.js +1 -1
  69. package/dist/proxy/claude-usage-tracker.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/sse-usage-parser.js +1 -1
  72. package/dist/sdk/agent/agent-config.js +1 -1
  73. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  74. package/dist/sdk/agent/agent-yaml.js +1 -1
  75. package/dist/sdk/agent/test/evaluator.js +1 -1
  76. package/dist/sdk/agent/test/executor.js +1 -1
  77. package/dist/sdk/agent/test/index.js +1 -1
  78. package/dist/sdk/agent/test/output.js +1 -1
  79. package/dist/sdk/agent/test/parser.js +1 -1
  80. package/dist/sdk/agent/tool-target-registry.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/client/cdp-api-client.js +1 -1
  83. package/dist/sdk/client/delivery-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/delivery.js +1 -1
  95. package/dist/sdk/engage/campaign-pull.js +1 -1
  96. package/dist/sdk/engage/campaign-push.js +1 -1
  97. package/dist/sdk/engage/campaign-validator.js +1 -1
  98. package/dist/sdk/engage/campaign-yaml.js +1 -1
  99. package/dist/sdk/engage/types/campaign-def.js +1 -1
  100. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  101. package/dist/sdk/engage.js +1 -1
  102. package/dist/sdk/errors.js +1 -1
  103. package/dist/sdk/index.js +1 -1
  104. package/dist/sdk/io/index.js +1 -1
  105. package/dist/sdk/io/node-filesystem.js +1 -1
  106. package/dist/sdk/job.js +1 -1
  107. package/dist/sdk/journey.js +1 -1
  108. package/dist/sdk/llm/chat-cache.js +1 -1
  109. package/dist/sdk/llm/index.js +1 -1
  110. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  111. package/dist/sdk/llm/model-factors.js +1 -1
  112. package/dist/sdk/personalization.js +1 -1
  113. package/dist/sdk/query/index.js +1 -1
  114. package/dist/sdk/query/sql-parser.js +1 -1
  115. package/dist/sdk/realtime.js +1 -1
  116. package/dist/sdk/schedule.js +1 -1
  117. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/fields-display.js +1 -1
  119. package/dist/sdk/segment/file-discovery.js +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-validator.js +1 -1
  122. package/dist/sdk/segment/journey-yaml.js +1 -1
  123. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  124. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  125. package/dist/sdk/segment/pull-workflow.js +1 -1
  126. package/dist/sdk/segment/push-recovery.js +1 -1
  127. package/dist/sdk/segment/push-workflow.js +1 -1
  128. package/dist/sdk/segment/resolution-context.js +1 -1
  129. package/dist/sdk/segment/segment-path-parser.js +1 -1
  130. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  131. package/dist/sdk/segment/segment-validator.js +1 -1
  132. package/dist/sdk/segment/target-resolution.js +1 -1
  133. package/dist/sdk/segment/tdx-config.js +1 -1
  134. package/dist/sdk/segment/types/activation-schema.js +1 -1
  135. package/dist/sdk/segment/types/journey-def.js +1 -1
  136. package/dist/sdk/segment/types/journey-schema.js +1 -1
  137. package/dist/sdk/segment/types/segment-def.js +1 -1
  138. package/dist/sdk/segment/types/segment-schema.js +1 -1
  139. package/dist/sdk/segment/validate-files.js +1 -1
  140. package/dist/sdk/segment/yaml-validator.js +1 -1
  141. package/dist/sdk/segment.js +1 -1
  142. package/dist/sdk/types/index.js +1 -1
  143. package/dist/sdk/types/progress.js +1 -1
  144. package/dist/sdk/user.js +1 -1
  145. package/dist/sdk/util/format-detector.js +1 -1
  146. package/dist/sdk/util/formatters.js +1 -1
  147. package/dist/sdk/util/index.js +1 -1
  148. package/dist/sdk/util/tree-formatter.js +1 -1
  149. package/dist/sdk/workflow/archive-validation.js +1 -1
  150. package/dist/sdk/workflow/clone-workflow.js +1 -1
  151. package/dist/sdk/workflow/index.js +1 -1
  152. package/dist/sdk/workflow/pull-workflow.js +1 -1
  153. package/dist/sdk/workflow/push-workflow.js +1 -1
  154. package/dist/sdk/workflow/tdx-config.js +1 -1
  155. package/dist/sdk/workflow/workflow-utils.js +1 -1
  156. package/dist/test-utils/command-runner.js +1 -1
  157. package/dist/test-utils/factories.js +1 -1
  158. package/dist/test-utils/fixtures.js +1 -1
  159. package/dist/test-utils/http-mock.js +1 -1
  160. package/dist/test-utils/index.js +1 -1
  161. package/dist/utils/async.js +1 -1
  162. package/dist/utils/colors.js +1 -1
  163. package/dist/utils/diff.js +1 -1
  164. package/dist/utils/file-permissions.js +1 -1
  165. package/dist/utils/file-reader.js +1 -1
  166. package/dist/utils/global-cache.js +1 -1
  167. package/dist/utils/json-loader.js +1 -1
  168. package/dist/utils/local-cache.js +1 -1
  169. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  170. package/dist/utils/logger/formatters/index.js +1 -1
  171. package/dist/utils/logger/handlers/console-handler.js +1 -1
  172. package/dist/utils/logger/handlers/file-handler.js +1 -1
  173. package/dist/utils/logger/handlers/index.js +1 -1
  174. package/dist/utils/logger/handlers/null-handler.js +1 -1
  175. package/dist/utils/logger/index.js +1 -1
  176. package/dist/utils/logger/logger.js +1 -1
  177. package/dist/utils/logger/types.js +1 -1
  178. package/dist/utils/option-validation.js +1 -1
  179. package/dist/utils/process.js +1 -1
  180. package/dist/utils/prompt.js +1 -1
  181. package/dist/utils/spinner.js +1 -1
  182. package/dist/utils/sse-parser.js +1 -1
  183. package/dist/utils/string-utils.js +1 -1
  184. package/dist/utils/table-ref-parser.js +1 -1
  185. package/dist/utils/tdx-logger.js +1 -1
  186. package/dist/utils/version-check.js +1 -1
  187. package/package.json +1 -1
@@ -1 +1 @@
1
- function a127_0x2cad(){const _0x3e305d=['Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','utf-8','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','tdx.sdk.push-recovery','4636330ASIGUo','ENOENT','parse','code','string','27906IdrraE','toISOString','journeyName','join','.push-recovery.json','2VGzXpU','stringify','6892902mYVMxr','245085AOMftp','.tmp','13604261ZtpMyS','228XIOhqH','warn','69385KeuBwE','24FvMpdQ','8ettUlI','1278000RzYKDH','debug','973mOJjRd'];a127_0x2cad=function(){return _0x3e305d;};return a127_0x2cad();}const a127_0x374619=a127_0x51f6;(function(_0x3edaf3,_0x237508){const _0xe1264d=a127_0x51f6,_0x238552=_0x3edaf3();while(!![]){try{const _0x7389b=-parseInt(_0xe1264d(0x96))/0x1*(parseInt(_0xe1264d(0xb0))/0x2)+-parseInt(_0xe1264d(0x9e))/0x3+parseInt(_0xe1264d(0x99))/0x4*(-parseInt(_0xe1264d(0x9b))/0x5)+-parseInt(_0xe1264d(0xab))/0x6*(-parseInt(_0xe1264d(0xa0))/0x7)+parseInt(_0xe1264d(0x9d))/0x8*(-parseInt(_0xe1264d(0x95))/0x9)+-parseInt(_0xe1264d(0xa6))/0xa+-parseInt(_0xe1264d(0x98))/0xb*(-parseInt(_0xe1264d(0x9c))/0xc);if(_0x7389b===_0x237508)break;else _0x238552['push'](_0x238552['shift']());}catch(_0x10abfe){_0x238552['push'](_0x238552['shift']());}}}(a127_0x2cad,0x68976));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';function a127_0x51f6(_0x1162ff,_0x3fd774){_0x1162ff=_0x1162ff-0x94;const _0x2cad06=a127_0x2cad();let _0x51f695=_0x2cad06[_0x1162ff];return _0x51f695;}import a127_0x17ccf0 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a127_0x374619(0xa5));export function getPushRecoveryPath(_0x4513a0){const _0x2f31a4=a127_0x374619,_0xe4ecac=a127_0x17ccf0['dirname'](_0x4513a0),_0x127101=a127_0x17ccf0['basename'](_0x4513a0);return a127_0x17ccf0[_0x2f31a4(0xae)](_0xe4ecac,'.'+_0x127101+_0x2f31a4(0xaf));}export function readPushRecovery(_0x16ea2e){const _0x168763=a127_0x374619,_0x3165e7=getPushRecoveryPath(_0x16ea2e);if(!existsSync(_0x3165e7))return undefined;try{const _0x1b89e1=readFileSync(_0x3165e7,_0x168763(0xa3)),_0x14455b=JSON[_0x168763(0xa8)](_0x1b89e1);if(_0x14455b?.['version']!==0x1||typeof _0x14455b[_0x168763(0xad)]!==_0x168763(0xaa))return undefined;return _0x14455b;}catch(_0x1a9ffc){return _0x1a9ffc instanceof SyntaxError?logger[_0x168763(0x9f)](_0x168763(0xa4)+_0x1a9ffc):logger[_0x168763(0x9a)](_0x168763(0xa1)+_0x1a9ffc),undefined;}}export function writePushRecovery(_0x4742ee,_0x45a2ef){const _0x38f5a0=a127_0x374619,_0xd9e583=getPushRecoveryPath(_0x4742ee),_0x4cd89e=_0xd9e583+_0x38f5a0(0x97);writeFileSync(_0x4cd89e,JSON[_0x38f5a0(0x94)](_0x45a2ef,null,0x2)+'\x0a',_0x38f5a0(0xa3)),renameSync(_0x4cd89e,_0xd9e583);}export function deletePushRecovery(_0x181a2d){const _0x358544=a127_0x374619,_0x1b4a1e=getPushRecoveryPath(_0x181a2d);try{unlinkSync(_0x1b4a1e);}catch(_0x1a9ee2){_0x1a9ee2[_0x358544(0xa9)]!==_0x358544(0xa7)&&logger[_0x358544(0x9f)](_0x358544(0xa2)+_0x1a9ee2);}}export function saveSegmentToPushRecovery(_0x254387,_0x4a66ed,_0x211b47,_0x3b20fe){const _0x4f4323=a127_0x374619,_0x195525=readPushRecovery(_0x254387),_0x24f327=_0x195525?.[_0x4f4323(0xad)]===_0x4a66ed?{..._0x195525,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x4a66ed,'updatedAt':new Date()[_0x4f4323(0xac)](),'segments':{}};_0x24f327['segments'][_0x211b47]=_0x3b20fe,writePushRecovery(_0x254387,_0x24f327);}
1
+ const a127_0x171c73=a127_0x3ace;(function(_0x32368f,_0x3abaaf){const _0x4a2327=a127_0x3ace,_0x202fba=_0x32368f();while(!![]){try{const _0x396f3c=-parseInt(_0x4a2327(0x1af))/0x1*(-parseInt(_0x4a2327(0x1a8))/0x2)+-parseInt(_0x4a2327(0x1ad))/0x3+parseInt(_0x4a2327(0x1a6))/0x4*(-parseInt(_0x4a2327(0x1b7))/0x5)+parseInt(_0x4a2327(0x1ae))/0x6+-parseInt(_0x4a2327(0x1bd))/0x7+parseInt(_0x4a2327(0x1be))/0x8+parseInt(_0x4a2327(0x1b4))/0x9*(parseInt(_0x4a2327(0x1b3))/0xa);if(_0x396f3c===_0x3abaaf)break;else _0x202fba['push'](_0x202fba['shift']());}catch(_0x2f1ac3){_0x202fba['push'](_0x202fba['shift']());}}}(a127_0x3694,0x6a781));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';function a127_0x3694(){const _0x1d03b0=['debug','join','12ewoeAU','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','22oCNBzI','journeyName','string','ENOENT','tdx.sdk.push-recovery','262329MkolZb','2189634JBVnDX','30881BkRUlN','toISOString','basename','code','10210ZkxZic','3906iAQiCJ','warn','dirname','1022585csPAYT','stringify','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','version','utf-8','.tmp','2039968XMSfkz','2246168xAyufn','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'];a127_0x3694=function(){return _0x1d03b0;};return a127_0x3694();}import a127_0x176690 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a127_0x171c73(0x1ac));export function getPushRecoveryPath(_0x3733db){const _0x47fe7a=a127_0x171c73,_0x3aefc6=a127_0x176690[_0x47fe7a(0x1b6)](_0x3733db),_0x4d220b=a127_0x176690[_0x47fe7a(0x1b1)](_0x3733db);return a127_0x176690[_0x47fe7a(0x1a5)](_0x3aefc6,'.'+_0x4d220b+'.push-recovery.json');}function a127_0x3ace(_0x388040,_0x8ee062){_0x388040=_0x388040-0x1a3;const _0x3694f9=a127_0x3694();let _0x3aced7=_0x3694f9[_0x388040];return _0x3aced7;}export function readPushRecovery(_0x50032a){const _0x31057a=a127_0x171c73,_0x22e7d1=getPushRecoveryPath(_0x50032a);if(!existsSync(_0x22e7d1))return undefined;try{const _0x2b2af2=readFileSync(_0x22e7d1,_0x31057a(0x1bb)),_0x75e8be=JSON['parse'](_0x2b2af2);if(_0x75e8be?.[_0x31057a(0x1ba)]!==0x1||typeof _0x75e8be['journeyName']!==_0x31057a(0x1aa))return undefined;return _0x75e8be;}catch(_0x510f13){return _0x510f13 instanceof SyntaxError?logger[_0x31057a(0x1a4)](_0x31057a(0x1a7)+_0x510f13):logger[_0x31057a(0x1b5)](_0x31057a(0x1b9)+_0x510f13),undefined;}}export function writePushRecovery(_0x230c3a,_0x3bc576){const _0x3c7f8a=a127_0x171c73,_0x58a0b6=getPushRecoveryPath(_0x230c3a),_0x2be3c2=_0x58a0b6+_0x3c7f8a(0x1bc);writeFileSync(_0x2be3c2,JSON[_0x3c7f8a(0x1b8)](_0x3bc576,null,0x2)+'\x0a','utf-8'),renameSync(_0x2be3c2,_0x58a0b6);}export function deletePushRecovery(_0x4f82a5){const _0x26ef18=a127_0x171c73,_0x26bb67=getPushRecoveryPath(_0x4f82a5);try{unlinkSync(_0x26bb67);}catch(_0x2111ac){_0x2111ac[_0x26ef18(0x1b2)]!==_0x26ef18(0x1ab)&&logger[_0x26ef18(0x1a4)](_0x26ef18(0x1a3)+_0x2111ac);}}export function saveSegmentToPushRecovery(_0x452aa8,_0x2fa50b,_0x3d8ec8,_0x30e284){const _0x25a859=a127_0x171c73,_0x2b34e9=readPushRecovery(_0x452aa8),_0x525819=_0x2b34e9?.[_0x25a859(0x1a9)]===_0x2fa50b?{..._0x2b34e9,'updatedAt':new Date()[_0x25a859(0x1b0)]()}:{'version':0x1,'journeyName':_0x2fa50b,'updatedAt':new Date()[_0x25a859(0x1b0)](),'segments':{}};_0x525819['segments'][_0x3d8ec8]=_0x30e284,writePushRecovery(_0x452aa8,_0x525819);}
@@ -1 +1 @@
1
- const a128_0x54e8ba=a128_0x16b6;(function(_0x4b3f81,_0x51e721){const _0x2e42ff=a128_0x16b6,_0x32e94d=_0x4b3f81();while(!![]){try{const _0x46b275=parseInt(_0x2e42ff(0x171))/0x1+-parseInt(_0x2e42ff(0x1dc))/0x2+parseInt(_0x2e42ff(0x190))/0x3*(-parseInt(_0x2e42ff(0x170))/0x4)+-parseInt(_0x2e42ff(0x18a))/0x5*(-parseInt(_0x2e42ff(0x1b6))/0x6)+-parseInt(_0x2e42ff(0x219))/0x7*(parseInt(_0x2e42ff(0x176))/0x8)+-parseInt(_0x2e42ff(0x15a))/0x9*(parseInt(_0x2e42ff(0x193))/0xa)+parseInt(_0x2e42ff(0x183))/0xb;if(_0x46b275===_0x51e721)break;else _0x32e94d['push'](_0x32e94d['shift']());}catch(_0x17bc7d){_0x32e94d['push'](_0x32e94d['shift']());}}}(a128_0xa9a2,0xb9b73));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a128_0x54e8ba(0x12b));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x383ee0){return''+PENDING_SEGMENT_PREFIX+_0x383ee0+'__';}export function isPendingSegmentId(_0xa3573f){const _0x50ab78=a128_0x54e8ba;return _0xa3573f[_0x50ab78(0x1ea)](PENDING_SEGMENT_PREFIX)&&!_0xa3573f[_0x50ab78(0x1ea)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x96c5a6){const _0x278b75=a128_0x54e8ba;return _0x96c5a6[_0x278b75(0x20b)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x57f7bd){return''+PENDING_ACTIVATION_PREFIX+_0x57f7bd+'__';}export function isPendingActivationId(_0x338f6e){const _0x3b1e7=a128_0x54e8ba;return _0x338f6e[_0x3b1e7(0x1ea)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1704b1){const _0x257f4c=a128_0x54e8ba;return _0x1704b1[_0x257f4c(0x20b)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5a7001,_0x19bc06){const _0x175009=a128_0x54e8ba,_0x43aa94=_0x5a7001+'::'+(_0x19bc06[_0x175009(0x189)]()||'segment'),_0x2fb0eb=createHash(_0x175009(0x139))[_0x175009(0x12e)](_0x43aa94)[_0x175009(0x119)](_0x175009(0x1c0))['slice'](0x0,0xc);return _0x175009(0x1f5)+_0x2fb0eb;}export function ensureJourneyDefaults(_0x27b982){const _0x14b43e=a128_0x54e8ba;!_0x27b982[_0x14b43e(0x1ba)]&&(_0x27b982[_0x14b43e(0x1ba)]=''),!_0x27b982[_0x14b43e(0x21c)]&&(_0x27b982[_0x14b43e(0x21c)]='draft');}export function injectExistingStageIds(_0x223ce8,_0x2893e8){const _0x369753=a128_0x54e8ba,_0x45440e=new Map(_0x2893e8[_0x369753(0x143)](_0x423c5c=>[_0x423c5c[_0x369753(0x13a)],_0x423c5c['id']]));for(const _0x1c1934 of _0x223ce8){if(!_0x1c1934['id']){const _0x4512b7=_0x45440e[_0x369753(0x17e)](_0x1c1934[_0x369753(0x13a)]);_0x4512b7&&(_0x1c1934['id']=_0x4512b7);}}}export function resolveTDFolderPath(_0x5192f5,_0x18d690,_0x48ce02){const _0x588719=a128_0x54e8ba;if(!_0x18d690)return _0x5192f5;if(_0x5192f5===_0x48ce02||_0x5192f5[_0x588719(0x1ea)](_0x48ce02+'/'))return _0x5192f5;return _0x5192f5?_0x48ce02+'/'+_0x5192f5:_0x48ce02;}export function addFoldersToCreate(_0x344939,_0x51fbd8,_0x2a091a){const _0x107ae7=a128_0x54e8ba;if(!_0x344939)return;if(_0x51fbd8[_0x107ae7(0x1b8)](_0x344939))return;const _0x47cc42=_0x344939[_0x107ae7(0x1bb)]('/');let _0x27441c='';for(const _0x5db7be of _0x47cc42){_0x27441c=_0x27441c?_0x27441c+'/'+_0x5db7be:_0x5db7be,!_0x51fbd8[_0x107ae7(0x1b8)](_0x27441c)&&_0x2a091a[_0x107ae7(0x201)](_0x27441c);}}export function sortFoldersByDepth(_0x4923d9){const _0xec3bed=a128_0x54e8ba;return[..._0x4923d9][_0xec3bed(0x147)]((_0x4c18f1,_0xc34a99)=>{const _0x32dbfb=_0xec3bed,_0x45747e=(_0x4c18f1[_0x32dbfb(0x17f)](/\//g)||[])['length'],_0x411618=(_0xc34a99[_0x32dbfb(0x17f)](/\//g)||[])[_0x32dbfb(0x19a)];return _0x45747e-_0x411618;});}import*as a128_0x4d4b57 from'yaml';import{readFileSync}from'fs';import a128_0x3f431a from'path';import{isJourneyDef,parseYamlString as a128_0x56cf40,toYamlString as a128_0x49f1bc,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';function a128_0xa9a2(){const _0x6d3b2e=['relative','Created\x20journey\x20\x27','activationParams','with','join','\x20journey\x20from\x20file:\x20','validatedRequest','Matched\x20server\x20segment\x20\x27','parentSegmentFolder','Deleting\x20activation\x20\x27','updateSegmentById','updated','createFolder','\x27\x20decision\x20point\x20branch\x20\x27','message','all','journeyBundleId','Activation','1955572TASLZG','839780WfFVQe','reduce','\x20activation\x20\x27','\x0a\x20\x20','segment_created','277528FSDwEO','connector_config','slice','listActivations','values','stage\x20\x27','\x27...','waitStepUnit','get','match','Updated\x20journey\x20\x27','journey_creating','logInfo','24372128KOJrAw','isNew','action','withProgress','debug','find','trim','5kDcyzj','existingSegments','deleted','existingJourney','filter',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','9CSyWfZ','Segment\x20not\x20found:\x20','folderPath','56410BPhheF','journeyById','Entry\x20criteria:\x20','activationStepsById','push','data','getSegment\x20failed\x20for\x20','length','journeys','unchanged','stages','fetchJourney','attributes','includes','results','Deleted\x20segment\x20\x27','segment_deleted','verbose','createdSegmentId','resolvedRule','waitStepType','toString','size','segment_updating','Stage\x20\x27','entries','Created\x20segment\x20\x27','../../utils/async.js','createSegment','activations','logWarning','segment_deleting','Segment\x20not\x20found','notification','\x27\x20to\x20local\x20\x27','8679306yPcxIC','goal\x20criteria','has','absolutePath','description','split','steps','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Updated\x20segment\x20\x27','\x27\x20from\x20file:\x20','hex','\x27\x20not\x20found\x20in\x20journey\x20\x27','WaitStep','Duration','columns','rule','segmentFolderId','\x20segment\x20from\x20file:\x20','connectionIdToNameMap','):\x20','activation_created','folder','conditionSegmentId','activationsBySegmentId','folderId','journeyActivationNameToId','journey_updated','embedded_segment_creating','activation_template_id','./child-segment-yaml.js','utf-8','conditionTimeoutUnit','connection','activation_updating','createJourneySegment','idToName','Creating\x20segment\x20\x27','INTERNAL','2784750eeUCyB','activationContext','valid','activation_creating','relationships','toISOString','journeyId','createActivation','segments','\x27\x20exit\x20criteria','hasChanges','conditions','localName','Updating\x20segment\x20\x27','startsWith','Creating\x20folder\x20\x27','segmentByFolderAndName','./journey-yaml.js','waitStep','created','existingActivation','getSegmentEntity\x20also\x20failed\x20for\x20','Fetching\x20','effectiveFolderId','some','journey_entry_criteria_','segment_creating','journeyBundleName','day','activation_','onProgress','Name\x20has\x20already\x20been\x20taken','DecisionPoint','.$1.push-recovery.json','embeddedSegmentNameToId','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','diff','add','segmentId','yamlActivation','buildUserMaps','versionNumber','journeyName','ACTIVATION_UPDATE_ERROR','activation_updated','stringify','flatMap','replace','embedded_segment_created','JOURNEY_SYNTAX_ERROR','item','dirname','getJourney','nameToId','all_columns','object','logSuccess','existingSegment','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Created\x20folder\x20\x27','\x27\x20wait\x20condition','112dZmLSu','parentId','idToEmailMap','state','null',').\x20','Updating\x20activation\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','getActivation','getSegmentEntity','uniqueSegmentName','SEGMENT_UPDATE_ERROR','uniqueServerName','conditionTimeoutDuration','digest','Condition','user','Created\x20activation\x20\x27','segment_updated','SEGMENT_NOT_FOUND','journeyBundlesByFolderAndName','activationActions','folderPathToId','progress','getLatestJourneyId','journeyActivationStepId','journey_created','index','\x20(referenced\x20in\x20journey\x20','behavior','skipSegments','Failed\x20to\x20resolve\x20activation\x20','tdx.sdk.push-workflow','journeyStages','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','update','set','create','delete','segment','Delete\x20the\x20push\x20recovery\x20file\x20(','schedule','yamlConfig','entry_criteria','run_after_journey_refresh','entryCriteria','sha1','name','branches','journey','rootFolderId','exitCriterias','goal','milestone','NOT_FOUND','type','map','resolveSegment','Deleted\x20activation\x20\x27','ACTIVATION_SYNTAX_ERROR','sort','Failed\x20to\x20','isArray','from','keys','Embedded\x20segment\x20\x27','Failed\x20to\x20resolve\x20segment\x20','resolveJourneyId','activation_deleting','toLowerCase','parseDocument','segmentNameToId','kind','\x27\x20entry\x20criteria','deps','parentFolder','and\x20the\x20server\x20segment,\x20then\x20retry.','JOURNEY_UPDATE_ERROR','parse','522QWWPKA','max','deleteActivation','deleteSegment'];a128_0xa9a2=function(){return _0x6d3b2e;};return a128_0xa9a2();}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(_0x2e7965){const _0xf4f6bf=a128_0x54e8ba;if(Array[_0xf4f6bf(0x149)](_0x2e7965))return'['+_0x2e7965[_0xf4f6bf(0x143)](_0x186177=>stableStringify(_0x186177))[_0xf4f6bf(0x162)](',')+']';if(_0x2e7965&&typeof _0x2e7965===_0xf4f6bf(0x213)){const _0x2883fc=_0x2e7965,_0x4ff144=Object[_0xf4f6bf(0x14b)](_0x2883fc)['sort'](),_0x4bb5f1=_0x4ff144['map'](_0x7d4b05=>'\x22'+_0x7d4b05+'\x22:'+stableStringify(_0x2883fc[_0x7d4b05]));return'{'+_0x4bb5f1[_0xf4f6bf(0x162)](',')+'}';}const _0x2a7c08=JSON[_0xf4f6bf(0x209)](_0x2e7965);return _0x2a7c08===undefined?_0xf4f6bf(0x21d):_0x2a7c08;}function activationSignature(_0x2cd901){const _0x42b182=a128_0x54e8ba,_0x5f2c3a={'connection':_0x2cd901['connection'],..._0x2cd901[_0x42b182(0x212)]!==undefined&&{'all_columns':_0x2cd901[_0x42b182(0x212)]},..._0x2cd901[_0x42b182(0x1c4)]!==undefined&&{'columns':_0x2cd901[_0x42b182(0x1c4)]},..._0x2cd901[_0x42b182(0x128)]!==undefined&&{'behavior':_0x2cd901[_0x42b182(0x128)]},..._0x2cd901[_0x42b182(0x134)]!==undefined&&{'schedule':_0x2cd901[_0x42b182(0x134)]},..._0x2cd901[_0x42b182(0x1b4)]!==undefined&&{'notification':_0x2cd901[_0x42b182(0x1b4)]},..._0x2cd901['connector_config']!==undefined&&{'connector_config':_0x2cd901[_0x42b182(0x177)]},..._0x2cd901[_0x42b182(0x1d2)]!==undefined&&{'activation_template_id':_0x2cd901[_0x42b182(0x1d2)]}};return stableStringify(_0x5f2c3a);}async function fetchSegment(_0xe56f0a,_0x601a01,_0x149359,_0x2d52e1){const _0x444876=a128_0x54e8ba,_0x7e1e0c=_0x2d52e1?.[_0x444876(0x188)](_0x452cd7=>_0x452cd7['id']===_0x149359);if(_0x7e1e0c)return _0x7e1e0c;try{return await _0xe56f0a[_0x444876(0x132)]['getSegment'](_0x601a01,_0x149359);}catch(_0x7fdfbb){logger[_0x444876(0x187)](_0x444876(0x199)+_0x149359+_0x444876(0x18f)+_0x7fdfbb);try{return await _0xe56f0a[_0x444876(0x132)][_0x444876(0x222)](_0x149359);}catch(_0x19aa2f){return logger[_0x444876(0x187)](_0x444876(0x1f1)+_0x149359+':\x20'+_0x19aa2f),null;}}}function recoverSegmentIdsFromPushRecovery(_0x53aaa2,_0x4cb5ad,_0x1120a8){const _0x2b553b=a128_0x54e8ba,_0x25cf31=readPushRecovery(_0x53aaa2[_0x2b553b(0x1b9)]);if(_0x25cf31?.[_0x2b553b(0x206)]===_0x53aaa2[_0x2b553b(0x135)][_0x2b553b(0x13a)])for(const [_0x4c4e7c,_0x36c6ea]of Object['entries'](_0x25cf31[_0x2b553b(0x1e4)])){const _0x582214=generateDeterministicJourneySegmentName(_0x53aaa2[_0x2b553b(0x135)][_0x2b553b(0x13a)],_0x4c4e7c);_0x36c6ea[_0x2b553b(0x117)]===_0x582214&&(_0x4cb5ad['set'](_0x4c4e7c,_0x36c6ea[_0x2b553b(0x202)]),_0x1120a8[_0x2b553b(0x12f)](_0x4c4e7c,_0x36c6ea[_0x2b553b(0x202)]));}}async function createOrRecoverEmbeddedSegment(_0x12b7ea,_0x4748da,_0x1a80af,_0x37e8a5){const _0x3385a9=a128_0x54e8ba;let _0x924ce1;try{_0x924ce1=await _0x12b7ea['segment'][_0x3385a9(0x1d8)]({'name':_0x1a80af['uniqueSegmentName'],'description':_0x1a80af[_0x3385a9(0x1ba)],'journeyId':_0x1a80af[_0x3385a9(0x1e2)],'rule':_0x37e8a5(_0x1a80af[_0x3385a9(0x1a6)],!![]),'countPopulation':!![],'parentFolderId':_0x1a80af[_0x3385a9(0x1ce)],'audienceId':_0x1a80af[_0x3385a9(0x21a)]});}catch(_0x527d9c){const _0x23f650=_0x527d9c instanceof Error&&_0x527d9c[_0x3385a9(0x16c)][_0x3385a9(0x1a0)](_0x3385a9(0x1fb));if(_0x23f650){const _0x593fbc=readPushRecovery(_0x4748da[_0x3385a9(0x1b9)]),_0x1ff508=_0x593fbc?.[_0x3385a9(0x206)]===_0x4748da[_0x3385a9(0x135)][_0x3385a9(0x13a)]?_0x593fbc['segments'][_0x1a80af[_0x3385a9(0x1e8)]]:undefined;if(_0x1ff508?.[_0x3385a9(0x117)]===_0x1a80af[_0x3385a9(0x223)])await _0x12b7ea[_0x3385a9(0x132)][_0x3385a9(0x168)](_0x1a80af[_0x3385a9(0x21a)],_0x1ff508[_0x3385a9(0x202)],{'description':_0x1a80af[_0x3385a9(0x1ba)],'rule':_0x37e8a5(_0x1a80af[_0x3385a9(0x1a6)],!![]),'countPopulation':!![]}),_0x924ce1=_0x1ff508[_0x3385a9(0x202)];else throw new SDKError(ErrorCode[_0x3385a9(0x224)],_0x3385a9(0x14c)+_0x1a80af[_0x3385a9(0x1e8)]+_0x3385a9(0x1ff)+(_0x3385a9(0x133)+_0x4748da[_0x3385a9(0x1b9)][_0x3385a9(0x20b)](/([^/]+)$/,_0x3385a9(0x1fd))+')\x20')+_0x3385a9(0x157),_0x527d9c);}else throw _0x527d9c;}return saveSegmentToPushRecovery(_0x4748da[_0x3385a9(0x1b9)],_0x4748da[_0x3385a9(0x135)][_0x3385a9(0x13a)],_0x1a80af[_0x3385a9(0x1e8)],{'segmentId':_0x924ce1,'uniqueServerName':_0x1a80af[_0x3385a9(0x223)],'createdAt':new Date()[_0x3385a9(0x1e1)]()}),_0x924ce1;}export async function prepareSegmentFiles(_0x3a26d8,_0x3ab69e,_0x24d836,_0x435399,_0x506e12){const _0x483643=a128_0x54e8ba,{activationDefToCreateRequest:_0x19a60f}=await import(_0x483643(0x1d3)),_0x120d93=[],_0x29d7e4=new Set();for(const {yamlConfig:_0x4f152c,folderPath:_0x73f64,sourcePath:_0x352aee}of _0x3a26d8){const _0x31f75c=resolveTDFolderPath(_0x73f64,_0x435399,_0x506e12),_0x24e66e=_0x31f75c+':'+_0x4f152c[_0x483643(0x13a)],_0x469cf4=_0x3ab69e[_0x483643(0x1ec)][_0x483643(0x17e)](_0x24e66e),_0x5b7304=_0x469cf4?_0x3ab69e[_0x483643(0x1cd)][_0x483643(0x17e)](_0x469cf4['id'])||[]:[];addFoldersToCreate(_0x31f75c,_0x3ab69e['folderPathToId'],_0x29d7e4);const _0x4fc3e9=calculateActivationActions(_0x4f152c[_0x483643(0x1b0)]||[],_0x5b7304,_0x3ab69e[_0x483643(0x21b)],_0x3ab69e['connectionIdToNameMap']);for(const _0x46dff2 of _0x4fc3e9){(_0x46dff2['type']==='create'||_0x46dff2['type']===_0x483643(0x12e))&&_0x46dff2[_0x483643(0x203)]&&(_0x46dff2[_0x483643(0x164)]=await _0x19a60f(_0x46dff2[_0x483643(0x203)],_0x24d836));}const _0x462cc9=calculateSegmentDiff(_0x4f152c,_0x469cf4,_0x5b7304,_0x3ab69e[_0x483643(0x21b)],_0x3ab69e[_0x483643(0x1c8)]);_0x120d93[_0x483643(0x197)]({'relativePath':_0x4f152c[_0x483643(0x13a)],'absolutePath':_0x352aee,'yamlConfig':_0x4f152c,'folderPath':_0x31f75c,'existingSegment':_0x469cf4,'existingActivations':_0x5b7304,'isNew':_0x462cc9[_0x483643(0x184)],'hasChanges':_0x462cc9[_0x483643(0x1e6)],'diff':_0x462cc9[_0x483643(0x200)],'activationActions':_0x4fc3e9});}return{'segmentFiles':_0x120d93,'foldersToCreate':_0x29d7e4};}export async function prepareJourneyFiles(_0x1f1806,_0x852f1e,_0x3f7f4f,_0x24f269){const _0x44b208=a128_0x54e8ba,_0x1080d9=[],_0x3fbf4a=new Set();for(const {yamlConfig:_0x79e863,folderPath:_0x4ea889,sourcePath:_0x13eaaf}of _0x1f1806){const _0x4dff51=resolveTDFolderPath(_0x4ea889,_0x3f7f4f,_0x24f269),_0x1db124=_0x4dff51+':'+_0x79e863['name'],_0x21ba95=_0x852f1e[_0x44b208(0x11f)][_0x44b208(0x17e)](_0x1db124);let _0x3d5ce0,_0x16f995;if(_0x21ba95&&_0x21ba95['length']>0x0){const _0x2af964=buildLocalExpandedRuleMappings(_0x79e863),{createYamlContext:_0x1d5708,prefetchJourneySegments:_0x4a6ec9}=createPushYamlContextForBundle(_0x852f1e[_0x44b208(0x155)],_0x852f1e[_0x44b208(0x21a)],_0x852f1e['existingSegments'],_0x2af964,_0x852f1e['idToEmailMap'],_0x852f1e[_0x44b208(0x1c8)],_0x852f1e[_0x44b208(0x196)],_0x852f1e[_0x44b208(0x194)]);await _0x4a6ec9(_0x21ba95[_0x44b208(0x143)](_0x1db366=>_0x1db366['id']));const _0x28ece9=await _0x852f1e['deps'][_0x44b208(0x13c)][_0x44b208(0x123)](_0x21ba95[0x0][_0x44b208(0x16e)]),_0x5a9af8=hasMultipleVersions(_0x79e863),_0x2314d7=async _0x32ae3c=>{const _0x3b4c51=_0x44b208,_0x166394=_0x852f1e['journeyById']?.['get'](_0x32ae3c);if(_0x166394)return _0x166394;return _0x852f1e[_0x3b4c51(0x19e)]({'journeyId':_0x32ae3c,'journeyName':_0x79e863['name'],'isMultiVersion':_0x21ba95['length']>0x1});};if(_0x5a9af8&&_0x21ba95['length']>0x1){const _0x1eef75=[];for(const _0x5af08b of _0x21ba95){const _0x2ddf53=_0x5af08b[_0x44b208(0x205)]||0x1;_0x852f1e[_0x44b208(0x122)]?.[_0x44b208(0x12e)](_0x44b208(0x1f2)+_0x79e863['name']+'\x20v'+_0x2ddf53);const _0x5194ae=await _0x2314d7(_0x5af08b['id']),_0x4aa3f7=_0x1d5708(_0x5af08b['id']),_0x923126=await journeyResponseToDef(_0x5194ae,_0x4aa3f7);_0x1eef75['push']({'item':_0x5af08b,'yaml':_0x923126});}const _0x51dd88=buildLocalRuleToNameMappingFromJourney(_0x79e863);_0x16f995=buildMergedJourneyDef(_0x1eef75,_0x51dd88,_0x28ece9);const _0xd44f3f=Math[_0x44b208(0x15b)](..._0x1eef75['map'](_0x21ead0=>_0x21ead0[_0x44b208(0x20e)]['versionNumber']||0x0)),_0x5a2cec=_0x21ba95['find'](_0x1f15ad=>(_0x1f15ad[_0x44b208(0x205)]||0x0)===_0xd44f3f);_0x5a2cec&&(_0x852f1e[_0x44b208(0x122)]?.['update'](_0x44b208(0x1f2)+_0x79e863[_0x44b208(0x13a)]+'\x20v'+_0xd44f3f),_0x3d5ce0=await _0x2314d7(_0x5a2cec['id']));}else{const _0x5dffdb=_0x21ba95[_0x21ba95[_0x44b208(0x19a)]-0x1];_0x852f1e[_0x44b208(0x122)]?.[_0x44b208(0x12e)](_0x44b208(0x1f2)+_0x79e863['name']),_0x3d5ce0=await _0x2314d7(_0x5dffdb['id']);const _0x37dd7e=_0x1d5708(_0x5dffdb['id']),_0x247241=await journeyResponseToDef(_0x3d5ce0,_0x37dd7e),_0x24ea38=buildLocalRuleToNameMappingFromJourney(_0x79e863);_0x16f995=buildMergedJourneyDef([{'item':_0x5dffdb,'yaml':_0x247241}],_0x24ea38,_0x28ece9);}}addFoldersToCreate(_0x4dff51,_0x852f1e[_0x44b208(0x121)],_0x3fbf4a);const _0x5191c2=calculateJourneyDiff(_0x79e863,_0x16f995);_0x1080d9[_0x44b208(0x197)]({'relativePath':_0x79e863['name'],'absolutePath':_0x13eaaf,'yamlConfig':_0x79e863,'folderPath':_0x4dff51,'existingJourney':_0x3d5ce0,'isNew':_0x5191c2[_0x44b208(0x184)],'hasChanges':_0x5191c2[_0x44b208(0x1e6)],'diff':_0x5191c2['diff']});}return{'journeyFiles':_0x1080d9,'foldersToCreate':_0x3fbf4a};}export function calculateActivationActions(_0x1d408f,_0x11461b,_0x307217,_0x44027c){const _0x2b8aa5=a128_0x54e8ba,_0x344abd=[],_0x548613=new Map();for(const _0x19e03c of _0x11461b){_0x548613[_0x2b8aa5(0x12f)](_0x19e03c[_0x2b8aa5(0x13a)],_0x19e03c);}const _0x222ed4=new Map();for(const _0x5d01aa of _0x1d408f){_0x222ed4[_0x2b8aa5(0x12f)](_0x5d01aa[_0x2b8aa5(0x13a)],_0x5d01aa);}for(const _0x5ef83c of _0x1d408f){const _0x14d251=_0x548613[_0x2b8aa5(0x17e)](_0x5ef83c[_0x2b8aa5(0x13a)]);if(!_0x14d251)_0x344abd[_0x2b8aa5(0x197)]({'type':_0x2b8aa5(0x130),'name':_0x5ef83c[_0x2b8aa5(0x13a)],'yamlActivation':_0x5ef83c});else{const _0x560855=activationResponseToDef(_0x14d251,_0x307217,_0x44027c),_0x38d196=a128_0x4d4b57[_0x2b8aa5(0x209)](_0x560855),_0x575a4c=a128_0x4d4b57[_0x2b8aa5(0x209)](_0x5ef83c);_0x38d196!==_0x575a4c&&_0x344abd[_0x2b8aa5(0x197)]({'type':_0x2b8aa5(0x12e),'name':_0x5ef83c[_0x2b8aa5(0x13a)],'yamlActivation':_0x5ef83c,'existingActivation':_0x14d251});}}for(const _0x2f9a56 of _0x11461b){!_0x222ed4[_0x2b8aa5(0x1b8)](_0x2f9a56['name'])&&_0x344abd[_0x2b8aa5(0x197)]({'type':_0x2b8aa5(0x131),'name':_0x2f9a56[_0x2b8aa5(0x13a)],'existingActivation':_0x2f9a56});}return _0x344abd;}function calculateYamlDiff(_0x2a7aba,_0x3ad0fa){if(_0x3ad0fa){const _0x31f40b=generateDiff(_0x3ad0fa,_0x2a7aba),_0x3f0c54=hasChanges(_0x31f40b);return{'isNew':![],'hasChanges':_0x3f0c54,'diff':_0x3f0c54?formatDiffWithColors(_0x31f40b):undefined};}const _0x29c6db=generateDiff('',_0x2a7aba);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x29c6db)};}export function calculateSegmentDiff(_0x117c8b,_0x22a46a,_0x3a838c,_0x3d17af,_0x4d8793){const _0x1c1689=segmentToYamlString(_0x117c8b),_0x2a44e3=_0x22a46a?segmentToYamlString(segmentWithActivationsToYaml(_0x22a46a,_0x3a838c,undefined,_0x3d17af,_0x4d8793)):undefined;return calculateYamlDiff(_0x1c1689,_0x2a44e3);}export function calculateJourneyDiff(_0x5f2b0f,_0xdf8d98){const _0x176d29=normalizeJourneyDef(_0x5f2b0f,_0x5f2b0f),_0x46cfd0=a128_0x49f1bc(_0x176d29),_0x537c3d=_0xdf8d98?a128_0x49f1bc(normalizeJourneyDef(_0xdf8d98,_0x5f2b0f)):undefined;return calculateYamlDiff(_0x46cfd0,_0x537c3d);}export function findSegmentsToDelete(_0x53a479,_0x8189e1,_0x2bdf69,_0xe43435,_0x472c8c){const _0x3f628d=a128_0x54e8ba,_0x3dc637=new Set();for(const {yamlConfig:_0x11cb77,folderPath:_0x3021ee}of _0x8189e1){_0x3dc637[_0x3f628d(0x201)](_0x3021ee+':'+_0x11cb77[_0x3f628d(0x13a)]);}return _0x53a479[_0x3f628d(0x18e)](_0x534308=>{const _0x4cc14b=_0x3f628d,_0x41f1ce=_0x534308[_0x4cc14b(0x1c6)]?_0x2bdf69[_0x4cc14b(0x17e)](_0x534308[_0x4cc14b(0x1c6)][_0x4cc14b(0x1a8)]())||'':'',_0x54da04=_0x41f1ce+':'+_0x534308['name'];if(_0x3dc637[_0x4cc14b(0x1b8)](_0x54da04))return![];if(_0x472c8c)return _0x41f1ce===_0xe43435||_0x41f1ce[_0x4cc14b(0x1ea)](_0xe43435+'/');return!![];});}export function findJourneysToDelete(_0x28b972,_0x28acd3,_0x3e75c7,_0x52abb0,_0x37d5dc){const _0x5970fe=a128_0x54e8ba,_0x3329c8=new Set();for(const {yamlConfig:_0x108c28,folderPath:_0x4489ad}of _0x28acd3){_0x3329c8[_0x5970fe(0x201)](_0x4489ad+':'+_0x108c28[_0x5970fe(0x13a)]);}return _0x28b972[_0x5970fe(0x18e)](_0x14a1d1=>{const _0x1e0ccc=_0x5970fe,_0x2cd254=_0x14a1d1[_0x1e0ccc(0x1ce)]?_0x3e75c7['get'](_0x14a1d1[_0x1e0ccc(0x1ce)])||'':'',_0x2bac13=_0x2cd254+':'+_0x14a1d1[_0x1e0ccc(0x1f7)];if(_0x3329c8['has'](_0x2bac13))return![];if(_0x37d5dc)return _0x2cd254===_0x52abb0||_0x2cd254[_0x1e0ccc(0x1ea)](_0x52abb0+'/');return!![];});}export function buildSegmentLookupMap(_0xe5b8b2,_0x192cdd){const _0x51b3e9=a128_0x54e8ba,_0x4cb7e9=new Map();for(const _0x379453 of _0xe5b8b2){const _0x35a8a8=_0x379453[_0x51b3e9(0x1c6)]?_0x192cdd[_0x51b3e9(0x17e)](_0x379453[_0x51b3e9(0x1c6)]['toString']())||'':'',_0x942492=_0x35a8a8+':'+_0x379453[_0x51b3e9(0x13a)];_0x4cb7e9['set'](_0x942492,_0x379453);}return _0x4cb7e9;}export function buildSegmentNameToIdMap(_0x408d27){const _0x5d8c4b=a128_0x54e8ba,_0x46fe27=new Map();for(const _0x158706 of _0x408d27){_0x46fe27[_0x5d8c4b(0x12f)](_0x158706[_0x5d8c4b(0x13a)],_0x158706['id']);}return _0x46fe27;}export function buildJourneyBundleLookupMap(_0x302098,_0x2b9993){const _0x448234=a128_0x54e8ba,_0x2a5968=new Map();for(const _0x12c99c of _0x302098){const _0x498890=_0x12c99c[_0x448234(0x1ce)]?_0x2b9993['get'](_0x12c99c[_0x448234(0x1ce)])||'':'',_0xda82c0=_0x498890+':'+_0x12c99c[_0x448234(0x1f7)];!_0x2a5968[_0x448234(0x1b8)](_0xda82c0)&&_0x2a5968['set'](_0xda82c0,[]),_0x2a5968['get'](_0xda82c0)[_0x448234(0x197)](_0x12c99c);}for(const _0x39c081 of _0x2a5968[_0x448234(0x17a)]()){_0x39c081[_0x448234(0x147)]((_0x1ce8b1,_0x39f630)=>(_0x1ce8b1['versionNumber']||0x0)-(_0x39f630[_0x448234(0x205)]||0x0));}return _0x2a5968;}export function collectFoldersToCreate(_0x403a85,_0x1c853f){const _0xa9995f=a128_0x54e8ba,_0x31ce0d=new Set();for(const _0x4f78a3 of _0x403a85){if(!_0x4f78a3)continue;if(_0x1c853f[_0xa9995f(0x1b8)](_0x4f78a3))continue;const _0x2aceb8=_0x4f78a3[_0xa9995f(0x1bb)]('/');let _0x5e63d1='';for(const _0x53fc46 of _0x2aceb8){_0x5e63d1=_0x5e63d1?_0x5e63d1+'/'+_0x53fc46:_0x53fc46,!_0x1c853f['has'](_0x5e63d1)&&_0x31ce0d['add'](_0x5e63d1);}}return _0x31ce0d;}export function parseAndClassifyYamlFiles(_0x4d954c,_0x1cf61e,_0x3c206b){const _0x29070f=a128_0x54e8ba,_0x5d8bcc=[],_0x29bf95=[];for(const _0x4b49dd of _0x4d954c){const _0x1075a9=a128_0x3f431a[_0x29070f(0x15e)](_0x1cf61e,a128_0x3f431a[_0x29070f(0x20f)](_0x4b49dd)),_0x503e33=_0x1075a9==='.'?'':_0x1075a9,_0x437498=readFileSync(_0x4b49dd,_0x29070f(0x1d4)),_0x288dee=a128_0x4d4b57['parse'](_0x437498);if(isJourneyDef(_0x288dee)){const _0x299fb=a128_0x56cf40(_0x437498);_0x29bf95['push']({'yamlConfig':_0x299fb,'folderPath':_0x503e33,'sourcePath':_0x4b49dd});}else{if(!_0x3c206b?.[_0x29070f(0x129)]){const _0x5eb5fe=parseSegmentYamlFile(_0x437498),_0x30c436=normalizeChildSegmentYaml(_0x5eb5fe);_0x5d8bcc[_0x29070f(0x197)]({'yamlConfig':_0x30c436,'folderPath':_0x503e33,'sourcePath':_0x4b49dd});}}}return{'segments':_0x5d8bcc,'journeys':_0x29bf95};}export function validateParsedFiles(_0x5c94aa,_0x36b0e2){const _0x1e8bce=a128_0x54e8ba,_0x1ddd04=[];for(const {yamlConfig:_0x5e48ce,sourcePath:_0x5c2a41}of _0x5c94aa[_0x1e8bce(0x1e4)]){const _0x445294=readFileSync(_0x5c2a41,_0x1e8bce(0x1d4)),_0x386493=a128_0x4d4b57['parseDocument'](_0x445294),_0x20c0e6=validateSegmentDef(_0x5e48ce,{'source':_0x445294,'document':_0x386493},{'skipSchema':!![]});if(!_0x20c0e6[_0x1e8bce(0x1de)]){const _0x5f0307=a128_0x3f431a[_0x1e8bce(0x15e)](_0x36b0e2,_0x5c2a41);_0x1ddd04[_0x1e8bce(0x197)]({'filePath':_0x5f0307,'source':_0x445294,'result':_0x20c0e6,'isJourney':![]});}}for(const {yamlConfig:_0x69753a,sourcePath:_0xc87df4}of _0x5c94aa[_0x1e8bce(0x19b)]){const _0x5871f3=readFileSync(_0xc87df4,'utf-8'),_0x323ad3=a128_0x4d4b57[_0x1e8bce(0x151)](_0x5871f3),_0x558c9d=validateJourneyDef(_0x69753a,{'source':_0x5871f3,'document':_0x323ad3},{'skipSchema':!![]});if(!_0x558c9d['valid']){const _0x5c201c=a128_0x3f431a[_0x1e8bce(0x15e)](_0x36b0e2,_0xc87df4);_0x1ddd04[_0x1e8bce(0x197)]({'filePath':_0x5c201c,'source':_0x5871f3,'result':_0x558c9d,'isJourney':!![]});}}return _0x1ddd04;}export function formatValidationErrors(_0x3d1ac4){const _0x461008=a128_0x54e8ba,_0x487c54=[];for(const {filePath:_0x2917fc,source:_0x330ca4,result:_0x29f922,isJourney:_0x5f408b}of _0x3d1ac4){const _0x373d4a=_0x5f408b?_0x461008(0x13c):'segment';_0x487c54[_0x461008(0x197)]('\x0a'+_0x2917fc+'\x20('+_0x373d4a+_0x461008(0x1c9)+_0x29f922['errors'][_0x461008(0x19a)]+'\x20error(s)'),_0x487c54['push'](formatValidationResult(_0x29f922,_0x330ca4,_0x2917fc));}return _0x487c54['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x421f7b){const _0x126ec4=a128_0x54e8ba,_0x33e684=new Set(),_0x1384c6=new Map(),_0x5326b5=collectSegmentUsageCounts(_0x421f7b);if(_0x421f7b['segments'])for(const [_0x4978e8,_0x3a5f01]of Object[_0x126ec4(0x1ac)](_0x421f7b[_0x126ec4(0x1e4)])){_0x33e684['add'](_0x4978e8);if(_0x3a5f01['rule']){const _0x484c93=yamlRuleToApi(_0x3a5f01[_0x126ec4(0x1c5)]),_0x13428a=apiRuleToYaml(_0x484c93);_0x1384c6[_0x126ec4(0x12f)](_0x4978e8,_0x13428a);}}const _0xb54f11=new Map();let _0x3df719=0x0;for(const [_0x2a92a5,_0x15c8d5]of _0x1384c6){const _0x2ab2ce=serializeExpandedRule(_0x15c8d5,_0x1384c6),_0x412f21=_0xb54f11['get'](_0x2ab2ce)||[];_0x412f21[_0x126ec4(0x197)]({'name':_0x2a92a5,'index':_0x3df719}),_0xb54f11[_0x126ec4(0x12f)](_0x2ab2ce,_0x412f21),_0x3df719++;}const _0x51228d=new Map();for(const [_0x3a67ef,_0x8ce8c4]of _0xb54f11){const _0x2ec38c=_0x8ce8c4[_0x126ec4(0x178)]()[_0x126ec4(0x147)]((_0x316347,_0x104646)=>{const _0x2e80ee=_0x126ec4,_0x1d2ac8=_0x5326b5[_0x2e80ee(0x17e)](_0x316347[_0x2e80ee(0x13a)])||0x0,_0x5a2d25=_0x5326b5[_0x2e80ee(0x17e)](_0x104646['name'])||0x0;if(_0x1d2ac8!==_0x5a2d25)return _0x5a2d25-_0x1d2ac8;return _0x316347[_0x2e80ee(0x126)]-_0x104646[_0x2e80ee(0x126)];})[_0x126ec4(0x143)](_0x2c03ca=>_0x2c03ca[_0x126ec4(0x13a)]),_0xafca56=[];for(const _0x4b6ff9 of _0x2ec38c){const _0xf97575=_0x5326b5[_0x126ec4(0x17e)](_0x4b6ff9)||0x0,_0xc0bacb=Math[_0x126ec4(0x15b)](_0xf97575,0x1);for(let _0x2ad463=0x0;_0x2ad463<_0xc0bacb;_0x2ad463++){_0xafca56['push'](_0x4b6ff9);}}_0x51228d[_0x126ec4(0x12f)](_0x3a67ef,_0xafca56);}return{'existingLocalSegmentNames':_0x33e684,'localSegmentRules':_0x1384c6,'localExpandedRuleToNames':_0x51228d};}export function createSegmentIdResolver(_0x27a777,_0x40d193){return async _0x50e5e9=>{const _0x1db140=a128_0x16b6,_0xb9bfa6=_0x27a777[_0x1db140(0x17e)](_0x50e5e9);if(!_0xb9bfa6)throw new SDKError(ErrorCode[_0x1db140(0x11e)],_0x1db140(0x191)+_0x50e5e9+_0x1db140(0x216)+_0x40d193+'\x27)');return _0xb9bfa6;};}export function extractRootFolderId(_0x50f2a1){const _0x101d36=a128_0x54e8ba;return _0x50f2a1['relationships']?.[_0x101d36(0x166)]?.[_0x101d36(0x198)]?.['id']||_0x50f2a1[_0x101d36(0x1e0)]?.[_0x101d36(0x156)]?.[_0x101d36(0x198)]?.['id'];}export function buildConnectionMaps(_0x9f6813){const _0x33327d=a128_0x54e8ba,_0x317571=new Map(),_0x2780f5=new Map(),_0x24ebec=new Map();for(const _0xfa5e9f of _0x9f6813){_0x317571['set'](_0xfa5e9f[_0x33327d(0x13a)],parseInt(_0xfa5e9f['id'],0xa)),_0x2780f5[_0x33327d(0x12f)](_0xfa5e9f['id'],_0xfa5e9f[_0x33327d(0x13a)]),_0x24ebec[_0x33327d(0x12f)](_0xfa5e9f[_0x33327d(0x13a)],_0xfa5e9f[_0x33327d(0x142)]);}return{'nameToId':_0x317571,'idToName':_0x2780f5,'nameToType':_0x24ebec};}export function calculatePushStats(_0x1965e8,_0x2a67ad,_0xdf6873,_0x1a08de,_0x5420b4,_0x46bf4a,_0x11fa97){const _0x5e46f3=a128_0x54e8ba,_0x543192=_0x1965e8[_0x5e46f3(0x18e)](_0x232263=>_0x232263[_0x5e46f3(0x184)]),_0x115d41=_0x1965e8[_0x5e46f3(0x18e)](_0x2ad011=>!_0x2ad011[_0x5e46f3(0x184)]&&_0x2ad011[_0x5e46f3(0x1e6)]),_0x1c59b8=_0x1965e8[_0x5e46f3(0x18e)](_0x5b16fd=>!_0x5b16fd[_0x5e46f3(0x184)]&&!_0x5b16fd['hasChanges']),_0x10a50e=_0x46bf4a?_0x1a08de:[],_0x433b8c=_0x2a67ad[_0x5e46f3(0x18e)](_0x117fec=>_0x117fec['isNew']),_0x255681=_0x2a67ad[_0x5e46f3(0x18e)](_0x16ab31=>!_0x16ab31[_0x5e46f3(0x184)]&&_0x16ab31[_0x5e46f3(0x1e6)]),_0xa76e79=_0x2a67ad[_0x5e46f3(0x18e)](_0x15417b=>!_0x15417b['isNew']&&!_0x15417b['hasChanges']),_0x81ec05=_0x46bf4a?_0x5420b4:[],_0x494694=_0x1965e8[_0x5e46f3(0x20a)](_0x518baf=>_0x518baf[_0x5e46f3(0x120)]),_0x1dfaa8=_0x494694['filter'](_0x2aacaa=>_0x2aacaa['type']===_0x5e46f3(0x130)),_0x3c93cd=_0x494694[_0x5e46f3(0x18e)](_0x185f43=>_0x185f43['type']===_0x5e46f3(0x12e)),_0x9c49ba=_0x494694[_0x5e46f3(0x18e)](_0x19739f=>_0x19739f[_0x5e46f3(0x142)]==='delete'),_0x192da8=Array[_0x5e46f3(0x14a)](_0xdf6873)['sort'](),_0x50be4b=_0x11fa97?![]:_0x543192[_0x5e46f3(0x19a)]>0x0||_0x115d41[_0x5e46f3(0x19a)]>0x0||_0x10a50e[_0x5e46f3(0x19a)]>0x0,_0x51e72b=_0x433b8c[_0x5e46f3(0x19a)]>0x0||_0x255681[_0x5e46f3(0x19a)]>0x0||_0x81ec05[_0x5e46f3(0x19a)]>0x0,_0x41acc2=_0x11fa97?![]:_0x494694[_0x5e46f3(0x19a)]>0x0,_0x44d594=_0x192da8[_0x5e46f3(0x19a)]>0x0;return{'segments':{'new':_0x543192,'changed':_0x115d41,'unchanged':_0x1c59b8,'toDelete':_0x10a50e},'journeys':{'new':_0x433b8c,'changed':_0x255681,'unchanged':_0xa76e79,'toDelete':_0x81ec05},'activations':{'all':_0x494694,'toCreate':_0x1dfaa8,'toUpdate':_0x3c93cd,'toDelete':_0x9c49ba},'folders':{'toCreate':_0x192da8},'counts':{'segments':{'new':_0x543192['length'],'changed':_0x115d41[_0x5e46f3(0x19a)],'unchanged':_0x1c59b8[_0x5e46f3(0x19a)],'toDelete':_0x10a50e['length']},'journeys':{'new':_0x433b8c['length'],'changed':_0x255681[_0x5e46f3(0x19a)],'unchanged':_0xa76e79[_0x5e46f3(0x19a)],'toDelete':_0x81ec05[_0x5e46f3(0x19a)]},'activations':{'create':_0x1dfaa8[_0x5e46f3(0x19a)],'update':_0x3c93cd[_0x5e46f3(0x19a)],'delete':_0x9c49ba[_0x5e46f3(0x19a)]},'folders':_0x192da8[_0x5e46f3(0x19a)]},'hasChanges':_0x50be4b||_0x51e72b||_0x41acc2||_0x44d594};}export async function buildPushExecutionContext(_0x5c0591,_0x10356d,_0x7731f4,_0x40504c,_0x2d5f09,_0x3e369a){const _0x18da52=a128_0x54e8ba,_0x3fff10=extractRootFolderId(_0x7731f4),{pathToId:_0x2e0462,idToPath:_0x371ae0}=buildFolderMaps(_0x2d5f09),_0x1ad36e=buildSegmentNameToIdMap(_0x40504c),_0x515be7=new Map(),{batchAsync:_0x5eacfb}=await import(_0x18da52(0x1ae)),[_0x3aed06,_0x209ac5]=await Promise['all']([_0x5c0591[_0x18da52(0x11b)][_0x18da52(0x204)](),_0x5c0591[_0x18da52(0x1d6)]['list'](),((async()=>{!_0x3e369a&&_0x40504c['length']>0x0&&await _0x5eacfb(_0x40504c,async _0x391c3f=>{const _0x1af119=a128_0x16b6,_0x166ad9=await _0x5c0591[_0x1af119(0x132)][_0x1af119(0x179)](_0x10356d,_0x391c3f['id']);_0x515be7[_0x1af119(0x12f)](_0x391c3f['id'],_0x166ad9);});})())]),{emailToId:_0x527f2b,idToEmail:_0x36ccfb}=_0x3aed06,_0x20b56c=buildConnectionMaps(_0x209ac5);return{'rootFolderId':_0x3fff10,'folderPathToId':_0x2e0462,'folderIdToPath':_0x371ae0,'segmentNameToId':_0x1ad36e,'activationsBySegmentId':_0x515be7,'emailToIdMap':_0x527f2b,'idToEmailMap':_0x36ccfb,'connectionNameToIdMap':_0x20b56c[_0x18da52(0x211)],'connectionIdToNameMap':_0x20b56c[_0x18da52(0x1d9)],'connectionNameToTypeMap':_0x20b56c['nameToType']};}export function createPushYamlContextForBundle(_0x43c834,_0x4039d1,_0x11b774,_0x19c49d,_0x23b0cf,_0x1d0fad,_0xca7907,_0x1d5eca){const {existingLocalSegmentNames:_0x44ca71,localExpandedRuleToNames:_0x180ed7}=_0x19c49d,_0x2a34eb=new Set(),_0x47f8f7=new Map(),_0x3c74fb=new Map(),_0x4603cd=new Map(),_0x7a0824=createJumpTargetCache(),_0x4c4493=new Map(),_0x472f6d=new Map(),_0x380f4a=new Set();let _0xa90149;const _0x30db09=_0x3773ab=>{const _0x5dd9c3={'resolveSegment':async _0x3e88bf=>{const _0x49f233=a128_0x16b6,_0x3a703e=_0x4603cd['get'](_0x3e88bf);if(_0x3a703e!==undefined)return{'name':_0x3a703e,'isJourneyLocal':!![]};try{const _0x244203=await fetchSegment(_0x43c834,_0x4039d1,_0x3e88bf,_0x11b774);if(!_0x244203)throw new Error(_0x49f233(0x1b3));const _0x1ed16b=generateJourneyLocalName(_0x244203[_0x49f233(0x13a)]),_0x375f54=_0x244203[_0x49f233(0x153)]===SEGMENT_KIND_JOURNEY&&_0x1ed16b!==undefined;let _0x1c9f6e=_0x244203[_0x49f233(0x13a)],_0x111dbe;if(_0x375f54&&_0x244203[_0x49f233(0x1c5)]){const _0x510e96=apiRuleToYaml(_0x244203['rule']);_0x472f6d[_0x49f233(0x12f)](_0x3e88bf,_0x510e96);const _0x2a5091=async _0xa05344=>{const _0x1139c2=_0x49f233,_0x4759ee=collectSegmentRefsFromRule(_0xa05344);for(const _0x54057c of _0x4759ee){if(!_0x472f6d[_0x1139c2(0x1b8)](_0x54057c))try{const _0x157045=await fetchSegment(_0x43c834,_0x4039d1,_0x54057c,_0x11b774);if(_0x157045?.[_0x1139c2(0x1c5)]){const _0x408b4d=apiRuleToYaml(_0x157045['rule']);_0x472f6d[_0x1139c2(0x12f)](_0x54057c,_0x408b4d),await _0x2a5091(_0x408b4d);}}catch(_0x3c457b){logger['debug'](_0x1139c2(0x1bd)+_0x54057c+':\x20'+_0x3c457b);}}};await _0x2a5091(_0x510e96);const _0x47a5f3=serializeExpandedRule(_0x510e96,_0x472f6d),_0x4e3c0d=_0x180ed7[_0x49f233(0x17e)](_0x47a5f3);if(_0x4e3c0d&&_0x4e3c0d[_0x49f233(0x19a)]>0x0){const _0x29c64f=_0x47f8f7['get'](_0x47a5f3)||0x0,_0x40f39b=_0x4e3c0d[_0x29c64f]||_0x4e3c0d[_0x4e3c0d[_0x49f233(0x19a)]-0x1];_0x47f8f7[_0x49f233(0x12f)](_0x47a5f3,_0x29c64f+0x1),_0x1c9f6e=_0x40f39b,_0x2a34eb[_0x49f233(0x201)](_0x1c9f6e),_0x4603cd[_0x49f233(0x12f)](_0x3e88bf,_0x1c9f6e);const _0x23d3eb=await resolveRuleSegmentRefs(_0x510e96,async _0x3d5789=>{const _0x491f7f=_0x49f233,_0x22ac67=_0x4603cd[_0x491f7f(0x17e)](_0x3d5789);if(_0x22ac67)return _0x22ac67;const _0x2db93f=await _0xa90149[_0x491f7f(0x144)](_0x3d5789);return _0x2db93f[_0x491f7f(0x13a)];});_0x111dbe={'description':_0x244203[_0x49f233(0x1ba)],'rule':_0x23d3eb};}else{const _0x3159ed=_0x4c4493['get'](_0x47a5f3);if(_0x3159ed)_0x1c9f6e=_0x3159ed,_0x4603cd['set'](_0x3e88bf,_0x1c9f6e);else{if(_0x1ed16b){let _0x4e72fa=_0x1ed16b,_0x2eb551=0x2;while(_0x2a34eb[_0x49f233(0x1b8)](_0x4e72fa)||_0x44ca71[_0x49f233(0x1b8)](_0x4e72fa)){_0x4e72fa=_0x1ed16b+'_'+_0x2eb551,_0x2eb551++;}_0x2a34eb[_0x49f233(0x201)](_0x4e72fa),_0x1c9f6e=_0x4e72fa;}_0x4603cd[_0x49f233(0x12f)](_0x3e88bf,_0x1c9f6e),_0x4c4493[_0x49f233(0x12f)](_0x47a5f3,_0x1c9f6e);const _0x5f3b44=await resolveRuleSegmentRefs(_0x510e96,async _0x52c1e6=>{const _0x5c96ee=_0x49f233,_0x9e068c=_0x4603cd[_0x5c96ee(0x17e)](_0x52c1e6);if(_0x9e068c)return _0x9e068c;const _0x478e1d=await _0xa90149[_0x5c96ee(0x144)](_0x52c1e6);return _0x478e1d[_0x5c96ee(0x13a)];});_0x111dbe={'description':_0x244203[_0x49f233(0x1ba)],'rule':_0x5f3b44};}}}return{'name':_0x1c9f6e,'isJourneyLocal':_0x375f54,'definition':_0x111dbe};}catch(_0xd7950e){return logger['debug'](_0x49f233(0x14d)+_0x3e88bf+':\x20'+_0xd7950e),{'name':_0x3e88bf,'isJourneyLocal':![]};}},'resolveActivation':async _0x250674=>{const _0xe21360=a128_0x16b6,_0x48c4b0=_0x3c74fb['get'](_0x250674);if(_0x48c4b0!==undefined)return{'name':_0x48c4b0,'isJourneyLocal':!![]};try{let _0x10a046=_0xca7907?.[_0xe21360(0x17e)](_0x250674);!_0x10a046&&(_0x10a046=await _0x43c834[_0xe21360(0x13c)][_0xe21360(0x221)](_0x3773ab,_0x250674));const _0x1d199e=_0x10a046[_0xe21360(0x19f)][_0xe21360(0x160)][_0xe21360(0x13a)]||_0x250674,_0x34e161=sanitizeYamlKey(_0x1d199e)||_0xe21360(0x1f9)+_0x250674,_0x1651a7=_0x34e161;_0x3c74fb[_0xe21360(0x12f)](_0x250674,_0x1651a7);const _0xe790ec=journeyActivationStepToYaml(_0x10a046,_0x23b0cf,_0x1d0fad);return{'name':_0x1651a7,'isJourneyLocal':!![],'definition':_0xe790ec};}catch(_0x6c248c){return logger[_0xe21360(0x187)](_0xe21360(0x12a)+_0x250674+':\x20'+_0x6c248c),{'name':_0x250674,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x39c847,_0x1ffe88)=>resolveJumpTarget(_0x39c847,_0x1ffe88,_0x7a0824,async _0x1b585e=>{const _0x40e928=a128_0x16b6,_0x3b47dd=_0x1d5eca?.[_0x40e928(0x17e)](_0x1b585e);if(_0x3b47dd)return _0x3b47dd;return _0x43c834[_0x40e928(0x13c)][_0x40e928(0x210)](_0x1b585e);})};return _0xa90149=_0x5dd9c3,_0x5dd9c3;},_0x28af7b=async _0x1e992a=>{const _0x4d35f7=a128_0x16b6,{collectSegmentIdsFromJourneyApi:_0x24441e}=await import(_0x4d35f7(0x1ed)),{batchAsync:_0x3fc09c}=await import(_0x4d35f7(0x1ae)),_0x57e80e=new Set();for(const _0x470092 of _0x1e992a){let _0x1c5d94=_0x1d5eca?.[_0x4d35f7(0x17e)](_0x470092);!_0x1c5d94&&(_0x1c5d94=await _0x43c834[_0x4d35f7(0x13c)]['getJourney'](_0x470092));const _0x52ee35=_0x24441e(_0x1c5d94);for(const _0x350e84 of _0x52ee35){_0x57e80e['add'](_0x350e84);}}let _0x35f900=Array['from'](_0x57e80e);while(_0x35f900[_0x4d35f7(0x19a)]>0x0){const _0x5e61a3=_0x35f900[_0x4d35f7(0x18e)](_0x19ef0b=>!_0x380f4a[_0x4d35f7(0x1b8)](_0x19ef0b));if(_0x5e61a3['length']===0x0)break;const _0x433920=await _0x3fc09c(_0x5e61a3,async _0x2517d=>{const _0x3d2c07=_0x4d35f7;_0x380f4a[_0x3d2c07(0x201)](_0x2517d);const _0x4d7a9f=await fetchSegment(_0x43c834,_0x4039d1,_0x2517d,_0x11b774);if(!_0x4d7a9f)return null;return{'segmentId':_0x2517d,'segment':_0x4d7a9f};},0xa),_0x56d7da=new Set();for(const _0x1e6649 of _0x433920){if(!_0x1e6649?.['segment']?.[_0x4d35f7(0x1c5)])continue;const _0x67a93d=apiRuleToYaml(_0x1e6649[_0x4d35f7(0x132)][_0x4d35f7(0x1c5)]);_0x472f6d[_0x4d35f7(0x12f)](_0x1e6649[_0x4d35f7(0x202)],_0x67a93d);const _0x22516d=collectSegmentRefsFromRule(_0x67a93d);for(const _0x10329a of _0x22516d){!_0x380f4a[_0x4d35f7(0x1b8)](_0x10329a)&&_0x56d7da[_0x4d35f7(0x201)](_0x10329a);}}_0x35f900=Array[_0x4d35f7(0x14a)](_0x56d7da);}};return{'createYamlContext':_0x30db09,'prefetchJourneySegments':_0x28af7b};}export async function executePushSegments(_0x5c0ed8,_0x2d7c64,_0x459d3a,_0x501474,_0x535835){const _0x470e5c=a128_0x54e8ba,{segmentDefToCreateRequest:_0x36986b,segmentDefToUpdateRequest:_0xbd6a33}=await import('./child-segment-yaml.js'),_0xdcf527=_0x459d3a[_0x470e5c(0x121)],_0x251c1c=0x5,_0x3f43a5=async _0x108032=>{const _0x52774c=_0x470e5c,_0x4b2178=_0x108032[_0x52774c(0x192)]?_0xdcf527[_0x52774c(0x17e)](_0x108032[_0x52774c(0x192)]):undefined;let _0x3b6093;const _0x5812cc={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x2ed237=_0x108032[_0x52774c(0x135)];if(_0x108032[_0x52774c(0x135)][_0x52774c(0x1c5)]){const _0x11bf52=createSegmentIdResolver(_0x459d3a[_0x52774c(0x152)],_0x108032[_0x52774c(0x135)][_0x52774c(0x13a)]),_0x2fe1c2=await resolveRuleSegmentIds(_0x108032[_0x52774c(0x135)][_0x52774c(0x1c5)],_0x11bf52);_0x2ed237={..._0x108032['yamlConfig'],'rule':_0x2fe1c2};}try{if(_0x108032[_0x52774c(0x184)]){_0x535835[_0x52774c(0x1fa)]?.({'type':_0x52774c(0x1f6),'name':_0x108032[_0x52774c(0x135)][_0x52774c(0x13a)]});const _0x656d4c=_0x36986b(_0x2ed237,_0x4b2178),_0x19130e=await _0x535835['withProgress'](_0x52774c(0x1da)+_0x108032[_0x52774c(0x135)][_0x52774c(0x13a)]+_0x52774c(0x17c),()=>_0x5c0ed8[_0x52774c(0x132)][_0x52774c(0x1af)](_0x501474[_0x52774c(0x21a)],_0x656d4c));_0x3b6093=_0x19130e[_0x52774c(0x198)]['id'],_0x459d3a['segmentNameToId'][_0x52774c(0x12f)](_0x108032[_0x52774c(0x135)][_0x52774c(0x13a)],_0x3b6093),_0x5812cc[_0x52774c(0x1a5)]={'name':_0x108032['yamlConfig'][_0x52774c(0x13a)],'id':_0x3b6093},_0x535835[_0x52774c(0x1fa)]?.({'type':_0x52774c(0x175),'name':_0x108032[_0x52774c(0x135)]['name'],'segmentId':_0x3b6093}),_0x535835[_0x52774c(0x214)]?.(_0x52774c(0x1ad)+_0x108032[_0x52774c(0x135)]['name']+'\x27'),_0x5812cc[_0x52774c(0x1ef)]=0x1;}else{if(_0x108032[_0x52774c(0x1e6)]){_0x535835[_0x52774c(0x1fa)]?.({'type':_0x52774c(0x1aa),'name':_0x108032[_0x52774c(0x135)][_0x52774c(0x13a)]});const _0x4a77e0=_0xbd6a33(_0x2ed237);_0x4b2178!==_0x108032[_0x52774c(0x215)]?.[_0x52774c(0x1c6)]&&(_0x4a77e0['segmentFolderId']=_0x4b2178?parseInt(_0x4b2178,0xa):undefined),await _0x535835[_0x52774c(0x186)](_0x52774c(0x1e9)+_0x108032[_0x52774c(0x135)]['name']+'\x27...',()=>_0x5c0ed8['segment'][_0x52774c(0x168)](_0x501474['parentId'],_0x108032[_0x52774c(0x215)]['id'],_0x4a77e0)),_0x3b6093=_0x108032[_0x52774c(0x215)]['id'],_0x535835['onProgress']?.({'type':_0x52774c(0x11d),'name':_0x108032[_0x52774c(0x135)][_0x52774c(0x13a)]}),_0x535835[_0x52774c(0x214)]?.(_0x52774c(0x1be)+_0x108032['yamlConfig'][_0x52774c(0x13a)]+'\x27'),_0x5812cc[_0x52774c(0x169)]=0x1;}else _0x3b6093=_0x108032[_0x52774c(0x215)]['id'];}}catch(_0x106c4c){const _0x517355=isHttp400Error(_0x106c4c),_0x51a9f4=_0x517355?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x48bff0=getErrorMessage(_0x106c4c);throw new SDKError(_0x51a9f4,'Failed\x20to\x20'+(_0x108032[_0x52774c(0x184)]?_0x52774c(0x130):'update')+_0x52774c(0x1c7)+_0x108032[_0x52774c(0x1b9)]+'\x0a\x20\x20'+_0x48bff0,_0x106c4c);}try{const _0x166c67=await syncActivationsForSegment(_0x5c0ed8,_0x501474[_0x52774c(0x21a)],_0x3b6093,_0x108032[_0x52774c(0x135)]['name'],_0x108032['activationActions'],_0x535835,_0x108032[_0x52774c(0x1b9)]);_0x5812cc[_0x52774c(0x1b0)]=_0x166c67;}catch(_0x4983c6){if(_0x4983c6 instanceof SDKError)throw _0x4983c6;throw new SDKError(ErrorCode[_0x52774c(0x207)],_0x52774c(0x220)+_0x108032[_0x52774c(0x135)][_0x52774c(0x13a)]+_0x52774c(0x1bf)+_0x108032[_0x52774c(0x1b9)]+'\x0a\x20\x20'+getErrorMessage(_0x4983c6),_0x4983c6);}return _0x5812cc;},_0x382289=await batchAsync(_0x2d7c64,_0x3f43a5,_0x251c1c),_0x589aed={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5b33f4 of _0x382289){_0x589aed[_0x470e5c(0x1ef)]+=_0x5b33f4[_0x470e5c(0x1ef)],_0x589aed[_0x470e5c(0x169)]+=_0x5b33f4[_0x470e5c(0x169)],_0x5b33f4[_0x470e5c(0x1a5)]&&_0x589aed['createdSegmentIds'][_0x470e5c(0x12f)](_0x5b33f4[_0x470e5c(0x1a5)][_0x470e5c(0x13a)],_0x5b33f4[_0x470e5c(0x1a5)]['id']),_0x589aed[_0x470e5c(0x1b0)][_0x470e5c(0x1ef)]+=_0x5b33f4[_0x470e5c(0x1b0)][_0x470e5c(0x1ef)],_0x589aed['activations'][_0x470e5c(0x169)]+=_0x5b33f4[_0x470e5c(0x1b0)][_0x470e5c(0x169)],_0x589aed['activations'][_0x470e5c(0x18c)]+=_0x5b33f4['activations']['deleted'];}return _0x589aed;}async function syncActivationsForSegment(_0x399969,_0x15ec4d,_0x30fe19,_0x8f1d91,_0x217b20,_0x3b17a2,_0x14ae52){const _0x3528b0=a128_0x54e8ba,_0x3c1716={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2f249f of _0x217b20){try{if(_0x2f249f[_0x3528b0(0x142)]===_0x3528b0(0x130)&&_0x2f249f[_0x3528b0(0x164)])_0x3b17a2[_0x3528b0(0x1fa)]?.({'type':_0x3528b0(0x1df),'segmentName':_0x8f1d91,'activationName':_0x2f249f['name']}),await _0x3b17a2[_0x3528b0(0x186)]('Creating\x20activation\x20\x27'+_0x2f249f[_0x3528b0(0x13a)]+_0x3528b0(0x17c),()=>_0x399969[_0x3528b0(0x132)][_0x3528b0(0x1e3)](_0x15ec4d,_0x30fe19,_0x2f249f[_0x3528b0(0x164)])),_0x3b17a2[_0x3528b0(0x1fa)]?.({'type':_0x3528b0(0x1ca),'segmentName':_0x8f1d91,'activationName':_0x2f249f[_0x3528b0(0x13a)]}),_0x3b17a2['logSuccess']?.(_0x3528b0(0x11c)+_0x2f249f[_0x3528b0(0x13a)]+'\x27'),_0x3c1716['created']++;else{if(_0x2f249f[_0x3528b0(0x142)]===_0x3528b0(0x12e)&&_0x2f249f[_0x3528b0(0x164)]&&_0x2f249f[_0x3528b0(0x1f0)])_0x3b17a2[_0x3528b0(0x1fa)]?.({'type':_0x3528b0(0x1d7),'segmentName':_0x8f1d91,'activationName':_0x2f249f[_0x3528b0(0x13a)]}),await _0x3b17a2[_0x3528b0(0x186)](_0x3528b0(0x21f)+_0x2f249f[_0x3528b0(0x13a)]+'\x27...',()=>_0x399969[_0x3528b0(0x132)]['updateActivation'](_0x15ec4d,_0x30fe19,_0x2f249f[_0x3528b0(0x1f0)]['id'],_0x2f249f['validatedRequest'])),_0x3b17a2[_0x3528b0(0x1fa)]?.({'type':_0x3528b0(0x208),'segmentName':_0x8f1d91,'activationName':_0x2f249f[_0x3528b0(0x13a)]}),_0x3b17a2[_0x3528b0(0x214)]?.('Updated\x20activation\x20\x27'+_0x2f249f[_0x3528b0(0x13a)]+'\x27'),_0x3c1716[_0x3528b0(0x169)]++;else _0x2f249f[_0x3528b0(0x142)]===_0x3528b0(0x131)&&_0x2f249f['existingActivation']&&(_0x3b17a2[_0x3528b0(0x1fa)]?.({'type':_0x3528b0(0x14f),'segmentName':_0x8f1d91,'activationName':_0x2f249f[_0x3528b0(0x13a)]}),await _0x3b17a2[_0x3528b0(0x186)](_0x3528b0(0x167)+_0x2f249f[_0x3528b0(0x13a)]+_0x3528b0(0x17c),()=>_0x399969[_0x3528b0(0x132)][_0x3528b0(0x15c)](_0x15ec4d,_0x30fe19,_0x2f249f[_0x3528b0(0x1f0)]['id'])),_0x3b17a2[_0x3528b0(0x1fa)]?.({'type':'activation_deleted','segmentName':_0x8f1d91,'activationName':_0x2f249f[_0x3528b0(0x13a)]}),_0x3b17a2['logDeleted']?.(_0x3528b0(0x145)+_0x2f249f[_0x3528b0(0x13a)]+'\x27'),_0x3c1716[_0x3528b0(0x18c)]++);}}catch(_0x129029){const _0x3fa285=isHttp400Error(_0x129029),_0x4977ca=_0x3fa285?ErrorCode[_0x3528b0(0x146)]:ErrorCode[_0x3528b0(0x207)],_0x5076df=getErrorMessage(_0x129029);throw new SDKError(_0x4977ca,_0x3528b0(0x148)+_0x2f249f[_0x3528b0(0x142)]+_0x3528b0(0x173)+_0x2f249f['name']+_0x3528b0(0x1bf)+_0x14ae52+_0x3528b0(0x174)+_0x5076df,_0x129029);}}return _0x3c1716;}export async function executePushFolders(_0x3652a1,_0x524dde,_0x186a77,_0x35ee3a,_0x41724a){const _0x1fa62f=a128_0x54e8ba,_0x6c2f2d=new Map(_0x186a77),_0x3836d5=sortFoldersByDepth(_0x524dde);for(const _0x44a13d of _0x3836d5){const _0x1927d3=_0x44a13d[_0x1fa62f(0x1bb)]('/'),_0x46ab2b=_0x1927d3[_0x1927d3[_0x1fa62f(0x19a)]-0x1],_0x235b67=_0x1927d3[_0x1fa62f(0x178)](0x0,-0x1)['join']('/'),_0x336bf6=_0x6c2f2d['get'](_0x235b67);_0x41724a[_0x1fa62f(0x1fa)]?.({'type':'folder_creating','folder':_0x44a13d});const _0x24e0c8={'name':_0x46ab2b,'parentFolderId':_0x336bf6},_0x2b0899=await _0x41724a[_0x1fa62f(0x186)](_0x1fa62f(0x1eb)+_0x44a13d+_0x1fa62f(0x17c),()=>_0x3652a1[_0x1fa62f(0x132)][_0x1fa62f(0x16a)](_0x35ee3a[_0x1fa62f(0x21a)],_0x24e0c8));_0x6c2f2d[_0x1fa62f(0x12f)](_0x44a13d,_0x2b0899[_0x1fa62f(0x198)]['id']),_0x41724a[_0x1fa62f(0x1fa)]?.({'type':'folder_created','folder':_0x44a13d,'folderId':_0x2b0899[_0x1fa62f(0x198)]['id']}),_0x41724a[_0x1fa62f(0x182)]?.(_0x1fa62f(0x217)+_0x44a13d+'\x27');}return _0x6c2f2d;}export async function executePushSegmentDeletions(_0x55f5b0,_0x2c8fba,_0x2004a6){const _0x500855=a128_0x54e8ba;if(_0x2c8fba['length']===0x0)return 0x0;const {batchAsync:_0x367f9a}=await import('../../utils/async.js'),_0x379951=0x5,_0x458f7a=await _0x367f9a(_0x2c8fba,async _0xac1db7=>{const _0x4a5586=a128_0x16b6;return _0x2004a6[_0x4a5586(0x1fa)]?.({'type':_0x4a5586(0x1b2),'name':_0xac1db7['name']}),await _0x55f5b0[_0x4a5586(0x132)][_0x4a5586(0x15d)](_0xac1db7['id']),_0x2004a6[_0x4a5586(0x1fa)]?.({'type':_0x4a5586(0x1a3),'name':_0xac1db7[_0x4a5586(0x13a)]}),_0x2004a6['logDeleted']?.(_0x4a5586(0x1a2)+_0xac1db7[_0x4a5586(0x13a)]+'\x27'),0x1;},_0x379951);return _0x458f7a[_0x500855(0x172)]((_0x2c5de7,_0x138b38)=>_0x2c5de7+_0x138b38,0x0);}function a128_0x16b6(_0x19d2af,_0x11b9db){_0x19d2af=_0x19d2af-0x117;const _0xa9a272=a128_0xa9a2();let _0x16b695=_0xa9a272[_0x19d2af];return _0x16b695;}export async function executePushJourneys(_0x3a1bb3,_0x483a1a,_0x10017b,_0x22e567,_0x225d85){const _0x1e0ee3=a128_0x54e8ba,{journeyDefToRequest:_0x4c46c6}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x3d9020,yamlRuleToApi:_0x12b503,validateSegmentRule:_0x56630a}=await import('./child-segment-yaml.js'),_0x13384e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x52d136=new Map(_0x10017b[_0x1e0ee3(0x152)]),_0xc517d3=0x5;for(let _0x59daae=0x0;_0x59daae<_0x483a1a[_0x1e0ee3(0x19a)];_0x59daae+=_0xc517d3){const _0x340480=_0x483a1a[_0x1e0ee3(0x178)](_0x59daae,_0x59daae+_0xc517d3),_0x4c5e3d=await Promise[_0x1e0ee3(0x16d)](_0x340480['map'](async _0x5c496d=>{const _0x370bb6=_0x1e0ee3;if(!_0x5c496d[_0x370bb6(0x184)]&&!_0x5c496d[_0x370bb6(0x1e6)])return{'action':_0x370bb6(0x19c),'name':_0x5c496d[_0x370bb6(0x135)][_0x370bb6(0x13a)],'journeyId':_0x5c496d['existingJourney']?.['id']};const _0x1c1984=_0x5c496d['folderPath']?_0x10017b['folderPathToId'][_0x370bb6(0x17e)](_0x5c496d[_0x370bb6(0x192)]):undefined;_0x225d85[_0x370bb6(0x1fa)]?.({'type':_0x5c496d[_0x370bb6(0x184)]?_0x370bb6(0x181):'journey_updating','name':_0x5c496d['yamlConfig'][_0x370bb6(0x13a)]});try{const _0x6c3c5c=await executeSingleJourneyPush(_0x3a1bb3,_0x5c496d,{..._0x10017b,'segmentNameToId':_0x52d136},{'parentId':_0x22e567[_0x370bb6(0x21a)],'rootFolderId':_0x22e567[_0x370bb6(0x13d)],'folderId':_0x1c1984,'verbose':_0x22e567[_0x370bb6(0x1a4)]},_0x225d85,{'journeyDefToRequest':_0x4c46c6,'activationDefToCreateRequest':_0x3d9020,'yamlRuleToApi':_0x12b503,'validateSegmentRule':_0x56630a});for(const [_0x5f1ec,_0x1d2e02]of _0x6c3c5c['embeddedSegmentNameToId']){_0x52d136[_0x370bb6(0x12f)](_0x5f1ec,_0x1d2e02),_0x13384e[_0x370bb6(0x1fe)][_0x370bb6(0x12f)](_0x5f1ec,_0x1d2e02);}if(_0x6c3c5c['action']===_0x370bb6(0x1ef))_0x225d85[_0x370bb6(0x1fa)]?.({'type':_0x370bb6(0x125),'name':_0x5c496d[_0x370bb6(0x135)][_0x370bb6(0x13a)],'journeyId':_0x6c3c5c[_0x370bb6(0x1e2)]}),_0x225d85['logSuccess']?.(_0x370bb6(0x15f)+_0x5c496d[_0x370bb6(0x135)][_0x370bb6(0x13a)]+'\x27'),_0x13384e[_0x370bb6(0x1ef)]++;else _0x6c3c5c[_0x370bb6(0x185)]===_0x370bb6(0x169)&&(_0x225d85['onProgress']?.({'type':_0x370bb6(0x1d0),'name':_0x5c496d[_0x370bb6(0x135)][_0x370bb6(0x13a)]}),_0x225d85[_0x370bb6(0x214)]?.(_0x370bb6(0x180)+_0x5c496d[_0x370bb6(0x135)][_0x370bb6(0x13a)]+'\x27'),_0x13384e[_0x370bb6(0x169)]++);return{'action':_0x6c3c5c[_0x370bb6(0x185)],'name':_0x5c496d[_0x370bb6(0x135)][_0x370bb6(0x13a)],'journeyId':_0x6c3c5c[_0x370bb6(0x1e2)]};}catch(_0x5af2be){const _0x50949e=isHttp400Error(_0x5af2be),_0x5878c1=_0x50949e?ErrorCode[_0x370bb6(0x20d)]:ErrorCode[_0x370bb6(0x158)],_0x469bd0=getErrorMessage(_0x5af2be);throw new SDKError(_0x5878c1,_0x370bb6(0x148)+(_0x5c496d[_0x370bb6(0x184)]?_0x370bb6(0x130):_0x370bb6(0x12e))+_0x370bb6(0x163)+_0x5c496d[_0x370bb6(0x1b9)]+_0x370bb6(0x174)+_0x469bd0,_0x5af2be);}}));_0x13384e[_0x1e0ee3(0x1a1)][_0x1e0ee3(0x197)](..._0x4c5e3d);}return _0x13384e;}async function matchExistingJourneySegments(_0x105726,_0x4f7e31,_0x332c4f,_0x4c1dca,_0x3a5120){const _0x55ef37=a128_0x54e8ba;if(!_0x4f7e31[_0x55ef37(0x18d)]||!_0x4f7e31[_0x55ef37(0x135)][_0x55ef37(0x1e4)])return;const _0x4b43dc=new Map(),_0x27c16d=new Set();for(const _0x16f9d2 of Object[_0x55ef37(0x14b)](_0x4f7e31[_0x55ef37(0x135)][_0x55ef37(0x1e4)])){const _0x4b31f3=generateDeterministicJourneySegmentName(_0x4f7e31[_0x55ef37(0x135)][_0x55ef37(0x13a)],_0x16f9d2);_0x4b43dc['set'](_0x4b31f3,_0x16f9d2),_0x27c16d[_0x55ef37(0x201)](_0x16f9d2);}const _0x11194f=[],_0x2d0109=collectSegmentIdsFromJourneyApi(_0x4f7e31[_0x55ef37(0x18d)]);for(const _0x17dd4f of _0x2d0109){const _0x5212c8=await fetchSegment(_0x105726,_0x332c4f,_0x17dd4f,_0x4c1dca);if(!_0x5212c8?.[_0x55ef37(0x13a)])continue;const _0x5681c5=_0x4b43dc[_0x55ef37(0x17e)](_0x5212c8[_0x55ef37(0x13a)]);_0x5681c5?(_0x3a5120[_0x55ef37(0x12f)](_0x5681c5,_0x17dd4f),_0x27c16d[_0x55ef37(0x131)](_0x5681c5)):_0x11194f['push']({'id':_0x17dd4f,'seg':_0x5212c8});}if(_0x27c16d[_0x55ef37(0x1a9)]>0x0&&_0x11194f['length']>0x0){const {localExpandedRuleToNames:_0x2173b8}=buildLocalExpandedRuleMappings(_0x4f7e31[_0x55ef37(0x135)]),_0x697d3c=new Map();for(const {id:_0xfabef0,seg:_0x2e5698}of _0x11194f){if(_0x2e5698[_0x55ef37(0x1c5)]){const _0x3d45d1=apiRuleToYaml(_0x2e5698['rule']);_0x697d3c[_0x55ef37(0x12f)](_0xfabef0,_0x3d45d1);}}for(const {id:_0x2a0567,seg:_0x4a3d52}of _0x11194f){if(!_0x4a3d52[_0x55ef37(0x1c5)])continue;const _0x436ee5=_0x697d3c['get'](_0x2a0567);if(!_0x436ee5)continue;const _0x44323d=serializeExpandedRule(_0x436ee5,_0x697d3c),_0xaab6ae=_0x2173b8['get'](_0x44323d);if(_0xaab6ae){const _0x11cafa=_0xaab6ae[_0x55ef37(0x188)](_0x5e2d19=>_0x27c16d[_0x55ef37(0x1b8)](_0x5e2d19));_0x11cafa&&(_0x3a5120['set'](_0x11cafa,_0x2a0567),_0x27c16d[_0x55ef37(0x131)](_0x11cafa),logger[_0x55ef37(0x187)](_0x55ef37(0x165)+_0x4a3d52['name']+_0x55ef37(0x1b5)+_0x11cafa+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x40aa63,_0x1ff6ae,_0x306558,_0x954e9e,_0x4236de,_0x4b106f){const _0x3233a6=a128_0x54e8ba,{journeyDefToRequest:_0x150609,activationDefToCreateRequest:_0x502b17,yamlRuleToApi:_0x49c8ad,validateSegmentRule:_0x5567b1}=_0x4b106f,_0x40544e=new Map(),_0xb856c6=new Map();recoverSegmentIdsFromPushRecovery(_0x1ff6ae,_0x40544e,_0x306558[_0x3233a6(0x152)]);const _0x380df2=new Map(),_0x570927=new Map(),_0x5ad396=new Map();let _0x851159;const _0x2ed11c=async()=>{const _0x58d927=_0x3233a6;if(_0x851159)return;_0x851159=new Map();if(!_0x1ff6ae['existingJourney'])return;const _0x293180=await _0x40aa63['journey']['listActivations'](_0x1ff6ae['existingJourney']['id']);for(const _0x1b3190 of _0x293180){const _0x5c2f0a=journeyActivationStepToYaml(_0x1b3190,_0x306558[_0x58d927(0x21b)],_0x306558[_0x58d927(0x1c8)]),_0x27bd10=activationSignature(_0x5c2f0a);!_0x851159[_0x58d927(0x1b8)](_0x27bd10)&&_0x851159[_0x58d927(0x12f)](_0x27bd10,_0x1b3190['id']),_0x5c2f0a['name']&&_0xb856c6[_0x58d927(0x12f)](_0x5c2f0a[_0x58d927(0x13a)],_0x1b3190['id']);}};await matchExistingJourneySegments(_0x40aa63,_0x1ff6ae,_0x954e9e[_0x3233a6(0x21a)],_0x306558[_0x3233a6(0x18b)],_0x306558[_0x3233a6(0x152)]);const _0x2e7d38={'resolveSegmentId':async _0x5a5a63=>{const _0xaa9af5=_0x3233a6,_0x15b679=_0x306558[_0xaa9af5(0x152)]['get'](_0x5a5a63);if(!_0x15b679)throw new SDKError(ErrorCode[_0xaa9af5(0x11e)],_0xaa9af5(0x191)+_0x5a5a63+_0xaa9af5(0x127)+_0x1ff6ae[_0xaa9af5(0x135)][_0xaa9af5(0x13a)]+')');return _0x15b679;},'resolveEmbeddedSegmentId':async(_0x16bf5a,_0x1d366d)=>{const _0x20afab=_0x3233a6,_0x33e90f=_0x306558[_0x20afab(0x152)]['get'](_0x16bf5a);if(_0x33e90f)return _0x33e90f;const _0x214917=_0x306558['existingSegments'][_0x20afab(0x188)](_0x47bc20=>_0x47bc20[_0x20afab(0x13a)]===_0x16bf5a);if(_0x214917)return _0x306558['segmentNameToId'][_0x20afab(0x12f)](_0x16bf5a,_0x214917['id']),_0x214917['id'];if(_0x1ff6ae[_0x20afab(0x184)]){const {stageName:_0xc70c2,criteriaName:_0x452fe7}=findSegmentCriteriaLocation(_0x1ff6ae['yamlConfig'],_0x16bf5a);return _0x5567b1(_0x16bf5a,_0x1d366d[_0x20afab(0x1c5)]),_0x570927[_0x20afab(0x12f)](_0x16bf5a,{'definition':_0x1d366d,'stageName':_0xc70c2,'criteriaName':_0x452fe7}),createPendingSegmentId(_0x16bf5a);}const _0x2952e2=_0x1ff6ae['existingJourney']?.['id'];if(!_0x2952e2)throw new SDKError(ErrorCode[_0x20afab(0x1db)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x14babc=_0x380df2[_0x20afab(0x17e)](_0x16bf5a);if(_0x14babc)return _0x14babc;const _0x5d7ba7=((async()=>{const _0x26efb9=_0x20afab;_0x5567b1(_0x16bf5a,_0x1d366d['rule']);const _0x42dfde=generateDeterministicJourneySegmentName(_0x1ff6ae[_0x26efb9(0x135)]['name'],_0x16bf5a),_0x1ee391=_0x306558[_0x26efb9(0x18b)]['find'](_0x6b5c9a=>_0x6b5c9a['name']===_0x42dfde),_0x1fe3d0=createSegmentIdResolver(_0x306558[_0x26efb9(0x152)],_0x16bf5a),_0x2bdf1e=await resolveRuleSegmentIds(_0x1d366d[_0x26efb9(0x1c5)],_0x1fe3d0);let _0x4d0b2a;return _0x1ee391?(await _0x40aa63[_0x26efb9(0x132)][_0x26efb9(0x168)](_0x954e9e[_0x26efb9(0x21a)],_0x1ee391['id'],{'description':_0x1d366d[_0x26efb9(0x1ba)]||_0x26efb9(0x195)+_0x16bf5a,'rule':_0x49c8ad(_0x2bdf1e,!![]),'countPopulation':!![]}),_0x4d0b2a=_0x1ee391['id'],saveSegmentToPushRecovery(_0x1ff6ae[_0x26efb9(0x1b9)],_0x1ff6ae[_0x26efb9(0x135)][_0x26efb9(0x13a)],_0x16bf5a,{'segmentId':_0x4d0b2a,'uniqueServerName':_0x42dfde,'createdAt':new Date()[_0x26efb9(0x1e1)]()})):_0x4d0b2a=await createOrRecoverEmbeddedSegment(_0x40aa63,_0x1ff6ae,{'localName':_0x16bf5a,'uniqueSegmentName':_0x42dfde,'description':_0x1d366d[_0x26efb9(0x1ba)]||_0x26efb9(0x195)+_0x16bf5a,'journeyId':_0x2952e2,'resolvedRule':_0x2bdf1e,'parentId':_0x954e9e[_0x26efb9(0x21a)],'folderId':_0x954e9e[_0x26efb9(0x13d)]||''},_0x49c8ad),_0x306558[_0x26efb9(0x152)]['set'](_0x16bf5a,_0x4d0b2a),_0x40544e['set'](_0x16bf5a,_0x4d0b2a),_0x4d0b2a;})());_0x380df2[_0x20afab(0x12f)](_0x16bf5a,_0x5d7ba7);try{return await _0x5d7ba7;}finally{_0x380df2[_0x20afab(0x131)](_0x16bf5a);}},'resolveActivationId':async _0xee89c7=>{const _0x4edd76=_0x3233a6,_0x9a1cd2=_0xb856c6[_0x4edd76(0x17e)](_0xee89c7);if(_0x9a1cd2)return _0x9a1cd2;if(_0x1ff6ae[_0x4edd76(0x18d)]){await _0x2ed11c();const _0x117a42=_0xb856c6['get'](_0xee89c7);if(_0x117a42)return _0x117a42;}throw new SDKError(ErrorCode[_0x4edd76(0x141)],'Activation\x20not\x20found:\x20'+_0xee89c7+'\x20(referenced\x20in\x20journey\x20'+_0x1ff6ae[_0x4edd76(0x135)][_0x4edd76(0x13a)]+_0x4edd76(0x21e)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x5d4bd5,_0x1e17e1)=>{const _0x2a5094=_0x3233a6,_0x2a4b2a=_0xb856c6[_0x2a5094(0x17e)](_0x5d4bd5);if(_0x2a4b2a)return _0x2a4b2a;if(_0x1ff6ae[_0x2a5094(0x184)])return _0x5ad396[_0x2a5094(0x12f)](_0x5d4bd5,_0x1e17e1),createPendingActivationId(_0x5d4bd5);if(_0x1ff6ae[_0x2a5094(0x18d)]){await _0x2ed11c();const _0x2fa74c=_0xb856c6[_0x2a5094(0x17e)](_0x1e17e1['name']);if(_0x2fa74c)return _0xb856c6[_0x2a5094(0x12f)](_0x5d4bd5,_0x2fa74c),_0x2fa74c;const _0x94822a=activationSignature(_0x1e17e1),_0xefa455=_0x851159?.['get'](_0x94822a);if(_0xefa455)return _0xb856c6[_0x2a5094(0x12f)](_0x5d4bd5,_0xefa455),_0xefa455;const _0x13c91f=await _0x502b17(_0x1e17e1,_0x306558['activationContext']),_0x574402={..._0x13c91f,..._0x1e17e1[_0x2a5094(0x137)]!==undefined&&{'runAfterJourneyRefresh':_0x1e17e1['run_after_journey_refresh']}},_0x5eb721=await _0x40aa63[_0x2a5094(0x13c)][_0x2a5094(0x1e3)](_0x1ff6ae[_0x2a5094(0x18d)]['id'],_0x574402);return _0xb856c6[_0x2a5094(0x12f)](_0x5d4bd5,_0x5eb721['id']),_0x5eb721['id'];}throw new SDKError(ErrorCode[_0x2a5094(0x1db)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x168b9c=>{const _0x2741ef=_0x3233a6;try{return await _0x40aa63[_0x2741ef(0x13c)][_0x2741ef(0x14e)](_0x954e9e[_0x2741ef(0x21a)],_0x168b9c);}catch(_0x1e2033){throw new SDKError(ErrorCode[_0x2741ef(0x141)],'Journey\x20\x27'+_0x168b9c+_0x2741ef(0x12d)+_0x1ff6ae[_0x2741ef(0x135)][_0x2741ef(0x13a)]+'\x27)',_0x1e2033);}},'resolveStageId':async(_0x3f3ebe,_0x3b4903)=>{const _0x54ddde=_0x3233a6,_0x2f10c1=await _0x40aa63[_0x54ddde(0x13c)][_0x54ddde(0x210)](_0x3f3ebe),_0x57b4a4=_0x2f10c1[_0x54ddde(0x19f)][_0x54ddde(0x12c)]['find'](_0x44acec=>_0x44acec[_0x54ddde(0x13a)][_0x54ddde(0x150)]()===_0x3b4903['toLowerCase']());if(!_0x57b4a4?.['id'])throw new SDKError(ErrorCode[_0x54ddde(0x141)],_0x54ddde(0x1ab)+_0x3b4903+_0x54ddde(0x1c1)+(_0x2f10c1[_0x54ddde(0x19f)][_0x54ddde(0x1f7)]||_0x2f10c1[_0x54ddde(0x19f)][_0x54ddde(0x13a)])+'\x27');return _0x57b4a4['id'];}},_0x54f6b0=await _0x150609(_0x1ff6ae[_0x3233a6(0x135)],_0x954e9e['parentId'],_0x2e7d38),_0x1b8f75=_0x954e9e[_0x3233a6(0x1ce)]||_0x954e9e['rootFolderId'];_0x1b8f75&&(_0x54f6b0[_0x3233a6(0x1e0)]={'parentFolder':{'data':{'id':_0x1b8f75,'type':_0x3233a6(0x1cb)}}});if(_0x1ff6ae['isNew']){if(_0x570927[_0x3233a6(0x1a9)]>0x0||_0x5ad396[_0x3233a6(0x1a9)]>0x0)return await executeThreeStepJourneyCreate(_0x40aa63,_0x1ff6ae,_0x54f6b0,{'pendingEmbeddedSegments':_0x570927,'pendingEmbeddedActivations':_0x5ad396,'embeddedSegmentNameToId':_0x40544e,'journeyActivationNameToId':_0xb856c6},{..._0x954e9e,'effectiveFolderId':_0x1b8f75},_0x306558,_0x4236de,_0x4b106f);else{ensureJourneyDefaults(_0x54f6b0[_0x3233a6(0x19f)]);const _0x3bf8a2=await _0x40aa63['journey'][_0x3233a6(0x130)](_0x54f6b0);return deletePushRecovery(_0x1ff6ae[_0x3233a6(0x1b9)]),{'action':_0x3233a6(0x1ef),'journeyId':_0x3bf8a2['id'],'embeddedSegmentNameToId':_0x40544e};}}else{if(_0x1ff6ae[_0x3233a6(0x1e6)]&&_0x1ff6ae[_0x3233a6(0x18d)]){_0x54f6b0['id']=_0x1ff6ae[_0x3233a6(0x18d)]['id'];const _0x1f05ab=_0x54f6b0[_0x3233a6(0x19f)];_0x1ff6ae['existingJourney'][_0x3233a6(0x19f)]?.[_0x3233a6(0x1f7)]&&(_0x1f05ab[_0x3233a6(0x1f7)]=_0x1ff6ae[_0x3233a6(0x18d)][_0x3233a6(0x19f)][_0x3233a6(0x1f7)]);const _0x478921=_0x1ff6ae[_0x3233a6(0x18d)][_0x3233a6(0x19f)]?.[_0x3233a6(0x12c)];return _0x478921&&_0x54f6b0[_0x3233a6(0x19f)][_0x3233a6(0x12c)]&&injectExistingStageIds(_0x54f6b0['attributes'][_0x3233a6(0x12c)],_0x478921),ensureJourneyDefaults(_0x1f05ab),await _0x40aa63[_0x3233a6(0x13c)]['update'](_0x1ff6ae['existingJourney']['id'],_0x54f6b0),deletePushRecovery(_0x1ff6ae[_0x3233a6(0x1b9)]),{'action':_0x3233a6(0x169),'journeyId':_0x1ff6ae[_0x3233a6(0x18d)]['id'],'embeddedSegmentNameToId':_0x40544e};}}return deletePushRecovery(_0x1ff6ae[_0x3233a6(0x1b9)]),{'action':_0x3233a6(0x19c),'journeyId':_0x1ff6ae[_0x3233a6(0x18d)]?.['id'],'embeddedSegmentNameToId':_0x40544e};}function findSegmentCriteriaLocation(_0x2ccbef,_0x2e6347){const _0x41cafd=a128_0x54e8ba,_0x24ffb5=_0x2ccbef[_0x41cafd(0x19d)]||_0x2ccbef[_0x41cafd(0x19b)]?.[0x0]?.[_0x41cafd(0x19d)]||[];let _0x1a7a73='entry',_0x294a6d=_0x2e6347;const _0x18a311=_0x2ccbef['goal']||_0x2ccbef['journeys']?.[0x0]?.[_0x41cafd(0x13f)];if(_0x18a311?.[_0x41cafd(0x132)]===_0x2e6347)return{'stageName':_0x41cafd(0x13f),'criteriaName':_0x18a311[_0x41cafd(0x13a)]||_0x2e6347};_0x5c767c:for(const _0x3d308b of _0x24ffb5){if(_0x3d308b['entry_criteria']?.[_0x41cafd(0x132)]===_0x2e6347){_0x1a7a73=_0x3d308b[_0x41cafd(0x13a)],_0x294a6d=_0x3d308b[_0x41cafd(0x136)][_0x41cafd(0x13a)]||_0x2e6347;break;}if(_0x3d308b[_0x41cafd(0x1bc)])for(const _0xde628 of _0x3d308b[_0x41cafd(0x1bc)]){if(_0xde628[_0x41cafd(0x142)]==='decision_point'&&_0xde628['with']?.[_0x41cafd(0x13b)])for(const _0x5d443e of _0xde628[_0x41cafd(0x161)][_0x41cafd(0x13b)]){if(_0x5d443e['segment']===_0x2e6347){_0x1a7a73=_0x3d308b[_0x41cafd(0x13a)],_0x294a6d=_0x5d443e['name']||_0x2e6347;break _0x5c767c;}}}}return{'stageName':_0x1a7a73,'criteriaName':_0x294a6d};}async function executeThreeStepJourneyCreate(_0x3bbbd9,_0x134f91,_0x4eb1e0,_0x3af307,_0x6b9f9e,_0x104e3a,_0x42ddbb,_0xfeb106){const _0x126d43=a128_0x54e8ba,{activationDefToCreateRequest:_0x5c2388,yamlRuleToApi:_0x5d6f36}=_0xfeb106,{pendingEmbeddedSegments:_0x19c71f,pendingEmbeddedActivations:_0x495778,embeddedSegmentNameToId:_0x236239}=_0x3af307,_0x4e4f29=JSON[_0x126d43(0x159)](JSON[_0x126d43(0x209)](_0x4eb1e0));ensureJourneyDefaults(_0x4e4f29[_0x126d43(0x19f)]),stripPendingIds(_0x4e4f29);const _0x5da913=await _0x3bbbd9[_0x126d43(0x13c)][_0x126d43(0x130)](_0x4e4f29),_0x5c4b71=_0x5da913['id'],_0x49583c=new Map();for(const _0x30573d of _0x5da913[_0x126d43(0x19f)][_0x126d43(0x12c)]){_0x49583c[_0x126d43(0x12f)](_0x30573d[_0x126d43(0x13a)]['toLowerCase'](),_0x30573d['id']);}recoverSegmentIdsFromPushRecovery(_0x134f91,_0x236239,_0x104e3a[_0x126d43(0x152)]);for(const [_0x1343d7,{definition:_0x5525eb}]of _0x19c71f){if(_0x236239[_0x126d43(0x1b8)](_0x1343d7)){_0x42ddbb[_0x126d43(0x1fa)]?.({'type':_0x126d43(0x20c),'journeyName':_0x134f91[_0x126d43(0x135)][_0x126d43(0x13a)],'segmentName':_0x1343d7});continue;}const _0x545dc4=generateDeterministicJourneySegmentName(_0x134f91[_0x126d43(0x135)][_0x126d43(0x13a)],_0x1343d7);_0x42ddbb[_0x126d43(0x1fa)]?.({'type':_0x126d43(0x1d1),'journeyName':_0x134f91[_0x126d43(0x135)][_0x126d43(0x13a)],'segmentName':_0x1343d7});const _0x208d76=createSegmentIdResolver(_0x104e3a['segmentNameToId'],_0x1343d7),_0x2846e8=await resolveRuleSegmentIds(_0x5525eb[_0x126d43(0x1c5)],_0x208d76),_0x9c46c8=await createOrRecoverEmbeddedSegment(_0x3bbbd9,_0x134f91,{'localName':_0x1343d7,'uniqueSegmentName':_0x545dc4,'description':_0x5525eb['description']||_0x126d43(0x195)+_0x1343d7,'journeyId':_0x5c4b71,'resolvedRule':_0x2846e8,'parentId':_0x6b9f9e[_0x126d43(0x21a)],'folderId':_0x6b9f9e[_0x126d43(0x1f3)]||''},_0x5d6f36);_0x236239['set'](_0x1343d7,_0x9c46c8),_0x104e3a[_0x126d43(0x152)]['set'](_0x1343d7,_0x9c46c8),_0x42ddbb['onProgress']?.({'type':_0x126d43(0x20c),'journeyName':_0x134f91[_0x126d43(0x135)][_0x126d43(0x13a)],'segmentName':_0x1343d7});}const _0x2188d3=new Map();for(const [_0x23c46c,_0x31b52e]of _0x495778){_0x42ddbb[_0x126d43(0x1fa)]?.({'type':'embedded_activation_creating','journeyName':_0x134f91[_0x126d43(0x135)]['name'],'activationName':_0x23c46c});const _0x250dd1=await _0x5c2388(_0x31b52e,_0x104e3a[_0x126d43(0x1dd)]),_0x58127e={..._0x250dd1,..._0x31b52e[_0x126d43(0x137)]!==undefined&&{'runAfterJourneyRefresh':_0x31b52e['run_after_journey_refresh']}},_0x3b50dd=await _0x3bbbd9['journey'][_0x126d43(0x1e3)](_0x5c4b71,_0x58127e);_0x2188d3[_0x126d43(0x12f)](_0x23c46c,_0x3b50dd['id']),_0x3af307[_0x126d43(0x1cf)][_0x126d43(0x12f)](_0x23c46c,_0x3b50dd['id']),_0x42ddbb[_0x126d43(0x1fa)]?.({'type':'embedded_activation_created','journeyName':_0x134f91[_0x126d43(0x135)][_0x126d43(0x13a)],'activationName':_0x23c46c});}const _0x9ae64e=JSON[_0x126d43(0x159)](JSON[_0x126d43(0x209)](_0x4eb1e0));return _0x9ae64e['id']=_0x5c4b71,ensureJourneyDefaults(_0x9ae64e[_0x126d43(0x19f)]),resolvePendingIdsInRequest(_0x9ae64e,_0x4eb1e0,_0x49583c,_0x236239,_0x2188d3,_0x42ddbb),await _0x3bbbd9['journey'][_0x126d43(0x12e)](_0x5c4b71,_0x9ae64e),deletePushRecovery(_0x134f91[_0x126d43(0x1b9)]),{'action':_0x126d43(0x1ef),'journeyId':_0x5c4b71,'embeddedSegmentNameToId':_0x236239};}export function stripWaitStepPendingIds(_0x56f14f){const _0x139f11=a128_0x54e8ba,_0x3265ef=_0x56f14f[_0x139f11(0x1cc)]&&isPendingSegmentId(_0x56f14f[_0x139f11(0x1cc)]),_0x3bf996=_0x56f14f[_0x139f11(0x1e7)]?.[_0x139f11(0x1f4)](_0x3c0e4e=>_0x3c0e4e[_0x139f11(0x202)]&&isPendingSegmentId(_0x3c0e4e[_0x139f11(0x202)]));(_0x3265ef||_0x3bf996)&&(_0x56f14f[_0x139f11(0x1a7)]=_0x139f11(0x1c3),_0x56f14f[_0x139f11(0x1ee)]=0x1,_0x56f14f['waitStepUnit']=_0x139f11(0x1f8),delete _0x56f14f['conditionSegmentId'],delete _0x56f14f[_0x139f11(0x118)],delete _0x56f14f[_0x139f11(0x1d5)],delete _0x56f14f[_0x139f11(0x1e7)]);}export function resolveWaitStepPendingIds(_0x597d64,_0x56ed16,_0x34f1bd,_0x5284a8){const _0x5d0228=a128_0x54e8ba;if(_0x56ed16['conditionSegmentId']&&isPendingSegmentId(_0x56ed16[_0x5d0228(0x1cc)])){const _0x406043=_0x34f1bd(_0x56ed16[_0x5d0228(0x1cc)],'stage\x20\x27'+_0x5284a8+_0x5d0228(0x218));_0x406043&&(_0x597d64['waitStepType']=_0x5d0228(0x11a),_0x597d64[_0x5d0228(0x1cc)]=_0x406043,delete _0x597d64[_0x5d0228(0x1ee)],delete _0x597d64[_0x5d0228(0x17d)],_0x56ed16['conditionTimeoutDuration']!==undefined&&(_0x597d64[_0x5d0228(0x118)]=_0x56ed16[_0x5d0228(0x118)]),_0x56ed16[_0x5d0228(0x1d5)]&&(_0x597d64[_0x5d0228(0x1d5)]=_0x56ed16[_0x5d0228(0x1d5)]));}if(_0x56ed16[_0x5d0228(0x1e7)]){const _0x5396f0=_0x56ed16[_0x5d0228(0x1e7)]['some'](_0x12f599=>_0x12f599['segmentId']&&isPendingSegmentId(_0x12f599['segmentId']));if(_0x5396f0){const _0x598c5d=_0x56ed16[_0x5d0228(0x1e7)][_0x5d0228(0x143)](_0xed8110=>{const _0x1d4d4f=_0x5d0228;if(_0xed8110[_0x1d4d4f(0x202)]&&isPendingSegmentId(_0xed8110[_0x1d4d4f(0x202)])){const _0x50298a=_0x34f1bd(_0xed8110[_0x1d4d4f(0x202)],'stage\x20\x27'+_0x5284a8+_0x1d4d4f(0x218));return{..._0xed8110,'segmentId':_0x50298a||_0xed8110[_0x1d4d4f(0x202)]};}return{..._0xed8110};});_0x597d64[_0x5d0228(0x1a7)]=_0x5d0228(0x11a),_0x597d64[_0x5d0228(0x1e7)]=_0x598c5d,delete _0x597d64['waitStep'],delete _0x597d64[_0x5d0228(0x17d)],delete _0x597d64[_0x5d0228(0x1cc)],delete _0x597d64[_0x5d0228(0x118)],delete _0x597d64[_0x5d0228(0x1d5)];}}}function stripPendingIds(_0x16ace6){const _0xb1fc33=a128_0x54e8ba;_0x16ace6[_0xb1fc33(0x19f)]['goal']?.[_0xb1fc33(0x202)]&&isPendingSegmentId(_0x16ace6[_0xb1fc33(0x19f)][_0xb1fc33(0x13f)][_0xb1fc33(0x202)])&&delete _0x16ace6[_0xb1fc33(0x19f)][_0xb1fc33(0x13f)];for(const _0x49aacf of _0x16ace6[_0xb1fc33(0x19f)][_0xb1fc33(0x12c)]||[]){_0x49aacf[_0xb1fc33(0x138)]?.[_0xb1fc33(0x202)]&&isPendingSegmentId(_0x49aacf[_0xb1fc33(0x138)][_0xb1fc33(0x202)])&&delete _0x49aacf[_0xb1fc33(0x138)];_0x49aacf['milestone']?.[_0xb1fc33(0x202)]&&isPendingSegmentId(_0x49aacf[_0xb1fc33(0x140)]['segmentId'])&&delete _0x49aacf[_0xb1fc33(0x140)];_0x49aacf[_0xb1fc33(0x13e)]&&(_0x49aacf[_0xb1fc33(0x13e)]=_0x49aacf[_0xb1fc33(0x13e)][_0xb1fc33(0x18e)](_0x227c0f=>!_0x227c0f['segmentId']||!isPendingSegmentId(_0x227c0f[_0xb1fc33(0x202)])));if(_0x49aacf[_0xb1fc33(0x1bc)])for(const _0x2d77bc of Object[_0xb1fc33(0x14b)](_0x49aacf[_0xb1fc33(0x1bc)])){const _0x15d027=_0x49aacf[_0xb1fc33(0x1bc)][_0x2d77bc];_0x15d027[_0xb1fc33(0x142)]===_0xb1fc33(0x16f)&&_0x15d027[_0xb1fc33(0x124)]&&isPendingActivationId(_0x15d027[_0xb1fc33(0x124)])&&(_0x15d027[_0xb1fc33(0x124)]='');if(_0x15d027[_0xb1fc33(0x142)]===_0xb1fc33(0x1fc)&&_0x15d027[_0xb1fc33(0x13b)])for(const _0x45f518 of _0x15d027['branches']){_0x45f518[_0xb1fc33(0x202)]&&isPendingSegmentId(_0x45f518[_0xb1fc33(0x202)])&&(_0x45f518[_0xb1fc33(0x202)]='');}_0x15d027[_0xb1fc33(0x142)]===_0xb1fc33(0x1c2)&&stripWaitStepPendingIds(_0x15d027);}}}function resolvePendingIdsInRequest(_0x3bc4ec,_0x8282d9,_0x58fb06,_0x2c9af2,_0x107316,_0x3f4eef){const _0x4a9bc2=a128_0x54e8ba,_0x3151d3=(_0x3b62d4,_0x5dd774)=>{const _0x53fb6c=a128_0x16b6;if(!isPendingSegmentId(_0x3b62d4))return _0x3b62d4;const _0x4eaa34=extractPendingSegmentName(_0x3b62d4),_0xe0bb51=_0x2c9af2[_0x53fb6c(0x17e)](_0x4eaa34);return!_0xe0bb51&&_0x3f4eef[_0x53fb6c(0x1b1)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x4eaa34+'\x27\x20for\x20'+_0x5dd774),_0xe0bb51;};if(_0x3bc4ec[_0x4a9bc2(0x19f)][_0x4a9bc2(0x13f)]?.[_0x4a9bc2(0x202)]&&isPendingSegmentId(_0x3bc4ec['attributes']['goal'][_0x4a9bc2(0x202)])){const _0x1eb7da=_0x3151d3(_0x3bc4ec[_0x4a9bc2(0x19f)][_0x4a9bc2(0x13f)]['segmentId'],_0x4a9bc2(0x1b7));_0x1eb7da&&(_0x3bc4ec[_0x4a9bc2(0x19f)][_0x4a9bc2(0x13f)][_0x4a9bc2(0x202)]=_0x1eb7da);}for(const _0x3357ea of _0x3bc4ec[_0x4a9bc2(0x19f)][_0x4a9bc2(0x12c)]||[]){const _0x4ea96d=_0x58fb06['get'](_0x3357ea['name'][_0x4a9bc2(0x150)]());_0x4ea96d&&(_0x3357ea['id']=_0x4ea96d);if(_0x3357ea[_0x4a9bc2(0x138)]?.[_0x4a9bc2(0x202)]&&isPendingSegmentId(_0x3357ea[_0x4a9bc2(0x138)][_0x4a9bc2(0x202)])){const _0x281616=_0x3151d3(_0x3357ea['entryCriteria']['segmentId'],'stage\x20\x27'+_0x3357ea[_0x4a9bc2(0x13a)]+_0x4a9bc2(0x154));_0x281616&&(_0x3357ea['entryCriteria'][_0x4a9bc2(0x202)]=_0x281616);}if(_0x3357ea[_0x4a9bc2(0x13e)])for(const _0x241fc9 of _0x3357ea[_0x4a9bc2(0x13e)]){if(_0x241fc9[_0x4a9bc2(0x202)]&&isPendingSegmentId(_0x241fc9['segmentId'])){const _0x1fb4d8=_0x3151d3(_0x241fc9[_0x4a9bc2(0x202)],'stage\x20\x27'+_0x3357ea[_0x4a9bc2(0x13a)]+_0x4a9bc2(0x1e5));_0x1fb4d8&&(_0x241fc9[_0x4a9bc2(0x202)]=_0x1fb4d8);}}if(_0x3357ea['milestone']?.[_0x4a9bc2(0x202)]&&isPendingSegmentId(_0x3357ea[_0x4a9bc2(0x140)][_0x4a9bc2(0x202)])){const _0x396cb4=_0x3151d3(_0x3357ea['milestone'][_0x4a9bc2(0x202)],_0x4a9bc2(0x17b)+_0x3357ea['name']+'\x27\x20milestone');_0x396cb4&&(_0x3357ea[_0x4a9bc2(0x140)][_0x4a9bc2(0x202)]=_0x396cb4);}if(_0x3357ea[_0x4a9bc2(0x1bc)]){const _0x1a2b7d=_0x45ac6f=>_0x8282d9['attributes'][_0x4a9bc2(0x12c)]?.['find'](_0x40556f=>_0x40556f[_0x4a9bc2(0x13a)][_0x4a9bc2(0x150)]()===_0x3357ea[_0x4a9bc2(0x13a)][_0x4a9bc2(0x150)]())?.['steps']?.[_0x45ac6f];for(const _0x175c33 of Object['keys'](_0x3357ea['steps'])){const _0x4588df=_0x3357ea[_0x4a9bc2(0x1bc)][_0x175c33],_0xcc3e18=_0x1a2b7d(_0x175c33);if(_0x4588df[_0x4a9bc2(0x142)]===_0x4a9bc2(0x16f)&&_0x4588df[_0x4a9bc2(0x124)]&&(isPendingActivationId(_0x4588df[_0x4a9bc2(0x124)])||_0x4588df['journeyActivationStepId']==='')){if(_0xcc3e18?.[_0x4a9bc2(0x124)]&&isPendingActivationId(_0xcc3e18[_0x4a9bc2(0x124)])){const _0x2bd0a4=extractPendingActivationName(_0xcc3e18[_0x4a9bc2(0x124)]),_0x963bd6=_0x107316[_0x4a9bc2(0x17e)](_0x2bd0a4);_0x963bd6&&(_0x4588df[_0x4a9bc2(0x124)]=_0x963bd6);}}if(_0x4588df[_0x4a9bc2(0x142)]===_0x4a9bc2(0x1fc)&&_0x4588df[_0x4a9bc2(0x13b)]&&_0xcc3e18?.[_0x4a9bc2(0x13b)])for(let _0x579b56=0x0;_0x579b56<_0x4588df[_0x4a9bc2(0x13b)][_0x4a9bc2(0x19a)];_0x579b56++){const _0x59a226=_0x4588df[_0x4a9bc2(0x13b)][_0x579b56],_0x3cc310=_0xcc3e18['branches'][_0x579b56];if(_0x3cc310?.[_0x4a9bc2(0x202)]&&isPendingSegmentId(_0x3cc310['segmentId'])){const _0x5d0c5e=_0x3151d3(_0x3cc310[_0x4a9bc2(0x202)],_0x4a9bc2(0x17b)+_0x3357ea[_0x4a9bc2(0x13a)]+_0x4a9bc2(0x16b)+(_0x59a226[_0x4a9bc2(0x13a)]||_0x579b56)+'\x27');_0x5d0c5e&&(_0x59a226[_0x4a9bc2(0x202)]=_0x5d0c5e);}}_0x4588df[_0x4a9bc2(0x142)]==='WaitStep'&&_0xcc3e18?.[_0x4a9bc2(0x142)]===_0x4a9bc2(0x1c2)&&resolveWaitStepPendingIds(_0x4588df,_0xcc3e18,_0x3151d3,_0x3357ea['name']);}}}}
1
+ const a128_0x3bb546=a128_0x1e5b;(function(_0x3dc7bf,_0x4f252c){const _0x5af47a=a128_0x1e5b,_0x35c1e4=_0x3dc7bf();while(!![]){try{const _0x6c1177=parseInt(_0x5af47a(0x14b))/0x1+-parseInt(_0x5af47a(0x184))/0x2*(parseInt(_0x5af47a(0x1b1))/0x3)+-parseInt(_0x5af47a(0x1fd))/0x4+parseInt(_0x5af47a(0x20e))/0x5*(-parseInt(_0x5af47a(0x160))/0x6)+-parseInt(_0x5af47a(0x1c9))/0x7+-parseInt(_0x5af47a(0x234))/0x8*(parseInt(_0x5af47a(0x17c))/0x9)+-parseInt(_0x5af47a(0x1c0))/0xa*(-parseInt(_0x5af47a(0x1f5))/0xb);if(_0x6c1177===_0x4f252c)break;else _0x35c1e4['push'](_0x35c1e4['shift']());}catch(_0x532f06){_0x35c1e4['push'](_0x35c1e4['shift']());}}}(a128_0x4ff8,0xefc17));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a128_0x3bb546(0x236));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a128_0x3bb546(0x21e);export function createPendingSegmentId(_0x2ece04){return''+PENDING_SEGMENT_PREFIX+_0x2ece04+'__';}export function isPendingSegmentId(_0x2784fa){const _0x4078e2=a128_0x3bb546;return _0x2784fa['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x2784fa[_0x4078e2(0x202)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x54e54f){return _0x54e54f['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3e4b95){return''+PENDING_ACTIVATION_PREFIX+_0x3e4b95+'__';}function a128_0x1e5b(_0x5e4bc9,_0x3fdd42){_0x5e4bc9=_0x5e4bc9-0x137;const _0x4ff863=a128_0x4ff8();let _0x1e5bc4=_0x4ff863[_0x5e4bc9];return _0x1e5bc4;}export function isPendingActivationId(_0x24b5ad){const _0xc8997c=a128_0x3bb546;return _0x24b5ad[_0xc8997c(0x202)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x59abf6){const _0x3f1269=a128_0x3bb546;return _0x59abf6[_0x3f1269(0x1f0)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4fd5fc,_0x15a1a2){const _0x586b27=a128_0x3bb546,_0x1e955f=_0x4fd5fc+'::'+(_0x15a1a2[_0x586b27(0x1d3)]()||_0x586b27(0x1ab)),_0x116f03=createHash(_0x586b27(0x22b))['update'](_0x1e955f)['digest'](_0x586b27(0x1d8))[_0x586b27(0x16d)](0x0,0xc);return _0x586b27(0x183)+_0x116f03;}export function ensureJourneyDefaults(_0x2520fa){const _0x2c653f=a128_0x3bb546;!_0x2520fa['description']&&(_0x2520fa[_0x2c653f(0x154)]=''),!_0x2520fa[_0x2c653f(0x137)]&&(_0x2520fa[_0x2c653f(0x137)]=_0x2c653f(0x194));}export function injectExistingStageIds(_0x993894,_0x253249){const _0x4a580d=a128_0x3bb546,_0x444b4d=new Map(_0x253249['map'](_0x4a517b=>[_0x4a517b['name'],_0x4a517b['id']]));for(const _0x14b306 of _0x993894){if(!_0x14b306['id']){const _0x43198f=_0x444b4d[_0x4a580d(0x19b)](_0x14b306[_0x4a580d(0x196)]);_0x43198f&&(_0x14b306['id']=_0x43198f);}}}export function resolveTDFolderPath(_0x4d051b,_0x529519,_0x4c3994){if(!_0x529519)return _0x4d051b;if(_0x4d051b===_0x4c3994||_0x4d051b['startsWith'](_0x4c3994+'/'))return _0x4d051b;return _0x4d051b?_0x4c3994+'/'+_0x4d051b:_0x4c3994;}export function addFoldersToCreate(_0x1259f7,_0x22ea5c,_0x38ce5d){const _0x114a40=a128_0x3bb546;if(!_0x1259f7)return;if(_0x22ea5c[_0x114a40(0x205)](_0x1259f7))return;const _0x1b0a3d=_0x1259f7[_0x114a40(0x17d)]('/');let _0x236b9d='';for(const _0xe3f278 of _0x1b0a3d){_0x236b9d=_0x236b9d?_0x236b9d+'/'+_0xe3f278:_0xe3f278,!_0x22ea5c['has'](_0x236b9d)&&_0x38ce5d[_0x114a40(0x1bb)](_0x236b9d);}}export function sortFoldersByDepth(_0x3600f3){const _0x30545e=a128_0x3bb546;return[..._0x3600f3][_0x30545e(0x1e6)]((_0x51bc52,_0x28ff01)=>{const _0x575828=_0x30545e,_0x101c0b=(_0x51bc52['match'](/\//g)||[])[_0x575828(0x19a)],_0x293127=(_0x28ff01[_0x575828(0x13c)](/\//g)||[])[_0x575828(0x19a)];return _0x101c0b-_0x293127;});}import*as a128_0x41fad9 from'yaml';import{readFileSync}from'fs';import a128_0x486e0e from'path';import{isJourneyDef,parseYamlString as a128_0x3e07c8,toYamlString as a128_0x7df47e,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(_0x2c44fa){const _0x578d1a=a128_0x3bb546;if(Array[_0x578d1a(0x1b3)](_0x2c44fa))return'['+_0x2c44fa['map'](_0x1050c7=>stableStringify(_0x1050c7))['join'](',')+']';if(_0x2c44fa&&typeof _0x2c44fa===_0x578d1a(0x167)){const _0xfb8dac=_0x2c44fa,_0x41ccde=Object[_0x578d1a(0x226)](_0xfb8dac)[_0x578d1a(0x1e6)](),_0x10f633=_0x41ccde[_0x578d1a(0x16c)](_0x9727aa=>'\x22'+_0x9727aa+'\x22:'+stableStringify(_0xfb8dac[_0x9727aa]));return'{'+_0x10f633['join'](',')+'}';}const _0x12c87a=JSON[_0x578d1a(0x13e)](_0x2c44fa);return _0x12c87a===undefined?_0x578d1a(0x1cf):_0x12c87a;}function activationSignature(_0x34c888){const _0x4695c8=a128_0x3bb546,_0xc62209={'connection':_0x34c888[_0x4695c8(0x208)],..._0x34c888['all_columns']!==undefined&&{'all_columns':_0x34c888[_0x4695c8(0x1b4)]},..._0x34c888[_0x4695c8(0x1a3)]!==undefined&&{'columns':_0x34c888[_0x4695c8(0x1a3)]},..._0x34c888[_0x4695c8(0x15a)]!==undefined&&{'behavior':_0x34c888[_0x4695c8(0x15a)]},..._0x34c888[_0x4695c8(0x16e)]!==undefined&&{'schedule':_0x34c888[_0x4695c8(0x16e)]},..._0x34c888[_0x4695c8(0x146)]!==undefined&&{'notification':_0x34c888[_0x4695c8(0x146)]},..._0x34c888[_0x4695c8(0x176)]!==undefined&&{'connector_config':_0x34c888['connector_config']},..._0x34c888[_0x4695c8(0x188)]!==undefined&&{'activation_template_id':_0x34c888[_0x4695c8(0x188)]}};return stableStringify(_0xc62209);}async function fetchSegment(_0x348685,_0x16e90b,_0x3dbfa2,_0x3c4b7a){const _0x363c68=a128_0x3bb546,_0x1f8cb7=_0x3c4b7a?.[_0x363c68(0x1d7)](_0x11de4a=>_0x11de4a['id']===_0x3dbfa2);if(_0x1f8cb7)return _0x1f8cb7;try{return await _0x348685['segment']['getSegment'](_0x16e90b,_0x3dbfa2);}catch(_0xb42d8d){logger[_0x363c68(0x22a)]('getSegment\x20failed\x20for\x20'+_0x3dbfa2+_0x363c68(0x22f)+_0xb42d8d);try{return await _0x348685[_0x363c68(0x1ab)][_0x363c68(0x1bd)](_0x3dbfa2);}catch(_0x2f41ae){return logger['debug'](_0x363c68(0x16a)+_0x3dbfa2+':\x20'+_0x2f41ae),null;}}}function recoverSegmentIdsFromPushRecovery(_0x18e4c5,_0x37a886,_0xe44699){const _0x1c5b08=a128_0x3bb546,_0x4ae1f1=readPushRecovery(_0x18e4c5[_0x1c5b08(0x213)]);if(_0x4ae1f1?.[_0x1c5b08(0x19d)]===_0x18e4c5[_0x1c5b08(0x13d)][_0x1c5b08(0x196)])for(const [_0x3040e1,_0x345cc1]of Object[_0x1c5b08(0x15f)](_0x4ae1f1['segments'])){const _0x521602=generateDeterministicJourneySegmentName(_0x18e4c5[_0x1c5b08(0x13d)][_0x1c5b08(0x196)],_0x3040e1);_0x345cc1['uniqueServerName']===_0x521602&&(_0x37a886['set'](_0x3040e1,_0x345cc1[_0x1c5b08(0x1db)]),_0xe44699[_0x1c5b08(0x1ec)](_0x3040e1,_0x345cc1[_0x1c5b08(0x1db)]));}}async function createOrRecoverEmbeddedSegment(_0x225edc,_0x114ec7,_0x42b2c9,_0x56836b){const _0x5adb98=a128_0x3bb546;let _0x589af2;try{_0x589af2=await _0x225edc['segment']['createJourneySegment']({'name':_0x42b2c9['uniqueSegmentName'],'description':_0x42b2c9[_0x5adb98(0x154)],'journeyId':_0x42b2c9[_0x5adb98(0x1f6)],'rule':_0x56836b(_0x42b2c9[_0x5adb98(0x15e)],!![]),'countPopulation':!![],'parentFolderId':_0x42b2c9['folderId'],'audienceId':_0x42b2c9[_0x5adb98(0x209)]});}catch(_0x5f3bec){const _0xd18444=_0x5f3bec instanceof Error&&_0x5f3bec[_0x5adb98(0x221)][_0x5adb98(0x1b5)](_0x5adb98(0x168));if(_0xd18444){const _0x503921=readPushRecovery(_0x114ec7[_0x5adb98(0x213)]),_0x5a0c1c=_0x503921?.[_0x5adb98(0x19d)]===_0x114ec7[_0x5adb98(0x13d)][_0x5adb98(0x196)]?_0x503921[_0x5adb98(0x180)][_0x42b2c9[_0x5adb98(0x18b)]]:undefined;if(_0x5a0c1c?.[_0x5adb98(0x228)]===_0x42b2c9['uniqueSegmentName'])await _0x225edc['segment'][_0x5adb98(0x224)](_0x42b2c9[_0x5adb98(0x209)],_0x5a0c1c['segmentId'],{'description':_0x42b2c9[_0x5adb98(0x154)],'rule':_0x56836b(_0x42b2c9[_0x5adb98(0x15e)],!![]),'countPopulation':!![]}),_0x589af2=_0x5a0c1c[_0x5adb98(0x1db)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5adb98(0x1da)+_0x42b2c9[_0x5adb98(0x18b)]+_0x5adb98(0x219)+(_0x5adb98(0x1b7)+_0x114ec7[_0x5adb98(0x213)][_0x5adb98(0x1f0)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x5f3bec);}else throw _0x5f3bec;}return saveSegmentToPushRecovery(_0x114ec7[_0x5adb98(0x213)],_0x114ec7[_0x5adb98(0x13d)][_0x5adb98(0x196)],_0x42b2c9[_0x5adb98(0x18b)],{'segmentId':_0x589af2,'uniqueServerName':_0x42b2c9[_0x5adb98(0x1e3)],'createdAt':new Date()[_0x5adb98(0x1f7)]()}),_0x589af2;}export async function prepareSegmentFiles(_0x4b1683,_0xbf5561,_0x8c617f,_0x4f1099,_0x54cf54){const _0x119341=a128_0x3bb546,{activationDefToCreateRequest:_0x3d818b}=await import(_0x119341(0x214)),_0x122545=[],_0x43dc1b=new Set();for(const {yamlConfig:_0x433674,folderPath:_0x365e9c,sourcePath:_0x55aa90}of _0x4b1683){const _0x21fb24=resolveTDFolderPath(_0x365e9c,_0x4f1099,_0x54cf54),_0x596034=_0x21fb24+':'+_0x433674[_0x119341(0x196)],_0x5f0f9f=_0xbf5561['segmentByFolderAndName'][_0x119341(0x19b)](_0x596034),_0x10154f=_0x5f0f9f?_0xbf5561[_0x119341(0x20b)][_0x119341(0x19b)](_0x5f0f9f['id'])||[]:[];addFoldersToCreate(_0x21fb24,_0xbf5561[_0x119341(0x13b)],_0x43dc1b);const _0x1926ad=calculateActivationActions(_0x433674[_0x119341(0x1d1)]||[],_0x10154f,_0xbf5561[_0x119341(0x1dd)],_0xbf5561['connectionIdToNameMap']);for(const _0xb69bbe of _0x1926ad){(_0xb69bbe[_0x119341(0x1ef)]===_0x119341(0x1e9)||_0xb69bbe[_0x119341(0x1ef)]===_0x119341(0x1c6))&&_0xb69bbe['yamlActivation']&&(_0xb69bbe['validatedRequest']=await _0x3d818b(_0xb69bbe[_0x119341(0x232)],_0x8c617f));}const _0x553237=calculateSegmentDiff(_0x433674,_0x5f0f9f,_0x10154f,_0xbf5561[_0x119341(0x1dd)],_0xbf5561['connectionIdToNameMap']);_0x122545[_0x119341(0x18c)]({'relativePath':_0x433674[_0x119341(0x196)],'absolutePath':_0x55aa90,'yamlConfig':_0x433674,'folderPath':_0x21fb24,'existingSegment':_0x5f0f9f,'existingActivations':_0x10154f,'isNew':_0x553237['isNew'],'hasChanges':_0x553237['hasChanges'],'diff':_0x553237[_0x119341(0x16f)],'activationActions':_0x1926ad});}return{'segmentFiles':_0x122545,'foldersToCreate':_0x43dc1b};}export async function prepareJourneyFiles(_0x4f19e5,_0x364ad7,_0x396563,_0x4e1d48){const _0x49c13c=a128_0x3bb546,_0x49840f=[],_0x324f7e=new Set();for(const {yamlConfig:_0x314827,folderPath:_0x2cf6cd,sourcePath:_0x4edc69}of _0x4f19e5){const _0x3860aa=resolveTDFolderPath(_0x2cf6cd,_0x396563,_0x4e1d48),_0x5a53a2=_0x3860aa+':'+_0x314827[_0x49c13c(0x196)],_0x524dc6=_0x364ad7[_0x49c13c(0x1c1)]['get'](_0x5a53a2);let _0x4b880d,_0x3a696c;if(_0x524dc6&&_0x524dc6[_0x49c13c(0x19a)]>0x0){const _0x20a34b=buildLocalExpandedRuleMappings(_0x314827),{createYamlContext:_0x504b7e,prefetchJourneySegments:_0x5003e2}=createPushYamlContextForBundle(_0x364ad7[_0x49c13c(0x1a8)],_0x364ad7[_0x49c13c(0x209)],_0x364ad7['existingSegments'],_0x20a34b,_0x364ad7['idToEmailMap'],_0x364ad7[_0x49c13c(0x1ad)],_0x364ad7[_0x49c13c(0x1c7)],_0x364ad7[_0x49c13c(0x139)]);await _0x5003e2(_0x524dc6[_0x49c13c(0x16c)](_0x5f28f8=>_0x5f28f8['id']));const _0x47a71b=await _0x364ad7['deps']['journey']['getLatestJourneyId'](_0x524dc6[0x0]['journeyBundleId']),_0x13094e=hasMultipleVersions(_0x314827),_0x9a93fe=async _0x1a97be=>{const _0x2fdcf2=_0x49c13c,_0x4ad862=_0x364ad7['journeyById']?.['get'](_0x1a97be);if(_0x4ad862)return _0x4ad862;return _0x364ad7[_0x2fdcf2(0x1b6)]({'journeyId':_0x1a97be,'journeyName':_0x314827[_0x2fdcf2(0x196)],'isMultiVersion':_0x524dc6[_0x2fdcf2(0x19a)]>0x1});};if(_0x13094e&&_0x524dc6[_0x49c13c(0x19a)]>0x1){const _0x5af442=[];for(const _0x4b3790 of _0x524dc6){const _0x1e5805=_0x4b3790[_0x49c13c(0x217)]||0x1;_0x364ad7[_0x49c13c(0x20f)]?.[_0x49c13c(0x1c6)]('Fetching\x20'+_0x314827[_0x49c13c(0x196)]+'\x20v'+_0x1e5805);const _0x4dfbad=await _0x9a93fe(_0x4b3790['id']),_0x3a9c86=_0x504b7e(_0x4b3790['id']),_0x132ccf=await journeyResponseToDef(_0x4dfbad,_0x3a9c86);_0x5af442[_0x49c13c(0x18c)]({'item':_0x4b3790,'yaml':_0x132ccf});}const _0x3c5715=buildLocalRuleToNameMappingFromJourney(_0x314827);_0x3a696c=buildMergedJourneyDef(_0x5af442,_0x3c5715,_0x47a71b);const _0x20d981=Math['max'](..._0x5af442['map'](_0x4c4309=>_0x4c4309[_0x49c13c(0x204)][_0x49c13c(0x217)]||0x0)),_0x7b2763=_0x524dc6[_0x49c13c(0x1d7)](_0x1f039d=>(_0x1f039d['versionNumber']||0x0)===_0x20d981);_0x7b2763&&(_0x364ad7[_0x49c13c(0x20f)]?.[_0x49c13c(0x1c6)](_0x49c13c(0x1b0)+_0x314827[_0x49c13c(0x196)]+'\x20v'+_0x20d981),_0x4b880d=await _0x9a93fe(_0x7b2763['id']));}else{const _0x3fc577=_0x524dc6[_0x524dc6[_0x49c13c(0x19a)]-0x1];_0x364ad7['progress']?.[_0x49c13c(0x1c6)](_0x49c13c(0x1b0)+_0x314827[_0x49c13c(0x196)]),_0x4b880d=await _0x9a93fe(_0x3fc577['id']);const _0x35fba3=_0x504b7e(_0x3fc577['id']),_0x40bea6=await journeyResponseToDef(_0x4b880d,_0x35fba3),_0x5b859c=buildLocalRuleToNameMappingFromJourney(_0x314827);_0x3a696c=buildMergedJourneyDef([{'item':_0x3fc577,'yaml':_0x40bea6}],_0x5b859c,_0x47a71b);}}addFoldersToCreate(_0x3860aa,_0x364ad7[_0x49c13c(0x13b)],_0x324f7e);const _0x1b6547=calculateJourneyDiff(_0x314827,_0x3a696c);_0x49840f[_0x49c13c(0x18c)]({'relativePath':_0x314827[_0x49c13c(0x196)],'absolutePath':_0x4edc69,'yamlConfig':_0x314827,'folderPath':_0x3860aa,'existingJourney':_0x4b880d,'isNew':_0x1b6547[_0x49c13c(0x215)],'hasChanges':_0x1b6547[_0x49c13c(0x191)],'diff':_0x1b6547['diff']});}return{'journeyFiles':_0x49840f,'foldersToCreate':_0x324f7e};}export function calculateActivationActions(_0x4ce8b6,_0x595ed0,_0x1bfa91,_0x1ee6e6){const _0x51101c=a128_0x3bb546,_0xe84e08=[],_0x43fd0a=new Map();for(const _0x1880e0 of _0x595ed0){_0x43fd0a[_0x51101c(0x1ec)](_0x1880e0[_0x51101c(0x196)],_0x1880e0);}const _0x28f821=new Map();for(const _0x1081a2 of _0x4ce8b6){_0x28f821[_0x51101c(0x1ec)](_0x1081a2['name'],_0x1081a2);}for(const _0x20c51c of _0x4ce8b6){const _0x175496=_0x43fd0a['get'](_0x20c51c[_0x51101c(0x196)]);if(!_0x175496)_0xe84e08[_0x51101c(0x18c)]({'type':'create','name':_0x20c51c[_0x51101c(0x196)],'yamlActivation':_0x20c51c});else{const _0x2679a7=activationResponseToDef(_0x175496,_0x1bfa91,_0x1ee6e6),_0x9f067=a128_0x41fad9['stringify'](_0x2679a7),_0x517555=a128_0x41fad9[_0x51101c(0x13e)](_0x20c51c);_0x9f067!==_0x517555&&_0xe84e08[_0x51101c(0x18c)]({'type':_0x51101c(0x1c6),'name':_0x20c51c[_0x51101c(0x196)],'yamlActivation':_0x20c51c,'existingActivation':_0x175496});}}for(const _0x88a996 of _0x595ed0){!_0x28f821[_0x51101c(0x205)](_0x88a996[_0x51101c(0x196)])&&_0xe84e08[_0x51101c(0x18c)]({'type':_0x51101c(0x20d),'name':_0x88a996[_0x51101c(0x196)],'existingActivation':_0x88a996});}return _0xe84e08;}function calculateYamlDiff(_0x1fc418,_0x2712fe){if(_0x2712fe){const _0x3f9b0c=generateDiff(_0x2712fe,_0x1fc418),_0x3df367=hasChanges(_0x3f9b0c);return{'isNew':![],'hasChanges':_0x3df367,'diff':_0x3df367?formatDiffWithColors(_0x3f9b0c):undefined};}const _0x2cba53=generateDiff('',_0x1fc418);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2cba53)};}export function calculateSegmentDiff(_0x3f0111,_0x4d0d9b,_0x3e6c08,_0x4de8b4,_0x59c4c5){const _0x3031a7=segmentToYamlString(_0x3f0111),_0x3e3380=_0x4d0d9b?segmentToYamlString(segmentWithActivationsToYaml(_0x4d0d9b,_0x3e6c08,undefined,_0x4de8b4,_0x59c4c5)):undefined;return calculateYamlDiff(_0x3031a7,_0x3e3380);}export function calculateJourneyDiff(_0x3c518d,_0x347794){const _0x67beca=normalizeJourneyDef(_0x3c518d,_0x3c518d),_0x53934f=a128_0x7df47e(_0x67beca),_0x1f7c65=_0x347794?a128_0x7df47e(normalizeJourneyDef(_0x347794,_0x3c518d)):undefined;return calculateYamlDiff(_0x53934f,_0x1f7c65);}export function findSegmentsToDelete(_0x9295f5,_0x2ae254,_0x1631a6,_0x28f708,_0x480db3){const _0xca811d=a128_0x3bb546,_0x1f1e09=new Set();for(const {yamlConfig:_0x4b9cc4,folderPath:_0x14aac4}of _0x2ae254){_0x1f1e09[_0xca811d(0x1bb)](_0x14aac4+':'+_0x4b9cc4[_0xca811d(0x196)]);}return _0x9295f5[_0xca811d(0x1b8)](_0x2cb91e=>{const _0x41fca2=_0xca811d,_0xa5ee82=_0x2cb91e['segmentFolderId']?_0x1631a6[_0x41fca2(0x19b)](_0x2cb91e[_0x41fca2(0x186)][_0x41fca2(0x216)]())||'':'',_0x48edea=_0xa5ee82+':'+_0x2cb91e[_0x41fca2(0x196)];if(_0x1f1e09[_0x41fca2(0x205)](_0x48edea))return![];if(_0x480db3)return _0xa5ee82===_0x28f708||_0xa5ee82[_0x41fca2(0x202)](_0x28f708+'/');return!![];});}export function findJourneysToDelete(_0x3e521f,_0x50b1bd,_0x91c2d0,_0x4caf6a,_0x2b1d05){const _0x1e7414=a128_0x3bb546,_0x102a36=new Set();for(const {yamlConfig:_0x4fc6fd,folderPath:_0x3fa7ca}of _0x50b1bd){_0x102a36['add'](_0x3fa7ca+':'+_0x4fc6fd[_0x1e7414(0x196)]);}return _0x3e521f[_0x1e7414(0x1b8)](_0x2dc16c=>{const _0x278d69=_0x1e7414,_0x246a6b=_0x2dc16c[_0x278d69(0x17f)]?_0x91c2d0[_0x278d69(0x19b)](_0x2dc16c[_0x278d69(0x17f)])||'':'',_0x1622ea=_0x246a6b+':'+_0x2dc16c[_0x278d69(0x170)];if(_0x102a36['has'](_0x1622ea))return![];if(_0x2b1d05)return _0x246a6b===_0x4caf6a||_0x246a6b[_0x278d69(0x202)](_0x4caf6a+'/');return!![];});}export function buildSegmentLookupMap(_0x997e37,_0x45d19a){const _0xac5354=a128_0x3bb546,_0x1afa00=new Map();for(const _0x41a4cc of _0x997e37){const _0x18e03d=_0x41a4cc[_0xac5354(0x186)]?_0x45d19a[_0xac5354(0x19b)](_0x41a4cc['segmentFolderId'][_0xac5354(0x216)]())||'':'',_0x27273d=_0x18e03d+':'+_0x41a4cc[_0xac5354(0x196)];_0x1afa00['set'](_0x27273d,_0x41a4cc);}return _0x1afa00;}export function buildSegmentNameToIdMap(_0x1e041a){const _0x322ee9=a128_0x3bb546,_0x5229e6=new Map();for(const _0x141e03 of _0x1e041a){_0x5229e6[_0x322ee9(0x1ec)](_0x141e03[_0x322ee9(0x196)],_0x141e03['id']);}return _0x5229e6;}export function buildJourneyBundleLookupMap(_0x1f0f80,_0x3b0906){const _0x33a19f=a128_0x3bb546,_0x1ad6b2=new Map();for(const _0x7e30da of _0x1f0f80){const _0xa93b2f=_0x7e30da[_0x33a19f(0x17f)]?_0x3b0906[_0x33a19f(0x19b)](_0x7e30da[_0x33a19f(0x17f)])||'':'',_0x551d5a=_0xa93b2f+':'+_0x7e30da['journeyBundleName'];!_0x1ad6b2[_0x33a19f(0x205)](_0x551d5a)&&_0x1ad6b2[_0x33a19f(0x1ec)](_0x551d5a,[]),_0x1ad6b2[_0x33a19f(0x19b)](_0x551d5a)[_0x33a19f(0x18c)](_0x7e30da);}for(const _0x39546c of _0x1ad6b2[_0x33a19f(0x225)]()){_0x39546c['sort']((_0x57dd37,_0x343f15)=>(_0x57dd37[_0x33a19f(0x217)]||0x0)-(_0x343f15[_0x33a19f(0x217)]||0x0));}return _0x1ad6b2;}function a128_0x4ff8(){const _0x53046a=['activation_updated','1826073WDEaYG','split','\x27\x20entry\x20criteria','folderId','segments','entryCriteria','relationships','journey_entry_criteria_','5306AIatod','segment_created','segmentFolderId','waitStepType','activation_template_id','entry_criteria','goal','localName','push','activationActions','\x27\x20for\x20','\x27\x20by\x20rule\x20content','\x20segment\x20from\x20file:\x20','hasChanges','deleted','WaitStep','draft','segmentNameToId','name','\x27\x20not\x20found\x20in\x20journey\x20\x27','folder','waitStep','length','get','Failed\x20to\x20resolve\x20segment\x20','journeyName','segment_creating','effectiveFolderId','getJourney','index','skipSegments','columns','existingSegment','parentFolder','size','JOURNEY_UPDATE_ERROR','deps','updated','journey_creating','segment','run_after_journey_refresh','connectionIdToNameMap','activationContext','createSegment','Fetching\x20','1032FNoiwN','conditionTimeoutUnit','isArray','all_columns','includes','fetchJourney','Delete\x20the\x20push\x20recovery\x20file\x20(','filter','Updated\x20segment\x20\x27','Entry\x20criteria:\x20','add','Matched\x20server\x20segment\x20\x27','getSegmentEntity','journeyActivationStepId','activation_deleted','12675820cvtUFG','journeyBundlesByFolderAndName','kind','JOURNEY_SYNTAX_ERROR','day','activation_','update','activationStepsById','validatedRequest','1062677qngexK','parse','createdSegmentId','\x20(referenced\x20in\x20journey\x20','join','\x27\x20wait\x20condition','null','parseDocument','activations','branches','trim','Deleting\x20activation\x20\x27','deleteActivation','createFolder','find','hex','NOT_FOUND','Embedded\x20segment\x20\x27','segmentId','relative','idToEmailMap','Created\x20folder\x20\x27','SEGMENT_SYNTAX_ERROR','valid','embedded_segment_created','withProgress','uniqueSegmentName','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x20journey\x20from\x20file:\x20','sort','action','entry','create','conditions','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','set','decision_point','Creating\x20folder\x20\x27','type','replace','rule','unchanged','Condition','goal\x20criteria','44msrVtU','journeyId','toISOString','existingActivation','\x20error(s)','conditionTimeoutDuration','utf-8','segment_updated','3026576YeqSUi','toLowerCase','results','milestone','embedded_segment_creating','startsWith','dirname','item','has','\x27\x20to\x20local\x20\x27','logSuccess','connection','parentId','createdSegmentIds','activationsBySegmentId','INTERNAL','delete','2527565dSIjAg','progress','\x27\x20milestone','max','Activation\x20not\x20found:\x20','absolutePath','./child-segment-yaml.js','isNew','toString','versionNumber','buildUserMaps','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','journey','idToName','):\x20','list','__pending_act_','existingJourney','resolveJourneyId','message','some','journeys','updateSegmentById','values','keys','data','uniqueServerName','created','debug','sha1','Failed\x20to\x20resolve\x20activation\x20','exitCriterias','nameToId',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','resolveSegment','Updating\x20activation\x20\x27','yamlActivation','\x27\x20decision\x20point\x20branch\x20\x27','72dbPzZA','\x27\x20exit\x20criteria','tdx.sdk.push-workflow','waitStepUnit','state','createActivation','journeyById','Failed\x20to\x20','folderPathToId','match','yamlConfig','stringify','stages','logInfo','steps','nameToType','folder_creating','SEGMENT_NOT_FOUND','SEGMENT_UPDATE_ERROR','notification','listActivations','rootFolderId','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','updateActivation','64384rbWGGg','conditionSegmentId','from','../../utils/async.js','user','Updated\x20activation\x20\x27','embeddedSegmentNameToId','\x27...','verbose','description','folderPath','logDeleted','logWarning','Segment\x20not\x20found:\x20','journeyStages','behavior','attributes','\x20activation\x20\x27','onProgress','resolvedRule','entries','6JMdTJq','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Created\x20segment\x20\x27','segment_deleting','segment_deleted','journey_updating','Created\x20activation\x20\x27','object','Name\x20has\x20already\x20been\x20taken','reduce','getSegmentEntity\x20also\x20failed\x20for\x20','journey_updated','map','slice','schedule','diff','journeyBundleName','\x27\x20from\x20file:\x20','\x0a\x20\x20','existingSegments','Updated\x20journey\x20\x27','Failed\x20to\x20fetch\x20referenced\x20segment\x20','connector_config','Activation','stage\x20\x27','with','DecisionPoint'];a128_0x4ff8=function(){return _0x53046a;};return a128_0x4ff8();}export function collectFoldersToCreate(_0x17fc81,_0x426004){const _0x5eb5dd=a128_0x3bb546,_0x38ee01=new Set();for(const _0x1edcff of _0x17fc81){if(!_0x1edcff)continue;if(_0x426004['has'](_0x1edcff))continue;const _0x549d48=_0x1edcff[_0x5eb5dd(0x17d)]('/');let _0x1d21f7='';for(const _0x5a3d4e of _0x549d48){_0x1d21f7=_0x1d21f7?_0x1d21f7+'/'+_0x5a3d4e:_0x5a3d4e,!_0x426004[_0x5eb5dd(0x205)](_0x1d21f7)&&_0x38ee01[_0x5eb5dd(0x1bb)](_0x1d21f7);}}return _0x38ee01;}export function parseAndClassifyYamlFiles(_0x138019,_0x373175,_0x25a134){const _0x34d323=a128_0x3bb546,_0x3fa580=[],_0x6002fd=[];for(const _0x41bb56 of _0x138019){const _0x583bf1=a128_0x486e0e['relative'](_0x373175,a128_0x486e0e[_0x34d323(0x203)](_0x41bb56)),_0x2f8746=_0x583bf1==='.'?'':_0x583bf1,_0x954839=readFileSync(_0x41bb56,_0x34d323(0x1fb)),_0x6d1d78=a128_0x41fad9[_0x34d323(0x1ca)](_0x954839);if(isJourneyDef(_0x6d1d78)){const _0x2a7c1e=a128_0x3e07c8(_0x954839);_0x6002fd[_0x34d323(0x18c)]({'yamlConfig':_0x2a7c1e,'folderPath':_0x2f8746,'sourcePath':_0x41bb56});}else{if(!_0x25a134?.[_0x34d323(0x1a2)]){const _0x27e6b3=parseSegmentYamlFile(_0x954839),_0x258267=normalizeChildSegmentYaml(_0x27e6b3);_0x3fa580[_0x34d323(0x18c)]({'yamlConfig':_0x258267,'folderPath':_0x2f8746,'sourcePath':_0x41bb56});}}}return{'segments':_0x3fa580,'journeys':_0x6002fd};}export function validateParsedFiles(_0xa27255,_0x3501ac){const _0xd31574=a128_0x3bb546,_0x2b98e1=[];for(const {yamlConfig:_0x25e344,sourcePath:_0x47dd70}of _0xa27255[_0xd31574(0x180)]){const _0x17781d=readFileSync(_0x47dd70,'utf-8'),_0x5c60d5=a128_0x41fad9[_0xd31574(0x1d0)](_0x17781d),_0x4d8520=validateSegmentDef(_0x25e344,{'source':_0x17781d,'document':_0x5c60d5},{'skipSchema':!![]});if(!_0x4d8520[_0xd31574(0x1e0)]){const _0x44cfc9=a128_0x486e0e[_0xd31574(0x1dc)](_0x3501ac,_0x47dd70);_0x2b98e1[_0xd31574(0x18c)]({'filePath':_0x44cfc9,'source':_0x17781d,'result':_0x4d8520,'isJourney':![]});}}for(const {yamlConfig:_0xd3b01,sourcePath:_0x472bd7}of _0xa27255[_0xd31574(0x223)]){const _0x3281e0=readFileSync(_0x472bd7,_0xd31574(0x1fb)),_0x5c6c82=a128_0x41fad9['parseDocument'](_0x3281e0),_0x4d7f12=validateJourneyDef(_0xd3b01,{'source':_0x3281e0,'document':_0x5c6c82},{'skipSchema':!![]});if(!_0x4d7f12[_0xd31574(0x1e0)]){const _0x366726=a128_0x486e0e[_0xd31574(0x1dc)](_0x3501ac,_0x472bd7);_0x2b98e1[_0xd31574(0x18c)]({'filePath':_0x366726,'source':_0x3281e0,'result':_0x4d7f12,'isJourney':!![]});}}return _0x2b98e1;}export function formatValidationErrors(_0x6aca78){const _0xf3ee3=a128_0x3bb546,_0xcfcea8=[];for(const {filePath:_0x3daf65,source:_0x44f8f5,result:_0x213c3b,isJourney:_0x1528d1}of _0x6aca78){const _0x3b0add=_0x1528d1?_0xf3ee3(0x21a):_0xf3ee3(0x1ab);_0xcfcea8['push']('\x0a'+_0x3daf65+'\x20('+_0x3b0add+_0xf3ee3(0x21c)+_0x213c3b['errors']['length']+_0xf3ee3(0x1f9)),_0xcfcea8[_0xf3ee3(0x18c)](formatValidationResult(_0x213c3b,_0x44f8f5,_0x3daf65));}return _0xcfcea8[_0xf3ee3(0x1cd)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x369134){const _0x97a5cd=a128_0x3bb546,_0x53a585=new Set(),_0x2b965b=new Map(),_0x4a3338=collectSegmentUsageCounts(_0x369134);if(_0x369134[_0x97a5cd(0x180)])for(const [_0x3d415a,_0x5b4444]of Object['entries'](_0x369134[_0x97a5cd(0x180)])){_0x53a585[_0x97a5cd(0x1bb)](_0x3d415a);if(_0x5b4444['rule']){const _0x53f696=yamlRuleToApi(_0x5b4444[_0x97a5cd(0x1f1)]),_0x5c2961=apiRuleToYaml(_0x53f696);_0x2b965b[_0x97a5cd(0x1ec)](_0x3d415a,_0x5c2961);}}const _0x52c418=new Map();let _0x59a584=0x0;for(const [_0x50c941,_0xd22d63]of _0x2b965b){const _0x108b22=serializeExpandedRule(_0xd22d63,_0x2b965b),_0x22a0be=_0x52c418[_0x97a5cd(0x19b)](_0x108b22)||[];_0x22a0be[_0x97a5cd(0x18c)]({'name':_0x50c941,'index':_0x59a584}),_0x52c418[_0x97a5cd(0x1ec)](_0x108b22,_0x22a0be),_0x59a584++;}const _0x391514=new Map();for(const [_0x266bb1,_0x241211]of _0x52c418){const _0x351377=_0x241211[_0x97a5cd(0x16d)]()[_0x97a5cd(0x1e6)]((_0x3e6f9e,_0x545bb1)=>{const _0x10196c=_0x97a5cd,_0x106b2e=_0x4a3338[_0x10196c(0x19b)](_0x3e6f9e[_0x10196c(0x196)])||0x0,_0x43bbbe=_0x4a3338['get'](_0x545bb1['name'])||0x0;if(_0x106b2e!==_0x43bbbe)return _0x43bbbe-_0x106b2e;return _0x3e6f9e[_0x10196c(0x1a1)]-_0x545bb1[_0x10196c(0x1a1)];})['map'](_0x42c206=>_0x42c206[_0x97a5cd(0x196)]),_0x34dfa7=[];for(const _0x54e59f of _0x351377){const _0x1f1bb9=_0x4a3338[_0x97a5cd(0x19b)](_0x54e59f)||0x0,_0x18eef6=Math[_0x97a5cd(0x211)](_0x1f1bb9,0x1);for(let _0x104867=0x0;_0x104867<_0x18eef6;_0x104867++){_0x34dfa7['push'](_0x54e59f);}}_0x391514[_0x97a5cd(0x1ec)](_0x266bb1,_0x34dfa7);}return{'existingLocalSegmentNames':_0x53a585,'localSegmentRules':_0x2b965b,'localExpandedRuleToNames':_0x391514};}export function createSegmentIdResolver(_0x423aae,_0x4c855f){return async _0x278baa=>{const _0x41d871=a128_0x1e5b,_0x2d6716=_0x423aae[_0x41d871(0x19b)](_0x278baa);if(!_0x2d6716)throw new SDKError(ErrorCode[_0x41d871(0x144)],_0x41d871(0x158)+_0x278baa+_0x41d871(0x1eb)+_0x4c855f+'\x27)');return _0x2d6716;};}export function extractRootFolderId(_0x419cff){const _0x32d11a=a128_0x3bb546;return _0x419cff['relationships']?.['parentSegmentFolder']?.[_0x32d11a(0x227)]?.['id']||_0x419cff['relationships']?.[_0x32d11a(0x1a5)]?.[_0x32d11a(0x227)]?.['id'];}export function buildConnectionMaps(_0x2e6260){const _0x238631=a128_0x3bb546,_0x506a99=new Map(),_0x15919c=new Map(),_0x30e53c=new Map();for(const _0xa5b39a of _0x2e6260){_0x506a99['set'](_0xa5b39a[_0x238631(0x196)],parseInt(_0xa5b39a['id'],0xa)),_0x15919c['set'](_0xa5b39a['id'],_0xa5b39a[_0x238631(0x196)]),_0x30e53c['set'](_0xa5b39a['name'],_0xa5b39a[_0x238631(0x1ef)]);}return{'nameToId':_0x506a99,'idToName':_0x15919c,'nameToType':_0x30e53c};}export function calculatePushStats(_0x591fe0,_0x334d94,_0x2cf8c2,_0x11af8c,_0x46dc3c,_0x1153b9,_0xe8fe03){const _0xa9bca8=a128_0x3bb546,_0x3757e6=_0x591fe0[_0xa9bca8(0x1b8)](_0x11b2e5=>_0x11b2e5[_0xa9bca8(0x215)]),_0x573e7a=_0x591fe0[_0xa9bca8(0x1b8)](_0x5a1488=>!_0x5a1488[_0xa9bca8(0x215)]&&_0x5a1488[_0xa9bca8(0x191)]),_0x29aa17=_0x591fe0[_0xa9bca8(0x1b8)](_0x148031=>!_0x148031['isNew']&&!_0x148031['hasChanges']),_0x5adb65=_0x1153b9?_0x11af8c:[],_0x94cdc3=_0x334d94[_0xa9bca8(0x1b8)](_0x155e82=>_0x155e82[_0xa9bca8(0x215)]),_0x36f059=_0x334d94[_0xa9bca8(0x1b8)](_0x1f1295=>!_0x1f1295[_0xa9bca8(0x215)]&&_0x1f1295['hasChanges']),_0x4ab33d=_0x334d94[_0xa9bca8(0x1b8)](_0x183881=>!_0x183881['isNew']&&!_0x183881[_0xa9bca8(0x191)]),_0x738eb8=_0x1153b9?_0x46dc3c:[],_0x24690f=_0x591fe0['flatMap'](_0x3471a8=>_0x3471a8[_0xa9bca8(0x18d)]),_0x4a0657=_0x24690f['filter'](_0x56c353=>_0x56c353['type']==='create'),_0x977180=_0x24690f[_0xa9bca8(0x1b8)](_0x3f2475=>_0x3f2475['type']===_0xa9bca8(0x1c6)),_0x5d4872=_0x24690f[_0xa9bca8(0x1b8)](_0x342cd6=>_0x342cd6[_0xa9bca8(0x1ef)]===_0xa9bca8(0x20d)),_0x48977a=Array['from'](_0x2cf8c2)[_0xa9bca8(0x1e6)](),_0x35bb8c=_0xe8fe03?![]:_0x3757e6['length']>0x0||_0x573e7a['length']>0x0||_0x5adb65[_0xa9bca8(0x19a)]>0x0,_0x42f8a1=_0x94cdc3[_0xa9bca8(0x19a)]>0x0||_0x36f059[_0xa9bca8(0x19a)]>0x0||_0x738eb8[_0xa9bca8(0x19a)]>0x0,_0x44f223=_0xe8fe03?![]:_0x24690f['length']>0x0,_0x57c6b3=_0x48977a['length']>0x0;return{'segments':{'new':_0x3757e6,'changed':_0x573e7a,'unchanged':_0x29aa17,'toDelete':_0x5adb65},'journeys':{'new':_0x94cdc3,'changed':_0x36f059,'unchanged':_0x4ab33d,'toDelete':_0x738eb8},'activations':{'all':_0x24690f,'toCreate':_0x4a0657,'toUpdate':_0x977180,'toDelete':_0x5d4872},'folders':{'toCreate':_0x48977a},'counts':{'segments':{'new':_0x3757e6[_0xa9bca8(0x19a)],'changed':_0x573e7a[_0xa9bca8(0x19a)],'unchanged':_0x29aa17[_0xa9bca8(0x19a)],'toDelete':_0x5adb65[_0xa9bca8(0x19a)]},'journeys':{'new':_0x94cdc3['length'],'changed':_0x36f059[_0xa9bca8(0x19a)],'unchanged':_0x4ab33d[_0xa9bca8(0x19a)],'toDelete':_0x738eb8[_0xa9bca8(0x19a)]},'activations':{'create':_0x4a0657[_0xa9bca8(0x19a)],'update':_0x977180[_0xa9bca8(0x19a)],'delete':_0x5d4872[_0xa9bca8(0x19a)]},'folders':_0x48977a[_0xa9bca8(0x19a)]},'hasChanges':_0x35bb8c||_0x42f8a1||_0x44f223||_0x57c6b3};}export async function buildPushExecutionContext(_0x586e30,_0x5a9321,_0x598dde,_0x311220,_0x3d1e78,_0x5d49b2){const _0x59b7c8=a128_0x3bb546,_0x253d1f=extractRootFolderId(_0x598dde),{pathToId:_0x966ff5,idToPath:_0x25b8b3}=buildFolderMaps(_0x3d1e78),_0x53eb6e=buildSegmentNameToIdMap(_0x311220),_0x4f948d=new Map(),{batchAsync:_0x538268}=await import(_0x59b7c8(0x14e)),[_0x47fe4a,_0x11fa42]=await Promise['all']([_0x586e30[_0x59b7c8(0x14f)][_0x59b7c8(0x218)](),_0x586e30[_0x59b7c8(0x208)][_0x59b7c8(0x21d)](),((async()=>{!_0x5d49b2&&_0x311220['length']>0x0&&await _0x538268(_0x311220,async _0x50b8da=>{const _0x102c1d=a128_0x1e5b,_0x3f0aea=await _0x586e30[_0x102c1d(0x1ab)][_0x102c1d(0x147)](_0x5a9321,_0x50b8da['id']);_0x4f948d[_0x102c1d(0x1ec)](_0x50b8da['id'],_0x3f0aea);});})())]),{emailToId:_0x3cf916,idToEmail:_0x1d7295}=_0x47fe4a,_0x1a8845=buildConnectionMaps(_0x11fa42);return{'rootFolderId':_0x253d1f,'folderPathToId':_0x966ff5,'folderIdToPath':_0x25b8b3,'segmentNameToId':_0x53eb6e,'activationsBySegmentId':_0x4f948d,'emailToIdMap':_0x3cf916,'idToEmailMap':_0x1d7295,'connectionNameToIdMap':_0x1a8845[_0x59b7c8(0x22e)],'connectionIdToNameMap':_0x1a8845[_0x59b7c8(0x21b)],'connectionNameToTypeMap':_0x1a8845[_0x59b7c8(0x142)]};}export function createPushYamlContextForBundle(_0x3dea05,_0x21edae,_0x5b7b6d,_0xbb31a3,_0x19a605,_0x38b3d9,_0x4cce8e,_0x112a41){const {existingLocalSegmentNames:_0x3794ee,localExpandedRuleToNames:_0x5705b9}=_0xbb31a3,_0x22ed40=new Set(),_0x16c88d=new Map(),_0x114655=new Map(),_0x1f9d35=new Map(),_0x54f321=createJumpTargetCache(),_0x5c893f=new Map(),_0x49bb20=new Map(),_0x3e5ea3=new Set();let _0x44e7d3;const _0x263104=_0x5da874=>{const _0x896f90={'resolveSegment':async _0x8c791d=>{const _0x2ab796=a128_0x1e5b,_0x42f797=_0x1f9d35[_0x2ab796(0x19b)](_0x8c791d);if(_0x42f797!==undefined)return{'name':_0x42f797,'isJourneyLocal':!![]};try{const _0x568e8f=await fetchSegment(_0x3dea05,_0x21edae,_0x8c791d,_0x5b7b6d);if(!_0x568e8f)throw new Error('Segment\x20not\x20found');const _0x16edd5=generateJourneyLocalName(_0x568e8f[_0x2ab796(0x196)]),_0x34696e=_0x568e8f[_0x2ab796(0x1c2)]===SEGMENT_KIND_JOURNEY&&_0x16edd5!==undefined;let _0x25113c=_0x568e8f[_0x2ab796(0x196)],_0x5a7a43;if(_0x34696e&&_0x568e8f[_0x2ab796(0x1f1)]){const _0x288a37=apiRuleToYaml(_0x568e8f[_0x2ab796(0x1f1)]);_0x49bb20['set'](_0x8c791d,_0x288a37);const _0x3f1682=async _0x28fc30=>{const _0x391821=_0x2ab796,_0x52417a=collectSegmentRefsFromRule(_0x28fc30);for(const _0x3339f1 of _0x52417a){if(!_0x49bb20['has'](_0x3339f1))try{const _0x24266c=await fetchSegment(_0x3dea05,_0x21edae,_0x3339f1,_0x5b7b6d);if(_0x24266c?.[_0x391821(0x1f1)]){const _0x58ac93=apiRuleToYaml(_0x24266c[_0x391821(0x1f1)]);_0x49bb20[_0x391821(0x1ec)](_0x3339f1,_0x58ac93),await _0x3f1682(_0x58ac93);}}catch(_0x51c89f){logger['debug'](_0x391821(0x175)+_0x3339f1+':\x20'+_0x51c89f);}}};await _0x3f1682(_0x288a37);const _0x395d07=serializeExpandedRule(_0x288a37,_0x49bb20),_0x359e95=_0x5705b9[_0x2ab796(0x19b)](_0x395d07);if(_0x359e95&&_0x359e95['length']>0x0){const _0x83651e=_0x16c88d['get'](_0x395d07)||0x0,_0x2fa307=_0x359e95[_0x83651e]||_0x359e95[_0x359e95[_0x2ab796(0x19a)]-0x1];_0x16c88d['set'](_0x395d07,_0x83651e+0x1),_0x25113c=_0x2fa307,_0x22ed40[_0x2ab796(0x1bb)](_0x25113c),_0x1f9d35[_0x2ab796(0x1ec)](_0x8c791d,_0x25113c);const _0x604fd4=await resolveRuleSegmentRefs(_0x288a37,async _0x3290aa=>{const _0x23a1dd=_0x2ab796,_0x363fcf=_0x1f9d35[_0x23a1dd(0x19b)](_0x3290aa);if(_0x363fcf)return _0x363fcf;const _0x17d303=await _0x44e7d3[_0x23a1dd(0x230)](_0x3290aa);return _0x17d303[_0x23a1dd(0x196)];});_0x5a7a43={'description':_0x568e8f[_0x2ab796(0x154)],'rule':_0x604fd4};}else{const _0x1f510f=_0x5c893f[_0x2ab796(0x19b)](_0x395d07);if(_0x1f510f)_0x25113c=_0x1f510f,_0x1f9d35['set'](_0x8c791d,_0x25113c);else{if(_0x16edd5){let _0x119944=_0x16edd5,_0x5b964c=0x2;while(_0x22ed40[_0x2ab796(0x205)](_0x119944)||_0x3794ee[_0x2ab796(0x205)](_0x119944)){_0x119944=_0x16edd5+'_'+_0x5b964c,_0x5b964c++;}_0x22ed40['add'](_0x119944),_0x25113c=_0x119944;}_0x1f9d35['set'](_0x8c791d,_0x25113c),_0x5c893f[_0x2ab796(0x1ec)](_0x395d07,_0x25113c);const _0x25a3fe=await resolveRuleSegmentRefs(_0x288a37,async _0x3bfa54=>{const _0x1f0d69=_0x2ab796,_0x25a187=_0x1f9d35[_0x1f0d69(0x19b)](_0x3bfa54);if(_0x25a187)return _0x25a187;const _0x16039e=await _0x44e7d3['resolveSegment'](_0x3bfa54);return _0x16039e[_0x1f0d69(0x196)];});_0x5a7a43={'description':_0x568e8f[_0x2ab796(0x154)],'rule':_0x25a3fe};}}}return{'name':_0x25113c,'isJourneyLocal':_0x34696e,'definition':_0x5a7a43};}catch(_0x4040de){return logger['debug'](_0x2ab796(0x19c)+_0x8c791d+':\x20'+_0x4040de),{'name':_0x8c791d,'isJourneyLocal':![]};}},'resolveActivation':async _0x3c1a71=>{const _0x5b1c7f=a128_0x1e5b,_0x205404=_0x114655[_0x5b1c7f(0x19b)](_0x3c1a71);if(_0x205404!==undefined)return{'name':_0x205404,'isJourneyLocal':!![]};try{let _0xe0785d=_0x4cce8e?.[_0x5b1c7f(0x19b)](_0x3c1a71);!_0xe0785d&&(_0xe0785d=await _0x3dea05['journey']['getActivation'](_0x5da874,_0x3c1a71));const _0x28721d=_0xe0785d[_0x5b1c7f(0x15b)]['activationParams'][_0x5b1c7f(0x196)]||_0x3c1a71,_0x369c9d=sanitizeYamlKey(_0x28721d)||_0x5b1c7f(0x1c5)+_0x3c1a71,_0x320d0d=_0x369c9d;_0x114655[_0x5b1c7f(0x1ec)](_0x3c1a71,_0x320d0d);const _0x3bc374=journeyActivationStepToYaml(_0xe0785d,_0x19a605,_0x38b3d9);return{'name':_0x320d0d,'isJourneyLocal':!![],'definition':_0x3bc374};}catch(_0x2fb8af){return logger[_0x5b1c7f(0x22a)](_0x5b1c7f(0x22c)+_0x3c1a71+':\x20'+_0x2fb8af),{'name':_0x3c1a71,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x47c1a6,_0x53e449)=>resolveJumpTarget(_0x47c1a6,_0x53e449,_0x54f321,async _0x52f000=>{const _0xa17159=a128_0x1e5b,_0x21b92e=_0x112a41?.[_0xa17159(0x19b)](_0x52f000);if(_0x21b92e)return _0x21b92e;return _0x3dea05['journey'][_0xa17159(0x1a0)](_0x52f000);})};return _0x44e7d3=_0x896f90,_0x896f90;},_0x378b40=async _0x1a108d=>{const _0x12d175=a128_0x1e5b,{collectSegmentIdsFromJourneyApi:_0xa3ffa6}=await import('./journey-yaml.js'),{batchAsync:_0x895ae8}=await import(_0x12d175(0x14e)),_0x3b7536=new Set();for(const _0x31945d of _0x1a108d){let _0x1cf9e8=_0x112a41?.[_0x12d175(0x19b)](_0x31945d);!_0x1cf9e8&&(_0x1cf9e8=await _0x3dea05[_0x12d175(0x21a)]['getJourney'](_0x31945d));const _0x1375fc=_0xa3ffa6(_0x1cf9e8);for(const _0x5d6af6 of _0x1375fc){_0x3b7536['add'](_0x5d6af6);}}let _0xb30e76=Array['from'](_0x3b7536);while(_0xb30e76[_0x12d175(0x19a)]>0x0){const _0x313155=_0xb30e76['filter'](_0x3f8388=>!_0x3e5ea3[_0x12d175(0x205)](_0x3f8388));if(_0x313155['length']===0x0)break;const _0x45f816=await _0x895ae8(_0x313155,async _0x25b3f7=>{const _0x132b34=_0x12d175;_0x3e5ea3[_0x132b34(0x1bb)](_0x25b3f7);const _0x1042fe=await fetchSegment(_0x3dea05,_0x21edae,_0x25b3f7,_0x5b7b6d);if(!_0x1042fe)return null;return{'segmentId':_0x25b3f7,'segment':_0x1042fe};},0xa),_0x5db46b=new Set();for(const _0x416f40 of _0x45f816){if(!_0x416f40?.[_0x12d175(0x1ab)]?.[_0x12d175(0x1f1)])continue;const _0x2be3c4=apiRuleToYaml(_0x416f40[_0x12d175(0x1ab)][_0x12d175(0x1f1)]);_0x49bb20[_0x12d175(0x1ec)](_0x416f40[_0x12d175(0x1db)],_0x2be3c4);const _0x4916a6=collectSegmentRefsFromRule(_0x2be3c4);for(const _0x341eb7 of _0x4916a6){!_0x3e5ea3[_0x12d175(0x205)](_0x341eb7)&&_0x5db46b[_0x12d175(0x1bb)](_0x341eb7);}}_0xb30e76=Array[_0x12d175(0x14d)](_0x5db46b);}};return{'createYamlContext':_0x263104,'prefetchJourneySegments':_0x378b40};}export async function executePushSegments(_0x11f8ee,_0x5eba2f,_0x2f03aa,_0x36cb26,_0x51e2fd){const _0xdc582d=a128_0x3bb546,{segmentDefToCreateRequest:_0x253fcb,segmentDefToUpdateRequest:_0x585bb8}=await import(_0xdc582d(0x214)),_0x3f89b0=_0x2f03aa['folderPathToId'],_0x34bf18=0x5,_0x6b8d01=async _0x5c19be=>{const _0x235944=_0xdc582d,_0x3f3893=_0x5c19be[_0x235944(0x155)]?_0x3f89b0[_0x235944(0x19b)](_0x5c19be[_0x235944(0x155)]):undefined;let _0x8335f2;const _0x3ce9ca={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x21a4c3=_0x5c19be[_0x235944(0x13d)];if(_0x5c19be[_0x235944(0x13d)]['rule']){const _0xb8e610=createSegmentIdResolver(_0x2f03aa[_0x235944(0x195)],_0x5c19be['yamlConfig'][_0x235944(0x196)]),_0x27bb83=await resolveRuleSegmentIds(_0x5c19be['yamlConfig'][_0x235944(0x1f1)],_0xb8e610);_0x21a4c3={..._0x5c19be['yamlConfig'],'rule':_0x27bb83};}try{if(_0x5c19be[_0x235944(0x215)]){_0x51e2fd[_0x235944(0x15d)]?.({'type':_0x235944(0x19e),'name':_0x5c19be[_0x235944(0x13d)]['name']});const _0x4e1621=_0x253fcb(_0x21a4c3,_0x3f3893),_0x27238f=await _0x51e2fd['withProgress']('Creating\x20segment\x20\x27'+_0x5c19be['yamlConfig']['name']+_0x235944(0x152),()=>_0x11f8ee[_0x235944(0x1ab)][_0x235944(0x1af)](_0x36cb26[_0x235944(0x209)],_0x4e1621));_0x8335f2=_0x27238f['data']['id'],_0x2f03aa[_0x235944(0x195)][_0x235944(0x1ec)](_0x5c19be[_0x235944(0x13d)][_0x235944(0x196)],_0x8335f2),_0x3ce9ca[_0x235944(0x1cb)]={'name':_0x5c19be[_0x235944(0x13d)][_0x235944(0x196)],'id':_0x8335f2},_0x51e2fd[_0x235944(0x15d)]?.({'type':_0x235944(0x185),'name':_0x5c19be['yamlConfig'][_0x235944(0x196)],'segmentId':_0x8335f2}),_0x51e2fd[_0x235944(0x207)]?.(_0x235944(0x162)+_0x5c19be[_0x235944(0x13d)][_0x235944(0x196)]+'\x27'),_0x3ce9ca['created']=0x1;}else{if(_0x5c19be[_0x235944(0x191)]){_0x51e2fd[_0x235944(0x15d)]?.({'type':'segment_updating','name':_0x5c19be[_0x235944(0x13d)][_0x235944(0x196)]});const _0x8ab3ad=_0x585bb8(_0x21a4c3);_0x3f3893!==_0x5c19be[_0x235944(0x1a4)]?.[_0x235944(0x186)]&&(_0x8ab3ad[_0x235944(0x186)]=_0x3f3893?parseInt(_0x3f3893,0xa):undefined),await _0x51e2fd['withProgress']('Updating\x20segment\x20\x27'+_0x5c19be['yamlConfig'][_0x235944(0x196)]+_0x235944(0x152),()=>_0x11f8ee[_0x235944(0x1ab)][_0x235944(0x224)](_0x36cb26['parentId'],_0x5c19be['existingSegment']['id'],_0x8ab3ad)),_0x8335f2=_0x5c19be[_0x235944(0x1a4)]['id'],_0x51e2fd[_0x235944(0x15d)]?.({'type':_0x235944(0x1fc),'name':_0x5c19be[_0x235944(0x13d)][_0x235944(0x196)]}),_0x51e2fd[_0x235944(0x207)]?.(_0x235944(0x1b9)+_0x5c19be[_0x235944(0x13d)][_0x235944(0x196)]+'\x27'),_0x3ce9ca['updated']=0x1;}else _0x8335f2=_0x5c19be[_0x235944(0x1a4)]['id'];}}catch(_0x26e6db){const _0x5da5ee=isHttp400Error(_0x26e6db),_0x56b977=_0x5da5ee?ErrorCode[_0x235944(0x1df)]:ErrorCode[_0x235944(0x145)],_0x42d4b6=getErrorMessage(_0x26e6db);throw new SDKError(_0x56b977,'Failed\x20to\x20'+(_0x5c19be[_0x235944(0x215)]?'create':'update')+_0x235944(0x190)+_0x5c19be['absolutePath']+_0x235944(0x172)+_0x42d4b6,_0x26e6db);}try{const _0x345655=await syncActivationsForSegment(_0x11f8ee,_0x36cb26['parentId'],_0x8335f2,_0x5c19be[_0x235944(0x13d)][_0x235944(0x196)],_0x5c19be[_0x235944(0x18d)],_0x51e2fd,_0x5c19be[_0x235944(0x213)]);_0x3ce9ca['activations']=_0x345655;}catch(_0x4bee6d){if(_0x4bee6d instanceof SDKError)throw _0x4bee6d;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x235944(0x161)+_0x5c19be[_0x235944(0x13d)][_0x235944(0x196)]+_0x235944(0x171)+_0x5c19be['absolutePath']+_0x235944(0x172)+getErrorMessage(_0x4bee6d),_0x4bee6d);}return _0x3ce9ca;},_0x1f90ec=await batchAsync(_0x5eba2f,_0x6b8d01,_0x34bf18),_0x5c7414={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x14910e of _0x1f90ec){_0x5c7414[_0xdc582d(0x229)]+=_0x14910e[_0xdc582d(0x229)],_0x5c7414['updated']+=_0x14910e[_0xdc582d(0x1a9)],_0x14910e['createdSegmentId']&&_0x5c7414[_0xdc582d(0x20a)]['set'](_0x14910e[_0xdc582d(0x1cb)][_0xdc582d(0x196)],_0x14910e['createdSegmentId']['id']),_0x5c7414[_0xdc582d(0x1d1)][_0xdc582d(0x229)]+=_0x14910e[_0xdc582d(0x1d1)]['created'],_0x5c7414[_0xdc582d(0x1d1)]['updated']+=_0x14910e[_0xdc582d(0x1d1)][_0xdc582d(0x1a9)],_0x5c7414[_0xdc582d(0x1d1)]['deleted']+=_0x14910e[_0xdc582d(0x1d1)][_0xdc582d(0x192)];}return _0x5c7414;}async function syncActivationsForSegment(_0x35d634,_0x35dbed,_0x157313,_0x521304,_0x249148,_0x4d2a3a,_0x34945){const _0x303f45=a128_0x3bb546,_0x186c41={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x31fd75 of _0x249148){try{if(_0x31fd75[_0x303f45(0x1ef)]===_0x303f45(0x1e9)&&_0x31fd75['validatedRequest'])_0x4d2a3a[_0x303f45(0x15d)]?.({'type':'activation_creating','segmentName':_0x521304,'activationName':_0x31fd75[_0x303f45(0x196)]}),await _0x4d2a3a[_0x303f45(0x1e2)]('Creating\x20activation\x20\x27'+_0x31fd75[_0x303f45(0x196)]+_0x303f45(0x152),()=>_0x35d634[_0x303f45(0x1ab)]['createActivation'](_0x35dbed,_0x157313,_0x31fd75[_0x303f45(0x1c8)])),_0x4d2a3a[_0x303f45(0x15d)]?.({'type':'activation_created','segmentName':_0x521304,'activationName':_0x31fd75[_0x303f45(0x196)]}),_0x4d2a3a[_0x303f45(0x207)]?.(_0x303f45(0x166)+_0x31fd75[_0x303f45(0x196)]+'\x27'),_0x186c41[_0x303f45(0x229)]++;else{if(_0x31fd75['type']===_0x303f45(0x1c6)&&_0x31fd75['validatedRequest']&&_0x31fd75[_0x303f45(0x1f8)])_0x4d2a3a[_0x303f45(0x15d)]?.({'type':'activation_updating','segmentName':_0x521304,'activationName':_0x31fd75['name']}),await _0x4d2a3a['withProgress'](_0x303f45(0x231)+_0x31fd75['name']+'\x27...',()=>_0x35d634[_0x303f45(0x1ab)][_0x303f45(0x14a)](_0x35dbed,_0x157313,_0x31fd75[_0x303f45(0x1f8)]['id'],_0x31fd75[_0x303f45(0x1c8)])),_0x4d2a3a[_0x303f45(0x15d)]?.({'type':_0x303f45(0x17b),'segmentName':_0x521304,'activationName':_0x31fd75[_0x303f45(0x196)]}),_0x4d2a3a[_0x303f45(0x207)]?.(_0x303f45(0x150)+_0x31fd75[_0x303f45(0x196)]+'\x27'),_0x186c41[_0x303f45(0x1a9)]++;else _0x31fd75[_0x303f45(0x1ef)]===_0x303f45(0x20d)&&_0x31fd75[_0x303f45(0x1f8)]&&(_0x4d2a3a['onProgress']?.({'type':'activation_deleting','segmentName':_0x521304,'activationName':_0x31fd75['name']}),await _0x4d2a3a['withProgress'](_0x303f45(0x1d4)+_0x31fd75[_0x303f45(0x196)]+'\x27...',()=>_0x35d634[_0x303f45(0x1ab)][_0x303f45(0x1d5)](_0x35dbed,_0x157313,_0x31fd75[_0x303f45(0x1f8)]['id'])),_0x4d2a3a[_0x303f45(0x15d)]?.({'type':_0x303f45(0x1bf),'segmentName':_0x521304,'activationName':_0x31fd75['name']}),_0x4d2a3a[_0x303f45(0x156)]?.('Deleted\x20activation\x20\x27'+_0x31fd75[_0x303f45(0x196)]+'\x27'),_0x186c41[_0x303f45(0x192)]++);}}catch(_0x737e99){const _0x7a33df=isHttp400Error(_0x737e99),_0x3b1ea0=_0x7a33df?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x4ec3ae=getErrorMessage(_0x737e99);throw new SDKError(_0x3b1ea0,_0x303f45(0x13a)+_0x31fd75[_0x303f45(0x1ef)]+_0x303f45(0x15c)+_0x31fd75[_0x303f45(0x196)]+'\x27\x20from\x20file:\x20'+_0x34945+_0x303f45(0x172)+_0x4ec3ae,_0x737e99);}}return _0x186c41;}export async function executePushFolders(_0x1e6f94,_0x38f556,_0x2d472f,_0x28940e,_0x3f3ae0){const _0x2c158f=a128_0x3bb546,_0x5d793c=new Map(_0x2d472f),_0xa68be7=sortFoldersByDepth(_0x38f556);for(const _0x4fd966 of _0xa68be7){const _0x464646=_0x4fd966[_0x2c158f(0x17d)]('/'),_0x19d8c1=_0x464646[_0x464646['length']-0x1],_0x53f29b=_0x464646[_0x2c158f(0x16d)](0x0,-0x1)[_0x2c158f(0x1cd)]('/'),_0x4c6065=_0x5d793c[_0x2c158f(0x19b)](_0x53f29b);_0x3f3ae0['onProgress']?.({'type':_0x2c158f(0x143),'folder':_0x4fd966});const _0x443b2e={'name':_0x19d8c1,'parentFolderId':_0x4c6065},_0x1efe5f=await _0x3f3ae0[_0x2c158f(0x1e2)](_0x2c158f(0x1ee)+_0x4fd966+_0x2c158f(0x152),()=>_0x1e6f94[_0x2c158f(0x1ab)][_0x2c158f(0x1d6)](_0x28940e[_0x2c158f(0x209)],_0x443b2e));_0x5d793c['set'](_0x4fd966,_0x1efe5f[_0x2c158f(0x227)]['id']),_0x3f3ae0[_0x2c158f(0x15d)]?.({'type':'folder_created','folder':_0x4fd966,'folderId':_0x1efe5f[_0x2c158f(0x227)]['id']}),_0x3f3ae0[_0x2c158f(0x140)]?.(_0x2c158f(0x1de)+_0x4fd966+'\x27');}return _0x5d793c;}export async function executePushSegmentDeletions(_0x415f18,_0x1eb104,_0x39eae5){const _0x32918c=a128_0x3bb546;if(_0x1eb104[_0x32918c(0x19a)]===0x0)return 0x0;const {batchAsync:_0x4a9c0b}=await import('../../utils/async.js'),_0x2b3232=0x5,_0x40fe0c=await _0x4a9c0b(_0x1eb104,async _0xc6beda=>{const _0x3cf508=_0x32918c;return _0x39eae5[_0x3cf508(0x15d)]?.({'type':_0x3cf508(0x163),'name':_0xc6beda[_0x3cf508(0x196)]}),await _0x415f18[_0x3cf508(0x1ab)]['deleteSegment'](_0xc6beda['id']),_0x39eae5[_0x3cf508(0x15d)]?.({'type':_0x3cf508(0x164),'name':_0xc6beda['name']}),_0x39eae5[_0x3cf508(0x156)]?.('Deleted\x20segment\x20\x27'+_0xc6beda[_0x3cf508(0x196)]+'\x27'),0x1;},_0x2b3232);return _0x40fe0c[_0x32918c(0x169)]((_0x282cc4,_0x597ac4)=>_0x282cc4+_0x597ac4,0x0);}export async function executePushJourneys(_0x3881ec,_0x30b294,_0x4c221a,_0x2d9dfb,_0x671cd6){const _0x4bfa34=a128_0x3bb546,{journeyDefToRequest:_0x4f2e09}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x3af416,yamlRuleToApi:_0x2231cb,validateSegmentRule:_0x54d3ef}=await import(_0x4bfa34(0x214)),_0x1181ad={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x375b05=new Map(_0x4c221a[_0x4bfa34(0x195)]),_0x40671f=0x5;for(let _0x48acc4=0x0;_0x48acc4<_0x30b294[_0x4bfa34(0x19a)];_0x48acc4+=_0x40671f){const _0x1fc802=_0x30b294[_0x4bfa34(0x16d)](_0x48acc4,_0x48acc4+_0x40671f),_0x3bf749=await Promise['all'](_0x1fc802[_0x4bfa34(0x16c)](async _0x477c36=>{const _0x43c91d=_0x4bfa34;if(!_0x477c36[_0x43c91d(0x215)]&&!_0x477c36['hasChanges'])return{'action':_0x43c91d(0x1f2),'name':_0x477c36[_0x43c91d(0x13d)][_0x43c91d(0x196)],'journeyId':_0x477c36[_0x43c91d(0x21f)]?.['id']};const _0x548e66=_0x477c36[_0x43c91d(0x155)]?_0x4c221a[_0x43c91d(0x13b)][_0x43c91d(0x19b)](_0x477c36[_0x43c91d(0x155)]):undefined;_0x671cd6['onProgress']?.({'type':_0x477c36[_0x43c91d(0x215)]?_0x43c91d(0x1aa):_0x43c91d(0x165),'name':_0x477c36[_0x43c91d(0x13d)][_0x43c91d(0x196)]});try{const _0x3d94a9=await executeSingleJourneyPush(_0x3881ec,_0x477c36,{..._0x4c221a,'segmentNameToId':_0x375b05},{'parentId':_0x2d9dfb[_0x43c91d(0x209)],'rootFolderId':_0x2d9dfb[_0x43c91d(0x148)],'folderId':_0x548e66,'verbose':_0x2d9dfb[_0x43c91d(0x153)]},_0x671cd6,{'journeyDefToRequest':_0x4f2e09,'activationDefToCreateRequest':_0x3af416,'yamlRuleToApi':_0x2231cb,'validateSegmentRule':_0x54d3ef});for(const [_0x311b90,_0x5bda8b]of _0x3d94a9[_0x43c91d(0x151)]){_0x375b05['set'](_0x311b90,_0x5bda8b),_0x1181ad[_0x43c91d(0x151)][_0x43c91d(0x1ec)](_0x311b90,_0x5bda8b);}if(_0x3d94a9[_0x43c91d(0x1e7)]==='created')_0x671cd6['onProgress']?.({'type':'journey_created','name':_0x477c36[_0x43c91d(0x13d)]['name'],'journeyId':_0x3d94a9[_0x43c91d(0x1f6)]}),_0x671cd6[_0x43c91d(0x207)]?.('Created\x20journey\x20\x27'+_0x477c36[_0x43c91d(0x13d)][_0x43c91d(0x196)]+'\x27'),_0x1181ad[_0x43c91d(0x229)]++;else _0x3d94a9['action']===_0x43c91d(0x1a9)&&(_0x671cd6[_0x43c91d(0x15d)]?.({'type':_0x43c91d(0x16b),'name':_0x477c36[_0x43c91d(0x13d)]['name']}),_0x671cd6[_0x43c91d(0x207)]?.(_0x43c91d(0x174)+_0x477c36[_0x43c91d(0x13d)][_0x43c91d(0x196)]+'\x27'),_0x1181ad[_0x43c91d(0x1a9)]++);return{'action':_0x3d94a9[_0x43c91d(0x1e7)],'name':_0x477c36[_0x43c91d(0x13d)][_0x43c91d(0x196)],'journeyId':_0x3d94a9['journeyId']};}catch(_0x1815c8){const _0x4453ab=isHttp400Error(_0x1815c8),_0x17ec9f=_0x4453ab?ErrorCode[_0x43c91d(0x1c3)]:ErrorCode[_0x43c91d(0x1a7)],_0x1276bb=getErrorMessage(_0x1815c8);throw new SDKError(_0x17ec9f,'Failed\x20to\x20'+(_0x477c36['isNew']?_0x43c91d(0x1e9):_0x43c91d(0x1c6))+_0x43c91d(0x1e5)+_0x477c36[_0x43c91d(0x213)]+_0x43c91d(0x172)+_0x1276bb,_0x1815c8);}}));_0x1181ad[_0x4bfa34(0x1ff)][_0x4bfa34(0x18c)](..._0x3bf749);}return _0x1181ad;}async function matchExistingJourneySegments(_0x316159,_0x136b45,_0x153b24,_0x32ebd6,_0x306bf1){const _0x5e0498=a128_0x3bb546;if(!_0x136b45['existingJourney']||!_0x136b45[_0x5e0498(0x13d)]['segments'])return;const _0x499fa2=new Map(),_0xa2bc10=new Set();for(const _0x1ee506 of Object[_0x5e0498(0x226)](_0x136b45['yamlConfig'][_0x5e0498(0x180)])){const _0x2de59c=generateDeterministicJourneySegmentName(_0x136b45[_0x5e0498(0x13d)][_0x5e0498(0x196)],_0x1ee506);_0x499fa2['set'](_0x2de59c,_0x1ee506),_0xa2bc10[_0x5e0498(0x1bb)](_0x1ee506);}const _0x3d701b=[],_0x201f14=collectSegmentIdsFromJourneyApi(_0x136b45[_0x5e0498(0x21f)]);for(const _0x22fc1d of _0x201f14){const _0x3a3eef=await fetchSegment(_0x316159,_0x153b24,_0x22fc1d,_0x32ebd6);if(!_0x3a3eef?.[_0x5e0498(0x196)])continue;const _0x4de3d2=_0x499fa2[_0x5e0498(0x19b)](_0x3a3eef['name']);_0x4de3d2?(_0x306bf1['set'](_0x4de3d2,_0x22fc1d),_0xa2bc10[_0x5e0498(0x20d)](_0x4de3d2)):_0x3d701b[_0x5e0498(0x18c)]({'id':_0x22fc1d,'seg':_0x3a3eef});}if(_0xa2bc10[_0x5e0498(0x1a6)]>0x0&&_0x3d701b[_0x5e0498(0x19a)]>0x0){const {localExpandedRuleToNames:_0x406c8f}=buildLocalExpandedRuleMappings(_0x136b45['yamlConfig']),_0x38f564=new Map();for(const {id:_0x50771b,seg:_0x5119c8}of _0x3d701b){if(_0x5119c8['rule']){const _0x1eced1=apiRuleToYaml(_0x5119c8['rule']);_0x38f564['set'](_0x50771b,_0x1eced1);}}for(const {id:_0x55cf93,seg:_0x1e7bfd}of _0x3d701b){if(!_0x1e7bfd[_0x5e0498(0x1f1)])continue;const _0x4d0a72=_0x38f564[_0x5e0498(0x19b)](_0x55cf93);if(!_0x4d0a72)continue;const _0x473e3f=serializeExpandedRule(_0x4d0a72,_0x38f564),_0x1b70b5=_0x406c8f[_0x5e0498(0x19b)](_0x473e3f);if(_0x1b70b5){const _0x6cb3fc=_0x1b70b5['find'](_0x393781=>_0xa2bc10['has'](_0x393781));_0x6cb3fc&&(_0x306bf1[_0x5e0498(0x1ec)](_0x6cb3fc,_0x55cf93),_0xa2bc10['delete'](_0x6cb3fc),logger[_0x5e0498(0x22a)](_0x5e0498(0x1bc)+_0x1e7bfd[_0x5e0498(0x196)]+_0x5e0498(0x206)+_0x6cb3fc+_0x5e0498(0x18f)));}}}}async function executeSingleJourneyPush(_0x4e5d16,_0x408b5e,_0x275571,_0x2b0775,_0x3099de,_0x5cb6e0){const _0x31bc58=a128_0x3bb546,{journeyDefToRequest:_0x512cae,activationDefToCreateRequest:_0x19cf84,yamlRuleToApi:_0x2d03b8,validateSegmentRule:_0x371374}=_0x5cb6e0,_0x1bacf0=new Map(),_0x1807e6=new Map();recoverSegmentIdsFromPushRecovery(_0x408b5e,_0x1bacf0,_0x275571['segmentNameToId']);const _0xe6f64f=new Map(),_0x2f32de=new Map(),_0x250a47=new Map();let _0x139229;const _0x3c38e4=async()=>{const _0x515734=a128_0x1e5b;if(_0x139229)return;_0x139229=new Map();if(!_0x408b5e['existingJourney'])return;const _0x4bc56c=await _0x4e5d16[_0x515734(0x21a)]['listActivations'](_0x408b5e[_0x515734(0x21f)]['id']);for(const _0xe6ffd7 of _0x4bc56c){const _0x5b0233=journeyActivationStepToYaml(_0xe6ffd7,_0x275571['idToEmailMap'],_0x275571[_0x515734(0x1ad)]),_0x160495=activationSignature(_0x5b0233);!_0x139229[_0x515734(0x205)](_0x160495)&&_0x139229['set'](_0x160495,_0xe6ffd7['id']),_0x5b0233[_0x515734(0x196)]&&_0x1807e6['set'](_0x5b0233['name'],_0xe6ffd7['id']);}};await matchExistingJourneySegments(_0x4e5d16,_0x408b5e,_0x2b0775[_0x31bc58(0x209)],_0x275571[_0x31bc58(0x173)],_0x275571[_0x31bc58(0x195)]);const _0x4acb57={'resolveSegmentId':async _0x2d88e9=>{const _0x360ef9=_0x31bc58,_0x2e156a=_0x275571[_0x360ef9(0x195)]['get'](_0x2d88e9);if(!_0x2e156a)throw new SDKError(ErrorCode[_0x360ef9(0x144)],'Segment\x20not\x20found:\x20'+_0x2d88e9+_0x360ef9(0x1cc)+_0x408b5e[_0x360ef9(0x13d)][_0x360ef9(0x196)]+')');return _0x2e156a;},'resolveEmbeddedSegmentId':async(_0x5419c7,_0x1d86a2)=>{const _0xf1258=_0x31bc58,_0x4fda90=_0x275571[_0xf1258(0x195)][_0xf1258(0x19b)](_0x5419c7);if(_0x4fda90)return _0x4fda90;const _0x427954=_0x275571[_0xf1258(0x173)][_0xf1258(0x1d7)](_0x39293a=>_0x39293a['name']===_0x5419c7);if(_0x427954)return _0x275571['segmentNameToId']['set'](_0x5419c7,_0x427954['id']),_0x427954['id'];if(_0x408b5e[_0xf1258(0x215)]){const {stageName:_0x282bbc,criteriaName:_0x442cdd}=findSegmentCriteriaLocation(_0x408b5e[_0xf1258(0x13d)],_0x5419c7);return _0x371374(_0x5419c7,_0x1d86a2[_0xf1258(0x1f1)]),_0x2f32de['set'](_0x5419c7,{'definition':_0x1d86a2,'stageName':_0x282bbc,'criteriaName':_0x442cdd}),createPendingSegmentId(_0x5419c7);}const _0x28ab69=_0x408b5e[_0xf1258(0x21f)]?.['id'];if(!_0x28ab69)throw new SDKError(ErrorCode[_0xf1258(0x20c)],_0xf1258(0x1e4));const _0x3edd90=_0xe6f64f['get'](_0x5419c7);if(_0x3edd90)return _0x3edd90;const _0x270646=((async()=>{const _0x163b90=_0xf1258;_0x371374(_0x5419c7,_0x1d86a2[_0x163b90(0x1f1)]);const _0x1b8bb2=generateDeterministicJourneySegmentName(_0x408b5e[_0x163b90(0x13d)][_0x163b90(0x196)],_0x5419c7),_0x50611f=_0x275571[_0x163b90(0x173)]['find'](_0xa2a565=>_0xa2a565[_0x163b90(0x196)]===_0x1b8bb2),_0x1fd140=createSegmentIdResolver(_0x275571[_0x163b90(0x195)],_0x5419c7),_0x435684=await resolveRuleSegmentIds(_0x1d86a2[_0x163b90(0x1f1)],_0x1fd140);let _0x2346ea;return _0x50611f?(await _0x4e5d16[_0x163b90(0x1ab)][_0x163b90(0x224)](_0x2b0775[_0x163b90(0x209)],_0x50611f['id'],{'description':_0x1d86a2[_0x163b90(0x154)]||_0x163b90(0x1ba)+_0x5419c7,'rule':_0x2d03b8(_0x435684,!![]),'countPopulation':!![]}),_0x2346ea=_0x50611f['id'],saveSegmentToPushRecovery(_0x408b5e[_0x163b90(0x213)],_0x408b5e[_0x163b90(0x13d)][_0x163b90(0x196)],_0x5419c7,{'segmentId':_0x2346ea,'uniqueServerName':_0x1b8bb2,'createdAt':new Date()[_0x163b90(0x1f7)]()})):_0x2346ea=await createOrRecoverEmbeddedSegment(_0x4e5d16,_0x408b5e,{'localName':_0x5419c7,'uniqueSegmentName':_0x1b8bb2,'description':_0x1d86a2[_0x163b90(0x154)]||'Entry\x20criteria:\x20'+_0x5419c7,'journeyId':_0x28ab69,'resolvedRule':_0x435684,'parentId':_0x2b0775['parentId'],'folderId':_0x2b0775[_0x163b90(0x148)]||''},_0x2d03b8),_0x275571['segmentNameToId'][_0x163b90(0x1ec)](_0x5419c7,_0x2346ea),_0x1bacf0[_0x163b90(0x1ec)](_0x5419c7,_0x2346ea),_0x2346ea;})());_0xe6f64f['set'](_0x5419c7,_0x270646);try{return await _0x270646;}finally{_0xe6f64f['delete'](_0x5419c7);}},'resolveActivationId':async _0x147587=>{const _0x3bc475=_0x31bc58,_0x5654a8=_0x1807e6[_0x3bc475(0x19b)](_0x147587);if(_0x5654a8)return _0x5654a8;if(_0x408b5e[_0x3bc475(0x21f)]){await _0x3c38e4();const _0x29adda=_0x1807e6['get'](_0x147587);if(_0x29adda)return _0x29adda;}throw new SDKError(ErrorCode[_0x3bc475(0x1d9)],_0x3bc475(0x212)+_0x147587+'\x20(referenced\x20in\x20journey\x20'+_0x408b5e[_0x3bc475(0x13d)][_0x3bc475(0x196)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3e4542,_0x397507)=>{const _0x480f3a=_0x31bc58,_0x1e70a6=_0x1807e6[_0x480f3a(0x19b)](_0x3e4542);if(_0x1e70a6)return _0x1e70a6;if(_0x408b5e[_0x480f3a(0x215)])return _0x250a47['set'](_0x3e4542,_0x397507),createPendingActivationId(_0x3e4542);if(_0x408b5e[_0x480f3a(0x21f)]){await _0x3c38e4();const _0x38f97e=_0x1807e6[_0x480f3a(0x19b)](_0x397507[_0x480f3a(0x196)]);if(_0x38f97e)return _0x1807e6[_0x480f3a(0x1ec)](_0x3e4542,_0x38f97e),_0x38f97e;const _0x439391=activationSignature(_0x397507),_0x2f36b5=_0x139229?.['get'](_0x439391);if(_0x2f36b5)return _0x1807e6[_0x480f3a(0x1ec)](_0x3e4542,_0x2f36b5),_0x2f36b5;const _0x2d06a1=await _0x19cf84(_0x397507,_0x275571[_0x480f3a(0x1ae)]),_0x4a01ac={..._0x2d06a1,..._0x397507[_0x480f3a(0x1ac)]!==undefined&&{'runAfterJourneyRefresh':_0x397507['run_after_journey_refresh']}},_0x324267=await _0x4e5d16[_0x480f3a(0x21a)][_0x480f3a(0x138)](_0x408b5e[_0x480f3a(0x21f)]['id'],_0x4a01ac);return _0x1807e6[_0x480f3a(0x1ec)](_0x3e4542,_0x324267['id']),_0x324267['id'];}throw new SDKError(ErrorCode[_0x480f3a(0x20c)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0xdec489=>{const _0x16f098=_0x31bc58;try{return await _0x4e5d16[_0x16f098(0x21a)][_0x16f098(0x220)](_0x2b0775[_0x16f098(0x209)],_0xdec489);}catch(_0x39254d){throw new SDKError(ErrorCode[_0x16f098(0x1d9)],'Journey\x20\x27'+_0xdec489+_0x16f098(0x149)+_0x408b5e[_0x16f098(0x13d)][_0x16f098(0x196)]+'\x27)',_0x39254d);}},'resolveStageId':async(_0x141c9f,_0x1d2baf)=>{const _0x2d4803=_0x31bc58,_0x3cd39f=await _0x4e5d16[_0x2d4803(0x21a)][_0x2d4803(0x1a0)](_0x141c9f),_0x244c7b=_0x3cd39f[_0x2d4803(0x15b)]['journeyStages']['find'](_0x3d7c7f=>_0x3d7c7f['name'][_0x2d4803(0x1fe)]()===_0x1d2baf[_0x2d4803(0x1fe)]());if(!_0x244c7b?.['id'])throw new SDKError(ErrorCode[_0x2d4803(0x1d9)],'Stage\x20\x27'+_0x1d2baf+_0x2d4803(0x197)+(_0x3cd39f['attributes']['journeyBundleName']||_0x3cd39f[_0x2d4803(0x15b)]['name'])+'\x27');return _0x244c7b['id'];}},_0x3da8d0=await _0x512cae(_0x408b5e[_0x31bc58(0x13d)],_0x2b0775[_0x31bc58(0x209)],_0x4acb57),_0x5c3c09=_0x2b0775[_0x31bc58(0x17f)]||_0x2b0775[_0x31bc58(0x148)];_0x5c3c09&&(_0x3da8d0[_0x31bc58(0x182)]={'parentFolder':{'data':{'id':_0x5c3c09,'type':_0x31bc58(0x198)}}});if(_0x408b5e[_0x31bc58(0x215)]){if(_0x2f32de[_0x31bc58(0x1a6)]>0x0||_0x250a47[_0x31bc58(0x1a6)]>0x0)return await executeThreeStepJourneyCreate(_0x4e5d16,_0x408b5e,_0x3da8d0,{'pendingEmbeddedSegments':_0x2f32de,'pendingEmbeddedActivations':_0x250a47,'embeddedSegmentNameToId':_0x1bacf0,'journeyActivationNameToId':_0x1807e6},{..._0x2b0775,'effectiveFolderId':_0x5c3c09},_0x275571,_0x3099de,_0x5cb6e0);else{ensureJourneyDefaults(_0x3da8d0[_0x31bc58(0x15b)]);const _0x39b49c=await _0x4e5d16['journey']['create'](_0x3da8d0);return deletePushRecovery(_0x408b5e[_0x31bc58(0x213)]),{'action':'created','journeyId':_0x39b49c['id'],'embeddedSegmentNameToId':_0x1bacf0};}}else{if(_0x408b5e[_0x31bc58(0x191)]&&_0x408b5e[_0x31bc58(0x21f)]){_0x3da8d0['id']=_0x408b5e[_0x31bc58(0x21f)]['id'];const _0x3ca53d=_0x3da8d0[_0x31bc58(0x15b)];_0x408b5e[_0x31bc58(0x21f)][_0x31bc58(0x15b)]?.['journeyBundleName']&&(_0x3ca53d[_0x31bc58(0x170)]=_0x408b5e[_0x31bc58(0x21f)][_0x31bc58(0x15b)]['journeyBundleName']);const _0x504036=_0x408b5e['existingJourney'][_0x31bc58(0x15b)]?.[_0x31bc58(0x159)];return _0x504036&&_0x3da8d0[_0x31bc58(0x15b)][_0x31bc58(0x159)]&&injectExistingStageIds(_0x3da8d0[_0x31bc58(0x15b)]['journeyStages'],_0x504036),ensureJourneyDefaults(_0x3ca53d),await _0x4e5d16[_0x31bc58(0x21a)][_0x31bc58(0x1c6)](_0x408b5e[_0x31bc58(0x21f)]['id'],_0x3da8d0),deletePushRecovery(_0x408b5e[_0x31bc58(0x213)]),{'action':'updated','journeyId':_0x408b5e[_0x31bc58(0x21f)]['id'],'embeddedSegmentNameToId':_0x1bacf0};}}return deletePushRecovery(_0x408b5e[_0x31bc58(0x213)]),{'action':'unchanged','journeyId':_0x408b5e[_0x31bc58(0x21f)]?.['id'],'embeddedSegmentNameToId':_0x1bacf0};}function findSegmentCriteriaLocation(_0xb59e14,_0x355310){const _0x34383f=a128_0x3bb546,_0x591e8a=_0xb59e14['stages']||_0xb59e14[_0x34383f(0x223)]?.[0x0]?.[_0x34383f(0x13f)]||[];let _0x37d84c=_0x34383f(0x1e8),_0x3c3aba=_0x355310;const _0x41fe28=_0xb59e14[_0x34383f(0x18a)]||_0xb59e14[_0x34383f(0x223)]?.[0x0]?.[_0x34383f(0x18a)];if(_0x41fe28?.[_0x34383f(0x1ab)]===_0x355310)return{'stageName':'goal','criteriaName':_0x41fe28[_0x34383f(0x196)]||_0x355310};_0x4ef75e:for(const _0x1cff36 of _0x591e8a){if(_0x1cff36[_0x34383f(0x189)]?.['segment']===_0x355310){_0x37d84c=_0x1cff36[_0x34383f(0x196)],_0x3c3aba=_0x1cff36[_0x34383f(0x189)]['name']||_0x355310;break;}if(_0x1cff36[_0x34383f(0x141)])for(const _0x5936af of _0x1cff36[_0x34383f(0x141)]){if(_0x5936af[_0x34383f(0x1ef)]===_0x34383f(0x1ed)&&_0x5936af[_0x34383f(0x179)]?.[_0x34383f(0x1d2)])for(const _0x2d7e7e of _0x5936af[_0x34383f(0x179)][_0x34383f(0x1d2)]){if(_0x2d7e7e[_0x34383f(0x1ab)]===_0x355310){_0x37d84c=_0x1cff36[_0x34383f(0x196)],_0x3c3aba=_0x2d7e7e[_0x34383f(0x196)]||_0x355310;break _0x4ef75e;}}}}return{'stageName':_0x37d84c,'criteriaName':_0x3c3aba};}async function executeThreeStepJourneyCreate(_0x578e42,_0x2d28f4,_0x20994c,_0x1dcf6c,_0x327fb5,_0x1c4138,_0x2cc5df,_0x20231a){const _0x2cf6e1=a128_0x3bb546,{activationDefToCreateRequest:_0x15ab15,yamlRuleToApi:_0x470b29}=_0x20231a,{pendingEmbeddedSegments:_0x2c7f8d,pendingEmbeddedActivations:_0x2f004b,embeddedSegmentNameToId:_0x3742db}=_0x1dcf6c,_0x5a52f7=JSON[_0x2cf6e1(0x1ca)](JSON[_0x2cf6e1(0x13e)](_0x20994c));ensureJourneyDefaults(_0x5a52f7[_0x2cf6e1(0x15b)]),stripPendingIds(_0x5a52f7);const _0x120249=await _0x578e42[_0x2cf6e1(0x21a)]['create'](_0x5a52f7),_0x13ad7b=_0x120249['id'],_0x2100a2=new Map();for(const _0x3aa661 of _0x120249[_0x2cf6e1(0x15b)][_0x2cf6e1(0x159)]){_0x2100a2[_0x2cf6e1(0x1ec)](_0x3aa661[_0x2cf6e1(0x196)]['toLowerCase'](),_0x3aa661['id']);}recoverSegmentIdsFromPushRecovery(_0x2d28f4,_0x3742db,_0x1c4138[_0x2cf6e1(0x195)]);for(const [_0x153560,{definition:_0x1cbdfe}]of _0x2c7f8d){if(_0x3742db[_0x2cf6e1(0x205)](_0x153560)){_0x2cc5df[_0x2cf6e1(0x15d)]?.({'type':_0x2cf6e1(0x1e1),'journeyName':_0x2d28f4['yamlConfig'][_0x2cf6e1(0x196)],'segmentName':_0x153560});continue;}const _0x4bed12=generateDeterministicJourneySegmentName(_0x2d28f4['yamlConfig'][_0x2cf6e1(0x196)],_0x153560);_0x2cc5df[_0x2cf6e1(0x15d)]?.({'type':_0x2cf6e1(0x201),'journeyName':_0x2d28f4[_0x2cf6e1(0x13d)]['name'],'segmentName':_0x153560});const _0x585e95=createSegmentIdResolver(_0x1c4138[_0x2cf6e1(0x195)],_0x153560),_0x19cf89=await resolveRuleSegmentIds(_0x1cbdfe[_0x2cf6e1(0x1f1)],_0x585e95),_0x553196=await createOrRecoverEmbeddedSegment(_0x578e42,_0x2d28f4,{'localName':_0x153560,'uniqueSegmentName':_0x4bed12,'description':_0x1cbdfe[_0x2cf6e1(0x154)]||_0x2cf6e1(0x1ba)+_0x153560,'journeyId':_0x13ad7b,'resolvedRule':_0x19cf89,'parentId':_0x327fb5[_0x2cf6e1(0x209)],'folderId':_0x327fb5[_0x2cf6e1(0x19f)]||''},_0x470b29);_0x3742db[_0x2cf6e1(0x1ec)](_0x153560,_0x553196),_0x1c4138[_0x2cf6e1(0x195)][_0x2cf6e1(0x1ec)](_0x153560,_0x553196),_0x2cc5df[_0x2cf6e1(0x15d)]?.({'type':_0x2cf6e1(0x1e1),'journeyName':_0x2d28f4[_0x2cf6e1(0x13d)][_0x2cf6e1(0x196)],'segmentName':_0x153560});}const _0x3ed6d0=new Map();for(const [_0x48c775,_0xd35345]of _0x2f004b){_0x2cc5df[_0x2cf6e1(0x15d)]?.({'type':'embedded_activation_creating','journeyName':_0x2d28f4['yamlConfig'][_0x2cf6e1(0x196)],'activationName':_0x48c775});const _0x31b38b=await _0x15ab15(_0xd35345,_0x1c4138[_0x2cf6e1(0x1ae)]),_0x3485a5={..._0x31b38b,..._0xd35345[_0x2cf6e1(0x1ac)]!==undefined&&{'runAfterJourneyRefresh':_0xd35345[_0x2cf6e1(0x1ac)]}},_0x27cd5b=await _0x578e42[_0x2cf6e1(0x21a)]['createActivation'](_0x13ad7b,_0x3485a5);_0x3ed6d0[_0x2cf6e1(0x1ec)](_0x48c775,_0x27cd5b['id']),_0x1dcf6c['journeyActivationNameToId']['set'](_0x48c775,_0x27cd5b['id']),_0x2cc5df[_0x2cf6e1(0x15d)]?.({'type':'embedded_activation_created','journeyName':_0x2d28f4[_0x2cf6e1(0x13d)]['name'],'activationName':_0x48c775});}const _0x335dbd=JSON[_0x2cf6e1(0x1ca)](JSON[_0x2cf6e1(0x13e)](_0x20994c));return _0x335dbd['id']=_0x13ad7b,ensureJourneyDefaults(_0x335dbd[_0x2cf6e1(0x15b)]),resolvePendingIdsInRequest(_0x335dbd,_0x20994c,_0x2100a2,_0x3742db,_0x3ed6d0,_0x2cc5df),await _0x578e42[_0x2cf6e1(0x21a)]['update'](_0x13ad7b,_0x335dbd),deletePushRecovery(_0x2d28f4[_0x2cf6e1(0x213)]),{'action':'created','journeyId':_0x13ad7b,'embeddedSegmentNameToId':_0x3742db};}export function stripWaitStepPendingIds(_0x621dd3){const _0x4ab978=a128_0x3bb546,_0x2aa670=_0x621dd3['conditionSegmentId']&&isPendingSegmentId(_0x621dd3['conditionSegmentId']),_0x119600=_0x621dd3['conditions']?.[_0x4ab978(0x222)](_0x3d5f0f=>_0x3d5f0f[_0x4ab978(0x1db)]&&isPendingSegmentId(_0x3d5f0f[_0x4ab978(0x1db)]));(_0x2aa670||_0x119600)&&(_0x621dd3[_0x4ab978(0x187)]='Duration',_0x621dd3[_0x4ab978(0x199)]=0x1,_0x621dd3['waitStepUnit']=_0x4ab978(0x1c4),delete _0x621dd3[_0x4ab978(0x14c)],delete _0x621dd3[_0x4ab978(0x1fa)],delete _0x621dd3[_0x4ab978(0x1b2)],delete _0x621dd3[_0x4ab978(0x1ea)]);}export function resolveWaitStepPendingIds(_0x399476,_0x2292a1,_0x442103,_0xb5d35d){const _0x1b373c=a128_0x3bb546;if(_0x2292a1[_0x1b373c(0x14c)]&&isPendingSegmentId(_0x2292a1[_0x1b373c(0x14c)])){const _0x34cb23=_0x442103(_0x2292a1[_0x1b373c(0x14c)],'stage\x20\x27'+_0xb5d35d+_0x1b373c(0x1ce));_0x34cb23&&(_0x399476[_0x1b373c(0x187)]=_0x1b373c(0x1f3),_0x399476[_0x1b373c(0x14c)]=_0x34cb23,delete _0x399476['waitStep'],delete _0x399476[_0x1b373c(0x237)],_0x2292a1['conditionTimeoutDuration']!==undefined&&(_0x399476[_0x1b373c(0x1fa)]=_0x2292a1[_0x1b373c(0x1fa)]),_0x2292a1[_0x1b373c(0x1b2)]&&(_0x399476[_0x1b373c(0x1b2)]=_0x2292a1[_0x1b373c(0x1b2)]));}if(_0x2292a1[_0x1b373c(0x1ea)]){const _0x5df44c=_0x2292a1['conditions'][_0x1b373c(0x222)](_0x5abd25=>_0x5abd25[_0x1b373c(0x1db)]&&isPendingSegmentId(_0x5abd25[_0x1b373c(0x1db)]));if(_0x5df44c){const _0x1b4838=_0x2292a1[_0x1b373c(0x1ea)]['map'](_0x2100d5=>{const _0x1eb69b=_0x1b373c;if(_0x2100d5[_0x1eb69b(0x1db)]&&isPendingSegmentId(_0x2100d5[_0x1eb69b(0x1db)])){const _0x16a023=_0x442103(_0x2100d5[_0x1eb69b(0x1db)],_0x1eb69b(0x178)+_0xb5d35d+_0x1eb69b(0x1ce));return{..._0x2100d5,'segmentId':_0x16a023||_0x2100d5[_0x1eb69b(0x1db)]};}return{..._0x2100d5};});_0x399476[_0x1b373c(0x187)]=_0x1b373c(0x1f3),_0x399476[_0x1b373c(0x1ea)]=_0x1b4838,delete _0x399476[_0x1b373c(0x199)],delete _0x399476[_0x1b373c(0x237)],delete _0x399476[_0x1b373c(0x14c)],delete _0x399476['conditionTimeoutDuration'],delete _0x399476['conditionTimeoutUnit'];}}}function stripPendingIds(_0x5a4653){const _0x5a5d4c=a128_0x3bb546;_0x5a4653[_0x5a5d4c(0x15b)][_0x5a5d4c(0x18a)]?.[_0x5a5d4c(0x1db)]&&isPendingSegmentId(_0x5a4653[_0x5a5d4c(0x15b)][_0x5a5d4c(0x18a)]['segmentId'])&&delete _0x5a4653[_0x5a5d4c(0x15b)][_0x5a5d4c(0x18a)];for(const _0x13a96c of _0x5a4653[_0x5a5d4c(0x15b)][_0x5a5d4c(0x159)]||[]){_0x13a96c['entryCriteria']?.[_0x5a5d4c(0x1db)]&&isPendingSegmentId(_0x13a96c[_0x5a5d4c(0x181)][_0x5a5d4c(0x1db)])&&delete _0x13a96c[_0x5a5d4c(0x181)];_0x13a96c[_0x5a5d4c(0x200)]?.[_0x5a5d4c(0x1db)]&&isPendingSegmentId(_0x13a96c['milestone'][_0x5a5d4c(0x1db)])&&delete _0x13a96c[_0x5a5d4c(0x200)];_0x13a96c[_0x5a5d4c(0x22d)]&&(_0x13a96c[_0x5a5d4c(0x22d)]=_0x13a96c[_0x5a5d4c(0x22d)][_0x5a5d4c(0x1b8)](_0xf546bd=>!_0xf546bd['segmentId']||!isPendingSegmentId(_0xf546bd[_0x5a5d4c(0x1db)])));if(_0x13a96c[_0x5a5d4c(0x141)])for(const _0x2e276f of Object[_0x5a5d4c(0x226)](_0x13a96c[_0x5a5d4c(0x141)])){const _0x5dbdd8=_0x13a96c[_0x5a5d4c(0x141)][_0x2e276f];_0x5dbdd8['type']===_0x5a5d4c(0x177)&&_0x5dbdd8['journeyActivationStepId']&&isPendingActivationId(_0x5dbdd8[_0x5a5d4c(0x1be)])&&(_0x5dbdd8[_0x5a5d4c(0x1be)]='');if(_0x5dbdd8[_0x5a5d4c(0x1ef)]===_0x5a5d4c(0x17a)&&_0x5dbdd8['branches'])for(const _0x2fd438 of _0x5dbdd8[_0x5a5d4c(0x1d2)]){_0x2fd438[_0x5a5d4c(0x1db)]&&isPendingSegmentId(_0x2fd438[_0x5a5d4c(0x1db)])&&(_0x2fd438[_0x5a5d4c(0x1db)]='');}_0x5dbdd8[_0x5a5d4c(0x1ef)]==='WaitStep'&&stripWaitStepPendingIds(_0x5dbdd8);}}}function resolvePendingIdsInRequest(_0x2a18ab,_0x523ec7,_0x317753,_0x2207d4,_0x110d3a,_0x33d077){const _0x3adb11=a128_0x3bb546,_0x14a861=(_0x1e2854,_0x4d40a3)=>{const _0x3a5a6a=a128_0x1e5b;if(!isPendingSegmentId(_0x1e2854))return _0x1e2854;const _0x5726e0=extractPendingSegmentName(_0x1e2854),_0x50bc92=_0x2207d4['get'](_0x5726e0);return!_0x50bc92&&_0x33d077[_0x3a5a6a(0x157)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x5726e0+_0x3a5a6a(0x18e)+_0x4d40a3),_0x50bc92;};if(_0x2a18ab[_0x3adb11(0x15b)]['goal']?.[_0x3adb11(0x1db)]&&isPendingSegmentId(_0x2a18ab[_0x3adb11(0x15b)][_0x3adb11(0x18a)][_0x3adb11(0x1db)])){const _0x23a033=_0x14a861(_0x2a18ab[_0x3adb11(0x15b)][_0x3adb11(0x18a)][_0x3adb11(0x1db)],_0x3adb11(0x1f4));_0x23a033&&(_0x2a18ab[_0x3adb11(0x15b)][_0x3adb11(0x18a)]['segmentId']=_0x23a033);}for(const _0xf5bed5 of _0x2a18ab[_0x3adb11(0x15b)]['journeyStages']||[]){const _0x1dd190=_0x317753[_0x3adb11(0x19b)](_0xf5bed5[_0x3adb11(0x196)][_0x3adb11(0x1fe)]());_0x1dd190&&(_0xf5bed5['id']=_0x1dd190);if(_0xf5bed5['entryCriteria']?.[_0x3adb11(0x1db)]&&isPendingSegmentId(_0xf5bed5[_0x3adb11(0x181)][_0x3adb11(0x1db)])){const _0xda5928=_0x14a861(_0xf5bed5[_0x3adb11(0x181)]['segmentId'],_0x3adb11(0x178)+_0xf5bed5[_0x3adb11(0x196)]+_0x3adb11(0x17e));_0xda5928&&(_0xf5bed5[_0x3adb11(0x181)][_0x3adb11(0x1db)]=_0xda5928);}if(_0xf5bed5[_0x3adb11(0x22d)])for(const _0x2238d8 of _0xf5bed5[_0x3adb11(0x22d)]){if(_0x2238d8[_0x3adb11(0x1db)]&&isPendingSegmentId(_0x2238d8[_0x3adb11(0x1db)])){const _0x2b4b7c=_0x14a861(_0x2238d8[_0x3adb11(0x1db)],_0x3adb11(0x178)+_0xf5bed5[_0x3adb11(0x196)]+_0x3adb11(0x235));_0x2b4b7c&&(_0x2238d8[_0x3adb11(0x1db)]=_0x2b4b7c);}}if(_0xf5bed5['milestone']?.['segmentId']&&isPendingSegmentId(_0xf5bed5['milestone'][_0x3adb11(0x1db)])){const _0x2a9310=_0x14a861(_0xf5bed5[_0x3adb11(0x200)]['segmentId'],'stage\x20\x27'+_0xf5bed5[_0x3adb11(0x196)]+_0x3adb11(0x210));_0x2a9310&&(_0xf5bed5[_0x3adb11(0x200)][_0x3adb11(0x1db)]=_0x2a9310);}if(_0xf5bed5['steps']){const _0x21ed50=_0x398c6f=>_0x523ec7[_0x3adb11(0x15b)][_0x3adb11(0x159)]?.[_0x3adb11(0x1d7)](_0x30a137=>_0x30a137['name'][_0x3adb11(0x1fe)]()===_0xf5bed5[_0x3adb11(0x196)][_0x3adb11(0x1fe)]())?.[_0x3adb11(0x141)]?.[_0x398c6f];for(const _0x4481a0 of Object['keys'](_0xf5bed5[_0x3adb11(0x141)])){const _0x44b94a=_0xf5bed5[_0x3adb11(0x141)][_0x4481a0],_0x3be6fb=_0x21ed50(_0x4481a0);if(_0x44b94a[_0x3adb11(0x1ef)]===_0x3adb11(0x177)&&_0x44b94a['journeyActivationStepId']&&(isPendingActivationId(_0x44b94a['journeyActivationStepId'])||_0x44b94a[_0x3adb11(0x1be)]==='')){if(_0x3be6fb?.['journeyActivationStepId']&&isPendingActivationId(_0x3be6fb[_0x3adb11(0x1be)])){const _0x373dcd=extractPendingActivationName(_0x3be6fb[_0x3adb11(0x1be)]),_0x34bea6=_0x110d3a[_0x3adb11(0x19b)](_0x373dcd);_0x34bea6&&(_0x44b94a[_0x3adb11(0x1be)]=_0x34bea6);}}if(_0x44b94a[_0x3adb11(0x1ef)]===_0x3adb11(0x17a)&&_0x44b94a[_0x3adb11(0x1d2)]&&_0x3be6fb?.[_0x3adb11(0x1d2)])for(let _0xd1a23e=0x0;_0xd1a23e<_0x44b94a[_0x3adb11(0x1d2)][_0x3adb11(0x19a)];_0xd1a23e++){const _0x1fbbd7=_0x44b94a['branches'][_0xd1a23e],_0x20f041=_0x3be6fb['branches'][_0xd1a23e];if(_0x20f041?.[_0x3adb11(0x1db)]&&isPendingSegmentId(_0x20f041[_0x3adb11(0x1db)])){const _0x39ed3b=_0x14a861(_0x20f041['segmentId'],'stage\x20\x27'+_0xf5bed5[_0x3adb11(0x196)]+_0x3adb11(0x233)+(_0x1fbbd7['name']||_0xd1a23e)+'\x27');_0x39ed3b&&(_0x1fbbd7[_0x3adb11(0x1db)]=_0x39ed3b);}}_0x44b94a['type']==='WaitStep'&&_0x3be6fb?.[_0x3adb11(0x1ef)]===_0x3adb11(0x193)&&resolveWaitStepPendingIds(_0x44b94a,_0x3be6fb,_0x14a861,_0xf5bed5[_0x3adb11(0x196)]);}}}}
@@ -1 +1 @@
1
- (function(_0x57350e,_0x207f16){const _0xa0516c=a129_0xb491,_0x15d04e=_0x57350e();while(!![]){try{const _0x15687e=-parseInt(_0xa0516c(0x7b))/0x1+parseInt(_0xa0516c(0x78))/0x2*(parseInt(_0xa0516c(0x80))/0x3)+parseInt(_0xa0516c(0x83))/0x4*(parseInt(_0xa0516c(0x79))/0x5)+parseInt(_0xa0516c(0x75))/0x6+parseInt(_0xa0516c(0x7d))/0x7*(-parseInt(_0xa0516c(0x84))/0x8)+-parseInt(_0xa0516c(0x76))/0x9*(parseInt(_0xa0516c(0x7e))/0xa)+-parseInt(_0xa0516c(0x7c))/0xb*(-parseInt(_0xa0516c(0x77))/0xc);if(_0x15687e===_0x207f16)break;else _0x15d04e['push'](_0x15d04e['shift']());}catch(_0x54f7e4){_0x15d04e['push'](_0x15d04e['shift']());}}}(a129_0x2c2a,0x3fdaa));function a129_0x2c2a(){const _0x3cb1a6=['88GtGWXv','set','get','474276xGUEXk','69021oveBlb','60OzlIQG','271636irxgzM','941200QOcuZv','add','259122cBVdny','716969QAnbXV','295673sOJDOT','20sWtSTr','parentFolderId','9XJkjku','has','name','4qVukbA'];a129_0x2c2a=function(){return _0x3cb1a6;};return a129_0x2c2a();}export function buildFolderIdToPathMap(_0x33f0da){const _0x28995a=a129_0xb491,_0x77843c=new Map(),_0x55f17a=new Map();for(const _0x1b7482 of _0x33f0da){_0x55f17a[_0x28995a(0x85)](_0x1b7482['id'],_0x1b7482);}const _0x2bcb1c=new Set();for(const _0x254d9d of _0x33f0da){!_0x254d9d['parentFolderId']&&_0x2bcb1c[_0x28995a(0x7a)](_0x254d9d['id']);}function _0x2a3881(_0x4d33ca){const _0x4afb61=_0x28995a;if(_0x77843c[_0x4afb61(0x81)](_0x4d33ca['id']))return _0x77843c['get'](_0x4d33ca['id']);if(_0x2bcb1c[_0x4afb61(0x81)](_0x4d33ca['id']))return _0x77843c['set'](_0x4d33ca['id'],''),'';if(_0x4d33ca['parentFolderId']){const _0x42e246=_0x55f17a[_0x4afb61(0x86)](_0x4d33ca['parentFolderId']);if(_0x42e246){const _0x362fbe=_0x2a3881(_0x42e246),_0x34b971=_0x362fbe?_0x362fbe+'/'+_0x4d33ca[_0x4afb61(0x82)]:_0x4d33ca[_0x4afb61(0x82)];return _0x77843c['set'](_0x4d33ca['id'],_0x34b971),_0x34b971;}}const _0x2531cc=_0x4d33ca[_0x4afb61(0x82)];return _0x77843c[_0x4afb61(0x85)](_0x4d33ca['id'],_0x2531cc),_0x2531cc;}for(const _0x487588 of _0x33f0da){_0x2a3881(_0x487588);}return _0x77843c;}function a129_0xb491(_0x7ac44d,_0x38b11a){_0x7ac44d=_0x7ac44d-0x75;const _0x2c2abb=a129_0x2c2a();let _0xb4910e=_0x2c2abb[_0x7ac44d];return _0xb4910e;}export function buildFolderPathToIdMap(_0x1ac48a){const _0x5c6869=a129_0xb491,_0x912cbc=new Map(),_0x4e94=new Map();for(const _0x1895f9 of _0x1ac48a){_0x4e94[_0x5c6869(0x85)](_0x1895f9['id'],_0x1895f9);}const _0x1f6db5=new Set();for(const _0x2f4b19 of _0x1ac48a){!_0x2f4b19[_0x5c6869(0x7f)]&&_0x1f6db5[_0x5c6869(0x7a)](_0x2f4b19['id']);}function _0x159be3(_0x1d42d9){const _0x3f9be5=_0x5c6869;if(_0x1f6db5['has'](_0x1d42d9['id']))return'';if(_0x1d42d9[_0x3f9be5(0x7f)]){const _0x49eefe=_0x4e94['get'](_0x1d42d9['parentFolderId']);if(_0x49eefe){const _0x44bb05=_0x159be3(_0x49eefe);return _0x44bb05?_0x44bb05+'/'+_0x1d42d9[_0x3f9be5(0x82)]:_0x1d42d9[_0x3f9be5(0x82)];}}return _0x1d42d9[_0x3f9be5(0x82)];}for(const _0x37afa5 of _0x1ac48a){const _0x21e200=_0x159be3(_0x37afa5);_0x912cbc[_0x5c6869(0x85)](_0x21e200,_0x37afa5['id']);}return _0x912cbc;}export function buildFolderMaps(_0x57f901){const _0x4b6aae=a129_0xb491,_0x1b4b8a=buildFolderIdToPathMap(_0x57f901),_0x750c0f=new Map();for(const [_0x844575,_0x5c2025]of _0x1b4b8a){_0x750c0f[_0x4b6aae(0x85)](_0x5c2025,_0x844575);}return{'idToPath':_0x1b4b8a,'pathToId':_0x750c0f};}export function getFolderPath(_0x53dfc5,_0xd1389d){const _0x2944b9=a129_0xb491;if(!_0x53dfc5)return'';return _0xd1389d[_0x2944b9(0x86)](_0x53dfc5)??'';}
1
+ (function(_0x301d4d,_0x4e97aa){const _0x2f9aca=a129_0x2d93,_0xa52463=_0x301d4d();while(!![]){try{const _0x4eb848=parseInt(_0x2f9aca(0x94))/0x1+parseInt(_0x2f9aca(0x92))/0x2*(-parseInt(_0x2f9aca(0x95))/0x3)+parseInt(_0x2f9aca(0x8f))/0x4+-parseInt(_0x2f9aca(0x8e))/0x5+parseInt(_0x2f9aca(0x8d))/0x6*(parseInt(_0x2f9aca(0x9a))/0x7)+-parseInt(_0x2f9aca(0x99))/0x8*(-parseInt(_0x2f9aca(0x96))/0x9)+-parseInt(_0x2f9aca(0x98))/0xa;if(_0x4eb848===_0x4e97aa)break;else _0xa52463['push'](_0xa52463['shift']());}catch(_0x58a04e){_0xa52463['push'](_0xa52463['shift']());}}}(a129_0x460b,0x5cf79));export function buildFolderIdToPathMap(_0x46a9ac){const _0x5124a9=a129_0x2d93,_0x7aa1ad=new Map(),_0x41d913=new Map();for(const _0x5ae49a of _0x46a9ac){_0x41d913[_0x5124a9(0x90)](_0x5ae49a['id'],_0x5ae49a);}const _0x3e58d9=new Set();for(const _0x2b3258 of _0x46a9ac){!_0x2b3258['parentFolderId']&&_0x3e58d9[_0x5124a9(0x91)](_0x2b3258['id']);}function _0x1b4f00(_0x5647e5){const _0x3b809c=_0x5124a9;if(_0x7aa1ad[_0x3b809c(0x97)](_0x5647e5['id']))return _0x7aa1ad['get'](_0x5647e5['id']);if(_0x3e58d9[_0x3b809c(0x97)](_0x5647e5['id']))return _0x7aa1ad['set'](_0x5647e5['id'],''),'';if(_0x5647e5['parentFolderId']){const _0x3fa2c5=_0x41d913[_0x3b809c(0x93)](_0x5647e5['parentFolderId']);if(_0x3fa2c5){const _0x9b6309=_0x1b4f00(_0x3fa2c5),_0x32bfd1=_0x9b6309?_0x9b6309+'/'+_0x5647e5[_0x3b809c(0x8c)]:_0x5647e5[_0x3b809c(0x8c)];return _0x7aa1ad['set'](_0x5647e5['id'],_0x32bfd1),_0x32bfd1;}}const _0x586dd8=_0x5647e5[_0x3b809c(0x8c)];return _0x7aa1ad[_0x3b809c(0x90)](_0x5647e5['id'],_0x586dd8),_0x586dd8;}for(const _0x3a2bfc of _0x46a9ac){_0x1b4f00(_0x3a2bfc);}return _0x7aa1ad;}export function buildFolderPathToIdMap(_0x550db9){const _0x4b9a45=a129_0x2d93,_0x3f8737=new Map(),_0x77f62f=new Map();for(const _0x9ac6e4 of _0x550db9){_0x77f62f[_0x4b9a45(0x90)](_0x9ac6e4['id'],_0x9ac6e4);}const _0x17c6d8=new Set();for(const _0x5ceb20 of _0x550db9){!_0x5ceb20[_0x4b9a45(0x9b)]&&_0x17c6d8['add'](_0x5ceb20['id']);}function _0x2f705f(_0x52cebd){const _0x47d40e=_0x4b9a45;if(_0x17c6d8[_0x47d40e(0x97)](_0x52cebd['id']))return'';if(_0x52cebd[_0x47d40e(0x9b)]){const _0x21d250=_0x77f62f[_0x47d40e(0x93)](_0x52cebd[_0x47d40e(0x9b)]);if(_0x21d250){const _0x3fab1a=_0x2f705f(_0x21d250);return _0x3fab1a?_0x3fab1a+'/'+_0x52cebd[_0x47d40e(0x8c)]:_0x52cebd[_0x47d40e(0x8c)];}}return _0x52cebd[_0x47d40e(0x8c)];}for(const _0x21c461 of _0x550db9){const _0xd707f5=_0x2f705f(_0x21c461);_0x3f8737[_0x4b9a45(0x90)](_0xd707f5,_0x21c461['id']);}return _0x3f8737;}export function buildFolderMaps(_0x48a557){const _0x407200=a129_0x2d93,_0x250bd5=buildFolderIdToPathMap(_0x48a557),_0x514086=new Map();for(const [_0x121b51,_0xde80e0]of _0x250bd5){_0x514086[_0x407200(0x90)](_0xde80e0,_0x121b51);}return{'idToPath':_0x250bd5,'pathToId':_0x514086};}function a129_0x460b(){const _0x1ac8a0=['has','6521010xbjLxP','44728iMCAQA','58793eAWwhN','parentFolderId','name','318oGiuHv','686240SosyGh','2129128XlwqeF','set','add','46958eYEKsR','get','652210ZSrKJM','78qrcnlR','243NRYOCF'];a129_0x460b=function(){return _0x1ac8a0;};return a129_0x460b();}function a129_0x2d93(_0x1ca2bd,_0x47e7b9){_0x1ca2bd=_0x1ca2bd-0x8c;const _0x460b15=a129_0x460b();let _0x2d9349=_0x460b15[_0x1ca2bd];return _0x2d9349;}export function getFolderPath(_0x558277,_0x27c316){const _0x42419d=a129_0x2d93;if(!_0x558277)return'';return _0x27c316[_0x42419d(0x93)](_0x558277)??'';}
@@ -1 +1 @@
1
- (function(_0x5b47a0,_0x3e2133){const _0x2eda0d=a130_0x1f8f,_0x3010e9=_0x5b47a0();while(!![]){try{const _0x26f4f0=parseInt(_0x2eda0d(0x15b))/0x1+parseInt(_0x2eda0d(0x187))/0x2+parseInt(_0x2eda0d(0x16d))/0x3+parseInt(_0x2eda0d(0x160))/0x4+-parseInt(_0x2eda0d(0x182))/0x5+parseInt(_0x2eda0d(0x164))/0x6*(parseInt(_0x2eda0d(0x161))/0x7)+-parseInt(_0x2eda0d(0x16e))/0x8*(parseInt(_0x2eda0d(0x178))/0x9);if(_0x26f4f0===_0x3e2133)break;else _0x3010e9['push'](_0x3010e9['shift']());}catch(_0xb9a49a){_0x3010e9['push'](_0x3010e9['shift']());}}}(a130_0x14a7,0xb55d9));function a130_0x14a7(){const _0x2511bb=['Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','578277TxLlSO','segment','startsWith','parent_segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','5042940WMdJrw','1771ZNJWvq','resolve','replace','28794PdAkfy','name','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Relative\x20path\x20cannot\x20be\x20empty','File\x20not\x20found:\x20','length','tdx.json','push','filter','2620644cGDMWf','4720MESJVc','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','raw','.yaml','readFile','Path\x20cannot\x20be\x20empty','parse','endsWith','journey','isAbsolute','51939NKaljI','Cannot\x20navigate\x20above\x20root','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','.yml','join','Path\x20attempts\x20to\x20navigate\x20above\x20root','pop','Path\x20segment\x20cannot\x20be\x20empty','exists','segments','4646410tCJdNV','substring','dirname','root','relative','2300676zMfZeo','trim'];a130_0x14a7=function(){return _0x2511bb;};return a130_0x14a7();}import a130_0x198607 from'path';import{parse as a130_0x4bbda6}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x140fba){const _0xd80d15=a130_0x1f8f;if(!_0x140fba||_0x140fba[_0xd80d15(0x188)]()==='')throw new Error(_0xd80d15(0x173));const _0x3f8955=_0x140fba[_0xd80d15(0x188)]();if(_0x3f8955==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x140fba};const _0x2d816d=_0x3f8955[_0xd80d15(0x15d)]('/')?_0x3f8955[_0xd80d15(0x183)](0x1):_0x3f8955,_0x497ece=_0x2d816d['split']('/')[_0xd80d15(0x16c)](_0x583f85=>_0x583f85!=='');if(_0x497ece['length']===0x0)throw new Error(_0xd80d15(0x15f));const _0x53ee68=_0x3f8955[_0xd80d15(0x15d)]('/')||!isRelativePathSegment(_0x497ece[0x0]);for(const _0x452e3a of _0x497ece){validatePathSegment(_0x452e3a);}return{'segments':_0x497ece,'isAbsolute':_0x53ee68,'raw':_0x140fba};}function isRelativePathSegment(_0x467831){return _0x467831==='.'||_0x467831==='..';}function validatePathSegment(_0x4d7f7f){const _0x1559ec=a130_0x1f8f;if(_0x4d7f7f==='')throw new Error(_0x1559ec(0x17f));if(_0x4d7f7f==='.'||_0x4d7f7f==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x4d7f7f))throw new Error(_0x1559ec(0x166)+_0x4d7f7f);if(_0x4d7f7f!==_0x4d7f7f[_0x1559ec(0x188)]()){}}export function validatePath(_0x5e616c){const _0xf7e5de=a130_0x1f8f;if(_0x5e616c[_0xf7e5de(0x181)]['length']===0x0&&!_0x5e616c['isAbsolute'])throw new Error(_0xf7e5de(0x167));if(_0x5e616c[_0xf7e5de(0x177)]){if(_0x5e616c[_0xf7e5de(0x181)][0x0]==='..')throw new Error(_0xf7e5de(0x16f));let _0x56a29c=0x0;for(const _0x11008e of _0x5e616c[_0xf7e5de(0x181)]){if(_0x11008e==='..'){if(_0x56a29c===0x0)throw new Error(_0xf7e5de(0x17d));_0x56a29c--;}else _0x11008e!=='.'&&_0x56a29c++;}}}export function joinPaths(_0xdae523,_0x184638){const _0xe5bdf=a130_0x1f8f;if(!_0xdae523||_0xdae523==='/')return _0x184638;if(!_0x184638||_0x184638==='.')return _0xdae523;if(_0x184638[_0xe5bdf(0x15d)]('/'))return _0x184638;const _0x58923e=parsePath(_0xdae523),_0x2f5a2f=parsePath(_0x184638),_0x5523ae=[..._0x58923e[_0xe5bdf(0x181)]];for(const _0x220f80 of _0x2f5a2f[_0xe5bdf(0x181)]){if(_0x220f80==='.')continue;else{if(_0x220f80==='..'){if(_0x5523ae['length']===0x0)throw new Error(_0xe5bdf(0x179));_0x5523ae[_0xe5bdf(0x17e)]();}else _0x5523ae[_0xe5bdf(0x16b)](_0x220f80);}}const _0x958831=_0x5523ae[_0xe5bdf(0x17c)]('/');return _0x58923e[_0xe5bdf(0x170)]['startsWith']('/')?'/'+_0x958831:_0x958831;}export function normalizePath(_0x2db1a4){const _0x3787f6=a130_0x1f8f,_0x254693=parsePath(_0x2db1a4),_0x1ea79c=[];for(const _0x251da7 of _0x254693[_0x3787f6(0x181)]){if(_0x251da7==='.')continue;else{if(_0x251da7==='..'){if(_0x1ea79c[_0x3787f6(0x169)]===0x0){if(_0x254693[_0x3787f6(0x177)])throw new Error(_0x3787f6(0x179));_0x1ea79c[_0x3787f6(0x16b)]('..');}else _0x1ea79c[_0x1ea79c[_0x3787f6(0x169)]-0x1]==='..'?_0x1ea79c['push']('..'):_0x1ea79c[_0x3787f6(0x17e)]();}else _0x1ea79c['push'](_0x251da7);}}if(_0x1ea79c[_0x3787f6(0x169)]===0x0)return _0x254693[_0x3787f6(0x177)]?'/':'.';const _0x16c2cf=_0x1ea79c['join']('/');return _0x254693['raw'][_0x3787f6(0x15d)]('/')?'/'+_0x16c2cf:_0x16c2cf;}function a130_0x1f8f(_0x204f47,_0x157da6){_0x204f47=_0x204f47-0x15b;const _0x14a7e1=a130_0x14a7();let _0x1f8f3f=_0x14a7e1[_0x204f47];return _0x1f8f3f;}export function getParentPath(_0x5dfdde){const _0x50a673=a130_0x1f8f,_0x198654=parsePath(_0x5dfdde);if(_0x198654[_0x50a673(0x181)][_0x50a673(0x169)]<=0x1)return'/';const _0x13b19f=_0x198654[_0x50a673(0x181)]['slice'](0x0,-0x1)[_0x50a673(0x17c)]('/');return _0x198654[_0x50a673(0x170)][_0x50a673(0x15d)]('/')?'/'+_0x13b19f:_0x13b19f;}export function getBaseName(_0x53e3be){const _0x463578=a130_0x1f8f,_0x17b0bc=parsePath(_0x53e3be);return _0x17b0bc[_0x463578(0x181)][_0x17b0bc['segments'][_0x463578(0x169)]-0x1]||'';}export function isChildPath(_0x4180b0,_0x1221fd){const _0x1d746e=a130_0x1f8f,_0x4aff63=parsePath(_0x4180b0),_0x58a3d5=parsePath(_0x1221fd);if(_0x4aff63[_0x1d746e(0x181)][_0x1d746e(0x169)]<=_0x58a3d5[_0x1d746e(0x181)][_0x1d746e(0x169)])return![];for(let _0x5c1807=0x0;_0x5c1807<_0x58a3d5['segments'][_0x1d746e(0x169)];_0x5c1807++){if(_0x4aff63[_0x1d746e(0x181)][_0x5c1807]!==_0x58a3d5[_0x1d746e(0x181)][_0x5c1807])return![];}return!![];}export function splitPath(_0x317bd6){const _0x4f4635=a130_0x1f8f,_0x479311=parsePath(_0x317bd6);if(_0x479311[_0x4f4635(0x181)]['length']===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x479311[_0x4f4635(0x181)]['length']===0x1)return{'parent':_0x479311[_0x4f4635(0x181)][0x0]};return{'parent':_0x479311['segments'][0x0],'child':_0x479311[_0x4f4635(0x181)]['slice'](0x1)[_0x4f4635(0x17c)]('/')};}export function isYamlFilePath(_0x4626eb){const _0x21849e=a130_0x1f8f;return _0x4626eb['endsWith'](_0x21849e(0x17b))||_0x4626eb[_0x21849e(0x175)](_0x21849e(0x171));}export async function resolveYamlFilePath(_0x25ec1b,_0x1809b1=nodeFileSystem){const _0x59ef0a=a130_0x1f8f,_0x58de95=a130_0x198607[_0x59ef0a(0x162)](_0x25ec1b);if(!await _0x1809b1[_0x59ef0a(0x180)](_0x58de95))throw new Error(_0x59ef0a(0x168)+_0x25ec1b);let _0x1af759=a130_0x198607['dirname'](_0x58de95),_0x4dad8d=null,_0x41bcf0=null;const _0x541352=a130_0x198607[_0x59ef0a(0x174)](_0x1af759)[_0x59ef0a(0x185)];while(_0x1af759!==_0x541352){const _0x3909ce=a130_0x198607[_0x59ef0a(0x17c)](_0x1af759,_0x59ef0a(0x16a));if(await _0x1809b1[_0x59ef0a(0x180)](_0x3909ce)){_0x4dad8d=_0x3909ce,_0x41bcf0=_0x1af759;break;}_0x1af759=a130_0x198607['dirname'](_0x1af759);}if(!_0x4dad8d||!_0x41bcf0)throw new Error(_0x59ef0a(0x18a)+_0x25ec1b+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x5a8e3f=await _0x1809b1[_0x59ef0a(0x172)](_0x4dad8d),_0x1415a2=JSON['parse'](_0x5a8e3f),_0x2115cc=_0x1415a2[_0x59ef0a(0x15e)];if(!_0x2115cc)throw new Error(_0x59ef0a(0x17a));const _0x37495d=await _0x1809b1['readFile'](_0x58de95),_0x3ab080=a130_0x4bbda6(_0x37495d),_0x5a08dd=_0x3ab080[_0x59ef0a(0x165)];if(!_0x5a08dd)throw new Error(_0x59ef0a(0x189)+_0x25ec1b);const _0x4b828f=_0x3ab080['type']===_0x59ef0a(0x176)?'journey':_0x59ef0a(0x15c),_0xa3739b=a130_0x198607[_0x59ef0a(0x186)](_0x41bcf0,_0x58de95),_0x4ac4de=a130_0x198607[_0x59ef0a(0x184)](_0xa3739b),_0x37dade=_0x4ac4de==='.'?'':_0x4ac4de[_0x59ef0a(0x163)](/\\/g,'/'),_0xb74730=_0x37dade?_0x2115cc+'/'+_0x37dade+'/'+_0x5a08dd:_0x2115cc+'/'+_0x5a08dd;return{'parentSegment':_0x2115cc,'segmentName':_0x5a08dd,'folderPath':_0x37dade,'fullPath':_0xb74730,'resourceType':_0x4b828f,'content':_0x37495d};}
1
+ (function(_0x176a9d,_0x2ee957){const _0x52bba8=a130_0xec11,_0x108198=_0x176a9d();while(!![]){try{const _0x1fe236=parseInt(_0x52bba8(0x158))/0x1+parseInt(_0x52bba8(0x142))/0x2*(-parseInt(_0x52bba8(0x13e))/0x3)+parseInt(_0x52bba8(0x140))/0x4*(-parseInt(_0x52bba8(0x14b))/0x5)+parseInt(_0x52bba8(0x13f))/0x6+parseInt(_0x52bba8(0x15b))/0x7+-parseInt(_0x52bba8(0x149))/0x8*(-parseInt(_0x52bba8(0x13a))/0x9)+parseInt(_0x52bba8(0x162))/0xa*(parseInt(_0x52bba8(0x13c))/0xb);if(_0x1fe236===_0x2ee957)break;else _0x108198['push'](_0x108198['shift']());}catch(_0x518f45){_0x108198['push'](_0x108198['shift']());}}}(a130_0x5a76,0xe5e79));import a130_0x551531 from'path';function a130_0xec11(_0x1ff90d,_0x23f01a){_0x1ff90d=_0x1ff90d-0x13a;const _0x5a768a=a130_0x5a76();let _0xec1156=_0x5a768a[_0x1ff90d];return _0xec1156;}import{parse as a130_0x4e5c4d}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5cbfdc){const _0x1980f7=a130_0xec11;if(!_0x5cbfdc||_0x5cbfdc[_0x1980f7(0x14e)]()==='')throw new Error(_0x1980f7(0x146));const _0x1e5947=_0x5cbfdc[_0x1980f7(0x14e)]();if(_0x1e5947==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5cbfdc};const _0x4ac3b1=_0x1e5947['startsWith']('/')?_0x1e5947['substring'](0x1):_0x1e5947,_0x36ba5f=_0x4ac3b1[_0x1980f7(0x165)]('/')[_0x1980f7(0x157)](_0x320c5d=>_0x320c5d!=='');if(_0x36ba5f[_0x1980f7(0x13d)]===0x0)throw new Error(_0x1980f7(0x15a));const _0x2c86b8=_0x1e5947[_0x1980f7(0x150)]('/')||!isRelativePathSegment(_0x36ba5f[0x0]);for(const _0x11ca4f of _0x36ba5f){validatePathSegment(_0x11ca4f);}return{'segments':_0x36ba5f,'isAbsolute':_0x2c86b8,'raw':_0x5cbfdc};}function isRelativePathSegment(_0x46f06b){return _0x46f06b==='.'||_0x46f06b==='..';}function validatePathSegment(_0x273857){const _0x5dcde3=a130_0xec11;if(_0x273857==='')throw new Error(_0x5dcde3(0x145));if(_0x273857==='.'||_0x273857==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x273857))throw new Error(_0x5dcde3(0x148)+_0x273857);if(_0x273857!==_0x273857['trim']()){}}export function validatePath(_0x45f1ec){const _0x27fb92=a130_0xec11;if(_0x45f1ec[_0x27fb92(0x161)][_0x27fb92(0x13d)]===0x0&&!_0x45f1ec[_0x27fb92(0x154)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x45f1ec[_0x27fb92(0x154)]){if(_0x45f1ec[_0x27fb92(0x161)][0x0]==='..')throw new Error(_0x27fb92(0x14f));let _0x186a8b=0x0;for(const _0x5aa881 of _0x45f1ec[_0x27fb92(0x161)]){if(_0x5aa881==='..'){if(_0x186a8b===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x186a8b--;}else _0x5aa881!=='.'&&_0x186a8b++;}}}export function joinPaths(_0x5b54ec,_0x1d084c){const _0x1b739b=a130_0xec11;if(!_0x5b54ec||_0x5b54ec==='/')return _0x1d084c;if(!_0x1d084c||_0x1d084c==='.')return _0x5b54ec;if(_0x1d084c[_0x1b739b(0x150)]('/'))return _0x1d084c;const _0x46384f=parsePath(_0x5b54ec),_0x49ae82=parsePath(_0x1d084c),_0x4bfc79=[..._0x46384f[_0x1b739b(0x161)]];for(const _0x131d68 of _0x49ae82[_0x1b739b(0x161)]){if(_0x131d68==='.')continue;else{if(_0x131d68==='..'){if(_0x4bfc79[_0x1b739b(0x13d)]===0x0)throw new Error(_0x1b739b(0x143));_0x4bfc79[_0x1b739b(0x147)]();}else _0x4bfc79[_0x1b739b(0x14a)](_0x131d68);}}const _0x36b76d=_0x4bfc79['join']('/');return _0x46384f['raw'][_0x1b739b(0x150)]('/')?'/'+_0x36b76d:_0x36b76d;}export function normalizePath(_0x3c84f7){const _0x24960e=a130_0xec11,_0x436bf1=parsePath(_0x3c84f7),_0xcde403=[];for(const _0x378b23 of _0x436bf1[_0x24960e(0x161)]){if(_0x378b23==='.')continue;else{if(_0x378b23==='..'){if(_0xcde403[_0x24960e(0x13d)]===0x0){if(_0x436bf1[_0x24960e(0x154)])throw new Error(_0x24960e(0x143));_0xcde403['push']('..');}else _0xcde403[_0xcde403['length']-0x1]==='..'?_0xcde403[_0x24960e(0x14a)]('..'):_0xcde403[_0x24960e(0x147)]();}else _0xcde403[_0x24960e(0x14a)](_0x378b23);}}if(_0xcde403[_0x24960e(0x13d)]===0x0)return _0x436bf1[_0x24960e(0x154)]?'/':'.';const _0x3cf4c3=_0xcde403[_0x24960e(0x164)]('/');return _0x436bf1[_0x24960e(0x15d)][_0x24960e(0x150)]('/')?'/'+_0x3cf4c3:_0x3cf4c3;}export function getParentPath(_0x4e9dfd){const _0x66462c=a130_0xec11,_0x3cecf5=parsePath(_0x4e9dfd);if(_0x3cecf5[_0x66462c(0x161)]['length']<=0x1)return'/';const _0x4af2b5=_0x3cecf5[_0x66462c(0x161)]['slice'](0x0,-0x1)[_0x66462c(0x164)]('/');return _0x3cecf5[_0x66462c(0x15d)][_0x66462c(0x150)]('/')?'/'+_0x4af2b5:_0x4af2b5;}export function getBaseName(_0x55f172){const _0x36c9b3=a130_0xec11,_0x40197f=parsePath(_0x55f172);return _0x40197f[_0x36c9b3(0x161)][_0x40197f['segments'][_0x36c9b3(0x13d)]-0x1]||'';}export function isChildPath(_0x4a9220,_0x3f903c){const _0x579c80=a130_0xec11,_0x39b9c6=parsePath(_0x4a9220),_0x37e694=parsePath(_0x3f903c);if(_0x39b9c6[_0x579c80(0x161)][_0x579c80(0x13d)]<=_0x37e694[_0x579c80(0x161)][_0x579c80(0x13d)])return![];for(let _0x2b1a89=0x0;_0x2b1a89<_0x37e694[_0x579c80(0x161)][_0x579c80(0x13d)];_0x2b1a89++){if(_0x39b9c6[_0x579c80(0x161)][_0x2b1a89]!==_0x37e694['segments'][_0x2b1a89])return![];}return!![];}export function splitPath(_0xf25d09){const _0x5c90e3=a130_0xec11,_0x596790=parsePath(_0xf25d09);if(_0x596790['segments'][_0x5c90e3(0x13d)]===0x0)throw new Error(_0x5c90e3(0x14d));if(_0x596790[_0x5c90e3(0x161)][_0x5c90e3(0x13d)]===0x1)return{'parent':_0x596790[_0x5c90e3(0x161)][0x0]};return{'parent':_0x596790['segments'][0x0],'child':_0x596790[_0x5c90e3(0x161)]['slice'](0x1)[_0x5c90e3(0x164)]('/')};}function a130_0x5a76(){const _0x2dd750=['1686132xdQzci','journey','raw','type','File\x20not\x20found:\x20','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','segments','6116160mmWtwT','segment','join','split','parent_segment','parse','42534hsxFcU','dirname','22OhsmLD','length','235992ikgGMU','8633802zcwSDS','21044xUkIio','readFile','18zcdfms','Cannot\x20navigate\x20above\x20root','relative','Path\x20segment\x20cannot\x20be\x20empty','Path\x20cannot\x20be\x20empty','pop','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','184VkGJXZ','push','1645ViMDGq','exists','Cannot\x20split\x20empty\x20path','trim','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','startsWith','name','endsWith','resolve','isAbsolute','tdx.json','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','filter','368761TsTrOs','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20must\x20contain\x20at\x20least\x20one\x20segment'];a130_0x5a76=function(){return _0x2dd750;};return a130_0x5a76();}export function isYamlFilePath(_0x249051){const _0x25d32d=a130_0xec11;return _0x249051[_0x25d32d(0x152)]('.yml')||_0x249051[_0x25d32d(0x152)]('.yaml');}export async function resolveYamlFilePath(_0x2b8eeb,_0x21fdb1=nodeFileSystem){const _0x586993=a130_0xec11,_0x2ff6c0=a130_0x551531[_0x586993(0x153)](_0x2b8eeb);if(!await _0x21fdb1['exists'](_0x2ff6c0))throw new Error(_0x586993(0x15f)+_0x2b8eeb);let _0x183f8a=a130_0x551531[_0x586993(0x13b)](_0x2ff6c0),_0x4f4a18=null,_0x3f7efc=null;const _0x2ef9de=a130_0x551531[_0x586993(0x167)](_0x183f8a)['root'];while(_0x183f8a!==_0x2ef9de){const _0x3b2552=a130_0x551531[_0x586993(0x164)](_0x183f8a,_0x586993(0x155));if(await _0x21fdb1[_0x586993(0x14c)](_0x3b2552)){_0x4f4a18=_0x3b2552,_0x3f7efc=_0x183f8a;break;}_0x183f8a=a130_0x551531[_0x586993(0x13b)](_0x183f8a);}if(!_0x4f4a18||!_0x3f7efc)throw new Error(_0x586993(0x159)+_0x2b8eeb+'\x0a'+_0x586993(0x160));const _0x5afae5=await _0x21fdb1['readFile'](_0x4f4a18),_0x1186df=JSON[_0x586993(0x167)](_0x5afae5),_0x49b6a5=_0x1186df[_0x586993(0x166)];if(!_0x49b6a5)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x1655ef=await _0x21fdb1[_0x586993(0x141)](_0x2ff6c0),_0x145fab=a130_0x4e5c4d(_0x1655ef),_0x4f790e=_0x145fab[_0x586993(0x151)];if(!_0x4f790e)throw new Error(_0x586993(0x156)+_0x2b8eeb);const _0x3a37f8=_0x145fab[_0x586993(0x15e)]===_0x586993(0x15c)?_0x586993(0x15c):_0x586993(0x163),_0x41225d=a130_0x551531[_0x586993(0x144)](_0x3f7efc,_0x2ff6c0),_0x10ac4a=a130_0x551531[_0x586993(0x13b)](_0x41225d),_0x596c0c=_0x10ac4a==='.'?'':_0x10ac4a['replace'](/\\/g,'/'),_0x2edaa0=_0x596c0c?_0x49b6a5+'/'+_0x596c0c+'/'+_0x4f790e:_0x49b6a5+'/'+_0x4f790e;return{'parentSegment':_0x49b6a5,'segmentName':_0x4f790e,'folderPath':_0x596c0c,'fullPath':_0x2edaa0,'resourceType':_0x3a37f8,'content':_0x1655ef};}
@@ -1 +1 @@
1
- function a131_0x5ba3(_0x3297d0,_0x26a337){_0x3297d0=_0x3297d0-0x120;const _0x360045=a131_0x3600();let _0x5ba323=_0x360045[_0x3297d0];return _0x5ba323;}function a131_0x3600(){const _0x642ba1=['396rHYXHt','1418541wXoMff','51002cidrMz','.\x20Child\x20name\x20cannot\x20be\x20empty','13987800JuhrpB','substring','indexOf','1182kqRTBf','471684eUKoKP','9fAPyeY','Invalid\x20segment\x20reference\x20format:\x20','315GoiLcB','2YUNlzb','53116INeMDi','.\x20Parent\x20name\x20cannot\x20be\x20empty','5613104vmuvmJ','2472177jEUAaC'];a131_0x3600=function(){return _0x642ba1;};return a131_0x3600();}(function(_0x4e966f,_0x4fe808){const _0x4e855b=a131_0x5ba3,_0x5ee02f=_0x4e966f();while(!![]){try{const _0x155707=parseInt(_0x4e855b(0x12d))/0x1*(-parseInt(_0x4e855b(0x127))/0x2)+parseInt(_0x4e855b(0x12b))/0x3+parseInt(_0x4e855b(0x128))/0x4*(-parseInt(_0x4e855b(0x126))/0x5)+parseInt(_0x4e855b(0x122))/0x6*(parseInt(_0x4e855b(0x12e))/0x7)+parseInt(_0x4e855b(0x12a))/0x8+-parseInt(_0x4e855b(0x124))/0x9*(parseInt(_0x4e855b(0x130))/0xa)+-parseInt(_0x4e855b(0x12c))/0xb*(-parseInt(_0x4e855b(0x123))/0xc);if(_0x155707===_0x4fe808)break;else _0x5ee02f['push'](_0x5ee02f['shift']());}catch(_0x496ecf){_0x5ee02f['push'](_0x5ee02f['shift']());}}}(a131_0x3600,0xb0511));export function parseSegmentRef(_0xd54869){const _0x45ac26=a131_0x5ba3,_0x308c2f=_0xd54869[_0x45ac26(0x121)]('/');if(_0x308c2f===-0x1)return{'parentId':_0xd54869};if(_0x308c2f===0x0)throw new Error(_0x45ac26(0x125)+_0xd54869+_0x45ac26(0x129));const _0x553739=_0xd54869['substring'](0x0,_0x308c2f),_0x47ede2=_0xd54869[_0x45ac26(0x120)](_0x308c2f+0x1);if(_0x47ede2==='')throw new Error(_0x45ac26(0x125)+_0xd54869+_0x45ac26(0x12f));return{'parentId':_0x553739,'childId':_0x47ede2};}
1
+ (function(_0x258be1,_0x5e0233){const _0x1395ce=a131_0x5728,_0x16ce51=_0x258be1();while(!![]){try{const _0x317026=-parseInt(_0x1395ce(0x15c))/0x1+-parseInt(_0x1395ce(0x156))/0x2*(parseInt(_0x1395ce(0x155))/0x3)+parseInt(_0x1395ce(0x163))/0x4+-parseInt(_0x1395ce(0x158))/0x5*(parseInt(_0x1395ce(0x164))/0x6)+parseInt(_0x1395ce(0x159))/0x7*(-parseInt(_0x1395ce(0x162))/0x8)+-parseInt(_0x1395ce(0x157))/0x9*(-parseInt(_0x1395ce(0x15e))/0xa)+parseInt(_0x1395ce(0x15a))/0xb;if(_0x317026===_0x5e0233)break;else _0x16ce51['push'](_0x16ce51['shift']());}catch(_0x2528bc){_0x16ce51['push'](_0x16ce51['shift']());}}}(a131_0x59d6,0xa4ee1));function a131_0x59d6(){const _0x382cb2=['substring','Invalid\x20segment\x20reference\x20format:\x20','4136344nmoJwp','3317732lrgJVl','12kpRqRN','3HAotXg','1072340qPIlQD','135JtQtad','1492430rKuqwt','14hbpjNb','23448777sWlAJQ','indexOf','528774WCtRpa','.\x20Child\x20name\x20cannot\x20be\x20empty','273610hntPLy','.\x20Parent\x20name\x20cannot\x20be\x20empty'];a131_0x59d6=function(){return _0x382cb2;};return a131_0x59d6();}function a131_0x5728(_0x916112,_0x396197){_0x916112=_0x916112-0x155;const _0x59d6d6=a131_0x59d6();let _0x572894=_0x59d6d6[_0x916112];return _0x572894;}export function parseSegmentRef(_0x1d4427){const _0x21f125=a131_0x5728,_0x5eddde=_0x1d4427[_0x21f125(0x15b)]('/');if(_0x5eddde===-0x1)return{'parentId':_0x1d4427};if(_0x5eddde===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1d4427+_0x21f125(0x15f));const _0x4cb7d4=_0x1d4427[_0x21f125(0x160)](0x0,_0x5eddde),_0x242cc3=_0x1d4427[_0x21f125(0x160)](_0x5eddde+0x1);if(_0x242cc3==='')throw new Error(_0x21f125(0x161)+_0x1d4427+_0x21f125(0x15d));return{'parentId':_0x4cb7d4,'childId':_0x242cc3};}