@treasuredata/tdx 2026.4.20 → 2026.4.22

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 (247) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.d.ts.map +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-command.js.map +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/delivery-command.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-campaign-pull-command.js +1 -1
  26. package/dist/commands/engage-campaign-push-command.js +1 -1
  27. package/dist/commands/engage-campaign-validate-command.js +1 -1
  28. package/dist/commands/engage-command.d.ts +47 -0
  29. package/dist/commands/engage-command.d.ts.map +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/engage-command.js.map +1 -1
  32. package/dist/commands/engage-template-pull-command.js +1 -1
  33. package/dist/commands/engage-template-push-command.js +1 -1
  34. package/dist/commands/engage-template-validate-command.js +1 -1
  35. package/dist/commands/job-command.js +1 -1
  36. package/dist/commands/journey-command.js +1 -1
  37. package/dist/commands/journey-validate-command.js +1 -1
  38. package/dist/commands/llm-command.js +1 -1
  39. package/dist/commands/mcp-command.js +1 -1
  40. package/dist/commands/parent-segment-command.js +1 -1
  41. package/dist/commands/policy-command.js +1 -1
  42. package/dist/commands/profile-command.js +1 -1
  43. package/dist/commands/profiles-command.js +1 -1
  44. package/dist/commands/query-command.js +1 -1
  45. package/dist/commands/schedule-command.js +1 -1
  46. package/dist/commands/segment-command.js +1 -1
  47. package/dist/commands/segment-create-command.js +1 -1
  48. package/dist/commands/segment-fields-command.js +1 -1
  49. package/dist/commands/segment-pull-command.js +1 -1
  50. package/dist/commands/segment-push-command.js +1 -1
  51. package/dist/commands/segment-update-command.js +1 -1
  52. package/dist/commands/segment-use-command.js +1 -1
  53. package/dist/commands/segment-validate-command.js +1 -1
  54. package/dist/commands/segments.js +1 -1
  55. package/dist/commands/show.js +1 -1
  56. package/dist/commands/status-command.js +1 -1
  57. package/dist/commands/tables.js +1 -1
  58. package/dist/commands/unset-command.js +1 -1
  59. package/dist/commands/upgrade-command.js +1 -1
  60. package/dist/commands/use-command.js +1 -1
  61. package/dist/commands/user-command.js +1 -1
  62. package/dist/commands/work-command.js +1 -1
  63. package/dist/commands/workflow-command.js +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  87. package/dist/proxy/claude-usage-tracker.js +1 -1
  88. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  89. package/dist/proxy/passthrough-server.d.ts +10 -0
  90. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  91. package/dist/proxy/passthrough-server.js +1 -1
  92. package/dist/proxy/passthrough-server.js.map +1 -1
  93. package/dist/proxy/sse-usage-parser.js +1 -1
  94. package/dist/sdk/agent/agent-config.js +1 -1
  95. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/test/evaluator.js +1 -1
  98. package/dist/sdk/agent/test/executor.js +1 -1
  99. package/dist/sdk/agent/test/index.js +1 -1
  100. package/dist/sdk/agent/test/output.js +1 -1
  101. package/dist/sdk/agent/test/parser.js +1 -1
  102. package/dist/sdk/agent/tool-target-registry.js +1 -1
  103. package/dist/sdk/api.js +1 -1
  104. package/dist/sdk/cas/cas-api-client.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  107. package/dist/sdk/cas/index.js +1 -1
  108. package/dist/sdk/cas/pull-workflow.js +1 -1
  109. package/dist/sdk/cas/push-workflow.js +1 -1
  110. package/dist/sdk/client/cdp-api-client.js +1 -1
  111. package/dist/sdk/client/delivery-api-client.js +1 -1
  112. package/dist/sdk/client/endpoints.js +1 -1
  113. package/dist/sdk/client/engage-api-client.d.ts +50 -1
  114. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  115. package/dist/sdk/client/engage-api-client.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js.map +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.js +1 -1
  119. package/dist/sdk/client/oauth-refresh.js +1 -1
  120. package/dist/sdk/client/rate-limiter.js +1 -1
  121. package/dist/sdk/client/td-api-client.js +1 -1
  122. package/dist/sdk/client/trino-api-client.js +1 -1
  123. package/dist/sdk/client/workflow-client.js +1 -1
  124. package/dist/sdk/connection-validator.js +1 -1
  125. package/dist/sdk/connection.js +1 -1
  126. package/dist/sdk/delivery.js +1 -1
  127. package/dist/sdk/engage/campaign-pull.js +1 -1
  128. package/dist/sdk/engage/campaign-push.js +1 -1
  129. package/dist/sdk/engage/campaign-validator.js +1 -1
  130. package/dist/sdk/engage/campaign-yaml.js +1 -1
  131. package/dist/sdk/engage/template-pull.js +1 -1
  132. package/dist/sdk/engage/template-push.js +1 -1
  133. package/dist/sdk/engage/template-validator.js +1 -1
  134. package/dist/sdk/engage/template-yaml.js +1 -1
  135. package/dist/sdk/engage/types/campaign-def.js +1 -1
  136. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  137. package/dist/sdk/engage/types/template-schema.js +1 -1
  138. package/dist/sdk/engage.d.ts +35 -1
  139. package/dist/sdk/engage.d.ts.map +1 -1
  140. package/dist/sdk/engage.js +1 -1
  141. package/dist/sdk/engage.js.map +1 -1
  142. package/dist/sdk/errors.js +1 -1
  143. package/dist/sdk/index.js +1 -1
  144. package/dist/sdk/io/index.js +1 -1
  145. package/dist/sdk/io/node-filesystem.js +1 -1
  146. package/dist/sdk/job.js +1 -1
  147. package/dist/sdk/journey.js +1 -1
  148. package/dist/sdk/llm/chat-cache.js +1 -1
  149. package/dist/sdk/llm/index.js +1 -1
  150. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  151. package/dist/sdk/llm/model-factors.d.ts +33 -9
  152. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  153. package/dist/sdk/llm/model-factors.js +1 -1
  154. package/dist/sdk/llm/model-factors.js.map +1 -1
  155. package/dist/sdk/personalization.js +1 -1
  156. package/dist/sdk/policy.js +1 -1
  157. package/dist/sdk/query/index.js +1 -1
  158. package/dist/sdk/query/sql-parser.js +1 -1
  159. package/dist/sdk/realtime.js +1 -1
  160. package/dist/sdk/schedule.js +1 -1
  161. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  162. package/dist/sdk/segment/fields-display.js +1 -1
  163. package/dist/sdk/segment/file-discovery.js +1 -1
  164. package/dist/sdk/segment/journey-utils.js +1 -1
  165. package/dist/sdk/segment/journey-validator.js +1 -1
  166. package/dist/sdk/segment/journey-yaml.js +1 -1
  167. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  168. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  169. package/dist/sdk/segment/pull-workflow.js +1 -1
  170. package/dist/sdk/segment/push-recovery.js +1 -1
  171. package/dist/sdk/segment/push-workflow.js +1 -1
  172. package/dist/sdk/segment/resolution-context.js +1 -1
  173. package/dist/sdk/segment/segment-path-parser.js +1 -1
  174. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  175. package/dist/sdk/segment/segment-validator.js +1 -1
  176. package/dist/sdk/segment/target-resolution.js +1 -1
  177. package/dist/sdk/segment/tdx-config.js +1 -1
  178. package/dist/sdk/segment/types/activation-schema.js +1 -1
  179. package/dist/sdk/segment/types/journey-def.js +1 -1
  180. package/dist/sdk/segment/types/journey-schema.js +1 -1
  181. package/dist/sdk/segment/types/segment-def.js +1 -1
  182. package/dist/sdk/segment/types/segment-schema.js +1 -1
  183. package/dist/sdk/segment/validate-files.js +1 -1
  184. package/dist/sdk/segment/yaml-validator.js +1 -1
  185. package/dist/sdk/segment.js +1 -1
  186. package/dist/sdk/types/engage.d.ts +53 -0
  187. package/dist/sdk/types/engage.d.ts.map +1 -1
  188. package/dist/sdk/types/index.d.ts +1 -1
  189. package/dist/sdk/types/index.d.ts.map +1 -1
  190. package/dist/sdk/types/index.js +1 -1
  191. package/dist/sdk/types/index.js.map +1 -1
  192. package/dist/sdk/types/progress.js +1 -1
  193. package/dist/sdk/types/workspace.js +1 -1
  194. package/dist/sdk/user.js +1 -1
  195. package/dist/sdk/util/format-detector.js +1 -1
  196. package/dist/sdk/util/formatters.js +1 -1
  197. package/dist/sdk/util/index.js +1 -1
  198. package/dist/sdk/util/paginate.js +1 -1
  199. package/dist/sdk/util/tree-formatter.js +1 -1
  200. package/dist/sdk/workflow/archive-validation.js +1 -1
  201. package/dist/sdk/workflow/clone-workflow.js +1 -1
  202. package/dist/sdk/workflow/index.js +1 -1
  203. package/dist/sdk/workflow/pull-workflow.js +1 -1
  204. package/dist/sdk/workflow/push-workflow.js +1 -1
  205. package/dist/sdk/workflow/task-graph.js +1 -1
  206. package/dist/sdk/workflow/tdx-config.js +1 -1
  207. package/dist/sdk/workflow/workflow-utils.js +1 -1
  208. package/dist/sdk/workspace/access-tracker.js +1 -1
  209. package/dist/sdk/workspace/frontmatter.js +1 -1
  210. package/dist/sdk/workspace/git.js +1 -1
  211. package/dist/sdk/workspace/index.js +1 -1
  212. package/dist/sdk/workspace/templates.js +1 -1
  213. package/dist/sdk/workspace/weekly.js +1 -1
  214. package/dist/sdk/workspace/wikilinks.js +1 -1
  215. package/dist/test-utils/command-runner.js +1 -1
  216. package/dist/test-utils/factories.js +1 -1
  217. package/dist/test-utils/fixtures.js +1 -1
  218. package/dist/test-utils/http-mock.js +1 -1
  219. package/dist/test-utils/index.js +1 -1
  220. package/dist/utils/async.js +1 -1
  221. package/dist/utils/colors.js +1 -1
  222. package/dist/utils/diff.js +1 -1
  223. package/dist/utils/file-permissions.js +1 -1
  224. package/dist/utils/file-reader.js +1 -1
  225. package/dist/utils/github-releases.js +1 -1
  226. package/dist/utils/global-cache.js +1 -1
  227. package/dist/utils/json-loader.js +1 -1
  228. package/dist/utils/local-cache.js +1 -1
  229. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  230. package/dist/utils/logger/formatters/index.js +1 -1
  231. package/dist/utils/logger/handlers/console-handler.js +1 -1
  232. package/dist/utils/logger/handlers/file-handler.js +1 -1
  233. package/dist/utils/logger/handlers/index.js +1 -1
  234. package/dist/utils/logger/handlers/null-handler.js +1 -1
  235. package/dist/utils/logger/index.js +1 -1
  236. package/dist/utils/logger/logger.js +1 -1
  237. package/dist/utils/logger/types.js +1 -1
  238. package/dist/utils/option-validation.js +1 -1
  239. package/dist/utils/process.js +1 -1
  240. package/dist/utils/prompt.js +1 -1
  241. package/dist/utils/spinner.js +1 -1
  242. package/dist/utils/sse-parser.js +1 -1
  243. package/dist/utils/string-utils.js +1 -1
  244. package/dist/utils/table-ref-parser.js +1 -1
  245. package/dist/utils/tdx-logger.js +1 -1
  246. package/dist/utils/version-check.js +1 -1
  247. package/package.json +1 -1
@@ -1 +1 @@
1
- const a152_0x525dc2=a152_0x4bae;(function(_0x563ae7,_0x57a99a){const _0x1219f1=a152_0x4bae,_0x3f8ffc=_0x563ae7();while(!![]){try{const _0x2510f7=-parseInt(_0x1219f1(0x282))/0x1+parseInt(_0x1219f1(0x1c6))/0x2+-parseInt(_0x1219f1(0x23b))/0x3*(-parseInt(_0x1219f1(0x24f))/0x4)+parseInt(_0x1219f1(0x23d))/0x5*(-parseInt(_0x1219f1(0x1cb))/0x6)+parseInt(_0x1219f1(0x2a3))/0x7+-parseInt(_0x1219f1(0x25f))/0x8+parseInt(_0x1219f1(0x2a0))/0x9;if(_0x2510f7===_0x57a99a)break;else _0x3f8ffc['push'](_0x3f8ffc['shift']());}catch(_0xacf3c){_0x3f8ffc['push'](_0x3f8ffc['shift']());}}}(a152_0x2599,0x27631));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x525dc2(0x1f1));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a152_0x525dc2(0x2a1);export function createPendingSegmentId(_0x531fde){return''+PENDING_SEGMENT_PREFIX+_0x531fde+'__';}export function isPendingSegmentId(_0x2336c8){const _0x1807b1=a152_0x525dc2;return _0x2336c8[_0x1807b1(0x242)](PENDING_SEGMENT_PREFIX)&&!_0x2336c8[_0x1807b1(0x242)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x3786c2){const _0x49c1e3=a152_0x525dc2;return _0x3786c2[_0x49c1e3(0x1ed)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1040a8){return''+PENDING_ACTIVATION_PREFIX+_0x1040a8+'__';}export function isPendingActivationId(_0x3d911e){const _0x2c6277=a152_0x525dc2;return _0x3d911e[_0x2c6277(0x242)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x48d0e){const _0x382b97=a152_0x525dc2;return _0x48d0e[_0x382b97(0x1ed)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3db450,_0x1637b9){const _0x5677ba=a152_0x525dc2,_0x91bcca=_0x3db450+'::'+(_0x1637b9[_0x5677ba(0x20e)]()||_0x5677ba(0x283)),_0x11de40=createHash(_0x5677ba(0x230))[_0x5677ba(0x1d9)](_0x91bcca)[_0x5677ba(0x26d)](_0x5677ba(0x24b))['slice'](0x0,0xc);return'journey_entry_criteria_'+_0x11de40;}export function ensureJourneyDefaults(_0x5ab821){const _0x4f9fcc=a152_0x525dc2;!_0x5ab821[_0x4f9fcc(0x206)]&&(_0x5ab821['description']=''),!_0x5ab821['state']&&(_0x5ab821['state']='draft');}export function injectExistingStageIds(_0x280ce2,_0x4717a5){const _0x1fedc6=a152_0x525dc2,_0x45fe3e=new Map(_0x4717a5[_0x1fedc6(0x237)](_0x4d454a=>[_0x4d454a[_0x1fedc6(0x1f7)],_0x4d454a['id']]));for(const _0x231e11 of _0x280ce2){if(!_0x231e11['id']){const _0x358212=_0x45fe3e[_0x1fedc6(0x21c)](_0x231e11[_0x1fedc6(0x1f7)]);_0x358212&&(_0x231e11['id']=_0x358212);}}}export function resolveTDFolderPath(_0x2adff6,_0x517583,_0x4e8ee8){const _0x3fed2a=a152_0x525dc2;if(!_0x517583)return _0x2adff6;if(_0x2adff6===_0x4e8ee8||_0x2adff6[_0x3fed2a(0x242)](_0x4e8ee8+'/'))return _0x2adff6;return _0x2adff6?_0x4e8ee8+'/'+_0x2adff6:_0x4e8ee8;}export function addFoldersToCreate(_0x4b3b9d,_0x3bf556,_0x53263d){const _0x155b14=a152_0x525dc2;if(!_0x4b3b9d)return;if(_0x3bf556[_0x155b14(0x23a)](_0x4b3b9d))return;const _0x8d6eb6=_0x4b3b9d[_0x155b14(0x269)]('/');let _0x5e9ac1='';for(const _0x12f48e of _0x8d6eb6){_0x5e9ac1=_0x5e9ac1?_0x5e9ac1+'/'+_0x12f48e:_0x12f48e,!_0x3bf556[_0x155b14(0x23a)](_0x5e9ac1)&&_0x53263d[_0x155b14(0x1f6)](_0x5e9ac1);}}export function sortFoldersByDepth(_0x4e9091){const _0x3b2794=a152_0x525dc2;return[..._0x4e9091][_0x3b2794(0x1b6)]((_0x5df8e9,_0x19df1c)=>{const _0x1afe19=_0x3b2794,_0x38e3c4=(_0x5df8e9[_0x1afe19(0x1ab)](/\//g)||[])['length'],_0x14396d=(_0x19df1c[_0x1afe19(0x1ab)](/\//g)||[])[_0x1afe19(0x1b9)];return _0x38e3c4-_0x14396d;});}import*as a152_0x103244 from'yaml';import{readFileSync}from'fs';import a152_0x493fd4 from'path';import{isJourneyDef,parseYamlString as a152_0x412f63,toYamlString as a152_0x111a4b,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(_0x32a1c6){const _0xb32d1d=a152_0x525dc2;if(Array['isArray'](_0x32a1c6))return'['+_0x32a1c6[_0xb32d1d(0x237)](_0x6c334c=>stableStringify(_0x6c334c))['join'](',')+']';if(_0x32a1c6&&typeof _0x32a1c6===_0xb32d1d(0x215)){const _0x12cc8e=_0x32a1c6,_0x5cc2d4=Object[_0xb32d1d(0x255)](_0x12cc8e)[_0xb32d1d(0x1b6)](),_0x25de25=_0x5cc2d4[_0xb32d1d(0x237)](_0x269a46=>'\x22'+_0x269a46+'\x22:'+stableStringify(_0x12cc8e[_0x269a46]));return'{'+_0x25de25[_0xb32d1d(0x1ef)](',')+'}';}const _0x3edb46=JSON['stringify'](_0x32a1c6);return _0x3edb46===undefined?_0xb32d1d(0x28a):_0x3edb46;}function activationSignature(_0x8025b3){const _0x4a84fe=a152_0x525dc2,_0x8919fa={'connection':_0x8025b3['connection'],..._0x8025b3[_0x4a84fe(0x26c)]!==undefined&&{'all_columns':_0x8025b3['all_columns']},..._0x8025b3[_0x4a84fe(0x1e0)]!==undefined&&{'columns':_0x8025b3[_0x4a84fe(0x1e0)]},..._0x8025b3[_0x4a84fe(0x1e8)]!==undefined&&{'behavior':_0x8025b3[_0x4a84fe(0x1e8)]},..._0x8025b3[_0x4a84fe(0x217)]!==undefined&&{'schedule':_0x8025b3[_0x4a84fe(0x217)]},..._0x8025b3[_0x4a84fe(0x1e7)]!==undefined&&{'notification':_0x8025b3[_0x4a84fe(0x1e7)]},..._0x8025b3[_0x4a84fe(0x20f)]!==undefined&&{'connector_config':_0x8025b3[_0x4a84fe(0x20f)]},..._0x8025b3['activation_template_id']!==undefined&&{'activation_template_id':_0x8025b3[_0x4a84fe(0x29e)]}};return stableStringify(_0x8919fa);}async function fetchSegment(_0x2af725,_0x2d0f16,_0x28d3d8,_0x2ed589){const _0x520e9f=a152_0x525dc2,_0x500661=_0x2ed589?.[_0x520e9f(0x1c8)](_0x20e4da=>_0x20e4da['id']===_0x28d3d8);if(_0x500661)return _0x500661;try{return await _0x2af725[_0x520e9f(0x283)][_0x520e9f(0x28f)](_0x2d0f16,_0x28d3d8);}catch(_0x4c1692){logger[_0x520e9f(0x1af)](_0x520e9f(0x270)+_0x28d3d8+_0x520e9f(0x1f5)+_0x4c1692);try{return await _0x2af725[_0x520e9f(0x283)][_0x520e9f(0x1de)](_0x28d3d8);}catch(_0x27d707){return logger[_0x520e9f(0x1af)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x28d3d8+':\x20'+_0x27d707),null;}}}function recoverSegmentIdsFromPushRecovery(_0xbe5d87,_0x41ee05,_0x542be1){const _0x543a49=a152_0x525dc2,_0x181d63=readPushRecovery(_0xbe5d87[_0x543a49(0x224)]);if(_0x181d63?.['journeyName']===_0xbe5d87[_0x543a49(0x220)][_0x543a49(0x1f7)])for(const [_0xc66e49,_0x5365d1]of Object['entries'](_0x181d63[_0x543a49(0x286)])){const _0x18a8e3=generateDeterministicJourneySegmentName(_0xbe5d87['yamlConfig'][_0x543a49(0x1f7)],_0xc66e49);_0x5365d1[_0x543a49(0x1fe)]===_0x18a8e3&&(_0x41ee05[_0x543a49(0x1b0)](_0xc66e49,_0x5365d1[_0x543a49(0x23c)]),_0x542be1[_0x543a49(0x1b0)](_0xc66e49,_0x5365d1[_0x543a49(0x23c)]));}}async function createOrRecoverEmbeddedSegment(_0x25680d,_0x16e36e,_0xdf3e81,_0x23f86a){const _0x513caf=a152_0x525dc2;let _0x4e6a10;try{_0x4e6a10=await _0x25680d['segment'][_0x513caf(0x259)]({'name':_0xdf3e81[_0x513caf(0x233)],'description':_0xdf3e81['description'],'journeyId':_0xdf3e81[_0x513caf(0x27c)],'rule':_0x23f86a(_0xdf3e81[_0x513caf(0x280)],!![]),'countPopulation':!![],'parentFolderId':_0xdf3e81[_0x513caf(0x1e6)],'audienceId':_0xdf3e81[_0x513caf(0x265)]});}catch(_0x39bdaa){const _0x185e74=_0x39bdaa instanceof Error&&_0x39bdaa[_0x513caf(0x1dc)]['includes'](_0x513caf(0x240));if(_0x185e74){const _0x66d761=readPushRecovery(_0x16e36e['absolutePath']),_0x433115=_0x66d761?.[_0x513caf(0x297)]===_0x16e36e[_0x513caf(0x220)][_0x513caf(0x1f7)]?_0x66d761['segments'][_0xdf3e81[_0x513caf(0x24c)]]:undefined;if(_0x433115?.['uniqueServerName']===_0xdf3e81[_0x513caf(0x233)])await _0x25680d['segment'][_0x513caf(0x294)](_0xdf3e81[_0x513caf(0x265)],_0x433115[_0x513caf(0x23c)],{'description':_0xdf3e81[_0x513caf(0x206)],'rule':_0x23f86a(_0xdf3e81[_0x513caf(0x280)],!![]),'countPopulation':!![]}),_0x4e6a10=_0x433115[_0x513caf(0x23c)];else throw new SDKError(ErrorCode[_0x513caf(0x281)],_0x513caf(0x1df)+_0xdf3e81[_0x513caf(0x24c)]+_0x513caf(0x292)+(_0x513caf(0x293)+_0x16e36e[_0x513caf(0x224)][_0x513caf(0x1ed)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x513caf(0x21a),_0x39bdaa);}else throw _0x39bdaa;}return saveSegmentToPushRecovery(_0x16e36e[_0x513caf(0x224)],_0x16e36e[_0x513caf(0x220)][_0x513caf(0x1f7)],_0xdf3e81[_0x513caf(0x24c)],{'segmentId':_0x4e6a10,'uniqueServerName':_0xdf3e81[_0x513caf(0x233)],'createdAt':new Date()[_0x513caf(0x1dd)]()}),_0x4e6a10;}export async function prepareSegmentFiles(_0x53c2a6,_0x35aff8,_0x25e092,_0x1bd19d,_0x5c36d4){const _0x4b7adb=a152_0x525dc2,{activationDefToCreateRequest:_0x46f14e}=await import(_0x4b7adb(0x1bc)),_0x15b430=[],_0x2dd2a8=new Set();for(const {yamlConfig:_0x5c05e4,folderPath:_0x322695,sourcePath:_0x3a50be}of _0x53c2a6){const _0x4f0fae=resolveTDFolderPath(_0x322695,_0x1bd19d,_0x5c36d4),_0x1e5c5a=_0x4f0fae+':'+_0x5c05e4[_0x4b7adb(0x1f7)],_0x7b5033=_0x35aff8[_0x4b7adb(0x1c9)][_0x4b7adb(0x21c)](_0x1e5c5a),_0x586e3=_0x7b5033?_0x35aff8[_0x4b7adb(0x1c5)][_0x4b7adb(0x21c)](_0x7b5033['id'])||[]:[];addFoldersToCreate(_0x4f0fae,_0x35aff8[_0x4b7adb(0x222)],_0x2dd2a8);const _0x3d82be=calculateActivationActions(_0x5c05e4['activations']||[],_0x586e3,_0x35aff8[_0x4b7adb(0x200)],_0x35aff8[_0x4b7adb(0x2a7)]);for(const _0x2b1cbe of _0x3d82be){(_0x2b1cbe['type']===_0x4b7adb(0x249)||_0x2b1cbe[_0x4b7adb(0x2a5)]===_0x4b7adb(0x1d9))&&_0x2b1cbe['yamlActivation']&&(_0x2b1cbe[_0x4b7adb(0x1f2)]=await _0x46f14e(_0x2b1cbe[_0x4b7adb(0x203)],_0x25e092));}const _0xe11d26=calculateSegmentDiff(_0x5c05e4,_0x7b5033,_0x586e3,_0x35aff8['idToEmailMap'],_0x35aff8[_0x4b7adb(0x2a7)]);_0x15b430[_0x4b7adb(0x1be)]({'relativePath':_0x5c05e4[_0x4b7adb(0x1f7)],'absolutePath':_0x3a50be,'yamlConfig':_0x5c05e4,'folderPath':_0x4f0fae,'existingSegment':_0x7b5033,'existingActivations':_0x586e3,'isNew':_0xe11d26['isNew'],'hasChanges':_0xe11d26['hasChanges'],'diff':_0xe11d26[_0x4b7adb(0x23e)],'activationActions':_0x3d82be});}return{'segmentFiles':_0x15b430,'foldersToCreate':_0x2dd2a8};}export async function prepareJourneyFiles(_0x304583,_0xae5da1,_0xb369d0,_0x5e437b){const _0x1bb547=a152_0x525dc2,_0x2f86b1=[],_0x320d35=new Set();for(const {yamlConfig:_0x5bb8c9,folderPath:_0x554f70,sourcePath:_0x4ff51b}of _0x304583){const _0x31495a=resolveTDFolderPath(_0x554f70,_0xb369d0,_0x5e437b),_0x26b2cd=_0x31495a+':'+_0x5bb8c9['name'],_0x431f0e=_0xae5da1[_0x1bb547(0x25b)][_0x1bb547(0x21c)](_0x26b2cd);let _0x5de921,_0x40e5fc;if(_0x431f0e&&_0x431f0e[_0x1bb547(0x1b9)]>0x0){const _0x363bc3=buildLocalExpandedRuleMappings(_0x5bb8c9),{createYamlContext:_0xc5fc23,prefetchJourneySegments:_0x218f52}=createPushYamlContextForBundle(_0xae5da1[_0x1bb547(0x20a)],_0xae5da1[_0x1bb547(0x265)],_0xae5da1[_0x1bb547(0x1b1)],_0x363bc3,_0xae5da1[_0x1bb547(0x200)],_0xae5da1[_0x1bb547(0x2a7)],_0xae5da1[_0x1bb547(0x1d3)],_0xae5da1['journeyById']);await _0x218f52(_0x431f0e[_0x1bb547(0x237)](_0x192cdd=>_0x192cdd['id']));const _0x57dd41=await _0xae5da1['deps'][_0x1bb547(0x262)][_0x1bb547(0x275)](_0x431f0e[0x0][_0x1bb547(0x24e)]),_0x5d63e8=hasMultipleVersions(_0x5bb8c9),_0x286eab=async _0x2c460b=>{const _0x292fd3=_0x1bb547,_0x1a63e4=_0xae5da1[_0x292fd3(0x264)]?.[_0x292fd3(0x21c)](_0x2c460b);if(_0x1a63e4)return _0x1a63e4;return _0xae5da1['fetchJourney']({'journeyId':_0x2c460b,'journeyName':_0x5bb8c9['name'],'isMultiVersion':_0x431f0e[_0x292fd3(0x1b9)]>0x1});};if(_0x5d63e8&&_0x431f0e[_0x1bb547(0x1b9)]>0x1){const _0xbcdbb2=[];for(const _0x2b6a12 of _0x431f0e){const _0x4a47a8=_0x2b6a12['versionNumber']||0x1;_0xae5da1[_0x1bb547(0x1ec)]?.['update']('Fetching\x20'+_0x5bb8c9[_0x1bb547(0x1f7)]+'\x20v'+_0x4a47a8);const _0x30b239=await _0x286eab(_0x2b6a12['id']),_0x3d7283=_0xc5fc23(_0x2b6a12['id']),_0x4f618d=await journeyResponseToDef(_0x30b239,_0x3d7283);_0xbcdbb2[_0x1bb547(0x1be)]({'item':_0x2b6a12,'yaml':_0x4f618d});}const _0x3accd5=buildLocalRuleToNameMappingFromJourney(_0x5bb8c9);_0x40e5fc=buildMergedJourneyDef(_0xbcdbb2,_0x3accd5,_0x57dd41);const _0x42e46c=Math[_0x1bb547(0x295)](..._0xbcdbb2[_0x1bb547(0x237)](_0xfad7e3=>_0xfad7e3[_0x1bb547(0x299)][_0x1bb547(0x1f4)]||0x0)),_0x25007d=_0x431f0e['find'](_0xfcdfb3=>(_0xfcdfb3['versionNumber']||0x0)===_0x42e46c);_0x25007d&&(_0xae5da1[_0x1bb547(0x1ec)]?.[_0x1bb547(0x1d9)]('Fetching\x20'+_0x5bb8c9[_0x1bb547(0x1f7)]+'\x20v'+_0x42e46c),_0x5de921=await _0x286eab(_0x25007d['id']));}else{const _0x2af32a=_0x431f0e[_0x431f0e[_0x1bb547(0x1b9)]-0x1];_0xae5da1[_0x1bb547(0x1ec)]?.['update']('Fetching\x20'+_0x5bb8c9[_0x1bb547(0x1f7)]),_0x5de921=await _0x286eab(_0x2af32a['id']);const _0x219d90=_0xc5fc23(_0x2af32a['id']),_0xe1acfd=await journeyResponseToDef(_0x5de921,_0x219d90),_0x2b517f=buildLocalRuleToNameMappingFromJourney(_0x5bb8c9);_0x40e5fc=buildMergedJourneyDef([{'item':_0x2af32a,'yaml':_0xe1acfd}],_0x2b517f,_0x57dd41);}}addFoldersToCreate(_0x31495a,_0xae5da1[_0x1bb547(0x222)],_0x320d35);const _0xa173c3=calculateJourneyDiff(_0x5bb8c9,_0x40e5fc);_0x2f86b1[_0x1bb547(0x1be)]({'relativePath':_0x5bb8c9['name'],'absolutePath':_0x4ff51b,'yamlConfig':_0x5bb8c9,'folderPath':_0x31495a,'existingJourney':_0x5de921,'isNew':_0xa173c3[_0x1bb547(0x254)],'hasChanges':_0xa173c3[_0x1bb547(0x20c)],'diff':_0xa173c3[_0x1bb547(0x23e)]});}return{'journeyFiles':_0x2f86b1,'foldersToCreate':_0x320d35};}export function calculateActivationActions(_0xfa3236,_0x3dbd08,_0x5c8b2b,_0x580e38){const _0x2888a7=a152_0x525dc2,_0x270e5e=[],_0x19777d=new Map();for(const _0x285b67 of _0x3dbd08){_0x19777d[_0x2888a7(0x1b0)](_0x285b67[_0x2888a7(0x1f7)],_0x285b67);}const _0x1bc790=new Map();for(const _0x337487 of _0xfa3236){_0x1bc790[_0x2888a7(0x1b0)](_0x337487[_0x2888a7(0x1f7)],_0x337487);}for(const _0x2ce51a of _0xfa3236){const _0x14a486=_0x19777d[_0x2888a7(0x21c)](_0x2ce51a['name']);if(!_0x14a486)_0x270e5e[_0x2888a7(0x1be)]({'type':_0x2888a7(0x249),'name':_0x2ce51a[_0x2888a7(0x1f7)],'yamlActivation':_0x2ce51a});else{const _0x1f8472=activationResponseToDef(_0x14a486,_0x5c8b2b,_0x580e38),_0x11ee18=a152_0x103244[_0x2888a7(0x1ce)](_0x1f8472),_0x48c359=a152_0x103244['stringify'](_0x2ce51a);_0x11ee18!==_0x48c359&&_0x270e5e[_0x2888a7(0x1be)]({'type':'update','name':_0x2ce51a[_0x2888a7(0x1f7)],'yamlActivation':_0x2ce51a,'existingActivation':_0x14a486});}}for(const _0x44cb42 of _0x3dbd08){!_0x1bc790[_0x2888a7(0x23a)](_0x44cb42[_0x2888a7(0x1f7)])&&_0x270e5e['push']({'type':_0x2888a7(0x288),'name':_0x44cb42[_0x2888a7(0x1f7)],'existingActivation':_0x44cb42});}return _0x270e5e;}function calculateYamlDiff(_0x2617c4,_0x38cc18){if(_0x38cc18){const _0x274d86=generateDiff(_0x38cc18,_0x2617c4),_0x2d07bd=hasChanges(_0x274d86);return{'isNew':![],'hasChanges':_0x2d07bd,'diff':_0x2d07bd?formatDiffWithColors(_0x274d86):undefined};}const _0x5e45ab=generateDiff('',_0x2617c4);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5e45ab)};}export function calculateSegmentDiff(_0x350089,_0x16114e,_0x45f0c7,_0x51db32,_0x2209d0){const _0x25e71d=segmentToYamlString(_0x350089),_0x1a5b1a=_0x16114e?segmentToYamlString(segmentWithActivationsToYaml(_0x16114e,_0x45f0c7,undefined,_0x51db32,_0x2209d0)):undefined;return calculateYamlDiff(_0x25e71d,_0x1a5b1a);}export function calculateJourneyDiff(_0x1442b7,_0x10f323){const _0x77b82e=normalizeJourneyDef(_0x1442b7,_0x1442b7),_0x210205=a152_0x111a4b(_0x77b82e),_0x1d8771=_0x10f323?a152_0x111a4b(normalizeJourneyDef(_0x10f323,_0x1442b7)):undefined;return calculateYamlDiff(_0x210205,_0x1d8771);}export function findSegmentsToDelete(_0x396e4d,_0x3a010f,_0x286b15,_0x5de637,_0x20238e){const _0x24f9a3=a152_0x525dc2,_0x100ac8=new Set();for(const {yamlConfig:_0x7ba628,folderPath:_0x584764}of _0x3a010f){_0x100ac8['add'](_0x584764+':'+_0x7ba628[_0x24f9a3(0x1f7)]);}return _0x396e4d['filter'](_0x2b1df0=>{const _0x292554=_0x24f9a3,_0x5a54c8=_0x2b1df0[_0x292554(0x1b2)]?_0x286b15[_0x292554(0x21c)](_0x2b1df0[_0x292554(0x1b2)][_0x292554(0x209)]())||'':'',_0x3388e2=_0x5a54c8+':'+_0x2b1df0[_0x292554(0x1f7)];if(_0x100ac8['has'](_0x3388e2))return![];if(_0x20238e)return _0x5a54c8===_0x5de637||_0x5a54c8[_0x292554(0x242)](_0x5de637+'/');return!![];});}export function findJourneysToDelete(_0x9301df,_0x426935,_0x12a30d,_0x1efb9e,_0x43e1cb){const _0x2774bd=a152_0x525dc2,_0x395f2a=new Set();for(const {yamlConfig:_0x4da0f3,folderPath:_0x1636a0}of _0x426935){_0x395f2a[_0x2774bd(0x1f6)](_0x1636a0+':'+_0x4da0f3[_0x2774bd(0x1f7)]);}return _0x9301df['filter'](_0x1c94f6=>{const _0x200bae=_0x2774bd,_0x11d840=_0x1c94f6['folderId']?_0x12a30d[_0x200bae(0x21c)](_0x1c94f6['folderId'])||'':'',_0x2272f0=_0x11d840+':'+_0x1c94f6[_0x200bae(0x279)];if(_0x395f2a[_0x200bae(0x23a)](_0x2272f0))return![];if(_0x43e1cb)return _0x11d840===_0x1efb9e||_0x11d840[_0x200bae(0x242)](_0x1efb9e+'/');return!![];});}function a152_0x2599(){const _0x498c12=['segmentByFolderAndName','Condition','30uqHlVk','journey_created','nameToId','stringify','resolveSegment','created','attributes','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','activationStepsById','activation_updated','Creating\x20segment\x20\x27','segment_deleted','activationContext','Segment\x20not\x20found:\x20','update','index','Created\x20activation\x20\x27','message','toISOString','getSegmentEntity','Embedded\x20segment\x20\x27','columns','updated','Creating\x20folder\x20\x27','connection','Created\x20journey\x20\x27','decision_point','folderId','notification','behavior','segment_creating','Failed\x20to\x20resolve\x20activation\x20','createActivation','progress','replace','branches','join','Journey\x20\x27','tdx.sdk.push-workflow','validatedRequest','relative','versionNumber',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','add','name','Failed\x20to\x20fetch\x20referenced\x20segment\x20','segment_updating','waitStep','\x27\x20exit\x20criteria','errors','\x20error(s)','uniqueServerName','withProgress','idToEmailMap','reduce','embedded_activation_created','yamlActivation','updateActivation','parseDocument','description','Duration','\x20activation\x20\x27','toString','deps','createdSegmentId','hasChanges','utf-8','trim','connector_config','JOURNEY_SYNTAX_ERROR','embeddedSegmentNameToId','conditionSegmentId','journeyActivationStepId','results','object','kind','schedule','existingActivation','\x27...','and\x20the\x20server\x20segment,\x20then\x20retry.','journey_updated','get','steps','Updating\x20activation\x20\x27','\x27\x20wait\x20condition','yamlConfig','dirname','folderPathToId','\x27\x20for\x20','absolutePath','\x27\x20from\x20file:\x20','list','conditions','action','Entry\x20criteria:\x20','folder','Updating\x20segment\x20\x27','exitCriterias','journey_creating','size','logDeleted','sha1','stage\x20\x27','from','uniqueSegmentName','Creating\x20activation\x20\x27','waitStepType','\x20journey\x20from\x20file:\x20','map','deleted','buildUserMaps','has','231jgukSa','segmentId','274465RxtFtb','diff','journeys','Name\x20has\x20already\x20been\x20taken','createSegment','startsWith','SEGMENT_NOT_FOUND','listActivations','logSuccess','Matched\x20server\x20segment\x20\x27','../../utils/async.js','existingSegment','create','goal','hex','localName','folder_creating','journeyBundleId','11972AxyAul','Activation','Failed\x20to\x20','run_after_journey_refresh','Deleted\x20activation\x20\x27','isNew','keys','getJourney','\x27\x20by\x20rule\x20content','Segment\x20not\x20found','createJourneySegment','DecisionPoint','journeyBundlesByFolderAndName','valid','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','data','974696fFPSWZ','embedded_segment_created','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','journey','):\x20','journeyById','parentId','\x0a\x20\x20','Stage\x20\x27','slice','split','WaitStep','activation_created','all_columns','digest','goal\x20criteria','journeyStages','getSegment\x20failed\x20for\x20','activations','some','activation_deleted','activation_creating','getLatestJourneyId','day','Updated\x20journey\x20\x27','\x20(referenced\x20in\x20journey\x20','journeyBundleName','verbose','SEGMENT_SYNTAX_ERROR','journeyId','ACTIVATION_UPDATE_ERROR','journey_updating','activation_updating','resolvedRule','SEGMENT_UPDATE_ERROR','108517KSjmIc','segment','milestone','logInfo','segments','parse','delete','entry_criteria','null','journeyActivationNameToId','existingJourney','createFolder','with','getSegment','rule','Created\x20segment\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Delete\x20the\x20push\x20recovery\x20file\x20(','updateSegmentById','max','filter','journeyName','values','item','Updated\x20activation\x20\x27','waitStepUnit','conditionTimeoutDuration','effectiveFolderId','activation_template_id','stages','3085209CPqjUF','__pending_act_','parentFolder','605962SfnSYH','embedded_segment_creating','type','all','connectionIdToNameMap','segment_deleting','Deleted\x20segment\x20\x27','relationships','match','deleteSegment','folder_created','onProgress','debug','set','existingSegments','segmentFolderId','activationActions','NOT_FOUND','logWarning','sort','INTERNAL','folderPath','length','rootFolderId','createdSegmentIds','./child-segment-yaml.js','segment_created','push','conditionTimeoutUnit','entryCriteria','segmentNameToId','./journey-yaml.js','toLowerCase','nameToType','activationsBySegmentId','12640QhzXSi','resolveJourneyId','find'];a152_0x2599=function(){return _0x498c12;};return a152_0x2599();}export function buildSegmentLookupMap(_0x1134df,_0x114b2f){const _0x3e3d29=a152_0x525dc2,_0x188ed8=new Map();for(const _0x1bb590 of _0x1134df){const _0x5e6ca6=_0x1bb590[_0x3e3d29(0x1b2)]?_0x114b2f['get'](_0x1bb590['segmentFolderId'][_0x3e3d29(0x209)]())||'':'',_0x1d7e95=_0x5e6ca6+':'+_0x1bb590[_0x3e3d29(0x1f7)];_0x188ed8[_0x3e3d29(0x1b0)](_0x1d7e95,_0x1bb590);}return _0x188ed8;}export function buildSegmentNameToIdMap(_0x1942e6){const _0x5a8255=a152_0x525dc2,_0x123422=new Map();for(const _0x134d71 of _0x1942e6){_0x123422[_0x5a8255(0x1b0)](_0x134d71[_0x5a8255(0x1f7)],_0x134d71['id']);}return _0x123422;}export function buildJourneyBundleLookupMap(_0x570f83,_0x568de8){const _0x4a96e2=a152_0x525dc2,_0x385da4=new Map();for(const _0xb3ac7d of _0x570f83){const _0x2e16d4=_0xb3ac7d['folderId']?_0x568de8['get'](_0xb3ac7d['folderId'])||'':'',_0x27ad5b=_0x2e16d4+':'+_0xb3ac7d[_0x4a96e2(0x279)];!_0x385da4[_0x4a96e2(0x23a)](_0x27ad5b)&&_0x385da4[_0x4a96e2(0x1b0)](_0x27ad5b,[]),_0x385da4['get'](_0x27ad5b)['push'](_0xb3ac7d);}for(const _0x330565 of _0x385da4[_0x4a96e2(0x298)]()){_0x330565[_0x4a96e2(0x1b6)]((_0x2b8643,_0x40d28c)=>(_0x2b8643[_0x4a96e2(0x1f4)]||0x0)-(_0x40d28c[_0x4a96e2(0x1f4)]||0x0));}return _0x385da4;}export function collectFoldersToCreate(_0x6a42aa,_0x42b7b7){const _0x564bd2=a152_0x525dc2,_0x41caf6=new Set();for(const _0x2b3ba0 of _0x6a42aa){if(!_0x2b3ba0)continue;if(_0x42b7b7[_0x564bd2(0x23a)](_0x2b3ba0))continue;const _0x41df5d=_0x2b3ba0['split']('/');let _0xe8417d='';for(const _0x3fee7a of _0x41df5d){_0xe8417d=_0xe8417d?_0xe8417d+'/'+_0x3fee7a:_0x3fee7a,!_0x42b7b7[_0x564bd2(0x23a)](_0xe8417d)&&_0x41caf6[_0x564bd2(0x1f6)](_0xe8417d);}}return _0x41caf6;}export function parseAndClassifyYamlFiles(_0x5a85e7,_0x31fe85,_0x1db018){const _0x204119=a152_0x525dc2,_0x14a566=[],_0x4b0e35=[];for(const _0x3f1231 of _0x5a85e7){const _0x1ed369=a152_0x493fd4[_0x204119(0x1f3)](_0x31fe85,a152_0x493fd4[_0x204119(0x221)](_0x3f1231)),_0x3f1fc9=_0x1ed369==='.'?'':_0x1ed369[_0x204119(0x1ed)](/\\/g,'/'),_0x990841=readFileSync(_0x3f1231,_0x204119(0x20d)),_0x31592a=a152_0x103244[_0x204119(0x287)](_0x990841);if(isJourneyDef(_0x31592a)){const _0x558ea5=a152_0x412f63(_0x990841);_0x4b0e35['push']({'yamlConfig':_0x558ea5,'folderPath':_0x3f1fc9,'sourcePath':_0x3f1231});}else{if(!_0x1db018?.['skipSegments']){const _0x1f6759=parseSegmentYamlFile(_0x990841),_0x29b47a=normalizeChildSegmentYaml(_0x1f6759);_0x14a566[_0x204119(0x1be)]({'yamlConfig':_0x29b47a,'folderPath':_0x3f1fc9,'sourcePath':_0x3f1231});}}}return{'segments':_0x14a566,'journeys':_0x4b0e35};}export function validateParsedFiles(_0x364611,_0x50698d){const _0xd23c56=a152_0x525dc2,_0x1fbc29=[];for(const {yamlConfig:_0x4fbb74,sourcePath:_0x337cff}of _0x364611[_0xd23c56(0x286)]){const _0x14923c=readFileSync(_0x337cff,_0xd23c56(0x20d)),_0x3861b8=a152_0x103244[_0xd23c56(0x205)](_0x14923c),_0x389b1f=validateSegmentDef(_0x4fbb74,{'source':_0x14923c,'document':_0x3861b8},{'skipSchema':!![]});if(!_0x389b1f[_0xd23c56(0x25c)]){const _0x50101c=a152_0x493fd4[_0xd23c56(0x1f3)](_0x50698d,_0x337cff);_0x1fbc29[_0xd23c56(0x1be)]({'filePath':_0x50101c,'source':_0x14923c,'result':_0x389b1f,'isJourney':![]});}}for(const {yamlConfig:_0x4809d6,sourcePath:_0x30e4d6}of _0x364611[_0xd23c56(0x23f)]){const _0x8f73d=readFileSync(_0x30e4d6,_0xd23c56(0x20d)),_0x51e6fb=a152_0x103244['parseDocument'](_0x8f73d),_0x2c6c12=validateJourneyDef(_0x4809d6,{'source':_0x8f73d,'document':_0x51e6fb},{'skipSchema':!![]});if(!_0x2c6c12[_0xd23c56(0x25c)]){const _0x3d4c49=a152_0x493fd4[_0xd23c56(0x1f3)](_0x50698d,_0x30e4d6);_0x1fbc29[_0xd23c56(0x1be)]({'filePath':_0x3d4c49,'source':_0x8f73d,'result':_0x2c6c12,'isJourney':!![]});}}return _0x1fbc29;}export function formatValidationErrors(_0x2ab48d){const _0x599d9b=a152_0x525dc2,_0x215b7c=[];for(const {filePath:_0x4d86e8,source:_0x31da30,result:_0x113813,isJourney:_0x2c6ddc}of _0x2ab48d){const _0x2f6126=_0x2c6ddc?_0x599d9b(0x262):'segment';_0x215b7c[_0x599d9b(0x1be)]('\x0a'+_0x4d86e8+'\x20('+_0x2f6126+_0x599d9b(0x263)+_0x113813[_0x599d9b(0x1fc)][_0x599d9b(0x1b9)]+_0x599d9b(0x1fd)),_0x215b7c[_0x599d9b(0x1be)](formatValidationResult(_0x113813,_0x31da30,_0x4d86e8));}return _0x215b7c['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x32fa6b){const _0x2bcacd=a152_0x525dc2,_0x471691=new Set(),_0x14c184=new Map(),_0x21062a=collectSegmentUsageCounts(_0x32fa6b);if(_0x32fa6b[_0x2bcacd(0x286)])for(const [_0x5e5e98,_0x5622b6]of Object['entries'](_0x32fa6b[_0x2bcacd(0x286)])){_0x471691['add'](_0x5e5e98);if(_0x5622b6[_0x2bcacd(0x290)]){const _0x124025=yamlRuleToApi(_0x5622b6[_0x2bcacd(0x290)]),_0x1c7289=apiRuleToYaml(_0x124025);_0x14c184[_0x2bcacd(0x1b0)](_0x5e5e98,_0x1c7289);}}const _0x3b6f8f=new Map();let _0x261e58=0x0;for(const [_0x949ce8,_0xd5b15d]of _0x14c184){const _0x5b5ad7=serializeExpandedRule(_0xd5b15d,_0x14c184),_0x4f55eb=_0x3b6f8f['get'](_0x5b5ad7)||[];_0x4f55eb[_0x2bcacd(0x1be)]({'name':_0x949ce8,'index':_0x261e58}),_0x3b6f8f['set'](_0x5b5ad7,_0x4f55eb),_0x261e58++;}const _0x2398a5=new Map();for(const [_0x55f9fc,_0x473558]of _0x3b6f8f){const _0x2627ef=_0x473558['slice']()[_0x2bcacd(0x1b6)]((_0x35b9db,_0x284be3)=>{const _0x34d7e1=_0x2bcacd,_0xcd6b39=_0x21062a[_0x34d7e1(0x21c)](_0x35b9db['name'])||0x0,_0x34ab65=_0x21062a['get'](_0x284be3[_0x34d7e1(0x1f7)])||0x0;if(_0xcd6b39!==_0x34ab65)return _0x34ab65-_0xcd6b39;return _0x35b9db[_0x34d7e1(0x1da)]-_0x284be3[_0x34d7e1(0x1da)];})['map'](_0x5f2491=>_0x5f2491[_0x2bcacd(0x1f7)]),_0x1c3664=[];for(const _0x18edec of _0x2627ef){const _0x1734c3=_0x21062a[_0x2bcacd(0x21c)](_0x18edec)||0x0,_0x1d26b0=Math[_0x2bcacd(0x295)](_0x1734c3,0x1);for(let _0x118bf8=0x0;_0x118bf8<_0x1d26b0;_0x118bf8++){_0x1c3664[_0x2bcacd(0x1be)](_0x18edec);}}_0x2398a5[_0x2bcacd(0x1b0)](_0x55f9fc,_0x1c3664);}return{'existingLocalSegmentNames':_0x471691,'localSegmentRules':_0x14c184,'localExpandedRuleToNames':_0x2398a5};}function a152_0x4bae(_0x1a5a6d,_0x201704){_0x1a5a6d=_0x1a5a6d-0x1a9;const _0x259918=a152_0x2599();let _0x4baea1=_0x259918[_0x1a5a6d];return _0x4baea1;}export function createSegmentIdResolver(_0x4bc85c,_0x3fc505){return async _0x370138=>{const _0x11d5cb=a152_0x4bae,_0x5ec4c5=_0x4bc85c[_0x11d5cb(0x21c)](_0x370138);if(!_0x5ec4c5)throw new SDKError(ErrorCode[_0x11d5cb(0x243)],'Segment\x20not\x20found:\x20'+_0x370138+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x3fc505+'\x27)');return _0x5ec4c5;};}export function extractRootFolderId(_0x4f7b3f){const _0x4c6ac2=a152_0x525dc2;return _0x4f7b3f[_0x4c6ac2(0x1aa)]?.['parentSegmentFolder']?.['data']?.['id']||_0x4f7b3f[_0x4c6ac2(0x1aa)]?.[_0x4c6ac2(0x2a2)]?.['data']?.['id'];}export function buildConnectionMaps(_0x52b7e1){const _0x578cd0=a152_0x525dc2,_0x5b1079=new Map(),_0x216fd9=new Map(),_0x54958c=new Map();for(const _0x1af02b of _0x52b7e1){_0x5b1079[_0x578cd0(0x1b0)](_0x1af02b['name'],parseInt(_0x1af02b['id'],0xa)),_0x216fd9[_0x578cd0(0x1b0)](_0x1af02b['id'],_0x1af02b['name']),_0x54958c[_0x578cd0(0x1b0)](_0x1af02b['name'],_0x1af02b[_0x578cd0(0x2a5)]);}return{'nameToId':_0x5b1079,'idToName':_0x216fd9,'nameToType':_0x54958c};}export function calculatePushStats(_0xb342de,_0x18b483,_0xebacc4,_0x539fe0,_0xaf1e13,_0x458a90,_0xc0776c){const _0x1c3ac0=a152_0x525dc2,_0x1bcbb9=_0xb342de['filter'](_0x47d1b1=>_0x47d1b1['isNew']),_0x8e28f3=_0xb342de['filter'](_0x53c075=>!_0x53c075[_0x1c3ac0(0x254)]&&_0x53c075[_0x1c3ac0(0x20c)]),_0x4b9598=_0xb342de[_0x1c3ac0(0x296)](_0x3aa8b5=>!_0x3aa8b5[_0x1c3ac0(0x254)]&&!_0x3aa8b5[_0x1c3ac0(0x20c)]),_0x226710=_0x458a90?_0x539fe0:[],_0x378c6e=_0x18b483[_0x1c3ac0(0x296)](_0x1d28a8=>_0x1d28a8[_0x1c3ac0(0x254)]),_0x41c164=_0x18b483['filter'](_0x8fa53=>!_0x8fa53[_0x1c3ac0(0x254)]&&_0x8fa53['hasChanges']),_0x272f1a=_0x18b483['filter'](_0x5ac227=>!_0x5ac227[_0x1c3ac0(0x254)]&&!_0x5ac227[_0x1c3ac0(0x20c)]),_0x1c3fcf=_0x458a90?_0xaf1e13:[],_0x589912=_0xb342de['flatMap'](_0x3446eb=>_0x3446eb[_0x1c3ac0(0x1b3)]),_0x2806b7=_0x589912[_0x1c3ac0(0x296)](_0x5a696e=>_0x5a696e['type']===_0x1c3ac0(0x249)),_0x3af55a=_0x589912[_0x1c3ac0(0x296)](_0x7f00ff=>_0x7f00ff[_0x1c3ac0(0x2a5)]===_0x1c3ac0(0x1d9)),_0x32b68f=_0x589912['filter'](_0xa96516=>_0xa96516['type']===_0x1c3ac0(0x288)),_0xd598f9=Array[_0x1c3ac0(0x232)](_0xebacc4)[_0x1c3ac0(0x1b6)](),_0x16877b=_0xc0776c?![]:_0x1bcbb9[_0x1c3ac0(0x1b9)]>0x0||_0x8e28f3['length']>0x0||_0x226710[_0x1c3ac0(0x1b9)]>0x0,_0x37450b=_0x378c6e['length']>0x0||_0x41c164[_0x1c3ac0(0x1b9)]>0x0||_0x1c3fcf['length']>0x0,_0x280e1d=_0xc0776c?![]:_0x589912[_0x1c3ac0(0x1b9)]>0x0,_0x225fc4=_0xd598f9['length']>0x0;return{'segments':{'new':_0x1bcbb9,'changed':_0x8e28f3,'unchanged':_0x4b9598,'toDelete':_0x226710},'journeys':{'new':_0x378c6e,'changed':_0x41c164,'unchanged':_0x272f1a,'toDelete':_0x1c3fcf},'activations':{'all':_0x589912,'toCreate':_0x2806b7,'toUpdate':_0x3af55a,'toDelete':_0x32b68f},'folders':{'toCreate':_0xd598f9},'counts':{'segments':{'new':_0x1bcbb9[_0x1c3ac0(0x1b9)],'changed':_0x8e28f3[_0x1c3ac0(0x1b9)],'unchanged':_0x4b9598['length'],'toDelete':_0x226710[_0x1c3ac0(0x1b9)]},'journeys':{'new':_0x378c6e['length'],'changed':_0x41c164[_0x1c3ac0(0x1b9)],'unchanged':_0x272f1a[_0x1c3ac0(0x1b9)],'toDelete':_0x1c3fcf[_0x1c3ac0(0x1b9)]},'activations':{'create':_0x2806b7['length'],'update':_0x3af55a[_0x1c3ac0(0x1b9)],'delete':_0x32b68f[_0x1c3ac0(0x1b9)]},'folders':_0xd598f9[_0x1c3ac0(0x1b9)]},'hasChanges':_0x16877b||_0x37450b||_0x280e1d||_0x225fc4};}export async function buildPushExecutionContext(_0x4185be,_0x558125,_0x59b8ff,_0x3c861d,_0x4432b6,_0x4fa6e6){const _0x3d9d32=a152_0x525dc2,_0x1f0e76=extractRootFolderId(_0x59b8ff),{pathToId:_0x5de1d2,idToPath:_0x1917cc}=buildFolderMaps(_0x4432b6),_0x3f7dd7=buildSegmentNameToIdMap(_0x3c861d),_0x228016=new Map(),{batchAsync:_0x473359}=await import(_0x3d9d32(0x247)),[_0x385f93,_0x518c5e]=await Promise['all']([_0x4185be['user'][_0x3d9d32(0x239)](),_0x4185be[_0x3d9d32(0x1e3)][_0x3d9d32(0x226)](),((async()=>{!_0x4fa6e6&&_0x3c861d['length']>0x0&&await _0x473359(_0x3c861d,async _0x327116=>{const _0x13bc57=a152_0x4bae,_0x28b368=await _0x4185be[_0x13bc57(0x283)][_0x13bc57(0x244)](_0x558125,_0x327116['id']);_0x228016[_0x13bc57(0x1b0)](_0x327116['id'],_0x28b368);});})())]),{emailToId:_0x5755db,idToEmail:_0x5de808}=_0x385f93,_0x2cbec9=buildConnectionMaps(_0x518c5e);return{'rootFolderId':_0x1f0e76,'folderPathToId':_0x5de1d2,'folderIdToPath':_0x1917cc,'segmentNameToId':_0x3f7dd7,'activationsBySegmentId':_0x228016,'emailToIdMap':_0x5755db,'idToEmailMap':_0x5de808,'connectionNameToIdMap':_0x2cbec9[_0x3d9d32(0x1cd)],'connectionIdToNameMap':_0x2cbec9['idToName'],'connectionNameToTypeMap':_0x2cbec9[_0x3d9d32(0x1c4)]};}export function createPushYamlContextForBundle(_0x4e7a4b,_0x1a33a8,_0x2ccda9,_0x332734,_0xc73ce,_0x171e97,_0x1b5e58,_0x265a81){const {existingLocalSegmentNames:_0x4e1e6c,localExpandedRuleToNames:_0x32a94a}=_0x332734,_0x1447b2=new Set(),_0x22afba=new Map(),_0x7a45bb=new Map(),_0x18264a=new Map(),_0x58aa31=createJumpTargetCache(),_0xaa6aef=new Map(),_0x4b3db9=new Map(),_0x2b6666=new Set();let _0x10d726;const _0x4404ef=_0x33c9e8=>{const _0x520e8c={'resolveSegment':async _0x3ef52a=>{const _0x4bc9a5=a152_0x4bae,_0xdd99c0=_0x18264a[_0x4bc9a5(0x21c)](_0x3ef52a);if(_0xdd99c0!==undefined)return{'name':_0xdd99c0,'isJourneyLocal':!![]};try{const _0x19aacc=await fetchSegment(_0x4e7a4b,_0x1a33a8,_0x3ef52a,_0x2ccda9);if(!_0x19aacc)throw new Error(_0x4bc9a5(0x258));const _0x20ed66=generateJourneyLocalName(_0x19aacc['name']),_0x10771f=_0x19aacc[_0x4bc9a5(0x216)]===SEGMENT_KIND_JOURNEY&&_0x20ed66!==undefined;let _0xa1c4d9=_0x19aacc[_0x4bc9a5(0x1f7)],_0x3484b4;if(_0x10771f&&_0x19aacc[_0x4bc9a5(0x290)]){const _0x268bb9=apiRuleToYaml(_0x19aacc[_0x4bc9a5(0x290)]);_0x4b3db9[_0x4bc9a5(0x1b0)](_0x3ef52a,_0x268bb9);const _0xff5ed8=async _0x96c549=>{const _0x385f86=_0x4bc9a5,_0x235469=collectSegmentRefsFromRule(_0x96c549);for(const _0x183dd2 of _0x235469){if(!_0x4b3db9[_0x385f86(0x23a)](_0x183dd2))try{const _0x1f5213=await fetchSegment(_0x4e7a4b,_0x1a33a8,_0x183dd2,_0x2ccda9);if(_0x1f5213?.[_0x385f86(0x290)]){const _0x128113=apiRuleToYaml(_0x1f5213[_0x385f86(0x290)]);_0x4b3db9['set'](_0x183dd2,_0x128113),await _0xff5ed8(_0x128113);}}catch(_0x20d64a){logger[_0x385f86(0x1af)](_0x385f86(0x1f8)+_0x183dd2+':\x20'+_0x20d64a);}}};await _0xff5ed8(_0x268bb9);const _0x50adbd=serializeExpandedRule(_0x268bb9,_0x4b3db9),_0x34d9a2=_0x32a94a['get'](_0x50adbd);if(_0x34d9a2&&_0x34d9a2['length']>0x0){const _0x1dbe82=_0x22afba[_0x4bc9a5(0x21c)](_0x50adbd)||0x0,_0x5c4dc5=_0x34d9a2[_0x1dbe82]||_0x34d9a2[_0x34d9a2['length']-0x1];_0x22afba['set'](_0x50adbd,_0x1dbe82+0x1),_0xa1c4d9=_0x5c4dc5,_0x1447b2['add'](_0xa1c4d9),_0x18264a[_0x4bc9a5(0x1b0)](_0x3ef52a,_0xa1c4d9);const _0x2b7aca=await resolveRuleSegmentRefs(_0x268bb9,async _0x16a53f=>{const _0xdc334e=_0x4bc9a5,_0x4c2b40=_0x18264a['get'](_0x16a53f);if(_0x4c2b40)return _0x4c2b40;const _0x30c60e=await _0x10d726[_0xdc334e(0x1cf)](_0x16a53f);return _0x30c60e[_0xdc334e(0x1f7)];});_0x3484b4={'description':_0x19aacc[_0x4bc9a5(0x206)],'rule':_0x2b7aca};}else{const _0x18c08c=_0xaa6aef[_0x4bc9a5(0x21c)](_0x50adbd);if(_0x18c08c)_0xa1c4d9=_0x18c08c,_0x18264a[_0x4bc9a5(0x1b0)](_0x3ef52a,_0xa1c4d9);else{if(_0x20ed66){let _0x28df24=_0x20ed66,_0x432c9e=0x2;while(_0x1447b2[_0x4bc9a5(0x23a)](_0x28df24)||_0x4e1e6c[_0x4bc9a5(0x23a)](_0x28df24)){_0x28df24=_0x20ed66+'_'+_0x432c9e,_0x432c9e++;}_0x1447b2[_0x4bc9a5(0x1f6)](_0x28df24),_0xa1c4d9=_0x28df24;}_0x18264a['set'](_0x3ef52a,_0xa1c4d9),_0xaa6aef[_0x4bc9a5(0x1b0)](_0x50adbd,_0xa1c4d9);const _0x33bb50=await resolveRuleSegmentRefs(_0x268bb9,async _0x3bc1f8=>{const _0x1e66a1=_0x4bc9a5,_0x5442ed=_0x18264a['get'](_0x3bc1f8);if(_0x5442ed)return _0x5442ed;const _0x2687ea=await _0x10d726[_0x1e66a1(0x1cf)](_0x3bc1f8);return _0x2687ea[_0x1e66a1(0x1f7)];});_0x3484b4={'description':_0x19aacc[_0x4bc9a5(0x206)],'rule':_0x33bb50};}}}return{'name':_0xa1c4d9,'isJourneyLocal':_0x10771f,'definition':_0x3484b4};}catch(_0x3c3d80){return logger[_0x4bc9a5(0x1af)]('Failed\x20to\x20resolve\x20segment\x20'+_0x3ef52a+':\x20'+_0x3c3d80),{'name':_0x3ef52a,'isJourneyLocal':![]};}},'resolveActivation':async _0x207d8c=>{const _0x18b44b=a152_0x4bae,_0xd4e01d=_0x7a45bb['get'](_0x207d8c);if(_0xd4e01d!==undefined)return{'name':_0xd4e01d,'isJourneyLocal':!![]};try{let _0x17a9bd=_0x1b5e58?.['get'](_0x207d8c);!_0x17a9bd&&(_0x17a9bd=await _0x4e7a4b[_0x18b44b(0x262)]['getActivation'](_0x33c9e8,_0x207d8c));const _0x41d09a=_0x17a9bd[_0x18b44b(0x1d1)]['activationParams'][_0x18b44b(0x1f7)]||_0x207d8c,_0x55f449=sanitizeYamlKey(_0x41d09a)||'activation_'+_0x207d8c,_0x5b8bbb=_0x55f449;_0x7a45bb[_0x18b44b(0x1b0)](_0x207d8c,_0x5b8bbb);const _0x46b1dc=journeyActivationStepToYaml(_0x17a9bd,_0xc73ce,_0x171e97);return{'name':_0x5b8bbb,'isJourneyLocal':!![],'definition':_0x46b1dc};}catch(_0x34e08d){return logger[_0x18b44b(0x1af)](_0x18b44b(0x1ea)+_0x207d8c+':\x20'+_0x34e08d),{'name':_0x207d8c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2101b4,_0x464cd8)=>resolveJumpTarget(_0x2101b4,_0x464cd8,_0x58aa31,async _0x2d4f4b=>{const _0x344474=a152_0x4bae,_0x5d51d3=_0x265a81?.[_0x344474(0x21c)](_0x2d4f4b);if(_0x5d51d3)return _0x5d51d3;return _0x4e7a4b[_0x344474(0x262)][_0x344474(0x256)](_0x2d4f4b);})};return _0x10d726=_0x520e8c,_0x520e8c;},_0x2838a3=async _0x1c721a=>{const _0x4dba5b=a152_0x4bae,{collectSegmentIdsFromJourneyApi:_0x4edb77}=await import('./journey-yaml.js'),{batchAsync:_0x2059e6}=await import('../../utils/async.js'),_0x43d1ad=new Set();for(const _0x322366 of _0x1c721a){let _0x4f10ae=_0x265a81?.['get'](_0x322366);!_0x4f10ae&&(_0x4f10ae=await _0x4e7a4b[_0x4dba5b(0x262)][_0x4dba5b(0x256)](_0x322366));const _0x456034=_0x4edb77(_0x4f10ae);for(const _0x497277 of _0x456034){_0x43d1ad['add'](_0x497277);}}let _0x278169=Array['from'](_0x43d1ad);while(_0x278169[_0x4dba5b(0x1b9)]>0x0){const _0x143cf8=_0x278169[_0x4dba5b(0x296)](_0x53cd39=>!_0x2b6666[_0x4dba5b(0x23a)](_0x53cd39));if(_0x143cf8[_0x4dba5b(0x1b9)]===0x0)break;const _0x18074c=await _0x2059e6(_0x143cf8,async _0x1d4999=>{const _0x5d1c15=_0x4dba5b;_0x2b6666[_0x5d1c15(0x1f6)](_0x1d4999);const _0x58e091=await fetchSegment(_0x4e7a4b,_0x1a33a8,_0x1d4999,_0x2ccda9);if(!_0x58e091)return null;return{'segmentId':_0x1d4999,'segment':_0x58e091};},0xa),_0xee85ac=new Set();for(const _0x584d8e of _0x18074c){if(!_0x584d8e?.[_0x4dba5b(0x283)]?.[_0x4dba5b(0x290)])continue;const _0x390e69=apiRuleToYaml(_0x584d8e[_0x4dba5b(0x283)][_0x4dba5b(0x290)]);_0x4b3db9[_0x4dba5b(0x1b0)](_0x584d8e[_0x4dba5b(0x23c)],_0x390e69);const _0x3a5d71=collectSegmentRefsFromRule(_0x390e69);for(const _0x2ae1f4 of _0x3a5d71){!_0x2b6666[_0x4dba5b(0x23a)](_0x2ae1f4)&&_0xee85ac[_0x4dba5b(0x1f6)](_0x2ae1f4);}}_0x278169=Array['from'](_0xee85ac);}};return{'createYamlContext':_0x4404ef,'prefetchJourneySegments':_0x2838a3};}export async function executePushSegments(_0x2ab5d8,_0x2ed1d4,_0x5e08f1,_0x2b0f8d,_0xfabfc){const _0x452ae6=a152_0x525dc2,{segmentDefToCreateRequest:_0x2d31b8,segmentDefToUpdateRequest:_0x591811}=await import(_0x452ae6(0x1bc)),_0x1e8a68=_0x5e08f1['folderPathToId'],_0xf6631a=0x5,_0x30b9d2=async _0x140dac=>{const _0xc618c7=_0x452ae6,_0x1ee9b4=_0x140dac[_0xc618c7(0x1b8)]?_0x1e8a68[_0xc618c7(0x21c)](_0x140dac['folderPath']):undefined;let _0x58cf6a;const _0xc4c43c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x6f6d02=_0x140dac[_0xc618c7(0x220)];if(_0x140dac[_0xc618c7(0x220)][_0xc618c7(0x290)]){const _0x455224=createSegmentIdResolver(_0x5e08f1[_0xc618c7(0x1c1)],_0x140dac['yamlConfig'][_0xc618c7(0x1f7)]),_0x5b67b4=await resolveRuleSegmentIds(_0x140dac[_0xc618c7(0x220)][_0xc618c7(0x290)],_0x455224);_0x6f6d02={..._0x140dac[_0xc618c7(0x220)],'rule':_0x5b67b4};}try{if(_0x140dac[_0xc618c7(0x254)]){_0xfabfc[_0xc618c7(0x1ae)]?.({'type':_0xc618c7(0x1e9),'name':_0x140dac[_0xc618c7(0x220)][_0xc618c7(0x1f7)]});const _0x22339d=_0x2d31b8(_0x6f6d02,_0x1ee9b4),_0x469694=await _0xfabfc[_0xc618c7(0x1ff)](_0xc618c7(0x1d5)+_0x140dac['yamlConfig'][_0xc618c7(0x1f7)]+'\x27...',()=>_0x2ab5d8[_0xc618c7(0x283)][_0xc618c7(0x241)](_0x2b0f8d[_0xc618c7(0x265)],_0x22339d));_0x58cf6a=_0x469694[_0xc618c7(0x25e)]['id'],_0x5e08f1[_0xc618c7(0x1c1)][_0xc618c7(0x1b0)](_0x140dac['yamlConfig'][_0xc618c7(0x1f7)],_0x58cf6a),_0xc4c43c[_0xc618c7(0x20b)]={'name':_0x140dac['yamlConfig'][_0xc618c7(0x1f7)],'id':_0x58cf6a},_0xfabfc[_0xc618c7(0x1ae)]?.({'type':_0xc618c7(0x1bd),'name':_0x140dac[_0xc618c7(0x220)]['name'],'segmentId':_0x58cf6a}),_0xfabfc['logSuccess']?.(_0xc618c7(0x291)+_0x140dac[_0xc618c7(0x220)][_0xc618c7(0x1f7)]+'\x27'),_0xc4c43c['created']=0x1;}else{if(_0x140dac[_0xc618c7(0x20c)]){_0xfabfc['onProgress']?.({'type':_0xc618c7(0x1f9),'name':_0x140dac['yamlConfig']['name']});const _0x1631b7=_0x591811(_0x6f6d02);_0x1ee9b4!==_0x140dac[_0xc618c7(0x248)]?.[_0xc618c7(0x1b2)]&&(_0x1631b7[_0xc618c7(0x1b2)]=_0x1ee9b4?parseInt(_0x1ee9b4,0xa):undefined),await _0xfabfc[_0xc618c7(0x1ff)](_0xc618c7(0x22b)+_0x140dac['yamlConfig'][_0xc618c7(0x1f7)]+_0xc618c7(0x219),()=>_0x2ab5d8[_0xc618c7(0x283)][_0xc618c7(0x294)](_0x2b0f8d[_0xc618c7(0x265)],_0x140dac[_0xc618c7(0x248)]['id'],_0x1631b7)),_0x58cf6a=_0x140dac[_0xc618c7(0x248)]['id'],_0xfabfc['onProgress']?.({'type':'segment_updated','name':_0x140dac[_0xc618c7(0x220)][_0xc618c7(0x1f7)]}),_0xfabfc[_0xc618c7(0x245)]?.('Updated\x20segment\x20\x27'+_0x140dac[_0xc618c7(0x220)][_0xc618c7(0x1f7)]+'\x27'),_0xc4c43c[_0xc618c7(0x1e1)]=0x1;}else _0x58cf6a=_0x140dac[_0xc618c7(0x248)]['id'];}}catch(_0x3239b4){const _0x5f0e33=isHttp400Error(_0x3239b4),_0x424211=_0x5f0e33?ErrorCode[_0xc618c7(0x27b)]:ErrorCode[_0xc618c7(0x281)],_0x56e08c=getErrorMessage(_0x3239b4);throw new SDKError(_0x424211,_0xc618c7(0x251)+(_0x140dac[_0xc618c7(0x254)]?_0xc618c7(0x249):_0xc618c7(0x1d9))+'\x20segment\x20from\x20file:\x20'+_0x140dac['absolutePath']+_0xc618c7(0x266)+_0x56e08c,_0x3239b4);}try{const _0x5c8cf8=await syncActivationsForSegment(_0x2ab5d8,_0x2b0f8d['parentId'],_0x58cf6a,_0x140dac[_0xc618c7(0x220)][_0xc618c7(0x1f7)],_0x140dac[_0xc618c7(0x1b3)],_0xfabfc,_0x140dac[_0xc618c7(0x224)]);_0xc4c43c['activations']=_0x5c8cf8;}catch(_0x5a9349){if(_0x5a9349 instanceof SDKError)throw _0x5a9349;throw new SDKError(ErrorCode[_0xc618c7(0x27d)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x140dac[_0xc618c7(0x220)][_0xc618c7(0x1f7)]+_0xc618c7(0x225)+_0x140dac[_0xc618c7(0x224)]+'\x0a\x20\x20'+getErrorMessage(_0x5a9349),_0x5a9349);}return _0xc4c43c;},_0x349ecc=await batchAsync(_0x2ed1d4,_0x30b9d2,_0xf6631a),_0x2e7ad6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4ce9f7 of _0x349ecc){_0x2e7ad6['created']+=_0x4ce9f7[_0x452ae6(0x1d0)],_0x2e7ad6['updated']+=_0x4ce9f7[_0x452ae6(0x1e1)],_0x4ce9f7[_0x452ae6(0x20b)]&&_0x2e7ad6[_0x452ae6(0x1bb)][_0x452ae6(0x1b0)](_0x4ce9f7[_0x452ae6(0x20b)]['name'],_0x4ce9f7[_0x452ae6(0x20b)]['id']),_0x2e7ad6[_0x452ae6(0x271)][_0x452ae6(0x1d0)]+=_0x4ce9f7[_0x452ae6(0x271)]['created'],_0x2e7ad6[_0x452ae6(0x271)][_0x452ae6(0x1e1)]+=_0x4ce9f7[_0x452ae6(0x271)][_0x452ae6(0x1e1)],_0x2e7ad6[_0x452ae6(0x271)]['deleted']+=_0x4ce9f7['activations'][_0x452ae6(0x238)];}return _0x2e7ad6;}async function syncActivationsForSegment(_0x2b1381,_0x271c47,_0xfe7bd7,_0x4523fe,_0x30f08d,_0x4ddc1d,_0x221061){const _0x3c4a55=a152_0x525dc2,_0x2c8794={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xee6f5c of _0x30f08d){try{if(_0xee6f5c[_0x3c4a55(0x2a5)]===_0x3c4a55(0x249)&&_0xee6f5c[_0x3c4a55(0x1f2)])_0x4ddc1d[_0x3c4a55(0x1ae)]?.({'type':_0x3c4a55(0x274),'segmentName':_0x4523fe,'activationName':_0xee6f5c['name']}),await _0x4ddc1d[_0x3c4a55(0x1ff)](_0x3c4a55(0x234)+_0xee6f5c[_0x3c4a55(0x1f7)]+_0x3c4a55(0x219),()=>_0x2b1381['segment'][_0x3c4a55(0x1eb)](_0x271c47,_0xfe7bd7,_0xee6f5c[_0x3c4a55(0x1f2)])),_0x4ddc1d[_0x3c4a55(0x1ae)]?.({'type':_0x3c4a55(0x26b),'segmentName':_0x4523fe,'activationName':_0xee6f5c[_0x3c4a55(0x1f7)]}),_0x4ddc1d[_0x3c4a55(0x245)]?.(_0x3c4a55(0x1db)+_0xee6f5c[_0x3c4a55(0x1f7)]+'\x27'),_0x2c8794['created']++;else{if(_0xee6f5c[_0x3c4a55(0x2a5)]===_0x3c4a55(0x1d9)&&_0xee6f5c['validatedRequest']&&_0xee6f5c['existingActivation'])_0x4ddc1d[_0x3c4a55(0x1ae)]?.({'type':_0x3c4a55(0x27f),'segmentName':_0x4523fe,'activationName':_0xee6f5c[_0x3c4a55(0x1f7)]}),await _0x4ddc1d[_0x3c4a55(0x1ff)](_0x3c4a55(0x21e)+_0xee6f5c[_0x3c4a55(0x1f7)]+_0x3c4a55(0x219),()=>_0x2b1381[_0x3c4a55(0x283)][_0x3c4a55(0x204)](_0x271c47,_0xfe7bd7,_0xee6f5c[_0x3c4a55(0x218)]['id'],_0xee6f5c['validatedRequest'])),_0x4ddc1d['onProgress']?.({'type':_0x3c4a55(0x1d4),'segmentName':_0x4523fe,'activationName':_0xee6f5c[_0x3c4a55(0x1f7)]}),_0x4ddc1d[_0x3c4a55(0x245)]?.(_0x3c4a55(0x29a)+_0xee6f5c['name']+'\x27'),_0x2c8794[_0x3c4a55(0x1e1)]++;else _0xee6f5c['type']===_0x3c4a55(0x288)&&_0xee6f5c[_0x3c4a55(0x218)]&&(_0x4ddc1d[_0x3c4a55(0x1ae)]?.({'type':'activation_deleting','segmentName':_0x4523fe,'activationName':_0xee6f5c[_0x3c4a55(0x1f7)]}),await _0x4ddc1d[_0x3c4a55(0x1ff)]('Deleting\x20activation\x20\x27'+_0xee6f5c[_0x3c4a55(0x1f7)]+'\x27...',()=>_0x2b1381[_0x3c4a55(0x283)]['deleteActivation'](_0x271c47,_0xfe7bd7,_0xee6f5c[_0x3c4a55(0x218)]['id'])),_0x4ddc1d[_0x3c4a55(0x1ae)]?.({'type':_0x3c4a55(0x273),'segmentName':_0x4523fe,'activationName':_0xee6f5c['name']}),_0x4ddc1d[_0x3c4a55(0x22f)]?.(_0x3c4a55(0x253)+_0xee6f5c['name']+'\x27'),_0x2c8794[_0x3c4a55(0x238)]++);}}catch(_0x337734){const _0x369250=isHttp400Error(_0x337734),_0x26c2eb=_0x369250?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2ba21a=getErrorMessage(_0x337734);throw new SDKError(_0x26c2eb,_0x3c4a55(0x251)+_0xee6f5c[_0x3c4a55(0x2a5)]+_0x3c4a55(0x208)+_0xee6f5c[_0x3c4a55(0x1f7)]+_0x3c4a55(0x225)+_0x221061+_0x3c4a55(0x266)+_0x2ba21a,_0x337734);}}return _0x2c8794;}export async function executePushFolders(_0x202ad0,_0x53b5fc,_0x2194dd,_0x243c8a,_0x1895ef){const _0xf6212=a152_0x525dc2,_0x5f1ed5=new Map(_0x2194dd),_0x1fe41b=sortFoldersByDepth(_0x53b5fc);for(const _0x23bb08 of _0x1fe41b){const _0x54ad04=_0x23bb08[_0xf6212(0x269)]('/'),_0x23b25d=_0x54ad04[_0x54ad04[_0xf6212(0x1b9)]-0x1],_0x8c605b=_0x54ad04[_0xf6212(0x268)](0x0,-0x1)[_0xf6212(0x1ef)]('/'),_0x528dd4=_0x5f1ed5['get'](_0x8c605b);_0x1895ef[_0xf6212(0x1ae)]?.({'type':_0xf6212(0x24d),'folder':_0x23bb08});const _0x1cea69={'name':_0x23b25d,'parentFolderId':_0x528dd4},_0x4a288e=await _0x1895ef[_0xf6212(0x1ff)](_0xf6212(0x1e2)+_0x23bb08+_0xf6212(0x219),()=>_0x202ad0['segment'][_0xf6212(0x28d)](_0x243c8a[_0xf6212(0x265)],_0x1cea69));_0x5f1ed5[_0xf6212(0x1b0)](_0x23bb08,_0x4a288e[_0xf6212(0x25e)]['id']),_0x1895ef['onProgress']?.({'type':_0xf6212(0x1ad),'folder':_0x23bb08,'folderId':_0x4a288e['data']['id']}),_0x1895ef[_0xf6212(0x285)]?.('Created\x20folder\x20\x27'+_0x23bb08+'\x27');}return _0x5f1ed5;}export async function executePushSegmentDeletions(_0x423876,_0x37648e,_0x4cf773){const _0x3a9991=a152_0x525dc2;if(_0x37648e['length']===0x0)return 0x0;const {batchAsync:_0x29818c}=await import(_0x3a9991(0x247)),_0x3bf5e5=0x5,_0x472a65=await _0x29818c(_0x37648e,async _0x28c72e=>{const _0x36f9cd=_0x3a9991;return _0x4cf773[_0x36f9cd(0x1ae)]?.({'type':_0x36f9cd(0x2a8),'name':_0x28c72e['name']}),await _0x423876['segment'][_0x36f9cd(0x1ac)](_0x28c72e['id']),_0x4cf773[_0x36f9cd(0x1ae)]?.({'type':_0x36f9cd(0x1d6),'name':_0x28c72e[_0x36f9cd(0x1f7)]}),_0x4cf773[_0x36f9cd(0x22f)]?.(_0x36f9cd(0x1a9)+_0x28c72e[_0x36f9cd(0x1f7)]+'\x27'),0x1;},_0x3bf5e5);return _0x472a65[_0x3a9991(0x201)]((_0x2aeb20,_0x203813)=>_0x2aeb20+_0x203813,0x0);}export async function executePushJourneys(_0x27a6c3,_0x357d36,_0x1b96cb,_0x572c39,_0x4510d7){const _0x5c73db=a152_0x525dc2,{journeyDefToRequest:_0x26eb93}=await import(_0x5c73db(0x1c2)),{activationDefToCreateRequest:_0x25cab5,yamlRuleToApi:_0x1fd536,validateSegmentRule:_0x2cea36}=await import(_0x5c73db(0x1bc)),_0x503fb1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5881ae=new Map(_0x1b96cb[_0x5c73db(0x1c1)]),_0x44ca3b=0x5;for(let _0x2d3dc6=0x0;_0x2d3dc6<_0x357d36[_0x5c73db(0x1b9)];_0x2d3dc6+=_0x44ca3b){const _0x114b78=_0x357d36[_0x5c73db(0x268)](_0x2d3dc6,_0x2d3dc6+_0x44ca3b),_0x32f998=await Promise[_0x5c73db(0x2a6)](_0x114b78[_0x5c73db(0x237)](async _0x3fadca=>{const _0x2b8047=_0x5c73db;if(!_0x3fadca[_0x2b8047(0x254)]&&!_0x3fadca['hasChanges'])return{'action':'unchanged','name':_0x3fadca[_0x2b8047(0x220)][_0x2b8047(0x1f7)],'journeyId':_0x3fadca['existingJourney']?.['id']};const _0x8ca1=_0x3fadca[_0x2b8047(0x1b8)]?_0x1b96cb[_0x2b8047(0x222)]['get'](_0x3fadca['folderPath']):undefined;_0x4510d7[_0x2b8047(0x1ae)]?.({'type':_0x3fadca[_0x2b8047(0x254)]?_0x2b8047(0x22d):_0x2b8047(0x27e),'name':_0x3fadca[_0x2b8047(0x220)]['name']});try{const _0x505a50=await executeSingleJourneyPush(_0x27a6c3,_0x3fadca,{..._0x1b96cb,'segmentNameToId':_0x5881ae},{'parentId':_0x572c39[_0x2b8047(0x265)],'rootFolderId':_0x572c39[_0x2b8047(0x1ba)],'folderId':_0x8ca1,'verbose':_0x572c39[_0x2b8047(0x27a)]},_0x4510d7,{'journeyDefToRequest':_0x26eb93,'activationDefToCreateRequest':_0x25cab5,'yamlRuleToApi':_0x1fd536,'validateSegmentRule':_0x2cea36});for(const [_0x39a300,_0x263045]of _0x505a50[_0x2b8047(0x211)]){_0x5881ae[_0x2b8047(0x1b0)](_0x39a300,_0x263045),_0x503fb1['embeddedSegmentNameToId'][_0x2b8047(0x1b0)](_0x39a300,_0x263045);}if(_0x505a50['action']===_0x2b8047(0x1d0))_0x4510d7[_0x2b8047(0x1ae)]?.({'type':_0x2b8047(0x1cc),'name':_0x3fadca[_0x2b8047(0x220)][_0x2b8047(0x1f7)],'journeyId':_0x505a50[_0x2b8047(0x27c)]}),_0x4510d7[_0x2b8047(0x245)]?.(_0x2b8047(0x1e4)+_0x3fadca[_0x2b8047(0x220)]['name']+'\x27'),_0x503fb1[_0x2b8047(0x1d0)]++;else _0x505a50['action']==='updated'&&(_0x4510d7['onProgress']?.({'type':_0x2b8047(0x21b),'name':_0x3fadca[_0x2b8047(0x220)][_0x2b8047(0x1f7)]}),_0x4510d7[_0x2b8047(0x245)]?.(_0x2b8047(0x277)+_0x3fadca[_0x2b8047(0x220)][_0x2b8047(0x1f7)]+'\x27'),_0x503fb1['updated']++);return{'action':_0x505a50[_0x2b8047(0x228)],'name':_0x3fadca[_0x2b8047(0x220)][_0x2b8047(0x1f7)],'journeyId':_0x505a50[_0x2b8047(0x27c)]};}catch(_0x2d490c){const _0x5b53c1=isHttp400Error(_0x2d490c),_0x93013=_0x5b53c1?ErrorCode[_0x2b8047(0x210)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x3d71b9=getErrorMessage(_0x2d490c);throw new SDKError(_0x93013,_0x2b8047(0x251)+(_0x3fadca[_0x2b8047(0x254)]?_0x2b8047(0x249):_0x2b8047(0x1d9))+_0x2b8047(0x236)+_0x3fadca['absolutePath']+'\x0a\x20\x20'+_0x3d71b9,_0x2d490c);}}));_0x503fb1[_0x5c73db(0x214)]['push'](..._0x32f998);}return _0x503fb1;}async function matchExistingJourneySegments(_0x2e20f1,_0xaa7df0,_0x35f9b5,_0xb15a16,_0x280d91){const _0x3786e8=a152_0x525dc2;if(!_0xaa7df0[_0x3786e8(0x28c)]||!_0xaa7df0[_0x3786e8(0x220)]['segments'])return;const _0x59453c=new Map(),_0x36543a=new Set();for(const _0x5c570e of Object[_0x3786e8(0x255)](_0xaa7df0[_0x3786e8(0x220)][_0x3786e8(0x286)])){const _0x386870=generateDeterministicJourneySegmentName(_0xaa7df0[_0x3786e8(0x220)][_0x3786e8(0x1f7)],_0x5c570e);_0x59453c['set'](_0x386870,_0x5c570e),_0x36543a[_0x3786e8(0x1f6)](_0x5c570e);}const _0x409cef=[],_0x19d7ca=collectSegmentIdsFromJourneyApi(_0xaa7df0['existingJourney']);for(const _0x3026be of _0x19d7ca){const _0x2e0ef7=await fetchSegment(_0x2e20f1,_0x35f9b5,_0x3026be,_0xb15a16);if(!_0x2e0ef7?.[_0x3786e8(0x1f7)])continue;const _0x528f31=_0x59453c[_0x3786e8(0x21c)](_0x2e0ef7[_0x3786e8(0x1f7)]);_0x528f31?(_0x280d91[_0x3786e8(0x1b0)](_0x528f31,_0x3026be),_0x36543a[_0x3786e8(0x288)](_0x528f31)):_0x409cef['push']({'id':_0x3026be,'seg':_0x2e0ef7});}if(_0x36543a[_0x3786e8(0x22e)]>0x0&&_0x409cef[_0x3786e8(0x1b9)]>0x0){const {localExpandedRuleToNames:_0x2fe957}=buildLocalExpandedRuleMappings(_0xaa7df0[_0x3786e8(0x220)]),_0x69ecda=new Map();for(const {id:_0x56f196,seg:_0x198b12}of _0x409cef){if(_0x198b12[_0x3786e8(0x290)]){const _0x372037=apiRuleToYaml(_0x198b12[_0x3786e8(0x290)]);_0x69ecda['set'](_0x56f196,_0x372037);}}for(const {id:_0x553c63,seg:_0x356b49}of _0x409cef){if(!_0x356b49[_0x3786e8(0x290)])continue;const _0x32ea12=_0x69ecda[_0x3786e8(0x21c)](_0x553c63);if(!_0x32ea12)continue;const _0x14e91d=serializeExpandedRule(_0x32ea12,_0x69ecda),_0x824532=_0x2fe957['get'](_0x14e91d);if(_0x824532){const _0x1c7e89=_0x824532[_0x3786e8(0x1c8)](_0x4ce024=>_0x36543a[_0x3786e8(0x23a)](_0x4ce024));_0x1c7e89&&(_0x280d91[_0x3786e8(0x1b0)](_0x1c7e89,_0x553c63),_0x36543a['delete'](_0x1c7e89),logger[_0x3786e8(0x1af)](_0x3786e8(0x246)+_0x356b49['name']+'\x27\x20to\x20local\x20\x27'+_0x1c7e89+_0x3786e8(0x257)));}}}}async function executeSingleJourneyPush(_0x52f0ea,_0x2f78c6,_0x2ecc08,_0x9153fc,_0x5e0763,_0x5bad6f){const _0x14a7fd=a152_0x525dc2,{journeyDefToRequest:_0x145029,activationDefToCreateRequest:_0xa0a734,yamlRuleToApi:_0x5b835e,validateSegmentRule:_0x1e7d4b}=_0x5bad6f,_0xab0f=new Map(),_0x563840=new Map();recoverSegmentIdsFromPushRecovery(_0x2f78c6,_0xab0f,_0x2ecc08[_0x14a7fd(0x1c1)]);const _0x4e3f0a=new Map(),_0x5b00c7=new Map(),_0x384818=new Map();let _0x329930;const _0x50f2c7=async()=>{const _0x437f42=_0x14a7fd;if(_0x329930)return;_0x329930=new Map();if(!_0x2f78c6[_0x437f42(0x28c)])return;const _0x98a00e=await _0x52f0ea[_0x437f42(0x262)][_0x437f42(0x244)](_0x2f78c6[_0x437f42(0x28c)]['id']);for(const _0xf6a690 of _0x98a00e){const _0x1769ca=journeyActivationStepToYaml(_0xf6a690,_0x2ecc08[_0x437f42(0x200)],_0x2ecc08[_0x437f42(0x2a7)]),_0x379e5a=activationSignature(_0x1769ca);!_0x329930[_0x437f42(0x23a)](_0x379e5a)&&_0x329930[_0x437f42(0x1b0)](_0x379e5a,_0xf6a690['id']),_0x1769ca[_0x437f42(0x1f7)]&&_0x563840['set'](_0x1769ca[_0x437f42(0x1f7)],_0xf6a690['id']);}};await matchExistingJourneySegments(_0x52f0ea,_0x2f78c6,_0x9153fc[_0x14a7fd(0x265)],_0x2ecc08[_0x14a7fd(0x1b1)],_0x2ecc08['segmentNameToId']);const _0x27b826={'resolveSegmentId':async _0x4977b1=>{const _0x29b488=_0x14a7fd,_0x401a94=_0x2ecc08[_0x29b488(0x1c1)][_0x29b488(0x21c)](_0x4977b1);if(!_0x401a94)throw new SDKError(ErrorCode[_0x29b488(0x243)],_0x29b488(0x1d8)+_0x4977b1+_0x29b488(0x278)+_0x2f78c6[_0x29b488(0x220)]['name']+')');return _0x401a94;},'resolveEmbeddedSegmentId':async(_0x4f1ede,_0x65af49)=>{const _0x2ff034=_0x14a7fd,_0x3bccb0=_0x2ecc08[_0x2ff034(0x1c1)][_0x2ff034(0x21c)](_0x4f1ede);if(_0x3bccb0)return _0x3bccb0;const _0x328978=_0x2ecc08[_0x2ff034(0x1b1)][_0x2ff034(0x1c8)](_0x593279=>_0x593279[_0x2ff034(0x1f7)]===_0x4f1ede);if(_0x328978)return _0x2ecc08[_0x2ff034(0x1c1)][_0x2ff034(0x1b0)](_0x4f1ede,_0x328978['id']),_0x328978['id'];if(_0x2f78c6[_0x2ff034(0x254)]){const {stageName:_0x318917,criteriaName:_0x9676bd}=findSegmentCriteriaLocation(_0x2f78c6[_0x2ff034(0x220)],_0x4f1ede);return _0x1e7d4b(_0x4f1ede,_0x65af49[_0x2ff034(0x290)]),_0x5b00c7[_0x2ff034(0x1b0)](_0x4f1ede,{'definition':_0x65af49,'stageName':_0x318917,'criteriaName':_0x9676bd}),createPendingSegmentId(_0x4f1ede);}const _0x5c123e=_0x2f78c6[_0x2ff034(0x28c)]?.['id'];if(!_0x5c123e)throw new SDKError(ErrorCode[_0x2ff034(0x1b7)],_0x2ff034(0x261));const _0xbf6919=_0x4e3f0a[_0x2ff034(0x21c)](_0x4f1ede);if(_0xbf6919)return _0xbf6919;const _0x34527b=((async()=>{const _0x537dc7=_0x2ff034;_0x1e7d4b(_0x4f1ede,_0x65af49['rule']);const _0x27643c=generateDeterministicJourneySegmentName(_0x2f78c6[_0x537dc7(0x220)]['name'],_0x4f1ede),_0x2931df=_0x2ecc08[_0x537dc7(0x1b1)][_0x537dc7(0x1c8)](_0xa0217c=>_0xa0217c[_0x537dc7(0x1f7)]===_0x27643c),_0x58d218=createSegmentIdResolver(_0x2ecc08[_0x537dc7(0x1c1)],_0x4f1ede),_0x345180=await resolveRuleSegmentIds(_0x65af49['rule'],_0x58d218);let _0x51912f;return _0x2931df?(await _0x52f0ea[_0x537dc7(0x283)]['updateSegmentById'](_0x9153fc[_0x537dc7(0x265)],_0x2931df['id'],{'description':_0x65af49[_0x537dc7(0x206)]||_0x537dc7(0x229)+_0x4f1ede,'rule':_0x5b835e(_0x345180),'countPopulation':!![]}),_0x51912f=_0x2931df['id'],saveSegmentToPushRecovery(_0x2f78c6[_0x537dc7(0x224)],_0x2f78c6[_0x537dc7(0x220)][_0x537dc7(0x1f7)],_0x4f1ede,{'segmentId':_0x51912f,'uniqueServerName':_0x27643c,'createdAt':new Date()[_0x537dc7(0x1dd)]()})):_0x51912f=await createOrRecoverEmbeddedSegment(_0x52f0ea,_0x2f78c6,{'localName':_0x4f1ede,'uniqueSegmentName':_0x27643c,'description':_0x65af49[_0x537dc7(0x206)]||_0x537dc7(0x229)+_0x4f1ede,'journeyId':_0x5c123e,'resolvedRule':_0x345180,'parentId':_0x9153fc[_0x537dc7(0x265)],'folderId':_0x9153fc[_0x537dc7(0x1ba)]||''},_0x5b835e),_0x2ecc08[_0x537dc7(0x1c1)][_0x537dc7(0x1b0)](_0x4f1ede,_0x51912f),_0xab0f[_0x537dc7(0x1b0)](_0x4f1ede,_0x51912f),_0x51912f;})());_0x4e3f0a['set'](_0x4f1ede,_0x34527b);try{return await _0x34527b;}finally{_0x4e3f0a[_0x2ff034(0x288)](_0x4f1ede);}},'resolveActivationId':async _0x5df39c=>{const _0x2d07a6=_0x14a7fd,_0x457581=_0x563840[_0x2d07a6(0x21c)](_0x5df39c);if(_0x457581)return _0x457581;if(_0x2f78c6['existingJourney']){await _0x50f2c7();const _0xb1be7e=_0x563840['get'](_0x5df39c);if(_0xb1be7e)return _0xb1be7e;}throw new SDKError(ErrorCode[_0x2d07a6(0x1b4)],'Activation\x20not\x20found:\x20'+_0x5df39c+_0x2d07a6(0x278)+_0x2f78c6[_0x2d07a6(0x220)][_0x2d07a6(0x1f7)]+').\x20'+_0x2d07a6(0x25d));},'resolveEmbeddedActivationId':async(_0xf96f37,_0x50d764)=>{const _0x578de2=_0x14a7fd,_0x57c185=_0x563840['get'](_0xf96f37);if(_0x57c185)return _0x57c185;if(_0x2f78c6['isNew'])return _0x384818[_0x578de2(0x1b0)](_0xf96f37,_0x50d764),createPendingActivationId(_0xf96f37);if(_0x2f78c6[_0x578de2(0x28c)]){await _0x50f2c7();const _0x2b7eeb=_0x563840['get'](_0x50d764[_0x578de2(0x1f7)]);if(_0x2b7eeb)return _0x563840['set'](_0xf96f37,_0x2b7eeb),_0x2b7eeb;const _0x311157=activationSignature(_0x50d764),_0x3aeb88=_0x329930?.[_0x578de2(0x21c)](_0x311157);if(_0x3aeb88)return _0x563840[_0x578de2(0x1b0)](_0xf96f37,_0x3aeb88),_0x3aeb88;const _0x12a61f=await _0xa0a734(_0x50d764,_0x2ecc08[_0x578de2(0x1d7)]),_0x7fa917={..._0x12a61f,..._0x50d764[_0x578de2(0x252)]!==undefined&&{'runAfterJourneyRefresh':_0x50d764[_0x578de2(0x252)]}},_0x3df50b=await _0x52f0ea[_0x578de2(0x262)][_0x578de2(0x1eb)](_0x2f78c6[_0x578de2(0x28c)]['id'],_0x7fa917);return _0x563840[_0x578de2(0x1b0)](_0xf96f37,_0x3df50b['id']),_0x3df50b['id'];}throw new SDKError(ErrorCode[_0x578de2(0x1b7)],_0x578de2(0x1d2));},'resolveJourneyId':async _0x5ba2fa=>{const _0x44f7fe=_0x14a7fd;try{return await _0x52f0ea['journey'][_0x44f7fe(0x1c7)](_0x9153fc[_0x44f7fe(0x265)],_0x5ba2fa);}catch(_0x3f7511){throw new SDKError(ErrorCode[_0x44f7fe(0x1b4)],_0x44f7fe(0x1f0)+_0x5ba2fa+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x2f78c6[_0x44f7fe(0x220)]['name']+'\x27)',_0x3f7511);}},'resolveStageId':async(_0x34faf1,_0x5b9652)=>{const _0x498ce8=_0x14a7fd,_0x48f787=await _0x52f0ea[_0x498ce8(0x262)][_0x498ce8(0x256)](_0x34faf1),_0x39f03b=_0x48f787[_0x498ce8(0x1d1)][_0x498ce8(0x26f)][_0x498ce8(0x1c8)](_0x3cf717=>_0x3cf717[_0x498ce8(0x1f7)]['toLowerCase']()===_0x5b9652[_0x498ce8(0x1c3)]());if(!_0x39f03b?.['id'])throw new SDKError(ErrorCode[_0x498ce8(0x1b4)],_0x498ce8(0x267)+_0x5b9652+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x48f787[_0x498ce8(0x1d1)]['journeyBundleName']||_0x48f787[_0x498ce8(0x1d1)][_0x498ce8(0x1f7)])+'\x27');return _0x39f03b['id'];}},_0xbc168f=await _0x145029(_0x2f78c6[_0x14a7fd(0x220)],_0x9153fc[_0x14a7fd(0x265)],_0x27b826),_0x1ae8df=_0x9153fc['folderId']||_0x9153fc[_0x14a7fd(0x1ba)];_0x1ae8df&&(_0xbc168f[_0x14a7fd(0x1aa)]={'parentFolder':{'data':{'id':_0x1ae8df,'type':_0x14a7fd(0x22a)}}});if(_0x2f78c6[_0x14a7fd(0x254)]){if(_0x5b00c7[_0x14a7fd(0x22e)]>0x0||_0x384818[_0x14a7fd(0x22e)]>0x0)return await executeThreeStepJourneyCreate(_0x52f0ea,_0x2f78c6,_0xbc168f,{'pendingEmbeddedSegments':_0x5b00c7,'pendingEmbeddedActivations':_0x384818,'embeddedSegmentNameToId':_0xab0f,'journeyActivationNameToId':_0x563840},{..._0x9153fc,'effectiveFolderId':_0x1ae8df},_0x2ecc08,_0x5e0763,_0x5bad6f);else{ensureJourneyDefaults(_0xbc168f['attributes']);const _0x9bb7f3=await _0x52f0ea[_0x14a7fd(0x262)][_0x14a7fd(0x249)](_0xbc168f);return deletePushRecovery(_0x2f78c6[_0x14a7fd(0x224)]),{'action':'created','journeyId':_0x9bb7f3['id'],'embeddedSegmentNameToId':_0xab0f};}}else{if(_0x2f78c6[_0x14a7fd(0x20c)]&&_0x2f78c6[_0x14a7fd(0x28c)]){_0xbc168f['id']=_0x2f78c6[_0x14a7fd(0x28c)]['id'];const _0x5d5f79=_0xbc168f[_0x14a7fd(0x1d1)];_0x2f78c6[_0x14a7fd(0x28c)]['attributes']?.['journeyBundleName']&&(_0x5d5f79[_0x14a7fd(0x279)]=_0x2f78c6[_0x14a7fd(0x28c)][_0x14a7fd(0x1d1)][_0x14a7fd(0x279)]);const _0x9a6cf8=_0x2f78c6['existingJourney'][_0x14a7fd(0x1d1)]?.['journeyStages'];return _0x9a6cf8&&_0xbc168f['attributes']['journeyStages']&&injectExistingStageIds(_0xbc168f[_0x14a7fd(0x1d1)][_0x14a7fd(0x26f)],_0x9a6cf8),ensureJourneyDefaults(_0x5d5f79),await _0x52f0ea['journey'][_0x14a7fd(0x1d9)](_0x2f78c6[_0x14a7fd(0x28c)]['id'],_0xbc168f),deletePushRecovery(_0x2f78c6['absolutePath']),{'action':_0x14a7fd(0x1e1),'journeyId':_0x2f78c6[_0x14a7fd(0x28c)]['id'],'embeddedSegmentNameToId':_0xab0f};}}return deletePushRecovery(_0x2f78c6[_0x14a7fd(0x224)]),{'action':'unchanged','journeyId':_0x2f78c6[_0x14a7fd(0x28c)]?.['id'],'embeddedSegmentNameToId':_0xab0f};}function findSegmentCriteriaLocation(_0x52defe,_0x1ae648){const _0x1b5caa=a152_0x525dc2,_0x9c8700=_0x52defe[_0x1b5caa(0x29f)]||_0x52defe[_0x1b5caa(0x23f)]?.[0x0]?.[_0x1b5caa(0x29f)]||[];let _0x4660b4='entry',_0x2767dd=_0x1ae648;const _0x312d49=_0x52defe[_0x1b5caa(0x24a)]||_0x52defe[_0x1b5caa(0x23f)]?.[0x0]?.[_0x1b5caa(0x24a)];if(_0x312d49?.[_0x1b5caa(0x283)]===_0x1ae648)return{'stageName':_0x1b5caa(0x24a),'criteriaName':_0x312d49[_0x1b5caa(0x1f7)]||_0x1ae648};_0xf365cb:for(const _0x2bad73 of _0x9c8700){if(_0x2bad73[_0x1b5caa(0x289)]?.[_0x1b5caa(0x283)]===_0x1ae648){_0x4660b4=_0x2bad73[_0x1b5caa(0x1f7)],_0x2767dd=_0x2bad73[_0x1b5caa(0x289)][_0x1b5caa(0x1f7)]||_0x1ae648;break;}if(_0x2bad73[_0x1b5caa(0x21d)])for(const _0x722568 of _0x2bad73[_0x1b5caa(0x21d)]){if(_0x722568[_0x1b5caa(0x2a5)]===_0x1b5caa(0x1e5)&&_0x722568['with']?.[_0x1b5caa(0x1ee)])for(const _0x37f8d6 of _0x722568[_0x1b5caa(0x28e)][_0x1b5caa(0x1ee)]){if(_0x37f8d6[_0x1b5caa(0x283)]===_0x1ae648){_0x4660b4=_0x2bad73['name'],_0x2767dd=_0x37f8d6[_0x1b5caa(0x1f7)]||_0x1ae648;break _0xf365cb;}}}}return{'stageName':_0x4660b4,'criteriaName':_0x2767dd};}async function executeThreeStepJourneyCreate(_0x488bd8,_0x36ae3d,_0x479a06,_0x442636,_0x5dfe11,_0x51c553,_0x5b3f77,_0x57befa){const _0x350667=a152_0x525dc2,{activationDefToCreateRequest:_0x4758e1,yamlRuleToApi:_0x16a94e}=_0x57befa,{pendingEmbeddedSegments:_0x265f8b,pendingEmbeddedActivations:_0x1ba4e7,embeddedSegmentNameToId:_0x38b99f}=_0x442636,_0x25166f=JSON[_0x350667(0x287)](JSON[_0x350667(0x1ce)](_0x479a06));ensureJourneyDefaults(_0x25166f[_0x350667(0x1d1)]),stripPendingIds(_0x25166f);const _0x17d74b=await _0x488bd8['journey'][_0x350667(0x249)](_0x25166f),_0x4d3b38=_0x17d74b['id'],_0x1d1921=new Map();for(const _0x5cebeb of _0x17d74b[_0x350667(0x1d1)][_0x350667(0x26f)]){_0x1d1921[_0x350667(0x1b0)](_0x5cebeb[_0x350667(0x1f7)]['toLowerCase'](),_0x5cebeb['id']);}recoverSegmentIdsFromPushRecovery(_0x36ae3d,_0x38b99f,_0x51c553[_0x350667(0x1c1)]);for(const [_0x26b12c,{definition:_0x8498a1}]of _0x265f8b){if(_0x38b99f['has'](_0x26b12c)){_0x5b3f77[_0x350667(0x1ae)]?.({'type':_0x350667(0x260),'journeyName':_0x36ae3d[_0x350667(0x220)][_0x350667(0x1f7)],'segmentName':_0x26b12c});continue;}const _0x472b6d=generateDeterministicJourneySegmentName(_0x36ae3d[_0x350667(0x220)][_0x350667(0x1f7)],_0x26b12c);_0x5b3f77[_0x350667(0x1ae)]?.({'type':_0x350667(0x2a4),'journeyName':_0x36ae3d['yamlConfig']['name'],'segmentName':_0x26b12c});const _0x26af08=createSegmentIdResolver(_0x51c553['segmentNameToId'],_0x26b12c),_0x416ba2=await resolveRuleSegmentIds(_0x8498a1[_0x350667(0x290)],_0x26af08),_0x383ada=await createOrRecoverEmbeddedSegment(_0x488bd8,_0x36ae3d,{'localName':_0x26b12c,'uniqueSegmentName':_0x472b6d,'description':_0x8498a1[_0x350667(0x206)]||_0x350667(0x229)+_0x26b12c,'journeyId':_0x4d3b38,'resolvedRule':_0x416ba2,'parentId':_0x5dfe11[_0x350667(0x265)],'folderId':_0x5dfe11[_0x350667(0x29d)]||''},_0x16a94e);_0x38b99f[_0x350667(0x1b0)](_0x26b12c,_0x383ada),_0x51c553['segmentNameToId'][_0x350667(0x1b0)](_0x26b12c,_0x383ada),_0x5b3f77[_0x350667(0x1ae)]?.({'type':_0x350667(0x260),'journeyName':_0x36ae3d[_0x350667(0x220)][_0x350667(0x1f7)],'segmentName':_0x26b12c});}const _0x2f52f1=new Map();for(const [_0x4b2990,_0x58d7fd]of _0x1ba4e7){_0x5b3f77['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x36ae3d['yamlConfig'][_0x350667(0x1f7)],'activationName':_0x4b2990});const _0x17c7e0=await _0x4758e1(_0x58d7fd,_0x51c553[_0x350667(0x1d7)]),_0x202eca={..._0x17c7e0,..._0x58d7fd[_0x350667(0x252)]!==undefined&&{'runAfterJourneyRefresh':_0x58d7fd[_0x350667(0x252)]}},_0x1df4f8=await _0x488bd8[_0x350667(0x262)][_0x350667(0x1eb)](_0x4d3b38,_0x202eca);_0x2f52f1['set'](_0x4b2990,_0x1df4f8['id']),_0x442636[_0x350667(0x28b)][_0x350667(0x1b0)](_0x4b2990,_0x1df4f8['id']),_0x5b3f77[_0x350667(0x1ae)]?.({'type':_0x350667(0x202),'journeyName':_0x36ae3d[_0x350667(0x220)][_0x350667(0x1f7)],'activationName':_0x4b2990});}const _0x3618d3=JSON[_0x350667(0x287)](JSON[_0x350667(0x1ce)](_0x479a06));return _0x3618d3['id']=_0x4d3b38,ensureJourneyDefaults(_0x3618d3[_0x350667(0x1d1)]),resolvePendingIdsInRequest(_0x3618d3,_0x479a06,_0x1d1921,_0x38b99f,_0x2f52f1,_0x5b3f77),await _0x488bd8[_0x350667(0x262)]['update'](_0x4d3b38,_0x3618d3),deletePushRecovery(_0x36ae3d['absolutePath']),{'action':_0x350667(0x1d0),'journeyId':_0x4d3b38,'embeddedSegmentNameToId':_0x38b99f};}export function stripWaitStepPendingIds(_0x303917){const _0x3bcc9e=a152_0x525dc2,_0x4b05f0=_0x303917[_0x3bcc9e(0x212)]&&isPendingSegmentId(_0x303917[_0x3bcc9e(0x212)]),_0x370ee1=_0x303917[_0x3bcc9e(0x227)]?.[_0x3bcc9e(0x272)](_0x25dea4=>_0x25dea4[_0x3bcc9e(0x23c)]&&isPendingSegmentId(_0x25dea4[_0x3bcc9e(0x23c)]));(_0x4b05f0||_0x370ee1)&&(_0x303917['waitStepType']=_0x3bcc9e(0x207),_0x303917[_0x3bcc9e(0x1fa)]=0x1,_0x303917[_0x3bcc9e(0x29b)]=_0x3bcc9e(0x276),delete _0x303917[_0x3bcc9e(0x212)],delete _0x303917['conditionTimeoutDuration'],delete _0x303917[_0x3bcc9e(0x1bf)],delete _0x303917[_0x3bcc9e(0x227)]);}export function resolveWaitStepPendingIds(_0x56eb51,_0x25e24c,_0x3d4cdb,_0x254faa){const _0x5cf525=a152_0x525dc2;if(_0x25e24c[_0x5cf525(0x212)]&&isPendingSegmentId(_0x25e24c['conditionSegmentId'])){const _0x45b9cb=_0x3d4cdb(_0x25e24c[_0x5cf525(0x212)],_0x5cf525(0x231)+_0x254faa+_0x5cf525(0x21f));_0x45b9cb&&(_0x56eb51[_0x5cf525(0x235)]=_0x5cf525(0x1ca),_0x56eb51[_0x5cf525(0x212)]=_0x45b9cb,delete _0x56eb51['waitStep'],delete _0x56eb51[_0x5cf525(0x29b)],_0x25e24c[_0x5cf525(0x29c)]!==undefined&&(_0x56eb51[_0x5cf525(0x29c)]=_0x25e24c[_0x5cf525(0x29c)]),_0x25e24c[_0x5cf525(0x1bf)]&&(_0x56eb51[_0x5cf525(0x1bf)]=_0x25e24c[_0x5cf525(0x1bf)]));}if(_0x25e24c[_0x5cf525(0x227)]){const _0x31e755=_0x25e24c['conditions'][_0x5cf525(0x272)](_0x2d7983=>_0x2d7983[_0x5cf525(0x23c)]&&isPendingSegmentId(_0x2d7983[_0x5cf525(0x23c)]));if(_0x31e755){const _0x3acd24=_0x25e24c[_0x5cf525(0x227)][_0x5cf525(0x237)](_0xd39841=>{const _0x4832d8=_0x5cf525;if(_0xd39841['segmentId']&&isPendingSegmentId(_0xd39841[_0x4832d8(0x23c)])){const _0x2b59b1=_0x3d4cdb(_0xd39841[_0x4832d8(0x23c)],_0x4832d8(0x231)+_0x254faa+_0x4832d8(0x21f));return{..._0xd39841,'segmentId':_0x2b59b1||_0xd39841[_0x4832d8(0x23c)]};}return{..._0xd39841};});_0x56eb51['waitStepType']=_0x5cf525(0x1ca),_0x56eb51[_0x5cf525(0x227)]=_0x3acd24,delete _0x56eb51['waitStep'],delete _0x56eb51[_0x5cf525(0x29b)],delete _0x56eb51[_0x5cf525(0x212)],delete _0x56eb51['conditionTimeoutDuration'],delete _0x56eb51['conditionTimeoutUnit'];}}}function stripPendingIds(_0x1b250c){const _0x15e443=a152_0x525dc2;_0x1b250c[_0x15e443(0x1d1)]['goal']?.[_0x15e443(0x23c)]&&isPendingSegmentId(_0x1b250c['attributes'][_0x15e443(0x24a)][_0x15e443(0x23c)])&&delete _0x1b250c[_0x15e443(0x1d1)]['goal'];for(const _0x4e6e5b of _0x1b250c[_0x15e443(0x1d1)][_0x15e443(0x26f)]||[]){_0x4e6e5b[_0x15e443(0x1c0)]?.[_0x15e443(0x23c)]&&isPendingSegmentId(_0x4e6e5b[_0x15e443(0x1c0)][_0x15e443(0x23c)])&&delete _0x4e6e5b[_0x15e443(0x1c0)];_0x4e6e5b[_0x15e443(0x284)]?.['segmentId']&&isPendingSegmentId(_0x4e6e5b[_0x15e443(0x284)][_0x15e443(0x23c)])&&delete _0x4e6e5b[_0x15e443(0x284)];_0x4e6e5b['exitCriterias']&&(_0x4e6e5b[_0x15e443(0x22c)]=_0x4e6e5b[_0x15e443(0x22c)]['filter'](_0x229828=>!_0x229828[_0x15e443(0x23c)]||!isPendingSegmentId(_0x229828[_0x15e443(0x23c)])));if(_0x4e6e5b[_0x15e443(0x21d)])for(const _0x549d9c of Object[_0x15e443(0x255)](_0x4e6e5b[_0x15e443(0x21d)])){const _0xf1c145=_0x4e6e5b['steps'][_0x549d9c];_0xf1c145['type']===_0x15e443(0x250)&&_0xf1c145[_0x15e443(0x213)]&&isPendingActivationId(_0xf1c145[_0x15e443(0x213)])&&(_0xf1c145[_0x15e443(0x213)]='');if(_0xf1c145['type']===_0x15e443(0x25a)&&_0xf1c145[_0x15e443(0x1ee)])for(const _0x1a1f88 of _0xf1c145[_0x15e443(0x1ee)]){_0x1a1f88[_0x15e443(0x23c)]&&isPendingSegmentId(_0x1a1f88['segmentId'])&&(_0x1a1f88['segmentId']='');}_0xf1c145[_0x15e443(0x2a5)]===_0x15e443(0x26a)&&stripWaitStepPendingIds(_0xf1c145);}}}function resolvePendingIdsInRequest(_0x4e8050,_0x3b8ba8,_0x309fae,_0x1fe980,_0x50cf3d,_0x5695c8){const _0x55becb=a152_0x525dc2,_0x2a7c5c=(_0x67fb78,_0x360222)=>{const _0x3247b6=a152_0x4bae;if(!isPendingSegmentId(_0x67fb78))return _0x67fb78;const _0xe442e7=extractPendingSegmentName(_0x67fb78),_0x16da8d=_0x1fe980[_0x3247b6(0x21c)](_0xe442e7);return!_0x16da8d&&_0x5695c8[_0x3247b6(0x1b5)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0xe442e7+_0x3247b6(0x223)+_0x360222),_0x16da8d;};if(_0x4e8050[_0x55becb(0x1d1)][_0x55becb(0x24a)]?.[_0x55becb(0x23c)]&&isPendingSegmentId(_0x4e8050['attributes']['goal'][_0x55becb(0x23c)])){const _0x33dc15=_0x2a7c5c(_0x4e8050['attributes'][_0x55becb(0x24a)]['segmentId'],_0x55becb(0x26e));_0x33dc15&&(_0x4e8050['attributes'][_0x55becb(0x24a)]['segmentId']=_0x33dc15);}for(const _0x445a03 of _0x4e8050[_0x55becb(0x1d1)][_0x55becb(0x26f)]||[]){const _0x296573=_0x309fae[_0x55becb(0x21c)](_0x445a03[_0x55becb(0x1f7)][_0x55becb(0x1c3)]());_0x296573&&(_0x445a03['id']=_0x296573);if(_0x445a03[_0x55becb(0x1c0)]?.['segmentId']&&isPendingSegmentId(_0x445a03['entryCriteria'][_0x55becb(0x23c)])){const _0x14cfcc=_0x2a7c5c(_0x445a03[_0x55becb(0x1c0)][_0x55becb(0x23c)],_0x55becb(0x231)+_0x445a03[_0x55becb(0x1f7)]+'\x27\x20entry\x20criteria');_0x14cfcc&&(_0x445a03['entryCriteria'][_0x55becb(0x23c)]=_0x14cfcc);}if(_0x445a03[_0x55becb(0x22c)])for(const _0xf1709e of _0x445a03[_0x55becb(0x22c)]){if(_0xf1709e[_0x55becb(0x23c)]&&isPendingSegmentId(_0xf1709e[_0x55becb(0x23c)])){const _0x23ec67=_0x2a7c5c(_0xf1709e[_0x55becb(0x23c)],_0x55becb(0x231)+_0x445a03[_0x55becb(0x1f7)]+_0x55becb(0x1fb));_0x23ec67&&(_0xf1709e[_0x55becb(0x23c)]=_0x23ec67);}}if(_0x445a03['milestone']?.['segmentId']&&isPendingSegmentId(_0x445a03[_0x55becb(0x284)][_0x55becb(0x23c)])){const _0x242c9d=_0x2a7c5c(_0x445a03[_0x55becb(0x284)][_0x55becb(0x23c)],_0x55becb(0x231)+_0x445a03[_0x55becb(0x1f7)]+'\x27\x20milestone');_0x242c9d&&(_0x445a03[_0x55becb(0x284)]['segmentId']=_0x242c9d);}if(_0x445a03[_0x55becb(0x21d)]){const _0x493f41=_0x43d67f=>_0x3b8ba8[_0x55becb(0x1d1)][_0x55becb(0x26f)]?.['find'](_0x530d76=>_0x530d76[_0x55becb(0x1f7)]['toLowerCase']()===_0x445a03[_0x55becb(0x1f7)]['toLowerCase']())?.[_0x55becb(0x21d)]?.[_0x43d67f];for(const _0xfcc8ab of Object[_0x55becb(0x255)](_0x445a03[_0x55becb(0x21d)])){const _0x19a375=_0x445a03[_0x55becb(0x21d)][_0xfcc8ab],_0x40499e=_0x493f41(_0xfcc8ab);if(_0x19a375[_0x55becb(0x2a5)]==='Activation'&&_0x19a375[_0x55becb(0x213)]&&(isPendingActivationId(_0x19a375['journeyActivationStepId'])||_0x19a375[_0x55becb(0x213)]==='')){if(_0x40499e?.[_0x55becb(0x213)]&&isPendingActivationId(_0x40499e['journeyActivationStepId'])){const _0x2b25e4=extractPendingActivationName(_0x40499e[_0x55becb(0x213)]),_0x1a6c2c=_0x50cf3d[_0x55becb(0x21c)](_0x2b25e4);_0x1a6c2c&&(_0x19a375[_0x55becb(0x213)]=_0x1a6c2c);}}if(_0x19a375[_0x55becb(0x2a5)]==='DecisionPoint'&&_0x19a375[_0x55becb(0x1ee)]&&_0x40499e?.[_0x55becb(0x1ee)])for(let _0xef446=0x0;_0xef446<_0x19a375[_0x55becb(0x1ee)]['length'];_0xef446++){const _0x18ffd9=_0x19a375['branches'][_0xef446],_0x5e71c2=_0x40499e[_0x55becb(0x1ee)][_0xef446];if(_0x5e71c2?.[_0x55becb(0x23c)]&&isPendingSegmentId(_0x5e71c2[_0x55becb(0x23c)])){const _0x261a54=_0x2a7c5c(_0x5e71c2[_0x55becb(0x23c)],_0x55becb(0x231)+_0x445a03[_0x55becb(0x1f7)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x18ffd9[_0x55becb(0x1f7)]||_0xef446)+'\x27');_0x261a54&&(_0x18ffd9['segmentId']=_0x261a54);}}_0x19a375['type']===_0x55becb(0x26a)&&_0x40499e?.['type']===_0x55becb(0x26a)&&resolveWaitStepPendingIds(_0x19a375,_0x40499e,_0x2a7c5c,_0x445a03[_0x55becb(0x1f7)]);}}}}
1
+ const a152_0xdbe0a=a152_0x3e4e;(function(_0x501ff3,_0x401c3c){const _0x3ae729=a152_0x3e4e,_0x1d98a2=_0x501ff3();while(!![]){try{const _0x4e3827=-parseInt(_0x3ae729(0x1ca))/0x1*(parseInt(_0x3ae729(0x193))/0x2)+-parseInt(_0x3ae729(0x135))/0x3+parseInt(_0x3ae729(0x175))/0x4*(parseInt(_0x3ae729(0x139))/0x5)+parseInt(_0x3ae729(0xff))/0x6*(-parseInt(_0x3ae729(0xf9))/0x7)+-parseInt(_0x3ae729(0xe6))/0x8*(-parseInt(_0x3ae729(0x132))/0x9)+-parseInt(_0x3ae729(0x143))/0xa+-parseInt(_0x3ae729(0x165))/0xb*(-parseInt(_0x3ae729(0xc5))/0xc);if(_0x4e3827===_0x401c3c)break;else _0x1d98a2['push'](_0x1d98a2['shift']());}catch(_0xb9739d){_0x1d98a2['push'](_0x1d98a2['shift']());}}}(a152_0x46f4,0x36eb6));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a152_0xdbe0a(0x11f);export const PENDING_ACTIVATION_PREFIX=a152_0xdbe0a(0x19a);export function createPendingSegmentId(_0x4e856d){return''+PENDING_SEGMENT_PREFIX+_0x4e856d+'__';}export function isPendingSegmentId(_0x24e790){const _0x1ae61b=a152_0xdbe0a;return _0x24e790[_0x1ae61b(0x1cd)](PENDING_SEGMENT_PREFIX)&&!_0x24e790[_0x1ae61b(0x1cd)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4da99e){const _0x40d261=a152_0xdbe0a;return _0x4da99e[_0x40d261(0x191)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x102c29){return''+PENDING_ACTIVATION_PREFIX+_0x102c29+'__';}export function isPendingActivationId(_0x185f67){return _0x185f67['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x57dead){const _0x2e90f0=a152_0xdbe0a;return _0x57dead[_0x2e90f0(0x191)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5e6473,_0x22fac1){const _0x348c49=a152_0xdbe0a,_0x1d32e5=_0x5e6473+'::'+(_0x22fac1[_0x348c49(0x14e)]()||_0x348c49(0x1c4)),_0x2c1cd5=createHash(_0x348c49(0x15b))[_0x348c49(0x172)](_0x1d32e5)['digest'](_0x348c49(0x150))[_0x348c49(0xe7)](0x0,0xc);return _0x348c49(0x166)+_0x2c1cd5;}export function ensureJourneyDefaults(_0x387147){const _0x27f1a8=a152_0xdbe0a;!_0x387147[_0x27f1a8(0x1cb)]&&(_0x387147[_0x27f1a8(0x1cb)]=''),!_0x387147[_0x27f1a8(0x130)]&&(_0x387147['state']=_0x27f1a8(0x186));}export function injectExistingStageIds(_0x166727,_0x251d45){const _0x3c4f19=a152_0xdbe0a,_0xe3281c=new Map(_0x251d45[_0x3c4f19(0x114)](_0x3a94ba=>[_0x3a94ba[_0x3c4f19(0x10d)],_0x3a94ba['id']]));for(const _0x52a77e of _0x166727){if(!_0x52a77e['id']){const _0x186275=_0xe3281c[_0x3c4f19(0x14b)](_0x52a77e['name']);_0x186275&&(_0x52a77e['id']=_0x186275);}}}export function resolveTDFolderPath(_0x34e965,_0x2e5a1a,_0x59f435){if(!_0x2e5a1a)return _0x34e965;if(_0x34e965===_0x59f435||_0x34e965['startsWith'](_0x59f435+'/'))return _0x34e965;return _0x34e965?_0x59f435+'/'+_0x34e965:_0x59f435;}export function addFoldersToCreate(_0x5d1dc,_0x318186,_0x1648c2){const _0x3933a6=a152_0xdbe0a;if(!_0x5d1dc)return;if(_0x318186[_0x3933a6(0x1a3)](_0x5d1dc))return;const _0x58d441=_0x5d1dc['split']('/');let _0x36cc0f='';for(const _0x5be148 of _0x58d441){_0x36cc0f=_0x36cc0f?_0x36cc0f+'/'+_0x5be148:_0x5be148,!_0x318186[_0x3933a6(0x1a3)](_0x36cc0f)&&_0x1648c2['add'](_0x36cc0f);}}export function sortFoldersByDepth(_0x10ae1c){return[..._0x10ae1c]['sort']((_0x4db3ef,_0x3090e)=>{const _0x1ace80=a152_0x3e4e,_0x2be06e=(_0x4db3ef[_0x1ace80(0xda)](/\//g)||[])[_0x1ace80(0x10e)],_0x34988d=(_0x3090e[_0x1ace80(0xda)](/\//g)||[])[_0x1ace80(0x10e)];return _0x2be06e-_0x34988d;});}import*as a152_0x14c7b5 from'yaml';import{readFileSync}from'fs';import a152_0x543d0d from'path';import{isJourneyDef,parseYamlString as a152_0x590d85,toYamlString as a152_0x57a5e6,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(_0x32c874){const _0x5717d3=a152_0xdbe0a;if(Array[_0x5717d3(0xf3)](_0x32c874))return'['+_0x32c874[_0x5717d3(0x114)](_0x24b3f7=>stableStringify(_0x24b3f7))[_0x5717d3(0x13d)](',')+']';if(_0x32c874&&typeof _0x32c874===_0x5717d3(0x18f)){const _0x151b18=_0x32c874,_0x4db7a0=Object[_0x5717d3(0x148)](_0x151b18)[_0x5717d3(0x163)](),_0x370d47=_0x4db7a0[_0x5717d3(0x114)](_0x219bcb=>'\x22'+_0x219bcb+'\x22:'+stableStringify(_0x151b18[_0x219bcb]));return'{'+_0x370d47[_0x5717d3(0x13d)](',')+'}';}const _0x3cede3=JSON[_0x5717d3(0x10f)](_0x32c874);return _0x3cede3===undefined?'null':_0x3cede3;}function activationSignature(_0x5b1e77){const _0x103134=a152_0xdbe0a,_0x1c6675={'connection':_0x5b1e77['connection'],..._0x5b1e77[_0x103134(0x185)]!==undefined&&{'all_columns':_0x5b1e77[_0x103134(0x185)]},..._0x5b1e77[_0x103134(0x121)]!==undefined&&{'columns':_0x5b1e77[_0x103134(0x121)]},..._0x5b1e77[_0x103134(0xf8)]!==undefined&&{'behavior':_0x5b1e77[_0x103134(0xf8)]},..._0x5b1e77[_0x103134(0x131)]!==undefined&&{'schedule':_0x5b1e77[_0x103134(0x131)]},..._0x5b1e77[_0x103134(0x1b1)]!==undefined&&{'notification':_0x5b1e77['notification']},..._0x5b1e77[_0x103134(0x126)]!==undefined&&{'connector_config':_0x5b1e77[_0x103134(0x126)]},..._0x5b1e77[_0x103134(0xee)]!==undefined&&{'activation_template_id':_0x5b1e77[_0x103134(0xee)]}};return stableStringify(_0x1c6675);}async function fetchSegment(_0x51d9f0,_0x1cabe0,_0xcfa708,_0x42194d){const _0x459531=a152_0xdbe0a,_0x51e40e=_0x42194d?.[_0x459531(0x1a1)](_0x528cfb=>_0x528cfb['id']===_0xcfa708);if(_0x51e40e)return _0x51e40e;try{return await _0x51d9f0[_0x459531(0x1c4)][_0x459531(0xe9)](_0x1cabe0,_0xcfa708);}catch(_0x2251a2){logger['debug'](_0x459531(0x136)+_0xcfa708+_0x459531(0xe8)+_0x2251a2);try{return await _0x51d9f0[_0x459531(0x1c4)][_0x459531(0x1c3)](_0xcfa708);}catch(_0x595350){return logger[_0x459531(0xc8)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0xcfa708+':\x20'+_0x595350),null;}}}function recoverSegmentIdsFromPushRecovery(_0x4eb114,_0xc1610c,_0x5825f9){const _0x365438=a152_0xdbe0a,_0xced2e1=readPushRecovery(_0x4eb114[_0x365438(0xfa)]);if(_0xced2e1?.[_0x365438(0x161)]===_0x4eb114[_0x365438(0x147)][_0x365438(0x10d)])for(const [_0x3f3f1e,_0x25dc4e]of Object[_0x365438(0x188)](_0xced2e1['segments'])){const _0x487c6a=generateDeterministicJourneySegmentName(_0x4eb114[_0x365438(0x147)][_0x365438(0x10d)],_0x3f3f1e);_0x25dc4e[_0x365438(0x145)]===_0x487c6a&&(_0xc1610c['set'](_0x3f3f1e,_0x25dc4e[_0x365438(0xe5)]),_0x5825f9['set'](_0x3f3f1e,_0x25dc4e['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x3b15b2,_0x4740ba,_0x32c8bb,_0x24f5e7){const _0x425245=a152_0xdbe0a;let _0x316fde;try{_0x316fde=await _0x3b15b2['segment'][_0x425245(0x108)]({'name':_0x32c8bb[_0x425245(0x1c7)],'description':_0x32c8bb[_0x425245(0x1cb)],'journeyId':_0x32c8bb[_0x425245(0x1c0)],'rule':_0x24f5e7(_0x32c8bb[_0x425245(0x16c)],!![]),'countPopulation':!![],'parentFolderId':_0x32c8bb[_0x425245(0x14a)],'audienceId':_0x32c8bb[_0x425245(0x129)]});}catch(_0x3757db){const _0x46a73e=_0x3757db instanceof Error&&_0x3757db[_0x425245(0x11e)][_0x425245(0xd2)](_0x425245(0x1b9));if(_0x46a73e){const _0x2abb46=readPushRecovery(_0x4740ba['absolutePath']),_0x164e17=_0x2abb46?.[_0x425245(0x161)]===_0x4740ba[_0x425245(0x147)]['name']?_0x2abb46['segments'][_0x32c8bb['localName']]:undefined;if(_0x164e17?.[_0x425245(0x145)]===_0x32c8bb[_0x425245(0x1c7)])await _0x3b15b2[_0x425245(0x1c4)][_0x425245(0x128)](_0x32c8bb[_0x425245(0x129)],_0x164e17['segmentId'],{'description':_0x32c8bb[_0x425245(0x1cb)],'rule':_0x24f5e7(_0x32c8bb[_0x425245(0x16c)],!![]),'countPopulation':!![]}),_0x316fde=_0x164e17[_0x425245(0xe5)];else throw new SDKError(ErrorCode[_0x425245(0x169)],'Embedded\x20segment\x20\x27'+_0x32c8bb['localName']+_0x425245(0x153)+(_0x425245(0x178)+_0x4740ba[_0x425245(0xfa)][_0x425245(0x191)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x3757db);}else throw _0x3757db;}return saveSegmentToPushRecovery(_0x4740ba['absolutePath'],_0x4740ba[_0x425245(0x147)][_0x425245(0x10d)],_0x32c8bb[_0x425245(0xd0)],{'segmentId':_0x316fde,'uniqueServerName':_0x32c8bb[_0x425245(0x1c7)],'createdAt':new Date()[_0x425245(0x106)]()}),_0x316fde;}export async function prepareSegmentFiles(_0x1a0b96,_0x4a4955,_0x1047a9,_0x2187e1,_0x5b359c){const _0x2f9461=a152_0xdbe0a,{activationDefToCreateRequest:_0x3099af}=await import(_0x2f9461(0xc7)),_0x53e6b0=[],_0x4e434c=new Set();for(const {yamlConfig:_0x496de7,folderPath:_0x10e8af,sourcePath:_0x3b338a}of _0x1a0b96){const _0x50bf75=resolveTDFolderPath(_0x10e8af,_0x2187e1,_0x5b359c),_0x43f170=_0x50bf75+':'+_0x496de7[_0x2f9461(0x10d)],_0x991666=_0x4a4955[_0x2f9461(0x1b4)][_0x2f9461(0x14b)](_0x43f170),_0x577d31=_0x991666?_0x4a4955['activationsBySegmentId'][_0x2f9461(0x14b)](_0x991666['id'])||[]:[];addFoldersToCreate(_0x50bf75,_0x4a4955['folderPathToId'],_0x4e434c);const _0x200fce=calculateActivationActions(_0x496de7[_0x2f9461(0x1ac)]||[],_0x577d31,_0x4a4955[_0x2f9461(0xf4)],_0x4a4955[_0x2f9461(0x1c5)]);for(const _0x460888 of _0x200fce){(_0x460888[_0x2f9461(0x146)]===_0x2f9461(0x182)||_0x460888[_0x2f9461(0x146)]===_0x2f9461(0x172))&&_0x460888[_0x2f9461(0x177)]&&(_0x460888[_0x2f9461(0xdf)]=await _0x3099af(_0x460888[_0x2f9461(0x177)],_0x1047a9));}const _0x2e1a62=calculateSegmentDiff(_0x496de7,_0x991666,_0x577d31,_0x4a4955[_0x2f9461(0xf4)],_0x4a4955['connectionIdToNameMap']);_0x53e6b0[_0x2f9461(0x1bc)]({'relativePath':_0x496de7[_0x2f9461(0x10d)],'absolutePath':_0x3b338a,'yamlConfig':_0x496de7,'folderPath':_0x50bf75,'existingSegment':_0x991666,'existingActivations':_0x577d31,'isNew':_0x2e1a62[_0x2f9461(0x190)],'hasChanges':_0x2e1a62[_0x2f9461(0x157)],'diff':_0x2e1a62[_0x2f9461(0xd1)],'activationActions':_0x200fce});}return{'segmentFiles':_0x53e6b0,'foldersToCreate':_0x4e434c};}export async function prepareJourneyFiles(_0xd749c8,_0xdd6429,_0x125113,_0xca4489){const _0x368b59=a152_0xdbe0a,_0x36e795=[],_0x441b1=new Set();for(const {yamlConfig:_0x5570d3,folderPath:_0x2a3a63,sourcePath:_0x3da22a}of _0xd749c8){const _0x9280a=resolveTDFolderPath(_0x2a3a63,_0x125113,_0xca4489),_0x8a20d0=_0x9280a+':'+_0x5570d3[_0x368b59(0x10d)],_0x507e86=_0xdd6429[_0x368b59(0x124)][_0x368b59(0x14b)](_0x8a20d0);let _0x24635c,_0x3dcf61;if(_0x507e86&&_0x507e86[_0x368b59(0x10e)]>0x0){const _0x388724=buildLocalExpandedRuleMappings(_0x5570d3),{createYamlContext:_0x162523,prefetchJourneySegments:_0x518121}=createPushYamlContextForBundle(_0xdd6429[_0x368b59(0x1a5)],_0xdd6429[_0x368b59(0x129)],_0xdd6429['existingSegments'],_0x388724,_0xdd6429['idToEmailMap'],_0xdd6429['connectionIdToNameMap'],_0xdd6429['activationStepsById'],_0xdd6429[_0x368b59(0xd4)]);await _0x518121(_0x507e86['map'](_0x3de66a=>_0x3de66a['id']));const _0x1db438=await _0xdd6429[_0x368b59(0x1a5)][_0x368b59(0xf0)][_0x368b59(0xd7)](_0x507e86[0x0][_0x368b59(0x11b)]),_0x1836fb=hasMultipleVersions(_0x5570d3),_0xeed6a1=async _0x2571c0=>{const _0x1ffb01=_0x368b59,_0x43fca5=_0xdd6429[_0x1ffb01(0xd4)]?.[_0x1ffb01(0x14b)](_0x2571c0);if(_0x43fca5)return _0x43fca5;return _0xdd6429[_0x1ffb01(0x1c2)]({'journeyId':_0x2571c0,'journeyName':_0x5570d3['name'],'isMultiVersion':_0x507e86[_0x1ffb01(0x10e)]>0x1});};if(_0x1836fb&&_0x507e86[_0x368b59(0x10e)]>0x1){const _0x37c022=[];for(const _0x37c5ca of _0x507e86){const _0x271829=_0x37c5ca[_0x368b59(0xe3)]||0x1;_0xdd6429[_0x368b59(0x17b)]?.[_0x368b59(0x172)](_0x368b59(0x19d)+_0x5570d3[_0x368b59(0x10d)]+'\x20v'+_0x271829);const _0x58db7d=await _0xeed6a1(_0x37c5ca['id']),_0xb38da7=_0x162523(_0x37c5ca['id']),_0x490717=await journeyResponseToDef(_0x58db7d,_0xb38da7);_0x37c022[_0x368b59(0x1bc)]({'item':_0x37c5ca,'yaml':_0x490717});}const _0x36e092=buildLocalRuleToNameMappingFromJourney(_0x5570d3);_0x3dcf61=buildMergedJourneyDef(_0x37c022,_0x36e092,_0x1db438);const _0xfb7c24=Math['max'](..._0x37c022[_0x368b59(0x114)](_0xf0dc99=>_0xf0dc99[_0x368b59(0x13f)]['versionNumber']||0x0)),_0x4ca7d3=_0x507e86[_0x368b59(0x1a1)](_0x136f55=>(_0x136f55[_0x368b59(0xe3)]||0x0)===_0xfb7c24);_0x4ca7d3&&(_0xdd6429[_0x368b59(0x17b)]?.[_0x368b59(0x172)](_0x368b59(0x19d)+_0x5570d3[_0x368b59(0x10d)]+'\x20v'+_0xfb7c24),_0x24635c=await _0xeed6a1(_0x4ca7d3['id']));}else{const _0x294fef=_0x507e86[_0x507e86['length']-0x1];_0xdd6429['progress']?.['update'](_0x368b59(0x19d)+_0x5570d3['name']),_0x24635c=await _0xeed6a1(_0x294fef['id']);const _0x3418a5=_0x162523(_0x294fef['id']),_0x49a0f4=await journeyResponseToDef(_0x24635c,_0x3418a5),_0x106c53=buildLocalRuleToNameMappingFromJourney(_0x5570d3);_0x3dcf61=buildMergedJourneyDef([{'item':_0x294fef,'yaml':_0x49a0f4}],_0x106c53,_0x1db438);}}addFoldersToCreate(_0x9280a,_0xdd6429[_0x368b59(0x102)],_0x441b1);const _0x2c634d=calculateJourneyDiff(_0x5570d3,_0x3dcf61);_0x36e795[_0x368b59(0x1bc)]({'relativePath':_0x5570d3[_0x368b59(0x10d)],'absolutePath':_0x3da22a,'yamlConfig':_0x5570d3,'folderPath':_0x9280a,'existingJourney':_0x24635c,'isNew':_0x2c634d[_0x368b59(0x190)],'hasChanges':_0x2c634d[_0x368b59(0x157)],'diff':_0x2c634d[_0x368b59(0xd1)]});}return{'journeyFiles':_0x36e795,'foldersToCreate':_0x441b1};}export function calculateActivationActions(_0x7616ef,_0xcfb78e,_0x1b7270,_0x3fdcbe){const _0x54c02b=a152_0xdbe0a,_0x2f4fdf=[],_0x518ed0=new Map();for(const _0x3af808 of _0xcfb78e){_0x518ed0[_0x54c02b(0xca)](_0x3af808['name'],_0x3af808);}const _0x3dbf7f=new Map();for(const _0x1fce47 of _0x7616ef){_0x3dbf7f[_0x54c02b(0xca)](_0x1fce47[_0x54c02b(0x10d)],_0x1fce47);}for(const _0x3647f9 of _0x7616ef){const _0x401167=_0x518ed0[_0x54c02b(0x14b)](_0x3647f9[_0x54c02b(0x10d)]);if(!_0x401167)_0x2f4fdf['push']({'type':_0x54c02b(0x182),'name':_0x3647f9[_0x54c02b(0x10d)],'yamlActivation':_0x3647f9});else{const _0x272ace=activationResponseToDef(_0x401167,_0x1b7270,_0x3fdcbe),_0x3f3013=a152_0x14c7b5[_0x54c02b(0x10f)](_0x272ace),_0x260723=a152_0x14c7b5[_0x54c02b(0x10f)](_0x3647f9);_0x3f3013!==_0x260723&&_0x2f4fdf['push']({'type':_0x54c02b(0x172),'name':_0x3647f9[_0x54c02b(0x10d)],'yamlActivation':_0x3647f9,'existingActivation':_0x401167});}}for(const _0x30d138 of _0xcfb78e){!_0x3dbf7f[_0x54c02b(0x1a3)](_0x30d138[_0x54c02b(0x10d)])&&_0x2f4fdf[_0x54c02b(0x1bc)]({'type':'delete','name':_0x30d138[_0x54c02b(0x10d)],'existingActivation':_0x30d138});}return _0x2f4fdf;}function calculateYamlDiff(_0x5b6af0,_0x56dde2){if(_0x56dde2){const _0x31e9bd=generateDiff(_0x56dde2,_0x5b6af0),_0x5ed653=hasChanges(_0x31e9bd);return{'isNew':![],'hasChanges':_0x5ed653,'diff':_0x5ed653?formatDiffWithColors(_0x31e9bd):undefined};}const _0xc9b85e=generateDiff('',_0x5b6af0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xc9b85e)};}export function calculateSegmentDiff(_0x43fec8,_0x135496,_0x549ad1,_0x3d3027,_0x23c0f3){const _0x1680ee=segmentToYamlString(_0x43fec8),_0x20f496=_0x135496?segmentToYamlString(segmentWithActivationsToYaml(_0x135496,_0x549ad1,undefined,_0x3d3027,_0x23c0f3)):undefined;return calculateYamlDiff(_0x1680ee,_0x20f496);}export function calculateJourneyDiff(_0xbf0822,_0x2ac9e9){const _0x17de0f=normalizeJourneyDef(_0xbf0822,_0xbf0822),_0x4d376d=a152_0x57a5e6(_0x17de0f),_0x561d87=_0x2ac9e9?a152_0x57a5e6(normalizeJourneyDef(_0x2ac9e9,_0xbf0822)):undefined;return calculateYamlDiff(_0x4d376d,_0x561d87);}export function findSegmentsToDelete(_0x2ed7d7,_0x363685,_0x28f314,_0x41d7d4,_0x46d3c2){const _0x1672a7=a152_0xdbe0a,_0x131914=new Set();for(const {yamlConfig:_0x2a97ae,folderPath:_0x5ed10d}of _0x363685){_0x131914[_0x1672a7(0x168)](_0x5ed10d+':'+_0x2a97ae[_0x1672a7(0x10d)]);}return _0x2ed7d7[_0x1672a7(0xf2)](_0x34b6f4=>{const _0x2b53d3=_0x1672a7,_0x5ca7c6=_0x34b6f4[_0x2b53d3(0xf7)]?_0x28f314[_0x2b53d3(0x14b)](_0x34b6f4['segmentFolderId'][_0x2b53d3(0x1a9)]())||'':'',_0x4c47b7=_0x5ca7c6+':'+_0x34b6f4[_0x2b53d3(0x10d)];if(_0x131914['has'](_0x4c47b7))return![];if(_0x46d3c2)return _0x5ca7c6===_0x41d7d4||_0x5ca7c6[_0x2b53d3(0x1cd)](_0x41d7d4+'/');return!![];});}export function findJourneysToDelete(_0x4dd4bd,_0x487fb2,_0x1533d6,_0x2f13bb,_0x4e7dd7){const _0x6f0ffb=a152_0xdbe0a,_0x9c2011=new Set();for(const {yamlConfig:_0x58606c,folderPath:_0x458d53}of _0x487fb2){_0x9c2011[_0x6f0ffb(0x168)](_0x458d53+':'+_0x58606c[_0x6f0ffb(0x10d)]);}return _0x4dd4bd[_0x6f0ffb(0xf2)](_0x587cb3=>{const _0x23d6f6=_0x6f0ffb,_0x10e192=_0x587cb3[_0x23d6f6(0x14a)]?_0x1533d6[_0x23d6f6(0x14b)](_0x587cb3[_0x23d6f6(0x14a)])||'':'',_0x265ea1=_0x10e192+':'+_0x587cb3[_0x23d6f6(0xf5)];if(_0x9c2011[_0x23d6f6(0x1a3)](_0x265ea1))return![];if(_0x4e7dd7)return _0x10e192===_0x2f13bb||_0x10e192[_0x23d6f6(0x1cd)](_0x2f13bb+'/');return!![];});}export function buildSegmentLookupMap(_0x36e7a2,_0x566931){const _0x252858=a152_0xdbe0a,_0x2800ef=new Map();for(const _0xe76a7 of _0x36e7a2){const _0x39e8c8=_0xe76a7[_0x252858(0xf7)]?_0x566931[_0x252858(0x14b)](_0xe76a7[_0x252858(0xf7)][_0x252858(0x1a9)]())||'':'',_0x42b46a=_0x39e8c8+':'+_0xe76a7[_0x252858(0x10d)];_0x2800ef[_0x252858(0xca)](_0x42b46a,_0xe76a7);}return _0x2800ef;}export function buildSegmentNameToIdMap(_0x5bb5cb){const _0x3a684f=a152_0xdbe0a,_0x528b84=new Map();for(const _0x29ef9b of _0x5bb5cb){_0x528b84[_0x3a684f(0xca)](_0x29ef9b[_0x3a684f(0x10d)],_0x29ef9b['id']);}return _0x528b84;}function a152_0x46f4(){const _0x5595e5=['conditionSegmentId','folderId','get','NOT_FOUND','\x20journey\x20from\x20file:\x20','trim','Segment\x20not\x20found:\x20','hex','journeyActivationNameToId','logDeleted','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Deleted\x20segment\x20\x27','reduce','WaitStep','hasChanges','verbose','SEGMENT_NOT_FOUND','withProgress','sha1','updated','with','skipSegments','\x27\x20to\x20local\x20\x27','activationContext','journeyName','Creating\x20activation\x20\x27','sort','Creating\x20folder\x20\x27','11lMWKRA','journey_entry_criteria_','relationships','add','SEGMENT_UPDATE_ERROR','run_after_journey_refresh','embedded_segment_created','resolvedRule','milestone','parentFolder','Condition','deleted','\x27\x20exit\x20criteria','update','unchanged','existingJourney','112TELYya','kind','yamlActivation','Delete\x20the\x20push\x20recovery\x20file\x20(','rootFolderId','toLowerCase','progress','segment_updated','JOURNEY_SYNTAX_ERROR','created','\x27...','rule','valid','create','parseDocument','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','all_columns','draft','Activation','entries','Updating\x20activation\x20\x27','onProgress','journey_updated','listActivations','dirname','):\x20','object','isNew','replace','deleteActivation','110qwneoS','\x27\x20milestone','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','all','data','\x20(referenced\x20in\x20journey\x20','DecisionPoint','__pending_act_','Entry\x20criteria:\x20','branches','Fetching\x20','folderPath','resolveSegment','\x20error(s)','find','segment_deleting','has','index','deps','conditionTimeoutUnit','Deleting\x20activation\x20\x27','Journey\x20\x27','toString','Stage\x20\x27','journeyActivationStepId','activations','ACTIVATION_SYNTAX_ERROR','Updated\x20segment\x20\x27','segment_created','delete','notification','createdSegmentIds','embedded_activation_created','segmentByFolderAndName','Updating\x20segment\x20\x27','\x27\x20by\x20rule\x20content','\x27\x20entry\x20criteria','INTERNAL','Name\x20has\x20already\x20been\x20taken','steps','parse','push','day','nameToType','existingSegments','journeyId','Created\x20journey\x20\x27','fetchJourney','getSegmentEntity','segment','connectionIdToNameMap','size','uniqueSegmentName','JOURNEY_UPDATE_ERROR','journey_updating','5458lsWKFk','description','\x27\x20wait\x20condition','startsWith','getJourney','existingSegment','journeys','Deleted\x20activation\x20\x27','6047172znifmm','segment_updating','./child-segment-yaml.js','debug','Created\x20folder\x20\x27','set','createFolder','Created\x20segment\x20\x27','\x27\x20not\x20found\x20in\x20journey\x20\x27','activation_updated','entryCriteria','localName','diff','includes','\x27\x20for\x20','journeyById','exitCriterias','embedded_activation_creating','getLatestJourneyId','buildUserMaps','SEGMENT_SYNTAX_ERROR','match','resolveJourneyId','parentSegmentFolder','flatMap','Failed\x20to\x20','validatedRequest','../../utils/async.js','from','getActivation','versionNumber',').\x20','segmentId','2936WIBxvd','slice',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','getSegment','\x20segment\x20from\x20file:\x20','relative','list','\x27\x20from\x20file:\x20','activation_template_id','folder_creating','journey','activationActions','filter','isArray','idToEmailMap','journeyBundleName','nameToId','segmentFolderId','behavior','8435KnPceG','absolutePath','conditions','Failed\x20to\x20resolve\x20activation\x20','journeyStages','segment_deleted','666mdkKOt','stage\x20\x27','\x0a\x20\x20','folderPathToId','max','createdSegmentId','entry_criteria','toISOString','embeddedSegmentNameToId','createJourneySegment','activation_','goal','folder_created','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','name','length','stringify','entry','segments','activation_created','errors','map','journey_creating','./journey-yaml.js','Failed\x20to\x20fetch\x20referenced\x20segment\x20','logWarning','action','conditionTimeoutDuration','journeyBundleId','\x20activation\x20\x27','waitStep','message','__pending_','ACTIVATION_UPDATE_ERROR','columns','logSuccess','journey_created','journeyBundlesByFolderAndName','split','connector_config','createSegment','updateSegmentById','parentId','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','results','utf-8','deleteSegment','existingActivation','waitStepType','state','schedule','7317gxYQtE','idToName','activation_deleting','552723PQmEnz','getSegment\x20failed\x20for\x20','Duration','activationParams','11395jdjOFn','effectiveFolderId','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','waitStepUnit','join','attributes','item','segmentNameToId','stages','Activation\x20not\x20found:\x20','229780FEvONY','embedded_segment_creating','uniqueServerName','type','yamlConfig','keys'];a152_0x46f4=function(){return _0x5595e5;};return a152_0x46f4();}export function buildJourneyBundleLookupMap(_0x2fe92f,_0x393de2){const _0x22056b=a152_0xdbe0a,_0x4c0b00=new Map();for(const _0x1d2134 of _0x2fe92f){const _0x483017=_0x1d2134[_0x22056b(0x14a)]?_0x393de2[_0x22056b(0x14b)](_0x1d2134['folderId'])||'':'',_0x138a93=_0x483017+':'+_0x1d2134[_0x22056b(0xf5)];!_0x4c0b00[_0x22056b(0x1a3)](_0x138a93)&&_0x4c0b00['set'](_0x138a93,[]),_0x4c0b00[_0x22056b(0x14b)](_0x138a93)[_0x22056b(0x1bc)](_0x1d2134);}for(const _0x5f2c2b of _0x4c0b00['values']()){_0x5f2c2b[_0x22056b(0x163)]((_0x39e049,_0x3d27bc)=>(_0x39e049[_0x22056b(0xe3)]||0x0)-(_0x3d27bc[_0x22056b(0xe3)]||0x0));}return _0x4c0b00;}export function collectFoldersToCreate(_0x1b325d,_0x1df406){const _0x39b640=a152_0xdbe0a,_0x50fee7=new Set();for(const _0x41bfed of _0x1b325d){if(!_0x41bfed)continue;if(_0x1df406['has'](_0x41bfed))continue;const _0x3163f8=_0x41bfed[_0x39b640(0x125)]('/');let _0x1a68eb='';for(const _0x74d6bd of _0x3163f8){_0x1a68eb=_0x1a68eb?_0x1a68eb+'/'+_0x74d6bd:_0x74d6bd,!_0x1df406[_0x39b640(0x1a3)](_0x1a68eb)&&_0x50fee7['add'](_0x1a68eb);}}return _0x50fee7;}export function parseAndClassifyYamlFiles(_0x99e1a7,_0x3084f0,_0x2f7ece){const _0x4e6f39=a152_0xdbe0a,_0x21ebec=[],_0x51e5d9=[];for(const _0x347e08 of _0x99e1a7){const _0x22beb7=a152_0x543d0d[_0x4e6f39(0xeb)](_0x3084f0,a152_0x543d0d[_0x4e6f39(0x18d)](_0x347e08)),_0x1b29a1=_0x22beb7==='.'?'':_0x22beb7['replace'](/\\/g,'/'),_0x52dcc7=readFileSync(_0x347e08,_0x4e6f39(0x12c)),_0x34233e=a152_0x14c7b5[_0x4e6f39(0x1bb)](_0x52dcc7);if(isJourneyDef(_0x34233e)){const _0x5af029=a152_0x590d85(_0x52dcc7);_0x51e5d9[_0x4e6f39(0x1bc)]({'yamlConfig':_0x5af029,'folderPath':_0x1b29a1,'sourcePath':_0x347e08});}else{if(!_0x2f7ece?.[_0x4e6f39(0x15e)]){const _0x153203=parseSegmentYamlFile(_0x52dcc7),_0x368ec3=normalizeChildSegmentYaml(_0x153203);_0x21ebec['push']({'yamlConfig':_0x368ec3,'folderPath':_0x1b29a1,'sourcePath':_0x347e08});}}}return{'segments':_0x21ebec,'journeys':_0x51e5d9};}export function validateParsedFiles(_0x399f78,_0xbd1dbc){const _0x277646=a152_0xdbe0a,_0x453537=[];for(const {yamlConfig:_0x4a9f7d,sourcePath:_0xf82a0}of _0x399f78[_0x277646(0x111)]){const _0x5ac647=readFileSync(_0xf82a0,'utf-8'),_0x53ebdf=a152_0x14c7b5['parseDocument'](_0x5ac647),_0x3860ea=validateSegmentDef(_0x4a9f7d,{'source':_0x5ac647,'document':_0x53ebdf},{'skipSchema':!![]});if(!_0x3860ea[_0x277646(0x181)]){const _0x2782d5=a152_0x543d0d[_0x277646(0xeb)](_0xbd1dbc,_0xf82a0);_0x453537[_0x277646(0x1bc)]({'filePath':_0x2782d5,'source':_0x5ac647,'result':_0x3860ea,'isJourney':![]});}}for(const {yamlConfig:_0x51b186,sourcePath:_0x4f469f}of _0x399f78[_0x277646(0x1d0)]){const _0x551990=readFileSync(_0x4f469f,'utf-8'),_0x1d8599=a152_0x14c7b5[_0x277646(0x183)](_0x551990),_0x21cc00=validateJourneyDef(_0x51b186,{'source':_0x551990,'document':_0x1d8599},{'skipSchema':!![]});if(!_0x21cc00[_0x277646(0x181)]){const _0x16222c=a152_0x543d0d['relative'](_0xbd1dbc,_0x4f469f);_0x453537[_0x277646(0x1bc)]({'filePath':_0x16222c,'source':_0x551990,'result':_0x21cc00,'isJourney':!![]});}}return _0x453537;}export function formatValidationErrors(_0x3928b8){const _0x4c5dfe=a152_0xdbe0a,_0x10ee54=[];for(const {filePath:_0x250fd0,source:_0x2eeea6,result:_0x3adeb0,isJourney:_0x3f69ee}of _0x3928b8){const _0x2cd099=_0x3f69ee?'journey':_0x4c5dfe(0x1c4);_0x10ee54[_0x4c5dfe(0x1bc)]('\x0a'+_0x250fd0+'\x20('+_0x2cd099+_0x4c5dfe(0x18e)+_0x3adeb0[_0x4c5dfe(0x113)][_0x4c5dfe(0x10e)]+_0x4c5dfe(0x1a0)),_0x10ee54[_0x4c5dfe(0x1bc)](formatValidationResult(_0x3adeb0,_0x2eeea6,_0x250fd0));}return _0x10ee54['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x1542d6){const _0x483da3=a152_0xdbe0a,_0x7f256a=new Set(),_0x1881cc=new Map(),_0x4962d3=collectSegmentUsageCounts(_0x1542d6);if(_0x1542d6[_0x483da3(0x111)])for(const [_0x1cdb17,_0x188d70]of Object[_0x483da3(0x188)](_0x1542d6['segments'])){_0x7f256a[_0x483da3(0x168)](_0x1cdb17);if(_0x188d70[_0x483da3(0x180)]){const _0x2376b2=yamlRuleToApi(_0x188d70[_0x483da3(0x180)]),_0x3ea612=apiRuleToYaml(_0x2376b2);_0x1881cc[_0x483da3(0xca)](_0x1cdb17,_0x3ea612);}}const _0x1dee40=new Map();let _0x4c6991=0x0;for(const [_0x676544,_0x3a31ed]of _0x1881cc){const _0x43b407=serializeExpandedRule(_0x3a31ed,_0x1881cc),_0x47e0ec=_0x1dee40[_0x483da3(0x14b)](_0x43b407)||[];_0x47e0ec[_0x483da3(0x1bc)]({'name':_0x676544,'index':_0x4c6991}),_0x1dee40[_0x483da3(0xca)](_0x43b407,_0x47e0ec),_0x4c6991++;}const _0x3e68db=new Map();for(const [_0x3098bf,_0x471372]of _0x1dee40){const _0x185375=_0x471372[_0x483da3(0xe7)]()[_0x483da3(0x163)]((_0x11a985,_0x381bcd)=>{const _0x5c3105=_0x483da3,_0xa90c03=_0x4962d3[_0x5c3105(0x14b)](_0x11a985[_0x5c3105(0x10d)])||0x0,_0x5e01f8=_0x4962d3[_0x5c3105(0x14b)](_0x381bcd[_0x5c3105(0x10d)])||0x0;if(_0xa90c03!==_0x5e01f8)return _0x5e01f8-_0xa90c03;return _0x11a985[_0x5c3105(0x1a4)]-_0x381bcd['index'];})['map'](_0x3a404f=>_0x3a404f['name']),_0x24eb42=[];for(const _0x33520c of _0x185375){const _0x540df7=_0x4962d3[_0x483da3(0x14b)](_0x33520c)||0x0,_0x39c5c1=Math[_0x483da3(0x103)](_0x540df7,0x1);for(let _0x50e72c=0x0;_0x50e72c<_0x39c5c1;_0x50e72c++){_0x24eb42[_0x483da3(0x1bc)](_0x33520c);}}_0x3e68db[_0x483da3(0xca)](_0x3098bf,_0x24eb42);}return{'existingLocalSegmentNames':_0x7f256a,'localSegmentRules':_0x1881cc,'localExpandedRuleToNames':_0x3e68db};}export function createSegmentIdResolver(_0x54d62e,_0x1f3203){return async _0x43e295=>{const _0x5bcdea=a152_0x3e4e,_0x1d7e29=_0x54d62e['get'](_0x43e295);if(!_0x1d7e29)throw new SDKError(ErrorCode[_0x5bcdea(0x159)],'Segment\x20not\x20found:\x20'+_0x43e295+_0x5bcdea(0x10c)+_0x1f3203+'\x27)');return _0x1d7e29;};}export function extractRootFolderId(_0x2caca9){const _0x46786c=a152_0xdbe0a;return _0x2caca9[_0x46786c(0x167)]?.[_0x46786c(0xdc)]?.[_0x46786c(0x197)]?.['id']||_0x2caca9[_0x46786c(0x167)]?.[_0x46786c(0x16e)]?.[_0x46786c(0x197)]?.['id'];}function a152_0x3e4e(_0x49afd1,_0x5dc4d6){_0x49afd1=_0x49afd1-0xc5;const _0x46f47d=a152_0x46f4();let _0x3e4ea4=_0x46f47d[_0x49afd1];return _0x3e4ea4;}export function buildConnectionMaps(_0x31f13e){const _0x13ff1f=a152_0xdbe0a,_0x13df76=new Map(),_0x313f62=new Map(),_0x34d7da=new Map();for(const _0x210ad6 of _0x31f13e){_0x13df76[_0x13ff1f(0xca)](_0x210ad6['name'],parseInt(_0x210ad6['id'],0xa)),_0x313f62[_0x13ff1f(0xca)](_0x210ad6['id'],_0x210ad6['name']),_0x34d7da[_0x13ff1f(0xca)](_0x210ad6['name'],_0x210ad6[_0x13ff1f(0x146)]);}return{'nameToId':_0x13df76,'idToName':_0x313f62,'nameToType':_0x34d7da};}export function calculatePushStats(_0x24168a,_0x1a3f10,_0x3fd6dc,_0x1ce33c,_0x46e993,_0x439d86,_0x3d90df){const _0x4bb9d4=a152_0xdbe0a,_0x3de955=_0x24168a[_0x4bb9d4(0xf2)](_0x2a7167=>_0x2a7167[_0x4bb9d4(0x190)]),_0x42945e=_0x24168a[_0x4bb9d4(0xf2)](_0x1e2c4e=>!_0x1e2c4e[_0x4bb9d4(0x190)]&&_0x1e2c4e[_0x4bb9d4(0x157)]),_0x804386=_0x24168a[_0x4bb9d4(0xf2)](_0x12d7e6=>!_0x12d7e6['isNew']&&!_0x12d7e6[_0x4bb9d4(0x157)]),_0x1010f6=_0x439d86?_0x1ce33c:[],_0xc848d3=_0x1a3f10[_0x4bb9d4(0xf2)](_0x49b18d=>_0x49b18d[_0x4bb9d4(0x190)]),_0x499415=_0x1a3f10[_0x4bb9d4(0xf2)](_0x285df6=>!_0x285df6[_0x4bb9d4(0x190)]&&_0x285df6[_0x4bb9d4(0x157)]),_0x411e02=_0x1a3f10['filter'](_0x286c41=>!_0x286c41[_0x4bb9d4(0x190)]&&!_0x286c41['hasChanges']),_0xb468f4=_0x439d86?_0x46e993:[],_0x398b61=_0x24168a[_0x4bb9d4(0xdd)](_0x5069ae=>_0x5069ae['activationActions']),_0xd87335=_0x398b61[_0x4bb9d4(0xf2)](_0x16b383=>_0x16b383[_0x4bb9d4(0x146)]==='create'),_0x1afee1=_0x398b61[_0x4bb9d4(0xf2)](_0x29e827=>_0x29e827['type']===_0x4bb9d4(0x172)),_0x58a4c5=_0x398b61[_0x4bb9d4(0xf2)](_0x539608=>_0x539608[_0x4bb9d4(0x146)]===_0x4bb9d4(0x1b0)),_0x4408ad=Array[_0x4bb9d4(0xe1)](_0x3fd6dc)[_0x4bb9d4(0x163)](),_0x50f200=_0x3d90df?![]:_0x3de955[_0x4bb9d4(0x10e)]>0x0||_0x42945e[_0x4bb9d4(0x10e)]>0x0||_0x1010f6[_0x4bb9d4(0x10e)]>0x0,_0x3d4e74=_0xc848d3[_0x4bb9d4(0x10e)]>0x0||_0x499415['length']>0x0||_0xb468f4[_0x4bb9d4(0x10e)]>0x0,_0x12d5be=_0x3d90df?![]:_0x398b61[_0x4bb9d4(0x10e)]>0x0,_0x43ba55=_0x4408ad['length']>0x0;return{'segments':{'new':_0x3de955,'changed':_0x42945e,'unchanged':_0x804386,'toDelete':_0x1010f6},'journeys':{'new':_0xc848d3,'changed':_0x499415,'unchanged':_0x411e02,'toDelete':_0xb468f4},'activations':{'all':_0x398b61,'toCreate':_0xd87335,'toUpdate':_0x1afee1,'toDelete':_0x58a4c5},'folders':{'toCreate':_0x4408ad},'counts':{'segments':{'new':_0x3de955['length'],'changed':_0x42945e[_0x4bb9d4(0x10e)],'unchanged':_0x804386['length'],'toDelete':_0x1010f6[_0x4bb9d4(0x10e)]},'journeys':{'new':_0xc848d3[_0x4bb9d4(0x10e)],'changed':_0x499415[_0x4bb9d4(0x10e)],'unchanged':_0x411e02[_0x4bb9d4(0x10e)],'toDelete':_0xb468f4[_0x4bb9d4(0x10e)]},'activations':{'create':_0xd87335[_0x4bb9d4(0x10e)],'update':_0x1afee1[_0x4bb9d4(0x10e)],'delete':_0x58a4c5[_0x4bb9d4(0x10e)]},'folders':_0x4408ad['length']},'hasChanges':_0x50f200||_0x3d4e74||_0x12d5be||_0x43ba55};}export async function buildPushExecutionContext(_0x43f8ce,_0x4b66af,_0x12668f,_0x77609f,_0x3f2fda,_0x3992a1){const _0x50c036=a152_0xdbe0a,_0x5747d8=extractRootFolderId(_0x12668f),{pathToId:_0x3d067e,idToPath:_0xa51105}=buildFolderMaps(_0x3f2fda),_0x1e6d4f=buildSegmentNameToIdMap(_0x77609f),_0x1a805f=new Map(),{batchAsync:_0x118f70}=await import(_0x50c036(0xe0)),[_0x51948e,_0x204837]=await Promise[_0x50c036(0x196)]([_0x43f8ce['user'][_0x50c036(0xd8)](),_0x43f8ce['connection'][_0x50c036(0xec)](),((async()=>{const _0x5d23bd=_0x50c036;!_0x3992a1&&_0x77609f[_0x5d23bd(0x10e)]>0x0&&await _0x118f70(_0x77609f,async _0x413f56=>{const _0x2330fb=_0x5d23bd,_0x29ddd1=await _0x43f8ce[_0x2330fb(0x1c4)][_0x2330fb(0x18c)](_0x4b66af,_0x413f56['id']);_0x1a805f[_0x2330fb(0xca)](_0x413f56['id'],_0x29ddd1);});})())]),{emailToId:_0x48539e,idToEmail:_0x566836}=_0x51948e,_0x1fa4e9=buildConnectionMaps(_0x204837);return{'rootFolderId':_0x5747d8,'folderPathToId':_0x3d067e,'folderIdToPath':_0xa51105,'segmentNameToId':_0x1e6d4f,'activationsBySegmentId':_0x1a805f,'emailToIdMap':_0x48539e,'idToEmailMap':_0x566836,'connectionNameToIdMap':_0x1fa4e9[_0x50c036(0xf6)],'connectionIdToNameMap':_0x1fa4e9[_0x50c036(0x133)],'connectionNameToTypeMap':_0x1fa4e9[_0x50c036(0x1be)]};}export function createPushYamlContextForBundle(_0xf20718,_0x53e53f,_0x185d60,_0x330856,_0x5e80b2,_0x47695b,_0x57514d,_0x3245a8){const {existingLocalSegmentNames:_0x484af4,localExpandedRuleToNames:_0x216d9f}=_0x330856,_0x192f2a=new Set(),_0x476c13=new Map(),_0x1f1473=new Map(),_0x20a510=new Map(),_0x33ce0e=createJumpTargetCache(),_0x3ff8ef=new Map(),_0x152703=new Map(),_0x1b292e=new Set();let _0x5eea27;const _0x5994d0=_0x10193c=>{const _0x78d78b={'resolveSegment':async _0x31b7f1=>{const _0x535b22=a152_0x3e4e,_0x47c29c=_0x20a510[_0x535b22(0x14b)](_0x31b7f1);if(_0x47c29c!==undefined)return{'name':_0x47c29c,'isJourneyLocal':!![]};try{const _0x5f2831=await fetchSegment(_0xf20718,_0x53e53f,_0x31b7f1,_0x185d60);if(!_0x5f2831)throw new Error('Segment\x20not\x20found');const _0x883342=generateJourneyLocalName(_0x5f2831[_0x535b22(0x10d)]),_0x35fcea=_0x5f2831[_0x535b22(0x176)]===SEGMENT_KIND_JOURNEY&&_0x883342!==undefined;let _0x39d25d=_0x5f2831[_0x535b22(0x10d)],_0x2a9b6f;if(_0x35fcea&&_0x5f2831[_0x535b22(0x180)]){const _0x1d94d7=apiRuleToYaml(_0x5f2831['rule']);_0x152703[_0x535b22(0xca)](_0x31b7f1,_0x1d94d7);const _0x1323f1=async _0x26f2e7=>{const _0x4132f2=_0x535b22,_0x294734=collectSegmentRefsFromRule(_0x26f2e7);for(const _0x5f1e17 of _0x294734){if(!_0x152703['has'](_0x5f1e17))try{const _0x58f578=await fetchSegment(_0xf20718,_0x53e53f,_0x5f1e17,_0x185d60);if(_0x58f578?.[_0x4132f2(0x180)]){const _0x5740d2=apiRuleToYaml(_0x58f578[_0x4132f2(0x180)]);_0x152703[_0x4132f2(0xca)](_0x5f1e17,_0x5740d2),await _0x1323f1(_0x5740d2);}}catch(_0x32c103){logger[_0x4132f2(0xc8)](_0x4132f2(0x117)+_0x5f1e17+':\x20'+_0x32c103);}}};await _0x1323f1(_0x1d94d7);const _0x3d3cda=serializeExpandedRule(_0x1d94d7,_0x152703),_0x66e961=_0x216d9f[_0x535b22(0x14b)](_0x3d3cda);if(_0x66e961&&_0x66e961['length']>0x0){const _0x2470ab=_0x476c13[_0x535b22(0x14b)](_0x3d3cda)||0x0,_0x5bb3d2=_0x66e961[_0x2470ab]||_0x66e961[_0x66e961[_0x535b22(0x10e)]-0x1];_0x476c13['set'](_0x3d3cda,_0x2470ab+0x1),_0x39d25d=_0x5bb3d2,_0x192f2a[_0x535b22(0x168)](_0x39d25d),_0x20a510[_0x535b22(0xca)](_0x31b7f1,_0x39d25d);const _0xafcd11=await resolveRuleSegmentRefs(_0x1d94d7,async _0x41eb7b=>{const _0x4af78b=_0x535b22,_0x1e9bad=_0x20a510[_0x4af78b(0x14b)](_0x41eb7b);if(_0x1e9bad)return _0x1e9bad;const _0x9d3d78=await _0x5eea27[_0x4af78b(0x19f)](_0x41eb7b);return _0x9d3d78[_0x4af78b(0x10d)];});_0x2a9b6f={'description':_0x5f2831[_0x535b22(0x1cb)],'rule':_0xafcd11};}else{const _0x4b2daa=_0x3ff8ef[_0x535b22(0x14b)](_0x3d3cda);if(_0x4b2daa)_0x39d25d=_0x4b2daa,_0x20a510[_0x535b22(0xca)](_0x31b7f1,_0x39d25d);else{if(_0x883342){let _0x21bd5f=_0x883342,_0xf0e0e3=0x2;while(_0x192f2a['has'](_0x21bd5f)||_0x484af4[_0x535b22(0x1a3)](_0x21bd5f)){_0x21bd5f=_0x883342+'_'+_0xf0e0e3,_0xf0e0e3++;}_0x192f2a[_0x535b22(0x168)](_0x21bd5f),_0x39d25d=_0x21bd5f;}_0x20a510[_0x535b22(0xca)](_0x31b7f1,_0x39d25d),_0x3ff8ef['set'](_0x3d3cda,_0x39d25d);const _0x53bb87=await resolveRuleSegmentRefs(_0x1d94d7,async _0x2fd4b2=>{const _0x52cba9=_0x535b22,_0x21dcdb=_0x20a510[_0x52cba9(0x14b)](_0x2fd4b2);if(_0x21dcdb)return _0x21dcdb;const _0x1b57d2=await _0x5eea27[_0x52cba9(0x19f)](_0x2fd4b2);return _0x1b57d2[_0x52cba9(0x10d)];});_0x2a9b6f={'description':_0x5f2831[_0x535b22(0x1cb)],'rule':_0x53bb87};}}}return{'name':_0x39d25d,'isJourneyLocal':_0x35fcea,'definition':_0x2a9b6f};}catch(_0x5bea24){return logger[_0x535b22(0xc8)]('Failed\x20to\x20resolve\x20segment\x20'+_0x31b7f1+':\x20'+_0x5bea24),{'name':_0x31b7f1,'isJourneyLocal':![]};}},'resolveActivation':async _0x34f88e=>{const _0x9a077c=a152_0x3e4e,_0x24c868=_0x1f1473['get'](_0x34f88e);if(_0x24c868!==undefined)return{'name':_0x24c868,'isJourneyLocal':!![]};try{let _0x38eea4=_0x57514d?.[_0x9a077c(0x14b)](_0x34f88e);!_0x38eea4&&(_0x38eea4=await _0xf20718[_0x9a077c(0xf0)][_0x9a077c(0xe2)](_0x10193c,_0x34f88e));const _0x148dda=_0x38eea4[_0x9a077c(0x13e)][_0x9a077c(0x138)][_0x9a077c(0x10d)]||_0x34f88e,_0x348f33=sanitizeYamlKey(_0x148dda)||_0x9a077c(0x109)+_0x34f88e,_0x437f2b=_0x348f33;_0x1f1473[_0x9a077c(0xca)](_0x34f88e,_0x437f2b);const _0x4a1e18=journeyActivationStepToYaml(_0x38eea4,_0x5e80b2,_0x47695b);return{'name':_0x437f2b,'isJourneyLocal':!![],'definition':_0x4a1e18};}catch(_0xd1e59d){return logger['debug'](_0x9a077c(0xfc)+_0x34f88e+':\x20'+_0xd1e59d),{'name':_0x34f88e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x33cbc8,_0x5cf931)=>resolveJumpTarget(_0x33cbc8,_0x5cf931,_0x33ce0e,async _0x2102e3=>{const _0x477132=a152_0x3e4e,_0x541294=_0x3245a8?.[_0x477132(0x14b)](_0x2102e3);if(_0x541294)return _0x541294;return _0xf20718['journey']['getJourney'](_0x2102e3);})};return _0x5eea27=_0x78d78b,_0x78d78b;},_0x13a514=async _0x31c655=>{const _0x399f1f=a152_0x3e4e,{collectSegmentIdsFromJourneyApi:_0x20bfcd}=await import(_0x399f1f(0x116)),{batchAsync:_0x2dc474}=await import('../../utils/async.js'),_0xf12b11=new Set();for(const _0x581a41 of _0x31c655){let _0x3e70a3=_0x3245a8?.['get'](_0x581a41);!_0x3e70a3&&(_0x3e70a3=await _0xf20718[_0x399f1f(0xf0)][_0x399f1f(0x1ce)](_0x581a41));const _0x1c9943=_0x20bfcd(_0x3e70a3);for(const _0x34c21a of _0x1c9943){_0xf12b11[_0x399f1f(0x168)](_0x34c21a);}}let _0x381b03=Array[_0x399f1f(0xe1)](_0xf12b11);while(_0x381b03[_0x399f1f(0x10e)]>0x0){const _0x5dfa33=_0x381b03['filter'](_0x3b543f=>!_0x1b292e[_0x399f1f(0x1a3)](_0x3b543f));if(_0x5dfa33[_0x399f1f(0x10e)]===0x0)break;const _0x38907e=await _0x2dc474(_0x5dfa33,async _0x26006d=>{const _0x272d28=_0x399f1f;_0x1b292e[_0x272d28(0x168)](_0x26006d);const _0x5e38a3=await fetchSegment(_0xf20718,_0x53e53f,_0x26006d,_0x185d60);if(!_0x5e38a3)return null;return{'segmentId':_0x26006d,'segment':_0x5e38a3};},0xa),_0x5b6b9c=new Set();for(const _0x368f7e of _0x38907e){if(!_0x368f7e?.['segment']?.[_0x399f1f(0x180)])continue;const _0x2374d9=apiRuleToYaml(_0x368f7e['segment'][_0x399f1f(0x180)]);_0x152703[_0x399f1f(0xca)](_0x368f7e['segmentId'],_0x2374d9);const _0x287ff3=collectSegmentRefsFromRule(_0x2374d9);for(const _0x118d2d of _0x287ff3){!_0x1b292e[_0x399f1f(0x1a3)](_0x118d2d)&&_0x5b6b9c[_0x399f1f(0x168)](_0x118d2d);}}_0x381b03=Array[_0x399f1f(0xe1)](_0x5b6b9c);}};return{'createYamlContext':_0x5994d0,'prefetchJourneySegments':_0x13a514};}export async function executePushSegments(_0xf4a3de,_0x3ba6cb,_0x559c73,_0x5a085a,_0x2dcd25){const _0x24b13=a152_0xdbe0a,{segmentDefToCreateRequest:_0x31c5fc,segmentDefToUpdateRequest:_0x525021}=await import(_0x24b13(0xc7)),_0x2de5c2=_0x559c73[_0x24b13(0x102)],_0x2a3efa=0x5,_0x41e037=async _0x30beb2=>{const _0x56d08a=_0x24b13,_0x433ccc=_0x30beb2[_0x56d08a(0x19e)]?_0x2de5c2[_0x56d08a(0x14b)](_0x30beb2[_0x56d08a(0x19e)]):undefined;let _0x336355;const _0xffce47={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x1a5ec1=_0x30beb2[_0x56d08a(0x147)];if(_0x30beb2[_0x56d08a(0x147)][_0x56d08a(0x180)]){const _0x4f53be=createSegmentIdResolver(_0x559c73[_0x56d08a(0x140)],_0x30beb2['yamlConfig']['name']),_0x31075b=await resolveRuleSegmentIds(_0x30beb2[_0x56d08a(0x147)][_0x56d08a(0x180)],_0x4f53be);_0x1a5ec1={..._0x30beb2[_0x56d08a(0x147)],'rule':_0x31075b};}try{if(_0x30beb2[_0x56d08a(0x190)]){_0x2dcd25[_0x56d08a(0x18a)]?.({'type':'segment_creating','name':_0x30beb2['yamlConfig'][_0x56d08a(0x10d)]});const _0xd751f6=_0x31c5fc(_0x1a5ec1,_0x433ccc),_0x29bc9b=await _0x2dcd25[_0x56d08a(0x15a)]('Creating\x20segment\x20\x27'+_0x30beb2[_0x56d08a(0x147)][_0x56d08a(0x10d)]+'\x27...',()=>_0xf4a3de['segment'][_0x56d08a(0x127)](_0x5a085a['parentId'],_0xd751f6));_0x336355=_0x29bc9b[_0x56d08a(0x197)]['id'],_0x559c73[_0x56d08a(0x140)][_0x56d08a(0xca)](_0x30beb2[_0x56d08a(0x147)]['name'],_0x336355),_0xffce47['createdSegmentId']={'name':_0x30beb2[_0x56d08a(0x147)][_0x56d08a(0x10d)],'id':_0x336355},_0x2dcd25[_0x56d08a(0x18a)]?.({'type':_0x56d08a(0x1af),'name':_0x30beb2[_0x56d08a(0x147)][_0x56d08a(0x10d)],'segmentId':_0x336355}),_0x2dcd25[_0x56d08a(0x122)]?.(_0x56d08a(0xcc)+_0x30beb2[_0x56d08a(0x147)][_0x56d08a(0x10d)]+'\x27'),_0xffce47[_0x56d08a(0x17e)]=0x1;}else{if(_0x30beb2[_0x56d08a(0x157)]){_0x2dcd25['onProgress']?.({'type':_0x56d08a(0xc6),'name':_0x30beb2[_0x56d08a(0x147)][_0x56d08a(0x10d)]});const _0x472b8c=_0x525021(_0x1a5ec1);_0x433ccc!==_0x30beb2['existingSegment']?.[_0x56d08a(0xf7)]&&(_0x472b8c[_0x56d08a(0xf7)]=_0x433ccc?parseInt(_0x433ccc,0xa):undefined),await _0x2dcd25['withProgress'](_0x56d08a(0x1b5)+_0x30beb2[_0x56d08a(0x147)]['name']+'\x27...',()=>_0xf4a3de[_0x56d08a(0x1c4)][_0x56d08a(0x128)](_0x5a085a[_0x56d08a(0x129)],_0x30beb2[_0x56d08a(0x1cf)]['id'],_0x472b8c)),_0x336355=_0x30beb2[_0x56d08a(0x1cf)]['id'],_0x2dcd25[_0x56d08a(0x18a)]?.({'type':_0x56d08a(0x17c),'name':_0x30beb2['yamlConfig'][_0x56d08a(0x10d)]}),_0x2dcd25[_0x56d08a(0x122)]?.(_0x56d08a(0x1ae)+_0x30beb2[_0x56d08a(0x147)][_0x56d08a(0x10d)]+'\x27'),_0xffce47[_0x56d08a(0x15c)]=0x1;}else _0x336355=_0x30beb2['existingSegment']['id'];}}catch(_0x277098){const _0x10b1a7=isHttp400Error(_0x277098),_0x4154c0=_0x10b1a7?ErrorCode[_0x56d08a(0xd9)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x279135=getErrorMessage(_0x277098);throw new SDKError(_0x4154c0,'Failed\x20to\x20'+(_0x30beb2[_0x56d08a(0x190)]?_0x56d08a(0x182):'update')+_0x56d08a(0xea)+_0x30beb2[_0x56d08a(0xfa)]+_0x56d08a(0x101)+_0x279135,_0x277098);}try{const _0x2c025c=await syncActivationsForSegment(_0xf4a3de,_0x5a085a[_0x56d08a(0x129)],_0x336355,_0x30beb2[_0x56d08a(0x147)][_0x56d08a(0x10d)],_0x30beb2[_0x56d08a(0xf1)],_0x2dcd25,_0x30beb2[_0x56d08a(0xfa)]);_0xffce47[_0x56d08a(0x1ac)]=_0x2c025c;}catch(_0x3ce9ef){if(_0x3ce9ef instanceof SDKError)throw _0x3ce9ef;throw new SDKError(ErrorCode[_0x56d08a(0x120)],_0x56d08a(0x195)+_0x30beb2['yamlConfig'][_0x56d08a(0x10d)]+_0x56d08a(0xed)+_0x30beb2[_0x56d08a(0xfa)]+_0x56d08a(0x101)+getErrorMessage(_0x3ce9ef),_0x3ce9ef);}return _0xffce47;},_0xed3431=await batchAsync(_0x3ba6cb,_0x41e037,_0x2a3efa),_0x44def1={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4d58e2 of _0xed3431){_0x44def1[_0x24b13(0x17e)]+=_0x4d58e2['created'],_0x44def1['updated']+=_0x4d58e2[_0x24b13(0x15c)],_0x4d58e2[_0x24b13(0x104)]&&_0x44def1[_0x24b13(0x1b2)][_0x24b13(0xca)](_0x4d58e2[_0x24b13(0x104)][_0x24b13(0x10d)],_0x4d58e2[_0x24b13(0x104)]['id']),_0x44def1[_0x24b13(0x1ac)][_0x24b13(0x17e)]+=_0x4d58e2[_0x24b13(0x1ac)][_0x24b13(0x17e)],_0x44def1[_0x24b13(0x1ac)][_0x24b13(0x15c)]+=_0x4d58e2[_0x24b13(0x1ac)]['updated'],_0x44def1[_0x24b13(0x1ac)][_0x24b13(0x170)]+=_0x4d58e2['activations'][_0x24b13(0x170)];}return _0x44def1;}async function syncActivationsForSegment(_0x4c2e89,_0x12253c,_0x1c7059,_0x21869c,_0x231f44,_0x4c1c0c,_0x31f893){const _0x8e45e5=a152_0xdbe0a,_0x1c6c37={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x24caaa of _0x231f44){try{if(_0x24caaa[_0x8e45e5(0x146)]==='create'&&_0x24caaa[_0x8e45e5(0xdf)])_0x4c1c0c[_0x8e45e5(0x18a)]?.({'type':'activation_creating','segmentName':_0x21869c,'activationName':_0x24caaa[_0x8e45e5(0x10d)]}),await _0x4c1c0c['withProgress'](_0x8e45e5(0x162)+_0x24caaa['name']+_0x8e45e5(0x17f),()=>_0x4c2e89['segment']['createActivation'](_0x12253c,_0x1c7059,_0x24caaa[_0x8e45e5(0xdf)])),_0x4c1c0c[_0x8e45e5(0x18a)]?.({'type':_0x8e45e5(0x112),'segmentName':_0x21869c,'activationName':_0x24caaa[_0x8e45e5(0x10d)]}),_0x4c1c0c[_0x8e45e5(0x122)]?.('Created\x20activation\x20\x27'+_0x24caaa['name']+'\x27'),_0x1c6c37[_0x8e45e5(0x17e)]++;else{if(_0x24caaa[_0x8e45e5(0x146)]==='update'&&_0x24caaa[_0x8e45e5(0xdf)]&&_0x24caaa[_0x8e45e5(0x12e)])_0x4c1c0c['onProgress']?.({'type':'activation_updating','segmentName':_0x21869c,'activationName':_0x24caaa[_0x8e45e5(0x10d)]}),await _0x4c1c0c[_0x8e45e5(0x15a)](_0x8e45e5(0x189)+_0x24caaa[_0x8e45e5(0x10d)]+'\x27...',()=>_0x4c2e89[_0x8e45e5(0x1c4)]['updateActivation'](_0x12253c,_0x1c7059,_0x24caaa[_0x8e45e5(0x12e)]['id'],_0x24caaa[_0x8e45e5(0xdf)])),_0x4c1c0c[_0x8e45e5(0x18a)]?.({'type':_0x8e45e5(0xce),'segmentName':_0x21869c,'activationName':_0x24caaa[_0x8e45e5(0x10d)]}),_0x4c1c0c['logSuccess']?.('Updated\x20activation\x20\x27'+_0x24caaa[_0x8e45e5(0x10d)]+'\x27'),_0x1c6c37[_0x8e45e5(0x15c)]++;else _0x24caaa[_0x8e45e5(0x146)]===_0x8e45e5(0x1b0)&&_0x24caaa['existingActivation']&&(_0x4c1c0c['onProgress']?.({'type':_0x8e45e5(0x134),'segmentName':_0x21869c,'activationName':_0x24caaa[_0x8e45e5(0x10d)]}),await _0x4c1c0c[_0x8e45e5(0x15a)](_0x8e45e5(0x1a7)+_0x24caaa[_0x8e45e5(0x10d)]+'\x27...',()=>_0x4c2e89[_0x8e45e5(0x1c4)][_0x8e45e5(0x192)](_0x12253c,_0x1c7059,_0x24caaa[_0x8e45e5(0x12e)]['id'])),_0x4c1c0c['onProgress']?.({'type':'activation_deleted','segmentName':_0x21869c,'activationName':_0x24caaa[_0x8e45e5(0x10d)]}),_0x4c1c0c['logDeleted']?.(_0x8e45e5(0x1d1)+_0x24caaa[_0x8e45e5(0x10d)]+'\x27'),_0x1c6c37['deleted']++);}}catch(_0xbd035b){const _0x3895eb=isHttp400Error(_0xbd035b),_0x1bd547=_0x3895eb?ErrorCode[_0x8e45e5(0x1ad)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xc133c4=getErrorMessage(_0xbd035b);throw new SDKError(_0x1bd547,_0x8e45e5(0xde)+_0x24caaa[_0x8e45e5(0x146)]+_0x8e45e5(0x11c)+_0x24caaa[_0x8e45e5(0x10d)]+_0x8e45e5(0xed)+_0x31f893+_0x8e45e5(0x101)+_0xc133c4,_0xbd035b);}}return _0x1c6c37;}export async function executePushFolders(_0x969a52,_0x5f10e7,_0x492273,_0x5339f6,_0x30f5c3){const _0x3d472c=a152_0xdbe0a,_0x57b485=new Map(_0x492273),_0x5ad780=sortFoldersByDepth(_0x5f10e7);for(const _0x3de730 of _0x5ad780){const _0x2e8ce1=_0x3de730[_0x3d472c(0x125)]('/'),_0x4cd269=_0x2e8ce1[_0x2e8ce1[_0x3d472c(0x10e)]-0x1],_0x4793b5=_0x2e8ce1[_0x3d472c(0xe7)](0x0,-0x1)[_0x3d472c(0x13d)]('/'),_0x2ffa71=_0x57b485[_0x3d472c(0x14b)](_0x4793b5);_0x30f5c3[_0x3d472c(0x18a)]?.({'type':_0x3d472c(0xef),'folder':_0x3de730});const _0x5c3ed7={'name':_0x4cd269,'parentFolderId':_0x2ffa71},_0x2f39c2=await _0x30f5c3['withProgress'](_0x3d472c(0x164)+_0x3de730+_0x3d472c(0x17f),()=>_0x969a52[_0x3d472c(0x1c4)][_0x3d472c(0xcb)](_0x5339f6[_0x3d472c(0x129)],_0x5c3ed7));_0x57b485[_0x3d472c(0xca)](_0x3de730,_0x2f39c2[_0x3d472c(0x197)]['id']),_0x30f5c3[_0x3d472c(0x18a)]?.({'type':_0x3d472c(0x10b),'folder':_0x3de730,'folderId':_0x2f39c2[_0x3d472c(0x197)]['id']}),_0x30f5c3['logInfo']?.(_0x3d472c(0xc9)+_0x3de730+'\x27');}return _0x57b485;}export async function executePushSegmentDeletions(_0x15a5b4,_0x291674,_0x55c342){const _0x12a2c4=a152_0xdbe0a;if(_0x291674[_0x12a2c4(0x10e)]===0x0)return 0x0;const {batchAsync:_0x3ce684}=await import('../../utils/async.js'),_0xb00834=0x5,_0x595666=await _0x3ce684(_0x291674,async _0x94deef=>{const _0x556add=_0x12a2c4;return _0x55c342[_0x556add(0x18a)]?.({'type':_0x556add(0x1a2),'name':_0x94deef['name']}),await _0x15a5b4['segment'][_0x556add(0x12d)](_0x94deef['id']),_0x55c342['onProgress']?.({'type':_0x556add(0xfe),'name':_0x94deef[_0x556add(0x10d)]}),_0x55c342[_0x556add(0x152)]?.(_0x556add(0x154)+_0x94deef[_0x556add(0x10d)]+'\x27'),0x1;},_0xb00834);return _0x595666[_0x12a2c4(0x155)]((_0x1a6467,_0x31f68c)=>_0x1a6467+_0x31f68c,0x0);}export async function executePushJourneys(_0x477ffb,_0x438309,_0x403476,_0x501a4f,_0x3de78d){const _0x3be99e=a152_0xdbe0a,{journeyDefToRequest:_0x59fe59}=await import(_0x3be99e(0x116)),{activationDefToCreateRequest:_0x40836f,yamlRuleToApi:_0x16fbc6,validateSegmentRule:_0x13767f}=await import('./child-segment-yaml.js'),_0x3b7bd0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1b0c2f=new Map(_0x403476[_0x3be99e(0x140)]),_0x554e29=0x5;for(let _0x3f946d=0x0;_0x3f946d<_0x438309[_0x3be99e(0x10e)];_0x3f946d+=_0x554e29){const _0x739b62=_0x438309['slice'](_0x3f946d,_0x3f946d+_0x554e29),_0x58ede2=await Promise[_0x3be99e(0x196)](_0x739b62[_0x3be99e(0x114)](async _0x3f316f=>{const _0xa32f10=_0x3be99e;if(!_0x3f316f['isNew']&&!_0x3f316f[_0xa32f10(0x157)])return{'action':_0xa32f10(0x173),'name':_0x3f316f[_0xa32f10(0x147)][_0xa32f10(0x10d)],'journeyId':_0x3f316f[_0xa32f10(0x174)]?.['id']};const _0x12a1b8=_0x3f316f[_0xa32f10(0x19e)]?_0x403476['folderPathToId']['get'](_0x3f316f[_0xa32f10(0x19e)]):undefined;_0x3de78d[_0xa32f10(0x18a)]?.({'type':_0x3f316f[_0xa32f10(0x190)]?_0xa32f10(0x115):_0xa32f10(0x1c9),'name':_0x3f316f[_0xa32f10(0x147)]['name']});try{const _0xdc15dd=await executeSingleJourneyPush(_0x477ffb,_0x3f316f,{..._0x403476,'segmentNameToId':_0x1b0c2f},{'parentId':_0x501a4f[_0xa32f10(0x129)],'rootFolderId':_0x501a4f[_0xa32f10(0x179)],'folderId':_0x12a1b8,'verbose':_0x501a4f[_0xa32f10(0x158)]},_0x3de78d,{'journeyDefToRequest':_0x59fe59,'activationDefToCreateRequest':_0x40836f,'yamlRuleToApi':_0x16fbc6,'validateSegmentRule':_0x13767f});for(const [_0x1c7865,_0x1b620a]of _0xdc15dd['embeddedSegmentNameToId']){_0x1b0c2f['set'](_0x1c7865,_0x1b620a),_0x3b7bd0[_0xa32f10(0x107)][_0xa32f10(0xca)](_0x1c7865,_0x1b620a);}if(_0xdc15dd[_0xa32f10(0x119)]===_0xa32f10(0x17e))_0x3de78d[_0xa32f10(0x18a)]?.({'type':_0xa32f10(0x123),'name':_0x3f316f[_0xa32f10(0x147)][_0xa32f10(0x10d)],'journeyId':_0xdc15dd['journeyId']}),_0x3de78d[_0xa32f10(0x122)]?.(_0xa32f10(0x1c1)+_0x3f316f[_0xa32f10(0x147)][_0xa32f10(0x10d)]+'\x27'),_0x3b7bd0[_0xa32f10(0x17e)]++;else _0xdc15dd['action']===_0xa32f10(0x15c)&&(_0x3de78d[_0xa32f10(0x18a)]?.({'type':_0xa32f10(0x18b),'name':_0x3f316f[_0xa32f10(0x147)]['name']}),_0x3de78d['logSuccess']?.('Updated\x20journey\x20\x27'+_0x3f316f['yamlConfig']['name']+'\x27'),_0x3b7bd0[_0xa32f10(0x15c)]++);return{'action':_0xdc15dd['action'],'name':_0x3f316f[_0xa32f10(0x147)][_0xa32f10(0x10d)],'journeyId':_0xdc15dd[_0xa32f10(0x1c0)]};}catch(_0xe1406f){const _0x2a9cd9=isHttp400Error(_0xe1406f),_0x2a8b32=_0x2a9cd9?ErrorCode[_0xa32f10(0x17d)]:ErrorCode[_0xa32f10(0x1c8)],_0x1bd961=getErrorMessage(_0xe1406f);throw new SDKError(_0x2a8b32,_0xa32f10(0xde)+(_0x3f316f[_0xa32f10(0x190)]?'create':_0xa32f10(0x172))+_0xa32f10(0x14d)+_0x3f316f['absolutePath']+_0xa32f10(0x101)+_0x1bd961,_0xe1406f);}}));_0x3b7bd0[_0x3be99e(0x12b)][_0x3be99e(0x1bc)](..._0x58ede2);}return _0x3b7bd0;}async function matchExistingJourneySegments(_0x2a9fe1,_0x4a1a5a,_0x17167c,_0x1bbfb1,_0x1d483d){const _0x1a74a0=a152_0xdbe0a;if(!_0x4a1a5a[_0x1a74a0(0x174)]||!_0x4a1a5a['yamlConfig']['segments'])return;const _0x47b7bf=new Map(),_0x211295=new Set();for(const _0x3081f2 of Object['keys'](_0x4a1a5a[_0x1a74a0(0x147)]['segments'])){const _0x575282=generateDeterministicJourneySegmentName(_0x4a1a5a[_0x1a74a0(0x147)][_0x1a74a0(0x10d)],_0x3081f2);_0x47b7bf[_0x1a74a0(0xca)](_0x575282,_0x3081f2),_0x211295['add'](_0x3081f2);}const _0x304455=[],_0x5135b6=collectSegmentIdsFromJourneyApi(_0x4a1a5a['existingJourney']);for(const _0xba708d of _0x5135b6){const _0x12f10a=await fetchSegment(_0x2a9fe1,_0x17167c,_0xba708d,_0x1bbfb1);if(!_0x12f10a?.['name'])continue;const _0x387aaa=_0x47b7bf[_0x1a74a0(0x14b)](_0x12f10a[_0x1a74a0(0x10d)]);_0x387aaa?(_0x1d483d[_0x1a74a0(0xca)](_0x387aaa,_0xba708d),_0x211295[_0x1a74a0(0x1b0)](_0x387aaa)):_0x304455['push']({'id':_0xba708d,'seg':_0x12f10a});}if(_0x211295[_0x1a74a0(0x1c6)]>0x0&&_0x304455[_0x1a74a0(0x10e)]>0x0){const {localExpandedRuleToNames:_0x49d788}=buildLocalExpandedRuleMappings(_0x4a1a5a[_0x1a74a0(0x147)]),_0x47c88e=new Map();for(const {id:_0x785be4,seg:_0x31fa9b}of _0x304455){if(_0x31fa9b[_0x1a74a0(0x180)]){const _0x1b923f=apiRuleToYaml(_0x31fa9b[_0x1a74a0(0x180)]);_0x47c88e[_0x1a74a0(0xca)](_0x785be4,_0x1b923f);}}for(const {id:_0x182a17,seg:_0x3ff0d6}of _0x304455){if(!_0x3ff0d6['rule'])continue;const _0x582079=_0x47c88e[_0x1a74a0(0x14b)](_0x182a17);if(!_0x582079)continue;const _0xfa7f07=serializeExpandedRule(_0x582079,_0x47c88e),_0x1415aa=_0x49d788[_0x1a74a0(0x14b)](_0xfa7f07);if(_0x1415aa){const _0x5553d5=_0x1415aa[_0x1a74a0(0x1a1)](_0x3cedb3=>_0x211295[_0x1a74a0(0x1a3)](_0x3cedb3));_0x5553d5&&(_0x1d483d['set'](_0x5553d5,_0x182a17),_0x211295[_0x1a74a0(0x1b0)](_0x5553d5),logger[_0x1a74a0(0xc8)]('Matched\x20server\x20segment\x20\x27'+_0x3ff0d6[_0x1a74a0(0x10d)]+_0x1a74a0(0x15f)+_0x5553d5+_0x1a74a0(0x1b6)));}}}}async function executeSingleJourneyPush(_0x2380c7,_0x19663c,_0x14fd3f,_0x5b3ec2,_0x32f622,_0x79dd93){const _0x2e6d63=a152_0xdbe0a,{journeyDefToRequest:_0x1442cd,activationDefToCreateRequest:_0x3627b5,yamlRuleToApi:_0x21da01,validateSegmentRule:_0x164745}=_0x79dd93,_0x5bb7bd=new Map(),_0x58d5fc=new Map();recoverSegmentIdsFromPushRecovery(_0x19663c,_0x5bb7bd,_0x14fd3f[_0x2e6d63(0x140)]);const _0x9cef7c=new Map(),_0x3ea76b=new Map(),_0x177c93=new Map();let _0x939c14;const _0x22417e=async()=>{const _0x4e6516=_0x2e6d63;if(_0x939c14)return;_0x939c14=new Map();if(!_0x19663c[_0x4e6516(0x174)])return;const _0x2a2467=await _0x2380c7['journey'][_0x4e6516(0x18c)](_0x19663c['existingJourney']['id']);for(const _0x367df9 of _0x2a2467){const _0x49deab=journeyActivationStepToYaml(_0x367df9,_0x14fd3f[_0x4e6516(0xf4)],_0x14fd3f['connectionIdToNameMap']),_0x3bb28a=activationSignature(_0x49deab);!_0x939c14['has'](_0x3bb28a)&&_0x939c14[_0x4e6516(0xca)](_0x3bb28a,_0x367df9['id']),_0x49deab[_0x4e6516(0x10d)]&&_0x58d5fc[_0x4e6516(0xca)](_0x49deab[_0x4e6516(0x10d)],_0x367df9['id']);}};await matchExistingJourneySegments(_0x2380c7,_0x19663c,_0x5b3ec2['parentId'],_0x14fd3f['existingSegments'],_0x14fd3f[_0x2e6d63(0x140)]);const _0x2bc658={'resolveSegmentId':async _0x316586=>{const _0x532ed6=_0x2e6d63,_0x6b82d7=_0x14fd3f['segmentNameToId'][_0x532ed6(0x14b)](_0x316586);if(!_0x6b82d7)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x532ed6(0x14f)+_0x316586+_0x532ed6(0x198)+_0x19663c['yamlConfig'][_0x532ed6(0x10d)]+')');return _0x6b82d7;},'resolveEmbeddedSegmentId':async(_0x18fd1e,_0x5e9203)=>{const _0x33af95=_0x2e6d63,_0xb9d601=_0x14fd3f[_0x33af95(0x140)]['get'](_0x18fd1e);if(_0xb9d601)return _0xb9d601;const _0x345ac7=_0x14fd3f[_0x33af95(0x1bf)][_0x33af95(0x1a1)](_0x2ed3ea=>_0x2ed3ea['name']===_0x18fd1e);if(_0x345ac7)return _0x14fd3f[_0x33af95(0x140)][_0x33af95(0xca)](_0x18fd1e,_0x345ac7['id']),_0x345ac7['id'];if(_0x19663c['isNew']){const {stageName:_0x4b5f4c,criteriaName:_0x2adb54}=findSegmentCriteriaLocation(_0x19663c[_0x33af95(0x147)],_0x18fd1e);return _0x164745(_0x18fd1e,_0x5e9203[_0x33af95(0x180)]),_0x3ea76b[_0x33af95(0xca)](_0x18fd1e,{'definition':_0x5e9203,'stageName':_0x4b5f4c,'criteriaName':_0x2adb54}),createPendingSegmentId(_0x18fd1e);}const _0x2d2a13=_0x19663c[_0x33af95(0x174)]?.['id'];if(!_0x2d2a13)throw new SDKError(ErrorCode[_0x33af95(0x1b8)],_0x33af95(0x12a));const _0x53196c=_0x9cef7c[_0x33af95(0x14b)](_0x18fd1e);if(_0x53196c)return _0x53196c;const _0xcd3ca6=((async()=>{const _0x34b9b2=_0x33af95;_0x164745(_0x18fd1e,_0x5e9203[_0x34b9b2(0x180)]);const _0x22c01e=generateDeterministicJourneySegmentName(_0x19663c['yamlConfig'][_0x34b9b2(0x10d)],_0x18fd1e),_0x2b9af3=_0x14fd3f[_0x34b9b2(0x1bf)]['find'](_0x2d5dff=>_0x2d5dff[_0x34b9b2(0x10d)]===_0x22c01e),_0x401a59=createSegmentIdResolver(_0x14fd3f[_0x34b9b2(0x140)],_0x18fd1e),_0x127cfc=await resolveRuleSegmentIds(_0x5e9203['rule'],_0x401a59);let _0x583415;return _0x2b9af3?(await _0x2380c7[_0x34b9b2(0x1c4)]['updateSegmentById'](_0x5b3ec2['parentId'],_0x2b9af3['id'],{'description':_0x5e9203[_0x34b9b2(0x1cb)]||_0x34b9b2(0x19b)+_0x18fd1e,'rule':_0x21da01(_0x127cfc),'countPopulation':!![]}),_0x583415=_0x2b9af3['id'],saveSegmentToPushRecovery(_0x19663c[_0x34b9b2(0xfa)],_0x19663c['yamlConfig'][_0x34b9b2(0x10d)],_0x18fd1e,{'segmentId':_0x583415,'uniqueServerName':_0x22c01e,'createdAt':new Date()['toISOString']()})):_0x583415=await createOrRecoverEmbeddedSegment(_0x2380c7,_0x19663c,{'localName':_0x18fd1e,'uniqueSegmentName':_0x22c01e,'description':_0x5e9203[_0x34b9b2(0x1cb)]||_0x34b9b2(0x19b)+_0x18fd1e,'journeyId':_0x2d2a13,'resolvedRule':_0x127cfc,'parentId':_0x5b3ec2[_0x34b9b2(0x129)],'folderId':_0x5b3ec2['rootFolderId']||''},_0x21da01),_0x14fd3f[_0x34b9b2(0x140)][_0x34b9b2(0xca)](_0x18fd1e,_0x583415),_0x5bb7bd[_0x34b9b2(0xca)](_0x18fd1e,_0x583415),_0x583415;})());_0x9cef7c[_0x33af95(0xca)](_0x18fd1e,_0xcd3ca6);try{return await _0xcd3ca6;}finally{_0x9cef7c[_0x33af95(0x1b0)](_0x18fd1e);}},'resolveActivationId':async _0x282227=>{const _0x348125=_0x2e6d63,_0x2a6033=_0x58d5fc[_0x348125(0x14b)](_0x282227);if(_0x2a6033)return _0x2a6033;if(_0x19663c[_0x348125(0x174)]){await _0x22417e();const _0x3a6a64=_0x58d5fc[_0x348125(0x14b)](_0x282227);if(_0x3a6a64)return _0x3a6a64;}throw new SDKError(ErrorCode[_0x348125(0x14c)],_0x348125(0x142)+_0x282227+'\x20(referenced\x20in\x20journey\x20'+_0x19663c[_0x348125(0x147)][_0x348125(0x10d)]+_0x348125(0xe4)+_0x348125(0x13b));},'resolveEmbeddedActivationId':async(_0xe92850,_0x12f80c)=>{const _0x43c728=_0x2e6d63,_0x16d2a4=_0x58d5fc[_0x43c728(0x14b)](_0xe92850);if(_0x16d2a4)return _0x16d2a4;if(_0x19663c['isNew'])return _0x177c93[_0x43c728(0xca)](_0xe92850,_0x12f80c),createPendingActivationId(_0xe92850);if(_0x19663c['existingJourney']){await _0x22417e();const _0x46c305=_0x58d5fc[_0x43c728(0x14b)](_0x12f80c[_0x43c728(0x10d)]);if(_0x46c305)return _0x58d5fc[_0x43c728(0xca)](_0xe92850,_0x46c305),_0x46c305;const _0x484c12=activationSignature(_0x12f80c),_0xdf5e33=_0x939c14?.[_0x43c728(0x14b)](_0x484c12);if(_0xdf5e33)return _0x58d5fc['set'](_0xe92850,_0xdf5e33),_0xdf5e33;const _0x1b1ae0=await _0x3627b5(_0x12f80c,_0x14fd3f['activationContext']),_0x419e11={..._0x1b1ae0,..._0x12f80c[_0x43c728(0x16a)]!==undefined&&{'runAfterJourneyRefresh':_0x12f80c['run_after_journey_refresh']}},_0x4e0730=await _0x2380c7[_0x43c728(0xf0)]['createActivation'](_0x19663c[_0x43c728(0x174)]['id'],_0x419e11);return _0x58d5fc[_0x43c728(0xca)](_0xe92850,_0x4e0730['id']),_0x4e0730['id'];}throw new SDKError(ErrorCode[_0x43c728(0x1b8)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x37d09f=>{const _0x23caf9=_0x2e6d63;try{return await _0x2380c7[_0x23caf9(0xf0)][_0x23caf9(0xdb)](_0x5b3ec2[_0x23caf9(0x129)],_0x37d09f);}catch(_0x2388a2){throw new SDKError(ErrorCode[_0x23caf9(0x14c)],_0x23caf9(0x1a8)+_0x37d09f+_0x23caf9(0x184)+_0x19663c[_0x23caf9(0x147)]['name']+'\x27)',_0x2388a2);}},'resolveStageId':async(_0x3c49d0,_0x58e7e2)=>{const _0x46d175=_0x2e6d63,_0x3fed0d=await _0x2380c7[_0x46d175(0xf0)][_0x46d175(0x1ce)](_0x3c49d0),_0x6d815f=_0x3fed0d['attributes'][_0x46d175(0xfd)][_0x46d175(0x1a1)](_0x5ba818=>_0x5ba818[_0x46d175(0x10d)][_0x46d175(0x17a)]()===_0x58e7e2[_0x46d175(0x17a)]());if(!_0x6d815f?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x46d175(0x1aa)+_0x58e7e2+_0x46d175(0xcd)+(_0x3fed0d[_0x46d175(0x13e)][_0x46d175(0xf5)]||_0x3fed0d[_0x46d175(0x13e)][_0x46d175(0x10d)])+'\x27');return _0x6d815f['id'];}},_0x4908ea=await _0x1442cd(_0x19663c[_0x2e6d63(0x147)],_0x5b3ec2[_0x2e6d63(0x129)],_0x2bc658),_0x2d5bd6=_0x5b3ec2[_0x2e6d63(0x14a)]||_0x5b3ec2[_0x2e6d63(0x179)];_0x2d5bd6&&(_0x4908ea['relationships']={'parentFolder':{'data':{'id':_0x2d5bd6,'type':'folder'}}});if(_0x19663c[_0x2e6d63(0x190)]){if(_0x3ea76b[_0x2e6d63(0x1c6)]>0x0||_0x177c93[_0x2e6d63(0x1c6)]>0x0)return await executeThreeStepJourneyCreate(_0x2380c7,_0x19663c,_0x4908ea,{'pendingEmbeddedSegments':_0x3ea76b,'pendingEmbeddedActivations':_0x177c93,'embeddedSegmentNameToId':_0x5bb7bd,'journeyActivationNameToId':_0x58d5fc},{..._0x5b3ec2,'effectiveFolderId':_0x2d5bd6},_0x14fd3f,_0x32f622,_0x79dd93);else{ensureJourneyDefaults(_0x4908ea[_0x2e6d63(0x13e)]);const _0x497c15=await _0x2380c7[_0x2e6d63(0xf0)][_0x2e6d63(0x182)](_0x4908ea);return deletePushRecovery(_0x19663c[_0x2e6d63(0xfa)]),{'action':'created','journeyId':_0x497c15['id'],'embeddedSegmentNameToId':_0x5bb7bd};}}else{if(_0x19663c[_0x2e6d63(0x157)]&&_0x19663c[_0x2e6d63(0x174)]){_0x4908ea['id']=_0x19663c[_0x2e6d63(0x174)]['id'];const _0x46c3f1=_0x4908ea[_0x2e6d63(0x13e)];_0x19663c['existingJourney'][_0x2e6d63(0x13e)]?.['journeyBundleName']&&(_0x46c3f1[_0x2e6d63(0xf5)]=_0x19663c[_0x2e6d63(0x174)][_0x2e6d63(0x13e)]['journeyBundleName']);const _0x49f808=_0x19663c[_0x2e6d63(0x174)][_0x2e6d63(0x13e)]?.[_0x2e6d63(0xfd)];return _0x49f808&&_0x4908ea['attributes'][_0x2e6d63(0xfd)]&&injectExistingStageIds(_0x4908ea[_0x2e6d63(0x13e)][_0x2e6d63(0xfd)],_0x49f808),ensureJourneyDefaults(_0x46c3f1),await _0x2380c7[_0x2e6d63(0xf0)][_0x2e6d63(0x172)](_0x19663c[_0x2e6d63(0x174)]['id'],_0x4908ea),deletePushRecovery(_0x19663c[_0x2e6d63(0xfa)]),{'action':_0x2e6d63(0x15c),'journeyId':_0x19663c[_0x2e6d63(0x174)]['id'],'embeddedSegmentNameToId':_0x5bb7bd};}}return deletePushRecovery(_0x19663c[_0x2e6d63(0xfa)]),{'action':_0x2e6d63(0x173),'journeyId':_0x19663c[_0x2e6d63(0x174)]?.['id'],'embeddedSegmentNameToId':_0x5bb7bd};}function findSegmentCriteriaLocation(_0x5d173f,_0x47f159){const _0x4ad693=a152_0xdbe0a,_0x2023d5=_0x5d173f[_0x4ad693(0x141)]||_0x5d173f[_0x4ad693(0x1d0)]?.[0x0]?.['stages']||[];let _0x399a5b=_0x4ad693(0x110),_0x3e4afe=_0x47f159;const _0x28a0d6=_0x5d173f[_0x4ad693(0x10a)]||_0x5d173f[_0x4ad693(0x1d0)]?.[0x0]?.[_0x4ad693(0x10a)];if(_0x28a0d6?.['segment']===_0x47f159)return{'stageName':'goal','criteriaName':_0x28a0d6[_0x4ad693(0x10d)]||_0x47f159};_0x131301:for(const _0xf08e86 of _0x2023d5){if(_0xf08e86[_0x4ad693(0x105)]?.['segment']===_0x47f159){_0x399a5b=_0xf08e86[_0x4ad693(0x10d)],_0x3e4afe=_0xf08e86[_0x4ad693(0x105)][_0x4ad693(0x10d)]||_0x47f159;break;}if(_0xf08e86[_0x4ad693(0x1ba)])for(const _0x5602b3 of _0xf08e86['steps']){if(_0x5602b3[_0x4ad693(0x146)]==='decision_point'&&_0x5602b3['with']?.[_0x4ad693(0x19c)])for(const _0xc45114 of _0x5602b3[_0x4ad693(0x15d)]['branches']){if(_0xc45114[_0x4ad693(0x1c4)]===_0x47f159){_0x399a5b=_0xf08e86[_0x4ad693(0x10d)],_0x3e4afe=_0xc45114[_0x4ad693(0x10d)]||_0x47f159;break _0x131301;}}}}return{'stageName':_0x399a5b,'criteriaName':_0x3e4afe};}async function executeThreeStepJourneyCreate(_0x4b071a,_0x139d09,_0x1e26c3,_0x387b64,_0x2986f1,_0x32bc37,_0x33791f,_0x477491){const _0x36c6a3=a152_0xdbe0a,{activationDefToCreateRequest:_0x63dfb3,yamlRuleToApi:_0x319327}=_0x477491,{pendingEmbeddedSegments:_0x59af82,pendingEmbeddedActivations:_0x4a4e10,embeddedSegmentNameToId:_0x4bcdfc}=_0x387b64,_0x139eac=JSON['parse'](JSON['stringify'](_0x1e26c3));ensureJourneyDefaults(_0x139eac[_0x36c6a3(0x13e)]),stripPendingIds(_0x139eac);const _0x341ec8=await _0x4b071a['journey'][_0x36c6a3(0x182)](_0x139eac),_0xde6fcf=_0x341ec8['id'],_0x332c77=new Map();for(const _0x54c4d3 of _0x341ec8[_0x36c6a3(0x13e)][_0x36c6a3(0xfd)]){_0x332c77[_0x36c6a3(0xca)](_0x54c4d3[_0x36c6a3(0x10d)][_0x36c6a3(0x17a)](),_0x54c4d3['id']);}recoverSegmentIdsFromPushRecovery(_0x139d09,_0x4bcdfc,_0x32bc37[_0x36c6a3(0x140)]);for(const [_0x34c23f,{definition:_0x3efd1b}]of _0x59af82){if(_0x4bcdfc['has'](_0x34c23f)){_0x33791f[_0x36c6a3(0x18a)]?.({'type':_0x36c6a3(0x16b),'journeyName':_0x139d09[_0x36c6a3(0x147)][_0x36c6a3(0x10d)],'segmentName':_0x34c23f});continue;}const _0x578020=generateDeterministicJourneySegmentName(_0x139d09[_0x36c6a3(0x147)][_0x36c6a3(0x10d)],_0x34c23f);_0x33791f['onProgress']?.({'type':_0x36c6a3(0x144),'journeyName':_0x139d09['yamlConfig'][_0x36c6a3(0x10d)],'segmentName':_0x34c23f});const _0x4f6a5e=createSegmentIdResolver(_0x32bc37[_0x36c6a3(0x140)],_0x34c23f),_0x6933d8=await resolveRuleSegmentIds(_0x3efd1b[_0x36c6a3(0x180)],_0x4f6a5e),_0x3aeff1=await createOrRecoverEmbeddedSegment(_0x4b071a,_0x139d09,{'localName':_0x34c23f,'uniqueSegmentName':_0x578020,'description':_0x3efd1b['description']||_0x36c6a3(0x19b)+_0x34c23f,'journeyId':_0xde6fcf,'resolvedRule':_0x6933d8,'parentId':_0x2986f1['parentId'],'folderId':_0x2986f1[_0x36c6a3(0x13a)]||''},_0x319327);_0x4bcdfc[_0x36c6a3(0xca)](_0x34c23f,_0x3aeff1),_0x32bc37[_0x36c6a3(0x140)]['set'](_0x34c23f,_0x3aeff1),_0x33791f[_0x36c6a3(0x18a)]?.({'type':_0x36c6a3(0x16b),'journeyName':_0x139d09[_0x36c6a3(0x147)][_0x36c6a3(0x10d)],'segmentName':_0x34c23f});}const _0x14a0d7=new Map();for(const [_0x307f32,_0x56a063]of _0x4a4e10){_0x33791f[_0x36c6a3(0x18a)]?.({'type':_0x36c6a3(0xd6),'journeyName':_0x139d09[_0x36c6a3(0x147)]['name'],'activationName':_0x307f32});const _0x12233e=await _0x63dfb3(_0x56a063,_0x32bc37[_0x36c6a3(0x160)]),_0x143468={..._0x12233e,..._0x56a063[_0x36c6a3(0x16a)]!==undefined&&{'runAfterJourneyRefresh':_0x56a063[_0x36c6a3(0x16a)]}},_0x14f16e=await _0x4b071a[_0x36c6a3(0xf0)]['createActivation'](_0xde6fcf,_0x143468);_0x14a0d7[_0x36c6a3(0xca)](_0x307f32,_0x14f16e['id']),_0x387b64[_0x36c6a3(0x151)]['set'](_0x307f32,_0x14f16e['id']),_0x33791f['onProgress']?.({'type':_0x36c6a3(0x1b3),'journeyName':_0x139d09[_0x36c6a3(0x147)][_0x36c6a3(0x10d)],'activationName':_0x307f32});}const _0x87bfb5=JSON[_0x36c6a3(0x1bb)](JSON[_0x36c6a3(0x10f)](_0x1e26c3));return _0x87bfb5['id']=_0xde6fcf,ensureJourneyDefaults(_0x87bfb5[_0x36c6a3(0x13e)]),resolvePendingIdsInRequest(_0x87bfb5,_0x1e26c3,_0x332c77,_0x4bcdfc,_0x14a0d7,_0x33791f),await _0x4b071a[_0x36c6a3(0xf0)]['update'](_0xde6fcf,_0x87bfb5),deletePushRecovery(_0x139d09[_0x36c6a3(0xfa)]),{'action':_0x36c6a3(0x17e),'journeyId':_0xde6fcf,'embeddedSegmentNameToId':_0x4bcdfc};}export function stripWaitStepPendingIds(_0x4073d4){const _0x27d5c5=a152_0xdbe0a,_0x21f6ef=_0x4073d4[_0x27d5c5(0x149)]&&isPendingSegmentId(_0x4073d4[_0x27d5c5(0x149)]),_0x55db61=_0x4073d4[_0x27d5c5(0xfb)]?.['some'](_0x9ef091=>_0x9ef091[_0x27d5c5(0xe5)]&&isPendingSegmentId(_0x9ef091[_0x27d5c5(0xe5)]));(_0x21f6ef||_0x55db61)&&(_0x4073d4[_0x27d5c5(0x12f)]=_0x27d5c5(0x137),_0x4073d4[_0x27d5c5(0x11d)]=0x1,_0x4073d4[_0x27d5c5(0x13c)]=_0x27d5c5(0x1bd),delete _0x4073d4['conditionSegmentId'],delete _0x4073d4['conditionTimeoutDuration'],delete _0x4073d4[_0x27d5c5(0x1a6)],delete _0x4073d4[_0x27d5c5(0xfb)]);}export function resolveWaitStepPendingIds(_0x37bd9e,_0x278143,_0xd7af4,_0x542b2c){const _0x4e8e77=a152_0xdbe0a;if(_0x278143[_0x4e8e77(0x149)]&&isPendingSegmentId(_0x278143[_0x4e8e77(0x149)])){const _0x5cce02=_0xd7af4(_0x278143[_0x4e8e77(0x149)],_0x4e8e77(0x100)+_0x542b2c+'\x27\x20wait\x20condition');_0x5cce02&&(_0x37bd9e[_0x4e8e77(0x12f)]=_0x4e8e77(0x16f),_0x37bd9e[_0x4e8e77(0x149)]=_0x5cce02,delete _0x37bd9e[_0x4e8e77(0x11d)],delete _0x37bd9e[_0x4e8e77(0x13c)],_0x278143['conditionTimeoutDuration']!==undefined&&(_0x37bd9e['conditionTimeoutDuration']=_0x278143[_0x4e8e77(0x11a)]),_0x278143[_0x4e8e77(0x1a6)]&&(_0x37bd9e['conditionTimeoutUnit']=_0x278143['conditionTimeoutUnit']));}if(_0x278143[_0x4e8e77(0xfb)]){const _0x13d9bf=_0x278143[_0x4e8e77(0xfb)]['some'](_0x78c4b0=>_0x78c4b0['segmentId']&&isPendingSegmentId(_0x78c4b0['segmentId']));if(_0x13d9bf){const _0x33d72b=_0x278143[_0x4e8e77(0xfb)][_0x4e8e77(0x114)](_0x397dd8=>{const _0xcae593=_0x4e8e77;if(_0x397dd8[_0xcae593(0xe5)]&&isPendingSegmentId(_0x397dd8[_0xcae593(0xe5)])){const _0x31db3a=_0xd7af4(_0x397dd8[_0xcae593(0xe5)],_0xcae593(0x100)+_0x542b2c+_0xcae593(0x1cc));return{..._0x397dd8,'segmentId':_0x31db3a||_0x397dd8[_0xcae593(0xe5)]};}return{..._0x397dd8};});_0x37bd9e[_0x4e8e77(0x12f)]=_0x4e8e77(0x16f),_0x37bd9e[_0x4e8e77(0xfb)]=_0x33d72b,delete _0x37bd9e[_0x4e8e77(0x11d)],delete _0x37bd9e[_0x4e8e77(0x13c)],delete _0x37bd9e[_0x4e8e77(0x149)],delete _0x37bd9e[_0x4e8e77(0x11a)],delete _0x37bd9e[_0x4e8e77(0x1a6)];}}}function stripPendingIds(_0x3872a1){const _0xc70f60=a152_0xdbe0a;_0x3872a1[_0xc70f60(0x13e)][_0xc70f60(0x10a)]?.[_0xc70f60(0xe5)]&&isPendingSegmentId(_0x3872a1['attributes'][_0xc70f60(0x10a)][_0xc70f60(0xe5)])&&delete _0x3872a1[_0xc70f60(0x13e)][_0xc70f60(0x10a)];for(const _0x1f3396 of _0x3872a1['attributes'][_0xc70f60(0xfd)]||[]){_0x1f3396[_0xc70f60(0xcf)]?.['segmentId']&&isPendingSegmentId(_0x1f3396['entryCriteria'][_0xc70f60(0xe5)])&&delete _0x1f3396[_0xc70f60(0xcf)];_0x1f3396[_0xc70f60(0x16d)]?.[_0xc70f60(0xe5)]&&isPendingSegmentId(_0x1f3396[_0xc70f60(0x16d)]['segmentId'])&&delete _0x1f3396[_0xc70f60(0x16d)];_0x1f3396[_0xc70f60(0xd5)]&&(_0x1f3396[_0xc70f60(0xd5)]=_0x1f3396['exitCriterias'][_0xc70f60(0xf2)](_0x351a26=>!_0x351a26['segmentId']||!isPendingSegmentId(_0x351a26[_0xc70f60(0xe5)])));if(_0x1f3396[_0xc70f60(0x1ba)])for(const _0x1086a9 of Object[_0xc70f60(0x148)](_0x1f3396['steps'])){const _0x9363a6=_0x1f3396[_0xc70f60(0x1ba)][_0x1086a9];_0x9363a6[_0xc70f60(0x146)]===_0xc70f60(0x187)&&_0x9363a6[_0xc70f60(0x1ab)]&&isPendingActivationId(_0x9363a6[_0xc70f60(0x1ab)])&&(_0x9363a6[_0xc70f60(0x1ab)]='');if(_0x9363a6[_0xc70f60(0x146)]===_0xc70f60(0x199)&&_0x9363a6['branches'])for(const _0x387021 of _0x9363a6[_0xc70f60(0x19c)]){_0x387021['segmentId']&&isPendingSegmentId(_0x387021['segmentId'])&&(_0x387021[_0xc70f60(0xe5)]='');}_0x9363a6[_0xc70f60(0x146)]===_0xc70f60(0x156)&&stripWaitStepPendingIds(_0x9363a6);}}}function resolvePendingIdsInRequest(_0x32b31f,_0x4a3599,_0x13c225,_0x58b35a,_0x27395e,_0x4d1b95){const _0x45495e=a152_0xdbe0a,_0x3d642c=(_0x3cd003,_0x27cdaf)=>{const _0x4a66d4=a152_0x3e4e;if(!isPendingSegmentId(_0x3cd003))return _0x3cd003;const _0x1b2438=extractPendingSegmentName(_0x3cd003),_0x11ba8a=_0x58b35a['get'](_0x1b2438);return!_0x11ba8a&&_0x4d1b95[_0x4a66d4(0x118)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x1b2438+_0x4a66d4(0xd3)+_0x27cdaf),_0x11ba8a;};if(_0x32b31f[_0x45495e(0x13e)][_0x45495e(0x10a)]?.[_0x45495e(0xe5)]&&isPendingSegmentId(_0x32b31f[_0x45495e(0x13e)][_0x45495e(0x10a)][_0x45495e(0xe5)])){const _0x2800df=_0x3d642c(_0x32b31f['attributes'][_0x45495e(0x10a)][_0x45495e(0xe5)],'goal\x20criteria');_0x2800df&&(_0x32b31f[_0x45495e(0x13e)][_0x45495e(0x10a)][_0x45495e(0xe5)]=_0x2800df);}for(const _0x15a1ee of _0x32b31f[_0x45495e(0x13e)][_0x45495e(0xfd)]||[]){const _0x58112c=_0x13c225[_0x45495e(0x14b)](_0x15a1ee[_0x45495e(0x10d)][_0x45495e(0x17a)]());_0x58112c&&(_0x15a1ee['id']=_0x58112c);if(_0x15a1ee[_0x45495e(0xcf)]?.['segmentId']&&isPendingSegmentId(_0x15a1ee[_0x45495e(0xcf)][_0x45495e(0xe5)])){const _0x41a039=_0x3d642c(_0x15a1ee[_0x45495e(0xcf)][_0x45495e(0xe5)],_0x45495e(0x100)+_0x15a1ee[_0x45495e(0x10d)]+_0x45495e(0x1b7));_0x41a039&&(_0x15a1ee[_0x45495e(0xcf)][_0x45495e(0xe5)]=_0x41a039);}if(_0x15a1ee['exitCriterias'])for(const _0x19b468 of _0x15a1ee[_0x45495e(0xd5)]){if(_0x19b468[_0x45495e(0xe5)]&&isPendingSegmentId(_0x19b468[_0x45495e(0xe5)])){const _0x13a4d1=_0x3d642c(_0x19b468[_0x45495e(0xe5)],_0x45495e(0x100)+_0x15a1ee[_0x45495e(0x10d)]+_0x45495e(0x171));_0x13a4d1&&(_0x19b468[_0x45495e(0xe5)]=_0x13a4d1);}}if(_0x15a1ee['milestone']?.[_0x45495e(0xe5)]&&isPendingSegmentId(_0x15a1ee[_0x45495e(0x16d)][_0x45495e(0xe5)])){const _0x109ec5=_0x3d642c(_0x15a1ee[_0x45495e(0x16d)][_0x45495e(0xe5)],'stage\x20\x27'+_0x15a1ee[_0x45495e(0x10d)]+_0x45495e(0x194));_0x109ec5&&(_0x15a1ee[_0x45495e(0x16d)][_0x45495e(0xe5)]=_0x109ec5);}if(_0x15a1ee['steps']){const _0x689636=_0x32694d=>_0x4a3599[_0x45495e(0x13e)][_0x45495e(0xfd)]?.[_0x45495e(0x1a1)](_0xe8d53=>_0xe8d53['name'][_0x45495e(0x17a)]()===_0x15a1ee[_0x45495e(0x10d)][_0x45495e(0x17a)]())?.[_0x45495e(0x1ba)]?.[_0x32694d];for(const _0x2aa980 of Object['keys'](_0x15a1ee[_0x45495e(0x1ba)])){const _0x1e1d02=_0x15a1ee['steps'][_0x2aa980],_0x375c9f=_0x689636(_0x2aa980);if(_0x1e1d02['type']===_0x45495e(0x187)&&_0x1e1d02[_0x45495e(0x1ab)]&&(isPendingActivationId(_0x1e1d02[_0x45495e(0x1ab)])||_0x1e1d02[_0x45495e(0x1ab)]==='')){if(_0x375c9f?.[_0x45495e(0x1ab)]&&isPendingActivationId(_0x375c9f[_0x45495e(0x1ab)])){const _0x4cc057=extractPendingActivationName(_0x375c9f[_0x45495e(0x1ab)]),_0x1e15b6=_0x27395e[_0x45495e(0x14b)](_0x4cc057);_0x1e15b6&&(_0x1e1d02[_0x45495e(0x1ab)]=_0x1e15b6);}}if(_0x1e1d02['type']===_0x45495e(0x199)&&_0x1e1d02[_0x45495e(0x19c)]&&_0x375c9f?.[_0x45495e(0x19c)])for(let _0x2bbe4b=0x0;_0x2bbe4b<_0x1e1d02[_0x45495e(0x19c)][_0x45495e(0x10e)];_0x2bbe4b++){const _0x2bb13b=_0x1e1d02[_0x45495e(0x19c)][_0x2bbe4b],_0x5c9488=_0x375c9f['branches'][_0x2bbe4b];if(_0x5c9488?.['segmentId']&&isPendingSegmentId(_0x5c9488[_0x45495e(0xe5)])){const _0x2bbfb5=_0x3d642c(_0x5c9488[_0x45495e(0xe5)],_0x45495e(0x100)+_0x15a1ee[_0x45495e(0x10d)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x2bb13b[_0x45495e(0x10d)]||_0x2bbe4b)+'\x27');_0x2bbfb5&&(_0x2bb13b[_0x45495e(0xe5)]=_0x2bbfb5);}}_0x1e1d02[_0x45495e(0x146)]===_0x45495e(0x156)&&_0x375c9f?.[_0x45495e(0x146)]==='WaitStep'&&resolveWaitStepPendingIds(_0x1e1d02,_0x375c9f,_0x3d642c,_0x15a1ee[_0x45495e(0x10d)]);}}}}
@@ -1 +1 @@
1
- (function(_0x2ff2fa,_0x7cf32b){const _0x5b76c1=a153_0x5f8c,_0x46fec6=_0x2ff2fa();while(!![]){try{const _0x1090c7=parseInt(_0x5b76c1(0x189))/0x1*(parseInt(_0x5b76c1(0x18e))/0x2)+-parseInt(_0x5b76c1(0x195))/0x3*(parseInt(_0x5b76c1(0x185))/0x4)+-parseInt(_0x5b76c1(0x18b))/0x5*(parseInt(_0x5b76c1(0x184))/0x6)+parseInt(_0x5b76c1(0x193))/0x7*(-parseInt(_0x5b76c1(0x192))/0x8)+parseInt(_0x5b76c1(0x188))/0x9+-parseInt(_0x5b76c1(0x196))/0xa*(parseInt(_0x5b76c1(0x18a))/0xb)+parseInt(_0x5b76c1(0x190))/0xc*(parseInt(_0x5b76c1(0x18f))/0xd);if(_0x1090c7===_0x7cf32b)break;else _0x46fec6['push'](_0x46fec6['shift']());}catch(_0x146937){_0x46fec6['push'](_0x46fec6['shift']());}}}(a153_0x12fc,0x78b92));export function buildFolderIdToPathMap(_0x8b32d7){const _0x300905=a153_0x5f8c,_0x4407fc=new Map(),_0x5b5fae=new Map();for(const _0x58d479 of _0x8b32d7){_0x5b5fae['set'](_0x58d479['id'],_0x58d479);}const _0x39c252=new Set();for(const _0x5b2f33 of _0x8b32d7){!_0x5b2f33['parentFolderId']&&_0x39c252[_0x300905(0x194)](_0x5b2f33['id']);}function _0x310e79(_0xb3170c){const _0x51041e=_0x300905;if(_0x4407fc[_0x51041e(0x191)](_0xb3170c['id']))return _0x4407fc['get'](_0xb3170c['id']);if(_0x39c252['has'](_0xb3170c['id']))return _0x4407fc[_0x51041e(0x18d)](_0xb3170c['id'],''),'';if(_0xb3170c[_0x51041e(0x186)]){const _0x25146d=_0x5b5fae[_0x51041e(0x18c)](_0xb3170c[_0x51041e(0x186)]);if(_0x25146d){const _0x1eb114=_0x310e79(_0x25146d),_0x4cc0de=_0x1eb114?_0x1eb114+'/'+_0xb3170c[_0x51041e(0x187)]:_0xb3170c[_0x51041e(0x187)];return _0x4407fc[_0x51041e(0x18d)](_0xb3170c['id'],_0x4cc0de),_0x4cc0de;}}const _0x36959a=_0xb3170c[_0x51041e(0x187)];return _0x4407fc[_0x51041e(0x18d)](_0xb3170c['id'],_0x36959a),_0x36959a;}for(const _0x4f6bef of _0x8b32d7){_0x310e79(_0x4f6bef);}return _0x4407fc;}export function buildFolderPathToIdMap(_0x5df35b){const _0x2bcb04=a153_0x5f8c,_0x30116c=new Map(),_0x4b590c=new Map();for(const _0x4a3644 of _0x5df35b){_0x4b590c['set'](_0x4a3644['id'],_0x4a3644);}const _0x184372=new Set();for(const _0x23044d of _0x5df35b){!_0x23044d[_0x2bcb04(0x186)]&&_0x184372['add'](_0x23044d['id']);}function _0x5dd8e3(_0x31f0b7){const _0x2e259b=_0x2bcb04;if(_0x184372[_0x2e259b(0x191)](_0x31f0b7['id']))return'';if(_0x31f0b7[_0x2e259b(0x186)]){const _0x10a3e=_0x4b590c[_0x2e259b(0x18c)](_0x31f0b7[_0x2e259b(0x186)]);if(_0x10a3e){const _0x5ba876=_0x5dd8e3(_0x10a3e);return _0x5ba876?_0x5ba876+'/'+_0x31f0b7[_0x2e259b(0x187)]:_0x31f0b7[_0x2e259b(0x187)];}}return _0x31f0b7[_0x2e259b(0x187)];}for(const _0x11dd17 of _0x5df35b){const _0x480e5d=_0x5dd8e3(_0x11dd17);_0x30116c[_0x2bcb04(0x18d)](_0x480e5d,_0x11dd17['id']);}return _0x30116c;}export function buildFolderMaps(_0x4280f9){const _0x34dea7=buildFolderIdToPathMap(_0x4280f9),_0x4349a0=new Map();for(const [_0x5b8f0a,_0x3dffe7]of _0x34dea7){_0x4349a0['set'](_0x3dffe7,_0x5b8f0a);}return{'idToPath':_0x34dea7,'pathToId':_0x4349a0};}export function getFolderPath(_0xbff6fb,_0x3a0f8d){const _0x3644f0=a153_0x5f8c;if(!_0xbff6fb)return'';return _0x3a0f8d[_0x3644f0(0x18c)](_0xbff6fb)??'';}function a153_0x5f8c(_0x5b8810,_0xa19935){_0x5b8810=_0x5b8810-0x184;const _0x12fcc2=a153_0x12fc();let _0x5f8ca3=_0x12fcc2[_0x5b8810];return _0x5f8ca3;}function a153_0x12fc(){const _0x2fc2ee=['has','8fZrMfY','4141865VGSgyK','add','2586xTcWKs','9836470tTrsEq','3113850YUQRFS','508cHvOsH','parentFolderId','name','4359483RXqNFj','75FhmlDl','11gGQgAq','5ljShhS','get','set','5062EdhESX','674687ZfFmQR','468dgjIhJ'];a153_0x12fc=function(){return _0x2fc2ee;};return a153_0x12fc();}
1
+ function a153_0x473f(){const _0x439a48=['74abZGSm','12UQydwx','238yKnPKF','parentFolderId','20879UPaRWp','88380oQSpol','4mqPoKA','name','has','1270lTCfzq','add','330304Otkeij','605964wfmZxX','22080256WRYdLa','3295900hMmmrP','4532175xLpKEC','set','get'];a153_0x473f=function(){return _0x439a48;};return a153_0x473f();}(function(_0x465cf2,_0x2a626d){const _0x4228bc=a153_0x335e,_0x329af4=_0x465cf2();while(!![]){try{const _0x57717f=-parseInt(_0x4228bc(0x7a))/0x1*(parseInt(_0x4228bc(0x76))/0x2)+-parseInt(_0x4228bc(0x73))/0x3*(-parseInt(_0x4228bc(0x7c))/0x4)+-parseInt(_0x4228bc(0x72))/0x5+parseInt(_0x4228bc(0x70))/0x6+parseInt(_0x4228bc(0x78))/0x7*(parseInt(_0x4228bc(0x6f))/0x8)+parseInt(_0x4228bc(0x7b))/0x9*(parseInt(_0x4228bc(0x6d))/0xa)+-parseInt(_0x4228bc(0x71))/0xb*(parseInt(_0x4228bc(0x77))/0xc);if(_0x57717f===_0x2a626d)break;else _0x329af4['push'](_0x329af4['shift']());}catch(_0xf96070){_0x329af4['push'](_0x329af4['shift']());}}}(a153_0x473f,0xc9164));export function buildFolderIdToPathMap(_0xead580){const _0x357dd1=a153_0x335e,_0x35ec93=new Map(),_0x3e1578=new Map();for(const _0x528af0 of _0xead580){_0x3e1578[_0x357dd1(0x74)](_0x528af0['id'],_0x528af0);}const _0x734071=new Set();for(const _0x403e83 of _0xead580){!_0x403e83['parentFolderId']&&_0x734071[_0x357dd1(0x6e)](_0x403e83['id']);}function _0xd0c12a(_0x47eaa2){const _0x552a92=_0x357dd1;if(_0x35ec93[_0x552a92(0x6c)](_0x47eaa2['id']))return _0x35ec93[_0x552a92(0x75)](_0x47eaa2['id']);if(_0x734071['has'](_0x47eaa2['id']))return _0x35ec93[_0x552a92(0x74)](_0x47eaa2['id'],''),'';if(_0x47eaa2[_0x552a92(0x79)]){const _0x282e47=_0x3e1578[_0x552a92(0x75)](_0x47eaa2[_0x552a92(0x79)]);if(_0x282e47){const _0x4eacd8=_0xd0c12a(_0x282e47),_0x565f43=_0x4eacd8?_0x4eacd8+'/'+_0x47eaa2['name']:_0x47eaa2[_0x552a92(0x7d)];return _0x35ec93['set'](_0x47eaa2['id'],_0x565f43),_0x565f43;}}const _0x792798=_0x47eaa2['name'];return _0x35ec93[_0x552a92(0x74)](_0x47eaa2['id'],_0x792798),_0x792798;}for(const _0x19e462 of _0xead580){_0xd0c12a(_0x19e462);}return _0x35ec93;}export function buildFolderPathToIdMap(_0x1f0ba4){const _0x340d64=a153_0x335e,_0x1cc4a7=new Map(),_0x379a66=new Map();for(const _0x4835a5 of _0x1f0ba4){_0x379a66[_0x340d64(0x74)](_0x4835a5['id'],_0x4835a5);}const _0x27ed31=new Set();for(const _0x202be7 of _0x1f0ba4){!_0x202be7[_0x340d64(0x79)]&&_0x27ed31['add'](_0x202be7['id']);}function _0x577655(_0xd5c5e7){const _0x3e8f7f=_0x340d64;if(_0x27ed31[_0x3e8f7f(0x6c)](_0xd5c5e7['id']))return'';if(_0xd5c5e7[_0x3e8f7f(0x79)]){const _0x500e38=_0x379a66[_0x3e8f7f(0x75)](_0xd5c5e7[_0x3e8f7f(0x79)]);if(_0x500e38){const _0x49afdb=_0x577655(_0x500e38);return _0x49afdb?_0x49afdb+'/'+_0xd5c5e7[_0x3e8f7f(0x7d)]:_0xd5c5e7[_0x3e8f7f(0x7d)];}}return _0xd5c5e7['name'];}for(const _0x5687bf of _0x1f0ba4){const _0x5668fb=_0x577655(_0x5687bf);_0x1cc4a7[_0x340d64(0x74)](_0x5668fb,_0x5687bf['id']);}return _0x1cc4a7;}export function buildFolderMaps(_0x23152e){const _0x5e65c5=buildFolderIdToPathMap(_0x23152e),_0x4a118b=new Map();for(const [_0xb185f8,_0x2bfb0f]of _0x5e65c5){_0x4a118b['set'](_0x2bfb0f,_0xb185f8);}return{'idToPath':_0x5e65c5,'pathToId':_0x4a118b};}function a153_0x335e(_0x268dbe,_0x23148c){_0x268dbe=_0x268dbe-0x6c;const _0x473ff3=a153_0x473f();let _0x335e89=_0x473ff3[_0x268dbe];return _0x335e89;}export function getFolderPath(_0x43fa0a,_0x6a751){const _0x2801c8=a153_0x335e;if(!_0x43fa0a)return'';return _0x6a751[_0x2801c8(0x75)](_0x43fa0a)??'';}
@@ -1 +1 @@
1
- (function(_0x1fd062,_0x4961d4){const _0x3a1326=a154_0x1de0,_0x3373c4=_0x1fd062();while(!![]){try{const _0x46fd01=-parseInt(_0x3a1326(0xfe))/0x1*(parseInt(_0x3a1326(0x103))/0x2)+-parseInt(_0x3a1326(0x11e))/0x3+-parseInt(_0x3a1326(0x121))/0x4*(-parseInt(_0x3a1326(0x107))/0x5)+parseInt(_0x3a1326(0x10d))/0x6*(-parseInt(_0x3a1326(0x106))/0x7)+parseInt(_0x3a1326(0x122))/0x8*(parseInt(_0x3a1326(0x11b))/0x9)+-parseInt(_0x3a1326(0xf3))/0xa*(parseInt(_0x3a1326(0x112))/0xb)+parseInt(_0x3a1326(0x10f))/0xc;if(_0x46fd01===_0x4961d4)break;else _0x3373c4['push'](_0x3373c4['shift']());}catch(_0x21b646){_0x3373c4['push'](_0x3373c4['shift']());}}}(a154_0x4050,0x41ce9));import a154_0x18eb71 from'path';import{parse as a154_0xaf2578}from'yaml';function a154_0x4050(){const _0xadf858=['Cannot\x20split\x20empty\x20path','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','isAbsolute','slice','length','resolve','endsWith','2BCQeUn','push','pop','startsWith','trim','281210TRsWTn','dirname','Path\x20segment\x20cannot\x20be\x20empty','981316Gdxzkf','10OQjoCA','filter','exists','segments','replace','raw','6FFvNhk','parent_segment','10276224XBbedP','Cannot\x20navigate\x20above\x20root','readFile','1907686QUirXY','File\x20not\x20found:\x20','.yaml','relative','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','name','split','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','parse','9uWPXXK','join','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','1331676lopYbV','No\x20tdx.json\x20found\x20for\x20file:\x20','root','551228TDWPTY','2797768VcjECQ','.yml','20BjDpLF','journey','tdx.json','substring'];a154_0x4050=function(){return _0xadf858;};return a154_0x4050();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x48b2d3){const _0x8cfeda=a154_0x1de0;if(!_0x48b2d3||_0x48b2d3['trim']()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x58078b=_0x48b2d3['trim']();if(_0x58078b==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x48b2d3};const _0x150d73=_0x58078b[_0x8cfeda(0x101)]('/')?_0x58078b[_0x8cfeda(0xf6)](0x1):_0x58078b,_0x110157=_0x150d73[_0x8cfeda(0x118)]('/')[_0x8cfeda(0x108)](_0x2e3888=>_0x2e3888!=='');if(_0x110157[_0x8cfeda(0xfb)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x2e77c8=_0x58078b[_0x8cfeda(0x101)]('/')||!isRelativePathSegment(_0x110157[0x0]);for(const _0xd0db8 of _0x110157){validatePathSegment(_0xd0db8);}return{'segments':_0x110157,'isAbsolute':_0x2e77c8,'raw':_0x48b2d3};}function isRelativePathSegment(_0x294c24){return _0x294c24==='.'||_0x294c24==='..';}function validatePathSegment(_0x1de79a){const _0x4954ca=a154_0x1de0;if(_0x1de79a==='')throw new Error(_0x4954ca(0x105));if(_0x1de79a==='.'||_0x1de79a==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x1de79a))throw new Error(_0x4954ca(0x116)+_0x1de79a);if(_0x1de79a!==_0x1de79a[_0x4954ca(0x102)]()){}}export function validatePath(_0x274e6e){const _0x2ed725=a154_0x1de0;if(_0x274e6e[_0x2ed725(0x10a)][_0x2ed725(0xfb)]===0x0&&!_0x274e6e[_0x2ed725(0xf9)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x274e6e['isAbsolute']){if(_0x274e6e['segments'][0x0]==='..')throw new Error(_0x2ed725(0x119));let _0x36871c=0x0;for(const _0x50a65b of _0x274e6e[_0x2ed725(0x10a)]){if(_0x50a65b==='..'){if(_0x36871c===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x36871c--;}else _0x50a65b!=='.'&&_0x36871c++;}}}export function joinPaths(_0x3b4a61,_0x2a1444){const _0x2bc744=a154_0x1de0;if(!_0x3b4a61||_0x3b4a61==='/')return _0x2a1444;if(!_0x2a1444||_0x2a1444==='.')return _0x3b4a61;if(_0x2a1444['startsWith']('/'))return _0x2a1444;const _0x26afaf=parsePath(_0x3b4a61),_0x38f1fd=parsePath(_0x2a1444),_0x22f447=[..._0x26afaf[_0x2bc744(0x10a)]];for(const _0x2eeea4 of _0x38f1fd[_0x2bc744(0x10a)]){if(_0x2eeea4==='.')continue;else{if(_0x2eeea4==='..'){if(_0x22f447[_0x2bc744(0xfb)]===0x0)throw new Error(_0x2bc744(0x110));_0x22f447[_0x2bc744(0x100)]();}else _0x22f447[_0x2bc744(0xff)](_0x2eeea4);}}const _0x5e6f95=_0x22f447[_0x2bc744(0x11c)]('/');return _0x26afaf[_0x2bc744(0x10c)][_0x2bc744(0x101)]('/')?'/'+_0x5e6f95:_0x5e6f95;}export function normalizePath(_0x543c12){const _0x3c8597=a154_0x1de0,_0x2b666a=parsePath(_0x543c12),_0x2f86b4=[];for(const _0x4f6f6f of _0x2b666a[_0x3c8597(0x10a)]){if(_0x4f6f6f==='.')continue;else{if(_0x4f6f6f==='..'){if(_0x2f86b4[_0x3c8597(0xfb)]===0x0){if(_0x2b666a[_0x3c8597(0xf9)])throw new Error(_0x3c8597(0x110));_0x2f86b4[_0x3c8597(0xff)]('..');}else _0x2f86b4[_0x2f86b4[_0x3c8597(0xfb)]-0x1]==='..'?_0x2f86b4[_0x3c8597(0xff)]('..'):_0x2f86b4[_0x3c8597(0x100)]();}else _0x2f86b4[_0x3c8597(0xff)](_0x4f6f6f);}}if(_0x2f86b4[_0x3c8597(0xfb)]===0x0)return _0x2b666a['isAbsolute']?'/':'.';const _0x4202c4=_0x2f86b4[_0x3c8597(0x11c)]('/');return _0x2b666a[_0x3c8597(0x10c)][_0x3c8597(0x101)]('/')?'/'+_0x4202c4:_0x4202c4;}export function getParentPath(_0x22565d){const _0x6fd908=a154_0x1de0,_0x2bbf98=parsePath(_0x22565d);if(_0x2bbf98[_0x6fd908(0x10a)][_0x6fd908(0xfb)]<=0x1)return'/';const _0x23aeaa=_0x2bbf98[_0x6fd908(0x10a)]['slice'](0x0,-0x1)[_0x6fd908(0x11c)]('/');return _0x2bbf98[_0x6fd908(0x10c)][_0x6fd908(0x101)]('/')?'/'+_0x23aeaa:_0x23aeaa;}export function getBaseName(_0x479fd0){const _0x1d5737=a154_0x1de0,_0xa11fa2=parsePath(_0x479fd0);return _0xa11fa2['segments'][_0xa11fa2[_0x1d5737(0x10a)]['length']-0x1]||'';}export function isChildPath(_0x52ddac,_0x56865c){const _0x291c7b=a154_0x1de0,_0x13c576=parsePath(_0x52ddac),_0x530fe4=parsePath(_0x56865c);if(_0x13c576[_0x291c7b(0x10a)][_0x291c7b(0xfb)]<=_0x530fe4[_0x291c7b(0x10a)][_0x291c7b(0xfb)])return![];for(let _0x430385=0x0;_0x430385<_0x530fe4[_0x291c7b(0x10a)][_0x291c7b(0xfb)];_0x430385++){if(_0x13c576[_0x291c7b(0x10a)][_0x430385]!==_0x530fe4[_0x291c7b(0x10a)][_0x430385])return![];}return!![];}export function splitPath(_0x1a191b){const _0x424891=a154_0x1de0,_0x198d71=parsePath(_0x1a191b);if(_0x198d71[_0x424891(0x10a)][_0x424891(0xfb)]===0x0)throw new Error(_0x424891(0xf7));if(_0x198d71[_0x424891(0x10a)][_0x424891(0xfb)]===0x1)return{'parent':_0x198d71[_0x424891(0x10a)][0x0]};return{'parent':_0x198d71[_0x424891(0x10a)][0x0],'child':_0x198d71[_0x424891(0x10a)][_0x424891(0xfa)](0x1)['join']('/')};}function a154_0x1de0(_0x4afbcd,_0x2e040a){_0x4afbcd=_0x4afbcd-0xf3;const _0x4050ee=a154_0x4050();let _0x1de0ea=_0x4050ee[_0x4afbcd];return _0x1de0ea;}export function isYamlFilePath(_0x475a6a){const _0x28ee4c=a154_0x1de0;return _0x475a6a[_0x28ee4c(0xfd)](_0x28ee4c(0x123))||_0x475a6a[_0x28ee4c(0xfd)](_0x28ee4c(0x114));}export async function resolveYamlFilePath(_0x211783,_0x392812=nodeFileSystem){const _0x2d670a=a154_0x1de0,_0x28c5f9=a154_0x18eb71[_0x2d670a(0xfc)](_0x211783);if(!await _0x392812[_0x2d670a(0x109)](_0x28c5f9))throw new Error(_0x2d670a(0x113)+_0x211783);let _0x193086=a154_0x18eb71[_0x2d670a(0x104)](_0x28c5f9),_0x471c7c=null,_0x2d168b=null;const _0x32c93c=a154_0x18eb71[_0x2d670a(0x11a)](_0x193086)[_0x2d670a(0x120)];while(_0x193086!==_0x32c93c){const _0x5e7bd6=a154_0x18eb71['join'](_0x193086,_0x2d670a(0xf5));if(await _0x392812[_0x2d670a(0x109)](_0x5e7bd6)){_0x471c7c=_0x5e7bd6,_0x2d168b=_0x193086;break;}_0x193086=a154_0x18eb71[_0x2d670a(0x104)](_0x193086);}if(!_0x471c7c||!_0x2d168b)throw new Error(_0x2d670a(0x11f)+_0x211783+'\x0a'+_0x2d670a(0x11d));const _0x1be484=await _0x392812[_0x2d670a(0x111)](_0x471c7c),_0x419ac3=JSON[_0x2d670a(0x11a)](_0x1be484),_0x58f6fb=_0x419ac3[_0x2d670a(0x10e)];if(!_0x58f6fb)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x3098ab=await _0x392812[_0x2d670a(0x111)](_0x28c5f9),_0x39ef36=a154_0xaf2578(_0x3098ab),_0x243bf7=_0x39ef36[_0x2d670a(0x117)];if(!_0x243bf7)throw new Error(_0x2d670a(0xf8)+_0x211783);const _0x528584=_0x39ef36['type']===_0x2d670a(0xf4)?_0x2d670a(0xf4):'segment',_0x1e4241=a154_0x18eb71[_0x2d670a(0x115)](_0x2d168b,_0x28c5f9),_0x1f97fe=a154_0x18eb71['dirname'](_0x1e4241),_0x5781b8=_0x1f97fe==='.'?'':_0x1f97fe[_0x2d670a(0x10b)](/\\/g,'/'),_0x1012cb=_0x5781b8?_0x58f6fb+'/'+_0x5781b8+'/'+_0x243bf7:_0x58f6fb+'/'+_0x243bf7;return{'parentSegment':_0x58f6fb,'segmentName':_0x243bf7,'folderPath':_0x5781b8,'fullPath':_0x1012cb,'resourceType':_0x528584,'content':_0x3098ab};}
1
+ (function(_0xdef459,_0x2bb0a4){const _0x3a019d=a154_0x372a,_0x343fee=_0xdef459();while(!![]){try{const _0x273746=parseInt(_0x3a019d(0x10e))/0x1*(parseInt(_0x3a019d(0xf5))/0x2)+-parseInt(_0x3a019d(0x106))/0x3*(parseInt(_0x3a019d(0x113))/0x4)+-parseInt(_0x3a019d(0xee))/0x5*(-parseInt(_0x3a019d(0xfa))/0x6)+-parseInt(_0x3a019d(0x111))/0x7*(parseInt(_0x3a019d(0x103))/0x8)+parseInt(_0x3a019d(0xfb))/0x9*(-parseInt(_0x3a019d(0x10d))/0xa)+parseInt(_0x3a019d(0xeb))/0xb+-parseInt(_0x3a019d(0x102))/0xc*(-parseInt(_0x3a019d(0x117))/0xd);if(_0x273746===_0x2bb0a4)break;else _0x343fee['push'](_0x343fee['shift']());}catch(_0x5d29f0){_0x343fee['push'](_0x343fee['shift']());}}}(a154_0x41a6,0x59ba4));import a154_0x3e3a42 from'path';function a154_0x372a(_0x19bc9f,_0x291c7a){_0x19bc9f=_0x19bc9f-0xe7;const _0x41a6ca=a154_0x41a6();let _0x372aa6=_0x41a6ca[_0x19bc9f];return _0x372aa6;}import{parse as a154_0x18b5ca}from'yaml';function a154_0x41a6(){const _0x521a62=['Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','raw','journey','push','startsWith','filter','38748rEQMLy','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','exists','split','length','396JHYtFz','71613GACTpH','.yml','segment','resolve','readFile','segments','parent_segment','12tftvhG','2456632BNxjvH','Cannot\x20navigate\x20above\x20root','Path\x20segment\x20cannot\x20be\x20empty','441jPrxrv','slice','Relative\x20path\x20cannot\x20be\x20empty','name','type','isAbsolute','File\x20not\x20found:\x20','740jBliVN','29gCCzgs','relative','endsWith','7NXhzTU','Path\x20attempts\x20to\x20navigate\x20above\x20root','18812nGKKPe','dirname','Cannot\x20split\x20empty\x20path','join','11935859BwKtvU','pop','parse','No\x20tdx.json\x20found\x20for\x20file:\x20','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','root','4937911upUkiW','trim','substring','1960PISJIv'];a154_0x41a6=function(){return _0x521a62;};return a154_0x41a6();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x1f999e){const _0x183132=a154_0x372a;if(!_0x1f999e||_0x1f999e[_0x183132(0xec)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x337ce7=_0x1f999e[_0x183132(0xec)]();if(_0x337ce7==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x1f999e};const _0x126c92=_0x337ce7[_0x183132(0xf3)]('/')?_0x337ce7[_0x183132(0xed)](0x1):_0x337ce7,_0x358157=_0x126c92[_0x183132(0xf8)]('/')[_0x183132(0xf4)](_0x4b6dab=>_0x4b6dab!=='');if(_0x358157[_0x183132(0xf9)]===0x0)throw new Error(_0x183132(0xf6));const _0x3b1479=_0x337ce7['startsWith']('/')||!isRelativePathSegment(_0x358157[0x0]);for(const _0x3028fc of _0x358157){validatePathSegment(_0x3028fc);}return{'segments':_0x358157,'isAbsolute':_0x3b1479,'raw':_0x1f999e};}function isRelativePathSegment(_0x3e4f5d){return _0x3e4f5d==='.'||_0x3e4f5d==='..';}function validatePathSegment(_0x1f24a5){const _0x4ff746=a154_0x372a;if(_0x1f24a5==='')throw new Error(_0x4ff746(0x105));if(_0x1f24a5==='.'||_0x1f24a5==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x1f24a5))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x1f24a5);if(_0x1f24a5!==_0x1f24a5[_0x4ff746(0xec)]()){}}export function validatePath(_0x1ffe56){const _0x3e4e3d=a154_0x372a;if(_0x1ffe56[_0x3e4e3d(0x100)][_0x3e4e3d(0xf9)]===0x0&&!_0x1ffe56[_0x3e4e3d(0x10b)])throw new Error(_0x3e4e3d(0x108));if(_0x1ffe56[_0x3e4e3d(0x10b)]){if(_0x1ffe56[_0x3e4e3d(0x100)][0x0]==='..')throw new Error(_0x3e4e3d(0xef));let _0xe35e93=0x0;for(const _0x5841e8 of _0x1ffe56[_0x3e4e3d(0x100)]){if(_0x5841e8==='..'){if(_0xe35e93===0x0)throw new Error(_0x3e4e3d(0x112));_0xe35e93--;}else _0x5841e8!=='.'&&_0xe35e93++;}}}export function joinPaths(_0x1a6dc1,_0x514150){const _0x1d3f5b=a154_0x372a;if(!_0x1a6dc1||_0x1a6dc1==='/')return _0x514150;if(!_0x514150||_0x514150==='.')return _0x1a6dc1;if(_0x514150[_0x1d3f5b(0xf3)]('/'))return _0x514150;const _0x430474=parsePath(_0x1a6dc1),_0x3b7391=parsePath(_0x514150),_0x4373c6=[..._0x430474[_0x1d3f5b(0x100)]];for(const _0x45477e of _0x3b7391[_0x1d3f5b(0x100)]){if(_0x45477e==='.')continue;else{if(_0x45477e==='..'){if(_0x4373c6[_0x1d3f5b(0xf9)]===0x0)throw new Error(_0x1d3f5b(0x104));_0x4373c6[_0x1d3f5b(0x118)]();}else _0x4373c6[_0x1d3f5b(0xf2)](_0x45477e);}}const _0xc65113=_0x4373c6[_0x1d3f5b(0x116)]('/');return _0x430474['raw']['startsWith']('/')?'/'+_0xc65113:_0xc65113;}export function normalizePath(_0x2fe8a8){const _0x5d379a=a154_0x372a,_0x14ec7e=parsePath(_0x2fe8a8),_0x5592b5=[];for(const _0x3149ce of _0x14ec7e[_0x5d379a(0x100)]){if(_0x3149ce==='.')continue;else{if(_0x3149ce==='..'){if(_0x5592b5['length']===0x0){if(_0x14ec7e[_0x5d379a(0x10b)])throw new Error(_0x5d379a(0x104));_0x5592b5['push']('..');}else _0x5592b5[_0x5592b5[_0x5d379a(0xf9)]-0x1]==='..'?_0x5592b5['push']('..'):_0x5592b5[_0x5d379a(0x118)]();}else _0x5592b5[_0x5d379a(0xf2)](_0x3149ce);}}if(_0x5592b5[_0x5d379a(0xf9)]===0x0)return _0x14ec7e[_0x5d379a(0x10b)]?'/':'.';const _0x1b5df6=_0x5592b5[_0x5d379a(0x116)]('/');return _0x14ec7e['raw'][_0x5d379a(0xf3)]('/')?'/'+_0x1b5df6:_0x1b5df6;}export function getParentPath(_0xe86a0b){const _0x235658=a154_0x372a,_0x54b2ee=parsePath(_0xe86a0b);if(_0x54b2ee[_0x235658(0x100)][_0x235658(0xf9)]<=0x1)return'/';const _0x17e084=_0x54b2ee[_0x235658(0x100)][_0x235658(0x107)](0x0,-0x1)['join']('/');return _0x54b2ee[_0x235658(0xf0)][_0x235658(0xf3)]('/')?'/'+_0x17e084:_0x17e084;}export function getBaseName(_0x289720){const _0x35ea66=a154_0x372a,_0x22c3a7=parsePath(_0x289720);return _0x22c3a7['segments'][_0x22c3a7[_0x35ea66(0x100)]['length']-0x1]||'';}export function isChildPath(_0x1689c1,_0xbb3742){const _0x50ebf6=a154_0x372a,_0x43abc4=parsePath(_0x1689c1),_0x493f90=parsePath(_0xbb3742);if(_0x43abc4['segments'][_0x50ebf6(0xf9)]<=_0x493f90[_0x50ebf6(0x100)][_0x50ebf6(0xf9)])return![];for(let _0x8f6018=0x0;_0x8f6018<_0x493f90['segments']['length'];_0x8f6018++){if(_0x43abc4[_0x50ebf6(0x100)][_0x8f6018]!==_0x493f90[_0x50ebf6(0x100)][_0x8f6018])return![];}return!![];}export function splitPath(_0xf6cf70){const _0x274c7b=a154_0x372a,_0x1f7478=parsePath(_0xf6cf70);if(_0x1f7478[_0x274c7b(0x100)][_0x274c7b(0xf9)]===0x0)throw new Error(_0x274c7b(0x115));if(_0x1f7478[_0x274c7b(0x100)][_0x274c7b(0xf9)]===0x1)return{'parent':_0x1f7478[_0x274c7b(0x100)][0x0]};return{'parent':_0x1f7478['segments'][0x0],'child':_0x1f7478[_0x274c7b(0x100)][_0x274c7b(0x107)](0x1)[_0x274c7b(0x116)]('/')};}export function isYamlFilePath(_0x1f8c43){const _0x24f10d=a154_0x372a;return _0x1f8c43[_0x24f10d(0x110)](_0x24f10d(0xfc))||_0x1f8c43[_0x24f10d(0x110)]('.yaml');}export async function resolveYamlFilePath(_0x5660a3,_0x3948a7=nodeFileSystem){const _0xea60=a154_0x372a,_0x709ee2=a154_0x3e3a42[_0xea60(0xfe)](_0x5660a3);if(!await _0x3948a7[_0xea60(0xf7)](_0x709ee2))throw new Error(_0xea60(0x10c)+_0x5660a3);let _0x3281f5=a154_0x3e3a42[_0xea60(0x114)](_0x709ee2),_0x5bc9ca=null,_0x192d59=null;const _0x153c3c=a154_0x3e3a42[_0xea60(0xe7)](_0x3281f5)[_0xea60(0xea)];while(_0x3281f5!==_0x153c3c){const _0x3492b9=a154_0x3e3a42[_0xea60(0x116)](_0x3281f5,'tdx.json');if(await _0x3948a7['exists'](_0x3492b9)){_0x5bc9ca=_0x3492b9,_0x192d59=_0x3281f5;break;}_0x3281f5=a154_0x3e3a42[_0xea60(0x114)](_0x3281f5);}if(!_0x5bc9ca||!_0x192d59)throw new Error(_0xea60(0xe8)+_0x5660a3+'\x0a'+_0xea60(0xe9));const _0x20fab5=await _0x3948a7[_0xea60(0xff)](_0x5bc9ca),_0x33132c=JSON[_0xea60(0xe7)](_0x20fab5),_0x35356d=_0x33132c[_0xea60(0x101)];if(!_0x35356d)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x348a63=await _0x3948a7[_0xea60(0xff)](_0x709ee2),_0x41f054=a154_0x18b5ca(_0x348a63),_0x17dbd9=_0x41f054[_0xea60(0x109)];if(!_0x17dbd9)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x5660a3);const _0xfc343=_0x41f054[_0xea60(0x10a)]===_0xea60(0xf1)?_0xea60(0xf1):_0xea60(0xfd),_0x6e77d2=a154_0x3e3a42[_0xea60(0x10f)](_0x192d59,_0x709ee2),_0x115910=a154_0x3e3a42[_0xea60(0x114)](_0x6e77d2),_0x38c557=_0x115910==='.'?'':_0x115910['replace'](/\\/g,'/'),_0x206db2=_0x38c557?_0x35356d+'/'+_0x38c557+'/'+_0x17dbd9:_0x35356d+'/'+_0x17dbd9;return{'parentSegment':_0x35356d,'segmentName':_0x17dbd9,'folderPath':_0x38c557,'fullPath':_0x206db2,'resourceType':_0xfc343,'content':_0x348a63};}
@@ -1 +1 @@
1
- (function(_0x30b99a,_0x36b5d5){const _0x7cea0d=a155_0x2b19,_0x3467af=_0x30b99a();while(!![]){try{const _0x4d6fe3=parseInt(_0x7cea0d(0xdf))/0x1*(parseInt(_0x7cea0d(0xe0))/0x2)+parseInt(_0x7cea0d(0xe4))/0x3*(parseInt(_0x7cea0d(0xda))/0x4)+-parseInt(_0x7cea0d(0xe7))/0x5*(parseInt(_0x7cea0d(0xe9))/0x6)+-parseInt(_0x7cea0d(0xd9))/0x7*(-parseInt(_0x7cea0d(0xe5))/0x8)+parseInt(_0x7cea0d(0xdc))/0x9*(-parseInt(_0x7cea0d(0xe1))/0xa)+parseInt(_0x7cea0d(0xdd))/0xb+parseInt(_0x7cea0d(0xe3))/0xc*(parseInt(_0x7cea0d(0xdb))/0xd);if(_0x4d6fe3===_0x36b5d5)break;else _0x3467af['push'](_0x3467af['shift']());}catch(_0x194eca){_0x3467af['push'](_0x3467af['shift']());}}}(a155_0x24f7,0x7a0c5));function a155_0x24f7(){const _0x525719=['5ovfLHe','substring','5258976eNjYlS','indexOf','1659343vcuYdl','3016mZbMcN','8411RlZSIJ','850923TiXWdl','1134639IqlUeR','Invalid\x20segment\x20reference\x20format:\x20','25366oBOhBx','38hBhlYq','90Wgppdb','.\x20Child\x20name\x20cannot\x20be\x20empty','11292iHYUIL','339iMeyZy','32pHEbkH','.\x20Parent\x20name\x20cannot\x20be\x20empty'];a155_0x24f7=function(){return _0x525719;};return a155_0x24f7();}function a155_0x2b19(_0x3c4dd1,_0x3ccedc){_0x3c4dd1=_0x3c4dd1-0xd9;const _0x24f7cc=a155_0x24f7();let _0x2b1986=_0x24f7cc[_0x3c4dd1];return _0x2b1986;}export function parseSegmentRef(_0x392755){const _0x3cbd8c=a155_0x2b19,_0x58fb08=_0x392755[_0x3cbd8c(0xea)]('/');if(_0x58fb08===-0x1)return{'parentId':_0x392755};if(_0x58fb08===0x0)throw new Error(_0x3cbd8c(0xde)+_0x392755+_0x3cbd8c(0xe6));const _0x401281=_0x392755[_0x3cbd8c(0xe8)](0x0,_0x58fb08),_0x3a522d=_0x392755[_0x3cbd8c(0xe8)](_0x58fb08+0x1);if(_0x3a522d==='')throw new Error(_0x3cbd8c(0xde)+_0x392755+_0x3cbd8c(0xe2));return{'parentId':_0x401281,'childId':_0x3a522d};}
1
+ function a155_0x1c75(_0x37e631,_0x307373){_0x37e631=_0x37e631-0x1e1;const _0x335033=a155_0x3350();let _0x1c7566=_0x335033[_0x37e631];return _0x1c7566;}function a155_0x3350(){const _0x24a0e2=['2425938bUBCPL','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring','960590buiWYk','1676504DMaHCD','7CQjwAR','123827cIbaPq','5313688lUYOyW','18NqCnpG','19779168xlXszE','15HTwafk','indexOf','Invalid\x20segment\x20reference\x20format:\x20','2552523CNkRek','18uEsCMx','11wtbYCr'];a155_0x3350=function(){return _0x24a0e2;};return a155_0x3350();}(function(_0x13e27b,_0xe1961){const _0x5b752b=a155_0x1c75,_0x35f4d7=_0x13e27b();while(!![]){try{const _0x27ee61=parseInt(_0x5b752b(0x1ea))/0x1*(parseInt(_0x5b752b(0x1e2))/0x2)+parseInt(_0x5b752b(0x1e1))/0x3+-parseInt(_0x5b752b(0x1e8))/0x4+-parseInt(_0x5b752b(0x1ee))/0x5*(-parseInt(_0x5b752b(0x1e4))/0x6)+-parseInt(_0x5b752b(0x1e9))/0x7*(parseInt(_0x5b752b(0x1eb))/0x8)+-parseInt(_0x5b752b(0x1ec))/0x9*(-parseInt(_0x5b752b(0x1e7))/0xa)+-parseInt(_0x5b752b(0x1e3))/0xb*(parseInt(_0x5b752b(0x1ed))/0xc);if(_0x27ee61===_0xe1961)break;else _0x35f4d7['push'](_0x35f4d7['shift']());}catch(_0x467c4c){_0x35f4d7['push'](_0x35f4d7['shift']());}}}(a155_0x3350,0x9bf32));export function parseSegmentRef(_0x5ca96f){const _0x374604=a155_0x1c75,_0x113c0f=_0x5ca96f[_0x374604(0x1ef)]('/');if(_0x113c0f===-0x1)return{'parentId':_0x5ca96f};if(_0x113c0f===0x0)throw new Error(_0x374604(0x1f0)+_0x5ca96f+_0x374604(0x1e5));const _0x185fb1=_0x5ca96f['substring'](0x0,_0x113c0f),_0x18d4f6=_0x5ca96f[_0x374604(0x1e6)](_0x113c0f+0x1);if(_0x18d4f6==='')throw new Error(_0x374604(0x1f0)+_0x5ca96f+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x185fb1,'childId':_0x18d4f6};}