@treasuredata/tdx 0.9.7 → 0.9.8
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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts +36 -7
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-config.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0xcfcc47=a35_0x5a42;(function(_0x53212e,_0x416f99){const _0x2c5ed5=a35_0x5a42,_0x59a4a8=_0x53212e();while(!![]){try{const _0xe4376e=parseInt(_0x2c5ed5(0xbb))/0x1*(parseInt(_0x2c5ed5(0x100))/0x2)+-parseInt(_0x2c5ed5(0xdb))/0x3*(-parseInt(_0x2c5ed5(0xcb))/0x4)+-parseInt(_0x2c5ed5(0xff))/0x5*(-parseInt(_0x2c5ed5(0x118))/0x6)+-parseInt(_0x2c5ed5(0xe9))/0x7*(-parseInt(_0x2c5ed5(0xc4))/0x8)+-parseInt(_0x2c5ed5(0x11e))/0x9*(-parseInt(_0x2c5ed5(0x10c))/0xa)+-parseInt(_0x2c5ed5(0x105))/0xb*(parseInt(_0x2c5ed5(0xcd))/0xc)+-parseInt(_0x2c5ed5(0xaf))/0xd*(parseInt(_0x2c5ed5(0xda))/0xe);if(_0xe4376e===_0x416f99)break;else _0x59a4a8['push'](_0x59a4a8['shift']());}catch(_0x241f30){_0x59a4a8['push'](_0x59a4a8['shift']());}}}(a35_0x34ea,0xba865));function a35_0x34ea(){const _0x2402b3=['green','segment','Found\x20existing\x20tdx.json\x20at:\x20','Fetching\x20journeys...','760793Gotquh','journey','reduce','set','parentSegment','map','relative','1249890BREZgX','Resolving\x20parent\x20segment\x20\x27','Fetching\x20journey\x20\x27','dirname','\x20with\x20','versionNumber','relativePath','length','Parent\x20segment:\x20','absolutePath','Fetching\x20users\x20for\x20email\x20resolution...','user','120SZrExn','Warning:\x20Could\x20not\x20resolve\x20activation\x20','buildIdToNameMap','yellow','Site:\x20','listFolders','18xPIncU','push','get','\x20journeys','dim','Using\x20parent\x20segment:\x20','getActivation','\x20unchanged\x20files','sort','143hIVbPw','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','isDirectory','segmentFolderId','\x20=\x20','slice','audienceId','session','filter','parent_segment','✔\x20Context\x20set:\x20','message','22NIbFgQ','data','has','\x20activations','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','dryRun','then','segment:pull','40XOGOXb','from','Resolved\x20parent\x20name:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20files\x20to\x20','name','attributes','68296vwVUri','\x0aPull\x20summary\x20for\x20\x27','36XtcXdT','Fetching\x20activations...','getSegment','size','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Found\x20tdx.json\x20at:\x20','cyan','hasChanges','folderId','journeyBundleName','activation_','Processing\x20journeys...','getParent','4960662tmDGMl','252ghzpvL','content','\x0aChanges\x20to\x20\x27','buildIdToEmailMap','listActivations','red','rule','\x20segments','\x20versions)','error','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Fetching\x20folders...','✔\x20Pulled\x20','execute','1437639VddIKX','setExtra','values','setPhase','\x20\x20Target:\x20','site','add','isNew','Fetching\x20connections\x20for\x20name\x20resolution...','getJourney','kind','description','yes','listJourneysFromParentSegment','utf-8','join','repeat','parentFolderId','.yml','verbose','all','\x27...','319745YjAkKp','79918oQGFne'];a35_0x34ea=function(){return _0x2402b3;};return a35_0x34ea();}import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,resolveRuleSegmentRefs,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a35_0x2fefb2,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a35_0x352a8d from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a35_0x54fe0a from'path';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{[a35_0xcfcc47(0xc9)]=a35_0xcfcc47(0xc3);[a35_0xcfcc47(0xf4)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a35_0xcfcc47(0xe8)](_0x4cba7d){const _0x349746=a35_0xcfcc47,{options:_0x10dc96,args:_0x37340d,tdx:_0x3f2f4b}=_0x4cba7d,_0x50385b=_0x10dc96,_0x3a943d=_0x10dc96[_0x349746(0x109)],_0x46ab93=_0x37340d[0x0],_0x308573=findTdxConfigPath();let _0x151b22,_0x417b40;if(!_0x46ab93&&_0x308573){const _0x354d7d=loadTdxConfig(_0x308573);_0x151b22=_0x354d7d[_0x349746(0xb8)],_0x417b40=a35_0x54fe0a[_0x349746(0x10f)](_0x308573),_0x50385b[_0x349746(0xfc)]&&(console[_0x349746(0xe4)](_0x349746(0x103)+_0x308573),console[_0x349746(0xe4)](_0x349746(0xab)+_0x151b22));}else{if(_0x46ab93){if(existsSync(_0x46ab93)&&statSync(_0x46ab93)[_0x349746(0xb1)]()){const _0x2079ce=findTdxConfigPath(_0x46ab93);if(_0x2079ce){const _0x975e39=loadTdxConfig(_0x2079ce);_0x151b22=_0x975e39[_0x349746(0xb8)],_0x417b40=a35_0x54fe0a['dirname'](_0x2079ce),_0x50385b[_0x349746(0xfc)]&&(console[_0x349746(0xe4)](_0x349746(0xd2)+_0x2079ce),console[_0x349746(0xe4)]('Using\x20parent\x20segment:\x20'+_0x151b22));}else return console[_0x349746(0xe4)](a35_0x352a8d[_0x349746(0xe0)](_0x349746(0xd1)+_0x46ab93+'\x0a')),console[_0x349746(0xe4)](a35_0x352a8d[_0x349746(0xd3)](_0x349746(0xc7))),0x1;}else _0x151b22=_0x46ab93;}else _0x151b22=_0x3a943d;}if(!_0x151b22)return console[_0x349746(0xe4)](a35_0x352a8d[_0x349746(0x11b)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x349746(0xe4)](_0x349746(0xc0)),console[_0x349746(0xe4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file'),0x1;_0x50385b[_0x349746(0xfc)]&&(console[_0x349746(0xe4)](_0x349746(0x11c)+_0x50385b[_0x349746(0xee)]),console['error'](_0x349746(0x114)+_0x151b22));const _0x2f7994=await withSpinner(_0x349746(0x10d)+_0x151b22+_0x349746(0xfe),()=>_0x3f2f4b[_0x349746(0x102)]['resolveParentId'](_0x151b22),{'verbose':_0x50385b['verbose']}),_0x26e9a9=_0x2f7994[_0x349746(0xbc)],_0x56941c=await withSpinner('Fetching\x20parent\x20segment\x20info...',()=>_0x3f2f4b['segment'][_0x349746(0xd9)](_0x26e9a9),{'verbose':_0x50385b[_0x349746(0xfc)]}),_0x49e9f9=_0x56941c[_0x349746(0xbc)][_0x349746(0xca)][_0x349746(0xc9)];_0x50385b['verbose']&&console['error'](_0x349746(0xc6)+_0x49e9f9);const [_0x4f602e,_0x426dc9,_0xf37ed5]=await Promise[_0x349746(0xfd)]([withSpinner('Fetching\x20segments...',()=>_0x3f2f4b['segment']['listSegments'](_0x26e9a9),{'verbose':_0x50385b[_0x349746(0xfc)]}),withSpinner(_0x349746(0xe6),()=>_0x3f2f4b[_0x349746(0x102)][_0x349746(0x11d)](_0x26e9a9),{'verbose':_0x50385b[_0x349746(0xfc)]}),withSpinner(_0x349746(0x104),()=>_0x3f2f4b['journey'][_0x349746(0xf6)](_0x26e9a9),{'verbose':_0x50385b['verbose']})]),_0x2bea74=_0x4f602e['data'],_0x46636e=_0x426dc9[_0x349746(0xbc)],_0x2cc2fe=_0xf37ed5[_0x349746(0xbc)];if(_0x2bea74[_0x349746(0x113)]===0x0&&_0x2cc2fe[_0x349746(0x113)]===0x0)return console['error'](a35_0x352a8d[_0x349746(0x11b)](_0x349746(0xbf)+_0x49e9f9+'\x27')),0x0;const _0x3d7f04=buildFolderPathMap(_0x46636e),_0x532774=_0x417b40||getSegmentRootDir(sanitizeFileName(_0x151b22)),_0x4363fb=new Map();await withSpinner(_0x349746(0xce),async()=>{await batchAsync(_0x2bea74,async _0x4cac4f=>{const _0x59d6f7=a35_0x5a42,_0x37afaa=await _0x3f2f4b[_0x59d6f7(0x102)][_0x59d6f7(0xdf)](_0x26e9a9,_0x4cac4f['id']);_0x4363fb['set'](_0x4cac4f['id'],_0x37afaa);});},{'verbose':_0x50385b[_0x349746(0xfc)]});const _0x29a7cd=await withSpinner(_0x349746(0x116),()=>_0x3f2f4b[_0x349746(0x117)][_0x349746(0xde)](),{'verbose':_0x50385b['verbose']})[_0x349746(0xc2)](_0x3357d3=>_0x3357d3[_0x349746(0xbc)]),_0x14bb15=await withSpinner(_0x349746(0xf1),()=>_0x3f2f4b['connection'][_0x349746(0x11a)](),{'verbose':_0x50385b[_0x349746(0xfc)]})[_0x349746(0xc2)](_0x36f88c=>_0x36f88c[_0x349746(0xbc)]),_0x5283ed=[],_0x3c04f1=a35_0x54fe0a[_0x349746(0xf8)](_0x532774,'tdx.json'),_0x4ddbd4=createTdxConfigContent(_0x49e9f9);_0x5283ed['push'](prepareFile(_0x3c04f1,_0x4ddbd4,_0x532774));const _0x27eddf=new Map();for(const _0x608405 of _0x2bea74){if(_0x608405[_0x349746(0xf3)]===SEGMENT_KIND_JOURNEY)continue;const _0x44ac67=_0x608405[_0x349746(0xb2)]?_0x3d7f04[_0x349746(0x120)](_0x608405[_0x349746(0xb2)])||'':'',_0x11b71f=_0x4363fb[_0x349746(0x120)](_0x608405['id'])||[],_0x25c845=segmentWithActivationsToYaml(_0x608405,_0x11b71f,undefined,_0x29a7cd,_0x14bb15),_0x47abda=_0x44ac67?a35_0x54fe0a[_0x349746(0xf8)](_0x532774,_0x44ac67):_0x532774,_0x12fd3a=sanitizeFileName(_0x608405['name']),_0xd69f7=getUniqueFileName(_0x47abda,_0x12fd3a,_0x27eddf),_0x2933ed=a35_0x54fe0a[_0x349746(0xf8)](_0x47abda,_0xd69f7+_0x349746(0xfb)),_0x593677=segmentToYamlString(_0x25c845);_0x5283ed[_0x349746(0x11f)](prepareFile(_0x2933ed,_0x593677,_0x532774));}const _0x5e3a31=new Map();for(const _0x37d6d0 of _0x2bea74){_0x5e3a31[_0x349746(0x108)](_0x37d6d0['id'],_0x37d6d0);}const _0xa62319=new Map();for(const _0x2b7d35 of _0x2cc2fe){const _0x52a548=_0x2b7d35['journeyBundleId'];!_0xa62319[_0x349746(0xbd)](_0x52a548)&&_0xa62319[_0x349746(0x108)](_0x52a548,[]),_0xa62319[_0x349746(0x120)](_0x52a548)[_0x349746(0x11f)](_0x2b7d35);}for(const _0x2052e2 of _0xa62319[_0x349746(0xeb)]()){_0x2052e2[_0x349746(0xae)]((_0x3350be,_0x330f54)=>(_0x3350be[_0x349746(0x111)]||0x0)-(_0x330f54[_0x349746(0x111)]||0x0));}const _0x269409=()=>{const _0x2b3d1a=_0x349746,_0x313bbf=new Set(),_0x469425=new Set(),_0x56dc0a=new Map(),_0x1c7a19=new Map(),_0x5da176=createJumpTargetCache(),_0xca1636=(_0x543315,_0x482fb6)=>({'resolveSegment':async _0x559eda=>{const _0x257f80=a35_0x5a42,_0x561907=_0x56dc0a[_0x257f80(0x120)](_0x559eda);if(_0x561907!==undefined)return{'name':_0x561907,'isJourneyLocal':!![]};if(!_0x482fb6)return{'name':_0x559eda,'isJourneyLocal':![]};try{let _0x9d95f9=_0x5e3a31[_0x257f80(0x120)](_0x559eda);!_0x9d95f9&&(_0x9d95f9=await _0x3f2f4b[_0x257f80(0x102)]['getSegment'](_0x482fb6,_0x559eda));const _0x5d806f=generateJourneyLocalName(_0x9d95f9[_0x257f80(0xc9)]),_0x41924a=_0x9d95f9['kind']===SEGMENT_KIND_JOURNEY&&_0x5d806f!==undefined;let _0x26a79b=_0x9d95f9['name'];if(_0x41924a&&_0x5d806f){let _0x29bf47=_0x5d806f,_0x107b7d=0x2;while(_0x313bbf[_0x257f80(0xbd)](_0x29bf47)){_0x29bf47=_0x5d806f+'_'+_0x107b7d,_0x107b7d++;}_0x313bbf[_0x257f80(0xef)](_0x29bf47),_0x26a79b=_0x29bf47,_0x56dc0a[_0x257f80(0x108)](_0x559eda,_0x26a79b);}let _0x857063;if(_0x41924a&&_0x9d95f9[_0x257f80(0xe1)]){let _0x494ccc=apiRuleToYaml(_0x9d95f9[_0x257f80(0xe1)]);_0x494ccc=await resolveRuleSegmentRefs(_0x494ccc,async _0x42ca0a=>{const _0x27b5b3=_0x257f80,_0x129ab3=await _0x3f2f4b[_0x27b5b3(0x102)][_0x27b5b3(0xcf)](_0x482fb6,_0x42ca0a);return _0x129ab3[_0x27b5b3(0xc9)];}),_0x857063={'description':_0x9d95f9['description'],'rule':_0x494ccc};}return{'name':_0x26a79b,'isJourneyLocal':_0x41924a,'definition':_0x857063};}catch(_0x461d22){return _0x50385b[_0x257f80(0xfc)]&&console[_0x257f80(0xe4)](_0x257f80(0xe5)+_0x559eda+':\x20'+_0x461d22[_0x257f80(0xba)]),{'name':_0x559eda,'isJourneyLocal':![]};}},'resolveActivation':async _0x1d06de=>{const _0x53f766=a35_0x5a42,_0x26ecb0=_0x1c7a19[_0x53f766(0x120)](_0x1d06de);if(_0x26ecb0!==undefined)return{'name':_0x26ecb0,'isJourneyLocal':!![]};try{const _0x5b8c3c=await _0x3f2f4b[_0x53f766(0x106)][_0x53f766(0xac)](_0x543315,_0x1d06de),_0x57eeb9=_0x5b8c3c['attributes']['activationParams']['name']||_0x1d06de,_0x460bab=sanitizeYamlKey(_0x57eeb9)||_0x53f766(0xd7)+_0x1d06de;let _0x232ec9=_0x460bab,_0x6a2f89=0x2;while(_0x469425['has'](_0x232ec9)){_0x232ec9=_0x460bab+'_'+_0x6a2f89,_0x6a2f89++;}_0x469425[_0x53f766(0xef)](_0x232ec9),_0x1c7a19[_0x53f766(0x108)](_0x1d06de,_0x232ec9);const _0x10b293=journeyActivationStepToYaml(_0x5b8c3c,_0x29a7cd,_0x14bb15);return{'name':_0x232ec9,'isJourneyLocal':!![],'definition':_0x10b293};}catch(_0x4afb1a){return _0x50385b[_0x53f766(0xfc)]&&console[_0x53f766(0xe4)](_0x53f766(0x119)+_0x1d06de+':\x20'+_0x4afb1a[_0x53f766(0xba)]),{'name':_0x1d06de,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x49bd96,_0x3d1347)=>resolveJumpTarget(_0x49bd96,_0x3d1347,_0x5da176,_0x58e079=>_0x3f2f4b[_0x2b3d1a(0x106)][_0x2b3d1a(0xf2)](_0x58e079))});return{'createYamlContext':_0xca1636};};if(_0xa62319[_0x349746(0xd0)]>0x0){const _0x1e91dd=Array[_0x349746(0xc5)](_0xa62319[_0x349746(0xeb)]()),_0x2177a0=await withQuerySpinner(_0x349746(0xd8),async _0x2f5251=>{const _0x30d1e9=_0x349746,_0x4c3e4c=[];let _0x2a9657=0x0;const _0x4063e4=0x5;for(let _0x59679b=0x0;_0x59679b<_0x1e91dd[_0x30d1e9(0x113)];_0x59679b+=_0x4063e4){const _0x5da26d=_0x1e91dd[_0x30d1e9(0xb4)](_0x59679b,_0x59679b+_0x4063e4),_0x55cb09=await Promise[_0x30d1e9(0xfd)](_0x5da26d[_0x30d1e9(0x10a)](async _0x2d137d=>{const _0x3c624e=_0x30d1e9,_0x52d0d3=_0x2d137d[0x0],_0x56755c=_0x52d0d3[_0x3c624e(0xd6)];_0x2f5251[_0x3c624e(0xec)](_0x3c624e(0x10e)+_0x56755c+'\x27');const _0x2c9efb=_0x52d0d3[_0x3c624e(0xd5)]?_0x3d7f04['get'](_0x52d0d3[_0x3c624e(0xd5)])||'':'',{createYamlContext:_0x472168}=_0x269409(),_0x35e058=[];for(const _0xfbfc65 of _0x2d137d){const _0x391dec=await _0x3f2f4b[_0x3c624e(0x106)][_0x3c624e(0xf2)](_0xfbfc65['id']),_0x12a7d2=_0x391dec[_0x3c624e(0xca)]?.[_0x3c624e(0xb5)],_0x1bd6e9=_0x472168(_0xfbfc65['id'],_0x12a7d2),_0x55ff92=await apiToYamlAsync(_0x391dec,_0x1bd6e9);_0x35e058['push']({'item':_0xfbfc65,'yaml':_0x55ff92});}let _0x2e4e87;return _0x35e058['length']===0x1?_0x2e4e87=_0x35e058[0x0]['yaml']:_0x2e4e87=buildMergedJourneyYaml(_0x35e058),{'bundleName':_0x56755c,'folderPath':_0x2c9efb,'finalYaml':_0x2e4e87};}));_0x4c3e4c['push'](..._0x55cb09),_0x2a9657+=_0x5da26d[_0x30d1e9(0x113)],_0x2f5251[_0x30d1e9(0xea)]('('+_0x2a9657+'/'+_0x1e91dd[_0x30d1e9(0x113)]+')');}return _0x4c3e4c;},{'verbose':_0x50385b['verbose']});for(const {bundleName:_0x1c1886,folderPath:_0x3010a3,finalYaml:_0x2753ae}of _0x2177a0[_0x349746(0xbc)]){const _0x407077=normalizeJourneyYaml(_0x2753ae),_0x307c5e=a35_0x2fefb2(_0x407077),_0x1b6ae6=_0x3010a3?a35_0x54fe0a['join'](_0x532774,_0x3010a3):_0x532774,_0x4983b7=sanitizeFileName(_0x1c1886),_0x2049d9=getUniqueFileName(_0x1b6ae6,_0x4983b7,_0x27eddf),_0x11524d=a35_0x54fe0a[_0x349746(0xf8)](_0x1b6ae6,_0x2049d9+_0x349746(0xfb));_0x5283ed[_0x349746(0x11f)](prepareFile(_0x11524d,_0x307c5e,_0x532774));}}const _0x2f069a=Array[_0x349746(0xc5)](_0x4363fb[_0x349746(0xeb)]())[_0x349746(0x107)]((_0x1214c9,_0x41d96a)=>_0x1214c9+_0x41d96a[_0x349746(0x113)],0x0),_0x15f62d=_0x5283ed['filter'](_0x185446=>_0x185446[_0x349746(0xf0)]),_0x4623a0=_0x5283ed[_0x349746(0xb7)](_0x2c739e=>!_0x2c739e[_0x349746(0xf0)]&&_0x2c739e['hasChanges']),_0x395290=_0x5283ed[_0x349746(0xb7)](_0x1ac1d4=>!_0x1ac1d4[_0x349746(0xf0)]&&!_0x1ac1d4[_0x349746(0xd4)]),_0x52facf=_0x2bea74[_0x349746(0xb7)](_0xed61a5=>_0xed61a5[_0x349746(0xf3)]!==SEGMENT_KIND_JOURNEY);console[_0x349746(0xe4)](_0x349746(0xcc)+_0x49e9f9+'\x27:'),console[_0x349746(0xe4)]('\x20\x20🎯\x20'+a35_0x352a8d[_0x349746(0xd3)](_0x52facf[_0x349746(0x113)]+_0x349746(0xe2))+_0x349746(0x110)+a35_0x352a8d['cyan'](_0x2f069a+_0x349746(0xbe)));if(_0xa62319[_0x349746(0xd0)]>0x0){const _0x48d546=_0x2cc2fe[_0x349746(0x113)],_0x2c2750=_0xa62319[_0x349746(0xd0)],_0x3a4838=_0x48d546>_0x2c2750?'\x20('+_0x48d546+_0x349746(0xe3):'';console[_0x349746(0xe4)]('\x20\x20🗺️\x20\x20'+a35_0x352a8d[_0x349746(0xd3)](_0x2c2750+_0x349746(0x121))+a35_0x352a8d['dim'](_0x3a4838));}console[_0x349746(0xe4)]('\x20\x20'+a35_0x352a8d[_0x349746(0x101)]('+\x20'+_0x15f62d[_0x349746(0x113)]+'\x20new\x20files')),console[_0x349746(0xe4)]('\x20\x20'+a35_0x352a8d['yellow']('~\x20'+_0x4623a0[_0x349746(0x113)]+'\x20changed\x20files')),console[_0x349746(0xe4)]('\x20\x20'+a35_0x352a8d['dim']('=\x20'+_0x395290[_0x349746(0x113)]+_0x349746(0xad))),console['error'](_0x349746(0xed)+a35_0x352a8d['cyan'](_0x532774)+'\x0a');if(_0x4623a0[_0x349746(0x113)]>0x0)for(const _0x190b04 of _0x4623a0){console['error'](_0x349746(0xdd)+_0x190b04[_0x349746(0x112)]+'\x27:'),console['error']('─'[_0x349746(0xf9)](0x3c)),console['error'](_0x190b04['diff']),console[_0x349746(0xe4)]('─'[_0x349746(0xf9)](0x3c));}if(_0x50385b[_0x349746(0xc1)])return console[_0x349746(0xe4)](a35_0x352a8d[_0x349746(0x11b)](_0x349746(0xb0))),0x0;if(_0x15f62d[_0x349746(0x113)]===0x0&&_0x4623a0[_0x349746(0x113)]===0x0)return console[_0x349746(0xe4)](a35_0x352a8d[_0x349746(0x101)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x49e9f9},_0x50385b[_0x349746(0xb6)]),console[_0x349746(0xe4)](a35_0x352a8d[_0x349746(0x101)](_0x349746(0xb9)+a35_0x352a8d['dim']('parent_segment')+_0x349746(0xb3)+a35_0x352a8d['cyan'](_0x49e9f9))),0x0;if(!_0x50385b[_0x349746(0xf5)]&&(_0x15f62d[_0x349746(0x113)]>0x0||_0x4623a0[_0x349746(0x113)]>0x0)){const _0x4e8e7a=await confirmKey('Write\x20'+(_0x15f62d[_0x349746(0x113)]+_0x4623a0[_0x349746(0x113)])+'\x20files?');if(!_0x4e8e7a)return console[_0x349746(0xe4)]('Aborted.'),0x1;}for(const _0x46e97d of _0x5283ed){if(_0x46e97d[_0x349746(0xf0)]||_0x46e97d['hasChanges']){const _0x34eaf3=a35_0x54fe0a[_0x349746(0x10f)](_0x46e97d['absolutePath']);!existsSync(_0x34eaf3)&&mkdirSync(_0x34eaf3,{'recursive':!![]}),writeFileSync(_0x46e97d[_0x349746(0x115)],_0x46e97d[_0x349746(0xdc)],_0x349746(0xf7));}}return console[_0x349746(0xe4)](a35_0x352a8d[_0x349746(0x101)](_0x349746(0xe7)+(_0x15f62d['length']+_0x4623a0[_0x349746(0x113)])+_0x349746(0xc8)+_0x532774)),saveSessionContext({'parent_segment':_0x49e9f9},_0x50385b[_0x349746(0xb6)]),console[_0x349746(0xe4)](a35_0x352a8d[_0x349746(0x101)](_0x349746(0xb9)+a35_0x352a8d[_0x349746(0x122)]('parent_segment')+'\x20=\x20'+a35_0x352a8d['cyan'](_0x49e9f9))),0x0;}}export function buildFolderPathMap(_0x293c2a){const _0x11310d=a35_0xcfcc47,_0xf3f07a=new Map(),_0x3816ea=new Map();for(const _0x3f1ff3 of _0x293c2a){_0x3816ea['set'](_0x3f1ff3['id'],_0x3f1ff3);}const _0x430d42=new Set();for(const _0x18e979 of _0x293c2a){!_0x18e979[_0x11310d(0xfa)]&&_0x430d42['add'](_0x18e979['id']);}function _0x383c8e(_0x3ef1b4){const _0xfc6102=_0x11310d;if(_0xf3f07a[_0xfc6102(0xbd)](_0x3ef1b4['id']))return _0xf3f07a[_0xfc6102(0x120)](_0x3ef1b4['id']);if(_0x430d42[_0xfc6102(0xbd)](_0x3ef1b4['id']))return _0xf3f07a[_0xfc6102(0x108)](_0x3ef1b4['id'],''),'';if(_0x3ef1b4[_0xfc6102(0xfa)]){const _0x200ce1=_0x3816ea[_0xfc6102(0x120)](_0x3ef1b4[_0xfc6102(0xfa)]);if(_0x200ce1){const _0x36a938=_0x383c8e(_0x200ce1),_0x3bce75=_0x36a938?_0x36a938+'/'+_0x3ef1b4[_0xfc6102(0xc9)]:_0x3ef1b4['name'];return _0xf3f07a[_0xfc6102(0x108)](_0x3ef1b4['id'],_0x3bce75),_0x3bce75;}}const _0x1045c4=_0x3ef1b4['name'];return _0xf3f07a[_0xfc6102(0x108)](_0x3ef1b4['id'],_0x1045c4),_0x1045c4;}for(const _0x2ea720 of _0x293c2a){_0x383c8e(_0x2ea720);}return _0xf3f07a;}function getUniqueFileName(_0x4dcbbc,_0x999572,_0x4b5a8b){const _0x527085=a35_0xcfcc47,_0x1faa08=_0x4dcbbc+':'+_0x999572,_0x458f67=_0x4b5a8b[_0x527085(0x120)](_0x1faa08)||0x0;_0x4b5a8b[_0x527085(0x108)](_0x1faa08,_0x458f67+0x1);if(_0x458f67===0x0)return _0x999572;return _0x999572+'-'+_0x458f67;}function a35_0x5a42(_0x2bf1d3,_0x3feee9){_0x2bf1d3=_0x2bf1d3-0xab;const _0x34ea1a=a35_0x34ea();let _0x5a4235=_0x34ea1a[_0x2bf1d3];return _0x5a4235;}function prepareFile(_0x48a806,_0x57c0b0,_0x1c9de8){const _0x50cf56=a35_0xcfcc47,_0x1d778a=a35_0x54fe0a[_0x50cf56(0x10b)](_0x1c9de8,_0x48a806);if(existsSync(_0x48a806)){const _0x11ada1=readFileSync(_0x48a806,'utf-8'),_0x124f6d=generateDiff(_0x11ada1,_0x57c0b0),_0x47db37=hasChanges(_0x124f6d);return{'relativePath':_0x1d778a,'absolutePath':_0x48a806,'content':_0x57c0b0,'isNew':![],'hasChanges':_0x47db37,'diff':_0x47db37?formatDiffWithColors(_0x124f6d):undefined};}return{'relativePath':_0x1d778a,'absolutePath':_0x48a806,'content':_0x57c0b0,'isNew':!![],'hasChanges':![]};}
|
|
1
|
+
const a35_0x4caf22=a35_0x1d73;(function(_0x350a22,_0x2856b5){const _0x2052e2=a35_0x1d73,_0x40fa51=_0x350a22();while(!![]){try{const _0x269c44=-parseInt(_0x2052e2(0x197))/0x1*(parseInt(_0x2052e2(0x194))/0x2)+parseInt(_0x2052e2(0x191))/0x3*(-parseInt(_0x2052e2(0x189))/0x4)+parseInt(_0x2052e2(0x17b))/0x5+parseInt(_0x2052e2(0x176))/0x6*(-parseInt(_0x2052e2(0x193))/0x7)+parseInt(_0x2052e2(0x15b))/0x8+parseInt(_0x2052e2(0x196))/0x9+parseInt(_0x2052e2(0x15d))/0xa*(-parseInt(_0x2052e2(0x19c))/0xb);if(_0x269c44===_0x2856b5)break;else _0x40fa51['push'](_0x40fa51['shift']());}catch(_0x54fc8e){_0x40fa51['push'](_0x40fa51['shift']());}}}(a35_0x4ace,0x4e946));function a35_0x1d73(_0xd6c49b,_0x444023){_0xd6c49b=_0xd6c49b-0x14b;const _0x4ace50=a35_0x4ace();let _0x1d736d=_0x4ace50[_0xd6c49b];return _0x1d736d;}function a35_0x4ace(){const _0x1b49f4=['user','activation_','setPhase','connection','Aborted.','get','setExtra','\x20\x20🗺️\x20\x20','versionNumber','4086832HHeSLx','Fetching\x20segments...','60nuKyNa','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','join','Resolved\x20parent\x20name:\x20','data','audienceId','Using\x20parent\x20segment:\x20','buildIdToEmailMap','\x0aPull\x20summary\x20for\x20\x27','add','segment:pull','Fetching\x20journey\x20\x27','\x0aChanges\x20to\x20\x27','listActivations','push','\x20versions)','from','all','tdx.json','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','error','session','\x27...','yaml','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','12LiWrxk','parentSegment','\x20\x20🎯\x20','relative','journeyBundleName','1198010AOnKAl','has','message','Found\x20existing\x20tdx.json\x20at:\x20','description','getSegment','getParent','\x20new\x20files','✔\x20Pulled\x20','map','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','size','attributes','1692QzabUd','segmentFolderId','cyan','folderId','sort','repeat','Warning:\x20Could\x20not\x20resolve\x20activation\x20','parentFolderId','2889YGCRRb','execute','298837fUyhsp','2STocnZ','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','3279366VLfkmx','295725moCWOQ','.yml','yellow','dim','utf-8','8272MOYaEv','Found\x20tdx.json\x20at:\x20','reduce','isNew','segment','\x20files\x20to\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resolveParentId','length','slice','Write\x20','Fetching\x20activations...','parent_segment','Fetching\x20parent\x20segment\x20info...','Processing\x20journeys...','diff','Fetching\x20journeys...','site','\x20with\x20','kind','name','journeyBundleId','content','getActivation','Site:\x20','\x20changed\x20files','\x20journeys','hasChanges','red','journey','dryRun','Resolving\x20parent\x20segment\x20\x27','then','verbose','rule','listSegments','\x20=\x20','Fetching\x20connections\x20for\x20name\x20resolution...','\x20unchanged\x20files','absolutePath','getJourney','yes','dirname','Fetching\x20users\x20for\x20email\x20resolution...','✔\x20Context\x20set:\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','set','green','values','\x20activations'];a35_0x4ace=function(){return _0x1b49f4;};return a35_0x4ace();}import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,resolveRuleSegmentRefs,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a35_0x2d524f,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a35_0x1840f2 from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a35_0x4c8437 from'path';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{[a35_0x4caf22(0x1b0)]=a35_0x4caf22(0x167);['description']=a35_0x4caf22(0x14d);async[a35_0x4caf22(0x192)](_0x199137){const _0x351ce2=a35_0x4caf22,{options:_0xbf1f08,args:_0x213734,tdx:_0x4c650c}=_0x199137,_0x2a09a6=_0xbf1f08,_0x276069=_0xbf1f08[_0x351ce2(0x177)],_0x282819=_0x213734[0x0],_0x2febb6=findTdxConfigPath();let _0x15d98a,_0x2208cb;if(!_0x282819&&_0x2febb6){const _0x25b024=loadTdxConfig(_0x2febb6);_0x15d98a=_0x25b024[_0x351ce2(0x1a8)],_0x2208cb=a35_0x4c8437[_0x351ce2(0x1c6)](_0x2febb6),_0x2a09a6[_0x351ce2(0x1bd)]&&(console[_0x351ce2(0x171)](_0x351ce2(0x17e)+_0x2febb6),console['error'](_0x351ce2(0x163)+_0x15d98a));}else{if(_0x282819){if(existsSync(_0x282819)&&statSync(_0x282819)['isDirectory']()){const _0x5a8fbd=findTdxConfigPath(_0x282819);if(_0x5a8fbd){const _0x32e72d=loadTdxConfig(_0x5a8fbd);_0x15d98a=_0x32e72d[_0x351ce2(0x1a8)],_0x2208cb=a35_0x4c8437[_0x351ce2(0x1c6)](_0x5a8fbd),_0x2a09a6[_0x351ce2(0x1bd)]&&(console['error'](_0x351ce2(0x19d)+_0x5a8fbd),console['error'](_0x351ce2(0x163)+_0x15d98a));}else return console[_0x351ce2(0x171)](a35_0x1840f2[_0x351ce2(0x1b8)](_0x351ce2(0x186)+_0x282819+'\x0a')),console[_0x351ce2(0x171)](a35_0x1840f2[_0x351ce2(0x18b)](_0x351ce2(0x195))),0x1;}else _0x15d98a=_0x282819;}else _0x15d98a=_0x276069;}if(!_0x15d98a)return console['error'](a35_0x1840f2[_0x351ce2(0x199)](_0x351ce2(0x1a2))),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x351ce2(0x171)](_0x351ce2(0x185)),console[_0x351ce2(0x171)](_0x351ce2(0x170)),0x1;_0x2a09a6[_0x351ce2(0x1bd)]&&(console[_0x351ce2(0x171)](_0x351ce2(0x1b4)+_0x2a09a6[_0x351ce2(0x1ad)]),console['error']('Parent\x20segment:\x20'+_0x15d98a));const _0x57cb25=await withSpinner(_0x351ce2(0x1bb)+_0x15d98a+_0x351ce2(0x173),()=>_0x4c650c[_0x351ce2(0x1a0)][_0x351ce2(0x1a3)](_0x15d98a),{'verbose':_0x2a09a6[_0x351ce2(0x1bd)]}),_0x2b2047=_0x57cb25[_0x351ce2(0x161)],_0x4746a=await withSpinner(_0x351ce2(0x1a9),()=>_0x4c650c['segment'][_0x351ce2(0x181)](_0x2b2047),{'verbose':_0x2a09a6[_0x351ce2(0x1bd)]}),_0x42c5b4=_0x4746a[_0x351ce2(0x161)][_0x351ce2(0x188)][_0x351ce2(0x1b0)];_0x2a09a6['verbose']&&console[_0x351ce2(0x171)](_0x351ce2(0x160)+_0x42c5b4);const [_0x4f2760,_0x40f184,_0x6a5281]=await Promise[_0x351ce2(0x16e)]([withSpinner(_0x351ce2(0x15c),()=>_0x4c650c['segment'][_0x351ce2(0x1bf)](_0x2b2047),{'verbose':_0x2a09a6[_0x351ce2(0x1bd)]}),withSpinner('Fetching\x20folders...',()=>_0x4c650c[_0x351ce2(0x1a0)]['listFolders'](_0x2b2047),{'verbose':_0x2a09a6[_0x351ce2(0x1bd)]}),withSpinner(_0x351ce2(0x1ac),()=>_0x4c650c[_0x351ce2(0x1b9)]['listJourneysFromParentSegment'](_0x2b2047),{'verbose':_0x2a09a6['verbose']})]),_0xd3b0c2=_0x4f2760[_0x351ce2(0x161)],_0x265e3d=_0x40f184[_0x351ce2(0x161)],_0x1ffe0e=_0x6a5281['data'];if(_0xd3b0c2[_0x351ce2(0x1a4)]===0x0&&_0x1ffe0e[_0x351ce2(0x1a4)]===0x0)return console[_0x351ce2(0x171)](a35_0x1840f2['yellow'](_0x351ce2(0x175)+_0x42c5b4+'\x27')),0x0;const _0x186f0e=buildFolderPathMap(_0x265e3d),_0x22a4b4=_0x2208cb||getSegmentRootDir(sanitizeFileName(_0x15d98a)),_0x144286=new Map();await withSpinner(_0x351ce2(0x1a7),async()=>{await batchAsync(_0xd3b0c2,async _0x1d2ed0=>{const _0x7b317f=a35_0x1d73,_0x123597=await _0x4c650c[_0x7b317f(0x1a0)][_0x7b317f(0x16a)](_0x2b2047,_0x1d2ed0['id']);_0x144286[_0x7b317f(0x14e)](_0x1d2ed0['id'],_0x123597);});},{'verbose':_0x2a09a6[_0x351ce2(0x1bd)]});const _0x1b39c5=await withSpinner(_0x351ce2(0x14b),()=>_0x4c650c[_0x351ce2(0x152)][_0x351ce2(0x164)](),{'verbose':_0x2a09a6[_0x351ce2(0x1bd)]})[_0x351ce2(0x1bc)](_0x3cab06=>_0x3cab06['data']),_0x472734=await withSpinner(_0x351ce2(0x1c1),()=>_0x4c650c[_0x351ce2(0x155)]['buildIdToNameMap'](),{'verbose':_0x2a09a6[_0x351ce2(0x1bd)]})[_0x351ce2(0x1bc)](_0x194010=>_0x194010[_0x351ce2(0x161)]),_0x53d3cc=[],_0x12d33b=a35_0x4c8437[_0x351ce2(0x15f)](_0x22a4b4,_0x351ce2(0x16f)),_0x5c40b2=createTdxConfigContent(_0x42c5b4);_0x53d3cc[_0x351ce2(0x16b)](prepareFile(_0x12d33b,_0x5c40b2,_0x22a4b4));const _0x8f90ac=new Map();for(const _0x4c39e9 of _0xd3b0c2){if(_0x4c39e9[_0x351ce2(0x1af)]===SEGMENT_KIND_JOURNEY)continue;const _0x1af859=_0x4c39e9[_0x351ce2(0x18a)]?_0x186f0e[_0x351ce2(0x157)](_0x4c39e9[_0x351ce2(0x18a)])||'':'',_0x45f45b=_0x144286[_0x351ce2(0x157)](_0x4c39e9['id'])||[],_0x88764=segmentWithActivationsToYaml(_0x4c39e9,_0x45f45b,undefined,_0x1b39c5,_0x472734),_0x5aea01=_0x1af859?a35_0x4c8437[_0x351ce2(0x15f)](_0x22a4b4,_0x1af859):_0x22a4b4,_0x24a9b0=sanitizeFileName(_0x4c39e9['name']),_0x56a9e9=getUniqueFileName(_0x5aea01,_0x24a9b0,_0x8f90ac),_0x1d6952=a35_0x4c8437['join'](_0x5aea01,_0x56a9e9+'.yml'),_0x1dd760=segmentToYamlString(_0x88764);_0x53d3cc[_0x351ce2(0x16b)](prepareFile(_0x1d6952,_0x1dd760,_0x22a4b4));}const _0x1d44af=new Map();for(const _0x236d2c of _0xd3b0c2){_0x1d44af[_0x351ce2(0x14e)](_0x236d2c['id'],_0x236d2c);}const _0x276b9f=new Map();for(const _0x435b75 of _0x1ffe0e){const _0x4977d0=_0x435b75[_0x351ce2(0x1b1)];!_0x276b9f[_0x351ce2(0x17c)](_0x4977d0)&&_0x276b9f[_0x351ce2(0x14e)](_0x4977d0,[]),_0x276b9f[_0x351ce2(0x157)](_0x4977d0)['push'](_0x435b75);}for(const _0x39739b of _0x276b9f[_0x351ce2(0x150)]()){_0x39739b[_0x351ce2(0x18d)]((_0x5c7f87,_0x47c79c)=>(_0x5c7f87[_0x351ce2(0x15a)]||0x0)-(_0x47c79c[_0x351ce2(0x15a)]||0x0));}const _0x584727=()=>{const _0x1cf66f=_0x351ce2,_0x28a1fc=new Set(),_0x55af99=new Set(),_0x1c75c3=new Map(),_0x4301d9=new Map(),_0x3f5f12=createJumpTargetCache(),_0x1649b3=(_0x56574b,_0x511cbd)=>({'resolveSegment':async _0x3b58a8=>{const _0x44526e=a35_0x1d73,_0x2fc2b1=_0x1c75c3['get'](_0x3b58a8);if(_0x2fc2b1!==undefined)return{'name':_0x2fc2b1,'isJourneyLocal':!![]};if(!_0x511cbd)return{'name':_0x3b58a8,'isJourneyLocal':![]};try{let _0x4e03ab=_0x1d44af['get'](_0x3b58a8);!_0x4e03ab&&(_0x4e03ab=await _0x4c650c[_0x44526e(0x1a0)][_0x44526e(0x180)](_0x511cbd,_0x3b58a8));const _0x87245f=generateJourneyLocalName(_0x4e03ab['name']),_0x25cf71=_0x4e03ab['kind']===SEGMENT_KIND_JOURNEY&&_0x87245f!==undefined;let _0x287809=_0x4e03ab[_0x44526e(0x1b0)];if(_0x25cf71&&_0x87245f){let _0x265546=_0x87245f,_0x1813fa=0x2;while(_0x28a1fc['has'](_0x265546)){_0x265546=_0x87245f+'_'+_0x1813fa,_0x1813fa++;}_0x28a1fc[_0x44526e(0x166)](_0x265546),_0x287809=_0x265546,_0x1c75c3['set'](_0x3b58a8,_0x287809);}let _0x17148c;if(_0x25cf71&&_0x4e03ab[_0x44526e(0x1be)]){let _0x214a47=apiRuleToYaml(_0x4e03ab[_0x44526e(0x1be)]);_0x214a47=await resolveRuleSegmentRefs(_0x214a47,async _0x590035=>{const _0x3aefca=_0x44526e,_0x27ee5f=await _0x4c650c[_0x3aefca(0x1a0)][_0x3aefca(0x180)](_0x511cbd,_0x590035);return _0x27ee5f['name'];}),_0x17148c={'description':_0x4e03ab[_0x44526e(0x17f)],'rule':_0x214a47};}return{'name':_0x287809,'isJourneyLocal':_0x25cf71,'definition':_0x17148c};}catch(_0x374f1e){return _0x2a09a6[_0x44526e(0x1bd)]&&console[_0x44526e(0x171)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x3b58a8+':\x20'+_0x374f1e[_0x44526e(0x17d)]),{'name':_0x3b58a8,'isJourneyLocal':![]};}},'resolveActivation':async _0x28563f=>{const _0x56d648=a35_0x1d73,_0xf9a7cd=_0x4301d9[_0x56d648(0x157)](_0x28563f);if(_0xf9a7cd!==undefined)return{'name':_0xf9a7cd,'isJourneyLocal':!![]};try{const _0x17f967=await _0x4c650c['journey'][_0x56d648(0x1b3)](_0x56574b,_0x28563f),_0xe32ad=_0x17f967[_0x56d648(0x188)]['activationParams']['name']||_0x28563f,_0xe94c5b=sanitizeYamlKey(_0xe32ad)||_0x56d648(0x153)+_0x28563f;let _0x188122=_0xe94c5b,_0x2d10a8=0x2;while(_0x55af99['has'](_0x188122)){_0x188122=_0xe94c5b+'_'+_0x2d10a8,_0x2d10a8++;}_0x55af99[_0x56d648(0x166)](_0x188122),_0x4301d9[_0x56d648(0x14e)](_0x28563f,_0x188122);const _0x36d90b=journeyActivationStepToYaml(_0x17f967,_0x1b39c5,_0x472734);return{'name':_0x188122,'isJourneyLocal':!![],'definition':_0x36d90b};}catch(_0x59af3d){return _0x2a09a6[_0x56d648(0x1bd)]&&console[_0x56d648(0x171)](_0x56d648(0x18f)+_0x28563f+':\x20'+_0x59af3d['message']),{'name':_0x28563f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2fb666,_0x10b0b0)=>resolveJumpTarget(_0x2fb666,_0x10b0b0,_0x3f5f12,_0x5b70e0=>_0x4c650c[_0x1cf66f(0x1b9)][_0x1cf66f(0x1c4)](_0x5b70e0))});return{'createYamlContext':_0x1649b3};};if(_0x276b9f[_0x351ce2(0x187)]>0x0){const _0x207276=Array[_0x351ce2(0x16d)](_0x276b9f[_0x351ce2(0x150)]()),_0x3c1056=await withQuerySpinner(_0x351ce2(0x1aa),async _0x38b335=>{const _0x58f6a9=_0x351ce2,_0x3f7fcb=[];let _0xe40d42=0x0;const _0x48149f=0x5;for(let _0xba6672=0x0;_0xba6672<_0x207276[_0x58f6a9(0x1a4)];_0xba6672+=_0x48149f){const _0x5616da=_0x207276[_0x58f6a9(0x1a5)](_0xba6672,_0xba6672+_0x48149f),_0x36d03a=await Promise['all'](_0x5616da[_0x58f6a9(0x184)](async _0x58dc68=>{const _0x4a7118=_0x58f6a9,_0x1620ed=_0x58dc68[0x0],_0x3050f7=_0x1620ed[_0x4a7118(0x17a)];_0x38b335[_0x4a7118(0x154)](_0x4a7118(0x168)+_0x3050f7+'\x27');const _0x30b43e=_0x1620ed[_0x4a7118(0x18c)]?_0x186f0e[_0x4a7118(0x157)](_0x1620ed['folderId'])||'':'',{createYamlContext:_0x3e9301}=_0x584727(),_0xe8016=[];for(const _0x42bea6 of _0x58dc68){const _0x5a6589=await _0x4c650c[_0x4a7118(0x1b9)]['getJourney'](_0x42bea6['id']),_0x56f0cb=_0x5a6589[_0x4a7118(0x188)]?.[_0x4a7118(0x162)],_0x51ac44=_0x3e9301(_0x42bea6['id'],_0x56f0cb),_0x71cb4a=await apiToYamlAsync(_0x5a6589,_0x51ac44);_0xe8016['push']({'item':_0x42bea6,'yaml':_0x71cb4a});}let _0x2b109f;return _0xe8016['length']===0x1?_0x2b109f=_0xe8016[0x0][_0x4a7118(0x174)]:_0x2b109f=buildMergedJourneyYaml(_0xe8016),{'bundleName':_0x3050f7,'folderPath':_0x30b43e,'finalYaml':_0x2b109f};}));_0x3f7fcb[_0x58f6a9(0x16b)](..._0x36d03a),_0xe40d42+=_0x5616da['length'],_0x38b335[_0x58f6a9(0x158)]('('+_0xe40d42+'/'+_0x207276[_0x58f6a9(0x1a4)]+')');}return _0x3f7fcb;},{'verbose':_0x2a09a6['verbose']});for(const {bundleName:_0x2bb0c6,folderPath:_0x542aa7,finalYaml:_0x2aaa51}of _0x3c1056[_0x351ce2(0x161)]){const _0x5a5003=normalizeJourneyYaml(_0x2aaa51),_0x579b7e=a35_0x2d524f(_0x5a5003),_0x127d1c=_0x542aa7?a35_0x4c8437['join'](_0x22a4b4,_0x542aa7):_0x22a4b4,_0x5b045f=sanitizeFileName(_0x2bb0c6),_0x446004=getUniqueFileName(_0x127d1c,_0x5b045f,_0x8f90ac),_0x4443ad=a35_0x4c8437[_0x351ce2(0x15f)](_0x127d1c,_0x446004+_0x351ce2(0x198));_0x53d3cc['push'](prepareFile(_0x4443ad,_0x579b7e,_0x22a4b4));}}const _0x8025fe=Array[_0x351ce2(0x16d)](_0x144286['values']())[_0x351ce2(0x19e)]((_0x1238aa,_0x87edd7)=>_0x1238aa+_0x87edd7[_0x351ce2(0x1a4)],0x0),_0x1df275=_0x53d3cc['filter'](_0x2dffab=>_0x2dffab[_0x351ce2(0x19f)]),_0x12ac30=_0x53d3cc['filter'](_0x15f294=>!_0x15f294[_0x351ce2(0x19f)]&&_0x15f294[_0x351ce2(0x1b7)]),_0x18dc72=_0x53d3cc['filter'](_0x2fbcaf=>!_0x2fbcaf[_0x351ce2(0x19f)]&&!_0x2fbcaf[_0x351ce2(0x1b7)]),_0x2fc41a=_0xd3b0c2['filter'](_0xf8ffc5=>_0xf8ffc5[_0x351ce2(0x1af)]!==SEGMENT_KIND_JOURNEY);console[_0x351ce2(0x171)](_0x351ce2(0x165)+_0x42c5b4+'\x27:'),console[_0x351ce2(0x171)](_0x351ce2(0x178)+a35_0x1840f2[_0x351ce2(0x18b)](_0x2fc41a[_0x351ce2(0x1a4)]+'\x20segments')+_0x351ce2(0x1ae)+a35_0x1840f2[_0x351ce2(0x18b)](_0x8025fe+_0x351ce2(0x151)));if(_0x276b9f['size']>0x0){const _0x59e41c=_0x1ffe0e[_0x351ce2(0x1a4)],_0x3b482c=_0x276b9f[_0x351ce2(0x187)],_0x41808d=_0x59e41c>_0x3b482c?'\x20('+_0x59e41c+_0x351ce2(0x16c):'';console[_0x351ce2(0x171)](_0x351ce2(0x159)+a35_0x1840f2[_0x351ce2(0x18b)](_0x3b482c+_0x351ce2(0x1b6))+a35_0x1840f2[_0x351ce2(0x19a)](_0x41808d));}console[_0x351ce2(0x171)]('\x20\x20'+a35_0x1840f2[_0x351ce2(0x14f)]('+\x20'+_0x1df275[_0x351ce2(0x1a4)]+_0x351ce2(0x182))),console['error']('\x20\x20'+a35_0x1840f2[_0x351ce2(0x199)]('~\x20'+_0x12ac30[_0x351ce2(0x1a4)]+_0x351ce2(0x1b5))),console[_0x351ce2(0x171)]('\x20\x20'+a35_0x1840f2[_0x351ce2(0x19a)]('=\x20'+_0x18dc72[_0x351ce2(0x1a4)]+_0x351ce2(0x1c2))),console['error']('\x20\x20Target:\x20'+a35_0x1840f2[_0x351ce2(0x18b)](_0x22a4b4)+'\x0a');if(_0x12ac30[_0x351ce2(0x1a4)]>0x0)for(const _0x1f07a8 of _0x12ac30){console['error'](_0x351ce2(0x169)+_0x1f07a8['relativePath']+'\x27:'),console['error']('─'[_0x351ce2(0x18e)](0x3c)),console[_0x351ce2(0x171)](_0x1f07a8[_0x351ce2(0x1ab)]),console['error']('─'[_0x351ce2(0x18e)](0x3c));}if(_0x2a09a6[_0x351ce2(0x1ba)])return console['error'](a35_0x1840f2[_0x351ce2(0x199)](_0x351ce2(0x15e))),0x0;if(_0x1df275['length']===0x0&&_0x12ac30['length']===0x0)return console['error'](a35_0x1840f2[_0x351ce2(0x14f)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x42c5b4},_0x2a09a6['session']),console['error'](a35_0x1840f2[_0x351ce2(0x14f)]('✔\x20Context\x20set:\x20'+a35_0x1840f2[_0x351ce2(0x19a)](_0x351ce2(0x1a8))+_0x351ce2(0x1c0)+a35_0x1840f2[_0x351ce2(0x18b)](_0x42c5b4))),0x0;if(!_0x2a09a6[_0x351ce2(0x1c5)]&&(_0x1df275[_0x351ce2(0x1a4)]>0x0||_0x12ac30[_0x351ce2(0x1a4)]>0x0)){const _0x26c1fc=await confirmKey(_0x351ce2(0x1a6)+(_0x1df275[_0x351ce2(0x1a4)]+_0x12ac30[_0x351ce2(0x1a4)])+'\x20files?');if(!_0x26c1fc)return console[_0x351ce2(0x171)](_0x351ce2(0x156)),0x1;}for(const _0x2172a7 of _0x53d3cc){if(_0x2172a7[_0x351ce2(0x19f)]||_0x2172a7[_0x351ce2(0x1b7)]){const _0x25bcb5=a35_0x4c8437['dirname'](_0x2172a7[_0x351ce2(0x1c3)]);!existsSync(_0x25bcb5)&&mkdirSync(_0x25bcb5,{'recursive':!![]}),writeFileSync(_0x2172a7[_0x351ce2(0x1c3)],_0x2172a7[_0x351ce2(0x1b2)],'utf-8');}}return console[_0x351ce2(0x171)](a35_0x1840f2[_0x351ce2(0x14f)](_0x351ce2(0x183)+(_0x1df275['length']+_0x12ac30['length'])+_0x351ce2(0x1a1)+_0x22a4b4)),saveSessionContext({'parent_segment':_0x42c5b4},_0x2a09a6[_0x351ce2(0x172)]),console[_0x351ce2(0x171)](a35_0x1840f2[_0x351ce2(0x14f)](_0x351ce2(0x14c)+a35_0x1840f2[_0x351ce2(0x19a)]('parent_segment')+_0x351ce2(0x1c0)+a35_0x1840f2[_0x351ce2(0x18b)](_0x42c5b4))),0x0;}}export function buildFolderPathMap(_0x52869a){const _0x36029f=a35_0x4caf22,_0x1b8796=new Map(),_0x40f4bf=new Map();for(const _0x4da1d4 of _0x52869a){_0x40f4bf[_0x36029f(0x14e)](_0x4da1d4['id'],_0x4da1d4);}const _0x17a848=new Set();for(const _0x5eb101 of _0x52869a){!_0x5eb101[_0x36029f(0x190)]&&_0x17a848[_0x36029f(0x166)](_0x5eb101['id']);}function _0x16b8e9(_0x2c255d){const _0x53141d=_0x36029f;if(_0x1b8796['has'](_0x2c255d['id']))return _0x1b8796['get'](_0x2c255d['id']);if(_0x17a848[_0x53141d(0x17c)](_0x2c255d['id']))return _0x1b8796[_0x53141d(0x14e)](_0x2c255d['id'],''),'';if(_0x2c255d[_0x53141d(0x190)]){const _0x1b4991=_0x40f4bf[_0x53141d(0x157)](_0x2c255d['parentFolderId']);if(_0x1b4991){const _0x3a7e5f=_0x16b8e9(_0x1b4991),_0x4c29f7=_0x3a7e5f?_0x3a7e5f+'/'+_0x2c255d[_0x53141d(0x1b0)]:_0x2c255d[_0x53141d(0x1b0)];return _0x1b8796[_0x53141d(0x14e)](_0x2c255d['id'],_0x4c29f7),_0x4c29f7;}}const _0x36a997=_0x2c255d['name'];return _0x1b8796[_0x53141d(0x14e)](_0x2c255d['id'],_0x36a997),_0x36a997;}for(const _0x289914 of _0x52869a){_0x16b8e9(_0x289914);}return _0x1b8796;}function getUniqueFileName(_0xe5507d,_0x408579,_0x5e0c14){const _0x45d058=a35_0x4caf22,_0x2f9997=_0xe5507d+':'+_0x408579,_0x1ae368=_0x5e0c14[_0x45d058(0x157)](_0x2f9997)||0x0;_0x5e0c14[_0x45d058(0x14e)](_0x2f9997,_0x1ae368+0x1);if(_0x1ae368===0x0)return _0x408579;return _0x408579+'-'+_0x1ae368;}function prepareFile(_0x3d88f0,_0x5deb01,_0x33a5b0){const _0x3b5380=a35_0x4caf22,_0x3bd498=a35_0x4c8437[_0x3b5380(0x179)](_0x33a5b0,_0x3d88f0);if(existsSync(_0x3d88f0)){const _0x131077=readFileSync(_0x3d88f0,_0x3b5380(0x19b)),_0x2f4243=generateDiff(_0x131077,_0x5deb01),_0x530a36=hasChanges(_0x2f4243);return{'relativePath':_0x3bd498,'absolutePath':_0x3d88f0,'content':_0x5deb01,'isNew':![],'hasChanges':_0x530a36,'diff':_0x530a36?formatDiffWithColors(_0x2f4243):undefined};}return{'relativePath':_0x3bd498,'absolutePath':_0x3d88f0,'content':_0x5deb01,'isNew':!![],'hasChanges':![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x3da80c=a36_0x2861;(function(_0x3e5b06,_0xef285d){const _0x546e5b=a36_0x2861,_0x28412a=_0x3e5b06();while(!![]){try{const _0x3abc0a=-parseInt(_0x546e5b(0x2bc))/0x1*(parseInt(_0x546e5b(0x217))/0x2)+-parseInt(_0x546e5b(0x22c))/0x3*(parseInt(_0x546e5b(0x260))/0x4)+-parseInt(_0x546e5b(0x20a))/0x5*(-parseInt(_0x546e5b(0x2b9))/0x6)+-parseInt(_0x546e5b(0x1f3))/0x7*(-parseInt(_0x546e5b(0x239))/0x8)+parseInt(_0x546e5b(0x1da))/0x9+-parseInt(_0x546e5b(0x2b0))/0xa*(-parseInt(_0x546e5b(0x2d4))/0xb)+parseInt(_0x546e5b(0x1de))/0xc*(parseInt(_0x546e5b(0x272))/0xd);if(_0x3abc0a===_0xef285d)break;else _0x28412a['push'](_0x28412a['shift']());}catch(_0x223e3f){_0x28412a['push'](_0x28412a['shift']());}}}(a36_0x5d24,0x4cd82));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,resolveRuleSegmentRefs}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x2583b8,yamlToApi as a36_0x3fb9ed,toYamlString as a36_0x50e334,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';function a36_0x2861(_0x31ac2f,_0xf27f4f){_0x31ac2f=_0x31ac2f-0x1c7;const _0x5d242b=a36_0x5d24();let _0x2861d2=_0x5d242b[_0x31ac2f];return _0x2861d2;}import a36_0x2bb026 from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x5ec126 from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x4d9ca2 from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX=a36_0x3da80c(0x202);function collectSegmentRefsFromRule(_0x5fe8e8){const _0x1a997f=[],_0x4adf4=_0x5e79e1=>{const _0x53b354=a36_0x2861;if(!_0x5e79e1||typeof _0x5e79e1!=='object')return;if(Array['isArray'](_0x5e79e1)){_0x5e79e1[_0x53b354(0x24d)](_0x4adf4);return;}const _0x55ab8d=_0x5e79e1;(_0x55ab8d[_0x53b354(0x2cb)]===_0x53b354(0x2a0)||_0x55ab8d[_0x53b354(0x2cb)]===_0x53b354(0x2d1))&&typeof _0x55ab8d[_0x53b354(0x1f0)]===_0x53b354(0x226)&&_0x1a997f['push'](_0x55ab8d[_0x53b354(0x1f0)]);for(const _0x1cc314 of Object[_0x53b354(0x2ca)](_0x55ab8d)){_0x4adf4(_0x1cc314);}};return _0x4adf4(_0x5fe8e8),_0x1a997f;}function collectSegmentIdsFromJourneyApi(_0x30934d){const _0x16ea3a=a36_0x3da80c,_0x144274=new Set();_0x30934d['attributes'][_0x16ea3a(0x208)]?.[_0x16ea3a(0x279)]&&_0x144274[_0x16ea3a(0x225)](_0x30934d[_0x16ea3a(0x2ad)][_0x16ea3a(0x208)][_0x16ea3a(0x279)]);const _0x5be337=_0x30934d[_0x16ea3a(0x2ad)]['journeyStages'];if(Array[_0x16ea3a(0x273)](_0x5be337))for(const _0x54446a of _0x5be337){_0x54446a[_0x16ea3a(0x1d7)]?.[_0x16ea3a(0x279)]&&_0x144274[_0x16ea3a(0x225)](_0x54446a['entryCriteria'][_0x16ea3a(0x279)]);if(Array[_0x16ea3a(0x273)](_0x54446a[_0x16ea3a(0x289)]))for(const _0x397772 of _0x54446a['exitCriteria']){_0x397772[_0x16ea3a(0x279)]&&_0x144274[_0x16ea3a(0x225)](_0x397772['segmentId']);}_0x54446a[_0x16ea3a(0x26e)]?.[_0x16ea3a(0x279)]&&_0x144274[_0x16ea3a(0x225)](_0x54446a['milestone'][_0x16ea3a(0x279)]);if(Array[_0x16ea3a(0x273)](_0x54446a[_0x16ea3a(0x2a6)]))for(const _0x4a8d40 of _0x54446a[_0x16ea3a(0x2a6)]){_0x4a8d40[_0x16ea3a(0x2c0)]?.['segmentId']&&_0x144274['add'](_0x4a8d40[_0x16ea3a(0x2c0)][_0x16ea3a(0x279)]);if(Array[_0x16ea3a(0x273)](_0x4a8d40[_0x16ea3a(0x2c3)]))for(const _0x5e1bc6 of _0x4a8d40['branches']){_0x5e1bc6['segmentId']&&_0x144274[_0x16ea3a(0x225)](_0x5e1bc6[_0x16ea3a(0x279)]);}}}return _0x144274;}function validateSegmentRule(_0x2c20d1,_0x5c80ea){const _0x28e2c3=a36_0x3da80c;if(!_0x5c80ea||!_0x5c80ea[_0x28e2c3(0x29c)])return;for(let _0x38d138=0x0;_0x38d138<_0x5c80ea[_0x28e2c3(0x29c)]['length'];_0x38d138++){const _0x1992d6=_0x5c80ea[_0x28e2c3(0x29c)][_0x38d138];if(_0x28e2c3(0x2cb)in _0x1992d6&&_0x1992d6['type']==='Value'){const _0x563d24=_0x1992d6;if(!_0x563d24[_0x28e2c3(0x245)]||_0x563d24[_0x28e2c3(0x245)]==='')throw new SDKError(ErrorCode[_0x28e2c3(0x2c9)],_0x28e2c3(0x28b)+_0x2c20d1+'\x27:\x20'+(_0x28e2c3(0x21e)+_0x38d138+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0x28e2c3(0x20e));}}}function createPendingSegmentId(_0xe0541e){return''+PENDING_SEGMENT_PREFIX+_0xe0541e+'__';}function isPendingSegmentId(_0x548852){const _0x30cf19=a36_0x3da80c;return _0x548852[_0x30cf19(0x299)](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x2ad5d6){return _0x2ad5d6['replace'](/^__pending_(.+)__$/,'$1');}function a36_0x5d24(){const _0x43878a=['diff','milestone','SEGMENT_UPDATE_ERROR','\x20\x20Source:\x20','parentFolder','156793PRaOFV','isArray','yes','activationParams','Creating\x20segment\x20\x27','Fetching\x20existing\x20journeys...','\x27\x20with\x20journeyId:\x20','segmentId','existingJourney','Activation','join','\x27\x20for\x20','parentSegmentFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','deleteActivation','unchanged','hasChanges','createSegment','Fetching\x20users\x20for\x20email\x20resolution...','journeyBundleName','journeyStages','journey','exitCriteria','then','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','parent_segment','INTERNAL','Push\x20','ACTIVATION_SYNTAX_ERROR','isNew','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20changed','connection','site','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','...',').\x20','\x20\x20🗺️\x20\x20Journeys:','startsWith','find','goal\x20criteria','conditions','\x27\x20exit\x20criteria','createJourneySegment','__pending_act_','include','relative','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20✔\x20Created\x20activation\x20\x27','user','yamlActivation','steps','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','journeys','✔\x20Deleted\x20segment\x20\x27','stages','\x20\x20Journey\x20API\x20request:\x20','getJourney','attributes','filter','randomUUID','20YKwNSy','segment:push','slice','📁\x20','\x20updated','Deleting\x20activation\x20\x27','endsWith','DecisionPoint','Creating\x20activation\x20\x27','6LQnCbK','parse','isDirectory','19487npVLmZ','\x20changes?','red','Error:\x20Directory\x20not\x20found:\x20','waitCondition','\x27\x20entry\x20criteria','config','branches','\x20\x20Segments:\x20','configDir','versionNumber','listFolders','data','JOURNEY_SYNTAX_ERROR','values','type','Fetching\x20parent\x20segment\x20details...','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x27...','delete','\x20folders\x20to\x20create','exclude','\x27\x20(internal:\x20','rule','489841IkAgbJ','segments','resolveJourneyId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20\x20⚠\x20Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','New\x20segment:','has','\x20activations]','dryRun','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','utf-8','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','journey_entry_criteria_','\x20journey\x20from\x20file:\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x0a\x20\x20','Updating','entryCriteria','SEGMENT_NOT_FOUND','Entry\x20criteria:\x20','2856663QEOePI','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Created\x20embedded\x20segment\x20\x27','\x20YAML\x20files\x20found','180RqqHME','max','/e/','update','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x20to\x20delete','\x27\x20decision\x20point\x20branch\x20\x27','\x27:\x20','folderId','activationActions','description','Fetching\x20journey\x20\x27','\x20unchanged','(Journey\x20will\x20be\x20deleted)','existingActivation','\x27\x20with\x20ID:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','parentFolderId','segment','.yaml','Delete\x20segment:','129703IzqGbV','Creating\x20folder\x20\x27','relationships','split','setExtra','updateActivation','dirname','map','\x27\x20v','\x0a✔\x20Push\x20complete','replace','✔\x20Updated\x20segment\x20\x27','\x20deleted','Source\x20directory:\x20','\x20(referenced\x20in\x20journey\x20','__pending_','green','getParent','Error\x20parsing\x20','toString','toLowerCase','goal','deleteSegment','1635505ggmsdT','\x20\x20\x20\x20','JOURNEY_UPDATE_ERROR','segment\x20or\x20journey','Please\x20specify\x20a\x20valid\x20attribute\x20name.','listJourneysFromParentSegment','execute','listActivations','repeat','folderPath','keys','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','22FpZcbe','existingSegment','yellow','validatedRequest','/app/ps/','absolutePath','Fetching\x20existing\x20folders...','conditions[','journeysOnly','error','No\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Folders\x20to\x20create:','verbose','add','string','getActivation','activation_','decision_point','updated','\x20to\x20create','51cDakie','get','Fetching\x20existing\x20activations...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','entries','.yml','✔\x20Created\x20journey\x20\x27','isFile','\x20\x20Or\x20set\x20context:\x20`tdx\x20sg\x20use\x20<parent_name>`','created','Activation\x20not\x20found:\x20','all','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','8QmHpPF','blue','Failed\x20to\x20','journeyActivationStepId','getOutputSchemaWithCache','Changes\x20to\x20journey:','sort','state','\x20\x20✔\x20Deleted\x20activation\x20\x27','resolveParentId','with','getSegment','attribute','\x20\x20Activations:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','NOT_FOUND','createActivation','size','push','stage\x20\x27','forEach','Fetching\x20connections\x20for\x20name\x20resolution...','/j/da/je','resolve','ACTIVATION_UPDATE_ERROR','activations','segmentFolderId','length','Resolving\x20parent\x20segment\x20\x27','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','Fetching\x20existing\x20segments...','Updating\x20segment\x20\x27','stringify','Changes\x20to:','✔\x20Created\x20folder\x20\x27','\x0aPush\x20summary\x20for\x20\x27','yamlConfig','\x20\x20Created\x20embedded\x20activation\x20\x27','set','95036DSpBFF','journeyId','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Creating','Segment\x20not\x20found:\x20','\x20created','cyan','\x20new','Updating\x20activation\x20\x27','cwd','name','action','create'];a36_0x5d24=function(){return _0x43878a;};return a36_0x5d24();}const PENDING_ACTIVATION_PREFIX=a36_0x3da80c(0x29f);function createPendingActivationId(_0x7d872e){return''+PENDING_ACTIVATION_PREFIX+_0x7d872e+'__';}function isPendingActivationId(_0x531962){return _0x531962['startsWith'](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x4d9657){const _0x31a0ad=a36_0x3da80c;return _0x4d9657[_0x31a0ad(0x1fd)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x22b619){const _0x341602=a36_0x3da80c;!_0x22b619[_0x341602(0x1e8)]&&(_0x22b619['description']=''),!_0x22b619[_0x341602(0x240)]&&(_0x22b619[_0x341602(0x240)]='draft');}function tryFindTdxConfig(_0x5b4841){try{return findTdxConfig(_0x5b4841);}catch{return null;}}function resolveTDFolderPath(_0x9de9c2,_0x3b82ac,_0x2d4bff){if(!_0x3b82ac)return _0x9de9c2;return _0x9de9c2?_0x2d4bff+'/'+_0x9de9c2:_0x2d4bff;}export class SegmentPushCommand extends BaseCommand{['name']=a36_0x3da80c(0x2b1);[a36_0x3da80c(0x1e8)]=a36_0x3da80c(0x1d1);async[a36_0x3da80c(0x210)](_0x30c9c1){const _0x3ceb12=a36_0x3da80c,{options:_0x4dfd61,args:_0x5304de,tdx:_0x442297}=_0x30c9c1,_0x1f4aea=_0x4dfd61,_0x3ff749=_0x4dfd61['parentSegment'],_0x3b50ac=_0x5304de[0x0];let _0x46c0ce,_0x15d562,_0x48226a,_0x215404;if(_0x3b50ac){if(existsSync(_0x3b50ac)&&statSync(_0x3b50ac)[_0x3ceb12(0x2bb)]()){const _0x24cf50=tryFindTdxConfig(_0x3b50ac);if(_0x24cf50)_0x46c0ce=_0x24cf50[_0x3ceb12(0x2c2)][_0x3ceb12(0x28c)],_0x15d562=_0x3b50ac,_0x48226a=_0x24cf50[_0x3ceb12(0x2c5)];else{if(_0x3ff749)_0x46c0ce=_0x3ff749,_0x15d562=_0x3b50ac;else return console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x2be)](_0x3ceb12(0x2a2)+_0x3b50ac+'\x0a')),console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x266)](_0x3ceb12(0x238))),console['error'](a36_0x2bb026['cyan'](_0x3ceb12(0x234))),0x1;}}else{if(existsSync(_0x3b50ac)&&statSync(_0x3b50ac)[_0x3ceb12(0x233)]()){const _0x33d4dd=a36_0x5ec126[_0x3ceb12(0x1f9)](_0x3b50ac),_0x2d6a78=tryFindTdxConfig(_0x33d4dd);if(_0x2d6a78)_0x46c0ce=_0x2d6a78[_0x3ceb12(0x2c2)]['parent_segment'],_0x48226a=_0x2d6a78[_0x3ceb12(0x2c5)],_0x15d562=_0x2d6a78[_0x3ceb12(0x2c5)],_0x215404=a36_0x5ec126['resolve'](_0x3b50ac);else{if(_0x3ff749)_0x46c0ce=_0x3ff749,_0x15d562=_0x33d4dd,_0x215404=a36_0x5ec126[_0x3ceb12(0x250)](_0x3b50ac);else return console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x2be)](_0x3ceb12(0x2a2)+_0x33d4dd+'\x0a')),console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x266)](_0x3ceb12(0x238))),console[_0x3ceb12(0x220)](a36_0x2bb026['cyan'](_0x3ceb12(0x234))),0x1;}}else _0x46c0ce=_0x3b50ac;}}else{const _0x2f2da1=tryFindTdxConfig(process['cwd']());_0x2f2da1?(_0x46c0ce=_0x2f2da1[_0x3ceb12(0x2c2)]['parent_segment'],_0x15d562=process[_0x3ceb12(0x269)](),_0x48226a=_0x2f2da1[_0x3ceb12(0x2c5)]):_0x46c0ce=_0x3ff749;}if(!_0x46c0ce)return console['error'](a36_0x2bb026[_0x3ceb12(0x219)](_0x3ceb12(0x295))),console['error'](_0x3ceb12(0x1e2)),console[_0x3ceb12(0x220)](_0x3ceb12(0x27f)),console['error'](_0x3ceb12(0x216)),0x1;const _0x3748cb=_0x15d562||getSegmentRootDir(sanitizeFileName(_0x46c0ce)),_0x470dd0=_0x48226a||_0x3748cb,_0x2c4709=a36_0x5ec126[_0x3ceb12(0x2a1)](_0x470dd0,_0x3748cb),_0x54a36c=_0x2c4709!==''&&_0x2c4709!=='.';if(!existsSync(_0x3748cb))return console['error'](a36_0x2bb026['red'](_0x3ceb12(0x2bf)+_0x3748cb+'\x0a')),console[_0x3ceb12(0x220)](a36_0x2bb026['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x1f4aea[_0x3ceb12(0x224)]&&(console[_0x3ceb12(0x220)]('Site:\x20'+_0x1f4aea[_0x3ceb12(0x294)]),console[_0x3ceb12(0x220)]('Parent\x20segment:\x20'+_0x46c0ce),console[_0x3ceb12(0x220)](_0x3ceb12(0x200)+_0x3748cb),_0x54a36c&&console[_0x3ceb12(0x220)]('Scoped\x20to\x20folder:\x20'+_0x2c4709));const _0xba7fa5=await withSpinner(_0x3ceb12(0x255)+_0x46c0ce+'\x27...',()=>_0x442297[_0x3ceb12(0x1f0)][_0x3ceb12(0x242)](_0x46c0ce),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]}),_0x33fe8a=_0xba7fa5[_0x3ceb12(0x2c8)],[_0x221587,_0x5f13a9,_0x4d2b41,_0x3af254,_0x1dd975]=await Promise['all']([withSpinner(_0x3ceb12(0x2cc),()=>_0x442297[_0x3ceb12(0x1f0)][_0x3ceb12(0x204)](_0x33fe8a),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]}),withSpinner(_0x3ceb12(0x257),()=>_0x442297[_0x3ceb12(0x1f0)]['listSegments'](_0x33fe8a),{'verbose':_0x1f4aea['verbose']}),withSpinner(_0x3ceb12(0x21d),()=>_0x442297['segment'][_0x3ceb12(0x2c7)](_0x33fe8a),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]}),withSpinner(_0x3ceb12(0x277),()=>_0x442297[_0x3ceb12(0x288)][_0x3ceb12(0x20f)](_0x33fe8a),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]}),withSpinner(_0x3ceb12(0x285),()=>_0x442297[_0x3ceb12(0x2a4)]['buildUserMaps'](),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]})[_0x3ceb12(0x28a)](_0x5cfb5b=>_0x5cfb5b['data'])]),_0x1b3b4c=_0x221587[_0x3ceb12(0x2c8)],_0x1b9fd9=_0x1b3b4c[_0x3ceb12(0x1f5)]?.[_0x3ceb12(0x27e)]?.[_0x3ceb12(0x2c8)]?.['id']||_0x1b3b4c[_0x3ceb12(0x1f5)]?.[_0x3ceb12(0x271)]?.[_0x3ceb12(0x2c8)]?.['id'],_0x133c39=_0x5f13a9[_0x3ceb12(0x2c8)],_0x5cf0fa=_0x4d2b41[_0x3ceb12(0x2c8)],_0x442f11=_0x3af254[_0x3ceb12(0x2c8)],{emailToId:_0x2763a5,idToEmail:_0x4dd521}=_0x1dd975,[_0x517261,_0x1db211,_0x586db0]=await withSpinner(_0x3ceb12(0x24e),async()=>{const _0xb5e2e6=_0x3ceb12,_0x2a69b3=await _0x442297[_0xb5e2e6(0x293)]['list'](),_0x48d6c6=new Map(),_0x37b584=new Map(),_0x3033b8=new Map();for(const _0x337096 of _0x2a69b3){_0x48d6c6[_0xb5e2e6(0x25f)](_0x337096[_0xb5e2e6(0x26a)],parseInt(_0x337096['id'],0xa)),_0x37b584[_0xb5e2e6(0x25f)](_0x337096['id'],_0x337096[_0xb5e2e6(0x26a)]),_0x3033b8[_0xb5e2e6(0x25f)](_0x337096['name'],_0x337096['type']);}return[_0x48d6c6,_0x37b584,_0x3033b8];},{'verbose':_0x1f4aea[_0x3ceb12(0x224)]})[_0x3ceb12(0x28a)](_0x13e263=>_0x13e263['data']),_0x1aae1d={'emailToIdMap':_0x2763a5,'connectionNameToIdMap':_0x517261,'connectionNameToTypeMap':_0x586db0,'getSchema':_0x7d53e9=>_0x442297[_0x3ceb12(0x293)][_0x3ceb12(0x23d)](_0x7d53e9)},_0x1794e3=buildFolderPathToIdMap(_0x5cf0fa),_0x359459=new Map();for(const [_0x1f20a1,_0xd874de]of _0x1794e3[_0x3ceb12(0x230)]()){_0x359459[_0x3ceb12(0x25f)](_0xd874de,_0x1f20a1);}const _0x3fdd8a=new Map();for(const _0x57866b of _0x133c39){const _0x287961=_0x57866b[_0x3ceb12(0x253)]?_0x359459['get'](_0x57866b['segmentFolderId'][_0x3ceb12(0x206)]())||'':'',_0x3b4216=_0x287961+':'+_0x57866b[_0x3ceb12(0x26a)];_0x3fdd8a[_0x3ceb12(0x25f)](_0x3b4216,_0x57866b);}const _0x1c9145=new Map();for(const _0x242ebb of _0x133c39){_0x1c9145[_0x3ceb12(0x25f)](_0x242ebb[_0x3ceb12(0x26a)],_0x242ebb['id']);}const _0x5a1499=new Map();for(const _0x282968 of _0x442f11){const _0x35041b=_0x282968['folderId']?_0x359459[_0x3ceb12(0x22d)](_0x282968[_0x3ceb12(0x1e6)])||'':'',_0x29cdc8=_0x35041b+':'+_0x282968[_0x3ceb12(0x286)];!_0x5a1499[_0x3ceb12(0x1cc)](_0x29cdc8)&&_0x5a1499[_0x3ceb12(0x25f)](_0x29cdc8,[]),_0x5a1499['get'](_0x29cdc8)[_0x3ceb12(0x24b)](_0x282968);}for(const _0xd6a3c6 of _0x5a1499[_0x3ceb12(0x2ca)]()){_0xd6a3c6[_0x3ceb12(0x23f)]((_0x260550,_0x7c22e0)=>(_0x260550['versionNumber']||0x0)-(_0x7c22e0[_0x3ceb12(0x2c6)]||0x0));}let _0x27918b;if(_0x215404){if(!_0x215404['endsWith']('.yml')&&!_0x215404[_0x3ceb12(0x2b6)](_0x3ceb12(0x1f1)))return console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x2be)](_0x3ceb12(0x1ee)+_0x215404+'\x0a')),0x1;_0x27918b=[_0x215404];}else _0x27918b=findYamlFiles(_0x3748cb);if(_0x27918b['length']===0x0)return console['error'](a36_0x2bb026[_0x3ceb12(0x2be)](_0x3ceb12(0x1c9)+_0x3748cb+'\x0a')),console[_0x3ceb12(0x220)](a36_0x2bb026['cyan'](_0x3ceb12(0x247))),0x1;const _0x28c434=[],_0x2e9264=[];for(const _0x95d0df of _0x27918b){const _0x3c9e3a=a36_0x5ec126[_0x3ceb12(0x2a1)](_0x3748cb,a36_0x5ec126[_0x3ceb12(0x1f9)](_0x95d0df)),_0x4438b2=_0x3c9e3a==='.'?'':_0x3c9e3a,_0x104474=readFileSync(_0x95d0df,_0x3ceb12(0x1d0));try{const _0x298e3d=a36_0x4d9ca2['parse'](_0x104474);if(isJourneyYaml(_0x298e3d)){const _0x22e673=a36_0x2583b8(_0x104474);_0x2e9264[_0x3ceb12(0x24b)]({'yamlConfig':_0x22e673,'folderPath':_0x4438b2,'sourcePath':_0x95d0df});}else{if(!_0x1f4aea['journeysOnly']){const _0x2d4f9a=parseSegmentYamlFile(_0x104474),_0x2c0509=normalizeChildSegmentYaml(_0x2d4f9a);_0x28c434[_0x3ceb12(0x24b)]({'yamlConfig':_0x2c0509,'folderPath':_0x4438b2,'sourcePath':_0x95d0df});}}}catch(_0x20ca0d){return console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x2be)](_0x3ceb12(0x205)+_0x95d0df+':\x20'+(_0x20ca0d instanceof Error?_0x20ca0d['message']:_0x20ca0d))),0x1;}}if(_0x28c434['length']===0x0&&_0x2e9264['length']===0x0){const _0xf064fd=_0x1f4aea[_0x3ceb12(0x21f)]?_0x3ceb12(0x288):_0x3ceb12(0x20d);return console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x219)](_0x3ceb12(0x221)+_0xf064fd+_0x3ceb12(0x1dd))),0x0;}const _0x5d0434=new Map();_0x133c39[_0x3ceb12(0x254)]>0x0&&!_0x1f4aea[_0x3ceb12(0x21f)]&&await withSpinner(_0x3ceb12(0x22e),async()=>{await batchAsync(_0x133c39,async _0x5cd48a=>{const _0x465456=a36_0x2861,_0x2394b3=await _0x442297[_0x465456(0x1f0)][_0x465456(0x211)](_0x33fe8a,_0x5cd48a['id']);_0x5d0434['set'](_0x5cd48a['id'],_0x2394b3);});},{'verbose':_0x1f4aea['verbose']});const _0x16b4b3=[],_0x1842ef=new Set();for(const {yamlConfig:_0x411cb3,folderPath:_0x2a236f,sourcePath:_0x52ab8c}of _0x28c434){const _0x304684=resolveTDFolderPath(_0x2a236f,_0x54a36c,_0x2c4709),_0x3e5629=_0x304684+':'+_0x411cb3['name'],_0x1e4525=_0x3fdd8a[_0x3ceb12(0x22d)](_0x3e5629),_0x11ce94=_0x1e4525?_0x5d0434['get'](_0x1e4525['id'])||[]:[];if(_0x304684&&!_0x1794e3[_0x3ceb12(0x1cc)](_0x304684)){const _0x5d34ae=_0x304684[_0x3ceb12(0x1f6)]('/');let _0xcb3202='';for(const _0x161b9e of _0x5d34ae){_0xcb3202=_0xcb3202?_0xcb3202+'/'+_0x161b9e:_0x161b9e,!_0x1794e3[_0x3ceb12(0x1cc)](_0xcb3202)&&_0x1842ef[_0x3ceb12(0x225)](_0xcb3202);}}const _0x18acf7=calculateActivationActions(_0x411cb3[_0x3ceb12(0x252)]||[],_0x11ce94,_0x4dd521,_0x1db211);for(const _0x465aae of _0x18acf7){(_0x465aae['type']===_0x3ceb12(0x26c)||_0x465aae['type']===_0x3ceb12(0x1e1))&&_0x465aae[_0x3ceb12(0x2a5)]&&(_0x465aae[_0x3ceb12(0x21a)]=await yamlActivationToCreateRequest(_0x465aae[_0x3ceb12(0x2a5)],_0x1aae1d));}const _0x1ae22b=segmentToYamlString(_0x411cb3);let _0x5fb8b,_0x4296a4=![],_0x3c58fc;if(_0x1e4525){const _0x413612=segmentWithActivationsToYaml(_0x1e4525,_0x11ce94,undefined,_0x4dd521,_0x1db211),_0x578f5d=segmentToYamlString(_0x413612);_0x5fb8b=generateDiff(_0x578f5d,_0x1ae22b),_0x4296a4=hasChanges(_0x5fb8b),_0x4296a4&&(_0x3c58fc=formatDiffWithColors(_0x5fb8b));}else _0x5fb8b=generateDiff('',_0x1ae22b),_0x3c58fc=formatDiffWithColors(_0x5fb8b);_0x16b4b3[_0x3ceb12(0x24b)]({'relativePath':_0x411cb3[_0x3ceb12(0x26a)],'absolutePath':_0x52ab8c,'yamlConfig':_0x411cb3,'folderPath':_0x304684,'existingSegment':_0x1e4525,'existingActivations':_0x11ce94,'isNew':!_0x1e4525,'hasChanges':_0x4296a4,'diff':_0x3c58fc,'activationActions':_0x18acf7});}let _0x5dd1b3=[];if(!_0x215404){const _0x506128=new Set();for(const {yamlConfig:_0x517a50,folderPath:_0x564425}of _0x28c434){const _0x559e0b=resolveTDFolderPath(_0x564425,_0x54a36c,_0x2c4709);_0x506128[_0x3ceb12(0x225)](_0x559e0b+':'+_0x517a50[_0x3ceb12(0x26a)]);}_0x5dd1b3=_0x133c39[_0x3ceb12(0x2ae)](_0x5326aa=>{const _0x28c8e8=_0x3ceb12,_0x28bd90=_0x5326aa[_0x28c8e8(0x253)]?_0x359459[_0x28c8e8(0x22d)](_0x5326aa[_0x28c8e8(0x253)]['toString']())||'':'',_0x2bbb35=_0x28bd90+':'+_0x5326aa[_0x28c8e8(0x26a)];if(_0x506128[_0x28c8e8(0x1cc)](_0x2bbb35))return![];if(_0x54a36c)return _0x28bd90===_0x2c4709||_0x28bd90[_0x28c8e8(0x299)](_0x2c4709+'/');return!![];});}const _0x373f03=[];for(const {yamlConfig:_0x2a1613,folderPath:_0x980aa5,sourcePath:_0x2b49ab}of _0x2e9264){const _0x246536=resolveTDFolderPath(_0x980aa5,_0x54a36c,_0x2c4709),_0x543762=_0x246536+':'+_0x2a1613[_0x3ceb12(0x26a)],_0x13228c=_0x5a1499[_0x3ceb12(0x22d)](_0x543762);let _0x28dc74,_0x2b6f3b;if(_0x13228c&&_0x13228c[_0x3ceb12(0x254)]>0x0){const _0x1147d1=new Set(),_0x4ca0c2=new Set(),_0x2fb5a8=new Map(),_0x37b7ea=new Map(),_0x75c74b=createJumpTargetCache(),_0x3f68de=new Set(),_0xdecca5=new Map();if(_0x2a1613['segments'])for(const [_0x3b084b,_0x4c2357]of Object[_0x3ceb12(0x230)](_0x2a1613[_0x3ceb12(0x1c7)])){_0x3f68de[_0x3ceb12(0x225)](_0x3b084b);if(_0x4c2357[_0x3ceb12(0x2d3)]){const _0x1307ae=yamlRuleToApi(_0x4c2357[_0x3ceb12(0x2d3)]),_0x1e607c=apiRuleToYaml(_0x1307ae);_0xdecca5[_0x3ceb12(0x25f)](_0x3b084b,_0x1e607c);}}const _0x53263f=new Map();for(const [_0x3f11cf,_0x35842c]of _0xdecca5){const _0x3cbb79=serializeExpandedRule(_0x35842c,_0xdecca5);!_0x53263f[_0x3ceb12(0x1cc)](_0x3cbb79)&&_0x53263f[_0x3ceb12(0x25f)](_0x3cbb79,_0x3f11cf);}const _0x235ba5=new Map(),_0x1ee3b6=new Map(),_0x35a98d=new Set(),_0x16df2f=async _0x50cbe7=>{const _0x13eeac=_0x3ceb12;if(_0x35a98d['has'](_0x50cbe7))return;_0x35a98d['add'](_0x50cbe7);let _0xe55716=_0x133c39[_0x13eeac(0x29a)](_0x5589a2=>_0x5589a2['id']===_0x50cbe7);if(!_0xe55716)try{_0xe55716=await _0x442297['segment'][_0x13eeac(0x244)](_0x33fe8a,_0x50cbe7);}catch{return;}if(_0xe55716?.[_0x13eeac(0x2d3)]){const _0x58ce52=apiRuleToYaml(_0xe55716[_0x13eeac(0x2d3)]);_0x1ee3b6[_0x13eeac(0x25f)](_0x50cbe7,_0x58ce52);const _0x396382=collectSegmentRefsFromRule(_0x58ce52);for(const _0x26c575 of _0x396382){await _0x16df2f(_0x26c575);}}};for(const _0x30e670 of _0x13228c){const _0x4391da=await _0x442297['journey'][_0x3ceb12(0x2ac)](_0x30e670['id']),_0x31b8c0=collectSegmentIdsFromJourneyApi(_0x4391da);for(const _0x47ffe6 of _0x31b8c0){await _0x16df2f(_0x47ffe6);}}let _0x4c3dc5;const _0x3b1430=_0x53dc1d=>({'resolveSegment':async _0x116c6f=>{const _0x2eedb4=_0x3ceb12,_0x4fc332=_0x37b7ea['get'](_0x116c6f);if(_0x4fc332!==undefined)return{'name':_0x4fc332,'isJourneyLocal':!![]};try{let _0x418f24=_0x133c39[_0x2eedb4(0x29a)](_0x47c720=>_0x47c720['id']===_0x116c6f);!_0x418f24&&(_0x418f24=await _0x442297['segment'][_0x2eedb4(0x244)](_0x33fe8a,_0x116c6f));const _0x5f3fe6=generateJourneyLocalName(_0x418f24['name']),_0x500209=_0x418f24['kind']===SEGMENT_KIND_JOURNEY&&_0x5f3fe6!==undefined;let _0x37f5bb=_0x418f24[_0x2eedb4(0x26a)],_0x24d191;if(_0x500209&&_0x418f24[_0x2eedb4(0x2d3)]){const _0x44bf64=apiRuleToYaml(_0x418f24['rule']);_0x1ee3b6[_0x2eedb4(0x25f)](_0x116c6f,_0x44bf64);const _0x5c931d=async _0x176d73=>{const _0x7190da=_0x2eedb4,_0x4f98e0=collectSegmentRefsFromRule(_0x176d73);for(const _0x56b832 of _0x4f98e0){if(!_0x1ee3b6[_0x7190da(0x1cc)](_0x56b832))try{const _0x331eeb=await _0x442297[_0x7190da(0x1f0)][_0x7190da(0x244)](_0x33fe8a,_0x56b832);if(_0x331eeb?.[_0x7190da(0x2d3)]){const _0x122c9c=apiRuleToYaml(_0x331eeb[_0x7190da(0x2d3)]);_0x1ee3b6[_0x7190da(0x25f)](_0x56b832,_0x122c9c),await _0x5c931d(_0x122c9c);}}catch{}}};await _0x5c931d(_0x44bf64);const _0x145502=serializeExpandedRule(_0x44bf64,_0x1ee3b6),_0x32ca83=_0x53263f[_0x2eedb4(0x22d)](_0x145502);if(_0x32ca83&&!_0x1147d1[_0x2eedb4(0x1cc)](_0x32ca83)){_0x37f5bb=_0x32ca83,_0x1147d1[_0x2eedb4(0x225)](_0x37f5bb),_0x37b7ea['set'](_0x116c6f,_0x37f5bb);const _0x2533c5=await resolveRuleSegmentRefs(_0x44bf64,async _0x5e18bf=>{const _0x1613a3=_0x2eedb4,_0x148571=_0x37b7ea[_0x1613a3(0x22d)](_0x5e18bf);if(_0x148571)return _0x148571;const _0x4aa0c2=await _0x4c3dc5['resolveSegment'](_0x5e18bf);return _0x4aa0c2[_0x1613a3(0x26a)];});_0x24d191={'description':_0x418f24[_0x2eedb4(0x1e8)],'rule':_0x2533c5};}else{if(_0x32ca83&&_0x1147d1[_0x2eedb4(0x1cc)](_0x32ca83))_0x37f5bb=_0x32ca83,_0x37b7ea[_0x2eedb4(0x25f)](_0x116c6f,_0x37f5bb);else{const _0x3f90d1=_0x235ba5[_0x2eedb4(0x22d)](_0x145502);if(_0x3f90d1)_0x37f5bb=_0x3f90d1,_0x37b7ea[_0x2eedb4(0x25f)](_0x116c6f,_0x37f5bb);else{if(_0x5f3fe6){let _0x45a31b=_0x5f3fe6,_0x4e1e61=0x2;while(_0x1147d1['has'](_0x45a31b)||_0x3f68de[_0x2eedb4(0x1cc)](_0x45a31b)){_0x45a31b=_0x5f3fe6+'_'+_0x4e1e61,_0x4e1e61++;}_0x1147d1[_0x2eedb4(0x225)](_0x45a31b),_0x37f5bb=_0x45a31b;}_0x37b7ea['set'](_0x116c6f,_0x37f5bb),_0x235ba5['set'](_0x145502,_0x37f5bb);const _0x281af8=await resolveRuleSegmentRefs(_0x44bf64,async _0x3b9e81=>{const _0x2cd3a2=_0x2eedb4,_0x43813c=_0x37b7ea[_0x2cd3a2(0x22d)](_0x3b9e81);if(_0x43813c)return _0x43813c;const _0x368693=await _0x4c3dc5['resolveSegment'](_0x3b9e81);return _0x368693[_0x2cd3a2(0x26a)];});_0x24d191={'description':_0x418f24[_0x2eedb4(0x1e8)],'rule':_0x281af8};}}}}return{'name':_0x37f5bb,'isJourneyLocal':_0x500209,'definition':_0x24d191};}catch{return{'name':_0x116c6f,'isJourneyLocal':![]};}},'resolveActivation':async _0x133cc=>{const _0x3dfbd2=_0x3ceb12,_0xfc7005=_0x2fb5a8[_0x3dfbd2(0x22d)](_0x133cc);if(_0xfc7005!==undefined)return{'name':_0xfc7005,'isJourneyLocal':!![]};try{const _0x1bfebf=await _0x442297[_0x3dfbd2(0x288)][_0x3dfbd2(0x227)](_0x53dc1d,_0x133cc),_0x42a70b=_0x1bfebf[_0x3dfbd2(0x2ad)][_0x3dfbd2(0x275)][_0x3dfbd2(0x26a)]||_0x133cc,_0x12b64b=sanitizeYamlKey(_0x42a70b)||_0x3dfbd2(0x228)+_0x133cc;let _0x5857b7=_0x12b64b,_0x2f175b=0x2;while(_0x4ca0c2['has'](_0x5857b7)){_0x5857b7=_0x12b64b+'_'+_0x2f175b,_0x2f175b++;}_0x4ca0c2[_0x3dfbd2(0x225)](_0x5857b7),_0x2fb5a8['set'](_0x133cc,_0x5857b7);const _0x2f3b68=journeyActivationStepToYaml(_0x1bfebf,_0x4dd521,_0x1db211);return{'name':_0x5857b7,'isJourneyLocal':!![],'definition':_0x2f3b68};}catch{return{'name':_0x133cc,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3d5743,_0x2dae87)=>resolveJumpTarget(_0x3d5743,_0x2dae87,_0x75c74b,_0x3d2f87=>_0x442297[_0x3ceb12(0x288)][_0x3ceb12(0x2ac)](_0x3d2f87))}),_0x501bf0=hasMultipleVersions(_0x2a1613);if(_0x501bf0&&_0x13228c[_0x3ceb12(0x254)]>0x1){const _0x364338=[];for(const _0x3d44d9 of _0x13228c){const _0x3ff8cc=await withSpinner(_0x3ceb12(0x1e9)+_0x2a1613[_0x3ceb12(0x26a)]+_0x3ceb12(0x1fb)+(_0x3d44d9[_0x3ceb12(0x2c6)]||0x1)+_0x3ceb12(0x296),()=>_0x442297['journey'][_0x3ceb12(0x2ac)](_0x3d44d9['id']),{'verbose':_0x1f4aea['verbose']}),_0x17e7f0=_0x3b1430(_0x3d44d9['id']);_0x4c3dc5=_0x17e7f0;const _0x576458=await apiToYamlAsync(_0x3ff8cc[_0x3ceb12(0x2c8)],_0x17e7f0);_0x364338[_0x3ceb12(0x24b)]({'item':_0x3d44d9,'yaml':_0x576458});}_0x2b6f3b=buildMergedJourneyYaml(_0x364338);const _0x99c524=Math[_0x3ceb12(0x1df)](..._0x364338['map'](_0xf0afcb=>_0xf0afcb['item'][_0x3ceb12(0x2c6)]||0x0)),_0x5d73fe=_0x13228c[_0x3ceb12(0x29a)](_0x33527b=>(_0x33527b[_0x3ceb12(0x2c6)]||0x0)===_0x99c524);_0x5d73fe&&(_0x28dc74=await _0x442297[_0x3ceb12(0x288)][_0x3ceb12(0x2ac)](_0x5d73fe['id']));}else{const _0x4982c6=_0x13228c[_0x13228c[_0x3ceb12(0x254)]-0x1],_0x218aee=await withSpinner(_0x3ceb12(0x1e9)+_0x2a1613[_0x3ceb12(0x26a)]+'\x27\x20details...',()=>_0x442297[_0x3ceb12(0x288)][_0x3ceb12(0x2ac)](_0x4982c6['id']),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]});_0x28dc74=_0x218aee['data'];const _0x201a89=_0x3b1430(_0x4982c6['id']);_0x4c3dc5=_0x201a89,_0x2b6f3b=await apiToYamlAsync(_0x28dc74,_0x201a89);}}if(_0x246536&&!_0x1794e3[_0x3ceb12(0x1cc)](_0x246536)){const _0x554028=_0x246536[_0x3ceb12(0x1f6)]('/');let _0x328233='';for(const _0x18a645 of _0x554028){_0x328233=_0x328233?_0x328233+'/'+_0x18a645:_0x18a645,!_0x1794e3['has'](_0x328233)&&_0x1842ef['add'](_0x328233);}}const _0x4de9c9=normalizeJourneyYaml(_0x2a1613,_0x2a1613),_0x44f243=a36_0x50e334(_0x4de9c9);let _0x49c756=![],_0x1fb04b;if(_0x2b6f3b){const _0x9d4797=normalizeJourneyYaml(_0x2b6f3b,_0x2a1613),_0x26c30c=a36_0x50e334(_0x9d4797),_0x3d5265=generateDiff(_0x26c30c,_0x44f243);_0x49c756=hasChanges(_0x3d5265),_0x49c756&&(_0x1fb04b=formatDiffWithColors(_0x3d5265));}else{const _0x45899a=generateDiff('',_0x44f243);_0x1fb04b=formatDiffWithColors(_0x45899a);}_0x373f03[_0x3ceb12(0x24b)]({'relativePath':_0x2a1613[_0x3ceb12(0x26a)],'absolutePath':_0x2b49ab,'yamlConfig':_0x2a1613,'folderPath':_0x246536,'existingJourney':_0x28dc74,'isNew':!_0x28dc74,'hasChanges':_0x49c756,'diff':_0x1fb04b});}let _0x161a37=[];if(!_0x215404){const _0x53b3ca=new Set();for(const {yamlConfig:_0x52ae4c,folderPath:_0x4cbc64}of _0x2e9264){const _0x17de46=resolveTDFolderPath(_0x4cbc64,_0x54a36c,_0x2c4709);_0x53b3ca['add'](_0x17de46+':'+_0x52ae4c[_0x3ceb12(0x26a)]);}_0x161a37=_0x442f11[_0x3ceb12(0x2ae)](_0x3fe90b=>{const _0x11c2ce=_0x3ceb12,_0x55af1b=_0x3fe90b[_0x11c2ce(0x1e6)]?_0x359459['get'](_0x3fe90b[_0x11c2ce(0x1e6)])||'':'',_0x12ff71=_0x55af1b+':'+_0x3fe90b['journeyBundleName'];if(_0x53b3ca['has'](_0x12ff71))return![];if(_0x54a36c)return _0x55af1b===_0x2c4709||_0x55af1b[_0x11c2ce(0x299)](_0x2c4709+'/');return!![];});}const _0x4b59fe=_0x16b4b3[_0x3ceb12(0x2ae)](_0x37bab2=>_0x37bab2[_0x3ceb12(0x290)]),_0x333403=_0x16b4b3['filter'](_0x49b08a=>!_0x49b08a[_0x3ceb12(0x290)]&&_0x49b08a[_0x3ceb12(0x283)]),_0x53fac7=_0x16b4b3[_0x3ceb12(0x2ae)](_0x522434=>!_0x522434['isNew']&&!_0x522434[_0x3ceb12(0x283)]),_0x36aaa5=Array['from'](_0x1842ef)[_0x3ceb12(0x23f)](),_0x1f5acf=_0x1f4aea[_0x3ceb12(0x2cf)]?_0x5dd1b3:[],_0x4bcdb1=_0x1f4aea[_0x3ceb12(0x2cf)]?_0x161a37:[],_0x276ec1=_0x16b4b3['flatMap'](_0x1ec64c=>_0x1ec64c[_0x3ceb12(0x1e7)]),_0x30dd3e=_0x276ec1[_0x3ceb12(0x2ae)](_0x1381ec=>_0x1381ec['type']===_0x3ceb12(0x26c)),_0x33b72d=_0x276ec1[_0x3ceb12(0x2ae)](_0x589b65=>_0x589b65[_0x3ceb12(0x2cb)]==='update'),_0x2bbfcd=_0x276ec1['filter'](_0x3f9d66=>_0x3f9d66[_0x3ceb12(0x2cb)]==='delete'),_0x523b56=_0x373f03[_0x3ceb12(0x2ae)](_0x3e9f47=>_0x3e9f47['isNew']),_0xe74fa1=_0x373f03['filter'](_0x7ffa20=>!_0x7ffa20[_0x3ceb12(0x290)]&&_0x7ffa20[_0x3ceb12(0x283)]),_0x33def1=_0x373f03['filter'](_0x6922d3=>!_0x6922d3[_0x3ceb12(0x290)]&&!_0x6922d3['hasChanges']);console['error'](_0x3ceb12(0x25c)+_0x46c0ce+'\x27:');_0x36aaa5[_0x3ceb12(0x254)]>0x0&&console['error']('\x20\x20'+a36_0x2bb026[_0x3ceb12(0x23a)](_0x3ceb12(0x2b3)+_0x36aaa5[_0x3ceb12(0x254)]+_0x3ceb12(0x2d0)));if(!_0x1f4aea['journeysOnly']){console[_0x3ceb12(0x220)]('\x20\x20📊\x20Segments:'),console['error'](_0x3ceb12(0x20b)+a36_0x2bb026[_0x3ceb12(0x203)]('+\x20'+_0x4b59fe[_0x3ceb12(0x254)]+_0x3ceb12(0x267))),console[_0x3ceb12(0x220)]('\x20\x20\x20\x20'+a36_0x2bb026['yellow']('~\x20'+_0x333403[_0x3ceb12(0x254)]+_0x3ceb12(0x292)));if(_0x1f5acf[_0x3ceb12(0x254)]>0x0)console[_0x3ceb12(0x220)](_0x3ceb12(0x20b)+a36_0x2bb026[_0x3ceb12(0x2be)]('-\x20'+_0x1f5acf['length']+_0x3ceb12(0x1e3)));else _0x5dd1b3['length']>0x0&&!_0x1f4aea[_0x3ceb12(0x2cf)]&&console[_0x3ceb12(0x220)](_0x3ceb12(0x20b)+a36_0x2bb026['dim'](_0x5dd1b3[_0x3ceb12(0x254)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3ceb12(0x220)](_0x3ceb12(0x20b)+a36_0x2bb026['dim']('=\x20'+_0x53fac7['length']+_0x3ceb12(0x1ea)));}if(_0x373f03['length']>0x0||_0x161a37[_0x3ceb12(0x254)]>0x0){console[_0x3ceb12(0x220)](_0x3ceb12(0x298)),console[_0x3ceb12(0x220)](_0x3ceb12(0x20b)+a36_0x2bb026[_0x3ceb12(0x203)]('+\x20'+_0x523b56[_0x3ceb12(0x254)]+'\x20new')),console['error'](_0x3ceb12(0x20b)+a36_0x2bb026[_0x3ceb12(0x219)]('~\x20'+_0xe74fa1[_0x3ceb12(0x254)]+_0x3ceb12(0x292)));if(_0x4bcdb1[_0x3ceb12(0x254)]>0x0)console['error'](_0x3ceb12(0x20b)+a36_0x2bb026[_0x3ceb12(0x2be)]('-\x20'+_0x4bcdb1['length']+_0x3ceb12(0x1e3)));else _0x161a37[_0x3ceb12(0x254)]>0x0&&!_0x1f4aea['delete']&&console[_0x3ceb12(0x220)](_0x3ceb12(0x20b)+a36_0x2bb026[_0x3ceb12(0x215)](_0x161a37[_0x3ceb12(0x254)]+_0x3ceb12(0x1db)));console[_0x3ceb12(0x220)]('\x20\x20\x20\x20'+a36_0x2bb026[_0x3ceb12(0x215)]('=\x20'+_0x33def1['length']+_0x3ceb12(0x1ea)));}_0x276ec1[_0x3ceb12(0x254)]>0x0&&!_0x1f4aea[_0x3ceb12(0x21f)]&&(console['error'](''),console[_0x3ceb12(0x220)]('\x20\x20Activations:'),_0x30dd3e[_0x3ceb12(0x254)]>0x0&&console[_0x3ceb12(0x220)](_0x3ceb12(0x20b)+a36_0x2bb026[_0x3ceb12(0x203)]('+\x20'+_0x30dd3e[_0x3ceb12(0x254)]+_0x3ceb12(0x22b))),_0x33b72d[_0x3ceb12(0x254)]>0x0&&console['error']('\x20\x20\x20\x20'+a36_0x2bb026[_0x3ceb12(0x219)]('~\x20'+_0x33b72d[_0x3ceb12(0x254)]+'\x20to\x20update')),_0x2bbfcd[_0x3ceb12(0x254)]>0x0&&console[_0x3ceb12(0x220)](_0x3ceb12(0x20b)+a36_0x2bb026[_0x3ceb12(0x2be)]('-\x20'+_0x2bbfcd[_0x3ceb12(0x254)]+_0x3ceb12(0x1e3))));console[_0x3ceb12(0x220)](_0x3ceb12(0x270)+a36_0x2bb026[_0x3ceb12(0x266)](_0x3748cb)+'\x0a');if(_0x36aaa5[_0x3ceb12(0x254)]>0x0){console[_0x3ceb12(0x220)](_0x3ceb12(0x223));for(const _0x49e996 of _0x36aaa5){console[_0x3ceb12(0x220)]('\x20\x20'+a36_0x2bb026[_0x3ceb12(0x23a)]('+')+'\x20'+_0x49e996);}console[_0x3ceb12(0x220)]('');}if(_0x4b59fe[_0x3ceb12(0x254)]>0x0&&!_0x1f4aea[_0x3ceb12(0x21f)])for(const _0x2017a4 of _0x4b59fe){const _0x1cff0f=_0x2017a4['folderPath']?_0x2017a4[_0x3ceb12(0x213)]+'/'+_0x2017a4[_0x3ceb12(0x25d)]['name']:_0x2017a4['yamlConfig'][_0x3ceb12(0x26a)],_0x3efdbe=_0x2017a4[_0x3ceb12(0x25d)]['activations']?.[_0x3ceb12(0x254)]||0x0,_0xd47e83=_0x3efdbe>0x0?a36_0x2bb026[_0x3ceb12(0x215)]('\x20['+_0x3efdbe+_0x3ceb12(0x1cd)):'';console[_0x3ceb12(0x220)]('\x0a'+a36_0x2bb026['green'](_0x3ceb12(0x1cb))+'\x20'+_0x1cff0f+_0xd47e83),console['error']('─'[_0x3ceb12(0x212)](0x3c)),_0x2017a4[_0x3ceb12(0x26d)]&&console[_0x3ceb12(0x220)](_0x2017a4[_0x3ceb12(0x26d)]),console[_0x3ceb12(0x220)]('─'[_0x3ceb12(0x212)](0x3c));}if(_0x1f5acf[_0x3ceb12(0x254)]>0x0&&!_0x1f4aea[_0x3ceb12(0x21f)])for(const _0x4d6986 of _0x1f5acf){const _0x1c8e31=_0x4d6986[_0x3ceb12(0x253)]?_0x359459[_0x3ceb12(0x22d)](_0x4d6986['segmentFolderId']['toString']())||'':'',_0x14d01f=_0x1c8e31?_0x1c8e31+'/'+_0x4d6986['name']:_0x4d6986[_0x3ceb12(0x26a)],_0xdb159b=_0x5d0434['get'](_0x4d6986['id'])||[],_0x496221=_0xdb159b[_0x3ceb12(0x254)]>0x0?a36_0x2bb026[_0x3ceb12(0x215)]('\x20['+_0xdb159b['length']+_0x3ceb12(0x1cd)):'';console[_0x3ceb12(0x220)]('\x0a'+a36_0x2bb026[_0x3ceb12(0x2be)](_0x3ceb12(0x1f2))+'\x20'+_0x14d01f+_0x496221),console[_0x3ceb12(0x220)]('─'['repeat'](0x3c));const _0x3457cd=segmentWithActivationsToYaml(_0x4d6986,_0xdb159b,undefined,_0x4dd521,_0x1db211),_0x35704b=segmentToYamlString(_0x3457cd),_0x62e0b3=generateDiff(_0x35704b,'');console['error'](formatDiffWithColors(_0x62e0b3)),console['error']('─'[_0x3ceb12(0x212)](0x3c));}const _0x27bc68=_0x16b4b3[_0x3ceb12(0x2ae)](_0x195531=>!_0x195531['isNew']&&_0x195531['diff']);if(_0x27bc68[_0x3ceb12(0x254)]>0x0&&!_0x1f4aea[_0x3ceb12(0x21f)])for(const _0x16bcc5 of _0x27bc68){const _0x3ba3cd=_0x16bcc5[_0x3ceb12(0x213)]?_0x16bcc5[_0x3ceb12(0x213)]+'/'+_0x16bcc5['yamlConfig'][_0x3ceb12(0x26a)]:_0x16bcc5[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)];console[_0x3ceb12(0x220)]('\x0a'+a36_0x2bb026[_0x3ceb12(0x219)](_0x3ceb12(0x25a))+'\x20'+_0x3ba3cd),console[_0x3ceb12(0x220)]('─'[_0x3ceb12(0x212)](0x3c)),console['error'](_0x16bcc5[_0x3ceb12(0x26d)]),console['error']('─'[_0x3ceb12(0x212)](0x3c));}if(_0x523b56[_0x3ceb12(0x254)]>0x0)for(const _0x193ef6 of _0x523b56){const _0x5edc44=_0x193ef6[_0x3ceb12(0x213)]?_0x193ef6[_0x3ceb12(0x213)]+'/'+_0x193ef6[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)]:_0x193ef6['yamlConfig'][_0x3ceb12(0x26a)];console['error']('\x0a'+a36_0x2bb026[_0x3ceb12(0x203)]('New\x20journey:')+'\x20'+_0x5edc44),console['error']('─'[_0x3ceb12(0x212)](0x3c)),_0x193ef6['diff']&&console['error'](_0x193ef6['diff']),console['error']('─'['repeat'](0x3c));}const _0x237ba7=_0x373f03[_0x3ceb12(0x2ae)](_0x5e6d8d=>!_0x5e6d8d[_0x3ceb12(0x290)]&&_0x5e6d8d[_0x3ceb12(0x26d)]);if(_0x237ba7[_0x3ceb12(0x254)]>0x0)for(const _0xd26247 of _0x237ba7){const _0x55f56d=_0xd26247[_0x3ceb12(0x213)]?_0xd26247[_0x3ceb12(0x213)]+'/'+_0xd26247[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)]:_0xd26247[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)];console['error']('\x0a'+a36_0x2bb026['yellow'](_0x3ceb12(0x23e))+'\x20'+_0x55f56d),console[_0x3ceb12(0x220)]('─'[_0x3ceb12(0x212)](0x3c)),console[_0x3ceb12(0x220)](_0xd26247[_0x3ceb12(0x26d)]),console[_0x3ceb12(0x220)]('─'[_0x3ceb12(0x212)](0x3c));}if(_0x4bcdb1[_0x3ceb12(0x254)]>0x0)for(const _0x49d17c of _0x4bcdb1){const _0x16cb8b=_0x49d17c[_0x3ceb12(0x1e6)]?_0x359459[_0x3ceb12(0x22d)](_0x49d17c[_0x3ceb12(0x1e6)])||'':'',_0x5c58d2=_0x16cb8b?_0x16cb8b+'/'+_0x49d17c[_0x3ceb12(0x286)]:_0x49d17c['journeyBundleName'];console['error']('\x0a'+a36_0x2bb026[_0x3ceb12(0x2be)]('Delete\x20journey:')+'\x20'+_0x5c58d2),console[_0x3ceb12(0x220)]('─'[_0x3ceb12(0x212)](0x3c)),console[_0x3ceb12(0x220)](a36_0x2bb026['red'](_0x3ceb12(0x1eb))),console['error']('─'[_0x3ceb12(0x212)](0x3c));}if(_0x1f4aea[_0x3ceb12(0x1ce)])return console[_0x3ceb12(0x220)](a36_0x2bb026['yellow'](_0x3ceb12(0x22f))),0x0;const _0x13686=_0x1f4aea['journeysOnly']?![]:_0x4b59fe[_0x3ceb12(0x254)]>0x0||_0x333403[_0x3ceb12(0x254)]>0x0||_0x1f5acf[_0x3ceb12(0x254)]>0x0,_0x2c869a=_0x523b56['length']>0x0||_0xe74fa1[_0x3ceb12(0x254)]>0x0||_0x4bcdb1[_0x3ceb12(0x254)]>0x0,_0x4667ee=_0x1f4aea[_0x3ceb12(0x21f)]?![]:_0x276ec1[_0x3ceb12(0x254)]>0x0,_0x5ea50f=_0x36aaa5[_0x3ceb12(0x254)]>0x0;if(!_0x13686&&!_0x2c869a&&!_0x4667ee&&!_0x5ea50f){const _0x209062=_0x1f4aea[_0x3ceb12(0x21f)]?_0x3ceb12(0x291):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a36_0x2bb026['green'](_0x209062));if(_0x215404&&_0x33def1[_0x3ceb12(0x254)]===0x1){const _0x5f3332=_0x33def1[0x0];if(_0x5f3332[_0x3ceb12(0x27a)]?.['id']){const _0x4b7f46=getConsoleNextUrl(_0x1f4aea['site'],_0x3ceb12(0x21b)+_0x33fe8a+_0x3ceb12(0x1e0)+_0x5f3332[_0x3ceb12(0x27a)]['id']+_0x3ceb12(0x24f));console['error']('\x20\x20'+a36_0x2bb026['cyan'](_0x4b7f46));}}return 0x0;}const _0x85c84f=_0x1f4aea[_0x3ceb12(0x21f)]?_0x523b56[_0x3ceb12(0x254)]+_0xe74fa1['length']+_0x4bcdb1[_0x3ceb12(0x254)]+_0x36aaa5[_0x3ceb12(0x254)]:_0x4b59fe['length']+_0x333403[_0x3ceb12(0x254)]+_0x1f5acf[_0x3ceb12(0x254)]+_0x523b56[_0x3ceb12(0x254)]+_0xe74fa1[_0x3ceb12(0x254)]+_0x4bcdb1['length']+_0x36aaa5[_0x3ceb12(0x254)]+_0x276ec1[_0x3ceb12(0x254)];if(!_0x1f4aea[_0x3ceb12(0x274)]&&_0x85c84f>0x0){const _0x320373=await confirmKey(_0x3ceb12(0x28e)+_0x85c84f+_0x3ceb12(0x2bd));if(!_0x320373)return console[_0x3ceb12(0x220)]('Aborted.'),0x1;}for(const _0xcecc27 of _0x36aaa5){const _0x55b940=_0xcecc27[_0x3ceb12(0x1f6)]('/'),_0x5acb34=_0x55b940[_0x55b940[_0x3ceb12(0x254)]-0x1],_0x7a69a4=_0x55b940[_0x3ceb12(0x2b2)](0x0,-0x1)[_0x3ceb12(0x27c)]('/'),_0x561471=_0x1794e3[_0x3ceb12(0x22d)](_0x7a69a4),_0x47f99a={'name':_0x5acb34,'parentFolderId':_0x561471},_0x36e91f=await withSpinner(_0x3ceb12(0x1f4)+_0xcecc27+'\x27...',()=>_0x442297[_0x3ceb12(0x1f0)]['createFolder'](_0x33fe8a,_0x47f99a),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]});_0x1794e3[_0x3ceb12(0x25f)](_0xcecc27,_0x36e91f[_0x3ceb12(0x2c8)]['id']),console['error'](a36_0x2bb026[_0x3ceb12(0x23a)](_0x3ceb12(0x25b)+_0xcecc27+'\x27'));}let _0x562490=0x0,_0x33ea71=0x0,_0x2b3878=0x0,_0x2775ab=0x0,_0x3c072a=0x0,_0x465bc7=0x0;const _0x349a94=new Map();for(const _0x1b9a7d of _0x1f4aea[_0x3ceb12(0x21f)]?[]:_0x16b4b3){const _0x24fc6b=_0x1b9a7d[_0x3ceb12(0x213)]?_0x1794e3[_0x3ceb12(0x22d)](_0x1b9a7d['folderPath']):undefined;let _0x3cf444;try{if(_0x1b9a7d['isNew']){const _0x2f8df1=yamlToCreateRequest(_0x1b9a7d['yamlConfig'],_0x24fc6b),_0x4bb39f=await withSpinner(_0x3ceb12(0x276)+_0x1b9a7d['yamlConfig'][_0x3ceb12(0x26a)]+_0x3ceb12(0x2ce),()=>_0x442297['segment'][_0x3ceb12(0x284)](_0x33fe8a,_0x2f8df1),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]});_0x3cf444=_0x4bb39f[_0x3ceb12(0x2c8)]['id'],_0x349a94[_0x3ceb12(0x25f)](_0x1b9a7d[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)],_0x3cf444),console[_0x3ceb12(0x220)](a36_0x2bb026['green']('✔\x20Created\x20segment\x20\x27'+_0x1b9a7d[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)]+'\x27')),_0x562490++;}else{if(_0x1b9a7d[_0x3ceb12(0x283)]){const _0x10882a=yamlToUpdateRequest(_0x1b9a7d[_0x3ceb12(0x25d)]);_0x24fc6b!==_0x1b9a7d[_0x3ceb12(0x218)]?.[_0x3ceb12(0x253)]&&(_0x10882a[_0x3ceb12(0x253)]=_0x24fc6b?parseInt(_0x24fc6b,0xa):undefined),await withSpinner(_0x3ceb12(0x258)+_0x1b9a7d[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)]+_0x3ceb12(0x2ce),()=>_0x442297[_0x3ceb12(0x1f0)]['updateSegmentById'](_0x33fe8a,_0x1b9a7d[_0x3ceb12(0x218)]['id'],_0x10882a),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]}),_0x3cf444=_0x1b9a7d['existingSegment']['id'],console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x219)](_0x3ceb12(0x1fe)+_0x1b9a7d[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)]+'\x27')),_0x33ea71++;}else _0x3cf444=_0x1b9a7d[_0x3ceb12(0x218)]['id'];}}catch(_0x3b814f){const _0xa72271=isHttp400Error(_0x3b814f),_0x110c9f=_0xa72271?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x45f1f3=getErrorMessage(_0x3b814f);throw new SDKError(_0x110c9f,_0x3ceb12(0x23b)+(_0x1b9a7d[_0x3ceb12(0x290)]?_0x3ceb12(0x26c):_0x3ceb12(0x1e1))+'\x20segment\x20from\x20file:\x20'+_0x1b9a7d[_0x3ceb12(0x21c)]+_0x3ceb12(0x1d5)+_0x45f1f3,_0x3b814f);}for(const _0x49f8c0 of _0x1b9a7d[_0x3ceb12(0x1e7)]){try{if(_0x49f8c0['type']==='create'&&_0x49f8c0[_0x3ceb12(0x21a)])await withSpinner(_0x3ceb12(0x2b8)+_0x49f8c0[_0x3ceb12(0x26a)]+'\x27...',()=>_0x442297[_0x3ceb12(0x1f0)]['createActivation'](_0x33fe8a,_0x3cf444,_0x49f8c0[_0x3ceb12(0x21a)]),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]}),console[_0x3ceb12(0x220)](a36_0x2bb026['green'](_0x3ceb12(0x2a3)+_0x49f8c0[_0x3ceb12(0x26a)]+'\x27')),_0x2775ab++;else{if(_0x49f8c0[_0x3ceb12(0x2cb)]==='update'&&_0x49f8c0[_0x3ceb12(0x21a)]&&_0x49f8c0[_0x3ceb12(0x1ec)])await withSpinner(_0x3ceb12(0x268)+_0x49f8c0[_0x3ceb12(0x26a)]+_0x3ceb12(0x2ce),()=>_0x442297[_0x3ceb12(0x1f0)][_0x3ceb12(0x1f8)](_0x33fe8a,_0x3cf444,_0x49f8c0[_0x3ceb12(0x1ec)]['id'],_0x49f8c0[_0x3ceb12(0x21a)]),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]}),console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x219)]('\x20\x20✔\x20Updated\x20activation\x20\x27'+_0x49f8c0[_0x3ceb12(0x26a)]+'\x27')),_0x3c072a++;else _0x49f8c0[_0x3ceb12(0x2cb)]===_0x3ceb12(0x2cf)&&_0x49f8c0[_0x3ceb12(0x1ec)]&&(await withSpinner(_0x3ceb12(0x2b5)+_0x49f8c0[_0x3ceb12(0x26a)]+_0x3ceb12(0x2ce),()=>_0x442297[_0x3ceb12(0x1f0)][_0x3ceb12(0x281)](_0x33fe8a,_0x3cf444,_0x49f8c0['existingActivation']['id']),{'verbose':_0x1f4aea['verbose']}),console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x2be)](_0x3ceb12(0x241)+_0x49f8c0[_0x3ceb12(0x26a)]+'\x27')),_0x465bc7++);}}catch(_0x59bfd3){const _0x1cfd35=isHttp400Error(_0x59bfd3),_0x35b16d=_0x1cfd35?ErrorCode[_0x3ceb12(0x28f)]:ErrorCode[_0x3ceb12(0x251)],_0x1be9c8=getErrorMessage(_0x59bfd3);throw new SDKError(_0x35b16d,'Failed\x20to\x20'+_0x49f8c0[_0x3ceb12(0x2cb)]+'\x20activation\x20\x27'+_0x49f8c0[_0x3ceb12(0x26a)]+'\x27\x20from\x20file:\x20'+_0x1b9a7d['absolutePath']+_0x3ceb12(0x1d5)+_0x1be9c8,_0x59bfd3);}}}for(const _0x4a3297 of _0x1f4aea[_0x3ceb12(0x21f)]?[]:_0x1f5acf){await withSpinner('Deleting\x20segment\x20\x27'+_0x4a3297[_0x3ceb12(0x26a)]+_0x3ceb12(0x2ce),()=>_0x442297[_0x3ceb12(0x1f0)][_0x3ceb12(0x209)](_0x4a3297['id']),{'verbose':_0x1f4aea[_0x3ceb12(0x224)]}),console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x2be)](_0x3ceb12(0x2a9)+_0x4a3297[_0x3ceb12(0x26a)]+'\x27')),_0x2b3878++;}let _0x38bc75=0x0,_0x15c66a=0x0,_0x479dc8=0x0;const _0x5370f=new Map(_0x1c9145);for(const _0x1b613e of _0x16b4b3){_0x1b613e[_0x3ceb12(0x290)]&&_0x349a94[_0x3ceb12(0x1cc)](_0x1b613e[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)])&&_0x5370f[_0x3ceb12(0x25f)](_0x1b613e[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)],_0x349a94[_0x3ceb12(0x22d)](_0x1b613e[_0x3ceb12(0x25d)][_0x3ceb12(0x26a)]));}if(_0x373f03[_0x3ceb12(0x254)]>0x0){const _0x337cc7=await withQuerySpinner('Pushing\x20journeys...',async _0x296fd6=>{const _0x1c4a7e=_0x3ceb12,_0x5b9b84=[];let _0x50f61f=0x0;const _0x1b0147=0x5;for(let _0x24dd21=0x0;_0x24dd21<_0x373f03[_0x1c4a7e(0x254)];_0x24dd21+=_0x1b0147){const _0x24e69a=_0x373f03[_0x1c4a7e(0x2b2)](_0x24dd21,_0x24dd21+_0x1b0147),_0x1a9520=await Promise[_0x1c4a7e(0x237)](_0x24e69a[_0x1c4a7e(0x1fa)](async _0x5147e7=>{const _0x3060ac=_0x1c4a7e;if(!_0x5147e7['isNew']&&!_0x5147e7[_0x3060ac(0x283)])return{'action':_0x3060ac(0x282),'name':_0x5147e7[_0x3060ac(0x25d)][_0x3060ac(0x26a)],'journeyId':_0x5147e7['existingJourney']?.['id']};const _0x1ef234=_0x5147e7[_0x3060ac(0x213)]?_0x1794e3['get'](_0x5147e7['folderPath']):undefined,_0x36af7c=_0x5147e7[_0x3060ac(0x290)]?_0x3060ac(0x263):_0x3060ac(0x1d6);_0x296fd6['setPhase'](_0x36af7c+'\x20journey\x20\x27'+_0x5147e7[_0x3060ac(0x25d)][_0x3060ac(0x26a)]+'\x27');const _0x401a3b=new Map(),_0x480bed=new Map(),_0x529896=new Map(),_0x365c0b={'resolveSegmentId':async _0x232d3a=>{const _0x5b4b49=_0x3060ac,_0x264c0b=_0x5370f[_0x5b4b49(0x22d)](_0x232d3a);if(!_0x264c0b)throw new SDKError(ErrorCode[_0x5b4b49(0x1d8)],_0x5b4b49(0x264)+_0x232d3a+_0x5b4b49(0x201)+_0x5147e7[_0x5b4b49(0x25d)][_0x5b4b49(0x26a)]+')');return _0x264c0b;},'resolveEmbeddedSegmentId':async(_0x23809e,_0x4ce4e6)=>{const _0x42bb28=_0x3060ac,_0x41ca2b=_0x5370f[_0x42bb28(0x22d)](_0x23809e);if(_0x41ca2b)return _0x41ca2b;const _0xefe46=_0x133c39['find'](_0x2c48ab=>_0x2c48ab[_0x42bb28(0x26a)]===_0x23809e);if(_0xefe46)return _0x5370f['set'](_0x23809e,_0xefe46['id']),_0xefe46['id'];if(_0x5147e7[_0x42bb28(0x290)]){const _0xa2bc9a=_0x5147e7[_0x42bb28(0x25d)][_0x42bb28(0x2aa)]||_0x5147e7[_0x42bb28(0x25d)][_0x42bb28(0x2a8)]?.[0x0]?.[_0x42bb28(0x2aa)]||[];let _0x5bcef8='entry',_0x273286=_0x23809e;const _0x313bea=_0x5147e7[_0x42bb28(0x25d)][_0x42bb28(0x208)]||_0x5147e7[_0x42bb28(0x25d)][_0x42bb28(0x2a8)]?.[0x0]?.[_0x42bb28(0x208)];if(_0x313bea?.[_0x42bb28(0x1f0)]===_0x23809e)_0x5bcef8=_0x42bb28(0x208),_0x273286=_0x313bea[_0x42bb28(0x26a)]||_0x23809e;else{_0x2df69c:for(const _0x4bef6b of _0xa2bc9a){if(_0x4bef6b['entry_criteria']?.['segment']===_0x23809e){_0x5bcef8=_0x4bef6b[_0x42bb28(0x26a)],_0x273286=_0x4bef6b['entry_criteria'][_0x42bb28(0x26a)]||_0x23809e;break;}if(_0x4bef6b['steps'])for(const _0xbc9f41 of _0x4bef6b[_0x42bb28(0x2a6)]){if(_0xbc9f41[_0x42bb28(0x2cb)]===_0x42bb28(0x229)&&_0xbc9f41[_0x42bb28(0x243)]?.['branches'])for(const _0x341636 of _0xbc9f41[_0x42bb28(0x243)]['branches']){if(_0x341636[_0x42bb28(0x1f0)]===_0x23809e){_0x5bcef8=_0x4bef6b[_0x42bb28(0x26a)],_0x273286=_0x341636[_0x42bb28(0x26a)]||_0x23809e;break _0x2df69c;}}}}}return validateSegmentRule(_0x23809e,_0x4ce4e6[_0x42bb28(0x2d3)]),_0x480bed[_0x42bb28(0x25f)](_0x23809e,{'definition':_0x4ce4e6,'stageName':_0x5bcef8,'criteriaName':_0x273286}),createPendingSegmentId(_0x23809e);}const _0x447aff=_0x5147e7[_0x42bb28(0x27a)]?.['id'];if(!_0x447aff)throw new SDKError(ErrorCode[_0x42bb28(0x28d)],_0x42bb28(0x2cd));validateSegmentRule(_0x23809e,_0x4ce4e6[_0x42bb28(0x2d3)]);const _0x3ad8e4=_0x42bb28(0x1d2)+crypto[_0x42bb28(0x2af)]();try{const _0x4189ec=await _0x442297[_0x42bb28(0x1f0)][_0x42bb28(0x29e)]({'name':_0x3ad8e4,'description':_0x4ce4e6['description']||_0x42bb28(0x1d9)+_0x23809e,'journeyId':_0x447aff,'rule':yamlRuleToApi(_0x4ce4e6[_0x42bb28(0x2d3)],!![]),'countPopulation':!![],'parentFolderId':_0x1b9fd9||'','audienceId':_0x33fe8a});return _0x1f4aea[_0x42bb28(0x224)]&&console[_0x42bb28(0x220)](_0x42bb28(0x1dc)+_0x23809e+'\x27\x20(internal:\x20'+_0x3ad8e4+')\x20with\x20ID:\x20'+_0x4189ec),_0x5370f[_0x42bb28(0x25f)](_0x23809e,_0x4189ec),_0x4189ec;}catch(_0xec1745){throw new SDKError(ErrorCode[_0x42bb28(0x26f)],'Failed\x20to\x20create\x20embedded\x20segment\x20\x27'+_0x23809e+_0x42bb28(0x1e5)+getErrorMessage(_0xec1745),_0xec1745);}},'resolveActivationId':async _0x5e425b=>{const _0x1d8abf=_0x3060ac,_0x1ff8f2=_0x401a3b[_0x1d8abf(0x22d)](_0x5e425b);if(_0x1ff8f2)return _0x1ff8f2;if(_0x5147e7['existingJourney']){const _0x2cee41=await _0x442297[_0x1d8abf(0x288)]['listActivations'](_0x5147e7[_0x1d8abf(0x27a)]['id']),_0x24db2b=_0x2cee41[_0x1d8abf(0x29a)](_0x51c96f=>_0x51c96f[_0x1d8abf(0x2ad)]['activationParams']?.[_0x1d8abf(0x26a)]===_0x5e425b);if(_0x24db2b)return _0x401a3b[_0x1d8abf(0x25f)](_0x5e425b,_0x24db2b['id']),_0x24db2b['id'];}throw new SDKError(ErrorCode['NOT_FOUND'],_0x1d8abf(0x236)+_0x5e425b+_0x1d8abf(0x201)+_0x5147e7[_0x1d8abf(0x25d)][_0x1d8abf(0x26a)]+_0x1d8abf(0x297)+_0x1d8abf(0x222));},'resolveEmbeddedActivationId':async(_0x5200ee,_0x4dd067)=>{const _0x3894c7=_0x3060ac,_0x157aa3=_0x401a3b[_0x3894c7(0x22d)](_0x5200ee);if(_0x157aa3)return _0x157aa3;if(_0x5147e7['isNew'])return _0x529896['set'](_0x5200ee,_0x4dd067),createPendingActivationId(_0x5200ee);if(_0x5147e7['existingJourney']){const _0x2e4297=await _0x442297['journey']['listActivations'](_0x5147e7[_0x3894c7(0x27a)]['id']),_0x516193=_0x2e4297['find'](_0x2de9a6=>_0x2de9a6[_0x3894c7(0x2ad)]['activationParams']?.[_0x3894c7(0x26a)]===_0x4dd067[_0x3894c7(0x26a)]);if(_0x516193)return _0x401a3b[_0x3894c7(0x25f)](_0x5200ee,_0x516193['id']),_0x516193['id'];try{const _0xeb6620=await yamlActivationToCreateRequest(_0x4dd067,_0x1aae1d),_0x65a476=await _0x442297[_0x3894c7(0x288)][_0x3894c7(0x249)](_0x5147e7['existingJourney']['id'],_0xeb6620);return _0x1f4aea['verbose']&&console[_0x3894c7(0x220)](_0x3894c7(0x25e)+_0x5200ee+_0x3894c7(0x1ed)+_0x65a476['id']),_0x401a3b[_0x3894c7(0x25f)](_0x5200ee,_0x65a476['id']),_0x65a476['id'];}catch(_0x2dbcc0){throw new SDKError(ErrorCode['JOURNEY_UPDATE_ERROR'],_0x3894c7(0x280)+_0x5200ee+_0x3894c7(0x1e5)+getErrorMessage(_0x2dbcc0),_0x2dbcc0);}}throw new SDKError(ErrorCode[_0x3894c7(0x28d)],_0x3894c7(0x1cf));},'resolveJourneyId':async _0x5301b7=>{const _0x247fca=_0x3060ac;try{return await _0x442297[_0x247fca(0x288)][_0x247fca(0x1c8)](_0x33fe8a,_0x5301b7);}catch(_0x105941){throw new SDKError(ErrorCode[_0x247fca(0x248)],'Journey\x20\x27'+_0x5301b7+_0x247fca(0x262)+_0x5147e7[_0x247fca(0x25d)][_0x247fca(0x26a)]+'\x27)',_0x105941);}},'resolveStageId':async(_0x3884b8,_0x2608d4)=>{const _0x4ee64f=_0x3060ac,_0x41f464=await _0x442297[_0x4ee64f(0x288)][_0x4ee64f(0x2ac)](_0x3884b8),_0x4a139d=_0x41f464[_0x4ee64f(0x2ad)][_0x4ee64f(0x287)][_0x4ee64f(0x29a)](_0x46ab8d=>_0x46ab8d[_0x4ee64f(0x26a)][_0x4ee64f(0x207)]()===_0x2608d4[_0x4ee64f(0x207)]());if(!_0x4a139d?.['id'])throw new SDKError(ErrorCode[_0x4ee64f(0x248)],'Stage\x20\x27'+_0x2608d4+_0x4ee64f(0x1d4)+(_0x41f464['attributes'][_0x4ee64f(0x286)]||_0x41f464[_0x4ee64f(0x2ad)][_0x4ee64f(0x26a)])+'\x27');return _0x4a139d['id'];}};try{const _0x4a864a=await a36_0x3fb9ed(_0x5147e7['yamlConfig'],_0x33fe8a,_0x365c0b),_0x5b77af=_0x1ef234||_0x1b9fd9;_0x5b77af&&(_0x4a864a[_0x3060ac(0x1f5)]={'parentFolder':{'data':{'id':_0x5b77af,'type':'folder'}}});if(_0x5147e7[_0x3060ac(0x290)]){if(_0x480bed[_0x3060ac(0x24a)]>0x0||_0x529896[_0x3060ac(0x24a)]>0x0){const _0x87041=JSON[_0x3060ac(0x2ba)](JSON[_0x3060ac(0x259)](_0x4a864a));ensureJourneyDefaults(_0x87041[_0x3060ac(0x2ad)]);for(const _0x235890 of _0x87041[_0x3060ac(0x2ad)][_0x3060ac(0x287)]){_0x235890[_0x3060ac(0x1d7)]?.[_0x3060ac(0x279)]&&isPendingSegmentId(_0x235890[_0x3060ac(0x1d7)][_0x3060ac(0x279)])&&delete _0x235890[_0x3060ac(0x1d7)];if(_0x235890['steps'])for(const _0x1b3553 of Object[_0x3060ac(0x214)](_0x235890[_0x3060ac(0x2a6)])){const _0xa79ca1=_0x235890[_0x3060ac(0x2a6)][_0x1b3553];_0xa79ca1[_0x3060ac(0x2cb)]===_0x3060ac(0x27b)&&_0xa79ca1['journeyActivationStepId']&&isPendingActivationId(_0xa79ca1[_0x3060ac(0x23c)])&&(_0xa79ca1[_0x3060ac(0x23c)]='');if(_0xa79ca1[_0x3060ac(0x2cb)]===_0x3060ac(0x2b7)&&_0xa79ca1[_0x3060ac(0x2c3)])for(const _0x34aa17 of _0xa79ca1[_0x3060ac(0x2c3)]){_0x34aa17[_0x3060ac(0x279)]&&isPendingSegmentId(_0x34aa17[_0x3060ac(0x279)])&&(_0x34aa17[_0x3060ac(0x279)]='');}}}_0x1f4aea['verbose']&&console['error']('\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20'+JSON[_0x3060ac(0x259)](_0x87041,null,0x2));const _0x528799=await _0x442297[_0x3060ac(0x288)][_0x3060ac(0x26c)](_0x87041),_0x4e09cc=_0x528799['id'],_0x3d3220=new Map();for(const _0x560046 of _0x528799[_0x3060ac(0x2ad)][_0x3060ac(0x287)]){_0x3d3220[_0x3060ac(0x25f)](_0x560046['name'][_0x3060ac(0x207)](),_0x560046['id']);}const _0x908a2f=new Map();for(const [_0x33caae,{definition:_0x5d6b4d,criteriaName:_0x5b4add}]of _0x480bed){const _0x20fed6=generateJourneyLocalName(_0x5b4add)||_0x3060ac(0x1d2)+crypto[_0x3060ac(0x2af)]();_0x1f4aea[_0x3060ac(0x224)]&&console[_0x3060ac(0x220)](_0x3060ac(0x256)+_0x33caae+_0x3060ac(0x2d2)+_0x20fed6+')\x20with\x20journeyId:\x20'+_0x4e09cc);const _0x226674=await _0x442297['segment'][_0x3060ac(0x29e)]({'name':_0x20fed6,'description':_0x5d6b4d['description']||_0x3060ac(0x1d9)+_0x33caae,'journeyId':_0x4e09cc,'rule':yamlRuleToApi(_0x5d6b4d[_0x3060ac(0x2d3)],!![]),'countPopulation':!![],'parentFolderId':_0x5b77af||'','audienceId':_0x33fe8a});_0x908a2f[_0x3060ac(0x25f)](_0x33caae,_0x226674),_0x5370f['set'](_0x33caae,_0x226674),_0x1f4aea[_0x3060ac(0x224)]&&console[_0x3060ac(0x220)](_0x3060ac(0x1dc)+_0x33caae+'\x27\x20with\x20ID:\x20'+_0x226674);}const _0x54f8cb=new Map();for(const [_0x2da551,_0x2479bc]of _0x529896){_0x1f4aea[_0x3060ac(0x224)]&&console['error']('\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27'+_0x2da551+_0x3060ac(0x278)+_0x4e09cc);try{const _0x3ba094=await yamlActivationToCreateRequest(_0x2479bc,_0x1aae1d),_0x1fbc0e=await _0x442297[_0x3060ac(0x288)][_0x3060ac(0x249)](_0x4e09cc,_0x3ba094);_0x54f8cb[_0x3060ac(0x25f)](_0x2da551,_0x1fbc0e['id']),_0x401a3b['set'](_0x2da551,_0x1fbc0e['id']),_0x1f4aea[_0x3060ac(0x224)]&&console[_0x3060ac(0x220)](_0x3060ac(0x25e)+_0x2da551+_0x3060ac(0x1ed)+_0x1fbc0e['id']);}catch(_0x59dc36){throw new SDKError(ErrorCode[_0x3060ac(0x20c)],_0x3060ac(0x280)+_0x2da551+_0x3060ac(0x1e5)+getErrorMessage(_0x59dc36),_0x59dc36);}}const _0x3a7d71=JSON[_0x3060ac(0x2ba)](JSON[_0x3060ac(0x259)](_0x4a864a));_0x3a7d71['id']=_0x4e09cc,ensureJourneyDefaults(_0x3a7d71[_0x3060ac(0x2ad)]);const _0x339b27=(_0x514acf,_0x191e93)=>{const _0x177850=_0x3060ac;if(!isPendingSegmentId(_0x514acf))return _0x514acf;const _0x554421=extractPendingSegmentName(_0x514acf),_0x187f94=_0x908a2f[_0x177850(0x22d)](_0x554421);return!_0x187f94&&console[_0x177850(0x220)](a36_0x2bb026[_0x177850(0x219)](_0x177850(0x1ca)+_0x554421+_0x177850(0x27d)+_0x191e93)),_0x187f94;};if(_0x3a7d71['attributes'][_0x3060ac(0x208)]?.[_0x3060ac(0x279)]&&isPendingSegmentId(_0x3a7d71[_0x3060ac(0x2ad)][_0x3060ac(0x208)]['segmentId'])){const _0x22c0fd=_0x339b27(_0x3a7d71['attributes'][_0x3060ac(0x208)][_0x3060ac(0x279)],_0x3060ac(0x29b));_0x22c0fd&&(_0x3a7d71['attributes']['goal'][_0x3060ac(0x279)]=_0x22c0fd);}for(const _0x3249fd of _0x3a7d71['attributes'][_0x3060ac(0x287)]){const _0xc6539=_0x3d3220[_0x3060ac(0x22d)](_0x3249fd[_0x3060ac(0x26a)][_0x3060ac(0x207)]());_0xc6539&&(_0x3249fd['id']=_0xc6539);if(_0x3249fd[_0x3060ac(0x1d7)]?.[_0x3060ac(0x279)]&&isPendingSegmentId(_0x3249fd['entryCriteria'][_0x3060ac(0x279)])){const _0x5899bb=_0x339b27(_0x3249fd[_0x3060ac(0x1d7)][_0x3060ac(0x279)],_0x3060ac(0x24c)+_0x3249fd[_0x3060ac(0x26a)]+_0x3060ac(0x2c1));_0x5899bb&&(_0x3249fd[_0x3060ac(0x1d7)][_0x3060ac(0x279)]=_0x5899bb);}if(_0x3249fd['exitCriterias'])for(const _0x41d5c3 of _0x3249fd['exitCriterias']){if(_0x41d5c3[_0x3060ac(0x279)]&&isPendingSegmentId(_0x41d5c3[_0x3060ac(0x279)])){const _0x34d6f=_0x339b27(_0x41d5c3[_0x3060ac(0x279)],_0x3060ac(0x24c)+_0x3249fd[_0x3060ac(0x26a)]+_0x3060ac(0x29d));_0x34d6f&&(_0x41d5c3['segmentId']=_0x34d6f);}}if(_0x3249fd['milestone']?.[_0x3060ac(0x279)]&&isPendingSegmentId(_0x3249fd[_0x3060ac(0x26e)][_0x3060ac(0x279)])){const _0x32c6d3=_0x339b27(_0x3249fd[_0x3060ac(0x26e)][_0x3060ac(0x279)],_0x3060ac(0x24c)+_0x3249fd[_0x3060ac(0x26a)]+'\x27\x20milestone');_0x32c6d3&&(_0x3249fd[_0x3060ac(0x26e)][_0x3060ac(0x279)]=_0x32c6d3);}if(_0x3249fd['steps']){const _0x341c45=_0x5e45ec=>_0x4a864a[_0x3060ac(0x2ad)][_0x3060ac(0x287)][_0x3060ac(0x29a)](_0x45b721=>_0x45b721[_0x3060ac(0x26a)][_0x3060ac(0x207)]()===_0x3249fd[_0x3060ac(0x26a)]['toLowerCase']())?.[_0x3060ac(0x2a6)]?.[_0x5e45ec];for(const _0x274b3e of Object[_0x3060ac(0x214)](_0x3249fd['steps'])){const _0x54edda=_0x3249fd[_0x3060ac(0x2a6)][_0x274b3e],_0x310fdf=_0x341c45(_0x274b3e);if(_0x54edda[_0x3060ac(0x2cb)]===_0x3060ac(0x27b)&&_0x54edda[_0x3060ac(0x23c)]&&(isPendingActivationId(_0x54edda[_0x3060ac(0x23c)])||_0x54edda['journeyActivationStepId']==='')){if(_0x310fdf?.[_0x3060ac(0x23c)]&&isPendingActivationId(_0x310fdf[_0x3060ac(0x23c)])){const _0x1f9f6c=extractPendingActivationName(_0x310fdf[_0x3060ac(0x23c)]),_0x1eb4dc=_0x54f8cb[_0x3060ac(0x22d)](_0x1f9f6c);_0x1eb4dc&&(_0x54edda['journeyActivationStepId']=_0x1eb4dc);}}if(_0x54edda[_0x3060ac(0x2cb)]===_0x3060ac(0x2b7)&&_0x54edda['branches']&&_0x310fdf?.[_0x3060ac(0x2c3)])for(let _0x52029a=0x0;_0x52029a<_0x54edda[_0x3060ac(0x2c3)][_0x3060ac(0x254)];_0x52029a++){const _0x31d197=_0x54edda[_0x3060ac(0x2c3)][_0x52029a],_0x289178=_0x310fdf[_0x3060ac(0x2c3)][_0x52029a];if(_0x289178?.[_0x3060ac(0x279)]&&isPendingSegmentId(_0x289178['segmentId'])){const _0x586bf4=_0x339b27(_0x289178[_0x3060ac(0x279)],_0x3060ac(0x24c)+_0x3249fd[_0x3060ac(0x26a)]+_0x3060ac(0x1e4)+(_0x31d197[_0x3060ac(0x26a)]||_0x52029a)+'\x27');_0x586bf4&&(_0x31d197[_0x3060ac(0x279)]=_0x586bf4);}}}}}return _0x1f4aea[_0x3060ac(0x224)]&&console[_0x3060ac(0x220)]('\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20'+JSON[_0x3060ac(0x259)](_0x3a7d71,null,0x2)),await _0x442297[_0x3060ac(0x288)][_0x3060ac(0x1e1)](_0x4e09cc,_0x3a7d71),{'action':_0x3060ac(0x235),'name':_0x5147e7[_0x3060ac(0x25d)][_0x3060ac(0x26a)],'journeyId':_0x4e09cc};}else{ensureJourneyDefaults(_0x4a864a['attributes']);_0x1f4aea['verbose']&&console[_0x3060ac(0x220)](_0x3060ac(0x2ab)+JSON[_0x3060ac(0x259)](_0x4a864a,null,0x2));const _0x3d1b37=await _0x442297[_0x3060ac(0x288)]['create'](_0x4a864a);return{'action':_0x3060ac(0x235),'name':_0x5147e7['yamlConfig']['name'],'journeyId':_0x3d1b37['id']};}}else{if(_0x5147e7[_0x3060ac(0x283)]&&_0x5147e7[_0x3060ac(0x27a)])return ensureJourneyDefaults(_0x4a864a[_0x3060ac(0x2ad)]),await _0x442297[_0x3060ac(0x288)]['update'](_0x5147e7['existingJourney']['id'],_0x4a864a),{'action':_0x3060ac(0x22a),'name':_0x5147e7[_0x3060ac(0x25d)][_0x3060ac(0x26a)],'journeyId':_0x5147e7[_0x3060ac(0x27a)]['id']};}return{'action':_0x3060ac(0x282),'name':_0x5147e7[_0x3060ac(0x25d)][_0x3060ac(0x26a)],'journeyId':_0x5147e7['existingJourney']?.['id']};}catch(_0x1d7e91){const _0x43ff8e=isHttp400Error(_0x1d7e91),_0x1518df=_0x43ff8e?ErrorCode[_0x3060ac(0x2c9)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x4baca7=getErrorMessage(_0x1d7e91);throw new SDKError(_0x1518df,_0x3060ac(0x23b)+(_0x5147e7[_0x3060ac(0x290)]?_0x3060ac(0x26c):_0x3060ac(0x1e1))+_0x3060ac(0x1d3)+_0x5147e7['absolutePath']+_0x3060ac(0x1d5)+_0x4baca7,_0x1d7e91);}}));_0x5b9b84[_0x1c4a7e(0x24b)](..._0x1a9520),_0x50f61f+=_0x24e69a[_0x1c4a7e(0x254)],_0x296fd6[_0x1c4a7e(0x1f7)]('('+_0x50f61f+'/'+_0x373f03[_0x1c4a7e(0x254)]+')');}return _0x5b9b84;},{'verbose':_0x1f4aea[_0x3ceb12(0x224)]});for(const _0x1ce944 of _0x337cc7[_0x3ceb12(0x2c8)]){if(_0x1ce944['action']===_0x3ceb12(0x235))console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x203)](_0x3ceb12(0x232)+_0x1ce944[_0x3ceb12(0x26a)]+'\x27')),_0x38bc75++;else _0x1ce944[_0x3ceb12(0x26b)]===_0x3ceb12(0x22a)&&(console[_0x3ceb12(0x220)](a36_0x2bb026[_0x3ceb12(0x219)]('✔\x20Updated\x20journey\x20\x27'+_0x1ce944[_0x3ceb12(0x26a)]+'\x27')),_0x15c66a++);}if(_0x215404&&_0x337cc7[_0x3ceb12(0x2c8)][_0x3ceb12(0x254)]===0x1){const _0x263fcc=_0x337cc7[_0x3ceb12(0x2c8)][0x0];if(_0x263fcc[_0x3ceb12(0x261)]){const _0x1995b0=getConsoleNextUrl(_0x1f4aea['site'],_0x3ceb12(0x21b)+_0x33fe8a+_0x3ceb12(0x1e0)+_0x263fcc['journeyId']+_0x3ceb12(0x24f));console['error']('\x20\x20'+a36_0x2bb026[_0x3ceb12(0x266)](_0x1995b0));}}}for(const _0x29f456 of _0x4bcdb1){console['error'](a36_0x2bb026[_0x3ceb12(0x219)](_0x3ceb12(0x2a7)+_0x29f456[_0x3ceb12(0x286)])),_0x479dc8++;}const _0x20826e=[];if(_0x562490>0x0)_0x20826e[_0x3ceb12(0x24b)](_0x562490+_0x3ceb12(0x265));if(_0x33ea71>0x0)_0x20826e[_0x3ceb12(0x24b)](_0x33ea71+'\x20updated');if(_0x2b3878>0x0)_0x20826e[_0x3ceb12(0x24b)](_0x2b3878+_0x3ceb12(0x1ff));const _0x519f7c=[];if(_0x38bc75>0x0)_0x519f7c['push'](_0x38bc75+_0x3ceb12(0x265));if(_0x15c66a>0x0)_0x519f7c[_0x3ceb12(0x24b)](_0x15c66a+'\x20updated');if(_0x479dc8>0x0)_0x519f7c[_0x3ceb12(0x24b)](_0x479dc8+'\x20deleted');const _0x2d0060=[];if(_0x2775ab>0x0)_0x2d0060[_0x3ceb12(0x24b)](_0x2775ab+'\x20created');if(_0x3c072a>0x0)_0x2d0060['push'](_0x3c072a+_0x3ceb12(0x2b4));if(_0x465bc7>0x0)_0x2d0060[_0x3ceb12(0x24b)](_0x465bc7+'\x20deleted');return console[_0x3ceb12(0x220)](a36_0x2bb026['green'](_0x3ceb12(0x1fc))),_0x20826e[_0x3ceb12(0x254)]>0x0&&!_0x1f4aea[_0x3ceb12(0x21f)]&&console[_0x3ceb12(0x220)](_0x3ceb12(0x2c4)+_0x20826e['join'](',\x20')),_0x519f7c[_0x3ceb12(0x254)]>0x0&&console[_0x3ceb12(0x220)]('\x20\x20Journeys:\x20'+_0x519f7c[_0x3ceb12(0x27c)](',\x20')),_0x2d0060['length']>0x0&&!_0x1f4aea[_0x3ceb12(0x21f)]&&console['error'](_0x3ceb12(0x246)+_0x2d0060[_0x3ceb12(0x27c)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x46f5d2){const _0x20c5fa=a36_0x3da80c,_0x34080c=new Map(),_0xb699fe=new Map();for(const _0x509a0b of _0x46f5d2){_0xb699fe['set'](_0x509a0b['id'],_0x509a0b);}const _0x25948a=new Set();for(const _0x2a0a78 of _0x46f5d2){!_0x2a0a78[_0x20c5fa(0x1ef)]&&_0x25948a[_0x20c5fa(0x225)](_0x2a0a78['id']);}function _0x419aba(_0xe06f82){const _0x5e712b=_0x20c5fa;if(_0x25948a['has'](_0xe06f82['id']))return'';if(_0xe06f82['parentFolderId']){const _0x20940b=_0xb699fe[_0x5e712b(0x22d)](_0xe06f82['parentFolderId']);if(_0x20940b){const _0x19275f=_0x419aba(_0x20940b);return _0x19275f?_0x19275f+'/'+_0xe06f82[_0x5e712b(0x26a)]:_0xe06f82[_0x5e712b(0x26a)];}}return _0xe06f82[_0x5e712b(0x26a)];}for(const _0x930a6b of _0x46f5d2){const _0x562724=_0x419aba(_0x930a6b);_0x34080c[_0x20c5fa(0x25f)](_0x562724,_0x930a6b['id']);}return _0x34080c;}function findYamlFiles(_0x46d112){const _0x1c32b4=[];function _0x14e40b(_0x5272da){const _0x1c6c23=a36_0x2861,_0x13cce7=readdirSync(_0x5272da,{'withFileTypes':!![]});for(const _0x1a9571 of _0x13cce7){const _0x4fa221=a36_0x5ec126[_0x1c6c23(0x27c)](_0x5272da,_0x1a9571[_0x1c6c23(0x26a)]);if(_0x1a9571['isDirectory']())_0x14e40b(_0x4fa221);else(_0x1a9571[_0x1c6c23(0x26a)][_0x1c6c23(0x2b6)](_0x1c6c23(0x231))||_0x1a9571[_0x1c6c23(0x26a)]['endsWith'](_0x1c6c23(0x1f1)))&&_0x1c32b4[_0x1c6c23(0x24b)](_0x4fa221);}}return _0x14e40b(_0x46d112),_0x1c32b4;}function calculateActivationActions(_0x2a1553,_0x125062,_0x225106,_0x156cf7){const _0x4864ff=a36_0x3da80c,_0x16c872=[],_0x5d98af=new Map();for(const _0x5887cd of _0x125062){_0x5d98af['set'](_0x5887cd[_0x4864ff(0x26a)],_0x5887cd);}const _0x1cd653=new Map();for(const _0x4d0730 of _0x2a1553){_0x1cd653['set'](_0x4d0730['name'],_0x4d0730);}for(const _0x4ac601 of _0x2a1553){const _0x49af77=_0x5d98af[_0x4864ff(0x22d)](_0x4ac601[_0x4864ff(0x26a)]);if(!_0x49af77)_0x16c872[_0x4864ff(0x24b)]({'type':'create','name':_0x4ac601[_0x4864ff(0x26a)],'yamlActivation':_0x4ac601});else{const _0x275dcb=activationToYaml(_0x49af77,_0x225106,_0x156cf7),_0x2d7700=a36_0x4d9ca2[_0x4864ff(0x259)](_0x275dcb),_0x30c41a=a36_0x4d9ca2[_0x4864ff(0x259)](_0x4ac601);_0x2d7700!==_0x30c41a&&_0x16c872[_0x4864ff(0x24b)]({'type':'update','name':_0x4ac601[_0x4864ff(0x26a)],'yamlActivation':_0x4ac601,'existingActivation':_0x49af77});}}for(const _0xaa9b6e of _0x125062){!_0x1cd653[_0x4864ff(0x1cc)](_0xaa9b6e[_0x4864ff(0x26a)])&&_0x16c872[_0x4864ff(0x24b)]({'type':_0x4864ff(0x2cf),'name':_0xaa9b6e[_0x4864ff(0x26a)],'existingActivation':_0xaa9b6e});}return _0x16c872;}
|
|
1
|
+
const a36_0x389626=a36_0x4d16;(function(_0x41eafd,_0x16f6e1){const _0xede15c=a36_0x4d16,_0x1b550d=_0x41eafd();while(!![]){try{const _0xdd28d1=parseInt(_0xede15c(0x83))/0x1*(parseInt(_0xede15c(0x156))/0x2)+parseInt(_0xede15c(0x15b))/0x3+parseInt(_0xede15c(0x142))/0x4*(-parseInt(_0xede15c(0xe0))/0x5)+-parseInt(_0xede15c(0x102))/0x6*(parseInt(_0xede15c(0x148))/0x7)+parseInt(_0xede15c(0xde))/0x8*(-parseInt(_0xede15c(0x12d))/0x9)+parseInt(_0xede15c(0x127))/0xa+parseInt(_0xede15c(0x9c))/0xb;if(_0xdd28d1===_0x16f6e1)break;else _0x1b550d['push'](_0x1b550d['shift']());}catch(_0x1167e4){_0x1b550d['push'](_0x1b550d['shift']());}}}(a36_0x5958,0x76d15));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a36_0x5958(){const _0x33bb5c=['Changes\x20to:','listFolders','\x20folders\x20to\x20create','map','journey_entry_criteria_','SEGMENT_NOT_FOUND','getSegment','dirname','\x27:\x20','segmentFolderId','Segment\x20not\x20found:\x20','createJourneySegment','folderPath','get','Delete\x20journey:','relationships','yamlConfig','📁\x20','rule','598290soMJHh','hasChanges','existingJourney','\x27\x20v','decision_point','\x20unchanged','9fiUzOm','existingSegment','verbose','\x20\x20\x20\x20','Delete\x20segment:','\x0a✔\x20Push\x20complete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','✔\x20Updated\x20journey\x20\x27','yellow','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','max','Creating\x20activation\x20\x27','length','red','Entry\x20criteria:\x20','Creating\x20folder\x20\x27','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','\x20\x20Created\x20embedded\x20activation\x20\x27','/app/ps/','activationParams','Changes\x20to\x20journey:','3540ohJgvd','\x20changes?','\x0a\x20\x20','\x27\x20from\x20file:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','Folders\x20to\x20create:','100583HhISzG','journeyId','waitCondition','description','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Deleting\x20segment\x20\x27','action','stage\x20\x27','\x27\x20with\x20ID:\x20','Value','segments','replace','updateSegmentById','72806XAgkUq','journeyBundleName','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Creating\x20segment\x20\x27','stages','513735XscWFF','JOURNEY_UPDATE_ERROR','parentSegmentFolder','getOutputSchemaWithCache','relative','entryCriteria','branches','\x0aPush\x20summary\x20for\x20\x27','filter','.yml','segment:push','listJourneysFromParentSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','(Journey\x20will\x20be\x20deleted)','draft','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','milestone','✔\x20Created\x20folder\x20\x27','utf-8','entry_criteria','\x20\x20Segments:\x20','Stage\x20\x27','Journey\x20\x27','endsWith','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','goal','\x20\x20Journey\x20API\x20request:\x20','connection','segment\x20or\x20journey','Updating\x20activation\x20\x27','Fetching\x20existing\x20folders...','parentFolder','Activation','delete','sort','\x20activations]','Creating','\x20updated','type','error','journeyActivationStepId','Activation\x20not\x20found:\x20','\x20new','\x20\x20🗺️\x20\x20Journeys:','✔\x20Created\x20segment\x20\x27','getJourney','size','\x20journey\x20from\x20file:\x20','Parent\x20segment:\x20','Failed\x20to\x20','/e/','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','entries','parent_segment','\x20deleted','Source\x20directory:\x20','\x27...','resolveSegment','Error:\x20Directory\x20not\x20found:\x20','9TulJKg','stringify','journeyStages','SEGMENT_SYNTAX_ERROR','deleteSegment','green','toString','message','\x27\x20for\x20','push','add','existingActivation','__pending_act_','cyan','\x20\x20Or\x20set\x20context:\x20`tdx\x20sg\x20use\x20<parent_name>`','\x27\x20entry\x20criteria','with','journeys','validatedRequest','\x20\x20✔\x20Updated\x20activation\x20\x27','isArray','include','config','Push\x20','NOT_FOUND','16992899fBBydX','\x27\x20with\x20journeyId:\x20','exitCriteria','listActivations','setPhase','entry','blue','\x27\x20exit\x20criteria','Updating','kind','journey','Pushing\x20journeys...','list','repeat','isFile','cwd','\x20(referenced\x20in\x20journey\x20','\x20\x20Activations:','dim','configDir','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','parentFolderId','\x20\x20Source:\x20','journeysOnly','slice','getParent','forEach','then','state','startsWith','\x27\x20(internal:\x20','segmentId','createActivation','\x20\x20✔\x20Deleted\x20activation\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','activationActions','isDirectory','created','INTERNAL','resolve','\x27\x20not\x20found\x20in\x20journey\x20\x27','folderId','Fetching\x20existing\x20journeys...','\x20\x20Created\x20embedded\x20segment\x20\x27','isNew','versionNumber','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','Please\x20specify\x20a\x20valid\x20attribute\x20name.','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','].attribute\x20cannot\x20be\x20empty.\x0a','\x20journey\x20\x27','find','attribute','update','activations','Aborted.','diff','parse','has','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','No\x20','Fetching\x20journey\x20\x27','all','data','folder','segment','4670032mekyIq','toLowerCase','3320EewoXx','values','\x20\x20📊\x20Segments:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x27\x20details...','dryRun','steps','exitCriterias','DecisionPoint','\x20to\x20delete','randomUUID','split','Fetching\x20existing\x20activations...','\x20changed','JOURNEY_SYNTAX_ERROR','✔\x20Deleted\x20segment\x20\x27','yamlActivation','create','conditions','\x27\x20decision\x20point\x20branch\x20\x27','unchanged','from','/j/da/je','\x20YAML\x20files\x20found','\x20\x20Activations:\x20','attributes','New\x20journey:','name','set','user','conditions[','string','resolveJourneyId','Fetching\x20users\x20for\x20email\x20resolution...','186HXMZbo','\x20created','Scoped\x20to\x20folder:\x20','updated','join','\x20segment\x20from\x20file:\x20','absolutePath','goal\x20criteria','getActivation','SEGMENT_UPDATE_ERROR','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','.yaml','object','flatMap','New\x20segment:',')\x20with\x20journeyId:\x20','updateActivation'];a36_0x5958=function(){return _0x33bb5c;};return a36_0x5958();}import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,resolveRuleSegmentRefs}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x13aa92,yamlToApi as a36_0x18eb28,toYamlString as a36_0x13a1cb,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a36_0x3401d0 from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x3e3928 from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x566de2 from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX='__pending_';function collectSegmentRefsFromRule(_0x3e0155){const _0x27369d=[],_0x4fbb2a=_0x447f0f=>{const _0x3e39cc=a36_0x4d16;if(!_0x447f0f||typeof _0x447f0f!==_0x3e39cc(0x10f))return;if(Array[_0x3e39cc(0x97)](_0x447f0f)){_0x447f0f[_0x3e39cc(0xb6)](_0x4fbb2a);return;}const _0x530702=_0x447f0f;(_0x530702[_0x3e39cc(0x181)]===_0x3e39cc(0x98)||_0x530702[_0x3e39cc(0x181)]==='exclude')&&typeof _0x530702[_0x3e39cc(0xdd)]===_0x3e39cc(0xff)&&_0x27369d[_0x3e39cc(0x8c)](_0x530702['segment']);for(const _0x1a5c52 of Object[_0x3e39cc(0xe1)](_0x530702)){_0x4fbb2a(_0x1a5c52);}};return _0x4fbb2a(_0x3e0155),_0x27369d;}function collectSegmentIdsFromJourneyApi(_0x4a35b8){const _0x24300f=a36_0x4d16,_0x3546fc=new Set();_0x4a35b8['attributes']['goal']?.['segmentId']&&_0x3546fc[_0x24300f(0x8d)](_0x4a35b8[_0x24300f(0xf9)][_0x24300f(0x174)]['segmentId']);const _0x6bec3=_0x4a35b8['attributes'][_0x24300f(0x85)];if(Array[_0x24300f(0x97)](_0x6bec3))for(const _0x10eaac of _0x6bec3){_0x10eaac[_0x24300f(0x160)]?.[_0x24300f(0xbb)]&&_0x3546fc[_0x24300f(0x8d)](_0x10eaac[_0x24300f(0x160)][_0x24300f(0xbb)]);if(Array['isArray'](_0x10eaac[_0x24300f(0x9e)]))for(const _0xb30aa6 of _0x10eaac['exitCriteria']){_0xb30aa6[_0x24300f(0xbb)]&&_0x3546fc[_0x24300f(0x8d)](_0xb30aa6[_0x24300f(0xbb)]);}_0x10eaac[_0x24300f(0x16b)]?.['segmentId']&&_0x3546fc['add'](_0x10eaac[_0x24300f(0x16b)][_0x24300f(0xbb)]);if(Array[_0x24300f(0x97)](_0x10eaac[_0x24300f(0xe6)]))for(const _0x48df3c of _0x10eaac['steps']){_0x48df3c[_0x24300f(0x14a)]?.[_0x24300f(0xbb)]&&_0x3546fc[_0x24300f(0x8d)](_0x48df3c[_0x24300f(0x14a)][_0x24300f(0xbb)]);if(Array[_0x24300f(0x97)](_0x48df3c['branches']))for(const _0x1b2fe4 of _0x48df3c['branches']){_0x1b2fe4[_0x24300f(0xbb)]&&_0x3546fc[_0x24300f(0x8d)](_0x1b2fe4[_0x24300f(0xbb)]);}}}return _0x3546fc;}function validateSegmentRule(_0x5bf3e3,_0x22701b){const _0x5aaa98=a36_0x4d16;if(!_0x22701b||!_0x22701b[_0x5aaa98(0xf2)])return;for(let _0x10572a=0x0;_0x10572a<_0x22701b[_0x5aaa98(0xf2)][_0x5aaa98(0x139)];_0x10572a++){const _0x66a902=_0x22701b[_0x5aaa98(0xf2)][_0x10572a];if(_0x5aaa98(0x181)in _0x66a902&&_0x66a902[_0x5aaa98(0x181)]===_0x5aaa98(0x152)){const _0x2955fb=_0x66a902;if(!_0x2955fb[_0x5aaa98(0xd0)]||_0x2955fb[_0x5aaa98(0xd0)]==='')throw new SDKError(ErrorCode[_0x5aaa98(0xee)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x5bf3e3+_0x5aaa98(0x11c)+(_0x5aaa98(0xfe)+_0x10572a+_0x5aaa98(0xcd))+_0x5aaa98(0xcb));}}}function createPendingSegmentId(_0x3fdd0f){return''+PENDING_SEGMENT_PREFIX+_0x3fdd0f+'__';}function isPendingSegmentId(_0x103936){return _0x103936['startsWith'](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x54a4eb){const _0x508044=a36_0x4d16;return _0x54a4eb[_0x508044(0x154)](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX=a36_0x389626(0x8f);function createPendingActivationId(_0xd598a){return''+PENDING_ACTIVATION_PREFIX+_0xd598a+'__';}function isPendingActivationId(_0x22d6ef){const _0x56e99e=a36_0x389626;return _0x22d6ef[_0x56e99e(0xb9)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x3bb1cf){const _0x40ed81=a36_0x389626;return _0x3bb1cf[_0x40ed81(0x154)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x495e98){const _0x228662=a36_0x389626;!_0x495e98['description']&&(_0x495e98[_0x228662(0x14b)]=''),!_0x495e98[_0x228662(0xb8)]&&(_0x495e98[_0x228662(0xb8)]=_0x228662(0x169));}function tryFindTdxConfig(_0x3efad5){try{return findTdxConfig(_0x3efad5);}catch{return null;}}function resolveTDFolderPath(_0x1fe79a,_0x2ac58f,_0x23ffe5){if(!_0x2ac58f)return _0x1fe79a;return _0x1fe79a?_0x23ffe5+'/'+_0x1fe79a:_0x23ffe5;}export class SegmentPushCommand extends BaseCommand{[a36_0x389626(0xfb)]=a36_0x389626(0x165);[a36_0x389626(0x14b)]=a36_0x389626(0xe3);async['execute'](_0x1282e7){const _0x97ab42=a36_0x389626,{options:_0x507e09,args:_0x286556,tdx:_0x45df43}=_0x1282e7,_0x1d8f5d=_0x507e09,_0x41624b=_0x507e09['parentSegment'],_0x32eb7c=_0x286556[0x0];let _0x42c612,_0x390761,_0x223ec4,_0x1d8974;if(_0x32eb7c){if(existsSync(_0x32eb7c)&&statSync(_0x32eb7c)[_0x97ab42(0xc0)]()){const _0x2f1cad=tryFindTdxConfig(_0x32eb7c);if(_0x2f1cad)_0x42c612=_0x2f1cad[_0x97ab42(0x99)][_0x97ab42(0x7d)],_0x390761=_0x32eb7c,_0x223ec4=_0x2f1cad[_0x97ab42(0xaf)];else{if(_0x41624b)_0x42c612=_0x41624b,_0x390761=_0x32eb7c;else return console['error'](a36_0x3401d0['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x32eb7c+'\x0a')),console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x90)](_0x97ab42(0x16a))),console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x90)](_0x97ab42(0x91))),0x1;}}else{if(existsSync(_0x32eb7c)&&statSync(_0x32eb7c)[_0x97ab42(0xaa)]()){const _0x39193b=a36_0x3e3928[_0x97ab42(0x11b)](_0x32eb7c),_0x5165c5=tryFindTdxConfig(_0x39193b);if(_0x5165c5)_0x42c612=_0x5165c5[_0x97ab42(0x99)][_0x97ab42(0x7d)],_0x223ec4=_0x5165c5[_0x97ab42(0xaf)],_0x390761=_0x5165c5[_0x97ab42(0xaf)],_0x1d8974=a36_0x3e3928[_0x97ab42(0xc3)](_0x32eb7c);else{if(_0x41624b)_0x42c612=_0x41624b,_0x390761=_0x39193b,_0x1d8974=a36_0x3e3928['resolve'](_0x32eb7c);else return console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x13a)](_0x97ab42(0x10c)+_0x39193b+'\x0a')),console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x90)](_0x97ab42(0x16a))),console['error'](a36_0x3401d0[_0x97ab42(0x90)](_0x97ab42(0x91))),0x1;}}else _0x42c612=_0x32eb7c;}}else{const _0x2e2ef1=tryFindTdxConfig(process[_0x97ab42(0xab)]());_0x2e2ef1?(_0x42c612=_0x2e2ef1[_0x97ab42(0x99)][_0x97ab42(0x7d)],_0x390761=process['cwd'](),_0x223ec4=_0x2e2ef1[_0x97ab42(0xaf)]):_0x42c612=_0x41624b;}if(!_0x42c612)return console['error'](a36_0x3401d0[_0x97ab42(0x135)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x97ab42(0x182)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x97ab42(0x182)](_0x97ab42(0x133)),console['error'](_0x97ab42(0x14d)),0x1;const _0x46b75e=_0x390761||getSegmentRootDir(sanitizeFileName(_0x42c612)),_0x18888d=_0x223ec4||_0x46b75e,_0x2dc6a3=a36_0x3e3928[_0x97ab42(0x15f)](_0x18888d,_0x46b75e),_0x653361=_0x2dc6a3!==''&&_0x2dc6a3!=='.';if(!existsSync(_0x46b75e))return console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x13a)](_0x97ab42(0x82)+_0x46b75e+'\x0a')),console['error'](a36_0x3401d0[_0x97ab42(0x90)](_0x97ab42(0x16a))),0x1;_0x1d8f5d[_0x97ab42(0x12f)]&&(console['error']('Site:\x20'+_0x1d8f5d['site']),console[_0x97ab42(0x182)](_0x97ab42(0x78)+_0x42c612),console[_0x97ab42(0x182)](_0x97ab42(0x7f)+_0x46b75e),_0x653361&&console[_0x97ab42(0x182)](_0x97ab42(0x104)+_0x2dc6a3));const _0x1d0ff8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x42c612+_0x97ab42(0x80),()=>_0x45df43['segment']['resolveParentId'](_0x42c612),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),_0x138b0e=_0x1d0ff8[_0x97ab42(0xdb)],[_0x1605ee,_0x235cc2,_0x3f2275,_0x38592d,_0x49cfd7]=await Promise[_0x97ab42(0xda)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x45df43['segment'][_0x97ab42(0xb5)](_0x138b0e),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x45df43[_0x97ab42(0xdd)]['listSegments'](_0x138b0e),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),withSpinner(_0x97ab42(0x179),()=>_0x45df43['segment'][_0x97ab42(0x115)](_0x138b0e),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),withSpinner(_0x97ab42(0xc6),()=>_0x45df43['journey'][_0x97ab42(0x166)](_0x138b0e),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),withSpinner(_0x97ab42(0x101),()=>_0x45df43[_0x97ab42(0xfd)]['buildUserMaps'](),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]})[_0x97ab42(0xb7)](_0x5ab830=>_0x5ab830[_0x97ab42(0xdb)])]),_0x33f8d5=_0x1605ee[_0x97ab42(0xdb)],_0xd8f619=_0x33f8d5[_0x97ab42(0x123)]?.[_0x97ab42(0x15d)]?.[_0x97ab42(0xdb)]?.['id']||_0x33f8d5[_0x97ab42(0x123)]?.[_0x97ab42(0x17a)]?.[_0x97ab42(0xdb)]?.['id'],_0x44edbd=_0x235cc2[_0x97ab42(0xdb)],_0x19140f=_0x3f2275[_0x97ab42(0xdb)],_0x3cddb4=_0x38592d[_0x97ab42(0xdb)],{emailToId:_0x2bfa2f,idToEmail:_0x5b6065}=_0x49cfd7,[_0x2bef41,_0x2ea3ec,_0xbe672e]=await withSpinner(_0x97ab42(0x146),async()=>{const _0x1dd99b=_0x97ab42,_0x1c6432=await _0x45df43['connection'][_0x1dd99b(0xa8)](),_0x1f6d6e=new Map(),_0x1b8c69=new Map(),_0x11b860=new Map();for(const _0x40368a of _0x1c6432){_0x1f6d6e[_0x1dd99b(0xfc)](_0x40368a[_0x1dd99b(0xfb)],parseInt(_0x40368a['id'],0xa)),_0x1b8c69[_0x1dd99b(0xfc)](_0x40368a['id'],_0x40368a[_0x1dd99b(0xfb)]),_0x11b860[_0x1dd99b(0xfc)](_0x40368a[_0x1dd99b(0xfb)],_0x40368a[_0x1dd99b(0x181)]);}return[_0x1f6d6e,_0x1b8c69,_0x11b860];},{'verbose':_0x1d8f5d['verbose']})[_0x97ab42(0xb7)](_0x1028f0=>_0x1028f0[_0x97ab42(0xdb)]),_0x3a0262={'emailToIdMap':_0x2bfa2f,'connectionNameToIdMap':_0x2bef41,'connectionNameToTypeMap':_0xbe672e,'getSchema':_0x4ef79e=>_0x45df43[_0x97ab42(0x176)][_0x97ab42(0x15e)](_0x4ef79e)},_0x246197=buildFolderPathToIdMap(_0x19140f),_0x518def=new Map();for(const [_0x4a936b,_0x13f3ee]of _0x246197['entries']()){_0x518def['set'](_0x13f3ee,_0x4a936b);}const _0x453342=new Map();for(const _0x9a0789 of _0x44edbd){const _0x401c7a=_0x9a0789[_0x97ab42(0x11d)]?_0x518def[_0x97ab42(0x121)](_0x9a0789[_0x97ab42(0x11d)][_0x97ab42(0x89)]())||'':'',_0x32583b=_0x401c7a+':'+_0x9a0789[_0x97ab42(0xfb)];_0x453342[_0x97ab42(0xfc)](_0x32583b,_0x9a0789);}const _0xa9215c=new Map();for(const _0x4de804 of _0x44edbd){_0xa9215c[_0x97ab42(0xfc)](_0x4de804[_0x97ab42(0xfb)],_0x4de804['id']);}const _0x413191=new Map();for(const _0x4b62b4 of _0x3cddb4){const _0x485282=_0x4b62b4['folderId']?_0x518def['get'](_0x4b62b4[_0x97ab42(0xc5)])||'':'',_0x3ebcff=_0x485282+':'+_0x4b62b4[_0x97ab42(0x157)];!_0x413191[_0x97ab42(0xd6)](_0x3ebcff)&&_0x413191['set'](_0x3ebcff,[]),_0x413191['get'](_0x3ebcff)[_0x97ab42(0x8c)](_0x4b62b4);}for(const _0x5bbdad of _0x413191[_0x97ab42(0xe1)]()){_0x5bbdad[_0x97ab42(0x17d)]((_0x35cdcf,_0x30f6d7)=>(_0x35cdcf['versionNumber']||0x0)-(_0x30f6d7[_0x97ab42(0xc9)]||0x0));}let _0x16db9e;if(_0x1d8974){if(!_0x1d8974[_0x97ab42(0x172)](_0x97ab42(0x164))&&!_0x1d8974[_0x97ab42(0x172)](_0x97ab42(0x10e)))return console['error'](a36_0x3401d0[_0x97ab42(0x13a)](_0x97ab42(0x14c)+_0x1d8974+'\x0a')),0x1;_0x16db9e=[_0x1d8974];}else _0x16db9e=findYamlFiles(_0x46b75e);if(_0x16db9e[_0x97ab42(0x139)]===0x0)return console['error'](a36_0x3401d0['red'](_0x97ab42(0x167)+_0x46b75e+'\x0a')),console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x90)](_0x97ab42(0xd7))),0x1;const _0x5c0daf=[],_0x511834=[];for(const _0x2653d9 of _0x16db9e){const _0x46073d=a36_0x3e3928[_0x97ab42(0x15f)](_0x46b75e,a36_0x3e3928[_0x97ab42(0x11b)](_0x2653d9)),_0x1b5178=_0x46073d==='.'?'':_0x46073d,_0x1096d4=readFileSync(_0x2653d9,_0x97ab42(0x16d));try{const _0x56a5b0=a36_0x566de2['parse'](_0x1096d4);if(isJourneyYaml(_0x56a5b0)){const _0x276d9a=a36_0x13aa92(_0x1096d4);_0x511834[_0x97ab42(0x8c)]({'yamlConfig':_0x276d9a,'folderPath':_0x1b5178,'sourcePath':_0x2653d9});}else{if(!_0x1d8f5d[_0x97ab42(0xb3)]){const _0x29d8b0=parseSegmentYamlFile(_0x1096d4),_0x43d62a=normalizeChildSegmentYaml(_0x29d8b0);_0x5c0daf[_0x97ab42(0x8c)]({'yamlConfig':_0x43d62a,'folderPath':_0x1b5178,'sourcePath':_0x2653d9});}}}catch(_0x111ae9){return console[_0x97ab42(0x182)](a36_0x3401d0['red']('Error\x20parsing\x20'+_0x2653d9+':\x20'+(_0x111ae9 instanceof Error?_0x111ae9[_0x97ab42(0x8a)]:_0x111ae9))),0x1;}}if(_0x5c0daf[_0x97ab42(0x139)]===0x0&&_0x511834[_0x97ab42(0x139)]===0x0){const _0x55457a=_0x1d8f5d['journeysOnly']?_0x97ab42(0xa6):_0x97ab42(0x177);return console[_0x97ab42(0x182)](a36_0x3401d0['yellow'](_0x97ab42(0xd8)+_0x55457a+_0x97ab42(0xf7))),0x0;}const _0x31b9e3=new Map();_0x44edbd[_0x97ab42(0x139)]>0x0&&!_0x1d8f5d[_0x97ab42(0xb3)]&&await withSpinner(_0x97ab42(0xec),async()=>{await batchAsync(_0x44edbd,async _0x528c46=>{const _0x55a96d=a36_0x4d16,_0x56c781=await _0x45df43[_0x55a96d(0xdd)][_0x55a96d(0x9f)](_0x138b0e,_0x528c46['id']);_0x31b9e3[_0x55a96d(0xfc)](_0x528c46['id'],_0x56c781);});},{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]});const _0x2dafcc=[],_0x3776ba=new Set();for(const {yamlConfig:_0x3dbcc9,folderPath:_0x59d1dc,sourcePath:_0x554aa2}of _0x5c0daf){const _0x59dc5c=resolveTDFolderPath(_0x59d1dc,_0x653361,_0x2dc6a3),_0x1676da=_0x59dc5c+':'+_0x3dbcc9[_0x97ab42(0xfb)],_0x4638ec=_0x453342[_0x97ab42(0x121)](_0x1676da),_0x103149=_0x4638ec?_0x31b9e3[_0x97ab42(0x121)](_0x4638ec['id'])||[]:[];if(_0x59dc5c&&!_0x246197[_0x97ab42(0xd6)](_0x59dc5c)){const _0x364e6e=_0x59dc5c[_0x97ab42(0xeb)]('/');let _0x2413ed='';for(const _0x2f3b02 of _0x364e6e){_0x2413ed=_0x2413ed?_0x2413ed+'/'+_0x2f3b02:_0x2f3b02,!_0x246197[_0x97ab42(0xd6)](_0x2413ed)&&_0x3776ba[_0x97ab42(0x8d)](_0x2413ed);}}const _0x1e10a6=calculateActivationActions(_0x3dbcc9[_0x97ab42(0xd2)]||[],_0x103149,_0x5b6065,_0x2ea3ec);for(const _0x43f922 of _0x1e10a6){(_0x43f922[_0x97ab42(0x181)]===_0x97ab42(0xf1)||_0x43f922[_0x97ab42(0x181)]===_0x97ab42(0xd1))&&_0x43f922['yamlActivation']&&(_0x43f922[_0x97ab42(0x95)]=await yamlActivationToCreateRequest(_0x43f922[_0x97ab42(0xf0)],_0x3a0262));}const _0x467ee3=segmentToYamlString(_0x3dbcc9);let _0x3e930c,_0x3f5948=![],_0x252b17;if(_0x4638ec){const _0x5a8d30=segmentWithActivationsToYaml(_0x4638ec,_0x103149,undefined,_0x5b6065,_0x2ea3ec),_0x4b115c=segmentToYamlString(_0x5a8d30);_0x3e930c=generateDiff(_0x4b115c,_0x467ee3),_0x3f5948=hasChanges(_0x3e930c),_0x3f5948&&(_0x252b17=formatDiffWithColors(_0x3e930c));}else _0x3e930c=generateDiff('',_0x467ee3),_0x252b17=formatDiffWithColors(_0x3e930c);_0x2dafcc[_0x97ab42(0x8c)]({'relativePath':_0x3dbcc9[_0x97ab42(0xfb)],'absolutePath':_0x554aa2,'yamlConfig':_0x3dbcc9,'folderPath':_0x59dc5c,'existingSegment':_0x4638ec,'existingActivations':_0x103149,'isNew':!_0x4638ec,'hasChanges':_0x3f5948,'diff':_0x252b17,'activationActions':_0x1e10a6});}let _0x590d9d=[];if(!_0x1d8974){const _0x464044=new Set();for(const {yamlConfig:_0xbfdd6f,folderPath:_0x265ab6}of _0x5c0daf){const _0x2a3ab0=resolveTDFolderPath(_0x265ab6,_0x653361,_0x2dc6a3);_0x464044[_0x97ab42(0x8d)](_0x2a3ab0+':'+_0xbfdd6f['name']);}_0x590d9d=_0x44edbd['filter'](_0x515812=>{const _0x3364e2=_0x97ab42,_0xb44d7c=_0x515812[_0x3364e2(0x11d)]?_0x518def[_0x3364e2(0x121)](_0x515812[_0x3364e2(0x11d)]['toString']())||'':'',_0x3e0bed=_0xb44d7c+':'+_0x515812['name'];if(_0x464044[_0x3364e2(0xd6)](_0x3e0bed))return![];if(_0x653361)return _0xb44d7c===_0x2dc6a3||_0xb44d7c[_0x3364e2(0xb9)](_0x2dc6a3+'/');return!![];});}const _0x27f091=[];for(const {yamlConfig:_0x2e0b31,folderPath:_0x46cff1,sourcePath:_0x55eb34}of _0x511834){const _0x4192be=resolveTDFolderPath(_0x46cff1,_0x653361,_0x2dc6a3),_0x22b0b7=_0x4192be+':'+_0x2e0b31['name'],_0x1e3cf9=_0x413191[_0x97ab42(0x121)](_0x22b0b7);let _0x2a549a,_0x1a3534;if(_0x1e3cf9&&_0x1e3cf9[_0x97ab42(0x139)]>0x0){const _0x4e5375=new Set(),_0x5c69e0=new Set(),_0x58afc8=new Map(),_0x22c53a=new Map(),_0x4849c2=createJumpTargetCache(),_0x512f0d=new Set(),_0x51b1d2=new Map();if(_0x2e0b31['segments'])for(const [_0x53d720,_0x1472ea]of Object[_0x97ab42(0x7c)](_0x2e0b31[_0x97ab42(0x153)])){_0x512f0d[_0x97ab42(0x8d)](_0x53d720);if(_0x1472ea[_0x97ab42(0x126)]){const _0x14c773=yamlRuleToApi(_0x1472ea['rule']),_0x26cef9=apiRuleToYaml(_0x14c773);_0x51b1d2[_0x97ab42(0xfc)](_0x53d720,_0x26cef9);}}const _0x16c027=new Map();for(const [_0x128010,_0x5a287a]of _0x51b1d2){const _0x46fd7a=serializeExpandedRule(_0x5a287a,_0x51b1d2);!_0x16c027[_0x97ab42(0xd6)](_0x46fd7a)&&_0x16c027['set'](_0x46fd7a,_0x128010);}const _0x42f101=new Map(),_0x1db39=new Map(),_0x124856=new Set(),_0x32a2ba=async _0x1eaf3e=>{const _0x5b95f7=_0x97ab42;if(_0x124856[_0x5b95f7(0xd6)](_0x1eaf3e))return;_0x124856[_0x5b95f7(0x8d)](_0x1eaf3e);let _0x2b8556=_0x44edbd[_0x5b95f7(0xcf)](_0x164c97=>_0x164c97['id']===_0x1eaf3e);if(!_0x2b8556)try{_0x2b8556=await _0x45df43['segment'][_0x5b95f7(0x11a)](_0x138b0e,_0x1eaf3e);}catch{return;}if(_0x2b8556?.[_0x5b95f7(0x126)]){const _0x19bf5b=apiRuleToYaml(_0x2b8556[_0x5b95f7(0x126)]);_0x1db39[_0x5b95f7(0xfc)](_0x1eaf3e,_0x19bf5b);const _0x33a038=collectSegmentRefsFromRule(_0x19bf5b);for(const _0xc4d8ee of _0x33a038){await _0x32a2ba(_0xc4d8ee);}}};for(const _0x207afa of _0x1e3cf9){const _0x245287=await _0x45df43[_0x97ab42(0xa6)][_0x97ab42(0x75)](_0x207afa['id']),_0xcac9b9=collectSegmentIdsFromJourneyApi(_0x245287);for(const _0x10adbd of _0xcac9b9){await _0x32a2ba(_0x10adbd);}}let _0x2ef290;const _0x1686de=_0x5af4b6=>({'resolveSegment':async _0x172da5=>{const _0x2e3d3d=_0x97ab42,_0x53ad55=_0x22c53a[_0x2e3d3d(0x121)](_0x172da5);if(_0x53ad55!==undefined)return{'name':_0x53ad55,'isJourneyLocal':!![]};try{let _0x270699=_0x44edbd[_0x2e3d3d(0xcf)](_0x191934=>_0x191934['id']===_0x172da5);!_0x270699&&(_0x270699=await _0x45df43[_0x2e3d3d(0xdd)][_0x2e3d3d(0x11a)](_0x138b0e,_0x172da5));const _0x1fc258=generateJourneyLocalName(_0x270699[_0x2e3d3d(0xfb)]),_0x159cf7=_0x270699[_0x2e3d3d(0xa5)]===SEGMENT_KIND_JOURNEY&&_0x1fc258!==undefined;let _0xc7eee3=_0x270699[_0x2e3d3d(0xfb)],_0x5ac7b3;if(_0x159cf7&&_0x270699[_0x2e3d3d(0x126)]){const _0x222b14=apiRuleToYaml(_0x270699['rule']);_0x1db39['set'](_0x172da5,_0x222b14);const _0x390cad=async _0x2a3a5f=>{const _0x4c1268=_0x2e3d3d,_0x59919b=collectSegmentRefsFromRule(_0x2a3a5f);for(const _0x2eb1dc of _0x59919b){if(!_0x1db39[_0x4c1268(0xd6)](_0x2eb1dc))try{const _0x5f19b5=await _0x45df43[_0x4c1268(0xdd)][_0x4c1268(0x11a)](_0x138b0e,_0x2eb1dc);if(_0x5f19b5?.[_0x4c1268(0x126)]){const _0x4bc34c=apiRuleToYaml(_0x5f19b5[_0x4c1268(0x126)]);_0x1db39[_0x4c1268(0xfc)](_0x2eb1dc,_0x4bc34c),await _0x390cad(_0x4bc34c);}}catch{}}};await _0x390cad(_0x222b14);const _0x55710f=serializeExpandedRule(_0x222b14,_0x1db39),_0x555154=_0x16c027[_0x2e3d3d(0x121)](_0x55710f);if(_0x555154&&!_0x4e5375[_0x2e3d3d(0xd6)](_0x555154)){_0xc7eee3=_0x555154,_0x4e5375[_0x2e3d3d(0x8d)](_0xc7eee3),_0x22c53a['set'](_0x172da5,_0xc7eee3);const _0x45d1d2=await resolveRuleSegmentRefs(_0x222b14,async _0x515b7a=>{const _0x44ca26=_0x2e3d3d,_0x21f183=_0x22c53a[_0x44ca26(0x121)](_0x515b7a);if(_0x21f183)return _0x21f183;const _0x12fc82=await _0x2ef290[_0x44ca26(0x81)](_0x515b7a);return _0x12fc82[_0x44ca26(0xfb)];});_0x5ac7b3={'description':_0x270699[_0x2e3d3d(0x14b)],'rule':_0x45d1d2};}else{if(_0x555154&&_0x4e5375['has'](_0x555154))_0xc7eee3=_0x555154,_0x22c53a[_0x2e3d3d(0xfc)](_0x172da5,_0xc7eee3);else{const _0x4048c6=_0x42f101[_0x2e3d3d(0x121)](_0x55710f);if(_0x4048c6)_0xc7eee3=_0x4048c6,_0x22c53a['set'](_0x172da5,_0xc7eee3);else{if(_0x1fc258){let _0x518f31=_0x1fc258,_0x2f44c1=0x2;while(_0x4e5375['has'](_0x518f31)||_0x512f0d['has'](_0x518f31)){_0x518f31=_0x1fc258+'_'+_0x2f44c1,_0x2f44c1++;}_0x4e5375[_0x2e3d3d(0x8d)](_0x518f31),_0xc7eee3=_0x518f31;}_0x22c53a[_0x2e3d3d(0xfc)](_0x172da5,_0xc7eee3),_0x42f101[_0x2e3d3d(0xfc)](_0x55710f,_0xc7eee3);const _0x12bc94=await resolveRuleSegmentRefs(_0x222b14,async _0x5f5210=>{const _0x466183=_0x2e3d3d,_0x5f3068=_0x22c53a[_0x466183(0x121)](_0x5f5210);if(_0x5f3068)return _0x5f3068;const _0x51797b=await _0x2ef290[_0x466183(0x81)](_0x5f5210);return _0x51797b['name'];});_0x5ac7b3={'description':_0x270699[_0x2e3d3d(0x14b)],'rule':_0x12bc94};}}}}return{'name':_0xc7eee3,'isJourneyLocal':_0x159cf7,'definition':_0x5ac7b3};}catch{return{'name':_0x172da5,'isJourneyLocal':![]};}},'resolveActivation':async _0x31228c=>{const _0x25657d=_0x97ab42,_0x28241d=_0x58afc8['get'](_0x31228c);if(_0x28241d!==undefined)return{'name':_0x28241d,'isJourneyLocal':!![]};try{const _0x8c02db=await _0x45df43[_0x25657d(0xa6)][_0x25657d(0x10a)](_0x5af4b6,_0x31228c),_0x21539f=_0x8c02db[_0x25657d(0xf9)][_0x25657d(0x140)]['name']||_0x31228c,_0x58502d=sanitizeYamlKey(_0x21539f)||'activation_'+_0x31228c;let _0x5dda94=_0x58502d,_0xf3071a=0x2;while(_0x5c69e0['has'](_0x5dda94)){_0x5dda94=_0x58502d+'_'+_0xf3071a,_0xf3071a++;}_0x5c69e0[_0x25657d(0x8d)](_0x5dda94),_0x58afc8[_0x25657d(0xfc)](_0x31228c,_0x5dda94);const _0x1c6acd=journeyActivationStepToYaml(_0x8c02db,_0x5b6065,_0x2ea3ec);return{'name':_0x5dda94,'isJourneyLocal':!![],'definition':_0x1c6acd};}catch{return{'name':_0x31228c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2033d8,_0x511399)=>resolveJumpTarget(_0x2033d8,_0x511399,_0x4849c2,_0xd5b2b1=>_0x45df43[_0x97ab42(0xa6)][_0x97ab42(0x75)](_0xd5b2b1))}),_0xb35419=hasMultipleVersions(_0x2e0b31);if(_0xb35419&&_0x1e3cf9[_0x97ab42(0x139)]>0x1){const _0x517d3f=[];for(const _0x5596f6 of _0x1e3cf9){const _0x37e240=await withSpinner(_0x97ab42(0xd9)+_0x2e0b31[_0x97ab42(0xfb)]+_0x97ab42(0x12a)+(_0x5596f6[_0x97ab42(0xc9)]||0x1)+'...',()=>_0x45df43[_0x97ab42(0xa6)][_0x97ab42(0x75)](_0x5596f6['id']),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),_0x28e98a=_0x1686de(_0x5596f6['id']);_0x2ef290=_0x28e98a;const _0x9f1dd9=await apiToYamlAsync(_0x37e240['data'],_0x28e98a);_0x517d3f[_0x97ab42(0x8c)]({'item':_0x5596f6,'yaml':_0x9f1dd9});}_0x1a3534=buildMergedJourneyYaml(_0x517d3f);const _0x2d8ecd=Math[_0x97ab42(0x137)](..._0x517d3f[_0x97ab42(0x117)](_0x8682cc=>_0x8682cc['item'][_0x97ab42(0xc9)]||0x0)),_0x5e770f=_0x1e3cf9['find'](_0x16b746=>(_0x16b746['versionNumber']||0x0)===_0x2d8ecd);_0x5e770f&&(_0x2a549a=await _0x45df43[_0x97ab42(0xa6)][_0x97ab42(0x75)](_0x5e770f['id']));}else{const _0x22c3f3=_0x1e3cf9[_0x1e3cf9[_0x97ab42(0x139)]-0x1],_0x16cda1=await withSpinner(_0x97ab42(0xd9)+_0x2e0b31[_0x97ab42(0xfb)]+_0x97ab42(0xe4),()=>_0x45df43[_0x97ab42(0xa6)][_0x97ab42(0x75)](_0x22c3f3['id']),{'verbose':_0x1d8f5d['verbose']});_0x2a549a=_0x16cda1[_0x97ab42(0xdb)];const _0x4626df=_0x1686de(_0x22c3f3['id']);_0x2ef290=_0x4626df,_0x1a3534=await apiToYamlAsync(_0x2a549a,_0x4626df);}}if(_0x4192be&&!_0x246197['has'](_0x4192be)){const _0x32c65a=_0x4192be[_0x97ab42(0xeb)]('/');let _0x445c94='';for(const _0x2cac3f of _0x32c65a){_0x445c94=_0x445c94?_0x445c94+'/'+_0x2cac3f:_0x2cac3f,!_0x246197['has'](_0x445c94)&&_0x3776ba[_0x97ab42(0x8d)](_0x445c94);}}const _0x7293e2=normalizeJourneyYaml(_0x2e0b31,_0x2e0b31),_0x340f68=a36_0x13a1cb(_0x7293e2);let _0x4a30bf=![],_0x42e301;if(_0x1a3534){const _0x2f099c=normalizeJourneyYaml(_0x1a3534,_0x2e0b31),_0x8e119a=a36_0x13a1cb(_0x2f099c),_0x518cd9=generateDiff(_0x8e119a,_0x340f68);_0x4a30bf=hasChanges(_0x518cd9),_0x4a30bf&&(_0x42e301=formatDiffWithColors(_0x518cd9));}else{const _0x167d0e=generateDiff('',_0x340f68);_0x42e301=formatDiffWithColors(_0x167d0e);}_0x27f091[_0x97ab42(0x8c)]({'relativePath':_0x2e0b31['name'],'absolutePath':_0x55eb34,'yamlConfig':_0x2e0b31,'folderPath':_0x4192be,'existingJourney':_0x2a549a,'isNew':!_0x2a549a,'hasChanges':_0x4a30bf,'diff':_0x42e301});}let _0x2549f3=[];if(!_0x1d8974){const _0x32c358=new Set();for(const {yamlConfig:_0x3f567a,folderPath:_0x57ebaa}of _0x511834){const _0x5beda3=resolveTDFolderPath(_0x57ebaa,_0x653361,_0x2dc6a3);_0x32c358['add'](_0x5beda3+':'+_0x3f567a['name']);}_0x2549f3=_0x3cddb4[_0x97ab42(0x163)](_0x4bbebf=>{const _0x52178d=_0x97ab42,_0x2eb99b=_0x4bbebf[_0x52178d(0xc5)]?_0x518def[_0x52178d(0x121)](_0x4bbebf[_0x52178d(0xc5)])||'':'',_0x26f7ee=_0x2eb99b+':'+_0x4bbebf[_0x52178d(0x157)];if(_0x32c358[_0x52178d(0xd6)](_0x26f7ee))return![];if(_0x653361)return _0x2eb99b===_0x2dc6a3||_0x2eb99b[_0x52178d(0xb9)](_0x2dc6a3+'/');return!![];});}const _0x241772=_0x2dafcc[_0x97ab42(0x163)](_0x8d00a7=>_0x8d00a7['isNew']),_0x570279=_0x2dafcc[_0x97ab42(0x163)](_0x3e6a00=>!_0x3e6a00['isNew']&&_0x3e6a00[_0x97ab42(0x128)]),_0x2a19d4=_0x2dafcc[_0x97ab42(0x163)](_0x3563bc=>!_0x3563bc[_0x97ab42(0xc8)]&&!_0x3563bc[_0x97ab42(0x128)]),_0x2015a4=Array[_0x97ab42(0xf5)](_0x3776ba)[_0x97ab42(0x17d)](),_0x6cd4e4=_0x1d8f5d[_0x97ab42(0x17c)]?_0x590d9d:[],_0x582d3f=_0x1d8f5d[_0x97ab42(0x17c)]?_0x2549f3:[],_0x48b783=_0x2dafcc[_0x97ab42(0x110)](_0x3079d8=>_0x3079d8[_0x97ab42(0xbf)]),_0x52627a=_0x48b783[_0x97ab42(0x163)](_0x5ceae0=>_0x5ceae0['type']==='create'),_0x389969=_0x48b783['filter'](_0x3c52fe=>_0x3c52fe[_0x97ab42(0x181)]===_0x97ab42(0xd1)),_0x533ec3=_0x48b783[_0x97ab42(0x163)](_0x5b9b00=>_0x5b9b00[_0x97ab42(0x181)]===_0x97ab42(0x17c)),_0x5f2a52=_0x27f091[_0x97ab42(0x163)](_0x22ff85=>_0x22ff85[_0x97ab42(0xc8)]),_0x360fbb=_0x27f091[_0x97ab42(0x163)](_0x32aaf0=>!_0x32aaf0[_0x97ab42(0xc8)]&&_0x32aaf0[_0x97ab42(0x128)]),_0x5a1ad0=_0x27f091['filter'](_0x13ce6c=>!_0x13ce6c[_0x97ab42(0xc8)]&&!_0x13ce6c[_0x97ab42(0x128)]);console[_0x97ab42(0x182)](_0x97ab42(0x162)+_0x42c612+'\x27:');_0x2015a4['length']>0x0&&console[_0x97ab42(0x182)]('\x20\x20'+a36_0x3401d0['blue'](_0x97ab42(0x125)+_0x2015a4['length']+_0x97ab42(0x116)));if(!_0x1d8f5d[_0x97ab42(0xb3)]){console['error'](_0x97ab42(0xe2)),console[_0x97ab42(0x182)]('\x20\x20\x20\x20'+a36_0x3401d0[_0x97ab42(0x88)]('+\x20'+_0x241772['length']+'\x20new')),console['error'](_0x97ab42(0x130)+a36_0x3401d0[_0x97ab42(0x135)]('~\x20'+_0x570279[_0x97ab42(0x139)]+_0x97ab42(0xed)));if(_0x6cd4e4[_0x97ab42(0x139)]>0x0)console[_0x97ab42(0x182)](_0x97ab42(0x130)+a36_0x3401d0[_0x97ab42(0x13a)]('-\x20'+_0x6cd4e4[_0x97ab42(0x139)]+_0x97ab42(0xe9)));else _0x590d9d[_0x97ab42(0x139)]>0x0&&!_0x1d8f5d[_0x97ab42(0x17c)]&&console['error'](_0x97ab42(0x130)+a36_0x3401d0['dim'](_0x590d9d[_0x97ab42(0x139)]+_0x97ab42(0x173)));console[_0x97ab42(0x182)](_0x97ab42(0x130)+a36_0x3401d0[_0x97ab42(0xae)]('=\x20'+_0x2a19d4[_0x97ab42(0x139)]+'\x20unchanged'));}if(_0x27f091[_0x97ab42(0x139)]>0x0||_0x2549f3[_0x97ab42(0x139)]>0x0){console[_0x97ab42(0x182)](_0x97ab42(0x186)),console['error'](_0x97ab42(0x130)+a36_0x3401d0[_0x97ab42(0x88)]('+\x20'+_0x5f2a52[_0x97ab42(0x139)]+_0x97ab42(0x185))),console[_0x97ab42(0x182)]('\x20\x20\x20\x20'+a36_0x3401d0['yellow']('~\x20'+_0x360fbb[_0x97ab42(0x139)]+_0x97ab42(0xed)));if(_0x582d3f['length']>0x0)console[_0x97ab42(0x182)](_0x97ab42(0x130)+a36_0x3401d0[_0x97ab42(0x13a)]('-\x20'+_0x582d3f[_0x97ab42(0x139)]+_0x97ab42(0xe9)));else _0x2549f3[_0x97ab42(0x139)]>0x0&&!_0x1d8f5d[_0x97ab42(0x17c)]&&console[_0x97ab42(0x182)](_0x97ab42(0x130)+a36_0x3401d0['dim'](_0x2549f3[_0x97ab42(0x139)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x97ab42(0x182)](_0x97ab42(0x130)+a36_0x3401d0['dim']('=\x20'+_0x5a1ad0['length']+_0x97ab42(0x12c)));}_0x48b783['length']>0x0&&!_0x1d8f5d[_0x97ab42(0xb3)]&&(console[_0x97ab42(0x182)](''),console[_0x97ab42(0x182)](_0x97ab42(0xad)),_0x52627a['length']>0x0&&console[_0x97ab42(0x182)]('\x20\x20\x20\x20'+a36_0x3401d0['green']('+\x20'+_0x52627a[_0x97ab42(0x139)]+'\x20to\x20create')),_0x389969[_0x97ab42(0x139)]>0x0&&console[_0x97ab42(0x182)](_0x97ab42(0x130)+a36_0x3401d0[_0x97ab42(0x135)]('~\x20'+_0x389969[_0x97ab42(0x139)]+'\x20to\x20update')),_0x533ec3[_0x97ab42(0x139)]>0x0&&console[_0x97ab42(0x182)](_0x97ab42(0x130)+a36_0x3401d0[_0x97ab42(0x13a)]('-\x20'+_0x533ec3['length']+'\x20to\x20delete')));console['error'](_0x97ab42(0xb2)+a36_0x3401d0[_0x97ab42(0x90)](_0x46b75e)+'\x0a');if(_0x2015a4['length']>0x0){console[_0x97ab42(0x182)](_0x97ab42(0x147));for(const _0x2ab5d2 of _0x2015a4){console['error']('\x20\x20'+a36_0x3401d0[_0x97ab42(0xa2)]('+')+'\x20'+_0x2ab5d2);}console['error']('');}if(_0x241772[_0x97ab42(0x139)]>0x0&&!_0x1d8f5d[_0x97ab42(0xb3)])for(const _0x2a6d4e of _0x241772){const _0x2459a0=_0x2a6d4e[_0x97ab42(0x120)]?_0x2a6d4e['folderPath']+'/'+_0x2a6d4e[_0x97ab42(0x124)][_0x97ab42(0xfb)]:_0x2a6d4e[_0x97ab42(0x124)]['name'],_0x501d1a=_0x2a6d4e['yamlConfig'][_0x97ab42(0xd2)]?.[_0x97ab42(0x139)]||0x0,_0x5593aa=_0x501d1a>0x0?a36_0x3401d0[_0x97ab42(0xae)]('\x20['+_0x501d1a+'\x20activations]'):'';console['error']('\x0a'+a36_0x3401d0[_0x97ab42(0x88)](_0x97ab42(0x111))+'\x20'+_0x2459a0+_0x5593aa),console[_0x97ab42(0x182)]('─'[_0x97ab42(0xa9)](0x3c)),_0x2a6d4e[_0x97ab42(0xd4)]&&console[_0x97ab42(0x182)](_0x2a6d4e[_0x97ab42(0xd4)]),console['error']('─'[_0x97ab42(0xa9)](0x3c));}if(_0x6cd4e4[_0x97ab42(0x139)]>0x0&&!_0x1d8f5d[_0x97ab42(0xb3)])for(const _0x5df0f2 of _0x6cd4e4){const _0x4a2cc7=_0x5df0f2['segmentFolderId']?_0x518def[_0x97ab42(0x121)](_0x5df0f2['segmentFolderId'][_0x97ab42(0x89)]())||'':'',_0x24416f=_0x4a2cc7?_0x4a2cc7+'/'+_0x5df0f2['name']:_0x5df0f2[_0x97ab42(0xfb)],_0x1097ab=_0x31b9e3[_0x97ab42(0x121)](_0x5df0f2['id'])||[],_0x5c9312=_0x1097ab[_0x97ab42(0x139)]>0x0?a36_0x3401d0[_0x97ab42(0xae)]('\x20['+_0x1097ab[_0x97ab42(0x139)]+_0x97ab42(0x17e)):'';console['error']('\x0a'+a36_0x3401d0['red'](_0x97ab42(0x131))+'\x20'+_0x24416f+_0x5c9312),console[_0x97ab42(0x182)]('─'[_0x97ab42(0xa9)](0x3c));const _0x296553=segmentWithActivationsToYaml(_0x5df0f2,_0x1097ab,undefined,_0x5b6065,_0x2ea3ec),_0x50d2ca=segmentToYamlString(_0x296553),_0x4efe0a=generateDiff(_0x50d2ca,'');console[_0x97ab42(0x182)](formatDiffWithColors(_0x4efe0a)),console[_0x97ab42(0x182)]('─'['repeat'](0x3c));}const _0x43e452=_0x2dafcc['filter'](_0x36926c=>!_0x36926c[_0x97ab42(0xc8)]&&_0x36926c['diff']);if(_0x43e452[_0x97ab42(0x139)]>0x0&&!_0x1d8f5d[_0x97ab42(0xb3)])for(const _0x5c2777 of _0x43e452){const _0x584595=_0x5c2777['folderPath']?_0x5c2777['folderPath']+'/'+_0x5c2777[_0x97ab42(0x124)][_0x97ab42(0xfb)]:_0x5c2777[_0x97ab42(0x124)][_0x97ab42(0xfb)];console[_0x97ab42(0x182)]('\x0a'+a36_0x3401d0[_0x97ab42(0x135)](_0x97ab42(0x114))+'\x20'+_0x584595),console['error']('─'[_0x97ab42(0xa9)](0x3c)),console[_0x97ab42(0x182)](_0x5c2777['diff']),console[_0x97ab42(0x182)]('─'[_0x97ab42(0xa9)](0x3c));}if(_0x5f2a52[_0x97ab42(0x139)]>0x0)for(const _0x4aa33f of _0x5f2a52){const _0x5336ca=_0x4aa33f[_0x97ab42(0x120)]?_0x4aa33f[_0x97ab42(0x120)]+'/'+_0x4aa33f[_0x97ab42(0x124)]['name']:_0x4aa33f[_0x97ab42(0x124)][_0x97ab42(0xfb)];console['error']('\x0a'+a36_0x3401d0[_0x97ab42(0x88)](_0x97ab42(0xfa))+'\x20'+_0x5336ca),console[_0x97ab42(0x182)]('─'['repeat'](0x3c)),_0x4aa33f[_0x97ab42(0xd4)]&&console['error'](_0x4aa33f[_0x97ab42(0xd4)]),console[_0x97ab42(0x182)]('─'[_0x97ab42(0xa9)](0x3c));}const _0x17a5dc=_0x27f091[_0x97ab42(0x163)](_0x53f3b3=>!_0x53f3b3[_0x97ab42(0xc8)]&&_0x53f3b3['diff']);if(_0x17a5dc[_0x97ab42(0x139)]>0x0)for(const _0x1ba2ba of _0x17a5dc){const _0x41f04d=_0x1ba2ba[_0x97ab42(0x120)]?_0x1ba2ba[_0x97ab42(0x120)]+'/'+_0x1ba2ba[_0x97ab42(0x124)][_0x97ab42(0xfb)]:_0x1ba2ba[_0x97ab42(0x124)][_0x97ab42(0xfb)];console['error']('\x0a'+a36_0x3401d0[_0x97ab42(0x135)](_0x97ab42(0x141))+'\x20'+_0x41f04d),console[_0x97ab42(0x182)]('─'['repeat'](0x3c)),console[_0x97ab42(0x182)](_0x1ba2ba[_0x97ab42(0xd4)]),console[_0x97ab42(0x182)]('─'[_0x97ab42(0xa9)](0x3c));}if(_0x582d3f[_0x97ab42(0x139)]>0x0)for(const _0x3908bb of _0x582d3f){const _0x22f48c=_0x3908bb[_0x97ab42(0xc5)]?_0x518def[_0x97ab42(0x121)](_0x3908bb[_0x97ab42(0xc5)])||'':'',_0x244c3a=_0x22f48c?_0x22f48c+'/'+_0x3908bb[_0x97ab42(0x157)]:_0x3908bb[_0x97ab42(0x157)];console['error']('\x0a'+a36_0x3401d0[_0x97ab42(0x13a)](_0x97ab42(0x122))+'\x20'+_0x244c3a),console['error']('─'[_0x97ab42(0xa9)](0x3c)),console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x13a)](_0x97ab42(0x168))),console[_0x97ab42(0x182)]('─'[_0x97ab42(0xa9)](0x3c));}if(_0x1d8f5d[_0x97ab42(0xe5)])return console['error'](a36_0x3401d0[_0x97ab42(0x135)](_0x97ab42(0xb0))),0x0;const _0x3442ac=_0x1d8f5d[_0x97ab42(0xb3)]?![]:_0x241772['length']>0x0||_0x570279['length']>0x0||_0x6cd4e4[_0x97ab42(0x139)]>0x0,_0x211d37=_0x5f2a52[_0x97ab42(0x139)]>0x0||_0x360fbb[_0x97ab42(0x139)]>0x0||_0x582d3f[_0x97ab42(0x139)]>0x0,_0x2b5328=_0x1d8f5d[_0x97ab42(0xb3)]?![]:_0x48b783[_0x97ab42(0x139)]>0x0,_0x3a4acb=_0x2015a4[_0x97ab42(0x139)]>0x0;if(!_0x3442ac&&!_0x211d37&&!_0x2b5328&&!_0x3a4acb){const _0x3f6e70=_0x1d8f5d['journeysOnly']?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x88)](_0x3f6e70));if(_0x1d8974&&_0x5a1ad0[_0x97ab42(0x139)]===0x1){const _0x190af4=_0x5a1ad0[0x0];if(_0x190af4[_0x97ab42(0x129)]?.['id']){const _0x31970f=getConsoleNextUrl(_0x1d8f5d['site'],_0x97ab42(0x13f)+_0x138b0e+_0x97ab42(0x7a)+_0x190af4['existingJourney']['id']+'/j/da/je');console['error']('\x20\x20'+a36_0x3401d0[_0x97ab42(0x90)](_0x31970f));}}return 0x0;}const _0x1a820d=_0x1d8f5d['journeysOnly']?_0x5f2a52[_0x97ab42(0x139)]+_0x360fbb[_0x97ab42(0x139)]+_0x582d3f['length']+_0x2015a4[_0x97ab42(0x139)]:_0x241772[_0x97ab42(0x139)]+_0x570279[_0x97ab42(0x139)]+_0x6cd4e4[_0x97ab42(0x139)]+_0x5f2a52['length']+_0x360fbb[_0x97ab42(0x139)]+_0x582d3f[_0x97ab42(0x139)]+_0x2015a4[_0x97ab42(0x139)]+_0x48b783['length'];if(!_0x1d8f5d['yes']&&_0x1a820d>0x0){const _0x2b7adc=await confirmKey(_0x97ab42(0x9a)+_0x1a820d+_0x97ab42(0x143));if(!_0x2b7adc)return console['error'](_0x97ab42(0xd3)),0x1;}for(const _0x10d9bb of _0x2015a4){const _0x31b509=_0x10d9bb[_0x97ab42(0xeb)]('/'),_0x268e2c=_0x31b509[_0x31b509[_0x97ab42(0x139)]-0x1],_0x16d4e4=_0x31b509[_0x97ab42(0xb4)](0x0,-0x1)[_0x97ab42(0x106)]('/'),_0x5afd76=_0x246197[_0x97ab42(0x121)](_0x16d4e4),_0x41dcf4={'name':_0x268e2c,'parentFolderId':_0x5afd76},_0x14c8d4=await withSpinner(_0x97ab42(0x13c)+_0x10d9bb+'\x27...',()=>_0x45df43[_0x97ab42(0xdd)]['createFolder'](_0x138b0e,_0x41dcf4),{'verbose':_0x1d8f5d['verbose']});_0x246197[_0x97ab42(0xfc)](_0x10d9bb,_0x14c8d4[_0x97ab42(0xdb)]['id']),console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0xa2)](_0x97ab42(0x16c)+_0x10d9bb+'\x27'));}let _0x30c892=0x0,_0x5e0791=0x0,_0x318f3c=0x0,_0x6ea0a=0x0,_0x56ede4=0x0,_0x5327c1=0x0;const _0x413f0e=new Map();for(const _0x284862 of _0x1d8f5d['journeysOnly']?[]:_0x2dafcc){const _0x4a36e1=_0x284862['folderPath']?_0x246197[_0x97ab42(0x121)](_0x284862[_0x97ab42(0x120)]):undefined;let _0x467e78;try{if(_0x284862[_0x97ab42(0xc8)]){const _0x3e3735=yamlToCreateRequest(_0x284862['yamlConfig'],_0x4a36e1),_0x2c0114=await withSpinner(_0x97ab42(0x159)+_0x284862[_0x97ab42(0x124)]['name']+'\x27...',()=>_0x45df43['segment']['createSegment'](_0x138b0e,_0x3e3735),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]});_0x467e78=_0x2c0114[_0x97ab42(0xdb)]['id'],_0x413f0e['set'](_0x284862[_0x97ab42(0x124)][_0x97ab42(0xfb)],_0x467e78),console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x88)](_0x97ab42(0x74)+_0x284862[_0x97ab42(0x124)][_0x97ab42(0xfb)]+'\x27')),_0x30c892++;}else{if(_0x284862[_0x97ab42(0x128)]){const _0x5b7c13=yamlToUpdateRequest(_0x284862['yamlConfig']);_0x4a36e1!==_0x284862[_0x97ab42(0x12e)]?.[_0x97ab42(0x11d)]&&(_0x5b7c13[_0x97ab42(0x11d)]=_0x4a36e1?parseInt(_0x4a36e1,0xa):undefined),await withSpinner('Updating\x20segment\x20\x27'+_0x284862[_0x97ab42(0x124)][_0x97ab42(0xfb)]+_0x97ab42(0x80),()=>_0x45df43['segment'][_0x97ab42(0x155)](_0x138b0e,_0x284862[_0x97ab42(0x12e)]['id'],_0x5b7c13),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),_0x467e78=_0x284862[_0x97ab42(0x12e)]['id'],console['error'](a36_0x3401d0[_0x97ab42(0x135)]('✔\x20Updated\x20segment\x20\x27'+_0x284862[_0x97ab42(0x124)]['name']+'\x27')),_0x5e0791++;}else _0x467e78=_0x284862[_0x97ab42(0x12e)]['id'];}}catch(_0x2e26f3){const _0x3f8c85=isHttp400Error(_0x2e26f3),_0xed95a9=_0x3f8c85?ErrorCode[_0x97ab42(0x86)]:ErrorCode[_0x97ab42(0x10b)],_0x30a8f8=getErrorMessage(_0x2e26f3);throw new SDKError(_0xed95a9,'Failed\x20to\x20'+(_0x284862[_0x97ab42(0xc8)]?'create':_0x97ab42(0xd1))+_0x97ab42(0x107)+_0x284862['absolutePath']+_0x97ab42(0x144)+_0x30a8f8,_0x2e26f3);}for(const _0x206f0d of _0x284862[_0x97ab42(0xbf)]){try{if(_0x206f0d[_0x97ab42(0x181)]===_0x97ab42(0xf1)&&_0x206f0d[_0x97ab42(0x95)])await withSpinner(_0x97ab42(0x138)+_0x206f0d[_0x97ab42(0xfb)]+'\x27...',()=>_0x45df43[_0x97ab42(0xdd)][_0x97ab42(0xbc)](_0x138b0e,_0x467e78,_0x206f0d[_0x97ab42(0x95)]),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),console[_0x97ab42(0x182)](a36_0x3401d0['green']('\x20\x20✔\x20Created\x20activation\x20\x27'+_0x206f0d[_0x97ab42(0xfb)]+'\x27')),_0x6ea0a++;else{if(_0x206f0d['type']===_0x97ab42(0xd1)&&_0x206f0d[_0x97ab42(0x95)]&&_0x206f0d['existingActivation'])await withSpinner(_0x97ab42(0x178)+_0x206f0d[_0x97ab42(0xfb)]+_0x97ab42(0x80),()=>_0x45df43['segment'][_0x97ab42(0x113)](_0x138b0e,_0x467e78,_0x206f0d['existingActivation']['id'],_0x206f0d[_0x97ab42(0x95)]),{'verbose':_0x1d8f5d['verbose']}),console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x135)](_0x97ab42(0x96)+_0x206f0d[_0x97ab42(0xfb)]+'\x27')),_0x56ede4++;else _0x206f0d[_0x97ab42(0x181)]===_0x97ab42(0x17c)&&_0x206f0d['existingActivation']&&(await withSpinner('Deleting\x20activation\x20\x27'+_0x206f0d[_0x97ab42(0xfb)]+_0x97ab42(0x80),()=>_0x45df43[_0x97ab42(0xdd)]['deleteActivation'](_0x138b0e,_0x467e78,_0x206f0d[_0x97ab42(0x8e)]['id']),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x13a)](_0x97ab42(0xbd)+_0x206f0d['name']+'\x27')),_0x5327c1++);}}catch(_0x354a67){const _0x33558f=isHttp400Error(_0x354a67),_0x2d13b5=_0x33558f?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x510ee5=getErrorMessage(_0x354a67);throw new SDKError(_0x2d13b5,_0x97ab42(0x79)+_0x206f0d['type']+'\x20activation\x20\x27'+_0x206f0d['name']+_0x97ab42(0x145)+_0x284862[_0x97ab42(0x108)]+_0x97ab42(0x144)+_0x510ee5,_0x354a67);}}}for(const _0x411dec of _0x1d8f5d['journeysOnly']?[]:_0x6cd4e4){await withSpinner(_0x97ab42(0x14e)+_0x411dec[_0x97ab42(0xfb)]+_0x97ab42(0x80),()=>_0x45df43[_0x97ab42(0xdd)][_0x97ab42(0x87)](_0x411dec['id']),{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]}),console[_0x97ab42(0x182)](a36_0x3401d0['red'](_0x97ab42(0xef)+_0x411dec[_0x97ab42(0xfb)]+'\x27')),_0x318f3c++;}let _0x208d8c=0x0,_0x144862=0x0,_0x32148a=0x0;const _0x1b2b47=new Map(_0xa9215c);for(const _0x443497 of _0x2dafcc){_0x443497[_0x97ab42(0xc8)]&&_0x413f0e['has'](_0x443497['yamlConfig'][_0x97ab42(0xfb)])&&_0x1b2b47[_0x97ab42(0xfc)](_0x443497['yamlConfig'][_0x97ab42(0xfb)],_0x413f0e[_0x97ab42(0x121)](_0x443497[_0x97ab42(0x124)][_0x97ab42(0xfb)]));}if(_0x27f091[_0x97ab42(0x139)]>0x0){const _0x5cf229=await withQuerySpinner(_0x97ab42(0xa7),async _0x4e1759=>{const _0x4e8ae4=_0x97ab42,_0x18321b=[];let _0x4c69ed=0x0;const _0x3c5d64=0x5;for(let _0x2a1222=0x0;_0x2a1222<_0x27f091[_0x4e8ae4(0x139)];_0x2a1222+=_0x3c5d64){const _0x39bdf6=_0x27f091['slice'](_0x2a1222,_0x2a1222+_0x3c5d64),_0x30afa6=await Promise['all'](_0x39bdf6[_0x4e8ae4(0x117)](async _0x43c389=>{const _0x8a4097=_0x4e8ae4;if(!_0x43c389[_0x8a4097(0xc8)]&&!_0x43c389['hasChanges'])return{'action':'unchanged','name':_0x43c389[_0x8a4097(0x124)][_0x8a4097(0xfb)],'journeyId':_0x43c389[_0x8a4097(0x129)]?.['id']};const _0x2ecc0b=_0x43c389[_0x8a4097(0x120)]?_0x246197['get'](_0x43c389[_0x8a4097(0x120)]):undefined,_0x3a6855=_0x43c389[_0x8a4097(0xc8)]?_0x8a4097(0x17f):_0x8a4097(0xa4);_0x4e1759[_0x8a4097(0xa0)](_0x3a6855+_0x8a4097(0xce)+_0x43c389[_0x8a4097(0x124)][_0x8a4097(0xfb)]+'\x27');const _0x21725d=new Map(),_0x5187c1=new Map(),_0x33c5b4=new Map(),_0x365ab6={'resolveSegmentId':async _0xcba3c4=>{const _0x196c35=_0x8a4097,_0x3b2c7c=_0x1b2b47['get'](_0xcba3c4);if(!_0x3b2c7c)throw new SDKError(ErrorCode[_0x196c35(0x119)],_0x196c35(0x11e)+_0xcba3c4+'\x20(referenced\x20in\x20journey\x20'+_0x43c389[_0x196c35(0x124)][_0x196c35(0xfb)]+')');return _0x3b2c7c;},'resolveEmbeddedSegmentId':async(_0x2fbce4,_0x5bae39)=>{const _0x368cbd=_0x8a4097,_0x492696=_0x1b2b47[_0x368cbd(0x121)](_0x2fbce4);if(_0x492696)return _0x492696;const _0x26f254=_0x44edbd[_0x368cbd(0xcf)](_0x11f5d6=>_0x11f5d6[_0x368cbd(0xfb)]===_0x2fbce4);if(_0x26f254)return _0x1b2b47[_0x368cbd(0xfc)](_0x2fbce4,_0x26f254['id']),_0x26f254['id'];if(_0x43c389[_0x368cbd(0xc8)]){const _0x9d1398=_0x43c389[_0x368cbd(0x124)][_0x368cbd(0x15a)]||_0x43c389[_0x368cbd(0x124)][_0x368cbd(0x94)]?.[0x0]?.[_0x368cbd(0x15a)]||[];let _0x4290f7=_0x368cbd(0xa1),_0x4b6eb3=_0x2fbce4;const _0x5ea40d=_0x43c389['yamlConfig'][_0x368cbd(0x174)]||_0x43c389['yamlConfig'][_0x368cbd(0x94)]?.[0x0]?.[_0x368cbd(0x174)];if(_0x5ea40d?.[_0x368cbd(0xdd)]===_0x2fbce4)_0x4290f7=_0x368cbd(0x174),_0x4b6eb3=_0x5ea40d[_0x368cbd(0xfb)]||_0x2fbce4;else{_0x267e16:for(const _0xf1a0fe of _0x9d1398){if(_0xf1a0fe[_0x368cbd(0x16e)]?.[_0x368cbd(0xdd)]===_0x2fbce4){_0x4290f7=_0xf1a0fe[_0x368cbd(0xfb)],_0x4b6eb3=_0xf1a0fe[_0x368cbd(0x16e)][_0x368cbd(0xfb)]||_0x2fbce4;break;}if(_0xf1a0fe['steps'])for(const _0x32e175 of _0xf1a0fe[_0x368cbd(0xe6)]){if(_0x32e175[_0x368cbd(0x181)]===_0x368cbd(0x12b)&&_0x32e175[_0x368cbd(0x93)]?.[_0x368cbd(0x161)])for(const _0x302cfb of _0x32e175[_0x368cbd(0x93)]['branches']){if(_0x302cfb['segment']===_0x2fbce4){_0x4290f7=_0xf1a0fe[_0x368cbd(0xfb)],_0x4b6eb3=_0x302cfb[_0x368cbd(0xfb)]||_0x2fbce4;break _0x267e16;}}}}}return validateSegmentRule(_0x2fbce4,_0x5bae39['rule']),_0x5187c1[_0x368cbd(0xfc)](_0x2fbce4,{'definition':_0x5bae39,'stageName':_0x4290f7,'criteriaName':_0x4b6eb3}),createPendingSegmentId(_0x2fbce4);}const _0x191a48=_0x43c389[_0x368cbd(0x129)]?.['id'];if(!_0x191a48)throw new SDKError(ErrorCode[_0x368cbd(0xc2)],_0x368cbd(0xcc));validateSegmentRule(_0x2fbce4,_0x5bae39[_0x368cbd(0x126)]);const _0x38e326=_0x368cbd(0x118)+crypto['randomUUID']();try{const _0x1d66c3=await _0x45df43['segment'][_0x368cbd(0x11f)]({'name':_0x38e326,'description':_0x5bae39[_0x368cbd(0x14b)]||_0x368cbd(0x13b)+_0x2fbce4,'journeyId':_0x191a48,'rule':yamlRuleToApi(_0x5bae39[_0x368cbd(0x126)],!![]),'countPopulation':!![],'parentFolderId':_0xd8f619||'','audienceId':_0x138b0e});return _0x1d8f5d[_0x368cbd(0x12f)]&&console[_0x368cbd(0x182)](_0x368cbd(0xc7)+_0x2fbce4+_0x368cbd(0xba)+_0x38e326+')\x20with\x20ID:\x20'+_0x1d66c3),_0x1b2b47[_0x368cbd(0xfc)](_0x2fbce4,_0x1d66c3),_0x1d66c3;}catch(_0x4148a0){throw new SDKError(ErrorCode[_0x368cbd(0x10b)],'Failed\x20to\x20create\x20embedded\x20segment\x20\x27'+_0x2fbce4+'\x27:\x20'+getErrorMessage(_0x4148a0),_0x4148a0);}},'resolveActivationId':async _0x28c0ba=>{const _0x2fd412=_0x8a4097,_0x31baec=_0x21725d[_0x2fd412(0x121)](_0x28c0ba);if(_0x31baec)return _0x31baec;if(_0x43c389['existingJourney']){const _0x11095b=await _0x45df43['journey'][_0x2fd412(0x9f)](_0x43c389[_0x2fd412(0x129)]['id']),_0x5c11e0=_0x11095b[_0x2fd412(0xcf)](_0x45f3b7=>_0x45f3b7[_0x2fd412(0xf9)][_0x2fd412(0x140)]?.[_0x2fd412(0xfb)]===_0x28c0ba);if(_0x5c11e0)return _0x21725d[_0x2fd412(0xfc)](_0x28c0ba,_0x5c11e0['id']),_0x5c11e0['id'];}throw new SDKError(ErrorCode['NOT_FOUND'],_0x2fd412(0x184)+_0x28c0ba+_0x2fd412(0xac)+_0x43c389[_0x2fd412(0x124)]['name']+').\x20'+_0x2fd412(0xbe));},'resolveEmbeddedActivationId':async(_0x3b725f,_0x2f4009)=>{const _0x48270d=_0x8a4097,_0x59203b=_0x21725d[_0x48270d(0x121)](_0x3b725f);if(_0x59203b)return _0x59203b;if(_0x43c389['isNew'])return _0x33c5b4[_0x48270d(0xfc)](_0x3b725f,_0x2f4009),createPendingActivationId(_0x3b725f);if(_0x43c389['existingJourney']){const _0x3548f0=await _0x45df43[_0x48270d(0xa6)][_0x48270d(0x9f)](_0x43c389[_0x48270d(0x129)]['id']),_0x51c7e8=_0x3548f0[_0x48270d(0xcf)](_0x26131b=>_0x26131b[_0x48270d(0xf9)][_0x48270d(0x140)]?.[_0x48270d(0xfb)]===_0x2f4009[_0x48270d(0xfb)]);if(_0x51c7e8)return _0x21725d[_0x48270d(0xfc)](_0x3b725f,_0x51c7e8['id']),_0x51c7e8['id'];try{const _0x27b807=await yamlActivationToCreateRequest(_0x2f4009,_0x3a0262),_0xffe31e=await _0x45df43[_0x48270d(0xa6)][_0x48270d(0xbc)](_0x43c389['existingJourney']['id'],_0x27b807);return _0x1d8f5d[_0x48270d(0x12f)]&&console[_0x48270d(0x182)](_0x48270d(0x13e)+_0x3b725f+_0x48270d(0x151)+_0xffe31e['id']),_0x21725d[_0x48270d(0xfc)](_0x3b725f,_0xffe31e['id']),_0xffe31e['id'];}catch(_0x107834){throw new SDKError(ErrorCode['JOURNEY_UPDATE_ERROR'],'Failed\x20to\x20create\x20embedded\x20activation\x20\x27'+_0x3b725f+_0x48270d(0x11c)+getErrorMessage(_0x107834),_0x107834);}}throw new SDKError(ErrorCode[_0x48270d(0xc2)],_0x48270d(0x158));},'resolveJourneyId':async _0x36a7d1=>{const _0x5a1a18=_0x8a4097;try{return await _0x45df43[_0x5a1a18(0xa6)][_0x5a1a18(0x100)](_0x138b0e,_0x36a7d1);}catch(_0x2ef648){throw new SDKError(ErrorCode[_0x5a1a18(0x9b)],_0x5a1a18(0x171)+_0x36a7d1+_0x5a1a18(0x10d)+_0x43c389['yamlConfig'][_0x5a1a18(0xfb)]+'\x27)',_0x2ef648);}},'resolveStageId':async(_0x5cc63,_0x1263b7)=>{const _0x2ce39c=_0x8a4097,_0x2f7e64=await _0x45df43[_0x2ce39c(0xa6)][_0x2ce39c(0x75)](_0x5cc63),_0x1c07a3=_0x2f7e64[_0x2ce39c(0xf9)][_0x2ce39c(0x85)]['find'](_0xd3b1ee=>_0xd3b1ee[_0x2ce39c(0xfb)]['toLowerCase']()===_0x1263b7[_0x2ce39c(0xdf)]());if(!_0x1c07a3?.['id'])throw new SDKError(ErrorCode[_0x2ce39c(0x9b)],_0x2ce39c(0x170)+_0x1263b7+_0x2ce39c(0xc4)+(_0x2f7e64['attributes']['journeyBundleName']||_0x2f7e64[_0x2ce39c(0xf9)][_0x2ce39c(0xfb)])+'\x27');return _0x1c07a3['id'];}};try{const _0x6e6b40=await a36_0x18eb28(_0x43c389[_0x8a4097(0x124)],_0x138b0e,_0x365ab6),_0x981f4d=_0x2ecc0b||_0xd8f619;_0x981f4d&&(_0x6e6b40['relationships']={'parentFolder':{'data':{'id':_0x981f4d,'type':_0x8a4097(0xdc)}}});if(_0x43c389[_0x8a4097(0xc8)]){if(_0x5187c1[_0x8a4097(0x76)]>0x0||_0x33c5b4[_0x8a4097(0x76)]>0x0){const _0x420bb3=JSON[_0x8a4097(0xd5)](JSON[_0x8a4097(0x84)](_0x6e6b40));ensureJourneyDefaults(_0x420bb3['attributes']);for(const _0x4c9182 of _0x420bb3[_0x8a4097(0xf9)][_0x8a4097(0x85)]){_0x4c9182[_0x8a4097(0x160)]?.[_0x8a4097(0xbb)]&&isPendingSegmentId(_0x4c9182[_0x8a4097(0x160)]['segmentId'])&&delete _0x4c9182[_0x8a4097(0x160)];if(_0x4c9182[_0x8a4097(0xe6)])for(const _0x332357 of Object['keys'](_0x4c9182[_0x8a4097(0xe6)])){const _0x15bace=_0x4c9182[_0x8a4097(0xe6)][_0x332357];_0x15bace['type']===_0x8a4097(0x17b)&&_0x15bace['journeyActivationStepId']&&isPendingActivationId(_0x15bace[_0x8a4097(0x183)])&&(_0x15bace[_0x8a4097(0x183)]='');if(_0x15bace['type']===_0x8a4097(0xe8)&&_0x15bace[_0x8a4097(0x161)])for(const _0x3725e2 of _0x15bace[_0x8a4097(0x161)]){_0x3725e2[_0x8a4097(0xbb)]&&isPendingSegmentId(_0x3725e2[_0x8a4097(0xbb)])&&(_0x3725e2[_0x8a4097(0xbb)]='');}}}_0x1d8f5d[_0x8a4097(0x12f)]&&console[_0x8a4097(0x182)](_0x8a4097(0x13d)+JSON[_0x8a4097(0x84)](_0x420bb3,null,0x2));const _0x1479d7=await _0x45df43['journey'][_0x8a4097(0xf1)](_0x420bb3),_0x1b65c6=_0x1479d7['id'],_0x54db41=new Map();for(const _0x46c2cd of _0x1479d7[_0x8a4097(0xf9)][_0x8a4097(0x85)]){_0x54db41[_0x8a4097(0xfc)](_0x46c2cd['name']['toLowerCase'](),_0x46c2cd['id']);}const _0x2da906=new Map();for(const [_0x6d148f,{definition:_0x49c8fe,criteriaName:_0x4d6dde}]of _0x5187c1){const _0x20d419=generateJourneyLocalName(_0x4d6dde)||_0x8a4097(0x118)+crypto[_0x8a4097(0xea)]();_0x1d8f5d['verbose']&&console['error'](_0x8a4097(0x136)+_0x6d148f+_0x8a4097(0xba)+_0x20d419+_0x8a4097(0x112)+_0x1b65c6);const _0x5023d6=await _0x45df43[_0x8a4097(0xdd)]['createJourneySegment']({'name':_0x20d419,'description':_0x49c8fe[_0x8a4097(0x14b)]||_0x8a4097(0x13b)+_0x6d148f,'journeyId':_0x1b65c6,'rule':yamlRuleToApi(_0x49c8fe[_0x8a4097(0x126)],!![]),'countPopulation':!![],'parentFolderId':_0x981f4d||'','audienceId':_0x138b0e});_0x2da906[_0x8a4097(0xfc)](_0x6d148f,_0x5023d6),_0x1b2b47['set'](_0x6d148f,_0x5023d6),_0x1d8f5d[_0x8a4097(0x12f)]&&console[_0x8a4097(0x182)](_0x8a4097(0xc7)+_0x6d148f+'\x27\x20with\x20ID:\x20'+_0x5023d6);}const _0x88aae5=new Map();for(const [_0x45fc5e,_0x2eb018]of _0x33c5b4){_0x1d8f5d[_0x8a4097(0x12f)]&&console[_0x8a4097(0x182)](_0x8a4097(0xca)+_0x45fc5e+_0x8a4097(0x9d)+_0x1b65c6);try{const _0x467fb4=await yamlActivationToCreateRequest(_0x2eb018,_0x3a0262),_0x2ca821=await _0x45df43[_0x8a4097(0xa6)]['createActivation'](_0x1b65c6,_0x467fb4);_0x88aae5['set'](_0x45fc5e,_0x2ca821['id']),_0x21725d[_0x8a4097(0xfc)](_0x45fc5e,_0x2ca821['id']),_0x1d8f5d[_0x8a4097(0x12f)]&&console[_0x8a4097(0x182)](_0x8a4097(0x13e)+_0x45fc5e+_0x8a4097(0x151)+_0x2ca821['id']);}catch(_0x264aaa){throw new SDKError(ErrorCode[_0x8a4097(0x15c)],_0x8a4097(0x7b)+_0x45fc5e+_0x8a4097(0x11c)+getErrorMessage(_0x264aaa),_0x264aaa);}}const _0x508db0=JSON['parse'](JSON[_0x8a4097(0x84)](_0x6e6b40));_0x508db0['id']=_0x1b65c6,ensureJourneyDefaults(_0x508db0[_0x8a4097(0xf9)]);const _0x28c3b7=(_0x467b33,_0x523102)=>{const _0x379de1=_0x8a4097;if(!isPendingSegmentId(_0x467b33))return _0x467b33;const _0x5c3e24=extractPendingSegmentName(_0x467b33),_0x243934=_0x2da906['get'](_0x5c3e24);return!_0x243934&&console[_0x379de1(0x182)](a36_0x3401d0[_0x379de1(0x135)]('\x20\x20⚠\x20Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x5c3e24+_0x379de1(0x8b)+_0x523102)),_0x243934;};if(_0x508db0[_0x8a4097(0xf9)][_0x8a4097(0x174)]?.['segmentId']&&isPendingSegmentId(_0x508db0[_0x8a4097(0xf9)]['goal'][_0x8a4097(0xbb)])){const _0x209783=_0x28c3b7(_0x508db0['attributes']['goal'][_0x8a4097(0xbb)],_0x8a4097(0x109));_0x209783&&(_0x508db0[_0x8a4097(0xf9)][_0x8a4097(0x174)][_0x8a4097(0xbb)]=_0x209783);}for(const _0x29b2b2 of _0x508db0[_0x8a4097(0xf9)][_0x8a4097(0x85)]){const _0x25a9ce=_0x54db41[_0x8a4097(0x121)](_0x29b2b2['name'][_0x8a4097(0xdf)]());_0x25a9ce&&(_0x29b2b2['id']=_0x25a9ce);if(_0x29b2b2[_0x8a4097(0x160)]?.['segmentId']&&isPendingSegmentId(_0x29b2b2[_0x8a4097(0x160)]['segmentId'])){const _0x107de2=_0x28c3b7(_0x29b2b2[_0x8a4097(0x160)]['segmentId'],_0x8a4097(0x150)+_0x29b2b2[_0x8a4097(0xfb)]+_0x8a4097(0x92));_0x107de2&&(_0x29b2b2[_0x8a4097(0x160)][_0x8a4097(0xbb)]=_0x107de2);}if(_0x29b2b2['exitCriterias'])for(const _0x3c04b7 of _0x29b2b2[_0x8a4097(0xe7)]){if(_0x3c04b7[_0x8a4097(0xbb)]&&isPendingSegmentId(_0x3c04b7[_0x8a4097(0xbb)])){const _0x337e6f=_0x28c3b7(_0x3c04b7[_0x8a4097(0xbb)],_0x8a4097(0x150)+_0x29b2b2[_0x8a4097(0xfb)]+_0x8a4097(0xa3));_0x337e6f&&(_0x3c04b7[_0x8a4097(0xbb)]=_0x337e6f);}}if(_0x29b2b2[_0x8a4097(0x16b)]?.[_0x8a4097(0xbb)]&&isPendingSegmentId(_0x29b2b2[_0x8a4097(0x16b)][_0x8a4097(0xbb)])){const _0x440b17=_0x28c3b7(_0x29b2b2[_0x8a4097(0x16b)][_0x8a4097(0xbb)],_0x8a4097(0x150)+_0x29b2b2[_0x8a4097(0xfb)]+'\x27\x20milestone');_0x440b17&&(_0x29b2b2['milestone'][_0x8a4097(0xbb)]=_0x440b17);}if(_0x29b2b2[_0x8a4097(0xe6)]){const _0x3b88ac=_0x4c6ae=>_0x6e6b40['attributes'][_0x8a4097(0x85)][_0x8a4097(0xcf)](_0x478379=>_0x478379['name'][_0x8a4097(0xdf)]()===_0x29b2b2['name'][_0x8a4097(0xdf)]())?.[_0x8a4097(0xe6)]?.[_0x4c6ae];for(const _0x1c2066 of Object['keys'](_0x29b2b2['steps'])){const _0x313589=_0x29b2b2['steps'][_0x1c2066],_0x297e7e=_0x3b88ac(_0x1c2066);if(_0x313589[_0x8a4097(0x181)]===_0x8a4097(0x17b)&&_0x313589[_0x8a4097(0x183)]&&(isPendingActivationId(_0x313589[_0x8a4097(0x183)])||_0x313589[_0x8a4097(0x183)]==='')){if(_0x297e7e?.[_0x8a4097(0x183)]&&isPendingActivationId(_0x297e7e[_0x8a4097(0x183)])){const _0x470a2c=extractPendingActivationName(_0x297e7e[_0x8a4097(0x183)]),_0x363234=_0x88aae5[_0x8a4097(0x121)](_0x470a2c);_0x363234&&(_0x313589[_0x8a4097(0x183)]=_0x363234);}}if(_0x313589[_0x8a4097(0x181)]===_0x8a4097(0xe8)&&_0x313589['branches']&&_0x297e7e?.[_0x8a4097(0x161)])for(let _0x5637f2=0x0;_0x5637f2<_0x313589[_0x8a4097(0x161)]['length'];_0x5637f2++){const _0x29775b=_0x313589[_0x8a4097(0x161)][_0x5637f2],_0x158d40=_0x297e7e[_0x8a4097(0x161)][_0x5637f2];if(_0x158d40?.['segmentId']&&isPendingSegmentId(_0x158d40[_0x8a4097(0xbb)])){const _0xb8fa8e=_0x28c3b7(_0x158d40[_0x8a4097(0xbb)],_0x8a4097(0x150)+_0x29b2b2['name']+_0x8a4097(0xf3)+(_0x29775b[_0x8a4097(0xfb)]||_0x5637f2)+'\x27');_0xb8fa8e&&(_0x29775b[_0x8a4097(0xbb)]=_0xb8fa8e);}}}}}return _0x1d8f5d[_0x8a4097(0x12f)]&&console[_0x8a4097(0x182)]('\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20'+JSON[_0x8a4097(0x84)](_0x508db0,null,0x2)),await _0x45df43[_0x8a4097(0xa6)][_0x8a4097(0xd1)](_0x1b65c6,_0x508db0),{'action':_0x8a4097(0xc1),'name':_0x43c389[_0x8a4097(0x124)]['name'],'journeyId':_0x1b65c6};}else{ensureJourneyDefaults(_0x6e6b40['attributes']);_0x1d8f5d[_0x8a4097(0x12f)]&&console['error'](_0x8a4097(0x175)+JSON['stringify'](_0x6e6b40,null,0x2));const _0x424b6e=await _0x45df43[_0x8a4097(0xa6)][_0x8a4097(0xf1)](_0x6e6b40);return{'action':'created','name':_0x43c389[_0x8a4097(0x124)][_0x8a4097(0xfb)],'journeyId':_0x424b6e['id']};}}else{if(_0x43c389['hasChanges']&&_0x43c389[_0x8a4097(0x129)])return ensureJourneyDefaults(_0x6e6b40['attributes']),await _0x45df43[_0x8a4097(0xa6)]['update'](_0x43c389[_0x8a4097(0x129)]['id'],_0x6e6b40),{'action':_0x8a4097(0x105),'name':_0x43c389[_0x8a4097(0x124)][_0x8a4097(0xfb)],'journeyId':_0x43c389['existingJourney']['id']};}return{'action':_0x8a4097(0xf4),'name':_0x43c389['yamlConfig']['name'],'journeyId':_0x43c389[_0x8a4097(0x129)]?.['id']};}catch(_0x3c119c){const _0x1708b4=isHttp400Error(_0x3c119c),_0x16294e=_0x1708b4?ErrorCode[_0x8a4097(0xee)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x5a8c53=getErrorMessage(_0x3c119c);throw new SDKError(_0x16294e,'Failed\x20to\x20'+(_0x43c389[_0x8a4097(0xc8)]?_0x8a4097(0xf1):_0x8a4097(0xd1))+_0x8a4097(0x77)+_0x43c389[_0x8a4097(0x108)]+'\x0a\x20\x20'+_0x5a8c53,_0x3c119c);}}));_0x18321b['push'](..._0x30afa6),_0x4c69ed+=_0x39bdf6[_0x4e8ae4(0x139)],_0x4e1759['setExtra']('('+_0x4c69ed+'/'+_0x27f091[_0x4e8ae4(0x139)]+')');}return _0x18321b;},{'verbose':_0x1d8f5d[_0x97ab42(0x12f)]});for(const _0x5e9825 of _0x5cf229[_0x97ab42(0xdb)]){if(_0x5e9825[_0x97ab42(0x14f)]==='created')console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x88)]('✔\x20Created\x20journey\x20\x27'+_0x5e9825[_0x97ab42(0xfb)]+'\x27')),_0x208d8c++;else _0x5e9825[_0x97ab42(0x14f)]===_0x97ab42(0x105)&&(console[_0x97ab42(0x182)](a36_0x3401d0[_0x97ab42(0x135)](_0x97ab42(0x134)+_0x5e9825[_0x97ab42(0xfb)]+'\x27')),_0x144862++);}if(_0x1d8974&&_0x5cf229['data']['length']===0x1){const _0x254712=_0x5cf229[_0x97ab42(0xdb)][0x0];if(_0x254712[_0x97ab42(0x149)]){const _0x55c776=getConsoleNextUrl(_0x1d8f5d['site'],_0x97ab42(0x13f)+_0x138b0e+_0x97ab42(0x7a)+_0x254712[_0x97ab42(0x149)]+_0x97ab42(0xf6));console[_0x97ab42(0x182)]('\x20\x20'+a36_0x3401d0['cyan'](_0x55c776));}}}for(const _0x25136c of _0x582d3f){console[_0x97ab42(0x182)](a36_0x3401d0['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x25136c[_0x97ab42(0x157)])),_0x32148a++;}const _0x31b1c9=[];if(_0x30c892>0x0)_0x31b1c9[_0x97ab42(0x8c)](_0x30c892+_0x97ab42(0x103));if(_0x5e0791>0x0)_0x31b1c9['push'](_0x5e0791+_0x97ab42(0x180));if(_0x318f3c>0x0)_0x31b1c9[_0x97ab42(0x8c)](_0x318f3c+_0x97ab42(0x7e));const _0xf72387=[];if(_0x208d8c>0x0)_0xf72387['push'](_0x208d8c+_0x97ab42(0x103));if(_0x144862>0x0)_0xf72387['push'](_0x144862+_0x97ab42(0x180));if(_0x32148a>0x0)_0xf72387[_0x97ab42(0x8c)](_0x32148a+_0x97ab42(0x7e));const _0x3e6663=[];if(_0x6ea0a>0x0)_0x3e6663[_0x97ab42(0x8c)](_0x6ea0a+_0x97ab42(0x103));if(_0x56ede4>0x0)_0x3e6663[_0x97ab42(0x8c)](_0x56ede4+'\x20updated');if(_0x5327c1>0x0)_0x3e6663[_0x97ab42(0x8c)](_0x5327c1+'\x20deleted');return console[_0x97ab42(0x182)](a36_0x3401d0['green'](_0x97ab42(0x132))),_0x31b1c9[_0x97ab42(0x139)]>0x0&&!_0x1d8f5d[_0x97ab42(0xb3)]&&console['error'](_0x97ab42(0x16f)+_0x31b1c9[_0x97ab42(0x106)](',\x20')),_0xf72387['length']>0x0&&console['error']('\x20\x20Journeys:\x20'+_0xf72387[_0x97ab42(0x106)](',\x20')),_0x3e6663[_0x97ab42(0x139)]>0x0&&!_0x1d8f5d['journeysOnly']&&console['error'](_0x97ab42(0xf8)+_0x3e6663['join'](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x5fed79){const _0x3f143b=a36_0x389626,_0xefab25=new Map(),_0x127ddd=new Map();for(const _0x1e86c3 of _0x5fed79){_0x127ddd[_0x3f143b(0xfc)](_0x1e86c3['id'],_0x1e86c3);}const _0x30a70b=new Set();for(const _0x560f60 of _0x5fed79){!_0x560f60[_0x3f143b(0xb1)]&&_0x30a70b['add'](_0x560f60['id']);}function _0x565283(_0x351ed7){const _0x332484=_0x3f143b;if(_0x30a70b['has'](_0x351ed7['id']))return'';if(_0x351ed7[_0x332484(0xb1)]){const _0x567a8e=_0x127ddd[_0x332484(0x121)](_0x351ed7[_0x332484(0xb1)]);if(_0x567a8e){const _0x5c1c95=_0x565283(_0x567a8e);return _0x5c1c95?_0x5c1c95+'/'+_0x351ed7['name']:_0x351ed7[_0x332484(0xfb)];}}return _0x351ed7[_0x332484(0xfb)];}for(const _0x28f234 of _0x5fed79){const _0x3690f8=_0x565283(_0x28f234);_0xefab25[_0x3f143b(0xfc)](_0x3690f8,_0x28f234['id']);}return _0xefab25;}function findYamlFiles(_0x128040){const _0x5516b3=[];function _0x559bc7(_0x30dfd7){const _0x20fb29=a36_0x4d16,_0x5681ca=readdirSync(_0x30dfd7,{'withFileTypes':!![]});for(const _0x408a27 of _0x5681ca){const _0x4c7f52=a36_0x3e3928['join'](_0x30dfd7,_0x408a27['name']);if(_0x408a27[_0x20fb29(0xc0)]())_0x559bc7(_0x4c7f52);else(_0x408a27['name']['endsWith'](_0x20fb29(0x164))||_0x408a27[_0x20fb29(0xfb)][_0x20fb29(0x172)]('.yaml'))&&_0x5516b3[_0x20fb29(0x8c)](_0x4c7f52);}}return _0x559bc7(_0x128040),_0x5516b3;}function a36_0x4d16(_0x492775,_0x2c6a7d){_0x492775=_0x492775-0x74;const _0x5958e1=a36_0x5958();let _0x4d167f=_0x5958e1[_0x492775];return _0x4d167f;}function calculateActivationActions(_0x552244,_0x264c19,_0x4da25a,_0xbebcd1){const _0x34d23e=a36_0x389626,_0x1b7aa=[],_0x2abb80=new Map();for(const _0x86c352 of _0x264c19){_0x2abb80['set'](_0x86c352[_0x34d23e(0xfb)],_0x86c352);}const _0x47fba8=new Map();for(const _0x19b848 of _0x552244){_0x47fba8[_0x34d23e(0xfc)](_0x19b848[_0x34d23e(0xfb)],_0x19b848);}for(const _0x23ab1d of _0x552244){const _0x1e6110=_0x2abb80[_0x34d23e(0x121)](_0x23ab1d[_0x34d23e(0xfb)]);if(!_0x1e6110)_0x1b7aa[_0x34d23e(0x8c)]({'type':_0x34d23e(0xf1),'name':_0x23ab1d['name'],'yamlActivation':_0x23ab1d});else{const _0x11ca41=activationToYaml(_0x1e6110,_0x4da25a,_0xbebcd1),_0x2addbc=a36_0x566de2[_0x34d23e(0x84)](_0x11ca41),_0x17f511=a36_0x566de2[_0x34d23e(0x84)](_0x23ab1d);_0x2addbc!==_0x17f511&&_0x1b7aa['push']({'type':_0x34d23e(0xd1),'name':_0x23ab1d[_0x34d23e(0xfb)],'yamlActivation':_0x23ab1d,'existingActivation':_0x1e6110});}}for(const _0x44c69f of _0x264c19){!_0x47fba8[_0x34d23e(0xd6)](_0x44c69f[_0x34d23e(0xfb)])&&_0x1b7aa[_0x34d23e(0x8c)]({'type':'delete','name':_0x44c69f['name'],'existingActivation':_0x44c69f});}return _0x1b7aa;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x37802c=a37_0x1e84;(function(_0xf4e3b7,_0x591aa8){const _0x45fd59=a37_0x1e84,_0x33f6db=_0xf4e3b7();while(!![]){try{const _0x76c6fa=-parseInt(_0x45fd59(0x17f))/0x1+parseInt(_0x45fd59(0x170))/0x2+parseInt(_0x45fd59(0x183))/0x3*(-parseInt(_0x45fd59(0x15c))/0x4)+-parseInt(_0x45fd59(0x162))/0x5+-parseInt(_0x45fd59(0x167))/0x6*(-parseInt(_0x45fd59(0x176))/0x7)+-parseInt(_0x45fd59(0x173))/0x8*(-parseInt(_0x45fd59(0x17a))/0x9)+-parseInt(_0x45fd59(0x158))/0xa*(-parseInt(_0x45fd59(0x15e))/0xb);if(_0x76c6fa===_0x591aa8)break;else _0x33f6db['push'](_0x33f6db['shift']());}catch(_0x302871){_0x33f6db['push'](_0x33f6db['shift']());}}}(a37_0x1304,0x28549));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a37_0x1304(){const _0x581e0c=['\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolvePathToResource','Update\x20existing\x20child\x20segment','95415ZWdLTc','error','Parent\x20ID:\x20','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','93uJAKuH','Resolving\x20path\x20\x27','name','folder','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x27...','40pxSKxS','Segment\x20ID\x20missing\x20from\x20resolved\x20path','includes','kind','17404zhZyke','✔\x20Updated\x20segment\x20\x27','688633OMsPpq','data','\x20\x20\x20Path:\x20','resolveFolderId','486590azXIRQ','description','Updating\x20segment\x20\x27','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','66IvUEmT','updateSegmentById','segment:update','Segment\x20ID:\x20','type','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','14284ESJxqQ','segmentPath','yellow','16fFUPhZ','segmentId','segment','64799XGOvyd','verbose','ruleFile','rule','600417owNuQw','INTERNAL'];a37_0x1304=function(){return _0x581e0c;};return a37_0x1304();}import a37_0x3ee61a from'chalk';function a37_0x1e84(_0x45a406,_0x1c6b55){_0x45a406=_0x45a406-0x157;const _0x130445=a37_0x1304();let _0x1e8498=_0x130445[_0x45a406];return _0x1e8498;}export class SegmentUpdateCommand extends BaseCommand{[a37_0x37802c(0x185)]=a37_0x37802c(0x169);[a37_0x37802c(0x163)]=a37_0x37802c(0x17e);async['execute'](_0x5eb0fd){const _0x11abf1=a37_0x37802c;console[_0x11abf1(0x180)](a37_0x3ee61a[_0x11abf1(0x172)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a37_0x3ee61a['yellow'](_0x11abf1(0x17c)));const {options:_0x4ed082,args:_0x5b07eb,tdx:_0x324b0c}=_0x5eb0fd,_0x163122=_0x4ed082;if(_0x5b07eb['length']===0x0)return console[_0x11abf1(0x180)](_0x11abf1(0x16c)),console[_0x11abf1(0x180)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x11abf1(0x180)]('Examples:'),console[_0x11abf1(0x180)](_0x11abf1(0x166)),console['error'](_0x11abf1(0x16f)),0x1;const _0x354cb6=_0x5b07eb[0x0],_0x55ddba=_0x4ed082[_0x11abf1(0x171)];let _0x391fa1=_0x354cb6;_0x55ddba&&!_0x354cb6[_0x11abf1(0x15a)]('/')&&(_0x391fa1=_0x55ddba+'/'+_0x354cb6,_0x163122[_0x11abf1(0x177)]&&console[_0x11abf1(0x180)]('Resolved\x20relative\x20path\x20to:\x20'+_0x391fa1));const _0x175f0e=await withSpinner(_0x11abf1(0x184)+_0x391fa1+_0x11abf1(0x157),()=>_0x324b0c[_0x11abf1(0x175)][_0x11abf1(0x17d)](_0x391fa1),{'verbose':_0x163122['verbose']}),_0x32b886=_0x175f0e[_0x11abf1(0x15f)];_0x163122['verbose']&&console['error'](_0x11abf1(0x165)+_0x32b886[_0x11abf1(0x16b)]);if(_0x32b886[_0x11abf1(0x16b)]!==_0x11abf1(0x175))return console[_0x11abf1(0x180)]('Error:\x20Cannot\x20update\x20'+_0x32b886[_0x11abf1(0x16b)]+_0x11abf1(0x182)),console[_0x11abf1(0x180)](_0x11abf1(0x187)),0x1;if(!_0x32b886[_0x11abf1(0x174)])throw new SDKError(ErrorCode[_0x11abf1(0x17b)],_0x11abf1(0x159));const _0x14445e=_0x32b886['parentId'],_0x160221=_0x32b886[_0x11abf1(0x174)];_0x163122['verbose']&&(console[_0x11abf1(0x180)](_0x11abf1(0x181)+_0x14445e),console[_0x11abf1(0x180)](_0x11abf1(0x16a)+_0x160221));let _0x157264;if(_0x163122[_0x11abf1(0x186)]){const _0x2f86f8=_0x163122[_0x11abf1(0x186)],_0x50c788=await withSpinner(_0x11abf1(0x16e)+_0x2f86f8+_0x11abf1(0x157),()=>_0x324b0c['segment'][_0x11abf1(0x161)](_0x14445e,_0x2f86f8),{'verbose':_0x163122[_0x11abf1(0x177)]});_0x157264=parseInt(_0x50c788[_0x11abf1(0x15f)],0xa),_0x163122[_0x11abf1(0x177)]&&console[_0x11abf1(0x180)](_0x11abf1(0x16d)+_0x157264);}const _0x334595=await loadJSONFromOptions(_0x163122[_0x11abf1(0x179)],_0x163122[_0x11abf1(0x178)]),_0x133282={'name':_0x163122['name'],'description':_0x163122[_0x11abf1(0x163)],'rule':_0x334595,'kind':_0x163122[_0x11abf1(0x15b)]!==undefined?parseInt(_0x163122[_0x11abf1(0x15b)],0xa):undefined,'segmentFolderId':_0x157264},_0x29215d=await withSpinner(_0x11abf1(0x164)+_0x32b886['segmentName']+_0x11abf1(0x157),()=>_0x324b0c['segment'][_0x11abf1(0x168)](_0x14445e,_0x160221,_0x133282),{'verbose':_0x163122['verbose']}),_0x375d1c=_0x29215d['data'];return console[_0x11abf1(0x180)](_0x11abf1(0x15d)+_0x375d1c[_0x11abf1(0x185)]+'\x27'),_0x391fa1!==_0x354cb6&&console[_0x11abf1(0x180)](_0x11abf1(0x160)+_0x391fa1),await handleSDKOutput([_0x375d1c],_0x163122),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a38_0x33ef56=a38_0x3ca1;(function(_0x30d621,_0x29f7ae){const _0x2aae10=a38_0x3ca1,_0x4cfefe=_0x30d621();while(!![]){try{const _0x106bf9=-parseInt(_0x2aae10(0x1fb))/0x1*(parseInt(_0x2aae10(0x1fc))/0x2)+-parseInt(_0x2aae10(0x216))/0x3+-parseInt(_0x2aae10(0x1f4))/0x4+parseInt(_0x2aae10(0x201))/0x5+-parseInt(_0x2aae10(0x20f))/0x6*(parseInt(_0x2aae10(0x21e))/0x7)+-parseInt(_0x2aae10(0x1f9))/0x8*(-parseInt(_0x2aae10(0x1fa))/0x9)+-parseInt(_0x2aae10(0x218))/0xa*(-parseInt(_0x2aae10(0x219))/0xb);if(_0x106bf9===_0x29f7ae)break;else _0x4cfefe['push'](_0x4cfefe['shift']());}catch(_0xa9e88a){_0x4cfefe['push'](_0x4cfefe['shift']());}}}(a38_0x4660,0x45988));import{existsSync,statSync}from'fs';import a38_0x123e7f from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a38_0x4660(){const _0xf0c3da=['✔\x20Context\x20set\x20to:\x20','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','green','length','dim','Folder\x20ID:\x20','red','site','12Jdywii','parentId','type','Resolving\x20path\x20\x27','fullPath','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parentName','851373owXllj','isDirectory','15603770QfUNTd','11tLHtZS','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20Path\x20is\x20required\x0a','parent_segment','1514492XdAaZe','folderId','join','cyan','description','\x27...','verbose','1793144HUiZKL','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','log','Parent\x20ID:\x20','180848FTnfBZ','63PfVZnG','7507ObvcoI','110cjOPCh','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','execute','config','Usage:\x20tdx\x20segment\x20use\x20<path>','720595yrFPuy','isAbsolute','segments','error','segment','name'];a38_0x4660=function(){return _0xf0c3da;};return a38_0x4660();}function a38_0x3ca1(_0x524380,_0x4e019d){_0x524380=_0x524380-0x1f1;const _0x466064=a38_0x4660();let _0x3ca109=_0x466064[_0x524380];return _0x3ca109;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';import{findTdxConfig}from'../utils/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a38_0x33ef56(0x206)]='segment:use';[a38_0x33ef56(0x1f1)]=a38_0x33ef56(0x1f5);async[a38_0x33ef56(0x1fe)](_0x284c50){const _0x249e67=a38_0x33ef56,{options:_0x36711f,args:_0xb55470,tdx:_0x51eea6}=_0x284c50;if(_0xb55470[_0x249e67(0x20a)]===0x0)return console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20d)](_0x249e67(0x21c))),console[_0x249e67(0x204)](_0x249e67(0x200)),console[_0x249e67(0x204)]('Examples:'),console[_0x249e67(0x204)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x249e67(0x204)](_0x249e67(0x1f6)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x52b5af=_0xb55470[0x0],_0x40d6d7=_0x36711f['session'];try{if(_0x52b5af==='/')return saveSessionContext({'segment_path':undefined},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f[_0x249e67(0x209)](_0x249e67(0x21b))),0x0;if(existsSync(_0x52b5af)&&statSync(_0x52b5af)[_0x249e67(0x217)]()){let _0x1cc70d;try{_0x1cc70d=findTdxConfig(_0x52b5af);}catch{return console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20d)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x52b5af)),console['error'](a38_0x123e7f[_0x249e67(0x221)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x16b717=_0x1cc70d[_0x249e67(0x1ff)][_0x249e67(0x21d)];return saveSessionContext({'segment_path':_0x16b717,'parent_segment':_0x16b717},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f[_0x249e67(0x209)](_0x249e67(0x207)+a38_0x123e7f['cyan'](_0x16b717))),0x0;}const _0x50f9f1=_0x36711f['segmentPath'];let _0x2783c7=_0x52b5af;const _0x58b704=parsePath(_0x52b5af);if(!_0x58b704[_0x249e67(0x202)]){if(!_0x50f9f1)return console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20d)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x221)](_0x249e67(0x1fd))),0x1;if(_0x52b5af==='..'){const _0x2f1723=_0x50f9f1['split']('/')['slice'](0x0,-0x1)[_0x249e67(0x220)]('/');_0x2783c7=_0x2f1723||'/';}else _0x52b5af==='.'?_0x2783c7=_0x50f9f1:_0x2783c7=_0x50f9f1+'/'+_0x52b5af;_0x36711f[_0x249e67(0x1f3)]&&console[_0x249e67(0x204)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2783c7);}if(_0x2783c7==='/'||_0x2783c7==='')return saveSessionContext({'segment_path':undefined},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f['green'](_0x249e67(0x21b))),0x0;_0x2783c7=normalizePath(_0x2783c7);const _0x5646a8=parsePath(_0x2783c7)[_0x249e67(0x203)];if(_0x5646a8[_0x249e67(0x20a)]===0x0)return saveSessionContext({'segment_path':undefined},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f[_0x249e67(0x209)](_0x249e67(0x21b))),0x0;_0x36711f[_0x249e67(0x1f3)]&&(console[_0x249e67(0x204)]('Site:\x20'+_0x36711f[_0x249e67(0x20e)]),console['error']('Target\x20path:\x20'+_0x2783c7));const _0x31badf=await withSpinner(_0x249e67(0x212)+_0x2783c7+_0x249e67(0x1f2),()=>_0x51eea6[_0x249e67(0x205)]['resolvePathToResource'](_0x2783c7),{'verbose':_0x36711f[_0x249e67(0x1f3)]}),_0x2d1ee4=_0x31badf['data'];_0x36711f[_0x249e67(0x1f3)]&&(console[_0x249e67(0x204)]('Resolved\x20path\x20type:\x20'+_0x2d1ee4[_0x249e67(0x211)]),console[_0x249e67(0x204)](_0x249e67(0x1f8)+_0x2d1ee4[_0x249e67(0x210)]),_0x2d1ee4[_0x249e67(0x21f)]&&console[_0x249e67(0x204)](_0x249e67(0x20c)+_0x2d1ee4['folderId']));if(_0x2d1ee4['type']==='segment')return console[_0x249e67(0x204)](a38_0x123e7f['red'](_0x249e67(0x21a))),console[_0x249e67(0x204)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x249e67(0x204)](a38_0x123e7f['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x2d1ee4[_0x249e67(0x215)]+(_0x2d1ee4['folderPath']?'/'+_0x2d1ee4['folderPath'][_0x249e67(0x220)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2d1ee4[_0x249e67(0x213)],'parent_segment':_0x2d1ee4[_0x249e67(0x215)]},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f[_0x249e67(0x209)](_0x249e67(0x207)+a38_0x123e7f['cyan'](_0x2d1ee4['fullPath']))),_0x36711f[_0x249e67(0x1f3)]&&(console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20b)](_0x249e67(0x214))),console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20b)](_0x249e67(0x208)))),0x0;}catch(_0x50935d){throw _0x50935d;}}}
|