@nylas/react 1.1.0-canary.21 → 1.1.0-canary.23
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-b8d6df60.js → add-circle-icon_3.entry-37a88ff3.js} +23 -13
- package/dist/add-circle-icon_3.entry-4f8f1cbf.cjs +1 -0
- package/dist/{archive-icon_7.entry-afaef817.cjs → archive-icon_7.entry-2ec9b077.cjs} +1 -1
- package/dist/{archive-icon_7.entry-3830776a.js → archive-icon_7.entry-3dcc4a66.js} +16 -16
- package/dist/{arrow-icon.entry-460cdd9f.cjs → arrow-icon.entry-175e8181.cjs} +1 -1
- package/dist/arrow-icon.entry-2cf3e94d.js +15 -0
- package/dist/{bold-icon_3.entry-80abafbb.js → bold-icon_3.entry-9fc74a39.js} +4 -4
- package/dist/{bold-icon_3.entry-1893eeec.cjs → bold-icon_3.entry-a3e61ad8.cjs} +1 -1
- package/dist/{button-component.entry-b78dc39e.cjs → button-component.entry-7fdb3bca.cjs} +1 -1
- package/dist/{button-component.entry-36137536.js → button-component.entry-861637f2.js} +2 -2
- package/dist/calendar-agenda-fill-icon_39.entry-3c21a3ec.cjs +7 -0
- package/dist/{calendar-agenda-fill-icon_40.entry-f19d6ad7.js → calendar-agenda-fill-icon_39.entry-493e91f6.js} +1268 -1300
- package/dist/{calendar-cancel-icon.entry-1fae00c5.js → calendar-cancel-icon.entry-3ca731f9.js} +2 -2
- package/dist/{calendar-cancel-icon.entry-0d83ee82.cjs → calendar-cancel-icon.entry-c9c7e3b3.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-e01c9028.cjs → calendar-check-icon_2.entry-5b8f8a75.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-159c38af.js → calendar-check-icon_2.entry-7c409a91.js} +5 -5
- package/dist/{calendar-icon.entry-3af9cb76.js → calendar-icon.entry-0589697f.js} +4 -4
- package/dist/{calendar-icon.entry-2e701aab.cjs → calendar-icon.entry-acd00f6f.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-9ff2c85b.cjs → checkbox-component_2.entry-0aa252b9.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-5eee51f6.js → checkbox-component_2.entry-538fd8ec.js} +3 -3
- package/dist/{checkmark-icon.entry-f96f1117.cjs → checkmark-icon.entry-0a184b31.cjs} +1 -1
- package/dist/{checkmark-icon.entry-0749b942.js → checkmark-icon.entry-56302db0.js} +4 -4
- package/dist/{chevron-icon_3.entry-c3989df2.cjs → chevron-icon_3.entry-7076e105.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-2e9eebbc.js → chevron-icon_3.entry-80e03257.js} +13 -13
- package/dist/{clock-icon_4.entry-d4563931.cjs → clock-icon_4.entry-d6901afd.cjs} +1 -1
- package/dist/{clock-icon_4.entry-9395d0cb.js → clock-icon_4.entry-db3fbda1.js} +19 -19
- package/dist/{constants-67de2eec-e3b50fc6.cjs → constants-12bd3c98-22fd56f2.cjs} +1 -1
- package/dist/{constants-67de2eec-b17f5b96.js → constants-12bd3c98-26c75011.js} +4 -4
- package/dist/{copy-icon_3.entry-7de3667f.cjs → copy-icon_3.entry-33e89a37.cjs} +1 -1
- package/dist/{copy-icon_3.entry-7b276fa2.js → copy-icon_3.entry-9670b9f9.js} +7 -7
- package/dist/{document-refresh-icon.entry-6dd65cb6.js → document-refresh-icon.entry-149f2a3b.js} +5 -5
- package/dist/document-refresh-icon.entry-a3326831.cjs +1 -0
- package/dist/elements/index.d.ts +3 -0
- package/dist/{elements-dc5b338e-158dce67.cjs → elements-dc5b338e-211879a3.cjs} +1 -1
- package/dist/{elements-dc5b338e-5e8a704b.js → elements-dc5b338e-e07600d4.js} +1 -1
- package/dist/{focus-visible-e8093c16-9d88e8ee.js → focus-visible-e8093c16-284cefe0.js} +1 -1
- package/dist/{focus-visible-e8093c16-5883a317.cjs → focus-visible-e8093c16-cb97634f.cjs} +1 -1
- package/dist/{forward-icon_6.entry-acdf04ad.js → forward-icon_6.entry-554b0722.js} +9 -9
- package/dist/{forward-icon_6.entry-a59dada5.cjs → forward-icon_6.entry-751fdd4e.cjs} +3 -3
- package/dist/{globe-icon.entry-eef27331.cjs → globe-icon.entry-63eb510d.cjs} +1 -1
- package/dist/{globe-icon.entry-389c0391.js → globe-icon.entry-e3dd58bc.js} +2 -2
- package/dist/google-logo-icon_5.entry-bccce7f4.cjs +1 -0
- package/dist/google-logo-icon_5.entry-e462e091.js +748 -0
- package/dist/index-53420959-02fe58ef.js +5 -0
- package/dist/index-53420959-0b9c205e.cjs +1 -0
- package/dist/{index-6d9eeb53-15c69801.cjs → index-6d9eeb53-81e5b798.cjs} +1 -1
- package/dist/{index-6d9eeb53-c70fc8a7.js → index-6d9eeb53-cc42c6f1.js} +2 -2
- package/dist/{index-db48e0b6.cjs → index-8a536089.cjs} +14 -14
- package/dist/{index-f8317a8e.js → index-a15916e5.js} +398 -383
- package/dist/{index.es-b16d0cf5-d7f30c4a.cjs → index.es-5355a265-e701a627.cjs} +1 -1
- package/dist/{index.es-b16d0cf5-386496a9.js → index.es-5355a265-f8853ce4.js} +1 -1
- package/dist/{info-icon_2.entry-97d75550.js → info-icon_2.entry-3b349f01.js} +5 -5
- package/dist/{info-icon_2.entry-63914227.cjs → info-icon_2.entry-9559cf3b.cjs} +1 -1
- package/dist/{input-dropdown.entry-4d29246a.js → input-dropdown.entry-9bc68630.js} +2 -2
- package/dist/{input-dropdown.entry-629d7b54.cjs → input-dropdown.entry-d454f6bc.cjs} +1 -1
- package/dist/loading-icon.entry-1d49e471.js +15 -0
- package/dist/loading-icon.entry-a68da48b.cjs +1 -0
- package/dist/{mailbox-store-f11de360-d781fd36.js → mailbox-store-31d55036-1106efe2.js} +2 -2
- package/dist/{mailbox-store-f11de360-02a6de93.cjs → mailbox-store-31d55036-c8618c0b.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-8e14e9af.js → multi-select-dropdown.entry-36074a81.js} +2 -2
- package/dist/{multi-select-dropdown.entry-68fcca98.cjs → multi-select-dropdown.entry-e5ed9285.cjs} +1 -1
- package/dist/{nylas-booked-event-card_10.entry-9487941d.js → nylas-booked-event-card_10.entry-38d2fd2e.js} +75 -74
- package/dist/nylas-booked-event-card_10.entry-e530a8db.cjs +1 -0
- package/dist/nylas-booking-confirmation-type.entry-2fea82f9.js +106 -0
- package/dist/nylas-booking-confirmation-type.entry-5857a863.cjs +1 -0
- package/dist/{nylas-form-card.entry-ca669dea.cjs → nylas-form-card.entry-03a31218.cjs} +1 -1
- package/dist/{nylas-form-card.entry-ccfa5692.js → nylas-form-card.entry-6e45c873.js} +19 -19
- package/dist/{nylas-if-state.entry-93935670.js → nylas-if-state.entry-092f4e1a.js} +3 -3
- package/dist/{nylas-if-state.entry-faa11bb6.cjs → nylas-if-state.entry-61d7ebc5.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-e7e179ea.cjs → nylas-list-folders.entry-1abbb401.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-14fc1fe8.js → nylas-list-folders.entry-ab9e1c2c.js} +3 -3
- package/dist/{nylas-list-threads.entry-2118b146.js → nylas-list-threads.entry-2faaa2bb.js} +3 -3
- package/dist/{nylas-list-threads.entry-3f52fc06.cjs → nylas-list-threads.entry-dfc87aca.cjs} +1 -1
- package/dist/{nylas-login.entry-87a902d6.js → nylas-login.entry-243ae09e.js} +7 -7
- package/dist/{nylas-login.entry-915f0284.cjs → nylas-login.entry-d1cac0a1.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-eedbf796.js → nylas-mailbox-pagination.entry-b8225a3e.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-9aa8a606.cjs → nylas-mailbox-pagination.entry-c27af71c.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-40b75810.js → nylas-mailbox-toolbar-button.entry-22347d22.js} +7 -7
- package/dist/{nylas-mailbox-toolbar-button.entry-ba5b826e.cjs → nylas-mailbox-toolbar-button.entry-b66d597d.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-179e5a5c.js → nylas-mailbox.entry-9e6e1b4d.js} +4 -4
- package/dist/{nylas-mailbox.entry-31de7f8f.cjs → nylas-mailbox.entry-cb80f58c.cjs} +1 -1
- package/dist/{nylas-provider.entry-7b70bbdc.js → nylas-provider.entry-196dd5da.js} +8 -8
- package/dist/{nylas-provider.entry-46fe01b6.cjs → nylas-provider.entry-28c12448.cjs} +1 -1
- package/dist/nylas-reminder-emails.entry-47ef5a9d.cjs +4 -0
- package/dist/nylas-reminder-emails.entry-b655d888.js +129 -0
- package/dist/nylas-reminder-time_2.entry-0f3747fb.cjs +1 -0
- package/dist/nylas-reminder-time_2.entry-9d8f7436.js +105 -0
- package/dist/{nylas-scheduler-editor.entry-76b68f66.cjs → nylas-scheduler-editor.entry-504e8ed3.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-f1f80de1.js → nylas-scheduler-editor.entry-feb7a7db.js} +12 -11
- package/dist/nylas-scheduling.entry-8c8f8e35.cjs +1 -0
- package/dist/{nylas-scheduling.entry-31d13205.js → nylas-scheduling.entry-d35efa9a.js} +73 -73
- package/dist/{nylas-threads-refresh.entry-a3ea46aa.js → nylas-threads-refresh.entry-91af9af3.js} +4 -4
- package/dist/{nylas-threads-refresh.entry-c9f9db8c.cjs → nylas-threads-refresh.entry-e637161b.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-01482ddf.js → nylas-threads-search.entry-5457dcec.js} +5 -5
- package/dist/{nylas-threads-search.entry-a4ab0d47.cjs → nylas-threads-search.entry-b944f95a.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-5a3bb0b7.cjs → nylas-time-window-picker.entry-134ef726.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-5f063b2b.js → nylas-time-window-picker.entry-a6fd216b.js} +12 -12
- package/dist/{nylas-view-thread.entry-cb057b9e.js → nylas-view-thread.entry-6fdd6cb1.js} +3 -3
- package/dist/{nylas-view-thread.entry-82e78b82.cjs → nylas-view-thread.entry-9296a505.cjs} +1 -1
- package/dist/{person-icon.entry-78cdc7f9.cjs → person-icon.entry-1cdb4dc2.cjs} +1 -1
- package/dist/{person-icon.entry-3e30c63c.js → person-icon.entry-4a695727.js} +4 -4
- package/dist/{play-icon_2.entry-4fb1938c.cjs → play-icon_2.entry-10fd617e.cjs} +1 -1
- package/dist/{play-icon_2.entry-71eaad5c.js → play-icon_2.entry-fb013b17.js} +6 -6
- package/dist/react.cjs +1 -1
- package/dist/react.js +104 -101
- package/dist/{refresh-icon.entry-db85d14d.js → refresh-icon.entry-46c92605.js} +4 -4
- package/dist/{refresh-icon.entry-3570353d.cjs → refresh-icon.entry-9dbb04ba.cjs} +1 -1
- package/dist/{register-component-b2a51b20-9a913603.cjs → register-component-592986c5-5edf5835.cjs} +1 -1
- package/dist/{register-component-b2a51b20-8a262dcf.js → register-component-592986c5-d5d210a8.js} +1 -1
- package/dist/{scheduler-config-store-9ccfba4d-6806e3cb.cjs → scheduler-config-store-9ccfba4d-3ec35859.cjs} +1 -1
- package/dist/{scheduler-config-store-9ccfba4d-a6745ccc.js → scheduler-config-store-9ccfba4d-b08031b5.js} +1 -1
- package/dist/{scheduler-store-db06b30a-1e63b67f.js → scheduler-store-fd0d11a5-313e8592.js} +1 -1
- package/dist/{scheduler-store-db06b30a-d5e6b6c3.cjs → scheduler-store-fd0d11a5-b180b3b7.cjs} +1 -1
- package/dist/{textarea-component.entry-f5f402a1.js → textarea-component.entry-0cd3b57f.js} +4 -4
- package/dist/{textarea-component.entry-be870b8f.cjs → textarea-component.entry-788eb37a.cjs} +1 -1
- package/dist/{time-period-selector.entry-d1a8470b.js → time-period-selector.entry-112c0b64.js} +6 -6
- package/dist/{time-period-selector.entry-fc7d61c6.cjs → time-period-selector.entry-1e0b720b.cjs} +1 -1
- package/dist/{translate-icon.entry-b91a0449.js → translate-icon.entry-a4df3c16.js} +4 -4
- package/dist/{translate-icon.entry-3ae0ddae.cjs → translate-icon.entry-c701b391.cjs} +1 -1
- package/dist/{warning-icon.entry-54127f45.cjs → warning-icon.entry-bda0aafa.cjs} +1 -1
- package/dist/{warning-icon.entry-acdc811b.js → warning-icon.entry-d1703715.js} +7 -7
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-29cc2385.cjs +0 -1
- package/dist/arrow-icon.entry-19f00716.js +0 -15
- package/dist/calendar-agenda-fill-icon_40.entry-62c66fce.cjs +0 -10
- package/dist/close-icon.entry-cf9f0a69.js +0 -15
- package/dist/close-icon.entry-e24af309.cjs +0 -1
- package/dist/document-refresh-icon.entry-582ac233.cjs +0 -1
- package/dist/google-logo-icon_4.entry-e9be320c.cjs +0 -1
- package/dist/google-logo-icon_4.entry-eae19fc8.js +0 -637
- package/dist/index-53420959-82a5306f.cjs +0 -1
- package/dist/index-53420959-9b1699ec.js +0 -5
- package/dist/loading-icon.entry-2f15a09f.cjs +0 -1
- package/dist/loading-icon.entry-fc9bc740.js +0 -15
- package/dist/nylas-booked-event-card_10.entry-4da23b61.cjs +0 -1
- package/dist/nylas-custom-booking-flow.entry-0e16973b.js +0 -106
- package/dist/nylas-custom-booking-flow.entry-338b0a8f.cjs +0 -1
- package/dist/nylas-scheduling.entry-3ce8c52f.cjs +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { k as
|
|
2
|
-
import { n as I, N as
|
|
3
|
-
import { E as C, C as
|
|
4
|
-
import { L as O } from "./constants-
|
|
1
|
+
import { k as g, r as L, c as k, d as _, l as x, m as A, n as N, h as i, H as y, g as R, F as E } from "./index-a15916e5.js";
|
|
2
|
+
import { n as I, N as F } from "./index.es-5355a265-f8853ce4.js";
|
|
3
|
+
import { E as C, C as P, N as S } from "./scheduler-store-fd0d11a5-313e8592.js";
|
|
4
|
+
import { L as O } from "./constants-12bd3c98-26c75011.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
class j {
|
|
8
|
-
constructor({ schedulerAPIURL: e, nylasSchedulerStore:
|
|
8
|
+
constructor({ schedulerAPIURL: e, nylasSchedulerStore: s, sessionId: n, configId: a }) {
|
|
9
9
|
if (!e)
|
|
10
10
|
throw new Error("schedulerAPIURL is required");
|
|
11
|
-
if (!
|
|
11
|
+
if (!s)
|
|
12
12
|
throw new Error("nylasSchedulerStore is required");
|
|
13
|
-
if (!n && !
|
|
13
|
+
if (!n && !a)
|
|
14
14
|
throw new Error("sessionId is required for private configs, if not config id is required for public configs");
|
|
15
|
-
e === "/" && (e = new URL(window.location.href).origin), this.configId =
|
|
15
|
+
e === "/" && (e = new URL(window.location.href).origin), this.configId = a, this.sessionId = n, this.schedulerAPIURL = e, this.nylasSchedulerStore = s;
|
|
16
16
|
}
|
|
17
17
|
init() {
|
|
18
18
|
_("NylasConnector init");
|
|
@@ -21,7 +21,7 @@ class j {
|
|
|
21
21
|
return this.nylasSchedulerStore;
|
|
22
22
|
}
|
|
23
23
|
get scheduler() {
|
|
24
|
-
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new
|
|
24
|
+
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new S({
|
|
25
25
|
schedulerAPIURL: this.schedulerAPIURL,
|
|
26
26
|
schedulerStore: this.schedulerStore,
|
|
27
27
|
sessionId: this.sessionId,
|
|
@@ -33,12 +33,12 @@ class j {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
const w = (t, e) => {
|
|
36
|
-
const
|
|
36
|
+
const s = t.isLoading, n = t.showNotification, a = t.nylasBranding;
|
|
37
37
|
return i(
|
|
38
38
|
E,
|
|
39
39
|
null,
|
|
40
40
|
n && i("nylas-notification", null),
|
|
41
|
-
|
|
41
|
+
s && i(
|
|
42
42
|
"div",
|
|
43
43
|
{ class: "loading" },
|
|
44
44
|
i(
|
|
@@ -56,57 +56,57 @@ const w = (t, e) => {
|
|
|
56
56
|
i("div", { class: "skeleton" })
|
|
57
57
|
)
|
|
58
58
|
),
|
|
59
|
-
!
|
|
60
|
-
i("div", { class: "footer" },
|
|
59
|
+
!s && e,
|
|
60
|
+
i("div", { class: "footer" }, a && i(
|
|
61
61
|
E,
|
|
62
62
|
null,
|
|
63
63
|
"Powered by ",
|
|
64
64
|
i("nylas-logo", null)
|
|
65
65
|
))
|
|
66
66
|
);
|
|
67
|
-
}, D = (t, e) => i("div", { class: "message-banner" }, e), H = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin-top:1rem}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width: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}@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}', M = H, B = { title:
|
|
67
|
+
}, D = (t, e) => i("div", { class: "message-banner" }, e), H = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin-top:1rem}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width: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}@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}', M = H, B = { title: g.t("genericErrorTitle"), type: I.Error, category: C.Component }, U = class {
|
|
68
68
|
constructor(t) {
|
|
69
|
-
L(this, t), this.init = k(this, "init", 7), this.schedulerWillLoad = k(this, "schedulerWillLoad", 7), this.schedulerDidLoad = k(this, "schedulerDidLoad", 7), this.nylasSchedulerError = k(this, "nylasSchedulerError", 7), this.bookingRefExtracted = k(this, "bookingRefExtracted", 7), this.mode = "app", this.defaultSchedulerState = void 0, this.sessionId = void 0, this.schedulerApiUrl = "https://api.us.nylas.com", this.bookingInfo = void 0, this.rescheduleBookingRef = void 0, this.cancelBookingRef = void 0, this.configurationId = void 0, this.nylasBranding = !0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.showNotification = !0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, { dateStyle: "full" }) || `${
|
|
69
|
+
L(this, t), this.init = k(this, "init", 7), this.schedulerWillLoad = k(this, "schedulerWillLoad", 7), this.schedulerDidLoad = k(this, "schedulerDidLoad", 7), this.nylasSchedulerError = k(this, "nylasSchedulerError", 7), this.bookingRefExtracted = k(this, "bookingRefExtracted", 7), this.mode = "app", this.defaultSchedulerState = void 0, this.sessionId = void 0, this.schedulerApiUrl = "https://api.us.nylas.com", this.bookingInfo = void 0, this.rescheduleBookingRef = void 0, this.cancelBookingRef = void 0, this.configurationId = void 0, this.nylasBranding = !0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.showNotification = !0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, { dateStyle: "full" }) || `${g.t("noDateSelected")}`, this.refConfigId = void 0, this.language = navigator.language;
|
|
70
70
|
}
|
|
71
71
|
connectedCallback() {
|
|
72
72
|
_("[nylas-scheduler] connectedCallback");
|
|
73
73
|
}
|
|
74
74
|
async componentWillLoad() {
|
|
75
|
-
var
|
|
75
|
+
var s, n;
|
|
76
76
|
if (_("[nylas-scheduler] Component will load"), this.schedulerWillLoad.emit(this.host).defaultPrevented)
|
|
77
77
|
return;
|
|
78
78
|
if (this.stores = {
|
|
79
|
-
scheduler:
|
|
79
|
+
scheduler: P({
|
|
80
80
|
bookingInfo: this.bookingInfo,
|
|
81
81
|
nylasBranding: this.nylasBranding,
|
|
82
82
|
...this.defaultSchedulerState
|
|
83
83
|
})
|
|
84
|
-
}, this.baseProvider = new
|
|
85
|
-
const [
|
|
86
|
-
this.refConfigId =
|
|
84
|
+
}, this.baseProvider = new F(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.refConfigId = this.configurationId, this.rescheduleBookingRef) {
|
|
85
|
+
const [a, o] = x(this.rescheduleBookingRef);
|
|
86
|
+
this.refConfigId = a, this.stores.scheduler.set("rescheduleBookingId", o), this.bookingRefExtracted.emit({ configurationId: a, bookingId: o });
|
|
87
87
|
} else if (this.cancelBookingRef) {
|
|
88
|
-
const [
|
|
89
|
-
this.refConfigId =
|
|
88
|
+
const [a, o] = x(this.cancelBookingRef);
|
|
89
|
+
this.refConfigId = a, this.stores.scheduler.set("cancelBookingId", o), this.bookingRefExtracted.emit({ configurationId: a, bookingId: o });
|
|
90
90
|
}
|
|
91
91
|
if (!this.checkIfSessionIdOrConfigIdExists())
|
|
92
92
|
return;
|
|
93
|
-
const e = (
|
|
93
|
+
const e = (s = this.baseProvider) == null ? void 0 : s.getStore("scheduler");
|
|
94
94
|
if (this.nylasSchedulerConnector = new j({
|
|
95
95
|
schedulerAPIURL: this.schedulerApiUrl,
|
|
96
96
|
sessionId: this.sessionId,
|
|
97
97
|
configId: this.refConfigId,
|
|
98
98
|
nylasSchedulerStore: e
|
|
99
99
|
}), this.init.emit(this.host), (n = this.baseProvider) == null || n.componentWillLoad(this.nylasSchedulerConnector), this.themeConfig)
|
|
100
|
-
for (const [
|
|
101
|
-
this.host.style.setProperty(`${
|
|
100
|
+
for (const [a, o] of Object.entries(this.themeConfig))
|
|
101
|
+
this.host.style.setProperty(`${a}`, o);
|
|
102
102
|
}
|
|
103
103
|
async componentDidLoad() {
|
|
104
|
-
var d, l,
|
|
104
|
+
var d, l, f, u, p, b, h;
|
|
105
105
|
if ((d = this.baseProvider) == null || d.componentDidLoad(), !this.checkIfSessionIdOrConfigIdExists())
|
|
106
106
|
return;
|
|
107
107
|
const t = await ((l = this.nylasSchedulerConnector) == null ? void 0 : l.scheduler.getUISettings());
|
|
108
108
|
(!t || "error" in t) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t == null ? void 0 : t.error) }, host: this.host });
|
|
109
|
-
const e = (
|
|
109
|
+
const e = (f = this.baseProvider) == null ? void 0 : f.getStore("scheduler"), s = (p = (u = e == null ? void 0 : e.get("configSettings")) == null ? void 0 : u.scheduler) == null ? void 0 : p.available_days_in_future, n = e == null ? void 0 : e.get("selectedTimeslot");
|
|
110
110
|
if (n && (n != null && n.start_time)) {
|
|
111
111
|
if (!this.isTimeslotValid(n))
|
|
112
112
|
return;
|
|
@@ -115,17 +115,17 @@ const w = (t, e) => {
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
const
|
|
118
|
+
const a = e == null ? void 0 : e.get("selectedDate"), o = e == null ? void 0 : e.get("availability");
|
|
119
119
|
let r;
|
|
120
120
|
if (!(o && o.length > 0)) {
|
|
121
|
-
if (
|
|
122
|
-
const { startTime: c, endTime: m, endTimeForAvailableDaysInFuture: v } = this.validateAvailableDaysInFuture(
|
|
123
|
-
|
|
121
|
+
if (a) {
|
|
122
|
+
const { startTime: c, endTime: m, endTimeForAvailableDaysInFuture: v } = this.validateAvailableDaysInFuture(a, s || 30);
|
|
123
|
+
a.getTime() < v * 1e3 && (r = await ((h = this.nylasSchedulerConnector) == null ? void 0 : h.scheduler.getAvailability(c, m)));
|
|
124
124
|
} else {
|
|
125
|
-
const c = /* @__PURE__ */ new Date(), { startTime: m, endTime: v, endTimeForAvailableDaysInFuture: T } = this.validateAvailableDaysInFuture(c,
|
|
126
|
-
c.getTime() < T * 1e3 && (r = await ((
|
|
125
|
+
const c = /* @__PURE__ */ new Date(), { startTime: m, endTime: v, endTimeForAvailableDaysInFuture: T } = this.validateAvailableDaysInFuture(c, s || 30);
|
|
126
|
+
c.getTime() < T * 1e3 && (r = await ((b = this.nylasSchedulerConnector) == null ? void 0 : b.scheduler.getAvailability(m, v)));
|
|
127
127
|
}
|
|
128
|
-
if ((!r || "error" in r) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(r == null ? void 0 : r.error) }, host: this.host }), !
|
|
128
|
+
if ((!r || "error" in r) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(r == null ? void 0 : r.error) }, host: this.host }), !a) {
|
|
129
129
|
let c = /* @__PURE__ */ new Date();
|
|
130
130
|
const m = e == null ? void 0 : e.get("availability").find((v) => new Date(v.start_time) > /* @__PURE__ */ new Date());
|
|
131
131
|
m && (c = m.start_time), e == null || e.set("selectedDate", c);
|
|
@@ -141,22 +141,22 @@ const w = (t, e) => {
|
|
|
141
141
|
(e = this.stores) == null || e.scheduler.set("bookingInfo", t);
|
|
142
142
|
}
|
|
143
143
|
rescheduleBookingRefChanged(t) {
|
|
144
|
-
var e,
|
|
144
|
+
var e, s;
|
|
145
145
|
if (t) {
|
|
146
|
-
const [n,
|
|
147
|
-
(e = this.stores) == null || e.scheduler.set("rescheduleBookingId",
|
|
146
|
+
const [n, a] = x(t);
|
|
147
|
+
(e = this.stores) == null || e.scheduler.set("rescheduleBookingId", a), this.refConfigId = n, (s = this.nylasSchedulerConnector) == null || s.scheduler.setConfigId(n);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
cancelBookingRefChanged(t) {
|
|
151
|
-
var e,
|
|
151
|
+
var e, s;
|
|
152
152
|
if (t) {
|
|
153
|
-
const [n,
|
|
154
|
-
(e = this.stores) == null || e.scheduler.set("cancelBookingId",
|
|
153
|
+
const [n, a] = x(t);
|
|
154
|
+
(e = this.stores) == null || e.scheduler.set("cancelBookingId", a), this.refConfigId = n, (s = this.nylasSchedulerConnector) == null || s.scheduler.setConfigId(n);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
languageChanged(t) {
|
|
158
158
|
const e = t.detail;
|
|
159
|
-
this.language = e,
|
|
159
|
+
this.language = e, g.changeLanguage(e);
|
|
160
160
|
}
|
|
161
161
|
async registerComponentHandler(t) {
|
|
162
162
|
var e;
|
|
@@ -167,20 +167,20 @@ const w = (t, e) => {
|
|
|
167
167
|
(e = this.baseProvider) == null || e.unregisterComponent(t.detail);
|
|
168
168
|
}
|
|
169
169
|
async monthChangedHandler(t) {
|
|
170
|
-
var r, d, l,
|
|
171
|
-
const e = t.detail,
|
|
170
|
+
var r, d, l, f, u, p, b;
|
|
171
|
+
const e = t.detail, s = (f = (l = (d = (r = this.nylasSchedulerConnector) == null ? void 0 : r.schedulerStore) == null ? void 0 : d.get("configSettings")) == null ? void 0 : l.scheduler) == null ? void 0 : f.available_days_in_future, { startTime: n, endTime: a, endTimeForAvailableDaysInFuture: o } = this.validateAvailableDaysInFuture(e, s || 30);
|
|
172
172
|
if (n < o && e.getTime() < o * 1e3) {
|
|
173
|
-
const
|
|
174
|
-
(!
|
|
175
|
-
const c = (
|
|
176
|
-
c && c.length > 0 && ((
|
|
173
|
+
const h = await ((u = this.nylasSchedulerConnector) == null ? void 0 : u.scheduler.getAvailability(n, a));
|
|
174
|
+
(!h || "error" in h) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(h == null ? void 0 : h.error) }, host: this.host });
|
|
175
|
+
const c = (p = this.stores) == null ? void 0 : p.scheduler.get("selectableDates");
|
|
176
|
+
c && c.length > 0 && ((b = this.stores) == null || b.scheduler.set("selectedDate", c[0]));
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
async bookButtonClickedHandler(t) {
|
|
180
|
-
var
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
183
|
-
const l = await ((r = this.nylasSchedulerConnector) == null ? void 0 : r.scheduler.rescheduleBooking(
|
|
180
|
+
var a, o, r, d;
|
|
181
|
+
const s = (o = (a = this.nylasSchedulerConnector) == null ? void 0 : a.schedulerStore) == null ? void 0 : o.get("rescheduleBookingId");
|
|
182
|
+
if (s) {
|
|
183
|
+
const l = await ((r = this.nylasSchedulerConnector) == null ? void 0 : r.scheduler.rescheduleBooking(s, t.detail));
|
|
184
184
|
(!l || "error" in l) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(l == null ? void 0 : l.error) }, host: this.host });
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
@@ -189,7 +189,7 @@ const w = (t, e) => {
|
|
|
189
189
|
}
|
|
190
190
|
dateSelectedHandler(t) {
|
|
191
191
|
const e = t.detail;
|
|
192
|
-
this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${
|
|
192
|
+
this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${g.t("noDateSelected")}`;
|
|
193
193
|
}
|
|
194
194
|
cancelBookedEventErrorHandler(t) {
|
|
195
195
|
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t.detail.error) }, host: this.host });
|
|
@@ -223,10 +223,10 @@ const w = (t, e) => {
|
|
|
223
223
|
checkIfSessionIdOrConfigIdExists() {
|
|
224
224
|
return !this.sessionId && !this.refConfigId ? (this.nylasSchedulerError.emit({
|
|
225
225
|
notification: {
|
|
226
|
-
title:
|
|
226
|
+
title: g.t("noSessionIdErrorTitle"),
|
|
227
227
|
category: C.Component,
|
|
228
228
|
type: I.Error,
|
|
229
|
-
description:
|
|
229
|
+
description: g.t("noSessionIdErrorMessage"),
|
|
230
230
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
231
231
|
ttl: "none"
|
|
232
232
|
},
|
|
@@ -236,10 +236,10 @@ const w = (t, e) => {
|
|
|
236
236
|
isTimeslotValid(t) {
|
|
237
237
|
return new Date(t.start_time) < /* @__PURE__ */ new Date() ? (this.nylasSchedulerError.emit({
|
|
238
238
|
notification: {
|
|
239
|
-
title:
|
|
239
|
+
title: g.t("invalidTimeslotErrorTitle"),
|
|
240
240
|
category: C.Component,
|
|
241
241
|
type: I.Error,
|
|
242
|
-
description:
|
|
242
|
+
description: g.t("invalidTimeslotErrorMessage"),
|
|
243
243
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
244
244
|
ttl: "none"
|
|
245
245
|
},
|
|
@@ -247,30 +247,30 @@ const w = (t, e) => {
|
|
|
247
247
|
}), !1) : !0;
|
|
248
248
|
}
|
|
249
249
|
validateAvailableDaysInFuture(t, e) {
|
|
250
|
-
const
|
|
251
|
-
return { startTime: n <
|
|
250
|
+
const s = /* @__PURE__ */ new Date(), n = new Date(t.getFullYear(), t.getMonth(), 1).getTime() / 1e3, a = new Date(t.getFullYear(), t.getMonth() + 1, 1).getTime() / 1e3, o = Math.floor(A(s, e).getTime() / 1e3), r = Math.min(o, a);
|
|
251
|
+
return { startTime: n < s.getTime() / 1e3 ? Math.floor(s.getTime() / 1e3) : n, endTime: r, endTimeForAvailableDaysInFuture: o };
|
|
252
252
|
}
|
|
253
253
|
render() {
|
|
254
|
-
var
|
|
255
|
-
const t = this.mode === "app", e = (
|
|
256
|
-
if (this.selectedDateLabel =
|
|
257
|
-
return i(
|
|
258
|
-
if (t && s)
|
|
259
|
-
return i(b, null, i(w, { nylasBranding: l, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, i("nylas-cancelled-event-card", { cancelledEventInfo: s, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))));
|
|
254
|
+
var p, b, h;
|
|
255
|
+
const t = this.mode === "app", e = (p = this.baseProvider) == null ? void 0 : p.getStore("scheduler"), s = e == null ? void 0 : e.get("eventInfo"), n = e == null ? void 0 : e.get("showBookingForm"), a = e == null ? void 0 : e.get("cancelledEventInfo"), o = e == null ? void 0 : e.get("cancelBookingId"), r = e == null ? void 0 : e.get("selectedTimeslot"), d = e == null ? void 0 : e.get("rescheduleBookingId"), l = (e == null ? void 0 : e.get("nylasBranding")) || this.nylasBranding, f = e == null ? void 0 : e.get("selectedDate"), u = (h = (b = e == null ? void 0 : e.get("configSettings")) == null ? void 0 : b.scheduler) == null ? void 0 : h.confirmation_redirect_url;
|
|
256
|
+
if (this.selectedDateLabel = f && this.language ? N(f.toLocaleDateString(O[this.language], { dateStyle: "full" })) : `${g.t("noDateSelected")}`, t && o && !a)
|
|
257
|
+
return i(y, null, i(w, { nylasBranding: l, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, i("nylas-cancel-booking-form", { selectedTimeslot: r, cancelBookingId: o, exportparts: "ncbf, ncbf__input-textfield, ncbf__button-cta, ncbf__button-outline, ncbf__input-label" }))));
|
|
260
258
|
if (t && a)
|
|
261
|
-
return i(
|
|
262
|
-
if (t &&
|
|
263
|
-
|
|
264
|
-
return
|
|
259
|
+
return i(y, null, i(w, { nylasBranding: l, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, i("nylas-cancelled-event-card", { cancelledEventInfo: a, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))));
|
|
260
|
+
if (t && s && u) {
|
|
261
|
+
window.location.assign(u);
|
|
262
|
+
return;
|
|
265
263
|
}
|
|
266
|
-
if (t &&
|
|
267
|
-
|
|
268
|
-
|
|
264
|
+
if (t && s)
|
|
265
|
+
return i(y, null, i(w, { nylasBranding: l, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "booked-event-page", part: "booked-event-page" }, i("nylas-booked-event-card", { selectedTimeslot: r, eventInfo: s, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))));
|
|
266
|
+
if (t && (!s || d) && !n) {
|
|
267
|
+
const c = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
|
|
268
|
+
return i(y, null, i(w, { nylasBranding: l, isLoading: this.isLoading, showNotification: this.showNotification }, d && i(D, 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__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), i("nylas-locale-switch", null)), i("div", { class: "right-panel" }, 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" }, c && i("span", { slot: "timeslot-picker-cta-label" }, i("slot", { name: "timeslot-picker-cta-label" })))))));
|
|
269
269
|
}
|
|
270
|
-
return i(
|
|
270
|
+
return t && !s && n ? i(y, null, i(w, { nylasBranding: l, isLoading: this.isLoading, showNotification: this.showNotification }, d && i(D, 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" }))), i("div", { class: "right-panel" }, i("nylas-booking-form", { exportparts: "nbf, nbf__input-label, nbf__input-textfield, nbf__button-ghost, nbf__button-primary, nbf__button-outline" }))))) : i(y, null, i("slot", null));
|
|
271
271
|
}
|
|
272
272
|
get host() {
|
|
273
|
-
return
|
|
273
|
+
return R(this);
|
|
274
274
|
}
|
|
275
275
|
static get watchers() {
|
|
276
276
|
return {
|
package/dist/{nylas-threads-refresh.entry-a3ea46aa.js → nylas-threads-refresh.entry-91af9af3.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-
|
|
1
|
+
import { r as f, c as p, d as i, h as o, H as u } from "./index-a15916e5.js";
|
|
2
|
+
import { R as m } from "./register-component-592986c5-d5d210a8.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;
|
|
@@ -45,11 +45,11 @@ const d = class {
|
|
|
45
45
|
this.state = t;
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return o(u, { key: "
|
|
48
|
+
return o(u, { key: "208a3f1e64e9f7a1a2614fa3e772c5664e3d3109" }, o("div", { key: "36d2e44d491978301c549d62834606f7d46737b3", class: "container", ref: (t) => this.containerElement = t }, o("button", { key: "1f2cbf74de5be69de5eeca22b46e0ba51ac87720", class: {
|
|
49
49
|
"pull-to-refresh": !0,
|
|
50
50
|
pulling: this.pulling,
|
|
51
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: "
|
|
52
|
+
}, "aria-label": "Refreshing..." }, this.state === "loading" && o("refresh-icon", { slot: "icon" }), this.state !== "loading" && o("arrow-icon", { slot: "icon" })), o("div", { key: "089d5985cbfb0be2d9db820b0039cb29fa7138a9", class: "content", ref: (t) => this.contentElement = t }, o("slot", { key: "8594cea7e7c308acf95aa59d7e8dabfeeb813fc4" }))));
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
v([
|
package/dist/{nylas-threads-refresh.entry-c9f9db8c.cjs → nylas-threads-refresh.entry-e637161b.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-8a536089.cjs"),d=require("./register-component-592986c5-5edf5835.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:"208a3f1e64e9f7a1a2614fa3e772c5664e3d3109"},s.h("div",{key:"36d2e44d491978301c549d62834606f7d46737b3",class:"container",ref:t=>this.containerElement=t},s.h("button",{key:"1f2cbf74de5be69de5eeca22b46e0ba51ac87720",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:"089d5985cbfb0be2d9db820b0039cb29fa7138a9",class:"content",ref:t=>this.contentElement=t},s.h("slot",{key:"8594cea7e7c308acf95aa59d7e8dabfeeb813fc4"}))))}};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-01482ddf.js → nylas-threads-search.entry-5457dcec.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as u, c as y, d as h, h as i, H as p } from "./index-
|
|
2
|
-
import { R as f } from "./register-component-
|
|
1
|
+
import { r as u, c as y, d as h, h as i, H as p } from "./index-a15916e5.js";
|
|
2
|
+
import { R as f } from "./register-component-592986c5-d5d210a8.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
const
|
|
5
|
+
const m = ":host{display:block}sp-search{width:100%;border:0}", b = m;
|
|
6
6
|
var g = function(t, e, n, r) {
|
|
7
7
|
var s = arguments.length, a = s < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, n) : r, o;
|
|
8
8
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
@@ -37,7 +37,7 @@ const d = class {
|
|
|
37
37
|
this.internalQuery = this.query;
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return i(p, { key: "
|
|
40
|
+
return i(p, { key: "ab923b1dc0d97e7989c0acb5153b3ef41c564379" }, i("sp-theme", { key: "d51233f46b3551a8e9b62a19a8d48c2e265ed7e6", scale: "medium", color: "dark" }, i("sp-search", { key: "be41fc3866ba0ee6203f0c310f4f544bcdf2e52d", quiet: !0, onSubmit: this.onSearch, onBlur: this.onSearch, value: this.internalQuery })));
|
|
41
41
|
}
|
|
42
42
|
static get watchers() {
|
|
43
43
|
return {
|
|
@@ -63,7 +63,7 @@ g([
|
|
|
63
63
|
l("design:paramtypes", []),
|
|
64
64
|
l("design:returntype", void 0)
|
|
65
65
|
], d.prototype, "render", null);
|
|
66
|
-
d.style =
|
|
66
|
+
d.style = b;
|
|
67
67
|
export {
|
|
68
68
|
d as nylas_threads_search
|
|
69
69
|
};
|
package/dist/{nylas-threads-search.entry-a4ab0d47.cjs → nylas-threads-search.entry-b944f95a.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-8a536089.cjs"),u=require("./register-component-592986c5-5edf5835.cjs");require("react");require("react-dom");const d=":host{display:block}sp-search{width:100%;border:0}",y=d;var f=function(t,e,s,n){var c=arguments.length,r=c<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,s):n,o;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--)(o=t[i])&&(r=(c<3?o(r):c>3?o(e,s,r):o(e,s))||r);return c>3&&r&&Object.defineProperty(e,s,r),r},l=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)};const h=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:"ab923b1dc0d97e7989c0acb5153b3ef41c564379"},a.h("sp-theme",{key:"d51233f46b3551a8e9b62a19a8d48c2e265ed7e6",scale:"medium",color:"dark"},a.h("sp-search",{key:"be41fc3866ba0ee6203f0c310f4f544bcdf2e52d",quiet:!0,onSubmit:this.onSearch,onBlur:this.onSearch,value:this.internalQuery})))}static get watchers(){return{query:["onQueryChange"]}}};f([u.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}),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],h.prototype,"render",null);h.style=y;exports.nylas_threads_search=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-db48e0b6.cjs");require("react");require("react-dom");var _={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(r.commonjsGlobal,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d\d/,h=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,b={},Z=function(s){return(s=+s)+(s>68?1900:2e3)},d=function(s){return function(o){this[s]=+o}},B=[/[+-]\d\d:?(\d\d)?|Z/,function(s){(this.zone||(this.zone={})).offset=function(o){if(!o||o==="Z")return 0;var m=o.match(/([+-]|\d\d)/g),l=60*m[1]+(+m[2]||0);return l===0?0:m[0]==="+"?-l:l}(s)}],F=function(s){var o=b[s];return o&&(o.indexOf?o:o.s.concat(o.f))},V=function(s,o){var m,l=b.meridiem;if(l){for(var p=1;p<=24;p+=1)if(s.indexOf(l(p,0,o))>-1){m=p>12;break}}else m=s===(o?"pm":"PM");return m},q={A:[x,function(s){this.afternoon=V(s,!1)}],a:[x,function(s){this.afternoon=V(s,!0)}],S:[/\d/,function(s){this.milliseconds=100*+s}],SS:[a,function(s){this.milliseconds=10*+s}],SSS:[/\d{3}/,function(s){this.milliseconds=+s}],s:[h,d("seconds")],ss:[h,d("seconds")],m:[h,d("minutes")],mm:[h,d("minutes")],H:[h,d("hours")],h:[h,d("hours")],HH:[h,d("hours")],hh:[h,d("hours")],D:[h,d("day")],DD:[a,d("day")],Do:[x,function(s){var o=b.ordinal,m=s.match(/\d+/);if(this.day=m[0],o)for(var l=1;l<=31;l+=1)o(l).replace(/\[|\]/g,"")===s&&(this.day=l)}],M:[h,d("month")],MM:[a,d("month")],MMM:[x,function(s){var o=F("months"),m=(F("monthsShort")||o.map(function(l){return l.slice(0,3)})).indexOf(s)+1;if(m<1)throw new Error;this.month=m%12||m}],MMMM:[x,function(s){var o=F("months").indexOf(s)+1;if(o<1)throw new Error;this.month=o%12||o}],Y:[/[+-]?\d+/,d("year")],YY:[a,function(s){this.year=Z(s)}],YYYY:[/\d{4}/,d("year")],Z:B,ZZ:B};function N(s){var o,m;o=s,m=b&&b.formats;for(var l=(s=o.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,T,f){var c=f&&f.toUpperCase();return T||m[f]||n[f]||m[c].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(w,k,M){return k||M.slice(1)})})).match(i),p=l.length,y=0;y<p;y+=1){var C=l[y],I=q[C],v=I&&I[0],g=I&&I[1];l[y]=g?{regex:v,parser:g}:C.replace(/^\[|\]$/g,"")}return function(S){for(var T={},f=0,c=0;f<p;f+=1){var w=l[f];if(typeof w=="string")c+=w.length;else{var k=w.regex,M=w.parser,L=S.slice(c),A=k.exec(L)[0];M.call(T,A),S=S.replace(A,"")}}return function(D){var u=D.afternoon;if(u!==void 0){var Y=D.hours;u?Y<12&&(D.hours+=12):Y===12&&(D.hours=0),delete D.afternoon}}(T),T}}return function(s,o,m){m.p.customParseFormat=!0,s&&s.parseTwoDigitYear&&(Z=s.parseTwoDigitYear);var l=o.prototype,p=l.parse;l.parse=function(y){var C=y.date,I=y.utc,v=y.args;this.$u=I;var g=v[1];if(typeof g=="string"){var S=v[2]===!0,T=v[3]===!0,f=S||T,c=v[2];T&&(c=v[2]),b=this.$locale(),!S&&c&&(b=m.Ls[c]),this.$d=function(L,A,D){try{if(["x","X"].indexOf(A)>-1)return new Date((A==="X"?1e3:1)*L);var u=N(A)(L),Y=u.year,E=u.month,X=u.day,G=u.hours,J=u.minutes,Q=u.seconds,ee=u.milliseconds,W=u.zone,$=new Date,P=X||(Y||E?1:$.getDate()),z=Y||$.getFullYear(),O=0;Y&&!E||(O=E>0?E-1:$.getMonth());var j=G||0,H=J||0,K=Q||0,R=ee||0;return W?new Date(Date.UTC(z,O,P,j,H,K,R+60*W.offset*1e3)):D?new Date(Date.UTC(z,O,P,j,H,K,R)):new Date(z,O,P,j,H,K,R)}catch{return new Date("")}}(C,g,I),this.init(),c&&c!==!0&&(this.$L=this.locale(c).$L),f&&C!=this.format(g)&&(this.$d=new Date("")),b={}}else if(g instanceof Array)for(var w=g.length,k=1;k<=w;k+=1){v[1]=g[k-1];var M=m.apply(this,v);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}k===w&&(this.$d=new Date(""))}else p.call(this,y)}}})})(_);const te=_.exports,ie=':host{display:block;position:relative;--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}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}',se=ie;r.dayjs.extend(te);const U=class{constructor(e){r.registerInstance(this,e),this.timeChange=r.createEvent(this,"timeChange",7),this.formError=r.createEvent(this,"formError",7),this.time=void 0,this.minimumStartTime=null,this.placeholder="hh:mmam/pm",this.name=void 0,this.hasError=!1,this.err="",this.showTimes=!1,this.ariaActivedescendant="",this.times=this.generateTimes(),this.shouldAutoScroll=!1}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.showTimes&&(this.showTimes=!1)}minimumStartTimeChangedHandler(){if(this.minimumStartTime){let e=r.dayjs().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4,-2)));this.minimumStartTime.slice(-2).toLowerCase()==="pm"&&parseInt(this.minimumStartTime)!==12?e=e.add(12,"hour"):this.minimumStartTime.slice(-2).toLowerCase()==="am"&&parseInt(this.minimumStartTime)===12&&(e=e.subtract(12,"hour")),this.times=this.generateTimes();const t=r.dayjs(this.times[0].value,"hh:mma");r.dayjs(this.time,"hh:mma").isBefore(t)&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"}))}}componentDidRender(){if(this.showTimes&&this.shouldAutoScroll){const e=r.autocompleteTimeFormat(this.time),t=this.times.findIndex(n=>n.value===e);t>-1&&(this.shouldAutoScroll=!1,this.scrollToViewWithinParent(t));return}}handleTimeChange(e,t){const n=t.split(":");n[0]==="00"&&n[1].slice(-2)=="pm"&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),r.validateTimeFormatInput(t)?(this.err="",this.formError.emit({key:this.el.id,message:""})):(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),this.timeChange.emit({key:this.el.id,value:t})}handleTimeAutocomplete(e){var n;const t=(n=e.target)==null?void 0:n.value;if(!r.validateTimeFormatInput(t)){this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"});return}if(t===""){const i=r.roundToNearest15Minutes().format("hh:mma");this.timeChange.emit({key:this.el.id,value:i});return}if(!r.validateExactTimeFormat(t)){const i=r.autocompleteTimeFormat(t);this.timeChange.emit({key:this.el.id,value:i});return}this.timeChange.emit({key:this.el.id,value:t})}handleOnInput(e){var n;const t=(n=e.target)==null?void 0:n.value;if(r.validateTimeFormatInput(t)){if(t===""){const i=r.roundToNearest15Minutes().format("hh:mma"),a=this.times.findIndex(h=>h.value===i);a>-1&&this.scrollToViewWithinParent(a);return}if(!r.validateExactTimeFormat(t)){const i=r.autocompleteTimeFormat(t),a=this.times.findIndex(h=>h.value===i);a>-1&&this.scrollToViewWithinParent(a);return}}}generateTimes(){const e=[];let t=r.dayjs().set("hour",0).set("minute",0).set("second",0);this.minimumStartTime&&(t=r.dayjs(this.minimumStartTime,"hh:mma"));const n=t.endOf("day").diff(t,"minutes"),i=Math.round(n/15);for(let a=0;a<i+1;a++){const h=t.add(a*15,"minute");if(a==i&&h.format("hh:mma").includes("am"))break;e.push({id:a,value:h.format("hh:mma")})}return e}handleComboboxKeyDown(e){if(e.key==="ArrowDown"){if(e.preventDefault(),!this.showTimes){this.showTimes=!0,this.shouldAutoScroll=!0;return}if(this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[0].id.toString(),this.focusOption(0);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),n=t+1<this.times.length?t+1:0;this.ariaActivedescendant=this.times[n].id.toString(),this.focusOption(n)}}else if(e.key==="ArrowUp")if(e.preventDefault(),this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[this.times.length-1].id.toString(),this.focusOption(this.times.length-1);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),n=t-1>=0?t-1:this.times.length-1;this.ariaActivedescendant=this.times[n].id.toString(),this.focusOption(n)}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}handleListboxKeydown(e){const t=this.times,n=t.findIndex(i=>i.id.toString()===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){e.preventDefault();const i=n+1<t.length?n+1:0;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();const i=n-1>=0?n-1:t.length-1;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="Enter"){if(e.preventDefault(),this.ariaActivedescendant){const i=t[n];this.handleTimeChange(e,i.value),this.showTimes=!1,this.ariaActivedescendant="",this.timeInput.focus()}}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}scrollToViewWithinParent(e){var x;const t=this.times[e],n=(x=this.el.shadowRoot)==null?void 0:x.getElementById(t.id.toString()),i=this.timeMenu;this.ariaActivedescendant=t.id.toString();const a=n.getBoundingClientRect(),h=i.getBoundingClientRect();a.top<h.top?i.scrollTop-=h.top-a.top:a.bottom>h.bottom&&(i.scrollTop+=a.bottom-h.bottom),a.left<h.left?i.scrollLeft-=h.left-a.left:a.right>h.right&&(i.scrollLeft+=a.right-h.right)}focusOption(e){var a;const t=this.times[e];if(!t)return;const n=t.id.toString(),i=(a=this.el.shadowRoot)==null?void 0:a.getElementById(n);i&&(i.focus(),i.scrollIntoView({behavior:"smooth",block:"nearest"}))}render(){return r.h(r.Host,{key:"5f167a6a87b1335e3d9fb2d861f6470ec94f2763"},r.h("div",{key:"02318b5b9e50f32e0be5b401013a244e87d37f94",class:"time-picker",part:"time-picker"},r.h("input",{key:"7c5d9aa9be2aa761ccebacb0338b00d2bee52317",type:"text",name:this.name,id:this.name,part:"time-input",class:{"time-input":!0,error:!!this.err||this.hasError},ref:e=>this.timeInput=e,value:this.time,onClick:()=>{this.showTimes=!this.showTimes,this.shouldAutoScroll=!0},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.showTimes?"true":"false",placeholder:this.placeholder,onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e),onBlur:e=>this.handleTimeAutocomplete(e)}),this.err&&r.h("div",{class:"invalid-time-icon"}),this.showTimes&&r.h("div",{class:"times",part:"times",ref:e=>this.timeMenu=e},r.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.times.map(e=>r.h("li",{tabindex:"0",key:e.id,id:e.id.toString(),class:{focused:this.ariaActivedescendant===e.id.toString()},onClick:t=>{this.handleTimeChange(t,e.value),this.showTimes=!1,this.timeInput.focus()},role:"option"},`${e.value}`)))),!this.showTimes&&this.err&&r.h("p",{class:"error",id:"email-error"},this.err)))}get el(){return r.getElement(this)}static get watchers(){return{minimumStartTime:["minimumStartTimeChangedHandler"]}}};U.style=se;exports.nylas_time_window_picker=U;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-8a536089.cjs");require("react");require("react-dom");var _={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(r.commonjsGlobal,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d\d/,h=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,b={},Z=function(s){return(s=+s)+(s>68?1900:2e3)},d=function(s){return function(o){this[s]=+o}},B=[/[+-]\d\d:?(\d\d)?|Z/,function(s){(this.zone||(this.zone={})).offset=function(o){if(!o||o==="Z")return 0;var m=o.match(/([+-]|\d\d)/g),l=60*m[1]+(+m[2]||0);return l===0?0:m[0]==="+"?-l:l}(s)}],F=function(s){var o=b[s];return o&&(o.indexOf?o:o.s.concat(o.f))},V=function(s,o){var m,l=b.meridiem;if(l){for(var p=1;p<=24;p+=1)if(s.indexOf(l(p,0,o))>-1){m=p>12;break}}else m=s===(o?"pm":"PM");return m},q={A:[x,function(s){this.afternoon=V(s,!1)}],a:[x,function(s){this.afternoon=V(s,!0)}],S:[/\d/,function(s){this.milliseconds=100*+s}],SS:[a,function(s){this.milliseconds=10*+s}],SSS:[/\d{3}/,function(s){this.milliseconds=+s}],s:[h,d("seconds")],ss:[h,d("seconds")],m:[h,d("minutes")],mm:[h,d("minutes")],H:[h,d("hours")],h:[h,d("hours")],HH:[h,d("hours")],hh:[h,d("hours")],D:[h,d("day")],DD:[a,d("day")],Do:[x,function(s){var o=b.ordinal,m=s.match(/\d+/);if(this.day=m[0],o)for(var l=1;l<=31;l+=1)o(l).replace(/\[|\]/g,"")===s&&(this.day=l)}],M:[h,d("month")],MM:[a,d("month")],MMM:[x,function(s){var o=F("months"),m=(F("monthsShort")||o.map(function(l){return l.slice(0,3)})).indexOf(s)+1;if(m<1)throw new Error;this.month=m%12||m}],MMMM:[x,function(s){var o=F("months").indexOf(s)+1;if(o<1)throw new Error;this.month=o%12||o}],Y:[/[+-]?\d+/,d("year")],YY:[a,function(s){this.year=Z(s)}],YYYY:[/\d{4}/,d("year")],Z:B,ZZ:B};function N(s){var o,m;o=s,m=b&&b.formats;for(var l=(s=o.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,T,f){var c=f&&f.toUpperCase();return T||m[f]||n[f]||m[c].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(w,k,M){return k||M.slice(1)})})).match(i),p=l.length,y=0;y<p;y+=1){var C=l[y],I=q[C],v=I&&I[0],g=I&&I[1];l[y]=g?{regex:v,parser:g}:C.replace(/^\[|\]$/g,"")}return function(S){for(var T={},f=0,c=0;f<p;f+=1){var w=l[f];if(typeof w=="string")c+=w.length;else{var k=w.regex,M=w.parser,L=S.slice(c),A=k.exec(L)[0];M.call(T,A),S=S.replace(A,"")}}return function(D){var u=D.afternoon;if(u!==void 0){var Y=D.hours;u?Y<12&&(D.hours+=12):Y===12&&(D.hours=0),delete D.afternoon}}(T),T}}return function(s,o,m){m.p.customParseFormat=!0,s&&s.parseTwoDigitYear&&(Z=s.parseTwoDigitYear);var l=o.prototype,p=l.parse;l.parse=function(y){var C=y.date,I=y.utc,v=y.args;this.$u=I;var g=v[1];if(typeof g=="string"){var S=v[2]===!0,T=v[3]===!0,f=S||T,c=v[2];T&&(c=v[2]),b=this.$locale(),!S&&c&&(b=m.Ls[c]),this.$d=function(L,A,D){try{if(["x","X"].indexOf(A)>-1)return new Date((A==="X"?1e3:1)*L);var u=N(A)(L),Y=u.year,E=u.month,X=u.day,G=u.hours,J=u.minutes,Q=u.seconds,ee=u.milliseconds,W=u.zone,$=new Date,P=X||(Y||E?1:$.getDate()),z=Y||$.getFullYear(),O=0;Y&&!E||(O=E>0?E-1:$.getMonth());var j=G||0,H=J||0,K=Q||0,R=ee||0;return W?new Date(Date.UTC(z,O,P,j,H,K,R+60*W.offset*1e3)):D?new Date(Date.UTC(z,O,P,j,H,K,R)):new Date(z,O,P,j,H,K,R)}catch{return new Date("")}}(C,g,I),this.init(),c&&c!==!0&&(this.$L=this.locale(c).$L),f&&C!=this.format(g)&&(this.$d=new Date("")),b={}}else if(g instanceof Array)for(var w=g.length,k=1;k<=w;k+=1){v[1]=g[k-1];var M=m.apply(this,v);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}k===w&&(this.$d=new Date(""))}else p.call(this,y)}}})})(_);const te=_.exports,ie=':host{display:block;position:relative;--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}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}',se=ie;r.dayjs.extend(te);const U=class{constructor(e){r.registerInstance(this,e),this.timeChange=r.createEvent(this,"timeChange",7),this.formError=r.createEvent(this,"formError",7),this.time=void 0,this.minimumStartTime=null,this.placeholder="hh:mmam/pm",this.name=void 0,this.hasError=!1,this.err="",this.showTimes=!1,this.ariaActivedescendant="",this.times=this.generateTimes(),this.shouldAutoScroll=!1}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.showTimes&&(this.showTimes=!1)}minimumStartTimeChangedHandler(){if(this.minimumStartTime){let e=r.dayjs().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4,-2)));this.minimumStartTime.slice(-2).toLowerCase()==="pm"&&parseInt(this.minimumStartTime)!==12?e=e.add(12,"hour"):this.minimumStartTime.slice(-2).toLowerCase()==="am"&&parseInt(this.minimumStartTime)===12&&(e=e.subtract(12,"hour")),this.times=this.generateTimes();const t=r.dayjs(this.times[0].value,"hh:mma");r.dayjs(this.time,"hh:mma").isBefore(t)&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"}))}}componentDidRender(){if(this.showTimes&&this.shouldAutoScroll){const e=r.autocompleteTimeFormat(this.time),t=this.times.findIndex(n=>n.value===e);t>-1&&(this.shouldAutoScroll=!1,this.scrollToViewWithinParent(t));return}}handleTimeChange(e,t){const n=t.split(":");n[0]==="00"&&n[1].slice(-2)=="pm"&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),r.validateTimeFormatInput(t)?(this.err="",this.formError.emit({key:this.el.id,message:""})):(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),this.timeChange.emit({key:this.el.id,value:t})}handleTimeAutocomplete(e){var n;const t=(n=e.target)==null?void 0:n.value;if(!r.validateTimeFormatInput(t)){this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"});return}if(t===""){const i=r.roundToNearest15Minutes().format("hh:mma");this.timeChange.emit({key:this.el.id,value:i});return}if(!r.validateExactTimeFormat(t)){const i=r.autocompleteTimeFormat(t);this.timeChange.emit({key:this.el.id,value:i});return}this.timeChange.emit({key:this.el.id,value:t})}handleOnInput(e){var n;const t=(n=e.target)==null?void 0:n.value;if(r.validateTimeFormatInput(t)){if(t===""){const i=r.roundToNearest15Minutes().format("hh:mma"),a=this.times.findIndex(h=>h.value===i);a>-1&&this.scrollToViewWithinParent(a);return}if(!r.validateExactTimeFormat(t)){const i=r.autocompleteTimeFormat(t),a=this.times.findIndex(h=>h.value===i);a>-1&&this.scrollToViewWithinParent(a);return}}}generateTimes(){const e=[];let t=r.dayjs().set("hour",0).set("minute",0).set("second",0);this.minimumStartTime&&(t=r.dayjs(this.minimumStartTime,"hh:mma"));const n=t.endOf("day").diff(t,"minutes"),i=Math.round(n/15);for(let a=0;a<i+1;a++){const h=t.add(a*15,"minute");if(a==i&&h.format("hh:mma").includes("am"))break;e.push({id:a,value:h.format("hh:mma")})}return e}handleComboboxKeyDown(e){if(e.key==="ArrowDown"){if(e.preventDefault(),!this.showTimes){this.showTimes=!0,this.shouldAutoScroll=!0;return}if(this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[0].id.toString(),this.focusOption(0);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),n=t+1<this.times.length?t+1:0;this.ariaActivedescendant=this.times[n].id.toString(),this.focusOption(n)}}else if(e.key==="ArrowUp")if(e.preventDefault(),this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[this.times.length-1].id.toString(),this.focusOption(this.times.length-1);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),n=t-1>=0?t-1:this.times.length-1;this.ariaActivedescendant=this.times[n].id.toString(),this.focusOption(n)}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}handleListboxKeydown(e){const t=this.times,n=t.findIndex(i=>i.id.toString()===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){e.preventDefault();const i=n+1<t.length?n+1:0;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();const i=n-1>=0?n-1:t.length-1;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="Enter"){if(e.preventDefault(),this.ariaActivedescendant){const i=t[n];this.handleTimeChange(e,i.value),this.showTimes=!1,this.ariaActivedescendant="",this.timeInput.focus()}}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}scrollToViewWithinParent(e){var x;const t=this.times[e],n=(x=this.el.shadowRoot)==null?void 0:x.getElementById(t.id.toString()),i=this.timeMenu;this.ariaActivedescendant=t.id.toString();const a=n.getBoundingClientRect(),h=i.getBoundingClientRect();a.top<h.top?i.scrollTop-=h.top-a.top:a.bottom>h.bottom&&(i.scrollTop+=a.bottom-h.bottom),a.left<h.left?i.scrollLeft-=h.left-a.left:a.right>h.right&&(i.scrollLeft+=a.right-h.right)}focusOption(e){var a;const t=this.times[e];if(!t)return;const n=t.id.toString(),i=(a=this.el.shadowRoot)==null?void 0:a.getElementById(n);i&&(i.focus(),i.scrollIntoView({behavior:"smooth",block:"nearest"}))}render(){return r.h(r.Host,{key:"637409030b6d1ea098f8127c7d5630f3482b69ce"},r.h("div",{key:"fb6e5babfcc5cf82d98b57b7df0c7f4899e79cc7",class:"time-picker",part:"time-picker"},r.h("input",{key:"e0c6f13b0986fead684d222c2c194e605c1c72ab",type:"text",name:this.name,id:this.name,part:"time-input",class:{"time-input":!0,error:!!this.err||this.hasError},ref:e=>this.timeInput=e,value:this.time,onClick:()=>{this.showTimes=!this.showTimes,this.shouldAutoScroll=!0},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.showTimes?"true":"false",placeholder:this.placeholder,onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e),onBlur:e=>this.handleTimeAutocomplete(e)}),this.err&&r.h("div",{class:"invalid-time-icon"}),this.showTimes&&r.h("div",{class:"times",part:"times",ref:e=>this.timeMenu=e},r.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.times.map(e=>r.h("li",{tabindex:"0",key:e.id,id:e.id.toString(),class:{focused:this.ariaActivedescendant===e.id.toString()},onClick:t=>{this.handleTimeChange(t,e.value),this.showTimes=!1,this.timeInput.focus()},role:"option"},`${e.value}`)))),!this.showTimes&&this.err&&r.h("p",{class:"error",id:"email-error"},this.err)))}get el(){return r.getElement(this)}static get watchers(){return{minimumStartTime:["minimumStartTimeChangedHandler"]}}};U.style=se;exports.nylas_time_window_picker=U;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ae,
|
|
1
|
+
import { i as ae, V as C, r as oe, c as N, W, X as B, Y as G, Z as q, h as k, H as he, g as me } from "./index-a15916e5.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
var J = { exports: {} };
|
|
@@ -6,13 +6,13 @@ var J = { exports: {} };
|
|
|
6
6
|
(function(n, i) {
|
|
7
7
|
e.exports = i();
|
|
8
8
|
})(ae, function() {
|
|
9
|
-
var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, i = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, r = /\d\d/, o = /\d\d?/, v = /\d*[^-_:/,()\s\d]+/, x = {},
|
|
9
|
+
var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, i = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, r = /\d\d/, o = /\d\d?/, v = /\d*[^-_:/,()\s\d]+/, x = {}, _ = function(s) {
|
|
10
10
|
return (s = +s) + (s > 68 ? 1900 : 2e3);
|
|
11
11
|
}, l = function(s) {
|
|
12
12
|
return function(a) {
|
|
13
13
|
this[s] = +a;
|
|
14
14
|
};
|
|
15
|
-
},
|
|
15
|
+
}, U = [/[+-]\d\d:?(\d\d)?|Z/, function(s) {
|
|
16
16
|
(this.zone || (this.zone = {})).offset = function(a) {
|
|
17
17
|
if (!a || a === "Z")
|
|
18
18
|
return 0;
|
|
@@ -61,8 +61,8 @@ var J = { exports: {} };
|
|
|
61
61
|
throw new Error();
|
|
62
62
|
this.month = a % 12 || a;
|
|
63
63
|
}], Y: [/[+-]?\d+/, l("year")], YY: [r, function(s) {
|
|
64
|
-
this.year =
|
|
65
|
-
}], YYYY: [/\d{4}/, l("year")], Z:
|
|
64
|
+
this.year = _(s);
|
|
65
|
+
}], YYYY: [/\d{4}/, l("year")], Z: U, ZZ: U };
|
|
66
66
|
function ee(s) {
|
|
67
67
|
var a, h;
|
|
68
68
|
a = s, h = x && x.formats;
|
|
@@ -95,7 +95,7 @@ var J = { exports: {} };
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
return function(s, a, h) {
|
|
98
|
-
h.p.customParseFormat = !0, s && s.parseTwoDigitYear && (
|
|
98
|
+
h.p.customParseFormat = !0, s && s.parseTwoDigitYear && (_ = s.parseTwoDigitYear);
|
|
99
99
|
var m = a.prototype, f = m.parse;
|
|
100
100
|
m.parse = function(p) {
|
|
101
101
|
var L = p.date, I = p.utc, y = p.args;
|
|
@@ -109,8 +109,8 @@ var J = { exports: {} };
|
|
|
109
109
|
return new Date((A === "X" ? 1e3 : 1) * E);
|
|
110
110
|
var c = ee(A)(E), Y = c.year, O = c.month, te = c.day, ie = c.hours, se = c.minutes, ne = c.seconds, re = c.milliseconds, j = c.zone, z = /* @__PURE__ */ new Date(), F = te || (Y || O ? 1 : z.getDate()), H = Y || z.getFullYear(), $ = 0;
|
|
111
111
|
Y && !O || ($ = O > 0 ? O - 1 : z.getMonth());
|
|
112
|
-
var K = ie || 0,
|
|
113
|
-
return j ? new Date(Date.UTC(H, $, F, K, R, V
|
|
112
|
+
var K = ie || 0, Z = se || 0, R = ne || 0, V = re || 0;
|
|
113
|
+
return j ? new Date(Date.UTC(H, $, F, K, Z, R, V + 60 * j.offset * 1e3)) : M ? new Date(Date.UTC(H, $, F, K, Z, R, V)) : new Date(H, $, F, K, Z, R, V);
|
|
114
114
|
} catch {
|
|
115
115
|
return /* @__PURE__ */ new Date("");
|
|
116
116
|
}
|
|
@@ -153,7 +153,7 @@ const ue = class {
|
|
|
153
153
|
}
|
|
154
154
|
componentDidRender() {
|
|
155
155
|
if (this.showTimes && this.shouldAutoScroll) {
|
|
156
|
-
const e =
|
|
156
|
+
const e = W(this.time), t = this.times.findIndex((n) => n.value === e);
|
|
157
157
|
t > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(t));
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
@@ -193,7 +193,7 @@ const ue = class {
|
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
if (!q(t)) {
|
|
196
|
-
const i =
|
|
196
|
+
const i = W(t);
|
|
197
197
|
this.timeChange.emit({
|
|
198
198
|
key: this.el.id,
|
|
199
199
|
value: i
|
|
@@ -215,7 +215,7 @@ const ue = class {
|
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
217
|
if (!q(t)) {
|
|
218
|
-
const i =
|
|
218
|
+
const i = W(t), r = this.times.findIndex((o) => o.value === i);
|
|
219
219
|
r > -1 && this.scrollToViewWithinParent(r);
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
@@ -290,7 +290,7 @@ const ue = class {
|
|
|
290
290
|
i && (i.focus(), i.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
291
291
|
}
|
|
292
292
|
render() {
|
|
293
|
-
return k(he, { key: "
|
|
293
|
+
return k(he, { key: "637409030b6d1ea098f8127c7d5630f3482b69ce" }, k("div", { key: "fb6e5babfcc5cf82d98b57b7df0c7f4899e79cc7", class: "time-picker", part: "time-picker" }, k("input", { key: "e0c6f13b0986fead684d222c2c194e605c1c72ab", type: "text", name: this.name, id: this.name, part: "time-input", class: {
|
|
294
294
|
"time-input": !0,
|
|
295
295
|
error: !!this.err || this.hasError
|
|
296
296
|
}, ref: (e) => this.timeInput = e, value: this.time, onClick: () => {
|