@nylas/react 1.4.5 → 2.0.1
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/abstract-provider-efe136bd-2041bdce.js +187 -0
- package/dist/abstract-provider-efe136bd-b4663c02.cjs +1 -0
- package/dist/add-circle-icon_2.entry-5204c48a.cjs +1 -0
- package/dist/add-circle-icon_2.entry-ea1692a4.js +26 -0
- package/dist/archive-icon.entry-0b585dff.js +16 -0
- package/dist/archive-icon.entry-c2c66bca.cjs +1 -0
- package/dist/{arrow-icon.entry-5bb183c1.js → arrow-icon.entry-2e61394e.js} +5 -5
- package/dist/arrow-icon.entry-9d471162.cjs +1 -0
- package/dist/{bold-icon.entry-c919c71d.cjs → bold-icon.entry-5c37622f.cjs} +1 -1
- package/dist/{bold-icon.entry-e0010c60.js → bold-icon.entry-8ef1b653.js} +2 -2
- package/dist/{button-component_2.entry-078ee06a.cjs → button-component_2.entry-8335ee1e.cjs} +1 -1
- package/dist/{button-component_2.entry-1dd1b8d6.js → button-component_2.entry-c906230f.js} +9 -9
- package/dist/calendar-agenda-fill-icon_36.entry-59c0a997.cjs +6 -0
- package/dist/{calendar-agenda-fill-icon_36.entry-772a70d7.js → calendar-agenda-fill-icon_36.entry-5f184433.js} +900 -881
- package/dist/{calendar-cancel-icon.entry-b791b6b1.cjs → calendar-cancel-icon.entry-65a4a34e.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-7d1a7cea.js → calendar-cancel-icon.entry-dd6ac4db.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-2380a4e6.cjs → calendar-check-icon_2.entry-ded15038.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-2b5711fd.js → calendar-check-icon_2.entry-f9b50bb8.js} +3 -3
- package/dist/{calendar-icon.entry-9b23c994.js → calendar-icon.entry-a2a1ddbc.js} +2 -2
- package/dist/{calendar-icon.entry-f88c8b09.cjs → calendar-icon.entry-ca512dd6.cjs} +1 -1
- package/dist/checkbox-component_2.entry-d6128246.js +115 -0
- package/dist/checkbox-component_2.entry-d79b5d1d.cjs +1 -0
- package/dist/checkbox-group_4.entry-2946c7ef.cjs +28 -0
- package/dist/{nylas-event-calendar_3.entry-cc428f95.js → checkbox-group_4.entry-e5145451.js} +1038 -923
- package/dist/{checkmark-icon_15.entry-3ddf90df.js → checkmark-icon_15.entry-6e92e93e.js} +21 -21
- package/dist/checkmark-icon_15.entry-a75a1825.cjs +5 -0
- package/dist/{chevron-icon_3.entry-af195326.js → chevron-icon_3.entry-6eaa3513.js} +16 -16
- package/dist/{chevron-icon_3.entry-a492d340.cjs → chevron-icon_3.entry-9193a885.cjs} +1 -1
- package/dist/{clock-icon_4.entry-7dc4324b.js → clock-icon_4.entry-2c93270e.js} +8 -8
- package/dist/{clock-icon_4.entry-530cd13b.cjs → clock-icon_4.entry-ae2272f4.cjs} +1 -1
- package/dist/constants-f51538ef-cd2a67c4.cjs +1 -0
- package/dist/{constants-3d8016e3-3c080f00.js → constants-f51538ef-e0a5f026.js} +27 -32
- package/dist/{customParseFormat-129be926-36eabae2.js → customParseFormat-edc38d83-b3722499.js} +1 -1
- package/dist/{customParseFormat-129be926-30b2af24.cjs → customParseFormat-edc38d83-fa9c77d9.cjs} +1 -1
- package/dist/{delete-icon.entry-3328484a.js → delete-icon.entry-6684eba6.js} +2 -2
- package/dist/{delete-icon.entry-9369bf78.cjs → delete-icon.entry-b9e4f2c7.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-f45be1c4.cjs → document-refresh-icon.entry-7afe6163.cjs} +1 -1
- package/dist/document-refresh-icon.entry-fba9f60b.js +16 -0
- package/dist/{feedbackSync-d943ffc7-d1e98ba0.js → feedbackSync-e4378c0b-23289195.js} +811 -798
- package/dist/{feedbackSync-d943ffc7-13f01c1f.cjs → feedbackSync-e4378c0b-7876d067.cjs} +26 -26
- package/dist/{folder-icon.entry-c4ffba45.js → folder-icon.entry-430c6b47.js} +4 -4
- package/dist/{folder-icon.entry-48cfa8d0.cjs → folder-icon.entry-b1632bf3.cjs} +1 -1
- package/dist/{forward-icon.entry-dd036273.js → forward-icon.entry-5e53da76.js} +2 -2
- package/dist/{forward-icon.entry-146f3318.cjs → forward-icon.entry-7626dcca.cjs} +1 -1
- package/dist/{globe-icon_2.entry-d6a95f6e.js → globe-icon_2.entry-646eae41.js} +21 -21
- package/dist/{globe-icon_2.entry-049fbca2.cjs → globe-icon_2.entry-bbb0a6ce.cjs} +1 -1
- package/dist/{google-logo-icon_6.entry-e26385cc.js → google-logo-icon_6.entry-5951a546.js} +665 -455
- package/dist/google-logo-icon_6.entry-e39dd9cb.cjs +2 -0
- package/dist/{google-meet-icon_5.entry-c0129f58.js → google-meet-icon_5.entry-a54c83da.js} +14 -14
- package/dist/{google-meet-icon_5.entry-94112d7e.cjs → google-meet-icon_5.entry-c13e0738.cjs} +1 -1
- package/dist/inbox-icon.entry-7bee82b3.js +16 -0
- package/dist/inbox-icon.entry-911b047a.cjs +1 -0
- package/dist/index-71f61ea9.js +24544 -0
- package/dist/index-f769bc2a.cjs +118 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.es-6a9d55cf-122c27e0.js +2724 -0
- package/dist/index.es-6a9d55cf-458ba0e0.cjs +7 -0
- package/dist/{info-icon_2.entry-8bcd39dc.cjs → info-icon_2.entry-471b836b.cjs} +1 -1
- package/dist/{info-icon_2.entry-ef5dbccc.js → info-icon_2.entry-6ff2f004.js} +3 -3
- package/dist/{input-component.entry-922063d5.js → input-component.entry-781b584c.js} +12 -12
- package/dist/{input-component.entry-cc1fb2fa.cjs → input-component.entry-b6a9b4cb.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-4041c294.js → input-dropdown_2.entry-1feebcba.js} +4 -4
- package/dist/{input-dropdown_2.entry-f3750e99.cjs → input-dropdown_2.entry-c71d14ff.cjs} +1 -1
- package/dist/{italic-icon.entry-63b6943f.cjs → italic-icon.entry-16debde5.cjs} +1 -1
- package/dist/italic-icon.entry-9ef7f4a2.js +16 -0
- package/dist/{elements → lib/elements}/index.d.ts +1 -1
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/main.d.ts +0 -0
- package/dist/lib/notetaker/CalendarSync/CalendarSync.d.ts +37 -0
- package/dist/lib/notetaker/CalendarSync/CalendarSync.spec.d.ts +0 -0
- package/dist/lib/notetaker/SendNotetaker/SendNotetaker.d.ts +31 -0
- package/dist/lib/notetaker/SendNotetaker/SendNotetaker.spec.d.ts +1 -0
- package/dist/lib/notetaker/Transcript/Transcript.d.ts +23 -0
- package/dist/lib/notetaker/Transcript/Transcript.spec.d.ts +0 -0
- package/dist/lib/notetaker/VideoPlayer/VideoPlayer.d.ts +22 -0
- package/dist/lib/notetaker/VideoPlayer/VideoPlayer.spec.d.ts +1 -0
- package/dist/lib/notetaker/index.d.ts +9 -0
- package/dist/lib/notetaker/lib/constants.d.ts +12 -0
- package/dist/lib/notetaker/lib/http-client.d.ts +2 -0
- package/dist/lib/notetaker/lib/primitives.d.ts +66 -0
- package/dist/lib/notetaker/lib/store.d.ts +7 -0
- package/dist/lib/notetaker/types.d.ts +42 -0
- package/dist/multi-select-dropdown.entry-0a6f9417.cjs +1 -0
- package/dist/multi-select-dropdown.entry-1b27c746.js +121 -0
- package/dist/nylas-booked-event-card_11.entry-74fba802.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-7eceb6b6.js → nylas-booked-event-card_11.entry-802671ee.js} +469 -534
- package/dist/{nylas-form-card.entry-984be5f9.cjs → nylas-form-card.entry-59a837c9.cjs} +1 -1
- package/dist/{nylas-form-card.entry-dd3f240a.js → nylas-form-card.entry-7da9a312.js} +3 -3
- package/dist/nylas-notification_2.entry-8f8bad34.cjs +1 -0
- package/dist/nylas-notification_2.entry-b16bb805.js +85 -0
- package/dist/{nylas-scheduler-editor.entry-623da747.js → nylas-scheduler-editor.entry-cbe3e1e3.js} +201 -168
- package/dist/nylas-scheduler-editor.entry-e33e11fb.cjs +2 -0
- package/dist/nylas-scheduling.entry-4223e50b.cjs +1 -0
- package/dist/{nylas-scheduling.entry-6608aa36.js → nylas-scheduling.entry-6fb094a8.js} +295 -295
- package/dist/{person-icon.entry-9f0233cd.js → person-icon.entry-6232e6fd.js} +7 -7
- package/dist/{person-icon.entry-168ba481.cjs → person-icon.entry-beb26b48.cjs} +1 -1
- package/dist/play-icon.entry-16a1c1ac.js +16 -0
- package/dist/{play-icon.entry-4115845d.cjs → play-icon.entry-9060d0d8.cjs} +1 -1
- package/dist/{radio-button-group.entry-da3f23ac.js → radio-button-group.entry-5a3728cd.js} +2 -2
- package/dist/{radio-button-group.entry-3ae5f246.cjs → radio-button-group.entry-6935c39d.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +135 -126
- package/dist/{refresh-icon.entry-13742bb5.cjs → refresh-icon.entry-2411b2e1.cjs} +1 -1
- package/dist/{refresh-icon.entry-e1db3ca5.js → refresh-icon.entry-4f56e72b.js} +2 -2
- package/dist/{register-component-083eb961-763c87e9.js → register-component-a1c3d7b4-774feacc.js} +1 -1
- package/dist/{register-component-083eb961-c5c48a1b.cjs → register-component-a1c3d7b4-97d7a6f5.cjs} +1 -1
- package/dist/{reply-all-icon.entry-9446c2d0.cjs → reply-all-icon.entry-b4b6926b.cjs} +1 -1
- package/dist/{reply-all-icon.entry-ded706c7.js → reply-all-icon.entry-b4b917ec.js} +2 -2
- package/dist/{reply-icon.entry-7c5c0fd9.js → reply-icon.entry-24f6f4c6.js} +5 -5
- package/dist/{reply-icon.entry-0d362c63.cjs → reply-icon.entry-454545ed.cjs} +1 -1
- package/dist/sent-icon.entry-d9a79336.cjs +1 -0
- package/dist/sent-icon.entry-fa59ce85.js +16 -0
- package/dist/spam-icon.entry-da39987e.cjs +1 -0
- package/dist/spam-icon.entry-fb18a08b.js +16 -0
- package/dist/{star-icon.entry-3a81207c.js → star-icon.entry-406472c1.js} +4 -4
- package/dist/{star-icon.entry-87823b56.cjs → star-icon.entry-833f35a7.cjs} +1 -1
- package/dist/{stop-icon.entry-472a11dc.js → stop-icon.entry-1b6ae838.js} +2 -2
- package/dist/{stop-icon.entry-ddf9242a.cjs → stop-icon.entry-3258db59.cjs} +1 -1
- package/dist/style.css +1 -0
- package/dist/test/vitest.setup.d.ts +0 -0
- package/dist/{textarea-component.entry-2c6c0c7e.cjs → textarea-component.entry-0ae18897.cjs} +1 -1
- package/dist/{textarea-component.entry-f9797150.js → textarea-component.entry-569a281e.js} +2 -2
- package/dist/{toggle-switch.entry-fbef6918.cjs → toggle-switch.entry-60d75f16.cjs} +1 -1
- package/dist/{toggle-switch.entry-a7cbc256.js → toggle-switch.entry-dc3f796b.js} +4 -4
- package/dist/{translate-icon.entry-0ab604fe.js → translate-icon.entry-297cf20f.js} +4 -4
- package/dist/{translate-icon.entry-2fe4868f.cjs → translate-icon.entry-c183ecb5.cjs} +1 -1
- package/dist/trash-fill-icon.entry-3d8a2e5e.js +16 -0
- package/dist/trash-fill-icon.entry-94d4f66c.cjs +1 -0
- package/dist/{underline-icon.entry-29366789.js → underline-icon.entry-4a9105c7.js} +2 -2
- package/dist/{underline-icon.entry-6a2ca451.cjs → underline-icon.entry-50d1e766.cjs} +1 -1
- package/package.json +41 -17
- package/dist/add-circle-icon_2.entry-55361a03.js +0 -26
- package/dist/add-circle-icon_2.entry-75a3df95.cjs +0 -1
- package/dist/archive-icon.entry-3c4e4b28.js +0 -16
- package/dist/archive-icon.entry-8aa151fd.cjs +0 -1
- package/dist/arrow-icon.entry-2cef5ca1.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_36.entry-9b694a33.cjs +0 -6
- package/dist/checkbox-component.entry-94fd68e7.js +0 -43
- package/dist/checkbox-component.entry-af77c4fa.cjs +0 -1
- package/dist/checkmark-icon_15.entry-de65b967.cjs +0 -5
- package/dist/constants-3d8016e3-fd6c3848.cjs +0 -1
- package/dist/document-refresh-icon.entry-902ead30.js +0 -16
- package/dist/google-logo-icon_6.entry-4d9e06be.cjs +0 -2
- package/dist/inbox-icon.entry-74d7a10d.js +0 -16
- package/dist/inbox-icon.entry-94683ba9.cjs +0 -1
- package/dist/index-3b0366ac.cjs +0 -57
- package/dist/index-6e735f92.js +0 -18483
- package/dist/index.es-4615d47c-9156501b.js +0 -2908
- package/dist/index.es-4615d47c-b7c254fe.cjs +0 -7
- package/dist/italic-icon.entry-6706da64.js +0 -16
- package/dist/multi-select-dropdown_2.entry-1096321d.cjs +0 -1
- package/dist/multi-select-dropdown_2.entry-e10a9439.js +0 -193
- package/dist/nylas-booked-event-card_12.entry-38f37135.cjs +0 -1
- package/dist/nylas-event-calendar_3.entry-7dad0f2f.cjs +0 -11
- package/dist/nylas-scheduler-editor.entry-8fb56081.cjs +0 -2
- package/dist/nylas-scheduling.entry-472ef577.cjs +0 -1
- package/dist/play-icon.entry-5fbfabb5.js +0 -16
- package/dist/sent-icon.entry-92434496.cjs +0 -1
- package/dist/sent-icon.entry-bc9d1b35.js +0 -16
- package/dist/spam-icon.entry-11370b68.js +0 -16
- package/dist/spam-icon.entry-e0313c63.cjs +0 -1
- package/dist/trash-fill-icon.entry-1904e8d6.cjs +0 -1
- package/dist/trash-fill-icon.entry-4bdfb061.js +0 -16
- package/dist/warning-icon.entry-1649ffe7.js +0 -16
- package/dist/warning-icon.entry-3f848ed6.cjs +0 -1
- /package/dist/{elements → lib/elements}/react-component-lib/createComponent.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/createOverlayComponent.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/index.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/interfaces.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/attachProps.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/case.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/dev.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/index.d.ts +0 -0
package/dist/{nylas-scheduler-editor.entry-623da747.js → nylas-scheduler-editor.entry-cbe3e1e3.js}
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { d as dayjs, u as utc, t as timezone, p as process, c as commonjsGlobal, r as registerInstance, a as createEvent, b as debug, N as NylasIdentityRequestWrapper, i as instance, h, H as Host, g as getElement, e as createStore, B as Buffer, F as Fragment, f as dataResponse, j as getCalendarRange } from "./index-
|
|
5
|
-
import { N as NylasBaseProvider
|
|
6
|
-
import {
|
|
1
|
+
var le = Object.defineProperty;
|
|
2
|
+
var ce = (r, t, n) => t in r ? le(r, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[t] = n;
|
|
3
|
+
var N = (r, t, n) => (ce(r, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import { d as dayjs, u as utc, t as timezone, p as process, c as commonjsGlobal, r as registerInstance, a as createEvent, b as debug, N as NylasIdentityRequestWrapper, i as instance, h, H as Host, g as getElement, e as createStore, B as Buffer, F as Fragment, f as dataResponse, j as getCalendarRange } from "./index-71f61ea9.js";
|
|
5
|
+
import { N as NylasBaseProvider } from "./abstract-provider-efe136bd-2041bdce.js";
|
|
6
|
+
import { X as Xr } from "./index.es-6a9d55cf-122c27e0.js";
|
|
7
|
+
import { L as LANGUAGE_CODE, a as LANGUAGE_MAP, C as CONFIGURATION_EVENT_TYPE } from "./constants-f51538ef-e0a5f026.js";
|
|
7
8
|
import "react";
|
|
8
9
|
import "react/jsx-runtime";
|
|
9
10
|
import "react-dom";
|
|
@@ -11,26 +12,36 @@ dayjs.extend(utc);
|
|
|
11
12
|
dayjs.extend(timezone);
|
|
12
13
|
class NylasSchedulerConfigAPIConnector {
|
|
13
14
|
constructor({ nylasApiRequest: t, nylasSchedulerConfigStore: n }) {
|
|
14
|
-
this.nylasApiRequest = t, this.nylasSchedulerConfigStore = n;
|
|
15
|
+
this.groupEventsCache = /* @__PURE__ */ new Map(), this.CACHE_DURATION = 1 * 60 * 1e3, this.nylasApiRequest = t, this.nylasSchedulerConfigStore = n;
|
|
15
16
|
}
|
|
16
17
|
async currentUser() {
|
|
17
18
|
return this.nylasApiRequest ? this.nylasApiRequest.currentUser() : (console.warn("Nylas API Request is not initialized"), null);
|
|
18
19
|
}
|
|
19
20
|
async getCalendars() {
|
|
20
|
-
var
|
|
21
|
+
var a;
|
|
21
22
|
if (!this.nylasApiRequest)
|
|
22
23
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
23
24
|
message: "Error fetching calendars: Nylas API Request is not initialized"
|
|
24
25
|
});
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
const t = [];
|
|
27
|
+
let n = null;
|
|
28
|
+
const s = 50;
|
|
29
|
+
do {
|
|
30
|
+
const [l, d] = await this.nylasApiRequest.request({
|
|
31
|
+
method: "GET",
|
|
32
|
+
path: `calendars?limit=${s}${n ? `&page_token=${n}` : ""}`
|
|
33
|
+
});
|
|
34
|
+
if (d)
|
|
35
|
+
return dataResponse(null, {
|
|
36
|
+
message: "Error fetching calendars: " + d.message
|
|
37
|
+
});
|
|
38
|
+
if (Xr(l))
|
|
39
|
+
return dataResponse(null, {
|
|
40
|
+
message: "Error fetching calendars: " + ((a = l.error) == null ? void 0 : a.message)
|
|
41
|
+
});
|
|
42
|
+
t.push(...l.data), n = l.next_cursor || null;
|
|
43
|
+
} while (n);
|
|
44
|
+
return this.nylasSchedulerConfigStore.state.calendars = t, dataResponse(t);
|
|
34
45
|
}
|
|
35
46
|
async getConfigurationById(t, n = !1) {
|
|
36
47
|
var l;
|
|
@@ -162,34 +173,47 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
162
173
|
message: "Error creating group event: " + a.message
|
|
163
174
|
})) : Xr(s) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
164
175
|
message: "Error creating group event: " + ((l = s.error) == null ? void 0 : l.message)
|
|
165
|
-
})) : (this.nylasSchedulerConfigStore.state.selectedGroupEvent = s.data, await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(s.data));
|
|
176
|
+
})) : (this.nylasSchedulerConfigStore.state.selectedGroupEvent = s.data, await this.getGroupEvents(n, this.nylasSchedulerConfigStore.state.selectedConfiguration), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(s.data));
|
|
166
177
|
}
|
|
167
|
-
async getGroupEvents(t) {
|
|
168
|
-
var
|
|
178
|
+
async getGroupEvents(t, n) {
|
|
179
|
+
var m, y;
|
|
169
180
|
if (!this.nylasApiRequest)
|
|
170
181
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
171
182
|
message: "Error fetching group events: Nylas API Request is not initialized"
|
|
172
183
|
});
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
184
|
+
const s = new URLSearchParams();
|
|
185
|
+
s.append("show_all", "true");
|
|
186
|
+
const a = this.nylasSchedulerConfigStore.state.calendarViewDateRange;
|
|
187
|
+
let l, d;
|
|
188
|
+
if (a)
|
|
189
|
+
l = a.start_time, d = a.end_time;
|
|
178
190
|
else {
|
|
179
|
-
const
|
|
180
|
-
|
|
191
|
+
const w = getCalendarRange((/* @__PURE__ */ new Date()).toISOString(), "week");
|
|
192
|
+
l = w.startTime.toString(), d = w.endTime.toString();
|
|
181
193
|
}
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
194
|
+
const c = `${t}-${l}-${d}`, u = this.groupEventsCache.get(c);
|
|
195
|
+
if (u && Date.now() - u.timestamp < this.CACHE_DURATION)
|
|
196
|
+
return this.nylasSchedulerConfigStore.state.groupEvents = u.data, dataResponse(u.data);
|
|
197
|
+
s.append("start_time", l), s.append("end_time", d);
|
|
198
|
+
const f = (m = n == null ? void 0 : n.group_booking) == null ? void 0 : m.calendar_id;
|
|
199
|
+
f && s.append("calendar_id", f);
|
|
200
|
+
const [g, p] = await this.nylasApiRequest.request({
|
|
185
201
|
method: "GET",
|
|
186
|
-
path: `scheduling/configurations/${t}/group-events?${
|
|
202
|
+
path: `scheduling/configurations/${t}/group-events?${s.toString()}`
|
|
187
203
|
});
|
|
188
|
-
return
|
|
189
|
-
message: "Error fetching group events: " +
|
|
190
|
-
}) : Xr(
|
|
191
|
-
message: "Error fetching group events: " + ((
|
|
192
|
-
}) : (this.
|
|
204
|
+
return p ? dataResponse(null, {
|
|
205
|
+
message: "Error fetching group events: " + p.message
|
|
206
|
+
}) : Xr(g) ? dataResponse(null, {
|
|
207
|
+
message: "Error fetching group events: " + ((y = g.error) == null ? void 0 : y.message)
|
|
208
|
+
}) : (this.groupEventsCache.set(c, {
|
|
209
|
+
data: g.data,
|
|
210
|
+
timestamp: Date.now()
|
|
211
|
+
}), this.cleanupExpiredCache(), this.nylasSchedulerConfigStore.state.groupEvents = g.data, dataResponse(g.data));
|
|
212
|
+
}
|
|
213
|
+
cleanupExpiredCache() {
|
|
214
|
+
const t = Date.now();
|
|
215
|
+
for (const [n, s] of this.groupEventsCache.entries())
|
|
216
|
+
t - s.timestamp > this.CACHE_DURATION && this.groupEventsCache.delete(n);
|
|
193
217
|
}
|
|
194
218
|
async updateGroupEventById(t, n) {
|
|
195
219
|
var d;
|
|
@@ -208,12 +232,12 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
208
232
|
message: "Error updating group event: " + l.message
|
|
209
233
|
})) : Xr(a) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
210
234
|
message: "Error updating group event: " + ((d = a.error) == null ? void 0 : d.message)
|
|
211
|
-
})) : (this.nylasSchedulerConfigStore.state.selectedGroupEvent = a.data, await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(a.data));
|
|
235
|
+
})) : (this.nylasSchedulerConfigStore.state.selectedGroupEvent = a.data, await this.getGroupEvents(n, this.nylasSchedulerConfigStore.state.selectedConfiguration), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(a.data));
|
|
212
236
|
}
|
|
213
237
|
async updateGroupEvent(t, n, s) {
|
|
214
|
-
var
|
|
238
|
+
var p, m, y, w, _, x, R, A, k, U, P, O, I, T;
|
|
215
239
|
this.nylasSchedulerConfigStore.state.isLoading = !0;
|
|
216
|
-
const a = this.nylasSchedulerConfigStore.state.selectedGroupEvent, l = (
|
|
240
|
+
const a = this.nylasSchedulerConfigStore.state.selectedGroupEvent, l = (p = a == null ? void 0 : a.event) == null ? void 0 : p.master_event_id, d = (m = a == null ? void 0 : a.event) == null ? void 0 : m.id, c = (w = (y = a == null ? void 0 : a.event) == null ? void 0 : y.when) == null ? void 0 : w.start_time, u = (x = (_ = a == null ? void 0 : a.group_event_info) == null ? void 0 : _.rrule) == null ? void 0 : x[0], f = u ? u.split(";").filter((S) => !S.startsWith("UNTIL")).join(";") : "", g = c ? dayjs(c * 1e3).subtract(1, "minute").format("YYYYMMDDTHHmmss[Z]") : "";
|
|
217
241
|
if (n === "this")
|
|
218
242
|
return this.updateGroupEventById({
|
|
219
243
|
...t,
|
|
@@ -226,9 +250,9 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
226
250
|
conferencing: (A = a == null ? void 0 : a.event) == null ? void 0 : A.conferencing,
|
|
227
251
|
title: (k = a == null ? void 0 : a.event) == null ? void 0 : k.title,
|
|
228
252
|
description: (U = a == null ? void 0 : a.event) == null ? void 0 : U.description,
|
|
229
|
-
capacity: (
|
|
253
|
+
capacity: (P = a == null ? void 0 : a.group_event_info) == null ? void 0 : P.capacity,
|
|
230
254
|
calendar_id: (O = a == null ? void 0 : a.event) == null ? void 0 : O.calendar_id,
|
|
231
|
-
recurrence: f ? [f + ";UNTIL=" +
|
|
255
|
+
recurrence: f ? [f + ";UNTIL=" + g] : [`RRULE:FREQ=DAILY;UNTIL=${g}`]
|
|
232
256
|
};
|
|
233
257
|
return await this.updateGroupEventById({
|
|
234
258
|
...v,
|
|
@@ -236,44 +260,44 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
236
260
|
}, s), [v, S];
|
|
237
261
|
} else if (n === "all") {
|
|
238
262
|
const S = t == null ? void 0 : t.when, v = (I = a == null ? void 0 : a.event) == null ? void 0 : I.when, L = (T = this.nylasSchedulerConfigStore.state.masterGroupEvents) == null ? void 0 : T[l];
|
|
239
|
-
let
|
|
240
|
-
return (S == null ? void 0 : S.start_time) !== (v == null ? void 0 : v.start_time) && (
|
|
241
|
-
...
|
|
242
|
-
start_time: (S == null ? void 0 : S.start_time) || (
|
|
243
|
-
}), (S == null ? void 0 : S.end_time) !== (v == null ? void 0 : v.end_time) && (
|
|
244
|
-
...
|
|
245
|
-
end_time: (S == null ? void 0 : S.end_time) || (
|
|
246
|
-
}), (S == null ? void 0 : S.start_timezone) !== (v == null ? void 0 : v.start_timezone) && (
|
|
247
|
-
...
|
|
248
|
-
start_timezone: (S == null ? void 0 : S.start_timezone) || (
|
|
249
|
-
}), (S == null ? void 0 : S.end_timezone) !== (v == null ? void 0 : v.end_timezone) && (
|
|
250
|
-
...
|
|
251
|
-
end_timezone: (S == null ? void 0 : S.end_timezone) || (
|
|
263
|
+
let b = L == null ? void 0 : L.when;
|
|
264
|
+
return (S == null ? void 0 : S.start_time) !== (v == null ? void 0 : v.start_time) && (b = {
|
|
265
|
+
...b,
|
|
266
|
+
start_time: (S == null ? void 0 : S.start_time) || (b == null ? void 0 : b.start_time)
|
|
267
|
+
}), (S == null ? void 0 : S.end_time) !== (v == null ? void 0 : v.end_time) && (b = {
|
|
268
|
+
...b,
|
|
269
|
+
end_time: (S == null ? void 0 : S.end_time) || (b == null ? void 0 : b.end_time)
|
|
270
|
+
}), (S == null ? void 0 : S.start_timezone) !== (v == null ? void 0 : v.start_timezone) && (b = {
|
|
271
|
+
...b,
|
|
272
|
+
start_timezone: (S == null ? void 0 : S.start_timezone) || (b == null ? void 0 : b.start_timezone)
|
|
273
|
+
}), (S == null ? void 0 : S.end_timezone) !== (v == null ? void 0 : v.end_timezone) && (b = {
|
|
274
|
+
...b,
|
|
275
|
+
end_timezone: (S == null ? void 0 : S.end_timezone) || (b == null ? void 0 : b.end_timezone)
|
|
252
276
|
}), this.updateGroupEventById({
|
|
253
277
|
...t,
|
|
254
|
-
when:
|
|
278
|
+
when: b,
|
|
255
279
|
id: l
|
|
256
280
|
}, s);
|
|
257
281
|
}
|
|
258
282
|
throw this.nylasSchedulerConfigStore.state.isLoading = !1, new Error("Invalid option");
|
|
259
283
|
}
|
|
260
284
|
async deleteGroupEvent(t, n, s) {
|
|
261
|
-
var m, y, w,
|
|
285
|
+
var m, y, w, _, x, R, A, k, U, P, O, I;
|
|
262
286
|
this.nylasSchedulerConfigStore.state.isLoading = !0;
|
|
263
|
-
const a = this.nylasSchedulerConfigStore.state.selectedGroupEvent, l = (m = a == null ? void 0 : a.event) == null ? void 0 : m.master_event_id, d = (y = a == null ? void 0 : a.event) == null ? void 0 : y.id, c = (
|
|
287
|
+
const a = this.nylasSchedulerConfigStore.state.selectedGroupEvent, l = (m = a == null ? void 0 : a.event) == null ? void 0 : m.master_event_id, d = (y = a == null ? void 0 : a.event) == null ? void 0 : y.id, c = (_ = (w = a == null ? void 0 : a.event) == null ? void 0 : w.when) == null ? void 0 : _.start_time, u = (R = (x = a == null ? void 0 : a.group_event_info) == null ? void 0 : x.rrule) == null ? void 0 : R[0], f = u ? u.split(";").filter((T) => !T.startsWith("UNTIL")).join(";") : "", g = c ? dayjs(c * 1e3).format("YYYYMMDDTHHmmss[Z]") : "", p = {
|
|
264
288
|
location: (A = a == null ? void 0 : a.event) == null ? void 0 : A.location,
|
|
265
289
|
conferencing: (k = a == null ? void 0 : a.event) == null ? void 0 : k.conferencing,
|
|
266
290
|
title: (U = a == null ? void 0 : a.event) == null ? void 0 : U.title,
|
|
267
|
-
description: (
|
|
291
|
+
description: (P = a == null ? void 0 : a.event) == null ? void 0 : P.description,
|
|
268
292
|
capacity: (O = a == null ? void 0 : a.group_event_info) == null ? void 0 : O.capacity,
|
|
269
293
|
calendar_id: (I = a == null ? void 0 : a.event) == null ? void 0 : I.calendar_id,
|
|
270
|
-
recurrence: f ? [f + ";UNTIL=" +
|
|
294
|
+
recurrence: f ? [f + ";UNTIL=" + g] : [`RRULE:UNTIL=${g}`]
|
|
271
295
|
};
|
|
272
296
|
if (n === "this" && d)
|
|
273
297
|
return this.deleteGroupEventById(d, s);
|
|
274
298
|
if (n === "future" && l && d)
|
|
275
299
|
return await this.deleteGroupEventById(d, s), await this.updateGroupEventById({
|
|
276
|
-
...
|
|
300
|
+
...p,
|
|
277
301
|
id: l
|
|
278
302
|
}, s);
|
|
279
303
|
if (n === "all" && l)
|
|
@@ -296,10 +320,10 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
296
320
|
message: "Error deleting group event: " + d.message
|
|
297
321
|
})) : Xr(l) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
298
322
|
message: "Error deleting group event: " + ((f = l.error) == null ? void 0 : f.message)
|
|
299
|
-
})) : (await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(l.data));
|
|
323
|
+
})) : (await this.getGroupEvents(n, this.nylasSchedulerConfigStore.state.selectedConfiguration), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(l.data));
|
|
300
324
|
}
|
|
301
325
|
async importGroupEvent(t, n) {
|
|
302
|
-
var c, u, f,
|
|
326
|
+
var c, u, f, g, p;
|
|
303
327
|
if (this.nylasSchedulerConfigStore.state.isLoading = !0, !this.nylasApiRequest)
|
|
304
328
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
305
329
|
message: "Error importing group event: Nylas API Request is not initialized"
|
|
@@ -315,7 +339,7 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
315
339
|
message: "Error importing group event: " + d.message
|
|
316
340
|
})) : Xr(l) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
317
341
|
message: "Error importing group event: " + ((f = l.error) == null ? void 0 : f.message)
|
|
318
|
-
})) : (((
|
|
342
|
+
})) : (((p = (g = l.data) == null ? void 0 : g.imported_events) == null ? void 0 : p.length) > 0 && await this.getGroupEvents(n, this.nylasSchedulerConfigStore.state.selectedConfiguration), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(l.data));
|
|
319
343
|
}
|
|
320
344
|
}
|
|
321
345
|
class NylasSchedulerConfigConnector {
|
|
@@ -387,7 +411,7 @@ class LocalStorage {
|
|
|
387
411
|
const PKCE_KEY = "pkce", GRANT_KEY = "grant", USER_KEY = "user";
|
|
388
412
|
class Storage {
|
|
389
413
|
constructor(t) {
|
|
390
|
-
|
|
414
|
+
N(this, "Storage", new LocalStorage());
|
|
391
415
|
if (t) {
|
|
392
416
|
this.Storage = t;
|
|
393
417
|
return;
|
|
@@ -463,8 +487,8 @@ class Storage {
|
|
|
463
487
|
}
|
|
464
488
|
class IndexedDBStorage {
|
|
465
489
|
constructor() {
|
|
466
|
-
|
|
467
|
-
|
|
490
|
+
N(this, "databaseName", "identity-db");
|
|
491
|
+
N(this, "storeName", "identity");
|
|
468
492
|
}
|
|
469
493
|
get(t) {
|
|
470
494
|
const n = this;
|
|
@@ -490,11 +514,11 @@ class IndexedDBStorage {
|
|
|
490
514
|
}, l.onerror = () => {
|
|
491
515
|
a(l.error);
|
|
492
516
|
}, l.onsuccess = (d) => {
|
|
493
|
-
const c = d.target.result, u = c.transaction(this.storeName, "readwrite"),
|
|
494
|
-
|
|
517
|
+
const c = d.target.result, u = c.transaction(this.storeName, "readwrite"), g = u.objectStore(this.storeName).delete(t);
|
|
518
|
+
g.onsuccess = () => {
|
|
495
519
|
s(null);
|
|
496
|
-
},
|
|
497
|
-
a(
|
|
520
|
+
}, g.onerror = () => {
|
|
521
|
+
a(g.error);
|
|
498
522
|
}, u.oncomplete = () => {
|
|
499
523
|
c.close();
|
|
500
524
|
};
|
|
@@ -509,11 +533,11 @@ class IndexedDBStorage {
|
|
|
509
533
|
}, l.onupgradeneeded = (d) => {
|
|
510
534
|
d.target.result.createObjectStore(this.storeName);
|
|
511
535
|
}, l.onsuccess = (d) => {
|
|
512
|
-
const c = d.target.result, u = c.transaction(this.storeName, "readwrite"),
|
|
513
|
-
|
|
536
|
+
const c = d.target.result, u = c.transaction(this.storeName, "readwrite"), g = u.objectStore(this.storeName).put(n, t);
|
|
537
|
+
g.onsuccess = () => {
|
|
514
538
|
s(n);
|
|
515
|
-
},
|
|
516
|
-
a(
|
|
539
|
+
}, g.onerror = () => {
|
|
540
|
+
a(g.error);
|
|
517
541
|
}, u.oncomplete = () => {
|
|
518
542
|
c.close();
|
|
519
543
|
};
|
|
@@ -690,11 +714,11 @@ var sha256 = { exports: {} };
|
|
|
690
714
|
r[16] = this.block, r[t >> 2] |= EXTRA[t & 3], this.block = r[16], t >= 56 && (this.hashed || this.hash(), r[0] = this.block, r[16] = r[1] = r[2] = r[3] = r[4] = r[5] = r[6] = r[7] = r[8] = r[9] = r[10] = r[11] = r[12] = r[13] = r[14] = r[15] = 0), r[14] = this.hBytes << 3 | this.bytes >>> 29, r[15] = this.bytes << 3, this.hash();
|
|
691
715
|
}
|
|
692
716
|
}, Sha256.prototype.hash = function() {
|
|
693
|
-
var r = this.h0, t = this.h1, n = this.h2, s = this.h3, a = this.h4, l = this.h5, d = this.h6, c = this.h7, u = this.blocks, f,
|
|
717
|
+
var r = this.h0, t = this.h1, n = this.h2, s = this.h3, a = this.h4, l = this.h5, d = this.h6, c = this.h7, u = this.blocks, f, g, p, m, y, w, _, x, R, A, k;
|
|
694
718
|
for (f = 16; f < 64; ++f)
|
|
695
|
-
y = u[f - 15],
|
|
719
|
+
y = u[f - 15], g = (y >>> 7 | y << 25) ^ (y >>> 18 | y << 14) ^ y >>> 3, y = u[f - 2], p = (y >>> 17 | y << 15) ^ (y >>> 19 | y << 13) ^ y >>> 10, u[f] = u[f - 16] + g + u[f - 7] + p << 0;
|
|
696
720
|
for (k = t & n, f = 0; f < 64; f += 4)
|
|
697
|
-
this.first ? (this.is224 ? (x = 300032, y = u[0] - 1413257819, c = y - 150054599 << 0, s = y + 24177077 << 0) : (x = 704751109, y = u[0] - 210244248, c = y - 1521486534 << 0, s = y + 143694565 << 0), this.first = !1) : (
|
|
721
|
+
this.first ? (this.is224 ? (x = 300032, y = u[0] - 1413257819, c = y - 150054599 << 0, s = y + 24177077 << 0) : (x = 704751109, y = u[0] - 210244248, c = y - 1521486534 << 0, s = y + 143694565 << 0), this.first = !1) : (g = (r >>> 2 | r << 30) ^ (r >>> 13 | r << 19) ^ (r >>> 22 | r << 10), p = (a >>> 6 | a << 26) ^ (a >>> 11 | a << 21) ^ (a >>> 25 | a << 7), x = r & t, m = x ^ r & n ^ k, _ = a & l ^ ~a & d, y = c + p + _ + K[f] + u[f], w = g + m, c = s + y << 0, s = y + w << 0), g = (s >>> 2 | s << 30) ^ (s >>> 13 | s << 19) ^ (s >>> 22 | s << 10), p = (c >>> 6 | c << 26) ^ (c >>> 11 | c << 21) ^ (c >>> 25 | c << 7), R = s & r, m = R ^ s & t ^ x, _ = c & a ^ ~c & l, y = d + p + _ + K[f + 1] + u[f + 1], w = g + m, d = n + y << 0, n = y + w << 0, g = (n >>> 2 | n << 30) ^ (n >>> 13 | n << 19) ^ (n >>> 22 | n << 10), p = (d >>> 6 | d << 26) ^ (d >>> 11 | d << 21) ^ (d >>> 25 | d << 7), A = n & s, m = A ^ n & r ^ R, _ = d & c ^ ~d & a, y = l + p + _ + K[f + 2] + u[f + 2], w = g + m, l = t + y << 0, t = y + w << 0, g = (t >>> 2 | t << 30) ^ (t >>> 13 | t << 19) ^ (t >>> 22 | t << 10), p = (l >>> 6 | l << 26) ^ (l >>> 11 | l << 21) ^ (l >>> 25 | l << 7), k = t & n, m = k ^ t & s ^ A, _ = l & d ^ ~l & c, y = a + p + _ + K[f + 3] + u[f + 3], w = g + m, a = r + y << 0, r = y + w << 0;
|
|
698
722
|
this.h0 = this.h0 + r << 0, this.h1 = this.h1 + t << 0, this.h2 = this.h2 + n << 0, this.h3 = this.h3 + s << 0, this.h4 = this.h4 + a << 0, this.h5 = this.h5 + l << 0, this.h6 = this.h6 + d << 0, this.h7 = this.h7 + c << 0;
|
|
699
723
|
}, Sha256.prototype.hex = function() {
|
|
700
724
|
this.finalize();
|
|
@@ -755,12 +779,12 @@ var sha256 = { exports: {} };
|
|
|
755
779
|
} else
|
|
756
780
|
throw new Error(ERROR);
|
|
757
781
|
r.length > 64 && (r = new Sha256(t, !0).update(r).array());
|
|
758
|
-
var f = [],
|
|
782
|
+
var f = [], g = [];
|
|
759
783
|
for (s = 0; s < 64; ++s) {
|
|
760
|
-
var
|
|
761
|
-
f[s] = 92 ^
|
|
784
|
+
var p = r[s] || 0;
|
|
785
|
+
f[s] = 92 ^ p, g[s] = 54 ^ p;
|
|
762
786
|
}
|
|
763
|
-
Sha256.call(this, t, n), this.update(
|
|
787
|
+
Sha256.call(this, t, n), this.update(g), this.oKeyPad = f, this.inner = !0, this.sharedMemory = n;
|
|
764
788
|
}
|
|
765
789
|
HmacSha256.prototype = new Sha256(), HmacSha256.prototype.finalize = function() {
|
|
766
790
|
if (Sha256.prototype.finalize.call(this), this.inner) {
|
|
@@ -843,21 +867,21 @@ function getMessages(r, t, n) {
|
|
|
843
867
|
if (d.length === 0)
|
|
844
868
|
n == null || n(s), s = newMessage();
|
|
845
869
|
else if (c > 0) {
|
|
846
|
-
const u = a.decode(d.subarray(0, c)), f = c + (d[c + 1] === 32 ? 2 : 1),
|
|
870
|
+
const u = a.decode(d.subarray(0, c)), f = c + (d[c + 1] === 32 ? 2 : 1), g = a.decode(d.subarray(f));
|
|
847
871
|
switch (u) {
|
|
848
872
|
case "data":
|
|
849
873
|
s.data = s.data ? s.data + `
|
|
850
|
-
` +
|
|
874
|
+
` + g : g;
|
|
851
875
|
break;
|
|
852
876
|
case "event":
|
|
853
|
-
s.event =
|
|
877
|
+
s.event = g;
|
|
854
878
|
break;
|
|
855
879
|
case "id":
|
|
856
|
-
r(s.id =
|
|
880
|
+
r(s.id = g);
|
|
857
881
|
break;
|
|
858
882
|
case "retry":
|
|
859
|
-
const
|
|
860
|
-
isNaN(
|
|
883
|
+
const p = parseInt(g, 10);
|
|
884
|
+
isNaN(p) || t(s.retry = p);
|
|
861
885
|
break;
|
|
862
886
|
}
|
|
863
887
|
}
|
|
@@ -886,44 +910,44 @@ var __rest = function(r, t) {
|
|
|
886
910
|
};
|
|
887
911
|
const EventStreamContentType = "text/event-stream", DefaultRetryInterval = 1e3, LastEventId = "last-event-id";
|
|
888
912
|
function fetchEventSource(r, t) {
|
|
889
|
-
var { signal: n, headers: s, onopen: a, onmessage: l, onclose: d, onerror: c, openWhenHidden: u, fetch: f } = t,
|
|
890
|
-
return new Promise((
|
|
913
|
+
var { signal: n, headers: s, onopen: a, onmessage: l, onclose: d, onerror: c, openWhenHidden: u, fetch: f } = t, g = __rest(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
914
|
+
return new Promise((p, m) => {
|
|
891
915
|
const y = Object.assign({}, s);
|
|
892
916
|
y.accept || (y.accept = EventStreamContentType);
|
|
893
917
|
let w;
|
|
894
|
-
function
|
|
895
|
-
w.abort(), document.hidden ||
|
|
918
|
+
function _() {
|
|
919
|
+
w.abort(), document.hidden || P();
|
|
896
920
|
}
|
|
897
|
-
u || document.addEventListener("visibilitychange",
|
|
921
|
+
u || document.addEventListener("visibilitychange", _);
|
|
898
922
|
let x = DefaultRetryInterval, R = 0;
|
|
899
923
|
function A() {
|
|
900
|
-
document.removeEventListener("visibilitychange",
|
|
924
|
+
document.removeEventListener("visibilitychange", _), window.clearTimeout(R), w.abort();
|
|
901
925
|
}
|
|
902
926
|
n == null || n.addEventListener("abort", () => {
|
|
903
|
-
A(),
|
|
927
|
+
A(), p();
|
|
904
928
|
});
|
|
905
929
|
const k = f ?? window.fetch, U = a ?? defaultOnOpen;
|
|
906
|
-
async function
|
|
930
|
+
async function P() {
|
|
907
931
|
var O;
|
|
908
932
|
w = new AbortController();
|
|
909
933
|
try {
|
|
910
|
-
const I = await k(r, Object.assign(Object.assign({},
|
|
934
|
+
const I = await k(r, Object.assign(Object.assign({}, g), { headers: y, signal: w.signal }));
|
|
911
935
|
await U(I), await getBytes(I.body, getLines(getMessages((T) => {
|
|
912
936
|
T ? y[LastEventId] = T : delete y[LastEventId];
|
|
913
937
|
}, (T) => {
|
|
914
938
|
x = T;
|
|
915
|
-
}, l))), d == null || d(), A(),
|
|
939
|
+
}, l))), d == null || d(), A(), p();
|
|
916
940
|
} catch (I) {
|
|
917
941
|
if (!w.signal.aborted)
|
|
918
942
|
try {
|
|
919
943
|
const T = (O = c == null ? void 0 : c(I)) !== null && O !== void 0 ? O : x;
|
|
920
|
-
window.clearTimeout(R), R = window.setTimeout(
|
|
944
|
+
window.clearTimeout(R), R = window.setTimeout(P, T);
|
|
921
945
|
} catch (T) {
|
|
922
946
|
A(), m(T);
|
|
923
947
|
}
|
|
924
948
|
}
|
|
925
949
|
}
|
|
926
|
-
|
|
950
|
+
P();
|
|
927
951
|
});
|
|
928
952
|
}
|
|
929
953
|
function defaultOnOpen(r) {
|
|
@@ -990,15 +1014,15 @@ function o(r, t) {
|
|
|
990
1014
|
n$1.prototype = new Error(), n$1.prototype.name = "InvalidTokenError";
|
|
991
1015
|
class NylasSessions {
|
|
992
1016
|
constructor(t) {
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1017
|
+
N(this, "clientId");
|
|
1018
|
+
N(this, "redirectUri");
|
|
1019
|
+
N(this, "accessType", "online");
|
|
1020
|
+
N(this, "domain", "http://api.nylas.com");
|
|
1021
|
+
N(this, "versioned", !1);
|
|
1022
|
+
N(this, "Storage");
|
|
1023
|
+
N(this, "hosted", !1);
|
|
1024
|
+
N(this, "multiAccount", !1);
|
|
1025
|
+
N(this, "loginId", "");
|
|
1002
1026
|
if (this.clientId = t.clientId, this.redirectUri = t.redirectUri, t.domain && (this.domain = t.domain, this.domain.substring(this.domain.length - 3).includes("/v") && (this.versioned = !0)), t.multiAccount && (this.multiAccount = t.multiAccount), t.sw) {
|
|
1003
1027
|
const n = new IndexedDBStorage();
|
|
1004
1028
|
this.Storage = new Storage(n);
|
|
@@ -1232,17 +1256,17 @@ class NylasSessions {
|
|
|
1232
1256
|
code: s,
|
|
1233
1257
|
grant_type: "authorization_code",
|
|
1234
1258
|
code_verifier: u
|
|
1235
|
-
},
|
|
1259
|
+
}, p = await (await fetch(`${this.domain}/connect/token`, {
|
|
1236
1260
|
method: "POST",
|
|
1237
1261
|
headers: new Headers({ "content-type": "application/json" }),
|
|
1238
1262
|
body: JSON.stringify(f)
|
|
1239
1263
|
})).json();
|
|
1240
|
-
if (
|
|
1241
|
-
if (
|
|
1242
|
-
const y = { detail:
|
|
1264
|
+
if (p) {
|
|
1265
|
+
if (p.error) {
|
|
1266
|
+
const y = { detail: p };
|
|
1243
1267
|
return window.dispatchEvent(new CustomEvent("onLoginFail", y)), !0;
|
|
1244
1268
|
}
|
|
1245
|
-
const m = await this.handleCodeExchangeResponse(
|
|
1269
|
+
const m = await this.handleCodeExchangeResponse(p);
|
|
1246
1270
|
if (m.valid) {
|
|
1247
1271
|
a && (m.data.state = a);
|
|
1248
1272
|
const y = { detail: m.data };
|
|
@@ -1254,8 +1278,8 @@ class NylasSessions {
|
|
|
1254
1278
|
}
|
|
1255
1279
|
return this.Storage.removePKCE(), !0;
|
|
1256
1280
|
} catch (f) {
|
|
1257
|
-
const
|
|
1258
|
-
return window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1281
|
+
const g = { detail: f };
|
|
1282
|
+
return window.dispatchEvent(new CustomEvent("onLoginFail", g)), window.history.pushState({}, document.title, window.location.pathname), !1;
|
|
1259
1283
|
}
|
|
1260
1284
|
}
|
|
1261
1285
|
// Token Exchange for session maintenece
|
|
@@ -1277,13 +1301,13 @@ class NylasSessions {
|
|
|
1277
1301
|
})).json();
|
|
1278
1302
|
if (d) {
|
|
1279
1303
|
if (d.error) {
|
|
1280
|
-
const
|
|
1281
|
-
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",
|
|
1304
|
+
const g = { detail: d };
|
|
1305
|
+
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", g)), !0;
|
|
1282
1306
|
}
|
|
1283
1307
|
const c = getTimestamp();
|
|
1284
1308
|
if (d.expires_in = c + d.expires_in, this.Storage.setGrant(d, this.multiAccount), !await this.validateIDToken(t)) {
|
|
1285
|
-
const
|
|
1286
|
-
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",
|
|
1309
|
+
const g = { detail: d };
|
|
1310
|
+
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", g)), !0;
|
|
1287
1311
|
}
|
|
1288
1312
|
const f = { detail: d };
|
|
1289
1313
|
return window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess", f)), !0;
|
|
@@ -1319,19 +1343,19 @@ class NylasSessions {
|
|
|
1319
1343
|
return;
|
|
1320
1344
|
const f = setInterval(async () => {
|
|
1321
1345
|
if (u.closed) {
|
|
1322
|
-
const
|
|
1346
|
+
const g = {
|
|
1323
1347
|
detail: { error_description: "OAuth provider window closed" }
|
|
1324
1348
|
};
|
|
1325
|
-
window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1349
|
+
window.dispatchEvent(new CustomEvent("onLoginFail", g)), f && clearInterval(f);
|
|
1326
1350
|
return;
|
|
1327
1351
|
}
|
|
1328
1352
|
try {
|
|
1329
|
-
const
|
|
1330
|
-
if (!
|
|
1353
|
+
const g = u.location.href.split("?");
|
|
1354
|
+
if (!g[0])
|
|
1331
1355
|
return;
|
|
1332
|
-
const
|
|
1333
|
-
if (u.history.pushState({}, document.title, window.location.pathname),
|
|
1334
|
-
const m = await this.codeExchange(
|
|
1356
|
+
const p = u.location.search;
|
|
1357
|
+
if (u.history.pushState({}, document.title, window.location.pathname), g[0] === this.redirectUri && g.length > 1) {
|
|
1358
|
+
const m = await this.codeExchange(p);
|
|
1335
1359
|
u.close(), m && location.reload(), f && clearInterval(f);
|
|
1336
1360
|
return;
|
|
1337
1361
|
}
|
|
@@ -1390,11 +1414,11 @@ class NylasSessions {
|
|
|
1390
1414
|
const f = await (u == null ? void 0 : u.json());
|
|
1391
1415
|
if (!await this.isAuthenticatedResponse(u.status, f)) {
|
|
1392
1416
|
if (d > 1) {
|
|
1393
|
-
const
|
|
1394
|
-
if (
|
|
1395
|
-
|
|
1417
|
+
const p = await this.getProfile(n.grant_id);
|
|
1418
|
+
if (p) {
|
|
1419
|
+
p.status = "unauthorized", await this.Storage.setUserToken(p);
|
|
1396
1420
|
const m = {
|
|
1397
|
-
detail: { user:
|
|
1421
|
+
detail: { user: p }
|
|
1398
1422
|
};
|
|
1399
1423
|
window.dispatchEvent(new CustomEvent("onSessionExpired", m));
|
|
1400
1424
|
}
|
|
@@ -1418,7 +1442,7 @@ class NylasSessions {
|
|
|
1418
1442
|
const m = await this.getAccessToken();
|
|
1419
1443
|
f.append("Authorization", `Bearer ${m}`);
|
|
1420
1444
|
}
|
|
1421
|
-
const
|
|
1445
|
+
const g = await fetch(u.toString(), {
|
|
1422
1446
|
method: n || "GET",
|
|
1423
1447
|
headers: f,
|
|
1424
1448
|
mode: "cors",
|
|
@@ -1426,7 +1450,7 @@ class NylasSessions {
|
|
|
1426
1450
|
body: s ? JSON.stringify(s) : void 0,
|
|
1427
1451
|
...d || {}
|
|
1428
1452
|
});
|
|
1429
|
-
return a ? await
|
|
1453
|
+
return a ? await g.json() : g.body;
|
|
1430
1454
|
}
|
|
1431
1455
|
// Checks if the response is not 401
|
|
1432
1456
|
async isAuthenticatedResponse(t, n) {
|
|
@@ -1528,8 +1552,8 @@ const LoginRequired = ({ authenticationUrl: r }) => h(
|
|
|
1528
1552
|
h("small", { class: "disclaimer-text", part: "nse__login-required-disclaimer-text" }, "* You will be redirected to authenticate your account.")
|
|
1529
1553
|
)
|
|
1530
1554
|
);
|
|
1531
|
-
function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n
|
|
1532
|
-
const
|
|
1555
|
+
function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n }) {
|
|
1556
|
+
const s = (t == null ? void 0 : t.find((a) => a.is_primary)) || (t == null ? void 0 : t[0]);
|
|
1533
1557
|
switch (n) {
|
|
1534
1558
|
case CONFIGURATION_EVENT_TYPE.one_on_one:
|
|
1535
1559
|
case CONFIGURATION_EVENT_TYPE.max_availability:
|
|
@@ -1548,8 +1572,7 @@ function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n, exper
|
|
|
1548
1572
|
h("nylas-event-location", { userProvider: r.provider })
|
|
1549
1573
|
)
|
|
1550
1574
|
),
|
|
1551
|
-
h("nylas-booking-calendar-picker", { exportparts: "nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content", expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar:
|
|
1552
|
-
!l && h("nylas-scheduling-method", { showSubTitle: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
1575
|
+
h("nylas-booking-calendar-picker", { exportparts: "nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content", expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: s == null ? void 0 : s.id }),
|
|
1553
1576
|
h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" })
|
|
1554
1577
|
);
|
|
1555
1578
|
case CONFIGURATION_EVENT_TYPE.collective:
|
|
@@ -1567,8 +1590,7 @@ function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n, exper
|
|
|
1567
1590
|
h("nylas-event-location", { userProvider: r.provider })
|
|
1568
1591
|
)
|
|
1569
1592
|
),
|
|
1570
|
-
h("nylas-booking-calendar-picker", { exportparts: "nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content", expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar:
|
|
1571
|
-
!l && h("nylas-scheduling-method", { showSubTitle: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
1593
|
+
h("nylas-booking-calendar-picker", { exportparts: "nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content", expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: s == null ? void 0 : s.id }),
|
|
1572
1594
|
h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
|
|
1573
1595
|
h("nylas-additional-participants", { name: "participants", eventParticipants: [{ name: (r == null ? void 0 : r.name) || (r == null ? void 0 : r.email), email: (r == null ? void 0 : r.email) || "", is_organizer: !0 }], exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" })
|
|
1574
1596
|
);
|
|
@@ -1589,33 +1611,39 @@ function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n, exper
|
|
|
1589
1611
|
h("nylas-event-capacity", null)
|
|
1590
1612
|
)
|
|
1591
1613
|
),
|
|
1592
|
-
h("nylas-booking-calendar-picker", { exportparts: "nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content", expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar:
|
|
1614
|
+
h("nylas-booking-calendar-picker", { exportparts: "nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content", expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: s == null ? void 0 : s.id }),
|
|
1593
1615
|
h("nylas-additional-participants", { name: "participants", eventParticipants: [{ name: (r == null ? void 0 : r.name) || (r == null ? void 0 : r.email), email: (r == null ? void 0 : r.email) || "", is_organizer: !0 }], exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" }),
|
|
1594
1616
|
h("nylas-page-name", { requirePageName: !0, pageName: "Group events page" }),
|
|
1595
1617
|
h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" })
|
|
1596
1618
|
);
|
|
1597
1619
|
}
|
|
1598
1620
|
}
|
|
1599
|
-
const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 0px 6px -2px rgba(0, 0, 0, 0.05), 0px 5px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{width:-moz-available;width:-webkit-fill-available;width:fill-available;min-width:325px}}
|
|
1621
|
+
const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 0px 6px -2px rgba(0, 0, 0, 0.05), 0px 5px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{width:-moz-available;width:-webkit-fill-available;width:fill-available;min-width:325px}}:host nylas-notification{position:absolute;top:0;right:0}div.scheduler-editor-content{height:800px}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-content--group{height:800px}@media screen and (max-width: 768px){div.scheduler-editor-content--group{height:auto}}div.scheduler-editor-header{display:grid;grid-template-columns:1fr auto auto;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900);min-width:924px}@media screen and (max-width: 768px){div.scheduler-editor-header{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;margin:0;font-size:18px;line-height:24px;font-weight:600}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary);background-color:transparent}div.scheduler-editor-header button:disabled{cursor:not-allowed}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button){border:none;padding:4px;margin-right:8px}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button):hover{outline:none;color:var(--nylas-primary)}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){min-width:132px}@media screen and (max-width: 768px){div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){width:-webkit-fill-available;width:fill-available;width:-moz-available}}nylas-select-event-type{height:inherit;width:calc(924px + 2rem)}@media screen and (max-width: 768px){nylas-select-event-type{width:auto}}nylas-editor-tabs,nylas-editor-tabs-group{width:auto;height:inherit}nylas-editor-tabs .row,nylas-editor-tabs-group .row{display:flex;gap:1rem}nylas-editor-tabs .composable,nylas-editor-tabs-group .composable{height:inherit;overflow:auto}nylas-editor-tabs nylas-event-info div[slot=inputs],nylas-editor-tabs nylas-event-limits div[slot=inputs],nylas-editor-tabs-group nylas-event-info div[slot=inputs],nylas-editor-tabs-group nylas-event-limits div[slot=inputs]{display:flex;flex-direction:column;gap:1rem}.card{display:flex;flex-direction:column;padding:2rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;max-width:fit-content;align-self:center}.login-required{height:inherit;overflow-y:auto;display:flex;flex-direction:column;justify-content:center;padding:2rem 1rem;background-color:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.login-required{height:auto}}.login-required p{margin:0 0 1rem}.login-required .microsoft-button,.login-required .google-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;margin-bottom:1rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;justify-content:center;gap:0.5rem;align-items:center}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;border:0;background-color:var(--nylas-base-0);height:48px;margin-bottom:1rem;font-size:0.95rem;justify-content:center;gap:0.25rem;align-items:center}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button svg{transform:rotate(180deg)}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .disclaimer-text{font-size:0.75rem;color:var(--nylas-base-600);align-self:center}.list-configurations{padding:2rem;height:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}', NylasSchedulerEditorStyle0 = nylasSchedulerEditorCss, NylasSchedulerEditor = class {
|
|
1600
1622
|
constructor(r) {
|
|
1601
1623
|
registerInstance(this, r), this.init = createEvent(this, "init", 7), this.loggedIn = createEvent(this, "loggedIn", 7), this.loggedOut = createEvent(this, "loggedOut", 7), this.schedulerConfigCloseClicked = createEvent(this, "schedulerConfigCloseClicked", 7), this.handleSchedulerConfigCloseClicked = (t) => {
|
|
1602
1624
|
const n = this.schedulerConfigCloseClicked.emit(this.host);
|
|
1603
1625
|
"schedulerConfigCloseClicked" in this.eventOverrides && this.eventOverrides.schedulerConfigCloseClicked(n, this.nylasSchedulerConfigConnector), n.defaultPrevented || (localStorage.removeItem("grant"), localStorage.removeItem("user"), window.location.reload());
|
|
1604
|
-
}, this.authenticationUrl = async (t) => this.nylasApiRequest ? await this.nylasApiRequest.authenticationUrl({ provider: t }) || "" : (console.error("[nylas-scheduler-editor] Nylas API Request is not initialized."), ""), this.configurationId = void 0, this.nylasApiRequest = void 0, this.nylasSessionsConfig = void 0, this.defaultAuthArgs = void 0, this.eventOverrides = {}, this.schedulerPreviewLink = "", this.defaultSchedulerConfigState = void 0, this.mode = "app", this.additionalParticipants = void 0, this.hideEditorTabs = [], this.conferenceProviders = void 0, this.requiresSlug = !1, this.enableUserFeedback = !0, this.defaultLanguage = void 0, this.localization = void 0, this.nylasBranding = !0, this.experimentalFeatures = void 0, this.
|
|
1626
|
+
}, this.authenticationUrl = async (t) => this.nylasApiRequest ? await this.nylasApiRequest.authenticationUrl({ provider: t }) || "" : (console.error("[nylas-scheduler-editor] Nylas API Request is not initialized."), ""), this.configurationId = void 0, this.nylasApiRequest = void 0, this.nylasSessionsConfig = void 0, this.defaultAuthArgs = void 0, this.eventOverrides = {}, this.schedulerPreviewLink = "", this.defaultSchedulerConfigState = void 0, this.mode = "app", this.additionalParticipants = void 0, this.hideEditorTabs = [], this.conferenceProviders = void 0, this.requiresSlug = !1, this.enableUserFeedback = !0, this.defaultLanguage = void 0, this.localization = void 0, this.nylasBranding = !0, this.experimentalFeatures = void 0, this.enableEventTypes = {
|
|
1627
|
+
one_on_one: !0,
|
|
1628
|
+
collective: !0,
|
|
1629
|
+
max_fairness: !0,
|
|
1630
|
+
max_availability: !0,
|
|
1631
|
+
group: !0
|
|
1632
|
+
}, this.automaticComponentRegistration = !0, this.selectedLanguage = this.defaultLanguage || LANGUAGE_CODE.en, this.langVersion = 0, this.version = "2.0.1";
|
|
1605
1633
|
}
|
|
1606
1634
|
connectedCallback() {
|
|
1607
1635
|
debug("[nylas-scheduler-editor] connectedCallback");
|
|
1608
1636
|
}
|
|
1609
1637
|
async componentWillLoad() {
|
|
1610
|
-
var s, a, l, d, c, u, f,
|
|
1638
|
+
var s, a, l, d, c, u, f, g;
|
|
1611
1639
|
debug("[nylas-scheduler-editor] componentWillLoad");
|
|
1612
|
-
const r = (s = this.additionalParticipants) == null ? void 0 : s.filter((
|
|
1640
|
+
const r = (s = this.additionalParticipants) == null ? void 0 : s.filter((p) => {
|
|
1613
1641
|
var y;
|
|
1614
|
-
const m = ((y =
|
|
1615
|
-
if (
|
|
1642
|
+
const m = ((y = p.calendars) == null ? void 0 : y.length) > 0 ? p.calendars.filter((w) => w.id && w.name) : [];
|
|
1643
|
+
if (p.name && p.email && m.length > 0)
|
|
1616
1644
|
return {
|
|
1617
|
-
name:
|
|
1618
|
-
email:
|
|
1645
|
+
name: p.name,
|
|
1646
|
+
email: p.email,
|
|
1619
1647
|
calendars: m
|
|
1620
1648
|
};
|
|
1621
1649
|
});
|
|
@@ -1627,23 +1655,24 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1627
1655
|
requiresSlug: this.requiresSlug,
|
|
1628
1656
|
selectedLanguage: this.defaultLanguage || LANGUAGE_CODE.en,
|
|
1629
1657
|
nylasBranding: this.nylasBranding,
|
|
1630
|
-
experimentalFeatures: this.experimentalFeatures
|
|
1658
|
+
experimentalFeatures: this.experimentalFeatures,
|
|
1659
|
+
enableEventTypes: this.enableEventTypes
|
|
1631
1660
|
})
|
|
1632
1661
|
}, !this.nylasApiRequest && this.nylasSessionsConfig) {
|
|
1633
|
-
const
|
|
1634
|
-
await
|
|
1662
|
+
const p = new NylasSessions(this.nylasSessionsConfig);
|
|
1663
|
+
await p.isLoggedIn(), p.onLoginSuccess(async () => {
|
|
1635
1664
|
var y, w;
|
|
1636
1665
|
const m = await ((w = (y = this.nylasSchedulerConfigConnector) == null ? void 0 : y.schedulerConfig) == null ? void 0 : w.currentUser());
|
|
1637
1666
|
if (m) {
|
|
1638
|
-
const
|
|
1639
|
-
"loggedIn" in this.eventOverrides && await this.eventOverrides.loggedIn(
|
|
1667
|
+
const _ = this.loggedIn.emit(this.host);
|
|
1668
|
+
"loggedIn" in this.eventOverrides && await this.eventOverrides.loggedIn(_, this.nylasSchedulerConfigConnector), _.defaultPrevented || await this.loggedInHandler(m);
|
|
1640
1669
|
}
|
|
1641
|
-
}),
|
|
1670
|
+
}), p.onLoginFail(async () => {
|
|
1642
1671
|
var y, w;
|
|
1643
1672
|
(w = (y = this.stores) == null ? void 0 : y.schedulerConfig) == null || w.set("currentUser", null);
|
|
1644
1673
|
const m = this.loggedOut.emit(this.host);
|
|
1645
1674
|
"loggedOut" in this.eventOverrides && (await this.eventOverrides.loggedOut(m, this.nylasSchedulerConfigConnector), m.defaultPrevented);
|
|
1646
|
-
}), this.nylasApiRequest = new NylasIdentityRequestWrapper(
|
|
1675
|
+
}), this.nylasApiRequest = new NylasIdentityRequestWrapper(p);
|
|
1647
1676
|
}
|
|
1648
1677
|
this.nylasApiRequest && this.defaultAuthArgs && this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs), this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
|
|
1649
1678
|
const t = this.baseProvider.getStore("schedulerConfig");
|
|
@@ -1653,10 +1682,10 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1653
1682
|
});
|
|
1654
1683
|
const n = this.init.emit(this.host);
|
|
1655
1684
|
if ("init" in this.eventOverrides && await this.eventOverrides.init(n, this.nylasSchedulerConfigConnector), !n.defaultPrevented) {
|
|
1656
|
-
const
|
|
1657
|
-
if (
|
|
1685
|
+
const p = await ((l = (a = this.nylasSchedulerConfigConnector) == null ? void 0 : a.schedulerConfig) == null ? void 0 : l.currentUser());
|
|
1686
|
+
if (p) {
|
|
1658
1687
|
const m = this.loggedIn.emit(this.host);
|
|
1659
|
-
"loggedIn" in this.eventOverrides && await this.eventOverrides.loggedIn(m, this.nylasSchedulerConfigConnector), m.defaultPrevented || await this.loggedInHandler(
|
|
1688
|
+
"loggedIn" in this.eventOverrides && await this.eventOverrides.loggedIn(m, this.nylasSchedulerConfigConnector), m.defaultPrevented || await this.loggedInHandler(p);
|
|
1660
1689
|
} else {
|
|
1661
1690
|
(c = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null || c.set("currentUser", null);
|
|
1662
1691
|
const m = this.loggedOut.emit(this.host);
|
|
@@ -1664,13 +1693,13 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1664
1693
|
return;
|
|
1665
1694
|
}
|
|
1666
1695
|
}
|
|
1667
|
-
(f = (u = this.stores) == null ? void 0 : u.schedulerConfig) == null || f.onChange("selectedConfiguration", async (
|
|
1668
|
-
|
|
1669
|
-
}), (
|
|
1696
|
+
(f = (u = this.stores) == null ? void 0 : u.schedulerConfig) == null || f.onChange("selectedConfiguration", async (p) => {
|
|
1697
|
+
p && p.id && (this.configurationId = p.id);
|
|
1698
|
+
}), (g = this.baseProvider) == null || g.componentWillLoad(this.nylasSchedulerConfigConnector);
|
|
1670
1699
|
}
|
|
1671
1700
|
async componentDidLoad() {
|
|
1672
1701
|
var r;
|
|
1673
|
-
debug("[nylas-scheduler-editor] componentDidLoad"), await ((r = this.baseProvider) == null ? void 0 : r.componentDidLoad()), this.updateLocalization(this.localization);
|
|
1702
|
+
debug("[nylas-scheduler-editor] componentDidLoad"), await ((r = this.baseProvider) == null ? void 0 : r.componentDidLoad()), this.updateLocalization(this.localization), this.version = "2.0.1";
|
|
1674
1703
|
}
|
|
1675
1704
|
async componentDisconnected() {
|
|
1676
1705
|
var r;
|
|
@@ -1693,6 +1722,10 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1693
1722
|
var t, n;
|
|
1694
1723
|
(n = (t = this.stores) == null ? void 0 : t.schedulerConfig) == null || n.set("experimentalFeatures", r);
|
|
1695
1724
|
}
|
|
1725
|
+
updateEnableEventTypes(r) {
|
|
1726
|
+
var t, n;
|
|
1727
|
+
(n = (t = this.stores) == null ? void 0 : t.schedulerConfig) == null || n.set("enableEventTypes", r);
|
|
1728
|
+
}
|
|
1696
1729
|
async store() {
|
|
1697
1730
|
var r;
|
|
1698
1731
|
return (r = this.stores) == null ? void 0 : r.schedulerConfig;
|
|
@@ -1721,18 +1754,17 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1721
1754
|
}
|
|
1722
1755
|
}
|
|
1723
1756
|
render() {
|
|
1724
|
-
var a, l, d, c, u, f,
|
|
1757
|
+
var a, l, d, c, u, f, g, p, m, y, w, _, x, R, A, k, U, P, O, I, T, S, v, L, b, $, X, j, z, Y, M, V, J, W, Z, Q, ee, te, ne, se, re, oe, ie, ae;
|
|
1725
1758
|
const r = this.host.querySelector('[slot="custom-page-style-inputs"]'), t = (d = (l = (a = this.stores) == null ? void 0 : a.schedulerConfig) == null ? void 0 : l.state.selectedConfiguration) == null ? void 0 : d.id, n = Object.keys(LANGUAGE_MAP).map((q) => ({
|
|
1726
1759
|
label: LANGUAGE_MAP[q],
|
|
1727
1760
|
value: q
|
|
1728
|
-
})), s = ((u = (c = this.stores) == null ? void 0 : c.schedulerConfig) == null ? void 0 : u.state.selectedEventType) === CONFIGURATION_EVENT_TYPE.group || ((
|
|
1729
|
-
return h(Host, { key: "
|
|
1761
|
+
})), s = ((u = (c = this.stores) == null ? void 0 : c.schedulerConfig) == null ? void 0 : u.state.selectedEventType) === CONFIGURATION_EVENT_TYPE.group || ((p = (g = (f = this.stores) == null ? void 0 : f.schedulerConfig) == null ? void 0 : g.state.selectedConfiguration) == null ? void 0 : p.type) === CONFIGURATION_EVENT_TYPE.group;
|
|
1762
|
+
return h(Host, { key: "f2ff98b69f59cf94f68e0a72750db304d5f5781c" }, h("div", { key: "382bac7a0ba7735ce0c6704f825d8a18a3faf412", class: "scheduler-editor-header", part: "nse__header" }, h("h1", { key: "eb011947ed70b8f7b2bd73a1d57c8de743782acd", class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { key: "d6a3bdf5d3c7501e865c363a58cbfd78b9ee10b1", width: "18", height: "18" }), instance.t("schedulerEditorTitle"), h("tooltip-component", { key: "d2cde09b0b5ac91a306d81dba57838ce373cda92" }, h("info-icon", { key: "af00e8fa6ca5ef8baaaf5a9abdf14a7138b030fd", slot: "tooltip-icon" }), h("span", { key: "24a185bac54f44abf7ffe9bf3cd2723dc363a12f", slot: "tooltip-content" }, this.version))), h("div", { key: "6fdf10c991b049d0a96a09faddf056de7b80a1de", class: {
|
|
1730
1763
|
language: !0
|
|
1731
|
-
}, part: "nse__language" }, h("select-dropdown", { key: "
|
|
1764
|
+
}, part: "nse__language" }, h("select-dropdown", { key: "d733d65ad4fd639f94b5fde41ae32725949fe429", name: "language", searchPlaceholder: instance.t("search"), options: n, withChevron: !1, defaultSelectedOption: n.find((q) => q.value == this.selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { key: "9ae3abafd8aa09ec54f70c9d950eb1569eff6870", slot: "select-icon" }, h("translate-icon", { key: "e435ec08d11c784caca91cf97887e261409b559b", width: "20", height: "20" })))), h("button", { key: "2bd03fa6333f11f3da17f8ce1db6516a4f936a6f", class: "scheduler-editor-close", title: "logout", onClick: (q) => this.handleSchedulerConfigCloseClicked(q), part: "nse__close-button" }, h("close-icon", { key: "b7e1ab191b7bfd4c892e101c5662ebeb42ad67a2", width: "18", height: "18" }))), h("div", { key: "3a19a2dde27979aa7428a388e68b9eb8c8d266a2", class: {
|
|
1732
1765
|
"scheduler-editor-content": !0,
|
|
1733
|
-
"scheduler-editor-content--group_feature_enabled": !!((w = (y = (m = this.stores) == null ? void 0 : m.schedulerConfig) == null ? void 0 : y.state.experimentalFeatures) != null && w[EXPERIMENTAL_FEATURES.group_events]),
|
|
1734
1766
|
"scheduler-editor-content--group": s
|
|
1735
|
-
}, part: "nse__content" }, ((
|
|
1767
|
+
}, part: "nse__content" }, ((y = (m = this.stores) == null ? void 0 : m.schedulerConfig) == null ? void 0 : y.state.currentUser) && this.stores.schedulerConfig.state.action === null && h("div", { class: "list-configurations", part: "nse__list-configurations" }, h("nylas-list-configurations", { exportparts: "nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete" })), ((_ = (w = this.stores) == null ? void 0 : w.schedulerConfig) == null ? void 0 : _.state.currentUser) && this.stores.schedulerConfig.state.action === "create-select" && h("nylas-select-event-type", null), ((R = (x = this.stores) == null ? void 0 : x.schedulerConfig) == null ? void 0 : R.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && s && h("nylas-editor-tabs-group", { mode: "composable" }, h(ExpressFlow, { selectedEventType: ((U = (k = (A = this.stores) == null ? void 0 : A.schedulerConfig) == null ? void 0 : k.state) == null ? void 0 : U.selectedEventType) || CONFIGURATION_EVENT_TYPE.one_on_one, currentUser: (O = (P = this.stores) == null ? void 0 : P.schedulerConfig) == null ? void 0 : O.state.currentUser, calendars: (S = (T = (I = this.stores) == null ? void 0 : I.schedulerConfig) == null ? void 0 : T.state) == null ? void 0 : S.calendars, selectedConfiguration: (b = (L = (v = this.stores) == null ? void 0 : v.schedulerConfig) == null ? void 0 : L.state) == null ? void 0 : b.selectedConfiguration })), ((X = ($ = this.stores) == null ? void 0 : $.schedulerConfig) == null ? void 0 : X.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && !s && h("nylas-editor-tabs", { mode: "composable" }, h(ExpressFlow, { selectedEventType: ((Y = (z = (j = this.stores) == null ? void 0 : j.schedulerConfig) == null ? void 0 : z.state) == null ? void 0 : Y.selectedEventType) || CONFIGURATION_EVENT_TYPE.one_on_one, currentUser: (V = (M = this.stores) == null ? void 0 : M.schedulerConfig) == null ? void 0 : V.state.currentUser, calendars: (Z = (W = (J = this.stores) == null ? void 0 : J.schedulerConfig) == null ? void 0 : W.state) == null ? void 0 : Z.calendars, selectedConfiguration: (te = (ee = (Q = this.stores) == null ? void 0 : Q.schedulerConfig) == null ? void 0 : ee.state) == null ? void 0 : te.selectedConfiguration })), ((se = (ne = this.stores) == null ? void 0 : ne.schedulerConfig) == null ? void 0 : se.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && s && h("nylas-editor-tabs-group", { key: t, mode: this.mode }, this.mode === "composable" && h("slot", null), this.mode === "app" && r && h("div", { style: { display: "none" }, slot: "custom-page-style-inputs", key: t }, h("slot", { name: "custom-page-style-inputs" }))), ((oe = (re = this.stores) == null ? void 0 : re.schedulerConfig) == null ? void 0 : oe.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && !s && h("nylas-editor-tabs", { key: t, mode: this.mode }, this.mode === "composable" && h("slot", null), this.mode === "app" && r && h("div", { style: { display: "none" }, slot: "custom-page-style-inputs", key: t }, h("slot", { name: "custom-page-style-inputs" }))), !((ae = (ie = this.stores) == null ? void 0 : ie.schedulerConfig) != null && ae.state.currentUser) && h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl }))));
|
|
1736
1768
|
}
|
|
1737
1769
|
get host() {
|
|
1738
1770
|
return getElement(this);
|
|
@@ -1742,7 +1774,8 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1742
1774
|
configurationId: ["configurationIdChanged"],
|
|
1743
1775
|
localization: ["updateLocalization"],
|
|
1744
1776
|
nylasBranding: ["updateNylasBranding"],
|
|
1745
|
-
experimentalFeatures: ["updateExperimentalFeatures"]
|
|
1777
|
+
experimentalFeatures: ["updateExperimentalFeatures"],
|
|
1778
|
+
enableEventTypes: ["updateEnableEventTypes"]
|
|
1746
1779
|
};
|
|
1747
1780
|
}
|
|
1748
1781
|
};
|