@activepieces/piece-greenhouse 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +13 -50
  3. package/src/index.d.ts +0 -2
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-candidate-note.d.ts +0 -8
  7. package/src/lib/actions/create-candidate-note.d.ts.map +0 -1
  8. package/src/lib/actions/create-candidate-note.js +0 -92
  9. package/src/lib/actions/create-candidate-note.js.map +0 -1
  10. package/src/lib/actions/create-candidate.d.ts +0 -14
  11. package/src/lib/actions/create-candidate.d.ts.map +0 -1
  12. package/src/lib/actions/create-candidate.js +0 -117
  13. package/src/lib/actions/create-candidate.js.map +0 -1
  14. package/src/lib/actions/create-prospect.d.ts +0 -14
  15. package/src/lib/actions/create-prospect.d.ts.map +0 -1
  16. package/src/lib/actions/create-prospect.js +0 -121
  17. package/src/lib/actions/create-prospect.js.map +0 -1
  18. package/src/lib/actions/find-candidate.d.ts +0 -4
  19. package/src/lib/actions/find-candidate.d.ts.map +0 -1
  20. package/src/lib/actions/find-candidate.js +0 -38
  21. package/src/lib/actions/find-candidate.js.map +0 -1
  22. package/src/lib/actions/find-due-scorecard.d.ts +0 -4
  23. package/src/lib/actions/find-due-scorecard.d.ts.map +0 -1
  24. package/src/lib/actions/find-due-scorecard.js +0 -54
  25. package/src/lib/actions/find-due-scorecard.js.map +0 -1
  26. package/src/lib/actions/find-or-create-candidate.d.ts +0 -14
  27. package/src/lib/actions/find-or-create-candidate.d.ts.map +0 -1
  28. package/src/lib/actions/find-or-create-candidate.js +0 -126
  29. package/src/lib/actions/find-or-create-candidate.js.map +0 -1
  30. package/src/lib/actions/update-candidate.d.ts +0 -15
  31. package/src/lib/actions/update-candidate.d.ts.map +0 -1
  32. package/src/lib/actions/update-candidate.js +0 -127
  33. package/src/lib/actions/update-candidate.js.map +0 -1
  34. package/src/lib/auth.d.ts +0 -2
  35. package/src/lib/auth.d.ts.map +0 -1
  36. package/src/lib/auth.js +0 -30
  37. package/src/lib/auth.js.map +0 -1
  38. package/src/lib/common/index.d.ts +0 -58
  39. package/src/lib/common/index.d.ts.map +0 -1
  40. package/src/lib/common/index.js +0 -44
  41. package/src/lib/common/index.js.map +0 -1
  42. package/src/lib/triggers/candidate-hired.d.ts +0 -3
  43. package/src/lib/triggers/candidate-hired.d.ts.map +0 -1
  44. package/src/lib/triggers/candidate-hired.js +0 -90
  45. package/src/lib/triggers/candidate-hired.js.map +0 -1
  46. package/src/lib/triggers/job-updated.d.ts +0 -3
  47. package/src/lib/triggers/job-updated.d.ts.map +0 -1
  48. package/src/lib/triggers/job-updated.js +0 -93
  49. package/src/lib/triggers/job-updated.js.map +0 -1
  50. package/src/lib/triggers/new-candidate-application.d.ts +0 -3
  51. package/src/lib/triggers/new-candidate-application.d.ts.map +0 -1
  52. package/src/lib/triggers/new-candidate-application.js +0 -103
  53. package/src/lib/triggers/new-candidate-application.js.map +0 -1
  54. package/src/lib/triggers/new-job-post.d.ts +0 -3
  55. package/src/lib/triggers/new-job-post.d.ts.map +0 -1
  56. package/src/lib/triggers/new-job-post.js +0 -99
  57. package/src/lib/triggers/new-job-post.js.map +0 -1
  58. package/src/lib/triggers/new-scheduled-interview.d.ts +0 -11
  59. package/src/lib/triggers/new-scheduled-interview.d.ts.map +0 -1
  60. package/src/lib/triggers/new-scheduled-interview.js +0 -99
  61. package/src/lib/triggers/new-scheduled-interview.js.map +0 -1
  62. package/src/lib/triggers/new-scorecard-due.d.ts +0 -3
  63. package/src/lib/triggers/new-scorecard-due.d.ts.map +0 -1
  64. package/src/lib/triggers/new-scorecard-due.js +0 -87
  65. package/src/lib/triggers/new-scorecard-due.js.map +0 -1
@@ -1,99 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newJobPostTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- const common_1 = require("../common");
9
- const polling = {
10
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
11
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS }) {
12
- const createdAfter = lastFetchEpochMS > 0
13
- ? new Date(lastFetchEpochMS).toISOString()
14
- : new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
15
- const response = yield (0, common_1.greenhouseApiCall)({
16
- accessToken: auth.access_token,
17
- method: pieces_common_1.HttpMethod.GET,
18
- endpoint: '/job_posts',
19
- queryParams: {
20
- 'created_at[gte]': createdAfter,
21
- per_page: '500',
22
- },
23
- });
24
- const jobPosts = Array.isArray(response.body) ? response.body : [];
25
- return jobPosts.map((post) => {
26
- var _a, _b, _c, _d, _e, _f;
27
- return ({
28
- epochMilliSeconds: new Date(post.created_at).getTime(),
29
- data: {
30
- id: post.id,
31
- title: post.title,
32
- job_id: post.job_id,
33
- job_board_id: post.job_board_id,
34
- location_name: (_b = (_a = post.location) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null,
35
- location_type: (_d = (_c = post.location) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : null,
36
- location_id: (_f = (_e = post.location) === null || _e === void 0 ? void 0 : _e.id) !== null && _f !== void 0 ? _f : null,
37
- internal: post.internal,
38
- active: post.active,
39
- live: post.live,
40
- featured: post.featured,
41
- public_url: post.public_url,
42
- language: post.language,
43
- first_published_at: post.first_published_at,
44
- demographic_question_set_id: post.demographic_question_set_id,
45
- created_at: post.created_at,
46
- updated_at: post.updated_at,
47
- },
48
- });
49
- });
50
- }),
51
- };
52
- exports.newJobPostTrigger = (0, pieces_framework_1.createTrigger)({
53
- auth: auth_1.greenhouseAuth,
54
- name: 'new_job_post',
55
- displayName: 'New Job Post',
56
- description: 'Triggers when a new job post is created.',
57
- props: {},
58
- sampleData: {
59
- id: 123,
60
- title: 'Software Engineer',
61
- job_id: 1234,
62
- job_board_id: 56,
63
- location_name: 'New York, NY',
64
- location_type: 'free_text',
65
- location_id: null,
66
- internal: false,
67
- active: true,
68
- live: true,
69
- featured: false,
70
- public_url: 'https://boards.greenhouse.io/acme/jobs/123',
71
- language: 'en',
72
- first_published_at: '2024-03-15T10:00:00.000Z',
73
- demographic_question_set_id: null,
74
- created_at: '2024-03-15T09:00:00.000Z',
75
- updated_at: '2024-03-15T10:00:00.000Z',
76
- },
77
- type: pieces_framework_1.TriggerStrategy.POLLING,
78
- test(context) {
79
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
- return yield pieces_common_1.pollingHelper.test(polling, context);
81
- });
82
- },
83
- onEnable(context) {
84
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
85
- yield pieces_common_1.pollingHelper.onEnable(polling, context);
86
- });
87
- },
88
- onDisable(context) {
89
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
90
- yield pieces_common_1.pollingHelper.onDisable(polling, context);
91
- });
92
- },
93
- run(context) {
94
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
95
- return yield pieces_common_1.pollingHelper.poll(polling, context);
96
- });
97
- },
98
- });
99
- //# sourceMappingURL=new-job-post.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-job-post.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-job-post.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,kCAAyC;AACzC,sCAA8C;AAsB9C,MAAM,OAAO,GAAmD;IAC9D,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAmC,EAAE,oDAA9B,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACtC,MAAM,YAAY,GAChB,gBAAgB,GAAG,CAAC;YAClB,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE;Y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,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newScheduledInterviewTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
3
- days_ahead: import("@activepieces/pieces-framework").NumberProperty<true>;
4
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
5
- days_ahead: import("@activepieces/pieces-framework").NumberProperty<true>;
6
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
7
- days_ahead: import("@activepieces/pieces-framework").NumberProperty<true>;
8
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
9
- days_ahead: import("@activepieces/pieces-framework").NumberProperty<true>;
10
- }>;
11
- //# sourceMappingURL=new-scheduled-interview.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-scheduled-interview.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-scheduled-interview.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGhB,MAAM,gCAAgC,CAAC;AA2ExC,eAAO,MAAM,4BAA4B;;;;;;;;EA0CvC,CAAC"}
@@ -1,99 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newScheduledInterviewTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- const common_1 = require("../common");
9
- const polling = {
10
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
11
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
12
- var _b;
13
- const daysAhead = (_b = propsValue.days_ahead) !== null && _b !== void 0 ? _b : 7;
14
- const createdAfter = lastFetchEpochMS > 0
15
- ? new Date(lastFetchEpochMS).toISOString()
16
- : new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
17
- const startsBefore = new Date(Date.now() + daysAhead * 24 * 60 * 60 * 1000).toISOString();
18
- const response = yield (0, common_1.greenhouseApiCall)({
19
- accessToken: auth.access_token,
20
- method: pieces_common_1.HttpMethod.GET,
21
- endpoint: '/interviews',
22
- queryParams: {
23
- 'created_at[gte]': createdAfter,
24
- 'starts_at[lte]': startsBefore,
25
- per_page: '500',
26
- },
27
- });
28
- const interviews = Array.isArray(response.body) ? response.body : [];
29
- return interviews.map((interview) => ({
30
- epochMilliSeconds: new Date(interview.created_at).getTime(),
31
- data: {
32
- id: interview.id,
33
- application_id: interview.application_id,
34
- external_event_id: interview.external_event_id,
35
- status: interview.status,
36
- starts_at: interview.starts_at,
37
- ends_at: interview.ends_at,
38
- all_day_start_on: interview.all_day_start_on,
39
- all_day_end_on: interview.all_day_end_on,
40
- location: interview.location,
41
- video_conferencing_url: interview.video_conferencing_url,
42
- organizer_id: interview.organizer_id,
43
- created_at: interview.created_at,
44
- updated_at: interview.updated_at,
45
- },
46
- }));
47
- }),
48
- };
49
- exports.newScheduledInterviewTrigger = (0, pieces_framework_1.createTrigger)({
50
- auth: auth_1.greenhouseAuth,
51
- name: 'new_scheduled_interview',
52
- displayName: 'New Scheduled Interview',
53
- description: 'Triggers when a new scheduled interview is created within the configured time window.',
54
- props: {
55
- days_ahead: pieces_framework_1.Property.Number({
56
- displayName: 'Time Window (Days)',
57
- description: 'Only trigger for interviews scheduled to start within this many days from now. For example, `7` means only interviews starting within the next week will fire this trigger.',
58
- required: true,
59
- defaultValue: 7,
60
- }),
61
- },
62
- sampleData: {
63
- id: 109170954,
64
- application_id: 102717457,
65
- external_event_id: 'external_event_id_1',
66
- status: 'scheduled',
67
- starts_at: '2024-03-20T13:15:00.000Z',
68
- ends_at: '2024-03-20T14:15:00.000Z',
69
- all_day_start_on: null,
70
- all_day_end_on: null,
71
- location: 'Big Conference Room',
72
- video_conferencing_url: 'https://zoom.us/j/123456789',
73
- organizer_id: 102361,
74
- created_at: '2024-03-10T19:22:07.000Z',
75
- updated_at: '2024-03-10T19:22:07.000Z',
76
- },
77
- type: pieces_framework_1.TriggerStrategy.POLLING,
78
- test(context) {
79
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
- return yield pieces_common_1.pollingHelper.test(polling, context);
81
- });
82
- },
83
- onEnable(context) {
84
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
85
- yield pieces_common_1.pollingHelper.onEnable(polling, context);
86
- });
87
- },
88
- onDisable(context) {
89
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
90
- yield pieces_common_1.pollingHelper.onDisable(polling, context);
91
- });
92
- },
93
- run(context) {
94
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
95
- return yield pieces_common_1.pollingHelper.poll(polling, context);
96
- });
97
- },
98
- });
99
- //# sourceMappingURL=new-scheduled-interview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-scheduled-interview.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-scheduled-interview.ts"],"names":[],"mappings":";;;;AAAA,qEAKwC;AACxC,+DAKqC;AACrC,kCAAyC;AACzC,sCAA8C;AAqB9C,MAAM,OAAO,GAA0C;IACrD,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,K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O,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newScorecardDueTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}>;
3
- //# sourceMappingURL=new-scorecard-due.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-scorecard-due.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-scorecard-due.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAoExC,eAAO,MAAM,sBAAsB,kwBAiCjC,CAAC"}
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newScorecardDueTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- const common_1 = require("../common");
9
- const polling = {
10
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
11
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS }) {
12
- const createdAfter = lastFetchEpochMS > 0
13
- ? new Date(lastFetchEpochMS).toISOString()
14
- : new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
15
- const response = yield (0, common_1.greenhouseApiCall)({
16
- accessToken: auth.access_token,
17
- method: pieces_common_1.HttpMethod.GET,
18
- endpoint: '/scorecards',
19
- queryParams: {
20
- 'created_at[gte]': createdAfter,
21
- per_page: '500',
22
- status: 'draft',
23
- },
24
- });
25
- const scorecards = Array.isArray(response.body) ? response.body : [];
26
- return scorecards.map((s) => ({
27
- epochMilliSeconds: new Date(s.created_at).getTime(),
28
- data: {
29
- id: s.id,
30
- application_id: s.application_id,
31
- interview_kit_id: s.interview_kit_id,
32
- interviewer_id: s.interviewer_id,
33
- submitter_id: s.submitter_id,
34
- status: s.status,
35
- candidate_rating: s.candidate_rating,
36
- notes: s.notes,
37
- interviewed_at: s.interviewed_at,
38
- submitted_at: s.submitted_at,
39
- created_at: s.created_at,
40
- updated_at: s.updated_at,
41
- },
42
- }));
43
- }),
44
- };
45
- exports.newScorecardDueTrigger = (0, pieces_framework_1.createTrigger)({
46
- auth: auth_1.greenhouseAuth,
47
- name: 'new_scorecard_due',
48
- displayName: 'New Scorecard Due',
49
- description: 'Triggers when a new scorecard is due — i.e. created but not yet submitted by the interviewer.',
50
- props: {},
51
- sampleData: {
52
- id: 11274,
53
- application_id: 3456,
54
- interview_kit_id: 789,
55
- interviewer_id: 4080,
56
- submitter_id: 4080,
57
- status: 'draft',
58
- candidate_rating: 'strong_yes',
59
- notes: null,
60
- interviewed_at: '2024-03-18T16:00:00.000Z',
61
- submitted_at: null,
62
- created_at: '2024-03-18T17:00:00.000Z',
63
- updated_at: '2024-03-18T17:00:00.000Z',
64
- },
65
- type: pieces_framework_1.TriggerStrategy.POLLING,
66
- test(context) {
67
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
68
- return yield pieces_common_1.pollingHelper.test(polling, context);
69
- });
70
- },
71
- onEnable(context) {
72
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
73
- yield pieces_common_1.pollingHelper.onEnable(polling, context);
74
- });
75
- },
76
- onDisable(context) {
77
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
78
- yield pieces_common_1.pollingHelper.onDisable(polling, context);
79
- });
80
- },
81
- run(context) {
82
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
83
- return yield pieces_common_1.pollingHelper.poll(polling, context);
84
- });
85
- },
86
- });
87
- //# sourceMappingURL=new-scorecard-due.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-scorecard-due.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-scorecard-due.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,kCAAyC;AACzC,sCAA8C;AAmB9C,MAAM,OAAO,GAAmD;IAC9D,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAmC,EAAE,oDAA9B,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACtC,MAAM,YAAY,GAChB,gBAAgB,GAAG,CAAC;YAClB,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE;YAC1C,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAE/D,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAAwB;YAC9D,WAAW,EAAE,IAA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