@catladder/cli 0.0.0-next-dc12de13 → 0.0.0-next-e95e1f20
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/bundles/catenv/index.js +43 -14
- package/dist/bundles/cli/index.js +43 -14
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js +4 -14
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js.map +1 -1
- package/dist/packages/pipeline/src/backends/gitlab/releaseGateJobs.d.ts +25 -0
- package/dist/packages/pipeline/src/backends/gitlab/releaseGateJobs.js +32 -0
- package/dist/packages/pipeline/src/backends/gitlab/releaseGateJobs.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -3584,6 +3584,7 @@ const createGitlabJobs_1 = __nccwpck_require__(41509);
|
|
|
3584
3584
|
const createGitlabPipeline_1 = __nccwpck_require__(94411);
|
|
3585
3585
|
const gitlabReleaseJobs_1 = __nccwpck_require__(75512);
|
|
3586
3586
|
const getPipelineStages_1 = __nccwpck_require__(29641);
|
|
3587
|
+
const releaseGateJobs_1 = __nccwpck_require__(80634);
|
|
3587
3588
|
const sortGitLabJobDefProps_1 = __nccwpck_require__(71625);
|
|
3588
3589
|
const writeFiles_1 = __nccwpck_require__(7396);
|
|
3589
3590
|
const CATLADDER_GENERATED_FOLDER = ".catladder-generated";
|
|
@@ -3694,20 +3695,9 @@ class GitlabBackend {
|
|
|
3694
3695
|
.filter(({ trigger }) => trigger === "mainBranch")
|
|
3695
3696
|
.flatMap(({ jobs }) => jobs)
|
|
3696
3697
|
.filter(({ gitlabJob }) => !isManualGitlabJob(gitlabJob));
|
|
3697
|
-
//
|
|
3698
|
-
//
|
|
3699
|
-
|
|
3700
|
-
// SINKS of the auto-job graph (test/lint/audit and the deploy or
|
|
3701
|
-
// verify tips) — everything upstream is implied. This keeps the
|
|
3702
|
-
// executor's needs list far below gitlab's 50-entry cap even on
|
|
3703
|
-
// pipelines with many components.
|
|
3704
|
-
const neededByAnAutoJob = new Set(mainBranchAutoJobs.flatMap(({ gitlabJob }) => {
|
|
3705
|
-
var _a;
|
|
3706
|
-
return ((_a = gitlabJob.needs) !== null && _a !== void 0 ? _a : []).map((need) => typeof need === "string" ? need : need.job);
|
|
3707
|
-
}));
|
|
3708
|
-
const mainBranchJobNames = [
|
|
3709
|
-
...new Set(mainBranchAutoJobs.map(({ name }) => name)),
|
|
3710
|
-
].filter((name) => !neededByAnAutoJob.has(name));
|
|
3698
|
+
// only the sinks of the auto-job graph — every other auto job is
|
|
3699
|
+
// awaited transitively through them (see releaseGateJobs.ts)
|
|
3700
|
+
const mainBranchJobNames = (0, releaseGateJobs_1.getReleaseGateJobNames)(mainBranchAutoJobs);
|
|
3711
3701
|
const releaseJobs = (0, gitlabReleaseJobs_1.getGitlabReleaseJobs)(config, images, mainBranchJobNames);
|
|
3712
3702
|
const allWorkspaceJobs = allJobsPerTrigger
|
|
3713
3703
|
.filter((j) => { var _a; return ((_a = j.context) === null || _a === void 0 ? void 0 : _a.type) === "workspace"; }) // sort by componentName in the same order as they appear in the config
|
|
@@ -4525,6 +4515,45 @@ __exportStar(__nccwpck_require__(75512), exports);
|
|
|
4525
4515
|
|
|
4526
4516
|
/***/ }),
|
|
4527
4517
|
|
|
4518
|
+
/***/ 80634:
|
|
4519
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
4520
|
+
|
|
4521
|
+
"use strict";
|
|
4522
|
+
|
|
4523
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4524
|
+
exports.getReleaseGateJobNames = void 0;
|
|
4525
|
+
/**
|
|
4526
|
+
* the jobs the queued-release executor must `needs:` so that it runs
|
|
4527
|
+
* exactly when the whole main-branch pipeline succeeded.
|
|
4528
|
+
*
|
|
4529
|
+
* `needs:` is transitive: a job that another automatic job needs is
|
|
4530
|
+
* already awaited through that job, and a failed ancestor skips its
|
|
4531
|
+
* descendants (and with them the executor) either way. The executor
|
|
4532
|
+
* therefore only needs the SINKS of the auto-job graph — the jobs no
|
|
4533
|
+
* other automatic job depends on (deploy/verify tips, terminal
|
|
4534
|
+
* test/lint/audit). This keeps the needs list far below gitlab's
|
|
4535
|
+
* 50-entry cap even on pipelines with many components.
|
|
4536
|
+
*
|
|
4537
|
+
* INVARIANT (do not weaken): every automatic job is an ancestor of the
|
|
4538
|
+
* returned set. This holds for ANY graph shape, because the sinks are
|
|
4539
|
+
* recomputed from the actual needs edges on every generation — if e.g.
|
|
4540
|
+
* deploys ever stop needing the test jobs, the test jobs become sinks
|
|
4541
|
+
* and re-enter the executor's needs by themselves. Only needs FROM
|
|
4542
|
+
* automatic jobs count: a job consumed solely by manual jobs is a sink
|
|
4543
|
+
* too, and keeps gating the release directly.
|
|
4544
|
+
*/
|
|
4545
|
+
const getReleaseGateJobNames = (autoJobs) => {
|
|
4546
|
+
const neededByAnAutoJob = new Set(autoJobs.flatMap(({ gitlabJob }) => {
|
|
4547
|
+
var _a;
|
|
4548
|
+
return ((_a = gitlabJob.needs) !== null && _a !== void 0 ? _a : []).map((need) => typeof need === "string" ? need : need.job);
|
|
4549
|
+
}));
|
|
4550
|
+
return [...new Set(autoJobs.map(({ name }) => name))].filter((name) => !neededByAnAutoJob.has(name));
|
|
4551
|
+
};
|
|
4552
|
+
exports.getReleaseGateJobNames = getReleaseGateJobNames;
|
|
4553
|
+
//# sourceMappingURL=releaseGateJobs.js.map
|
|
4554
|
+
|
|
4555
|
+
/***/ }),
|
|
4556
|
+
|
|
4528
4557
|
/***/ 71625:
|
|
4529
4558
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4530
4559
|
|
|
@@ -9612,6 +9612,7 @@ const createGitlabJobs_1 = __nccwpck_require__(41509);
|
|
|
9612
9612
|
const createGitlabPipeline_1 = __nccwpck_require__(94411);
|
|
9613
9613
|
const gitlabReleaseJobs_1 = __nccwpck_require__(75512);
|
|
9614
9614
|
const getPipelineStages_1 = __nccwpck_require__(29641);
|
|
9615
|
+
const releaseGateJobs_1 = __nccwpck_require__(80634);
|
|
9615
9616
|
const sortGitLabJobDefProps_1 = __nccwpck_require__(71625);
|
|
9616
9617
|
const writeFiles_1 = __nccwpck_require__(7396);
|
|
9617
9618
|
const CATLADDER_GENERATED_FOLDER = ".catladder-generated";
|
|
@@ -9722,20 +9723,9 @@ class GitlabBackend {
|
|
|
9722
9723
|
.filter(({ trigger }) => trigger === "mainBranch")
|
|
9723
9724
|
.flatMap(({ jobs }) => jobs)
|
|
9724
9725
|
.filter(({ gitlabJob }) => !isManualGitlabJob(gitlabJob));
|
|
9725
|
-
//
|
|
9726
|
-
//
|
|
9727
|
-
|
|
9728
|
-
// SINKS of the auto-job graph (test/lint/audit and the deploy or
|
|
9729
|
-
// verify tips) — everything upstream is implied. This keeps the
|
|
9730
|
-
// executor's needs list far below gitlab's 50-entry cap even on
|
|
9731
|
-
// pipelines with many components.
|
|
9732
|
-
const neededByAnAutoJob = new Set(mainBranchAutoJobs.flatMap(({ gitlabJob }) => {
|
|
9733
|
-
var _a;
|
|
9734
|
-
return ((_a = gitlabJob.needs) !== null && _a !== void 0 ? _a : []).map((need) => typeof need === "string" ? need : need.job);
|
|
9735
|
-
}));
|
|
9736
|
-
const mainBranchJobNames = [
|
|
9737
|
-
...new Set(mainBranchAutoJobs.map(({ name }) => name)),
|
|
9738
|
-
].filter((name) => !neededByAnAutoJob.has(name));
|
|
9726
|
+
// only the sinks of the auto-job graph — every other auto job is
|
|
9727
|
+
// awaited transitively through them (see releaseGateJobs.ts)
|
|
9728
|
+
const mainBranchJobNames = (0, releaseGateJobs_1.getReleaseGateJobNames)(mainBranchAutoJobs);
|
|
9739
9729
|
const releaseJobs = (0, gitlabReleaseJobs_1.getGitlabReleaseJobs)(config, images, mainBranchJobNames);
|
|
9740
9730
|
const allWorkspaceJobs = allJobsPerTrigger
|
|
9741
9731
|
.filter((j) => { var _a; return ((_a = j.context) === null || _a === void 0 ? void 0 : _a.type) === "workspace"; }) // sort by componentName in the same order as they appear in the config
|
|
@@ -10553,6 +10543,45 @@ __exportStar(__nccwpck_require__(75512), exports);
|
|
|
10553
10543
|
|
|
10554
10544
|
/***/ }),
|
|
10555
10545
|
|
|
10546
|
+
/***/ 80634:
|
|
10547
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
10548
|
+
|
|
10549
|
+
"use strict";
|
|
10550
|
+
|
|
10551
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10552
|
+
exports.getReleaseGateJobNames = void 0;
|
|
10553
|
+
/**
|
|
10554
|
+
* the jobs the queued-release executor must `needs:` so that it runs
|
|
10555
|
+
* exactly when the whole main-branch pipeline succeeded.
|
|
10556
|
+
*
|
|
10557
|
+
* `needs:` is transitive: a job that another automatic job needs is
|
|
10558
|
+
* already awaited through that job, and a failed ancestor skips its
|
|
10559
|
+
* descendants (and with them the executor) either way. The executor
|
|
10560
|
+
* therefore only needs the SINKS of the auto-job graph — the jobs no
|
|
10561
|
+
* other automatic job depends on (deploy/verify tips, terminal
|
|
10562
|
+
* test/lint/audit). This keeps the needs list far below gitlab's
|
|
10563
|
+
* 50-entry cap even on pipelines with many components.
|
|
10564
|
+
*
|
|
10565
|
+
* INVARIANT (do not weaken): every automatic job is an ancestor of the
|
|
10566
|
+
* returned set. This holds for ANY graph shape, because the sinks are
|
|
10567
|
+
* recomputed from the actual needs edges on every generation — if e.g.
|
|
10568
|
+
* deploys ever stop needing the test jobs, the test jobs become sinks
|
|
10569
|
+
* and re-enter the executor's needs by themselves. Only needs FROM
|
|
10570
|
+
* automatic jobs count: a job consumed solely by manual jobs is a sink
|
|
10571
|
+
* too, and keeps gating the release directly.
|
|
10572
|
+
*/
|
|
10573
|
+
const getReleaseGateJobNames = (autoJobs) => {
|
|
10574
|
+
const neededByAnAutoJob = new Set(autoJobs.flatMap(({ gitlabJob }) => {
|
|
10575
|
+
var _a;
|
|
10576
|
+
return ((_a = gitlabJob.needs) !== null && _a !== void 0 ? _a : []).map((need) => typeof need === "string" ? need : need.job);
|
|
10577
|
+
}));
|
|
10578
|
+
return [...new Set(autoJobs.map(({ name }) => name))].filter((name) => !neededByAnAutoJob.has(name));
|
|
10579
|
+
};
|
|
10580
|
+
exports.getReleaseGateJobNames = getReleaseGateJobNames;
|
|
10581
|
+
//# sourceMappingURL=releaseGateJobs.js.map
|
|
10582
|
+
|
|
10583
|
+
/***/ }),
|
|
10584
|
+
|
|
10556
10585
|
/***/ 71625:
|
|
10557
10586
|
/***/ ((__unused_webpack_module, exports) => {
|
|
10558
10587
|
|
|
@@ -13,6 +13,7 @@ const createGitlabJobs_1 = require("./createGitlabJobs");
|
|
|
13
13
|
const createGitlabPipeline_1 = require("./createGitlabPipeline");
|
|
14
14
|
const gitlabReleaseJobs_1 = require("./gitlabReleaseJobs");
|
|
15
15
|
const getPipelineStages_1 = require("./getPipelineStages");
|
|
16
|
+
const releaseGateJobs_1 = require("./releaseGateJobs");
|
|
16
17
|
const sortGitLabJobDefProps_1 = require("./sortGitLabJobDefProps");
|
|
17
18
|
const writeFiles_1 = require("../../utils/writeFiles");
|
|
18
19
|
const CATLADDER_GENERATED_FOLDER = ".catladder-generated";
|
|
@@ -123,20 +124,9 @@ class GitlabBackend {
|
|
|
123
124
|
.filter(({ trigger }) => trigger === "mainBranch")
|
|
124
125
|
.flatMap(({ jobs }) => jobs)
|
|
125
126
|
.filter(({ gitlabJob }) => !isManualGitlabJob(gitlabJob));
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
|
|
129
|
-
// SINKS of the auto-job graph (test/lint/audit and the deploy or
|
|
130
|
-
// verify tips) — everything upstream is implied. This keeps the
|
|
131
|
-
// executor's needs list far below gitlab's 50-entry cap even on
|
|
132
|
-
// pipelines with many components.
|
|
133
|
-
const neededByAnAutoJob = new Set(mainBranchAutoJobs.flatMap(({ gitlabJob }) => {
|
|
134
|
-
var _a;
|
|
135
|
-
return ((_a = gitlabJob.needs) !== null && _a !== void 0 ? _a : []).map((need) => typeof need === "string" ? need : need.job);
|
|
136
|
-
}));
|
|
137
|
-
const mainBranchJobNames = [
|
|
138
|
-
...new Set(mainBranchAutoJobs.map(({ name }) => name)),
|
|
139
|
-
].filter((name) => !neededByAnAutoJob.has(name));
|
|
127
|
+
// only the sinks of the auto-job graph — every other auto job is
|
|
128
|
+
// awaited transitively through them (see releaseGateJobs.ts)
|
|
129
|
+
const mainBranchJobNames = (0, releaseGateJobs_1.getReleaseGateJobNames)(mainBranchAutoJobs);
|
|
140
130
|
const releaseJobs = (0, gitlabReleaseJobs_1.getGitlabReleaseJobs)(config, images, mainBranchJobNames);
|
|
141
131
|
const allWorkspaceJobs = allJobsPerTrigger
|
|
142
132
|
.filter((j) => { var _a; return ((_a = j.context) === null || _a === void 0 ? void 0 : _a.type) === "workspace"; }) // sort by componentName in the same order as they appear in the config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitlabBackend.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/gitlab/GitlabBackend.ts"],"names":[],"mappings":";;;AAAA,0CAA2C;AAC3C,uCAKqB;AAUrB,+CAA2D;AAC3D,gEAA6D;AAC7D,oEAAiE;AACjE,2DAAkE;AAClE,2CAAiD;AAEjD,oCAA8C;AAE9C,yDAAsD;AACtD,iEAA0E;AAC1E,2DAA2D;AAC3D,2DAAwD;AACxD,mEAAgE;AAChE,uDAA+D;AAE/D,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAE1D,MAAM,uBAAuB,GAAG,0BAA0B,GAAG,SAAS,CAAC;AAEvE,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAE1C,MAAa,aAAa;IAA1B;QACW,SAAI,GAAG,QAAiB,CAAC;QAEzB,oBAAe,GAAG,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"GitlabBackend.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/gitlab/GitlabBackend.ts"],"names":[],"mappings":";;;AAAA,0CAA2C;AAC3C,uCAKqB;AAUrB,+CAA2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;gBACT,GAAG,MAAM,CAAC,eAAe;gBACzB,iEAAiE;gBACjE,GAAG,IAAA,0BAAkB,EAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe;aACzD;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA7OD,sCA6OC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,GAAiB;;IAC1C,OAAO,CAAC,MAAA,GAAG,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,wBAAwB,CAAC,OAAwB;IACxD,kEAAkE;IAClE,uBAAuB;IACvB,wBAAwB;IACxB,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,YAAY;YACf,OAAO;gBACL,mCAA2B;gBAC3B,kDAA0C;aAC3C,CAAC;QACJ,KAAK,IAAI;YACP,OAAO,CAAC,mCAA2B,EAAE,6BAAqB,CAAC,CAAC;QAC9D,KAAK,eAAe;YAClB,OAAO,CAAC,mCAA2B,EAAE,8BAAsB,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,mBAAmB,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { GitlabJobDef } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* the jobs the queued-release executor must `needs:` so that it runs
|
|
4
|
+
* exactly when the whole main-branch pipeline succeeded.
|
|
5
|
+
*
|
|
6
|
+
* `needs:` is transitive: a job that another automatic job needs is
|
|
7
|
+
* already awaited through that job, and a failed ancestor skips its
|
|
8
|
+
* descendants (and with them the executor) either way. The executor
|
|
9
|
+
* therefore only needs the SINKS of the auto-job graph — the jobs no
|
|
10
|
+
* other automatic job depends on (deploy/verify tips, terminal
|
|
11
|
+
* test/lint/audit). This keeps the needs list far below gitlab's
|
|
12
|
+
* 50-entry cap even on pipelines with many components.
|
|
13
|
+
*
|
|
14
|
+
* INVARIANT (do not weaken): every automatic job is an ancestor of the
|
|
15
|
+
* returned set. This holds for ANY graph shape, because the sinks are
|
|
16
|
+
* recomputed from the actual needs edges on every generation — if e.g.
|
|
17
|
+
* deploys ever stop needing the test jobs, the test jobs become sinks
|
|
18
|
+
* and re-enter the executor's needs by themselves. Only needs FROM
|
|
19
|
+
* automatic jobs count: a job consumed solely by manual jobs is a sink
|
|
20
|
+
* too, and keeps gating the release directly.
|
|
21
|
+
*/
|
|
22
|
+
export declare const getReleaseGateJobNames: (autoJobs: Array<{
|
|
23
|
+
name: string;
|
|
24
|
+
gitlabJob: Pick<GitlabJobDef, "needs">;
|
|
25
|
+
}>) => string[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReleaseGateJobNames = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* the jobs the queued-release executor must `needs:` so that it runs
|
|
6
|
+
* exactly when the whole main-branch pipeline succeeded.
|
|
7
|
+
*
|
|
8
|
+
* `needs:` is transitive: a job that another automatic job needs is
|
|
9
|
+
* already awaited through that job, and a failed ancestor skips its
|
|
10
|
+
* descendants (and with them the executor) either way. The executor
|
|
11
|
+
* therefore only needs the SINKS of the auto-job graph — the jobs no
|
|
12
|
+
* other automatic job depends on (deploy/verify tips, terminal
|
|
13
|
+
* test/lint/audit). This keeps the needs list far below gitlab's
|
|
14
|
+
* 50-entry cap even on pipelines with many components.
|
|
15
|
+
*
|
|
16
|
+
* INVARIANT (do not weaken): every automatic job is an ancestor of the
|
|
17
|
+
* returned set. This holds for ANY graph shape, because the sinks are
|
|
18
|
+
* recomputed from the actual needs edges on every generation — if e.g.
|
|
19
|
+
* deploys ever stop needing the test jobs, the test jobs become sinks
|
|
20
|
+
* and re-enter the executor's needs by themselves. Only needs FROM
|
|
21
|
+
* automatic jobs count: a job consumed solely by manual jobs is a sink
|
|
22
|
+
* too, and keeps gating the release directly.
|
|
23
|
+
*/
|
|
24
|
+
const getReleaseGateJobNames = (autoJobs) => {
|
|
25
|
+
const neededByAnAutoJob = new Set(autoJobs.flatMap(({ gitlabJob }) => {
|
|
26
|
+
var _a;
|
|
27
|
+
return ((_a = gitlabJob.needs) !== null && _a !== void 0 ? _a : []).map((need) => typeof need === "string" ? need : need.job);
|
|
28
|
+
}));
|
|
29
|
+
return [...new Set(autoJobs.map(({ name }) => name))].filter((name) => !neededByAnAutoJob.has(name));
|
|
30
|
+
};
|
|
31
|
+
exports.getReleaseGateJobNames = getReleaseGateJobNames;
|
|
32
|
+
//# sourceMappingURL=releaseGateJobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"releaseGateJobs.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/gitlab/releaseGateJobs.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,sBAAsB,GAAG,CACpC,QAAyE,EAC/D,EAAE;IACZ,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC/B,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;;QACjC,OAAA,CAAC,MAAA,SAAS,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACnC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAC3C,CAAA;KAAA,CACF,CACF,CAAC;IACF,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAC1D,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CACvC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,sBAAsB,0BAajC"}
|