@nylas/react 1.1.0-canary.18 → 1.1.0-canary.19
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/{add-circle-icon_2.entry-3b13ee64.js → add-circle-icon_2.entry-3ca337a6.js} +5 -5
- package/dist/{add-circle-icon_2.entry-3091976b.cjs → add-circle-icon_2.entry-adde5fdf.cjs} +1 -1
- package/dist/{archive-icon_7.entry-c2b6d860.cjs → archive-icon_7.entry-2b56ef80.cjs} +1 -1
- package/dist/{archive-icon_7.entry-8932618a.js → archive-icon_7.entry-896a1054.js} +13 -13
- package/dist/{arrow-icon.entry-a159bee8.cjs → arrow-icon.entry-0288f3fc.cjs} +1 -1
- package/dist/arrow-icon.entry-9aaa93fd.js +15 -0
- package/dist/{bold-icon_3.entry-447d0537.js → bold-icon_3.entry-0061cf1f.js} +4 -4
- package/dist/{bold-icon_3.entry-c51e1af3.cjs → bold-icon_3.entry-e7810620.cjs} +1 -1
- package/dist/button-component_4.entry-276606e6.js +115 -0
- package/dist/button-component_4.entry-e53a8f37.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_35.entry-a19cae9c.js +4178 -0
- package/dist/calendar-agenda-fill-icon_35.entry-fa968081.cjs +7 -0
- package/dist/{calendar-cancel-icon.entry-a78f27bc.js → calendar-cancel-icon.entry-71eae711.js} +1 -1
- package/dist/{calendar-cancel-icon.entry-805febcc.cjs → calendar-cancel-icon.entry-8e8b25b6.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-4a0fd7bd.cjs → calendar-check-icon_2.entry-562e98cf.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-7c8b6c92.js → calendar-check-icon_2.entry-6f971ca2.js} +1 -1
- package/dist/{calendar-icon.entry-1fc018b4.cjs → calendar-icon.entry-3a59af30.cjs} +1 -1
- package/dist/{calendar-icon.entry-96f9727f.js → calendar-icon.entry-3e496896.js} +1 -1
- package/dist/{chevron-icon_3.entry-25d90239.js → chevron-icon_3.entry-7eac0ed5.js} +37 -34
- package/dist/chevron-icon_3.entry-7ff10540.cjs +1 -0
- package/dist/{clock-icon_2.entry-c1b22ed4.js → clock-icon_2.entry-120d672e.js} +5 -5
- package/dist/{clock-icon_2.entry-2406c3d0.cjs → clock-icon_2.entry-43873262.cjs} +1 -1
- package/dist/{constants-f34b9c6e-b774916c.cjs → constants-7ce66b44-a951d78c.cjs} +5 -5
- package/dist/{constants-f34b9c6e-f1c4dd0d.js → constants-7ce66b44-e7ca66c2.js} +484 -383
- package/dist/copy-icon_4.entry-57874c4f.cjs +1 -0
- package/dist/copy-icon_4.entry-9a949d24.js +45 -0
- package/dist/{document-refresh-icon.entry-570f9c9d.js → document-refresh-icon.entry-f0d95ac8.js} +5 -5
- package/dist/document-refresh-icon.entry-f1d3f32d.cjs +1 -0
- package/dist/elements/index.d.ts +14 -0
- package/dist/{elements-dc5b338e-550a6cb1.cjs → elements-dc5b338e-62b53496.cjs} +1 -1
- package/dist/{elements-dc5b338e-cafa7a55.js → elements-dc5b338e-974e2077.js} +1 -1
- package/dist/{focus-visible-e8093c16-022799ce.js → focus-visible-e8093c16-7a512fc0.js} +1 -1
- package/dist/{focus-visible-e8093c16-c14162e8.cjs → focus-visible-e8093c16-923e1041.cjs} +1 -1
- package/dist/{forward-icon_6.entry-55752b23.cjs → forward-icon_6.entry-45b70066.cjs} +3 -3
- package/dist/{forward-icon_6.entry-9b832146.js → forward-icon_6.entry-675c0b73.js} +9 -9
- package/dist/{globe-icon.entry-2b61820e.js → globe-icon.entry-3296e427.js} +2 -2
- package/dist/{globe-icon.entry-dabe7b8b.cjs → globe-icon.entry-7ecd6221.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-aa9f8b35.js +584 -0
- package/dist/google-logo-icon_4.entry-fd734a59.cjs +1 -0
- package/dist/index-53420959-1c0d390d.js +5 -0
- package/dist/index-53420959-8e7b10db.cjs +1 -0
- package/dist/{index-812162da.js → index-5efb84b8.js} +813 -793
- package/dist/{index-6d9eeb53-3edef246.js → index-6d9eeb53-4e2a7f9f.js} +2 -2
- package/dist/{index-6d9eeb53-3049fc04.cjs → index-6d9eeb53-aa1dfa96.cjs} +1 -1
- package/dist/index-d36b8fb8.cjs +42 -0
- package/dist/{index.es-9cc0eb3c-52226859.js → index.es-9cc0eb3c-65f8af0c.js} +1 -1
- package/dist/{index.es-9cc0eb3c-0c99c055.cjs → index.es-9cc0eb3c-8eefd4fc.cjs} +1 -1
- package/dist/{info-icon_2.entry-5f6b9af8.cjs → info-icon_2.entry-e612f1d6.cjs} +1 -1
- package/dist/{info-icon_2.entry-2fe6c16c.js → info-icon_2.entry-f06c8dd0.js} +8 -8
- package/dist/{input-dropdown_2.entry-dbdb5aa3.cjs → input-dropdown_2.entry-ad380260.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-dbd0d6f4.js → input-dropdown_2.entry-ccd95678.js} +3 -3
- package/dist/{loading-icon.entry-e179f122.cjs → loading-icon.entry-678a6b3f.cjs} +1 -1
- package/dist/loading-icon.entry-9e6670d5.js +15 -0
- package/dist/{mailbox-store-64b4ef7c-0eac526c.cjs → mailbox-store-64b4ef7c-9bd02ffd.cjs} +1 -1
- package/dist/{mailbox-store-64b4ef7c-22a6c565.js → mailbox-store-64b4ef7c-b56d5e78.js} +2 -2
- package/dist/multi-select-dropdown.entry-5bb80d89.cjs +1 -0
- package/dist/multi-select-dropdown.entry-edf10867.js +91 -0
- package/dist/{nylas-booked-event-card_10.entry-e0990f5b.js → nylas-booked-event-card_10.entry-92f6e85d.js} +267 -235
- package/dist/nylas-booked-event-card_10.entry-ad4671b2.cjs +1 -0
- package/dist/{nylas-custom-booking-flow.entry-bc64af5f.js → nylas-custom-booking-flow.entry-b39a2bf2.js} +3 -3
- package/dist/{nylas-custom-booking-flow.entry-898c8cc9.cjs → nylas-custom-booking-flow.entry-cef0041a.cjs} +1 -1
- package/dist/{nylas-form-card.entry-c564b52e.js → nylas-form-card.entry-bf4545e2.js} +11 -11
- package/dist/{nylas-form-card.entry-0c71f4fc.cjs → nylas-form-card.entry-fba5d623.cjs} +1 -1
- package/dist/{nylas-if-state.entry-e9486e12.js → nylas-if-state.entry-2739dc10.js} +3 -3
- package/dist/{nylas-if-state.entry-ff6a2046.cjs → nylas-if-state.entry-d7b818a6.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-90716d2b.cjs → nylas-list-folders.entry-0ec6ba20.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-0258af1e.js → nylas-list-folders.entry-3197e390.js} +7 -7
- package/dist/{nylas-list-threads.entry-21edf012.cjs → nylas-list-threads.entry-2a7e1e84.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-1abcdd30.js → nylas-list-threads.entry-9004c490.js} +3 -3
- package/dist/{nylas-login.entry-2e0ce95e.cjs → nylas-login.entry-c2ffd6a5.cjs} +1 -1
- package/dist/{nylas-login.entry-ba7383ac.js → nylas-login.entry-f2927406.js} +3 -3
- package/dist/{nylas-mailbox-pagination.entry-ba6beb08.cjs → nylas-mailbox-pagination.entry-839c9ad3.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-f6186560.js → nylas-mailbox-pagination.entry-e9356835.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-e18059b0.js → nylas-mailbox-toolbar-button.entry-298a3c47.js} +10 -10
- package/dist/{nylas-mailbox-toolbar-button.entry-0875aadb.cjs → nylas-mailbox-toolbar-button.entry-43812d51.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-2e3815ed.js → nylas-mailbox.entry-aa42f6c4.js} +4 -4
- package/dist/{nylas-mailbox.entry-bb2905bf.cjs → nylas-mailbox.entry-cf13ddf5.cjs} +1 -1
- package/dist/{nylas-provider.entry-69ee5061.js → nylas-provider.entry-1a3a195f.js} +39 -39
- package/dist/{nylas-provider.entry-51c5cdbf.cjs → nylas-provider.entry-843b5593.cjs} +1 -1
- package/dist/nylas-scheduler-editor.entry-048e7a8f.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-d4a9afb1.js → nylas-scheduler-editor.entry-d56d6d2a.js} +138 -119
- package/dist/nylas-scheduling.entry-0ad9b1d0.cjs +1 -0
- package/dist/{nylas-scheduling.entry-f82a2822.js → nylas-scheduling.entry-7039a890.js} +52 -52
- package/dist/{nylas-threads-refresh.entry-99001756.cjs → nylas-threads-refresh.entry-9cae6ac8.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-72482d2f.js → nylas-threads-refresh.entry-d951050a.js} +10 -10
- package/dist/nylas-threads-search.entry-0d34c5a8.cjs +1 -0
- package/dist/{nylas-threads-search.entry-c5fe50e5.js → nylas-threads-search.entry-7a4bbc75.js} +17 -17
- package/dist/{nylas-time-window-picker.entry-ccffcf2b.cjs → nylas-time-window-picker.entry-062bc8c1.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-0d93e7cc.js → nylas-time-window-picker.entry-210c3f1a.js} +2 -2
- package/dist/{nylas-view-thread.entry-2d34b41c.js → nylas-view-thread.entry-8b39a997.js} +6 -6
- package/dist/{nylas-view-thread.entry-58432a52.cjs → nylas-view-thread.entry-db78ed9c.cjs} +1 -1
- package/dist/play-icon_2.entry-19271982.cjs +1 -0
- package/dist/play-icon_2.entry-c53f3cac.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +115 -101
- package/dist/{refresh-icon.entry-a041136d.js → refresh-icon.entry-75139a0c.js} +4 -4
- package/dist/{refresh-icon.entry-1e670732.cjs → refresh-icon.entry-e695cf7f.cjs} +1 -1
- package/dist/{register-component-a5a9ca5d-a5c01c35.js → register-component-a5a9ca5d-d69a7a05.js} +1 -1
- package/dist/{register-component-a5a9ca5d-b68b6039.cjs → register-component-a5a9ca5d-eebf89e7.cjs} +1 -1
- package/dist/scheduler-config-store-9ccfba4d-22a58b7d.cjs +1 -0
- package/dist/{scheduler-config-store-4a50a03d-ee42ff96.js → scheduler-config-store-9ccfba4d-fd62a421.js} +8 -6
- package/dist/{scheduler-store-f02ce045-23a14e3f.js → scheduler-store-8a400448-3b007d4d.js} +125 -96
- package/dist/scheduler-store-8a400448-44e0edad.cjs +1 -0
- package/dist/{textarea-component.entry-24a830c1.cjs → textarea-component.entry-48feabb3.cjs} +1 -1
- package/dist/{textarea-component.entry-1b4c771b.js → textarea-component.entry-ead5ab00.js} +7 -6
- package/dist/{translate-icon.entry-44bde57b.js → translate-icon.entry-55043beb.js} +2 -2
- package/dist/{translate-icon.entry-0c0add25.cjs → translate-icon.entry-5f62bc61.cjs} +1 -1
- package/dist/{warning-icon.entry-9a77ab01.cjs → warning-icon.entry-2e0a80da.cjs} +1 -1
- package/dist/{warning-icon.entry-8956cba2.js → warning-icon.entry-fa644462.js} +5 -5
- package/package.json +3 -3
- package/dist/arrow-icon.entry-1f54c377.js +0 -15
- package/dist/button-component.entry-52ccb6d9.js +0 -16
- package/dist/button-component.entry-e79b2d08.cjs +0 -1
- package/dist/calendar-info-icon_28.entry-2054703c.cjs +0 -1
- package/dist/calendar-info-icon_28.entry-e7bebd13.js +0 -2083
- package/dist/chevron-icon_3.entry-7bd4a4b5.cjs +0 -1
- package/dist/document-refresh-icon.entry-a0293858.cjs +0 -1
- package/dist/google-logo-icon_4.entry-60c0d39a.cjs +0 -1
- package/dist/google-logo-icon_4.entry-a0dc33da.js +0 -467
- package/dist/index-53420959-67beefed.js +0 -5
- package/dist/index-53420959-d3254a34.cjs +0 -1
- package/dist/index-e3e9b594.cjs +0 -42
- package/dist/input-component.entry-1195d579.js +0 -45
- package/dist/input-component.entry-2b6e44c4.cjs +0 -1
- package/dist/loading-icon.entry-027a2ad1.js +0 -15
- package/dist/nylas-booked-event-card_10.entry-84f64ba5.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-923b8566.cjs +0 -2
- package/dist/nylas-scheduling.entry-54f1a5e9.cjs +0 -1
- package/dist/nylas-threads-search.entry-462527fd.cjs +0 -1
- package/dist/play-icon_2.entry-1ea3fd6b.cjs +0 -1
- package/dist/play-icon_2.entry-d08adf17.js +0 -25
- package/dist/scheduler-config-store-4a50a03d-884e6df8.cjs +0 -1
- package/dist/scheduler-store-f02ce045-42e3647c.cjs +0 -1
package/dist/{nylas-scheduler-editor.entry-d4a9afb1.js → nylas-scheduler-editor.entry-d56d6d2a.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var P = Object.defineProperty;
|
|
2
2
|
var O = (r, t, n) => t in r ? P(r, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[t] = n;
|
|
3
|
-
var
|
|
4
|
-
import { i as commonjsGlobal, r as registerInstance, c as createEvent, d as debug, N as NylasIdentityRequestWrapper, h, H as Host, g as getElement, B as Buffer, F as Fragment, j as dataResponse } from "./index-
|
|
5
|
-
import { N as NylasBaseProvider, X as Xr } from "./index.es-9cc0eb3c-
|
|
6
|
-
import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-
|
|
7
|
-
import { p as process } from "./index-53420959-
|
|
3
|
+
var b = (r, t, n) => (O(r, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import { i as commonjsGlobal, r as registerInstance, c as createEvent, d as debug, N as NylasIdentityRequestWrapper, h, H as Host, g as getElement, B as Buffer, F as Fragment, j as dataResponse } from "./index-5efb84b8.js";
|
|
5
|
+
import { N as NylasBaseProvider, X as Xr } from "./index.es-9cc0eb3c-65f8af0c.js";
|
|
6
|
+
import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-9ccfba4d-fd62a421.js";
|
|
7
|
+
import { p as process } from "./index-53420959-1c0d390d.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
class NylasSchedulerConfigAPIConnector {
|
|
@@ -51,21 +51,21 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
51
51
|
message: "Error fetching configuration: " + ((a = s.error) == null ? void 0 : a.message)
|
|
52
52
|
}) : (this.nylasSchedulerConfigStore.state.selectedConfiguration = s.data, this.nylasSchedulerConfigStore.state.configurations.find((d) => d.id === t) ? this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map((d) => d.id === t ? s.data : d) : this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, s.data], dataResponse(s.data));
|
|
53
53
|
}
|
|
54
|
-
async getConfigurations() {
|
|
55
|
-
var
|
|
54
|
+
async getConfigurations(t) {
|
|
55
|
+
var a;
|
|
56
56
|
if (!this.nylasApiRequest)
|
|
57
57
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
58
58
|
message: "Error fetching configurations: Nylas API Request is not initialized"
|
|
59
59
|
});
|
|
60
|
-
const [
|
|
60
|
+
const n = 50, [s, c] = await this.nylasApiRequest.request({
|
|
61
61
|
method: "GET",
|
|
62
|
-
path:
|
|
62
|
+
path: `scheduling/configurations?limit=${n}${t ? `&page_token=${t}` : ""}`
|
|
63
63
|
});
|
|
64
|
-
return
|
|
65
|
-
message: "Error fetching configurations: " +
|
|
66
|
-
}) : Xr(
|
|
67
|
-
message: "Error fetching configurations: " + ((
|
|
68
|
-
}) : (this.nylasSchedulerConfigStore.state.configurations =
|
|
64
|
+
return c ? dataResponse(null, {
|
|
65
|
+
message: "Error fetching configurations: " + c.message
|
|
66
|
+
}) : Xr(s) ? dataResponse(null, {
|
|
67
|
+
message: "Error fetching configurations: " + ((a = s.error) == null ? void 0 : a.message)
|
|
68
|
+
}) : (this.nylasSchedulerConfigStore.state.configurations = s.data, this.nylasSchedulerConfigStore.state.listConfigurationsNextCursor = s.next_cursor || null, dataResponse(s.data));
|
|
69
69
|
}
|
|
70
70
|
async createConfiguration(t) {
|
|
71
71
|
var c;
|
|
@@ -162,7 +162,7 @@ class LocalStorage {
|
|
|
162
162
|
const PKCE_KEY = "pkce", GRANT_KEY = "grant", USER_KEY = "user";
|
|
163
163
|
class Storage {
|
|
164
164
|
constructor(t) {
|
|
165
|
-
|
|
165
|
+
b(this, "Storage", new LocalStorage());
|
|
166
166
|
if (t) {
|
|
167
167
|
this.Storage = t;
|
|
168
168
|
return;
|
|
@@ -238,8 +238,8 @@ class Storage {
|
|
|
238
238
|
}
|
|
239
239
|
class IndexedDBStorage {
|
|
240
240
|
constructor() {
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
b(this, "databaseName", "identity-db");
|
|
242
|
+
b(this, "storeName", "identity");
|
|
243
243
|
}
|
|
244
244
|
get(t) {
|
|
245
245
|
const n = this;
|
|
@@ -265,11 +265,11 @@ class IndexedDBStorage {
|
|
|
265
265
|
}, a.onerror = () => {
|
|
266
266
|
c(a.error);
|
|
267
267
|
}, a.onsuccess = (d) => {
|
|
268
|
-
const l = d.target.result, u = l.transaction(this.storeName, "readwrite"),
|
|
269
|
-
|
|
268
|
+
const l = d.target.result, u = l.transaction(this.storeName, "readwrite"), y = u.objectStore(this.storeName).delete(t);
|
|
269
|
+
y.onsuccess = () => {
|
|
270
270
|
s(null);
|
|
271
|
-
},
|
|
272
|
-
c(
|
|
271
|
+
}, y.onerror = () => {
|
|
272
|
+
c(y.error);
|
|
273
273
|
}, u.oncomplete = () => {
|
|
274
274
|
l.close();
|
|
275
275
|
};
|
|
@@ -284,11 +284,11 @@ class IndexedDBStorage {
|
|
|
284
284
|
}, a.onupgradeneeded = (d) => {
|
|
285
285
|
d.target.result.createObjectStore(this.storeName);
|
|
286
286
|
}, a.onsuccess = (d) => {
|
|
287
|
-
const l = d.target.result, u = l.transaction(this.storeName, "readwrite"),
|
|
288
|
-
|
|
287
|
+
const l = d.target.result, u = l.transaction(this.storeName, "readwrite"), y = u.objectStore(this.storeName).put(n, t);
|
|
288
|
+
y.onsuccess = () => {
|
|
289
289
|
s(n);
|
|
290
|
-
},
|
|
291
|
-
c(
|
|
290
|
+
}, y.onerror = () => {
|
|
291
|
+
c(y.error);
|
|
292
292
|
}, u.oncomplete = () => {
|
|
293
293
|
l.close();
|
|
294
294
|
};
|
|
@@ -465,11 +465,11 @@ var sha256 = { exports: {} };
|
|
|
465
465
|
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();
|
|
466
466
|
}
|
|
467
467
|
}, Sha256.prototype.hash = function() {
|
|
468
|
-
var r = this.h0, t = this.h1, n = this.h2, s = this.h3, c = this.h4, a = this.h5, d = this.h6, l = this.h7, u = this.blocks, f,
|
|
468
|
+
var r = this.h0, t = this.h1, n = this.h2, s = this.h3, c = this.h4, a = this.h5, d = this.h6, l = this.h7, u = this.blocks, f, y, g, w, p, S, m, x, R, _, A;
|
|
469
469
|
for (f = 16; f < 64; ++f)
|
|
470
|
-
p = u[f - 15],
|
|
470
|
+
p = u[f - 15], y = (p >>> 7 | p << 25) ^ (p >>> 18 | p << 14) ^ p >>> 3, p = u[f - 2], g = (p >>> 17 | p << 15) ^ (p >>> 19 | p << 13) ^ p >>> 10, u[f] = u[f - 16] + y + u[f - 7] + g << 0;
|
|
471
471
|
for (A = t & n, f = 0; f < 64; f += 4)
|
|
472
|
-
this.first ? (this.is224 ? (x = 300032, p = u[0] - 1413257819, l = p - 150054599 << 0, s = p + 24177077 << 0) : (x = 704751109, p = u[0] - 210244248, l = p - 1521486534 << 0, s = p + 143694565 << 0), this.first = !1) : (
|
|
472
|
+
this.first ? (this.is224 ? (x = 300032, p = u[0] - 1413257819, l = p - 150054599 << 0, s = p + 24177077 << 0) : (x = 704751109, p = u[0] - 210244248, l = p - 1521486534 << 0, s = p + 143694565 << 0), this.first = !1) : (y = (r >>> 2 | r << 30) ^ (r >>> 13 | r << 19) ^ (r >>> 22 | r << 10), g = (c >>> 6 | c << 26) ^ (c >>> 11 | c << 21) ^ (c >>> 25 | c << 7), x = r & t, w = x ^ r & n ^ A, m = c & a ^ ~c & d, p = l + g + m + K[f] + u[f], S = y + w, l = s + p << 0, s = p + S << 0), y = (s >>> 2 | s << 30) ^ (s >>> 13 | s << 19) ^ (s >>> 22 | s << 10), g = (l >>> 6 | l << 26) ^ (l >>> 11 | l << 21) ^ (l >>> 25 | l << 7), R = s & r, w = R ^ s & t ^ x, m = l & c ^ ~l & a, p = d + g + m + K[f + 1] + u[f + 1], S = y + w, d = n + p << 0, n = p + S << 0, y = (n >>> 2 | n << 30) ^ (n >>> 13 | n << 19) ^ (n >>> 22 | n << 10), g = (d >>> 6 | d << 26) ^ (d >>> 11 | d << 21) ^ (d >>> 25 | d << 7), _ = n & s, w = _ ^ n & r ^ R, m = d & l ^ ~d & c, p = a + g + m + K[f + 2] + u[f + 2], S = y + w, a = t + p << 0, t = p + S << 0, y = (t >>> 2 | t << 30) ^ (t >>> 13 | t << 19) ^ (t >>> 22 | t << 10), g = (a >>> 6 | a << 26) ^ (a >>> 11 | a << 21) ^ (a >>> 25 | a << 7), A = t & n, w = A ^ t & s ^ _, m = a & d ^ ~a & l, p = c + g + m + K[f + 3] + u[f + 3], S = y + w, c = r + p << 0, r = p + S << 0;
|
|
473
473
|
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 + c << 0, this.h5 = this.h5 + a << 0, this.h6 = this.h6 + d << 0, this.h7 = this.h7 + l << 0;
|
|
474
474
|
}, Sha256.prototype.hex = function() {
|
|
475
475
|
this.finalize();
|
|
@@ -530,12 +530,12 @@ var sha256 = { exports: {} };
|
|
|
530
530
|
} else
|
|
531
531
|
throw new Error(ERROR);
|
|
532
532
|
r.length > 64 && (r = new Sha256(t, !0).update(r).array());
|
|
533
|
-
var f = [],
|
|
533
|
+
var f = [], y = [];
|
|
534
534
|
for (s = 0; s < 64; ++s) {
|
|
535
|
-
var
|
|
536
|
-
f[s] = 92 ^
|
|
535
|
+
var g = r[s] || 0;
|
|
536
|
+
f[s] = 92 ^ g, y[s] = 54 ^ g;
|
|
537
537
|
}
|
|
538
|
-
Sha256.call(this, t, n), this.update(
|
|
538
|
+
Sha256.call(this, t, n), this.update(y), this.oKeyPad = f, this.inner = !0, this.sharedMemory = n;
|
|
539
539
|
}
|
|
540
540
|
HmacSha256.prototype = new Sha256(), HmacSha256.prototype.finalize = function() {
|
|
541
541
|
if (Sha256.prototype.finalize.call(this), this.inner) {
|
|
@@ -618,21 +618,21 @@ function getMessages(r, t, n) {
|
|
|
618
618
|
if (d.length === 0)
|
|
619
619
|
n == null || n(s), s = newMessage();
|
|
620
620
|
else if (l > 0) {
|
|
621
|
-
const u = c.decode(d.subarray(0, l)), f = l + (d[l + 1] === 32 ? 2 : 1),
|
|
621
|
+
const u = c.decode(d.subarray(0, l)), f = l + (d[l + 1] === 32 ? 2 : 1), y = c.decode(d.subarray(f));
|
|
622
622
|
switch (u) {
|
|
623
623
|
case "data":
|
|
624
624
|
s.data = s.data ? s.data + `
|
|
625
|
-
` +
|
|
625
|
+
` + y : y;
|
|
626
626
|
break;
|
|
627
627
|
case "event":
|
|
628
|
-
s.event =
|
|
628
|
+
s.event = y;
|
|
629
629
|
break;
|
|
630
630
|
case "id":
|
|
631
|
-
r(s.id =
|
|
631
|
+
r(s.id = y);
|
|
632
632
|
break;
|
|
633
633
|
case "retry":
|
|
634
|
-
const
|
|
635
|
-
isNaN(
|
|
634
|
+
const g = parseInt(y, 10);
|
|
635
|
+
isNaN(g) || t(s.retry = g);
|
|
636
636
|
break;
|
|
637
637
|
}
|
|
638
638
|
}
|
|
@@ -661,37 +661,37 @@ var __rest = function(r, t) {
|
|
|
661
661
|
};
|
|
662
662
|
const EventStreamContentType = "text/event-stream", DefaultRetryInterval = 1e3, LastEventId = "last-event-id";
|
|
663
663
|
function fetchEventSource(r, t) {
|
|
664
|
-
var { signal: n, headers: s, onopen: c, onmessage: a, onclose: d, onerror: l, openWhenHidden: u, fetch: f } = t,
|
|
665
|
-
return new Promise((
|
|
664
|
+
var { signal: n, headers: s, onopen: c, onmessage: a, onclose: d, onerror: l, openWhenHidden: u, fetch: f } = t, y = __rest(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
665
|
+
return new Promise((g, w) => {
|
|
666
666
|
const p = Object.assign({}, s);
|
|
667
667
|
p.accept || (p.accept = EventStreamContentType);
|
|
668
668
|
let S;
|
|
669
|
-
function
|
|
669
|
+
function m() {
|
|
670
670
|
S.abort(), document.hidden || k();
|
|
671
671
|
}
|
|
672
|
-
u || document.addEventListener("visibilitychange",
|
|
672
|
+
u || document.addEventListener("visibilitychange", m);
|
|
673
673
|
let x = DefaultRetryInterval, R = 0;
|
|
674
674
|
function _() {
|
|
675
|
-
document.removeEventListener("visibilitychange",
|
|
675
|
+
document.removeEventListener("visibilitychange", m), window.clearTimeout(R), S.abort();
|
|
676
676
|
}
|
|
677
677
|
n == null || n.addEventListener("abort", () => {
|
|
678
|
-
_(),
|
|
678
|
+
_(), g();
|
|
679
679
|
});
|
|
680
|
-
const A = f ?? window.fetch,
|
|
680
|
+
const A = f ?? window.fetch, I = c ?? defaultOnOpen;
|
|
681
681
|
async function k() {
|
|
682
|
-
var
|
|
682
|
+
var U;
|
|
683
683
|
S = new AbortController();
|
|
684
684
|
try {
|
|
685
|
-
const T = await A(r, Object.assign(Object.assign({},
|
|
686
|
-
await
|
|
685
|
+
const T = await A(r, Object.assign(Object.assign({}, y), { headers: p, signal: S.signal }));
|
|
686
|
+
await I(T), await getBytes(T.body, getLines(getMessages((v) => {
|
|
687
687
|
v ? p[LastEventId] = v : delete p[LastEventId];
|
|
688
688
|
}, (v) => {
|
|
689
689
|
x = v;
|
|
690
|
-
}, a))), d == null || d(), _(),
|
|
690
|
+
}, a))), d == null || d(), _(), g();
|
|
691
691
|
} catch (T) {
|
|
692
692
|
if (!S.signal.aborted)
|
|
693
693
|
try {
|
|
694
|
-
const v = (
|
|
694
|
+
const v = (U = l == null ? void 0 : l(T)) !== null && U !== void 0 ? U : x;
|
|
695
695
|
window.clearTimeout(R), R = window.setTimeout(k, v);
|
|
696
696
|
} catch (v) {
|
|
697
697
|
_(), w(v);
|
|
@@ -765,15 +765,15 @@ function o(r, t) {
|
|
|
765
765
|
n$1.prototype = new Error(), n$1.prototype.name = "InvalidTokenError";
|
|
766
766
|
class NylasSessions {
|
|
767
767
|
constructor(t) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
768
|
+
b(this, "clientId");
|
|
769
|
+
b(this, "redirectUri");
|
|
770
|
+
b(this, "accessType", "online");
|
|
771
|
+
b(this, "domain", "http://api.nylas.com");
|
|
772
|
+
b(this, "versioned", !1);
|
|
773
|
+
b(this, "Storage");
|
|
774
|
+
b(this, "hosted", !1);
|
|
775
|
+
b(this, "multiAccount", !1);
|
|
776
|
+
b(this, "loginId", "");
|
|
777
777
|
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) {
|
|
778
778
|
const n = new IndexedDBStorage();
|
|
779
779
|
this.Storage = new Storage(n);
|
|
@@ -1006,17 +1006,17 @@ class NylasSessions {
|
|
|
1006
1006
|
code: s,
|
|
1007
1007
|
grant_type: "authorization_code",
|
|
1008
1008
|
code_verifier: u
|
|
1009
|
-
},
|
|
1009
|
+
}, g = await (await fetch(`${this.domain}/connect/token`, {
|
|
1010
1010
|
method: "POST",
|
|
1011
1011
|
headers: new Headers({ "content-type": "application/json" }),
|
|
1012
1012
|
body: JSON.stringify(f)
|
|
1013
1013
|
})).json();
|
|
1014
|
-
if (
|
|
1015
|
-
if (
|
|
1016
|
-
const p = { detail:
|
|
1014
|
+
if (g) {
|
|
1015
|
+
if (g.error) {
|
|
1016
|
+
const p = { detail: g };
|
|
1017
1017
|
return window.dispatchEvent(new CustomEvent("onLoginFail", p)), !0;
|
|
1018
1018
|
}
|
|
1019
|
-
const w = await this.handleCodeExchangeResponse(
|
|
1019
|
+
const w = await this.handleCodeExchangeResponse(g);
|
|
1020
1020
|
if (w.valid) {
|
|
1021
1021
|
c && (w.data.state = c);
|
|
1022
1022
|
const p = { detail: w.data };
|
|
@@ -1028,8 +1028,8 @@ class NylasSessions {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
return this.Storage.removePKCE(), !0;
|
|
1030
1030
|
} catch (f) {
|
|
1031
|
-
const
|
|
1032
|
-
return window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1031
|
+
const y = { detail: f };
|
|
1032
|
+
return window.dispatchEvent(new CustomEvent("onLoginFail", y)), window.history.pushState({}, document.title, window.location.pathname), !1;
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
1035
|
// Token Exchange for session maintenece
|
|
@@ -1051,13 +1051,13 @@ class NylasSessions {
|
|
|
1051
1051
|
})).json();
|
|
1052
1052
|
if (d) {
|
|
1053
1053
|
if (d.error) {
|
|
1054
|
-
const
|
|
1055
|
-
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",
|
|
1054
|
+
const y = { detail: d };
|
|
1055
|
+
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", y)), !0;
|
|
1056
1056
|
}
|
|
1057
1057
|
const l = getTimestamp();
|
|
1058
1058
|
if (d.expires_in = l + d.expires_in, this.Storage.setGrant(d, this.multiAccount), !await this.validateIDToken(t)) {
|
|
1059
|
-
const
|
|
1060
|
-
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",
|
|
1059
|
+
const y = { detail: d };
|
|
1060
|
+
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", y)), !0;
|
|
1061
1061
|
}
|
|
1062
1062
|
const f = { detail: d };
|
|
1063
1063
|
return window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess", f)), !0;
|
|
@@ -1093,19 +1093,19 @@ class NylasSessions {
|
|
|
1093
1093
|
return;
|
|
1094
1094
|
const f = setInterval(async () => {
|
|
1095
1095
|
if (u.closed) {
|
|
1096
|
-
const
|
|
1096
|
+
const y = {
|
|
1097
1097
|
detail: { error_description: "OAuth provider window closed" }
|
|
1098
1098
|
};
|
|
1099
|
-
window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1099
|
+
window.dispatchEvent(new CustomEvent("onLoginFail", y)), f && clearInterval(f);
|
|
1100
1100
|
return;
|
|
1101
1101
|
}
|
|
1102
1102
|
try {
|
|
1103
|
-
const
|
|
1104
|
-
if (!
|
|
1103
|
+
const y = u.location.href.split("?");
|
|
1104
|
+
if (!y[0])
|
|
1105
1105
|
return;
|
|
1106
|
-
const
|
|
1107
|
-
if (u.history.pushState({}, document.title, window.location.pathname),
|
|
1108
|
-
const w = await this.codeExchange(
|
|
1106
|
+
const g = u.location.search;
|
|
1107
|
+
if (u.history.pushState({}, document.title, window.location.pathname), y[0] === this.redirectUri && y.length > 1) {
|
|
1108
|
+
const w = await this.codeExchange(g);
|
|
1109
1109
|
u.close(), w && location.reload(), f && clearInterval(f);
|
|
1110
1110
|
return;
|
|
1111
1111
|
}
|
|
@@ -1164,11 +1164,11 @@ class NylasSessions {
|
|
|
1164
1164
|
const f = await (u == null ? void 0 : u.json());
|
|
1165
1165
|
if (!await this.isAuthenticatedResponse(u.status, f)) {
|
|
1166
1166
|
if (d > 1) {
|
|
1167
|
-
const
|
|
1168
|
-
if (
|
|
1169
|
-
|
|
1167
|
+
const g = await this.getProfile(n.grant_id);
|
|
1168
|
+
if (g) {
|
|
1169
|
+
g.status = "unauthorized", await this.Storage.setUserToken(g);
|
|
1170
1170
|
const w = {
|
|
1171
|
-
detail: { user:
|
|
1171
|
+
detail: { user: g }
|
|
1172
1172
|
};
|
|
1173
1173
|
window.dispatchEvent(new CustomEvent("onSessionExpired", w));
|
|
1174
1174
|
}
|
|
@@ -1192,7 +1192,7 @@ class NylasSessions {
|
|
|
1192
1192
|
const w = await this.getAccessToken();
|
|
1193
1193
|
f.append("Authorization", `Bearer ${w}`);
|
|
1194
1194
|
}
|
|
1195
|
-
const
|
|
1195
|
+
const y = await fetch(u.toString(), {
|
|
1196
1196
|
method: n || "GET",
|
|
1197
1197
|
headers: f,
|
|
1198
1198
|
mode: "cors",
|
|
@@ -1200,7 +1200,7 @@ class NylasSessions {
|
|
|
1200
1200
|
body: s ? JSON.stringify(s) : void 0,
|
|
1201
1201
|
...d || {}
|
|
1202
1202
|
});
|
|
1203
|
-
return c ? await
|
|
1203
|
+
return c ? await y.json() : y.body;
|
|
1204
1204
|
}
|
|
1205
1205
|
// Checks if the response is not 401
|
|
1206
1206
|
async isAuthenticatedResponse(t, n) {
|
|
@@ -1301,60 +1301,79 @@ const LoginRequired = ({ authenticationUrl: r }) => h(
|
|
|
1301
1301
|
),
|
|
1302
1302
|
h("small", { class: "disclaimer-text" }, "* You will be redirected to authenticate your account.")
|
|
1303
1303
|
)
|
|
1304
|
-
)
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1304
|
+
);
|
|
1305
|
+
function ExpressFlow({ selectedConfiguration: r, currentUser: t, calendars: n }) {
|
|
1306
|
+
var c;
|
|
1307
|
+
const s = ((c = r.participants) == null ? void 0 : c.find((a) => a.is_organizer)) ?? t;
|
|
1308
|
+
return h(
|
|
1309
|
+
Fragment,
|
|
1309
1310
|
null,
|
|
1310
1311
|
h(
|
|
1311
|
-
"
|
|
1312
|
-
|
|
1313
|
-
h(
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
)
|
|
1312
|
+
"nylas-event-info",
|
|
1313
|
+
null,
|
|
1314
|
+
h(
|
|
1315
|
+
"div",
|
|
1316
|
+
{ slot: "inputs" },
|
|
1317
|
+
h("nylas-event-title", null),
|
|
1318
|
+
h("nylas-event-duration", null),
|
|
1319
|
+
h("nylas-event-location", null)
|
|
1320
|
+
)
|
|
1321
|
+
),
|
|
1322
|
+
h("nylas-booking-calendar-picker", { calendars: n, currentUser: t, defaultBookingCalendar: s == null ? void 0 : s.email })
|
|
1323
|
+
);
|
|
1324
|
+
}
|
|
1325
|
+
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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}div.scheduler-editor-header{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900)}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;width:858px;margin:0;font-size:18px;line-height:24px;font-weight:600}@media screen and (max-width: 768px){div.scheduler-editor-header h1.scheduler-editor-title{width:auto;min-width:calc(325px - 1rem)}}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)}div.scheduler-editor-header button:disabled{cursor:not-allowed}nylas-editor-tabs{width:auto}nylas-editor-tabs nylas-event-info div[slot=inputs],nylas-editor-tabs 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:554px;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:1rem;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:1rem;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:554px;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.list-configurations{height:auto}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}', NylasSchedulerEditorStyle0 = nylasSchedulerEditorCss, NylasSchedulerEditor = class {
|
|
1320
1326
|
constructor(r) {
|
|
1321
1327
|
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) => {
|
|
1322
1328
|
this.schedulerConfigCloseClicked.emit(this.host).defaultPrevented || (localStorage.removeItem("grant"), localStorage.removeItem("user"), window.location.reload());
|
|
1323
|
-
}, 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.automaticComponentRegistration = !0;
|
|
1329
|
+
}, 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.automaticComponentRegistration = !0;
|
|
1324
1330
|
}
|
|
1325
1331
|
connectedCallback() {
|
|
1326
1332
|
debug("[nylas-scheduler-editor] connectedCallback");
|
|
1327
1333
|
}
|
|
1328
1334
|
async componentWillLoad() {
|
|
1329
|
-
var
|
|
1330
|
-
|
|
1335
|
+
var s, c, a, d, l, u, f, y;
|
|
1336
|
+
debug("[nylas-scheduler-editor] componentWillLoad");
|
|
1337
|
+
const r = (s = this.additionalParticipants) == null ? void 0 : s.filter((g) => {
|
|
1338
|
+
var p;
|
|
1339
|
+
const w = ((p = g.calendars) == null ? void 0 : p.length) > 0 ? g.calendars.filter((S) => S.id && S.name) : [];
|
|
1340
|
+
if (g.name && g.email && w.length > 0)
|
|
1341
|
+
return {
|
|
1342
|
+
name: g.name,
|
|
1343
|
+
email: g.email,
|
|
1344
|
+
calendars: w
|
|
1345
|
+
};
|
|
1346
|
+
});
|
|
1347
|
+
if (this.stores = {
|
|
1331
1348
|
schedulerConfig: CreateNylasSchedulerConfigStore({
|
|
1332
1349
|
...this.defaultSchedulerConfigState,
|
|
1333
|
-
additionalParticipants:
|
|
1350
|
+
additionalParticipants: r,
|
|
1351
|
+
conferenceProviders: this.conferenceProviders,
|
|
1352
|
+
hideEditorTabs: this.hideEditorTabs
|
|
1334
1353
|
})
|
|
1335
1354
|
}, !this.nylasApiRequest && this.nylasSessionsConfig) {
|
|
1336
|
-
const
|
|
1337
|
-
await
|
|
1338
|
-
var
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1341
|
-
}),
|
|
1342
|
-
var
|
|
1343
|
-
(
|
|
1344
|
-
}), this.nylasApiRequest = new NylasIdentityRequestWrapper(
|
|
1355
|
+
const g = new NylasSessions(this.nylasSessionsConfig);
|
|
1356
|
+
await g.isLoggedIn(), g.onLoginSuccess(async () => {
|
|
1357
|
+
var p, S;
|
|
1358
|
+
const w = await ((S = (p = this.nylasSchedulerConfigConnector) == null ? void 0 : p.schedulerConfig) == null ? void 0 : S.currentUser());
|
|
1359
|
+
w && (this.loggedIn.emit(this.host), this.loggedInHandler(w));
|
|
1360
|
+
}), g.onLoginFail(async () => {
|
|
1361
|
+
var w, p;
|
|
1362
|
+
(p = (w = this.stores) == null ? void 0 : w.schedulerConfig) == null || p.set("currentUser", null), this.loggedOut.emit(this.host);
|
|
1363
|
+
}), this.nylasApiRequest = new NylasIdentityRequestWrapper(g);
|
|
1345
1364
|
}
|
|
1346
1365
|
this.nylasApiRequest && this.defaultAuthArgs && this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs), this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
|
|
1347
|
-
const
|
|
1366
|
+
const t = this.baseProvider.getStore("schedulerConfig");
|
|
1348
1367
|
if (this.nylasSchedulerConfigConnector = new NylasSchedulerConfigConnector({
|
|
1349
1368
|
nylasApiRequest: this.nylasApiRequest,
|
|
1350
|
-
nylasSchedulerConfigStore:
|
|
1369
|
+
nylasSchedulerConfigStore: t
|
|
1351
1370
|
}), !this.init.emit(this.host).defaultPrevented) {
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1371
|
+
const g = await ((a = (c = this.nylasSchedulerConfigConnector) == null ? void 0 : c.schedulerConfig) == null ? void 0 : a.currentUser());
|
|
1372
|
+
g ? (this.loggedIn.emit(this.host), await this.loggedInHandler(g)) : ((l = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null || l.set("currentUser", null), this.loggedOut.emit(this.host));
|
|
1354
1373
|
}
|
|
1355
|
-
(
|
|
1356
|
-
|
|
1357
|
-
}), (
|
|
1374
|
+
(f = (u = this.stores) == null ? void 0 : u.schedulerConfig) == null || f.onChange("selectedConfiguration", async (g) => {
|
|
1375
|
+
g && g.id && (this.configurationId = g.id);
|
|
1376
|
+
}), (y = this.baseProvider) == null || y.componentWillLoad(this.nylasSchedulerConfigConnector);
|
|
1358
1377
|
}
|
|
1359
1378
|
async componentDidLoad() {
|
|
1360
1379
|
var r;
|
|
@@ -1394,8 +1413,8 @@ const LoginRequired = ({ authenticationUrl: r }) => h(
|
|
|
1394
1413
|
}
|
|
1395
1414
|
}
|
|
1396
1415
|
render() {
|
|
1397
|
-
var r, t, n, s, c, a, d, l;
|
|
1398
|
-
return h(Host, { key: "
|
|
1416
|
+
var r, t, n, s, c, a, d, l, u, f, y, g, w, p, S, m;
|
|
1417
|
+
return h(Host, { key: "843aa39842caf2c85154b6b70120bf7f66d6e13b" }, h("div", { key: "bb75d22d48ac322be916635dbbb6229b1077db36", class: "scheduler-editor-header", part: "nse__header" }, h("h1", { key: "ae180ddc9c742c58e91cfeae59c76129f2b8d4b1", class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { key: "6f96e2158cccdddbad611fb64fa5d37795a60ee7", width: "18", height: "18" }), "Scheduler editor"), h("button", { key: "f24abc88ac228e1b0c05689cbe9b33560d87a7a5", class: "scheduler-editor-close", title: "logout", onClick: (x) => this.handleSchedulerConfigCloseClicked(x), part: "nse__close-button" }, h("close-icon", { key: "916d5d1c0506995603598e6a56d16586690a509b", width: "18", height: "18" }))), ((t = (r = this.stores) == null ? void 0 : r.schedulerConfig) == null ? void 0 : t.state.currentUser) && this.stores.schedulerConfig.state.action === null && h("div", { class: "list-configurations" }, h("nylas-list-configurations", null)), ((s = (n = this.stores) == null ? void 0 : n.schedulerConfig) == null ? void 0 : s.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && h("nylas-editor-tabs", { mode: "composable" }, h(ExpressFlow, { currentUser: (a = (c = this.stores) == null ? void 0 : c.schedulerConfig) == null ? void 0 : a.state.currentUser, calendars: (u = (l = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null ? void 0 : l.state) == null ? void 0 : u.calendars, selectedConfiguration: (g = (y = (f = this.stores) == null ? void 0 : f.schedulerConfig) == null ? void 0 : y.state) == null ? void 0 : g.selectedConfiguration })), ((p = (w = this.stores) == null ? void 0 : w.schedulerConfig) == null ? void 0 : p.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && h("nylas-editor-tabs", { mode: this.mode }, this.mode === "composable" && h("slot", null)), !((m = (S = this.stores) == null ? void 0 : S.schedulerConfig) != null && m.state.currentUser) && h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl })));
|
|
1399
1418
|
}
|
|
1400
1419
|
get host() {
|
|
1401
1420
|
return getElement(this);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-d36b8fb8.cjs"),m=require("./index.es-9cc0eb3c-8eefd4fc.cjs"),y=require("./scheduler-store-8a400448-44e0edad.cjs");require("react");require("react-dom");class C{constructor({schedulerAPIURL:e,nylasSchedulerStore:o,sessionId:i,configId:s}){if(!e)throw new Error("schedulerAPIURL is required");if(!o)throw new Error("nylasSchedulerStore is required");if(!i&&!s)throw new Error("sessionId is required for private configs, if not config id is required for public configs");e==="/"&&(e=new URL(window.location.href).origin),this.configId=s,this.sessionId=i,this.schedulerAPIURL=e,this.nylasSchedulerStore=o}init(){t.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new y.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}const b=(n,e)=>{const o=n.isLoading,i=n.showNotification,s=n.nylasBranding;return t.h(t.Fragment,null,i&&t.h("nylas-notification",null),o&&t.h("div",{class:"loading"},t.h("div",{class:"left"},t.h("div",{class:"skeleton"})),t.h("div",{class:"right"},t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}))),!o&&e,t.h("div",{class:"footer"},s&&t.h(t.Fragment,null,"Powered by ",t.h("nylas-logo",null))))},w=(n,e)=>t.h("div",{class:"message-banner"},e),E=':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 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin-top:1rem}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:384px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}',D=E,x={title:"Something went wrong...",type:m.nr.Error,category:y.ErrorCategory.Component},I=class{constructor(n){t.registerInstance(this,n),this.init=t.createEvent(this,"init",7),this.schedulerWillLoad=t.createEvent(this,"schedulerWillLoad",7),this.schedulerDidLoad=t.createEvent(this,"schedulerDidLoad",7),this.nylasSchedulerError=t.createEvent(this,"nylasSchedulerError",7),this.bookingRefExtracted=t.createEvent(this,"bookingRefExtracted",7),this.mode="app",this.defaultSchedulerState=void 0,this.sessionId=void 0,this.schedulerApiUrl="https://api.us.nylas.com",this.bookingInfo=void 0,this.rescheduleBookingRef=void 0,this.cancelBookingRef=void 0,this.configurationId=void 0,this.nylasBranding=!0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.showNotification=!0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(void 0,{dateStyle:"full"})||"No date selected",this.refConfigId=void 0}connectedCallback(){t.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var o,i;if(t.debug("[nylas-scheduler] Component will load"),this.schedulerWillLoad.emit(this.host).defaultPrevented)return;if(this.stores={scheduler:y.CreateNylasSchedulerStore({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})},this.baseProvider=new m.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.refConfigId=this.configurationId,this.rescheduleBookingRef){const[s,a]=t.compactStringToUUIDs(this.rescheduleBookingRef);this.refConfigId=s,this.stores.scheduler.set("rescheduleBookingId",a),this.bookingRefExtracted.emit({configurationId:s,bookingId:a})}else if(this.cancelBookingRef){const[s,a]=t.compactStringToUUIDs(this.cancelBookingRef);this.refConfigId=s,this.stores.scheduler.set("cancelBookingId",a),this.bookingRefExtracted.emit({configurationId:s,bookingId:a})}if(!this.checkIfSessionIdOrConfigIdExists())return;const e=(o=this.baseProvider)==null?void 0:o.getStore("scheduler");if(this.nylasSchedulerConnector=new C({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,nylasSchedulerStore:e}),this.init.emit(this.host),(i=this.baseProvider)==null||i.componentWillLoad(this.nylasSchedulerConnector),this.themeConfig)for(const[s,a]of Object.entries(this.themeConfig))this.host.style.setProperty(`${s}`,a)}async componentDidLoad(){var d,l,h,g,c,v,k;if((d=this.baseProvider)==null||d.componentDidLoad(),!this.checkIfSessionIdOrConfigIdExists())return;const n=await((l=this.nylasSchedulerConnector)==null?void 0:l.scheduler.getUISettings());(!n||"error"in n)&&this.nylasSchedulerError.emit({...this.getErrorObject(n==null?void 0:n.error)});const e=(h=this.baseProvider)==null?void 0:h.getStore("scheduler"),o=(c=(g=e==null?void 0:e.get("configSettings"))==null?void 0:g.scheduler)==null?void 0:c.available_days_in_future,i=e==null?void 0:e.get("selectedTimeslot");if(i&&(i!=null&&i.start_time)){if(!this.isTimeslotValid(i))return;if(e!=null&&e.get("showBookingForm")){e==null||e.set("selectedDate",i.start_time);return}}const s=e==null?void 0:e.get("selectedDate"),a=e==null?void 0:e.get("availability");let r;if(!(a&&a.length>0)){if(s){const{startTime:u,endTime:f,endTimeForAvailableDaysInFuture:p}=this.validateAvailableDaysInFuture(s,o||30);s.getTime()<p*1e3&&(r=await((k=this.nylasSchedulerConnector)==null?void 0:k.scheduler.getAvailability(u,f)))}else{const u=new Date,{startTime:f,endTime:p,endTimeForAvailableDaysInFuture:_}=this.validateAvailableDaysInFuture(u,o||30);u.getTime()<_*1e3&&(r=await((v=this.nylasSchedulerConnector)==null?void 0:v.scheduler.getAvailability(f,p)))}if((!r||"error"in r)&&this.nylasSchedulerError.emit({...this.getErrorObject(r==null?void 0:r.error)}),!s){let u=new Date;const f=e==null?void 0:e.get("availability").find(p=>new Date(p.start_time)>new Date);f&&(u=f.start_time),e==null||e.set("selectedDate",u)}}}componentDisconnected(){var n;(n=this.baseProvider)==null||n.componentDisconnected()}bookingInfoChanged(n){var e;(e=this.stores)==null||e.scheduler.set("bookingInfo",n)}rescheduleBookingRefChanged(n){var e,o;if(n){const[i,s]=t.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("rescheduleBookingId",s),this.refConfigId=i,(o=this.nylasSchedulerConnector)==null||o.scheduler.setConfigId(i)}}cancelBookingRefChanged(n){var e,o;if(n){const[i,s]=t.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("cancelBookingId",s),this.refConfigId=i,(o=this.nylasSchedulerConnector)==null||o.scheduler.setConfigId(i)}}async registerComponentHandler(n){var e;(e=this.baseProvider)==null||e.registerComponent(n.detail)}async unregisterComponentHandler(n){var e;(e=this.baseProvider)==null||e.unregisterComponent(n.detail)}async monthChangedHandler(n){var r,d,l,h,g;const e=n.detail,o=(h=(l=(d=(r=this.nylasSchedulerConnector)==null?void 0:r.schedulerStore)==null?void 0:d.get("configSettings"))==null?void 0:l.scheduler)==null?void 0:h.available_days_in_future,{startTime:i,endTime:s,endTimeForAvailableDaysInFuture:a}=this.validateAvailableDaysInFuture(e,o||30);if(i<a&&e.getTime()<a*1e3){const c=await((g=this.nylasSchedulerConnector)==null?void 0:g.scheduler.getAvailability(i,s));(!c||"error"in c)&&this.nylasSchedulerError.emit({...this.getErrorObject(c==null?void 0:c.error)})}}async bookButtonClickedHandler(n){var s,a,r,d;const o=(a=(s=this.nylasSchedulerConnector)==null?void 0:s.schedulerStore)==null?void 0:a.get("rescheduleBookingId");if(o){const l=await((r=this.nylasSchedulerConnector)==null?void 0:r.scheduler.rescheduleBooking(o,n.detail));(!l||"error"in l)&&this.nylasSchedulerError.emit({...this.getErrorObject(l==null?void 0:l.error)});return}const i=await((d=this.nylasSchedulerConnector)==null?void 0:d.scheduler.bookTimeslot(n.detail));(!i||"error"in i)&&this.nylasSchedulerError.emit({...this.getErrorObject(i==null?void 0:i.error)})}dateSelectedHandler(n){const e=n.detail;this.selectedDateLabel=e?e.toLocaleDateString(void 0,{dateStyle:"full"}):"No date selected"}cancelBookedEventErrorHandler(n){this.nylasSchedulerError.emit({...this.getErrorObject(n.detail.error)})}cancelBookedEventValidationErrorHandler(n){this.nylasSchedulerError.emit({...this.getErrorObject(n.detail.error)})}rescheduleBookedEventErrorHandler(n){this.nylasSchedulerError.emit({...this.getErrorObject(n.detail.error)})}async getNylasSchedulerStore(){var n;return(n=this.baseProvider)==null?void 0:n.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(n){return{title:(n==null?void 0:n.title)||x.title,category:(n==null?void 0:n.category)||x.category,type:m.nr.Error,description:(n==null?void 0:n.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){return!this.sessionId&&!this.refConfigId?(this.nylasSchedulerError.emit({title:"No sessionId!",category:y.ErrorCategory.Component,type:m.nr.Error,description:"Session ID is required",id:new Date().getTime().toString(),ttl:"none"}),!1):!0}isTimeslotValid(n){return new Date(n.start_time)<new Date?(this.nylasSchedulerError.emit({title:"Invalid tiemslot!",category:y.ErrorCategory.Component,type:m.nr.Error,description:"The selected timeslot is invalid.",id:new Date().getTime().toString(),ttl:"none"}),!1):!0}validateAvailableDaysInFuture(n,e){const o=new Date,i=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,s=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,a=Math.floor(t.addDaysToCurrentDate(o,e).getTime()/1e3),r=Math.min(a,s);return{startTime:i<o.getTime()/1e3?Math.floor(o.getTime()/1e3):i,endTime:r,endTimeForAvailableDaysInFuture:a}}render(){var g;const n=this.mode==="app",e=(g=this.baseProvider)==null?void 0:g.getStore("scheduler"),o=e==null?void 0:e.get("eventInfo"),i=e==null?void 0:e.get("showBookingForm"),s=e==null?void 0:e.get("cancelledEventInfo"),a=e==null?void 0:e.get("cancelBookingId"),r=e==null?void 0:e.get("selectedTimeslot"),d=e==null?void 0:e.get("rescheduleBookingId"),l=(e==null?void 0:e.get("nylasBranding"))||this.nylasBranding,h=e==null?void 0:e.get("selectedDate");if(this.selectedDateLabel=h?h.toLocaleDateString(void 0,{dateStyle:"full"}):"No date selected",n&&a&&!s)return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},t.h("nylas-cancel-booking-form",{selectedTimeslot:r,cancelBookingId:a,exportparts:"ncbf, ncbf__input-textfield, ncbf__button-cta, ncbf__button-outline, ncbf__input-label"}))));if(n&&s)return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},t.h("nylas-cancelled-event-card",{cancelledEventInfo:s,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))));if(n&&o)return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"booked-event-page",part:"booked-event-page"},t.h("nylas-booked-event-card",{selectedTimeslot:r,eventInfo:o,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))));if(n&&(!o||d)&&!i){const c=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},d&&t.h(w,null,"Choose another time slot to reschedule your meeting"),t.h("div",{class:"select-date-page",part:"select-date-page"},t.h("div",{class:"left-panel"},t.h("nylas-date-picker",{exportparts:"ndp, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),t.h("nylas-locale-switch",null)),t.h("div",{class:"right-panel"},t.h("h2",null,t.h("calendar-icon",null),t.h("span",{id:"selectedDate"},this.selectedDateLabel)),t.h("nylas-timeslot-picker",{exportparts:"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},c&&t.h("span",{slot:"timeslot-picker-cta-label"},t.h("slot",{name:"timeslot-picker-cta-label"})))))))}if(n&&!o&&i){const c=this.host.querySelector('[slot="custom-booking-form"]');return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},d&&t.h(w,null,"Choose another time slot to reschedule your meeting"),t.h("div",{class:"additional-data-page",part:"additional-data-page"},t.h("div",{class:"left-panel"},t.h("div",{class:"wrapper"},t.h("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time"}))),t.h("div",{class:"right-panel"},t.h("nylas-booking-form",{exportparts:"nbf, nbf__input-label, nbf__input-textfield, nbf__button-ghost, nbf__button-primary, nbf__button-outline"},c&&t.h("div",{slot:"custom-booking-form"},t.h("slot",{name:"custom-booking-form"})))))))}return t.h(t.Host,null,t.h("slot",null))}get host(){return t.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"]}}};I.style=D;exports.nylas_scheduling=I;
|