@nylas/react 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_2.entry-6753bd65.js +25 -0
- package/dist/add-circle-icon_2.entry-cd9a7f37.cjs +1 -0
- package/dist/archive-icon.entry-434d1696.js +15 -0
- package/dist/archive-icon.entry-7cb1c265.cjs +1 -0
- package/dist/arrow-icon.entry-20b50784.js +15 -0
- package/dist/{arrow-icon.entry-a924df13.cjs → arrow-icon.entry-83c3105b.cjs} +1 -1
- package/dist/bold-icon.entry-0e3d84e1.cjs +1 -0
- package/dist/bold-icon.entry-34b18d0d.js +15 -0
- package/dist/{button-component_2.entry-b9d3f6a2.cjs → button-component_2.entry-54101987.cjs} +1 -1
- package/dist/{button-component_2.entry-93aa59a2.js → button-component_2.entry-8a5e99da.js} +7 -7
- package/dist/calendar-agenda-fill-icon_51.entry-1920adc2.cjs +7 -0
- package/dist/{calendar-agenda-fill-icon_48.entry-476bc4ef.js → calendar-agenda-fill-icon_51.entry-a351dca5.js} +997 -917
- package/dist/{calendar-cancel-icon.entry-11bb8656.cjs → calendar-cancel-icon.entry-00756264.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-ee0acc54.js → calendar-cancel-icon.entry-f83e9b41.js} +2 -2
- package/dist/{calendar-check-icon_2.entry-54a82e1e.js → calendar-check-icon_2.entry-1817540c.js} +7 -7
- package/dist/{calendar-check-icon_2.entry-14548656.cjs → calendar-check-icon_2.entry-6ac948fc.cjs} +1 -1
- package/dist/{calendar-icon.entry-29f7003b.js → calendar-icon.entry-362428bf.js} +4 -4
- package/dist/{calendar-icon.entry-1a17f887.cjs → calendar-icon.entry-68e53f52.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-dfec10cb.js → checkbox-component_2.entry-0d7c1916.js} +3 -3
- package/dist/{checkbox-component_2.entry-84a17232.cjs → checkbox-component_2.entry-5ce9807d.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-826e81d4.js → chevron-icon_3.entry-37c087a7.js} +8 -8
- package/dist/{chevron-icon_3.entry-5da08d02.cjs → chevron-icon_3.entry-89c52603.cjs} +1 -1
- package/dist/{clock-icon_4.entry-36d97f00.js → clock-icon_4.entry-2e78febe.js} +11 -11
- package/dist/{clock-icon_4.entry-dafdd895.cjs → clock-icon_4.entry-496058ef.cjs} +1 -1
- package/dist/{constants-50c3e067-fed7fb48.js → constants-c31dccfe-04b9cd8a.js} +2 -2
- package/dist/{constants-50c3e067-1fe54cf3.cjs → constants-c31dccfe-1a739653.cjs} +2 -2
- package/dist/{copy-icon.entry-6d1a649d.js → copy-icon.entry-6d4e05b0.js} +7 -7
- package/dist/{copy-icon.entry-eec265da.cjs → copy-icon.entry-a1baee33.cjs} +1 -1
- package/dist/delete-icon.entry-e98b336e.cjs +1 -0
- package/dist/delete-icon.entry-ea06b42a.js +15 -0
- package/dist/document-refresh-icon.entry-09750b52.cjs +1 -0
- package/dist/document-refresh-icon.entry-afae6621.js +15 -0
- package/dist/elements/index.d.ts +2 -11
- package/dist/feedbackSync-ab657d65-e650e46d.cjs +448 -0
- package/dist/feedbackSync-ab657d65-e8b7c001.js +6035 -0
- package/dist/folder-icon.entry-5c3f4e8f.cjs +1 -0
- package/dist/folder-icon.entry-6096fbf4.js +15 -0
- package/dist/forward-icon.entry-4089e3bb.cjs +1 -0
- package/dist/forward-icon.entry-da319c05.js +15 -0
- package/dist/{globe-icon.entry-154ccdb5.js → globe-icon.entry-59f4c2f9.js} +4 -4
- package/dist/{globe-icon.entry-95fc0408.cjs → globe-icon.entry-e8ca972e.cjs} +1 -1
- package/dist/{google-logo-icon_4.entry-68cfa3fe.js → google-logo-icon_4.entry-d4b8926f.js} +331 -289
- package/dist/google-logo-icon_4.entry-e2001f83.cjs +1 -0
- package/dist/inbox-icon.entry-70dae5ec.js +15 -0
- package/dist/inbox-icon.entry-80ee9082.cjs +1 -0
- package/dist/index-6b9d4b01.cjs +81 -0
- package/dist/{index-1322d804.js → index-e475e0c0.js} +3126 -3103
- package/dist/index.d.ts +1 -1
- package/dist/{index.es-79f5b771-08cc349d.cjs → index.es-b475d61f-68a74a28.cjs} +5 -5
- package/dist/{index.es-79f5b771-04cd3414.js → index.es-b475d61f-bfa2cba2.js} +125 -131
- package/dist/{info-icon_2.entry-49261a0a.js → info-icon_2.entry-2bb60213.js} +3 -3
- package/dist/{info-icon_2.entry-2af880b8.cjs → info-icon_2.entry-f1b1dfba.cjs} +1 -1
- package/dist/{input-color-picker.entry-aefe0e26.js → input-color-picker.entry-5ae45a9e.js} +3 -3
- package/dist/{input-color-picker.entry-57adff77.cjs → input-color-picker.entry-b669f7fb.cjs} +1 -1
- package/dist/{input-component.entry-d7c2724b.js → input-component.entry-cb958501.js} +2 -2
- package/dist/{input-component.entry-09c3c9b6.cjs → input-component.entry-eeb95361.cjs} +1 -1
- package/dist/{input-dropdown.entry-e7d26273.cjs → input-dropdown.entry-0b458f68.cjs} +1 -1
- package/dist/{input-dropdown.entry-e573ade0.js → input-dropdown.entry-962605f8.js} +4 -4
- package/dist/italic-icon.entry-4a89e289.cjs +1 -0
- package/dist/italic-icon.entry-5be07509.js +15 -0
- package/dist/{multi-select-dropdown.entry-15cacb87.js → multi-select-dropdown.entry-3084e1fc.js} +5 -5
- package/dist/{multi-select-dropdown.entry-46b2b1c9.cjs → multi-select-dropdown.entry-a66408a2.cjs} +1 -1
- package/dist/nylas-booked-event-card_12.entry-227ccf31.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-3921071a.js → nylas-booked-event-card_12.entry-29e2a4b1.js} +84 -81
- package/dist/{nylas-form-card.entry-ca835017.js → nylas-form-card.entry-33b4c295.js} +15 -15
- package/dist/{nylas-form-card.entry-db3f0e3b.cjs → nylas-form-card.entry-8465eccf.cjs} +1 -1
- package/dist/{nylas-if-state.entry-4159d41d.js → nylas-if-state.entry-9d96fc87.js} +2 -2
- package/dist/{nylas-if-state.entry-5410607c.cjs → nylas-if-state.entry-adb6103a.cjs} +1 -1
- package/dist/{nylas-login.entry-590e7fba.js → nylas-login.entry-3f7c195e.js} +7 -7
- package/dist/{nylas-login.entry-f1d7bc7d.cjs → nylas-login.entry-78b968d1.cjs} +1 -1
- package/dist/nylas-provider.entry-19635620.js +264 -0
- package/dist/nylas-provider.entry-b918d0f6.cjs +1 -0
- package/dist/nylas-reminder-emails.entry-ec79b757.js +168 -0
- package/dist/nylas-reminder-emails.entry-ee76db24.cjs +4 -0
- package/dist/{nylas-reminder-time_2.entry-0357f280.js → nylas-reminder-time_2.entry-105de2d0.js} +42 -39
- package/dist/nylas-reminder-time_2.entry-83ecc1d4.cjs +1 -0
- package/dist/{nylas-scheduler-editor.entry-d2c3bddc.cjs → nylas-scheduler-editor.entry-cfed7ae2.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-6bb290ed.js → nylas-scheduler-editor.entry-e848771f.js} +7 -7
- package/dist/nylas-scheduling.entry-da987c02.js +400 -0
- package/dist/nylas-scheduling.entry-e989cf9e.cjs +1 -0
- package/dist/{nylas-time-window-picker.entry-1b449403.cjs → nylas-time-window-picker.entry-1f76b577.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-260f52a6.js → nylas-time-window-picker.entry-3c6b29d9.js} +20 -20
- package/dist/{person-icon.entry-ed6786db.js → person-icon.entry-79fcd9fb.js} +4 -4
- package/dist/{person-icon.entry-b4ce06b7.cjs → person-icon.entry-82bbb87c.cjs} +1 -1
- package/dist/play-icon.entry-3f357ea4.cjs +1 -0
- package/dist/play-icon.entry-97b40470.js +15 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +109 -118
- package/dist/{refresh-icon.entry-87af05b0.js → refresh-icon.entry-1427a5e6.js} +5 -5
- package/dist/{refresh-icon.entry-21ac359d.cjs → refresh-icon.entry-7ce5ec90.cjs} +1 -1
- package/dist/{register-component-ea95564d-a64ee107.cjs → register-component-679c1308-b5a96acf.cjs} +1 -1
- package/dist/{register-component-ea95564d-843da1da.js → register-component-679c1308-de697ecb.js} +1 -1
- package/dist/reply-all-icon.entry-cf8114db.cjs +1 -0
- package/dist/reply-all-icon.entry-f1165660.js +15 -0
- package/dist/reply-icon.entry-3a601cff.js +15 -0
- package/dist/reply-icon.entry-3db337c9.cjs +1 -0
- package/dist/{scheduler-config-store-2a3b403d-8553b685.js → scheduler-config-store-2a3b403d-e5210f72.js} +1 -1
- package/dist/{scheduler-config-store-2a3b403d-88840eb1.cjs → scheduler-config-store-2a3b403d-e6f5bcab.cjs} +1 -1
- package/dist/scheduler-store-908886c8-62d14677.cjs +1 -0
- package/dist/{scheduler-store-9ff4914b-d1a624f8.js → scheduler-store-908886c8-b0f43cb9.js} +2 -2
- package/dist/sent-icon.entry-2c7bd48e.js +15 -0
- package/dist/sent-icon.entry-708b9a2b.cjs +1 -0
- package/dist/spam-icon.entry-3106ed3d.js +15 -0
- package/dist/spam-icon.entry-fa8b80c6.cjs +1 -0
- package/dist/star-icon.entry-88501c8b.cjs +1 -0
- package/dist/star-icon.entry-b15601ca.js +15 -0
- package/dist/stop-icon.entry-3475e257.cjs +1 -0
- package/dist/stop-icon.entry-f926a8db.js +15 -0
- package/dist/{textarea-component.entry-cbffb0b0.cjs → textarea-component.entry-683c2959.cjs} +1 -1
- package/dist/{textarea-component.entry-dad42f20.js → textarea-component.entry-d1f4dd9a.js} +2 -2
- package/dist/{time-period-selector.entry-e54d0989.cjs → time-period-selector.entry-8cfdf750.cjs} +1 -1
- package/dist/{time-period-selector.entry-79c94da3.js → time-period-selector.entry-e97f86fd.js} +2 -2
- package/dist/{translate-icon.entry-ef6266c4.js → translate-icon.entry-09c5574f.js} +2 -2
- package/dist/{translate-icon.entry-8e9eeeba.cjs → translate-icon.entry-5757c37c.cjs} +1 -1
- package/dist/trash-fill-icon.entry-470ec1ff.js +15 -0
- package/dist/trash-fill-icon.entry-4bbfabcc.cjs +1 -0
- package/dist/underline-icon.entry-6d729068.cjs +1 -0
- package/dist/underline-icon.entry-9fe74ba7.js +15 -0
- package/dist/{warning-icon.entry-34c85de2.cjs → warning-icon.entry-c1d48318.cjs} +1 -1
- package/dist/{warning-icon.entry-adf18211.js → warning-icon.entry-d924f8f9.js} +5 -5
- package/package.json +2 -2
- package/dist/add-circle-icon_2.entry-611be49d.js +0 -25
- package/dist/add-circle-icon_2.entry-f1383568.cjs +0 -1
- package/dist/archive-icon_7.entry-59cc6868.cjs +0 -1
- package/dist/archive-icon_7.entry-5e6ba9e7.js +0 -75
- package/dist/arrow-icon.entry-9c19a803.js +0 -15
- package/dist/bold-icon_3.entry-2935a3df.js +0 -35
- package/dist/bold-icon_3.entry-ffe02f93.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_48.entry-c4ea84b3.cjs +0 -7
- package/dist/delete-icon_2.entry-160ba41e.cjs +0 -1
- package/dist/delete-icon_2.entry-528a3879.js +0 -25
- package/dist/document-refresh-icon.entry-276704dc.cjs +0 -1
- package/dist/document-refresh-icon.entry-6565f3b5.js +0 -15
- package/dist/elements-dc5b338e-2d3857dc.js +0 -28031
- package/dist/elements-dc5b338e-b06b2857.cjs +0 -16516
- package/dist/flow-40ff9cea-6f8c30e2.cjs +0 -9
- package/dist/flow-40ff9cea-ee70fdf5.js +0 -505
- package/dist/focus-visible-e8093c16-47e61336.cjs +0 -1
- package/dist/focus-visible-e8093c16-6f68eb89.js +0 -84
- package/dist/forward-icon_6.entry-ed6ab66a.js +0 -953
- package/dist/forward-icon_6.entry-fed8994d.cjs +0 -3
- package/dist/google-logo-icon_4.entry-afffb209.cjs +0 -1
- package/dist/index-c4e817ef.cjs +0 -82
- package/dist/mailbox-store-9c52a3fa-27f8f7e6.js +0 -380
- package/dist/mailbox-store-9c52a3fa-6b39645f.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-47c5381d.cjs +0 -1
- package/dist/nylas-list-folders.entry-0f143930.cjs +0 -1
- package/dist/nylas-list-folders.entry-6b4a3d96.js +0 -120
- package/dist/nylas-list-threads.entry-62108562.js +0 -70
- package/dist/nylas-list-threads.entry-68b6f32b.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-8377fdee.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-ba1af8fb.js +0 -101
- package/dist/nylas-mailbox-toolbar-button.entry-4497acd0.js +0 -82
- package/dist/nylas-mailbox-toolbar-button.entry-6a5d8387.cjs +0 -1
- package/dist/nylas-mailbox.entry-917c22f5.js +0 -134
- package/dist/nylas-mailbox.entry-a07652b4.cjs +0 -1
- package/dist/nylas-provider.entry-0e520ac3.cjs +0 -1
- package/dist/nylas-provider.entry-20c47b14.js +0 -145
- package/dist/nylas-reminder-emails.entry-088ee120.js +0 -129
- package/dist/nylas-reminder-emails.entry-69626e7f.cjs +0 -4
- package/dist/nylas-reminder-time_2.entry-b5c181db.cjs +0 -1
- package/dist/nylas-scheduling.entry-bc9c25c5.js +0 -359
- package/dist/nylas-scheduling.entry-dc92d5e7.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-45d7d171.js +0 -74
- package/dist/nylas-threads-refresh.entry-6636e7b1.cjs +0 -1
- package/dist/nylas-threads-search.entry-4460aa9b.js +0 -69
- package/dist/nylas-threads-search.entry-ae87695a.cjs +0 -1
- package/dist/nylas-view-thread.entry-5821630b.js +0 -203
- package/dist/nylas-view-thread.entry-5a9b353a.cjs +0 -1
- package/dist/play-icon_2.entry-261ea828.js +0 -25
- package/dist/play-icon_2.entry-87fe39a9.cjs +0 -1
- package/dist/scheduler-store-9ff4914b-63dc472a.cjs +0 -1
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
import { k as g, r as R, c as _, d as E, l as I, m as O, n as N, h as i, H as y, g as A, F as D } from "./index-1322d804.js";
|
|
2
|
-
import { n as x, N as P } from "./index.es-79f5b771-04cd3414.js";
|
|
3
|
-
import { E as B, C as F, N as S } from "./scheduler-store-9ff4914b-d1a624f8.js";
|
|
4
|
-
import { L as j, a as M } from "./constants-50c3e067-fed7fb48.js";
|
|
5
|
-
import "react";
|
|
6
|
-
import "react-dom";
|
|
7
|
-
class H {
|
|
8
|
-
constructor({ schedulerAPIURL: e, nylasSchedulerStore: n, sessionId: a, configId: o, slug: r, clientId: d }) {
|
|
9
|
-
if (!e)
|
|
10
|
-
throw new Error("schedulerAPIURL is required");
|
|
11
|
-
if (!n)
|
|
12
|
-
throw new Error("nylasSchedulerStore is required");
|
|
13
|
-
if (!a && !o && !(r || d))
|
|
14
|
-
throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");
|
|
15
|
-
e === "/" && (e = new URL(window.location.href).origin), this.configId = o, this.sessionId = a, this.schedulerAPIURL = e, this.nylasSchedulerStore = n, this.slug = r, this.clientId = d;
|
|
16
|
-
}
|
|
17
|
-
init() {
|
|
18
|
-
E("NylasConnector init");
|
|
19
|
-
}
|
|
20
|
-
get schedulerStore() {
|
|
21
|
-
return this.nylasSchedulerStore;
|
|
22
|
-
}
|
|
23
|
-
get scheduler() {
|
|
24
|
-
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new S({
|
|
25
|
-
schedulerAPIURL: this.schedulerAPIURL,
|
|
26
|
-
schedulerStore: this.schedulerStore,
|
|
27
|
-
sessionId: this.sessionId,
|
|
28
|
-
configId: this.configId,
|
|
29
|
-
slug: this.slug,
|
|
30
|
-
clientId: this.clientId
|
|
31
|
-
}), this._schedulerAPIConnector);
|
|
32
|
-
}
|
|
33
|
-
resetStores() {
|
|
34
|
-
this.nylasSchedulerStore.reset();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const k = (t, e) => {
|
|
38
|
-
const n = t.isLoading, a = t.showNotification, o = t.nylasBranding;
|
|
39
|
-
return i(
|
|
40
|
-
D,
|
|
41
|
-
null,
|
|
42
|
-
a && i("nylas-notification", null),
|
|
43
|
-
n && i(
|
|
44
|
-
"div",
|
|
45
|
-
{ class: "loading" },
|
|
46
|
-
i(
|
|
47
|
-
"div",
|
|
48
|
-
{ class: "left" },
|
|
49
|
-
i("div", { class: "skeleton" })
|
|
50
|
-
),
|
|
51
|
-
i(
|
|
52
|
-
"div",
|
|
53
|
-
{ class: "right" },
|
|
54
|
-
i("div", { class: "skeleton" }),
|
|
55
|
-
i("div", { class: "skeleton" }),
|
|
56
|
-
i("div", { class: "skeleton" }),
|
|
57
|
-
i("div", { class: "skeleton" }),
|
|
58
|
-
i("div", { class: "skeleton" })
|
|
59
|
-
)
|
|
60
|
-
),
|
|
61
|
-
!n && e,
|
|
62
|
-
i("div", { class: "footer" }, o && i(
|
|
63
|
-
D,
|
|
64
|
-
null,
|
|
65
|
-
"Powered by ",
|
|
66
|
-
i("nylas-logo", null)
|
|
67
|
-
))
|
|
68
|
-
);
|
|
69
|
-
}, L = (t, e) => i("div", { class: "message-banner" }, e), U = ':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 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px 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:0}.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,.manual-confirmation-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,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;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}.right-panel.reschedule{border-top-right-radius:0px}@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}', W = U, T = { title: g.t("genericErrorTitle"), type: x.Error, category: B.Component }, $ = class {
|
|
70
|
-
constructor(t) {
|
|
71
|
-
R(this, t), this.init = _(this, "init", 7), this.schedulerWillLoad = _(this, "schedulerWillLoad", 7), this.schedulerDidLoad = _(this, "schedulerDidLoad", 7), this.nylasSchedulerError = _(this, "nylasSchedulerError", 7), this.configSettingsLoaded = _(this, "configSettingsLoaded", 7), this.bookingRefExtracted = _(this, "bookingRefExtracted", 7), this.bookedEventInfo = _(this, "bookedEventInfo", 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.organizerConfirmationBookingRef = void 0, this.configurationId = void 0, this.slug = void 0, this.clientId = void 0, this.nylasBranding = !0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.localization = void 0, this.showNotification = !0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, { dateStyle: "full" }) || `${g.t("noDateSelected")}`, this.refConfigId = void 0, this.language = navigator.language;
|
|
72
|
-
}
|
|
73
|
-
connectedCallback() {
|
|
74
|
-
E("[nylas-scheduler] connectedCallback");
|
|
75
|
-
}
|
|
76
|
-
async componentWillLoad() {
|
|
77
|
-
var o, r;
|
|
78
|
-
E("[nylas-scheduler] Component will load");
|
|
79
|
-
const t = this.schedulerWillLoad.emit(this.host);
|
|
80
|
-
if ("schedulerWillLoad" in this.eventOverrides && (await this.eventOverrides.schedulerWillLoad(t, this.nylasSchedulerConnector), t.defaultPrevented))
|
|
81
|
-
return;
|
|
82
|
-
this.stores = {
|
|
83
|
-
scheduler: F({
|
|
84
|
-
bookingInfo: this.bookingInfo,
|
|
85
|
-
nylasBranding: this.nylasBranding,
|
|
86
|
-
...this.defaultSchedulerState
|
|
87
|
-
})
|
|
88
|
-
}, this.baseProvider = new P(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.refConfigId = this.configurationId;
|
|
89
|
-
let e;
|
|
90
|
-
if (this.rescheduleBookingRef) {
|
|
91
|
-
const [d, s, l] = I(this.rescheduleBookingRef);
|
|
92
|
-
this.refConfigId = d, this.stores.scheduler.set("rescheduleBookingId", s), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s });
|
|
93
|
-
} else if (this.cancelBookingRef) {
|
|
94
|
-
const [d, s, l] = I(this.cancelBookingRef);
|
|
95
|
-
this.refConfigId = d, this.stores.scheduler.set("cancelBookingId", s), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s });
|
|
96
|
-
} else if (this.organizerConfirmationBookingRef) {
|
|
97
|
-
const [d, s, l] = I(this.organizerConfirmationBookingRef);
|
|
98
|
-
this.refConfigId = d, this.stores.scheduler.set("organizerConfirmationBookingId", s), this.stores.scheduler.set("organizerConfirmationSalt", l), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s, salt: l });
|
|
99
|
-
}
|
|
100
|
-
if ("bookingRefExtracted" in this.eventOverrides && (await this.eventOverrides.bookingRefExtracted(e, this.nylasSchedulerConnector), e.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
|
|
101
|
-
return;
|
|
102
|
-
const n = (o = this.baseProvider) == null ? void 0 : o.getStore("scheduler");
|
|
103
|
-
this.nylasSchedulerConnector = new H({
|
|
104
|
-
schedulerAPIURL: this.schedulerApiUrl,
|
|
105
|
-
sessionId: this.sessionId,
|
|
106
|
-
configId: this.refConfigId,
|
|
107
|
-
slug: this.slug,
|
|
108
|
-
clientId: this.clientId,
|
|
109
|
-
nylasSchedulerStore: n
|
|
110
|
-
});
|
|
111
|
-
const a = this.init.emit(this.host);
|
|
112
|
-
"init" in this.eventOverrides && (await this.eventOverrides.init(a, this.nylasSchedulerConnector), a.defaultPrevented) || ((r = this.baseProvider) == null || r.componentWillLoad(this.nylasSchedulerConnector), this.applyThemeConfig(this.themeConfig));
|
|
113
|
-
}
|
|
114
|
-
async componentDidLoad() {
|
|
115
|
-
var l, p, m, h, c, f, b, w;
|
|
116
|
-
(l = this.baseProvider) == null || l.componentDidLoad();
|
|
117
|
-
const t = this.schedulerDidLoad.emit(this.host);
|
|
118
|
-
if ("schedulerDidLoad" in this.eventOverrides && (await this.eventOverrides.schedulerDidLoad(t, this.nylasSchedulerConnector), t.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
|
|
119
|
-
return;
|
|
120
|
-
this.localizationChanged(this.localization);
|
|
121
|
-
const e = await ((p = this.nylasSchedulerConnector) == null ? void 0 : p.scheduler.getUISettings());
|
|
122
|
-
if (!e || "error" in e) {
|
|
123
|
-
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(e == null ? void 0 : e.error) }, host: this.host });
|
|
124
|
-
return;
|
|
125
|
-
} else {
|
|
126
|
-
"data" in e && ((m = e.data) != null && m.appearance) && console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");
|
|
127
|
-
const u = this.configSettingsLoaded.emit({ settings: e });
|
|
128
|
-
if ("configSettingsLoaded" in this.eventOverrides && (await this.eventOverrides.configSettingsLoaded(u, this.nylasSchedulerConnector), u.defaultPrevented))
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
const n = (h = this.baseProvider) == null ? void 0 : h.getStore("scheduler"), a = (f = (c = n == null ? void 0 : n.get("configSettings")) == null ? void 0 : c.scheduler) == null ? void 0 : f.available_days_in_future, o = n == null ? void 0 : n.get("selectedTimeslot");
|
|
132
|
-
if (o && (o != null && o.start_time)) {
|
|
133
|
-
if (!this.isTimeslotValid(o))
|
|
134
|
-
return;
|
|
135
|
-
if (n != null && n.get("showBookingForm")) {
|
|
136
|
-
n == null || n.set("selectedDate", o.start_time);
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
const r = n == null ? void 0 : n.get("selectedDate"), d = n == null ? void 0 : n.get("availability");
|
|
141
|
-
let s;
|
|
142
|
-
if (!(d && d.length > 0)) {
|
|
143
|
-
if (r) {
|
|
144
|
-
const { startTime: u, endTime: v, endTimeForAvailableDaysInFuture: C } = this.validateAvailableDaysInFuture(r, a || 30);
|
|
145
|
-
r.getTime() < C * 1e3 && (s = await ((w = this.nylasSchedulerConnector) == null ? void 0 : w.scheduler.getAvailability(u, v)));
|
|
146
|
-
} else {
|
|
147
|
-
const u = /* @__PURE__ */ new Date(), { startTime: v, endTime: C, endTimeForAvailableDaysInFuture: z } = this.validateAvailableDaysInFuture(u, a || 30);
|
|
148
|
-
u.getTime() < z * 1e3 && (s = await ((b = this.nylasSchedulerConnector) == null ? void 0 : b.scheduler.getAvailability(v, C)));
|
|
149
|
-
}
|
|
150
|
-
if ((!s || "error" in s) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(s == null ? void 0 : s.error) }, host: this.host }), !r) {
|
|
151
|
-
let u = /* @__PURE__ */ new Date();
|
|
152
|
-
const v = n == null ? void 0 : n.get("availability").find((C) => new Date(C.start_time) > /* @__PURE__ */ new Date());
|
|
153
|
-
v && (u = v.start_time), n == null || n.set("selectedDate", u);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
componentDisconnected() {
|
|
158
|
-
var t;
|
|
159
|
-
(t = this.baseProvider) == null || t.componentDisconnected();
|
|
160
|
-
}
|
|
161
|
-
bookingInfoChanged(t) {
|
|
162
|
-
var e;
|
|
163
|
-
(e = this.stores) == null || e.scheduler.set("bookingInfo", t);
|
|
164
|
-
}
|
|
165
|
-
rescheduleBookingRefChanged(t) {
|
|
166
|
-
var e, n;
|
|
167
|
-
if (t) {
|
|
168
|
-
const [a, o] = I(t);
|
|
169
|
-
(e = this.stores) == null || e.scheduler.set("rescheduleBookingId", o), this.refConfigId = a, (n = this.nylasSchedulerConnector) == null || n.scheduler.setConfigId(a);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
cancelBookingRefChanged(t) {
|
|
173
|
-
var e, n;
|
|
174
|
-
if (t) {
|
|
175
|
-
const [a, o] = I(t);
|
|
176
|
-
(e = this.stores) == null || e.scheduler.set("cancelBookingId", o), this.refConfigId = a, (n = this.nylasSchedulerConnector) == null || n.scheduler.setConfigId(a);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
organizerConfirmationBookingRefChanged(t) {
|
|
180
|
-
var e, n;
|
|
181
|
-
if (t) {
|
|
182
|
-
const [a, o] = I(t);
|
|
183
|
-
(e = this.stores) == null || e.scheduler.set("organizerConfirmationBookingId", o), this.refConfigId = a, (n = this.nylasSchedulerConnector) == null || n.scheduler.setConfigId(a);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
localizationChanged(t) {
|
|
187
|
-
t && Object.keys(t).forEach((e) => {
|
|
188
|
-
e in j && (g.addResourceBundle(e, "translation", t[e], !1, !0), this.language = this.language);
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
themeConfigChanged(t) {
|
|
192
|
-
this.applyThemeConfig(t);
|
|
193
|
-
}
|
|
194
|
-
languageChanged(t) {
|
|
195
|
-
const e = t.detail;
|
|
196
|
-
this.language = e, g.changeLanguage(e);
|
|
197
|
-
}
|
|
198
|
-
async registerComponentHandler(t) {
|
|
199
|
-
var e;
|
|
200
|
-
(e = this.baseProvider) == null || e.registerComponent(t.detail);
|
|
201
|
-
}
|
|
202
|
-
async unregisterComponentHandler(t) {
|
|
203
|
-
var e;
|
|
204
|
-
(e = this.baseProvider) == null || e.unregisterComponent(t.detail);
|
|
205
|
-
}
|
|
206
|
-
async monthChangedHandler(t) {
|
|
207
|
-
var d, s, l, p, m, h, c;
|
|
208
|
-
const e = t.detail, n = (p = (l = (s = (d = this.nylasSchedulerConnector) == null ? void 0 : d.schedulerStore) == null ? void 0 : s.get("configSettings")) == null ? void 0 : l.scheduler) == null ? void 0 : p.available_days_in_future, { startTime: a, endTime: o, endTimeForAvailableDaysInFuture: r } = this.validateAvailableDaysInFuture(e, n || 30);
|
|
209
|
-
if (a < r && e.getTime() < r * 1e3) {
|
|
210
|
-
const f = await ((m = this.nylasSchedulerConnector) == null ? void 0 : m.scheduler.getAvailability(a, o));
|
|
211
|
-
(!f || "error" in f) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(f == null ? void 0 : f.error) }, host: this.host });
|
|
212
|
-
const b = (h = this.stores) == null ? void 0 : h.scheduler.get("selectableDates");
|
|
213
|
-
b && b.length > 0 && ((c = this.stores) == null || c.scheduler.set("selectedDate", b[0]));
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
mapToBookingData(t) {
|
|
217
|
-
var d, s, l;
|
|
218
|
-
const e = (d = this.stores) == null ? void 0 : d.scheduler.get("selectedTimeslot"), n = (s = this.stores) == null ? void 0 : s.scheduler.get("selectedLanguage"), a = (l = this.stores) == null ? void 0 : l.scheduler.get("selectedTimezone"), o = e != null && e.start_time ? new Date(e == null ? void 0 : e.start_time).getTime() / 1e3 : "", r = e != null && e.end_time ? new Date(e == null ? void 0 : e.end_time).getTime() / 1e3 : "";
|
|
219
|
-
return {
|
|
220
|
-
additional_guests: t.guests,
|
|
221
|
-
guest: t.primaryParticipant,
|
|
222
|
-
additional_fields: t.additionalFields,
|
|
223
|
-
start_time: o,
|
|
224
|
-
end_time: r,
|
|
225
|
-
email_language: n,
|
|
226
|
-
timezone: a
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
async bookButtonClickedHandler(t) {
|
|
230
|
-
var l, p, m, h;
|
|
231
|
-
const e = t.detail, n = this.mapToBookingData(e), o = (p = (l = this.nylasSchedulerConnector) == null ? void 0 : l.schedulerStore) == null ? void 0 : p.get("rescheduleBookingId");
|
|
232
|
-
if (o) {
|
|
233
|
-
const c = await ((m = this.nylasSchedulerConnector) == null ? void 0 : m.scheduler.rescheduleBooking(o, e));
|
|
234
|
-
(!c || "error" in c) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(c == null ? void 0 : c.error) }, host: this.host });
|
|
235
|
-
const f = c == null ? void 0 : c.data, b = this.bookedEventInfo.emit({ ...c, data: { ...f, ...n } });
|
|
236
|
-
"bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(b, this.nylasSchedulerConnector);
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
const r = await ((h = this.nylasSchedulerConnector) == null ? void 0 : h.scheduler.bookTimeslot(e));
|
|
240
|
-
(!r || "error" in r) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(r == null ? void 0 : r.error) }, host: this.host });
|
|
241
|
-
const d = r == null ? void 0 : r.data, s = this.bookedEventInfo.emit({ ...r, data: { ...d, ...n } });
|
|
242
|
-
"bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(s, this.nylasSchedulerConnector);
|
|
243
|
-
}
|
|
244
|
-
dateSelectedHandler(t) {
|
|
245
|
-
const e = t.detail;
|
|
246
|
-
this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${g.t("noDateSelected")}`;
|
|
247
|
-
}
|
|
248
|
-
cancelBookedEventErrorHandler(t) {
|
|
249
|
-
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t.detail.error) }, host: this.host });
|
|
250
|
-
}
|
|
251
|
-
cancelBookedEventValidationErrorHandler(t) {
|
|
252
|
-
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t.detail.error) }, host: this.host });
|
|
253
|
-
}
|
|
254
|
-
rescheduleBookedEventErrorHandler(t) {
|
|
255
|
-
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t.detail.error) }, host: this.host });
|
|
256
|
-
}
|
|
257
|
-
confirmBookingErrorHandler(t) {
|
|
258
|
-
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t.detail.error) }, host: this.host });
|
|
259
|
-
}
|
|
260
|
-
async getNylasSchedulerStore() {
|
|
261
|
-
var t;
|
|
262
|
-
return (t = this.baseProvider) == null ? void 0 : t.getStore("scheduler");
|
|
263
|
-
}
|
|
264
|
-
async getNylasSchedulerConnector() {
|
|
265
|
-
return this.nylasSchedulerConnector;
|
|
266
|
-
}
|
|
267
|
-
async getRef() {
|
|
268
|
-
return this.host;
|
|
269
|
-
}
|
|
270
|
-
getErrorObject(t) {
|
|
271
|
-
return {
|
|
272
|
-
title: (t == null ? void 0 : t.title) || T.title,
|
|
273
|
-
category: (t == null ? void 0 : t.category) || T.category,
|
|
274
|
-
type: x.Error,
|
|
275
|
-
description: (t == null ? void 0 : t.message) || "",
|
|
276
|
-
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
277
|
-
ttl: "none"
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
checkIfSessionIdOrConfigIdExists() {
|
|
281
|
-
if (!this.sessionId && !this.refConfigId && !(this.slug && this.clientId)) {
|
|
282
|
-
let t = "";
|
|
283
|
-
return this.sessionId || (t += g.t("sessionIdRequiredErrorMessage")), !this.sessionId && !this.refConfigId && !(this.slug && this.clientId) && (t = g.t("sessionIdRequiredErrorMessage") + " " + g.t("publicConfigErrorMessage")), this.nylasSchedulerError.emit({
|
|
284
|
-
notification: {
|
|
285
|
-
title: g.t("schedulingComponentErrorTitle"),
|
|
286
|
-
category: B.Component,
|
|
287
|
-
type: x.Error,
|
|
288
|
-
description: t,
|
|
289
|
-
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
290
|
-
ttl: "none"
|
|
291
|
-
},
|
|
292
|
-
host: this.host
|
|
293
|
-
}), !1;
|
|
294
|
-
}
|
|
295
|
-
return !0;
|
|
296
|
-
}
|
|
297
|
-
isTimeslotValid(t) {
|
|
298
|
-
return new Date(t.start_time) < /* @__PURE__ */ new Date() ? (this.nylasSchedulerError.emit({
|
|
299
|
-
notification: {
|
|
300
|
-
title: g.t("invalidTimeslotErrorTitle"),
|
|
301
|
-
category: B.Component,
|
|
302
|
-
type: x.Error,
|
|
303
|
-
description: g.t("invalidTimeslotErrorMessage"),
|
|
304
|
-
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
305
|
-
ttl: "none"
|
|
306
|
-
},
|
|
307
|
-
host: this.host
|
|
308
|
-
}), !1) : !0;
|
|
309
|
-
}
|
|
310
|
-
validateAvailableDaysInFuture(t, e) {
|
|
311
|
-
const n = /* @__PURE__ */ new Date(), a = new Date(t.getFullYear(), t.getMonth(), 1).getTime() / 1e3, o = new Date(t.getFullYear(), t.getMonth() + 1, 1).getTime() / 1e3, r = Math.floor(O(n, e).getTime() / 1e3), d = Math.min(r, o);
|
|
312
|
-
return { startTime: a < n.getTime() / 1e3 ? Math.floor(n.getTime() / 1e3) : a, endTime: d, endTimeForAvailableDaysInFuture: r };
|
|
313
|
-
}
|
|
314
|
-
applyThemeConfig(t) {
|
|
315
|
-
if (t)
|
|
316
|
-
for (const [e, n] of Object.entries(t))
|
|
317
|
-
this.host.style.setProperty(`${e}`, n);
|
|
318
|
-
}
|
|
319
|
-
render() {
|
|
320
|
-
var b, w, u;
|
|
321
|
-
const t = this.mode === "app", e = (b = this.baseProvider) == null ? void 0 : b.getStore("scheduler"), n = e == null ? void 0 : e.get("eventInfo"), a = e == null ? void 0 : e.get("showBookingForm"), o = e == null ? void 0 : e.get("cancelledEventInfo"), r = e == null ? void 0 : e.get("cancelBookingId"), d = e == null ? void 0 : e.get("selectedTimeslot"), s = e == null ? void 0 : e.get("rescheduleBookingId"), l = e == null ? void 0 : e.get("organizerConfirmationBookingId"), p = e == null ? void 0 : e.get("rejectBookingId"), m = e == null ? void 0 : e.get("confirmedEventInfo"), h = (e == null ? void 0 : e.get("nylasBranding")) || this.nylasBranding, c = e == null ? void 0 : e.get("selectedDate"), f = (u = (w = e == null ? void 0 : e.get("configSettings")) == null ? void 0 : w.scheduler) == null ? void 0 : u.confirmation_redirect_url;
|
|
322
|
-
if (this.selectedDateLabel = c && this.language ? N(c.toLocaleDateString(M[this.language], { dateStyle: "full" })) : `${g.t("noDateSelected")}`, t && (r || p) && !o)
|
|
323
|
-
return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, i("nylas-cancel-booking-form", { selectedTimeslot: d, cancelBookingId: r, rejectBookingId: p, exportparts: "ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card" }))));
|
|
324
|
-
if (t && l)
|
|
325
|
-
return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "manual-confirmation-page", part: "manual-confirmation-page" }, i("nylas-organizer-confirmation-card", { organizerConfirmationBookingId: l, exportparts: "nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline" }))));
|
|
326
|
-
if (t && o)
|
|
327
|
-
return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, i("nylas-cancelled-event-card", { cancelledEventInfo: o, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))));
|
|
328
|
-
if (t && m)
|
|
329
|
-
return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, i("nylas-confirmed-event-card", { confirmedEventInfo: m, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))));
|
|
330
|
-
if (t && n && f) {
|
|
331
|
-
window.location.assign(f);
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
if (t && n)
|
|
335
|
-
return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "booked-event-page", part: "booked-event-page" }, i("nylas-booked-event-card", { selectedTimeslot: d, eventInfo: n, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))));
|
|
336
|
-
if (t && (!n || s) && !a) {
|
|
337
|
-
const v = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
|
|
338
|
-
return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, s && i(L, null, `${g.t("rescheduleTitle")}`), i("div", { class: "select-date-page", part: "select-date-page" }, i("div", { class: "left-panel" }, i("nylas-date-picker", { exportparts: "ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), i("nylas-locale-switch", { exportparts: "nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label" })), i("div", { class: `right-panel ${s ? "reschedule" : ""}` }, i("h2", null, i("calendar-icon", null), i("span", { id: "selectedDate" }, this.selectedDateLabel)), i("nylas-timeslot-picker", { exportparts: "ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary" }, v && i("span", { slot: "timeslot-picker-cta-label" }, i("slot", { name: "timeslot-picker-cta-label" })))))));
|
|
339
|
-
}
|
|
340
|
-
return t && !n && a ? i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, s && i(L, null, `${g.t("rescheduleTitle")}`), i("div", { class: "additional-data-page", part: "additional-data-page" }, i("div", { class: "left-panel" }, i("div", { class: "wrapper" }, i("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone" }))), i("div", { class: `right-panel ${s ? "reschedule" : ""}` }, i("nylas-booking-form", { exportparts: "nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content" }))))) : i(y, null, i("slot", null));
|
|
341
|
-
}
|
|
342
|
-
get host() {
|
|
343
|
-
return A(this);
|
|
344
|
-
}
|
|
345
|
-
static get watchers() {
|
|
346
|
-
return {
|
|
347
|
-
bookingInfo: ["bookingInfoChanged"],
|
|
348
|
-
rescheduleBookingRef: ["rescheduleBookingRefChanged"],
|
|
349
|
-
cancelBookingRef: ["cancelBookingRefChanged"],
|
|
350
|
-
organizerConfirmationBookingRef: ["organizerConfirmationBookingRefChanged"],
|
|
351
|
-
localization: ["localizationChanged"],
|
|
352
|
-
themeConfig: ["themeConfigChanged"]
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
};
|
|
356
|
-
$.style = W;
|
|
357
|
-
export {
|
|
358
|
-
$ as nylas_scheduling
|
|
359
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-c4e817ef.cjs"),I=require("./index.es-79f5b771-08cc349d.cjs"),k=require("./scheduler-store-9ff4914b-63dc472a.cjs"),w=require("./constants-50c3e067-1fe54cf3.cjs");require("react");require("react-dom");class B{constructor({schedulerAPIURL:e,nylasSchedulerStore:i,sessionId:a,configId:o,slug:r,clientId:d}){if(!e)throw new Error("schedulerAPIURL is required");if(!i)throw new Error("nylasSchedulerStore is required");if(!a&&!o&&!(r||d))throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");e==="/"&&(e=new URL(window.location.href).origin),this.configId=o,this.sessionId=a,this.schedulerAPIURL=e,this.nylasSchedulerStore=i,this.slug=r,this.clientId=d}init(){t.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new k.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}const v=(n,e)=>{const i=n.isLoading,a=n.showNotification,o=n.nylasBranding;return t.h(t.Fragment,null,a&&t.h("nylas-notification",null),i&&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"}))),!i&&e,t.h("div",{class:"footer"},o&&t.h(t.Fragment,null,"Powered by ",t.h("nylas-logo",null))))},C=(n,e)=>t.h("div",{class:"message-banner"},e),T=':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 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px 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:0}.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,.manual-confirmation-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,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;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}.right-panel.reschedule{border-top-right-radius:0px}@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}',L=T,x={title:t.instance.t("genericErrorTitle"),type:I.nr.Error,category:k.ErrorCategory.Component},E=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.configSettingsLoaded=t.createEvent(this,"configSettingsLoaded",7),this.bookingRefExtracted=t.createEvent(this,"bookingRefExtracted",7),this.bookedEventInfo=t.createEvent(this,"bookedEventInfo",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.organizerConfirmationBookingRef=void 0,this.configurationId=void 0,this.slug=void 0,this.clientId=void 0,this.nylasBranding=!0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.localization=void 0,this.showNotification=!0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(void 0,{dateStyle:"full"})||`${t.instance.t("noDateSelected")}`,this.refConfigId=void 0,this.language=navigator.language}connectedCallback(){t.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var o,r;t.debug("[nylas-scheduler] Component will load");const n=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerWillLoad(n,this.nylasSchedulerConnector),n.defaultPrevented))return;this.stores={scheduler:k.CreateNylasSchedulerStore({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})},this.baseProvider=new I.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.refConfigId=this.configurationId;let e;if(this.rescheduleBookingRef){const[d,s,l]=t.compactStringToUUIDs(this.rescheduleBookingRef);this.refConfigId=d,this.stores.scheduler.set("rescheduleBookingId",s),e=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.cancelBookingRef){const[d,s,l]=t.compactStringToUUIDs(this.cancelBookingRef);this.refConfigId=d,this.stores.scheduler.set("cancelBookingId",s),e=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.organizerConfirmationBookingRef){const[d,s,l]=t.compactStringToUUIDs(this.organizerConfirmationBookingRef);this.refConfigId=d,this.stores.scheduler.set("organizerConfirmationBookingId",s),this.stores.scheduler.set("organizerConfirmationSalt",l),e=this.bookingRefExtracted.emit({configurationId:d,bookingId:s,salt:l})}if("bookingRefExtracted"in this.eventOverrides&&(await this.eventOverrides.bookingRefExtracted(e,this.nylasSchedulerConnector),e.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;const i=(o=this.baseProvider)==null?void 0:o.getStore("scheduler");this.nylasSchedulerConnector=new B({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:i});const a=this.init.emit(this.host);"init"in this.eventOverrides&&(await this.eventOverrides.init(a,this.nylasSchedulerConnector),a.defaultPrevented)||((r=this.baseProvider)==null||r.componentWillLoad(this.nylasSchedulerConnector),this.applyThemeConfig(this.themeConfig))}async componentDidLoad(){var l,u,p,h,c,g,m,y;(l=this.baseProvider)==null||l.componentDidLoad();const n=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerDidLoad(n,this.nylasSchedulerConnector),n.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;this.localizationChanged(this.localization);const e=await((u=this.nylasSchedulerConnector)==null?void 0:u.scheduler.getUISettings());if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e==null?void 0:e.error)},host:this.host});return}else{"data"in e&&((p=e.data)!=null&&p.appearance)&&console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");const f=this.configSettingsLoaded.emit({settings:e});if("configSettingsLoaded"in this.eventOverrides&&(await this.eventOverrides.configSettingsLoaded(f,this.nylasSchedulerConnector),f.defaultPrevented))return}const i=(h=this.baseProvider)==null?void 0:h.getStore("scheduler"),a=(g=(c=i==null?void 0:i.get("configSettings"))==null?void 0:c.scheduler)==null?void 0:g.available_days_in_future,o=i==null?void 0:i.get("selectedTimeslot");if(o&&(o!=null&&o.start_time)){if(!this.isTimeslotValid(o))return;if(i!=null&&i.get("showBookingForm")){i==null||i.set("selectedDate",o.start_time);return}}const r=i==null?void 0:i.get("selectedDate"),d=i==null?void 0:i.get("availability");let s;if(!(d&&d.length>0)){if(r){const{startTime:f,endTime:b,endTimeForAvailableDaysInFuture:_}=this.validateAvailableDaysInFuture(r,a||30);r.getTime()<_*1e3&&(s=await((y=this.nylasSchedulerConnector)==null?void 0:y.scheduler.getAvailability(f,b)))}else{const f=new Date,{startTime:b,endTime:_,endTimeForAvailableDaysInFuture:D}=this.validateAvailableDaysInFuture(f,a||30);f.getTime()<D*1e3&&(s=await((m=this.nylasSchedulerConnector)==null?void 0:m.scheduler.getAvailability(b,_)))}if((!s||"error"in s)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(s==null?void 0:s.error)},host:this.host}),!r){let f=new Date;const b=i==null?void 0:i.get("availability").find(_=>new Date(_.start_time)>new Date);b&&(f=b.start_time),i==null||i.set("selectedDate",f)}}}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,i;if(n){const[a,o]=t.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("rescheduleBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}cancelBookingRefChanged(n){var e,i;if(n){const[a,o]=t.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("cancelBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}organizerConfirmationBookingRefChanged(n){var e,i;if(n){const[a,o]=t.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("organizerConfirmationBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}localizationChanged(n){n&&Object.keys(n).forEach(e=>{e in w.LANGUAGE_CODE&&(t.instance.addResourceBundle(e,"translation",n[e],!1,!0),this.language=this.language)})}themeConfigChanged(n){this.applyThemeConfig(n)}languageChanged(n){const e=n.detail;this.language=e,t.instance.changeLanguage(e)}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 d,s,l,u,p,h,c;const e=n.detail,i=(u=(l=(s=(d=this.nylasSchedulerConnector)==null?void 0:d.schedulerStore)==null?void 0:s.get("configSettings"))==null?void 0:l.scheduler)==null?void 0:u.available_days_in_future,{startTime:a,endTime:o,endTimeForAvailableDaysInFuture:r}=this.validateAvailableDaysInFuture(e,i||30);if(a<r&&e.getTime()<r*1e3){const g=await((p=this.nylasSchedulerConnector)==null?void 0:p.scheduler.getAvailability(a,o));(!g||"error"in g)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(g==null?void 0:g.error)},host:this.host});const m=(h=this.stores)==null?void 0:h.scheduler.get("selectableDates");m&&m.length>0&&((c=this.stores)==null||c.scheduler.set("selectedDate",m[0]))}}mapToBookingData(n){var d,s,l;const e=(d=this.stores)==null?void 0:d.scheduler.get("selectedTimeslot"),i=(s=this.stores)==null?void 0:s.scheduler.get("selectedLanguage"),a=(l=this.stores)==null?void 0:l.scheduler.get("selectedTimezone"),o=e!=null&&e.start_time?new Date(e==null?void 0:e.start_time).getTime()/1e3:"",r=e!=null&&e.end_time?new Date(e==null?void 0:e.end_time).getTime()/1e3:"";return{additional_guests:n.guests,guest:n.primaryParticipant,additional_fields:n.additionalFields,start_time:o,end_time:r,email_language:i,timezone:a}}async bookButtonClickedHandler(n){var l,u,p,h;const e=n.detail,i=this.mapToBookingData(e),o=(u=(l=this.nylasSchedulerConnector)==null?void 0:l.schedulerStore)==null?void 0:u.get("rescheduleBookingId");if(o){const c=await((p=this.nylasSchedulerConnector)==null?void 0:p.scheduler.rescheduleBooking(o,e));(!c||"error"in c)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(c==null?void 0:c.error)},host:this.host});const g=c==null?void 0:c.data,m=this.bookedEventInfo.emit({...c,data:{...g,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(m,this.nylasSchedulerConnector);return}const r=await((h=this.nylasSchedulerConnector)==null?void 0:h.scheduler.bookTimeslot(e));(!r||"error"in r)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r==null?void 0:r.error)},host:this.host});const d=r==null?void 0:r.data,s=this.bookedEventInfo.emit({...r,data:{...d,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(s,this.nylasSchedulerConnector)}dateSelectedHandler(n){const e=n.detail;this.selectedDateLabel=e?e.toLocaleDateString(void 0,{dateStyle:"full"}):`${t.instance.t("noDateSelected")}`}cancelBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}confirmBookingErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}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:I.nr.Error,description:(n==null?void 0:n.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let n="";return this.sessionId||(n+=t.instance.t("sessionIdRequiredErrorMessage")),!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)&&(n=t.instance.t("sessionIdRequiredErrorMessage")+" "+t.instance.t("publicConfigErrorMessage")),this.nylasSchedulerError.emit({notification:{title:t.instance.t("schedulingComponentErrorTitle"),category:k.ErrorCategory.Component,type:I.nr.Error,description:n,id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1}return!0}isTimeslotValid(n){return new Date(n.start_time)<new Date?(this.nylasSchedulerError.emit({notification:{title:t.instance.t("invalidTimeslotErrorTitle"),category:k.ErrorCategory.Component,type:I.nr.Error,description:t.instance.t("invalidTimeslotErrorMessage"),id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1):!0}validateAvailableDaysInFuture(n,e){const i=new Date,a=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,o=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,r=Math.floor(t.addDaysToCurrentDate(i,e).getTime()/1e3),d=Math.min(r,o);return{startTime:a<i.getTime()/1e3?Math.floor(i.getTime()/1e3):a,endTime:d,endTimeForAvailableDaysInFuture:r}}applyThemeConfig(n){if(n)for(const[e,i]of Object.entries(n))this.host.style.setProperty(`${e}`,i)}render(){var m,y,f;const n=this.mode==="app",e=(m=this.baseProvider)==null?void 0:m.getStore("scheduler"),i=e==null?void 0:e.get("eventInfo"),a=e==null?void 0:e.get("showBookingForm"),o=e==null?void 0:e.get("cancelledEventInfo"),r=e==null?void 0:e.get("cancelBookingId"),d=e==null?void 0:e.get("selectedTimeslot"),s=e==null?void 0:e.get("rescheduleBookingId"),l=e==null?void 0:e.get("organizerConfirmationBookingId"),u=e==null?void 0:e.get("rejectBookingId"),p=e==null?void 0:e.get("confirmedEventInfo"),h=(e==null?void 0:e.get("nylasBranding"))||this.nylasBranding,c=e==null?void 0:e.get("selectedDate"),g=(f=(y=e==null?void 0:e.get("configSettings"))==null?void 0:y.scheduler)==null?void 0:f.confirmation_redirect_url;if(this.selectedDateLabel=c&&this.language?t.capitalizeFirstLetter(c.toLocaleDateString(w.LANGUAGE_CODE_MAP[this.language],{dateStyle:"full"})):`${t.instance.t("noDateSelected")}`,n&&(r||u)&&!o)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},t.h("nylas-cancel-booking-form",{selectedTimeslot:d,cancelBookingId:r,rejectBookingId:u,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))));if(n&&l)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},t.h("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:l,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))));if(n&&o)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},t.h("nylas-cancelled-event-card",{cancelledEventInfo:o,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))));if(n&&p)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancelled-event-page",part:"confirmed-event-page"},t.h("nylas-confirmed-event-card",{confirmedEventInfo:p,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))));if(n&&i&&g){window.location.assign(g);return}if(n&&i)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"booked-event-page",part:"booked-event-page"},t.h("nylas-booked-event-card",{selectedTimeslot:d,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))));if(n&&(!i||s)&&!a){const b=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},s&&t.h(C,null,`${t.instance.t("rescheduleTitle")}`),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__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),t.h("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),t.h("div",{class:`right-panel ${s?"reschedule":""}`},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"},b&&t.h("span",{slot:"timeslot-picker-cta-label"},t.h("slot",{name:"timeslot-picker-cta-label"})))))))}return n&&!i&&a?t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},s&&t.h(C,null,`${t.instance.t("rescheduleTitle")}`),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, nsec__timezone"}))),t.h("div",{class:`right-panel ${s?"reschedule":""}`},t.h("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"}))))):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"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],themeConfig:["themeConfigChanged"]}}};E.style=L;exports.nylas_scheduling=E;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { r as f, c as p, d as i, h as o, H as u } from "./index-1322d804.js";
|
|
2
|
-
import { R as m } from "./register-component-ea95564d-843da1da.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import "react-dom";
|
|
5
|
-
const g = ":host{display:contents}.container{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.pull-to-refresh{display:none;border:0;background-color:transparent;text-align:center;width:100%;justify-content:center}.pulling{position:relative;display:flex;margin:0 auto;padding:1rem}.pulling svg{width:24px;height:24px;color:var(--nylas-color-primary-500);transform:rotate(90deg)}.refreshing{position:relative;display:flex;margin:0 auto;padding:1rem}.refreshing svg{width:24px;height:24px;fill:var(--nylas-color-primary-500);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}", y = g;
|
|
6
|
-
var v = function(t, e, s, r) {
|
|
7
|
-
var a = arguments.length, n = a < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, s) : r, h;
|
|
8
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
9
|
-
n = Reflect.decorate(t, e, s, r);
|
|
10
|
-
else
|
|
11
|
-
for (var l = t.length - 1; l >= 0; l--)
|
|
12
|
-
(h = t[l]) && (n = (a < 3 ? h(n) : a > 3 ? h(e, s, n) : h(e, s)) || n);
|
|
13
|
-
return a > 3 && n && Object.defineProperty(e, s, n), n;
|
|
14
|
-
}, c = function(t, e) {
|
|
15
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
16
|
-
return Reflect.metadata(t, e);
|
|
17
|
-
};
|
|
18
|
-
const d = class {
|
|
19
|
-
constructor(t) {
|
|
20
|
-
f(this, t), this.refresh = p(this, "refresh", 7), this.threshold = 100, this.onTouchStart = (e) => {
|
|
21
|
-
var s, r, a, n;
|
|
22
|
-
i("[nylas-threads-refresh] Touch start", e.touches[0].pageY, (s = this.containerElement) == null ? void 0 : s.scrollTop, (r = this.containerElement) == null ? void 0 : r.offsetHeight, (a = this.contentElement) == null ? void 0 : a.scrollTop), ((n = this.containerElement) == null ? void 0 : n.scrollTop) === 0 ? this.start = e.touches[0].pageY : this.start = 0;
|
|
23
|
-
}, this.onTouchMove = (e) => {
|
|
24
|
-
this.start && (e.touches[0].pageY - this.start > this.threshold ? this.pulling = !0 : this.pulling = !1);
|
|
25
|
-
}, this.onTouchEnd = (e) => {
|
|
26
|
-
this.start && (e.changedTouches[0].pageY - this.start > this.threshold && (this.pulling = !1, this.refresh.emit({
|
|
27
|
-
updateState: this.updateState
|
|
28
|
-
})), this.start = 0);
|
|
29
|
-
}, this.start = 0, this.state = "ready", this.pulling = !1, i("[nylas-threads-refresh] Constructor"), this.updateState = this.updateState.bind(this);
|
|
30
|
-
}
|
|
31
|
-
connectedCallback() {
|
|
32
|
-
}
|
|
33
|
-
async componentWillLoad() {
|
|
34
|
-
i("[nylas-threads-refresh] Component will load");
|
|
35
|
-
}
|
|
36
|
-
componentDidLoad() {
|
|
37
|
-
var t, e, s;
|
|
38
|
-
i("[nylas-threads-refresh] Component did load"), (t = this.containerElement) == null || t.addEventListener("touchstart", this.onTouchStart), (e = this.containerElement) == null || e.addEventListener("touchmove", this.onTouchMove), (s = this.containerElement) == null || s.addEventListener("touchend", this.onTouchEnd);
|
|
39
|
-
}
|
|
40
|
-
disconnectedCallback() {
|
|
41
|
-
var t, e, s;
|
|
42
|
-
i("[nylas-threads-refresh] Component disconnected"), (t = this.containerElement) == null || t.removeEventListener("touchstart", this.onTouchStart), (e = this.containerElement) == null || e.removeEventListener("touchmove", this.onTouchMove), (s = this.containerElement) == null || s.removeEventListener("touchend", this.onTouchEnd);
|
|
43
|
-
}
|
|
44
|
-
async updateState(t) {
|
|
45
|
-
this.state = t;
|
|
46
|
-
}
|
|
47
|
-
render() {
|
|
48
|
-
return o(u, { key: "0e7150c1fd50e5422e124ac007132ae2ecc0006b" }, o("div", { key: "730765ce38847fdbe691f2b9cfeda44e1a46259b", class: "container", ref: (t) => this.containerElement = t }, o("button", { key: "55427e329f0405960f22f736f10722e620931516", class: {
|
|
49
|
-
"pull-to-refresh": !0,
|
|
50
|
-
pulling: this.pulling,
|
|
51
|
-
refreshing: this.state === "loading"
|
|
52
|
-
}, "aria-label": "Refreshing..." }, this.state === "loading" && o("refresh-icon", { slot: "icon" }), this.state !== "loading" && o("arrow-icon", { slot: "icon" })), o("div", { key: "585886ff635733f5e0398ca9cfe11944860f5a61", class: "content", ref: (t) => this.contentElement = t }, o("slot", { key: "f61cab9fae1aae81ecb0e7a6544ddb4b845c91b4" }))));
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
v([
|
|
56
|
-
m({
|
|
57
|
-
name: "nylas-threads-refresh",
|
|
58
|
-
eventToProps: {
|
|
59
|
-
refresh: async (t, e) => {
|
|
60
|
-
i("[nylas-threads-refresh] Refreshing threads");
|
|
61
|
-
const { updateState: s } = t.detail;
|
|
62
|
-
await s("loading"), await e.threads.getThreads(void 0, "overwrite", !1), await s("ready");
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
fireRegisterEvent: !0
|
|
66
|
-
}),
|
|
67
|
-
c("design:type", Function),
|
|
68
|
-
c("design:paramtypes", []),
|
|
69
|
-
c("design:returntype", void 0)
|
|
70
|
-
], d.prototype, "render", null);
|
|
71
|
-
d.style = y;
|
|
72
|
-
export {
|
|
73
|
-
d as nylas_threads_refresh
|
|
74
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-c4e817ef.cjs"),d=require("./register-component-ea95564d-a64ee107.cjs");require("react");require("react-dom");const f=":host{display:contents}.container{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.pull-to-refresh{display:none;border:0;background-color:transparent;text-align:center;width:100%;justify-content:center}.pulling{position:relative;display:flex;margin:0 auto;padding:1rem}.pulling svg{width:24px;height:24px;color:var(--nylas-color-primary-500);transform:rotate(90deg)}.refreshing{position:relative;display:flex;margin:0 auto;padding:1rem}.refreshing svg{width:24px;height:24px;fill:var(--nylas-color-primary-500);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}",u=f;var p=function(t,e,n,a){var i=arguments.length,r=i<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,n):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,e,n,a);else for(var h=t.length-1;h>=0;h--)(o=t[h])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);return i>3&&r&&Object.defineProperty(e,n,r),r},l=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)};const c=class{constructor(t){s.registerInstance(this,t),this.refresh=s.createEvent(this,"refresh",7),this.threshold=100,this.onTouchStart=e=>{var n,a,i,r;s.debug("[nylas-threads-refresh] Touch start",e.touches[0].pageY,(n=this.containerElement)==null?void 0:n.scrollTop,(a=this.containerElement)==null?void 0:a.offsetHeight,(i=this.contentElement)==null?void 0:i.scrollTop),((r=this.containerElement)==null?void 0:r.scrollTop)===0?this.start=e.touches[0].pageY:this.start=0},this.onTouchMove=e=>{this.start&&(e.touches[0].pageY-this.start>this.threshold?this.pulling=!0:this.pulling=!1)},this.onTouchEnd=e=>{this.start&&(e.changedTouches[0].pageY-this.start>this.threshold&&(this.pulling=!1,this.refresh.emit({updateState:this.updateState})),this.start=0)},this.start=0,this.state="ready",this.pulling=!1,s.debug("[nylas-threads-refresh] Constructor"),this.updateState=this.updateState.bind(this)}connectedCallback(){}async componentWillLoad(){s.debug("[nylas-threads-refresh] Component will load")}componentDidLoad(){var t,e,n;s.debug("[nylas-threads-refresh] Component did load"),(t=this.containerElement)==null||t.addEventListener("touchstart",this.onTouchStart),(e=this.containerElement)==null||e.addEventListener("touchmove",this.onTouchMove),(n=this.containerElement)==null||n.addEventListener("touchend",this.onTouchEnd)}disconnectedCallback(){var t,e,n;s.debug("[nylas-threads-refresh] Component disconnected"),(t=this.containerElement)==null||t.removeEventListener("touchstart",this.onTouchStart),(e=this.containerElement)==null||e.removeEventListener("touchmove",this.onTouchMove),(n=this.containerElement)==null||n.removeEventListener("touchend",this.onTouchEnd)}async updateState(t){this.state=t}render(){return s.h(s.Host,{key:"0e7150c1fd50e5422e124ac007132ae2ecc0006b"},s.h("div",{key:"730765ce38847fdbe691f2b9cfeda44e1a46259b",class:"container",ref:t=>this.containerElement=t},s.h("button",{key:"55427e329f0405960f22f736f10722e620931516",class:{"pull-to-refresh":!0,pulling:this.pulling,refreshing:this.state==="loading"},"aria-label":"Refreshing..."},this.state==="loading"&&s.h("refresh-icon",{slot:"icon"}),this.state!=="loading"&&s.h("arrow-icon",{slot:"icon"})),s.h("div",{key:"585886ff635733f5e0398ca9cfe11944860f5a61",class:"content",ref:t=>this.contentElement=t},s.h("slot",{key:"f61cab9fae1aae81ecb0e7a6544ddb4b845c91b4"}))))}};p([d.RegisterComponent({name:"nylas-threads-refresh",eventToProps:{refresh:async(t,e)=>{s.debug("[nylas-threads-refresh] Refreshing threads");const{updateState:n}=t.detail;await n("loading"),await e.threads.getThreads(void 0,"overwrite",!1),await n("ready")}},fireRegisterEvent:!0}),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],c.prototype,"render",null);c.style=u;exports.nylas_threads_refresh=c;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { r as u, c as y, d as l, h as i, H as f } from "./index-1322d804.js";
|
|
2
|
-
import { R as p } from "./register-component-ea95564d-843da1da.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import "react-dom";
|
|
5
|
-
const m = ":host{display:block}sp-search{width:100%;border:0}", b = m;
|
|
6
|
-
var g = function(t, e, n, r) {
|
|
7
|
-
var s = arguments.length, a = s < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, n) : r, o;
|
|
8
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
9
|
-
a = Reflect.decorate(t, e, n, r);
|
|
10
|
-
else
|
|
11
|
-
for (var c = t.length - 1; c >= 0; c--)
|
|
12
|
-
(o = t[c]) && (a = (s < 3 ? o(a) : s > 3 ? o(e, n, a) : o(e, n)) || a);
|
|
13
|
-
return s > 3 && a && Object.defineProperty(e, n, a), a;
|
|
14
|
-
}, d = function(t, e) {
|
|
15
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
16
|
-
return Reflect.metadata(t, e);
|
|
17
|
-
};
|
|
18
|
-
const h = class {
|
|
19
|
-
constructor(t) {
|
|
20
|
-
u(this, t), this.search = y(this, "search", 7), this.onSearch = async (e) => {
|
|
21
|
-
e.preventDefault(), e.stopPropagation();
|
|
22
|
-
const r = e.target.value;
|
|
23
|
-
r !== this.internalQuery && (this.internalQuery = r, this.search.emit(this.internalQuery));
|
|
24
|
-
}, this.query = "", this.internalQuery = "";
|
|
25
|
-
}
|
|
26
|
-
connectedCallback() {
|
|
27
|
-
}
|
|
28
|
-
disconnectedCallback() {
|
|
29
|
-
}
|
|
30
|
-
async componentWillLoad() {
|
|
31
|
-
l("[nylas-threads-search] Component will load");
|
|
32
|
-
}
|
|
33
|
-
async componentDidLoad() {
|
|
34
|
-
l("[nylas-threads-search] Component did load");
|
|
35
|
-
}
|
|
36
|
-
onQueryChange() {
|
|
37
|
-
this.internalQuery = this.query;
|
|
38
|
-
}
|
|
39
|
-
render() {
|
|
40
|
-
return i(f, { key: "6d49d740fb64cff220ddf6b74ca0393a3b6fd83a" }, i("sp-theme", { key: "fda27523444c0c7350cdfdf6d1a29dd1d63158f5", scale: "medium", color: "dark" }, i("sp-search", { key: "bb840884220a5008c144f90775ea10291c507b51", quiet: !0, onSubmit: this.onSearch, onBlur: this.onSearch, value: this.internalQuery })));
|
|
41
|
-
}
|
|
42
|
-
static get watchers() {
|
|
43
|
-
return {
|
|
44
|
-
query: ["onQueryChange"]
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
g([
|
|
49
|
-
p({
|
|
50
|
-
name: "nylas-pagination",
|
|
51
|
-
stateToProps: /* @__PURE__ */ new Map([["mailbox.searchQuery", "query"]]),
|
|
52
|
-
eventToProps: {
|
|
53
|
-
search: async (t, e) => {
|
|
54
|
-
await e.threads.getThreads({
|
|
55
|
-
search_query_native: t.detail || void 0,
|
|
56
|
-
page_token: void 0
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
fireRegisterEvent: !0
|
|
61
|
-
}),
|
|
62
|
-
d("design:type", Function),
|
|
63
|
-
d("design:paramtypes", []),
|
|
64
|
-
d("design:returntype", void 0)
|
|
65
|
-
], h.prototype, "render", null);
|
|
66
|
-
h.style = b;
|
|
67
|
-
export {
|
|
68
|
-
h as nylas_threads_search
|
|
69
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-c4e817ef.cjs"),h=require("./register-component-ea95564d-a64ee107.cjs");require("react");require("react-dom");const u=":host{display:block}sp-search{width:100%;border:0}",y=u;var f=function(t,e,s,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,s):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,e,s,n);else for(var i=t.length-1;i>=0;i--)(c=t[i])&&(r=(o<3?c(r):o>3?c(e,s,r):c(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r},d=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)};const l=class{constructor(t){a.registerInstance(this,t),this.search=a.createEvent(this,"search",7),this.onSearch=async e=>{e.preventDefault(),e.stopPropagation();const n=e.target.value;n!==this.internalQuery&&(this.internalQuery=n,this.search.emit(this.internalQuery))},this.query="",this.internalQuery=""}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){a.debug("[nylas-threads-search] Component will load")}async componentDidLoad(){a.debug("[nylas-threads-search] Component did load")}onQueryChange(){this.internalQuery=this.query}render(){return a.h(a.Host,{key:"6d49d740fb64cff220ddf6b74ca0393a3b6fd83a"},a.h("sp-theme",{key:"fda27523444c0c7350cdfdf6d1a29dd1d63158f5",scale:"medium",color:"dark"},a.h("sp-search",{key:"bb840884220a5008c144f90775ea10291c507b51",quiet:!0,onSubmit:this.onSearch,onBlur:this.onSearch,value:this.internalQuery})))}static get watchers(){return{query:["onQueryChange"]}}};f([h.RegisterComponent({name:"nylas-pagination",stateToProps:new Map([["mailbox.searchQuery","query"]]),eventToProps:{search:async(t,e)=>{await e.threads.getThreads({search_query_native:t.detail||void 0,page_token:void 0})}},fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],l.prototype,"render",null);l.style=y;exports.nylas_threads_search=l;
|