@treasuredata/tdx 0.9.0 → 0.9.2
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.d.ts +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/api.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.d.ts +27 -20
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +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.js +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 a36_0x23a37f=a36_0x1d1c;(function(_0x1f1a06,_0x344b74){const _0x4094df=a36_0x1d1c,_0x321aa5=_0x1f1a06();while(!![]){try{const _0x2042e3=-parseInt(_0x4094df(0x23f))/0x1*(-parseInt(_0x4094df(0x278))/0x2)+parseInt(_0x4094df(0x1e1))/0x3+-parseInt(_0x4094df(0x208))/0x4+-parseInt(_0x4094df(0x223))/0x5*(-parseInt(_0x4094df(0x220))/0x6)+parseInt(_0x4094df(0x1c0))/0x7*(parseInt(_0x4094df(0x272))/0x8)+parseInt(_0x4094df(0x24f))/0x9+-parseInt(_0x4094df(0x23d))/0xa;if(_0x2042e3===_0x344b74)break;else _0x321aa5['push'](_0x321aa5['shift']());}catch(_0x2f1fca){_0x321aa5['push'](_0x321aa5['shift']());}}}(a36_0xa6c3,0x6b6ec));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,yamlActivationToUpdateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x4aa7d6,yamlToApi as a36_0x3c7ba,toYamlString as a36_0xdc6651,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a36_0x55958f from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x327b7c from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x54d85f from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';function a36_0xa6c3(){const _0x444640=['JOURNEY_UPDATE_ERROR','\x20\x20🗺️\x20\x20Journeys:','\x20created','\x27\x20with\x20journeyId:\x20','\x20\x20Created\x20embedded\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','journeyActivationStepId','Deleting\x20activation\x20\x27','\x20activations]','journey_entry_criteria_','entry_criteria','Creating','size','from','2474670NZiHIC','cyan','split','DecisionPoint','endsWith','existingSegment','attributes','all','/j/da/je','diff','stages','Fetching\x20parent\x20segment\x20details...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Scoped\x20to\x20folder:\x20','\x20new','activations','unchanged','updateActivation','find','get','\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20','dryRun','\x20(referenced\x20in\x20journey\x20','createFolder','/e/','\x20segment\x20from\x20file:\x20','\x27\x20from\x20file:\x20','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','slice','.yml','\x20deleted','listActivations','created','kind','stringify','\x20\x20Journeys:\x20','sort','verbose','randomUUID','1970828kBcLxT','\x20journey\x20from\x20file:\x20','buildUserMaps','\x20to\x20update','Pushing\x20journeys...','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','rule','length','absolutePath','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20Created\x20embedded\x20segment\x20\x27','parentSegment','dim','Updating\x20activation\x20\x27','New\x20segment:','\x20unchanged','\x20\x20\x20\x20','createSegment','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','journey','📁\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','parent_segment','✔\x20Created\x20journey\x20\x27','972TRqbvc','journeyBundleName','Creating\x20folder\x20\x27','11300NfTttO','relative','update','site','activationActions','listFolders','utf-8','Creating\x20segment\x20\x27','configDir','segmentId','name','parentFolder','user','\x0a✔\x20Push\x20complete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20Source:\x20','\x27\x20v','Fetching\x20existing\x20folders...','\x20\x20✔\x20Created\x20activation\x20\x27','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','connection','Delete\x20segment:','error','push','\x20updated','yes','12739000oHTaFd','\x20journey\x20\x27','1NJZcRg','.yaml','execute','data','state','isNew','filter','createActivation',')\x20with\x20journeyId:\x20','entries','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','segmentFolderId','Activation','add','ACTIVATION_SYNTAX_ERROR','item','1771866eXIfjY','steps','__pending_','yamlConfig','Delete\x20journey:','keys','delete','\x20\x20Activations:','versionNumber','Failed\x20to\x20','segment\x20or\x20journey','Fetching\x20existing\x20activations...','action','create','entryCriteria','existingActivation','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','hasChanges',')\x20with\x20ID:\x20','updateSegmentById','createJourneySegment','Fetching\x20existing\x20journeys...','\x20changed','draft','folder','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','updated','journeys','activation_','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','cwd','has','join','\x0a\x20\x20','/app/ps/','112JQTOEr','max','replace','journeyStages','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20changes?','946354GISOUC','✔\x20Created\x20folder\x20\x27','Source\x20directory:\x20','red','getJourney','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment','\x27\x20with\x20ID:\x20','yamlActivation','journeysOnly','folderPath','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20Activations:\x20','getParent','toLowerCase','blue','green','parentFolderId','\x27\x20(internal:\x20','Updating\x20segment\x20\x27','journeyId','description','parse','Fetching\x20existing\x20segments...','set','Journey\x20\x27','Push\x20','ACTIVATION_UPDATE_ERROR','\x20to\x20delete','buildIdToNameMap','Stage\x20\x27','getActivation','message','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','config','INTERNAL','activationParams','resolve','\x20\x20📊\x20Segments:','repeat','Creating\x20activation\x20\x27','\x27:\x20','relationships','isDirectory','getSegment','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','entry','\x27\x20details...','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','SEGMENT_NOT_FOUND','\x27...','resolveParentId','__pending_act_','Changes\x20to\x20journey:','map','\x20\x20Segments:\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','✔\x20Updated\x20journey\x20\x27','setPhase','segment:push','NOT_FOUND','startsWith','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','172795FcjKut','Fetching\x20journey\x20\x27','then','type','toString','Deleting\x20segment\x20\x27','folderId','✔\x20Updated\x20segment\x20\x27','branches','Entry\x20criteria:\x20','\x20activation\x20\x27','dirname','Segment\x20not\x20found:\x20','existingJourney','parentSegmentFolder','Folders\x20to\x20create:','...','yellow','\x20YAML\x20files\x20found'];a36_0xa6c3=function(){return _0x444640;};return a36_0xa6c3();}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX=a36_0x23a37f(0x251);function createPendingSegmentId(_0xa04785){return''+PENDING_SEGMENT_PREFIX+_0xa04785+'__';}function isPendingSegmentId(_0x42b554){const _0x40336b=a36_0x23a37f;return _0x42b554[_0x40336b(0x1be)](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x560c1f){return _0x560c1f['replace'](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX=a36_0x23a37f(0x1b5);function createPendingActivationId(_0x4bd6e6){return''+PENDING_ACTIVATION_PREFIX+_0x4bd6e6+'__';}function isPendingActivationId(_0x3e2dce){const _0x53c64f=a36_0x23a37f;return _0x3e2dce[_0x53c64f(0x1be)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x560228){const _0x36ff53=a36_0x23a37f;return _0x560228[_0x36ff53(0x274)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0xbb909a){const _0x32f2b1=a36_0x23a37f;!_0xbb909a[_0x32f2b1(0x28e)]&&(_0xbb909a['description']=''),!_0xbb909a['state']&&(_0xbb909a[_0x32f2b1(0x243)]=_0x32f2b1(0x266));}function tryFindTdxConfig(_0x13b08f){try{return findTdxConfig(_0x13b08f);}catch{return null;}}function resolveTDFolderPath(_0x5b6e96,_0x370dfc,_0x44516b){if(!_0x370dfc)return _0x5b6e96;return _0x5b6e96?_0x44516b+'/'+_0x5b6e96:_0x44516b;}export class SegmentPushCommand extends BaseCommand{[a36_0x23a37f(0x22d)]=a36_0x23a37f(0x1bc);[a36_0x23a37f(0x28e)]=a36_0x23a37f(0x1fc);async[a36_0x23a37f(0x241)](_0x17ecfc){const _0x4cc7ef=a36_0x23a37f,{options:_0x16b71b,args:_0x5a3a35,tdx:_0x464609}=_0x17ecfc,_0x2cc35f=_0x16b71b,_0x1464ed=_0x16b71b[_0x4cc7ef(0x213)],_0x5deae0=_0x5a3a35[0x0];let _0x27d9b8,_0xbb9df9,_0x3401f2,_0x293aae;if(_0x5deae0){if(existsSync(_0x5deae0)&&statSync(_0x5deae0)[_0x4cc7ef(0x2a4)]()){const _0x577055=tryFindTdxConfig(_0x5deae0);if(_0x577055)_0x27d9b8=_0x577055[_0x4cc7ef(0x29b)][_0x4cc7ef(0x21e)],_0xbb9df9=_0x5deae0,_0x3401f2=_0x577055[_0x4cc7ef(0x22b)];else return console[_0x4cc7ef(0x239)](a36_0x55958f['red'](_0x4cc7ef(0x284)+_0x5deae0+'\x0a')),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1e2)](_0x4cc7ef(0x27e))),0x1;}else{if(existsSync(_0x5deae0)&&statSync(_0x5deae0)['isFile']()){const _0x267aee=a36_0x327b7c[_0x4cc7ef(0x1cb)](_0x5deae0),_0x5370f2=tryFindTdxConfig(_0x267aee);if(_0x5370f2)_0x27d9b8=_0x5370f2['config'][_0x4cc7ef(0x21e)],_0x3401f2=_0x5370f2['configDir'],_0xbb9df9=_0x5370f2[_0x4cc7ef(0x22b)],_0x293aae=a36_0x327b7c[_0x4cc7ef(0x29e)](_0x5deae0);else return console['error'](a36_0x55958f[_0x4cc7ef(0x27b)](_0x4cc7ef(0x284)+_0x267aee+'\x0a')),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1e2)](_0x4cc7ef(0x27e))),0x1;}else _0x27d9b8=_0x5deae0;}}else{const _0x2427f9=tryFindTdxConfig(process[_0x4cc7ef(0x26d)]());_0x2427f9?(_0x27d9b8=_0x2427f9[_0x4cc7ef(0x29b)][_0x4cc7ef(0x21e)],_0xbb9df9=process[_0x4cc7ef(0x26d)](),_0x3401f2=_0x2427f9[_0x4cc7ef(0x22b)]):_0x27d9b8=_0x1464ed;}if(!_0x27d9b8)return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1d1)](_0x4cc7ef(0x268))),console['error']('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[_0x4cc7ef(0x239)](_0x4cc7ef(0x276)),console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file'),0x1;const _0x46bd24=_0xbb9df9||getSegmentRootDir(sanitizeFileName(_0x27d9b8)),_0x4c4025=_0x3401f2||_0x46bd24,_0x112337=a36_0x327b7c[_0x4cc7ef(0x224)](_0x4c4025,_0x46bd24),_0x4fe784=_0x112337!==''&&_0x112337!=='.';if(!existsSync(_0x46bd24))return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('Error:\x20Directory\x20not\x20found:\x20'+_0x46bd24+'\x0a')),console['error'](a36_0x55958f[_0x4cc7ef(0x1e2)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x2cc35f[_0x4cc7ef(0x206)]&&(console[_0x4cc7ef(0x239)]('Site:\x20'+_0x2cc35f['site']),console[_0x4cc7ef(0x239)]('Parent\x20segment:\x20'+_0x27d9b8),console[_0x4cc7ef(0x239)](_0x4cc7ef(0x27a)+_0x46bd24),_0x4fe784&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x1ee)+_0x112337));const _0xb4fbaa=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x27d9b8+_0x4cc7ef(0x1b3),()=>_0x464609[_0x4cc7ef(0x27f)][_0x4cc7ef(0x1b4)](_0x27d9b8),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]}),_0xf2a83c=_0xb4fbaa[_0x4cc7ef(0x242)],[_0x3fa212,_0xcb5a3d,_0x5890c6,_0x1511be,_0x5a05f0]=await Promise[_0x4cc7ef(0x1e8)]([withSpinner(_0x4cc7ef(0x1ec),()=>_0x464609['segment'][_0x4cc7ef(0x286)](_0xf2a83c),{'verbose':_0x2cc35f['verbose']}),withSpinner(_0x4cc7ef(0x290),()=>_0x464609['segment']['listSegments'](_0xf2a83c),{'verbose':_0x2cc35f['verbose']}),withSpinner(_0x4cc7ef(0x234),()=>_0x464609[_0x4cc7ef(0x27f)][_0x4cc7ef(0x228)](_0xf2a83c),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]}),withSpinner(_0x4cc7ef(0x264),()=>_0x464609[_0x4cc7ef(0x21b)]['listJourneysFromParentSegment'](_0xf2a83c),{'verbose':_0x2cc35f['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x464609[_0x4cc7ef(0x22f)][_0x4cc7ef(0x20a)](),{'verbose':_0x2cc35f['verbose']})[_0x4cc7ef(0x1c2)](_0x246261=>_0x246261[_0x4cc7ef(0x242)])]),_0xf8df0b=_0x3fa212[_0x4cc7ef(0x242)],_0x44a1b7=_0xf8df0b[_0x4cc7ef(0x2a3)]?.[_0x4cc7ef(0x1ce)]?.[_0x4cc7ef(0x242)]?.['id']||_0xf8df0b[_0x4cc7ef(0x2a3)]?.[_0x4cc7ef(0x22e)]?.['data']?.['id'],_0x40a69b=_0xcb5a3d[_0x4cc7ef(0x242)],_0x5b1ddf=_0x5890c6['data'],_0x56fb9b=_0x1511be[_0x4cc7ef(0x242)],{emailToId:_0x539eff,idToEmail:_0x5cfa1c}=_0x5a05f0,[_0x26400c,_0x1e87e0]=await withSpinner(_0x4cc7ef(0x211),async()=>{const _0x528c88=_0x4cc7ef,[_0x3b1f0f,_0x439563]=await Promise['all']([_0x464609[_0x528c88(0x237)]['buildNameToIdMap'](),_0x464609[_0x528c88(0x237)][_0x528c88(0x296)]()]);return[_0x3b1f0f,_0x439563];},{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]})[_0x4cc7ef(0x1c2)](_0x15e217=>_0x15e217[_0x4cc7ef(0x242)]),_0xa5bdaa=buildFolderPathToIdMap(_0x5b1ddf),_0x3eff8d=new Map();for(const [_0x4cd1b2,_0x3fc50a]of _0xa5bdaa[_0x4cc7ef(0x248)]()){_0x3eff8d[_0x4cc7ef(0x291)](_0x3fc50a,_0x4cd1b2);}const _0x2b55f7=new Map();for(const _0x45f802 of _0x40a69b){const _0x56c7ec=_0x45f802[_0x4cc7ef(0x24a)]?_0x3eff8d[_0x4cc7ef(0x1f4)](_0x45f802[_0x4cc7ef(0x24a)][_0x4cc7ef(0x1c4)]())||'':'',_0x46a9c9=_0x56c7ec+':'+_0x45f802['name'];_0x2b55f7[_0x4cc7ef(0x291)](_0x46a9c9,_0x45f802);}const _0x3a6dd9=new Map();for(const _0x11e544 of _0x40a69b){_0x3a6dd9[_0x4cc7ef(0x291)](_0x11e544[_0x4cc7ef(0x22d)],_0x11e544['id']);}const _0x3408da=new Map();for(const _0x1024af of _0x56fb9b){const _0x5af5f7=_0x1024af[_0x4cc7ef(0x1c6)]?_0x3eff8d[_0x4cc7ef(0x1f4)](_0x1024af[_0x4cc7ef(0x1c6)])||'':'',_0x4708b5=_0x5af5f7+':'+_0x1024af[_0x4cc7ef(0x221)];!_0x3408da[_0x4cc7ef(0x26e)](_0x4708b5)&&_0x3408da[_0x4cc7ef(0x291)](_0x4708b5,[]),_0x3408da[_0x4cc7ef(0x1f4)](_0x4708b5)[_0x4cc7ef(0x23a)](_0x1024af);}for(const _0x5931c0 of _0x3408da['values']()){_0x5931c0[_0x4cc7ef(0x205)]((_0x4c8701,_0x102925)=>(_0x4c8701[_0x4cc7ef(0x257)]||0x0)-(_0x102925['versionNumber']||0x0));}let _0x2cec18;if(_0x293aae){if(!_0x293aae[_0x4cc7ef(0x1e5)](_0x4cc7ef(0x1fe))&&!_0x293aae[_0x4cc7ef(0x1e5)](_0x4cc7ef(0x240)))return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)](_0x4cc7ef(0x231)+_0x293aae+'\x0a')),0x1;_0x2cec18=[_0x293aae];}else _0x2cec18=findYamlFiles(_0x46bd24);if(_0x2cec18[_0x4cc7ef(0x20f)]===0x0)return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x46bd24+'\x0a')),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1e2)](_0x4cc7ef(0x1bf))),0x1;const _0xf9bf17=[],_0x4bfb65=[];for(const _0x421be7 of _0x2cec18){const _0x52b655=a36_0x327b7c[_0x4cc7ef(0x224)](_0x46bd24,a36_0x327b7c[_0x4cc7ef(0x1cb)](_0x421be7)),_0x445d0f=_0x52b655==='.'?'':_0x52b655,_0x3428e8=readFileSync(_0x421be7,_0x4cc7ef(0x229));try{const _0x2a0c59=a36_0x54d85f[_0x4cc7ef(0x28f)](_0x3428e8);if(isJourneyYaml(_0x2a0c59)){const _0x3d2d7a=a36_0x4aa7d6(_0x3428e8);_0x4bfb65[_0x4cc7ef(0x23a)]({'yamlConfig':_0x3d2d7a,'folderPath':_0x445d0f,'sourcePath':_0x421be7});}else{if(!_0x2cc35f[_0x4cc7ef(0x282)]){const _0x4c26c8=parseSegmentYamlFile(_0x3428e8),_0x513bbb=normalizeChildSegmentYaml(_0x4c26c8);_0xf9bf17[_0x4cc7ef(0x23a)]({'yamlConfig':_0x513bbb,'folderPath':_0x445d0f,'sourcePath':_0x421be7});}}}catch(_0x1e7806){return console[_0x4cc7ef(0x239)](a36_0x55958f['red']('Error\x20parsing\x20'+_0x421be7+':\x20'+(_0x1e7806 instanceof Error?_0x1e7806[_0x4cc7ef(0x299)]:_0x1e7806))),0x1;}}if(_0xf9bf17[_0x4cc7ef(0x20f)]===0x0&&_0x4bfb65[_0x4cc7ef(0x20f)]===0x0){const _0x4e0354=_0x2cc35f[_0x4cc7ef(0x282)]?_0x4cc7ef(0x21b):_0x4cc7ef(0x259);return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1d1)]('No\x20'+_0x4e0354+_0x4cc7ef(0x1d2))),0x0;}const _0x4a94c1=new Map();_0x40a69b[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x282)]&&await withSpinner(_0x4cc7ef(0x25a),async()=>{await batchAsync(_0x40a69b,async _0x1966de=>{const _0x49185b=a36_0x1d1c,_0x41da04=await _0x464609['segment']['listActivations'](_0xf2a83c,_0x1966de['id']);_0x4a94c1[_0x49185b(0x291)](_0x1966de['id'],_0x41da04);});},{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]});const _0x469f95=[],_0xa9ccc7=new Set();for(const {yamlConfig:_0x93230,folderPath:_0x2d8df2,sourcePath:_0x6fc482}of _0xf9bf17){const _0xe1bd7d=resolveTDFolderPath(_0x2d8df2,_0x4fe784,_0x112337),_0x2bf690=_0xe1bd7d+':'+_0x93230[_0x4cc7ef(0x22d)],_0x44c556=_0x2b55f7[_0x4cc7ef(0x1f4)](_0x2bf690),_0x17ea6f=_0x44c556?_0x4a94c1['get'](_0x44c556['id'])||[]:[];if(_0xe1bd7d&&!_0xa5bdaa[_0x4cc7ef(0x26e)](_0xe1bd7d)){const _0x55ccd9=_0xe1bd7d[_0x4cc7ef(0x1e3)]('/');let _0x49b88e='';for(const _0x1e2fad of _0x55ccd9){_0x49b88e=_0x49b88e?_0x49b88e+'/'+_0x1e2fad:_0x1e2fad,!_0xa5bdaa[_0x4cc7ef(0x26e)](_0x49b88e)&&_0xa9ccc7[_0x4cc7ef(0x24c)](_0x49b88e);}}const _0x19a34e=calculateActivationActions(_0x93230[_0x4cc7ef(0x1f0)]||[],_0x17ea6f,_0x5cfa1c,_0x1e87e0),_0x15f992=segmentToYamlString(_0x93230);let _0x562b67,_0x2cc774=![],_0x8681ca;if(_0x44c556){const _0x7778c8=segmentWithActivationsToYaml(_0x44c556,_0x17ea6f,undefined,_0x5cfa1c,_0x1e87e0),_0x24cd82=segmentToYamlString(_0x7778c8);_0x562b67=generateDiff(_0x24cd82,_0x15f992),_0x2cc774=hasChanges(_0x562b67),_0x2cc774&&(_0x8681ca=formatDiffWithColors(_0x562b67));}else _0x562b67=generateDiff('',_0x15f992),_0x8681ca=formatDiffWithColors(_0x562b67);_0x469f95[_0x4cc7ef(0x23a)]({'relativePath':_0x93230[_0x4cc7ef(0x22d)],'absolutePath':_0x6fc482,'yamlConfig':_0x93230,'folderPath':_0xe1bd7d,'existingSegment':_0x44c556,'existingActivations':_0x17ea6f,'isNew':!_0x44c556,'hasChanges':_0x2cc774,'diff':_0x8681ca,'activationActions':_0x19a34e});}let _0x58b14b=[];if(!_0x293aae){const _0x575d3a=new Set();for(const {yamlConfig:_0x226121,folderPath:_0xe67faa}of _0xf9bf17){const _0x4d21b3=resolveTDFolderPath(_0xe67faa,_0x4fe784,_0x112337);_0x575d3a[_0x4cc7ef(0x24c)](_0x4d21b3+':'+_0x226121[_0x4cc7ef(0x22d)]);}_0x58b14b=_0x40a69b[_0x4cc7ef(0x245)](_0x188e8b=>{const _0x507241=_0x4cc7ef,_0x57c240=_0x188e8b[_0x507241(0x24a)]?_0x3eff8d[_0x507241(0x1f4)](_0x188e8b[_0x507241(0x24a)][_0x507241(0x1c4)]())||'':'',_0x22c5f8=_0x57c240+':'+_0x188e8b[_0x507241(0x22d)];if(_0x575d3a[_0x507241(0x26e)](_0x22c5f8))return![];if(_0x4fe784)return _0x57c240===_0x112337||_0x57c240[_0x507241(0x1be)](_0x112337+'/');return!![];});}const _0x53c9e6=[];for(const {yamlConfig:_0x265615,folderPath:_0x56c1f4,sourcePath:_0xc2bb0e}of _0x4bfb65){const _0x4a9acd=resolveTDFolderPath(_0x56c1f4,_0x4fe784,_0x112337),_0x4185d1=_0x4a9acd+':'+_0x265615[_0x4cc7ef(0x22d)],_0x1058c5=_0x3408da[_0x4cc7ef(0x1f4)](_0x4185d1);let _0x28868f,_0x2788ea;if(_0x1058c5&&_0x1058c5['length']>0x0){const _0x222344=new Set(),_0x35932e=new Set(),_0x5dd02e=new Map(),_0x4b44df=new Map(),_0x39f65c=createJumpTargetCache(),_0x388e60=_0x2463d6=>({'resolveSegment':async _0x1ead67=>{const _0x104593=_0x4cc7ef,_0x512532=_0x4b44df[_0x104593(0x1f4)](_0x1ead67);if(_0x512532!==undefined)return{'name':_0x512532,'isJourneyLocal':!![]};try{let _0x6ad625=_0x40a69b[_0x104593(0x1f3)](_0x1ed518=>_0x1ed518['id']===_0x1ead67);!_0x6ad625&&(_0x6ad625=await _0x464609['segment'][_0x104593(0x2a5)](_0xf2a83c,_0x1ead67));const _0x2382a2=generateJourneyLocalName(_0x6ad625[_0x104593(0x22d)]),_0x340f73=_0x6ad625[_0x104593(0x202)]===SEGMENT_KIND_JOURNEY&&_0x2382a2!==undefined;let _0x122a64=_0x6ad625['name'];if(_0x340f73&&_0x2382a2){let _0x253f3e=_0x2382a2,_0x11fca1=0x2;while(_0x222344['has'](_0x253f3e)){_0x253f3e=_0x2382a2+'_'+_0x11fca1,_0x11fca1++;}_0x222344[_0x104593(0x24c)](_0x253f3e),_0x122a64=_0x253f3e,_0x4b44df[_0x104593(0x291)](_0x1ead67,_0x122a64);}let _0x86ec41;return _0x340f73&&_0x6ad625['rule']&&(_0x86ec41={'description':_0x6ad625['description'],'rule':apiRuleToYaml(_0x6ad625[_0x104593(0x20e)])}),{'name':_0x122a64,'isJourneyLocal':_0x340f73,'definition':_0x86ec41};}catch{return{'name':_0x1ead67,'isJourneyLocal':![]};}},'resolveActivation':async _0x4e5750=>{const _0x572af5=_0x4cc7ef,_0x5c2d26=_0x5dd02e[_0x572af5(0x1f4)](_0x4e5750);if(_0x5c2d26!==undefined)return{'name':_0x5c2d26,'isJourneyLocal':!![]};try{const _0x48baac=await _0x464609[_0x572af5(0x21b)][_0x572af5(0x298)](_0x2463d6,_0x4e5750),_0x545693=_0x48baac[_0x572af5(0x1e7)][_0x572af5(0x29d)]['name']||_0x4e5750,_0x590602=sanitizeYamlKey(_0x545693)||_0x572af5(0x26b)+_0x4e5750;let _0x49adbb=_0x590602,_0x76a130=0x2;while(_0x35932e['has'](_0x49adbb)){_0x49adbb=_0x590602+'_'+_0x76a130,_0x76a130++;}_0x35932e[_0x572af5(0x24c)](_0x49adbb),_0x5dd02e[_0x572af5(0x291)](_0x4e5750,_0x49adbb);const _0x1d7043=journeyActivationStepToYaml(_0x48baac,_0x5cfa1c,_0x1e87e0);return{'name':_0x49adbb,'isJourneyLocal':!![],'definition':_0x1d7043};}catch{return{'name':_0x4e5750,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x231671,_0x3b2bcc)=>resolveJumpTarget(_0x231671,_0x3b2bcc,_0x39f65c,_0x4ebb59=>_0x464609['journey']['getJourney'](_0x4ebb59))}),_0x31195e=hasMultipleVersions(_0x265615);if(_0x31195e&&_0x1058c5[_0x4cc7ef(0x20f)]>0x1){const _0x121cf4=[];for(const _0x5c32a6 of _0x1058c5){const _0x376f36=await withSpinner('Fetching\x20journey\x20\x27'+_0x265615[_0x4cc7ef(0x22d)]+_0x4cc7ef(0x233)+(_0x5c32a6[_0x4cc7ef(0x257)]||0x1)+_0x4cc7ef(0x1d0),()=>_0x464609['journey'][_0x4cc7ef(0x27c)](_0x5c32a6['id']),{'verbose':_0x2cc35f['verbose']}),_0x2ff7b7=_0x388e60(_0x5c32a6['id']),_0x3a59cf=await apiToYamlAsync(_0x376f36[_0x4cc7ef(0x242)],_0x2ff7b7);_0x121cf4[_0x4cc7ef(0x23a)]({'item':_0x5c32a6,'yaml':_0x3a59cf});}_0x2788ea=buildMergedJourneyYaml(_0x121cf4);const _0x567a4d=Math[_0x4cc7ef(0x273)](..._0x121cf4[_0x4cc7ef(0x1b7)](_0x363012=>_0x363012[_0x4cc7ef(0x24e)][_0x4cc7ef(0x257)]||0x0)),_0x17634f=_0x1058c5[_0x4cc7ef(0x1f3)](_0x4bdbc2=>(_0x4bdbc2['versionNumber']||0x0)===_0x567a4d);_0x17634f&&(_0x28868f=await _0x464609[_0x4cc7ef(0x21b)]['getJourney'](_0x17634f['id']));}else{const _0xfc99b0=_0x1058c5[_0x1058c5['length']-0x1],_0x551a92=await withSpinner(_0x4cc7ef(0x1c1)+_0x265615[_0x4cc7ef(0x22d)]+_0x4cc7ef(0x2a8),()=>_0x464609[_0x4cc7ef(0x21b)]['getJourney'](_0xfc99b0['id']),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]});_0x28868f=_0x551a92['data'];const _0x4f4721=_0x388e60(_0xfc99b0['id']);_0x2788ea=await apiToYamlAsync(_0x28868f,_0x4f4721);}}if(_0x4a9acd&&!_0xa5bdaa[_0x4cc7ef(0x26e)](_0x4a9acd)){const _0x2383bf=_0x4a9acd['split']('/');let _0x1d3390='';for(const _0x49ba15 of _0x2383bf){_0x1d3390=_0x1d3390?_0x1d3390+'/'+_0x49ba15:_0x49ba15,!_0xa5bdaa['has'](_0x1d3390)&&_0xa9ccc7['add'](_0x1d3390);}}const _0x33d534=normalizeJourneyYaml(_0x265615),_0x5f51ec=a36_0xdc6651(_0x33d534);let _0x3e03fe=![],_0x52e7e7;if(_0x2788ea){const _0x211470=normalizeJourneyYaml(_0x2788ea),_0x53eea6=a36_0xdc6651(_0x211470),_0x514569=generateDiff(_0x53eea6,_0x5f51ec);_0x3e03fe=hasChanges(_0x514569),_0x3e03fe&&(_0x52e7e7=formatDiffWithColors(_0x514569));}else{const _0x53d360=generateDiff('',_0x5f51ec);_0x52e7e7=formatDiffWithColors(_0x53d360);}_0x53c9e6[_0x4cc7ef(0x23a)]({'relativePath':_0x265615['name'],'absolutePath':_0xc2bb0e,'yamlConfig':_0x265615,'folderPath':_0x4a9acd,'existingJourney':_0x28868f,'isNew':!_0x28868f,'hasChanges':_0x3e03fe,'diff':_0x52e7e7});}let _0x5c20c9=[];if(!_0x293aae){const _0x16b3e2=new Set();for(const {yamlConfig:_0x1118e5,folderPath:_0x380ef4}of _0x4bfb65){const _0x3e0936=resolveTDFolderPath(_0x380ef4,_0x4fe784,_0x112337);_0x16b3e2[_0x4cc7ef(0x24c)](_0x3e0936+':'+_0x1118e5['name']);}_0x5c20c9=_0x56fb9b[_0x4cc7ef(0x245)](_0x336350=>{const _0x3b78c6=_0x4cc7ef,_0x24671d=_0x336350[_0x3b78c6(0x1c6)]?_0x3eff8d['get'](_0x336350[_0x3b78c6(0x1c6)])||'':'',_0x1d737d=_0x24671d+':'+_0x336350[_0x3b78c6(0x221)];if(_0x16b3e2[_0x3b78c6(0x26e)](_0x1d737d))return![];if(_0x4fe784)return _0x24671d===_0x112337||_0x24671d[_0x3b78c6(0x1be)](_0x112337+'/');return!![];});}const _0x23e01f=_0x469f95[_0x4cc7ef(0x245)](_0x115b1a=>_0x115b1a[_0x4cc7ef(0x244)]),_0xee1891=_0x469f95['filter'](_0x3264ef=>!_0x3264ef[_0x4cc7ef(0x244)]&&_0x3264ef[_0x4cc7ef(0x260)]),_0x1b244c=_0x469f95[_0x4cc7ef(0x245)](_0x9a0cff=>!_0x9a0cff[_0x4cc7ef(0x244)]&&!_0x9a0cff[_0x4cc7ef(0x260)]),_0xad6d47=Array[_0x4cc7ef(0x1e0)](_0xa9ccc7)['sort'](),_0x40fa0c=_0x2cc35f['delete']?_0x58b14b:[],_0x48d9a3=_0x2cc35f[_0x4cc7ef(0x255)]?_0x5c20c9:[],_0xd427e6=_0x469f95['flatMap'](_0x49e7f3=>_0x49e7f3[_0x4cc7ef(0x227)]),_0x36b24c=_0xd427e6[_0x4cc7ef(0x245)](_0x5e796d=>_0x5e796d[_0x4cc7ef(0x1c3)]===_0x4cc7ef(0x25c)),_0x5e245b=_0xd427e6[_0x4cc7ef(0x245)](_0x1347c4=>_0x1347c4[_0x4cc7ef(0x1c3)]===_0x4cc7ef(0x225)),_0x58ddbd=_0xd427e6[_0x4cc7ef(0x245)](_0x339c7a=>_0x339c7a['type']===_0x4cc7ef(0x255)),_0x5581a4=_0x53c9e6[_0x4cc7ef(0x245)](_0x3bf34b=>_0x3bf34b[_0x4cc7ef(0x244)]),_0x1b33d5=_0x53c9e6[_0x4cc7ef(0x245)](_0x239fe9=>!_0x239fe9['isNew']&&_0x239fe9['hasChanges']),_0x3c1e93=_0x53c9e6[_0x4cc7ef(0x245)](_0x11ef23=>!_0x11ef23['isNew']&&!_0x11ef23[_0x4cc7ef(0x260)]);console[_0x4cc7ef(0x239)]('\x0aPush\x20summary\x20for\x20\x27'+_0x27d9b8+'\x27:');_0xad6d47['length']>0x0&&console[_0x4cc7ef(0x239)]('\x20\x20'+a36_0x55958f[_0x4cc7ef(0x288)](_0x4cc7ef(0x21c)+_0xad6d47[_0x4cc7ef(0x20f)]+'\x20folders\x20to\x20create'));if(!_0x2cc35f['journeysOnly']){console[_0x4cc7ef(0x239)](_0x4cc7ef(0x29f)),console['error'](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x289)]('+\x20'+_0x23e01f['length']+_0x4cc7ef(0x1ef))),console[_0x4cc7ef(0x239)](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x1d1)]('~\x20'+_0xee1891[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x265)));if(_0x40fa0c[_0x4cc7ef(0x20f)]>0x0)console['error'](_0x4cc7ef(0x218)+a36_0x55958f['red']('-\x20'+_0x40fa0c[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x295)));else _0x58b14b[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x255)]&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x214)](_0x58b14b[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x29a)));console['error']('\x20\x20\x20\x20'+a36_0x55958f['dim']('=\x20'+_0x1b244c[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x217)));}if(_0x53c9e6[_0x4cc7ef(0x20f)]>0x0||_0x5c20c9[_0x4cc7ef(0x20f)]>0x0){console[_0x4cc7ef(0x239)](_0x4cc7ef(0x1d4)),console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20'+a36_0x55958f[_0x4cc7ef(0x289)]('+\x20'+_0x5581a4[_0x4cc7ef(0x20f)]+'\x20new')),console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20'+a36_0x55958f[_0x4cc7ef(0x1d1)]('~\x20'+_0x1b33d5[_0x4cc7ef(0x20f)]+'\x20changed'));if(_0x48d9a3[_0x4cc7ef(0x20f)]>0x0)console[_0x4cc7ef(0x239)](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x27b)]('-\x20'+_0x48d9a3[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x295)));else _0x5c20c9[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x255)]&&console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20'+a36_0x55958f['dim'](_0x5c20c9[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x29a)));console['error'](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x214)]('=\x20'+_0x3c1e93[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x217)));}_0xd427e6[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x282)]&&(console[_0x4cc7ef(0x239)](''),console[_0x4cc7ef(0x239)](_0x4cc7ef(0x256)),_0x36b24c[_0x4cc7ef(0x20f)]>0x0&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x289)]('+\x20'+_0x36b24c['length']+'\x20to\x20create')),_0x5e245b[_0x4cc7ef(0x20f)]>0x0&&console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20'+a36_0x55958f[_0x4cc7ef(0x1d1)]('~\x20'+_0x5e245b[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x20b))),_0x58ddbd[_0x4cc7ef(0x20f)]>0x0&&console['error']('\x20\x20\x20\x20'+a36_0x55958f[_0x4cc7ef(0x27b)]('-\x20'+_0x58ddbd['length']+'\x20to\x20delete')));console[_0x4cc7ef(0x239)](_0x4cc7ef(0x232)+a36_0x55958f[_0x4cc7ef(0x1e2)](_0x46bd24)+'\x0a');if(_0xad6d47['length']>0x0){console[_0x4cc7ef(0x239)](_0x4cc7ef(0x1cf));for(const _0xd33463 of _0xad6d47){console[_0x4cc7ef(0x239)]('\x20\x20'+a36_0x55958f['blue']('+')+'\x20'+_0xd33463);}console['error']('');}if(_0x23e01f[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f['journeysOnly'])for(const _0x2dd00d of _0x23e01f){const _0xfc540f=_0x2dd00d[_0x4cc7ef(0x283)]?_0x2dd00d[_0x4cc7ef(0x283)]+'/'+_0x2dd00d[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]:_0x2dd00d[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)],_0x1825fd=_0x2dd00d[_0x4cc7ef(0x252)][_0x4cc7ef(0x1f0)]?.[_0x4cc7ef(0x20f)]||0x0,_0xa271fc=_0x1825fd>0x0?a36_0x55958f[_0x4cc7ef(0x214)]('\x20['+_0x1825fd+_0x4cc7ef(0x1db)):'';console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f[_0x4cc7ef(0x289)](_0x4cc7ef(0x216))+'\x20'+_0xfc540f+_0xa271fc),console['error']('─'[_0x4cc7ef(0x2a0)](0x3c)),_0x2dd00d[_0x4cc7ef(0x1ea)]&&console[_0x4cc7ef(0x239)](_0x2dd00d[_0x4cc7ef(0x1ea)]),console[_0x4cc7ef(0x239)]('─'[_0x4cc7ef(0x2a0)](0x3c));}if(_0x40fa0c[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f['journeysOnly'])for(const _0x928f7e of _0x40fa0c){const _0x11c02f=_0x928f7e[_0x4cc7ef(0x24a)]?_0x3eff8d[_0x4cc7ef(0x1f4)](_0x928f7e['segmentFolderId'][_0x4cc7ef(0x1c4)]())||'':'',_0x1778ac=_0x11c02f?_0x11c02f+'/'+_0x928f7e[_0x4cc7ef(0x22d)]:_0x928f7e[_0x4cc7ef(0x22d)],_0x4cf127=_0x4a94c1[_0x4cc7ef(0x1f4)](_0x928f7e['id'])||[],_0x5aea84=_0x4cf127['length']>0x0?a36_0x55958f[_0x4cc7ef(0x214)]('\x20['+_0x4cf127[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x1db)):'';console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f['red'](_0x4cc7ef(0x238))+'\x20'+_0x1778ac+_0x5aea84),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c));const _0xd937fb=segmentWithActivationsToYaml(_0x928f7e,_0x4cf127,undefined,_0x5cfa1c,_0x1e87e0),_0x2eeb78=segmentToYamlString(_0xd937fb),_0x4f08bf=generateDiff(_0x2eeb78,'');console[_0x4cc7ef(0x239)](formatDiffWithColors(_0x4f08bf)),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c));}const _0x392ce1=_0x469f95[_0x4cc7ef(0x245)](_0x2df194=>!_0x2df194[_0x4cc7ef(0x244)]&&_0x2df194[_0x4cc7ef(0x1ea)]);if(_0x392ce1[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x282)])for(const _0x1095a0 of _0x392ce1){const _0x348528=_0x1095a0[_0x4cc7ef(0x283)]?_0x1095a0[_0x4cc7ef(0x283)]+'/'+_0x1095a0[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]:_0x1095a0[_0x4cc7ef(0x252)]['name'];console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f[_0x4cc7ef(0x1d1)]('Changes\x20to:')+'\x20'+_0x348528),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c)),console[_0x4cc7ef(0x239)](_0x1095a0[_0x4cc7ef(0x1ea)]),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c));}if(_0x5581a4[_0x4cc7ef(0x20f)]>0x0)for(const _0x135ece of _0x5581a4){const _0x57d71a=_0x135ece[_0x4cc7ef(0x283)]?_0x135ece[_0x4cc7ef(0x283)]+'/'+_0x135ece[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]:_0x135ece[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)];console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f['green']('New\x20journey:')+'\x20'+_0x57d71a),console['error']('─'['repeat'](0x3c)),_0x135ece[_0x4cc7ef(0x1ea)]&&console[_0x4cc7ef(0x239)](_0x135ece[_0x4cc7ef(0x1ea)]),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c));}const _0x2dabab=_0x53c9e6[_0x4cc7ef(0x245)](_0x1a501f=>!_0x1a501f[_0x4cc7ef(0x244)]&&_0x1a501f['diff']);if(_0x2dabab['length']>0x0)for(const _0x256081 of _0x2dabab){const _0xbc418a=_0x256081[_0x4cc7ef(0x283)]?_0x256081['folderPath']+'/'+_0x256081[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]:_0x256081['yamlConfig'][_0x4cc7ef(0x22d)];console['error']('\x0a'+a36_0x55958f['yellow'](_0x4cc7ef(0x1b6))+'\x20'+_0xbc418a),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c)),console['error'](_0x256081[_0x4cc7ef(0x1ea)]),console[_0x4cc7ef(0x239)]('─'[_0x4cc7ef(0x2a0)](0x3c));}if(_0x48d9a3[_0x4cc7ef(0x20f)]>0x0)for(const _0xb58f5 of _0x48d9a3){const _0x5bfece=_0xb58f5['folderId']?_0x3eff8d[_0x4cc7ef(0x1f4)](_0xb58f5['folderId'])||'':'',_0x33f49a=_0x5bfece?_0x5bfece+'/'+_0xb58f5[_0x4cc7ef(0x221)]:_0xb58f5[_0x4cc7ef(0x221)];console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f['red'](_0x4cc7ef(0x253))+'\x20'+_0x33f49a),console[_0x4cc7ef(0x239)]('─'[_0x4cc7ef(0x2a0)](0x3c)),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x4cc7ef(0x2a0)](0x3c));}if(_0x2cc35f[_0x4cc7ef(0x1f6)])return console['error'](a36_0x55958f[_0x4cc7ef(0x1d1)](_0x4cc7ef(0x2a6))),0x0;const _0x2d4583=_0x2cc35f[_0x4cc7ef(0x282)]?![]:_0x23e01f[_0x4cc7ef(0x20f)]>0x0||_0xee1891[_0x4cc7ef(0x20f)]>0x0||_0x40fa0c[_0x4cc7ef(0x20f)]>0x0,_0x289046=_0x5581a4[_0x4cc7ef(0x20f)]>0x0||_0x1b33d5[_0x4cc7ef(0x20f)]>0x0||_0x48d9a3[_0x4cc7ef(0x20f)]>0x0,_0x45ec44=_0x2cc35f['journeysOnly']?![]:_0xd427e6[_0x4cc7ef(0x20f)]>0x0,_0x181ad6=_0xad6d47[_0x4cc7ef(0x20f)]>0x0;if(!_0x2d4583&&!_0x289046&&!_0x45ec44&&!_0x181ad6){const _0x404de5=_0x2cc35f[_0x4cc7ef(0x282)]?_0x4cc7ef(0x25f):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x289)](_0x404de5));if(_0x293aae&&_0x3c1e93[_0x4cc7ef(0x20f)]===0x1){const _0x58485d=_0x3c1e93[0x0];if(_0x58485d[_0x4cc7ef(0x1cd)]?.['id']){const _0x93dd68=getConsoleNextUrl(_0x2cc35f[_0x4cc7ef(0x226)],_0x4cc7ef(0x271)+_0xf2a83c+_0x4cc7ef(0x1f9)+_0x58485d['existingJourney']['id']+'/j/da/je');console['error']('\x20\x20'+a36_0x55958f[_0x4cc7ef(0x1e2)](_0x93dd68));}}return 0x0;}const _0x364e6e=_0x2cc35f[_0x4cc7ef(0x282)]?_0x5581a4[_0x4cc7ef(0x20f)]+_0x1b33d5['length']+_0x48d9a3[_0x4cc7ef(0x20f)]+_0xad6d47[_0x4cc7ef(0x20f)]:_0x23e01f['length']+_0xee1891[_0x4cc7ef(0x20f)]+_0x40fa0c[_0x4cc7ef(0x20f)]+_0x5581a4['length']+_0x1b33d5['length']+_0x48d9a3['length']+_0xad6d47['length']+_0xd427e6[_0x4cc7ef(0x20f)];if(!_0x2cc35f[_0x4cc7ef(0x23c)]&&_0x364e6e>0x0){const _0x26d878=await confirmKey(_0x4cc7ef(0x293)+_0x364e6e+_0x4cc7ef(0x277));if(!_0x26d878)return console['error']('Aborted.'),0x1;}for(const _0x2805b1 of _0xad6d47){const _0x14c7a4=_0x2805b1['split']('/'),_0x42518a=_0x14c7a4[_0x14c7a4[_0x4cc7ef(0x20f)]-0x1],_0x385b79=_0x14c7a4[_0x4cc7ef(0x1fd)](0x0,-0x1)[_0x4cc7ef(0x26f)]('/'),_0x4a44d7=_0xa5bdaa[_0x4cc7ef(0x1f4)](_0x385b79),_0x2cfed2={'name':_0x42518a,'parentFolderId':_0x4a44d7},_0x11065c=await withSpinner(_0x4cc7ef(0x222)+_0x2805b1+_0x4cc7ef(0x1b3),()=>_0x464609['segment'][_0x4cc7ef(0x1f8)](_0xf2a83c,_0x2cfed2),{'verbose':_0x2cc35f['verbose']});_0xa5bdaa[_0x4cc7ef(0x291)](_0x2805b1,_0x11065c['data']['id']),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x288)](_0x4cc7ef(0x279)+_0x2805b1+'\x27'));}let _0x34d0c5=0x0,_0x3f318e=0x0,_0x134af7=0x0,_0x1927a9=0x0,_0x4f9954=0x0,_0x21d8ee=0x0;const _0x1882b4=new Map();for(const _0x555f24 of _0x2cc35f[_0x4cc7ef(0x282)]?[]:_0x469f95){const _0x50a42c=_0x555f24['folderPath']?_0xa5bdaa[_0x4cc7ef(0x1f4)](_0x555f24[_0x4cc7ef(0x283)]):undefined;let _0x1bda2e;try{if(_0x555f24['isNew']){const _0x5531bc=yamlToCreateRequest(_0x555f24[_0x4cc7ef(0x252)],_0x50a42c),_0xdaf103=await withSpinner(_0x4cc7ef(0x22a)+_0x555f24['yamlConfig'][_0x4cc7ef(0x22d)]+_0x4cc7ef(0x1b3),()=>_0x464609['segment'][_0x4cc7ef(0x219)](_0xf2a83c,_0x5531bc),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]});_0x1bda2e=_0xdaf103[_0x4cc7ef(0x242)]['id'],_0x1882b4[_0x4cc7ef(0x291)](_0x555f24[_0x4cc7ef(0x252)]['name'],_0x1bda2e),console[_0x4cc7ef(0x239)](a36_0x55958f['green']('✔\x20Created\x20segment\x20\x27'+_0x555f24[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]+'\x27')),_0x34d0c5++;}else{if(_0x555f24['hasChanges']){const _0x13c2b2=yamlToUpdateRequest(_0x555f24[_0x4cc7ef(0x252)]);_0x50a42c!==_0x555f24[_0x4cc7ef(0x1e6)]?.[_0x4cc7ef(0x24a)]&&(_0x13c2b2[_0x4cc7ef(0x24a)]=_0x50a42c?parseInt(_0x50a42c,0xa):undefined),await withSpinner(_0x4cc7ef(0x28c)+_0x555f24['yamlConfig'][_0x4cc7ef(0x22d)]+'\x27...',()=>_0x464609['segment'][_0x4cc7ef(0x262)](_0xf2a83c,_0x555f24[_0x4cc7ef(0x1e6)]['id'],_0x13c2b2),{'verbose':_0x2cc35f['verbose']}),_0x1bda2e=_0x555f24[_0x4cc7ef(0x1e6)]['id'],console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1d1)](_0x4cc7ef(0x1c7)+_0x555f24[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]+'\x27')),_0x3f318e++;}else _0x1bda2e=_0x555f24[_0x4cc7ef(0x1e6)]['id'];}}catch(_0x4c0fb4){const _0x50f1d9=isHttp400Error(_0x4c0fb4),_0x149bf8=_0x50f1d9?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x4cc7ef(0x1d8)],_0x4072fa=getErrorMessage(_0x4c0fb4);throw new SDKError(_0x149bf8,_0x4cc7ef(0x258)+(_0x555f24[_0x4cc7ef(0x244)]?_0x4cc7ef(0x25c):'update')+_0x4cc7ef(0x1fa)+_0x555f24[_0x4cc7ef(0x210)]+'\x0a\x20\x20'+_0x4072fa,_0x4c0fb4);}for(const _0x255732 of _0x555f24[_0x4cc7ef(0x227)]){try{if(_0x255732[_0x4cc7ef(0x1c3)]===_0x4cc7ef(0x25c)&&_0x255732[_0x4cc7ef(0x281)]){const _0x4fdfe7=yamlActivationToCreateRequest(_0x255732['yamlActivation'],_0x539eff,_0x26400c);await withSpinner(_0x4cc7ef(0x2a1)+_0x255732[_0x4cc7ef(0x22d)]+_0x4cc7ef(0x1b3),()=>_0x464609[_0x4cc7ef(0x27f)][_0x4cc7ef(0x246)](_0xf2a83c,_0x1bda2e,_0x4fdfe7),{'verbose':_0x2cc35f['verbose']}),console['error'](a36_0x55958f[_0x4cc7ef(0x289)](_0x4cc7ef(0x235)+_0x255732[_0x4cc7ef(0x22d)]+'\x27')),_0x1927a9++;}else{if(_0x255732['type']===_0x4cc7ef(0x225)&&_0x255732[_0x4cc7ef(0x281)]&&_0x255732[_0x4cc7ef(0x25e)]){const _0x325b08=yamlActivationToUpdateRequest(_0x255732[_0x4cc7ef(0x281)],_0x539eff,_0x26400c);await withSpinner(_0x4cc7ef(0x215)+_0x255732['name']+'\x27...',()=>_0x464609[_0x4cc7ef(0x27f)][_0x4cc7ef(0x1f2)](_0xf2a83c,_0x1bda2e,_0x255732[_0x4cc7ef(0x25e)]['id'],_0x325b08),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]}),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1d1)]('\x20\x20✔\x20Updated\x20activation\x20\x27'+_0x255732[_0x4cc7ef(0x22d)]+'\x27')),_0x4f9954++;}else _0x255732[_0x4cc7ef(0x1c3)]===_0x4cc7ef(0x255)&&_0x255732[_0x4cc7ef(0x25e)]&&(await withSpinner(_0x4cc7ef(0x1da)+_0x255732['name']+_0x4cc7ef(0x1b3),()=>_0x464609[_0x4cc7ef(0x27f)]['deleteActivation'](_0xf2a83c,_0x1bda2e,_0x255732['existingActivation']['id']),{'verbose':_0x2cc35f['verbose']}),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('\x20\x20✔\x20Deleted\x20activation\x20\x27'+_0x255732[_0x4cc7ef(0x22d)]+'\x27')),_0x21d8ee++);}}catch(_0x37b99f){const _0x508477=isHttp400Error(_0x37b99f),_0xc6d638=_0x508477?ErrorCode[_0x4cc7ef(0x24d)]:ErrorCode[_0x4cc7ef(0x294)],_0x33670e=getErrorMessage(_0x37b99f);throw new SDKError(_0xc6d638,_0x4cc7ef(0x258)+_0x255732['type']+_0x4cc7ef(0x1ca)+_0x255732['name']+_0x4cc7ef(0x1fb)+_0x555f24['absolutePath']+'\x0a\x20\x20'+_0x33670e,_0x37b99f);}}}for(const _0x524f31 of _0x2cc35f[_0x4cc7ef(0x282)]?[]:_0x40fa0c){await withSpinner(_0x4cc7ef(0x1c5)+_0x524f31['name']+_0x4cc7ef(0x1b3),()=>_0x464609[_0x4cc7ef(0x27f)]['deleteSegment'](_0x524f31['id']),{'verbose':_0x2cc35f['verbose']}),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('✔\x20Deleted\x20segment\x20\x27'+_0x524f31['name']+'\x27')),_0x134af7++;}let _0x55f4f0=0x0,_0x50f087=0x0,_0x3c5eb5=0x0;const _0x4169c0=new Map(_0x3a6dd9);for(const _0x44a8b8 of _0x469f95){_0x44a8b8[_0x4cc7ef(0x244)]&&_0x1882b4[_0x4cc7ef(0x26e)](_0x44a8b8[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)])&&_0x4169c0[_0x4cc7ef(0x291)](_0x44a8b8[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)],_0x1882b4[_0x4cc7ef(0x1f4)](_0x44a8b8[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]));}if(_0x53c9e6['length']>0x0){const _0x75f1e=await withQuerySpinner(_0x4cc7ef(0x20c),async _0x210be6=>{const _0x4f86b4=_0x4cc7ef,_0x43c4dc=[];let _0x6105ce=0x0;const _0x3121d1=0x5;for(let _0x38f3af=0x0;_0x38f3af<_0x53c9e6[_0x4f86b4(0x20f)];_0x38f3af+=_0x3121d1){const _0x15d85b=_0x53c9e6[_0x4f86b4(0x1fd)](_0x38f3af,_0x38f3af+_0x3121d1),_0x2d3e29=await Promise[_0x4f86b4(0x1e8)](_0x15d85b[_0x4f86b4(0x1b7)](async _0x587dee=>{const _0x30fda7=_0x4f86b4;if(!_0x587dee['isNew']&&!_0x587dee['hasChanges'])return{'action':_0x30fda7(0x1f1),'name':_0x587dee[_0x30fda7(0x252)][_0x30fda7(0x22d)],'journeyId':_0x587dee[_0x30fda7(0x1cd)]?.['id']};const _0x3fcafc=_0x587dee[_0x30fda7(0x283)]?_0xa5bdaa['get'](_0x587dee[_0x30fda7(0x283)]):undefined,_0x2f8806=_0x587dee[_0x30fda7(0x244)]?_0x30fda7(0x1de):'Updating';_0x210be6[_0x30fda7(0x1bb)](_0x2f8806+_0x30fda7(0x23e)+_0x587dee[_0x30fda7(0x252)]['name']+'\x27');const _0x173019=new Map(),_0x1bd4c6=new Map(),_0x47524a=new Map(),_0x44dc70={'resolveSegmentId':async _0x52d85a=>{const _0xeb8ad8=_0x30fda7,_0x28554e=_0x4169c0[_0xeb8ad8(0x1f4)](_0x52d85a);if(!_0x28554e)throw new SDKError(ErrorCode[_0xeb8ad8(0x2aa)],_0xeb8ad8(0x1cc)+_0x52d85a+_0xeb8ad8(0x1f7)+_0x587dee['yamlConfig'][_0xeb8ad8(0x22d)]+')');return _0x28554e;},'resolveEmbeddedSegmentId':async(_0x3b6ffe,_0x421bb3)=>{const _0x19cff0=_0x30fda7,_0x1d4fb2=_0x4169c0[_0x19cff0(0x1f4)](_0x3b6ffe);if(_0x1d4fb2)return _0x1d4fb2;const _0x4d353b=_0x40a69b[_0x19cff0(0x1f3)](_0x36f322=>_0x36f322[_0x19cff0(0x22d)]===_0x3b6ffe);if(_0x4d353b)return _0x4169c0[_0x19cff0(0x291)](_0x3b6ffe,_0x4d353b['id']),_0x4d353b['id'];if(_0x587dee[_0x19cff0(0x244)]){const _0x7a7b8e=_0x587dee['yamlConfig'][_0x19cff0(0x1eb)]||_0x587dee['yamlConfig'][_0x19cff0(0x26a)]?.[0x0]?.[_0x19cff0(0x1eb)]||[];let _0x11cda4=_0x19cff0(0x2a7),_0x48561f=_0x3b6ffe;for(const _0x20aab5 of _0x7a7b8e){if(_0x20aab5[_0x19cff0(0x1dd)]?.['segment']===_0x3b6ffe){_0x11cda4=_0x20aab5[_0x19cff0(0x22d)],_0x48561f=_0x20aab5[_0x19cff0(0x1dd)][_0x19cff0(0x22d)]||_0x3b6ffe;break;}}return _0x1bd4c6['set'](_0x3b6ffe,{'definition':_0x421bb3,'stageName':_0x11cda4,'criteriaName':_0x48561f}),createPendingSegmentId(_0x3b6ffe);}const _0x17c038=_0x587dee[_0x19cff0(0x1cd)]?.['id'];if(!_0x17c038)throw new SDKError(ErrorCode[_0x19cff0(0x29c)],_0x19cff0(0x21d));const _0x3a1080=_0x19cff0(0x1dc)+crypto['randomUUID']();try{const _0x43e15b=await _0x464609[_0x19cff0(0x27f)][_0x19cff0(0x263)]({'name':_0x3a1080,'description':_0x421bb3[_0x19cff0(0x28e)]||_0x19cff0(0x1c9)+_0x3b6ffe,'journeyId':_0x17c038,'rule':yamlRuleToApi(_0x421bb3[_0x19cff0(0x20e)],!![]),'countPopulation':!![],'parentFolderId':_0x44a1b7||'','audienceId':_0xf2a83c});return _0x2cc35f[_0x19cff0(0x206)]&&console[_0x19cff0(0x239)]('\x20\x20Created\x20embedded\x20segment\x20\x27'+_0x3b6ffe+_0x19cff0(0x28b)+_0x3a1080+_0x19cff0(0x261)+_0x43e15b),_0x4169c0[_0x19cff0(0x291)](_0x3b6ffe,_0x43e15b),_0x43e15b;}catch(_0x16bd8d){throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x19cff0(0x249)+_0x3b6ffe+_0x19cff0(0x2a2)+getErrorMessage(_0x16bd8d),_0x16bd8d);}},'resolveActivationId':async _0x3c022d=>{const _0x1047e9=_0x30fda7,_0x50bec6=_0x173019['get'](_0x3c022d);if(_0x50bec6)return _0x50bec6;if(_0x587dee[_0x1047e9(0x1cd)]){const _0xe593d5=await _0x464609['journey'][_0x1047e9(0x200)](_0x587dee['existingJourney']['id']),_0x2cbcad=_0xe593d5['find'](_0x143afe=>_0x143afe['attributes'][_0x1047e9(0x29d)]?.['name']===_0x3c022d);if(_0x2cbcad)return _0x173019[_0x1047e9(0x291)](_0x3c022d,_0x2cbcad['id']),_0x2cbcad['id'];}throw new SDKError(ErrorCode[_0x1047e9(0x1bd)],'Activation\x20not\x20found:\x20'+_0x3c022d+_0x1047e9(0x1f7)+_0x587dee['yamlConfig'][_0x1047e9(0x22d)]+').\x20'+_0x1047e9(0x20d));},'resolveEmbeddedActivationId':async(_0x5ef008,_0x104a5d)=>{const _0x2459fd=_0x30fda7,_0x1f0409=_0x173019[_0x2459fd(0x1f4)](_0x5ef008);if(_0x1f0409)return _0x1f0409;if(_0x587dee[_0x2459fd(0x244)])return _0x47524a[_0x2459fd(0x291)](_0x5ef008,_0x104a5d),createPendingActivationId(_0x5ef008);if(_0x587dee['existingJourney']){const _0x9b6d12=await _0x464609[_0x2459fd(0x21b)][_0x2459fd(0x200)](_0x587dee[_0x2459fd(0x1cd)]['id']),_0x3e4018=_0x9b6d12['find'](_0x393fc2=>_0x393fc2[_0x2459fd(0x1e7)][_0x2459fd(0x29d)]?.[_0x2459fd(0x22d)]===_0x104a5d[_0x2459fd(0x22d)]);if(_0x3e4018)return _0x173019[_0x2459fd(0x291)](_0x5ef008,_0x3e4018['id']),_0x3e4018['id'];try{const _0xb3e09a=yamlActivationToCreateRequest(_0x104a5d,_0x539eff,_0x26400c),_0x28150c=await _0x464609[_0x2459fd(0x21b)]['createActivation'](_0x587dee['existingJourney']['id'],_0xb3e09a);return _0x2cc35f[_0x2459fd(0x206)]&&console[_0x2459fd(0x239)](_0x2459fd(0x1d7)+_0x5ef008+_0x2459fd(0x280)+_0x28150c['id']),_0x173019[_0x2459fd(0x291)](_0x5ef008,_0x28150c['id']),_0x28150c['id'];}catch(_0x42da61){throw new SDKError(ErrorCode['JOURNEY_UPDATE_ERROR'],_0x2459fd(0x26c)+_0x5ef008+_0x2459fd(0x2a2)+getErrorMessage(_0x42da61),_0x42da61);}}throw new SDKError(ErrorCode[_0x2459fd(0x29c)],_0x2459fd(0x2a9));},'resolveJourneyId':async _0x4e8491=>{const _0x59f221=_0x30fda7;try{return await _0x464609['journey']['resolveJourneyId'](_0xf2a83c,_0x4e8491);}catch(_0x33fbab){throw new SDKError(ErrorCode['NOT_FOUND'],_0x59f221(0x292)+_0x4e8491+_0x59f221(0x236)+_0x587dee[_0x59f221(0x252)][_0x59f221(0x22d)]+'\x27)',_0x33fbab);}},'resolveStageId':async(_0x210901,_0x376eaf)=>{const _0x48149c=_0x30fda7,_0x241f1e=await _0x464609[_0x48149c(0x21b)]['getJourney'](_0x210901),_0x5effc7=_0x241f1e[_0x48149c(0x1e7)][_0x48149c(0x275)]['find'](_0x400b5d=>_0x400b5d[_0x48149c(0x22d)][_0x48149c(0x287)]()===_0x376eaf[_0x48149c(0x287)]());if(!_0x5effc7?.['id'])throw new SDKError(ErrorCode[_0x48149c(0x1bd)],_0x48149c(0x297)+_0x376eaf+_0x48149c(0x1b9)+(_0x241f1e[_0x48149c(0x1e7)][_0x48149c(0x221)]||_0x241f1e[_0x48149c(0x1e7)][_0x48149c(0x22d)])+'\x27');return _0x5effc7['id'];}};try{const _0x5eeda1=await a36_0x3c7ba(_0x587dee['yamlConfig'],_0xf2a83c,_0x44dc70),_0x5134fe=_0x3fcafc||_0x44a1b7;_0x5134fe&&(_0x5eeda1[_0x30fda7(0x2a3)]={'parentFolder':{'data':{'id':_0x5134fe,'type':_0x30fda7(0x267)}}});if(_0x587dee[_0x30fda7(0x244)]){if(_0x1bd4c6[_0x30fda7(0x1df)]>0x0||_0x47524a['size']>0x0){const _0x2bec6d=JSON[_0x30fda7(0x28f)](JSON[_0x30fda7(0x203)](_0x5eeda1));ensureJourneyDefaults(_0x2bec6d[_0x30fda7(0x1e7)]);for(const _0x1ad19d of _0x2bec6d[_0x30fda7(0x1e7)][_0x30fda7(0x275)]){_0x1ad19d[_0x30fda7(0x25d)]?.[_0x30fda7(0x22c)]&&isPendingSegmentId(_0x1ad19d[_0x30fda7(0x25d)][_0x30fda7(0x22c)])&&delete _0x1ad19d[_0x30fda7(0x25d)];if(_0x1ad19d[_0x30fda7(0x250)])for(const _0x564e9d of Object[_0x30fda7(0x254)](_0x1ad19d[_0x30fda7(0x250)])){const _0x5e234b=_0x1ad19d['steps'][_0x564e9d];_0x5e234b[_0x30fda7(0x1c3)]===_0x30fda7(0x24b)&&_0x5e234b[_0x30fda7(0x1d9)]&&isPendingActivationId(_0x5e234b[_0x30fda7(0x1d9)])&&(_0x5e234b[_0x30fda7(0x1d9)]='');if(_0x5e234b[_0x30fda7(0x1c3)]===_0x30fda7(0x1e4)&&_0x5e234b[_0x30fda7(0x1c8)])for(const _0x3c0bef of _0x5e234b[_0x30fda7(0x1c8)]){_0x3c0bef[_0x30fda7(0x22c)]&&isPendingSegmentId(_0x3c0bef[_0x30fda7(0x22c)])&&(_0x3c0bef[_0x30fda7(0x22c)]='');}}}_0x2cc35f[_0x30fda7(0x206)]&&console['error'](_0x30fda7(0x27d)+JSON[_0x30fda7(0x203)](_0x2bec6d,null,0x2));const _0x417316=await _0x464609[_0x30fda7(0x21b)][_0x30fda7(0x25c)](_0x2bec6d),_0x118a97=_0x417316['id'],_0x46274f=new Map();for(const _0x1a6dcf of _0x417316[_0x30fda7(0x1e7)]['journeyStages']){_0x46274f[_0x30fda7(0x291)](_0x1a6dcf[_0x30fda7(0x22d)]['toLowerCase'](),_0x1a6dcf['id']);}const _0x397636=new Map();for(const [_0x4c1c17,{definition:_0x1abf69,criteriaName:_0x17e775}]of _0x1bd4c6){const _0x15b70a=generateJourneyLocalName(_0x17e775)||_0x30fda7(0x1dc)+crypto[_0x30fda7(0x207)]();_0x2cc35f[_0x30fda7(0x206)]&&console[_0x30fda7(0x239)]('\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27'+_0x4c1c17+_0x30fda7(0x28b)+_0x15b70a+_0x30fda7(0x247)+_0x118a97);const _0x1ff380=await _0x464609[_0x30fda7(0x27f)]['createJourneySegment']({'name':_0x15b70a,'description':_0x1abf69['description']||_0x30fda7(0x1c9)+_0x4c1c17,'journeyId':_0x118a97,'rule':yamlRuleToApi(_0x1abf69[_0x30fda7(0x20e)],!![]),'countPopulation':!![],'parentFolderId':_0x5134fe||'','audienceId':_0xf2a83c});_0x397636[_0x30fda7(0x291)](_0x4c1c17,_0x1ff380),_0x4169c0[_0x30fda7(0x291)](_0x4c1c17,_0x1ff380),_0x2cc35f[_0x30fda7(0x206)]&&console[_0x30fda7(0x239)](_0x30fda7(0x212)+_0x4c1c17+_0x30fda7(0x280)+_0x1ff380);}const _0x2c164c=new Map();for(const [_0x194df2,_0x27cf23]of _0x47524a){_0x2cc35f[_0x30fda7(0x206)]&&console[_0x30fda7(0x239)](_0x30fda7(0x21a)+_0x194df2+_0x30fda7(0x1d6)+_0x118a97);try{const _0x5782cc=yamlActivationToCreateRequest(_0x27cf23,_0x539eff,_0x26400c),_0x5094ae=await _0x464609[_0x30fda7(0x21b)][_0x30fda7(0x246)](_0x118a97,_0x5782cc);_0x2c164c[_0x30fda7(0x291)](_0x194df2,_0x5094ae['id']),_0x173019[_0x30fda7(0x291)](_0x194df2,_0x5094ae['id']),_0x2cc35f['verbose']&&console[_0x30fda7(0x239)]('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x194df2+_0x30fda7(0x280)+_0x5094ae['id']);}catch(_0x50ba2f){throw new SDKError(ErrorCode['JOURNEY_UPDATE_ERROR'],'Failed\x20to\x20create\x20embedded\x20activation\x20\x27'+_0x194df2+_0x30fda7(0x2a2)+getErrorMessage(_0x50ba2f),_0x50ba2f);}}const _0x55728f=JSON[_0x30fda7(0x28f)](JSON['stringify'](_0x5eeda1));_0x55728f['id']=_0x118a97,ensureJourneyDefaults(_0x55728f[_0x30fda7(0x1e7)]);for(const _0x3d1441 of _0x55728f['attributes'][_0x30fda7(0x275)]){const _0xa913f3=_0x46274f[_0x30fda7(0x1f4)](_0x3d1441[_0x30fda7(0x22d)]['toLowerCase']());_0xa913f3&&(_0x3d1441['id']=_0xa913f3);if(_0x3d1441[_0x30fda7(0x25d)]?.[_0x30fda7(0x22c)]&&isPendingSegmentId(_0x3d1441[_0x30fda7(0x25d)][_0x30fda7(0x22c)])){const _0x1790f9=extractPendingSegmentName(_0x3d1441[_0x30fda7(0x25d)][_0x30fda7(0x22c)]),_0x5a35f4=_0x397636[_0x30fda7(0x1f4)](_0x1790f9);_0x5a35f4&&(_0x3d1441[_0x30fda7(0x25d)][_0x30fda7(0x22c)]=_0x5a35f4);}if(_0x3d1441[_0x30fda7(0x250)]){const _0x17b7cc=_0x320607=>_0x5eeda1[_0x30fda7(0x1e7)]['journeyStages'][_0x30fda7(0x1f3)](_0x240b16=>_0x240b16[_0x30fda7(0x22d)][_0x30fda7(0x287)]()===_0x3d1441[_0x30fda7(0x22d)][_0x30fda7(0x287)]())?.[_0x30fda7(0x250)]?.[_0x320607];for(const _0xa5bfe of Object['keys'](_0x3d1441[_0x30fda7(0x250)])){const _0x1db124=_0x3d1441[_0x30fda7(0x250)][_0xa5bfe],_0x15ea66=_0x17b7cc(_0xa5bfe);if(_0x1db124['type']==='Activation'&&_0x1db124['journeyActivationStepId']&&(isPendingActivationId(_0x1db124['journeyActivationStepId'])||_0x1db124['journeyActivationStepId']==='')){if(_0x15ea66?.[_0x30fda7(0x1d9)]&&isPendingActivationId(_0x15ea66['journeyActivationStepId'])){const _0x53affa=extractPendingActivationName(_0x15ea66['journeyActivationStepId']),_0x17ca95=_0x2c164c[_0x30fda7(0x1f4)](_0x53affa);_0x17ca95&&(_0x1db124[_0x30fda7(0x1d9)]=_0x17ca95);}}if(_0x1db124['type']===_0x30fda7(0x1e4)&&_0x1db124[_0x30fda7(0x1c8)]&&_0x15ea66?.[_0x30fda7(0x1c8)])for(let _0x5e91cc=0x0;_0x5e91cc<_0x1db124['branches'][_0x30fda7(0x20f)];_0x5e91cc++){const _0x39cfb7=_0x1db124['branches'][_0x5e91cc],_0x2baf0f=_0x15ea66[_0x30fda7(0x1c8)][_0x5e91cc];if(_0x2baf0f?.['segmentId']&&isPendingSegmentId(_0x2baf0f[_0x30fda7(0x22c)])){const _0x2acabc=extractPendingSegmentName(_0x2baf0f[_0x30fda7(0x22c)]),_0x41a008=_0x397636[_0x30fda7(0x1f4)](_0x2acabc);_0x41a008&&(_0x39cfb7['segmentId']=_0x41a008);}}}}}return _0x2cc35f[_0x30fda7(0x206)]&&console['error'](_0x30fda7(0x1f5)+JSON[_0x30fda7(0x203)](_0x55728f,null,0x2)),await _0x464609[_0x30fda7(0x21b)][_0x30fda7(0x225)](_0x118a97,_0x55728f),{'action':'created','name':_0x587dee[_0x30fda7(0x252)][_0x30fda7(0x22d)],'journeyId':_0x118a97};}else{ensureJourneyDefaults(_0x5eeda1['attributes']);_0x2cc35f[_0x30fda7(0x206)]&&console['error']('\x20\x20Journey\x20API\x20request:\x20'+JSON[_0x30fda7(0x203)](_0x5eeda1,null,0x2));const _0xb8da31=await _0x464609['journey'][_0x30fda7(0x25c)](_0x5eeda1);return{'action':_0x30fda7(0x201),'name':_0x587dee[_0x30fda7(0x252)][_0x30fda7(0x22d)],'journeyId':_0xb8da31['id']};}}else{if(_0x587dee[_0x30fda7(0x260)]&&_0x587dee[_0x30fda7(0x1cd)])return ensureJourneyDefaults(_0x5eeda1[_0x30fda7(0x1e7)]),await _0x464609[_0x30fda7(0x21b)][_0x30fda7(0x225)](_0x587dee[_0x30fda7(0x1cd)]['id'],_0x5eeda1),{'action':'updated','name':_0x587dee[_0x30fda7(0x252)][_0x30fda7(0x22d)],'journeyId':_0x587dee[_0x30fda7(0x1cd)]['id']};}return{'action':_0x30fda7(0x1f1),'name':_0x587dee[_0x30fda7(0x252)]['name'],'journeyId':_0x587dee[_0x30fda7(0x1cd)]?.['id']};}catch(_0x209e46){const _0x4aae3c=isHttp400Error(_0x209e46),_0x19c167=_0x4aae3c?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x30fda7(0x1d3)],_0x10fa56=getErrorMessage(_0x209e46);throw new SDKError(_0x19c167,_0x30fda7(0x258)+(_0x587dee['isNew']?_0x30fda7(0x25c):_0x30fda7(0x225))+_0x30fda7(0x209)+_0x587dee['absolutePath']+_0x30fda7(0x270)+_0x10fa56,_0x209e46);}}));_0x43c4dc[_0x4f86b4(0x23a)](..._0x2d3e29),_0x6105ce+=_0x15d85b['length'],_0x210be6['setExtra']('('+_0x6105ce+'/'+_0x53c9e6[_0x4f86b4(0x20f)]+')');}return _0x43c4dc;},{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]});for(const _0x1c9838 of _0x75f1e['data']){if(_0x1c9838[_0x4cc7ef(0x25b)]===_0x4cc7ef(0x201))console[_0x4cc7ef(0x239)](a36_0x55958f['green'](_0x4cc7ef(0x21f)+_0x1c9838['name']+'\x27')),_0x55f4f0++;else _0x1c9838['action']===_0x4cc7ef(0x269)&&(console['error'](a36_0x55958f[_0x4cc7ef(0x1d1)](_0x4cc7ef(0x1ba)+_0x1c9838[_0x4cc7ef(0x22d)]+'\x27')),_0x50f087++);}if(_0x293aae&&_0x75f1e[_0x4cc7ef(0x242)][_0x4cc7ef(0x20f)]===0x1){const _0x280eaf=_0x75f1e[_0x4cc7ef(0x242)][0x0];if(_0x280eaf[_0x4cc7ef(0x28d)]){const _0x441b1c=getConsoleNextUrl(_0x2cc35f['site'],'/app/ps/'+_0xf2a83c+_0x4cc7ef(0x1f9)+_0x280eaf[_0x4cc7ef(0x28d)]+_0x4cc7ef(0x1e9));console[_0x4cc7ef(0x239)]('\x20\x20'+a36_0x55958f[_0x4cc7ef(0x1e2)](_0x441b1c));}}}for(const _0x5b7cc7 of _0x48d9a3){console[_0x4cc7ef(0x239)](a36_0x55958f['yellow'](_0x4cc7ef(0x1ed)+_0x5b7cc7['journeyBundleName'])),_0x3c5eb5++;}const _0x12f585=[];if(_0x34d0c5>0x0)_0x12f585['push'](_0x34d0c5+_0x4cc7ef(0x1d5));if(_0x3f318e>0x0)_0x12f585['push'](_0x3f318e+'\x20updated');if(_0x134af7>0x0)_0x12f585[_0x4cc7ef(0x23a)](_0x134af7+_0x4cc7ef(0x1ff));const _0x386db7=[];if(_0x55f4f0>0x0)_0x386db7[_0x4cc7ef(0x23a)](_0x55f4f0+_0x4cc7ef(0x1d5));if(_0x50f087>0x0)_0x386db7[_0x4cc7ef(0x23a)](_0x50f087+_0x4cc7ef(0x23b));if(_0x3c5eb5>0x0)_0x386db7['push'](_0x3c5eb5+_0x4cc7ef(0x1ff));const _0x48ba67=[];if(_0x1927a9>0x0)_0x48ba67['push'](_0x1927a9+_0x4cc7ef(0x1d5));if(_0x4f9954>0x0)_0x48ba67['push'](_0x4f9954+_0x4cc7ef(0x23b));if(_0x21d8ee>0x0)_0x48ba67[_0x4cc7ef(0x23a)](_0x21d8ee+_0x4cc7ef(0x1ff));return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x289)](_0x4cc7ef(0x230))),_0x12f585['length']>0x0&&!_0x2cc35f[_0x4cc7ef(0x282)]&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x1b8)+_0x12f585['join'](',\x20')),_0x386db7[_0x4cc7ef(0x20f)]>0x0&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x204)+_0x386db7[_0x4cc7ef(0x26f)](',\x20')),_0x48ba67[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f['journeysOnly']&&console['error'](_0x4cc7ef(0x285)+_0x48ba67[_0x4cc7ef(0x26f)](',\x20')),0x0;}}function a36_0x1d1c(_0x2bbcb1,_0x192f97){_0x2bbcb1=_0x2bbcb1-0x1b3;const _0xa6c34e=a36_0xa6c3();let _0x1d1c37=_0xa6c34e[_0x2bbcb1];return _0x1d1c37;}function buildFolderPathToIdMap(_0xddbf6d){const _0x5ba503=a36_0x23a37f,_0x4bf895=new Map(),_0x2a17a1=new Map();for(const _0x1650ec of _0xddbf6d){_0x2a17a1[_0x5ba503(0x291)](_0x1650ec['id'],_0x1650ec);}const _0x469832=new Set();for(const _0x3ebb5c of _0xddbf6d){!_0x3ebb5c['parentFolderId']&&_0x469832[_0x5ba503(0x24c)](_0x3ebb5c['id']);}function _0x2279d4(_0x2dab84){const _0x5512ef=_0x5ba503;if(_0x469832['has'](_0x2dab84['id']))return'';if(_0x2dab84[_0x5512ef(0x28a)]){const _0x30dadc=_0x2a17a1[_0x5512ef(0x1f4)](_0x2dab84['parentFolderId']);if(_0x30dadc){const _0x4e5cab=_0x2279d4(_0x30dadc);return _0x4e5cab?_0x4e5cab+'/'+_0x2dab84[_0x5512ef(0x22d)]:_0x2dab84[_0x5512ef(0x22d)];}}return _0x2dab84['name'];}for(const _0x5c6b33 of _0xddbf6d){const _0x45048a=_0x2279d4(_0x5c6b33);_0x4bf895[_0x5ba503(0x291)](_0x45048a,_0x5c6b33['id']);}return _0x4bf895;}function findYamlFiles(_0x38bec2){const _0x3d3f7f=[];function _0x4ca9f0(_0x348e8b){const _0xc7fc26=a36_0x1d1c,_0x125d2f=readdirSync(_0x348e8b,{'withFileTypes':!![]});for(const _0x472dbb of _0x125d2f){const _0x123657=a36_0x327b7c['join'](_0x348e8b,_0x472dbb[_0xc7fc26(0x22d)]);if(_0x472dbb[_0xc7fc26(0x2a4)]())_0x4ca9f0(_0x123657);else(_0x472dbb[_0xc7fc26(0x22d)][_0xc7fc26(0x1e5)](_0xc7fc26(0x1fe))||_0x472dbb[_0xc7fc26(0x22d)]['endsWith'](_0xc7fc26(0x240)))&&_0x3d3f7f[_0xc7fc26(0x23a)](_0x123657);}}return _0x4ca9f0(_0x38bec2),_0x3d3f7f;}function calculateActivationActions(_0x1b770d,_0x1f0e7a,_0x566573,_0x169cc6){const _0x4ac8ea=a36_0x23a37f,_0x16786c=[],_0x5ea53b=new Map();for(const _0x384e08 of _0x1f0e7a){_0x5ea53b[_0x4ac8ea(0x291)](_0x384e08['name'],_0x384e08);}const _0x40c572=new Map();for(const _0x18fcd7 of _0x1b770d){_0x40c572[_0x4ac8ea(0x291)](_0x18fcd7[_0x4ac8ea(0x22d)],_0x18fcd7);}for(const _0x45f8d3 of _0x1b770d){const _0x18d98e=_0x5ea53b[_0x4ac8ea(0x1f4)](_0x45f8d3[_0x4ac8ea(0x22d)]);if(!_0x18d98e)_0x16786c[_0x4ac8ea(0x23a)]({'type':_0x4ac8ea(0x25c),'name':_0x45f8d3[_0x4ac8ea(0x22d)],'yamlActivation':_0x45f8d3});else{const _0x1b32aa=activationToYaml(_0x18d98e,_0x566573,_0x169cc6),_0x427a21=a36_0x54d85f[_0x4ac8ea(0x203)](_0x1b32aa),_0xcd6e6a=a36_0x54d85f['stringify'](_0x45f8d3);_0x427a21!==_0xcd6e6a&&_0x16786c[_0x4ac8ea(0x23a)]({'type':_0x4ac8ea(0x225),'name':_0x45f8d3[_0x4ac8ea(0x22d)],'yamlActivation':_0x45f8d3,'existingActivation':_0x18d98e});}}for(const _0x3b33dd of _0x1f0e7a){!_0x40c572[_0x4ac8ea(0x26e)](_0x3b33dd[_0x4ac8ea(0x22d)])&&_0x16786c['push']({'type':_0x4ac8ea(0x255),'name':_0x3b33dd['name'],'existingActivation':_0x3b33dd});}return _0x16786c;}
|
|
1
|
+
const a36_0x59c5e1=a36_0x2d4a;(function(_0x485bd3,_0x6afa23){const _0x54ad50=a36_0x2d4a,_0x3748e3=_0x485bd3();while(!![]){try{const _0x3dea59=-parseInt(_0x54ad50(0x1f7))/0x1*(parseInt(_0x54ad50(0x1ff))/0x2)+parseInt(_0x54ad50(0x200))/0x3+-parseInt(_0x54ad50(0x1dd))/0x4*(-parseInt(_0x54ad50(0x174))/0x5)+parseInt(_0x54ad50(0x178))/0x6*(parseInt(_0x54ad50(0x221))/0x7)+parseInt(_0x54ad50(0x25c))/0x8*(parseInt(_0x54ad50(0x206))/0x9)+parseInt(_0x54ad50(0x1cc))/0xa*(parseInt(_0x54ad50(0x1ee))/0xb)+-parseInt(_0x54ad50(0x1fa))/0xc*(parseInt(_0x54ad50(0x186))/0xd);if(_0x3dea59===_0x6afa23)break;else _0x3748e3['push'](_0x3748e3['shift']());}catch(_0x2edb0a){_0x3748e3['push'](_0x3748e3['shift']());}}}(a36_0x3691,0xa97b2));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,yamlActivationToUpdateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x2e896f,yamlToApi as a36_0x18f4eb,toYamlString as a36_0x2783fc,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a36_0x54932d from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x475838 from'path';import{getConsoleNextUrl}from'../types/endpoints.js';function a36_0x2d4a(_0x33ab24,_0x201696){_0x33ab24=_0x33ab24-0x169;const _0x3691bc=a36_0x3691();let _0x2d4a1f=_0x3691bc[_0x33ab24];return _0x2d4a1f;}import*as a36_0x147f4c 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 createPendingSegmentId(_0x5e5212){return''+PENDING_SEGMENT_PREFIX+_0x5e5212+'__';}function isPendingSegmentId(_0x30872e){return _0x30872e['startsWith'](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x3d8be3){return _0x3d8be3['replace'](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX=a36_0x59c5e1(0x257);function createPendingActivationId(_0x59c9b7){return''+PENDING_ACTIVATION_PREFIX+_0x59c9b7+'__';}function isPendingActivationId(_0x6b4358){const _0x530571=a36_0x59c5e1;return _0x6b4358[_0x530571(0x19c)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x19ee40){const _0x1257d3=a36_0x59c5e1;return _0x19ee40[_0x1257d3(0x1d6)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x3b2f15){const _0x53017e=a36_0x59c5e1;!_0x3b2f15['description']&&(_0x3b2f15['description']=''),!_0x3b2f15[_0x53017e(0x1aa)]&&(_0x3b2f15[_0x53017e(0x1aa)]=_0x53017e(0x198));}function tryFindTdxConfig(_0x506458){try{return findTdxConfig(_0x506458);}catch{return null;}}function resolveTDFolderPath(_0x53f5ca,_0x597af2,_0x35abfc){if(!_0x597af2)return _0x53f5ca;return _0x53f5ca?_0x35abfc+'/'+_0x53f5ca:_0x35abfc;}function a36_0x3691(){const _0x3918b4=['toLowerCase','parse','8198508RCKOZn','name','\x20changed','existingSegment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','dirname','parent_segment','folderPath','Creating\x20folder\x20\x27','Deleting\x20segment\x20\x27','\x20journey\x20from\x20file:\x20','Updating','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Updating\x20activation\x20\x27','12116130yIajdy','Changes\x20to:','getJourney','get','buildUserMaps','Error\x20parsing\x20','resolve','\x20activation\x20\x27','Failed\x20to\x20','values','then','Parent\x20segment:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','entries','attributes','\x20created','\x20to\x20delete','all','draft','entry_criteria','deleteSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','startsWith','connection','\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20','config','Activation','repeat','push','New\x20segment:','absolutePath','SEGMENT_UPDATE_ERROR','delete','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','isFile','✔\x20Created\x20segment\x20\x27','state','\x27\x20details...','INTERNAL','listActivations','yamlActivation','join','map','versionNumber','\x20\x20✔\x20Updated\x20activation\x20\x27','(Journey\x20will\x20be\x20deleted)','length','\x20deleted','cwd','steps','\x20\x20Created\x20embedded\x20segment\x20\x27','relative','Segment\x20not\x20found:\x20','data','yes','/e/','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','existingJourney','site','\x27...','\x20\x20Activations:','ACTIVATION_SYNTAX_ERROR','blue','\x27:\x20','green','item','folderId','.yml','/j/da/je','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','180lhVFjD','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20new','Fetching\x20parent\x20segment\x20details...','configDir','diff','JOURNEY_SYNTAX_ERROR','setPhase','cyan','replace',')\x20with\x20ID:\x20','sort','Activation\x20not\x20found:\x20','\x20activations]',')\x20with\x20journeyId:\x20','Scoped\x20to\x20folder:\x20','4kIABuP','relationships','\x0aPush\x20summary\x20for\x20\x27','updated','journey','Folders\x20to\x20create:','SEGMENT_NOT_FOUND','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','activationActions','\x20\x20Journey\x20API\x20request:\x20','segment','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','listSegments','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','Creating\x20segment\x20\x27','Stage\x20\x27','609323qLSNAN','\x20unchanged','\x20\x20🗺️\x20\x20Journeys:','updateSegmentById','activations','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','DecisionPoint','✔\x20Deleted\x20segment\x20\x27','action','462594lPQzKp','parentSegment','verbose','48nhDMpd','slice','.yaml','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x27\x20v','4aiNxrC','1796772kJArmT','...','yamlConfig','existingActivation','entryCriteria','journeyBundleName','12159387ZvrihF','\x20journey\x20\x27','buildIdToNameMap','New\x20journey:','created','createJourneySegment','rule','Pushing\x20journeys...','isNew','journeysOnly','toString','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Fetching\x20existing\x20folders...','\x20segment\x20from\x20file:\x20','entry','createFolder','find','Push\x20','Fetching\x20existing\x20journeys...','listFolders','set','\x20\x20Segments:\x20','filter','keys','execute','has','error','7UFDNRv','\x27\x20with\x20ID:\x20','Source\x20directory:\x20','resolveJourneyId','red','create','setExtra','\x20\x20✔\x20Created\x20activation\x20\x27','\x20folders\x20to\x20create','ACTIVATION_UPDATE_ERROR','createActivation','isDirectory','Fetching\x20journey\x20\x27','Resolving\x20parent\x20segment\x20\x27','NOT_FOUND','Site:\x20','type','add','\x20\x20Created\x20embedded\x20activation\x20\x27',').\x20','parentFolderId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','journeyStages','\x20changes?','split','Delete\x20journey:','\x20to\x20create','branches','description','parentSegmentFolder','size','✔\x20Updated\x20journey\x20\x27','folder','\x20updated','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)','randomUUID','stringify','stages','dryRun','✔\x20Created\x20journey\x20\x27','journeyActivationStepId','update','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','SEGMENT_SYNTAX_ERROR','getActivation','\x20\x20\x20\x20','kind','journey_entry_criteria_','segmentId','📁\x20','\x0a✔\x20Push\x20complete','\x27\x20from\x20file:\x20','hasChanges','__pending_act_','Aborted.','\x27\x20not\x20found\x20in\x20journey\x20\x27','user','unchanged','8oCztjH','Entry\x20criteria:\x20','Changes\x20to\x20journey:','Fetching\x20existing\x20activations...','JOURNEY_UPDATE_ERROR','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','journeyId','\x20\x20Journeys:\x20','\x27\x20(internal:\x20','activationParams','Fetching\x20users\x20for\x20email\x20resolution...','flatMap','createSegment','dim','segmentFolderId','getParent','\x20\x20✔\x20Deleted\x20activation\x20\x27','✔\x20Created\x20folder\x20\x27','\x20YAML\x20files\x20found','5169815VllwdB','endsWith'];a36_0x3691=function(){return _0x3918b4;};return a36_0x3691();}export class SegmentPushCommand extends BaseCommand{[a36_0x59c5e1(0x179)]='segment:push';['description']=a36_0x59c5e1(0x237);async[a36_0x59c5e1(0x21e)](_0x322d10){const _0x25e0ba=a36_0x59c5e1,{options:_0x164202,args:_0x506602,tdx:_0x5793b9}=_0x322d10,_0x9a1cc5=_0x164202,_0x5092b0=_0x164202[_0x25e0ba(0x1f8)],_0x287eb2=_0x506602[0x0];let _0x1e93f0,_0x2c65d3,_0x4177a9,_0x24ed3e;if(_0x287eb2){if(existsSync(_0x287eb2)&&statSync(_0x287eb2)[_0x25e0ba(0x22c)]()){const _0x5b04e1=tryFindTdxConfig(_0x287eb2);if(_0x5b04e1)_0x1e93f0=_0x5b04e1[_0x25e0ba(0x19f)][_0x25e0ba(0x17e)],_0x2c65d3=_0x287eb2,_0x4177a9=_0x5b04e1[_0x25e0ba(0x1d1)];else return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x1fd)+_0x287eb2+'\x0a')),console[_0x25e0ba(0x220)](a36_0x54932d['cyan'](_0x25e0ba(0x236))),0x1;}else{if(existsSync(_0x287eb2)&&statSync(_0x287eb2)[_0x25e0ba(0x1a8)]()){const _0x2719cd=a36_0x475838['dirname'](_0x287eb2),_0xdccf5e=tryFindTdxConfig(_0x2719cd);if(_0xdccf5e)_0x1e93f0=_0xdccf5e[_0x25e0ba(0x19f)][_0x25e0ba(0x17e)],_0x4177a9=_0xdccf5e[_0x25e0ba(0x1d1)],_0x2c65d3=_0xdccf5e[_0x25e0ba(0x1d1)],_0x24ed3e=a36_0x475838[_0x25e0ba(0x18c)](_0x287eb2);else return console['error'](a36_0x54932d['red'](_0x25e0ba(0x1fd)+_0x2719cd+'\x0a')),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1d5)](_0x25e0ba(0x236))),0x1;}else _0x1e93f0=_0x287eb2;}}else{const _0x48fcaa=tryFindTdxConfig(process[_0x25e0ba(0x1b6)]());_0x48fcaa?(_0x1e93f0=_0x48fcaa['config']['parent_segment'],_0x2c65d3=process['cwd'](),_0x4177a9=_0x48fcaa[_0x25e0ba(0x1d1)]):_0x1e93f0=_0x5092b0;}if(!_0x1e93f0)return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)](_0x25e0ba(0x17c))),console[_0x25e0ba(0x220)](_0x25e0ba(0x244)),console[_0x25e0ba(0x220)](_0x25e0ba(0x1ce)),console[_0x25e0ba(0x220)](_0x25e0ba(0x184)),0x1;const _0x59c816=_0x2c65d3||getSegmentRootDir(sanitizeFileName(_0x1e93f0)),_0x4fcb86=_0x4177a9||_0x59c816,_0x1bda42=a36_0x475838['relative'](_0x4fcb86,_0x59c816),_0xab46ba=_0x1bda42!==''&&_0x1bda42!=='.';if(!existsSync(_0x59c816))return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)]('Error:\x20Directory\x20not\x20found:\x20'+_0x59c816+'\x0a')),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1d5)](_0x25e0ba(0x236))),0x1;_0x9a1cc5['verbose']&&(console[_0x25e0ba(0x220)](_0x25e0ba(0x230)+_0x9a1cc5[_0x25e0ba(0x1c0)]),console[_0x25e0ba(0x220)](_0x25e0ba(0x191)+_0x1e93f0),console[_0x25e0ba(0x220)](_0x25e0ba(0x223)+_0x59c816),_0xab46ba&&console[_0x25e0ba(0x220)](_0x25e0ba(0x1dc)+_0x1bda42));const _0x598751=await withSpinner(_0x25e0ba(0x22e)+_0x1e93f0+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)]['resolveParentId'](_0x1e93f0),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),_0x2d104e=_0x598751[_0x25e0ba(0x1bb)],[_0x2a80fa,_0x2c4945,_0x41105e,_0x282fd3,_0x1b40b1]=await Promise['all']([withSpinner(_0x25e0ba(0x1d0),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x170)](_0x2d104e),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x1e9)](_0x2d104e),{'verbose':_0x9a1cc5['verbose']}),withSpinner(_0x25e0ba(0x212),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x219)](_0x2d104e),{'verbose':_0x9a1cc5['verbose']}),withSpinner(_0x25e0ba(0x218),()=>_0x5793b9[_0x25e0ba(0x1e1)]['listJourneysFromParentSegment'](_0x2d104e),{'verbose':_0x9a1cc5['verbose']}),withSpinner(_0x25e0ba(0x16b),()=>_0x5793b9[_0x25e0ba(0x25a)][_0x25e0ba(0x18a)](),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]})[_0x25e0ba(0x190)](_0x171c0d=>_0x171c0d[_0x25e0ba(0x1bb)])]),_0x24c2fd=_0x2a80fa[_0x25e0ba(0x1bb)],_0x17d9ba=_0x24c2fd[_0x25e0ba(0x1de)]?.[_0x25e0ba(0x23f)]?.[_0x25e0ba(0x1bb)]?.['id']||_0x24c2fd[_0x25e0ba(0x1de)]?.['parentFolder']?.[_0x25e0ba(0x1bb)]?.['id'],_0xfee852=_0x2c4945[_0x25e0ba(0x1bb)],_0x3df1cf=_0x41105e[_0x25e0ba(0x1bb)],_0x5e662c=_0x282fd3[_0x25e0ba(0x1bb)],{emailToId:_0x1516f5,idToEmail:_0x464344}=_0x1b40b1,[_0x5b7934,_0x502bc7]=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x16fe6a=_0x25e0ba,[_0x3267ae,_0x56938c]=await Promise[_0x16fe6a(0x197)]([_0x5793b9[_0x16fe6a(0x19d)]['buildNameToIdMap'](),_0x5793b9[_0x16fe6a(0x19d)][_0x16fe6a(0x208)]()]);return[_0x3267ae,_0x56938c];},{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]})[_0x25e0ba(0x190)](_0x2cbe5e=>_0x2cbe5e['data']),_0x2ac595=buildFolderPathToIdMap(_0x3df1cf),_0x22d65e=new Map();for(const [_0xaad2c1,_0x121047]of _0x2ac595[_0x25e0ba(0x193)]()){_0x22d65e[_0x25e0ba(0x21a)](_0x121047,_0xaad2c1);}const _0x4e2e0d=new Map();for(const _0x583b74 of _0xfee852){const _0x451a57=_0x583b74[_0x25e0ba(0x16f)]?_0x22d65e['get'](_0x583b74[_0x25e0ba(0x16f)]['toString']())||'':'',_0x1c70b8=_0x451a57+':'+_0x583b74[_0x25e0ba(0x179)];_0x4e2e0d[_0x25e0ba(0x21a)](_0x1c70b8,_0x583b74);}const _0x10252d=new Map();for(const _0x5e0d40 of _0xfee852){_0x10252d['set'](_0x5e0d40[_0x25e0ba(0x179)],_0x5e0d40['id']);}const _0x2ae488=new Map();for(const _0x4c44e6 of _0x5e662c){const _0x398286=_0x4c44e6['folderId']?_0x22d65e[_0x25e0ba(0x189)](_0x4c44e6[_0x25e0ba(0x1c8)])||'':'',_0x11a443=_0x398286+':'+_0x4c44e6[_0x25e0ba(0x205)];!_0x2ae488[_0x25e0ba(0x21f)](_0x11a443)&&_0x2ae488[_0x25e0ba(0x21a)](_0x11a443,[]),_0x2ae488[_0x25e0ba(0x189)](_0x11a443)[_0x25e0ba(0x1a2)](_0x4c44e6);}for(const _0xc28d99 of _0x2ae488[_0x25e0ba(0x18f)]()){_0xc28d99[_0x25e0ba(0x1d8)]((_0x180c67,_0x239b01)=>(_0x180c67[_0x25e0ba(0x1b1)]||0x0)-(_0x239b01[_0x25e0ba(0x1b1)]||0x0));}let _0x4a9f97;if(_0x24ed3e){if(!_0x24ed3e[_0x25e0ba(0x175)](_0x25e0ba(0x1c9))&&!_0x24ed3e[_0x25e0ba(0x175)](_0x25e0ba(0x1fc)))return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x24c)+_0x24ed3e+'\x0a')),0x1;_0x4a9f97=[_0x24ed3e];}else _0x4a9f97=findYamlFiles(_0x59c816);if(_0x4a9f97[_0x25e0ba(0x1b4)]===0x0)return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x19b)+_0x59c816+'\x0a')),console['error'](a36_0x54932d[_0x25e0ba(0x1d5)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;const _0x100cfe=[],_0x135150=[];for(const _0x235229 of _0x4a9f97){const _0x20a6f9=a36_0x475838[_0x25e0ba(0x1b9)](_0x59c816,a36_0x475838[_0x25e0ba(0x17d)](_0x235229)),_0x548494=_0x20a6f9==='.'?'':_0x20a6f9,_0x3be0e3=readFileSync(_0x235229,'utf-8');try{const _0x59557c=a36_0x147f4c[_0x25e0ba(0x177)](_0x3be0e3);if(isJourneyYaml(_0x59557c)){const _0x41c08d=a36_0x2e896f(_0x3be0e3);_0x135150['push']({'yamlConfig':_0x41c08d,'folderPath':_0x548494,'sourcePath':_0x235229});}else{if(!_0x9a1cc5[_0x25e0ba(0x20f)]){const _0x5b5100=parseSegmentYamlFile(_0x3be0e3),_0x3adba9=normalizeChildSegmentYaml(_0x5b5100);_0x100cfe[_0x25e0ba(0x1a2)]({'yamlConfig':_0x3adba9,'folderPath':_0x548494,'sourcePath':_0x235229});}}}catch(_0x53bad7){return console[_0x25e0ba(0x220)](a36_0x54932d['red'](_0x25e0ba(0x18b)+_0x235229+':\x20'+(_0x53bad7 instanceof Error?_0x53bad7['message']:_0x53bad7))),0x1;}}if(_0x100cfe[_0x25e0ba(0x1b4)]===0x0&&_0x135150['length']===0x0){const _0x84df66=_0x9a1cc5[_0x25e0ba(0x20f)]?_0x25e0ba(0x1e1):'segment\x20or\x20journey';return console['error'](a36_0x54932d[_0x25e0ba(0x1cd)]('No\x20'+_0x84df66+_0x25e0ba(0x173))),0x0;}const _0x37b05f=new Map();_0xfee852[_0x25e0ba(0x1b4)]>0x0&&!_0x9a1cc5['journeysOnly']&&await withSpinner(_0x25e0ba(0x25f),async()=>{await batchAsync(_0xfee852,async _0x236395=>{const _0x205fbf=a36_0x2d4a,_0x57764f=await _0x5793b9['segment'][_0x205fbf(0x1ad)](_0x2d104e,_0x236395['id']);_0x37b05f['set'](_0x236395['id'],_0x57764f);});},{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]});const _0x91fd22=[],_0x3c7242=new Set();for(const {yamlConfig:_0x569e66,folderPath:_0x4408a0,sourcePath:_0x26638b}of _0x100cfe){const _0x10865e=resolveTDFolderPath(_0x4408a0,_0xab46ba,_0x1bda42),_0x161ef3=_0x10865e+':'+_0x569e66['name'],_0x22bed5=_0x4e2e0d[_0x25e0ba(0x189)](_0x161ef3),_0x46b872=_0x22bed5?_0x37b05f[_0x25e0ba(0x189)](_0x22bed5['id'])||[]:[];if(_0x10865e&&!_0x2ac595[_0x25e0ba(0x21f)](_0x10865e)){const _0x349f07=_0x10865e['split']('/');let _0x46f54f='';for(const _0x680b16 of _0x349f07){_0x46f54f=_0x46f54f?_0x46f54f+'/'+_0x680b16:_0x680b16,!_0x2ac595[_0x25e0ba(0x21f)](_0x46f54f)&&_0x3c7242[_0x25e0ba(0x232)](_0x46f54f);}}const _0x32875b=calculateActivationActions(_0x569e66['activations']||[],_0x46b872,_0x464344,_0x502bc7),_0x54fd56=segmentToYamlString(_0x569e66);let _0x494a18,_0x1d7af3=![],_0x3ab3ff;if(_0x22bed5){const _0x1bb1f7=segmentWithActivationsToYaml(_0x22bed5,_0x46b872,undefined,_0x464344,_0x502bc7),_0x3ec935=segmentToYamlString(_0x1bb1f7);_0x494a18=generateDiff(_0x3ec935,_0x54fd56),_0x1d7af3=hasChanges(_0x494a18),_0x1d7af3&&(_0x3ab3ff=formatDiffWithColors(_0x494a18));}else _0x494a18=generateDiff('',_0x54fd56),_0x3ab3ff=formatDiffWithColors(_0x494a18);_0x91fd22[_0x25e0ba(0x1a2)]({'relativePath':_0x569e66[_0x25e0ba(0x179)],'absolutePath':_0x26638b,'yamlConfig':_0x569e66,'folderPath':_0x10865e,'existingSegment':_0x22bed5,'existingActivations':_0x46b872,'isNew':!_0x22bed5,'hasChanges':_0x1d7af3,'diff':_0x3ab3ff,'activationActions':_0x32875b});}let _0x53a076=[];if(!_0x24ed3e){const _0x1a258f=new Set();for(const {yamlConfig:_0x2eb490,folderPath:_0x3d28bf}of _0x100cfe){const _0x4e660e=resolveTDFolderPath(_0x3d28bf,_0xab46ba,_0x1bda42);_0x1a258f[_0x25e0ba(0x232)](_0x4e660e+':'+_0x2eb490['name']);}_0x53a076=_0xfee852[_0x25e0ba(0x21c)](_0x577361=>{const _0x309c7b=_0x25e0ba,_0x1dcfbb=_0x577361[_0x309c7b(0x16f)]?_0x22d65e[_0x309c7b(0x189)](_0x577361[_0x309c7b(0x16f)]['toString']())||'':'',_0x21e981=_0x1dcfbb+':'+_0x577361[_0x309c7b(0x179)];if(_0x1a258f[_0x309c7b(0x21f)](_0x21e981))return![];if(_0xab46ba)return _0x1dcfbb===_0x1bda42||_0x1dcfbb[_0x309c7b(0x19c)](_0x1bda42+'/');return!![];});}const _0x4ecc55=[];for(const {yamlConfig:_0x35f5b8,folderPath:_0xbd7dc7,sourcePath:_0x1c6f5a}of _0x135150){const _0x1b0a45=resolveTDFolderPath(_0xbd7dc7,_0xab46ba,_0x1bda42),_0x1424c9=_0x1b0a45+':'+_0x35f5b8['name'],_0x1f4683=_0x2ae488[_0x25e0ba(0x189)](_0x1424c9);let _0x202410,_0x1d243c;if(_0x1f4683&&_0x1f4683[_0x25e0ba(0x1b4)]>0x0){const _0x168bd7=new Set(),_0x3e5fb6=new Set(),_0x2adf8a=new Map(),_0xc7e0f=new Map(),_0x15e76d=createJumpTargetCache(),_0x171688=_0x111f18=>({'resolveSegment':async _0xc10e90=>{const _0x305baf=_0x25e0ba,_0x419247=_0xc7e0f[_0x305baf(0x189)](_0xc10e90);if(_0x419247!==undefined)return{'name':_0x419247,'isJourneyLocal':!![]};try{let _0x1f5b7f=_0xfee852['find'](_0x47ccde=>_0x47ccde['id']===_0xc10e90);!_0x1f5b7f&&(_0x1f5b7f=await _0x5793b9[_0x305baf(0x1e7)]['getSegment'](_0x2d104e,_0xc10e90));const _0x23e7ad=generateJourneyLocalName(_0x1f5b7f[_0x305baf(0x179)]),_0x2ddcb9=_0x1f5b7f[_0x305baf(0x250)]===SEGMENT_KIND_JOURNEY&&_0x23e7ad!==undefined;let _0x4bc387=_0x1f5b7f[_0x305baf(0x179)];if(_0x2ddcb9&&_0x23e7ad){let _0x2b7759=_0x23e7ad,_0x2a5e97=0x2;while(_0x168bd7[_0x305baf(0x21f)](_0x2b7759)){_0x2b7759=_0x23e7ad+'_'+_0x2a5e97,_0x2a5e97++;}_0x168bd7[_0x305baf(0x232)](_0x2b7759),_0x4bc387=_0x2b7759,_0xc7e0f[_0x305baf(0x21a)](_0xc10e90,_0x4bc387);}let _0x4b7771;return _0x2ddcb9&&_0x1f5b7f[_0x305baf(0x20c)]&&(_0x4b7771={'description':_0x1f5b7f[_0x305baf(0x23e)],'rule':apiRuleToYaml(_0x1f5b7f[_0x305baf(0x20c)])}),{'name':_0x4bc387,'isJourneyLocal':_0x2ddcb9,'definition':_0x4b7771};}catch{return{'name':_0xc10e90,'isJourneyLocal':![]};}},'resolveActivation':async _0x2f24d7=>{const _0x8d0ffc=_0x25e0ba,_0x33982b=_0x2adf8a[_0x8d0ffc(0x189)](_0x2f24d7);if(_0x33982b!==undefined)return{'name':_0x33982b,'isJourneyLocal':!![]};try{const _0x419314=await _0x5793b9[_0x8d0ffc(0x1e1)][_0x8d0ffc(0x24e)](_0x111f18,_0x2f24d7),_0x3b007e=_0x419314['attributes'][_0x8d0ffc(0x16a)][_0x8d0ffc(0x179)]||_0x2f24d7,_0x2ac228=sanitizeYamlKey(_0x3b007e)||'activation_'+_0x2f24d7;let _0x4df006=_0x2ac228,_0x5418d0=0x2;while(_0x3e5fb6[_0x8d0ffc(0x21f)](_0x4df006)){_0x4df006=_0x2ac228+'_'+_0x5418d0,_0x5418d0++;}_0x3e5fb6[_0x8d0ffc(0x232)](_0x4df006),_0x2adf8a[_0x8d0ffc(0x21a)](_0x2f24d7,_0x4df006);const _0x2e4540=journeyActivationStepToYaml(_0x419314,_0x464344,_0x502bc7);return{'name':_0x4df006,'isJourneyLocal':!![],'definition':_0x2e4540};}catch{return{'name':_0x2f24d7,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x106561,_0x5c761d)=>resolveJumpTarget(_0x106561,_0x5c761d,_0x15e76d,_0x3ed9b0=>_0x5793b9[_0x25e0ba(0x1e1)]['getJourney'](_0x3ed9b0))}),_0x1a0560=hasMultipleVersions(_0x35f5b8);if(_0x1a0560&&_0x1f4683[_0x25e0ba(0x1b4)]>0x1){const _0x30930b=[];for(const _0x20ccaa of _0x1f4683){const _0x471142=await withSpinner(_0x25e0ba(0x22d)+_0x35f5b8['name']+_0x25e0ba(0x1fe)+(_0x20ccaa[_0x25e0ba(0x1b1)]||0x1)+_0x25e0ba(0x201),()=>_0x5793b9[_0x25e0ba(0x1e1)][_0x25e0ba(0x188)](_0x20ccaa['id']),{'verbose':_0x9a1cc5['verbose']}),_0x45881d=_0x171688(_0x20ccaa['id']),_0x473a02=await apiToYamlAsync(_0x471142[_0x25e0ba(0x1bb)],_0x45881d);_0x30930b['push']({'item':_0x20ccaa,'yaml':_0x473a02});}_0x1d243c=buildMergedJourneyYaml(_0x30930b);const _0x2f4bb2=Math['max'](..._0x30930b['map'](_0x3dd47d=>_0x3dd47d[_0x25e0ba(0x1c7)]['versionNumber']||0x0)),_0x36b179=_0x1f4683['find'](_0x42aa0c=>(_0x42aa0c[_0x25e0ba(0x1b1)]||0x0)===_0x2f4bb2);_0x36b179&&(_0x202410=await _0x5793b9[_0x25e0ba(0x1e1)][_0x25e0ba(0x188)](_0x36b179['id']));}else{const _0x2f16a1=_0x1f4683[_0x1f4683[_0x25e0ba(0x1b4)]-0x1],_0x12178e=await withSpinner('Fetching\x20journey\x20\x27'+_0x35f5b8['name']+_0x25e0ba(0x1ab),()=>_0x5793b9[_0x25e0ba(0x1e1)][_0x25e0ba(0x188)](_0x2f16a1['id']),{'verbose':_0x9a1cc5['verbose']});_0x202410=_0x12178e[_0x25e0ba(0x1bb)];const _0x335a8c=_0x171688(_0x2f16a1['id']);_0x1d243c=await apiToYamlAsync(_0x202410,_0x335a8c);}}if(_0x1b0a45&&!_0x2ac595[_0x25e0ba(0x21f)](_0x1b0a45)){const _0x5a58d2=_0x1b0a45[_0x25e0ba(0x23a)]('/');let _0x1f8a25='';for(const _0x92e134 of _0x5a58d2){_0x1f8a25=_0x1f8a25?_0x1f8a25+'/'+_0x92e134:_0x92e134,!_0x2ac595[_0x25e0ba(0x21f)](_0x1f8a25)&&_0x3c7242['add'](_0x1f8a25);}}const _0x3fe45a=normalizeJourneyYaml(_0x35f5b8),_0x496921=a36_0x2783fc(_0x3fe45a);let _0x34eb96=![],_0x3aecc8;if(_0x1d243c){const _0x256887=normalizeJourneyYaml(_0x1d243c),_0x475e80=a36_0x2783fc(_0x256887),_0x363ec1=generateDiff(_0x475e80,_0x496921);_0x34eb96=hasChanges(_0x363ec1),_0x34eb96&&(_0x3aecc8=formatDiffWithColors(_0x363ec1));}else{const _0x95c39e=generateDiff('',_0x496921);_0x3aecc8=formatDiffWithColors(_0x95c39e);}_0x4ecc55[_0x25e0ba(0x1a2)]({'relativePath':_0x35f5b8[_0x25e0ba(0x179)],'absolutePath':_0x1c6f5a,'yamlConfig':_0x35f5b8,'folderPath':_0x1b0a45,'existingJourney':_0x202410,'isNew':!_0x202410,'hasChanges':_0x34eb96,'diff':_0x3aecc8});}let _0x57fe6d=[];if(!_0x24ed3e){const _0x588e24=new Set();for(const {yamlConfig:_0x4f91fa,folderPath:_0x19ff17}of _0x135150){const _0x115948=resolveTDFolderPath(_0x19ff17,_0xab46ba,_0x1bda42);_0x588e24[_0x25e0ba(0x232)](_0x115948+':'+_0x4f91fa[_0x25e0ba(0x179)]);}_0x57fe6d=_0x5e662c['filter'](_0x44ab91=>{const _0x2fb96c=_0x25e0ba,_0x21d6ef=_0x44ab91[_0x2fb96c(0x1c8)]?_0x22d65e[_0x2fb96c(0x189)](_0x44ab91[_0x2fb96c(0x1c8)])||'':'',_0x382506=_0x21d6ef+':'+_0x44ab91['journeyBundleName'];if(_0x588e24[_0x2fb96c(0x21f)](_0x382506))return![];if(_0xab46ba)return _0x21d6ef===_0x1bda42||_0x21d6ef[_0x2fb96c(0x19c)](_0x1bda42+'/');return!![];});}const _0x108c12=_0x91fd22[_0x25e0ba(0x21c)](_0x3ba927=>_0x3ba927[_0x25e0ba(0x20e)]),_0x8331ab=_0x91fd22[_0x25e0ba(0x21c)](_0x498e61=>!_0x498e61[_0x25e0ba(0x20e)]&&_0x498e61[_0x25e0ba(0x256)]),_0x20207f=_0x91fd22['filter'](_0x98a95b=>!_0x98a95b['isNew']&&!_0x98a95b[_0x25e0ba(0x256)]),_0x3408d0=Array['from'](_0x3c7242)['sort'](),_0x304ea1=_0x9a1cc5['delete']?_0x53a076:[],_0x3e0feb=_0x9a1cc5[_0x25e0ba(0x1a6)]?_0x57fe6d:[],_0x1e2c1e=_0x91fd22[_0x25e0ba(0x16c)](_0x392df4=>_0x392df4[_0x25e0ba(0x1e5)]),_0x527a4e=_0x1e2c1e[_0x25e0ba(0x21c)](_0x12a771=>_0x12a771[_0x25e0ba(0x231)]==='create'),_0x384eb8=_0x1e2c1e['filter'](_0x3d1997=>_0x3d1997['type']===_0x25e0ba(0x24b)),_0x4e02d2=_0x1e2c1e[_0x25e0ba(0x21c)](_0x438fcc=>_0x438fcc[_0x25e0ba(0x231)]===_0x25e0ba(0x1a6)),_0x479e32=_0x4ecc55[_0x25e0ba(0x21c)](_0x2424c3=>_0x2424c3[_0x25e0ba(0x20e)]),_0x2ec4a2=_0x4ecc55[_0x25e0ba(0x21c)](_0x5ae894=>!_0x5ae894['isNew']&&_0x5ae894[_0x25e0ba(0x256)]),_0x13b708=_0x4ecc55[_0x25e0ba(0x21c)](_0x36d299=>!_0x36d299[_0x25e0ba(0x20e)]&&!_0x36d299[_0x25e0ba(0x256)]);console[_0x25e0ba(0x220)](_0x25e0ba(0x1df)+_0x1e93f0+'\x27:');_0x3408d0[_0x25e0ba(0x1b4)]>0x0&&console[_0x25e0ba(0x220)]('\x20\x20'+a36_0x54932d[_0x25e0ba(0x1c4)](_0x25e0ba(0x253)+_0x3408d0[_0x25e0ba(0x1b4)]+_0x25e0ba(0x229)));if(!_0x9a1cc5[_0x25e0ba(0x20f)]){console[_0x25e0ba(0x220)]('\x20\x20📊\x20Segments:'),console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x1c6)]('+\x20'+_0x108c12[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1cf))),console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d['yellow']('~\x20'+_0x8331ab[_0x25e0ba(0x1b4)]+_0x25e0ba(0x17a)));if(_0x304ea1['length']>0x0)console['error']('\x20\x20\x20\x20'+a36_0x54932d[_0x25e0ba(0x225)]('-\x20'+_0x304ea1[_0x25e0ba(0x1b4)]+_0x25e0ba(0x196)));else _0x53a076[_0x25e0ba(0x1b4)]>0x0&&!_0x9a1cc5[_0x25e0ba(0x1a6)]&&console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x16e)](_0x53a076[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1f3)));console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x16e)]('=\x20'+_0x20207f[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1ef)));}if(_0x4ecc55['length']>0x0||_0x57fe6d[_0x25e0ba(0x1b4)]>0x0){console[_0x25e0ba(0x220)](_0x25e0ba(0x1f0)),console['error']('\x20\x20\x20\x20'+a36_0x54932d[_0x25e0ba(0x1c6)]('+\x20'+_0x479e32[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1cf))),console[_0x25e0ba(0x220)]('\x20\x20\x20\x20'+a36_0x54932d[_0x25e0ba(0x1cd)]('~\x20'+_0x2ec4a2[_0x25e0ba(0x1b4)]+_0x25e0ba(0x17a)));if(_0x3e0feb[_0x25e0ba(0x1b4)]>0x0)console['error'](_0x25e0ba(0x24f)+a36_0x54932d['red']('-\x20'+_0x3e0feb[_0x25e0ba(0x1b4)]+_0x25e0ba(0x196)));else _0x57fe6d[_0x25e0ba(0x1b4)]>0x0&&!_0x9a1cc5[_0x25e0ba(0x1a6)]&&console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x16e)](_0x57fe6d[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1f3)));console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x16e)]('=\x20'+_0x13b708['length']+_0x25e0ba(0x1ef)));}_0x1e2c1e['length']>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)]&&(console[_0x25e0ba(0x220)](''),console[_0x25e0ba(0x220)](_0x25e0ba(0x1c2)),_0x527a4e['length']>0x0&&console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d['green']('+\x20'+_0x527a4e['length']+_0x25e0ba(0x23c))),_0x384eb8[_0x25e0ba(0x1b4)]>0x0&&console['error'](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x1cd)]('~\x20'+_0x384eb8[_0x25e0ba(0x1b4)]+'\x20to\x20update')),_0x4e02d2[_0x25e0ba(0x1b4)]>0x0&&console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x225)]('-\x20'+_0x4e02d2['length']+'\x20to\x20delete')));console[_0x25e0ba(0x220)]('\x20\x20Source:\x20'+a36_0x54932d[_0x25e0ba(0x1d5)](_0x59c816)+'\x0a');if(_0x3408d0['length']>0x0){console[_0x25e0ba(0x220)](_0x25e0ba(0x1e2));for(const _0x32f047 of _0x3408d0){console['error']('\x20\x20'+a36_0x54932d[_0x25e0ba(0x1c4)]('+')+'\x20'+_0x32f047);}console[_0x25e0ba(0x220)]('');}if(_0x108c12['length']>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)])for(const _0x2e76f6 of _0x108c12){const _0x43b797=_0x2e76f6[_0x25e0ba(0x17f)]?_0x2e76f6['folderPath']+'/'+_0x2e76f6[_0x25e0ba(0x202)]['name']:_0x2e76f6[_0x25e0ba(0x202)][_0x25e0ba(0x179)],_0x49b9e9=_0x2e76f6[_0x25e0ba(0x202)][_0x25e0ba(0x1f2)]?.[_0x25e0ba(0x1b4)]||0x0,_0x47fbfb=_0x49b9e9>0x0?a36_0x54932d[_0x25e0ba(0x16e)]('\x20['+_0x49b9e9+'\x20activations]'):'';console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d['green'](_0x25e0ba(0x1a3))+'\x20'+_0x43b797+_0x47fbfb),console['error']('─'[_0x25e0ba(0x1a1)](0x3c)),_0x2e76f6['diff']&&console['error'](_0x2e76f6[_0x25e0ba(0x1d2)]),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));}if(_0x304ea1['length']>0x0&&!_0x9a1cc5['journeysOnly'])for(const _0x3ce9db of _0x304ea1){const _0xf6c53c=_0x3ce9db['segmentFolderId']?_0x22d65e[_0x25e0ba(0x189)](_0x3ce9db['segmentFolderId'][_0x25e0ba(0x210)]())||'':'',_0x1296d9=_0xf6c53c?_0xf6c53c+'/'+_0x3ce9db[_0x25e0ba(0x179)]:_0x3ce9db['name'],_0x534423=_0x37b05f[_0x25e0ba(0x189)](_0x3ce9db['id'])||[],_0x108187=_0x534423['length']>0x0?a36_0x54932d[_0x25e0ba(0x16e)]('\x20['+_0x534423[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1da)):'';console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d[_0x25e0ba(0x225)]('Delete\x20segment:')+'\x20'+_0x1296d9+_0x108187),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));const _0x3cac8d=segmentWithActivationsToYaml(_0x3ce9db,_0x534423,undefined,_0x464344,_0x502bc7),_0x1f568f=segmentToYamlString(_0x3cac8d),_0x6ea09a=generateDiff(_0x1f568f,'');console[_0x25e0ba(0x220)](formatDiffWithColors(_0x6ea09a)),console['error']('─'[_0x25e0ba(0x1a1)](0x3c));}const _0x27572f=_0x91fd22['filter'](_0x250c74=>!_0x250c74[_0x25e0ba(0x20e)]&&_0x250c74[_0x25e0ba(0x1d2)]);if(_0x27572f['length']>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)])for(const _0x2cfc8 of _0x27572f){const _0x214b51=_0x2cfc8[_0x25e0ba(0x17f)]?_0x2cfc8[_0x25e0ba(0x17f)]+'/'+_0x2cfc8['yamlConfig'][_0x25e0ba(0x179)]:_0x2cfc8['yamlConfig'][_0x25e0ba(0x179)];console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d['yellow'](_0x25e0ba(0x187))+'\x20'+_0x214b51),console['error']('─'[_0x25e0ba(0x1a1)](0x3c)),console['error'](_0x2cfc8[_0x25e0ba(0x1d2)]),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));}if(_0x479e32[_0x25e0ba(0x1b4)]>0x0)for(const _0x4b016a of _0x479e32){const _0x563b02=_0x4b016a[_0x25e0ba(0x17f)]?_0x4b016a['folderPath']+'/'+_0x4b016a[_0x25e0ba(0x202)][_0x25e0ba(0x179)]:_0x4b016a[_0x25e0ba(0x202)][_0x25e0ba(0x179)];console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d[_0x25e0ba(0x1c6)](_0x25e0ba(0x209))+'\x20'+_0x563b02),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c)),_0x4b016a[_0x25e0ba(0x1d2)]&&console['error'](_0x4b016a[_0x25e0ba(0x1d2)]),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));}const _0x3eede5=_0x4ecc55['filter'](_0x26cf81=>!_0x26cf81[_0x25e0ba(0x20e)]&&_0x26cf81[_0x25e0ba(0x1d2)]);if(_0x3eede5[_0x25e0ba(0x1b4)]>0x0)for(const _0x55cb7a of _0x3eede5){const _0x2f98cd=_0x55cb7a[_0x25e0ba(0x17f)]?_0x55cb7a[_0x25e0ba(0x17f)]+'/'+_0x55cb7a['yamlConfig']['name']:_0x55cb7a[_0x25e0ba(0x202)][_0x25e0ba(0x179)];console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d[_0x25e0ba(0x1cd)](_0x25e0ba(0x25e))+'\x20'+_0x2f98cd),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c)),console[_0x25e0ba(0x220)](_0x55cb7a[_0x25e0ba(0x1d2)]),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));}if(_0x3e0feb[_0x25e0ba(0x1b4)]>0x0)for(const _0x2d25f1 of _0x3e0feb){const _0x5bb6b5=_0x2d25f1[_0x25e0ba(0x1c8)]?_0x22d65e[_0x25e0ba(0x189)](_0x2d25f1['folderId'])||'':'',_0x1e341d=_0x5bb6b5?_0x5bb6b5+'/'+_0x2d25f1[_0x25e0ba(0x205)]:_0x2d25f1[_0x25e0ba(0x205)];console['error']('\x0a'+a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x23b))+'\x20'+_0x1e341d),console['error']('─'[_0x25e0ba(0x1a1)](0x3c)),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x1b3))),console[_0x25e0ba(0x220)]('─'['repeat'](0x3c));}if(_0x9a1cc5[_0x25e0ba(0x248)])return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)](_0x25e0ba(0x192))),0x0;const _0x26197a=_0x9a1cc5[_0x25e0ba(0x20f)]?![]:_0x108c12[_0x25e0ba(0x1b4)]>0x0||_0x8331ab[_0x25e0ba(0x1b4)]>0x0||_0x304ea1[_0x25e0ba(0x1b4)]>0x0,_0x464dde=_0x479e32[_0x25e0ba(0x1b4)]>0x0||_0x2ec4a2[_0x25e0ba(0x1b4)]>0x0||_0x3e0feb[_0x25e0ba(0x1b4)]>0x0,_0x4ecced=_0x9a1cc5['journeysOnly']?![]:_0x1e2c1e[_0x25e0ba(0x1b4)]>0x0,_0x23efde=_0x3408d0[_0x25e0ba(0x1b4)]>0x0;if(!_0x26197a&&!_0x464dde&&!_0x4ecced&&!_0x23efde){const _0x2bf2d0=_0x9a1cc5[_0x25e0ba(0x20f)]?_0x25e0ba(0x261):_0x25e0ba(0x1ea);console['error'](a36_0x54932d[_0x25e0ba(0x1c6)](_0x2bf2d0));if(_0x24ed3e&&_0x13b708[_0x25e0ba(0x1b4)]===0x1){const _0x2e801d=_0x13b708[0x0];if(_0x2e801d[_0x25e0ba(0x1bf)]?.['id']){const _0x178da0=getConsoleNextUrl(_0x9a1cc5[_0x25e0ba(0x1c0)],'/app/ps/'+_0x2d104e+_0x25e0ba(0x1bd)+_0x2e801d[_0x25e0ba(0x1bf)]['id']+_0x25e0ba(0x1ca));console['error']('\x20\x20'+a36_0x54932d['cyan'](_0x178da0));}}return 0x0;}const _0x37929d=_0x9a1cc5[_0x25e0ba(0x20f)]?_0x479e32[_0x25e0ba(0x1b4)]+_0x2ec4a2['length']+_0x3e0feb['length']+_0x3408d0['length']:_0x108c12[_0x25e0ba(0x1b4)]+_0x8331ab[_0x25e0ba(0x1b4)]+_0x304ea1[_0x25e0ba(0x1b4)]+_0x479e32[_0x25e0ba(0x1b4)]+_0x2ec4a2[_0x25e0ba(0x1b4)]+_0x3e0feb[_0x25e0ba(0x1b4)]+_0x3408d0[_0x25e0ba(0x1b4)]+_0x1e2c1e['length'];if(!_0x9a1cc5[_0x25e0ba(0x1bc)]&&_0x37929d>0x0){const _0x2f0ab8=await confirmKey(_0x25e0ba(0x217)+_0x37929d+_0x25e0ba(0x239));if(!_0x2f0ab8)return console[_0x25e0ba(0x220)](_0x25e0ba(0x258)),0x1;}for(const _0x354e18 of _0x3408d0){const _0x44e9ad=_0x354e18['split']('/'),_0x6aeea1=_0x44e9ad[_0x44e9ad[_0x25e0ba(0x1b4)]-0x1],_0x31845d=_0x44e9ad[_0x25e0ba(0x1fb)](0x0,-0x1)[_0x25e0ba(0x1af)]('/'),_0x470acf=_0x2ac595['get'](_0x31845d),_0x304d26={'name':_0x6aeea1,'parentFolderId':_0x470acf},_0x267652=await withSpinner(_0x25e0ba(0x180)+_0x354e18+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x215)](_0x2d104e,_0x304d26),{'verbose':_0x9a1cc5['verbose']});_0x2ac595['set'](_0x354e18,_0x267652[_0x25e0ba(0x1bb)]['id']),console[_0x25e0ba(0x220)](a36_0x54932d['blue'](_0x25e0ba(0x172)+_0x354e18+'\x27'));}let _0x396bcc=0x0,_0x5e3f71=0x0,_0x4b3f14=0x0,_0x32af90=0x0,_0x343e01=0x0,_0x4fde80=0x0;const _0x170880=new Map();for(const _0x51a4ff of _0x9a1cc5[_0x25e0ba(0x20f)]?[]:_0x91fd22){const _0x488b04=_0x51a4ff[_0x25e0ba(0x17f)]?_0x2ac595[_0x25e0ba(0x189)](_0x51a4ff[_0x25e0ba(0x17f)]):undefined;let _0x207355;try{if(_0x51a4ff[_0x25e0ba(0x20e)]){const _0x3a5227=yamlToCreateRequest(_0x51a4ff['yamlConfig'],_0x488b04),_0x418026=await withSpinner(_0x25e0ba(0x1ec)+_0x51a4ff[_0x25e0ba(0x202)]['name']+_0x25e0ba(0x1c1),()=>_0x5793b9['segment'][_0x25e0ba(0x16d)](_0x2d104e,_0x3a5227),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]});_0x207355=_0x418026[_0x25e0ba(0x1bb)]['id'],_0x170880[_0x25e0ba(0x21a)](_0x51a4ff['yamlConfig'][_0x25e0ba(0x179)],_0x207355),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1c6)](_0x25e0ba(0x1a9)+_0x51a4ff['yamlConfig'][_0x25e0ba(0x179)]+'\x27')),_0x396bcc++;}else{if(_0x51a4ff[_0x25e0ba(0x256)]){const _0x2798cb=yamlToUpdateRequest(_0x51a4ff['yamlConfig']);_0x488b04!==_0x51a4ff['existingSegment']?.[_0x25e0ba(0x16f)]&&(_0x2798cb[_0x25e0ba(0x16f)]=_0x488b04?parseInt(_0x488b04,0xa):undefined),await withSpinner('Updating\x20segment\x20\x27'+_0x51a4ff[_0x25e0ba(0x202)][_0x25e0ba(0x179)]+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x1f1)](_0x2d104e,_0x51a4ff[_0x25e0ba(0x17b)]['id'],_0x2798cb),{'verbose':_0x9a1cc5['verbose']}),_0x207355=_0x51a4ff[_0x25e0ba(0x17b)]['id'],console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)]('✔\x20Updated\x20segment\x20\x27'+_0x51a4ff[_0x25e0ba(0x202)][_0x25e0ba(0x179)]+'\x27')),_0x5e3f71++;}else _0x207355=_0x51a4ff[_0x25e0ba(0x17b)]['id'];}}catch(_0x135110){const _0x37833f=isHttp400Error(_0x135110),_0x4880d2=_0x37833f?ErrorCode[_0x25e0ba(0x24d)]:ErrorCode[_0x25e0ba(0x1a5)],_0x2dec39=getErrorMessage(_0x135110);throw new SDKError(_0x4880d2,_0x25e0ba(0x18e)+(_0x51a4ff[_0x25e0ba(0x20e)]?_0x25e0ba(0x226):_0x25e0ba(0x24b))+_0x25e0ba(0x213)+_0x51a4ff[_0x25e0ba(0x1a4)]+'\x0a\x20\x20'+_0x2dec39,_0x135110);}for(const _0x98c0e8 of _0x51a4ff[_0x25e0ba(0x1e5)]){try{if(_0x98c0e8['type']===_0x25e0ba(0x226)&&_0x98c0e8[_0x25e0ba(0x1ae)]){const _0x284423=yamlActivationToCreateRequest(_0x98c0e8['yamlActivation'],_0x1516f5,_0x5b7934);await withSpinner('Creating\x20activation\x20\x27'+_0x98c0e8[_0x25e0ba(0x179)]+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x22b)](_0x2d104e,_0x207355,_0x284423),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),console[_0x25e0ba(0x220)](a36_0x54932d['green'](_0x25e0ba(0x228)+_0x98c0e8['name']+'\x27')),_0x32af90++;}else{if(_0x98c0e8[_0x25e0ba(0x231)]==='update'&&_0x98c0e8[_0x25e0ba(0x1ae)]&&_0x98c0e8['existingActivation']){const _0x4f9055=yamlActivationToUpdateRequest(_0x98c0e8[_0x25e0ba(0x1ae)],_0x1516f5,_0x5b7934);await withSpinner(_0x25e0ba(0x185)+_0x98c0e8[_0x25e0ba(0x179)]+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)]['updateActivation'](_0x2d104e,_0x207355,_0x98c0e8[_0x25e0ba(0x203)]['id'],_0x4f9055),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),console['error'](a36_0x54932d['yellow'](_0x25e0ba(0x1b2)+_0x98c0e8[_0x25e0ba(0x179)]+'\x27')),_0x343e01++;}else _0x98c0e8[_0x25e0ba(0x231)]===_0x25e0ba(0x1a6)&&_0x98c0e8[_0x25e0ba(0x203)]&&(await withSpinner('Deleting\x20activation\x20\x27'+_0x98c0e8['name']+'\x27...',()=>_0x5793b9['segment']['deleteActivation'](_0x2d104e,_0x207355,_0x98c0e8['existingActivation']['id']),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x171)+_0x98c0e8[_0x25e0ba(0x179)]+'\x27')),_0x4fde80++);}}catch(_0x19e25d){const _0x26eda4=isHttp400Error(_0x19e25d),_0xdfd46e=_0x26eda4?ErrorCode[_0x25e0ba(0x1c3)]:ErrorCode[_0x25e0ba(0x22a)],_0x2bea05=getErrorMessage(_0x19e25d);throw new SDKError(_0xdfd46e,_0x25e0ba(0x18e)+_0x98c0e8[_0x25e0ba(0x231)]+_0x25e0ba(0x18d)+_0x98c0e8['name']+_0x25e0ba(0x255)+_0x51a4ff[_0x25e0ba(0x1a4)]+'\x0a\x20\x20'+_0x2bea05,_0x19e25d);}}}for(const _0x58fa97 of _0x9a1cc5[_0x25e0ba(0x20f)]?[]:_0x304ea1){await withSpinner(_0x25e0ba(0x181)+_0x58fa97[_0x25e0ba(0x179)]+'\x27...',()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x19a)](_0x58fa97['id']),{'verbose':_0x9a1cc5['verbose']}),console[_0x25e0ba(0x220)](a36_0x54932d['red'](_0x25e0ba(0x1f5)+_0x58fa97[_0x25e0ba(0x179)]+'\x27')),_0x4b3f14++;}let _0x5495d0=0x0,_0x2af5da=0x0,_0x394fa4=0x0;const _0x427c03=new Map(_0x10252d);for(const _0x35bcae of _0x91fd22){_0x35bcae[_0x25e0ba(0x20e)]&&_0x170880[_0x25e0ba(0x21f)](_0x35bcae['yamlConfig'][_0x25e0ba(0x179)])&&_0x427c03['set'](_0x35bcae[_0x25e0ba(0x202)]['name'],_0x170880[_0x25e0ba(0x189)](_0x35bcae[_0x25e0ba(0x202)][_0x25e0ba(0x179)]));}if(_0x4ecc55[_0x25e0ba(0x1b4)]>0x0){const _0x4b53d5=await withQuerySpinner(_0x25e0ba(0x20d),async _0x42162c=>{const _0x42653d=_0x25e0ba,_0x58d8a6=[];let _0x3e5cd3=0x0;const _0x14bc96=0x5;for(let _0x28ea29=0x0;_0x28ea29<_0x4ecc55['length'];_0x28ea29+=_0x14bc96){const _0x566315=_0x4ecc55['slice'](_0x28ea29,_0x28ea29+_0x14bc96),_0x588d99=await Promise[_0x42653d(0x197)](_0x566315[_0x42653d(0x1b0)](async _0x588c1e=>{const _0x239b85=_0x42653d;if(!_0x588c1e[_0x239b85(0x20e)]&&!_0x588c1e[_0x239b85(0x256)])return{'action':_0x239b85(0x25b),'name':_0x588c1e[_0x239b85(0x202)][_0x239b85(0x179)],'journeyId':_0x588c1e[_0x239b85(0x1bf)]?.['id']};const _0x14fc5c=_0x588c1e[_0x239b85(0x17f)]?_0x2ac595[_0x239b85(0x189)](_0x588c1e['folderPath']):undefined,_0x1ff13d=_0x588c1e['isNew']?'Creating':_0x239b85(0x183);_0x42162c[_0x239b85(0x1d4)](_0x1ff13d+_0x239b85(0x207)+_0x588c1e[_0x239b85(0x202)][_0x239b85(0x179)]+'\x27');const _0x2246a6=new Map(),_0x4de172=new Map(),_0x50ba04=new Map(),_0x1e6f5d={'resolveSegmentId':async _0x4c94be=>{const _0x3f0b31=_0x239b85,_0x31f1c7=_0x427c03[_0x3f0b31(0x189)](_0x4c94be);if(!_0x31f1c7)throw new SDKError(ErrorCode[_0x3f0b31(0x1e3)],_0x3f0b31(0x1ba)+_0x4c94be+'\x20(referenced\x20in\x20journey\x20'+_0x588c1e[_0x3f0b31(0x202)][_0x3f0b31(0x179)]+')');return _0x31f1c7;},'resolveEmbeddedSegmentId':async(_0x47603a,_0x38570a)=>{const _0x233c3f=_0x239b85,_0x446a6a=_0x427c03[_0x233c3f(0x189)](_0x47603a);if(_0x446a6a)return _0x446a6a;const _0x5a72e7=_0xfee852[_0x233c3f(0x216)](_0x12add8=>_0x12add8[_0x233c3f(0x179)]===_0x47603a);if(_0x5a72e7)return _0x427c03[_0x233c3f(0x21a)](_0x47603a,_0x5a72e7['id']),_0x5a72e7['id'];if(_0x588c1e['isNew']){const _0x4e5d57=_0x588c1e[_0x233c3f(0x202)]['stages']||_0x588c1e['yamlConfig']['journeys']?.[0x0]?.[_0x233c3f(0x247)]||[];let _0x262988=_0x233c3f(0x214),_0x444684=_0x47603a;for(const _0x5e44ba of _0x4e5d57){if(_0x5e44ba[_0x233c3f(0x199)]?.[_0x233c3f(0x1e7)]===_0x47603a){_0x262988=_0x5e44ba[_0x233c3f(0x179)],_0x444684=_0x5e44ba[_0x233c3f(0x199)]['name']||_0x47603a;break;}}return _0x4de172[_0x233c3f(0x21a)](_0x47603a,{'definition':_0x38570a,'stageName':_0x262988,'criteriaName':_0x444684}),createPendingSegmentId(_0x47603a);}const _0x170af8=_0x588c1e[_0x233c3f(0x1bf)]?.['id'];if(!_0x170af8)throw new SDKError(ErrorCode[_0x233c3f(0x1ac)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x472bc4=_0x233c3f(0x251)+crypto[_0x233c3f(0x245)]();try{const _0x4a56e4=await _0x5793b9[_0x233c3f(0x1e7)][_0x233c3f(0x20b)]({'name':_0x472bc4,'description':_0x38570a[_0x233c3f(0x23e)]||_0x233c3f(0x25d)+_0x47603a,'journeyId':_0x170af8,'rule':yamlRuleToApi(_0x38570a[_0x233c3f(0x20c)],!![]),'countPopulation':!![],'parentFolderId':_0x17d9ba||'','audienceId':_0x2d104e});return _0x9a1cc5[_0x233c3f(0x1f9)]&&console[_0x233c3f(0x220)](_0x233c3f(0x1b8)+_0x47603a+_0x233c3f(0x169)+_0x472bc4+_0x233c3f(0x1d7)+_0x4a56e4),_0x427c03['set'](_0x47603a,_0x4a56e4),_0x4a56e4;}catch(_0x55e7d6){throw new SDKError(ErrorCode[_0x233c3f(0x1a5)],_0x233c3f(0x1eb)+_0x47603a+_0x233c3f(0x1c5)+getErrorMessage(_0x55e7d6),_0x55e7d6);}},'resolveActivationId':async _0x168e0c=>{const _0x17f557=_0x239b85,_0xa8be23=_0x2246a6[_0x17f557(0x189)](_0x168e0c);if(_0xa8be23)return _0xa8be23;if(_0x588c1e[_0x17f557(0x1bf)]){const _0x3286a9=await _0x5793b9['journey'][_0x17f557(0x1ad)](_0x588c1e[_0x17f557(0x1bf)]['id']),_0x20a25c=_0x3286a9['find'](_0x4997bb=>_0x4997bb[_0x17f557(0x194)][_0x17f557(0x16a)]?.[_0x17f557(0x179)]===_0x168e0c);if(_0x20a25c)return _0x2246a6[_0x17f557(0x21a)](_0x168e0c,_0x20a25c['id']),_0x20a25c['id'];}throw new SDKError(ErrorCode[_0x17f557(0x22f)],_0x17f557(0x1d9)+_0x168e0c+'\x20(referenced\x20in\x20journey\x20'+_0x588c1e[_0x17f557(0x202)]['name']+_0x17f557(0x234)+_0x17f557(0x211));},'resolveEmbeddedActivationId':async(_0x1ad973,_0x3464d4)=>{const _0x4f8aa3=_0x239b85,_0x25228a=_0x2246a6[_0x4f8aa3(0x189)](_0x1ad973);if(_0x25228a)return _0x25228a;if(_0x588c1e['isNew'])return _0x50ba04[_0x4f8aa3(0x21a)](_0x1ad973,_0x3464d4),createPendingActivationId(_0x1ad973);if(_0x588c1e['existingJourney']){const _0x2ecb8a=await _0x5793b9[_0x4f8aa3(0x1e1)]['listActivations'](_0x588c1e[_0x4f8aa3(0x1bf)]['id']),_0x374c77=_0x2ecb8a['find'](_0x241793=>_0x241793[_0x4f8aa3(0x194)]['activationParams']?.[_0x4f8aa3(0x179)]===_0x3464d4[_0x4f8aa3(0x179)]);if(_0x374c77)return _0x2246a6[_0x4f8aa3(0x21a)](_0x1ad973,_0x374c77['id']),_0x374c77['id'];try{const _0x2c37cb=yamlActivationToCreateRequest(_0x3464d4,_0x1516f5,_0x5b7934),_0x50b08f=await _0x5793b9[_0x4f8aa3(0x1e1)][_0x4f8aa3(0x22b)](_0x588c1e[_0x4f8aa3(0x1bf)]['id'],_0x2c37cb);return _0x9a1cc5['verbose']&&console['error'](_0x4f8aa3(0x233)+_0x1ad973+_0x4f8aa3(0x222)+_0x50b08f['id']),_0x2246a6[_0x4f8aa3(0x21a)](_0x1ad973,_0x50b08f['id']),_0x50b08f['id'];}catch(_0x5c58e4){throw new SDKError(ErrorCode[_0x4f8aa3(0x260)],'Failed\x20to\x20create\x20embedded\x20activation\x20\x27'+_0x1ad973+_0x4f8aa3(0x1c5)+getErrorMessage(_0x5c58e4),_0x5c58e4);}}throw new SDKError(ErrorCode[_0x4f8aa3(0x1ac)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x459bdc=>{const _0x3e3c04=_0x239b85;try{return await _0x5793b9[_0x3e3c04(0x1e1)][_0x3e3c04(0x224)](_0x2d104e,_0x459bdc);}catch(_0x1d0aa6){throw new SDKError(ErrorCode[_0x3e3c04(0x22f)],'Journey\x20\x27'+_0x459bdc+_0x3e3c04(0x1be)+_0x588c1e[_0x3e3c04(0x202)][_0x3e3c04(0x179)]+'\x27)',_0x1d0aa6);}},'resolveStageId':async(_0x32d0a8,_0x5e5fb7)=>{const _0x5a8ed9=_0x239b85,_0x2d92ca=await _0x5793b9[_0x5a8ed9(0x1e1)]['getJourney'](_0x32d0a8),_0x5df7d0=_0x2d92ca[_0x5a8ed9(0x194)][_0x5a8ed9(0x238)][_0x5a8ed9(0x216)](_0x3ad76a=>_0x3ad76a[_0x5a8ed9(0x179)][_0x5a8ed9(0x176)]()===_0x5e5fb7[_0x5a8ed9(0x176)]());if(!_0x5df7d0?.['id'])throw new SDKError(ErrorCode[_0x5a8ed9(0x22f)],_0x5a8ed9(0x1ed)+_0x5e5fb7+_0x5a8ed9(0x259)+(_0x2d92ca[_0x5a8ed9(0x194)]['journeyBundleName']||_0x2d92ca[_0x5a8ed9(0x194)][_0x5a8ed9(0x179)])+'\x27');return _0x5df7d0['id'];}};try{const _0x1a4548=await a36_0x18f4eb(_0x588c1e[_0x239b85(0x202)],_0x2d104e,_0x1e6f5d),_0x557596=_0x14fc5c||_0x17d9ba;_0x557596&&(_0x1a4548['relationships']={'parentFolder':{'data':{'id':_0x557596,'type':_0x239b85(0x242)}}});if(_0x588c1e[_0x239b85(0x20e)]){if(_0x4de172[_0x239b85(0x240)]>0x0||_0x50ba04['size']>0x0){const _0x2f69a8=JSON[_0x239b85(0x177)](JSON[_0x239b85(0x246)](_0x1a4548));ensureJourneyDefaults(_0x2f69a8[_0x239b85(0x194)]);for(const _0x5aaf8c of _0x2f69a8[_0x239b85(0x194)][_0x239b85(0x238)]){_0x5aaf8c[_0x239b85(0x204)]?.[_0x239b85(0x252)]&&isPendingSegmentId(_0x5aaf8c[_0x239b85(0x204)][_0x239b85(0x252)])&&delete _0x5aaf8c[_0x239b85(0x204)];if(_0x5aaf8c['steps'])for(const _0x199855 of Object[_0x239b85(0x21d)](_0x5aaf8c['steps'])){const _0xfdbf7e=_0x5aaf8c[_0x239b85(0x1b7)][_0x199855];_0xfdbf7e[_0x239b85(0x231)]===_0x239b85(0x1a0)&&_0xfdbf7e['journeyActivationStepId']&&isPendingActivationId(_0xfdbf7e[_0x239b85(0x24a)])&&(_0xfdbf7e[_0x239b85(0x24a)]='');if(_0xfdbf7e[_0x239b85(0x231)]===_0x239b85(0x1f4)&&_0xfdbf7e[_0x239b85(0x23d)])for(const _0x19499f of _0xfdbf7e[_0x239b85(0x23d)]){_0x19499f[_0x239b85(0x252)]&&isPendingSegmentId(_0x19499f[_0x239b85(0x252)])&&(_0x19499f['segmentId']='');}}}_0x9a1cc5[_0x239b85(0x1f9)]&&console[_0x239b85(0x220)](_0x239b85(0x1cb)+JSON['stringify'](_0x2f69a8,null,0x2));const _0x510261=await _0x5793b9[_0x239b85(0x1e1)][_0x239b85(0x226)](_0x2f69a8),_0x20f4f9=_0x510261['id'],_0x1d4560=new Map();for(const _0x3de940 of _0x510261[_0x239b85(0x194)][_0x239b85(0x238)]){_0x1d4560[_0x239b85(0x21a)](_0x3de940[_0x239b85(0x179)][_0x239b85(0x176)](),_0x3de940['id']);}const _0x19c074=new Map();for(const [_0x391ede,{definition:_0x1fb793,criteriaName:_0x83a3fb}]of _0x4de172){const _0x2ea868=generateJourneyLocalName(_0x83a3fb)||_0x239b85(0x251)+crypto[_0x239b85(0x245)]();_0x9a1cc5[_0x239b85(0x1f9)]&&console[_0x239b85(0x220)](_0x239b85(0x1e4)+_0x391ede+_0x239b85(0x169)+_0x2ea868+_0x239b85(0x1db)+_0x20f4f9);const _0x5157a3=await _0x5793b9['segment'][_0x239b85(0x20b)]({'name':_0x2ea868,'description':_0x1fb793['description']||_0x239b85(0x25d)+_0x391ede,'journeyId':_0x20f4f9,'rule':yamlRuleToApi(_0x1fb793[_0x239b85(0x20c)],!![]),'countPopulation':!![],'parentFolderId':_0x557596||'','audienceId':_0x2d104e});_0x19c074['set'](_0x391ede,_0x5157a3),_0x427c03['set'](_0x391ede,_0x5157a3),_0x9a1cc5[_0x239b85(0x1f9)]&&console[_0x239b85(0x220)](_0x239b85(0x1b8)+_0x391ede+_0x239b85(0x222)+_0x5157a3);}const _0x59200a=new Map();for(const [_0x3b49b9,_0x4d06d7]of _0x50ba04){_0x9a1cc5['verbose']&&console['error'](_0x239b85(0x1a7)+_0x3b49b9+'\x27\x20with\x20journeyId:\x20'+_0x20f4f9);try{const _0x227883=yamlActivationToCreateRequest(_0x4d06d7,_0x1516f5,_0x5b7934),_0x50d15f=await _0x5793b9[_0x239b85(0x1e1)][_0x239b85(0x22b)](_0x20f4f9,_0x227883);_0x59200a[_0x239b85(0x21a)](_0x3b49b9,_0x50d15f['id']),_0x2246a6[_0x239b85(0x21a)](_0x3b49b9,_0x50d15f['id']),_0x9a1cc5[_0x239b85(0x1f9)]&&console[_0x239b85(0x220)](_0x239b85(0x233)+_0x3b49b9+_0x239b85(0x222)+_0x50d15f['id']);}catch(_0x184a10){throw new SDKError(ErrorCode[_0x239b85(0x260)],_0x239b85(0x1e8)+_0x3b49b9+'\x27:\x20'+getErrorMessage(_0x184a10),_0x184a10);}}const _0x402fcd=JSON[_0x239b85(0x177)](JSON['stringify'](_0x1a4548));_0x402fcd['id']=_0x20f4f9,ensureJourneyDefaults(_0x402fcd[_0x239b85(0x194)]);for(const _0x55c41a of _0x402fcd[_0x239b85(0x194)][_0x239b85(0x238)]){const _0x35725d=_0x1d4560[_0x239b85(0x189)](_0x55c41a[_0x239b85(0x179)][_0x239b85(0x176)]());_0x35725d&&(_0x55c41a['id']=_0x35725d);if(_0x55c41a[_0x239b85(0x204)]?.[_0x239b85(0x252)]&&isPendingSegmentId(_0x55c41a['entryCriteria']['segmentId'])){const _0x485534=extractPendingSegmentName(_0x55c41a[_0x239b85(0x204)][_0x239b85(0x252)]),_0x4a42df=_0x19c074[_0x239b85(0x189)](_0x485534);_0x4a42df&&(_0x55c41a[_0x239b85(0x204)][_0x239b85(0x252)]=_0x4a42df);}if(_0x55c41a['steps']){const _0x38e388=_0x124748=>_0x1a4548[_0x239b85(0x194)][_0x239b85(0x238)]['find'](_0x58a66b=>_0x58a66b[_0x239b85(0x179)][_0x239b85(0x176)]()===_0x55c41a['name']['toLowerCase']())?.['steps']?.[_0x124748];for(const _0x32558f of Object[_0x239b85(0x21d)](_0x55c41a[_0x239b85(0x1b7)])){const _0x4d2878=_0x55c41a['steps'][_0x32558f],_0x48cbb8=_0x38e388(_0x32558f);if(_0x4d2878[_0x239b85(0x231)]===_0x239b85(0x1a0)&&_0x4d2878[_0x239b85(0x24a)]&&(isPendingActivationId(_0x4d2878[_0x239b85(0x24a)])||_0x4d2878['journeyActivationStepId']==='')){if(_0x48cbb8?.[_0x239b85(0x24a)]&&isPendingActivationId(_0x48cbb8[_0x239b85(0x24a)])){const _0x5221dd=extractPendingActivationName(_0x48cbb8[_0x239b85(0x24a)]),_0x2c6740=_0x59200a['get'](_0x5221dd);_0x2c6740&&(_0x4d2878[_0x239b85(0x24a)]=_0x2c6740);}}if(_0x4d2878['type']===_0x239b85(0x1f4)&&_0x4d2878['branches']&&_0x48cbb8?.[_0x239b85(0x23d)])for(let _0x29826b=0x0;_0x29826b<_0x4d2878[_0x239b85(0x23d)][_0x239b85(0x1b4)];_0x29826b++){const _0x58f753=_0x4d2878['branches'][_0x29826b],_0x369b97=_0x48cbb8[_0x239b85(0x23d)][_0x29826b];if(_0x369b97?.[_0x239b85(0x252)]&&isPendingSegmentId(_0x369b97[_0x239b85(0x252)])){const _0x586f91=extractPendingSegmentName(_0x369b97[_0x239b85(0x252)]),_0x259b8a=_0x19c074[_0x239b85(0x189)](_0x586f91);_0x259b8a&&(_0x58f753[_0x239b85(0x252)]=_0x259b8a);}}}}}return _0x9a1cc5[_0x239b85(0x1f9)]&&console['error'](_0x239b85(0x19e)+JSON[_0x239b85(0x246)](_0x402fcd,null,0x2)),await _0x5793b9[_0x239b85(0x1e1)][_0x239b85(0x24b)](_0x20f4f9,_0x402fcd),{'action':_0x239b85(0x20a),'name':_0x588c1e['yamlConfig'][_0x239b85(0x179)],'journeyId':_0x20f4f9};}else{ensureJourneyDefaults(_0x1a4548['attributes']);_0x9a1cc5[_0x239b85(0x1f9)]&&console['error'](_0x239b85(0x1e6)+JSON[_0x239b85(0x246)](_0x1a4548,null,0x2));const _0x5f54df=await _0x5793b9[_0x239b85(0x1e1)][_0x239b85(0x226)](_0x1a4548);return{'action':_0x239b85(0x20a),'name':_0x588c1e['yamlConfig'][_0x239b85(0x179)],'journeyId':_0x5f54df['id']};}}else{if(_0x588c1e[_0x239b85(0x256)]&&_0x588c1e['existingJourney'])return ensureJourneyDefaults(_0x1a4548[_0x239b85(0x194)]),await _0x5793b9[_0x239b85(0x1e1)]['update'](_0x588c1e['existingJourney']['id'],_0x1a4548),{'action':_0x239b85(0x1e0),'name':_0x588c1e[_0x239b85(0x202)]['name'],'journeyId':_0x588c1e['existingJourney']['id']};}return{'action':_0x239b85(0x25b),'name':_0x588c1e[_0x239b85(0x202)]['name'],'journeyId':_0x588c1e[_0x239b85(0x1bf)]?.['id']};}catch(_0x43d982){const _0x195724=isHttp400Error(_0x43d982),_0x425968=_0x195724?ErrorCode[_0x239b85(0x1d3)]:ErrorCode[_0x239b85(0x260)],_0x5a6b5f=getErrorMessage(_0x43d982);throw new SDKError(_0x425968,_0x239b85(0x18e)+(_0x588c1e[_0x239b85(0x20e)]?_0x239b85(0x226):_0x239b85(0x24b))+_0x239b85(0x182)+_0x588c1e[_0x239b85(0x1a4)]+'\x0a\x20\x20'+_0x5a6b5f,_0x43d982);}}));_0x58d8a6[_0x42653d(0x1a2)](..._0x588d99),_0x3e5cd3+=_0x566315[_0x42653d(0x1b4)],_0x42162c[_0x42653d(0x227)]('('+_0x3e5cd3+'/'+_0x4ecc55[_0x42653d(0x1b4)]+')');}return _0x58d8a6;},{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]});for(const _0x2a27eb of _0x4b53d5[_0x25e0ba(0x1bb)]){if(_0x2a27eb[_0x25e0ba(0x1f6)]==='created')console['error'](a36_0x54932d[_0x25e0ba(0x1c6)](_0x25e0ba(0x249)+_0x2a27eb[_0x25e0ba(0x179)]+'\x27')),_0x5495d0++;else _0x2a27eb[_0x25e0ba(0x1f6)]==='updated'&&(console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)](_0x25e0ba(0x241)+_0x2a27eb[_0x25e0ba(0x179)]+'\x27')),_0x2af5da++);}if(_0x24ed3e&&_0x4b53d5['data'][_0x25e0ba(0x1b4)]===0x1){const _0x33fd09=_0x4b53d5[_0x25e0ba(0x1bb)][0x0];if(_0x33fd09['journeyId']){const _0x250ebe=getConsoleNextUrl(_0x9a1cc5['site'],'/app/ps/'+_0x2d104e+_0x25e0ba(0x1bd)+_0x33fd09[_0x25e0ba(0x262)]+_0x25e0ba(0x1ca));console[_0x25e0ba(0x220)]('\x20\x20'+a36_0x54932d[_0x25e0ba(0x1d5)](_0x250ebe));}}}for(const _0x57761a of _0x3e0feb){console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x57761a[_0x25e0ba(0x205)])),_0x394fa4++;}const _0x2f5cb5=[];if(_0x396bcc>0x0)_0x2f5cb5[_0x25e0ba(0x1a2)](_0x396bcc+_0x25e0ba(0x195));if(_0x5e3f71>0x0)_0x2f5cb5['push'](_0x5e3f71+_0x25e0ba(0x243));if(_0x4b3f14>0x0)_0x2f5cb5[_0x25e0ba(0x1a2)](_0x4b3f14+_0x25e0ba(0x1b5));const _0x9c7767=[];if(_0x5495d0>0x0)_0x9c7767[_0x25e0ba(0x1a2)](_0x5495d0+_0x25e0ba(0x195));if(_0x2af5da>0x0)_0x9c7767[_0x25e0ba(0x1a2)](_0x2af5da+_0x25e0ba(0x243));if(_0x394fa4>0x0)_0x9c7767['push'](_0x394fa4+_0x25e0ba(0x1b5));const _0x125c25=[];if(_0x32af90>0x0)_0x125c25[_0x25e0ba(0x1a2)](_0x32af90+_0x25e0ba(0x195));if(_0x343e01>0x0)_0x125c25[_0x25e0ba(0x1a2)](_0x343e01+_0x25e0ba(0x243));if(_0x4fde80>0x0)_0x125c25[_0x25e0ba(0x1a2)](_0x4fde80+'\x20deleted');return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1c6)](_0x25e0ba(0x254))),_0x2f5cb5['length']>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)]&&console['error'](_0x25e0ba(0x21b)+_0x2f5cb5[_0x25e0ba(0x1af)](',\x20')),_0x9c7767[_0x25e0ba(0x1b4)]>0x0&&console[_0x25e0ba(0x220)](_0x25e0ba(0x263)+_0x9c7767['join'](',\x20')),_0x125c25[_0x25e0ba(0x1b4)]>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)]&&console[_0x25e0ba(0x220)]('\x20\x20Activations:\x20'+_0x125c25[_0x25e0ba(0x1af)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0xad195a){const _0x550775=a36_0x59c5e1,_0x5bf768=new Map(),_0x5b5192=new Map();for(const _0x34a354 of _0xad195a){_0x5b5192[_0x550775(0x21a)](_0x34a354['id'],_0x34a354);}const _0xfc537f=new Set();for(const _0x963a06 of _0xad195a){!_0x963a06[_0x550775(0x235)]&&_0xfc537f[_0x550775(0x232)](_0x963a06['id']);}function _0xc75d18(_0x12823b){const _0x5b1b0a=_0x550775;if(_0xfc537f[_0x5b1b0a(0x21f)](_0x12823b['id']))return'';if(_0x12823b[_0x5b1b0a(0x235)]){const _0x1e40d0=_0x5b5192[_0x5b1b0a(0x189)](_0x12823b['parentFolderId']);if(_0x1e40d0){const _0x1fe6cf=_0xc75d18(_0x1e40d0);return _0x1fe6cf?_0x1fe6cf+'/'+_0x12823b[_0x5b1b0a(0x179)]:_0x12823b[_0x5b1b0a(0x179)];}}return _0x12823b[_0x5b1b0a(0x179)];}for(const _0x188e44 of _0xad195a){const _0x44559d=_0xc75d18(_0x188e44);_0x5bf768['set'](_0x44559d,_0x188e44['id']);}return _0x5bf768;}function findYamlFiles(_0x2918e5){const _0xf57dc4=[];function _0x944a9c(_0x273dab){const _0x23aebd=a36_0x2d4a,_0x3b214c=readdirSync(_0x273dab,{'withFileTypes':!![]});for(const _0x568f60 of _0x3b214c){const _0x12944b=a36_0x475838[_0x23aebd(0x1af)](_0x273dab,_0x568f60[_0x23aebd(0x179)]);if(_0x568f60['isDirectory']())_0x944a9c(_0x12944b);else(_0x568f60[_0x23aebd(0x179)]['endsWith'](_0x23aebd(0x1c9))||_0x568f60[_0x23aebd(0x179)][_0x23aebd(0x175)](_0x23aebd(0x1fc)))&&_0xf57dc4[_0x23aebd(0x1a2)](_0x12944b);}}return _0x944a9c(_0x2918e5),_0xf57dc4;}function calculateActivationActions(_0x17674b,_0x5bba71,_0x57f11f,_0x1f4bb5){const _0x542d11=a36_0x59c5e1,_0x95a15f=[],_0x218fa1=new Map();for(const _0xb1abed of _0x5bba71){_0x218fa1[_0x542d11(0x21a)](_0xb1abed[_0x542d11(0x179)],_0xb1abed);}const _0x361b27=new Map();for(const _0x5821f8 of _0x17674b){_0x361b27[_0x542d11(0x21a)](_0x5821f8['name'],_0x5821f8);}for(const _0x36c200 of _0x17674b){const _0x44d174=_0x218fa1[_0x542d11(0x189)](_0x36c200[_0x542d11(0x179)]);if(!_0x44d174)_0x95a15f[_0x542d11(0x1a2)]({'type':_0x542d11(0x226),'name':_0x36c200[_0x542d11(0x179)],'yamlActivation':_0x36c200});else{const _0x12bfea=activationToYaml(_0x44d174,_0x57f11f,_0x1f4bb5),_0x39ba83=a36_0x147f4c['stringify'](_0x12bfea),_0x42d5e8=a36_0x147f4c[_0x542d11(0x246)](_0x36c200);_0x39ba83!==_0x42d5e8&&_0x95a15f[_0x542d11(0x1a2)]({'type':_0x542d11(0x24b),'name':_0x36c200[_0x542d11(0x179)],'yamlActivation':_0x36c200,'existingActivation':_0x44d174});}}for(const _0x5b475c of _0x5bba71){!_0x361b27[_0x542d11(0x21f)](_0x5b475c[_0x542d11(0x179)])&&_0x95a15f['push']({'type':'delete','name':_0x5b475c['name'],'existingActivation':_0x5b475c});}return _0x95a15f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0xa1831f=a37_0x42b8;(function(_0x3f4119,_0x5b3483){const _0x241665=a37_0x42b8,_0x5bab86=_0x3f4119();while(!![]){try{const _0x44c052=parseInt(_0x241665(0x20c))/0x1+-parseInt(_0x241665(0x202))/0x2+-parseInt(_0x241665(0x1f6))/0x3+-parseInt(_0x241665(0x1ff))/0x4+-parseInt(_0x241665(0x205))/0x5+-parseInt(_0x241665(0x212))/0x6*(-parseInt(_0x241665(0x1f4))/0x7)+parseInt(_0x241665(0x20b))/0x8*(parseInt(_0x241665(0x203))/0x9);if(_0x44c052===_0x5b3483)break;else _0x5bab86['push'](_0x5bab86['shift']());}catch(_0x3d68ae){_0x5bab86['push'](_0x5bab86['shift']());}}}(a37_0x393d,0x5418f));import{BaseCommand}from'./command.js';function a37_0x42b8(_0x4b5331,_0x29915e){_0x4b5331=_0x4b5331-0x1f2;const _0x393d3b=a37_0x393d();let _0x42b88f=_0x393d3b[_0x4b5331];return _0x42b88f;}import{handleSDKOutput}from'../utils/command-output.js';function a37_0x393d(){const _0x33e4ee=['error','Resolved\x20folder\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Examples:','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','name','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','includes','48524bGqovx','\x20\x20\x20Path:\x20','762036HTQFiQ','\x27...','Segment\x20ID:\x20','ruleFile','segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','INTERNAL','kind','type','513580nrSVeQ','folder','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','148174eIlAyA','63yNjqIZ','segmentName','1863505ifMRnP','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','yellow','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20path\x20\x27','1182536euFosW','41891SgrQEP','segmentId','✔\x20Updated\x20segment\x20\x27','description','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20relative\x20path\x20to:\x20','84xQbuCL','verbose','length'];a37_0x393d=function(){return _0x33e4ee;};return a37_0x393d();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a37_0x55be90 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a37_0xa1831f(0x21b)]='segment:update';[a37_0xa1831f(0x20f)]='Update\x20existing\x20child\x20segment';async['execute'](_0x39697d){const _0x2d5b49=a37_0xa1831f;console['error'](a37_0x55be90[_0x2d5b49(0x207)](_0x2d5b49(0x21a))),console[_0x2d5b49(0x215)](a37_0x55be90[_0x2d5b49(0x207)](_0x2d5b49(0x217)));const {options:_0x242027,args:_0x41c44c,tdx:_0x3b3369}=_0x39697d,_0x3af002=_0x242027;if(_0x41c44c[_0x2d5b49(0x214)]===0x0)return console[_0x2d5b49(0x215)](_0x2d5b49(0x209)),console[_0x2d5b49(0x215)](_0x2d5b49(0x201)),console[_0x2d5b49(0x215)](_0x2d5b49(0x218)),console[_0x2d5b49(0x215)](_0x2d5b49(0x206)),console[_0x2d5b49(0x215)](_0x2d5b49(0x1fb)),0x1;const _0xd1781e=_0x41c44c[0x0],_0x2755e7=_0x242027['segmentPath'];let _0x32349d=_0xd1781e;_0x2755e7&&!_0xd1781e[_0x2d5b49(0x1f3)]('/')&&(_0x32349d=_0x2755e7+'/'+_0xd1781e,_0x3af002[_0x2d5b49(0x213)]&&console[_0x2d5b49(0x215)](_0x2d5b49(0x211)+_0x32349d));const _0x147960=await withSpinner(_0x2d5b49(0x20a)+_0x32349d+'\x27...',()=>_0x3b3369['segment']['resolvePathToResource'](_0x32349d),{'verbose':_0x3af002[_0x2d5b49(0x213)]}),_0x594b33=_0x147960['data'];_0x3af002[_0x2d5b49(0x213)]&&console['error']('Resolved\x20type:\x20'+_0x594b33[_0x2d5b49(0x1fe)]);if(_0x594b33[_0x2d5b49(0x1fe)]!==_0x2d5b49(0x1fa))return console[_0x2d5b49(0x215)](_0x2d5b49(0x1f2)+_0x594b33[_0x2d5b49(0x1fe)]+_0x2d5b49(0x21c)),console['error'](_0x2d5b49(0x208)),0x1;if(!_0x594b33[_0x2d5b49(0x20d)])throw new SDKError(ErrorCode[_0x2d5b49(0x1fc)],_0x2d5b49(0x210));const _0x41f9be=_0x594b33['parentId'],_0x17bb87=_0x594b33[_0x2d5b49(0x20d)];_0x3af002['verbose']&&(console[_0x2d5b49(0x215)]('Parent\x20ID:\x20'+_0x41f9be),console[_0x2d5b49(0x215)](_0x2d5b49(0x1f8)+_0x17bb87));let _0x3089b2;if(_0x3af002[_0x2d5b49(0x200)]){const _0x4e5240=_0x3af002[_0x2d5b49(0x200)],_0x2a7955=await withSpinner('Resolving\x20folder\x20\x27'+_0x4e5240+_0x2d5b49(0x1f7),()=>_0x3b3369[_0x2d5b49(0x1fa)]['resolveFolderId'](_0x41f9be,_0x4e5240),{'verbose':_0x3af002[_0x2d5b49(0x213)]});_0x3089b2=parseInt(_0x2a7955['data'],0xa),_0x3af002['verbose']&&console[_0x2d5b49(0x215)](_0x2d5b49(0x216)+_0x3089b2);}const _0x321586=await loadJSONFromOptions(_0x3af002[_0x2d5b49(0x219)],_0x3af002[_0x2d5b49(0x1f9)]),_0x2e7b1a={'name':_0x3af002[_0x2d5b49(0x21b)],'description':_0x3af002['description'],'rule':_0x321586,'kind':_0x3af002[_0x2d5b49(0x1fd)]!==undefined?parseInt(_0x3af002['kind'],0xa):undefined,'segmentFolderId':_0x3089b2},_0x33734f=await withSpinner('Updating\x20segment\x20\x27'+_0x594b33[_0x2d5b49(0x204)]+_0x2d5b49(0x1f7),()=>_0x3b3369[_0x2d5b49(0x1fa)]['updateSegmentById'](_0x41f9be,_0x17bb87,_0x2e7b1a),{'verbose':_0x3af002[_0x2d5b49(0x213)]}),_0x54096c=_0x33734f['data'];return console[_0x2d5b49(0x215)](_0x2d5b49(0x20e)+_0x54096c[_0x2d5b49(0x21b)]+'\x27'),_0x32349d!==_0xd1781e&&console[_0x2d5b49(0x215)](_0x2d5b49(0x1f5)+_0x32349d),await handleSDKOutput([_0x54096c],_0x3af002),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a38_0x4ef8(){const _0x4eab15=['folderId','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','red','parent_segment','Target\x20path:\x20','slice','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','2885800SdtOUh','dim','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','cyan','parentName','verbose','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','9LCrsgO','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','fullPath','config','error','Resolved\x20path\x20type:\x20','parentId','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','313389BGkgDY','data','green','segment:use','execute','1rAzcov','10301864ZqrbUI','Parent\x20ID:\x20','resolvePathToResource','segmentPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','segment','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Resolving\x20path\x20\x27','\x27...','Use:\x20tdx\x20segment\x20use\x20','Error:\x20Path\x20is\x20required\x0a','445838sLhFvh','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Site:\x20','log','Resolved\x20relative\x20path\x20to:\x20','✔\x20Context\x20set\x20to:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Usage:\x20tdx\x20segment\x20use\x20<path>','isAbsolute','Examples:','1572558jiLvjs','description','session','3240923MoQbel','split','length','type','segments','1444508jXylno'];a38_0x4ef8=function(){return _0x4eab15;};return a38_0x4ef8();}const a38_0x58a60c=a38_0x51e0;(function(_0x10d88b,_0x28b8bb){const _0x38f854=a38_0x51e0,_0x256e3c=_0x10d88b();while(!![]){try{const _0xb2a477=-parseInt(_0x38f854(0xfd))/0x1*(parseInt(_0x38f854(0x109))/0x2)+parseInt(_0x38f854(0xf8))/0x3+-parseInt(_0x38f854(0x11c))/0x4+-parseInt(_0x38f854(0x124))/0x5+-parseInt(_0x38f854(0x114))/0x6+parseInt(_0x38f854(0x117))/0x7+parseInt(_0x38f854(0xfe))/0x8*(parseInt(_0x38f854(0xef))/0x9);if(_0xb2a477===_0x28b8bb)break;else _0x256e3c['push'](_0x256e3c['shift']());}catch(_0x11bd91){_0x256e3c['push'](_0x256e3c['shift']());}}}(a38_0x4ef8,0x6970e));import{existsSync,statSync}from'fs';import a38_0x4ed56a from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';import{findTdxConfig}from'../utils/tdx-config.js';function a38_0x51e0(_0x1b838d,_0x55c977){_0x1b838d=_0x1b838d-0xea;const _0x4ef8aa=a38_0x4ef8();let _0x51e05e=_0x4ef8aa[_0x1b838d];return _0x51e05e;}export class SegmentUseCommand extends BaseCommand{['name']=a38_0x58a60c(0xfb);[a38_0x58a60c(0x115)]=a38_0x58a60c(0x102);async[a38_0x58a60c(0xfc)](_0x5c26f0){const _0x1c69d0=a38_0x58a60c,{options:_0x534131,args:_0x1b9b13,tdx:_0x4b015d}=_0x5c26f0;if(_0x1b9b13[_0x1c69d0(0x119)]===0x0)return console['error'](a38_0x4ed56a[_0x1c69d0(0x11f)](_0x1c69d0(0x108))),console['error'](_0x1c69d0(0x111)),console[_0x1c69d0(0xf4)](_0x1c69d0(0x113)),console[_0x1c69d0(0xf4)](_0x1c69d0(0x10a)),console[_0x1c69d0(0xf4)](_0x1c69d0(0xf1)),console[_0x1c69d0(0xf4)](_0x1c69d0(0xee)),console[_0x1c69d0(0xf4)](_0x1c69d0(0x123)),0x1;const _0x13da51=_0x1b9b13[0x0],_0x4997c4=_0x534131[_0x1c69d0(0x116)];try{if(_0x13da51==='/')return saveSessionContext({'segment_path':undefined},_0x4997c4),console[_0x1c69d0(0x10c)](a38_0x4ed56a[_0x1c69d0(0xfa)](_0x1c69d0(0xf7))),0x0;if(existsSync(_0x13da51)&&statSync(_0x13da51)['isDirectory']()){let _0x4633a4;try{_0x4633a4=findTdxConfig(_0x13da51);}catch{return console['error'](a38_0x4ed56a['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x13da51)),console['error'](a38_0x4ed56a[_0x1c69d0(0xeb)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x35e732=_0x4633a4[_0x1c69d0(0xf3)][_0x1c69d0(0x120)];return saveSessionContext({'segment_path':_0x35e732,'parent_segment':_0x35e732},_0x4997c4),console['log'](a38_0x4ed56a['green'](_0x1c69d0(0x10e)+a38_0x4ed56a[_0x1c69d0(0xeb)](_0x35e732))),0x0;}const _0x4847b0=_0x534131[_0x1c69d0(0x101)];let _0x7a8f52=_0x13da51;const _0x2b06ce=parsePath(_0x13da51);if(!_0x2b06ce[_0x1c69d0(0x112)]){if(!_0x4847b0)return console[_0x1c69d0(0xf4)](a38_0x4ed56a[_0x1c69d0(0x11f)](_0x1c69d0(0xea))),console[_0x1c69d0(0xf4)](a38_0x4ed56a[_0x1c69d0(0xeb)](_0x1c69d0(0x104))),0x1;if(_0x13da51==='..'){const _0x3ab331=_0x4847b0[_0x1c69d0(0x118)]('/')[_0x1c69d0(0x122)](0x0,-0x1)['join']('/');_0x7a8f52=_0x3ab331||'/';}else _0x13da51==='.'?_0x7a8f52=_0x4847b0:_0x7a8f52=_0x4847b0+'/'+_0x13da51;_0x534131[_0x1c69d0(0xed)]&&console[_0x1c69d0(0xf4)](_0x1c69d0(0x10d)+_0x7a8f52);}if(_0x7a8f52==='/'||_0x7a8f52==='')return saveSessionContext({'segment_path':undefined},_0x4997c4),console['log'](a38_0x4ed56a[_0x1c69d0(0xfa)](_0x1c69d0(0xf7))),0x0;_0x7a8f52=normalizePath(_0x7a8f52);const _0x5e0b6d=parsePath(_0x7a8f52)[_0x1c69d0(0x11b)];if(_0x5e0b6d[_0x1c69d0(0x119)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4997c4),console['log'](a38_0x4ed56a[_0x1c69d0(0xfa)](_0x1c69d0(0xf7))),0x0;_0x534131[_0x1c69d0(0xed)]&&(console['error'](_0x1c69d0(0x10b)+_0x534131['site']),console['error'](_0x1c69d0(0x121)+_0x7a8f52));const _0x313251=await withSpinner(_0x1c69d0(0x105)+_0x7a8f52+_0x1c69d0(0x106),()=>_0x4b015d[_0x1c69d0(0x103)][_0x1c69d0(0x100)](_0x7a8f52),{'verbose':_0x534131[_0x1c69d0(0xed)]}),_0x43c150=_0x313251[_0x1c69d0(0xf9)];_0x534131[_0x1c69d0(0xed)]&&(console['error'](_0x1c69d0(0xf5)+_0x43c150[_0x1c69d0(0x11a)]),console['error'](_0x1c69d0(0xff)+_0x43c150[_0x1c69d0(0xf6)]),_0x43c150[_0x1c69d0(0x11d)]&&console[_0x1c69d0(0xf4)](_0x1c69d0(0xf0)+_0x43c150['folderId']));if(_0x43c150[_0x1c69d0(0x11a)]===_0x1c69d0(0x103))return console[_0x1c69d0(0xf4)](a38_0x4ed56a[_0x1c69d0(0x11f)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x1c69d0(0xf4)](_0x1c69d0(0x110)),console['error'](a38_0x4ed56a[_0x1c69d0(0xeb)](_0x1c69d0(0x107)+_0x43c150[_0x1c69d0(0xec)]+(_0x43c150['folderPath']?'/'+_0x43c150['folderPath']['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x43c150[_0x1c69d0(0xf2)],'parent_segment':_0x43c150['parentName']},_0x4997c4),console[_0x1c69d0(0x10c)](a38_0x4ed56a[_0x1c69d0(0xfa)](_0x1c69d0(0x10e)+a38_0x4ed56a[_0x1c69d0(0xeb)](_0x43c150[_0x1c69d0(0xf2)]))),_0x534131[_0x1c69d0(0xed)]&&(console['error'](a38_0x4ed56a[_0x1c69d0(0x125)](_0x1c69d0(0x10f))),console[_0x1c69d0(0xf4)](a38_0x4ed56a[_0x1c69d0(0x125)](_0x1c69d0(0x11e)))),0x0;}catch(_0x3a7221){throw _0x3a7221;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x122608=a39_0x2dd4;(function(_0x3c9cac,_0x395823){const _0x49c887=a39_0x2dd4,_0x1a83a2=_0x3c9cac();while(!![]){try{const _0x45d8d5=-parseInt(_0x49c887(0xdc))/0x1+-parseInt(_0x49c887(0x117))/0x2*(parseInt(_0x49c887(0xe0))/0x3)+-parseInt(_0x49c887(0xd6))/0x4+-parseInt(_0x49c887(0xe7))/0x5+parseInt(_0x49c887(0x10c))/0x6+parseInt(_0x49c887(0xfe))/0x7*(parseInt(_0x49c887(0x100))/0x8)+parseInt(_0x49c887(0xfa))/0x9;if(_0x45d8d5===_0x395823)break;else _0x1a83a2['push'](_0x1a83a2['shift']());}catch(_0x53c837){_0x1a83a2['push'](_0x1a83a2['shift']());}}}(a39_0x148a,0xc3ffa));import{BaseCommand}from'./command.js';function a39_0x2dd4(_0x580424,_0x502631){_0x580424=_0x580424-0xd1;const _0x148a20=a39_0x148a();let _0x2dd4f3=_0x148a20[_0x580424];return _0x2dd4f3;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a39_0x148a(){const _0x4e566f=['resolvePathToResource','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','5914620nqmdAG','maxDepth','parentId','length','site','Resolving\x20parent\x20segment\x20\x27','filter','recursive','listUnified','localeCompare','\x20\x20Cause:\x20','folder','segment','dim','web','json','Folder\x20ID:\x20','\x20top-level\x20items','\x20folder','7853841zPgich','replace',',\x20and\x20','/app/ps/','35ausIUM','log','1881512qaNNVZ','Building\x20hierarchy\x20tree...','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','all','test','message','Listing\x20folders,\x20segments,\x20and\x20journeys...','Folder/pattern\x20arg:\x20','format','cause','journey','\x27...','5561922UVoQZz',']\x20matching\x20\x27','sort','\x20matching\x20\x27','\x20segment','jsonl','✔\x20Built\x20tree\x20with\x20','verbose','Site:\x20','List\x20folders\x20and\x20child\x20segments','Parent\x20ID:\x20','10224UIeAOx','includes','listWithPattern','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','data','✔\x20Found\x20','/e/','map','451124zemcaU','journeyBundleName','Set\x20a\x20parent\x20segment\x20context\x20first:','listRecursive','parentSegment','\x20journey','739042UfeQKy','/j/da','execute','folderId','81qgpiSX','name','error','(empty)','listJourneysFromParentSegment'];a39_0x148a=function(){return _0x4e566f;};return a39_0x148a();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{getConsoleNextUrl}from'../types/endpoints.js';import a39_0x8f6ede from'chalk';export class SegmentsCommand extends BaseCommand{[a39_0x122608(0xe1)]='segments';['description']=a39_0x122608(0x115);async[a39_0x122608(0xde)](_0x415092){const _0x2c7962=a39_0x122608,{options:_0x2cca66,args:_0x40d5f9}=_0x415092,_0x578456=_0x2cca66[_0x2c7962(0xee)],_0x23adb7=_0x40d5f9[0x0];try{const _0x4302c6=_0x2cca66[_0x2c7962(0xda)];_0x2cca66[_0x2c7962(0x113)]&&(console['error'](_0x2c7962(0x114)+_0x2cca66[_0x2c7962(0xeb)]),console[_0x2c7962(0xe2)]('Parent\x20segment\x20context:\x20'+(_0x4302c6||'(not\x20set)')),_0x23adb7&&console['error'](_0x2c7962(0x107)+_0x23adb7),_0x578456&&console[_0x2c7962(0xe2)]('Recursive\x20mode:\x20enabled'));if(!_0x4302c6)return console[_0x2c7962(0xe2)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x2c7962(0xe2)](_0x2c7962(0xd8)),console['error'](_0x2c7962(0x102)),console[_0x2c7962(0xe2)](_0x2c7962(0xd1)),console[_0x2c7962(0xe2)](''),console[_0x2c7962(0xe2)](_0x2c7962(0xe6)),0x1;const _0x3a0d1b=_0x23adb7&&(_0x23adb7[_0x2c7962(0x118)]('*')||_0x23adb7[_0x2c7962(0x118)]('?'));if(_0x3a0d1b)return await this[_0x2c7962(0x119)](_0x415092,_0x4302c6,_0x23adb7);const _0x115643=_0x23adb7?_0x4302c6+'/'+_0x23adb7:_0x4302c6;return _0x578456?await this[_0x2c7962(0xd9)](_0x415092,_0x115643):await this['listUnified'](_0x415092,_0x115643);}catch(_0x2dbb57){if(_0x2dbb57 instanceof SDKError)return console['error']('Error:\x20'+_0x2dbb57[_0x2c7962(0x105)]),_0x2dbb57[_0x2c7962(0x109)]&&console['error'](_0x2c7962(0xf1)+_0x2dbb57['cause']),0x1;throw _0x2dbb57;}}async['listWithPattern'](_0x5f47f4,_0x2ae930,_0x3df12b){const _0x51ca17=a39_0x122608,{options:_0x46c55f,tdx:_0x4a5d93}=_0x5f47f4,_0xb84b90=_0x46c55f['web'],_0x44aa3f=await withSpinner(_0x51ca17(0xec)+_0x2ae930+_0x51ca17(0x10b),()=>_0x4a5d93[_0x51ca17(0xf3)]['resolvePathToResource'](_0x2ae930),{'verbose':_0x46c55f[_0x51ca17(0x113)]}),_0x368935=_0x44aa3f[_0x51ca17(0xd2)],_0x1e61b7=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>Promise[_0x51ca17(0x103)]([_0x4a5d93[_0x51ca17(0xf3)][_0x51ca17(0xef)](_0x368935[_0x51ca17(0xe9)],_0x368935[_0x51ca17(0xdf)]),_0x4a5d93['journey'][_0x51ca17(0xe4)](_0x368935[_0x51ca17(0xe9)])]),{'verbose':_0x46c55f[_0x51ca17(0x113)]}),[_0x2c4132,_0x5e93bb]=_0x1e61b7[_0x51ca17(0xd2)],{folders:_0x1fe135,segments:_0x590c84}=_0x2c4132,_0x752438=_0x3df12b[_0x51ca17(0xfb)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x51ca17(0xfb)](/\*/g,'.*')[_0x51ca17(0xfb)](/\?/g,'.'),_0x46c144=new RegExp('^'+_0x752438+'$','i'),_0x4a61ae=_0x1fe135[_0x51ca17(0xed)](_0x58b74f=>_0x46c144[_0x51ca17(0x104)](_0x58b74f['name'])),_0x334b34=_0x590c84[_0x51ca17(0xed)](_0x2a545f=>_0x46c144[_0x51ca17(0x104)](_0x2a545f[_0x51ca17(0xe1)])),_0x3e9736=_0x5e93bb['filter'](_0x2c2415=>_0x46c144['test'](_0x2c2415[_0x51ca17(0xd7)])),_0x5bc9d3=_0x4a61ae['length']+_0x334b34[_0x51ca17(0xea)]+_0x3e9736[_0x51ca17(0xea)];console[_0x51ca17(0xe2)](_0x51ca17(0xd3)+_0x4a61ae[_0x51ca17(0xea)]+'\x20folder'+(_0x4a61ae[_0x51ca17(0xea)]!==0x1?'s':'')+',\x20'+_0x334b34[_0x51ca17(0xea)]+_0x51ca17(0x110)+(_0x334b34[_0x51ca17(0xea)]!==0x1?'s':'')+_0x51ca17(0xfc)+_0x3e9736[_0x51ca17(0xea)]+_0x51ca17(0xdb)+(_0x3e9736[_0x51ca17(0xea)]!==0x1?'s':'')+_0x51ca17(0x10f)+_0x3df12b+'\x27');const _0x971eb5=_0x3fd320=>{const _0xcde3b0=_0x51ca17;return getConsoleNextUrl(_0x46c55f[_0xcde3b0(0xeb)],_0xcde3b0(0xfd)+_0x368935['parentId']+'/e/'+_0x3fd320);},_0x3813e8=_0x46c55f[_0x51ca17(0x108)]===_0x51ca17(0xf6)||_0x46c55f[_0x51ca17(0x108)]===_0x51ca17(0x111);if(_0x3813e8){const _0x2a61a6=[..._0x4a61ae['map'](_0x125f0d=>({..._0x125f0d,'type':_0x51ca17(0xf2)})),..._0x334b34[_0x51ca17(0xd5)](_0x191d04=>({..._0x191d04,'type':_0x51ca17(0xf3),'url':_0x971eb5(_0x191d04['id'])})),..._0x3e9736[_0x51ca17(0xd5)](_0xdfed8c=>({..._0xdfed8c,'name':_0xdfed8c[_0x51ca17(0xd7)],'type':_0x51ca17(0x10a)}))][_0x51ca17(0x10e)]((_0x357331,_0xfab7d5)=>_0x357331['name'][_0x51ca17(0xf0)](_0xfab7d5[_0x51ca17(0xe1)]));await handleSDKOutput(_0x2a61a6,_0x46c55f);}else{if(_0x5bc9d3===0x0)console[_0x51ca17(0xff)]('No\x20items\x20match\x20pattern:\x20'+_0x3df12b);else{console[_0x51ca17(0xff)](a39_0x8f6ede[_0x51ca17(0xf4)]('['+_0x2ae930+_0x51ca17(0x10d)+_0x3df12b+'\x27'));const _0x59d0d6=formatFlatList(_0x4a61ae,_0x334b34,{'showMetadata':!![],'showUrl':_0xb84b90,'getSegmentUrl':_0x971eb5},_0x3e9736);console[_0x51ca17(0xff)](_0x59d0d6);}}return 0x0;}async[a39_0x122608(0xef)](_0x1da94e,_0x23314a){const _0x1d1a71=a39_0x122608,{options:_0x587f7e,tdx:_0x1e5629}=_0x1da94e,_0x5424e8=_0x587f7e[_0x1d1a71(0xf5)],_0x1159f1=await withSpinner('Resolving\x20path\x20\x27'+_0x23314a+_0x1d1a71(0x10b),()=>_0x1e5629[_0x1d1a71(0xf3)][_0x1d1a71(0xe5)](_0x23314a),{'verbose':_0x587f7e[_0x1d1a71(0x113)]}),_0x4ebc82=_0x1159f1[_0x1d1a71(0xd2)];_0x587f7e[_0x1d1a71(0x113)]&&(console['error']('Parent\x20ID:\x20'+_0x4ebc82[_0x1d1a71(0xe9)]),_0x4ebc82[_0x1d1a71(0xdf)]&&console[_0x1d1a71(0xe2)](_0x1d1a71(0xf7)+_0x4ebc82[_0x1d1a71(0xdf)]));const _0x4dec7f=await withSpinner(_0x1d1a71(0x106),()=>Promise['all']([_0x1e5629[_0x1d1a71(0xf3)]['listUnified'](_0x4ebc82['parentId'],_0x4ebc82[_0x1d1a71(0xdf)]),_0x1e5629[_0x1d1a71(0x10a)][_0x1d1a71(0xe4)](_0x4ebc82[_0x1d1a71(0xe9)])]),{'verbose':_0x587f7e[_0x1d1a71(0x113)]}),[_0x1f8b78,_0x22af8d]=_0x4dec7f[_0x1d1a71(0xd2)],{folders:_0x37a980,segments:_0x2f0641}=_0x1f8b78,_0x11309d=_0x37a980['length']+_0x2f0641['length']+_0x22af8d[_0x1d1a71(0xea)];console[_0x1d1a71(0xe2)](_0x1d1a71(0xd3)+_0x37a980[_0x1d1a71(0xea)]+_0x1d1a71(0xf9)+(_0x37a980['length']!==0x1?'s':'')+',\x20'+_0x2f0641[_0x1d1a71(0xea)]+'\x20segment'+(_0x2f0641['length']!==0x1?'s':'')+_0x1d1a71(0xfc)+_0x22af8d[_0x1d1a71(0xea)]+_0x1d1a71(0xdb)+(_0x22af8d[_0x1d1a71(0xea)]!==0x1?'s':''));const _0x16f69e=_0x474a9d=>{const _0x301381=_0x1d1a71;return getConsoleNextUrl(_0x587f7e[_0x301381(0xeb)],_0x301381(0xfd)+_0x4ebc82[_0x301381(0xe9)]+_0x301381(0xd4)+_0x474a9d);},_0x101141=_0x547a7b=>{const _0x351b10=_0x1d1a71;return getConsoleNextUrl(_0x587f7e[_0x351b10(0xeb)],_0x351b10(0xfd)+_0x4ebc82[_0x351b10(0xe9)]+_0x351b10(0xd4)+_0x547a7b+_0x351b10(0xdd));},_0x1d55dc=_0x587f7e[_0x1d1a71(0x108)]===_0x1d1a71(0xf6)||_0x587f7e['format']===_0x1d1a71(0x111);if(_0x1d55dc){const _0xc15a4f=[..._0x37a980[_0x1d1a71(0xd5)](_0x47bc5a=>({..._0x47bc5a,'type':'folder'})),..._0x2f0641[_0x1d1a71(0xd5)](_0x4e71ba=>({..._0x4e71ba,'type':'segment','url':_0x16f69e(_0x4e71ba['id'])})),..._0x22af8d[_0x1d1a71(0xd5)](_0xc0198c=>({..._0xc0198c,'name':_0xc0198c['journeyBundleName'],'type':_0x1d1a71(0x10a),'url':_0x101141(_0xc0198c['id'])}))]['sort']((_0x50f404,_0x14adb8)=>_0x50f404['name'][_0x1d1a71(0xf0)](_0x14adb8['name']));await handleSDKOutput(_0xc15a4f,_0x587f7e);}else{if(_0x11309d===0x0)console[_0x1d1a71(0xff)](a39_0x8f6ede[_0x1d1a71(0xf4)]('['+_0x23314a+']')),console[_0x1d1a71(0xff)](_0x1d1a71(0xe3));else{console[_0x1d1a71(0xff)](a39_0x8f6ede[_0x1d1a71(0xf4)]('['+_0x23314a+']'));const _0x38c243=formatFlatList(_0x37a980,_0x2f0641,{'showMetadata':!![],'showUrl':_0x5424e8,'getSegmentUrl':_0x16f69e,'getJourneyUrl':_0x101141},_0x22af8d);console['log'](_0x38c243);}}return 0x0;}async['listRecursive'](_0x4f6695,_0x561569){const _0x58f483=a39_0x122608,{options:_0x1930f7,tdx:_0x48351d}=_0x4f6695,_0x275b4c=_0x1930f7[_0x58f483(0xf5)],_0x1e0cd1=await withSpinner('Resolving\x20path\x20\x27'+_0x561569+'\x27...',()=>_0x48351d[_0x58f483(0xf3)][_0x58f483(0xe5)](_0x561569),{'verbose':_0x1930f7[_0x58f483(0x113)]}),_0x1f31f2=_0x1e0cd1['data'];_0x1930f7['verbose']&&(console[_0x58f483(0xe2)](_0x58f483(0x116)+_0x1f31f2[_0x58f483(0xe9)]),_0x1f31f2[_0x58f483(0xdf)]&&console['error'](_0x58f483(0xf7)+_0x1f31f2[_0x58f483(0xdf)]));const _0x41042f=_0x1930f7[_0x58f483(0xe8)]||0xa,_0x338222=await withSpinner(_0x58f483(0x101),()=>_0x48351d[_0x58f483(0xf3)]['listRecursive'](_0x1f31f2[_0x58f483(0xe9)],_0x1f31f2[_0x58f483(0xdf)],0x0,_0x41042f),{'verbose':_0x1930f7[_0x58f483(0x113)]}),_0x6f1c5=_0x338222[_0x58f483(0xd2)];console[_0x58f483(0xe2)](_0x58f483(0x112)+_0x6f1c5['length']+_0x58f483(0xf8));const _0x2b4472=_0x4946d2=>{const _0x3cabb5=_0x58f483;return getConsoleNextUrl(_0x1930f7['site'],_0x3cabb5(0xfd)+_0x1f31f2[_0x3cabb5(0xe9)]+'/e/'+_0x4946d2);};if(_0x1930f7['format']==='json'||_0x1930f7['format']===_0x58f483(0x111))await handleSDKOutput(_0x6f1c5,_0x1930f7);else{console[_0x58f483(0xff)](a39_0x8f6ede[_0x58f483(0xf4)]('['+_0x561569+']'));const _0x2b1e89=formatTree(_0x6f1c5,{'showMetadata':!![],'showUrl':_0x275b4c,'getSegmentUrl':_0x2b4472});console[_0x58f483(0xff)](_0x2b1e89);}return 0x0;}}
|
|
1
|
+
const a39_0x697b5a=a39_0x44fc;(function(_0x2ea0ea,_0x378ffa){const _0xd5da7e=a39_0x44fc,_0x19591f=_0x2ea0ea();while(!![]){try{const _0x91c5e5=-parseInt(_0xd5da7e(0x152))/0x1*(-parseInt(_0xd5da7e(0x18e))/0x2)+-parseInt(_0xd5da7e(0x16d))/0x3+-parseInt(_0xd5da7e(0x163))/0x4+parseInt(_0xd5da7e(0x16f))/0x5+-parseInt(_0xd5da7e(0x194))/0x6+parseInt(_0xd5da7e(0x184))/0x7*(parseInt(_0xd5da7e(0x16a))/0x8)+-parseInt(_0xd5da7e(0x180))/0x9*(parseInt(_0xd5da7e(0x157))/0xa);if(_0x91c5e5===_0x378ffa)break;else _0x19591f['push'](_0x19591f['shift']());}catch(_0x2935ff){_0x19591f['push'](_0x19591f['shift']());}}}(a39_0x532f,0x916f3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a39_0x44fc(_0x1b5f95,_0x24753b){_0x1b5f95=_0x1b5f95-0x151;const _0x532f11=a39_0x532f();let _0x44fc6d=_0x532f11[_0x1b5f95];return _0x44fc6d;}import{getConsoleNextUrl}from'../types/endpoints.js';function a39_0x532f(){const _0x40b4eb=['log','8WSNJlh','/j/da','listUnified','2630955GdgFXq','resolvePathToResource','1759070eueZAP','includes','all','name','Folder\x20ID:\x20','dim','site','Resolving\x20parent\x20segment\x20\x27','journeyBundleName','listWithPattern','No\x20items\x20match\x20pattern:\x20','\x20folder','Listing\x20folders,\x20segments,\x20and\x20journeys...','message','parentId','(not\x20set)','map','7452981kSABXD','Site:\x20','/app/ps/','sort','7859285cdWdnM','(empty)','cause','Error:\x20','\x27...','format','Resolving\x20path\x20\x27','Folder/pattern\x20arg:\x20','List\x20folders\x20and\x20child\x20segments','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','65214TRyCqZ','filter','\x20top-level\x20items','\x20journey','verbose','folder','728208lDClJX','segments','\x20segment','\x5c$&','length','test','journey','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','replace','33EDtbLm','jsonl','data','\x20matching\x20\x27','Parent\x20ID:\x20','10TmaAnt','json','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId',',\x20and\x20','segment','Building\x20hierarchy\x20tree...','listRecursive','listJourneysFromParentSegment',']\x20matching\x20\x27','maxDepth','error','513756ZNgDYi','recursive','execute','✔\x20Found\x20','web','/e/'];a39_0x532f=function(){return _0x40b4eb;};return a39_0x532f();}import a39_0x1bde1d from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a39_0x697b5a(0x195);['description']=a39_0x697b5a(0x18c);async[a39_0x697b5a(0x165)](_0xa5475c){const _0x1834dc=a39_0x697b5a,{options:_0x1992fd,args:_0x57780e}=_0xa5475c,_0x2f2fc9=_0x1992fd[_0x1834dc(0x164)],_0x1b0a34=_0x57780e[0x0];try{const _0x15e622=_0x1992fd['parentSegment'];_0x1992fd['verbose']&&(console['error'](_0x1834dc(0x181)+_0x1992fd['site']),console['error']('Parent\x20segment\x20context:\x20'+(_0x15e622||_0x1834dc(0x17e))),_0x1b0a34&&console[_0x1834dc(0x162)](_0x1834dc(0x18b)+_0x1b0a34),_0x2f2fc9&&console['error']('Recursive\x20mode:\x20enabled'));if(!_0x15e622)return console[_0x1834dc(0x162)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x1834dc(0x162)](_0x1834dc(0x159)),console[_0x1834dc(0x162)](_0x1834dc(0x19b)),console[_0x1834dc(0x162)](_0x1834dc(0x18d)),console['error'](''),console[_0x1834dc(0x162)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x33b7f3=_0x1b0a34&&(_0x1b0a34[_0x1834dc(0x170)]('*')||_0x1b0a34[_0x1834dc(0x170)]('?'));if(_0x33b7f3)return await this['listWithPattern'](_0xa5475c,_0x15e622,_0x1b0a34);const _0x2535af=_0x1b0a34?_0x15e622+'/'+_0x1b0a34:_0x15e622;return _0x2f2fc9?await this[_0x1834dc(0x15e)](_0xa5475c,_0x2535af):await this[_0x1834dc(0x16c)](_0xa5475c,_0x2535af);}catch(_0x5029b9){if(_0x5029b9 instanceof SDKError)return console['error'](_0x1834dc(0x187)+_0x5029b9[_0x1834dc(0x17c)]),_0x5029b9['cause']&&console[_0x1834dc(0x162)]('\x20\x20Cause:\x20'+_0x5029b9[_0x1834dc(0x186)]),0x1;throw _0x5029b9;}}async[a39_0x697b5a(0x178)](_0x1ce700,_0xe91400,_0x5259fa){const _0x4001e0=a39_0x697b5a,{options:_0x5a6e42,tdx:_0x4f5fb9}=_0x1ce700,_0x1916bc=_0x5a6e42[_0x4001e0(0x167)],_0x4c8fa9=await withSpinner(_0x4001e0(0x176)+_0xe91400+'\x27...',()=>_0x4f5fb9['segment'][_0x4001e0(0x16e)](_0xe91400),{'verbose':_0x5a6e42[_0x4001e0(0x192)]}),_0x3d164c=_0x4c8fa9[_0x4001e0(0x154)],_0x5458c6=await withSpinner(_0x4001e0(0x17b),()=>Promise[_0x4001e0(0x171)]([_0x4f5fb9[_0x4001e0(0x15c)][_0x4001e0(0x16c)](_0x3d164c[_0x4001e0(0x17d)],_0x3d164c[_0x4001e0(0x15a)]),_0x4f5fb9['journey'][_0x4001e0(0x15f)](_0x3d164c[_0x4001e0(0x17d)])]),{'verbose':_0x5a6e42[_0x4001e0(0x192)]}),[_0x1e0730,_0x6166f6]=_0x5458c6[_0x4001e0(0x154)],{folders:_0x3f01f2,segments:_0x23e937}=_0x1e0730,_0x237878=_0x5259fa[_0x4001e0(0x151)](/[.+^${}()|[\]\\]/g,_0x4001e0(0x197))[_0x4001e0(0x151)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x2aaaa5=new RegExp('^'+_0x237878+'$','i'),_0x10bfee=_0x3f01f2[_0x4001e0(0x18f)](_0x545b3b=>_0x2aaaa5[_0x4001e0(0x199)](_0x545b3b['name'])),_0x2a3d4d=_0x23e937[_0x4001e0(0x18f)](_0x36d29a=>_0x2aaaa5[_0x4001e0(0x199)](_0x36d29a[_0x4001e0(0x172)])),_0x5d0421=_0x6166f6[_0x4001e0(0x18f)](_0x5c3419=>_0x2aaaa5['test'](_0x5c3419['journeyBundleName'])),_0x296de0=_0x10bfee[_0x4001e0(0x198)]+_0x2a3d4d[_0x4001e0(0x198)]+_0x5d0421[_0x4001e0(0x198)];console[_0x4001e0(0x162)](_0x4001e0(0x166)+_0x10bfee['length']+_0x4001e0(0x17a)+(_0x10bfee[_0x4001e0(0x198)]!==0x1?'s':'')+',\x20'+_0x2a3d4d[_0x4001e0(0x198)]+'\x20segment'+(_0x2a3d4d[_0x4001e0(0x198)]!==0x1?'s':'')+_0x4001e0(0x15b)+_0x5d0421[_0x4001e0(0x198)]+_0x4001e0(0x191)+(_0x5d0421[_0x4001e0(0x198)]!==0x1?'s':'')+_0x4001e0(0x155)+_0x5259fa+'\x27');const _0x27293e=_0x166ead=>{const _0x528c3e=_0x4001e0;return getConsoleNextUrl(_0x5a6e42['site'],_0x528c3e(0x182)+_0x3d164c['parentId']+_0x528c3e(0x168)+_0x166ead);},_0x12108b=_0x5a6e42[_0x4001e0(0x189)]===_0x4001e0(0x158)||_0x5a6e42[_0x4001e0(0x189)]===_0x4001e0(0x153);if(_0x12108b){const _0x48a013=[..._0x10bfee[_0x4001e0(0x17f)](_0x481d3f=>({..._0x481d3f,'type':_0x4001e0(0x193)})),..._0x2a3d4d[_0x4001e0(0x17f)](_0x42d664=>({..._0x42d664,'type':_0x4001e0(0x15c),'url':_0x27293e(_0x42d664['id'])})),..._0x5d0421['map'](_0x448859=>({..._0x448859,'name':_0x448859[_0x4001e0(0x177)],'type':_0x4001e0(0x19a)}))][_0x4001e0(0x183)]((_0x5e518c,_0x4e5c3f)=>_0x5e518c['name']['localeCompare'](_0x4e5c3f['name']));await handleSDKOutput(_0x48a013,_0x5a6e42);}else{if(_0x296de0===0x0)console[_0x4001e0(0x169)](_0x4001e0(0x179)+_0x5259fa);else{console[_0x4001e0(0x169)](a39_0x1bde1d['dim']('['+_0xe91400+_0x4001e0(0x160)+_0x5259fa+'\x27'));const _0x593691=formatFlatList(_0x10bfee,_0x2a3d4d,{'showMetadata':!![],'showUrl':_0x1916bc,'getSegmentUrl':_0x27293e},_0x5d0421);console['log'](_0x593691);}}return 0x0;}async[a39_0x697b5a(0x16c)](_0x5d7ea3,_0x23b020){const _0xe21f83=a39_0x697b5a,{options:_0x66cc3c,tdx:_0x13f0ba}=_0x5d7ea3,_0x4f40ae=_0x66cc3c['web'],_0x56ffcd=await withSpinner(_0xe21f83(0x18a)+_0x23b020+_0xe21f83(0x188),()=>_0x13f0ba['segment'][_0xe21f83(0x16e)](_0x23b020),{'verbose':_0x66cc3c[_0xe21f83(0x192)]}),_0x2a4295=_0x56ffcd['data'];_0x66cc3c[_0xe21f83(0x192)]&&(console[_0xe21f83(0x162)](_0xe21f83(0x156)+_0x2a4295[_0xe21f83(0x17d)]),_0x2a4295[_0xe21f83(0x15a)]&&console[_0xe21f83(0x162)](_0xe21f83(0x173)+_0x2a4295['folderId']));const _0x5c139a=await withSpinner(_0xe21f83(0x17b),()=>Promise[_0xe21f83(0x171)]([_0x13f0ba[_0xe21f83(0x15c)]['listUnified'](_0x2a4295['parentId'],_0x2a4295[_0xe21f83(0x15a)]),_0x13f0ba[_0xe21f83(0x19a)][_0xe21f83(0x15f)](_0x2a4295[_0xe21f83(0x17d)])]),{'verbose':_0x66cc3c[_0xe21f83(0x192)]}),[_0x9c14d9,_0x19f538]=_0x5c139a[_0xe21f83(0x154)],{folders:_0x29c6fb,segments:_0x10a535}=_0x9c14d9,_0x17d84d=_0x29c6fb[_0xe21f83(0x198)]+_0x10a535[_0xe21f83(0x198)]+_0x19f538[_0xe21f83(0x198)];console[_0xe21f83(0x162)](_0xe21f83(0x166)+_0x29c6fb[_0xe21f83(0x198)]+_0xe21f83(0x17a)+(_0x29c6fb['length']!==0x1?'s':'')+',\x20'+_0x10a535[_0xe21f83(0x198)]+_0xe21f83(0x196)+(_0x10a535['length']!==0x1?'s':'')+_0xe21f83(0x15b)+_0x19f538[_0xe21f83(0x198)]+_0xe21f83(0x191)+(_0x19f538['length']!==0x1?'s':''));const _0x4318c9=_0x335f02=>{const _0x5ed7c5=_0xe21f83;return getConsoleNextUrl(_0x66cc3c[_0x5ed7c5(0x175)],_0x5ed7c5(0x182)+_0x2a4295[_0x5ed7c5(0x17d)]+_0x5ed7c5(0x168)+_0x335f02);},_0x29faf7=_0x43dea6=>{const _0x384d1b=_0xe21f83;return getConsoleNextUrl(_0x66cc3c[_0x384d1b(0x175)],'/app/ps/'+_0x2a4295[_0x384d1b(0x17d)]+'/e/'+_0x43dea6+_0x384d1b(0x16b));},_0x181466=_0x66cc3c['format']==='json'||_0x66cc3c[_0xe21f83(0x189)]===_0xe21f83(0x153);if(_0x181466){const _0x1d9949=[..._0x29c6fb['map'](_0x286d2f=>({..._0x286d2f,'type':_0xe21f83(0x193)})),..._0x10a535['map'](_0x5af922=>({..._0x5af922,'type':'segment','url':_0x4318c9(_0x5af922['id'])})),..._0x19f538[_0xe21f83(0x17f)](_0x303390=>({..._0x303390,'name':_0x303390[_0xe21f83(0x177)],'type':'journey','url':_0x29faf7(_0x303390['id'])}))]['sort']((_0x2a886f,_0x362a6b)=>_0x2a886f[_0xe21f83(0x172)]['localeCompare'](_0x362a6b['name']));await handleSDKOutput(_0x1d9949,_0x66cc3c);}else{if(_0x17d84d===0x0)console[_0xe21f83(0x169)](a39_0x1bde1d[_0xe21f83(0x174)]('['+_0x23b020+']')),console[_0xe21f83(0x169)](_0xe21f83(0x185));else{console[_0xe21f83(0x169)](a39_0x1bde1d[_0xe21f83(0x174)]('['+_0x23b020+']'));const _0x14d8ad=formatFlatList(_0x29c6fb,_0x10a535,{'showMetadata':!![],'showUrl':_0x4f40ae,'getSegmentUrl':_0x4318c9,'getJourneyUrl':_0x29faf7},_0x19f538);console[_0xe21f83(0x169)](_0x14d8ad);}}return 0x0;}async['listRecursive'](_0x5d7d18,_0xd5cd61){const _0x2a3f3d=a39_0x697b5a,{options:_0x58264d,tdx:_0x29cae5}=_0x5d7d18,_0x2da9c8=_0x58264d[_0x2a3f3d(0x167)],_0x4b9b64=await withSpinner(_0x2a3f3d(0x18a)+_0xd5cd61+'\x27...',()=>_0x29cae5[_0x2a3f3d(0x15c)][_0x2a3f3d(0x16e)](_0xd5cd61),{'verbose':_0x58264d[_0x2a3f3d(0x192)]}),_0x3e00e4=_0x4b9b64[_0x2a3f3d(0x154)];_0x58264d[_0x2a3f3d(0x192)]&&(console[_0x2a3f3d(0x162)](_0x2a3f3d(0x156)+_0x3e00e4[_0x2a3f3d(0x17d)]),_0x3e00e4[_0x2a3f3d(0x15a)]&&console['error']('Folder\x20ID:\x20'+_0x3e00e4[_0x2a3f3d(0x15a)]));const _0xa9cd42=_0x58264d[_0x2a3f3d(0x161)]||0xa,_0x18b113=await withSpinner(_0x2a3f3d(0x15d),()=>_0x29cae5['segment']['listRecursive'](_0x3e00e4['parentId'],_0x3e00e4[_0x2a3f3d(0x15a)],0x0,_0xa9cd42),{'verbose':_0x58264d[_0x2a3f3d(0x192)]}),_0x22ddb0=_0x18b113[_0x2a3f3d(0x154)];console[_0x2a3f3d(0x162)]('✔\x20Built\x20tree\x20with\x20'+_0x22ddb0['length']+_0x2a3f3d(0x190));const _0x39cc82=_0x4e09a6=>{const _0xa212c7=_0x2a3f3d;return getConsoleNextUrl(_0x58264d['site'],'/app/ps/'+_0x3e00e4['parentId']+_0xa212c7(0x168)+_0x4e09a6);};if(_0x58264d[_0x2a3f3d(0x189)]===_0x2a3f3d(0x158)||_0x58264d[_0x2a3f3d(0x189)]===_0x2a3f3d(0x153))await handleSDKOutput(_0x22ddb0,_0x58264d);else{console['log'](a39_0x1bde1d['dim']('['+_0xd5cd61+']'));const _0xe774df=formatTree(_0x22ddb0,{'showMetadata':!![],'showUrl':_0x2da9c8,'getSegmentUrl':_0x39cc82});console['log'](_0xe774df);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a40_0x51286c=a40_0x1f1a;function a40_0x1f1a(_0x58d3ec,_0x183dda){_0x58d3ec=_0x58d3ec-0xc4;const _0x52b18e=a40_0x52b1();let _0x1f1a74=_0x52b18e[_0x58d3ec];return _0x1f1a74;}(function(_0x3c524d,_0x3bbc23){const _0x515a3e=a40_0x1f1a,_0x4f9e5a=_0x3c524d();while(!![]){try{const _0x1d7f40=parseInt(_0x515a3e(0xc6))/0x1*(parseInt(_0x515a3e(0xc9))/0x2)+-parseInt(_0x515a3e(0xda))/0x3+parseInt(_0x515a3e(0xd8))/0x4*(parseInt(_0x515a3e(0xe2))/0x5)+-parseInt(_0x515a3e(0xdc))/0x6+-parseInt(_0x515a3e(0xc4))/0x7+parseInt(_0x515a3e(0xcf))/0x8+parseInt(_0x515a3e(0xcc))/0x9;if(_0x1d7f40===_0x3bbc23)break;else _0x4f9e5a['push'](_0x4f9e5a['shift']());}catch(_0x4287dc){_0x4f9e5a['push'](_0x4f9e5a['shift']());}}}(a40_0x52b1,0x6c301));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a40_0x52b1(){const _0x3453dc=['query','error','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','2388610kWZeoG','validate','642927HUQBNd','table','showTable','2qmAKAK','Catalog:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','1535634QqUXly','database','...','6545880WZBgUI','catalog','message','verbose','args','cause','length','Site:\x20','\x20row','4TmyJqh','Database:\x20','2183760vViOpg','Table:\x20','1993938xoxbGv','data','site','Limit:\x20','Show\x20table\x20contents','Error:\x20','1064110zqMuiN','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','description','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','show'];a40_0x52b1=function(){return _0x3453dc;};return a40_0x52b1();}export class ShowCommand extends BaseCommand{['name']=a40_0x51286c(0xe6);[a40_0x51286c(0xe4)]=a40_0x51286c(0xe0);async['execute'](_0x1683f7){return this['showTable'](_0x1683f7);}async[a40_0x51286c(0xc8)](_0xd7915e){const _0x2b7180=a40_0x51286c,{options:_0x13c91b,args:_0x299001,tdx:_0x19fe2f}=_0xd7915e;let _0x4f5ea7;try{_0x4f5ea7=parseTableReference(_0x299001[0x0]);const _0x5db2e9=_0x13c91b['database'];!_0x4f5ea7[_0x2b7180(0xcd)]&&_0x5db2e9&&(_0x4f5ea7['database']=_0x5db2e9);const _0x1a504d=validateTableDescribeReference(_0x4f5ea7);if(_0x1a504d)return console['error']('Error:\x20'+_0x1a504d),console[_0x2b7180(0xe8)](_0x2b7180(0xe9)),console['error'](_0x2b7180(0xea)),console[_0x2b7180(0xe8)](_0x2b7180(0xe3)),0x1;}catch(_0x52e789){return console[_0x2b7180(0xe8)](_0x2b7180(0xe1)+_0x52e789[_0x2b7180(0xd1)]),console[_0x2b7180(0xe8)](_0x2b7180(0xe9)),console['error'](_0x2b7180(0xea)),console[_0x2b7180(0xe8)](_0x2b7180(0xe3)),0x1;}const _0x3b9cd5=_0x4f5ea7[_0x2b7180(0xd0)],_0x756f60=_0x4f5ea7[_0x2b7180(0xcd)],_0x45a547=_0x4f5ea7[_0x2b7180(0xc7)],_0x3c5d0e=resolveLimit(_0x13c91b['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x13c91b[_0x2b7180(0xd2)]&&(console[_0x2b7180(0xe8)](_0x2b7180(0xd6)+_0x13c91b[_0x2b7180(0xde)]),_0x3b9cd5&&console[_0x2b7180(0xe8)](_0x2b7180(0xca)+_0x3b9cd5),console[_0x2b7180(0xe8)](_0x2b7180(0xd9)+_0x756f60),console[_0x2b7180(0xe8)](_0x2b7180(0xdb)+_0x45a547),console['error'](_0x2b7180(0xdf)+_0x3c5d0e));const _0x3872f9=_0x3b9cd5?_0x3b9cd5+'.'+_0x756f60+'.'+_0x45a547:_0x756f60+'.'+_0x45a547,_0x2708fd=await withSpinner('Querying\x20'+_0x3872f9+_0x2b7180(0xce),()=>_0x19fe2f[_0x2b7180(0xe7)][_0x2b7180(0xc8)](_0x756f60,_0x45a547,_0x3c5d0e,_0x3b9cd5),{'verbose':_0x13c91b[_0x2b7180(0xd2)]}),_0x31f78c=_0x2708fd[_0x2b7180(0xdd)],_0x47da96=_0x31f78c['data'];return _0x47da96[_0x2b7180(0xd5)]===0x0?console['error']('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console['error']('✔\x20Retrieved\x20'+_0x47da96[_0x2b7180(0xd5)]+_0x2b7180(0xd7)+(_0x47da96[_0x2b7180(0xd5)]!==0x1?'s':'')+'\x20from\x20'+_0x3872f9),await handleSDKOutput(_0x47da96,_0x13c91b),0x0;}catch(_0x1b692d){if(_0x1b692d instanceof SDKError)return console[_0x2b7180(0xe8)](_0x2b7180(0xe1)+_0x1b692d[_0x2b7180(0xd1)]),_0x1b692d[_0x2b7180(0xd4)]&&console[_0x2b7180(0xe8)]('\x20\x20Cause:\x20'+_0x1b692d['cause']),0x1;throw _0x1b692d;}}[a40_0x51286c(0xc5)](_0x2286e3){const _0x2c66bb=a40_0x51286c;if(_0x2286e3[_0x2c66bb(0xd3)][_0x2c66bb(0xd5)]===0x0)return _0x2c66bb(0xe5);if(_0x2286e3[_0x2c66bb(0xd3)]['length']>0x1)return _0x2c66bb(0xcb);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x2f74cf=a41_0x13cc;(function(_0x4489b0,_0x1c18f8){const _0x47bc7a=a41_0x13cc,_0x2a9172=_0x4489b0();while(!![]){try{const _0x34c020=parseInt(_0x47bc7a(0xa9))/0x1*(-parseInt(_0x47bc7a(0xca))/0x2)+-parseInt(_0x47bc7a(0xa1))/0x3*(parseInt(_0x47bc7a(0xa8))/0x4)+parseInt(_0x47bc7a(0xc2))/0x5+parseInt(_0x47bc7a(0xc4))/0x6+parseInt(_0x47bc7a(0xb9))/0x7*(parseInt(_0x47bc7a(0xcb))/0x8)+parseInt(_0x47bc7a(0xb4))/0x9*(-parseInt(_0x47bc7a(0xcc))/0xa)+parseInt(_0x47bc7a(0xbf))/0xb*(parseInt(_0x47bc7a(0xb8))/0xc);if(_0x34c020===_0x1c18f8)break;else _0x2a9172['push'](_0x2a9172['shift']());}catch(_0x220374){_0x2a9172['push'](_0x2a9172['shift']());}}}(a41_0x41b8,0x90cf7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a41_0x41b8(){const _0x81db84=['\x27\x20is\x20ambiguous.','Error:\x20','listTables','256751pWBoEX','execute','Database:\x20','915350lTdbox','✖\x20No\x20tables\x20found','1924002HaqGqE','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Table\x20pattern:\x20','✔\x20Found\x20','Database\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','394oHRbaE','56632zTbXhe','70ggouIA','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database\x20pattern:\x20','description','limit','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','message','table','.*\x22','15JCyLFT','validate','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','List\x20tables\x20in\x20a\x20database','name','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','647708pCEnCz','5307lItKFo','cause','length','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x27\x20across\x20all\x20databases.','data','includes','error','tables','Database:\x20all','database','732879UqRatB','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','site','verbose','816zkycEq','917EWaLIz','Or\x20use\x20--in\x20flag:','\x20table'];a41_0x41b8=function(){return _0x81db84;};return a41_0x41b8();}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a41_0x13cc(_0x3172ce,_0x1c5c9c){_0x3172ce=_0x3172ce-0x99;const _0x41b8c6=a41_0x41b8();let _0x13ccbe=_0x41b8c6[_0x3172ce];return _0x13ccbe;}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a41_0x2f74cf(0xa6)]=a41_0x2f74cf(0xb1);[a41_0x2f74cf(0x9b)]=a41_0x2f74cf(0xa5);async[a41_0x2f74cf(0xc0)](_0x33930c){const _0x504a01=a41_0x2f74cf,{options:_0x4e6647,args:_0x2a41d5,tdx:_0x29bd0b}=_0x33930c;let _0x2d6137;if(_0x2a41d5['length']===0x0)_0x2d6137={'database':undefined,'table':undefined,'original':''};else{if(_0x2a41d5['length']===0x1)try{_0x2d6137=parseTableReference(_0x2a41d5[0x0]);if(_0x2d6137[_0x504a01(0x9f)]&&!_0x2d6137[_0x504a01(0xb3)]&&!_0x2d6137[_0x504a01(0x9f)][_0x504a01(0xaf)]('*')&&!_0x2d6137[_0x504a01(0x9f)][_0x504a01(0xaf)]('?'))return console[_0x504a01(0xb0)]('Error:\x20Pattern\x20\x27'+_0x2a41d5[0x0]+_0x504a01(0xbc)),console[_0x504a01(0xb0)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x2d6137[_0x504a01(0x9f)]+'\x27?'),console[_0x504a01(0xb0)](_0x504a01(0xa4)+_0x2d6137[_0x504a01(0x9f)]+_0x504a01(0xa0)),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x2d6137[_0x504a01(0x9f)]),console[_0x504a01(0xb0)](_0x504a01(0xa3)+_0x2d6137['table']),console[_0x504a01(0xb0)](''),console[_0x504a01(0xb0)]('Note:\x20\x27'+_0x2a41d5[0x0]+_0x504a01(0xc5)+_0x2d6137['table']+_0x504a01(0xad)),0x1;}catch(_0x33ea90){return console[_0x504a01(0xb0)](_0x504a01(0xbd)+_0x33ea90[_0x504a01(0x9e)]),0x1;}else return console[_0x504a01(0xb0)](_0x504a01(0x9d)),console['error'](_0x504a01(0x99)),console[_0x504a01(0xb0)](_0x504a01(0xc9)),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x504a01(0xb0)](_0x504a01(0xb5)),console[_0x504a01(0xb0)](_0x504a01(0xba)),console[_0x504a01(0xb0)](_0x504a01(0xa7)),0x1;}const _0x20f104=_0x4e6647[_0x504a01(0xb3)];!_0x2d6137[_0x504a01(0xb3)]&&_0x20f104&&(_0x2d6137['database']=_0x20f104);try{const _0x575352=_0x1ba380=>_0x1ba380&&(_0x1ba380['includes']('*')||_0x1ba380[_0x504a01(0xaf)]('?')),_0x3183b0=_0x575352(_0x2d6137[_0x504a01(0xb3)]);_0x4e6647[_0x504a01(0xb7)]&&(console[_0x504a01(0xb0)]('Site:\x20'+_0x4e6647[_0x504a01(0xb6)]),_0x2d6137[_0x504a01(0xb3)]?_0x3183b0?console[_0x504a01(0xb0)](_0x504a01(0x9a)+_0x2d6137[_0x504a01(0xb3)]):console['error'](_0x504a01(0xc1)+_0x2d6137[_0x504a01(0xb3)]):console['error'](_0x504a01(0xb2)),_0x2d6137[_0x504a01(0x9f)]&&console['error'](_0x504a01(0xc6)+_0x2d6137[_0x504a01(0x9f)]));const _0x39575f=_0x2d6137[_0x504a01(0xb3)]&&!_0x3183b0?_0x2d6137[_0x504a01(0xb3)]:undefined,_0x2a1860=_0x3183b0?_0x2d6137[_0x504a01(0xb3)]:undefined,_0x19117b=_0x2d6137[_0x504a01(0x9f)],_0xa76d84=resolveLimit(_0x4e6647[_0x504a01(0x9c)],DEFAULT_LISTING_LIMIT),_0x2c2952=await withSpinner('Listing\x20tables...',()=>_0x29bd0b['query'][_0x504a01(0xbe)](_0x39575f,_0x19117b,_0x2a1860,_0xa76d84),{'verbose':_0x4e6647[_0x504a01(0xb7)]}),_0x2a52c8=_0x2c2952[_0x504a01(0xae)];if(_0x2a52c8[_0x504a01(0xab)]===0x0&&_0x2d6137[_0x504a01(0xb3)]&&!_0x3183b0)return console[_0x504a01(0xb0)](_0x504a01(0xc3)),console[_0x504a01(0xb0)](_0x504a01(0xc8)+_0x2d6137[_0x504a01(0xb3)]+_0x504a01(0xac)),0x1;return console['error'](_0x504a01(0xc7)+_0x2a52c8[_0x504a01(0xab)]+_0x504a01(0xbb)+(_0x2a52c8[_0x504a01(0xab)]!==0x1?'s':'')),await handleSDKOutput(_0x2a52c8,{..._0x4e6647,'limit':_0xa76d84}),0x0;}catch(_0xfecafa){if(_0xfecafa instanceof SDKError)return console[_0x504a01(0xb0)](_0x504a01(0xbd)+_0xfecafa['message']),_0xfecafa[_0x504a01(0xaa)]&&console[_0x504a01(0xb0)]('\x20\x20Cause:\x20'+_0xfecafa['cause']),0x1;throw _0xfecafa;}}[a41_0x2f74cf(0xa2)](_0x1cf1c4){return undefined;}}
|