@nylas/react 1.1.1 → 1.1.2
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-b14ecb5c.js → add-circle-icon_2.entry-611be49d.js} +1 -1
- package/dist/{add-circle-icon_2.entry-c6211866.cjs → add-circle-icon_2.entry-f1383568.cjs} +1 -1
- package/dist/{archive-icon_7.entry-54fc1f03.cjs → archive-icon_7.entry-59cc6868.cjs} +1 -1
- package/dist/{archive-icon_7.entry-3fe7721a.js → archive-icon_7.entry-5e6ba9e7.js} +1 -1
- package/dist/{arrow-icon.entry-cc936041.js → arrow-icon.entry-9c19a803.js} +1 -1
- package/dist/{arrow-icon.entry-1dfee3bc.cjs → arrow-icon.entry-a924df13.cjs} +1 -1
- package/dist/{bold-icon_3.entry-e2a1d434.js → bold-icon_3.entry-2935a3df.js} +1 -1
- package/dist/{bold-icon_3.entry-4b9de887.cjs → bold-icon_3.entry-ffe02f93.cjs} +1 -1
- package/dist/{button-component_2.entry-3639ade6.js → button-component_2.entry-93aa59a2.js} +1 -1
- package/dist/{button-component_2.entry-5666fdfa.cjs → button-component_2.entry-b9d3f6a2.cjs} +1 -1
- package/dist/{calendar-agenda-fill-icon_48.entry-56e364cd.js → calendar-agenda-fill-icon_48.entry-476bc4ef.js} +8 -8
- package/dist/{calendar-agenda-fill-icon_48.entry-bf278e34.cjs → calendar-agenda-fill-icon_48.entry-c4ea84b3.cjs} +2 -2
- package/dist/{calendar-cancel-icon.entry-ac1cb5dd.cjs → calendar-cancel-icon.entry-11bb8656.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-dcd777cd.js → calendar-cancel-icon.entry-ee0acc54.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-7ad1b2a0.cjs → calendar-check-icon_2.entry-14548656.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-6330bd2d.js → calendar-check-icon_2.entry-54a82e1e.js} +1 -1
- package/dist/{calendar-icon.entry-5849a547.cjs → calendar-icon.entry-1a17f887.cjs} +1 -1
- package/dist/{calendar-icon.entry-8559fa0d.js → calendar-icon.entry-29f7003b.js} +1 -1
- package/dist/{checkbox-component_2.entry-6cf5da6b.cjs → checkbox-component_2.entry-84a17232.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-1474c465.js → checkbox-component_2.entry-dfec10cb.js} +1 -1
- package/dist/chevron-icon_3.entry-5da08d02.cjs +1 -0
- package/dist/{chevron-icon_3.entry-cb757aa3.js → chevron-icon_3.entry-826e81d4.js} +20 -9
- package/dist/{clock-icon_4.entry-642f4dc6.js → clock-icon_4.entry-36d97f00.js} +1 -1
- package/dist/{clock-icon_4.entry-36a33de5.cjs → clock-icon_4.entry-dafdd895.cjs} +1 -1
- package/dist/{constants-50c3e067-4e027da4.cjs → constants-50c3e067-1fe54cf3.cjs} +1 -1
- package/dist/{constants-50c3e067-83f1d865.js → constants-50c3e067-fed7fb48.js} +1 -1
- package/dist/{copy-icon.entry-60740516.js → copy-icon.entry-6d1a649d.js} +1 -1
- package/dist/{copy-icon.entry-fb63cf53.cjs → copy-icon.entry-eec265da.cjs} +1 -1
- package/dist/{delete-icon_2.entry-d1af0606.cjs → delete-icon_2.entry-160ba41e.cjs} +1 -1
- package/dist/{delete-icon_2.entry-45851bc5.js → delete-icon_2.entry-528a3879.js} +1 -1
- package/dist/{document-refresh-icon.entry-1731d4d9.cjs → document-refresh-icon.entry-276704dc.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-5db0830a.js → document-refresh-icon.entry-6565f3b5.js} +1 -1
- package/dist/{elements-dc5b338e-3099ee02.js → elements-dc5b338e-2d3857dc.js} +1 -1
- package/dist/{elements-dc5b338e-ab9afb63.cjs → elements-dc5b338e-b06b2857.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-811f50fa.cjs → focus-visible-e8093c16-47e61336.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-067a8f23.js → focus-visible-e8093c16-6f68eb89.js} +1 -1
- package/dist/{forward-icon_6.entry-e7c5fa46.js → forward-icon_6.entry-ed6ab66a.js} +2 -2
- package/dist/{forward-icon_6.entry-4e9c9686.cjs → forward-icon_6.entry-fed8994d.cjs} +1 -1
- package/dist/{globe-icon.entry-aa3f3ea3.js → globe-icon.entry-154ccdb5.js} +1 -1
- package/dist/{globe-icon.entry-74f79652.cjs → globe-icon.entry-95fc0408.cjs} +1 -1
- package/dist/{google-logo-icon_4.entry-3fe41d69.js → google-logo-icon_4.entry-68cfa3fe.js} +3 -3
- package/dist/{google-logo-icon_4.entry-0332a181.cjs → google-logo-icon_4.entry-afffb209.cjs} +1 -1
- package/dist/{index-a134f625.js → index-1322d804.js} +50 -50
- package/dist/{index-2a53b6a8.cjs → index-c4e817ef.cjs} +2 -2
- package/dist/{index.es-79f5b771-ce07d6fc.js → index.es-79f5b771-04cd3414.js} +1 -1
- package/dist/{index.es-79f5b771-64a1baf0.cjs → index.es-79f5b771-08cc349d.cjs} +1 -1
- package/dist/{info-icon_2.entry-a3f40027.cjs → info-icon_2.entry-2af880b8.cjs} +1 -1
- package/dist/{info-icon_2.entry-fed731f4.js → info-icon_2.entry-49261a0a.js} +1 -1
- package/dist/{input-color-picker.entry-cbdce7a1.cjs → input-color-picker.entry-57adff77.cjs} +1 -1
- package/dist/{input-color-picker.entry-37826630.js → input-color-picker.entry-aefe0e26.js} +1 -1
- package/dist/{input-component.entry-e71b7062.cjs → input-component.entry-09c3c9b6.cjs} +1 -1
- package/dist/{input-component.entry-b83b7103.js → input-component.entry-d7c2724b.js} +1 -1
- package/dist/{input-dropdown.entry-db0dae5f.js → input-dropdown.entry-e573ade0.js} +1 -1
- package/dist/{input-dropdown.entry-150819cd.cjs → input-dropdown.entry-e7d26273.cjs} +1 -1
- package/dist/{mailbox-store-9c52a3fa-80fe343c.js → mailbox-store-9c52a3fa-27f8f7e6.js} +2 -2
- package/dist/{mailbox-store-9c52a3fa-04f22f60.cjs → mailbox-store-9c52a3fa-6b39645f.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-6b429b39.js → multi-select-dropdown.entry-15cacb87.js} +1 -1
- package/dist/{multi-select-dropdown.entry-629329d7.cjs → multi-select-dropdown.entry-46b2b1c9.cjs} +1 -1
- package/dist/{nylas-booked-event-card_12.entry-c22c02b4.js → nylas-booked-event-card_12.entry-3921071a.js} +195 -192
- package/dist/nylas-booked-event-card_12.entry-47c5381d.cjs +1 -0
- package/dist/{nylas-form-card.entry-f3d6a1e4.js → nylas-form-card.entry-ca835017.js} +2 -2
- package/dist/{nylas-form-card.entry-2ced5eef.cjs → nylas-form-card.entry-db3f0e3b.cjs} +1 -1
- package/dist/{nylas-if-state.entry-862ad978.js → nylas-if-state.entry-4159d41d.js} +2 -2
- package/dist/{nylas-if-state.entry-55c32c0c.cjs → nylas-if-state.entry-5410607c.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-77e936f7.cjs → nylas-list-folders.entry-0f143930.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-544fd38d.js → nylas-list-folders.entry-6b4a3d96.js} +2 -2
- package/dist/{nylas-list-threads.entry-71411da7.js → nylas-list-threads.entry-62108562.js} +2 -2
- package/dist/{nylas-list-threads.entry-82e04782.cjs → nylas-list-threads.entry-68b6f32b.cjs} +1 -1
- package/dist/{nylas-login.entry-48179c01.js → nylas-login.entry-590e7fba.js} +2 -2
- package/dist/{nylas-login.entry-3ccc2bef.cjs → nylas-login.entry-f1d7bc7d.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-d31f9aa4.cjs → nylas-mailbox-pagination.entry-8377fdee.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-77cf03b5.js → nylas-mailbox-pagination.entry-ba1af8fb.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-40e3c373.js → nylas-mailbox-toolbar-button.entry-4497acd0.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-33aad610.cjs → nylas-mailbox-toolbar-button.entry-6a5d8387.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-f4066fb2.js → nylas-mailbox.entry-917c22f5.js} +3 -3
- package/dist/{nylas-mailbox.entry-963de1c3.cjs → nylas-mailbox.entry-a07652b4.cjs} +1 -1
- package/dist/{nylas-provider.entry-08767da3.cjs → nylas-provider.entry-0e520ac3.cjs} +1 -1
- package/dist/{nylas-provider.entry-c61428b1.js → nylas-provider.entry-20c47b14.js} +5 -5
- package/dist/{nylas-reminder-emails.entry-cd8e1d2e.js → nylas-reminder-emails.entry-088ee120.js} +2 -2
- package/dist/{nylas-reminder-emails.entry-d42a7f1d.cjs → nylas-reminder-emails.entry-69626e7f.cjs} +1 -1
- package/dist/{nylas-reminder-time_2.entry-d7115393.js → nylas-reminder-time_2.entry-0357f280.js} +3 -3
- package/dist/{nylas-reminder-time_2.entry-e5540fdd.cjs → nylas-reminder-time_2.entry-b5c181db.cjs} +1 -1
- package/dist/{nylas-scheduler-editor.entry-65eb4938.js → nylas-scheduler-editor.entry-6bb290ed.js} +6 -6
- package/dist/{nylas-scheduler-editor.entry-67904653.cjs → nylas-scheduler-editor.entry-d2c3bddc.cjs} +2 -2
- package/dist/{nylas-scheduling.entry-7aad4f63.js → nylas-scheduling.entry-bc9c25c5.js} +126 -112
- package/dist/nylas-scheduling.entry-dc92d5e7.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-d025575a.js → nylas-threads-refresh.entry-45d7d171.js} +2 -2
- package/dist/{nylas-threads-refresh.entry-1b8befab.cjs → nylas-threads-refresh.entry-6636e7b1.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-a254c36e.js → nylas-threads-search.entry-4460aa9b.js} +2 -2
- package/dist/{nylas-threads-search.entry-78c06183.cjs → nylas-threads-search.entry-ae87695a.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-30baeb50.cjs → nylas-time-window-picker.entry-1b449403.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-89c15823.js → nylas-time-window-picker.entry-260f52a6.js} +1 -1
- package/dist/{nylas-view-thread.entry-c8d56573.js → nylas-view-thread.entry-5821630b.js} +2 -2
- package/dist/{nylas-view-thread.entry-939a4561.cjs → nylas-view-thread.entry-5a9b353a.cjs} +1 -1
- package/dist/{person-icon.entry-5ab75598.cjs → person-icon.entry-b4ce06b7.cjs} +1 -1
- package/dist/{person-icon.entry-8aef4041.js → person-icon.entry-ed6786db.js} +1 -1
- package/dist/{play-icon_2.entry-4b068c1b.js → play-icon_2.entry-261ea828.js} +1 -1
- package/dist/{play-icon_2.entry-392ad303.cjs → play-icon_2.entry-87fe39a9.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/{refresh-icon.entry-9ea254c9.cjs → refresh-icon.entry-21ac359d.cjs} +1 -1
- package/dist/{refresh-icon.entry-a754a2b5.js → refresh-icon.entry-87af05b0.js} +1 -1
- package/dist/{register-component-ea95564d-e19ec159.js → register-component-ea95564d-843da1da.js} +1 -1
- package/dist/{register-component-ea95564d-ab3d630f.cjs → register-component-ea95564d-a64ee107.cjs} +1 -1
- package/dist/{scheduler-config-store-2a3b403d-581c70cf.js → scheduler-config-store-2a3b403d-8553b685.js} +1 -1
- package/dist/{scheduler-config-store-2a3b403d-4e10b542.cjs → scheduler-config-store-2a3b403d-88840eb1.cjs} +1 -1
- package/dist/{scheduler-store-9ff4914b-6e28240e.cjs → scheduler-store-9ff4914b-63dc472a.cjs} +1 -1
- package/dist/{scheduler-store-9ff4914b-b71a0aca.js → scheduler-store-9ff4914b-d1a624f8.js} +1 -1
- package/dist/{textarea-component.entry-70bb02bf.cjs → textarea-component.entry-cbffb0b0.cjs} +1 -1
- package/dist/{textarea-component.entry-a5daab6c.js → textarea-component.entry-dad42f20.js} +1 -1
- package/dist/{time-period-selector.entry-25348de7.js → time-period-selector.entry-79c94da3.js} +1 -1
- package/dist/{time-period-selector.entry-6306e456.cjs → time-period-selector.entry-e54d0989.cjs} +1 -1
- package/dist/{translate-icon.entry-785fa109.cjs → translate-icon.entry-8e9eeeba.cjs} +1 -1
- package/dist/{translate-icon.entry-b6094ecc.js → translate-icon.entry-ef6266c4.js} +1 -1
- package/dist/{warning-icon.entry-94e34c58.cjs → warning-icon.entry-34c85de2.cjs} +1 -1
- package/dist/{warning-icon.entry-4b400ee2.js → warning-icon.entry-adf18211.js} +1 -1
- package/package.json +2 -2
- package/dist/chevron-icon_3.entry-41170718.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-660af56a.cjs +0 -1
- package/dist/nylas-scheduling.entry-50e41d85.cjs +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { k as
|
|
2
|
-
import { n as x, N as P } from "./index.es-79f5b771-
|
|
3
|
-
import { E as B, C as F, N as S } from "./scheduler-store-9ff4914b-
|
|
4
|
-
import { L as j, a as M } from "./constants-50c3e067-
|
|
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
5
|
import "react";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
class H {
|
|
8
|
-
constructor({ schedulerAPIURL: e, nylasSchedulerStore:
|
|
8
|
+
constructor({ schedulerAPIURL: e, nylasSchedulerStore: n, sessionId: a, configId: o, slug: r, clientId: d }) {
|
|
9
9
|
if (!e)
|
|
10
10
|
throw new Error("schedulerAPIURL is required");
|
|
11
|
-
if (!
|
|
11
|
+
if (!n)
|
|
12
12
|
throw new Error("nylasSchedulerStore is required");
|
|
13
|
-
if (!
|
|
13
|
+
if (!a && !o && !(r || d))
|
|
14
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 =
|
|
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
16
|
}
|
|
17
17
|
init() {
|
|
18
18
|
E("NylasConnector init");
|
|
@@ -35,46 +35,46 @@ class H {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
const k = (t, e) => {
|
|
38
|
-
const
|
|
39
|
-
return
|
|
38
|
+
const n = t.isLoading, a = t.showNotification, o = t.nylasBranding;
|
|
39
|
+
return i(
|
|
40
40
|
D,
|
|
41
41
|
null,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
a && i("nylas-notification", null),
|
|
43
|
+
n && i(
|
|
44
44
|
"div",
|
|
45
45
|
{ class: "loading" },
|
|
46
|
-
|
|
46
|
+
i(
|
|
47
47
|
"div",
|
|
48
48
|
{ class: "left" },
|
|
49
|
-
|
|
49
|
+
i("div", { class: "skeleton" })
|
|
50
50
|
),
|
|
51
|
-
|
|
51
|
+
i(
|
|
52
52
|
"div",
|
|
53
53
|
{ class: "right" },
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
59
|
)
|
|
60
60
|
),
|
|
61
|
-
!
|
|
62
|
-
|
|
61
|
+
!n && e,
|
|
62
|
+
i("div", { class: "footer" }, o && i(
|
|
63
63
|
D,
|
|
64
64
|
null,
|
|
65
65
|
"Powered by ",
|
|
66
|
-
|
|
66
|
+
i("nylas-logo", null)
|
|
67
67
|
))
|
|
68
68
|
);
|
|
69
|
-
}, L = (t, e) =>
|
|
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
70
|
constructor(t) {
|
|
71
|
-
|
|
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
72
|
}
|
|
73
73
|
connectedCallback() {
|
|
74
74
|
E("[nylas-scheduler] connectedCallback");
|
|
75
75
|
}
|
|
76
76
|
async componentWillLoad() {
|
|
77
|
-
var
|
|
77
|
+
var o, r;
|
|
78
78
|
E("[nylas-scheduler] Component will load");
|
|
79
79
|
const t = this.schedulerWillLoad.emit(this.host);
|
|
80
80
|
if ("schedulerWillLoad" in this.eventOverrides && (await this.eventOverrides.schedulerWillLoad(t, this.nylasSchedulerConnector), t.defaultPrevented))
|
|
@@ -88,68 +88,69 @@ const k = (t, e) => {
|
|
|
88
88
|
}, this.baseProvider = new P(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.refConfigId = this.configurationId;
|
|
89
89
|
let e;
|
|
90
90
|
if (this.rescheduleBookingRef) {
|
|
91
|
-
const [
|
|
92
|
-
this.refConfigId =
|
|
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
93
|
} else if (this.cancelBookingRef) {
|
|
94
|
-
const [
|
|
95
|
-
this.refConfigId =
|
|
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
96
|
} else if (this.organizerConfirmationBookingRef) {
|
|
97
|
-
const [
|
|
98
|
-
this.refConfigId =
|
|
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
99
|
}
|
|
100
100
|
if ("bookingRefExtracted" in this.eventOverrides && (await this.eventOverrides.bookingRefExtracted(e, this.nylasSchedulerConnector), e.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
|
|
101
101
|
return;
|
|
102
|
-
const
|
|
102
|
+
const n = (o = this.baseProvider) == null ? void 0 : o.getStore("scheduler");
|
|
103
103
|
this.nylasSchedulerConnector = new H({
|
|
104
104
|
schedulerAPIURL: this.schedulerApiUrl,
|
|
105
105
|
sessionId: this.sessionId,
|
|
106
106
|
configId: this.refConfigId,
|
|
107
107
|
slug: this.slug,
|
|
108
108
|
clientId: this.clientId,
|
|
109
|
-
nylasSchedulerStore:
|
|
109
|
+
nylasSchedulerStore: n
|
|
110
110
|
});
|
|
111
|
-
const
|
|
112
|
-
"init" in this.eventOverrides && (await this.eventOverrides.init(
|
|
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
113
|
}
|
|
114
114
|
async componentDidLoad() {
|
|
115
|
-
var l,
|
|
115
|
+
var l, p, m, h, c, f, b, w;
|
|
116
116
|
(l = this.baseProvider) == null || l.componentDidLoad();
|
|
117
117
|
const t = this.schedulerDidLoad.emit(this.host);
|
|
118
118
|
if ("schedulerDidLoad" in this.eventOverrides && (await this.eventOverrides.schedulerDidLoad(t, this.nylasSchedulerConnector), t.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
|
|
119
119
|
return;
|
|
120
120
|
this.localizationChanged(this.localization);
|
|
121
|
-
const e = await ((
|
|
122
|
-
if (!e || "error" in e)
|
|
121
|
+
const e = await ((p = this.nylasSchedulerConnector) == null ? void 0 : p.scheduler.getUISettings());
|
|
122
|
+
if (!e || "error" in e) {
|
|
123
123
|
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(e == null ? void 0 : e.error) }, host: this.host });
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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))
|
|
128
129
|
return;
|
|
129
130
|
}
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
if (!this.isTimeslotValid(
|
|
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))
|
|
133
134
|
return;
|
|
134
|
-
if (
|
|
135
|
-
|
|
135
|
+
if (n != null && n.get("showBookingForm")) {
|
|
136
|
+
n == null || n.set("selectedDate", o.start_time);
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
|
-
const
|
|
140
|
-
let
|
|
141
|
-
if (!(
|
|
142
|
-
if (
|
|
143
|
-
const { startTime:
|
|
144
|
-
|
|
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)));
|
|
145
146
|
} else {
|
|
146
|
-
const
|
|
147
|
-
|
|
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)));
|
|
148
149
|
}
|
|
149
|
-
if ((!
|
|
150
|
-
let
|
|
151
|
-
const v =
|
|
152
|
-
v && (
|
|
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);
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
}
|
|
@@ -162,29 +163,29 @@ const k = (t, e) => {
|
|
|
162
163
|
(e = this.stores) == null || e.scheduler.set("bookingInfo", t);
|
|
163
164
|
}
|
|
164
165
|
rescheduleBookingRefChanged(t) {
|
|
165
|
-
var e,
|
|
166
|
+
var e, n;
|
|
166
167
|
if (t) {
|
|
167
|
-
const [
|
|
168
|
-
(e = this.stores) == null || e.scheduler.set("rescheduleBookingId",
|
|
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);
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
cancelBookingRefChanged(t) {
|
|
172
|
-
var e,
|
|
173
|
+
var e, n;
|
|
173
174
|
if (t) {
|
|
174
|
-
const [
|
|
175
|
-
(e = this.stores) == null || e.scheduler.set("cancelBookingId",
|
|
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);
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
organizerConfirmationBookingRefChanged(t) {
|
|
179
|
-
var e,
|
|
180
|
+
var e, n;
|
|
180
181
|
if (t) {
|
|
181
|
-
const [
|
|
182
|
-
(e = this.stores) == null || e.scheduler.set("organizerConfirmationBookingId",
|
|
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);
|
|
183
184
|
}
|
|
184
185
|
}
|
|
185
186
|
localizationChanged(t) {
|
|
186
187
|
t && Object.keys(t).forEach((e) => {
|
|
187
|
-
e in j && (
|
|
188
|
+
e in j && (g.addResourceBundle(e, "translation", t[e], !1, !0), this.language = this.language);
|
|
188
189
|
});
|
|
189
190
|
}
|
|
190
191
|
themeConfigChanged(t) {
|
|
@@ -192,7 +193,7 @@ const k = (t, e) => {
|
|
|
192
193
|
}
|
|
193
194
|
languageChanged(t) {
|
|
194
195
|
const e = t.detail;
|
|
195
|
-
this.language = e,
|
|
196
|
+
this.language = e, g.changeLanguage(e);
|
|
196
197
|
}
|
|
197
198
|
async registerComponentHandler(t) {
|
|
198
199
|
var e;
|
|
@@ -203,33 +204,46 @@ const k = (t, e) => {
|
|
|
203
204
|
(e = this.baseProvider) == null || e.unregisterComponent(t.detail);
|
|
204
205
|
}
|
|
205
206
|
async monthChangedHandler(t) {
|
|
206
|
-
var
|
|
207
|
-
const e = t.detail,
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
(!
|
|
211
|
-
const
|
|
212
|
-
|
|
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]));
|
|
213
214
|
}
|
|
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
|
+
}
|
|
215
229
|
async bookButtonClickedHandler(t) {
|
|
216
|
-
var
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
const c = await ((
|
|
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));
|
|
220
234
|
(!c || "error" in c) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(c == null ? void 0 : c.error) }, host: this.host });
|
|
221
|
-
const
|
|
222
|
-
"bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(
|
|
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);
|
|
223
237
|
return;
|
|
224
238
|
}
|
|
225
|
-
const
|
|
226
|
-
(!
|
|
227
|
-
const s = this.bookedEventInfo.emit({ ...
|
|
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 } });
|
|
228
242
|
"bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(s, this.nylasSchedulerConnector);
|
|
229
243
|
}
|
|
230
244
|
dateSelectedHandler(t) {
|
|
231
245
|
const e = t.detail;
|
|
232
|
-
this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${
|
|
246
|
+
this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${g.t("noDateSelected")}`;
|
|
233
247
|
}
|
|
234
248
|
cancelBookedEventErrorHandler(t) {
|
|
235
249
|
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t.detail.error) }, host: this.host });
|
|
@@ -266,9 +280,9 @@ const k = (t, e) => {
|
|
|
266
280
|
checkIfSessionIdOrConfigIdExists() {
|
|
267
281
|
if (!this.sessionId && !this.refConfigId && !(this.slug && this.clientId)) {
|
|
268
282
|
let t = "";
|
|
269
|
-
return this.sessionId || (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({
|
|
270
284
|
notification: {
|
|
271
|
-
title:
|
|
285
|
+
title: g.t("schedulingComponentErrorTitle"),
|
|
272
286
|
category: B.Component,
|
|
273
287
|
type: x.Error,
|
|
274
288
|
description: t,
|
|
@@ -283,10 +297,10 @@ const k = (t, e) => {
|
|
|
283
297
|
isTimeslotValid(t) {
|
|
284
298
|
return new Date(t.start_time) < /* @__PURE__ */ new Date() ? (this.nylasSchedulerError.emit({
|
|
285
299
|
notification: {
|
|
286
|
-
title:
|
|
300
|
+
title: g.t("invalidTimeslotErrorTitle"),
|
|
287
301
|
category: B.Component,
|
|
288
302
|
type: x.Error,
|
|
289
|
-
description:
|
|
303
|
+
description: g.t("invalidTimeslotErrorMessage"),
|
|
290
304
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
291
305
|
ttl: "none"
|
|
292
306
|
},
|
|
@@ -294,36 +308,36 @@ const k = (t, e) => {
|
|
|
294
308
|
}), !1) : !0;
|
|
295
309
|
}
|
|
296
310
|
validateAvailableDaysInFuture(t, e) {
|
|
297
|
-
const
|
|
298
|
-
return { startTime:
|
|
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 };
|
|
299
313
|
}
|
|
300
314
|
applyThemeConfig(t) {
|
|
301
315
|
if (t)
|
|
302
|
-
for (const [e,
|
|
303
|
-
this.host.style.setProperty(`${e}`,
|
|
316
|
+
for (const [e, n] of Object.entries(t))
|
|
317
|
+
this.host.style.setProperty(`${e}`, n);
|
|
304
318
|
}
|
|
305
319
|
render() {
|
|
306
|
-
var
|
|
307
|
-
const t = this.mode === "app", e = (
|
|
308
|
-
if (this.selectedDateLabel =
|
|
309
|
-
return
|
|
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" }))));
|
|
310
324
|
if (t && l)
|
|
311
|
-
return
|
|
312
|
-
if (t &&
|
|
313
|
-
return
|
|
314
|
-
if (t &&
|
|
315
|
-
return
|
|
316
|
-
if (t &&
|
|
317
|
-
window.location.assign(
|
|
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);
|
|
318
332
|
return;
|
|
319
333
|
}
|
|
320
|
-
if (t &&
|
|
321
|
-
return
|
|
322
|
-
if (t && (!
|
|
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) {
|
|
323
337
|
const v = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
|
|
324
|
-
return
|
|
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" })))))));
|
|
325
339
|
}
|
|
326
|
-
return t && !
|
|
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));
|
|
327
341
|
}
|
|
328
342
|
get host() {
|
|
329
343
|
return A(this);
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
package/dist/{nylas-threads-refresh.entry-d025575a.js → nylas-threads-refresh.entry-45d7d171.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as f, c as p, d as i, h as o, H as u } from "./index-
|
|
2
|
-
import { R as m } from "./register-component-ea95564d-
|
|
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
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
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;
|
package/dist/{nylas-threads-refresh.entry-1b8befab.cjs → nylas-threads-refresh.entry-6636e7b1.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
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;
|
package/dist/{nylas-threads-search.entry-a254c36e.js → nylas-threads-search.entry-4460aa9b.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as u, c as y, d as l, h as i, H as f } from "./index-
|
|
2
|
-
import { R as p } from "./register-component-ea95564d-
|
|
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
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
const m = ":host{display:block}sp-search{width:100%;border:0}", b = m;
|
package/dist/{nylas-threads-search.entry-78c06183.cjs → nylas-threads-search.entry-ae87695a.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-
|
|
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;
|