@epam/ai-dial-chat-hooks 1.3.6 → 1.4.0-dev.103
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/attachment/useAttachmentAction/useAttachmentAction.d.ts +1 -1
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -1
- package/attachment/useAttachmentAction/useAttachmentAction.js +35 -44
- package/catalog/create-publish-api.d.ts +9 -1
- package/catalog/create-publish-api.d.ts.map +1 -1
- package/catalog/create-publish-api.js +9 -0
- package/catalog/publish.d.ts +2 -0
- package/catalog/publish.d.ts.map +1 -1
- package/catalog/publish.js +4 -4
- package/catalog/resource-save-adapter.d.ts +7 -2
- package/catalog/resource-save-adapter.d.ts.map +1 -1
- package/catalog/resource-save-adapters.d.ts +32 -7
- package/catalog/resource-save-adapters.d.ts.map +1 -1
- package/catalog/resource-save-adapters.js +47 -41
- package/catalog/resource-save.d.ts +17 -9
- package/catalog/resource-save.d.ts.map +1 -1
- package/catalog/resource-save.js +34 -25
- package/catalog/save-destination-root.d.ts +12 -0
- package/catalog/save-destination-root.d.ts.map +1 -0
- package/catalog/save-destination-root.js +6 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts +8 -2
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -1
- package/catalog/usePublishFolders/usePublishFolders.js +29 -29
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts +7 -3
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts.map +1 -1
- package/catalog/useResourceSavePanel/useResourceSavePanel.js +107 -97
- package/catalog/useVersionHistory/useVersionHistory.d.ts +38 -0
- package/catalog/useVersionHistory/useVersionHistory.d.ts.map +1 -0
- package/catalog/useVersionHistory/useVersionHistory.js +49 -0
- package/catalog/useVersionHistory/useVersionHistorySection.d.ts +30 -0
- package/catalog/useVersionHistory/useVersionHistorySection.d.ts.map +1 -0
- package/catalog/useVersionHistory/useVersionHistorySection.js +31 -0
- package/catalog/version-history.d.ts +42 -0
- package/catalog/version-history.d.ts.map +1 -0
- package/catalog/version-history.js +27 -0
- package/catalog.js +37 -33
- package/conversation/useConversationStream/generation-resume.d.ts.map +1 -1
- package/conversation/useConversationStream/generation-resume.js +119 -96
- package/entry-points/catalog.d.ts +3 -0
- package/entry-points/catalog.d.ts.map +1 -1
- package/entry-points/scheduled-tasks.d.ts +1 -0
- package/entry-points/scheduled-tasks.d.ts.map +1 -1
- package/entry-points/utils.d.ts +3 -0
- package/entry-points/utils.d.ts.map +1 -1
- package/file-manager.js +33 -33
- package/files/annotation.d.ts +3 -3
- package/files/annotation.d.ts.map +1 -1
- package/files/annotation.js +12 -11
- package/files/attachment-canvas.d.ts +1 -1
- package/files/attachment-canvas.d.ts.map +1 -1
- package/files/attachment-canvas.js +135 -135
- package/files/dial-file.d.ts +18 -0
- package/files/dial-file.d.ts.map +1 -1
- package/files/dial-file.js +30 -5
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -1
- package/index.js +259 -252
- package/org-units/models.d.ts +3 -1
- package/org-units/models.d.ts.map +1 -1
- package/org-units/org-unit-guards.d.ts +64 -0
- package/org-units/org-unit-guards.d.ts.map +1 -0
- package/org-units/org-unit-guards.js +28 -0
- package/org-units/useFolderGuards/useFolderGuards.d.ts +31 -0
- package/org-units/useFolderGuards/useFolderGuards.d.ts.map +1 -0
- package/org-units/useFolderGuards/useFolderGuards.js +50 -0
- package/org-units/useOrgUnits/useOrgUnits.d.ts +18 -3
- package/org-units/useOrgUnits/useOrgUnits.d.ts.map +1 -1
- package/org-units/useOrgUnits/useOrgUnits.js +43 -23
- package/package.json +19 -19
- package/scheduled-task/scheduled-task-description.d.ts +19 -13
- package/scheduled-task/scheduled-task-description.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-description.js +39 -55
- package/scheduled-task/scheduled-task-display.d.ts +19 -5
- package/scheduled-task/scheduled-task-display.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-display.js +43 -38
- package/scheduled-task/scheduled-task-next-occurrence.d.ts +7 -5
- package/scheduled-task/scheduled-task-next-occurrence.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-next-occurrence.js +15 -15
- package/scheduled-task/scheduled-task-trigger.d.ts +6 -4
- package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-trigger.js +92 -115
- package/scheduled-tasks.js +14 -13
- package/shared/timezones.d.ts +30 -0
- package/shared/timezones.d.ts.map +1 -0
- package/shared/timezones.js +102 -0
- package/skill/useSkillEditorSubmit.d.ts +4 -1
- package/skill/useSkillEditorSubmit.d.ts.map +1 -1
- package/skill/useSkillEditorSubmit.js +125 -121
- package/utils.js +19 -16
- package/shared/cron-day-of-month.d.ts +0 -21
- package/shared/cron-day-of-month.d.ts.map +0 -1
- package/shared/cron-day-of-month.js +0 -13
|
@@ -19,6 +19,8 @@ export interface ScheduledTaskScheduleLabels {
|
|
|
19
19
|
invalid: string;
|
|
20
20
|
/** Label for a recurring trigger no other shape describes. */
|
|
21
21
|
recurringFallback: string;
|
|
22
|
+
/** Appends the task's zone to a schedule label, e.g. "Daily at 09:00 (Asia/Tokyo)". Omit to never show the zone. */
|
|
23
|
+
withTimezone?: (label: string, timezone: string) => string;
|
|
22
24
|
}
|
|
23
25
|
/** Host-translated duration units for a run. */
|
|
24
26
|
export interface ScheduledTaskRunDurationLabels {
|
|
@@ -38,12 +40,12 @@ export interface ScheduledTaskRunTimestampLabels {
|
|
|
38
40
|
/** A run that started on the short date `date` at `time`. */
|
|
39
41
|
dateAt: (date: string, time: string) => string;
|
|
40
42
|
}
|
|
41
|
-
/** Locale and
|
|
43
|
+
/** Locale and viewer zone used to format a schedule label. */
|
|
42
44
|
export interface ScheduledTaskScheduleLabelOptions {
|
|
43
45
|
/** BCP 47 locale for dates and weekday names. Defaults to the runtime default. */
|
|
44
46
|
locale?: string;
|
|
45
|
-
/** IANA
|
|
46
|
-
|
|
47
|
+
/** The viewer's IANA zone; a task in a different zone gets its zone appended to the label. Defaults to the browser's resolved zone. */
|
|
48
|
+
browserTimezone?: string;
|
|
47
49
|
}
|
|
48
50
|
/** Inputs for formatting a run's start time. */
|
|
49
51
|
export interface ScheduledTaskRunTimestampOptions {
|
|
@@ -85,8 +87,20 @@ export declare enum ScheduledTaskDeleteErrorKind {
|
|
|
85
87
|
/** Any other failure. */
|
|
86
88
|
Generic = "generic"
|
|
87
89
|
}
|
|
88
|
-
/**
|
|
89
|
-
export declare const
|
|
90
|
+
/** Formats a zone-local `YYYY-MM-DDTHH:mm` as a medium date and short time without converting it to another zone. */
|
|
91
|
+
export declare const formatZonedDateTime: (dateTime: string, locale?: string) => string;
|
|
92
|
+
/**
|
|
93
|
+
* Formats a stored trigger datetime — a zone-local wall time, or an absolute
|
|
94
|
+
* instant written by an older client — as the wall time it shows in the
|
|
95
|
+
* task's own zone. Returns the raw value when it is not a date.
|
|
96
|
+
*/
|
|
97
|
+
export declare const formatScheduledTaskTriggerTime: (value: string, timezone: string, locale?: string) => string;
|
|
98
|
+
/**
|
|
99
|
+
* Returns the schedule label for a task's trigger in the task's own zone: the
|
|
100
|
+
* stored wall time is shown as is, and the zone is appended when it differs
|
|
101
|
+
* from the viewer's.
|
|
102
|
+
*/
|
|
103
|
+
export declare const formatScheduledTaskScheduleLabel: (task: ScheduledTaskDto, labels: ScheduledTaskScheduleLabels, { locale, browserTimezone, }?: ScheduledTaskScheduleLabelOptions) => string;
|
|
90
104
|
/** Maps a scheduled-task DTO to the scheduled-tasks lib's card item. */
|
|
91
105
|
export declare const toScheduledTaskItem: (task: ScheduledTaskDto, labels: ScheduledTaskScheduleLabels, options?: ScheduledTaskScheduleLabelOptions) => ScheduledTaskItem;
|
|
92
106
|
/** Maps scheduled-task DTOs to card items, preserving order. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-task-display.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-display.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"scheduled-task-display.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-display.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,69 +1,74 @@
|
|
|
1
1
|
import { ScheduledTaskTriggerDescriptionKind as e, describeScheduledTaskTrigger as t } from "./scheduled-task-description.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { isSameTimezone as n } from "../shared/timezones.js";
|
|
3
|
+
import { ScheduledTaskErrorCode as r, ScheduledTaskRunDtoStatusEnum as i } from "@epam/ai-dial-chat-api-client";
|
|
4
|
+
import { ScheduledTaskRunStatus as a, instantToZonedDateTime as o, isAbsoluteInstant as s } from "@epam/ai-dial-scheduled-tasks";
|
|
4
5
|
//#region src/scheduled-task/scheduled-task-display.ts
|
|
5
|
-
var
|
|
6
|
+
var c = /* @__PURE__ */ function(e) {
|
|
6
7
|
return e.NotFound = "notFound", e.Retryable = "retryable", e.Generic = "generic", e;
|
|
7
|
-
}({}),
|
|
8
|
+
}({}), l = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/, u = 60, d = 3600, f = (e, t) => new Intl.DateTimeFormat(t, {
|
|
8
9
|
weekday: "long",
|
|
9
10
|
timeZone: "UTC"
|
|
10
|
-
}).format(new Date(Date.UTC(2023, 0, 2 + Number(e)))),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
case e.
|
|
21
|
-
case e.
|
|
22
|
-
case e.
|
|
23
|
-
|
|
11
|
+
}).format(new Date(Date.UTC(2023, 0, 2 + Number(e)))), p = (e, t) => new Intl.ListFormat(t, { type: "conjunction" }).format(e.map((e) => f(e, t))), m = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), h = (e, t) => new Intl.DateTimeFormat(t, {
|
|
12
|
+
dateStyle: "medium",
|
|
13
|
+
timeStyle: "short",
|
|
14
|
+
timeZone: "UTC"
|
|
15
|
+
}).format(/* @__PURE__ */ new Date(`${e}:00Z`)), g = (e, t, n) => {
|
|
16
|
+
let r = s(e) ? o(e, t) : e.slice(0, 16);
|
|
17
|
+
return !r || !l.test(r) ? e : h(r, n);
|
|
18
|
+
}, _ = (r, i, { locale: a, browserTimezone: o = Intl.DateTimeFormat().resolvedOptions().timeZone } = {}) => {
|
|
19
|
+
let s = r.timezone || "UTC", c = t(r.trigger, { timezone: s }), l = c.time ?? "", u = (e) => i.withTimezone && !n(s, o) ? i.withTimezone(e, s) : e;
|
|
20
|
+
switch (c.kind) {
|
|
21
|
+
case e.OneTime: return u(i.onceAt(h(c.dateTime ?? "", a)));
|
|
22
|
+
case e.EveryNMinutes: return i.everyNMinutes(c.intervalMinutes ?? 0);
|
|
23
|
+
case e.Hourly: return u(i.hourlyAt(l));
|
|
24
|
+
case e.Daily: return u(i.dailyAt(l));
|
|
25
|
+
case e.Weekly: return u(i.weeklyAt(p(c.daysOfWeek ?? [c.dayOfWeek ?? ""], a), l));
|
|
26
|
+
case e.Monthly: return u(i.monthlyAt(c.dayOfMonth ?? "", l));
|
|
27
|
+
case e.Invalid: return i.invalid;
|
|
28
|
+
default: return i.recurringFallback;
|
|
24
29
|
}
|
|
25
|
-
},
|
|
30
|
+
}, v = (e, t, n) => ({
|
|
26
31
|
id: e.id,
|
|
27
32
|
displayName: e.displayName,
|
|
28
33
|
descriptionPreview: e.description,
|
|
29
|
-
scheduleLabel:
|
|
34
|
+
scheduleLabel: _(e, t, n),
|
|
30
35
|
isActive: e.isActive,
|
|
31
36
|
isCompleted: e.isCompleted
|
|
32
|
-
}),
|
|
37
|
+
}), y = (e, t, n) => e.map((e) => v(e, t, n)), b = (e, t) => {
|
|
33
38
|
if (e == null) return;
|
|
34
39
|
let n = [
|
|
35
|
-
[Math.floor(e /
|
|
36
|
-
[Math.floor(e %
|
|
37
|
-
[e %
|
|
40
|
+
[Math.floor(e / d), t.hours],
|
|
41
|
+
[Math.floor(e % d / u), t.minutes],
|
|
42
|
+
[e % u, t.seconds]
|
|
38
43
|
].filter(([e]) => e > 0).map(([e, t]) => t(e));
|
|
39
44
|
return t.suffix(n.length ? n.join(" ") : t.seconds(0));
|
|
40
|
-
},
|
|
41
|
-
let o = new Date(e), s = new Intl.DateTimeFormat(i, { timeStyle: "short" }).format(o), c =
|
|
45
|
+
}, x = (e, t, n, { durationLabels: r, locale: i, now: a = /* @__PURE__ */ new Date() } = {}) => {
|
|
46
|
+
let o = new Date(e), s = new Intl.DateTimeFormat(i, { timeStyle: "short" }).format(o), c = m(o, a) ? n.todayAt(s) : n.dateAt(new Intl.DateTimeFormat(i, {
|
|
42
47
|
month: "short",
|
|
43
48
|
day: "numeric"
|
|
44
|
-
}).format(o), s), l = r ?
|
|
49
|
+
}).format(o), s), l = r ? b(t, r) : void 0;
|
|
45
50
|
return l ? `${c} ${l}` : c;
|
|
46
|
-
},
|
|
51
|
+
}, S = (e) => {
|
|
47
52
|
switch (e) {
|
|
48
|
-
case
|
|
49
|
-
case
|
|
50
|
-
case
|
|
51
|
-
default: return
|
|
53
|
+
case i.Success: return a.Success;
|
|
54
|
+
case i.Error: return a.Error;
|
|
55
|
+
case i.InProgress: return a.InProgress;
|
|
56
|
+
default: return a.Missed;
|
|
52
57
|
}
|
|
53
|
-
},
|
|
58
|
+
}, C = (e, { timestampLabels: t, durationLabels: n, conversations: r, conversationIdsMatch: i, locale: a, now: o }) => {
|
|
54
59
|
let { conversationId: s } = e, c = s ? r.find((e) => i(e.id, s)) : void 0;
|
|
55
60
|
return {
|
|
56
61
|
id: e.id,
|
|
57
|
-
status:
|
|
58
|
-
timestampLabel:
|
|
62
|
+
status: S(e.status),
|
|
63
|
+
timestampLabel: x(e.startTime, void 0, t, {
|
|
59
64
|
locale: a,
|
|
60
65
|
now: o
|
|
61
66
|
}),
|
|
62
|
-
durationLabel:
|
|
67
|
+
durationLabel: b(e.durationSeconds, n),
|
|
63
68
|
conversationId: s,
|
|
64
69
|
isUnread: c?.isUnread === !0,
|
|
65
70
|
errorText: e.errorText
|
|
66
71
|
};
|
|
67
|
-
},
|
|
72
|
+
}, w = (e, t) => e.map((e) => C(e, t)), T = (e) => e === 404 || e === 409 ? "notFound" : e === 502 ? "retryable" : "generic", E = (e, { adminConsentRequired: t, fallback: n }) => e.code === r.ScheduledTaskAdminConsentRequired ? t : e.upstreamMessage?.trim() || n;
|
|
68
73
|
//#endregion
|
|
69
|
-
export {
|
|
74
|
+
export { c as ScheduledTaskDeleteErrorKind, T as classifyScheduledTaskDeleteError, b as formatScheduledTaskRunDuration, x as formatScheduledTaskRunTimestamp, _ as formatScheduledTaskScheduleLabel, g as formatScheduledTaskTriggerTime, h as formatZonedDateTime, E as selectScheduledTaskErrorMessage, v as toScheduledTaskItem, y as toScheduledTaskItems, C as toScheduledTaskRunItem, w as toScheduledTaskRunItems };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ScheduleCronDto } from '@epam/ai-dial-chat-api-client';
|
|
2
2
|
/**
|
|
3
|
-
* Returns the next
|
|
4
|
-
* `hour`/`minute` fires
|
|
5
|
-
* list of weekdays) or `day` (Monthly) constraint.
|
|
6
|
-
*
|
|
3
|
+
* Returns the next local `YYYY-MM-DDTHH:mm` at which a cron trigger with a
|
|
4
|
+
* fixed `hour`/`minute` fires in `timezone`, honouring its `day_of_week` (a
|
|
5
|
+
* weekday or a comma list of weekdays) or `day` (Monthly) constraint. Cron
|
|
6
|
+
* fields are wall time in the task's zone, so the answer is wall time too.
|
|
7
|
+
* Returns `undefined` when the fields are not plain values this helper can
|
|
8
|
+
* evaluate or the zone is unknown.
|
|
7
9
|
*/
|
|
8
|
-
export declare const getNextCronOccurrence: (cron: ScheduleCronDto, from?: Date) =>
|
|
10
|
+
export declare const getNextCronOccurrence: (cron: ScheduleCronDto, timezone: string, from?: Date) => string | undefined;
|
|
9
11
|
//# sourceMappingURL=scheduled-task-next-occurrence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-task-next-occurrence.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-next-occurrence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduled-task-next-occurrence.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-next-occurrence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA8BrE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,eAAe,EACrB,UAAU,MAAM,EAChB,OAAM,IAAiB,KACtB,MAAM,GAAG,SAmCX,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
import { padTwoDigits as e } from "../shared/formatting.js";
|
|
2
|
+
import { getZonedNow as t } from "@epam/ai-dial-scheduled-tasks";
|
|
1
3
|
//#region src/scheduled-task/scheduled-task-next-occurrence.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
if (
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
var n = "last", r = 366, i = /^\d+$/, a = 864e5, o = (e, t, r) => t == null ? r === n ? new Date(e.getTime() + a).getUTCDate() === 1 : r == null || Number(r) === e.getUTCDate() : t.split(",").some((t) => (Number(t) + 1) % 7 === e.getUTCDay()), s = (s, c, l = /* @__PURE__ */ new Date()) => {
|
|
5
|
+
let { hour: u, minute: d, day_of_week: f, day: p } = s.fields;
|
|
6
|
+
if (!u || !d || !i.test(u) || !i.test(d) || f != null && !/^[0-6](?:,[0-6])*$/.test(f) || p != null && p !== n && !i.test(p)) return;
|
|
7
|
+
let m;
|
|
8
|
+
try {
|
|
9
|
+
m = t(l, c).dateTime;
|
|
10
|
+
} catch {
|
|
11
|
+
return;
|
|
7
12
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
let l = new Date(i);
|
|
13
|
-
l.setUTCHours(Number(a), Number(o), 0, 0);
|
|
14
|
-
for (let e = 0; e <= 366; e++) {
|
|
15
|
-
if (l > i && n(l, s, c)) return l;
|
|
16
|
-
l.setUTCDate(l.getUTCDate() + 1);
|
|
13
|
+
let h = `${e(Number(u))}:${e(Number(d))}`, g = Date.parse(`${m.slice(0, 10)}T00:00:00Z`);
|
|
14
|
+
for (let e = 0; e <= r; e++) {
|
|
15
|
+
let t = new Date(g + e * a), n = `${t.toISOString().slice(0, 10)}T${h}`;
|
|
16
|
+
if (n > m && o(t, f, p)) return n;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
//#endregion
|
|
20
|
-
export {
|
|
20
|
+
export { s as getNextCronOccurrence };
|
|
@@ -3,15 +3,17 @@ import { ScheduledTaskCreateFormValues } from '@epam/ai-dial-scheduled-tasks';
|
|
|
3
3
|
import { ScheduledTaskDtoMappingResult } from './scheduled-task-mapping';
|
|
4
4
|
/**
|
|
5
5
|
* Maps validated create-form values to the `POST /api/v1/scheduled-tasks`
|
|
6
|
-
* request body
|
|
7
|
-
*
|
|
8
|
-
* validated required fields (name, model,
|
|
9
|
-
* section's fields) — this function does not
|
|
6
|
+
* request body: `trigger.date` for a one-shot schedule or `trigger.cron` for a
|
|
7
|
+
* recurring one, both in wall time, plus the `timezone` they are read in.
|
|
8
|
+
* Assumes the caller has already validated required fields (name, model,
|
|
9
|
+
* prompt, and the active schedule section's fields) — this function does not
|
|
10
|
+
* re-validate.
|
|
10
11
|
*/
|
|
11
12
|
export declare const mapFormValuesToCreateBody: (values: ScheduledTaskCreateFormValues) => CreateScheduledTaskBodyDto;
|
|
12
13
|
/**
|
|
13
14
|
* Maps a complete, validated edit draft to an update body. An unset skill
|
|
14
15
|
* emits null to remove the saved reference; hydrate from detail before editing.
|
|
16
|
+
* The zone is always present, because the scheduler resets an omitted one to UTC.
|
|
15
17
|
*/
|
|
16
18
|
export declare const mapFormValuesToUpdateBody: (values: ScheduledTaskCreateFormValues) => UpdateScheduledTaskBodyDto;
|
|
17
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-task-trigger.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,gBAAgB,EAEhB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"scheduled-task-trigger.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,gBAAgB,EAEhB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIL,KAAK,6BAA6B,EACnC,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,0BAA0B,CAAC;AAuFlC;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,6BAA6B,KACpC,0BAuCF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,6BAA6B,KACpC,0BAGD,CAAC;AA4HH;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC1C,KAAK,gBAAgB,KACpB,6BA4HF,CAAC"}
|
|
@@ -1,174 +1,151 @@
|
|
|
1
1
|
import { padTwoDigits as e } from "../shared/formatting.js";
|
|
2
2
|
import { UnsupportedTriggerReason as t } from "./scheduled-task-mapping.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ScheduledTaskRepeat as s } from "@epam/ai-dial-scheduled-tasks";
|
|
3
|
+
import { isKnownTimezone as n } from "../shared/timezones.js";
|
|
4
|
+
import { ScheduledTaskRepeat as r, instantToZonedDateTime as i, isAbsoluteInstant as a } from "@epam/ai-dial-scheduled-tasks";
|
|
6
5
|
//#region src/scheduled-task/scheduled-task-trigger.ts
|
|
7
|
-
var
|
|
6
|
+
var o = /* @__PURE__ */ new Set([
|
|
8
7
|
"hour",
|
|
9
8
|
"minute",
|
|
10
9
|
"day_of_week",
|
|
11
10
|
"day"
|
|
12
|
-
]),
|
|
13
|
-
if (e.repeat ===
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
hour: "*",
|
|
17
|
-
minute: String(t.getUTCMinutes())
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
let [t, r] = e.time.split(":"), c = Number(t), l = Number(r), d = /* @__PURE__ */ new Date();
|
|
21
|
-
d.setHours(c, l, 0, 0);
|
|
22
|
-
let f = e.repeat === s.Weekly && !!e.dayOfWeek, p = e.repeat === s.Custom ? u(e.daysOfWeek ?? []) : [], m = e.repeat === s.Monthly && !!e.dayOfMonth, h = f ? e.dayOfWeek : p[0];
|
|
23
|
-
if (h !== void 0) {
|
|
24
|
-
let e = (a(Number(h)) - d.getDay() + 7) % 7;
|
|
25
|
-
d.setDate(d.getDate() + e);
|
|
26
|
-
}
|
|
27
|
-
let g = {
|
|
28
|
-
hour: String(d.getUTCHours()),
|
|
29
|
-
minute: String(d.getUTCMinutes())
|
|
11
|
+
]), s = "UTC", c = /^[0-6]$/, l = /^\d+$/, u = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})(?::(\d{2}))?/, d = 10, f = 16, p = (e) => [...e].sort((e, t) => Number(e) - Number(t)), m = "09:00", h = (e) => {
|
|
12
|
+
if (e.repeat === r.Hourly) return {
|
|
13
|
+
hour: "*",
|
|
14
|
+
minute: String(Number(e.minute))
|
|
30
15
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
let [t, n] = e.time.split(":"), i = {
|
|
17
|
+
hour: String(Number(t)),
|
|
18
|
+
minute: String(Number(n))
|
|
19
|
+
};
|
|
20
|
+
if (e.repeat === r.Weekly && e.dayOfWeek && (i.day_of_week = e.dayOfWeek), e.repeat === r.Monthly && e.dayOfMonth && (i.day = String(Number(e.dayOfMonth))), e.repeat === r.Custom) {
|
|
21
|
+
let t = p(e.daysOfWeek ?? []);
|
|
22
|
+
t.length && (i.day_of_week = t.join(","));
|
|
34
23
|
}
|
|
35
|
-
return
|
|
36
|
-
},
|
|
37
|
-
let
|
|
38
|
-
return t
|
|
39
|
-
},
|
|
40
|
-
let t = e.repeat ===
|
|
41
|
-
fields:
|
|
42
|
-
...e.startDate ? { startDate:
|
|
43
|
-
...e.endDate ? { endDate:
|
|
24
|
+
return i;
|
|
25
|
+
}, g = (e, t) => t === "start" ? `${e}T00:00:00.000` : `${e}T23:59:59.999`, _ = (e) => {
|
|
26
|
+
let t = u.exec(e);
|
|
27
|
+
return t ? `${t[1]}:${t[2] ?? "00"}` : e;
|
|
28
|
+
}, v = (e) => {
|
|
29
|
+
let t = e.repeat === r.OneTime ? { date: _(e.runAt ?? "") } : { cron: {
|
|
30
|
+
fields: h(e),
|
|
31
|
+
...e.startDate ? { startDate: g(e.startDate, "start") } : {},
|
|
32
|
+
...e.endDate ? { endDate: g(e.endDate, "end") } : {}
|
|
44
33
|
} }, n = e.description?.trim();
|
|
45
34
|
return {
|
|
46
35
|
displayName: e.displayName.trim(),
|
|
47
36
|
trigger: t,
|
|
37
|
+
timezone: e.timezone,
|
|
48
38
|
model: e.modelId,
|
|
49
39
|
prompt: e.prompt.trim(),
|
|
50
40
|
...e.skillUrls?.length ? { skillUrls: [...new Set(e.skillUrls)] } : {},
|
|
51
41
|
...n ? { description: n } : {}
|
|
52
42
|
};
|
|
53
|
-
},
|
|
54
|
-
...
|
|
43
|
+
}, y = (e) => ({
|
|
44
|
+
...v(e),
|
|
55
45
|
skillUrls: [...new Set(e.skillUrls ?? [])]
|
|
56
|
-
}),
|
|
57
|
-
let n = new
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
ok: !0,
|
|
69
|
-
isHourly: !0,
|
|
70
|
-
minute: String(e.getMinutes())
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
let p = Number(t.hour), m = Number(t.minute);
|
|
74
|
-
if (Number.isNaN(p) || Number.isNaN(m)) return { ok: !1 };
|
|
75
|
-
let h = /* @__PURE__ */ new Date();
|
|
76
|
-
h.setUTCHours(p, m, 0, 0);
|
|
77
|
-
let g = d ? String(t.day_of_week).split(",") : [];
|
|
78
|
-
if (g.some((e) => !l.test(e)) || new Set(g).size !== g.length) return { ok: !1 };
|
|
79
|
-
if (g.length) {
|
|
80
|
-
let e = (a(Number(g[0])) - h.getUTCDay() + 7) % 7;
|
|
81
|
-
h.setUTCDate(h.getUTCDate() + e);
|
|
82
|
-
}
|
|
83
|
-
let _ = `${e(h.getHours())}:${e(h.getMinutes())}`;
|
|
84
|
-
if (g.length > 1) {
|
|
85
|
-
let e = n(h);
|
|
86
|
-
return {
|
|
87
|
-
ok: !0,
|
|
88
|
-
isHourly: !1,
|
|
89
|
-
isCustom: !0,
|
|
90
|
-
time: _,
|
|
91
|
-
daysOfWeek: u(g.map((t) => String((Number(t) - e + 7) % 7)))
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
let v = f ? r(String(t.day), n(h)) : void 0;
|
|
95
|
-
return f && !v ? { ok: !1 } : {
|
|
46
|
+
}), b = (e, t) => a(e) ? i(e, t) ?? e.slice(0, f) : e.slice(0, f), x = (e, t) => b(e, t).slice(0, d), S = (t) => {
|
|
47
|
+
let n = new Set(Object.entries(t).filter(([, e]) => e != null).map(([e]) => e)), r = [...n].filter((e) => !o.has(e)), i = n.has("day_of_week"), a = n.has("day");
|
|
48
|
+
if (r.length > 0 || i && a || !n.has("hour") || !n.has("minute")) return { ok: !1 };
|
|
49
|
+
if (t.hour === "*" && l.test(String(t.minute)) && !i && !a) return {
|
|
50
|
+
ok: !0,
|
|
51
|
+
isHourly: !0,
|
|
52
|
+
minute: String(Number(t.minute))
|
|
53
|
+
};
|
|
54
|
+
if (!l.test(String(t.hour)) || !l.test(String(t.minute))) return { ok: !1 };
|
|
55
|
+
let s = `${e(Number(t.hour))}:${e(Number(t.minute))}`, u = i ? String(t.day_of_week).split(",") : [];
|
|
56
|
+
if (u.some((e) => !c.test(e)) || new Set(u).size !== u.length) return { ok: !1 };
|
|
57
|
+
if (u.length > 1) return {
|
|
96
58
|
ok: !0,
|
|
97
59
|
isHourly: !1,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
60
|
+
isCustom: !0,
|
|
61
|
+
time: s,
|
|
62
|
+
daysOfWeek: p(u)
|
|
101
63
|
};
|
|
102
|
-
|
|
64
|
+
let d = a ? String(t.day) : void 0;
|
|
65
|
+
return d !== void 0 && (!l.test(d) || Number(d) < 1 || Number(d) > 31) ? { ok: !1 } : {
|
|
66
|
+
ok: !0,
|
|
67
|
+
isHourly: !1,
|
|
68
|
+
time: s,
|
|
69
|
+
...u.length ? { dayOfWeek: u[0] } : {},
|
|
70
|
+
...d ? { dayOfMonth: String(Number(d)) } : {}
|
|
71
|
+
};
|
|
72
|
+
}, C = (e) => {
|
|
103
73
|
if (!e.model || typeof e.prompt != "string" || !e.prompt.trim() && !e.skillUrls?.length) return {
|
|
104
74
|
ok: !1,
|
|
105
75
|
reason: t.MissingRequiredFields
|
|
106
76
|
};
|
|
107
|
-
let { date:
|
|
108
|
-
if (
|
|
77
|
+
let { date: i, cron: a } = e.trigger, o = !!i;
|
|
78
|
+
if (o === !!a) return {
|
|
109
79
|
ok: !1,
|
|
110
80
|
reason: t.UnsupportedTriggerType
|
|
111
81
|
};
|
|
112
|
-
let
|
|
82
|
+
let c = e.timezone || s;
|
|
83
|
+
if (!n(c)) return {
|
|
84
|
+
ok: !1,
|
|
85
|
+
reason: t.UnsupportedTriggerType
|
|
86
|
+
};
|
|
87
|
+
let l = {
|
|
113
88
|
displayName: e.displayName,
|
|
114
89
|
modelId: e.model,
|
|
115
90
|
prompt: e.prompt,
|
|
116
91
|
skillUrls: [...new Set(e.skillUrls ?? [])],
|
|
92
|
+
timezone: c,
|
|
117
93
|
...e.description ? { description: e.description } : {}
|
|
118
94
|
};
|
|
119
|
-
if (
|
|
95
|
+
if (o) return {
|
|
120
96
|
ok: !0,
|
|
121
97
|
values: {
|
|
122
|
-
...
|
|
123
|
-
repeat:
|
|
124
|
-
runAt:
|
|
125
|
-
time:
|
|
98
|
+
...l,
|
|
99
|
+
repeat: r.OneTime,
|
|
100
|
+
runAt: b(i, c),
|
|
101
|
+
time: m
|
|
126
102
|
}
|
|
127
103
|
};
|
|
128
|
-
if (!
|
|
104
|
+
if (!a) return {
|
|
129
105
|
ok: !1,
|
|
130
106
|
reason: t.UnsupportedTriggerType
|
|
131
107
|
};
|
|
132
|
-
let
|
|
133
|
-
if (!
|
|
108
|
+
let u = S(a.fields);
|
|
109
|
+
if (!u.ok) return {
|
|
134
110
|
ok: !1,
|
|
135
111
|
reason: t.UnsupportedCronShape
|
|
136
112
|
};
|
|
137
|
-
|
|
113
|
+
let d = {
|
|
114
|
+
...a.startDate ? { startDate: x(a.startDate, c) } : {},
|
|
115
|
+
...a.endDate ? { endDate: x(a.endDate, c) } : {}
|
|
116
|
+
};
|
|
117
|
+
if (u.isHourly) return {
|
|
138
118
|
ok: !0,
|
|
139
119
|
values: {
|
|
140
|
-
...
|
|
141
|
-
repeat:
|
|
142
|
-
time:
|
|
143
|
-
minute:
|
|
144
|
-
...
|
|
145
|
-
...r.endDate ? { endDate: _(r.endDate) } : {}
|
|
120
|
+
...l,
|
|
121
|
+
repeat: r.Hourly,
|
|
122
|
+
time: m,
|
|
123
|
+
minute: u.minute,
|
|
124
|
+
...d
|
|
146
125
|
}
|
|
147
126
|
};
|
|
148
|
-
if (
|
|
127
|
+
if (u.isCustom) return {
|
|
149
128
|
ok: !0,
|
|
150
129
|
values: {
|
|
151
|
-
...
|
|
152
|
-
repeat:
|
|
153
|
-
time:
|
|
154
|
-
daysOfWeek:
|
|
155
|
-
...
|
|
156
|
-
...r.endDate ? { endDate: _(r.endDate) } : {}
|
|
130
|
+
...l,
|
|
131
|
+
repeat: r.Custom,
|
|
132
|
+
time: u.time,
|
|
133
|
+
daysOfWeek: u.daysOfWeek,
|
|
134
|
+
...d
|
|
157
135
|
}
|
|
158
136
|
};
|
|
159
|
-
let
|
|
160
|
-
return
|
|
137
|
+
let f = r.Daily;
|
|
138
|
+
return u.dayOfWeek ? f = r.Weekly : u.dayOfMonth && (f = r.Monthly), {
|
|
161
139
|
ok: !0,
|
|
162
140
|
values: {
|
|
163
|
-
...
|
|
164
|
-
repeat:
|
|
165
|
-
time:
|
|
166
|
-
...
|
|
167
|
-
...
|
|
168
|
-
...
|
|
169
|
-
...r.endDate ? { endDate: _(r.endDate) } : {}
|
|
141
|
+
...l,
|
|
142
|
+
repeat: f,
|
|
143
|
+
time: u.time,
|
|
144
|
+
...u.dayOfWeek ? { dayOfWeek: u.dayOfWeek } : {},
|
|
145
|
+
...u.dayOfMonth ? { dayOfMonth: u.dayOfMonth } : {},
|
|
146
|
+
...d
|
|
170
147
|
}
|
|
171
148
|
};
|
|
172
149
|
};
|
|
173
150
|
//#endregion
|
|
174
|
-
export {
|
|
151
|
+
export { v as mapFormValuesToCreateBody, y as mapFormValuesToUpdateBody, C as mapScheduledTaskDtoToFormValues };
|
package/scheduled-tasks.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { UnsupportedTriggerReason as e } from "./scheduled-task/scheduled-task-mapping.js";
|
|
2
2
|
import { ScheduledTaskTriggerDescriptionKind as t, describeScheduledTaskTrigger as n } from "./scheduled-task/scheduled-task-description.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
3
|
+
import { UTC_TIMEZONE_ID as r, findTimezoneOption as i, getTimezoneOptions as a, isKnownTimezone as o, isSameTimezone as s } from "./shared/timezones.js";
|
|
4
|
+
import { ScheduledTaskDeleteErrorKind as c, classifyScheduledTaskDeleteError as l, formatScheduledTaskRunDuration as u, formatScheduledTaskRunTimestamp as d, formatScheduledTaskScheduleLabel as f, formatScheduledTaskTriggerTime as p, formatZonedDateTime as m, selectScheduledTaskErrorMessage as h, toScheduledTaskItem as g, toScheduledTaskItems as _, toScheduledTaskRunItem as v, toScheduledTaskRunItems as y } from "./scheduled-task/scheduled-task-display.js";
|
|
5
|
+
import { mapFormValuesToCreateBody as b, mapFormValuesToUpdateBody as x, mapScheduledTaskDtoToFormValues as S } from "./scheduled-task/scheduled-task-trigger.js";
|
|
6
|
+
import { prepareScheduledTaskCreateBody as C, prepareScheduledTaskUpdateBody as w } from "./scheduled-task/scheduled-task-preparation.js";
|
|
7
|
+
import { createScheduledTasksApiClient as T } from "./scheduled-task/scheduled-tasks-api-client.js";
|
|
8
|
+
import { useScheduledTasks as E } from "./scheduled-task/use-scheduled-tasks.js";
|
|
9
|
+
import { mergeRunsById as D, useScheduledTaskRuns as O } from "./scheduled-task/use-scheduled-task-runs.js";
|
|
10
|
+
import { ScheduledTaskRunStatusFeedback as k, mergeScheduledTaskRuns as A, useStartScheduledTask as j } from "./scheduled-task/useStartScheduledTask.js";
|
|
11
|
+
import { getNextCronOccurrence as M } from "./scheduled-task/scheduled-task-next-occurrence.js";
|
|
12
|
+
import { checkScheduledTaskAuthSessionError as N } from "./scheduled-task/check-scheduled-task-auth-session-error.js";
|
|
13
|
+
import { useScheduledTaskSkillDisplayNames as P } from "./scheduled-task/useScheduledTaskSkillDisplayNames/useScheduledTaskSkillDisplayNames.js";
|
|
14
|
+
import { ActiveScheduledTaskDetailState as F, ActiveScheduledTaskStatus as I, resolveActiveScheduledTask as L } from "./scheduled-task/active-scheduled-task.js";
|
|
15
|
+
import { useActiveScheduledTaskDetails as R } from "./scheduled-task/useActiveScheduledTaskDetails.js";
|
|
16
|
+
export { F as ActiveScheduledTaskDetailState, I as ActiveScheduledTaskStatus, c as ScheduledTaskDeleteErrorKind, k as ScheduledTaskRunStatusFeedback, t as ScheduledTaskTriggerDescriptionKind, r as UTC_TIMEZONE_ID, e as UnsupportedTriggerReason, N as checkScheduledTaskAuthSessionError, l as classifyScheduledTaskDeleteError, T as createScheduledTasksApiClient, n as describeScheduledTaskTrigger, i as findTimezoneOption, u as formatScheduledTaskRunDuration, d as formatScheduledTaskRunTimestamp, f as formatScheduledTaskScheduleLabel, p as formatScheduledTaskTriggerTime, m as formatZonedDateTime, M as getNextCronOccurrence, a as getTimezoneOptions, o as isKnownTimezone, s as isSameTimezone, b as mapFormValuesToCreateBody, x as mapFormValuesToUpdateBody, S as mapScheduledTaskDtoToFormValues, D as mergeRunsById, A as mergeScheduledTaskRuns, C as prepareScheduledTaskCreateBody, w as prepareScheduledTaskUpdateBody, L as resolveActiveScheduledTask, h as selectScheduledTaskErrorMessage, g as toScheduledTaskItem, _ as toScheduledTaskItems, v as toScheduledTaskRunItem, y as toScheduledTaskRunItems, R as useActiveScheduledTaskDetails, O as useScheduledTaskRuns, P as useScheduledTaskSkillDisplayNames, E as useScheduledTasks, j as useStartScheduledTask };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ScheduledTaskTimezoneOption } from '@epam/ai-dial-scheduled-tasks';
|
|
2
|
+
/** Zone every task falls back to and the one engines may leave out of their supported list. */
|
|
3
|
+
export declare const UTC_TIMEZONE_ID = "UTC";
|
|
4
|
+
/** Options of {@link getTimezoneOptions}. */
|
|
5
|
+
export interface GetTimezoneOptionsParams {
|
|
6
|
+
/** Moment the offsets and the current abbreviation are read at. Defaults to now. */
|
|
7
|
+
now?: Date;
|
|
8
|
+
/** BCP 47 locale the abbreviations are written in. Defaults to the platform default. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
}
|
|
11
|
+
/** True when the identifier looks like an IANA id and `Intl` can format in it; an unknown name, an offset such as `+02:00` or an empty string is not a zone. */
|
|
12
|
+
export declare const isKnownTimezone: (timezone: string) => boolean;
|
|
13
|
+
/** True when both identifiers name the same zone once legacy names are resolved (`Europe/Kiev` and `Europe/Kyiv`). */
|
|
14
|
+
export declare const isSameTimezone: (a: string, b: string) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Returns every selectable IANA zone as a picker row, sorted by UTC offset and
|
|
17
|
+
* then by identifier. Offsets and the abbreviation are read at `now`; the
|
|
18
|
+
* abbreviation falls back to English (`CET`) where the locale gives none. Search
|
|
19
|
+
* terms also carry the January and July abbreviations and the long names
|
|
20
|
+
* (`Central European Time`), so `CEST` or a region name is found in any month;
|
|
21
|
+
* they are computed when a row's `searchTerms` is first read.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getTimezoneOptions: ({ now, locale, }?: GetTimezoneOptionsParams) => ScheduledTaskTimezoneOption[];
|
|
24
|
+
/**
|
|
25
|
+
* Finds the option naming the same zone as `timezone`: an exact id match, else
|
|
26
|
+
* the option for its canonical form, so a browser reporting `Asia/Calcutta`
|
|
27
|
+
* still lands on the listed `Asia/Kolkata` row. Returns `undefined` when none.
|
|
28
|
+
*/
|
|
29
|
+
export declare const findTimezoneOption: (options: readonly ScheduledTaskTimezoneOption[], timezone: string | undefined) => ScheduledTaskTimezoneOption | undefined;
|
|
30
|
+
//# sourceMappingURL=timezones.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timezones.d.ts","sourceRoot":"","sources":["../../src/shared/timezones.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAEjF,+FAA+F;AAC/F,eAAO,MAAM,eAAe,QAAQ,CAAC;AA6BrC,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,oFAAoF;IACpF,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA2DD,gKAAgK;AAChK,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,KAAG,OACc,CAAC;AAoBlE,sHAAsH;AACtH,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,OACR,CAAC;AAiG/C;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAI,mBAGhC,wBAA6B,KAAG,2BAA2B,EAyC7D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,SAAS,2BAA2B,EAAE,EAC/C,UAAU,MAAM,GAAG,SAAS,KAC3B,2BAA2B,GAAG,SAMhC,CAAC"}
|