@treasuredata/tdx 2026.8.2 → 2026.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-move-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/table-deleted.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/site-mismatch.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/auth-token.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.d.ts +9 -3
  100. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  101. package/dist/sdk/cas/cas-api-client.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  103. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  104. package/dist/sdk/cas/cas-audience-validator.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.d.ts +10 -0
  108. package/dist/sdk/cas/index.d.ts.map +1 -1
  109. package/dist/sdk/cas/index.js +1 -1
  110. package/dist/sdk/cas/index.js.map +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/cas/validate-files.js +1 -1
  114. package/dist/sdk/client/cdp-api-client.js +1 -1
  115. package/dist/sdk/client/delivery-api-client.js +1 -1
  116. package/dist/sdk/client/endpoints.js +1 -1
  117. package/dist/sdk/client/engage-api-client.js +1 -1
  118. package/dist/sdk/client/http-client.js +1 -1
  119. package/dist/sdk/client/llm-api-client.js +1 -1
  120. package/dist/sdk/client/oauth-refresh.js +1 -1
  121. package/dist/sdk/client/rate-limiter.js +1 -1
  122. package/dist/sdk/client/td-api-client.js +1 -1
  123. package/dist/sdk/client/trino-api-client.js +1 -1
  124. package/dist/sdk/client/workflow-client.js +1 -1
  125. package/dist/sdk/connection-validator.js +1 -1
  126. package/dist/sdk/connection.js +1 -1
  127. package/dist/sdk/delivery.js +1 -1
  128. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  129. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  130. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  131. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  132. package/dist/sdk/engage/campaign-pull.js +1 -1
  133. package/dist/sdk/engage/campaign-push.js +1 -1
  134. package/dist/sdk/engage/campaign-validator.js +1 -1
  135. package/dist/sdk/engage/campaign-yaml.js +1 -1
  136. package/dist/sdk/engage/template-pull.js +1 -1
  137. package/dist/sdk/engage/template-push.js +1 -1
  138. package/dist/sdk/engage/template-validator.js +1 -1
  139. package/dist/sdk/engage/template-yaml.js +1 -1
  140. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.js +1 -1
  153. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  154. package/dist/sdk/llm/model-factors.js +1 -1
  155. package/dist/sdk/llm/user-settings.js +1 -1
  156. package/dist/sdk/personalization.js +1 -1
  157. package/dist/sdk/policy.js +1 -1
  158. package/dist/sdk/query/deleted-table-validation.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.js +1 -1
  166. package/dist/sdk/segment/journey-utils.js +1 -1
  167. package/dist/sdk/segment/journey-validator.js +1 -1
  168. package/dist/sdk/segment/journey-yaml.js +1 -1
  169. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  170. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  171. package/dist/sdk/segment/pull-workflow.js +1 -1
  172. package/dist/sdk/segment/push-recovery.js +1 -1
  173. package/dist/sdk/segment/push-workflow.js +1 -1
  174. package/dist/sdk/segment/resolution-context.js +1 -1
  175. package/dist/sdk/segment/segment-path-parser.js +1 -1
  176. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  177. package/dist/sdk/segment/segment-validator.js +1 -1
  178. package/dist/sdk/segment/target-resolution.js +1 -1
  179. package/dist/sdk/segment/tdx-config.js +1 -1
  180. package/dist/sdk/segment/types/activation-schema.js +1 -1
  181. package/dist/sdk/segment/types/journey-def.js +1 -1
  182. package/dist/sdk/segment/types/journey-schema.js +1 -1
  183. package/dist/sdk/segment/types/segment-def.js +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/validate-files.js +1 -1
  186. package/dist/sdk/segment/yaml-validator.js +1 -1
  187. package/dist/sdk/segment.js +1 -1
  188. package/dist/sdk/types/index.js +1 -1
  189. package/dist/sdk/types/progress.js +1 -1
  190. package/dist/sdk/types/workspace.js +1 -1
  191. package/dist/sdk/user.js +1 -1
  192. package/dist/sdk/util/format-detector.js +1 -1
  193. package/dist/sdk/util/formatters.js +1 -1
  194. package/dist/sdk/util/index.js +1 -1
  195. package/dist/sdk/util/paginate.js +1 -1
  196. package/dist/sdk/util/tree-formatter.js +1 -1
  197. package/dist/sdk/util/tree-search.js +1 -1
  198. package/dist/sdk/workflow/archive-validation.js +1 -1
  199. package/dist/sdk/workflow/clone-workflow.js +1 -1
  200. package/dist/sdk/workflow/index.js +1 -1
  201. package/dist/sdk/workflow/pull-workflow.js +1 -1
  202. package/dist/sdk/workflow/push-workflow.js +1 -1
  203. package/dist/sdk/workflow/task-graph.js +1 -1
  204. package/dist/sdk/workflow/tdx-config.js +1 -1
  205. package/dist/sdk/workflow/workflow-utils.js +1 -1
  206. package/dist/sdk/workspace/access-tracker.js +1 -1
  207. package/dist/sdk/workspace/frontmatter.js +1 -1
  208. package/dist/sdk/workspace/git.js +1 -1
  209. package/dist/sdk/workspace/index.js +1 -1
  210. package/dist/sdk/workspace/templates.js +1 -1
  211. package/dist/sdk/workspace/weekly.js +1 -1
  212. package/dist/sdk/workspace/wikilinks.js +1 -1
  213. package/dist/test-utils/command-runner.js +1 -1
  214. package/dist/test-utils/factories.js +1 -1
  215. package/dist/test-utils/fixtures.js +1 -1
  216. package/dist/test-utils/http-mock.js +1 -1
  217. package/dist/test-utils/index.js +1 -1
  218. package/dist/utils/async.js +1 -1
  219. package/dist/utils/claude-code-state.js +1 -1
  220. package/dist/utils/colors.js +1 -1
  221. package/dist/utils/diff.js +1 -1
  222. package/dist/utils/file-permissions.js +1 -1
  223. package/dist/utils/file-reader.js +1 -1
  224. package/dist/utils/github-releases.js +1 -1
  225. package/dist/utils/global-cache.js +1 -1
  226. package/dist/utils/json-loader.js +1 -1
  227. package/dist/utils/local-cache.js +1 -1
  228. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  229. package/dist/utils/logger/formatters/index.js +1 -1
  230. package/dist/utils/logger/handlers/console-handler.js +1 -1
  231. package/dist/utils/logger/handlers/file-handler.js +1 -1
  232. package/dist/utils/logger/handlers/index.js +1 -1
  233. package/dist/utils/logger/handlers/null-handler.js +1 -1
  234. package/dist/utils/logger/index.js +1 -1
  235. package/dist/utils/logger/logger.js +1 -1
  236. package/dist/utils/logger/types.js +1 -1
  237. package/dist/utils/option-validation.js +1 -1
  238. package/dist/utils/process.js +1 -1
  239. package/dist/utils/prompt.js +1 -1
  240. package/dist/utils/proxy-fetch.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 a169_0x12f8f2=a169_0x880c;(function(_0x425f53,_0x25a6c5){const _0x5c2ea6=a169_0x880c,_0x2a3d34=_0x425f53();while(!![]){try{const _0x524e85=-parseInt(_0x5c2ea6(0x229))/0x1*(parseInt(_0x5c2ea6(0x24b))/0x2)+parseInt(_0x5c2ea6(0x244))/0x3*(parseInt(_0x5c2ea6(0x1ce))/0x4)+-parseInt(_0x5c2ea6(0x1e8))/0x5+-parseInt(_0x5c2ea6(0x251))/0x6*(parseInt(_0x5c2ea6(0x273))/0x7)+-parseInt(_0x5c2ea6(0x279))/0x8*(-parseInt(_0x5c2ea6(0x23e))/0x9)+parseInt(_0x5c2ea6(0x2bd))/0xa+parseInt(_0x5c2ea6(0x1e0))/0xb;if(_0x524e85===_0x25a6c5)break;else _0x2a3d34['push'](_0x2a3d34['shift']());}catch(_0x13d03e){_0x2a3d34['push'](_0x2a3d34['shift']());}}}(a169_0xf99f,0xd87b0));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a169_0x12f8f2(0x2be));export const PENDING_SEGMENT_PREFIX=a169_0x12f8f2(0x2b2);export const PENDING_ACTIVATION_PREFIX=a169_0x12f8f2(0x20e);export function createPendingSegmentId(_0x541c24){return''+PENDING_SEGMENT_PREFIX+_0x541c24+'__';}export function isPendingSegmentId(_0x4563e2){const _0x42f4f2=a169_0x12f8f2;return _0x4563e2[_0x42f4f2(0x28d)](PENDING_SEGMENT_PREFIX)&&!_0x4563e2[_0x42f4f2(0x28d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4a71ad){const _0x12dfaa=a169_0x12f8f2;return _0x4a71ad[_0x12dfaa(0x228)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3da04b){return''+PENDING_ACTIVATION_PREFIX+_0x3da04b+'__';}export function isPendingActivationId(_0x50a055){const _0x2c9c1d=a169_0x12f8f2;return _0x50a055[_0x2c9c1d(0x28d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1db518){const _0x4c185d=a169_0x12f8f2;return _0x1db518[_0x4c185d(0x228)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2ad93e,_0x406d58){const _0x39bf74=a169_0x12f8f2,_0x108181=_0x2ad93e+'::'+(_0x406d58[_0x39bf74(0x271)]()||_0x39bf74(0x28e)),_0x1133a5=createHash(_0x39bf74(0x23c))['update'](_0x108181)[_0x39bf74(0x280)]('hex')[_0x39bf74(0x209)](0x0,0xc);return _0x39bf74(0x231)+_0x1133a5;}export function ensureJourneyDefaults(_0xd1d229){const _0xc22543=a169_0x12f8f2;!_0xd1d229[_0xc22543(0x261)]&&(_0xd1d229[_0xc22543(0x261)]=''),!_0xd1d229['state']&&(_0xd1d229[_0xc22543(0x1f1)]='draft');}export function injectExistingStageIds(_0x24a44b,_0x3f5d85){const _0x4ed02b=a169_0x12f8f2,_0x4c256d=new Map(_0x3f5d85['map'](_0x14bc99=>[_0x14bc99['name'],_0x14bc99['id']]));for(const _0x3c7a56 of _0x24a44b){if(!_0x3c7a56['id']){const _0x380f07=_0x4c256d[_0x4ed02b(0x1d3)](_0x3c7a56['name']);_0x380f07&&(_0x3c7a56['id']=_0x380f07);}}}export function resolveTDFolderPath(_0x2edc8c,_0x487631,_0x2449bc){const _0x3bc9b9=a169_0x12f8f2;if(!_0x487631)return _0x2edc8c;if(_0x2edc8c===_0x2449bc||_0x2edc8c[_0x3bc9b9(0x28d)](_0x2449bc+'/'))return _0x2edc8c;return _0x2edc8c?_0x2449bc+'/'+_0x2edc8c:_0x2449bc;}export function addFoldersToCreate(_0x497632,_0x46b1d2,_0x2648f2){const _0x289aba=a169_0x12f8f2;if(!_0x497632)return;if(_0x46b1d2[_0x289aba(0x249)](_0x497632))return;const _0x350fce=_0x497632[_0x289aba(0x2bb)]('/');let _0xb842c9='';for(const _0xeaf482 of _0x350fce){_0xb842c9=_0xb842c9?_0xb842c9+'/'+_0xeaf482:_0xeaf482,!_0x46b1d2[_0x289aba(0x249)](_0xb842c9)&&_0x2648f2[_0x289aba(0x1f7)](_0xb842c9);}}export function sortFoldersByDepth(_0x3a6cdd){const _0x33b09b=a169_0x12f8f2;return[..._0x3a6cdd][_0x33b09b(0x2a7)]((_0xfe7ded,_0x3e4b72)=>{const _0x1af6ec=_0x33b09b,_0x51e82d=(_0xfe7ded['match'](/\//g)||[])[_0x1af6ec(0x295)],_0x58e2e3=(_0x3e4b72[_0x1af6ec(0x29f)](/\//g)||[])[_0x1af6ec(0x295)];return _0x51e82d-_0x58e2e3;});}import*as a169_0x56a015 from'yaml';import{readFileSync}from'fs';import a169_0x240131 from'path';import{isJourneyDef,parseYamlString as a169_0x235896,toYamlString as a169_0x271d0b,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(_0xb24438){const _0x51038a=a169_0x12f8f2;if(Array[_0x51038a(0x200)](_0xb24438))return'['+_0xb24438['map'](_0x1236ba=>stableStringify(_0x1236ba))[_0x51038a(0x2b9)](',')+']';if(_0xb24438&&typeof _0xb24438===_0x51038a(0x1fc)){const _0x183879=_0xb24438,_0x4dddae=Object[_0x51038a(0x1d2)](_0x183879)[_0x51038a(0x2a7)](),_0x5961c1=_0x4dddae[_0x51038a(0x201)](_0x3085dd=>'\x22'+_0x3085dd+'\x22:'+stableStringify(_0x183879[_0x3085dd]));return'{'+_0x5961c1['join'](',')+'}';}const _0x37373c=JSON[_0x51038a(0x298)](_0xb24438);return _0x37373c===undefined?_0x51038a(0x299):_0x37373c;}function activationSignature(_0x23ac55){const _0x311f30=a169_0x12f8f2,_0x20494a={'connection':_0x23ac55[_0x311f30(0x1f5)],..._0x23ac55[_0x311f30(0x27c)]!==undefined&&{'all_columns':_0x23ac55[_0x311f30(0x27c)]},..._0x23ac55[_0x311f30(0x2cb)]!==undefined&&{'columns':_0x23ac55[_0x311f30(0x2cb)]},..._0x23ac55['behavior']!==undefined&&{'behavior':_0x23ac55[_0x311f30(0x1e5)]},..._0x23ac55[_0x311f30(0x2b1)]!==undefined&&{'behaviors':_0x23ac55[_0x311f30(0x2b1)]},..._0x23ac55['schedule']!==undefined&&{'schedule':_0x23ac55[_0x311f30(0x2a0)]},..._0x23ac55[_0x311f30(0x26b)]!==undefined&&{'notification':_0x23ac55[_0x311f30(0x26b)]},..._0x23ac55[_0x311f30(0x27a)]!==undefined&&{'connector_config':_0x23ac55[_0x311f30(0x27a)]},..._0x23ac55[_0x311f30(0x234)]!==undefined&&{'activation_template_id':_0x23ac55['activation_template_id']}};return stableStringify(_0x20494a);}async function fetchSegment(_0x51d257,_0x3b372f,_0x41bfd7,_0x1ed2b6){const _0x4b8376=a169_0x12f8f2,_0x31b39c=_0x1ed2b6?.[_0x4b8376(0x1f8)](_0x5fb2f6=>_0x5fb2f6['id']===_0x41bfd7);if(_0x31b39c)return _0x31b39c;try{return await _0x51d257[_0x4b8376(0x28e)]['getSegment'](_0x3b372f,_0x41bfd7);}catch(_0x159ab9){logger['debug']('getSegment\x20failed\x20for\x20'+_0x41bfd7+_0x4b8376(0x22c)+_0x159ab9);try{return await _0x51d257[_0x4b8376(0x28e)][_0x4b8376(0x211)](_0x41bfd7);}catch(_0x4ea2a7){return logger[_0x4b8376(0x1eb)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x41bfd7+':\x20'+_0x4ea2a7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x9dd050,_0x2de427,_0x397630){const _0x3bf5ac=a169_0x12f8f2,_0xe8675b=readPushRecovery(_0x9dd050[_0x3bf5ac(0x253)]);if(_0xe8675b?.['journeyName']===_0x9dd050[_0x3bf5ac(0x256)][_0x3bf5ac(0x2a4)])for(const [_0x160a6a,_0x1fdcb1]of Object['entries'](_0xe8675b[_0x3bf5ac(0x1ed)])){const _0x2f22c8=generateDeterministicJourneySegmentName(_0x9dd050['yamlConfig'][_0x3bf5ac(0x2a4)],_0x160a6a);_0x1fdcb1[_0x3bf5ac(0x274)]===_0x2f22c8&&(_0x2de427[_0x3bf5ac(0x1ea)](_0x160a6a,_0x1fdcb1[_0x3bf5ac(0x26d)]),_0x397630['set'](_0x160a6a,_0x1fdcb1[_0x3bf5ac(0x26d)]));}}async function createOrRecoverEmbeddedSegment(_0x1b3147,_0x29c86a,_0x191fba,_0x82650f){const _0x2b19ed=a169_0x12f8f2;let _0x12d100;try{_0x12d100=await _0x1b3147[_0x2b19ed(0x28e)][_0x2b19ed(0x210)]({'name':_0x191fba[_0x2b19ed(0x205)],'description':_0x191fba[_0x2b19ed(0x261)],'journeyId':_0x191fba['journeyId'],'rule':_0x82650f(_0x191fba[_0x2b19ed(0x214)],!![]),'countPopulation':!![],'parentFolderId':_0x191fba[_0x2b19ed(0x27d)],'audienceId':_0x191fba[_0x2b19ed(0x1e4)]});}catch(_0x2d9b2a){const _0x5280fd=_0x2d9b2a instanceof Error&&_0x2d9b2a['message'][_0x2b19ed(0x26f)](_0x2b19ed(0x268));if(_0x5280fd){const _0x28cb20=readPushRecovery(_0x29c86a[_0x2b19ed(0x253)]),_0x5d0c77=_0x28cb20?.[_0x2b19ed(0x1e3)]===_0x29c86a[_0x2b19ed(0x256)][_0x2b19ed(0x2a4)]?_0x28cb20[_0x2b19ed(0x1ed)][_0x191fba[_0x2b19ed(0x297)]]:undefined;if(_0x5d0c77?.[_0x2b19ed(0x274)]===_0x191fba[_0x2b19ed(0x205)])await _0x1b3147[_0x2b19ed(0x28e)][_0x2b19ed(0x22d)](_0x191fba[_0x2b19ed(0x1e4)],_0x5d0c77[_0x2b19ed(0x26d)],{'description':_0x191fba[_0x2b19ed(0x261)],'rule':_0x82650f(_0x191fba['resolvedRule'],!![]),'countPopulation':!![]}),_0x12d100=_0x5d0c77['segmentId'];else throw new SDKError(ErrorCode[_0x2b19ed(0x239)],_0x2b19ed(0x232)+_0x191fba[_0x2b19ed(0x297)]+_0x2b19ed(0x1f0)+(_0x2b19ed(0x20a)+_0x29c86a['absolutePath'][_0x2b19ed(0x228)](/([^/]+)$/,_0x2b19ed(0x245))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x2d9b2a);}else throw _0x2d9b2a;}return saveSegmentToPushRecovery(_0x29c86a[_0x2b19ed(0x253)],_0x29c86a[_0x2b19ed(0x256)]['name'],_0x191fba[_0x2b19ed(0x297)],{'segmentId':_0x12d100,'uniqueServerName':_0x191fba[_0x2b19ed(0x205)],'createdAt':new Date()[_0x2b19ed(0x2ad)]()}),_0x12d100;}export async function prepareSegmentFiles(_0x22ac10,_0x3968a5,_0x18a2cc,_0x4d8a42,_0x372abd){const _0x38bdf5=a169_0x12f8f2,{activationDefToCreateRequest:_0x177430}=await import(_0x38bdf5(0x202)),_0x2c47fd=[],_0x354f36=new Set();for(const {yamlConfig:_0x5ab5c2,folderPath:_0x234108,sourcePath:_0x2afe37}of _0x22ac10){const _0x1da61d=resolveTDFolderPath(_0x234108,_0x4d8a42,_0x372abd),_0x2d41d7=_0x1da61d+':'+_0x5ab5c2[_0x38bdf5(0x2a4)],_0x4e1b59=_0x3968a5[_0x38bdf5(0x29b)][_0x38bdf5(0x1d3)](_0x2d41d7),_0x4072d2=_0x4e1b59?_0x3968a5[_0x38bdf5(0x23a)]['get'](_0x4e1b59['id'])||[]:[];addFoldersToCreate(_0x1da61d,_0x3968a5[_0x38bdf5(0x241)],_0x354f36);const _0x1acc79=calculateActivationActions(_0x5ab5c2[_0x38bdf5(0x20c)]||[],_0x4072d2,_0x3968a5[_0x38bdf5(0x1ef)],_0x3968a5[_0x38bdf5(0x212)]);for(const _0x324511 of _0x1acc79){(_0x324511[_0x38bdf5(0x1d7)]===_0x38bdf5(0x29d)||_0x324511['type']==='update')&&_0x324511['yamlActivation']&&(_0x324511[_0x38bdf5(0x2c3)]=await _0x177430(_0x324511[_0x38bdf5(0x288)],_0x18a2cc));}const _0xd5c6ef=calculateSegmentDiff(_0x5ab5c2,_0x4e1b59,_0x4072d2,_0x3968a5[_0x38bdf5(0x1ef)],_0x3968a5[_0x38bdf5(0x212)]);_0x2c47fd[_0x38bdf5(0x2a9)]({'relativePath':_0x5ab5c2[_0x38bdf5(0x2a4)],'absolutePath':_0x2afe37,'yamlConfig':_0x5ab5c2,'folderPath':_0x1da61d,'existingSegment':_0x4e1b59,'existingActivations':_0x4072d2,'isNew':_0xd5c6ef[_0x38bdf5(0x267)],'hasChanges':_0xd5c6ef[_0x38bdf5(0x247)],'diff':_0xd5c6ef[_0x38bdf5(0x206)],'activationActions':_0x1acc79});}return{'segmentFiles':_0x2c47fd,'foldersToCreate':_0x354f36};}function a169_0x880c(_0x4e4c34,_0x1536f7){_0x4e4c34=_0x4e4c34-0x1ce;const _0xf99fa4=a169_0xf99f();let _0x880c74=_0xf99fa4[_0x4e4c34];return _0x880c74;}export async function prepareJourneyFiles(_0x21f1ba,_0x3edbf0,_0xd77b41,_0x52732b){const _0x4b2fd8=a169_0x12f8f2,_0x57b2ed=[],_0x2471aa=new Set();for(const {yamlConfig:_0x322df0,folderPath:_0x41c093,sourcePath:_0x3fa7cb}of _0x21f1ba){const _0x2722e9=resolveTDFolderPath(_0x41c093,_0xd77b41,_0x52732b),_0x763ac3=_0x2722e9+':'+_0x322df0[_0x4b2fd8(0x2a4)],_0x26db51=_0x3edbf0[_0x4b2fd8(0x1ec)][_0x4b2fd8(0x1d3)](_0x763ac3);let _0x28fc7c,_0x4892cf;if(_0x26db51&&_0x26db51[_0x4b2fd8(0x295)]>0x0){const _0x330a57=buildLocalExpandedRuleMappings(_0x322df0),{createYamlContext:_0x173f3b,prefetchJourneySegments:_0x486911}=createPushYamlContextForBundle(_0x3edbf0[_0x4b2fd8(0x2ba)],_0x3edbf0[_0x4b2fd8(0x1e4)],_0x3edbf0[_0x4b2fd8(0x21a)],_0x330a57,_0x3edbf0[_0x4b2fd8(0x1ef)],_0x3edbf0[_0x4b2fd8(0x212)],_0x3edbf0['activationStepsById'],_0x3edbf0[_0x4b2fd8(0x2b3)]);await _0x486911(_0x26db51['map'](_0x341950=>_0x341950['id']));const _0x5f4ccc=await _0x3edbf0[_0x4b2fd8(0x2ba)][_0x4b2fd8(0x2bc)][_0x4b2fd8(0x2c7)](_0x26db51[0x0]['journeyBundleId']),_0x17dd19=hasMultipleVersions(_0x322df0),_0x31d75b=async _0x5be338=>{const _0x33ea49=_0x4b2fd8,_0x38722d=_0x3edbf0['journeyById']?.['get'](_0x5be338);if(_0x38722d)return _0x38722d;return _0x3edbf0['fetchJourney']({'journeyId':_0x5be338,'journeyName':_0x322df0['name'],'isMultiVersion':_0x26db51[_0x33ea49(0x295)]>0x1});};if(_0x17dd19&&_0x26db51[_0x4b2fd8(0x295)]>0x1){const _0x17c15a=[];for(const _0x5c1594 of _0x26db51){const _0x1c8f3d=_0x5c1594[_0x4b2fd8(0x2a1)]||0x1;_0x3edbf0['progress']?.[_0x4b2fd8(0x23f)](_0x4b2fd8(0x260)+_0x322df0['name']+'\x20v'+_0x1c8f3d);const _0x53aeb2=await _0x31d75b(_0x5c1594['id']),_0x397500=_0x173f3b(_0x5c1594['id']),_0x5c4c1f=await journeyResponseToDef(_0x53aeb2,_0x397500);_0x17c15a[_0x4b2fd8(0x2a9)]({'item':_0x5c1594,'yaml':_0x5c4c1f});}const _0xe03e14=buildLocalRuleToNameMappingFromJourney(_0x322df0);_0x4892cf=buildMergedJourneyDef(_0x17c15a,_0xe03e14,_0x5f4ccc);const _0x5b7989=Math[_0x4b2fd8(0x26e)](..._0x17c15a['map'](_0x43b917=>_0x43b917[_0x4b2fd8(0x270)][_0x4b2fd8(0x2a1)]||0x0)),_0xced487=_0x26db51[_0x4b2fd8(0x1f8)](_0x208720=>(_0x208720['versionNumber']||0x0)===_0x5b7989);_0xced487&&(_0x3edbf0['progress']?.[_0x4b2fd8(0x23f)]('Fetching\x20'+_0x322df0['name']+'\x20v'+_0x5b7989),_0x28fc7c=await _0x31d75b(_0xced487['id']));}else{const _0x2998a3=_0x26db51[_0x26db51[_0x4b2fd8(0x295)]-0x1];_0x3edbf0[_0x4b2fd8(0x1de)]?.[_0x4b2fd8(0x23f)](_0x4b2fd8(0x260)+_0x322df0[_0x4b2fd8(0x2a4)]),_0x28fc7c=await _0x31d75b(_0x2998a3['id']);const _0x4c3679=_0x173f3b(_0x2998a3['id']),_0x2d2516=await journeyResponseToDef(_0x28fc7c,_0x4c3679),_0x371104=buildLocalRuleToNameMappingFromJourney(_0x322df0);_0x4892cf=buildMergedJourneyDef([{'item':_0x2998a3,'yaml':_0x2d2516}],_0x371104,_0x5f4ccc);}}addFoldersToCreate(_0x2722e9,_0x3edbf0[_0x4b2fd8(0x241)],_0x2471aa);const _0x5268db=calculateJourneyDiff(_0x322df0,_0x4892cf);_0x57b2ed[_0x4b2fd8(0x2a9)]({'relativePath':_0x322df0[_0x4b2fd8(0x2a4)],'absolutePath':_0x3fa7cb,'yamlConfig':_0x322df0,'folderPath':_0x2722e9,'existingJourney':_0x28fc7c,'isNew':_0x5268db['isNew'],'hasChanges':_0x5268db[_0x4b2fd8(0x247)],'diff':_0x5268db[_0x4b2fd8(0x206)]});}return{'journeyFiles':_0x57b2ed,'foldersToCreate':_0x2471aa};}export function calculateActivationActions(_0x568a6b,_0x4e7cb6,_0x299131,_0x45be10){const _0xe552be=a169_0x12f8f2,_0x1324d3=[],_0x5b70ea=new Map();for(const _0x44221b of _0x4e7cb6){_0x5b70ea[_0xe552be(0x1ea)](_0x44221b[_0xe552be(0x2a4)],_0x44221b);}const _0x472b50=new Map();for(const _0x590503 of _0x568a6b){_0x472b50[_0xe552be(0x1ea)](_0x590503[_0xe552be(0x2a4)],_0x590503);}for(const _0x5bfded of _0x568a6b){const _0x2935fe=_0x5b70ea[_0xe552be(0x1d3)](_0x5bfded[_0xe552be(0x2a4)]);if(!_0x2935fe)_0x1324d3['push']({'type':_0xe552be(0x29d),'name':_0x5bfded[_0xe552be(0x2a4)],'yamlActivation':_0x5bfded});else{const _0x28f01b=activationResponseToDef(_0x2935fe,_0x299131,_0x45be10),_0x5dd227=a169_0x56a015[_0xe552be(0x298)](_0x28f01b),_0x11bce4=a169_0x56a015[_0xe552be(0x298)](_0x5bfded);_0x5dd227!==_0x11bce4&&_0x1324d3[_0xe552be(0x2a9)]({'type':_0xe552be(0x23f),'name':_0x5bfded[_0xe552be(0x2a4)],'yamlActivation':_0x5bfded,'existingActivation':_0x2935fe});}}for(const _0x35d1a2 of _0x4e7cb6){!_0x472b50[_0xe552be(0x249)](_0x35d1a2[_0xe552be(0x2a4)])&&_0x1324d3['push']({'type':_0xe552be(0x275),'name':_0x35d1a2[_0xe552be(0x2a4)],'existingActivation':_0x35d1a2});}return _0x1324d3;}function calculateYamlDiff(_0x5258fd,_0x585ad4){if(_0x585ad4){const _0x2a8db3=generateDiff(_0x585ad4,_0x5258fd),_0x47d459=hasChanges(_0x2a8db3);return{'isNew':![],'hasChanges':_0x47d459,'diff':_0x47d459?formatDiffWithColors(_0x2a8db3):undefined};}const _0x5aef0e=generateDiff('',_0x5258fd);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5aef0e)};}export function calculateSegmentDiff(_0x5d29e3,_0x22c05a,_0x56675c,_0x194ab1,_0x598186){const _0x1984d4=segmentToYamlString(_0x5d29e3),_0x5ed46b=_0x22c05a?segmentToYamlString(segmentWithActivationsToYaml(_0x22c05a,_0x56675c,undefined,_0x194ab1,_0x598186)):undefined;return calculateYamlDiff(_0x1984d4,_0x5ed46b);}export function calculateJourneyDiff(_0x250ab4,_0x1ada0e){const _0x2ef306=normalizeJourneyDef(_0x250ab4,_0x250ab4),_0x192b38=a169_0x271d0b(_0x2ef306),_0x1b217e=_0x1ada0e?a169_0x271d0b(normalizeJourneyDef(_0x1ada0e,_0x250ab4)):undefined;return calculateYamlDiff(_0x192b38,_0x1b217e);}export function findSegmentsToDelete(_0x31c610,_0x5eed92,_0x397a82,_0x17e9f4,_0x1caeea){const _0x373c48=a169_0x12f8f2,_0xc6ce97=new Set();for(const {yamlConfig:_0x182c58,folderPath:_0x4180f1}of _0x5eed92){_0xc6ce97[_0x373c48(0x1f7)](_0x4180f1+':'+_0x182c58[_0x373c48(0x2a4)]);}return _0x31c610['filter'](_0x21f372=>{const _0x4c3b6f=_0x373c48,_0x5d4b81=_0x21f372[_0x4c3b6f(0x22e)]?_0x397a82['get'](_0x21f372[_0x4c3b6f(0x22e)][_0x4c3b6f(0x21c)]())||'':'',_0x5412ca=_0x5d4b81+':'+_0x21f372[_0x4c3b6f(0x2a4)];if(_0xc6ce97[_0x4c3b6f(0x249)](_0x5412ca))return![];if(_0x1caeea)return _0x5d4b81===_0x17e9f4||_0x5d4b81[_0x4c3b6f(0x28d)](_0x17e9f4+'/');return!![];});}export function findJourneysToDelete(_0x12482a,_0x52ba1c,_0x3daa95,_0x54fbea,_0x11ff23){const _0x271c89=a169_0x12f8f2,_0x4b295e=new Set();for(const {yamlConfig:_0x393f18,folderPath:_0x20949d}of _0x52ba1c){_0x4b295e[_0x271c89(0x1f7)](_0x20949d+':'+_0x393f18[_0x271c89(0x2a4)]);}return _0x12482a['filter'](_0x2c9bb9=>{const _0x1abdf8=_0x271c89,_0x8e829b=_0x2c9bb9['folderId']?_0x3daa95['get'](_0x2c9bb9[_0x1abdf8(0x27d)])||'':'',_0x129dcf=_0x8e829b+':'+_0x2c9bb9[_0x1abdf8(0x203)];if(_0x4b295e[_0x1abdf8(0x249)](_0x129dcf))return![];if(_0x11ff23)return _0x8e829b===_0x54fbea||_0x8e829b[_0x1abdf8(0x28d)](_0x54fbea+'/');return!![];});}export function buildSegmentLookupMap(_0x7f9fa4,_0x3bc784){const _0x2dd59d=a169_0x12f8f2,_0x2ad1d1=new Map();for(const _0x3a4651 of _0x7f9fa4){const _0xad5234=_0x3a4651[_0x2dd59d(0x22e)]?_0x3bc784[_0x2dd59d(0x1d3)](_0x3a4651[_0x2dd59d(0x22e)]['toString']())||'':'',_0x33c008=_0xad5234+':'+_0x3a4651[_0x2dd59d(0x2a4)];_0x2ad1d1[_0x2dd59d(0x1ea)](_0x33c008,_0x3a4651);}return _0x2ad1d1;}export function buildSegmentNameToIdMap(_0x3db959){const _0x453372=a169_0x12f8f2,_0x39c105=new Map();for(const _0x2682da of _0x3db959){_0x39c105[_0x453372(0x1ea)](_0x2682da['name'],_0x2682da['id']);}return _0x39c105;}export function buildJourneyBundleLookupMap(_0x4be2a4,_0x44d9d5){const _0x5e000d=a169_0x12f8f2,_0x409aff=new Map();for(const _0xe3752e of _0x4be2a4){const _0x52abf7=_0xe3752e[_0x5e000d(0x27d)]?_0x44d9d5[_0x5e000d(0x1d3)](_0xe3752e[_0x5e000d(0x27d)])||'':'',_0x2bd378=_0x52abf7+':'+_0xe3752e[_0x5e000d(0x203)];!_0x409aff[_0x5e000d(0x249)](_0x2bd378)&&_0x409aff['set'](_0x2bd378,[]),_0x409aff[_0x5e000d(0x1d3)](_0x2bd378)[_0x5e000d(0x2a9)](_0xe3752e);}for(const _0x1ae348 of _0x409aff[_0x5e000d(0x254)]()){_0x1ae348['sort']((_0xc8458c,_0x4fb55e)=>(_0xc8458c[_0x5e000d(0x2a1)]||0x0)-(_0x4fb55e[_0x5e000d(0x2a1)]||0x0));}return _0x409aff;}export function collectFoldersToCreate(_0x4caf4b,_0x453fa0){const _0x40eeb4=a169_0x12f8f2,_0xafbe02=new Set();for(const _0x591064 of _0x4caf4b){if(!_0x591064)continue;if(_0x453fa0['has'](_0x591064))continue;const _0x5a1eeb=_0x591064[_0x40eeb4(0x2bb)]('/');let _0x48f321='';for(const _0x49e48a of _0x5a1eeb){_0x48f321=_0x48f321?_0x48f321+'/'+_0x49e48a:_0x49e48a,!_0x453fa0['has'](_0x48f321)&&_0xafbe02[_0x40eeb4(0x1f7)](_0x48f321);}}return _0xafbe02;}export function parseAndClassifyYamlFiles(_0x54aa0a,_0xd70e7f,_0x5f22ee){const _0x9a835f=a169_0x12f8f2,_0x1d88ca=[],_0x3705fc=[];for(const _0x4a4592 of _0x54aa0a){const _0x5768e7=a169_0x240131[_0x9a835f(0x223)](_0xd70e7f,a169_0x240131['dirname'](_0x4a4592)),_0x400b2d=_0x5768e7==='.'?'':_0x5768e7[_0x9a835f(0x228)](/\\/g,'/'),_0x3df099=readFileSync(_0x4a4592,_0x9a835f(0x2cf)),_0x18409a=a169_0x56a015[_0x9a835f(0x2a2)](_0x3df099);if(isJourneyDef(_0x18409a,_0x4a4592)){const _0x2c1632=a169_0x235896(_0x3df099);_0x3705fc[_0x9a835f(0x2a9)]({'yamlConfig':_0x2c1632,'folderPath':_0x400b2d,'sourcePath':_0x4a4592});}else{if(!_0x5f22ee?.['skipSegments']){const _0x1b453b=parseSegmentYamlFile(_0x3df099),_0x5b4e80=normalizeChildSegmentYaml(_0x1b453b);_0x1d88ca[_0x9a835f(0x2a9)]({'yamlConfig':_0x5b4e80,'folderPath':_0x400b2d,'sourcePath':_0x4a4592});}}}return{'segments':_0x1d88ca,'journeys':_0x3705fc};}export function validateParsedFiles(_0xce089f,_0x3ad269){const _0x3feb03=a169_0x12f8f2,_0x3bd037=[];for(const {yamlConfig:_0x226fe2,sourcePath:_0x289b4e}of _0xce089f['segments']){const _0x2aa6c4=readFileSync(_0x289b4e,_0x3feb03(0x2cf)),_0xc2f020=a169_0x56a015[_0x3feb03(0x221)](_0x2aa6c4),_0x3991af=validateSegmentDef(_0x226fe2,{'source':_0x2aa6c4,'document':_0xc2f020},{'skipSchema':!![]});if(!_0x3991af[_0x3feb03(0x286)]){const _0xb1a2af=a169_0x240131[_0x3feb03(0x223)](_0x3ad269,_0x289b4e);_0x3bd037[_0x3feb03(0x2a9)]({'filePath':_0xb1a2af,'source':_0x2aa6c4,'result':_0x3991af,'isJourney':![]});}}for(const {yamlConfig:_0x5ddb29,sourcePath:_0x3f9f89}of _0xce089f['journeys']){const _0x2024cd=readFileSync(_0x3f9f89,_0x3feb03(0x2cf)),_0x3c9a49=a169_0x56a015[_0x3feb03(0x221)](_0x2024cd),_0x41c14a=validateJourneyDef(_0x5ddb29,{'source':_0x2024cd,'document':_0x3c9a49},{'skipSchema':!![]});if(!_0x41c14a[_0x3feb03(0x286)]){const _0x2087de=a169_0x240131[_0x3feb03(0x223)](_0x3ad269,_0x3f9f89);_0x3bd037['push']({'filePath':_0x2087de,'source':_0x2024cd,'result':_0x41c14a,'isJourney':!![]});}}return _0x3bd037;}export function formatValidationErrors(_0x427179){const _0x453e57=a169_0x12f8f2,_0x36e473=[];for(const {filePath:_0x45d47f,source:_0xbfacc2,result:_0x4b125b,isJourney:_0x27bdff}of _0x427179){const _0x1cb1c4=_0x27bdff?_0x453e57(0x2bc):_0x453e57(0x28e);_0x36e473['push']('\x0a'+_0x45d47f+'\x20('+_0x1cb1c4+_0x453e57(0x22a)+_0x4b125b[_0x453e57(0x27b)][_0x453e57(0x295)]+_0x453e57(0x2cd)),_0x36e473[_0x453e57(0x2a9)](formatValidationResult(_0x4b125b,_0xbfacc2,_0x45d47f));}return _0x36e473[_0x453e57(0x2b9)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2ba5e8){const _0x150509=a169_0x12f8f2,_0x1751cf=new Set(),_0x1037c2=new Map(),_0x1cdcad=collectSegmentUsageCounts(_0x2ba5e8);if(_0x2ba5e8[_0x150509(0x1ed)])for(const [_0x59853e,_0x58c02a]of Object[_0x150509(0x1f6)](_0x2ba5e8['segments'])){_0x1751cf[_0x150509(0x1f7)](_0x59853e);if(_0x58c02a[_0x150509(0x284)]){const _0x45ec55=yamlRuleToApi(_0x58c02a[_0x150509(0x284)]),_0x2230bb=apiRuleToYaml(_0x45ec55);_0x1037c2[_0x150509(0x1ea)](_0x59853e,_0x2230bb);}}const _0x53cc17=new Map();let _0x3d81b9=0x0;for(const [_0x331857,_0x21a6bd]of _0x1037c2){const _0x875114=serializeExpandedRule(_0x21a6bd,_0x1037c2),_0x160467=_0x53cc17[_0x150509(0x1d3)](_0x875114)||[];_0x160467[_0x150509(0x2a9)]({'name':_0x331857,'index':_0x3d81b9}),_0x53cc17['set'](_0x875114,_0x160467),_0x3d81b9++;}const _0x44b631=new Map();for(const [_0x17ac0f,_0x2860f1]of _0x53cc17){const _0x37314e=_0x2860f1[_0x150509(0x209)]()[_0x150509(0x2a7)]((_0x3d0bf4,_0x55a9e5)=>{const _0x75ce32=_0x150509,_0x21d02b=_0x1cdcad['get'](_0x3d0bf4[_0x75ce32(0x2a4)])||0x0,_0x3553a8=_0x1cdcad['get'](_0x55a9e5['name'])||0x0;if(_0x21d02b!==_0x3553a8)return _0x3553a8-_0x21d02b;return _0x3d0bf4[_0x75ce32(0x243)]-_0x55a9e5[_0x75ce32(0x243)];})[_0x150509(0x201)](_0x22a1b9=>_0x22a1b9[_0x150509(0x2a4)]),_0x2b72b5=[];for(const _0xc668ce of _0x37314e){const _0x545cfb=_0x1cdcad[_0x150509(0x1d3)](_0xc668ce)||0x0,_0x62b473=Math['max'](_0x545cfb,0x1);for(let _0x2061db=0x0;_0x2061db<_0x62b473;_0x2061db++){_0x2b72b5[_0x150509(0x2a9)](_0xc668ce);}}_0x44b631[_0x150509(0x1ea)](_0x17ac0f,_0x2b72b5);}return{'existingLocalSegmentNames':_0x1751cf,'localSegmentRules':_0x1037c2,'localExpandedRuleToNames':_0x44b631};}export function createSegmentIdResolver(_0x4e6fc5,_0x6b5b1c){return async _0x15265e=>{const _0x216d05=a169_0x880c,_0x44ea06=_0x4e6fc5[_0x216d05(0x1d3)](_0x15265e);if(!_0x44ea06)throw new SDKError(ErrorCode[_0x216d05(0x218)],_0x216d05(0x1d6)+_0x15265e+_0x216d05(0x246)+_0x6b5b1c+'\x27)');return _0x44ea06;};}export function extractRootFolderId(_0x46c674){const _0x1e6545=a169_0x12f8f2;return _0x46c674['relationships']?.['parentSegmentFolder']?.['data']?.['id']||_0x46c674[_0x1e6545(0x28f)]?.[_0x1e6545(0x1e7)]?.[_0x1e6545(0x204)]?.['id'];}export function buildConnectionMaps(_0x5db828){const _0x3ab45c=a169_0x12f8f2,_0x1f9d91=new Map(),_0x340745=new Map(),_0x30ba02=new Map();for(const _0x2ba8f3 of _0x5db828){_0x1f9d91[_0x3ab45c(0x1ea)](_0x2ba8f3[_0x3ab45c(0x2a4)],parseInt(_0x2ba8f3['id'],0xa)),_0x340745[_0x3ab45c(0x1ea)](_0x2ba8f3['id'],_0x2ba8f3[_0x3ab45c(0x2a4)]),_0x30ba02[_0x3ab45c(0x1ea)](_0x2ba8f3[_0x3ab45c(0x2a4)],_0x2ba8f3['type']);}return{'nameToId':_0x1f9d91,'idToName':_0x340745,'nameToType':_0x30ba02};}export function calculatePushStats(_0x5835a7,_0x484916,_0x33a3dc,_0x4a612b,_0x5ae9b0,_0x34e49d,_0x213682){const _0x34cc30=a169_0x12f8f2,_0x46c51a=_0x5835a7['filter'](_0x23145b=>_0x23145b[_0x34cc30(0x267)]),_0x3cc4d0=_0x5835a7['filter'](_0x5d7497=>!_0x5d7497[_0x34cc30(0x267)]&&_0x5d7497[_0x34cc30(0x247)]),_0x40208b=_0x5835a7[_0x34cc30(0x2af)](_0x3e247d=>!_0x3e247d[_0x34cc30(0x267)]&&!_0x3e247d[_0x34cc30(0x247)]),_0x37cd4e=_0x34e49d?_0x4a612b:[],_0x481922=_0x484916[_0x34cc30(0x2af)](_0x5b734b=>_0x5b734b[_0x34cc30(0x267)]),_0x309d41=_0x484916['filter'](_0x36475b=>!_0x36475b[_0x34cc30(0x267)]&&_0x36475b['hasChanges']),_0x55b487=_0x484916[_0x34cc30(0x2af)](_0x307651=>!_0x307651['isNew']&&!_0x307651[_0x34cc30(0x247)]),_0x6b9f0b=_0x34e49d?_0x5ae9b0:[],_0x34614a=_0x5835a7[_0x34cc30(0x2c2)](_0x3d5544=>_0x3d5544[_0x34cc30(0x2ab)]),_0x30d70e=_0x34614a['filter'](_0x57d98a=>_0x57d98a['type']===_0x34cc30(0x29d)),_0x52a684=_0x34614a[_0x34cc30(0x2af)](_0x292085=>_0x292085[_0x34cc30(0x1d7)]===_0x34cc30(0x23f)),_0x3dc352=_0x34614a[_0x34cc30(0x2af)](_0x360e49=>_0x360e49['type']===_0x34cc30(0x275)),_0x3bbfd1=Array[_0x34cc30(0x276)](_0x33a3dc)['sort'](),_0x64e82a=_0x213682?![]:_0x46c51a[_0x34cc30(0x295)]>0x0||_0x3cc4d0[_0x34cc30(0x295)]>0x0||_0x37cd4e[_0x34cc30(0x295)]>0x0,_0x21d515=_0x481922['length']>0x0||_0x309d41[_0x34cc30(0x295)]>0x0||_0x6b9f0b[_0x34cc30(0x295)]>0x0,_0xb1c06a=_0x213682?![]:_0x34614a[_0x34cc30(0x295)]>0x0,_0x59c28e=_0x3bbfd1['length']>0x0;return{'segments':{'new':_0x46c51a,'changed':_0x3cc4d0,'unchanged':_0x40208b,'toDelete':_0x37cd4e},'journeys':{'new':_0x481922,'changed':_0x309d41,'unchanged':_0x55b487,'toDelete':_0x6b9f0b},'activations':{'all':_0x34614a,'toCreate':_0x30d70e,'toUpdate':_0x52a684,'toDelete':_0x3dc352},'folders':{'toCreate':_0x3bbfd1},'counts':{'segments':{'new':_0x46c51a['length'],'changed':_0x3cc4d0[_0x34cc30(0x295)],'unchanged':_0x40208b[_0x34cc30(0x295)],'toDelete':_0x37cd4e[_0x34cc30(0x295)]},'journeys':{'new':_0x481922[_0x34cc30(0x295)],'changed':_0x309d41['length'],'unchanged':_0x55b487['length'],'toDelete':_0x6b9f0b[_0x34cc30(0x295)]},'activations':{'create':_0x30d70e[_0x34cc30(0x295)],'update':_0x52a684[_0x34cc30(0x295)],'delete':_0x3dc352[_0x34cc30(0x295)]},'folders':_0x3bbfd1[_0x34cc30(0x295)]},'hasChanges':_0x64e82a||_0x21d515||_0xb1c06a||_0x59c28e};}function a169_0xf99f(){const _0x58b184=['12549582TGGQCL','update','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','folderPathToId','createActivation','index','1685589tSFlQN','.$1.push-recovery.json','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','hasChanges','segment_created','has','Journey\x20\x27','3197086wVSyws','Updating\x20segment\x20\x27','ACTIVATION_UPDATE_ERROR','INTERNAL','activation_created','journeyActivationNameToId','5370uLDckm','nameToType','absolutePath','values','\x20segment\x20from\x20file:\x20','yamlConfig','effectiveFolderId','getActivation','deleteActivation','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','DecisionPoint','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Segment\x20not\x20found','unchanged','day','Fetching\x20','description','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','folder_creating','folder_created','updateActivation','\x20(referenced\x20in\x20journey\x20','isNew','Name\x20has\x20already\x20been\x20taken','../../utils/async.js','JOURNEY_SYNTAX_ERROR','notification','\x20journey\x20from\x20file:\x20','segmentId','max','includes','item','trim','logInfo','1428QAboMX','uniqueServerName','delete','from','exitCriterias','NOT_FOUND','8IbYbMJ','connector_config','errors','all_columns','folderId','activation_updated','Creating\x20activation\x20\x27','digest','embeddedSegmentNameToId','JOURNEY_UPDATE_ERROR','Failed\x20to\x20fetch\x20referenced\x20segment\x20','rule','segment_updating','valid','\x27\x20by\x20rule\x20content','yamlActivation','waitStep','logSuccess','list','Creating\x20segment\x20\x27','startsWith','segment','relationships','journeyActivationStepId','folder','conditionSegmentId','segment_updated','segmentNameToId','length','SEGMENT_SYNTAX_ERROR','localName','stringify','null','journeyId','segmentByFolderAndName','entryCriteria','create','created','match','schedule','versionNumber','parse','journey_updated','name','Created\x20folder\x20\x27','Created\x20journey\x20\x27','sort','folderPath','push','Failed\x20to\x20','activationActions','Condition','toISOString','createdSegmentId','filter','steps','behaviors','__pending_','journeyById','logDeleted','stages','results','\x27\x20from\x20file:\x20','\x27\x20decision\x20point\x20branch\x20\x27','join','deps','split','journey','7342470GqFmEk','tdx.sdk.push-workflow','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','kind','goal','flatMap','validatedRequest','Created\x20segment\x20\x27','attributes','journey_updating','getLatestJourneyId','existingSegment','conditions','goal\x20criteria','columns','./journey-yaml.js','\x20error(s)','\x27\x20wait\x20condition','utf-8','with','activationParams','4CEuhYG','Stage\x20\x27','WaitStep','rootFolderId','keys','get','Updated\x20segment\x20\x27','createSegment','Segment\x20not\x20found:\x20','type','journey_created','Matched\x20server\x20segment\x20\x27','embedded_segment_created','Failed\x20to\x20resolve\x20activation\x20','deleted','Entry\x20criteria:\x20','progress','\x27...','836363gCrGbU','waitStepType','milestone','journeyName','parentId','behavior','\x0a\x20\x20','parentFolder','493570eYXQxC','activation_deleted','set','debug','journeyBundlesByFolderAndName','segments','branches','idToEmailMap','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','state','Updated\x20activation\x20\x27','stage\x20\x27','all','connection','entries','add','find','embedded_activation_created','activation_creating','updated','object','idToName','\x27\x20entry\x20criteria','conditionTimeoutDuration','isArray','map','./child-segment-yaml.js','journeyBundleName','data','uniqueSegmentName','diff','reduce','segment_deleted','slice','Delete\x20the\x20push\x20recovery\x20file\x20(','Activation','activations','resolveSegment','__pending_act_','Created\x20activation\x20\x27','createJourneySegment','getSegmentEntity','connectionIdToNameMap','deleteSegment','resolvedRule',').\x20','onProgress','listActivations','SEGMENT_NOT_FOUND','\x27\x20not\x20found\x20in\x20journey\x20\x27','existingSegments','existingActivation','toString','toLowerCase','conditionTimeoutUnit','journeys','withProgress','parseDocument','embedded_activation_creating','relative','ACTIVATION_SYNTAX_ERROR','action','resolveJourneyId','getJourney','replace','1GxXwAP','):\x20','activationContext',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','updateSegmentById','segmentFolderId','entry_criteria','\x20activation\x20\x27','journey_entry_criteria_','Embedded\x20segment\x20\x27','run_after_journey_refresh','activation_template_id','buildUserMaps','waitStepUnit','some','journeyStages','SEGMENT_UPDATE_ERROR','activationsBySegmentId','existingJourney','sha1','verbose'];a169_0xf99f=function(){return _0x58b184;};return a169_0xf99f();}export async function buildPushExecutionContext(_0x3cff81,_0x144f12,_0x490a4f,_0x3bbfda,_0x5bad27,_0x2ac091){const _0x4621f5=a169_0x12f8f2,_0x558572=extractRootFolderId(_0x490a4f),{pathToId:_0x2d3e5a,idToPath:_0x446649}=buildFolderMaps(_0x5bad27),_0x3bdbfa=buildSegmentNameToIdMap(_0x3bbfda),_0x5899d3=new Map(),{batchAsync:_0x53eb12}=await import('../../utils/async.js'),[_0x45836e,_0x15ed3b]=await Promise[_0x4621f5(0x1f4)]([_0x3cff81['user'][_0x4621f5(0x235)](),_0x3cff81['connection'][_0x4621f5(0x28b)](),((async()=>{const _0x46b50a=_0x4621f5;!_0x2ac091&&_0x3bbfda[_0x46b50a(0x295)]>0x0&&await _0x53eb12(_0x3bbfda,async _0x2f23df=>{const _0x262d39=_0x46b50a,_0x3ec4d2=await _0x3cff81[_0x262d39(0x28e)][_0x262d39(0x217)](_0x144f12,_0x2f23df['id']);_0x5899d3['set'](_0x2f23df['id'],_0x3ec4d2);});})())]),{emailToId:_0x9ad3a6,idToEmail:_0x598283}=_0x45836e,_0x524b8b=buildConnectionMaps(_0x15ed3b);return{'rootFolderId':_0x558572,'folderPathToId':_0x2d3e5a,'folderIdToPath':_0x446649,'segmentNameToId':_0x3bdbfa,'activationsBySegmentId':_0x5899d3,'emailToIdMap':_0x9ad3a6,'idToEmailMap':_0x598283,'connectionNameToIdMap':_0x524b8b['nameToId'],'connectionIdToNameMap':_0x524b8b[_0x4621f5(0x1fd)],'connectionNameToTypeMap':_0x524b8b[_0x4621f5(0x252)]};}export function createPushYamlContextForBundle(_0x2f770d,_0x1f506c,_0x76a654,_0x2d6450,_0x2fccf7,_0x1574bf,_0x4a6e9a,_0x52bd43){const {existingLocalSegmentNames:_0x18af2c,localExpandedRuleToNames:_0x349dc7}=_0x2d6450,_0x36edd4=new Set(),_0x58d9cc=new Map(),_0x17f0b6=new Map(),_0x5e4f37=new Map(),_0x3e479e=createJumpTargetCache(),_0x48389b=new Map(),_0x50a809=new Map(),_0x36d1e0=new Set();let _0x45ed88;const _0x332410=_0x20b54e=>{const _0x423667={'resolveSegment':async _0x5e24cc=>{const _0x9fe798=a169_0x880c,_0xab0243=_0x5e4f37['get'](_0x5e24cc);if(_0xab0243!==undefined)return{'name':_0xab0243,'isJourneyLocal':!![]};try{const _0x52ff02=await fetchSegment(_0x2f770d,_0x1f506c,_0x5e24cc,_0x76a654);if(!_0x52ff02)throw new Error(_0x9fe798(0x25d));const _0x5e0a38=generateJourneyLocalName(_0x52ff02[_0x9fe798(0x2a4)]),_0x16baf9=_0x52ff02[_0x9fe798(0x2c0)]===SEGMENT_KIND_JOURNEY&&_0x5e0a38!==undefined;let _0x3b4b24=_0x52ff02[_0x9fe798(0x2a4)],_0x5f9015;if(_0x16baf9&&_0x52ff02[_0x9fe798(0x284)]){const _0x21e2ee=apiRuleToYaml(_0x52ff02[_0x9fe798(0x284)]);_0x50a809['set'](_0x5e24cc,_0x21e2ee);const _0x29e69a=async _0x47fd63=>{const _0x447950=_0x9fe798,_0x417af2=collectSegmentRefsFromRule(_0x47fd63);for(const _0x3cd671 of _0x417af2){if(!_0x50a809[_0x447950(0x249)](_0x3cd671))try{const _0x3e2fe1=await fetchSegment(_0x2f770d,_0x1f506c,_0x3cd671,_0x76a654);if(_0x3e2fe1?.[_0x447950(0x284)]){const _0x57f266=apiRuleToYaml(_0x3e2fe1['rule']);_0x50a809['set'](_0x3cd671,_0x57f266),await _0x29e69a(_0x57f266);}}catch(_0x2b3ea5){logger[_0x447950(0x1eb)](_0x447950(0x283)+_0x3cd671+':\x20'+_0x2b3ea5);}}};await _0x29e69a(_0x21e2ee);const _0x49833e=serializeExpandedRule(_0x21e2ee,_0x50a809),_0x224a85=_0x349dc7[_0x9fe798(0x1d3)](_0x49833e);if(_0x224a85&&_0x224a85[_0x9fe798(0x295)]>0x0){const _0x2b3c28=_0x58d9cc[_0x9fe798(0x1d3)](_0x49833e)||0x0,_0x524780=_0x224a85[_0x2b3c28]||_0x224a85[_0x224a85['length']-0x1];_0x58d9cc[_0x9fe798(0x1ea)](_0x49833e,_0x2b3c28+0x1),_0x3b4b24=_0x524780,_0x36edd4[_0x9fe798(0x1f7)](_0x3b4b24),_0x5e4f37[_0x9fe798(0x1ea)](_0x5e24cc,_0x3b4b24);const _0x1be744=await resolveRuleSegmentRefs(_0x21e2ee,async _0x10cf9a=>{const _0x255cd3=_0x9fe798,_0x23930c=_0x5e4f37[_0x255cd3(0x1d3)](_0x10cf9a);if(_0x23930c)return _0x23930c;const _0x85737e=await _0x45ed88[_0x255cd3(0x20d)](_0x10cf9a);return _0x85737e[_0x255cd3(0x2a4)];});_0x5f9015={'description':_0x52ff02[_0x9fe798(0x261)],'rule':_0x1be744};}else{const _0x492e77=_0x48389b[_0x9fe798(0x1d3)](_0x49833e);if(_0x492e77)_0x3b4b24=_0x492e77,_0x5e4f37[_0x9fe798(0x1ea)](_0x5e24cc,_0x3b4b24);else{if(_0x5e0a38){let _0x1c4bc5=_0x5e0a38,_0x3e1f63=0x2;while(_0x36edd4[_0x9fe798(0x249)](_0x1c4bc5)||_0x18af2c[_0x9fe798(0x249)](_0x1c4bc5)){_0x1c4bc5=_0x5e0a38+'_'+_0x3e1f63,_0x3e1f63++;}_0x36edd4[_0x9fe798(0x1f7)](_0x1c4bc5),_0x3b4b24=_0x1c4bc5;}_0x5e4f37['set'](_0x5e24cc,_0x3b4b24),_0x48389b[_0x9fe798(0x1ea)](_0x49833e,_0x3b4b24);const _0xbe027d=await resolveRuleSegmentRefs(_0x21e2ee,async _0x28c1e9=>{const _0xf3e1b7=_0x9fe798,_0x3d9a2e=_0x5e4f37['get'](_0x28c1e9);if(_0x3d9a2e)return _0x3d9a2e;const _0x10c28d=await _0x45ed88[_0xf3e1b7(0x20d)](_0x28c1e9);return _0x10c28d[_0xf3e1b7(0x2a4)];});_0x5f9015={'description':_0x52ff02['description'],'rule':_0xbe027d};}}}return{'name':_0x3b4b24,'isJourneyLocal':_0x16baf9,'definition':_0x5f9015};}catch(_0x565df6){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x5e24cc+':\x20'+_0x565df6),{'name':_0x5e24cc,'isJourneyLocal':![]};}},'resolveActivation':async _0x28412c=>{const _0x9b5d42=a169_0x880c,_0xd218c1=_0x17f0b6[_0x9b5d42(0x1d3)](_0x28412c);if(_0xd218c1!==undefined)return{'name':_0xd218c1,'isJourneyLocal':!![]};try{let _0x649542=_0x4a6e9a?.[_0x9b5d42(0x1d3)](_0x28412c);!_0x649542&&(_0x649542=await _0x2f770d[_0x9b5d42(0x2bc)][_0x9b5d42(0x258)](_0x20b54e,_0x28412c));const _0x54308d=_0x649542[_0x9b5d42(0x2c5)][_0x9b5d42(0x2d1)][_0x9b5d42(0x2a4)]||_0x28412c,_0x5394cd=sanitizeYamlKey(_0x54308d)||'activation_'+_0x28412c,_0x5af7b1=_0x5394cd;_0x17f0b6[_0x9b5d42(0x1ea)](_0x28412c,_0x5af7b1);const _0x4c5efa=journeyActivationStepToYaml(_0x649542,_0x2fccf7,_0x1574bf);return{'name':_0x5af7b1,'isJourneyLocal':!![],'definition':_0x4c5efa};}catch(_0x17d526){return logger[_0x9b5d42(0x1eb)](_0x9b5d42(0x1db)+_0x28412c+':\x20'+_0x17d526),{'name':_0x28412c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1028f7,_0x2eb62f)=>resolveJumpTarget(_0x1028f7,_0x2eb62f,_0x3e479e,async _0x325187=>{const _0x15070b=a169_0x880c,_0x5dbe49=_0x52bd43?.[_0x15070b(0x1d3)](_0x325187);if(_0x5dbe49)return _0x5dbe49;return _0x2f770d['journey'][_0x15070b(0x227)](_0x325187);})};return _0x45ed88=_0x423667,_0x423667;},_0x1c2e85=async _0x2bafea=>{const _0x59c9f6=a169_0x880c,{collectSegmentIdsFromJourneyApi:_0x4edbc0}=await import(_0x59c9f6(0x2cc)),{batchAsync:_0x2776cc}=await import(_0x59c9f6(0x269)),_0x442406=new Set();for(const _0x552c39 of _0x2bafea){let _0x946a8b=_0x52bd43?.[_0x59c9f6(0x1d3)](_0x552c39);!_0x946a8b&&(_0x946a8b=await _0x2f770d[_0x59c9f6(0x2bc)][_0x59c9f6(0x227)](_0x552c39));const _0x420af4=_0x4edbc0(_0x946a8b);for(const _0x4b6e71 of _0x420af4){_0x442406[_0x59c9f6(0x1f7)](_0x4b6e71);}}let _0x1c20a0=Array[_0x59c9f6(0x276)](_0x442406);while(_0x1c20a0[_0x59c9f6(0x295)]>0x0){const _0x1616a8=_0x1c20a0[_0x59c9f6(0x2af)](_0x8348be=>!_0x36d1e0[_0x59c9f6(0x249)](_0x8348be));if(_0x1616a8[_0x59c9f6(0x295)]===0x0)break;const _0x3120a3=await _0x2776cc(_0x1616a8,async _0x28d5d8=>{const _0x19e7a7=_0x59c9f6;_0x36d1e0[_0x19e7a7(0x1f7)](_0x28d5d8);const _0x5b109c=await fetchSegment(_0x2f770d,_0x1f506c,_0x28d5d8,_0x76a654);if(!_0x5b109c)return null;return{'segmentId':_0x28d5d8,'segment':_0x5b109c};},0xa),_0x213373=new Set();for(const _0x41ad48 of _0x3120a3){if(!_0x41ad48?.[_0x59c9f6(0x28e)]?.['rule'])continue;const _0x2490d2=apiRuleToYaml(_0x41ad48['segment'][_0x59c9f6(0x284)]);_0x50a809[_0x59c9f6(0x1ea)](_0x41ad48[_0x59c9f6(0x26d)],_0x2490d2);const _0x32f240=collectSegmentRefsFromRule(_0x2490d2);for(const _0x1327df of _0x32f240){!_0x36d1e0[_0x59c9f6(0x249)](_0x1327df)&&_0x213373[_0x59c9f6(0x1f7)](_0x1327df);}}_0x1c20a0=Array['from'](_0x213373);}};return{'createYamlContext':_0x332410,'prefetchJourneySegments':_0x1c2e85};}export async function executePushSegments(_0x30f1d8,_0x16c483,_0x4491c1,_0x26c86f,_0x5c1c56){const _0xfe1d18=a169_0x12f8f2,{segmentDefToCreateRequest:_0xbd0431,segmentDefToUpdateRequest:_0xf572fa}=await import(_0xfe1d18(0x202)),_0x36d221=_0x4491c1['folderPathToId'],_0x3921f7=0x5,_0x4592a7=async _0x5a7f8d=>{const _0x19370b=_0xfe1d18,_0xfa71a1=_0x5a7f8d['folderPath']?_0x36d221['get'](_0x5a7f8d['folderPath']):undefined;let _0x22dea4;const _0x25662a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xc1ac47=_0x5a7f8d[_0x19370b(0x256)];if(_0x5a7f8d['yamlConfig'][_0x19370b(0x284)]){const _0x3203d8=createSegmentIdResolver(_0x4491c1[_0x19370b(0x294)],_0x5a7f8d['yamlConfig']['name']),_0x9b0e11=await resolveRuleSegmentIds(_0x5a7f8d[_0x19370b(0x256)]['rule'],_0x3203d8);_0xc1ac47={..._0x5a7f8d[_0x19370b(0x256)],'rule':_0x9b0e11};}try{if(_0x5a7f8d[_0x19370b(0x267)]){_0x5c1c56[_0x19370b(0x216)]?.({'type':'segment_creating','name':_0x5a7f8d[_0x19370b(0x256)]['name']});const _0x1ce40b=_0xbd0431(_0xc1ac47,_0xfa71a1),_0x16f304=await _0x5c1c56[_0x19370b(0x220)](_0x19370b(0x28c)+_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]+_0x19370b(0x1df),()=>_0x30f1d8[_0x19370b(0x28e)][_0x19370b(0x1d5)](_0x26c86f['parentId'],_0x1ce40b));_0x22dea4=_0x16f304[_0x19370b(0x204)]['id'],_0x4491c1[_0x19370b(0x294)][_0x19370b(0x1ea)](_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)],_0x22dea4),_0x25662a['createdSegmentId']={'name':_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)],'id':_0x22dea4},_0x5c1c56[_0x19370b(0x216)]?.({'type':_0x19370b(0x248),'name':_0x5a7f8d[_0x19370b(0x256)]['name'],'segmentId':_0x22dea4}),_0x5c1c56[_0x19370b(0x28a)]?.(_0x19370b(0x2c4)+_0x5a7f8d[_0x19370b(0x256)]['name']+'\x27'),_0x25662a[_0x19370b(0x29e)]=0x1;}else{if(_0x5a7f8d[_0x19370b(0x247)]){_0x5c1c56['onProgress']?.({'type':_0x19370b(0x285),'name':_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]});const _0x46e629=_0xf572fa(_0xc1ac47);_0xfa71a1!==_0x5a7f8d['existingSegment']?.[_0x19370b(0x22e)]&&(_0x46e629['segmentFolderId']=_0xfa71a1?parseInt(_0xfa71a1,0xa):undefined),await _0x5c1c56['withProgress'](_0x19370b(0x24c)+_0x5a7f8d[_0x19370b(0x256)]['name']+_0x19370b(0x1df),()=>_0x30f1d8['segment'][_0x19370b(0x22d)](_0x26c86f[_0x19370b(0x1e4)],_0x5a7f8d[_0x19370b(0x2c8)]['id'],_0x46e629)),_0x22dea4=_0x5a7f8d[_0x19370b(0x2c8)]['id'],_0x5c1c56[_0x19370b(0x216)]?.({'type':_0x19370b(0x293),'name':_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]}),_0x5c1c56[_0x19370b(0x28a)]?.(_0x19370b(0x1d4)+_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]+'\x27'),_0x25662a[_0x19370b(0x1fb)]=0x1;}else _0x22dea4=_0x5a7f8d['existingSegment']['id'];}}catch(_0x4ff1e7){const _0x5efd68=isHttp400Error(_0x4ff1e7),_0x21bb0b=_0x5efd68?ErrorCode[_0x19370b(0x296)]:ErrorCode[_0x19370b(0x239)],_0x2aefc3=getErrorMessage(_0x4ff1e7);throw new SDKError(_0x21bb0b,'Failed\x20to\x20'+(_0x5a7f8d[_0x19370b(0x267)]?_0x19370b(0x29d):_0x19370b(0x23f))+_0x19370b(0x255)+_0x5a7f8d[_0x19370b(0x253)]+_0x19370b(0x1e6)+_0x2aefc3,_0x4ff1e7);}try{const _0x18673a=await syncActivationsForSegment(_0x30f1d8,_0x26c86f[_0x19370b(0x1e4)],_0x22dea4,_0x5a7f8d['yamlConfig'][_0x19370b(0x2a4)],_0x5a7f8d[_0x19370b(0x2ab)],_0x5c1c56,_0x5a7f8d[_0x19370b(0x253)]);_0x25662a['activations']=_0x18673a;}catch(_0x1f606f){if(_0x1f606f instanceof SDKError)throw _0x1f606f;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x19370b(0x25c)+_0x5a7f8d['yamlConfig'][_0x19370b(0x2a4)]+_0x19370b(0x2b7)+_0x5a7f8d[_0x19370b(0x253)]+_0x19370b(0x1e6)+getErrorMessage(_0x1f606f),_0x1f606f);}return _0x25662a;},_0x3edecd=await batchAsync(_0x16c483,_0x4592a7,_0x3921f7),_0x1456a8={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x12d4b9 of _0x3edecd){_0x1456a8['created']+=_0x12d4b9['created'],_0x1456a8[_0xfe1d18(0x1fb)]+=_0x12d4b9[_0xfe1d18(0x1fb)],_0x12d4b9['createdSegmentId']&&_0x1456a8['createdSegmentIds'][_0xfe1d18(0x1ea)](_0x12d4b9[_0xfe1d18(0x2ae)][_0xfe1d18(0x2a4)],_0x12d4b9['createdSegmentId']['id']),_0x1456a8[_0xfe1d18(0x20c)][_0xfe1d18(0x29e)]+=_0x12d4b9[_0xfe1d18(0x20c)][_0xfe1d18(0x29e)],_0x1456a8[_0xfe1d18(0x20c)]['updated']+=_0x12d4b9[_0xfe1d18(0x20c)][_0xfe1d18(0x1fb)],_0x1456a8[_0xfe1d18(0x20c)][_0xfe1d18(0x1dc)]+=_0x12d4b9['activations']['deleted'];}return _0x1456a8;}async function syncActivationsForSegment(_0x5a42b2,_0x5126dd,_0x13d04b,_0xc28f72,_0x83bf3,_0xa654b5,_0x160e81){const _0x5826ed=a169_0x12f8f2,_0x363826={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x19d6f3 of _0x83bf3){try{if(_0x19d6f3[_0x5826ed(0x1d7)]===_0x5826ed(0x29d)&&_0x19d6f3[_0x5826ed(0x2c3)])_0xa654b5[_0x5826ed(0x216)]?.({'type':_0x5826ed(0x1fa),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),await _0xa654b5['withProgress'](_0x5826ed(0x27f)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27...',()=>_0x5a42b2[_0x5826ed(0x28e)][_0x5826ed(0x242)](_0x5126dd,_0x13d04b,_0x19d6f3[_0x5826ed(0x2c3)])),_0xa654b5[_0x5826ed(0x216)]?.({'type':_0x5826ed(0x24f),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),_0xa654b5[_0x5826ed(0x28a)]?.(_0x5826ed(0x20f)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27'),_0x363826[_0x5826ed(0x29e)]++;else{if(_0x19d6f3['type']===_0x5826ed(0x23f)&&_0x19d6f3[_0x5826ed(0x2c3)]&&_0x19d6f3['existingActivation'])_0xa654b5['onProgress']?.({'type':'activation_updating','segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),await _0xa654b5[_0x5826ed(0x220)]('Updating\x20activation\x20\x27'+_0x19d6f3['name']+_0x5826ed(0x1df),()=>_0x5a42b2[_0x5826ed(0x28e)][_0x5826ed(0x265)](_0x5126dd,_0x13d04b,_0x19d6f3[_0x5826ed(0x21b)]['id'],_0x19d6f3[_0x5826ed(0x2c3)])),_0xa654b5['onProgress']?.({'type':_0x5826ed(0x27e),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),_0xa654b5[_0x5826ed(0x28a)]?.(_0x5826ed(0x1f2)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27'),_0x363826[_0x5826ed(0x1fb)]++;else _0x19d6f3[_0x5826ed(0x1d7)]===_0x5826ed(0x275)&&_0x19d6f3[_0x5826ed(0x21b)]&&(_0xa654b5['onProgress']?.({'type':'activation_deleting','segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),await _0xa654b5['withProgress']('Deleting\x20activation\x20\x27'+_0x19d6f3[_0x5826ed(0x2a4)]+_0x5826ed(0x1df),()=>_0x5a42b2[_0x5826ed(0x28e)][_0x5826ed(0x259)](_0x5126dd,_0x13d04b,_0x19d6f3[_0x5826ed(0x21b)]['id'])),_0xa654b5['onProgress']?.({'type':_0x5826ed(0x1e9),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),_0xa654b5[_0x5826ed(0x2b4)]?.('Deleted\x20activation\x20\x27'+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27'),_0x363826[_0x5826ed(0x1dc)]++);}}catch(_0x261fd9){const _0x11e3fd=isHttp400Error(_0x261fd9),_0x5c5df3=_0x11e3fd?ErrorCode[_0x5826ed(0x224)]:ErrorCode[_0x5826ed(0x24d)],_0x432cb7=getErrorMessage(_0x261fd9);throw new SDKError(_0x5c5df3,_0x5826ed(0x2aa)+_0x19d6f3[_0x5826ed(0x1d7)]+_0x5826ed(0x230)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27\x20from\x20file:\x20'+_0x160e81+_0x5826ed(0x1e6)+_0x432cb7,_0x261fd9);}}return _0x363826;}export async function executePushFolders(_0x2bec26,_0x2ebb77,_0xe9b408,_0x2095be,_0x4831b4){const _0xcc790a=a169_0x12f8f2,_0x2993fb=new Map(_0xe9b408),_0x4d351b=sortFoldersByDepth(_0x2ebb77);for(const _0xa43de2 of _0x4d351b){const _0x1ac8c3=_0xa43de2[_0xcc790a(0x2bb)]('/'),_0x5535ac=_0x1ac8c3[_0x1ac8c3[_0xcc790a(0x295)]-0x1],_0x4474fe=_0x1ac8c3[_0xcc790a(0x209)](0x0,-0x1)[_0xcc790a(0x2b9)]('/'),_0x1e9f56=_0x2993fb[_0xcc790a(0x1d3)](_0x4474fe);_0x4831b4[_0xcc790a(0x216)]?.({'type':_0xcc790a(0x263),'folder':_0xa43de2});const _0x3698a1={'name':_0x5535ac,'parentFolderId':_0x1e9f56},_0xd63371=await _0x4831b4[_0xcc790a(0x220)]('Creating\x20folder\x20\x27'+_0xa43de2+'\x27...',()=>_0x2bec26[_0xcc790a(0x28e)]['createFolder'](_0x2095be[_0xcc790a(0x1e4)],_0x3698a1));_0x2993fb[_0xcc790a(0x1ea)](_0xa43de2,_0xd63371[_0xcc790a(0x204)]['id']),_0x4831b4['onProgress']?.({'type':_0xcc790a(0x264),'folder':_0xa43de2,'folderId':_0xd63371[_0xcc790a(0x204)]['id']}),_0x4831b4[_0xcc790a(0x272)]?.(_0xcc790a(0x2a5)+_0xa43de2+'\x27');}return _0x2993fb;}export async function executePushSegmentDeletions(_0x3b46f2,_0x143c16,_0xa2c447){const _0x4c479d=a169_0x12f8f2;if(_0x143c16[_0x4c479d(0x295)]===0x0)return 0x0;const {batchAsync:_0x366b79}=await import(_0x4c479d(0x269)),_0x4e62e3=0x5,_0x51d468=await _0x366b79(_0x143c16,async _0x20be75=>{const _0x5e6529=_0x4c479d;return _0xa2c447[_0x5e6529(0x216)]?.({'type':'segment_deleting','name':_0x20be75[_0x5e6529(0x2a4)]}),await _0x3b46f2[_0x5e6529(0x28e)][_0x5e6529(0x213)](_0x20be75['id']),_0xa2c447[_0x5e6529(0x216)]?.({'type':_0x5e6529(0x208),'name':_0x20be75[_0x5e6529(0x2a4)]}),_0xa2c447[_0x5e6529(0x2b4)]?.('Deleted\x20segment\x20\x27'+_0x20be75['name']+'\x27'),0x1;},_0x4e62e3);return _0x51d468[_0x4c479d(0x207)]((_0x2230bc,_0x53a0be)=>_0x2230bc+_0x53a0be,0x0);}export async function executePushJourneys(_0x59d74c,_0x2f26af,_0x42b3f4,_0x3d7a97,_0x3d271b){const _0x253138=a169_0x12f8f2,{journeyDefToRequest:_0x3430c3}=await import(_0x253138(0x2cc)),{activationDefToCreateRequest:_0x3c3301,yamlRuleToApi:_0x444e69,validateSegmentRule:_0x4d7d98}=await import(_0x253138(0x202)),_0x3b0450={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3262cb=new Map(_0x42b3f4[_0x253138(0x294)]),_0x453f6d=0x5;for(let _0x583299=0x0;_0x583299<_0x2f26af[_0x253138(0x295)];_0x583299+=_0x453f6d){const _0x3095ba=_0x2f26af['slice'](_0x583299,_0x583299+_0x453f6d),_0x5bb7b2=await Promise['all'](_0x3095ba[_0x253138(0x201)](async _0x3d124f=>{const _0x55dedb=_0x253138;if(!_0x3d124f['isNew']&&!_0x3d124f[_0x55dedb(0x247)])return{'action':'unchanged','name':_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)],'journeyId':_0x3d124f[_0x55dedb(0x23b)]?.['id']};const _0x191a3a=_0x3d124f[_0x55dedb(0x2a8)]?_0x42b3f4[_0x55dedb(0x241)][_0x55dedb(0x1d3)](_0x3d124f[_0x55dedb(0x2a8)]):undefined;_0x3d271b[_0x55dedb(0x216)]?.({'type':_0x3d124f[_0x55dedb(0x267)]?'journey_creating':_0x55dedb(0x2c6),'name':_0x3d124f['yamlConfig'][_0x55dedb(0x2a4)]});try{const _0x540257=await executeSingleJourneyPush(_0x59d74c,_0x3d124f,{..._0x42b3f4,'segmentNameToId':_0x3262cb},{'parentId':_0x3d7a97[_0x55dedb(0x1e4)],'rootFolderId':_0x3d7a97[_0x55dedb(0x1d1)],'folderId':_0x191a3a,'verbose':_0x3d7a97[_0x55dedb(0x23d)]},_0x3d271b,{'journeyDefToRequest':_0x3430c3,'activationDefToCreateRequest':_0x3c3301,'yamlRuleToApi':_0x444e69,'validateSegmentRule':_0x4d7d98});for(const [_0x4ce91f,_0x361d0e]of _0x540257[_0x55dedb(0x281)]){_0x3262cb['set'](_0x4ce91f,_0x361d0e),_0x3b0450['embeddedSegmentNameToId'][_0x55dedb(0x1ea)](_0x4ce91f,_0x361d0e);}if(_0x540257[_0x55dedb(0x225)]===_0x55dedb(0x29e))_0x3d271b[_0x55dedb(0x216)]?.({'type':_0x55dedb(0x1d8),'name':_0x3d124f[_0x55dedb(0x256)]['name'],'journeyId':_0x540257[_0x55dedb(0x29a)]}),_0x3d271b[_0x55dedb(0x28a)]?.(_0x55dedb(0x2a6)+_0x3d124f[_0x55dedb(0x256)]['name']+'\x27'),_0x3b0450[_0x55dedb(0x29e)]++;else _0x540257[_0x55dedb(0x225)]===_0x55dedb(0x1fb)&&(_0x3d271b['onProgress']?.({'type':_0x55dedb(0x2a3),'name':_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)]}),_0x3d271b[_0x55dedb(0x28a)]?.('Updated\x20journey\x20\x27'+_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)]+'\x27'),_0x3b0450[_0x55dedb(0x1fb)]++);return{'action':_0x540257['action'],'name':_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)],'journeyId':_0x540257[_0x55dedb(0x29a)]};}catch(_0x2c7a30){const _0x4833fa=isHttp400Error(_0x2c7a30),_0x599610=_0x4833fa?ErrorCode[_0x55dedb(0x26a)]:ErrorCode[_0x55dedb(0x282)],_0x5696fa=getErrorMessage(_0x2c7a30);throw new SDKError(_0x599610,_0x55dedb(0x2aa)+(_0x3d124f[_0x55dedb(0x267)]?_0x55dedb(0x29d):'update')+_0x55dedb(0x26c)+_0x3d124f[_0x55dedb(0x253)]+_0x55dedb(0x1e6)+_0x5696fa,_0x2c7a30);}}));_0x3b0450[_0x253138(0x2b6)][_0x253138(0x2a9)](..._0x5bb7b2);}return _0x3b0450;}async function matchExistingJourneySegments(_0x5dc956,_0x2f6989,_0xb55bbe,_0x350d42,_0x5d3409){const _0x4364c7=a169_0x12f8f2;if(!_0x2f6989[_0x4364c7(0x23b)]||!_0x2f6989[_0x4364c7(0x256)]['segments'])return;const _0x2d4735=new Map(),_0x452d41=new Set();for(const _0x480340 of Object[_0x4364c7(0x1d2)](_0x2f6989[_0x4364c7(0x256)][_0x4364c7(0x1ed)])){const _0x29e73a=generateDeterministicJourneySegmentName(_0x2f6989[_0x4364c7(0x256)][_0x4364c7(0x2a4)],_0x480340);_0x2d4735[_0x4364c7(0x1ea)](_0x29e73a,_0x480340),_0x452d41[_0x4364c7(0x1f7)](_0x480340);}const _0x2de35d=[],_0x14ca10=collectSegmentIdsFromJourneyApi(_0x2f6989[_0x4364c7(0x23b)]);for(const _0x132d88 of _0x14ca10){const _0x25c5b4=await fetchSegment(_0x5dc956,_0xb55bbe,_0x132d88,_0x350d42);if(!_0x25c5b4?.[_0x4364c7(0x2a4)])continue;const _0x3a94cb=_0x2d4735['get'](_0x25c5b4[_0x4364c7(0x2a4)]);_0x3a94cb?(_0x5d3409[_0x4364c7(0x1ea)](_0x3a94cb,_0x132d88),_0x452d41[_0x4364c7(0x275)](_0x3a94cb)):_0x2de35d[_0x4364c7(0x2a9)]({'id':_0x132d88,'seg':_0x25c5b4});}if(_0x452d41['size']>0x0&&_0x2de35d[_0x4364c7(0x295)]>0x0){const {localExpandedRuleToNames:_0x12f957}=buildLocalExpandedRuleMappings(_0x2f6989[_0x4364c7(0x256)]),_0x5266f8=new Map();for(const {id:_0x367a9a,seg:_0x454d98}of _0x2de35d){if(_0x454d98[_0x4364c7(0x284)]){const _0x31bd03=apiRuleToYaml(_0x454d98['rule']);_0x5266f8[_0x4364c7(0x1ea)](_0x367a9a,_0x31bd03);}}for(const {id:_0x3487c5,seg:_0x21a62a}of _0x2de35d){if(!_0x21a62a[_0x4364c7(0x284)])continue;const _0x300315=_0x5266f8[_0x4364c7(0x1d3)](_0x3487c5);if(!_0x300315)continue;const _0x328601=serializeExpandedRule(_0x300315,_0x5266f8),_0x500d60=_0x12f957[_0x4364c7(0x1d3)](_0x328601);if(_0x500d60){const _0x2e01ea=_0x500d60[_0x4364c7(0x1f8)](_0x17e9fd=>_0x452d41[_0x4364c7(0x249)](_0x17e9fd));_0x2e01ea&&(_0x5d3409[_0x4364c7(0x1ea)](_0x2e01ea,_0x3487c5),_0x452d41[_0x4364c7(0x275)](_0x2e01ea),logger[_0x4364c7(0x1eb)](_0x4364c7(0x1d9)+_0x21a62a[_0x4364c7(0x2a4)]+'\x27\x20to\x20local\x20\x27'+_0x2e01ea+_0x4364c7(0x287)));}}}}async function executeSingleJourneyPush(_0x3b481c,_0x354b51,_0x58674f,_0x3e2030,_0x5e3db5,_0xca719a){const _0x5dfb9a=a169_0x12f8f2,{journeyDefToRequest:_0x5093fa,activationDefToCreateRequest:_0x592e47,yamlRuleToApi:_0x41a634,validateSegmentRule:_0x4bea41}=_0xca719a,_0x8f0ba4=new Map(),_0xc348de=new Map();recoverSegmentIdsFromPushRecovery(_0x354b51,_0x8f0ba4,_0x58674f['segmentNameToId']);const _0x3bbdf7=new Map(),_0x35f53f=new Map(),_0x261d77=new Map();let _0x335523;const _0x1153a2=async()=>{const _0x79e86b=a169_0x880c;if(_0x335523)return;_0x335523=new Map();if(!_0x354b51[_0x79e86b(0x23b)])return;const _0x47bb18=await _0x3b481c['journey'][_0x79e86b(0x217)](_0x354b51[_0x79e86b(0x23b)]['id']);for(const _0xceac57 of _0x47bb18){const _0x11aad9=journeyActivationStepToYaml(_0xceac57,_0x58674f[_0x79e86b(0x1ef)],_0x58674f[_0x79e86b(0x212)]),_0x571652=activationSignature(_0x11aad9);!_0x335523[_0x79e86b(0x249)](_0x571652)&&_0x335523[_0x79e86b(0x1ea)](_0x571652,_0xceac57['id']),_0x11aad9['name']&&_0xc348de[_0x79e86b(0x1ea)](_0x11aad9[_0x79e86b(0x2a4)],_0xceac57['id']);}};await matchExistingJourneySegments(_0x3b481c,_0x354b51,_0x3e2030[_0x5dfb9a(0x1e4)],_0x58674f[_0x5dfb9a(0x21a)],_0x58674f[_0x5dfb9a(0x294)]);const _0x1f8486={'resolveSegmentId':async _0x2007cb=>{const _0x11661e=_0x5dfb9a,_0x5b602a=_0x58674f[_0x11661e(0x294)][_0x11661e(0x1d3)](_0x2007cb);if(!_0x5b602a)throw new SDKError(ErrorCode[_0x11661e(0x218)],_0x11661e(0x1d6)+_0x2007cb+_0x11661e(0x266)+_0x354b51[_0x11661e(0x256)][_0x11661e(0x2a4)]+')');return _0x5b602a;},'resolveEmbeddedSegmentId':async(_0x143fd5,_0x465ea2)=>{const _0x53324b=_0x5dfb9a,_0x4ace68=_0x58674f[_0x53324b(0x294)][_0x53324b(0x1d3)](_0x143fd5);if(_0x4ace68)return _0x4ace68;const _0x44a18f=_0x58674f[_0x53324b(0x21a)][_0x53324b(0x1f8)](_0x54df9b=>_0x54df9b[_0x53324b(0x2a4)]===_0x143fd5);if(_0x44a18f)return _0x58674f['segmentNameToId'][_0x53324b(0x1ea)](_0x143fd5,_0x44a18f['id']),_0x44a18f['id'];if(_0x354b51[_0x53324b(0x267)]){const {stageName:_0x5c7b78,criteriaName:_0x5513a4}=findSegmentCriteriaLocation(_0x354b51['yamlConfig'],_0x143fd5);return _0x4bea41(_0x143fd5,_0x465ea2[_0x53324b(0x284)]),_0x35f53f[_0x53324b(0x1ea)](_0x143fd5,{'definition':_0x465ea2,'stageName':_0x5c7b78,'criteriaName':_0x5513a4}),createPendingSegmentId(_0x143fd5);}const _0x4a4d6e=_0x354b51[_0x53324b(0x23b)]?.['id'];if(!_0x4a4d6e)throw new SDKError(ErrorCode[_0x53324b(0x24e)],_0x53324b(0x240));const _0x14c959=_0x3bbdf7[_0x53324b(0x1d3)](_0x143fd5);if(_0x14c959)return _0x14c959;const _0x4159cb=((async()=>{const _0x2d5e37=_0x53324b;_0x4bea41(_0x143fd5,_0x465ea2[_0x2d5e37(0x284)]);const _0x937a42=generateDeterministicJourneySegmentName(_0x354b51[_0x2d5e37(0x256)][_0x2d5e37(0x2a4)],_0x143fd5),_0x2833f8=_0x58674f[_0x2d5e37(0x21a)][_0x2d5e37(0x1f8)](_0x3377e4=>_0x3377e4[_0x2d5e37(0x2a4)]===_0x937a42),_0x42878f=createSegmentIdResolver(_0x58674f[_0x2d5e37(0x294)],_0x143fd5),_0x347ff8=await resolveRuleSegmentIds(_0x465ea2[_0x2d5e37(0x284)],_0x42878f);let _0x2be5b3;return _0x2833f8?(await _0x3b481c[_0x2d5e37(0x28e)][_0x2d5e37(0x22d)](_0x3e2030[_0x2d5e37(0x1e4)],_0x2833f8['id'],{'description':_0x465ea2[_0x2d5e37(0x261)]||_0x2d5e37(0x1dd)+_0x143fd5,'rule':_0x41a634(_0x347ff8),'countPopulation':!![]}),_0x2be5b3=_0x2833f8['id'],saveSegmentToPushRecovery(_0x354b51[_0x2d5e37(0x253)],_0x354b51[_0x2d5e37(0x256)][_0x2d5e37(0x2a4)],_0x143fd5,{'segmentId':_0x2be5b3,'uniqueServerName':_0x937a42,'createdAt':new Date()[_0x2d5e37(0x2ad)]()})):_0x2be5b3=await createOrRecoverEmbeddedSegment(_0x3b481c,_0x354b51,{'localName':_0x143fd5,'uniqueSegmentName':_0x937a42,'description':_0x465ea2[_0x2d5e37(0x261)]||_0x2d5e37(0x1dd)+_0x143fd5,'journeyId':_0x4a4d6e,'resolvedRule':_0x347ff8,'parentId':_0x3e2030[_0x2d5e37(0x1e4)],'folderId':_0x3e2030[_0x2d5e37(0x1d1)]||''},_0x41a634),_0x58674f[_0x2d5e37(0x294)][_0x2d5e37(0x1ea)](_0x143fd5,_0x2be5b3),_0x8f0ba4[_0x2d5e37(0x1ea)](_0x143fd5,_0x2be5b3),_0x2be5b3;})());_0x3bbdf7['set'](_0x143fd5,_0x4159cb);try{return await _0x4159cb;}finally{_0x3bbdf7[_0x53324b(0x275)](_0x143fd5);}},'resolveActivationId':async _0x1c10b7=>{const _0x349422=_0x5dfb9a,_0x1fc3d1=_0xc348de['get'](_0x1c10b7);if(_0x1fc3d1)return _0x1fc3d1;if(_0x354b51[_0x349422(0x23b)]){await _0x1153a2();const _0x5b1d02=_0xc348de[_0x349422(0x1d3)](_0x1c10b7);if(_0x5b1d02)return _0x5b1d02;}throw new SDKError(ErrorCode[_0x349422(0x278)],'Activation\x20not\x20found:\x20'+_0x1c10b7+_0x349422(0x266)+_0x354b51[_0x349422(0x256)][_0x349422(0x2a4)]+_0x349422(0x215)+_0x349422(0x2bf));},'resolveEmbeddedActivationId':async(_0x45832e,_0x2732e9)=>{const _0x4cee17=_0x5dfb9a,_0x47a9ba=_0xc348de[_0x4cee17(0x1d3)](_0x45832e);if(_0x47a9ba)return _0x47a9ba;if(_0x354b51['isNew'])return _0x261d77[_0x4cee17(0x1ea)](_0x45832e,_0x2732e9),createPendingActivationId(_0x45832e);if(_0x354b51[_0x4cee17(0x23b)]){await _0x1153a2();const _0xfbbbe2=_0xc348de[_0x4cee17(0x1d3)](_0x2732e9[_0x4cee17(0x2a4)]);if(_0xfbbbe2)return _0xc348de[_0x4cee17(0x1ea)](_0x45832e,_0xfbbbe2),_0xfbbbe2;const _0x3613d1=activationSignature(_0x2732e9),_0x4df490=_0x335523?.['get'](_0x3613d1);if(_0x4df490)return _0xc348de[_0x4cee17(0x1ea)](_0x45832e,_0x4df490),_0x4df490;const _0x22cbf6=await _0x592e47(_0x2732e9,_0x58674f[_0x4cee17(0x22b)]),_0x3f8715={..._0x22cbf6,..._0x2732e9[_0x4cee17(0x233)]!==undefined&&{'runAfterJourneyRefresh':_0x2732e9[_0x4cee17(0x233)]}},_0x394b80=await _0x3b481c[_0x4cee17(0x2bc)][_0x4cee17(0x242)](_0x354b51['existingJourney']['id'],_0x3f8715);return _0xc348de[_0x4cee17(0x1ea)](_0x45832e,_0x394b80['id']),_0x394b80['id'];}throw new SDKError(ErrorCode[_0x4cee17(0x24e)],_0x4cee17(0x262));},'resolveJourneyId':async _0x2e3b1f=>{const _0x5edef4=_0x5dfb9a;try{return await _0x3b481c['journey'][_0x5edef4(0x226)](_0x3e2030[_0x5edef4(0x1e4)],_0x2e3b1f);}catch(_0x27e6a7){throw new SDKError(ErrorCode[_0x5edef4(0x278)],_0x5edef4(0x24a)+_0x2e3b1f+_0x5edef4(0x25a)+_0x354b51[_0x5edef4(0x256)][_0x5edef4(0x2a4)]+'\x27)',_0x27e6a7);}},'resolveStageId':async(_0x2622f4,_0x3c5fdc)=>{const _0x41d7c8=_0x5dfb9a,_0x39e6b4=await _0x3b481c[_0x41d7c8(0x2bc)][_0x41d7c8(0x227)](_0x2622f4),_0x366869=_0x39e6b4[_0x41d7c8(0x2c5)][_0x41d7c8(0x238)][_0x41d7c8(0x1f8)](_0x5b4697=>_0x5b4697['name']['toLowerCase']()===_0x3c5fdc[_0x41d7c8(0x21d)]());if(!_0x366869?.['id'])throw new SDKError(ErrorCode[_0x41d7c8(0x278)],_0x41d7c8(0x1cf)+_0x3c5fdc+_0x41d7c8(0x219)+(_0x39e6b4[_0x41d7c8(0x2c5)][_0x41d7c8(0x203)]||_0x39e6b4[_0x41d7c8(0x2c5)]['name'])+'\x27');return _0x366869['id'];}},_0x3d4f4f=await _0x5093fa(_0x354b51[_0x5dfb9a(0x256)],_0x3e2030[_0x5dfb9a(0x1e4)],_0x1f8486),_0x269c8d=_0x3e2030[_0x5dfb9a(0x27d)]||_0x3e2030['rootFolderId'];_0x269c8d&&(_0x3d4f4f['relationships']={'parentFolder':{'data':{'id':_0x269c8d,'type':_0x5dfb9a(0x291)}}});if(_0x354b51[_0x5dfb9a(0x267)]){if(_0x35f53f['size']>0x0||_0x261d77['size']>0x0)return await executeThreeStepJourneyCreate(_0x3b481c,_0x354b51,_0x3d4f4f,{'pendingEmbeddedSegments':_0x35f53f,'pendingEmbeddedActivations':_0x261d77,'embeddedSegmentNameToId':_0x8f0ba4,'journeyActivationNameToId':_0xc348de},{..._0x3e2030,'effectiveFolderId':_0x269c8d},_0x58674f,_0x5e3db5,_0xca719a);else{ensureJourneyDefaults(_0x3d4f4f[_0x5dfb9a(0x2c5)]);const _0x1b72f6=await _0x3b481c[_0x5dfb9a(0x2bc)][_0x5dfb9a(0x29d)](_0x3d4f4f);return deletePushRecovery(_0x354b51[_0x5dfb9a(0x253)]),{'action':'created','journeyId':_0x1b72f6['id'],'embeddedSegmentNameToId':_0x8f0ba4};}}else{if(_0x354b51[_0x5dfb9a(0x247)]&&_0x354b51[_0x5dfb9a(0x23b)]){_0x3d4f4f['id']=_0x354b51[_0x5dfb9a(0x23b)]['id'];const _0x4f5717=_0x3d4f4f[_0x5dfb9a(0x2c5)];_0x354b51[_0x5dfb9a(0x23b)][_0x5dfb9a(0x2c5)]?.[_0x5dfb9a(0x203)]&&(_0x4f5717[_0x5dfb9a(0x203)]=_0x354b51[_0x5dfb9a(0x23b)]['attributes'][_0x5dfb9a(0x203)]);const _0x509ae8=_0x354b51[_0x5dfb9a(0x23b)][_0x5dfb9a(0x2c5)]?.[_0x5dfb9a(0x238)];return _0x509ae8&&_0x3d4f4f['attributes'][_0x5dfb9a(0x238)]&&injectExistingStageIds(_0x3d4f4f['attributes']['journeyStages'],_0x509ae8),ensureJourneyDefaults(_0x4f5717),await _0x3b481c[_0x5dfb9a(0x2bc)]['update'](_0x354b51[_0x5dfb9a(0x23b)]['id'],_0x3d4f4f),deletePushRecovery(_0x354b51[_0x5dfb9a(0x253)]),{'action':'updated','journeyId':_0x354b51[_0x5dfb9a(0x23b)]['id'],'embeddedSegmentNameToId':_0x8f0ba4};}}return deletePushRecovery(_0x354b51[_0x5dfb9a(0x253)]),{'action':_0x5dfb9a(0x25e),'journeyId':_0x354b51['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x8f0ba4};}function findSegmentCriteriaLocation(_0x3b1e72,_0xe91eae){const _0x2afe5a=a169_0x12f8f2,_0x47ac27=_0x3b1e72[_0x2afe5a(0x2b5)]||_0x3b1e72[_0x2afe5a(0x21f)]?.[0x0]?.[_0x2afe5a(0x2b5)]||[];let _0x66529e='entry',_0x60e359=_0xe91eae;const _0x13987e=_0x3b1e72['goal']||_0x3b1e72[_0x2afe5a(0x21f)]?.[0x0]?.['goal'];if(_0x13987e?.['segment']===_0xe91eae)return{'stageName':_0x2afe5a(0x2c1),'criteriaName':_0x13987e['name']||_0xe91eae};_0x3a7ece:for(const _0x32eaf2 of _0x47ac27){if(_0x32eaf2[_0x2afe5a(0x22f)]?.['segment']===_0xe91eae){_0x66529e=_0x32eaf2[_0x2afe5a(0x2a4)],_0x60e359=_0x32eaf2[_0x2afe5a(0x22f)][_0x2afe5a(0x2a4)]||_0xe91eae;break;}if(_0x32eaf2[_0x2afe5a(0x2b0)])for(const _0x3bc5c5 of _0x32eaf2['steps']){if(_0x3bc5c5[_0x2afe5a(0x1d7)]==='decision_point'&&_0x3bc5c5[_0x2afe5a(0x2d0)]?.[_0x2afe5a(0x1ee)])for(const _0x2a6666 of _0x3bc5c5[_0x2afe5a(0x2d0)][_0x2afe5a(0x1ee)]){if(_0x2a6666['segment']===_0xe91eae){_0x66529e=_0x32eaf2[_0x2afe5a(0x2a4)],_0x60e359=_0x2a6666[_0x2afe5a(0x2a4)]||_0xe91eae;break _0x3a7ece;}}}}return{'stageName':_0x66529e,'criteriaName':_0x60e359};}async function executeThreeStepJourneyCreate(_0x81ef42,_0xb6bdbf,_0x388cb1,_0x332740,_0x4e9402,_0x336fb3,_0x4d85da,_0x53b2c9){const _0x6847e7=a169_0x12f8f2,{activationDefToCreateRequest:_0x37ff0f,yamlRuleToApi:_0x1209fa}=_0x53b2c9,{pendingEmbeddedSegments:_0x25879f,pendingEmbeddedActivations:_0x266e46,embeddedSegmentNameToId:_0x60306d}=_0x332740,_0x23230c=JSON[_0x6847e7(0x2a2)](JSON[_0x6847e7(0x298)](_0x388cb1));ensureJourneyDefaults(_0x23230c[_0x6847e7(0x2c5)]),stripPendingIds(_0x23230c);const _0x5b6d68=await _0x81ef42['journey'][_0x6847e7(0x29d)](_0x23230c),_0x1dedfa=_0x5b6d68['id'],_0x4c725e=new Map();for(const _0xfd0f21 of _0x5b6d68['attributes']['journeyStages']){_0x4c725e['set'](_0xfd0f21[_0x6847e7(0x2a4)][_0x6847e7(0x21d)](),_0xfd0f21['id']);}recoverSegmentIdsFromPushRecovery(_0xb6bdbf,_0x60306d,_0x336fb3['segmentNameToId']);for(const [_0x416111,{definition:_0x2f4511}]of _0x25879f){if(_0x60306d[_0x6847e7(0x249)](_0x416111)){_0x4d85da[_0x6847e7(0x216)]?.({'type':_0x6847e7(0x1da),'journeyName':_0xb6bdbf[_0x6847e7(0x256)][_0x6847e7(0x2a4)],'segmentName':_0x416111});continue;}const _0x481ed2=generateDeterministicJourneySegmentName(_0xb6bdbf[_0x6847e7(0x256)]['name'],_0x416111);_0x4d85da[_0x6847e7(0x216)]?.({'type':'embedded_segment_creating','journeyName':_0xb6bdbf['yamlConfig'][_0x6847e7(0x2a4)],'segmentName':_0x416111});const _0x4e760b=createSegmentIdResolver(_0x336fb3[_0x6847e7(0x294)],_0x416111),_0x5a75d4=await resolveRuleSegmentIds(_0x2f4511[_0x6847e7(0x284)],_0x4e760b),_0x3df1dc=await createOrRecoverEmbeddedSegment(_0x81ef42,_0xb6bdbf,{'localName':_0x416111,'uniqueSegmentName':_0x481ed2,'description':_0x2f4511[_0x6847e7(0x261)]||_0x6847e7(0x1dd)+_0x416111,'journeyId':_0x1dedfa,'resolvedRule':_0x5a75d4,'parentId':_0x4e9402[_0x6847e7(0x1e4)],'folderId':_0x4e9402[_0x6847e7(0x257)]||''},_0x1209fa);_0x60306d[_0x6847e7(0x1ea)](_0x416111,_0x3df1dc),_0x336fb3[_0x6847e7(0x294)][_0x6847e7(0x1ea)](_0x416111,_0x3df1dc),_0x4d85da[_0x6847e7(0x216)]?.({'type':'embedded_segment_created','journeyName':_0xb6bdbf[_0x6847e7(0x256)]['name'],'segmentName':_0x416111});}const _0x12b815=new Map();for(const [_0x5ab345,_0x34b5d9]of _0x266e46){_0x4d85da[_0x6847e7(0x216)]?.({'type':_0x6847e7(0x222),'journeyName':_0xb6bdbf['yamlConfig'][_0x6847e7(0x2a4)],'activationName':_0x5ab345});const _0x5b2538=await _0x37ff0f(_0x34b5d9,_0x336fb3[_0x6847e7(0x22b)]),_0x13e705={..._0x5b2538,..._0x34b5d9[_0x6847e7(0x233)]!==undefined&&{'runAfterJourneyRefresh':_0x34b5d9[_0x6847e7(0x233)]}},_0x16712b=await _0x81ef42[_0x6847e7(0x2bc)][_0x6847e7(0x242)](_0x1dedfa,_0x13e705);_0x12b815[_0x6847e7(0x1ea)](_0x5ab345,_0x16712b['id']),_0x332740[_0x6847e7(0x250)][_0x6847e7(0x1ea)](_0x5ab345,_0x16712b['id']),_0x4d85da[_0x6847e7(0x216)]?.({'type':_0x6847e7(0x1f9),'journeyName':_0xb6bdbf['yamlConfig'][_0x6847e7(0x2a4)],'activationName':_0x5ab345});}const _0x19e3c4=JSON[_0x6847e7(0x2a2)](JSON[_0x6847e7(0x298)](_0x388cb1));return _0x19e3c4['id']=_0x1dedfa,ensureJourneyDefaults(_0x19e3c4[_0x6847e7(0x2c5)]),resolvePendingIdsInRequest(_0x19e3c4,_0x388cb1,_0x4c725e,_0x60306d,_0x12b815,_0x4d85da),await _0x81ef42[_0x6847e7(0x2bc)][_0x6847e7(0x23f)](_0x1dedfa,_0x19e3c4),deletePushRecovery(_0xb6bdbf[_0x6847e7(0x253)]),{'action':_0x6847e7(0x29e),'journeyId':_0x1dedfa,'embeddedSegmentNameToId':_0x60306d};}export function stripWaitStepPendingIds(_0x1a9de8){const _0x58b866=a169_0x12f8f2,_0x22a2d7=_0x1a9de8[_0x58b866(0x292)]&&isPendingSegmentId(_0x1a9de8['conditionSegmentId']),_0x1a35c4=_0x1a9de8[_0x58b866(0x2c9)]?.[_0x58b866(0x237)](_0x59e6a8=>_0x59e6a8[_0x58b866(0x26d)]&&isPendingSegmentId(_0x59e6a8[_0x58b866(0x26d)]));(_0x22a2d7||_0x1a35c4)&&(_0x1a9de8[_0x58b866(0x1e1)]='Duration',_0x1a9de8[_0x58b866(0x289)]=0x1,_0x1a9de8[_0x58b866(0x236)]=_0x58b866(0x25f),delete _0x1a9de8[_0x58b866(0x292)],delete _0x1a9de8['conditionTimeoutDuration'],delete _0x1a9de8['conditionTimeoutUnit'],delete _0x1a9de8[_0x58b866(0x2c9)]);}export function resolveWaitStepPendingIds(_0x37853c,_0x231f24,_0x5192dd,_0x3dcd01){const _0x3629e1=a169_0x12f8f2;if(_0x231f24[_0x3629e1(0x292)]&&isPendingSegmentId(_0x231f24[_0x3629e1(0x292)])){const _0x28987d=_0x5192dd(_0x231f24[_0x3629e1(0x292)],_0x3629e1(0x1f3)+_0x3dcd01+_0x3629e1(0x2ce));_0x28987d&&(_0x37853c[_0x3629e1(0x1e1)]=_0x3629e1(0x2ac),_0x37853c[_0x3629e1(0x292)]=_0x28987d,delete _0x37853c[_0x3629e1(0x289)],delete _0x37853c[_0x3629e1(0x236)],_0x231f24[_0x3629e1(0x1ff)]!==undefined&&(_0x37853c['conditionTimeoutDuration']=_0x231f24['conditionTimeoutDuration']),_0x231f24['conditionTimeoutUnit']&&(_0x37853c[_0x3629e1(0x21e)]=_0x231f24[_0x3629e1(0x21e)]));}if(_0x231f24[_0x3629e1(0x2c9)]){const _0x3fac33=_0x231f24[_0x3629e1(0x2c9)]['some'](_0x2818cc=>_0x2818cc['segmentId']&&isPendingSegmentId(_0x2818cc['segmentId']));if(_0x3fac33){const _0xd1b3f=_0x231f24[_0x3629e1(0x2c9)][_0x3629e1(0x201)](_0x1a23b2=>{const _0x5631b1=_0x3629e1;if(_0x1a23b2[_0x5631b1(0x26d)]&&isPendingSegmentId(_0x1a23b2[_0x5631b1(0x26d)])){const _0x845f72=_0x5192dd(_0x1a23b2[_0x5631b1(0x26d)],_0x5631b1(0x1f3)+_0x3dcd01+_0x5631b1(0x2ce));return{..._0x1a23b2,'segmentId':_0x845f72||_0x1a23b2[_0x5631b1(0x26d)]};}return{..._0x1a23b2};});_0x37853c[_0x3629e1(0x1e1)]=_0x3629e1(0x2ac),_0x37853c[_0x3629e1(0x2c9)]=_0xd1b3f,delete _0x37853c[_0x3629e1(0x289)],delete _0x37853c[_0x3629e1(0x236)],delete _0x37853c[_0x3629e1(0x292)],delete _0x37853c[_0x3629e1(0x1ff)],delete _0x37853c[_0x3629e1(0x21e)];}}}function stripPendingIds(_0x17d507){const _0x4242d8=a169_0x12f8f2;_0x17d507[_0x4242d8(0x2c5)][_0x4242d8(0x2c1)]?.[_0x4242d8(0x26d)]&&isPendingSegmentId(_0x17d507[_0x4242d8(0x2c5)][_0x4242d8(0x2c1)]['segmentId'])&&delete _0x17d507[_0x4242d8(0x2c5)]['goal'];for(const _0x52c4b4 of _0x17d507[_0x4242d8(0x2c5)][_0x4242d8(0x238)]||[]){_0x52c4b4['entryCriteria']?.[_0x4242d8(0x26d)]&&isPendingSegmentId(_0x52c4b4[_0x4242d8(0x29c)]['segmentId'])&&delete _0x52c4b4[_0x4242d8(0x29c)];_0x52c4b4['milestone']?.['segmentId']&&isPendingSegmentId(_0x52c4b4[_0x4242d8(0x1e2)]['segmentId'])&&delete _0x52c4b4['milestone'];_0x52c4b4[_0x4242d8(0x277)]&&(_0x52c4b4[_0x4242d8(0x277)]=_0x52c4b4['exitCriterias'][_0x4242d8(0x2af)](_0x1b85a3=>!_0x1b85a3[_0x4242d8(0x26d)]||!isPendingSegmentId(_0x1b85a3['segmentId'])));if(_0x52c4b4[_0x4242d8(0x2b0)])for(const _0x13efaa of Object[_0x4242d8(0x1d2)](_0x52c4b4[_0x4242d8(0x2b0)])){const _0x43f8dd=_0x52c4b4[_0x4242d8(0x2b0)][_0x13efaa];_0x43f8dd[_0x4242d8(0x1d7)]===_0x4242d8(0x20b)&&_0x43f8dd['journeyActivationStepId']&&isPendingActivationId(_0x43f8dd[_0x4242d8(0x290)])&&(_0x43f8dd[_0x4242d8(0x290)]='');if(_0x43f8dd['type']===_0x4242d8(0x25b)&&_0x43f8dd[_0x4242d8(0x1ee)])for(const _0x18a271 of _0x43f8dd['branches']){_0x18a271[_0x4242d8(0x26d)]&&isPendingSegmentId(_0x18a271[_0x4242d8(0x26d)])&&(_0x18a271[_0x4242d8(0x26d)]='');}_0x43f8dd['type']===_0x4242d8(0x1d0)&&stripWaitStepPendingIds(_0x43f8dd);}}}function resolvePendingIdsInRequest(_0x37f5cb,_0x47302a,_0xc618da,_0x4951c4,_0x2e6ccd,_0x1b2672){const _0x48e770=a169_0x12f8f2,_0x4c9611=(_0x4124b0,_0x3831ef)=>{if(!isPendingSegmentId(_0x4124b0))return _0x4124b0;const _0x52939f=extractPendingSegmentName(_0x4124b0),_0x4d66fb=_0x4951c4['get'](_0x52939f);return!_0x4d66fb&&_0x1b2672['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x52939f+'\x27\x20for\x20'+_0x3831ef),_0x4d66fb;};if(_0x37f5cb[_0x48e770(0x2c5)][_0x48e770(0x2c1)]?.[_0x48e770(0x26d)]&&isPendingSegmentId(_0x37f5cb['attributes']['goal'][_0x48e770(0x26d)])){const _0xfa468d=_0x4c9611(_0x37f5cb[_0x48e770(0x2c5)][_0x48e770(0x2c1)][_0x48e770(0x26d)],_0x48e770(0x2ca));_0xfa468d&&(_0x37f5cb[_0x48e770(0x2c5)][_0x48e770(0x2c1)]['segmentId']=_0xfa468d);}for(const _0x397199 of _0x37f5cb['attributes'][_0x48e770(0x238)]||[]){const _0x22c2b0=_0xc618da[_0x48e770(0x1d3)](_0x397199['name'][_0x48e770(0x21d)]());_0x22c2b0&&(_0x397199['id']=_0x22c2b0);if(_0x397199[_0x48e770(0x29c)]?.['segmentId']&&isPendingSegmentId(_0x397199[_0x48e770(0x29c)][_0x48e770(0x26d)])){const _0x45787b=_0x4c9611(_0x397199[_0x48e770(0x29c)][_0x48e770(0x26d)],_0x48e770(0x1f3)+_0x397199[_0x48e770(0x2a4)]+_0x48e770(0x1fe));_0x45787b&&(_0x397199['entryCriteria']['segmentId']=_0x45787b);}if(_0x397199[_0x48e770(0x277)])for(const _0x2fd0f0 of _0x397199['exitCriterias']){if(_0x2fd0f0[_0x48e770(0x26d)]&&isPendingSegmentId(_0x2fd0f0[_0x48e770(0x26d)])){const _0x135320=_0x4c9611(_0x2fd0f0['segmentId'],'stage\x20\x27'+_0x397199[_0x48e770(0x2a4)]+'\x27\x20exit\x20criteria');_0x135320&&(_0x2fd0f0[_0x48e770(0x26d)]=_0x135320);}}if(_0x397199[_0x48e770(0x1e2)]?.['segmentId']&&isPendingSegmentId(_0x397199[_0x48e770(0x1e2)]['segmentId'])){const _0x827564=_0x4c9611(_0x397199['milestone'][_0x48e770(0x26d)],_0x48e770(0x1f3)+_0x397199[_0x48e770(0x2a4)]+'\x27\x20milestone');_0x827564&&(_0x397199[_0x48e770(0x1e2)][_0x48e770(0x26d)]=_0x827564);}if(_0x397199[_0x48e770(0x2b0)]){const _0x66765b=_0x4f6175=>_0x47302a[_0x48e770(0x2c5)][_0x48e770(0x238)]?.[_0x48e770(0x1f8)](_0x1b5811=>_0x1b5811['name'][_0x48e770(0x21d)]()===_0x397199[_0x48e770(0x2a4)][_0x48e770(0x21d)]())?.[_0x48e770(0x2b0)]?.[_0x4f6175];for(const _0x5d9109 of Object[_0x48e770(0x1d2)](_0x397199[_0x48e770(0x2b0)])){const _0x19decf=_0x397199[_0x48e770(0x2b0)][_0x5d9109],_0x13176b=_0x66765b(_0x5d9109);if(_0x19decf[_0x48e770(0x1d7)]===_0x48e770(0x20b)&&_0x19decf[_0x48e770(0x290)]&&(isPendingActivationId(_0x19decf['journeyActivationStepId'])||_0x19decf[_0x48e770(0x290)]==='')){if(_0x13176b?.['journeyActivationStepId']&&isPendingActivationId(_0x13176b[_0x48e770(0x290)])){const _0x229c72=extractPendingActivationName(_0x13176b[_0x48e770(0x290)]),_0x46f786=_0x2e6ccd[_0x48e770(0x1d3)](_0x229c72);_0x46f786&&(_0x19decf[_0x48e770(0x290)]=_0x46f786);}}if(_0x19decf[_0x48e770(0x1d7)]===_0x48e770(0x25b)&&_0x19decf[_0x48e770(0x1ee)]&&_0x13176b?.[_0x48e770(0x1ee)])for(let _0x174822=0x0;_0x174822<_0x19decf[_0x48e770(0x1ee)][_0x48e770(0x295)];_0x174822++){const _0x5cee04=_0x19decf[_0x48e770(0x1ee)][_0x174822],_0x4d8671=_0x13176b[_0x48e770(0x1ee)][_0x174822];if(_0x4d8671?.[_0x48e770(0x26d)]&&isPendingSegmentId(_0x4d8671['segmentId'])){const _0x4d4d10=_0x4c9611(_0x4d8671[_0x48e770(0x26d)],'stage\x20\x27'+_0x397199[_0x48e770(0x2a4)]+_0x48e770(0x2b8)+(_0x5cee04['name']||_0x174822)+'\x27');_0x4d4d10&&(_0x5cee04[_0x48e770(0x26d)]=_0x4d4d10);}}_0x19decf[_0x48e770(0x1d7)]===_0x48e770(0x1d0)&&_0x13176b?.['type']===_0x48e770(0x1d0)&&resolveWaitStepPendingIds(_0x19decf,_0x13176b,_0x4c9611,_0x397199['name']);}}}}
1
+ const a169_0x579498=a169_0x5e1a;(function(_0x3f00dd,_0x5037c8){const _0x3a057d=a169_0x5e1a,_0x3e1124=_0x3f00dd();while(!![]){try{const _0x5c0123=parseInt(_0x3a057d(0x193))/0x1*(-parseInt(_0x3a057d(0x1f7))/0x2)+-parseInt(_0x3a057d(0x239))/0x3*(-parseInt(_0x3a057d(0x234))/0x4)+-parseInt(_0x3a057d(0x253))/0x5+-parseInt(_0x3a057d(0x1d1))/0x6*(parseInt(_0x3a057d(0x19f))/0x7)+parseInt(_0x3a057d(0x226))/0x8*(-parseInt(_0x3a057d(0x1fc))/0x9)+-parseInt(_0x3a057d(0x1f4))/0xa+parseInt(_0x3a057d(0x1dd))/0xb;if(_0x5c0123===_0x5037c8)break;else _0x3e1124['push'](_0x3e1124['shift']());}catch(_0x4706d5){_0x3e1124['push'](_0x3e1124['shift']());}}}(a169_0x5807,0x50e55));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a169_0x579498(0x232));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a169_0x579498(0x21d);export function createPendingSegmentId(_0x30626c){return''+PENDING_SEGMENT_PREFIX+_0x30626c+'__';}export function isPendingSegmentId(_0x54a4e0){const _0x43d448=a169_0x579498;return _0x54a4e0['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x54a4e0[_0x43d448(0x27a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0xb8c37b){return _0xb8c37b['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x29e897){return''+PENDING_ACTIVATION_PREFIX+_0x29e897+'__';}export function isPendingActivationId(_0x4165c9){const _0x3a7392=a169_0x579498;return _0x4165c9[_0x3a7392(0x27a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x50d938){const _0x2707cb=a169_0x579498;return _0x50d938[_0x2707cb(0x24f)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2299fd,_0x20177c){const _0x41b96e=a169_0x579498,_0x447051=_0x2299fd+'::'+(_0x20177c['trim']()||_0x41b96e(0x1da)),_0x61d6e=createHash('sha1')['update'](_0x447051)[_0x41b96e(0x199)]('hex')[_0x41b96e(0x27c)](0x0,0xc);return _0x41b96e(0x225)+_0x61d6e;}export function ensureJourneyDefaults(_0x59fb76){const _0xfe9070=a169_0x579498;!_0x59fb76[_0xfe9070(0x1d5)]&&(_0x59fb76['description']=''),!_0x59fb76['state']&&(_0x59fb76['state']=_0xfe9070(0x213));}export function injectExistingStageIds(_0x1cced4,_0x20ac40){const _0x4f187a=a169_0x579498,_0x4f7975=new Map(_0x20ac40[_0x4f187a(0x190)](_0x48fad3=>[_0x48fad3['name'],_0x48fad3['id']]));for(const _0x3ce5f3 of _0x1cced4){if(!_0x3ce5f3['id']){const _0x254b54=_0x4f7975[_0x4f187a(0x250)](_0x3ce5f3[_0x4f187a(0x1a9)]);_0x254b54&&(_0x3ce5f3['id']=_0x254b54);}}}export function resolveTDFolderPath(_0x3ce6f3,_0x2aad1b,_0x45d8e3){if(!_0x2aad1b)return _0x3ce6f3;if(_0x3ce6f3===_0x45d8e3||_0x3ce6f3['startsWith'](_0x45d8e3+'/'))return _0x3ce6f3;return _0x3ce6f3?_0x45d8e3+'/'+_0x3ce6f3:_0x45d8e3;}export function addFoldersToCreate(_0x3f2c5e,_0x309df7,_0x65ce67){const _0x4a3d00=a169_0x579498;if(!_0x3f2c5e)return;if(_0x309df7[_0x4a3d00(0x20d)](_0x3f2c5e))return;const _0x67b962=_0x3f2c5e[_0x4a3d00(0x25e)]('/');let _0x582f7c='';for(const _0x2b119c of _0x67b962){_0x582f7c=_0x582f7c?_0x582f7c+'/'+_0x2b119c:_0x2b119c,!_0x309df7[_0x4a3d00(0x20d)](_0x582f7c)&&_0x65ce67['add'](_0x582f7c);}}export function sortFoldersByDepth(_0x38a63a){const _0x554cd1=a169_0x579498;return[..._0x38a63a][_0x554cd1(0x1c8)]((_0x4dede4,_0x50b6e2)=>{const _0x55aea3=_0x554cd1,_0x3b12f6=(_0x4dede4['match'](/\//g)||[])[_0x55aea3(0x20b)],_0x56eb42=(_0x50b6e2[_0x55aea3(0x27b)](/\//g)||[])[_0x55aea3(0x20b)];return _0x3b12f6-_0x56eb42;});}import*as a169_0x5c3d03 from'yaml';import{readFileSync}from'fs';import a169_0x2e5e57 from'path';import{isJourneyDef,parseYamlString as a169_0x4ac2de,toYamlString as a169_0x3fc1d8,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(_0x12a453){const _0x37ca10=a169_0x579498;if(Array[_0x37ca10(0x19d)](_0x12a453))return'['+_0x12a453[_0x37ca10(0x190)](_0x41105f=>stableStringify(_0x41105f))['join'](',')+']';if(_0x12a453&&typeof _0x12a453===_0x37ca10(0x1aa)){const _0x1b2e0c=_0x12a453,_0x2aff47=Object[_0x37ca10(0x25f)](_0x1b2e0c)[_0x37ca10(0x1c8)](),_0x90af4c=_0x2aff47[_0x37ca10(0x190)](_0x2c6200=>'\x22'+_0x2c6200+'\x22:'+stableStringify(_0x1b2e0c[_0x2c6200]));return'{'+_0x90af4c['join'](',')+'}';}const _0x20d626=JSON[_0x37ca10(0x1ae)](_0x12a453);return _0x20d626===undefined?_0x37ca10(0x27e):_0x20d626;}function activationSignature(_0x472cdd){const _0x3624a3=a169_0x579498,_0x2f70cc={'connection':_0x472cdd[_0x3624a3(0x1de)],..._0x472cdd[_0x3624a3(0x27d)]!==undefined&&{'all_columns':_0x472cdd[_0x3624a3(0x27d)]},..._0x472cdd[_0x3624a3(0x273)]!==undefined&&{'columns':_0x472cdd[_0x3624a3(0x273)]},..._0x472cdd[_0x3624a3(0x185)]!==undefined&&{'behavior':_0x472cdd['behavior']},..._0x472cdd[_0x3624a3(0x235)]!==undefined&&{'behaviors':_0x472cdd[_0x3624a3(0x235)]},..._0x472cdd['schedule']!==undefined&&{'schedule':_0x472cdd[_0x3624a3(0x1fd)]},..._0x472cdd[_0x3624a3(0x207)]!==undefined&&{'notification':_0x472cdd[_0x3624a3(0x207)]},..._0x472cdd[_0x3624a3(0x228)]!==undefined&&{'connector_config':_0x472cdd[_0x3624a3(0x228)]},..._0x472cdd[_0x3624a3(0x17a)]!==undefined&&{'activation_template_id':_0x472cdd[_0x3624a3(0x17a)]}};return stableStringify(_0x2f70cc);}async function fetchSegment(_0x16a9e8,_0x26bc68,_0x8c5779,_0x1b2107){const _0x3da7e1=a169_0x579498,_0x5217fd=_0x1b2107?.[_0x3da7e1(0x1e7)](_0x30072b=>_0x30072b['id']===_0x8c5779);if(_0x5217fd)return _0x5217fd;try{return await _0x16a9e8[_0x3da7e1(0x1da)]['getSegment'](_0x26bc68,_0x8c5779);}catch(_0x10d242){logger[_0x3da7e1(0x1f2)](_0x3da7e1(0x1bb)+_0x8c5779+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x10d242);try{return await _0x16a9e8[_0x3da7e1(0x1da)]['getSegmentEntity'](_0x8c5779);}catch(_0x3d0a19){return logger[_0x3da7e1(0x1f2)](_0x3da7e1(0x1e6)+_0x8c5779+':\x20'+_0x3d0a19),null;}}}function recoverSegmentIdsFromPushRecovery(_0x42a5c6,_0x5b18b2,_0x5aa960){const _0x529079=a169_0x579498,_0x36b7e3=readPushRecovery(_0x42a5c6[_0x529079(0x22b)]);if(_0x36b7e3?.[_0x529079(0x251)]===_0x42a5c6['yamlConfig']['name'])for(const [_0x5ec39e,_0x3c6f33]of Object['entries'](_0x36b7e3[_0x529079(0x24a)])){const _0x472195=generateDeterministicJourneySegmentName(_0x42a5c6[_0x529079(0x237)][_0x529079(0x1a9)],_0x5ec39e);_0x3c6f33[_0x529079(0x1f6)]===_0x472195&&(_0x5b18b2[_0x529079(0x182)](_0x5ec39e,_0x3c6f33[_0x529079(0x1a5)]),_0x5aa960[_0x529079(0x182)](_0x5ec39e,_0x3c6f33[_0x529079(0x1a5)]));}}async function createOrRecoverEmbeddedSegment(_0x3da06d,_0x3dc452,_0x1e4253,_0x235822){const _0x5cb138=a169_0x579498;let _0xf9f681;try{_0xf9f681=await _0x3da06d['segment'][_0x5cb138(0x1f5)]({'name':_0x1e4253[_0x5cb138(0x275)],'description':_0x1e4253[_0x5cb138(0x1d5)],'journeyId':_0x1e4253[_0x5cb138(0x1b8)],'rule':_0x235822(_0x1e4253[_0x5cb138(0x1c7)],!![]),'countPopulation':!![],'parentFolderId':_0x1e4253[_0x5cb138(0x187)],'audienceId':_0x1e4253[_0x5cb138(0x268)]});}catch(_0x22f4c0){const _0x523e66=_0x22f4c0 instanceof Error&&_0x22f4c0[_0x5cb138(0x25c)][_0x5cb138(0x222)]('Name\x20has\x20already\x20been\x20taken');if(_0x523e66){const _0x4cb2ea=readPushRecovery(_0x3dc452[_0x5cb138(0x22b)]),_0x40fd8f=_0x4cb2ea?.['journeyName']===_0x3dc452[_0x5cb138(0x237)][_0x5cb138(0x1a9)]?_0x4cb2ea['segments'][_0x1e4253[_0x5cb138(0x238)]]:undefined;if(_0x40fd8f?.[_0x5cb138(0x1f6)]===_0x1e4253['uniqueSegmentName'])await _0x3da06d[_0x5cb138(0x1da)][_0x5cb138(0x1fb)](_0x1e4253[_0x5cb138(0x268)],_0x40fd8f[_0x5cb138(0x1a5)],{'description':_0x1e4253[_0x5cb138(0x1d5)],'rule':_0x235822(_0x1e4253[_0x5cb138(0x1c7)],!![]),'countPopulation':!![]}),_0xf9f681=_0x40fd8f['segmentId'];else throw new SDKError(ErrorCode[_0x5cb138(0x26a)],_0x5cb138(0x176)+_0x1e4253[_0x5cb138(0x238)]+_0x5cb138(0x25a)+(_0x5cb138(0x1d4)+_0x3dc452[_0x5cb138(0x22b)]['replace'](/([^/]+)$/,_0x5cb138(0x1ce))+')\x20')+_0x5cb138(0x18a),_0x22f4c0);}else throw _0x22f4c0;}return saveSegmentToPushRecovery(_0x3dc452[_0x5cb138(0x22b)],_0x3dc452[_0x5cb138(0x237)][_0x5cb138(0x1a9)],_0x1e4253[_0x5cb138(0x238)],{'segmentId':_0xf9f681,'uniqueServerName':_0x1e4253[_0x5cb138(0x275)],'createdAt':new Date()[_0x5cb138(0x277)]()}),_0xf9f681;}export async function prepareSegmentFiles(_0x1e60c7,_0x11be5a,_0x67923f,_0x2e7040,_0x3d2654){const _0x562423=a169_0x579498,{activationDefToCreateRequest:_0x241187}=await import('./child-segment-yaml.js'),_0x4b3b75=[],_0x1ed1ba=new Set();for(const {yamlConfig:_0x5d44f3,folderPath:_0x4ae977,sourcePath:_0x4e7c53}of _0x1e60c7){const _0xf1f202=resolveTDFolderPath(_0x4ae977,_0x2e7040,_0x3d2654),_0x5dd09a=_0xf1f202+':'+_0x5d44f3[_0x562423(0x1a9)],_0x37710f=_0x11be5a[_0x562423(0x1f0)]['get'](_0x5dd09a),_0xa1e705=_0x37710f?_0x11be5a[_0x562423(0x22c)][_0x562423(0x250)](_0x37710f['id'])||[]:[];addFoldersToCreate(_0xf1f202,_0x11be5a[_0x562423(0x247)],_0x1ed1ba);const _0x3af630=calculateActivationActions(_0x5d44f3[_0x562423(0x260)]||[],_0xa1e705,_0x11be5a['idToEmailMap'],_0x11be5a[_0x562423(0x231)]);for(const _0x393c7a of _0x3af630){(_0x393c7a[_0x562423(0x274)]===_0x562423(0x25b)||_0x393c7a[_0x562423(0x274)]===_0x562423(0x26e))&&_0x393c7a[_0x562423(0x265)]&&(_0x393c7a[_0x562423(0x269)]=await _0x241187(_0x393c7a[_0x562423(0x265)],_0x67923f));}const _0x2ce152=calculateSegmentDiff(_0x5d44f3,_0x37710f,_0xa1e705,_0x11be5a[_0x562423(0x26c)],_0x11be5a[_0x562423(0x231)]);_0x4b3b75[_0x562423(0x23d)]({'relativePath':_0x5d44f3[_0x562423(0x1a9)],'absolutePath':_0x4e7c53,'yamlConfig':_0x5d44f3,'folderPath':_0xf1f202,'existingSegment':_0x37710f,'existingActivations':_0xa1e705,'isNew':_0x2ce152[_0x562423(0x20e)],'hasChanges':_0x2ce152[_0x562423(0x1a1)],'diff':_0x2ce152['diff'],'activationActions':_0x3af630});}return{'segmentFiles':_0x4b3b75,'foldersToCreate':_0x1ed1ba};}export async function prepareJourneyFiles(_0x12b62b,_0x5e2e8b,_0x2815d1,_0x38d9fd){const _0x4aa716=a169_0x579498,_0x4f84e1=[],_0x99623d=new Set();for(const {yamlConfig:_0x2c186f,folderPath:_0x2d57b9,sourcePath:_0x5186fc}of _0x12b62b){const _0xd18c3=resolveTDFolderPath(_0x2d57b9,_0x2815d1,_0x38d9fd),_0x2eadc4=_0xd18c3+':'+_0x2c186f['name'],_0xeeacd0=_0x5e2e8b[_0x4aa716(0x1fe)]['get'](_0x2eadc4);let _0x4a9502,_0x43b960;if(_0xeeacd0&&_0xeeacd0[_0x4aa716(0x20b)]>0x0){const _0x2244de=buildLocalExpandedRuleMappings(_0x2c186f),{createYamlContext:_0x41ed05,prefetchJourneySegments:_0x469b82}=createPushYamlContextForBundle(_0x5e2e8b[_0x4aa716(0x17d)],_0x5e2e8b[_0x4aa716(0x268)],_0x5e2e8b[_0x4aa716(0x22e)],_0x2244de,_0x5e2e8b[_0x4aa716(0x26c)],_0x5e2e8b['connectionIdToNameMap'],_0x5e2e8b[_0x4aa716(0x1ca)],_0x5e2e8b['journeyById']);await _0x469b82(_0xeeacd0[_0x4aa716(0x190)](_0x43c8b6=>_0x43c8b6['id']));const _0x1644f0=await _0x5e2e8b[_0x4aa716(0x17d)][_0x4aa716(0x1f3)]['getLatestJourneyId'](_0xeeacd0[0x0]['journeyBundleId']),_0x10893b=hasMultipleVersions(_0x2c186f),_0x4dfbb3=async _0xd35ef9=>{const _0x22a610=_0x4aa716,_0x313045=_0x5e2e8b[_0x22a610(0x267)]?.[_0x22a610(0x250)](_0xd35ef9);if(_0x313045)return _0x313045;return _0x5e2e8b[_0x22a610(0x224)]({'journeyId':_0xd35ef9,'journeyName':_0x2c186f['name'],'isMultiVersion':_0xeeacd0[_0x22a610(0x20b)]>0x1});};if(_0x10893b&&_0xeeacd0[_0x4aa716(0x20b)]>0x1){const _0xad5799=[];for(const _0x1e0b05 of _0xeeacd0){const _0x245fca=_0x1e0b05[_0x4aa716(0x1a4)]||0x1;_0x5e2e8b[_0x4aa716(0x208)]?.[_0x4aa716(0x26e)]('Fetching\x20'+_0x2c186f[_0x4aa716(0x1a9)]+'\x20v'+_0x245fca);const _0xa06b4a=await _0x4dfbb3(_0x1e0b05['id']),_0x2627ee=_0x41ed05(_0x1e0b05['id']),_0xc70bc2=await journeyResponseToDef(_0xa06b4a,_0x2627ee);_0xad5799[_0x4aa716(0x23d)]({'item':_0x1e0b05,'yaml':_0xc70bc2});}const _0x40670b=buildLocalRuleToNameMappingFromJourney(_0x2c186f);_0x43b960=buildMergedJourneyDef(_0xad5799,_0x40670b,_0x1644f0);const _0xced5aa=Math[_0x4aa716(0x23f)](..._0xad5799[_0x4aa716(0x190)](_0x5d777c=>_0x5d777c['item'][_0x4aa716(0x1a4)]||0x0)),_0x6df287=_0xeeacd0[_0x4aa716(0x1e7)](_0xb62f43=>(_0xb62f43[_0x4aa716(0x1a4)]||0x0)===_0xced5aa);_0x6df287&&(_0x5e2e8b[_0x4aa716(0x208)]?.[_0x4aa716(0x26e)]('Fetching\x20'+_0x2c186f['name']+'\x20v'+_0xced5aa),_0x4a9502=await _0x4dfbb3(_0x6df287['id']));}else{const _0x1448d8=_0xeeacd0[_0xeeacd0[_0x4aa716(0x20b)]-0x1];_0x5e2e8b[_0x4aa716(0x208)]?.[_0x4aa716(0x26e)](_0x4aa716(0x24c)+_0x2c186f[_0x4aa716(0x1a9)]),_0x4a9502=await _0x4dfbb3(_0x1448d8['id']);const _0xf8467b=_0x41ed05(_0x1448d8['id']),_0x18abd2=await journeyResponseToDef(_0x4a9502,_0xf8467b),_0x28fba0=buildLocalRuleToNameMappingFromJourney(_0x2c186f);_0x43b960=buildMergedJourneyDef([{'item':_0x1448d8,'yaml':_0x18abd2}],_0x28fba0,_0x1644f0);}}addFoldersToCreate(_0xd18c3,_0x5e2e8b['folderPathToId'],_0x99623d);const _0x3719d2=calculateJourneyDiff(_0x2c186f,_0x43b960);_0x4f84e1[_0x4aa716(0x23d)]({'relativePath':_0x2c186f[_0x4aa716(0x1a9)],'absolutePath':_0x5186fc,'yamlConfig':_0x2c186f,'folderPath':_0xd18c3,'existingJourney':_0x4a9502,'isNew':_0x3719d2[_0x4aa716(0x20e)],'hasChanges':_0x3719d2[_0x4aa716(0x1a1)],'diff':_0x3719d2[_0x4aa716(0x1c9)]});}return{'journeyFiles':_0x4f84e1,'foldersToCreate':_0x99623d};}export function calculateActivationActions(_0x1f3fda,_0xd0152d,_0x328996,_0x1eeb4f){const _0x1ab3b1=a169_0x579498,_0xc2858b=[],_0x46e4a9=new Map();for(const _0x35f71d of _0xd0152d){_0x46e4a9[_0x1ab3b1(0x182)](_0x35f71d['name'],_0x35f71d);}const _0x567067=new Map();for(const _0x483360 of _0x1f3fda){_0x567067[_0x1ab3b1(0x182)](_0x483360[_0x1ab3b1(0x1a9)],_0x483360);}for(const _0x4f90dc of _0x1f3fda){const _0x222776=_0x46e4a9['get'](_0x4f90dc[_0x1ab3b1(0x1a9)]);if(!_0x222776)_0xc2858b[_0x1ab3b1(0x23d)]({'type':'create','name':_0x4f90dc[_0x1ab3b1(0x1a9)],'yamlActivation':_0x4f90dc});else{const _0x1b7aab=activationResponseToDef(_0x222776,_0x328996,_0x1eeb4f),_0x36c8ee=a169_0x5c3d03[_0x1ab3b1(0x1ae)](_0x1b7aab),_0x103dad=a169_0x5c3d03['stringify'](_0x4f90dc);_0x36c8ee!==_0x103dad&&_0xc2858b[_0x1ab3b1(0x23d)]({'type':_0x1ab3b1(0x26e),'name':_0x4f90dc[_0x1ab3b1(0x1a9)],'yamlActivation':_0x4f90dc,'existingActivation':_0x222776});}}for(const _0x5b8aa1 of _0xd0152d){!_0x567067[_0x1ab3b1(0x20d)](_0x5b8aa1[_0x1ab3b1(0x1a9)])&&_0xc2858b[_0x1ab3b1(0x23d)]({'type':_0x1ab3b1(0x21f),'name':_0x5b8aa1[_0x1ab3b1(0x1a9)],'existingActivation':_0x5b8aa1});}return _0xc2858b;}function calculateYamlDiff(_0x388e88,_0x37f880){if(_0x37f880){const _0x33731f=generateDiff(_0x37f880,_0x388e88),_0xbd544d=hasChanges(_0x33731f);return{'isNew':![],'hasChanges':_0xbd544d,'diff':_0xbd544d?formatDiffWithColors(_0x33731f):undefined};}const _0x1c815f=generateDiff('',_0x388e88);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1c815f)};}export function calculateSegmentDiff(_0x17b4e7,_0xb3adde,_0x2bcf28,_0x2c944d,_0x33b7d6){const _0x216f4a=segmentToYamlString(_0x17b4e7),_0x22852b=_0xb3adde?segmentToYamlString(segmentWithActivationsToYaml(_0xb3adde,_0x2bcf28,undefined,_0x2c944d,_0x33b7d6)):undefined;return calculateYamlDiff(_0x216f4a,_0x22852b);}export function calculateJourneyDiff(_0xe7f9fc,_0x1d9faa){const _0x13083a=normalizeJourneyDef(_0xe7f9fc,_0xe7f9fc),_0x4acbf5=a169_0x3fc1d8(_0x13083a),_0x15541b=_0x1d9faa?a169_0x3fc1d8(normalizeJourneyDef(_0x1d9faa,_0xe7f9fc)):undefined;return calculateYamlDiff(_0x4acbf5,_0x15541b);}export function findSegmentsToDelete(_0xabae53,_0x7d7e0f,_0x485183,_0x47e7e5,_0x1f4dab){const _0x1a4ba7=a169_0x579498,_0x1db730=new Set();for(const {yamlConfig:_0x2c1aae,folderPath:_0x3c9a85}of _0x7d7e0f){_0x1db730[_0x1a4ba7(0x1e4)](_0x3c9a85+':'+_0x2c1aae[_0x1a4ba7(0x1a9)]);}return _0xabae53[_0x1a4ba7(0x20f)](_0xf44f53=>{const _0x4c74a2=_0x1a4ba7,_0x284994=_0xf44f53['segmentFolderId']?_0x485183['get'](_0xf44f53['segmentFolderId'][_0x4c74a2(0x177)]())||'':'',_0x444a3d=_0x284994+':'+_0xf44f53['name'];if(_0x1db730['has'](_0x444a3d))return![];if(_0x1f4dab)return _0x284994===_0x47e7e5||_0x284994[_0x4c74a2(0x27a)](_0x47e7e5+'/');return!![];});}export function findJourneysToDelete(_0x14e401,_0x4ecf82,_0x4cf505,_0x315ae9,_0x4d92e1){const _0x6bbb27=a169_0x579498,_0x7bec62=new Set();for(const {yamlConfig:_0x18003d,folderPath:_0x1d0a28}of _0x4ecf82){_0x7bec62[_0x6bbb27(0x1e4)](_0x1d0a28+':'+_0x18003d[_0x6bbb27(0x1a9)]);}return _0x14e401[_0x6bbb27(0x20f)](_0x1b5d11=>{const _0x20ffd1=_0x6bbb27,_0x3e7b55=_0x1b5d11[_0x20ffd1(0x187)]?_0x4cf505['get'](_0x1b5d11[_0x20ffd1(0x187)])||'':'',_0x223aea=_0x3e7b55+':'+_0x1b5d11[_0x20ffd1(0x210)];if(_0x7bec62[_0x20ffd1(0x20d)](_0x223aea))return![];if(_0x4d92e1)return _0x3e7b55===_0x315ae9||_0x3e7b55[_0x20ffd1(0x27a)](_0x315ae9+'/');return!![];});}export function buildSegmentLookupMap(_0x14127f,_0x58b574){const _0x50741d=a169_0x579498,_0x37115b=new Map();for(const _0x51e9e7 of _0x14127f){const _0x558851=_0x51e9e7[_0x50741d(0x186)]?_0x58b574['get'](_0x51e9e7['segmentFolderId'][_0x50741d(0x177)]())||'':'',_0x4f5515=_0x558851+':'+_0x51e9e7['name'];_0x37115b[_0x50741d(0x182)](_0x4f5515,_0x51e9e7);}return _0x37115b;}export function buildSegmentNameToIdMap(_0x18109d){const _0x13bf5d=a169_0x579498,_0x212829=new Map();for(const _0x1fdd95 of _0x18109d){_0x212829[_0x13bf5d(0x182)](_0x1fdd95['name'],_0x1fdd95['id']);}return _0x212829;}function a169_0x5e1a(_0x54024e,_0x8e4e37){_0x54024e=_0x54024e-0x171;const _0x580701=a169_0x5807();let _0x5e1a53=_0x580701[_0x54024e];return _0x5e1a53;}export function buildJourneyBundleLookupMap(_0x357963,_0x385df0){const _0x5823a0=a169_0x579498,_0x27c54c=new Map();for(const _0x2a532f of _0x357963){const _0x1e4e37=_0x2a532f[_0x5823a0(0x187)]?_0x385df0['get'](_0x2a532f[_0x5823a0(0x187)])||'':'',_0x9482e1=_0x1e4e37+':'+_0x2a532f[_0x5823a0(0x210)];!_0x27c54c['has'](_0x9482e1)&&_0x27c54c[_0x5823a0(0x182)](_0x9482e1,[]),_0x27c54c[_0x5823a0(0x250)](_0x9482e1)[_0x5823a0(0x23d)](_0x2a532f);}for(const _0x566eb0 of _0x27c54c[_0x5823a0(0x195)]()){_0x566eb0['sort']((_0xb3793d,_0x21ad08)=>(_0xb3793d['versionNumber']||0x0)-(_0x21ad08[_0x5823a0(0x1a4)]||0x0));}return _0x27c54c;}export function collectFoldersToCreate(_0x284e33,_0x15cad6){const _0x517f5f=a169_0x579498,_0x324e9b=new Set();for(const _0x30f7cd of _0x284e33){if(!_0x30f7cd)continue;if(_0x15cad6[_0x517f5f(0x20d)](_0x30f7cd))continue;const _0x53c3fe=_0x30f7cd[_0x517f5f(0x25e)]('/');let _0xb0c8b0='';for(const _0x2270e1 of _0x53c3fe){_0xb0c8b0=_0xb0c8b0?_0xb0c8b0+'/'+_0x2270e1:_0x2270e1,!_0x15cad6[_0x517f5f(0x20d)](_0xb0c8b0)&&_0x324e9b['add'](_0xb0c8b0);}}return _0x324e9b;}export function parseAndClassifyYamlFiles(_0x34a1c3,_0x2e77fc,_0x26fe03){const _0x57a561=a169_0x579498,_0x170057=[],_0x2fadfd=[];for(const _0x2c52d6 of _0x34a1c3){const _0x450c84=a169_0x2e5e57['relative'](_0x2e77fc,a169_0x2e5e57[_0x57a561(0x256)](_0x2c52d6)),_0x516685=_0x450c84==='.'?'':_0x450c84[_0x57a561(0x24f)](/\\/g,'/'),_0x41225c=readFileSync(_0x2c52d6,_0x57a561(0x1a0)),_0x131b53=a169_0x5c3d03['parse'](_0x41225c);if(isJourneyDef(_0x131b53,_0x2c52d6)){const _0x4b9a42=a169_0x4ac2de(_0x41225c);_0x2fadfd['push']({'yamlConfig':_0x4b9a42,'folderPath':_0x516685,'sourcePath':_0x2c52d6});}else{if(!_0x26fe03?.[_0x57a561(0x188)]){const _0x34d5eb=parseSegmentYamlFile(_0x41225c),_0xdfde10=normalizeChildSegmentYaml(_0x34d5eb);_0x170057['push']({'yamlConfig':_0xdfde10,'folderPath':_0x516685,'sourcePath':_0x2c52d6});}}}return{'segments':_0x170057,'journeys':_0x2fadfd};}function a169_0x5807(){const _0x4a743d=['behaviors','journey_updated','yamlConfig','localName','3JtyjrH','Updating\x20segment\x20\x27','embedded_segment_creating','\x20(referenced\x20in\x20journey\x20','push','./journey-yaml.js','max','embedded_activation_creating','segment_deleted','conditions','journeyActivationNameToId','DecisionPoint','folder_creating','conditionTimeoutDuration','folderPathToId','activationParams','Updated\x20activation\x20\x27','segments','../../utils/async.js','Fetching\x20','ACTIVATION_UPDATE_ERROR','data','replace','get','journeyName','activationActions','2250090OFPYme','journeyActivationStepId','segment_updated','dirname','\x27\x20decision\x20point\x20branch\x20\x27','Journey\x20\x27','journeys','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','create','message','ACTIVATION_SYNTAX_ERROR','split','keys','activations','\x27...','embedded_activation_created','\x27\x20milestone','parentSegmentFolder','yamlActivation','unchanged','journeyById','parentId','validatedRequest','SEGMENT_UPDATE_ERROR','updated','idToEmailMap','NOT_FOUND','update','exitCriterias','Updated\x20journey\x20\x27','buildUserMaps','INTERNAL','columns','type','uniqueSegmentName','existingActivation','toISOString','with','decision_point','startsWith','match','slice','all_columns','null','journeyStages','toLowerCase','steps','journey_updating','conditionSegmentId','Updating\x20activation\x20\x27','\x27\x20not\x20found\x20in\x20journey\x20\x27','Embedded\x20segment\x20\x27','toString','Activation\x20not\x20found:\x20','\x27\x20from\x20file:\x20','activation_template_id','list','activation_','deps','conditionTimeoutUnit','valid','Failed\x20to\x20resolve\x20segment\x20','all','set','Failed\x20to\x20resolve\x20activation\x20','stage\x20\x27','behavior','segmentFolderId','folderId','skipSegments','deleted','and\x20the\x20server\x20segment,\x20then\x20retry.','folder_created','embeddedSegmentNameToId','activationContext','\x20journey\x20from\x20file:\x20','journey_created','map','rule','reduce','238709OypTNW','activation_created','values','Deleted\x20activation\x20\x27','Condition','index','digest','):\x20','size','./child-segment-yaml.js','isArray','deleteSegment','451479SvQhXw','utf-8','hasChanges','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','versionNumber','segmentId','createActivation','\x27\x20exit\x20criteria','nameToType','name','object','waitStepType','Created\x20segment\x20\x27','attributes','stringify','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Deleted\x20segment\x20\x27','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','parentFolder','from','effectiveFolderId','Failed\x20to\x20','folder','segment_deleting','journeyId','folderPath','entries','getSegment\x20failed\x20for\x20','JOURNEY_UPDATE_ERROR','\x27\x20to\x20local\x20\x27','logInfo','Activation','segment_created','\x0a\x20\x20','run_after_journey_refresh','relationships','logDeleted','withProgress','logWarning','resolvedRule','sort','diff','activationStepsById','\x27\x20by\x20rule\x20content','Entry\x20criteria:\x20','Duration','.$1.push-recovery.json','Failed\x20to\x20fetch\x20referenced\x20segment\x20','rootFolderId','36HApLAe','\x27\x20for\x20','entry','Delete\x20the\x20push\x20recovery\x20file\x20(','description','existingJourney','Segment\x20not\x20found:\x20','entry_criteria','entryCriteria','segment','createdSegmentIds','Creating\x20activation\x20\x27','21910878kNgPQp','connection','existingSegment','action','journey_creating','getActivation','logSuccess','add','Stage\x20\x27','getSegmentEntity\x20also\x20failed\x20for\x20','find','activation_deleting','goal','JOURNEY_SYNTAX_ERROR','WaitStep','Created\x20activation\x20\x27','segmentNameToId','day','createSegment','segmentByFolderAndName','getJourney','debug','journey','4239970ZUKWkA','createJourneySegment','uniqueServerName','2uEeaJO','parse','createdSegmentId','verbose','updateSegmentById','482337MvzhLr','schedule','journeyBundlesByFolderAndName','relative','flatMap','deleteActivation','Created\x20journey\x20\x27','Matched\x20server\x20segment\x20\x27','branches',').\x20','user','notification','progress','waitStepUnit','\x20segment\x20from\x20file:\x20','length','milestone','has','isNew','filter','journeyBundleName','SEGMENT_SYNTAX_ERROR','Deleting\x20activation\x20\x27','draft','createFolder','stages','some','Segment\x20not\x20found','segment_updating','parseDocument','\x27\x20wait\x20condition','Updated\x20segment\x20\x27','kind','__pending_act_','idToName','delete','waitStep','onProgress','includes','join','fetchJourney','journey_entry_criteria_','64zknMPX','goal\x20criteria','connector_config','SEGMENT_NOT_FOUND','updateActivation','absolutePath','activationsBySegmentId','created','existingSegments','listActivations','resolveJourneyId','connectionIdToNameMap','tdx.sdk.push-workflow','errors','1071604HEDMZJ'];a169_0x5807=function(){return _0x4a743d;};return a169_0x5807();}export function validateParsedFiles(_0x450016,_0x343ff7){const _0x349ea3=a169_0x579498,_0x3223c3=[];for(const {yamlConfig:_0x36622b,sourcePath:_0x5021f0}of _0x450016[_0x349ea3(0x24a)]){const _0x4009ff=readFileSync(_0x5021f0,_0x349ea3(0x1a0)),_0x23d021=a169_0x5c3d03[_0x349ea3(0x219)](_0x4009ff),_0x2c5106=validateSegmentDef(_0x36622b,{'source':_0x4009ff,'document':_0x23d021},{'skipSchema':!![]});if(!_0x2c5106[_0x349ea3(0x17f)]){const _0x1dae9d=a169_0x2e5e57[_0x349ea3(0x1ff)](_0x343ff7,_0x5021f0);_0x3223c3[_0x349ea3(0x23d)]({'filePath':_0x1dae9d,'source':_0x4009ff,'result':_0x2c5106,'isJourney':![]});}}for(const {yamlConfig:_0xdf63f5,sourcePath:_0x453752}of _0x450016[_0x349ea3(0x259)]){const _0x3724fe=readFileSync(_0x453752,_0x349ea3(0x1a0)),_0x53fbe0=a169_0x5c3d03[_0x349ea3(0x219)](_0x3724fe),_0x32d14f=validateJourneyDef(_0xdf63f5,{'source':_0x3724fe,'document':_0x53fbe0},{'skipSchema':!![]});if(!_0x32d14f[_0x349ea3(0x17f)]){const _0x1697f5=a169_0x2e5e57[_0x349ea3(0x1ff)](_0x343ff7,_0x453752);_0x3223c3[_0x349ea3(0x23d)]({'filePath':_0x1697f5,'source':_0x3724fe,'result':_0x32d14f,'isJourney':!![]});}}return _0x3223c3;}export function formatValidationErrors(_0x2d9391){const _0xab2232=a169_0x579498,_0x464f21=[];for(const {filePath:_0x4e8213,source:_0x2b20d3,result:_0x13fcb3,isJourney:_0x2aac3f}of _0x2d9391){const _0x253fd9=_0x2aac3f?_0xab2232(0x1f3):_0xab2232(0x1da);_0x464f21['push']('\x0a'+_0x4e8213+'\x20('+_0x253fd9+_0xab2232(0x19a)+_0x13fcb3[_0xab2232(0x233)]['length']+'\x20error(s)'),_0x464f21['push'](formatValidationResult(_0x13fcb3,_0x2b20d3,_0x4e8213));}return _0x464f21['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x10027f){const _0xef558b=a169_0x579498,_0x199eaf=new Set(),_0x2f0f36=new Map(),_0x107180=collectSegmentUsageCounts(_0x10027f);if(_0x10027f['segments'])for(const [_0x5eb7cb,_0x5daac3]of Object[_0xef558b(0x1ba)](_0x10027f['segments'])){_0x199eaf[_0xef558b(0x1e4)](_0x5eb7cb);if(_0x5daac3['rule']){const _0x405862=yamlRuleToApi(_0x5daac3[_0xef558b(0x191)]),_0xb96ec4=apiRuleToYaml(_0x405862);_0x2f0f36[_0xef558b(0x182)](_0x5eb7cb,_0xb96ec4);}}const _0x2cdc29=new Map();let _0x427ad9=0x0;for(const [_0xa99aa9,_0x5ae86e]of _0x2f0f36){const _0x3a4201=serializeExpandedRule(_0x5ae86e,_0x2f0f36),_0x3237be=_0x2cdc29['get'](_0x3a4201)||[];_0x3237be[_0xef558b(0x23d)]({'name':_0xa99aa9,'index':_0x427ad9}),_0x2cdc29[_0xef558b(0x182)](_0x3a4201,_0x3237be),_0x427ad9++;}const _0x138c9b=new Map();for(const [_0x41e33a,_0x4fa5d1]of _0x2cdc29){const _0x16fdf7=_0x4fa5d1[_0xef558b(0x27c)]()[_0xef558b(0x1c8)]((_0x55ea53,_0x386e8a)=>{const _0x58161e=_0xef558b,_0x10a343=_0x107180[_0x58161e(0x250)](_0x55ea53[_0x58161e(0x1a9)])||0x0,_0x59591b=_0x107180['get'](_0x386e8a[_0x58161e(0x1a9)])||0x0;if(_0x10a343!==_0x59591b)return _0x59591b-_0x10a343;return _0x55ea53[_0x58161e(0x198)]-_0x386e8a['index'];})['map'](_0x2a3a33=>_0x2a3a33[_0xef558b(0x1a9)]),_0x4eb4d7=[];for(const _0x546e1b of _0x16fdf7){const _0x5c519c=_0x107180[_0xef558b(0x250)](_0x546e1b)||0x0,_0x16b3f5=Math[_0xef558b(0x23f)](_0x5c519c,0x1);for(let _0x22e8d9=0x0;_0x22e8d9<_0x16b3f5;_0x22e8d9++){_0x4eb4d7[_0xef558b(0x23d)](_0x546e1b);}}_0x138c9b[_0xef558b(0x182)](_0x41e33a,_0x4eb4d7);}return{'existingLocalSegmentNames':_0x199eaf,'localSegmentRules':_0x2f0f36,'localExpandedRuleToNames':_0x138c9b};}export function createSegmentIdResolver(_0xcf37fd,_0x3ba3b4){return async _0x4605ec=>{const _0x3a0dbd=a169_0x5e1a,_0x10e268=_0xcf37fd['get'](_0x4605ec);if(!_0x10e268)throw new SDKError(ErrorCode[_0x3a0dbd(0x229)],_0x3a0dbd(0x1d7)+_0x4605ec+_0x3a0dbd(0x1b1)+_0x3ba3b4+'\x27)');return _0x10e268;};}export function extractRootFolderId(_0x23a57a){const _0x39a90e=a169_0x579498;return _0x23a57a[_0x39a90e(0x1c3)]?.[_0x39a90e(0x264)]?.[_0x39a90e(0x24e)]?.['id']||_0x23a57a['relationships']?.[_0x39a90e(0x1b2)]?.[_0x39a90e(0x24e)]?.['id'];}export function buildConnectionMaps(_0x6ed4e8){const _0x16f636=a169_0x579498,_0x6aa005=new Map(),_0x2c5f2e=new Map(),_0x5d2a13=new Map();for(const _0x5b4d0e of _0x6ed4e8){_0x6aa005[_0x16f636(0x182)](_0x5b4d0e[_0x16f636(0x1a9)],parseInt(_0x5b4d0e['id'],0xa)),_0x2c5f2e[_0x16f636(0x182)](_0x5b4d0e['id'],_0x5b4d0e[_0x16f636(0x1a9)]),_0x5d2a13['set'](_0x5b4d0e[_0x16f636(0x1a9)],_0x5b4d0e[_0x16f636(0x274)]);}return{'nameToId':_0x6aa005,'idToName':_0x2c5f2e,'nameToType':_0x5d2a13};}export function calculatePushStats(_0x4a0be4,_0x4162b7,_0x58de7e,_0x12c42a,_0x1d8eef,_0x3a6b17,_0x29b979){const _0x3e5d7d=a169_0x579498,_0x598eb9=_0x4a0be4[_0x3e5d7d(0x20f)](_0x2e62e9=>_0x2e62e9['isNew']),_0x506496=_0x4a0be4[_0x3e5d7d(0x20f)](_0x45f20c=>!_0x45f20c[_0x3e5d7d(0x20e)]&&_0x45f20c[_0x3e5d7d(0x1a1)]),_0x31ffe0=_0x4a0be4[_0x3e5d7d(0x20f)](_0x8c537d=>!_0x8c537d['isNew']&&!_0x8c537d[_0x3e5d7d(0x1a1)]),_0xeeef88=_0x3a6b17?_0x12c42a:[],_0x11cd40=_0x4162b7['filter'](_0x2eb425=>_0x2eb425[_0x3e5d7d(0x20e)]),_0x1ab4ea=_0x4162b7['filter'](_0x4c4e36=>!_0x4c4e36[_0x3e5d7d(0x20e)]&&_0x4c4e36[_0x3e5d7d(0x1a1)]),_0xdf6009=_0x4162b7[_0x3e5d7d(0x20f)](_0x40ba82=>!_0x40ba82[_0x3e5d7d(0x20e)]&&!_0x40ba82[_0x3e5d7d(0x1a1)]),_0x153507=_0x3a6b17?_0x1d8eef:[],_0xa75bf=_0x4a0be4[_0x3e5d7d(0x200)](_0x467e28=>_0x467e28[_0x3e5d7d(0x252)]),_0x33d32a=_0xa75bf['filter'](_0x263e25=>_0x263e25[_0x3e5d7d(0x274)]===_0x3e5d7d(0x25b)),_0xabca7a=_0xa75bf['filter'](_0xa1ef2c=>_0xa1ef2c[_0x3e5d7d(0x274)]==='update'),_0x168270=_0xa75bf['filter'](_0x390521=>_0x390521[_0x3e5d7d(0x274)]==='delete'),_0x1639a8=Array[_0x3e5d7d(0x1b3)](_0x58de7e)[_0x3e5d7d(0x1c8)](),_0x5a848a=_0x29b979?![]:_0x598eb9[_0x3e5d7d(0x20b)]>0x0||_0x506496['length']>0x0||_0xeeef88[_0x3e5d7d(0x20b)]>0x0,_0x5dd934=_0x11cd40[_0x3e5d7d(0x20b)]>0x0||_0x1ab4ea[_0x3e5d7d(0x20b)]>0x0||_0x153507[_0x3e5d7d(0x20b)]>0x0,_0x2849b0=_0x29b979?![]:_0xa75bf['length']>0x0,_0x396fc6=_0x1639a8[_0x3e5d7d(0x20b)]>0x0;return{'segments':{'new':_0x598eb9,'changed':_0x506496,'unchanged':_0x31ffe0,'toDelete':_0xeeef88},'journeys':{'new':_0x11cd40,'changed':_0x1ab4ea,'unchanged':_0xdf6009,'toDelete':_0x153507},'activations':{'all':_0xa75bf,'toCreate':_0x33d32a,'toUpdate':_0xabca7a,'toDelete':_0x168270},'folders':{'toCreate':_0x1639a8},'counts':{'segments':{'new':_0x598eb9[_0x3e5d7d(0x20b)],'changed':_0x506496['length'],'unchanged':_0x31ffe0[_0x3e5d7d(0x20b)],'toDelete':_0xeeef88[_0x3e5d7d(0x20b)]},'journeys':{'new':_0x11cd40['length'],'changed':_0x1ab4ea[_0x3e5d7d(0x20b)],'unchanged':_0xdf6009[_0x3e5d7d(0x20b)],'toDelete':_0x153507[_0x3e5d7d(0x20b)]},'activations':{'create':_0x33d32a['length'],'update':_0xabca7a['length'],'delete':_0x168270[_0x3e5d7d(0x20b)]},'folders':_0x1639a8[_0x3e5d7d(0x20b)]},'hasChanges':_0x5a848a||_0x5dd934||_0x2849b0||_0x396fc6};}export async function buildPushExecutionContext(_0x45e7e0,_0x351ba7,_0x17a2f1,_0x187c1f,_0x1c2f06,_0x1907f5){const _0x1ed039=a169_0x579498,_0x21c188=extractRootFolderId(_0x17a2f1),{pathToId:_0x2f57bb,idToPath:_0xf55f44}=buildFolderMaps(_0x1c2f06),_0x1e7747=buildSegmentNameToIdMap(_0x187c1f),_0x418eb6=new Map(),{batchAsync:_0x319396}=await import('../../utils/async.js'),[_0x12f8a7,_0x5ca06b]=await Promise[_0x1ed039(0x181)]([_0x45e7e0[_0x1ed039(0x206)][_0x1ed039(0x271)](),_0x45e7e0[_0x1ed039(0x1de)][_0x1ed039(0x17b)](),((async()=>{const _0x508c98=_0x1ed039;!_0x1907f5&&_0x187c1f[_0x508c98(0x20b)]>0x0&&await _0x319396(_0x187c1f,async _0x3acca9=>{const _0x3b1574=_0x508c98,_0x5c6211=await _0x45e7e0[_0x3b1574(0x1da)][_0x3b1574(0x22f)](_0x351ba7,_0x3acca9['id']);_0x418eb6[_0x3b1574(0x182)](_0x3acca9['id'],_0x5c6211);});})())]),{emailToId:_0x4db102,idToEmail:_0x4bb86e}=_0x12f8a7,_0x1473bc=buildConnectionMaps(_0x5ca06b);return{'rootFolderId':_0x21c188,'folderPathToId':_0x2f57bb,'folderIdToPath':_0xf55f44,'segmentNameToId':_0x1e7747,'activationsBySegmentId':_0x418eb6,'emailToIdMap':_0x4db102,'idToEmailMap':_0x4bb86e,'connectionNameToIdMap':_0x1473bc['nameToId'],'connectionIdToNameMap':_0x1473bc[_0x1ed039(0x21e)],'connectionNameToTypeMap':_0x1473bc[_0x1ed039(0x1a8)]};}export function createPushYamlContextForBundle(_0x1749c1,_0x5b0b9d,_0x27fa88,_0x439d22,_0x53c3c6,_0x1c7ff7,_0x1fbfc1,_0x3b24d6){const {existingLocalSegmentNames:_0x4df3e0,localExpandedRuleToNames:_0x1db5fa}=_0x439d22,_0x1df327=new Set(),_0x112479=new Map(),_0x615090=new Map(),_0x334b4e=new Map(),_0x5c1701=createJumpTargetCache(),_0x27d0b4=new Map(),_0x375e26=new Map(),_0x198711=new Set();let _0x48e258;const _0x23f0c1=_0x4d0277=>{const _0x104ecf={'resolveSegment':async _0x4397ae=>{const _0x121e39=a169_0x5e1a,_0x488947=_0x334b4e[_0x121e39(0x250)](_0x4397ae);if(_0x488947!==undefined)return{'name':_0x488947,'isJourneyLocal':!![]};try{const _0x3d7d83=await fetchSegment(_0x1749c1,_0x5b0b9d,_0x4397ae,_0x27fa88);if(!_0x3d7d83)throw new Error(_0x121e39(0x217));const _0x2e2ac1=generateJourneyLocalName(_0x3d7d83['name']),_0x534407=_0x3d7d83[_0x121e39(0x21c)]===SEGMENT_KIND_JOURNEY&&_0x2e2ac1!==undefined;let _0x4bcca0=_0x3d7d83['name'],_0x140d07;if(_0x534407&&_0x3d7d83['rule']){const _0x4dc5d7=apiRuleToYaml(_0x3d7d83[_0x121e39(0x191)]);_0x375e26[_0x121e39(0x182)](_0x4397ae,_0x4dc5d7);const _0x5c3a6a=async _0xdcd712=>{const _0x581e9c=_0x121e39,_0x4ae794=collectSegmentRefsFromRule(_0xdcd712);for(const _0x4396ec of _0x4ae794){if(!_0x375e26[_0x581e9c(0x20d)](_0x4396ec))try{const _0x183c39=await fetchSegment(_0x1749c1,_0x5b0b9d,_0x4396ec,_0x27fa88);if(_0x183c39?.[_0x581e9c(0x191)]){const _0x2bc8a9=apiRuleToYaml(_0x183c39[_0x581e9c(0x191)]);_0x375e26[_0x581e9c(0x182)](_0x4396ec,_0x2bc8a9),await _0x5c3a6a(_0x2bc8a9);}}catch(_0x31e59e){logger[_0x581e9c(0x1f2)](_0x581e9c(0x1cf)+_0x4396ec+':\x20'+_0x31e59e);}}};await _0x5c3a6a(_0x4dc5d7);const _0x34c126=serializeExpandedRule(_0x4dc5d7,_0x375e26),_0x2436f6=_0x1db5fa[_0x121e39(0x250)](_0x34c126);if(_0x2436f6&&_0x2436f6[_0x121e39(0x20b)]>0x0){const _0x18cbcf=_0x112479[_0x121e39(0x250)](_0x34c126)||0x0,_0x2596e7=_0x2436f6[_0x18cbcf]||_0x2436f6[_0x2436f6[_0x121e39(0x20b)]-0x1];_0x112479[_0x121e39(0x182)](_0x34c126,_0x18cbcf+0x1),_0x4bcca0=_0x2596e7,_0x1df327[_0x121e39(0x1e4)](_0x4bcca0),_0x334b4e[_0x121e39(0x182)](_0x4397ae,_0x4bcca0);const _0x1a4e69=await resolveRuleSegmentRefs(_0x4dc5d7,async _0x153cca=>{const _0x1b263=_0x334b4e['get'](_0x153cca);if(_0x1b263)return _0x1b263;const _0x2c933f=await _0x48e258['resolveSegment'](_0x153cca);return _0x2c933f['name'];});_0x140d07={'description':_0x3d7d83[_0x121e39(0x1d5)],'rule':_0x1a4e69};}else{const _0x31d93b=_0x27d0b4['get'](_0x34c126);if(_0x31d93b)_0x4bcca0=_0x31d93b,_0x334b4e[_0x121e39(0x182)](_0x4397ae,_0x4bcca0);else{if(_0x2e2ac1){let _0x1e4665=_0x2e2ac1,_0x17f83b=0x2;while(_0x1df327[_0x121e39(0x20d)](_0x1e4665)||_0x4df3e0[_0x121e39(0x20d)](_0x1e4665)){_0x1e4665=_0x2e2ac1+'_'+_0x17f83b,_0x17f83b++;}_0x1df327['add'](_0x1e4665),_0x4bcca0=_0x1e4665;}_0x334b4e['set'](_0x4397ae,_0x4bcca0),_0x27d0b4[_0x121e39(0x182)](_0x34c126,_0x4bcca0);const _0x49b12d=await resolveRuleSegmentRefs(_0x4dc5d7,async _0x336b06=>{const _0x15d40c=_0x334b4e['get'](_0x336b06);if(_0x15d40c)return _0x15d40c;const _0x513a8d=await _0x48e258['resolveSegment'](_0x336b06);return _0x513a8d['name'];});_0x140d07={'description':_0x3d7d83[_0x121e39(0x1d5)],'rule':_0x49b12d};}}}return{'name':_0x4bcca0,'isJourneyLocal':_0x534407,'definition':_0x140d07};}catch(_0x516bb3){return logger[_0x121e39(0x1f2)](_0x121e39(0x180)+_0x4397ae+':\x20'+_0x516bb3),{'name':_0x4397ae,'isJourneyLocal':![]};}},'resolveActivation':async _0x309111=>{const _0x70a15d=a169_0x5e1a,_0x994495=_0x615090[_0x70a15d(0x250)](_0x309111);if(_0x994495!==undefined)return{'name':_0x994495,'isJourneyLocal':!![]};try{let _0x251dc2=_0x1fbfc1?.['get'](_0x309111);!_0x251dc2&&(_0x251dc2=await _0x1749c1[_0x70a15d(0x1f3)][_0x70a15d(0x1e2)](_0x4d0277,_0x309111));const _0x4812da=_0x251dc2[_0x70a15d(0x1ad)][_0x70a15d(0x248)][_0x70a15d(0x1a9)]||_0x309111,_0x48d2e7=sanitizeYamlKey(_0x4812da)||_0x70a15d(0x17c)+_0x309111,_0xd03bcf=_0x48d2e7;_0x615090[_0x70a15d(0x182)](_0x309111,_0xd03bcf);const _0x18c19f=journeyActivationStepToYaml(_0x251dc2,_0x53c3c6,_0x1c7ff7);return{'name':_0xd03bcf,'isJourneyLocal':!![],'definition':_0x18c19f};}catch(_0x39ea5e){return logger['debug'](_0x70a15d(0x183)+_0x309111+':\x20'+_0x39ea5e),{'name':_0x309111,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1b94b7,_0x1866ae)=>resolveJumpTarget(_0x1b94b7,_0x1866ae,_0x5c1701,async _0x52a3eb=>{const _0x21c49c=a169_0x5e1a,_0x50cf87=_0x3b24d6?.[_0x21c49c(0x250)](_0x52a3eb);if(_0x50cf87)return _0x50cf87;return _0x1749c1[_0x21c49c(0x1f3)][_0x21c49c(0x1f1)](_0x52a3eb);})};return _0x48e258=_0x104ecf,_0x104ecf;},_0x14c483=async _0x177ab5=>{const _0x2705bb=a169_0x5e1a,{collectSegmentIdsFromJourneyApi:_0x4552c3}=await import('./journey-yaml.js'),{batchAsync:_0x4f3d4f}=await import(_0x2705bb(0x24b)),_0x6fdbcb=new Set();for(const _0x3d48aa of _0x177ab5){let _0x31d88c=_0x3b24d6?.['get'](_0x3d48aa);!_0x31d88c&&(_0x31d88c=await _0x1749c1[_0x2705bb(0x1f3)][_0x2705bb(0x1f1)](_0x3d48aa));const _0x368ad8=_0x4552c3(_0x31d88c);for(const _0x3b2e48 of _0x368ad8){_0x6fdbcb['add'](_0x3b2e48);}}let _0x5a3849=Array[_0x2705bb(0x1b3)](_0x6fdbcb);while(_0x5a3849['length']>0x0){const _0x3b4bde=_0x5a3849[_0x2705bb(0x20f)](_0x413cbd=>!_0x198711[_0x2705bb(0x20d)](_0x413cbd));if(_0x3b4bde[_0x2705bb(0x20b)]===0x0)break;const _0x10eb26=await _0x4f3d4f(_0x3b4bde,async _0xfa4c35=>{_0x198711['add'](_0xfa4c35);const _0x23a1fb=await fetchSegment(_0x1749c1,_0x5b0b9d,_0xfa4c35,_0x27fa88);if(!_0x23a1fb)return null;return{'segmentId':_0xfa4c35,'segment':_0x23a1fb};},0xa),_0x36fd74=new Set();for(const _0x4f24a3 of _0x10eb26){if(!_0x4f24a3?.[_0x2705bb(0x1da)]?.[_0x2705bb(0x191)])continue;const _0x4ef768=apiRuleToYaml(_0x4f24a3[_0x2705bb(0x1da)]['rule']);_0x375e26[_0x2705bb(0x182)](_0x4f24a3[_0x2705bb(0x1a5)],_0x4ef768);const _0xa6e3b2=collectSegmentRefsFromRule(_0x4ef768);for(const _0x27d33d of _0xa6e3b2){!_0x198711['has'](_0x27d33d)&&_0x36fd74[_0x2705bb(0x1e4)](_0x27d33d);}}_0x5a3849=Array[_0x2705bb(0x1b3)](_0x36fd74);}};return{'createYamlContext':_0x23f0c1,'prefetchJourneySegments':_0x14c483};}export async function executePushSegments(_0x2361db,_0x276879,_0x4318fc,_0x1eb0ed,_0x3a004d){const _0x57db2f=a169_0x579498,{segmentDefToCreateRequest:_0xe690d4,segmentDefToUpdateRequest:_0x24b2aa}=await import('./child-segment-yaml.js'),_0x5e090e=_0x4318fc[_0x57db2f(0x247)],_0x25bb4e=0x5,_0x368d66=async _0x49dc6f=>{const _0x54bd39=_0x57db2f,_0x5085b4=_0x49dc6f['folderPath']?_0x5e090e['get'](_0x49dc6f['folderPath']):undefined;let _0x40e63b;const _0x67197e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xa308cf=_0x49dc6f[_0x54bd39(0x237)];if(_0x49dc6f[_0x54bd39(0x237)][_0x54bd39(0x191)]){const _0x15687e=createSegmentIdResolver(_0x4318fc[_0x54bd39(0x1ed)],_0x49dc6f['yamlConfig'][_0x54bd39(0x1a9)]),_0x2c035d=await resolveRuleSegmentIds(_0x49dc6f[_0x54bd39(0x237)][_0x54bd39(0x191)],_0x15687e);_0xa308cf={..._0x49dc6f['yamlConfig'],'rule':_0x2c035d};}try{if(_0x49dc6f[_0x54bd39(0x20e)]){_0x3a004d[_0x54bd39(0x221)]?.({'type':'segment_creating','name':_0x49dc6f[_0x54bd39(0x237)][_0x54bd39(0x1a9)]});const _0x1a5ad5=_0xe690d4(_0xa308cf,_0x5085b4),_0x592653=await _0x3a004d[_0x54bd39(0x1c5)]('Creating\x20segment\x20\x27'+_0x49dc6f['yamlConfig'][_0x54bd39(0x1a9)]+_0x54bd39(0x261),()=>_0x2361db[_0x54bd39(0x1da)][_0x54bd39(0x1ef)](_0x1eb0ed[_0x54bd39(0x268)],_0x1a5ad5));_0x40e63b=_0x592653[_0x54bd39(0x24e)]['id'],_0x4318fc[_0x54bd39(0x1ed)]['set'](_0x49dc6f[_0x54bd39(0x237)][_0x54bd39(0x1a9)],_0x40e63b),_0x67197e[_0x54bd39(0x1f9)]={'name':_0x49dc6f[_0x54bd39(0x237)][_0x54bd39(0x1a9)],'id':_0x40e63b},_0x3a004d[_0x54bd39(0x221)]?.({'type':_0x54bd39(0x1c0),'name':_0x49dc6f[_0x54bd39(0x237)]['name'],'segmentId':_0x40e63b}),_0x3a004d[_0x54bd39(0x1e3)]?.(_0x54bd39(0x1ac)+_0x49dc6f[_0x54bd39(0x237)][_0x54bd39(0x1a9)]+'\x27'),_0x67197e['created']=0x1;}else{if(_0x49dc6f[_0x54bd39(0x1a1)]){_0x3a004d[_0x54bd39(0x221)]?.({'type':_0x54bd39(0x218),'name':_0x49dc6f[_0x54bd39(0x237)]['name']});const _0x249c96=_0x24b2aa(_0xa308cf);_0x5085b4!==_0x49dc6f['existingSegment']?.[_0x54bd39(0x186)]&&(_0x249c96[_0x54bd39(0x186)]=_0x5085b4?parseInt(_0x5085b4,0xa):undefined),await _0x3a004d[_0x54bd39(0x1c5)](_0x54bd39(0x23a)+_0x49dc6f[_0x54bd39(0x237)]['name']+_0x54bd39(0x261),()=>_0x2361db['segment'][_0x54bd39(0x1fb)](_0x1eb0ed['parentId'],_0x49dc6f['existingSegment']['id'],_0x249c96)),_0x40e63b=_0x49dc6f[_0x54bd39(0x1df)]['id'],_0x3a004d[_0x54bd39(0x221)]?.({'type':_0x54bd39(0x255),'name':_0x49dc6f['yamlConfig'][_0x54bd39(0x1a9)]}),_0x3a004d[_0x54bd39(0x1e3)]?.(_0x54bd39(0x21b)+_0x49dc6f[_0x54bd39(0x237)][_0x54bd39(0x1a9)]+'\x27'),_0x67197e[_0x54bd39(0x26b)]=0x1;}else _0x40e63b=_0x49dc6f[_0x54bd39(0x1df)]['id'];}}catch(_0x472d89){const _0x59ac59=isHttp400Error(_0x472d89),_0x432770=_0x59ac59?ErrorCode[_0x54bd39(0x211)]:ErrorCode[_0x54bd39(0x26a)],_0x49dd2c=getErrorMessage(_0x472d89);throw new SDKError(_0x432770,_0x54bd39(0x1b5)+(_0x49dc6f[_0x54bd39(0x20e)]?_0x54bd39(0x25b):_0x54bd39(0x26e))+_0x54bd39(0x20a)+_0x49dc6f['absolutePath']+_0x54bd39(0x1c1)+_0x49dd2c,_0x472d89);}try{const _0x533331=await syncActivationsForSegment(_0x2361db,_0x1eb0ed[_0x54bd39(0x268)],_0x40e63b,_0x49dc6f['yamlConfig'][_0x54bd39(0x1a9)],_0x49dc6f[_0x54bd39(0x252)],_0x3a004d,_0x49dc6f[_0x54bd39(0x22b)]);_0x67197e[_0x54bd39(0x260)]=_0x533331;}catch(_0x68532f){if(_0x68532f instanceof SDKError)throw _0x68532f;throw new SDKError(ErrorCode[_0x54bd39(0x24d)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x49dc6f['yamlConfig']['name']+_0x54bd39(0x179)+_0x49dc6f[_0x54bd39(0x22b)]+_0x54bd39(0x1c1)+getErrorMessage(_0x68532f),_0x68532f);}return _0x67197e;},_0x5657a5=await batchAsync(_0x276879,_0x368d66,_0x25bb4e),_0x1ee127={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x42ab49 of _0x5657a5){_0x1ee127[_0x57db2f(0x22d)]+=_0x42ab49[_0x57db2f(0x22d)],_0x1ee127[_0x57db2f(0x26b)]+=_0x42ab49[_0x57db2f(0x26b)],_0x42ab49[_0x57db2f(0x1f9)]&&_0x1ee127[_0x57db2f(0x1db)][_0x57db2f(0x182)](_0x42ab49[_0x57db2f(0x1f9)][_0x57db2f(0x1a9)],_0x42ab49['createdSegmentId']['id']),_0x1ee127['activations'][_0x57db2f(0x22d)]+=_0x42ab49[_0x57db2f(0x260)]['created'],_0x1ee127[_0x57db2f(0x260)][_0x57db2f(0x26b)]+=_0x42ab49['activations'][_0x57db2f(0x26b)],_0x1ee127[_0x57db2f(0x260)][_0x57db2f(0x189)]+=_0x42ab49[_0x57db2f(0x260)][_0x57db2f(0x189)];}return _0x1ee127;}async function syncActivationsForSegment(_0x37ddd0,_0x3e2f93,_0x53c755,_0x58d924,_0x17b107,_0x1ca9b1,_0x51eb9a){const _0x2bd1fd=a169_0x579498,_0x5e73de={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x19573a of _0x17b107){try{if(_0x19573a[_0x2bd1fd(0x274)]==='create'&&_0x19573a[_0x2bd1fd(0x269)])_0x1ca9b1[_0x2bd1fd(0x221)]?.({'type':'activation_creating','segmentName':_0x58d924,'activationName':_0x19573a[_0x2bd1fd(0x1a9)]}),await _0x1ca9b1[_0x2bd1fd(0x1c5)](_0x2bd1fd(0x1dc)+_0x19573a['name']+_0x2bd1fd(0x261),()=>_0x37ddd0[_0x2bd1fd(0x1da)][_0x2bd1fd(0x1a6)](_0x3e2f93,_0x53c755,_0x19573a[_0x2bd1fd(0x269)])),_0x1ca9b1[_0x2bd1fd(0x221)]?.({'type':_0x2bd1fd(0x194),'segmentName':_0x58d924,'activationName':_0x19573a[_0x2bd1fd(0x1a9)]}),_0x1ca9b1[_0x2bd1fd(0x1e3)]?.(_0x2bd1fd(0x1ec)+_0x19573a[_0x2bd1fd(0x1a9)]+'\x27'),_0x5e73de[_0x2bd1fd(0x22d)]++;else{if(_0x19573a['type']===_0x2bd1fd(0x26e)&&_0x19573a[_0x2bd1fd(0x269)]&&_0x19573a[_0x2bd1fd(0x276)])_0x1ca9b1[_0x2bd1fd(0x221)]?.({'type':'activation_updating','segmentName':_0x58d924,'activationName':_0x19573a[_0x2bd1fd(0x1a9)]}),await _0x1ca9b1['withProgress'](_0x2bd1fd(0x174)+_0x19573a[_0x2bd1fd(0x1a9)]+_0x2bd1fd(0x261),()=>_0x37ddd0[_0x2bd1fd(0x1da)][_0x2bd1fd(0x22a)](_0x3e2f93,_0x53c755,_0x19573a['existingActivation']['id'],_0x19573a[_0x2bd1fd(0x269)])),_0x1ca9b1[_0x2bd1fd(0x221)]?.({'type':'activation_updated','segmentName':_0x58d924,'activationName':_0x19573a[_0x2bd1fd(0x1a9)]}),_0x1ca9b1[_0x2bd1fd(0x1e3)]?.(_0x2bd1fd(0x249)+_0x19573a['name']+'\x27'),_0x5e73de[_0x2bd1fd(0x26b)]++;else _0x19573a[_0x2bd1fd(0x274)]===_0x2bd1fd(0x21f)&&_0x19573a['existingActivation']&&(_0x1ca9b1[_0x2bd1fd(0x221)]?.({'type':_0x2bd1fd(0x1e8),'segmentName':_0x58d924,'activationName':_0x19573a[_0x2bd1fd(0x1a9)]}),await _0x1ca9b1[_0x2bd1fd(0x1c5)](_0x2bd1fd(0x212)+_0x19573a['name']+'\x27...',()=>_0x37ddd0[_0x2bd1fd(0x1da)][_0x2bd1fd(0x201)](_0x3e2f93,_0x53c755,_0x19573a[_0x2bd1fd(0x276)]['id'])),_0x1ca9b1[_0x2bd1fd(0x221)]?.({'type':'activation_deleted','segmentName':_0x58d924,'activationName':_0x19573a[_0x2bd1fd(0x1a9)]}),_0x1ca9b1[_0x2bd1fd(0x1c4)]?.(_0x2bd1fd(0x196)+_0x19573a[_0x2bd1fd(0x1a9)]+'\x27'),_0x5e73de[_0x2bd1fd(0x189)]++);}}catch(_0x5d0e05){const _0x3ce266=isHttp400Error(_0x5d0e05),_0x127d29=_0x3ce266?ErrorCode[_0x2bd1fd(0x25d)]:ErrorCode[_0x2bd1fd(0x24d)],_0x44e0f3=getErrorMessage(_0x5d0e05);throw new SDKError(_0x127d29,_0x2bd1fd(0x1b5)+_0x19573a['type']+'\x20activation\x20\x27'+_0x19573a[_0x2bd1fd(0x1a9)]+_0x2bd1fd(0x179)+_0x51eb9a+_0x2bd1fd(0x1c1)+_0x44e0f3,_0x5d0e05);}}return _0x5e73de;}export async function executePushFolders(_0x2b3582,_0x1e2b6e,_0xed3c0e,_0x41a36b,_0x547374){const _0x18dffd=a169_0x579498,_0x2e3878=new Map(_0xed3c0e),_0x20d6d1=sortFoldersByDepth(_0x1e2b6e);for(const _0x5537b9 of _0x20d6d1){const _0x247be0=_0x5537b9['split']('/'),_0x613347=_0x247be0[_0x247be0[_0x18dffd(0x20b)]-0x1],_0x6d2c4b=_0x247be0['slice'](0x0,-0x1)[_0x18dffd(0x223)]('/'),_0x13709d=_0x2e3878[_0x18dffd(0x250)](_0x6d2c4b);_0x547374['onProgress']?.({'type':_0x18dffd(0x245),'folder':_0x5537b9});const _0x5e3fd5={'name':_0x613347,'parentFolderId':_0x13709d},_0x14d9f2=await _0x547374[_0x18dffd(0x1c5)]('Creating\x20folder\x20\x27'+_0x5537b9+_0x18dffd(0x261),()=>_0x2b3582['segment'][_0x18dffd(0x214)](_0x41a36b['parentId'],_0x5e3fd5));_0x2e3878['set'](_0x5537b9,_0x14d9f2[_0x18dffd(0x24e)]['id']),_0x547374[_0x18dffd(0x221)]?.({'type':_0x18dffd(0x18b),'folder':_0x5537b9,'folderId':_0x14d9f2[_0x18dffd(0x24e)]['id']}),_0x547374[_0x18dffd(0x1be)]?.('Created\x20folder\x20\x27'+_0x5537b9+'\x27');}return _0x2e3878;}export async function executePushSegmentDeletions(_0x34b6b0,_0x1cf282,_0x2700fd){const _0x2e6404=a169_0x579498;if(_0x1cf282[_0x2e6404(0x20b)]===0x0)return 0x0;const {batchAsync:_0x34dec3}=await import(_0x2e6404(0x24b)),_0xb45545=0x5,_0x52843c=await _0x34dec3(_0x1cf282,async _0x3f3ec1=>{const _0x1facc2=_0x2e6404;return _0x2700fd[_0x1facc2(0x221)]?.({'type':_0x1facc2(0x1b7),'name':_0x3f3ec1['name']}),await _0x34b6b0[_0x1facc2(0x1da)][_0x1facc2(0x19e)](_0x3f3ec1['id']),_0x2700fd['onProgress']?.({'type':_0x1facc2(0x241),'name':_0x3f3ec1[_0x1facc2(0x1a9)]}),_0x2700fd[_0x1facc2(0x1c4)]?.(_0x1facc2(0x1b0)+_0x3f3ec1[_0x1facc2(0x1a9)]+'\x27'),0x1;},_0xb45545);return _0x52843c[_0x2e6404(0x192)]((_0x562120,_0x125972)=>_0x562120+_0x125972,0x0);}export async function executePushJourneys(_0x574a6f,_0x49f1c9,_0x44b5b1,_0x4cdfff,_0x3c2b2a){const _0x37166f=a169_0x579498,{journeyDefToRequest:_0x5c10ae}=await import(_0x37166f(0x23e)),{activationDefToCreateRequest:_0x1323d0,yamlRuleToApi:_0x748935,validateSegmentRule:_0x522795}=await import(_0x37166f(0x19c)),_0x2ed395={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3c3392=new Map(_0x44b5b1[_0x37166f(0x1ed)]),_0x3fd350=0x5;for(let _0x23164a=0x0;_0x23164a<_0x49f1c9[_0x37166f(0x20b)];_0x23164a+=_0x3fd350){const _0x31b81e=_0x49f1c9[_0x37166f(0x27c)](_0x23164a,_0x23164a+_0x3fd350),_0x8d4548=await Promise[_0x37166f(0x181)](_0x31b81e[_0x37166f(0x190)](async _0x524f68=>{const _0x418a0e=_0x37166f;if(!_0x524f68['isNew']&&!_0x524f68[_0x418a0e(0x1a1)])return{'action':_0x418a0e(0x266),'name':_0x524f68['yamlConfig']['name'],'journeyId':_0x524f68[_0x418a0e(0x1d6)]?.['id']};const _0x1f951b=_0x524f68[_0x418a0e(0x1b9)]?_0x44b5b1[_0x418a0e(0x247)][_0x418a0e(0x250)](_0x524f68[_0x418a0e(0x1b9)]):undefined;_0x3c2b2a[_0x418a0e(0x221)]?.({'type':_0x524f68[_0x418a0e(0x20e)]?_0x418a0e(0x1e1):_0x418a0e(0x172),'name':_0x524f68[_0x418a0e(0x237)]['name']});try{const _0x5eb1dd=await executeSingleJourneyPush(_0x574a6f,_0x524f68,{..._0x44b5b1,'segmentNameToId':_0x3c3392},{'parentId':_0x4cdfff[_0x418a0e(0x268)],'rootFolderId':_0x4cdfff[_0x418a0e(0x1d0)],'folderId':_0x1f951b,'verbose':_0x4cdfff[_0x418a0e(0x1fa)]},_0x3c2b2a,{'journeyDefToRequest':_0x5c10ae,'activationDefToCreateRequest':_0x1323d0,'yamlRuleToApi':_0x748935,'validateSegmentRule':_0x522795});for(const [_0x1d6714,_0x16de46]of _0x5eb1dd[_0x418a0e(0x18c)]){_0x3c3392[_0x418a0e(0x182)](_0x1d6714,_0x16de46),_0x2ed395[_0x418a0e(0x18c)][_0x418a0e(0x182)](_0x1d6714,_0x16de46);}if(_0x5eb1dd[_0x418a0e(0x1e0)]===_0x418a0e(0x22d))_0x3c2b2a['onProgress']?.({'type':_0x418a0e(0x18f),'name':_0x524f68[_0x418a0e(0x237)][_0x418a0e(0x1a9)],'journeyId':_0x5eb1dd['journeyId']}),_0x3c2b2a[_0x418a0e(0x1e3)]?.(_0x418a0e(0x202)+_0x524f68[_0x418a0e(0x237)][_0x418a0e(0x1a9)]+'\x27'),_0x2ed395['created']++;else _0x5eb1dd[_0x418a0e(0x1e0)]==='updated'&&(_0x3c2b2a[_0x418a0e(0x221)]?.({'type':_0x418a0e(0x236),'name':_0x524f68[_0x418a0e(0x237)][_0x418a0e(0x1a9)]}),_0x3c2b2a['logSuccess']?.(_0x418a0e(0x270)+_0x524f68[_0x418a0e(0x237)][_0x418a0e(0x1a9)]+'\x27'),_0x2ed395[_0x418a0e(0x26b)]++);return{'action':_0x5eb1dd[_0x418a0e(0x1e0)],'name':_0x524f68[_0x418a0e(0x237)][_0x418a0e(0x1a9)],'journeyId':_0x5eb1dd[_0x418a0e(0x1b8)]};}catch(_0x361940){const _0x1331c1=isHttp400Error(_0x361940),_0x3ed0e8=_0x1331c1?ErrorCode[_0x418a0e(0x1ea)]:ErrorCode[_0x418a0e(0x1bc)],_0x56da3e=getErrorMessage(_0x361940);throw new SDKError(_0x3ed0e8,_0x418a0e(0x1b5)+(_0x524f68[_0x418a0e(0x20e)]?_0x418a0e(0x25b):_0x418a0e(0x26e))+_0x418a0e(0x18e)+_0x524f68[_0x418a0e(0x22b)]+_0x418a0e(0x1c1)+_0x56da3e,_0x361940);}}));_0x2ed395['results']['push'](..._0x8d4548);}return _0x2ed395;}async function matchExistingJourneySegments(_0x571b3c,_0x283cf2,_0x56e8f7,_0x34ae61,_0x407d25){const _0x162987=a169_0x579498;if(!_0x283cf2['existingJourney']||!_0x283cf2['yamlConfig']['segments'])return;const _0x1e1d58=new Map(),_0x44ebca=new Set();for(const _0x2ad8fb of Object[_0x162987(0x25f)](_0x283cf2['yamlConfig'][_0x162987(0x24a)])){const _0x2fae62=generateDeterministicJourneySegmentName(_0x283cf2[_0x162987(0x237)]['name'],_0x2ad8fb);_0x1e1d58[_0x162987(0x182)](_0x2fae62,_0x2ad8fb),_0x44ebca[_0x162987(0x1e4)](_0x2ad8fb);}const _0x499b27=[],_0x5a52fa=collectSegmentIdsFromJourneyApi(_0x283cf2['existingJourney']);for(const _0x103519 of _0x5a52fa){const _0x23a376=await fetchSegment(_0x571b3c,_0x56e8f7,_0x103519,_0x34ae61);if(!_0x23a376?.[_0x162987(0x1a9)])continue;const _0x406b70=_0x1e1d58['get'](_0x23a376[_0x162987(0x1a9)]);_0x406b70?(_0x407d25[_0x162987(0x182)](_0x406b70,_0x103519),_0x44ebca['delete'](_0x406b70)):_0x499b27[_0x162987(0x23d)]({'id':_0x103519,'seg':_0x23a376});}if(_0x44ebca[_0x162987(0x19b)]>0x0&&_0x499b27[_0x162987(0x20b)]>0x0){const {localExpandedRuleToNames:_0x23c282}=buildLocalExpandedRuleMappings(_0x283cf2[_0x162987(0x237)]),_0x50ad91=new Map();for(const {id:_0x2db538,seg:_0x196f5c}of _0x499b27){if(_0x196f5c[_0x162987(0x191)]){const _0x574cba=apiRuleToYaml(_0x196f5c[_0x162987(0x191)]);_0x50ad91[_0x162987(0x182)](_0x2db538,_0x574cba);}}for(const {id:_0x4ff26e,seg:_0x59f074}of _0x499b27){if(!_0x59f074['rule'])continue;const _0x5d3bff=_0x50ad91['get'](_0x4ff26e);if(!_0x5d3bff)continue;const _0x15cf42=serializeExpandedRule(_0x5d3bff,_0x50ad91),_0x16c2af=_0x23c282[_0x162987(0x250)](_0x15cf42);if(_0x16c2af){const _0x45dd1e=_0x16c2af[_0x162987(0x1e7)](_0x45d688=>_0x44ebca['has'](_0x45d688));_0x45dd1e&&(_0x407d25[_0x162987(0x182)](_0x45dd1e,_0x4ff26e),_0x44ebca[_0x162987(0x21f)](_0x45dd1e),logger['debug'](_0x162987(0x203)+_0x59f074[_0x162987(0x1a9)]+_0x162987(0x1bd)+_0x45dd1e+_0x162987(0x1cb)));}}}}async function executeSingleJourneyPush(_0x209900,_0x1dab3e,_0x8b91aa,_0x5cd720,_0x69f3c2,_0xb86d7e){const _0x410d05=a169_0x579498,{journeyDefToRequest:_0x17e1c5,activationDefToCreateRequest:_0x5d2ca2,yamlRuleToApi:_0x1ac01a,validateSegmentRule:_0x1b2c59}=_0xb86d7e,_0x22ec17=new Map(),_0x27abfd=new Map();recoverSegmentIdsFromPushRecovery(_0x1dab3e,_0x22ec17,_0x8b91aa[_0x410d05(0x1ed)]);const _0x4dd46a=new Map(),_0x4fd4a7=new Map(),_0x195b80=new Map();let _0x17c9b1;const _0x5a19c5=async()=>{const _0xfe5652=_0x410d05;if(_0x17c9b1)return;_0x17c9b1=new Map();if(!_0x1dab3e['existingJourney'])return;const _0x4a0893=await _0x209900[_0xfe5652(0x1f3)]['listActivations'](_0x1dab3e[_0xfe5652(0x1d6)]['id']);for(const _0x235f54 of _0x4a0893){const _0x4b04e1=journeyActivationStepToYaml(_0x235f54,_0x8b91aa[_0xfe5652(0x26c)],_0x8b91aa[_0xfe5652(0x231)]),_0x4dc230=activationSignature(_0x4b04e1);!_0x17c9b1[_0xfe5652(0x20d)](_0x4dc230)&&_0x17c9b1[_0xfe5652(0x182)](_0x4dc230,_0x235f54['id']),_0x4b04e1[_0xfe5652(0x1a9)]&&_0x27abfd[_0xfe5652(0x182)](_0x4b04e1[_0xfe5652(0x1a9)],_0x235f54['id']);}};await matchExistingJourneySegments(_0x209900,_0x1dab3e,_0x5cd720[_0x410d05(0x268)],_0x8b91aa[_0x410d05(0x22e)],_0x8b91aa[_0x410d05(0x1ed)]);const _0x14bc86={'resolveSegmentId':async _0x45276d=>{const _0x398eb5=_0x410d05,_0x4d8c73=_0x8b91aa[_0x398eb5(0x1ed)][_0x398eb5(0x250)](_0x45276d);if(!_0x4d8c73)throw new SDKError(ErrorCode[_0x398eb5(0x229)],_0x398eb5(0x1d7)+_0x45276d+_0x398eb5(0x23c)+_0x1dab3e[_0x398eb5(0x237)][_0x398eb5(0x1a9)]+')');return _0x4d8c73;},'resolveEmbeddedSegmentId':async(_0x5c5739,_0x366e9e)=>{const _0x25833c=_0x410d05,_0x1274a1=_0x8b91aa[_0x25833c(0x1ed)][_0x25833c(0x250)](_0x5c5739);if(_0x1274a1)return _0x1274a1;const _0x43fe2a=_0x8b91aa['existingSegments'][_0x25833c(0x1e7)](_0x3707c9=>_0x3707c9[_0x25833c(0x1a9)]===_0x5c5739);if(_0x43fe2a)return _0x8b91aa[_0x25833c(0x1ed)][_0x25833c(0x182)](_0x5c5739,_0x43fe2a['id']),_0x43fe2a['id'];if(_0x1dab3e[_0x25833c(0x20e)]){const {stageName:_0x126636,criteriaName:_0x51eba8}=findSegmentCriteriaLocation(_0x1dab3e[_0x25833c(0x237)],_0x5c5739);return _0x1b2c59(_0x5c5739,_0x366e9e[_0x25833c(0x191)]),_0x4fd4a7[_0x25833c(0x182)](_0x5c5739,{'definition':_0x366e9e,'stageName':_0x126636,'criteriaName':_0x51eba8}),createPendingSegmentId(_0x5c5739);}const _0x516c50=_0x1dab3e['existingJourney']?.['id'];if(!_0x516c50)throw new SDKError(ErrorCode[_0x25833c(0x272)],_0x25833c(0x1af));const _0x175e5b=_0x4dd46a[_0x25833c(0x250)](_0x5c5739);if(_0x175e5b)return _0x175e5b;const _0x23be84=((async()=>{const _0x58f1e0=_0x25833c;_0x1b2c59(_0x5c5739,_0x366e9e['rule']);const _0x5efbba=generateDeterministicJourneySegmentName(_0x1dab3e[_0x58f1e0(0x237)][_0x58f1e0(0x1a9)],_0x5c5739),_0x5d4ed8=_0x8b91aa['existingSegments'][_0x58f1e0(0x1e7)](_0x465034=>_0x465034['name']===_0x5efbba),_0x1437d6=createSegmentIdResolver(_0x8b91aa['segmentNameToId'],_0x5c5739),_0x3a617e=await resolveRuleSegmentIds(_0x366e9e[_0x58f1e0(0x191)],_0x1437d6);let _0x1cbf9b;return _0x5d4ed8?(await _0x209900[_0x58f1e0(0x1da)][_0x58f1e0(0x1fb)](_0x5cd720[_0x58f1e0(0x268)],_0x5d4ed8['id'],{'description':_0x366e9e[_0x58f1e0(0x1d5)]||_0x58f1e0(0x1cc)+_0x5c5739,'rule':_0x1ac01a(_0x3a617e),'countPopulation':!![]}),_0x1cbf9b=_0x5d4ed8['id'],saveSegmentToPushRecovery(_0x1dab3e[_0x58f1e0(0x22b)],_0x1dab3e[_0x58f1e0(0x237)]['name'],_0x5c5739,{'segmentId':_0x1cbf9b,'uniqueServerName':_0x5efbba,'createdAt':new Date()['toISOString']()})):_0x1cbf9b=await createOrRecoverEmbeddedSegment(_0x209900,_0x1dab3e,{'localName':_0x5c5739,'uniqueSegmentName':_0x5efbba,'description':_0x366e9e[_0x58f1e0(0x1d5)]||_0x58f1e0(0x1cc)+_0x5c5739,'journeyId':_0x516c50,'resolvedRule':_0x3a617e,'parentId':_0x5cd720[_0x58f1e0(0x268)],'folderId':_0x5cd720[_0x58f1e0(0x1d0)]||''},_0x1ac01a),_0x8b91aa[_0x58f1e0(0x1ed)][_0x58f1e0(0x182)](_0x5c5739,_0x1cbf9b),_0x22ec17[_0x58f1e0(0x182)](_0x5c5739,_0x1cbf9b),_0x1cbf9b;})());_0x4dd46a[_0x25833c(0x182)](_0x5c5739,_0x23be84);try{return await _0x23be84;}finally{_0x4dd46a[_0x25833c(0x21f)](_0x5c5739);}},'resolveActivationId':async _0x451248=>{const _0x5bb6ed=_0x410d05,_0x2d0f6a=_0x27abfd[_0x5bb6ed(0x250)](_0x451248);if(_0x2d0f6a)return _0x2d0f6a;if(_0x1dab3e[_0x5bb6ed(0x1d6)]){await _0x5a19c5();const _0xc53c4a=_0x27abfd['get'](_0x451248);if(_0xc53c4a)return _0xc53c4a;}throw new SDKError(ErrorCode[_0x5bb6ed(0x26d)],_0x5bb6ed(0x178)+_0x451248+_0x5bb6ed(0x23c)+_0x1dab3e[_0x5bb6ed(0x237)][_0x5bb6ed(0x1a9)]+_0x5bb6ed(0x205)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x2ba42f,_0x54f0ed)=>{const _0x5797a3=_0x410d05,_0x3a1018=_0x27abfd[_0x5797a3(0x250)](_0x2ba42f);if(_0x3a1018)return _0x3a1018;if(_0x1dab3e[_0x5797a3(0x20e)])return _0x195b80['set'](_0x2ba42f,_0x54f0ed),createPendingActivationId(_0x2ba42f);if(_0x1dab3e[_0x5797a3(0x1d6)]){await _0x5a19c5();const _0x3bf6c0=_0x27abfd[_0x5797a3(0x250)](_0x54f0ed[_0x5797a3(0x1a9)]);if(_0x3bf6c0)return _0x27abfd[_0x5797a3(0x182)](_0x2ba42f,_0x3bf6c0),_0x3bf6c0;const _0x3aa935=activationSignature(_0x54f0ed),_0x108be0=_0x17c9b1?.['get'](_0x3aa935);if(_0x108be0)return _0x27abfd[_0x5797a3(0x182)](_0x2ba42f,_0x108be0),_0x108be0;const _0xe2992f=await _0x5d2ca2(_0x54f0ed,_0x8b91aa[_0x5797a3(0x18d)]),_0x229682={..._0xe2992f,..._0x54f0ed[_0x5797a3(0x1c2)]!==undefined&&{'runAfterJourneyRefresh':_0x54f0ed[_0x5797a3(0x1c2)]}},_0x3fbe38=await _0x209900[_0x5797a3(0x1f3)][_0x5797a3(0x1a6)](_0x1dab3e['existingJourney']['id'],_0x229682);return _0x27abfd['set'](_0x2ba42f,_0x3fbe38['id']),_0x3fbe38['id'];}throw new SDKError(ErrorCode[_0x5797a3(0x272)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x5785f2=>{const _0x123d1f=_0x410d05;try{return await _0x209900[_0x123d1f(0x1f3)][_0x123d1f(0x230)](_0x5cd720[_0x123d1f(0x268)],_0x5785f2);}catch(_0x529047){throw new SDKError(ErrorCode['NOT_FOUND'],_0x123d1f(0x258)+_0x5785f2+_0x123d1f(0x1a3)+_0x1dab3e['yamlConfig'][_0x123d1f(0x1a9)]+'\x27)',_0x529047);}},'resolveStageId':async(_0x9ddaf6,_0x9b590e)=>{const _0x2ac0d6=_0x410d05,_0x29dc49=await _0x209900['journey'][_0x2ac0d6(0x1f1)](_0x9ddaf6),_0x21449b=_0x29dc49[_0x2ac0d6(0x1ad)]['journeyStages'][_0x2ac0d6(0x1e7)](_0x3ff239=>_0x3ff239[_0x2ac0d6(0x1a9)][_0x2ac0d6(0x280)]()===_0x9b590e['toLowerCase']());if(!_0x21449b?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x2ac0d6(0x1e5)+_0x9b590e+_0x2ac0d6(0x175)+(_0x29dc49[_0x2ac0d6(0x1ad)][_0x2ac0d6(0x210)]||_0x29dc49['attributes'][_0x2ac0d6(0x1a9)])+'\x27');return _0x21449b['id'];}},_0x303383=await _0x17e1c5(_0x1dab3e['yamlConfig'],_0x5cd720['parentId'],_0x14bc86),_0x535b8d=_0x5cd720['folderId']||_0x5cd720[_0x410d05(0x1d0)];_0x535b8d&&(_0x303383['relationships']={'parentFolder':{'data':{'id':_0x535b8d,'type':_0x410d05(0x1b6)}}});if(_0x1dab3e[_0x410d05(0x20e)]){if(_0x4fd4a7[_0x410d05(0x19b)]>0x0||_0x195b80['size']>0x0)return await executeThreeStepJourneyCreate(_0x209900,_0x1dab3e,_0x303383,{'pendingEmbeddedSegments':_0x4fd4a7,'pendingEmbeddedActivations':_0x195b80,'embeddedSegmentNameToId':_0x22ec17,'journeyActivationNameToId':_0x27abfd},{..._0x5cd720,'effectiveFolderId':_0x535b8d},_0x8b91aa,_0x69f3c2,_0xb86d7e);else{ensureJourneyDefaults(_0x303383[_0x410d05(0x1ad)]);const _0x2542c3=await _0x209900['journey'][_0x410d05(0x25b)](_0x303383);return deletePushRecovery(_0x1dab3e[_0x410d05(0x22b)]),{'action':_0x410d05(0x22d),'journeyId':_0x2542c3['id'],'embeddedSegmentNameToId':_0x22ec17};}}else{if(_0x1dab3e['hasChanges']&&_0x1dab3e['existingJourney']){_0x303383['id']=_0x1dab3e['existingJourney']['id'];const _0x88cf50=_0x303383[_0x410d05(0x1ad)];_0x1dab3e[_0x410d05(0x1d6)]['attributes']?.[_0x410d05(0x210)]&&(_0x88cf50[_0x410d05(0x210)]=_0x1dab3e[_0x410d05(0x1d6)][_0x410d05(0x1ad)]['journeyBundleName']);const _0x4b64d4=_0x1dab3e[_0x410d05(0x1d6)]['attributes']?.[_0x410d05(0x27f)];return _0x4b64d4&&_0x303383['attributes'][_0x410d05(0x27f)]&&injectExistingStageIds(_0x303383[_0x410d05(0x1ad)][_0x410d05(0x27f)],_0x4b64d4),ensureJourneyDefaults(_0x88cf50),await _0x209900[_0x410d05(0x1f3)]['update'](_0x1dab3e[_0x410d05(0x1d6)]['id'],_0x303383),deletePushRecovery(_0x1dab3e[_0x410d05(0x22b)]),{'action':_0x410d05(0x26b),'journeyId':_0x1dab3e[_0x410d05(0x1d6)]['id'],'embeddedSegmentNameToId':_0x22ec17};}}return deletePushRecovery(_0x1dab3e[_0x410d05(0x22b)]),{'action':_0x410d05(0x266),'journeyId':_0x1dab3e[_0x410d05(0x1d6)]?.['id'],'embeddedSegmentNameToId':_0x22ec17};}function findSegmentCriteriaLocation(_0x427ae1,_0x50659f){const _0x1cc98c=a169_0x579498,_0x3cb592=_0x427ae1[_0x1cc98c(0x215)]||_0x427ae1['journeys']?.[0x0]?.[_0x1cc98c(0x215)]||[];let _0x580aa2=_0x1cc98c(0x1d3),_0x43399a=_0x50659f;const _0x2388eb=_0x427ae1['goal']||_0x427ae1[_0x1cc98c(0x259)]?.[0x0]?.[_0x1cc98c(0x1e9)];if(_0x2388eb?.['segment']===_0x50659f)return{'stageName':_0x1cc98c(0x1e9),'criteriaName':_0x2388eb[_0x1cc98c(0x1a9)]||_0x50659f};_0x4985fc:for(const _0x552512 of _0x3cb592){if(_0x552512['entry_criteria']?.[_0x1cc98c(0x1da)]===_0x50659f){_0x580aa2=_0x552512[_0x1cc98c(0x1a9)],_0x43399a=_0x552512[_0x1cc98c(0x1d8)][_0x1cc98c(0x1a9)]||_0x50659f;break;}if(_0x552512['steps'])for(const _0x56fca8 of _0x552512[_0x1cc98c(0x171)]){if(_0x56fca8['type']===_0x1cc98c(0x279)&&_0x56fca8['with']?.['branches'])for(const _0x4f5582 of _0x56fca8[_0x1cc98c(0x278)][_0x1cc98c(0x204)]){if(_0x4f5582[_0x1cc98c(0x1da)]===_0x50659f){_0x580aa2=_0x552512['name'],_0x43399a=_0x4f5582[_0x1cc98c(0x1a9)]||_0x50659f;break _0x4985fc;}}}}return{'stageName':_0x580aa2,'criteriaName':_0x43399a};}async function executeThreeStepJourneyCreate(_0x413408,_0x40e67c,_0xdb2dc3,_0x3e547e,_0x12a93f,_0x4df9a0,_0x6854eb,_0x2df33a){const _0x516efa=a169_0x579498,{activationDefToCreateRequest:_0x1e4440,yamlRuleToApi:_0x69b402}=_0x2df33a,{pendingEmbeddedSegments:_0x5b4de1,pendingEmbeddedActivations:_0x2c6f31,embeddedSegmentNameToId:_0x4bc3a9}=_0x3e547e,_0xbda898=JSON[_0x516efa(0x1f8)](JSON[_0x516efa(0x1ae)](_0xdb2dc3));ensureJourneyDefaults(_0xbda898[_0x516efa(0x1ad)]),stripPendingIds(_0xbda898);const _0x3f98cd=await _0x413408[_0x516efa(0x1f3)][_0x516efa(0x25b)](_0xbda898),_0x56abbd=_0x3f98cd['id'],_0x946b64=new Map();for(const _0xabbd4b of _0x3f98cd['attributes']['journeyStages']){_0x946b64[_0x516efa(0x182)](_0xabbd4b[_0x516efa(0x1a9)][_0x516efa(0x280)](),_0xabbd4b['id']);}recoverSegmentIdsFromPushRecovery(_0x40e67c,_0x4bc3a9,_0x4df9a0[_0x516efa(0x1ed)]);for(const [_0x52204c,{definition:_0x58a603}]of _0x5b4de1){if(_0x4bc3a9[_0x516efa(0x20d)](_0x52204c)){_0x6854eb[_0x516efa(0x221)]?.({'type':'embedded_segment_created','journeyName':_0x40e67c['yamlConfig'][_0x516efa(0x1a9)],'segmentName':_0x52204c});continue;}const _0x3a4243=generateDeterministicJourneySegmentName(_0x40e67c[_0x516efa(0x237)][_0x516efa(0x1a9)],_0x52204c);_0x6854eb[_0x516efa(0x221)]?.({'type':_0x516efa(0x23b),'journeyName':_0x40e67c[_0x516efa(0x237)][_0x516efa(0x1a9)],'segmentName':_0x52204c});const _0x587a41=createSegmentIdResolver(_0x4df9a0[_0x516efa(0x1ed)],_0x52204c),_0x5518de=await resolveRuleSegmentIds(_0x58a603['rule'],_0x587a41),_0xf5396c=await createOrRecoverEmbeddedSegment(_0x413408,_0x40e67c,{'localName':_0x52204c,'uniqueSegmentName':_0x3a4243,'description':_0x58a603[_0x516efa(0x1d5)]||_0x516efa(0x1cc)+_0x52204c,'journeyId':_0x56abbd,'resolvedRule':_0x5518de,'parentId':_0x12a93f[_0x516efa(0x268)],'folderId':_0x12a93f[_0x516efa(0x1b4)]||''},_0x69b402);_0x4bc3a9[_0x516efa(0x182)](_0x52204c,_0xf5396c),_0x4df9a0[_0x516efa(0x1ed)][_0x516efa(0x182)](_0x52204c,_0xf5396c),_0x6854eb[_0x516efa(0x221)]?.({'type':'embedded_segment_created','journeyName':_0x40e67c[_0x516efa(0x237)][_0x516efa(0x1a9)],'segmentName':_0x52204c});}const _0x3ddd3a=new Map();for(const [_0x4007c9,_0x199f63]of _0x2c6f31){_0x6854eb[_0x516efa(0x221)]?.({'type':_0x516efa(0x240),'journeyName':_0x40e67c[_0x516efa(0x237)][_0x516efa(0x1a9)],'activationName':_0x4007c9});const _0x2e9c79=await _0x1e4440(_0x199f63,_0x4df9a0[_0x516efa(0x18d)]),_0x478e7d={..._0x2e9c79,..._0x199f63[_0x516efa(0x1c2)]!==undefined&&{'runAfterJourneyRefresh':_0x199f63[_0x516efa(0x1c2)]}},_0x153bf0=await _0x413408[_0x516efa(0x1f3)][_0x516efa(0x1a6)](_0x56abbd,_0x478e7d);_0x3ddd3a[_0x516efa(0x182)](_0x4007c9,_0x153bf0['id']),_0x3e547e[_0x516efa(0x243)][_0x516efa(0x182)](_0x4007c9,_0x153bf0['id']),_0x6854eb[_0x516efa(0x221)]?.({'type':_0x516efa(0x262),'journeyName':_0x40e67c[_0x516efa(0x237)][_0x516efa(0x1a9)],'activationName':_0x4007c9});}const _0x21bdd8=JSON[_0x516efa(0x1f8)](JSON[_0x516efa(0x1ae)](_0xdb2dc3));return _0x21bdd8['id']=_0x56abbd,ensureJourneyDefaults(_0x21bdd8[_0x516efa(0x1ad)]),resolvePendingIdsInRequest(_0x21bdd8,_0xdb2dc3,_0x946b64,_0x4bc3a9,_0x3ddd3a,_0x6854eb),await _0x413408[_0x516efa(0x1f3)]['update'](_0x56abbd,_0x21bdd8),deletePushRecovery(_0x40e67c[_0x516efa(0x22b)]),{'action':'created','journeyId':_0x56abbd,'embeddedSegmentNameToId':_0x4bc3a9};}export function stripWaitStepPendingIds(_0x5cec3e){const _0x2df773=a169_0x579498,_0x4be3=_0x5cec3e[_0x2df773(0x173)]&&isPendingSegmentId(_0x5cec3e[_0x2df773(0x173)]),_0x3fe4b9=_0x5cec3e[_0x2df773(0x242)]?.[_0x2df773(0x216)](_0x239c79=>_0x239c79['segmentId']&&isPendingSegmentId(_0x239c79[_0x2df773(0x1a5)]));(_0x4be3||_0x3fe4b9)&&(_0x5cec3e[_0x2df773(0x1ab)]=_0x2df773(0x1cd),_0x5cec3e[_0x2df773(0x220)]=0x1,_0x5cec3e[_0x2df773(0x209)]=_0x2df773(0x1ee),delete _0x5cec3e['conditionSegmentId'],delete _0x5cec3e[_0x2df773(0x246)],delete _0x5cec3e[_0x2df773(0x17e)],delete _0x5cec3e[_0x2df773(0x242)]);}export function resolveWaitStepPendingIds(_0x3439d1,_0x39127e,_0x546b17,_0x32d2d8){const _0x525525=a169_0x579498;if(_0x39127e[_0x525525(0x173)]&&isPendingSegmentId(_0x39127e[_0x525525(0x173)])){const _0x11fd3c=_0x546b17(_0x39127e['conditionSegmentId'],_0x525525(0x184)+_0x32d2d8+_0x525525(0x21a));_0x11fd3c&&(_0x3439d1[_0x525525(0x1ab)]=_0x525525(0x197),_0x3439d1[_0x525525(0x173)]=_0x11fd3c,delete _0x3439d1[_0x525525(0x220)],delete _0x3439d1[_0x525525(0x209)],_0x39127e[_0x525525(0x246)]!==undefined&&(_0x3439d1['conditionTimeoutDuration']=_0x39127e['conditionTimeoutDuration']),_0x39127e[_0x525525(0x17e)]&&(_0x3439d1['conditionTimeoutUnit']=_0x39127e[_0x525525(0x17e)]));}if(_0x39127e[_0x525525(0x242)]){const _0x31ff9b=_0x39127e[_0x525525(0x242)]['some'](_0x2d031e=>_0x2d031e[_0x525525(0x1a5)]&&isPendingSegmentId(_0x2d031e['segmentId']));if(_0x31ff9b){const _0x2f954=_0x39127e['conditions']['map'](_0x501171=>{const _0xc80f67=_0x525525;if(_0x501171[_0xc80f67(0x1a5)]&&isPendingSegmentId(_0x501171[_0xc80f67(0x1a5)])){const _0x2d6b97=_0x546b17(_0x501171['segmentId'],_0xc80f67(0x184)+_0x32d2d8+_0xc80f67(0x21a));return{..._0x501171,'segmentId':_0x2d6b97||_0x501171['segmentId']};}return{..._0x501171};});_0x3439d1[_0x525525(0x1ab)]=_0x525525(0x197),_0x3439d1[_0x525525(0x242)]=_0x2f954,delete _0x3439d1[_0x525525(0x220)],delete _0x3439d1[_0x525525(0x209)],delete _0x3439d1['conditionSegmentId'],delete _0x3439d1[_0x525525(0x246)],delete _0x3439d1[_0x525525(0x17e)];}}}function stripPendingIds(_0x348cde){const _0x3c6e67=a169_0x579498;_0x348cde[_0x3c6e67(0x1ad)][_0x3c6e67(0x1e9)]?.[_0x3c6e67(0x1a5)]&&isPendingSegmentId(_0x348cde['attributes'][_0x3c6e67(0x1e9)]['segmentId'])&&delete _0x348cde[_0x3c6e67(0x1ad)][_0x3c6e67(0x1e9)];for(const _0x3af51f of _0x348cde[_0x3c6e67(0x1ad)][_0x3c6e67(0x27f)]||[]){_0x3af51f['entryCriteria']?.[_0x3c6e67(0x1a5)]&&isPendingSegmentId(_0x3af51f[_0x3c6e67(0x1d9)][_0x3c6e67(0x1a5)])&&delete _0x3af51f[_0x3c6e67(0x1d9)];_0x3af51f[_0x3c6e67(0x20c)]?.[_0x3c6e67(0x1a5)]&&isPendingSegmentId(_0x3af51f[_0x3c6e67(0x20c)][_0x3c6e67(0x1a5)])&&delete _0x3af51f[_0x3c6e67(0x20c)];_0x3af51f['exitCriterias']&&(_0x3af51f[_0x3c6e67(0x26f)]=_0x3af51f[_0x3c6e67(0x26f)][_0x3c6e67(0x20f)](_0x5aea9a=>!_0x5aea9a['segmentId']||!isPendingSegmentId(_0x5aea9a[_0x3c6e67(0x1a5)])));if(_0x3af51f[_0x3c6e67(0x171)])for(const _0x32787a of Object['keys'](_0x3af51f[_0x3c6e67(0x171)])){const _0x33f1c7=_0x3af51f['steps'][_0x32787a];_0x33f1c7['type']===_0x3c6e67(0x1bf)&&_0x33f1c7[_0x3c6e67(0x254)]&&isPendingActivationId(_0x33f1c7[_0x3c6e67(0x254)])&&(_0x33f1c7[_0x3c6e67(0x254)]='');if(_0x33f1c7['type']===_0x3c6e67(0x244)&&_0x33f1c7[_0x3c6e67(0x204)])for(const _0x3a69b2 of _0x33f1c7[_0x3c6e67(0x204)]){_0x3a69b2[_0x3c6e67(0x1a5)]&&isPendingSegmentId(_0x3a69b2['segmentId'])&&(_0x3a69b2[_0x3c6e67(0x1a5)]='');}_0x33f1c7[_0x3c6e67(0x274)]==='WaitStep'&&stripWaitStepPendingIds(_0x33f1c7);}}}function resolvePendingIdsInRequest(_0x18c6f9,_0x3fc9c4,_0x593b84,_0x16ec21,_0x41f01b,_0x248716){const _0x36a5c1=a169_0x579498,_0x2aa5aa=(_0xe6942a,_0x46ce2f)=>{const _0x163fc4=a169_0x5e1a;if(!isPendingSegmentId(_0xe6942a))return _0xe6942a;const _0xf9f9fd=extractPendingSegmentName(_0xe6942a),_0x2261bb=_0x16ec21[_0x163fc4(0x250)](_0xf9f9fd);return!_0x2261bb&&_0x248716[_0x163fc4(0x1c6)]?.(_0x163fc4(0x1a2)+_0xf9f9fd+_0x163fc4(0x1d2)+_0x46ce2f),_0x2261bb;};if(_0x18c6f9[_0x36a5c1(0x1ad)][_0x36a5c1(0x1e9)]?.[_0x36a5c1(0x1a5)]&&isPendingSegmentId(_0x18c6f9['attributes'][_0x36a5c1(0x1e9)]['segmentId'])){const _0xde904c=_0x2aa5aa(_0x18c6f9[_0x36a5c1(0x1ad)][_0x36a5c1(0x1e9)][_0x36a5c1(0x1a5)],_0x36a5c1(0x227));_0xde904c&&(_0x18c6f9[_0x36a5c1(0x1ad)][_0x36a5c1(0x1e9)][_0x36a5c1(0x1a5)]=_0xde904c);}for(const _0x3ff8ed of _0x18c6f9[_0x36a5c1(0x1ad)][_0x36a5c1(0x27f)]||[]){const _0xb654a0=_0x593b84['get'](_0x3ff8ed[_0x36a5c1(0x1a9)][_0x36a5c1(0x280)]());_0xb654a0&&(_0x3ff8ed['id']=_0xb654a0);if(_0x3ff8ed[_0x36a5c1(0x1d9)]?.['segmentId']&&isPendingSegmentId(_0x3ff8ed['entryCriteria']['segmentId'])){const _0x498f3a=_0x2aa5aa(_0x3ff8ed['entryCriteria'][_0x36a5c1(0x1a5)],_0x36a5c1(0x184)+_0x3ff8ed[_0x36a5c1(0x1a9)]+'\x27\x20entry\x20criteria');_0x498f3a&&(_0x3ff8ed['entryCriteria']['segmentId']=_0x498f3a);}if(_0x3ff8ed[_0x36a5c1(0x26f)])for(const _0x510922 of _0x3ff8ed[_0x36a5c1(0x26f)]){if(_0x510922[_0x36a5c1(0x1a5)]&&isPendingSegmentId(_0x510922[_0x36a5c1(0x1a5)])){const _0x30d7e3=_0x2aa5aa(_0x510922[_0x36a5c1(0x1a5)],'stage\x20\x27'+_0x3ff8ed[_0x36a5c1(0x1a9)]+_0x36a5c1(0x1a7));_0x30d7e3&&(_0x510922[_0x36a5c1(0x1a5)]=_0x30d7e3);}}if(_0x3ff8ed[_0x36a5c1(0x20c)]?.[_0x36a5c1(0x1a5)]&&isPendingSegmentId(_0x3ff8ed['milestone'][_0x36a5c1(0x1a5)])){const _0x517196=_0x2aa5aa(_0x3ff8ed['milestone'][_0x36a5c1(0x1a5)],_0x36a5c1(0x184)+_0x3ff8ed[_0x36a5c1(0x1a9)]+_0x36a5c1(0x263));_0x517196&&(_0x3ff8ed[_0x36a5c1(0x20c)][_0x36a5c1(0x1a5)]=_0x517196);}if(_0x3ff8ed[_0x36a5c1(0x171)]){const _0x95906f=_0x54e3d3=>_0x3fc9c4['attributes'][_0x36a5c1(0x27f)]?.[_0x36a5c1(0x1e7)](_0x4bef57=>_0x4bef57[_0x36a5c1(0x1a9)]['toLowerCase']()===_0x3ff8ed[_0x36a5c1(0x1a9)]['toLowerCase']())?.[_0x36a5c1(0x171)]?.[_0x54e3d3];for(const _0x130951 of Object[_0x36a5c1(0x25f)](_0x3ff8ed['steps'])){const _0x4f1f27=_0x3ff8ed[_0x36a5c1(0x171)][_0x130951],_0x7d6cd6=_0x95906f(_0x130951);if(_0x4f1f27[_0x36a5c1(0x274)]===_0x36a5c1(0x1bf)&&_0x4f1f27['journeyActivationStepId']&&(isPendingActivationId(_0x4f1f27[_0x36a5c1(0x254)])||_0x4f1f27[_0x36a5c1(0x254)]==='')){if(_0x7d6cd6?.[_0x36a5c1(0x254)]&&isPendingActivationId(_0x7d6cd6[_0x36a5c1(0x254)])){const _0x320771=extractPendingActivationName(_0x7d6cd6[_0x36a5c1(0x254)]),_0x40eb8b=_0x41f01b[_0x36a5c1(0x250)](_0x320771);_0x40eb8b&&(_0x4f1f27[_0x36a5c1(0x254)]=_0x40eb8b);}}if(_0x4f1f27[_0x36a5c1(0x274)]===_0x36a5c1(0x244)&&_0x4f1f27[_0x36a5c1(0x204)]&&_0x7d6cd6?.[_0x36a5c1(0x204)])for(let _0x6df25b=0x0;_0x6df25b<_0x4f1f27['branches'][_0x36a5c1(0x20b)];_0x6df25b++){const _0x5a5bce=_0x4f1f27[_0x36a5c1(0x204)][_0x6df25b],_0x323973=_0x7d6cd6[_0x36a5c1(0x204)][_0x6df25b];if(_0x323973?.[_0x36a5c1(0x1a5)]&&isPendingSegmentId(_0x323973[_0x36a5c1(0x1a5)])){const _0x53148d=_0x2aa5aa(_0x323973['segmentId'],_0x36a5c1(0x184)+_0x3ff8ed[_0x36a5c1(0x1a9)]+_0x36a5c1(0x257)+(_0x5a5bce['name']||_0x6df25b)+'\x27');_0x53148d&&(_0x5a5bce[_0x36a5c1(0x1a5)]=_0x53148d);}}_0x4f1f27[_0x36a5c1(0x274)]===_0x36a5c1(0x1eb)&&_0x7d6cd6?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0x4f1f27,_0x7d6cd6,_0x2aa5aa,_0x3ff8ed['name']);}}}}
@@ -1 +1 @@
1
- function a170_0x5db3(){const _0x27e618=['2362086vBnpno','name','4876Qarbkv','554596lQtaFZ','get','set','624DYPlcU','128733opreiI','573XbfSrU','has','6RsnIEM','15252TahKxn','88590mlkFkV','70620LiMFks','4xoWTjI','24GhhHrV','150SoySkJ','add','parentFolderId'];a170_0x5db3=function(){return _0x27e618;};return a170_0x5db3();}(function(_0x43129d,_0x1914e6){const _0x28fdc6=a170_0x1a3a,_0x341e56=_0x43129d();while(!![]){try{const _0x425c00=-parseInt(_0x28fdc6(0x1a3))/0x1*(parseInt(_0x28fdc6(0x1a1))/0x2)+-parseInt(_0x28fdc6(0x19d))/0x3*(-parseInt(_0x28fdc6(0x1aa))/0x4)+parseInt(_0x28fdc6(0x1a2))/0x5*(parseInt(_0x28fdc6(0x19f))/0x6)+parseInt(_0x28fdc6(0x1ab))/0x7*(parseInt(_0x28fdc6(0x1a4))/0x8)+-parseInt(_0x28fdc6(0x1a8))/0x9+parseInt(_0x28fdc6(0x1a5))/0xa*(parseInt(_0x28fdc6(0x19c))/0xb)+-parseInt(_0x28fdc6(0x1a0))/0xc*(parseInt(_0x28fdc6(0x1ae))/0xd);if(_0x425c00===_0x1914e6)break;else _0x341e56['push'](_0x341e56['shift']());}catch(_0x45bc9c){_0x341e56['push'](_0x341e56['shift']());}}}(a170_0x5db3,0x26f34));export function buildFolderIdToPathMap(_0x26a7a2){const _0x387eab=a170_0x1a3a,_0x436f99=new Map(),_0x5dd81e=new Map();for(const _0x16f8a6 of _0x26a7a2){_0x5dd81e[_0x387eab(0x1ad)](_0x16f8a6['id'],_0x16f8a6);}const _0x36c588=new Set();for(const _0x17fbb4 of _0x26a7a2){!_0x17fbb4[_0x387eab(0x1a7)]&&_0x36c588['add'](_0x17fbb4['id']);}function _0xe1c30a(_0x47c05f){const _0x45df67=_0x387eab;if(_0x436f99[_0x45df67(0x19e)](_0x47c05f['id']))return _0x436f99[_0x45df67(0x1ac)](_0x47c05f['id']);if(_0x36c588['has'](_0x47c05f['id']))return _0x436f99[_0x45df67(0x1ad)](_0x47c05f['id'],''),'';if(_0x47c05f['parentFolderId']){const _0x3e4d06=_0x5dd81e[_0x45df67(0x1ac)](_0x47c05f[_0x45df67(0x1a7)]);if(_0x3e4d06){const _0xd8e5cf=_0xe1c30a(_0x3e4d06),_0x14f83c=_0xd8e5cf?_0xd8e5cf+'/'+_0x47c05f[_0x45df67(0x1a9)]:_0x47c05f[_0x45df67(0x1a9)];return _0x436f99['set'](_0x47c05f['id'],_0x14f83c),_0x14f83c;}}const _0x1879d0=_0x47c05f[_0x45df67(0x1a9)];return _0x436f99['set'](_0x47c05f['id'],_0x1879d0),_0x1879d0;}for(const _0x11fdfd of _0x26a7a2){_0xe1c30a(_0x11fdfd);}return _0x436f99;}export function buildFolderPathToIdMap(_0x57dece){const _0x576ba7=a170_0x1a3a,_0x41a6a9=new Map(),_0x44a425=new Map();for(const _0x5d3208 of _0x57dece){_0x44a425[_0x576ba7(0x1ad)](_0x5d3208['id'],_0x5d3208);}const _0x325f69=new Set();for(const _0x2d2b9c of _0x57dece){!_0x2d2b9c[_0x576ba7(0x1a7)]&&_0x325f69[_0x576ba7(0x1a6)](_0x2d2b9c['id']);}function _0x5c271a(_0x3a2dc3){const _0x18c8eb=_0x576ba7;if(_0x325f69[_0x18c8eb(0x19e)](_0x3a2dc3['id']))return'';if(_0x3a2dc3[_0x18c8eb(0x1a7)]){const _0x9d83ae=_0x44a425[_0x18c8eb(0x1ac)](_0x3a2dc3['parentFolderId']);if(_0x9d83ae){const _0x4a7c80=_0x5c271a(_0x9d83ae);return _0x4a7c80?_0x4a7c80+'/'+_0x3a2dc3[_0x18c8eb(0x1a9)]:_0x3a2dc3[_0x18c8eb(0x1a9)];}}return _0x3a2dc3[_0x18c8eb(0x1a9)];}for(const _0x2384d8 of _0x57dece){const _0x3bc68b=_0x5c271a(_0x2384d8);_0x41a6a9[_0x576ba7(0x1ad)](_0x3bc68b,_0x2384d8['id']);}return _0x41a6a9;}function a170_0x1a3a(_0x115536,_0x5161dd){_0x115536=_0x115536-0x19c;const _0x5db382=a170_0x5db3();let _0x1a3a30=_0x5db382[_0x115536];return _0x1a3a30;}export function buildFolderMaps(_0x1df256){const _0x35e803=a170_0x1a3a,_0x823460=buildFolderIdToPathMap(_0x1df256),_0x497cc=new Map();for(const [_0x162d8e,_0x32de30]of _0x823460){_0x497cc[_0x35e803(0x1ad)](_0x32de30,_0x162d8e);}return{'idToPath':_0x823460,'pathToId':_0x497cc};}export function getFolderPath(_0x4c6eb5,_0x3535cb){const _0x2dc14a=a170_0x1a3a;if(!_0x4c6eb5)return'';return _0x3535cb[_0x2dc14a(0x1ac)](_0x4c6eb5)??'';}
1
+ function a170_0x4fbd(_0x386d93,_0x2c4302){_0x386d93=_0x386d93-0xe2;const _0x1869c7=a170_0x1869();let _0x4fbd05=_0x1869c7[_0x386d93];return _0x4fbd05;}function a170_0x1869(){const _0x37eab1=['80hmwfug','2531370FKbGIw','4ixYwPm','194513YyMqRR','1065420AXNVID','373035qoSGMz','name','1660437tRplZi','has','12774aNwzeQ','4095364YsWtgq','parentFolderId','77QQykBe','8EYofcE','get','add','set'];a170_0x1869=function(){return _0x37eab1;};return a170_0x1869();}(function(_0xfd57a6,_0x3bc57c){const _0x3e21a0=a170_0x4fbd,_0x484917=_0xfd57a6();while(!![]){try{const _0xea0ad5=-parseInt(_0x3e21a0(0xec))/0x1*(-parseInt(_0x3e21a0(0xe9))/0x2)+parseInt(_0x3e21a0(0xe5))/0x3*(parseInt(_0x3e21a0(0xe2))/0x4)+parseInt(_0x3e21a0(0xf2))/0x5+parseInt(_0x3e21a0(0xe4))/0x6+-parseInt(_0x3e21a0(0xea))/0x7+-parseInt(_0x3e21a0(0xed))/0x8*(parseInt(_0x3e21a0(0xe7))/0x9)+parseInt(_0x3e21a0(0xf1))/0xa*(-parseInt(_0x3e21a0(0xe3))/0xb);if(_0xea0ad5===_0x3bc57c)break;else _0x484917['push'](_0x484917['shift']());}catch(_0x1a0243){_0x484917['push'](_0x484917['shift']());}}}(a170_0x1869,0x5ef73));export function buildFolderIdToPathMap(_0x5314ab){const _0x5adf76=a170_0x4fbd,_0xe0fac3=new Map(),_0x11c1d6=new Map();for(const _0x2cbb8e of _0x5314ab){_0x11c1d6['set'](_0x2cbb8e['id'],_0x2cbb8e);}const _0x4bfa23=new Set();for(const _0x12b035 of _0x5314ab){!_0x12b035[_0x5adf76(0xeb)]&&_0x4bfa23[_0x5adf76(0xef)](_0x12b035['id']);}function _0x4a3ef2(_0x505f00){const _0x3c216f=_0x5adf76;if(_0xe0fac3[_0x3c216f(0xe8)](_0x505f00['id']))return _0xe0fac3[_0x3c216f(0xee)](_0x505f00['id']);if(_0x4bfa23[_0x3c216f(0xe8)](_0x505f00['id']))return _0xe0fac3[_0x3c216f(0xf0)](_0x505f00['id'],''),'';if(_0x505f00[_0x3c216f(0xeb)]){const _0x9208bd=_0x11c1d6[_0x3c216f(0xee)](_0x505f00[_0x3c216f(0xeb)]);if(_0x9208bd){const _0x4fc530=_0x4a3ef2(_0x9208bd),_0x5d9fe2=_0x4fc530?_0x4fc530+'/'+_0x505f00[_0x3c216f(0xe6)]:_0x505f00[_0x3c216f(0xe6)];return _0xe0fac3[_0x3c216f(0xf0)](_0x505f00['id'],_0x5d9fe2),_0x5d9fe2;}}const _0x10ebbe=_0x505f00[_0x3c216f(0xe6)];return _0xe0fac3[_0x3c216f(0xf0)](_0x505f00['id'],_0x10ebbe),_0x10ebbe;}for(const _0x1daf32 of _0x5314ab){_0x4a3ef2(_0x1daf32);}return _0xe0fac3;}export function buildFolderPathToIdMap(_0x20842b){const _0x1f236b=a170_0x4fbd,_0x1cc84a=new Map(),_0x2dd86f=new Map();for(const _0xf87adb of _0x20842b){_0x2dd86f[_0x1f236b(0xf0)](_0xf87adb['id'],_0xf87adb);}const _0x450cbb=new Set();for(const _0x38352d of _0x20842b){!_0x38352d[_0x1f236b(0xeb)]&&_0x450cbb[_0x1f236b(0xef)](_0x38352d['id']);}function _0x22549e(_0x9cbb3b){const _0x4f5833=_0x1f236b;if(_0x450cbb[_0x4f5833(0xe8)](_0x9cbb3b['id']))return'';if(_0x9cbb3b[_0x4f5833(0xeb)]){const _0x3e7f52=_0x2dd86f[_0x4f5833(0xee)](_0x9cbb3b['parentFolderId']);if(_0x3e7f52){const _0x167bb9=_0x22549e(_0x3e7f52);return _0x167bb9?_0x167bb9+'/'+_0x9cbb3b[_0x4f5833(0xe6)]:_0x9cbb3b[_0x4f5833(0xe6)];}}return _0x9cbb3b[_0x4f5833(0xe6)];}for(const _0x408240 of _0x20842b){const _0x1b4ff6=_0x22549e(_0x408240);_0x1cc84a[_0x1f236b(0xf0)](_0x1b4ff6,_0x408240['id']);}return _0x1cc84a;}export function buildFolderMaps(_0x3cd6e1){const _0x2823e4=a170_0x4fbd,_0x5616dc=buildFolderIdToPathMap(_0x3cd6e1),_0x5acf03=new Map();for(const [_0x18c7dd,_0x2886be]of _0x5616dc){_0x5acf03[_0x2823e4(0xf0)](_0x2886be,_0x18c7dd);}return{'idToPath':_0x5616dc,'pathToId':_0x5acf03};}export function getFolderPath(_0xc7f3d4,_0x50c0f8){if(!_0xc7f3d4)return'';return _0x50c0f8['get'](_0xc7f3d4)??'';}
@@ -1 +1 @@
1
- (function(_0x573b51,_0x1880f5){const _0x239748=a171_0x2be2,_0x56fb56=_0x573b51();while(!![]){try{const _0x4c535e=parseInt(_0x239748(0x1db))/0x1*(parseInt(_0x239748(0x1f4))/0x2)+-parseInt(_0x239748(0x1e5))/0x3+-parseInt(_0x239748(0x1ea))/0x4+-parseInt(_0x239748(0x1d3))/0x5+parseInt(_0x239748(0x1dc))/0x6+-parseInt(_0x239748(0x1e1))/0x7+parseInt(_0x239748(0x1f7))/0x8*(parseInt(_0x239748(0x1fb))/0x9);if(_0x4c535e===_0x1880f5)break;else _0x56fb56['push'](_0x56fb56['shift']());}catch(_0x265039){_0x56fb56['push'](_0x56fb56['shift']());}}}(a171_0x30ab,0x7a48e));import a171_0x2ec83f from'path';import{parse as a171_0x3663e5}from'yaml';function a171_0x2be2(_0x1c66c9,_0x2b8f54){_0x1c66c9=_0x1c66c9-0x1cd;const _0x30ab01=a171_0x30ab();let _0x2be2ac=_0x30ab01[_0x1c66c9];return _0x2be2ac;}import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x103a12){const _0x332b2a=a171_0x2be2;if(!_0x103a12||_0x103a12[_0x332b2a(0x1f8)]()==='')throw new Error(_0x332b2a(0x1fa));const _0xfab9a1=_0x103a12[_0x332b2a(0x1f8)]();if(_0xfab9a1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x103a12};const _0x3cc320=_0xfab9a1['startsWith']('/')?_0xfab9a1[_0x332b2a(0x1e2)](0x1):_0xfab9a1,_0x278c49=_0x3cc320[_0x332b2a(0x1e9)]('/')[_0x332b2a(0x1da)](_0x3c9dee=>_0x3c9dee!=='');if(_0x278c49['length']===0x0)throw new Error(_0x332b2a(0x1ee));const _0x154e56=_0xfab9a1['startsWith']('/')||!isRelativePathSegment(_0x278c49[0x0]);for(const _0x5cc95a of _0x278c49){validatePathSegment(_0x5cc95a);}return{'segments':_0x278c49,'isAbsolute':_0x154e56,'raw':_0x103a12};}function isRelativePathSegment(_0x58dcaa){return _0x58dcaa==='.'||_0x58dcaa==='..';}function a171_0x30ab(){const _0x4f1a2c=['length','segments','relative','readFile','2614975lUBcqX','test','parse','parent_segment','Relative\x20path\x20cannot\x20be\x20empty','slice','Path\x20attempts\x20to\x20navigate\x20above\x20root','filter','436969QAlCnb','3522972lgYDUI','dirname','replace','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','startsWith','4607197FNYUrN','substring','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','segment','1630023DWzQwj','Cannot\x20navigate\x20above\x20root','File\x20not\x20found:\x20','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','split','2476704ejajMp','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Cannot\x20split\x20empty\x20path','exists','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Path\x20segment\x20cannot\x20be\x20empty','isAbsolute','push','No\x20tdx.json\x20found\x20for\x20file:\x20','raw','2FYJewB','join','resolve','40680UhhjWu','trim','pop','Path\x20cannot\x20be\x20empty','3222jiwUnX','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','name'];a171_0x30ab=function(){return _0x4f1a2c;};return a171_0x30ab();}function validatePathSegment(_0x58f417){const _0x5acb80=a171_0x2be2;if(_0x58f417==='')throw new Error(_0x5acb80(0x1ef));if(_0x58f417==='.'||_0x58f417==='..')return;if(/[\x00-\x1F\x7F]/[_0x5acb80(0x1d4)](_0x58f417))throw new Error(_0x5acb80(0x1df)+_0x58f417);if(_0x58f417!==_0x58f417['trim']()){}}export function validatePath(_0x31f468){const _0x26ce69=a171_0x2be2;if(_0x31f468[_0x26ce69(0x1d0)][_0x26ce69(0x1cf)]===0x0&&!_0x31f468[_0x26ce69(0x1f0)])throw new Error(_0x26ce69(0x1d7));if(_0x31f468[_0x26ce69(0x1f0)]){if(_0x31f468[_0x26ce69(0x1d0)][0x0]==='..')throw new Error(_0x26ce69(0x1e3));let _0x515ca4=0x0;for(const _0x409db4 of _0x31f468['segments']){if(_0x409db4==='..'){if(_0x515ca4===0x0)throw new Error(_0x26ce69(0x1d9));_0x515ca4--;}else _0x409db4!=='.'&&_0x515ca4++;}}}export function joinPaths(_0x4706a2,_0x57d891){const _0x52987a=a171_0x2be2;if(!_0x4706a2||_0x4706a2==='/')return _0x57d891;if(!_0x57d891||_0x57d891==='.')return _0x4706a2;if(_0x57d891[_0x52987a(0x1e0)]('/'))return _0x57d891;const _0x3ca2ce=parsePath(_0x4706a2),_0x11641b=parsePath(_0x57d891),_0x3e79af=[..._0x3ca2ce[_0x52987a(0x1d0)]];for(const _0x401420 of _0x11641b[_0x52987a(0x1d0)]){if(_0x401420==='.')continue;else{if(_0x401420==='..'){if(_0x3e79af['length']===0x0)throw new Error(_0x52987a(0x1e6));_0x3e79af[_0x52987a(0x1f9)]();}else _0x3e79af[_0x52987a(0x1f1)](_0x401420);}}const _0x36e554=_0x3e79af['join']('/');return _0x3ca2ce[_0x52987a(0x1f3)][_0x52987a(0x1e0)]('/')?'/'+_0x36e554:_0x36e554;}export function normalizePath(_0xe05ffa){const _0x28e0b8=a171_0x2be2,_0x3e69ba=parsePath(_0xe05ffa),_0x5c2bfb=[];for(const _0x5c6cc9 of _0x3e69ba[_0x28e0b8(0x1d0)]){if(_0x5c6cc9==='.')continue;else{if(_0x5c6cc9==='..'){if(_0x5c2bfb[_0x28e0b8(0x1cf)]===0x0){if(_0x3e69ba[_0x28e0b8(0x1f0)])throw new Error(_0x28e0b8(0x1e6));_0x5c2bfb[_0x28e0b8(0x1f1)]('..');}else _0x5c2bfb[_0x5c2bfb[_0x28e0b8(0x1cf)]-0x1]==='..'?_0x5c2bfb['push']('..'):_0x5c2bfb[_0x28e0b8(0x1f9)]();}else _0x5c2bfb[_0x28e0b8(0x1f1)](_0x5c6cc9);}}if(_0x5c2bfb['length']===0x0)return _0x3e69ba[_0x28e0b8(0x1f0)]?'/':'.';const _0x29dd0d=_0x5c2bfb['join']('/');return _0x3e69ba[_0x28e0b8(0x1f3)][_0x28e0b8(0x1e0)]('/')?'/'+_0x29dd0d:_0x29dd0d;}export function getParentPath(_0x249f7d){const _0x7925f2=a171_0x2be2,_0x1493dc=parsePath(_0x249f7d);if(_0x1493dc[_0x7925f2(0x1d0)][_0x7925f2(0x1cf)]<=0x1)return'/';const _0x5e7f12=_0x1493dc[_0x7925f2(0x1d0)]['slice'](0x0,-0x1)[_0x7925f2(0x1f5)]('/');return _0x1493dc[_0x7925f2(0x1f3)][_0x7925f2(0x1e0)]('/')?'/'+_0x5e7f12:_0x5e7f12;}export function getBaseName(_0x238f58){const _0x2f7f1e=a171_0x2be2,_0x1d4e59=parsePath(_0x238f58);return _0x1d4e59[_0x2f7f1e(0x1d0)][_0x1d4e59[_0x2f7f1e(0x1d0)]['length']-0x1]||'';}export function isChildPath(_0x8e6ef4,_0x1dd0d6){const _0x4d9956=a171_0x2be2,_0x4e8e8b=parsePath(_0x8e6ef4),_0x2aa69e=parsePath(_0x1dd0d6);if(_0x4e8e8b[_0x4d9956(0x1d0)]['length']<=_0x2aa69e[_0x4d9956(0x1d0)][_0x4d9956(0x1cf)])return![];for(let _0x4ace51=0x0;_0x4ace51<_0x2aa69e[_0x4d9956(0x1d0)]['length'];_0x4ace51++){if(_0x4e8e8b[_0x4d9956(0x1d0)][_0x4ace51]!==_0x2aa69e[_0x4d9956(0x1d0)][_0x4ace51])return![];}return!![];}export function splitPath(_0x5548c0){const _0x3899aa=a171_0x2be2,_0x237852=parsePath(_0x5548c0);if(_0x237852[_0x3899aa(0x1d0)][_0x3899aa(0x1cf)]===0x0)throw new Error(_0x3899aa(0x1ec));if(_0x237852[_0x3899aa(0x1d0)]['length']===0x1)return{'parent':_0x237852['segments'][0x0]};return{'parent':_0x237852['segments'][0x0],'child':_0x237852['segments'][_0x3899aa(0x1d8)](0x1)[_0x3899aa(0x1f5)]('/')};}export function isYamlFilePath(_0x1e7585){return _0x1e7585['endsWith']('.yml')||_0x1e7585['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x473979,_0x53fef1=nodeFileSystem){const _0x33b4b3=a171_0x2be2,_0x29c04f=a171_0x2ec83f[_0x33b4b3(0x1f6)](_0x473979);if(!await _0x53fef1['exists'](_0x29c04f))throw new Error(_0x33b4b3(0x1e7)+_0x473979);let _0x199637=a171_0x2ec83f['dirname'](_0x29c04f),_0x31f65d=null,_0xedcf66=null;const _0x29dd4e=a171_0x2ec83f[_0x33b4b3(0x1d5)](_0x199637)['root'];while(_0x199637!==_0x29dd4e){const _0x2f0f0d=a171_0x2ec83f[_0x33b4b3(0x1f5)](_0x199637,'tdx.json');if(await _0x53fef1[_0x33b4b3(0x1ed)](_0x2f0f0d)){_0x31f65d=_0x2f0f0d,_0xedcf66=_0x199637;break;}_0x199637=a171_0x2ec83f[_0x33b4b3(0x1dd)](_0x199637);}if(!_0x31f65d||!_0xedcf66)throw new Error(_0x33b4b3(0x1f2)+_0x473979+'\x0a'+_0x33b4b3(0x1e8));const _0x36a7ac=await _0x53fef1['readFile'](_0x31f65d),_0x6d0572=JSON[_0x33b4b3(0x1d5)](_0x36a7ac),_0x308ed3=_0x6d0572[_0x33b4b3(0x1d6)];if(!_0x308ed3)throw new Error(_0x33b4b3(0x1cd));const _0x2dec8=await _0x53fef1[_0x33b4b3(0x1d2)](_0x29c04f),_0x143f05=a171_0x3663e5(_0x2dec8),_0x5f0e91=_0x143f05[_0x33b4b3(0x1ce)];if(!_0x5f0e91)throw new Error(_0x33b4b3(0x1eb)+_0x473979);const _0x543ce8=isJourneyDef(_0x143f05,_0x29c04f)?'journey':_0x33b4b3(0x1e4),_0x4c2253=a171_0x2ec83f[_0x33b4b3(0x1d1)](_0xedcf66,_0x29c04f),_0x516138=a171_0x2ec83f[_0x33b4b3(0x1dd)](_0x4c2253),_0x430789=_0x516138==='.'?'':_0x516138[_0x33b4b3(0x1de)](/\\/g,'/'),_0x1e8cb3=_0x430789?_0x308ed3+'/'+_0x430789+'/'+_0x5f0e91:_0x308ed3+'/'+_0x5f0e91;return{'parentSegment':_0x308ed3,'segmentName':_0x5f0e91,'folderPath':_0x430789,'fullPath':_0x1e8cb3,'resourceType':_0x543ce8,'content':_0x2dec8};}
1
+ (function(_0x1e7dbd,_0x5c6b16){const _0x648c9c=a171_0x49f0,_0x576351=_0x1e7dbd();while(!![]){try{const _0x37e23a=-parseInt(_0x648c9c(0x115))/0x1*(parseInt(_0x648c9c(0x116))/0x2)+-parseInt(_0x648c9c(0x120))/0x3*(-parseInt(_0x648c9c(0xfc))/0x4)+-parseInt(_0x648c9c(0x105))/0x5*(-parseInt(_0x648c9c(0x10c))/0x6)+-parseInt(_0x648c9c(0x100))/0x7+-parseInt(_0x648c9c(0x114))/0x8*(-parseInt(_0x648c9c(0x125))/0x9)+parseInt(_0x648c9c(0x122))/0xa*(parseInt(_0x648c9c(0x128))/0xb)+-parseInt(_0x648c9c(0x118))/0xc;if(_0x37e23a===_0x5c6b16)break;else _0x576351['push'](_0x576351['shift']());}catch(_0x1fd823){_0x576351['push'](_0x576351['shift']());}}}(a171_0x4097,0xa11f5));import a171_0x32ba0c from'path';import{parse as a171_0x580c97}from'yaml';function a171_0x4097(){const _0x403701=['Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','52TwRmXP','parent_segment','join','push','1953826QTsisz','filter','.yaml','exists','Cannot\x20split\x20empty\x20path','5xDvkeM','segments','test','readFile','substring','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','5826426ZOtoGK','raw','journey','root','trim','Cannot\x20navigate\x20above\x20root','name','slice','362968YIoMgt','3BJosDl','282614dDxbVl','startsWith','31515468lKHcfc','resolve','Relative\x20path\x20cannot\x20be\x20empty','No\x20tdx.json\x20found\x20for\x20file:\x20','dirname','segment','isAbsolute','parse','302418nKRoAB','length','10IYbADP','pop','File\x20not\x20found:\x20','135AlftFZ','tdx.json','replace','11298881kdvhwb','endsWith','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'];a171_0x4097=function(){return _0x403701;};return a171_0x4097();}import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x26e1b6){const _0x2feb0a=a171_0x49f0;if(!_0x26e1b6||_0x26e1b6[_0x2feb0a(0x110)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x9305de=_0x26e1b6[_0x2feb0a(0x110)]();if(_0x9305de==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x26e1b6};const _0x1d0175=_0x9305de['startsWith']('/')?_0x9305de[_0x2feb0a(0x109)](0x1):_0x9305de,_0x3b1b3a=_0x1d0175['split']('/')[_0x2feb0a(0x101)](_0x5a003b=>_0x5a003b!=='');if(_0x3b1b3a[_0x2feb0a(0x121)]===0x0)throw new Error(_0x2feb0a(0x12a));const _0x5e1d01=_0x9305de['startsWith']('/')||!isRelativePathSegment(_0x3b1b3a[0x0]);for(const _0x40f1ea of _0x3b1b3a){validatePathSegment(_0x40f1ea);}return{'segments':_0x3b1b3a,'isAbsolute':_0x5e1d01,'raw':_0x26e1b6};}function isRelativePathSegment(_0xf4dbc5){return _0xf4dbc5==='.'||_0xf4dbc5==='..';}function validatePathSegment(_0x901208){const _0x748aaa=a171_0x49f0;if(_0x901208==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x901208==='.'||_0x901208==='..')return;if(/[\x00-\x1F\x7F]/[_0x748aaa(0x107)](_0x901208))throw new Error(_0x748aaa(0x12b)+_0x901208);if(_0x901208!==_0x901208['trim']()){}}export function validatePath(_0x4b7581){const _0x10b2c3=a171_0x49f0;if(_0x4b7581[_0x10b2c3(0x106)][_0x10b2c3(0x121)]===0x0&&!_0x4b7581[_0x10b2c3(0x11e)])throw new Error(_0x10b2c3(0x11a));if(_0x4b7581[_0x10b2c3(0x11e)]){if(_0x4b7581[_0x10b2c3(0x106)][0x0]==='..')throw new Error(_0x10b2c3(0x10b));let _0x567797=0x0;for(const _0x5762f of _0x4b7581['segments']){if(_0x5762f==='..'){if(_0x567797===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x567797--;}else _0x5762f!=='.'&&_0x567797++;}}}function a171_0x49f0(_0x119781,_0x1153ec){_0x119781=_0x119781-0xfb;const _0x4097da=a171_0x4097();let _0x49f0fb=_0x4097da[_0x119781];return _0x49f0fb;}export function joinPaths(_0x55c2e3,_0x1f3b22){const _0x1887d4=a171_0x49f0;if(!_0x55c2e3||_0x55c2e3==='/')return _0x1f3b22;if(!_0x1f3b22||_0x1f3b22==='.')return _0x55c2e3;if(_0x1f3b22['startsWith']('/'))return _0x1f3b22;const _0x350278=parsePath(_0x55c2e3),_0x413509=parsePath(_0x1f3b22),_0x550c82=[..._0x350278['segments']];for(const _0x5c2dbc of _0x413509['segments']){if(_0x5c2dbc==='.')continue;else{if(_0x5c2dbc==='..'){if(_0x550c82[_0x1887d4(0x121)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x550c82[_0x1887d4(0x123)]();}else _0x550c82[_0x1887d4(0xff)](_0x5c2dbc);}}const _0x575c2a=_0x550c82[_0x1887d4(0xfe)]('/');return _0x350278[_0x1887d4(0x10d)]['startsWith']('/')?'/'+_0x575c2a:_0x575c2a;}export function normalizePath(_0x37fa92){const _0x1a9b68=a171_0x49f0,_0x1fbd14=parsePath(_0x37fa92),_0x47f874=[];for(const _0x343f3d of _0x1fbd14[_0x1a9b68(0x106)]){if(_0x343f3d==='.')continue;else{if(_0x343f3d==='..'){if(_0x47f874['length']===0x0){if(_0x1fbd14['isAbsolute'])throw new Error(_0x1a9b68(0x111));_0x47f874[_0x1a9b68(0xff)]('..');}else _0x47f874[_0x47f874[_0x1a9b68(0x121)]-0x1]==='..'?_0x47f874[_0x1a9b68(0xff)]('..'):_0x47f874[_0x1a9b68(0x123)]();}else _0x47f874[_0x1a9b68(0xff)](_0x343f3d);}}if(_0x47f874[_0x1a9b68(0x121)]===0x0)return _0x1fbd14[_0x1a9b68(0x11e)]?'/':'.';const _0x2b5186=_0x47f874['join']('/');return _0x1fbd14[_0x1a9b68(0x10d)][_0x1a9b68(0x117)]('/')?'/'+_0x2b5186:_0x2b5186;}export function getParentPath(_0x2148dc){const _0x10b38c=a171_0x49f0,_0x2ec398=parsePath(_0x2148dc);if(_0x2ec398[_0x10b38c(0x106)]['length']<=0x1)return'/';const _0x7c1511=_0x2ec398['segments'][_0x10b38c(0x113)](0x0,-0x1)['join']('/');return _0x2ec398[_0x10b38c(0x10d)]['startsWith']('/')?'/'+_0x7c1511:_0x7c1511;}export function getBaseName(_0x5bd9d0){const _0x287a20=a171_0x49f0,_0x49f9f2=parsePath(_0x5bd9d0);return _0x49f9f2[_0x287a20(0x106)][_0x49f9f2[_0x287a20(0x106)][_0x287a20(0x121)]-0x1]||'';}export function isChildPath(_0xb470e2,_0x16c620){const _0x409d3e=a171_0x49f0,_0x4fdb40=parsePath(_0xb470e2),_0x39650f=parsePath(_0x16c620);if(_0x4fdb40[_0x409d3e(0x106)]['length']<=_0x39650f[_0x409d3e(0x106)][_0x409d3e(0x121)])return![];for(let _0x1d7450=0x0;_0x1d7450<_0x39650f[_0x409d3e(0x106)]['length'];_0x1d7450++){if(_0x4fdb40[_0x409d3e(0x106)][_0x1d7450]!==_0x39650f[_0x409d3e(0x106)][_0x1d7450])return![];}return!![];}export function splitPath(_0x53e152){const _0x2c02d2=a171_0x49f0,_0x5bd021=parsePath(_0x53e152);if(_0x5bd021[_0x2c02d2(0x106)]['length']===0x0)throw new Error(_0x2c02d2(0x104));if(_0x5bd021[_0x2c02d2(0x106)][_0x2c02d2(0x121)]===0x1)return{'parent':_0x5bd021[_0x2c02d2(0x106)][0x0]};return{'parent':_0x5bd021['segments'][0x0],'child':_0x5bd021[_0x2c02d2(0x106)][_0x2c02d2(0x113)](0x1)['join']('/')};}export function isYamlFilePath(_0x180f47){const _0x105ddb=a171_0x49f0;return _0x180f47[_0x105ddb(0x129)]('.yml')||_0x180f47[_0x105ddb(0x129)](_0x105ddb(0x102));}export async function resolveYamlFilePath(_0x3f2584,_0x152b35=nodeFileSystem){const _0x34d715=a171_0x49f0,_0x4f5bce=a171_0x32ba0c[_0x34d715(0x119)](_0x3f2584);if(!await _0x152b35[_0x34d715(0x103)](_0x4f5bce))throw new Error(_0x34d715(0x124)+_0x3f2584);let _0x1c07b9=a171_0x32ba0c['dirname'](_0x4f5bce),_0x6bdb44=null,_0x56f9de=null;const _0xe28a0a=a171_0x32ba0c[_0x34d715(0x11f)](_0x1c07b9)[_0x34d715(0x10f)];while(_0x1c07b9!==_0xe28a0a){const _0x51c335=a171_0x32ba0c[_0x34d715(0xfe)](_0x1c07b9,_0x34d715(0x126));if(await _0x152b35[_0x34d715(0x103)](_0x51c335)){_0x6bdb44=_0x51c335,_0x56f9de=_0x1c07b9;break;}_0x1c07b9=a171_0x32ba0c[_0x34d715(0x11c)](_0x1c07b9);}if(!_0x6bdb44||!_0x56f9de)throw new Error(_0x34d715(0x11b)+_0x3f2584+'\x0a'+_0x34d715(0xfb));const _0x3fc704=await _0x152b35[_0x34d715(0x108)](_0x6bdb44),_0x205040=JSON['parse'](_0x3fc704),_0x30f3e8=_0x205040[_0x34d715(0xfd)];if(!_0x30f3e8)throw new Error(_0x34d715(0x10a));const _0x57ede2=await _0x152b35[_0x34d715(0x108)](_0x4f5bce),_0xb2e797=a171_0x580c97(_0x57ede2),_0x93111c=_0xb2e797[_0x34d715(0x112)];if(!_0x93111c)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x3f2584);const _0xe265d9=isJourneyDef(_0xb2e797,_0x4f5bce)?_0x34d715(0x10e):_0x34d715(0x11d),_0x32bf71=a171_0x32ba0c['relative'](_0x56f9de,_0x4f5bce),_0x4040f4=a171_0x32ba0c[_0x34d715(0x11c)](_0x32bf71),_0x2c7b54=_0x4040f4==='.'?'':_0x4040f4[_0x34d715(0x127)](/\\/g,'/'),_0x3f3907=_0x2c7b54?_0x30f3e8+'/'+_0x2c7b54+'/'+_0x93111c:_0x30f3e8+'/'+_0x93111c;return{'parentSegment':_0x30f3e8,'segmentName':_0x93111c,'folderPath':_0x2c7b54,'fullPath':_0x3f3907,'resourceType':_0xe265d9,'content':_0x57ede2};}
@@ -1 +1 @@
1
- (function(_0x2648b8,_0x22556e){const _0x43e8d3=a172_0x1a11,_0x375cf3=_0x2648b8();while(!![]){try{const _0x25352b=parseInt(_0x43e8d3(0xb7))/0x1+-parseInt(_0x43e8d3(0xb0))/0x2*(parseInt(_0x43e8d3(0xb9))/0x3)+parseInt(_0x43e8d3(0xb1))/0x4+parseInt(_0x43e8d3(0xb4))/0x5*(parseInt(_0x43e8d3(0xbb))/0x6)+parseInt(_0x43e8d3(0xb2))/0x7*(-parseInt(_0x43e8d3(0xaf))/0x8)+parseInt(_0x43e8d3(0xbc))/0x9*(-parseInt(_0x43e8d3(0xbe))/0xa)+-parseInt(_0x43e8d3(0xb3))/0xb*(parseInt(_0x43e8d3(0xb8))/0xc);if(_0x25352b===_0x22556e)break;else _0x375cf3['push'](_0x375cf3['shift']());}catch(_0x53b192){_0x375cf3['push'](_0x375cf3['shift']());}}}(a172_0x2277,0xc61ef));function a172_0x2277(){const _0x54beb9=['substring','Invalid\x20segment\x20reference\x20format:\x20','1602188WByuIg','12VoEjuW','3579RUvBeO','.\x20Parent\x20name\x20cannot\x20be\x20empty','18nVmzGt','6057UwmkmR','indexOf','5330wGhnuB','3736awrniH','106qgFbZo','3652760xtMAcj','23191SMLFow','763807oqIHjt','557785dLJnNw'];a172_0x2277=function(){return _0x54beb9;};return a172_0x2277();}function a172_0x1a11(_0x4ee5fb,_0x149eb0){_0x4ee5fb=_0x4ee5fb-0xaf;const _0x22772b=a172_0x2277();let _0x1a1148=_0x22772b[_0x4ee5fb];return _0x1a1148;}export function parseSegmentRef(_0x53dd74){const _0xf840ed=a172_0x1a11,_0x4e2562=_0x53dd74[_0xf840ed(0xbd)]('/');if(_0x4e2562===-0x1)return{'parentId':_0x53dd74};if(_0x4e2562===0x0)throw new Error(_0xf840ed(0xb6)+_0x53dd74+_0xf840ed(0xba));const _0x27d479=_0x53dd74[_0xf840ed(0xb5)](0x0,_0x4e2562),_0x123a09=_0x53dd74[_0xf840ed(0xb5)](_0x4e2562+0x1);if(_0x123a09==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x53dd74+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x27d479,'childId':_0x123a09};}
1
+ function a172_0x113b(){const _0x38b9aa=['Invalid\x20segment\x20reference\x20format:\x20','130nnhLNR','1525705MLRNQl','2SCrwwA','1040744boTZKW','6ZHMDhU','48YyJUfx','273393HOdjRq','562086womHGz','178596REGQVe','.\x20Parent\x20name\x20cannot\x20be\x20empty','6175841rmotcD','767038ZmsDRl','indexOf'];a172_0x113b=function(){return _0x38b9aa;};return a172_0x113b();}function a172_0xb8e1(_0x5b9aa1,_0x5bf1d1){_0x5b9aa1=_0x5b9aa1-0x123;const _0x113b44=a172_0x113b();let _0xb8e12=_0x113b44[_0x5b9aa1];return _0xb8e12;}(function(_0xc64a06,_0x36ee75){const _0x338753=a172_0xb8e1,_0xdcae05=_0xc64a06();while(!![]){try{const _0x2bd3f7=-parseInt(_0x338753(0x124))/0x1*(parseInt(_0x338753(0x129))/0x2)+parseInt(_0x338753(0x12d))/0x3*(parseInt(_0x338753(0x12c))/0x4)+parseInt(_0x338753(0x128))/0x5+parseInt(_0x338753(0x12b))/0x6*(parseInt(_0x338753(0x123))/0x7)+-parseInt(_0x338753(0x12a))/0x8+-parseInt(_0x338753(0x12e))/0x9*(parseInt(_0x338753(0x127))/0xa)+parseInt(_0x338753(0x12f))/0xb;if(_0x2bd3f7===_0x36ee75)break;else _0xdcae05['push'](_0xdcae05['shift']());}catch(_0x519d57){_0xdcae05['push'](_0xdcae05['shift']());}}}(a172_0x113b,0x8f993));export function parseSegmentRef(_0x478aff){const _0x3764ce=a172_0xb8e1,_0x2b30a4=_0x478aff[_0x3764ce(0x125)]('/');if(_0x2b30a4===-0x1)return{'parentId':_0x478aff};if(_0x2b30a4===0x0)throw new Error(_0x3764ce(0x126)+_0x478aff+_0x3764ce(0x130));const _0x43e61e=_0x478aff['substring'](0x0,_0x2b30a4),_0x1d79a0=_0x478aff['substring'](_0x2b30a4+0x1);if(_0x1d79a0==='')throw new Error(_0x3764ce(0x126)+_0x478aff+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x43e61e,'childId':_0x1d79a0};}
@@ -1 +1 @@
1
- function a173_0x4f81(){const _0x5a815a=['success','MISSING_SEGMENT_REFERENCE','level','EMPTY_ATTRIBUTE','conditions','92187GQWxZj','.conditions','.filter','length','rule','INVALID_RULE_TYPE','MISSING_NAME','.operator.not','match','name','includes','document','.operator.value','symbol','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','Value','map','Composite','invalid_value','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','Attribute\x20name\x20cannot\x20be\x20empty','code','INVALID_OPERATOR_TYPE','944IybfsZ','646lSyaTk','source','.operator.type','.source','push','MISSING_TIME_UNIT','path','validationCode','data','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','TimeWithinPast','custom','not','params','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','Attribute\x20\x27','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','Behavior','.conditions[','SEGMENT_SCHEMA_ERROR','.type','110joQxik','endsWith','EMPTY_CONDITIONS','INVALID_ARRAY_MATCHING','MISSING_CONDITIONS','5540Wcqyqk','aggregation','NESTED_CONDITION_GROUP','message','20982iolcxe','type','Operator\x20\x27','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','arrayMatching','4291CAxdFc','26666112BtbiOc','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','warning','rule.type','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','And','2698944OHfapC','safeParse','TEMPORAL_NEGATION_UNSUPPORTED','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','filter','attribute','BEHAVIOR_SOURCE_MISSING_FILTER','description','operator','error','issues','.segment','MISSING_OPERATOR_VALUE','4193240jeQPDu','Behavior\x20source\x20\x27','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','TimeWithinNext','520HPaeQW'];a173_0x4f81=function(){return _0x5a815a;};return a173_0x4f81();}(function(_0x25700e,_0x3f8359){const _0xba78b6=a173_0xa233,_0x1a3890=_0x25700e();while(!![]){try{const _0x181c78=-parseInt(_0xba78b6(0xa7))/0x1*(parseInt(_0xba78b6(0xc3))/0x2)+-parseInt(_0xba78b6(0xd3))/0x3+parseInt(_0xba78b6(0xe0))/0x4+-parseInt(_0xba78b6(0xe4))/0x5*(-parseInt(_0xba78b6(0xc7))/0x6)+parseInt(_0xba78b6(0xcc))/0x7*(-parseInt(_0xba78b6(0xa6))/0x8)+parseInt(_0xba78b6(0xea))/0x9*(-parseInt(_0xba78b6(0xbe))/0xa)+parseInt(_0xba78b6(0xcd))/0xb;if(_0x181c78===_0x3f8359)break;else _0x1a3890['push'](_0x1a3890['shift']());}catch(_0x10f85d){_0x1a3890['push'](_0x1a3890['shift']());}}}(a173_0x4f81,0xeae43));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';function a173_0xa233(_0x202a9a,_0x5bbb0b){_0x202a9a=_0x202a9a-0x96;const _0x4f81cc=a173_0x4f81();let _0xa2333d=_0x4f81cc[_0x202a9a];return _0xa2333d;}export function validateSegmentDef(_0xebf268,_0x676c8e={},_0x4644a2={}){const _0x19c58f=a173_0xa233;if(_0x4644a2['skipSchema'])return runSemanticChecks(_0xebf268,_0x676c8e);const _0x453dfb=SegmentDefSchema[_0x19c58f(0xd4)](_0xebf268);if(_0x453dfb['success'])return runSemanticChecks(_0x453dfb[_0x19c58f(0xaf)],_0x676c8e);return zodErrorsToValidationResult(_0x453dfb['error'],_0x676c8e);}export function validateRuleDef(_0x2ac9a1,_0x17c4b7,_0x16069f){const _0x4b5aff=a173_0xa233;if(!_0x2ac9a1)return[];const _0x399f2e=RuleDefSchema[_0x4b5aff(0xd4)](_0x2ac9a1);if(_0x399f2e[_0x4b5aff(0xe5)])return checkRule(_0x399f2e['data'],_0x17c4b7,_0x16069f);const _0x55e1a0=flattenZodIssues(_0x399f2e[_0x4b5aff(0xdc)][_0x4b5aff(0xdd)]);return _0x55e1a0[_0x4b5aff(0x9f)](_0x17ad6c=>{const _0x31f156=_0x4b5aff,_0x29fdf2=formatZodPath(_0x17ad6c['path']),_0x5a9f0c=_0x29fdf2?_0x17c4b7+'.'+_0x29fdf2:_0x17c4b7,_0x3508d6=mapZodIssueToCode(_0x17ad6c,_0x29fdf2),_0x17eb40=getLocationFromPath(_0x16069f[_0x31f156(0x9a)],_0x16069f['source'],pathToArray(_0x5a9f0c));return{'level':_0x31f156(0xdc),'path':_0x5a9f0c,'code':_0x3508d6,'message':_0x17ad6c['message'],..._0x17eb40&&{'location':_0x17eb40}};});}function zodErrorsToValidationResult(_0x5e5d25,_0x3b4edb){const _0x24964e=a173_0xa233,_0x85fe74=flattenZodIssues(_0x5e5d25[_0x24964e(0xdd)]),_0x18a9e9=_0x85fe74[_0x24964e(0x9f)](_0x5feb8f=>{const _0xcb4489=_0x24964e,_0x4a4ddd=formatZodPath(_0x5feb8f[_0xcb4489(0xad)]),_0x2e12ee=mapZodIssueToCode(_0x5feb8f,_0x4a4ddd),_0x4fd312=getLocationFromPath(_0x3b4edb[_0xcb4489(0x9a)],_0x3b4edb[_0xcb4489(0xa8)],_0x5feb8f[_0xcb4489(0xad)][_0xcb4489(0x9f)](_0x1096f4=>typeof _0x1096f4===_0xcb4489(0x9c)?String(_0x1096f4):_0x1096f4));return{'level':_0xcb4489(0xdc),'path':_0x4a4ddd,'code':_0x2e12ee,'message':_0x5feb8f[_0xcb4489(0xc6)],..._0x4fd312&&{'location':_0x4fd312}};});return{'valid':![],'errors':_0x18a9e9,'warnings':[]};}function mapZodIssueToCode(_0xca47af,_0x1170b2){const _0x389fa6=a173_0xa233,_0x8f716d=_0xca47af['code']===_0x389fa6(0xb3)?_0xca47af[_0x389fa6(0xb5)]:undefined;if(_0x1170b2===_0x389fa6(0x98))return _0x389fa6(0xf0);if(_0x1170b2===_0x389fa6(0xd0)||_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0xbd))){if(_0xca47af[_0x389fa6(0xa4)]===_0x389fa6(0xa1)){if(_0x1170b2==='rule.type'||_0x1170b2[_0x389fa6(0x97)](/\.conditions\[\d+\]\.type$/))return _0x389fa6(0xef);}}if(_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0xa9)))return _0x389fa6(0xa5);if(_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0x9b)))return _0x389fa6(0xdf);if(_0x8f716d?.[_0x389fa6(0xae)]==='MISSING_BETWEEN_BOUNDS')return'MISSING_BETWEEN_BOUNDS';if(_0x8f716d?.['validationCode']===_0x389fa6(0xac))return'MISSING_TIME_UNIT';if(_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0xeb))||_0x1170b2===_0x389fa6(0xe9))return _0x389fa6(0xc2);if(_0x1170b2[_0x389fa6(0x99)](_0x389fa6(0xcb)))return _0x389fa6(0xc1);if(_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0xde)))return _0x389fa6(0xe6);return _0x389fa6(0xbc);}function runSemanticChecks(_0x219e39,_0x15db33){const _0x1b0ca8=a173_0xa233,_0x30ff45=[];_0x219e39[_0x1b0ca8(0xee)]&&_0x30ff45['push'](...checkRule(_0x219e39['rule'],_0x1b0ca8(0xee),_0x15db33));const _0x4c26f7=_0x30ff45[_0x1b0ca8(0xd7)](_0x44c6b8=>_0x44c6b8[_0x1b0ca8(0xe7)]===_0x1b0ca8(0xdc)),_0x38da33=_0x30ff45['filter'](_0x36416b=>_0x36416b[_0x1b0ca8(0xe7)]===_0x1b0ca8(0xcf));return{'valid':_0x4c26f7[_0x1b0ca8(0xed)]===0x0,'errors':_0x4c26f7,'warnings':_0x38da33};}function checkRule(_0x50e70a,_0x505e30,_0x1c0192){const _0x774e00=a173_0xa233,_0x33ef48=[];if(_0x50e70a['conditions'][_0x774e00(0xed)]===0x0)return _0x33ef48[_0x774e00(0xab)]({'level':'error','path':_0x505e30+'.conditions','code':'EMPTY_CONDITIONS','message':'Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','location':getLocationFromPath(_0x1c0192[_0x774e00(0x9a)],_0x1c0192['source'],pathToArray(_0x505e30+_0x774e00(0xeb)))}),_0x33ef48;return _0x33ef48[_0x774e00(0xab)](...checkConditions(_0x50e70a[_0x774e00(0xe9)],_0x505e30,_0x1c0192)),_0x33ef48;}function checkConditions(_0x5499ca,_0x3a5a83,_0x5678da){const _0x4bc747=a173_0xa233,_0x304e5f=[];for(let _0x49e89a=0x0;_0x49e89a<_0x5499ca[_0x4bc747(0xed)];_0x49e89a++){const _0x35c0b8=_0x5499ca[_0x49e89a],_0x88d9c7=_0x3a5a83+_0x4bc747(0xbb)+_0x49e89a+']';_0x304e5f[_0x4bc747(0xab)](...checkCondition(_0x35c0b8,_0x88d9c7,_0x5678da));}return _0x304e5f;}function checkCondition(_0x57577d,_0x30a444,_0x44114c){const _0x4a318d=a173_0xa233,_0x2e5a2f=[];if(_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0xd2)||_0x57577d[_0x4a318d(0xc8)]==='Or'||_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0xa0)){if(_0x57577d[_0x4a318d(0xe9)][_0x4a318d(0xed)]===0x0)_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xdc),'path':_0x30a444+_0x4a318d(0xeb),'code':_0x4a318d(0xc0),'message':_0x57577d[_0x4a318d(0xc8)]+_0x4a318d(0xca),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c[_0x4a318d(0xa8)],pathToArray(_0x30a444+_0x4a318d(0xeb)))});else{const _0x522655=_0x57577d[_0x4a318d(0xda)]!==undefined,_0x4ce862=_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0xa0);!_0x522655&&!_0x4ce862&&_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xcf),'path':_0x30a444,'code':_0x4a318d(0xc5),'message':_0x57577d['type']+_0x4a318d(0xb1)+'condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20'+_0x4a318d(0xa2),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c[_0x4a318d(0xa8)],pathToArray(_0x30a444))}),_0x2e5a2f[_0x4a318d(0xab)](...checkConditions(_0x57577d[_0x4a318d(0xe9)],_0x30a444,_0x44114c));}return _0x2e5a2f;}if(_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0x9e)||_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0xba)){const _0x40396e=_0x57577d,_0x7f6af8=_0x40396e[_0x4a318d(0xa8)],_0x44c1fd=_0x40396e[_0x4a318d(0xc4)],_0x5f2714=_0x7f6af8||_0x44c1fd,_0x367020=_0x40396e[_0x4a318d(0xdb)]?.['type'];if((_0x367020===_0x4a318d(0xb2)||_0x367020===_0x4a318d(0xe3))&&_0x40396e[_0x4a318d(0xdb)]?.[_0x4a318d(0xb4)]!==undefined){const _0x1bf9b2=_0x40396e['operator'][_0x4a318d(0xb4)]===!![];_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x1bf9b2?_0x4a318d(0xdc):_0x4a318d(0xcf),'path':_0x30a444+_0x4a318d(0x96),'code':_0x4a318d(0xd5),'message':_0x1bf9b2?_0x4a318d(0xc9)+_0x367020+_0x4a318d(0xb6)+_0x4a318d(0xb8)+_0x4a318d(0xe2):_0x4a318d(0xc9)+_0x367020+'\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20'+_0x4a318d(0xce),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c[_0x4a318d(0xa8)],pathToArray(_0x30a444+_0x4a318d(0x96)))});}(!_0x40396e[_0x4a318d(0xd8)]||_0x40396e[_0x4a318d(0xd8)]==='')&&(!_0x5f2714&&_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xdc),'path':_0x30a444+'.attribute','code':_0x4a318d(0xe8),'message':_0x4a318d(0xa3),'location':getLocationFromPath(_0x44114c['document'],_0x44114c['source'],pathToArray(_0x30a444+'.attribute'))}));_0x40396e[_0x4a318d(0xd7)]&&_0x2e5a2f[_0x4a318d(0xab)](...checkRule(_0x40396e[_0x4a318d(0xd7)],_0x30a444+_0x4a318d(0xec),_0x44114c));if(_0x40396e[_0x4a318d(0xa8)]){const _0x39b2d2=_0x40396e[_0x4a318d(0xd8)]&&_0x40396e[_0x4a318d(0xd8)]!=='';_0x39b2d2&&!_0x40396e[_0x4a318d(0xd7)]&&_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xdc),'path':_0x30a444+_0x4a318d(0xaa),'code':_0x4a318d(0xd9),'message':_0x4a318d(0xe1)+_0x40396e[_0x4a318d(0xa8)]+'\x27\x20with\x20attribute\x20\x27'+_0x40396e[_0x4a318d(0xd8)]+'\x27\x20'+_0x4a318d(0xb0)+_0x4a318d(0xb9)+_0x4a318d(0xd1),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c[_0x4a318d(0xa8)],pathToArray(_0x30a444+_0x4a318d(0xaa)))}),_0x39b2d2&&_0x40396e['filter']&&_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xcf),'path':_0x30a444+'.attribute','code':_0x4a318d(0xd6),'message':_0x4a318d(0xb7)+_0x40396e[_0x4a318d(0xd8)]+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+_0x4a318d(0x9d),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c['source'],pathToArray(_0x30a444+'.attribute'))});}}return _0x2e5a2f;}
1
+ (function(_0x45acd9,_0x27261e){const _0x4bd609=a173_0x1bf2,_0x523af7=_0x45acd9();while(!![]){try{const _0x28c07f=-parseInt(_0x4bd609(0x1b9))/0x1*(parseInt(_0x4bd609(0x1a1))/0x2)+parseInt(_0x4bd609(0x19a))/0x3*(-parseInt(_0x4bd609(0x1b8))/0x4)+-parseInt(_0x4bd609(0x1be))/0x5*(parseInt(_0x4bd609(0x1da))/0x6)+-parseInt(_0x4bd609(0x190))/0x7*(-parseInt(_0x4bd609(0x1a4))/0x8)+-parseInt(_0x4bd609(0x18d))/0x9+-parseInt(_0x4bd609(0x18a))/0xa*(-parseInt(_0x4bd609(0x1b7))/0xb)+parseInt(_0x4bd609(0x1c8))/0xc*(parseInt(_0x4bd609(0x1ad))/0xd);if(_0x28c07f===_0x27261e)break;else _0x523af7['push'](_0x523af7['shift']());}catch(_0x22598b){_0x523af7['push'](_0x523af7['shift']());}}}(a173_0x5aa9,0xb78b2));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x2c160d,_0x49c527={},_0x43e6f7={}){const _0x4d61f9=a173_0x1bf2;if(_0x43e6f7[_0x4d61f9(0x1c5)])return runSemanticChecks(_0x2c160d,_0x49c527);const _0x225da4=SegmentDefSchema['safeParse'](_0x2c160d);if(_0x225da4[_0x4d61f9(0x1c7)])return runSemanticChecks(_0x225da4[_0x4d61f9(0x19e)],_0x49c527);return zodErrorsToValidationResult(_0x225da4[_0x4d61f9(0x197)],_0x49c527);}export function validateRuleDef(_0x3f298d,_0x3430b4,_0xbee831){const _0x3bed5b=a173_0x1bf2;if(!_0x3f298d)return[];const _0x9e836d=RuleDefSchema[_0x3bed5b(0x1d4)](_0x3f298d);if(_0x9e836d[_0x3bed5b(0x1c7)])return checkRule(_0x9e836d['data'],_0x3430b4,_0xbee831);const _0x1b90cf=flattenZodIssues(_0x9e836d['error'][_0x3bed5b(0x1bf)]);return _0x1b90cf[_0x3bed5b(0x1cd)](_0x485692=>{const _0x2bccc8=_0x3bed5b,_0x40fecd=formatZodPath(_0x485692[_0x2bccc8(0x1d8)]),_0x5430f9=_0x40fecd?_0x3430b4+'.'+_0x40fecd:_0x3430b4,_0x392fce=mapZodIssueToCode(_0x485692,_0x40fecd),_0x2fc11e=getLocationFromPath(_0xbee831['document'],_0xbee831[_0x2bccc8(0x1a3)],pathToArray(_0x5430f9));return{'level':_0x2bccc8(0x197),'path':_0x5430f9,'code':_0x392fce,'message':_0x485692[_0x2bccc8(0x1ab)],..._0x2fc11e&&{'location':_0x2fc11e}};});}function zodErrorsToValidationResult(_0x4845fa,_0x3c71fb){const _0x54c350=a173_0x1bf2,_0x3c5fcb=flattenZodIssues(_0x4845fa[_0x54c350(0x1bf)]),_0xefc03c=_0x3c5fcb[_0x54c350(0x1cd)](_0x390a17=>{const _0x57d311=_0x54c350,_0x57bcd1=formatZodPath(_0x390a17[_0x57d311(0x1d8)]),_0x1d7f41=mapZodIssueToCode(_0x390a17,_0x57bcd1),_0x2b63fa=getLocationFromPath(_0x3c71fb[_0x57d311(0x1cb)],_0x3c71fb['source'],_0x390a17[_0x57d311(0x1d8)][_0x57d311(0x1cd)](_0x1b36a9=>typeof _0x1b36a9===_0x57d311(0x1cf)?String(_0x1b36a9):_0x1b36a9));return{'level':_0x57d311(0x197),'path':_0x57bcd1,'code':_0x1d7f41,'message':_0x390a17[_0x57d311(0x1ab)],..._0x2b63fa&&{'location':_0x2b63fa}};});return{'valid':![],'errors':_0xefc03c,'warnings':[]};}function a173_0x1bf2(_0x478c1a,_0x14b6ec){_0x478c1a=_0x478c1a-0x188;const _0x5aa94d=a173_0x5aa9();let _0x1bf27b=_0x5aa94d[_0x478c1a];return _0x1bf27b;}function mapZodIssueToCode(_0x58e6f0,_0x53bdf7){const _0x4b978a=a173_0x1bf2,_0x421b8b=_0x58e6f0['code']===_0x4b978a(0x18e)?_0x58e6f0['params']:undefined;if(_0x53bdf7===_0x4b978a(0x199))return _0x4b978a(0x1bd);if(_0x53bdf7===_0x4b978a(0x193)||_0x53bdf7[_0x4b978a(0x18c)](_0x4b978a(0x194))){if(_0x58e6f0[_0x4b978a(0x1bc)]===_0x4b978a(0x1b6)){if(_0x53bdf7===_0x4b978a(0x193)||_0x53bdf7[_0x4b978a(0x1ae)](/\.conditions\[\d+\]\.type$/))return _0x4b978a(0x195);}}if(_0x53bdf7['endsWith']('.operator.type'))return _0x4b978a(0x19c);if(_0x53bdf7[_0x4b978a(0x18c)](_0x4b978a(0x19b)))return _0x4b978a(0x1b4);if(_0x421b8b?.[_0x4b978a(0x191)]==='MISSING_BETWEEN_BOUNDS')return _0x4b978a(0x1c6);if(_0x421b8b?.['validationCode']===_0x4b978a(0x1b1))return'MISSING_TIME_UNIT';if(_0x53bdf7[_0x4b978a(0x18c)](_0x4b978a(0x1b2))||_0x53bdf7==='conditions')return'MISSING_CONDITIONS';if(_0x53bdf7['includes'](_0x4b978a(0x192)))return'INVALID_ARRAY_MATCHING';if(_0x53bdf7[_0x4b978a(0x18c)](_0x4b978a(0x1ca)))return _0x4b978a(0x1c1);return _0x4b978a(0x1ba);}function a173_0x5aa9(){const _0x3cb10d=['584pMudvA','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','filter','TEMPORAL_NEGATION_UNSUPPORTED','description','length','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','message','Operator\x20\x27','26rZklfY','match','EMPTY_CONDITIONS','level','MISSING_TIME_UNIT','.conditions','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','MISSING_OPERATOR_VALUE','.conditions[','invalid_value','234806rVKlHz','12BrKTUX','4yWFKsz','SEGMENT_SCHEMA_ERROR','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','code','MISSING_NAME','130ozGoYc','issues','Behavior\x20source\x20\x27','MISSING_SEGMENT_REFERENCE','operator','aggregation','not','skipSchema','MISSING_BETWEEN_BOUNDS','success','14790504mQPeWw','warning','.segment','document','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','map','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','symbol','.filter','type','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','TimeWithinNext','safeParse','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','And','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','path','attribute','184002wERqwH','NESTED_CONDITION_GROUP','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','30VbJZmC','conditions','endsWith','8592597NZZhhd','custom','push','96173UJWxlZ','validationCode','arrayMatching','rule.type','.type','INVALID_RULE_TYPE','rule','error','Composite','name','29292ZVTNAf','.operator.value','INVALID_OPERATOR_TYPE','.attribute','data','\x27\x20with\x20attribute\x20\x27','EMPTY_ATTRIBUTE','499454JoqzKq','BEHAVIOR_SOURCE_MISSING_FILTER','source'];a173_0x5aa9=function(){return _0x3cb10d;};return a173_0x5aa9();}function runSemanticChecks(_0x40b475,_0x110ac0){const _0x1abbc3=a173_0x1bf2,_0x3283c1=[];_0x40b475[_0x1abbc3(0x196)]&&_0x3283c1[_0x1abbc3(0x18f)](...checkRule(_0x40b475[_0x1abbc3(0x196)],_0x1abbc3(0x196),_0x110ac0));const _0x2df2b3=_0x3283c1[_0x1abbc3(0x1a6)](_0x44039c=>_0x44039c[_0x1abbc3(0x1b0)]===_0x1abbc3(0x197)),_0x45a593=_0x3283c1[_0x1abbc3(0x1a6)](_0x221969=>_0x221969[_0x1abbc3(0x1b0)]===_0x1abbc3(0x1c9));return{'valid':_0x2df2b3[_0x1abbc3(0x1a9)]===0x0,'errors':_0x2df2b3,'warnings':_0x45a593};}function checkRule(_0xdce97d,_0x571143,_0x3daeab){const _0x42cf3e=a173_0x1bf2,_0xeca09d=[];if(_0xdce97d[_0x42cf3e(0x18b)][_0x42cf3e(0x1a9)]===0x0)return _0xeca09d[_0x42cf3e(0x18f)]({'level':_0x42cf3e(0x197),'path':_0x571143+_0x42cf3e(0x1b2),'code':_0x42cf3e(0x1af),'message':_0x42cf3e(0x1d5),'location':getLocationFromPath(_0x3daeab[_0x42cf3e(0x1cb)],_0x3daeab[_0x42cf3e(0x1a3)],pathToArray(_0x571143+_0x42cf3e(0x1b2)))}),_0xeca09d;return _0xeca09d[_0x42cf3e(0x18f)](...checkConditions(_0xdce97d[_0x42cf3e(0x18b)],_0x571143,_0x3daeab)),_0xeca09d;}function checkConditions(_0x46c046,_0x265252,_0x299f40){const _0x18cda2=a173_0x1bf2,_0x55187f=[];for(let _0x354f63=0x0;_0x354f63<_0x46c046[_0x18cda2(0x1a9)];_0x354f63++){const _0x13b48f=_0x46c046[_0x354f63],_0xa0ec27=_0x265252+_0x18cda2(0x1b5)+_0x354f63+']';_0x55187f[_0x18cda2(0x18f)](...checkCondition(_0x13b48f,_0xa0ec27,_0x299f40));}return _0x55187f;}function checkCondition(_0x1386ca,_0x228976,_0x3a2994){const _0xef29fa=a173_0x1bf2,_0x237a56=[];if(_0x1386ca[_0xef29fa(0x1d1)]===_0xef29fa(0x1d6)||_0x1386ca['type']==='Or'||_0x1386ca['type']==='Composite'){if(_0x1386ca[_0xef29fa(0x18b)]['length']===0x0)_0x237a56[_0xef29fa(0x18f)]({'level':_0xef29fa(0x197),'path':_0x228976+_0xef29fa(0x1b2),'code':_0xef29fa(0x1af),'message':_0x1386ca[_0xef29fa(0x1d1)]+_0xef29fa(0x1a5),'location':getLocationFromPath(_0x3a2994['document'],_0x3a2994[_0xef29fa(0x1a3)],pathToArray(_0x228976+_0xef29fa(0x1b2)))});else{const _0xcfcefc=_0x1386ca[_0xef29fa(0x1a8)]!==undefined,_0xb37b3b=_0x1386ca[_0xef29fa(0x1d1)]===_0xef29fa(0x198);!_0xcfcefc&&!_0xb37b3b&&_0x237a56['push']({'level':_0xef29fa(0x1c9),'path':_0x228976,'code':_0xef29fa(0x188),'message':_0x1386ca[_0xef29fa(0x1d1)]+_0xef29fa(0x1bb)+_0xef29fa(0x1cc)+'conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','location':getLocationFromPath(_0x3a2994[_0xef29fa(0x1cb)],_0x3a2994['source'],pathToArray(_0x228976))}),_0x237a56[_0xef29fa(0x18f)](...checkConditions(_0x1386ca[_0xef29fa(0x18b)],_0x228976,_0x3a2994));}return _0x237a56;}if(_0x1386ca[_0xef29fa(0x1d1)]==='Value'||_0x1386ca[_0xef29fa(0x1d1)]==='Behavior'){const _0x36122c=_0x1386ca,_0x1ffa51=_0x36122c[_0xef29fa(0x1a3)],_0x19813c=_0x36122c[_0xef29fa(0x1c3)],_0x1a9938=_0x1ffa51||_0x19813c,_0x418276=_0x36122c[_0xef29fa(0x1c2)]?.[_0xef29fa(0x1d1)];if((_0x418276==='TimeWithinPast'||_0x418276===_0xef29fa(0x1d3))&&_0x36122c[_0xef29fa(0x1c2)]?.['not']!==undefined){const _0x32bc30=_0x36122c['operator'][_0xef29fa(0x1c4)]===!![];_0x237a56[_0xef29fa(0x18f)]({'level':_0x32bc30?_0xef29fa(0x197):_0xef29fa(0x1c9),'path':_0x228976+'.operator.not','code':_0xef29fa(0x1a7),'message':_0x32bc30?_0xef29fa(0x1ac)+_0x418276+_0xef29fa(0x1d2)+_0xef29fa(0x1b3)+'Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.':_0xef29fa(0x1ac)+_0x418276+_0xef29fa(0x1aa)+'Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','location':getLocationFromPath(_0x3a2994['document'],_0x3a2994[_0xef29fa(0x1a3)],pathToArray(_0x228976+'.operator.not'))});}(!_0x36122c[_0xef29fa(0x1d9)]||_0x36122c[_0xef29fa(0x1d9)]==='')&&(!_0x1a9938&&_0x237a56[_0xef29fa(0x18f)]({'level':_0xef29fa(0x197),'path':_0x228976+_0xef29fa(0x19d),'code':_0xef29fa(0x1a0),'message':'Attribute\x20name\x20cannot\x20be\x20empty','location':getLocationFromPath(_0x3a2994[_0xef29fa(0x1cb)],_0x3a2994[_0xef29fa(0x1a3)],pathToArray(_0x228976+_0xef29fa(0x19d)))}));_0x36122c[_0xef29fa(0x1a6)]&&_0x237a56[_0xef29fa(0x18f)](...checkRule(_0x36122c[_0xef29fa(0x1a6)],_0x228976+_0xef29fa(0x1d0),_0x3a2994));if(_0x36122c[_0xef29fa(0x1a3)]){const _0x99f352=_0x36122c[_0xef29fa(0x1d9)]&&_0x36122c[_0xef29fa(0x1d9)]!=='';_0x99f352&&!_0x36122c['filter']&&_0x237a56['push']({'level':'error','path':_0x228976+'.source','code':_0xef29fa(0x1a2),'message':_0xef29fa(0x1c0)+_0x36122c[_0xef29fa(0x1a3)]+_0xef29fa(0x19f)+_0x36122c[_0xef29fa(0x1d9)]+'\x27\x20'+'requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20'+_0xef29fa(0x189)+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x3a2994[_0xef29fa(0x1cb)],_0x3a2994[_0xef29fa(0x1a3)],pathToArray(_0x228976+'.source'))}),_0x99f352&&_0x36122c[_0xef29fa(0x1a6)]&&_0x237a56[_0xef29fa(0x18f)]({'level':_0xef29fa(0x1c9),'path':_0x228976+_0xef29fa(0x19d),'code':_0xef29fa(0x1d7),'message':'Attribute\x20\x27'+_0x36122c['attribute']+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+_0xef29fa(0x1ce),'location':getLocationFromPath(_0x3a2994[_0xef29fa(0x1cb)],_0x3a2994[_0xef29fa(0x1a3)],pathToArray(_0x228976+_0xef29fa(0x19d)))});}}return _0x237a56;}