@nylas/react 1.1.0-canary.14 → 1.1.0-canary.15
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-00dc2c13.cjs +1 -0
- package/dist/add-circle-icon_2.entry-3f834b47.js +26 -0
- package/dist/{archive-icon_7.entry-60311199.cjs → archive-icon_7.entry-25d8b2f0.cjs} +1 -1
- package/dist/{archive-icon_7.entry-0dfc9782.js → archive-icon_7.entry-ca8262ff.js} +15 -15
- package/dist/{arrow-icon.entry-eb53c4cb.cjs → arrow-icon.entry-01192ecf.cjs} +1 -1
- package/dist/{arrow-icon.entry-f38f3014.js → arrow-icon.entry-991ba7cd.js} +2 -2
- package/dist/{bold-icon_3.entry-20e74265.js → bold-icon_3.entry-81a3ff1e.js} +10 -10
- package/dist/{bold-icon_3.entry-d5100ffa.cjs → bold-icon_3.entry-e94dcf5b.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-e5d1bc0a.cjs → calendar-cancel-icon.entry-9088fa8b.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-0bdee178.js → calendar-cancel-icon.entry-f646c147.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-10af2017.cjs → calendar-check-icon_2.entry-4dc1391a.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-f18a2ddb.js → calendar-check-icon_2.entry-a7e4d0e6.js} +7 -7
- package/dist/{calendar-icon.entry-12ca0ae4.js → calendar-icon.entry-1658930c.js} +2 -2
- package/dist/{calendar-icon.entry-bc6f0808.cjs → calendar-icon.entry-1e2acd5c.cjs} +1 -1
- package/dist/{add-circle-icon_22.entry-ab0d5ede.js → calendar-info-icon_25.entry-493c5547.js} +966 -704
- package/dist/calendar-info-icon_25.entry-7513d798.cjs +1 -0
- package/dist/chevron-icon_3.entry-52b97043.cjs +1 -0
- package/dist/chevron-icon_3.entry-b3c7eb44.js +126 -0
- package/dist/{clock-icon_2.entry-ffc9e057.js → clock-icon_2.entry-58f07042.js} +3 -3
- package/dist/{clock-icon_2.entry-7cddf901.cjs → clock-icon_2.entry-882249ee.cjs} +1 -1
- package/dist/close-icon.entry-4a39816a.js +15 -0
- package/dist/close-icon.entry-f1166251.cjs +1 -0
- package/dist/{constants-f34b9c6e-108993e8.cjs → constants-f34b9c6e-1da5094b.cjs} +1 -1
- package/dist/{constants-f34b9c6e-37cabe82.js → constants-f34b9c6e-628beaa8.js} +1 -1
- package/dist/{document-refresh-icon.entry-d1f6259a.cjs → document-refresh-icon.entry-4f581bf4.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-e4636c8e.js → document-refresh-icon.entry-b53316b4.js} +2 -2
- package/dist/elements/index.d.ts +9 -0
- package/dist/{elements-dc5b338e-a37a0510.cjs → elements-dc5b338e-3284591d.cjs} +1 -1
- package/dist/{elements-dc5b338e-c6f2806c.js → elements-dc5b338e-7abe37c6.js} +1 -1
- package/dist/{focus-visible-e8093c16-b62197ad.cjs → focus-visible-e8093c16-cb6c97b1.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-b0821d89.js → focus-visible-e8093c16-d6612604.js} +1 -1
- package/dist/{forward-icon_6.entry-2a694e7c.js → forward-icon_6.entry-d54244f7.js} +9 -9
- package/dist/{forward-icon_6.entry-b81b22f6.cjs → forward-icon_6.entry-e402ad1e.cjs} +2 -2
- package/dist/{globe-icon.entry-c037589b.cjs → globe-icon.entry-db7377d9.cjs} +1 -1
- package/dist/{globe-icon.entry-e794eb52.js → globe-icon.entry-e83c79c2.js} +4 -4
- package/dist/google-logo-icon_4.entry-8818686b.js +429 -0
- package/dist/google-logo-icon_4.entry-fa65ae29.cjs +1 -0
- package/dist/{index-d61429c6.js → index-2d032bec.js} +1288 -1265
- package/dist/index-53420959-41ed02ae.js +5 -0
- package/dist/index-53420959-a76f0327.cjs +1 -0
- package/dist/{index-ef01c714-1e2feefc.js → index-6d9eeb53-91d36348.js} +2 -2
- package/dist/{index-ef01c714-54e17405.cjs → index-6d9eeb53-f478270c.cjs} +1 -1
- package/dist/index-9c04361d.cjs +42 -0
- package/dist/{index.es-74f70f7d-a22eba35.cjs → index.es-9cc0eb3c-2242baf6.cjs} +1 -1
- package/dist/{index.es-74f70f7d-da0e7fcf.js → index.es-9cc0eb3c-ee2ebbe1.js} +1 -1
- package/dist/{info-icon_2.entry-23e3fa8a.cjs → info-icon_2.entry-4b257e73.cjs} +1 -1
- package/dist/{info-icon_2.entry-647915bb.js → info-icon_2.entry-74eb7415.js} +5 -5
- package/dist/input-component.entry-3ef7ce2c.cjs +1 -0
- package/dist/input-component.entry-6bb4a5e8.js +45 -0
- package/dist/input-dropdown_2.entry-a87714fc.cjs +1 -0
- package/dist/input-dropdown_2.entry-f71e4c01.js +209 -0
- package/dist/{loading-icon.entry-1ddd0244.js → loading-icon.entry-30724cb0.js} +2 -2
- package/dist/{loading-icon.entry-98d65a5d.cjs → loading-icon.entry-bb250f1c.cjs} +1 -1
- package/dist/{mailbox-store-050a2914-6fef25fb.js → mailbox-store-64b4ef7c-202f1afd.js} +2 -2
- package/dist/{mailbox-store-050a2914-bd0a86bb.cjs → mailbox-store-64b4ef7c-74f959be.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-3c598863.cjs → nylas-additional-participants.entry-567c7c2a.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-0f93e24e.js → nylas-additional-participants.entry-7961be04.js} +5 -5
- package/dist/nylas-booked-event-card_10.entry-c2f889ba.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-9f7869af.js → nylas-booked-event-card_10.entry-ddfcff5e.js} +371 -299
- package/dist/{nylas-custom-booking-flow.entry-877cac85.cjs → nylas-custom-booking-flow.entry-63ed387e.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-69638c50.js → nylas-custom-booking-flow.entry-a1f66d05.js} +10 -10
- package/dist/{nylas-form-card.entry-4349d07d.cjs → nylas-form-card.entry-6fece0ff.cjs} +1 -1
- package/dist/{nylas-form-card.entry-b2da5266.js → nylas-form-card.entry-ea1153b9.js} +11 -11
- package/dist/{nylas-if-state.entry-62474acb.js → nylas-if-state.entry-05f8f66f.js} +3 -3
- package/dist/{nylas-if-state.entry-9eade180.cjs → nylas-if-state.entry-b75320f0.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-348a784b.js → nylas-list-folders.entry-bd5a1b1d.js} +7 -7
- package/dist/{nylas-list-folders.entry-b32ec92a.cjs → nylas-list-folders.entry-edc61b97.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-7e8044b2.cjs → nylas-list-threads.entry-79ad0944.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-ec1c5fb6.js → nylas-list-threads.entry-f3cd80de.js} +3 -3
- package/dist/{nylas-login.entry-0495d0b5.cjs → nylas-login.entry-68873357.cjs} +1 -1
- package/dist/{nylas-login.entry-f6f1e306.js → nylas-login.entry-b3207e82.js} +7 -7
- package/dist/{nylas-mailbox-pagination.entry-24c82c53.js → nylas-mailbox-pagination.entry-22c5b9ca.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-22385ead.cjs → nylas-mailbox-pagination.entry-2ef5b88a.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-b13b2a58.js → nylas-mailbox-toolbar-button.entry-95bb58b5.js} +9 -9
- package/dist/{nylas-mailbox-toolbar-button.entry-e8e52474.cjs → nylas-mailbox-toolbar-button.entry-f2fa3a8e.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-77f4c37e.cjs → nylas-mailbox.entry-4b1d320f.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-0365fbb0.js → nylas-mailbox.entry-4ef7d18d.js} +6 -6
- package/dist/{nylas-provider.entry-11239372.js → nylas-provider.entry-7f7e098a.js} +6 -6
- package/dist/{nylas-provider.entry-d454a4d1.cjs → nylas-provider.entry-b629340a.cjs} +1 -1
- package/dist/{nylas-scheduler-editor.entry-16473950.cjs → nylas-scheduler-editor.entry-19a29c4c.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-c4d38853.js → nylas-scheduler-editor.entry-2d19593f.js} +13 -7
- package/dist/nylas-scheduling.entry-70454242.cjs +1 -0
- package/dist/{nylas-scheduling.entry-cc2535a9.js → nylas-scheduling.entry-753cb746.js} +61 -61
- package/dist/{nylas-threads-refresh.entry-725ef87d.cjs → nylas-threads-refresh.entry-0a832631.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-5a6378fe.js → nylas-threads-refresh.entry-5a774ad7.js} +4 -4
- package/dist/{nylas-threads-search.entry-5e7b6a03.js → nylas-threads-search.entry-451c6d5c.js} +9 -9
- package/dist/nylas-threads-search.entry-5b57688b.cjs +1 -0
- package/dist/{nylas-view-thread.entry-98f8e35b.cjs → nylas-view-thread.entry-7b273955.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-249f0b65.js → nylas-view-thread.entry-e0af8998.js} +3 -3
- package/dist/{people-icon.entry-0ab4b752.cjs → people-icon.entry-c7fb7f6c.cjs} +1 -1
- package/dist/{people-icon.entry-0ed95db0.js → people-icon.entry-de3fada0.js} +6 -6
- package/dist/{play-icon_2.entry-433a8722.js → play-icon_2.entry-58592b64.js} +5 -5
- package/dist/play-icon_2.entry-5b22a7ca.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +98 -89
- package/dist/{refresh-icon.entry-508a246d.cjs → refresh-icon.entry-876b8aea.cjs} +1 -1
- package/dist/{refresh-icon.entry-b5bee0f4.js → refresh-icon.entry-90756bc6.js} +4 -4
- package/dist/{register-component-e4dc8778-7812a275.cjs → register-component-a5a9ca5d-1fbb27d2.cjs} +1 -1
- package/dist/{register-component-e4dc8778-53fe0729.js → register-component-a5a9ca5d-8bede801.js} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-435c84ca.cjs → scheduler-config-store-ec3b6190-104df545.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-01892765.js → scheduler-config-store-ec3b6190-cbc40d60.js} +1 -1
- package/dist/scheduler-store-f02ce045-1d93c571.js +390 -0
- package/dist/scheduler-store-f02ce045-712c600c.cjs +1 -0
- package/dist/textarea-component.entry-3ea161d6.js +35 -0
- package/dist/textarea-component.entry-9d6b5cdc.cjs +1 -0
- package/dist/toggle-switch.entry-10aa0c1a.cjs +1 -0
- package/dist/toggle-switch.entry-a08c1027.js +25 -0
- package/dist/{translate-icon.entry-f77cfd3d.cjs → translate-icon.entry-04dde6b1.cjs} +1 -1
- package/dist/{translate-icon.entry-c34bad94.js → translate-icon.entry-be9c3401.js} +6 -6
- package/dist/{warning-icon.entry-f781a623.js → warning-icon.entry-347d77af.js} +5 -5
- package/dist/{warning-icon.entry-f73b31bf.cjs → warning-icon.entry-84121a43.cjs} +1 -1
- package/package.json +3 -3
- package/dist/add-circle-icon_22.entry-c165f0de.cjs +0 -1
- package/dist/chevron-icon_3.entry-55eb864f.js +0 -117
- package/dist/chevron-icon_3.entry-a18c373d.cjs +0 -1
- package/dist/close-icon.entry-7c67181c.js +0 -15
- package/dist/close-icon.entry-918dd254.cjs +0 -1
- package/dist/google-logo-icon_4.entry-748af8c3.cjs +0 -1
- package/dist/google-logo-icon_4.entry-b4464873.js +0 -393
- package/dist/index-53420959-31867ccf.js +0 -5
- package/dist/index-53420959-535906ce.cjs +0 -1
- package/dist/index-6a4ee4f8.cjs +0 -42
- package/dist/nylas-booked-event-card_10.entry-912e4a89.cjs +0 -1
- package/dist/nylas-scheduling.entry-5b156a28.cjs +0 -1
- package/dist/nylas-threads-search.entry-a2553cbe.cjs +0 -1
- package/dist/play-icon_2.entry-f9c0b647.cjs +0 -1
- package/dist/scheduler-store-04e15f8a-5d06eaf3.cjs +0 -1
- package/dist/scheduler-store-04e15f8a-69eb8d7a.js +0 -376
- package/dist/time-period-selector.entry-77a6debf.cjs +0 -1
- package/dist/time-period-selector.entry-a29c8ffa.js +0 -76
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { R as
|
|
3
|
-
import { T as
|
|
4
|
-
import { s as
|
|
5
|
-
import "./index-53420959-
|
|
1
|
+
import { r as m, c as d, d as c, h as a, H as h, g as ae, l as V, z as ne, A as ie, C as u, D as oe, E as S, F as se } from "./index-2d032bec.js";
|
|
2
|
+
import { R as y } from "./register-component-a5a9ca5d-8bede801.js";
|
|
3
|
+
import { T as _, g as re, L as q } from "./constants-f34b9c6e-628beaa8.js";
|
|
4
|
+
import { s as z } from "./index-6d9eeb53-91d36348.js";
|
|
5
|
+
import "./index-53420959-41ed02ae.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
const
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
const le = ':host{display:block;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', ce = le;
|
|
9
|
+
var de = function(e, t, n, s) {
|
|
10
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, r;
|
|
11
11
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
12
|
-
|
|
12
|
+
i = Reflect.decorate(e, t, n, s);
|
|
13
13
|
else
|
|
14
14
|
for (var l = e.length - 1; l >= 0; l--)
|
|
15
|
-
(
|
|
16
|
-
return
|
|
17
|
-
},
|
|
15
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
16
|
+
return o > 3 && i && Object.defineProperty(t, n, i), i;
|
|
17
|
+
}, B = function(e, t) {
|
|
18
18
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
19
19
|
return Reflect.metadata(e, t);
|
|
20
20
|
};
|
|
21
|
-
const
|
|
21
|
+
const W = class {
|
|
22
22
|
constructor(e) {
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
const t =
|
|
26
|
-
t.getTime() < s
|
|
23
|
+
m(this, e), this.cancelBookingButtonClicked = d(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = d(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = d(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = d(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
24
|
+
var o;
|
|
25
|
+
const t = new Date(this.selectedTimeslot.start_time), n = (o = this.configSettings) == null ? void 0 : o.scheduler.min_cancellation_notice, s = t.getTime() - n * 60 * 1e3;
|
|
26
|
+
t.getTime() < s ? this.cancelBookedEventValidationError.emit({
|
|
27
27
|
error: {
|
|
28
28
|
title: "Cancellation Error",
|
|
29
|
-
message: `You cannot cancel the booking within ${
|
|
29
|
+
message: `You cannot cancel the booking within ${n} minutes of the event.`
|
|
30
30
|
}
|
|
31
31
|
}) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
32
32
|
}, this.handleRescheduleButtonClicked = () => {
|
|
33
|
-
const t = (
|
|
34
|
-
this.rescheduleBookedEventError.emit(
|
|
33
|
+
const t = (n) => {
|
|
34
|
+
this.rescheduleBookedEventError.emit(n);
|
|
35
35
|
};
|
|
36
36
|
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
|
|
37
37
|
}, this.getOrganizer = (t) => t == null ? void 0 : t.organizer, this.getPaticipantType = (t) => {
|
|
@@ -56,12 +56,16 @@ const H = class {
|
|
|
56
56
|
c("[nylas-booked-event-card] Component did load"), this.eventInfo || console.warn('[nylas-booked-event-card] "eventInfo" prop missing. Please provide the event info to display the event details in the booked event card component.'), this.bookingInfo || console.warn('[nylas-booked-event-card] "bookingInfo" prop missing. Please provide the booking info to display the guest details in the booked event card component.');
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
var e, t,
|
|
60
|
-
return a(
|
|
59
|
+
var e, t, n, s, o, i, r, l, b, f, v, k, x, C, g, p, w, $, A, Z, G;
|
|
60
|
+
return a(h, { key: "25f461e554d352c8b62341f77c84d61521a40472", part: "nbec" }, a("sp-theme", { key: "fa7ae9d97b3c334d71a64076bd6c5787b48b124b", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "731d9d89bfc2f63b8a1095ea671f39d1a99dc4a4", class: "booked-event-timezone" }, a("globe-icon", { key: "e7a7d73d7c9461f34145ddf3e99bf5640b39ab56" }), _[this.selectedTimezone]), a("div", { key: "dbb07cac45a1528a2633119af6050a630f8df173", class: "event-card-wrapper", part: "nbec__card" }, a("div", { key: "79b6b636707f8e867358da1b4340e6f0bfeb386e", class: "calendar-icon" }, a("calendar-check-icon", { key: "a268b01ecbf64976dc61c9e3c66a67cade9d2227" })), a("div", { key: "52c4c97407582b05bfb87e1379930f7cf149c013", class: "booked-event-header" }, a("h2", { key: "ed4631c601b4920b20c27d158063dcbef92084d4", slot: "card-title", part: "nbec__title" }, "Booking ", this.rescheduleBookingId ? "rescheduled" : "confirmed", "!"), a("div", { key: "f5e93f73c4828764cb7e27cc3d5ab2b761e66fdc", part: "nbec__description" }, ((e = this.getOrganizer(this.eventInfo)) == null ? void 0 : e.name) || ((t = this.getOrganizer(this.eventInfo)) == null ? void 0 : t.email), " & ", ((s = (n = this.bookingInfo) == null ? void 0 : n.primaryParticipant) == null ? void 0 : s.name) || ((i = (o = this.bookingInfo) == null ? void 0 : o.primaryParticipant) == null ? void 0 : i.email))), a("sp-divider", { key: "d9f14eeb24c4935f131edebb3102ffd69d2bde43" }), a("div", { key: "57f6f7877162eb8de8898d6523dac452b3c841e9", class: "booking-date-time" }, a("checkmark-circle-icon", { key: "5bd672ae7c70b0102d6a14e2761b8ecc222ce488" }), a("h3", { key: "5e8ca582a26a51f790ca111648381a10f8ef917c" }, "Booking date and time"), a("p", { key: "0b98f73c94add678003f63cd1e59352f7acd29b3" }, new Date((r = this.selectedTimeslot) == null ? void 0 : r.start_time).toLocaleDateString(void 0, { dateStyle: "full" }), " ", a("br", { key: "cc2a50917760651ca2e015fa22f264740b545a58" }), new Date((l = this.selectedTimeslot) == null ? void 0 : l.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date((b = this.selectedTimeslot) == null ? void 0 : b.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), a("div", { key: "5ccf1dbc6002c9eaf60b3bd9211e590ab9135d68", class: "booking-participants" }), a("sp-divider", { key: "7ff9b9f4fa4bfc19da47d358ddda325b13b1a465" }), a("div", { key: "2c3d69854b255864cca3782a9ad87175a18d8cf9", class: {
|
|
61
|
+
footer: !0,
|
|
62
|
+
"no-footer": ((v = (f = this.configSettings) == null ? void 0 : f.scheduler) == null ? void 0 : v.hide_cancellation_options) && ((x = (k = this.configSettings) == null ? void 0 : k.scheduler) == null ? void 0 : x.hide_rescheduling_options),
|
|
63
|
+
"no-template-cols": ((g = (C = this.configSettings) == null ? void 0 : C.scheduler) == null ? void 0 : g.hide_cancellation_options) || ((w = (p = this.configSettings) == null ? void 0 : p.scheduler) == null ? void 0 : w.hide_rescheduling_options)
|
|
64
|
+
} }, !((A = ($ = this.configSettings) == null ? void 0 : $.scheduler) != null && A.hide_cancellation_options) && a("sp-button", { variant: "secondary", treatment: "outline", class: "cancel", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, "Cancel booking"), !((G = (Z = this.configSettings) == null ? void 0 : Z.scheduler) != null && G.hide_rescheduling_options) && a("sp-button", { variant: "secondary", treatment: "outline", class: "reschedule", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, "Reschedule")))));
|
|
61
65
|
}
|
|
62
66
|
};
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
de([
|
|
68
|
+
y({
|
|
65
69
|
name: "nylas-booked-event-card",
|
|
66
70
|
stateToProps: /* @__PURE__ */ new Map([
|
|
67
71
|
["scheduler.bookingInfo", "bookingInfo"],
|
|
@@ -75,144 +79,188 @@ se([
|
|
|
75
79
|
t.scheduler.setCancel(e.detail.bookingId);
|
|
76
80
|
},
|
|
77
81
|
rescheduleButtonClicked: async (e, t) => {
|
|
78
|
-
const
|
|
79
|
-
s && (!
|
|
82
|
+
const n = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: s } = e.detail;
|
|
83
|
+
s && (!n || "error" in n) && s(n);
|
|
80
84
|
}
|
|
81
85
|
},
|
|
82
86
|
fireRegisterEvent: !0
|
|
83
87
|
}),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
],
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
var
|
|
91
|
-
var
|
|
88
|
+
B("design:type", Function),
|
|
89
|
+
B("design:paramtypes", []),
|
|
90
|
+
B("design:returntype", void 0)
|
|
91
|
+
], W.prototype, "render", null);
|
|
92
|
+
W.style = ce;
|
|
93
|
+
const be = ':host{display:block;height:100%;--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}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}.guest-email-input{position:relative;display:flex;width:100%}', fe = be;
|
|
94
|
+
var he = function(e, t, n, s) {
|
|
95
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, r;
|
|
92
96
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
93
|
-
|
|
97
|
+
i = Reflect.decorate(e, t, n, s);
|
|
94
98
|
else
|
|
95
99
|
for (var l = e.length - 1; l >= 0; l--)
|
|
96
|
-
(
|
|
97
|
-
return
|
|
98
|
-
},
|
|
100
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
101
|
+
return o > 3 && i && Object.defineProperty(t, n, i), i;
|
|
102
|
+
}, L = function(e, t) {
|
|
99
103
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
100
104
|
return Reflect.metadata(e, t);
|
|
101
105
|
};
|
|
102
|
-
const
|
|
106
|
+
const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, U = class {
|
|
103
107
|
constructor(e) {
|
|
104
|
-
|
|
108
|
+
m(this, e), this.nameChanged = d(this, "nameChanged", 7), this.emailChanged = d(this, "emailChanged", 7), this.backButtonClicked = d(this, "backButtonClicked", 7), this.detailsConfirmed = d(this, "detailsConfirmed", 7), this.bookingFormError = d(this, "bookingFormError", 7), this.bookingFormSubmitted = d(this, "bookingFormSubmitted", 7), this.handleGuestChange = (t, n) => {
|
|
105
109
|
this.resetGuestEmailError(t);
|
|
106
110
|
const s = [...this.guestEmails];
|
|
107
|
-
s[t] =
|
|
108
|
-
}, this.handleGuestBlur = (t,
|
|
109
|
-
if (this.resetGuestEmailError(t),
|
|
111
|
+
s[t] = z(n), this.guestEmails = [...s];
|
|
112
|
+
}, this.handleGuestBlur = (t, n) => {
|
|
113
|
+
if (this.resetGuestEmailError(t), n === "") {
|
|
110
114
|
this.guestEmailErrors[t] = "Email is required";
|
|
111
115
|
return;
|
|
112
116
|
}
|
|
113
|
-
if (!
|
|
117
|
+
if (!E.test(n)) {
|
|
114
118
|
this.guestEmailErrors[t] = "Enter a valid email address";
|
|
115
119
|
return;
|
|
116
120
|
}
|
|
117
|
-
this.handleGuestChange(t,
|
|
118
|
-
}, this.addGuestButtonClickedHandler = () => {
|
|
119
|
-
this.guestEmails = [...this.guestEmails, ""];
|
|
120
|
-
}, this.removeGuestButtonClickHandler = (t,
|
|
121
|
-
t.preventDefault(), this.resetGuestEmailError(
|
|
121
|
+
this.handleGuestChange(t, n);
|
|
122
|
+
}, this.addGuestButtonClickedHandler = (t) => {
|
|
123
|
+
t.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
|
|
124
|
+
}, this.removeGuestButtonClickHandler = (t, n) => {
|
|
125
|
+
t.preventDefault(), this.resetGuestEmailError(n);
|
|
122
126
|
const s = [...this.guestEmails];
|
|
123
|
-
s.splice(
|
|
127
|
+
s.splice(n, 1), this.guestEmails = [...s];
|
|
124
128
|
}, this.handleBackButtonClicked = () => {
|
|
125
129
|
this.backButtonClicked.emit();
|
|
126
130
|
}, this.bookButtonClickedHandler = async (t) => {
|
|
127
|
-
var
|
|
128
|
-
t.preventDefault(),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
var l, b, f, v, k, x, C;
|
|
132
|
+
if (t.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
|
|
133
|
+
return;
|
|
134
|
+
c("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
135
|
+
const s = this.name || ((b = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : b.name), o = this.email || ((v = (f = this.bookingInfo) == null ? void 0 : f.primaryParticipant) == null ? void 0 : v.email);
|
|
136
|
+
if (!s || s === "") {
|
|
131
137
|
this.isNameValid = !1, this.validationError.name = "Name is required", this.bookingFormError.emit({
|
|
132
138
|
title: "Booking form error",
|
|
133
139
|
description: "Name is required"
|
|
134
140
|
});
|
|
135
141
|
return;
|
|
136
142
|
}
|
|
137
|
-
if (!
|
|
143
|
+
if (!o || o === "") {
|
|
138
144
|
this.isEmailValid = !1, this.validationError.email = "Email is required", this.bookingFormError.emit({
|
|
139
145
|
title: "Booking form error",
|
|
140
146
|
description: "Email is required"
|
|
141
147
|
});
|
|
142
148
|
return;
|
|
143
149
|
}
|
|
144
|
-
if (!
|
|
150
|
+
if (!E.test(o)) {
|
|
145
151
|
this.isEmailValid = !1, this.validationError.email = "Enter a valid email address", this.bookingFormError.emit({
|
|
146
152
|
title: "Booking form error",
|
|
147
153
|
description: "Invalid email"
|
|
148
154
|
});
|
|
149
155
|
return;
|
|
150
156
|
}
|
|
151
|
-
let
|
|
157
|
+
let i = [];
|
|
152
158
|
if (this.guestEmails.length > 0) {
|
|
153
|
-
let
|
|
154
|
-
if (this.guestEmails.forEach((
|
|
155
|
-
|
|
156
|
-
}),
|
|
159
|
+
let g = !1;
|
|
160
|
+
if (this.guestEmails.forEach((p, w) => {
|
|
161
|
+
p === "" ? (g = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [w]: "Email is required" }) : E.test(p) || (g = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [w]: "Enter a valid email address" });
|
|
162
|
+
}), g) {
|
|
157
163
|
this.bookingFormError.emit({
|
|
158
164
|
title: "Booking form error",
|
|
159
165
|
description: "Invalid guest email"
|
|
160
166
|
});
|
|
161
167
|
return;
|
|
162
168
|
}
|
|
163
|
-
|
|
169
|
+
i = this.guestEmails.map((p) => ({ name: p.trim(), email: p.trim() }));
|
|
164
170
|
} else
|
|
165
|
-
(
|
|
171
|
+
(k = this.bookingInfo) != null && k.guests && (i = (x = this.bookingInfo) == null ? void 0 : x.guests);
|
|
172
|
+
const r = ((C = this.bookingInfo) == null ? void 0 : C.additionalFields) || [];
|
|
166
173
|
this.detailsConfirmed.emit({
|
|
167
174
|
primaryParticipant: {
|
|
168
|
-
name:
|
|
169
|
-
email:
|
|
175
|
+
name: s,
|
|
176
|
+
email: o
|
|
170
177
|
},
|
|
171
|
-
guests:
|
|
172
|
-
additionalFields:
|
|
173
|
-
...(M = this.bookingInfo) == null ? void 0 : M.additionalFields
|
|
174
|
-
}
|
|
178
|
+
guests: i,
|
|
179
|
+
additionalFields: [...r, ...this.additionalFields]
|
|
175
180
|
});
|
|
176
|
-
}, this.
|
|
181
|
+
}, this.updateAdditionalFields = (t, n, s) => {
|
|
182
|
+
const o = this.additionalFields.findIndex((i) => i.name === t);
|
|
183
|
+
o > -1 ? this.additionalFields[o].value = n : this.additionalFields.push({ name: t, value: n, type: s || "text" });
|
|
184
|
+
}, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = [], this.validationError = { name: "", email: "" };
|
|
177
185
|
}
|
|
178
186
|
connectedCallback() {
|
|
179
187
|
}
|
|
180
188
|
disconnectedCallback() {
|
|
181
189
|
}
|
|
182
190
|
componentWillLoad() {
|
|
183
|
-
var e, t;
|
|
184
|
-
c("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && (this.name = (
|
|
191
|
+
var e, t, n;
|
|
192
|
+
c("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && ((e = this.bookingInfo) != null && e.primaryParticipant) && (this.name = (t = this.bookingInfo.primaryParticipant) == null ? void 0 : t.name, this.email = (n = this.bookingInfo.primaryParticipant) == null ? void 0 : n.email);
|
|
185
193
|
}
|
|
186
194
|
bookingInfoChangedHandler(e) {
|
|
187
195
|
e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
|
|
188
196
|
}
|
|
189
197
|
changeName(e) {
|
|
190
|
-
this.isNameValid = !0, this.validationError.name = "", this.name =
|
|
198
|
+
this.isNameValid = !0, this.validationError.name = "", this.name = z(e), this.nameChanged.emit(e);
|
|
191
199
|
}
|
|
192
200
|
changeEmail(e) {
|
|
193
|
-
this.isEmailValid = !0, this.validationError.email = "", this.email =
|
|
201
|
+
this.isEmailValid = !0, this.validationError.email = "", this.email = z(e), this.emailChanged.emit(e);
|
|
194
202
|
}
|
|
195
203
|
resetGuestEmailError(e) {
|
|
196
204
|
const t = { ...this.guestEmailErrors };
|
|
197
205
|
delete t[e], this.guestEmailErrors = { ...t };
|
|
198
206
|
}
|
|
207
|
+
nylasFormInputChangedHandler(e) {
|
|
208
|
+
switch (e.detail.name) {
|
|
209
|
+
case "name":
|
|
210
|
+
this.changeName(e.detail.value);
|
|
211
|
+
break;
|
|
212
|
+
case "email":
|
|
213
|
+
this.changeEmail(e.detail.value);
|
|
214
|
+
break;
|
|
215
|
+
default:
|
|
216
|
+
if (e.detail.error) {
|
|
217
|
+
this.bookingFormError.emit({
|
|
218
|
+
title: "Booking form error",
|
|
219
|
+
description: e.detail.error
|
|
220
|
+
});
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
this.updateAdditionalFields(e.detail.label, e.detail.value, e.detail.type);
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
e.detail.name === "name" ? this.changeName(e.detail.value) : e.detail.name === "email" && this.changeEmail(e.detail.value);
|
|
227
|
+
}
|
|
228
|
+
selectOptionChangedHandler(e) {
|
|
229
|
+
if (e.detail.error) {
|
|
230
|
+
this.bookingFormError.emit({
|
|
231
|
+
title: "Booking form error",
|
|
232
|
+
description: e.detail.error
|
|
233
|
+
});
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
this.updateAdditionalFields(e.detail.label, e.detail.value, "dropdown");
|
|
237
|
+
}
|
|
238
|
+
switchToggledHandler(e) {
|
|
239
|
+
this.updateAdditionalFields(e.detail.label, e.detail.checked ? "true" : "false", "checkbox");
|
|
240
|
+
}
|
|
241
|
+
checkboxToggledHandler(e) {
|
|
242
|
+
this.updateAdditionalFields(e.detail.label, e.detail.checked ? "true" : "false", "checkbox");
|
|
243
|
+
}
|
|
199
244
|
render() {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
error:
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
var
|
|
211
|
-
return this.
|
|
212
|
-
} }), a("
|
|
245
|
+
var e, t, n, s, o, i;
|
|
246
|
+
return a(h, { key: "5a4ca2feb2f89ada6abada8dd3f6dc4909cb3500" }, a("form", { key: "1df9fb2f5a519f4e3ed189f9a11623caa86f3dee", onSubmit: (r) => this.bookButtonClickedHandler(r), noValidate: !0 }, a("div", { key: "86a4548532291a4aec3f004eeeb6edde6064248b", class: "nylas-booking-form" }, a("div", { key: "7749795a2086658ef53cbe1e6dfa073b29b8b880", class: "input-wrapper" }, a("input-component", { key: "b2fd6473fa91b144cb2a23d1db9059f7aafce20b", label: "Name", name: "name", id: "name", defaultValue: ((t = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : t.name) || this.name, placeholder: "Enter your name", type: "text", required: !0, part: "nbf__input-textfield" })), a("div", { key: "cf6fca8e8ced455047b555905e5b21ad7307505d", class: "input-wrapper" }, a("input-component", { key: "0a5639811623911f7ed59fa12bd45ceb76ae0373", label: "Email", name: "email", id: "email", pattern: E, defaultValue: ((s = (n = this.bookingInfo) == null ? void 0 : n.primaryParticipant) == null ? void 0 : s.email) || this.email, placeholder: "Enter your email", type: "email", required: !0, part: "nbf__input-textfield" })), ((i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.additional_guests_hidden) !== !0 && a("div", { class: "input-wrapper" }, this.guestEmails.map((r, l) => a("div", { class: "input-wrapper button-wrapper" }, a("label", { class: {
|
|
247
|
+
error: !!this.guestEmailErrors[l]
|
|
248
|
+
} }, "Guest email"), a("div", { class: "guest-email-input" }, a("input", { type: "email", id: `guest-email-${l}`, maxLength: 100, class: {
|
|
249
|
+
"guest-email": !0,
|
|
250
|
+
error: !!this.guestEmailErrors[l]
|
|
251
|
+
}, placeholder: "Enter guest email", value: r, "data-index": l, part: "nbf__input-textfield", onBlur: (b) => {
|
|
252
|
+
var f;
|
|
253
|
+
return this.handleGuestBlur(l, (f = b.target) == null ? void 0 : f.value);
|
|
254
|
+
}, onInput: (b) => {
|
|
255
|
+
var f;
|
|
256
|
+
return this.handleGuestChange(l, (f = b.target) == null ? void 0 : f.value);
|
|
257
|
+
} }), a("button-component", { variant: "basic", onClick: (b) => this.removeGuestButtonClickHandler(b, l), class: {
|
|
258
|
+
"remove-guest": !0,
|
|
259
|
+
error: !!this.guestEmailErrors[l]
|
|
260
|
+
} }, a("close-icon", null))), a("p", { class: "help-text" }, this.guestEmailErrors[l]))), a("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (r) => this.addGuestButtonClickedHandler(r) }, a("div", { class: "button-content" }, a("add-circle-icon", { slot: "icon" }), "Add ", this.guestEmails.length > 0 ? "another " : "", "guest"))), a("slot", { key: "d803e320680a184cf9f88956312f202c353ad8ab", name: "custom-booking-form" })), a("div", { key: "133c6d4edc0cce58ad2c3b1c81f1f4db3af62867", class: "cta" }, a("sp-button", { key: "7c918d85c91574a13c5554f3e3cfea913860cb33", treatment: "outline", variant: "secondary", class: "back", part: "nbf__button-outline", onClick: this.handleBackButtonClicked }, a("slot", { key: "91e718bf54cb2a9bd6cf387da927888a73608be0", name: "booking-form-back-label" }, "Back")), a("sp-button", { key: "8ee30e206049de131bf443413e914027f9e48d3f", variant: "primary", class: "book", part: "nbf__button-primary", type: "submit" }, this.isLoading && a("loading-icon", { slot: "icon" }), a("slot", { key: "302f27c0705119d4c20d634c4d94c3569cc18c92", name: "booking-form-book-label" }, "Book now")))));
|
|
213
261
|
}
|
|
214
262
|
get host() {
|
|
215
|
-
return
|
|
263
|
+
return ae(this);
|
|
216
264
|
}
|
|
217
265
|
static get watchers() {
|
|
218
266
|
return {
|
|
@@ -220,13 +268,14 @@ const T = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
220
268
|
};
|
|
221
269
|
}
|
|
222
270
|
};
|
|
223
|
-
|
|
224
|
-
|
|
271
|
+
he([
|
|
272
|
+
y({
|
|
225
273
|
name: "nylas-booking-form",
|
|
226
274
|
stateToProps: /* @__PURE__ */ new Map([
|
|
227
275
|
["scheduler.isLoading", "isLoading"],
|
|
228
276
|
["scheduler.bookingInfo", "bookingInfo"],
|
|
229
|
-
["scheduler.eventInfo", "eventInfo"]
|
|
277
|
+
["scheduler.eventInfo", "eventInfo"],
|
|
278
|
+
["scheduler.configSettings", "configSettings"]
|
|
230
279
|
]),
|
|
231
280
|
eventToProps: {
|
|
232
281
|
backButtonClicked: async (e, t) => {
|
|
@@ -241,41 +290,46 @@ le([
|
|
|
241
290
|
},
|
|
242
291
|
fireRegisterEvent: !0
|
|
243
292
|
}),
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
],
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
var
|
|
251
|
-
var
|
|
293
|
+
L("design:type", Function),
|
|
294
|
+
L("design:paramtypes", []),
|
|
295
|
+
L("design:returntype", void 0)
|
|
296
|
+
], U.prototype, "render", null);
|
|
297
|
+
U.style = fe;
|
|
298
|
+
const me = ':host{display:block;width:400px;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}', pe = me;
|
|
299
|
+
var ue = function(e, t, n, s) {
|
|
300
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, r;
|
|
252
301
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
253
|
-
|
|
302
|
+
i = Reflect.decorate(e, t, n, s);
|
|
254
303
|
else
|
|
255
304
|
for (var l = e.length - 1; l >= 0; l--)
|
|
256
|
-
(
|
|
257
|
-
return
|
|
258
|
-
},
|
|
305
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
306
|
+
return o > 3 && i && Object.defineProperty(t, n, i), i;
|
|
307
|
+
}, I = function(e, t) {
|
|
259
308
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
260
309
|
return Reflect.metadata(e, t);
|
|
261
310
|
};
|
|
262
|
-
const
|
|
311
|
+
const Y = class {
|
|
263
312
|
constructor(e) {
|
|
264
|
-
|
|
313
|
+
var t, n;
|
|
314
|
+
m(this, e), this.goBackButtonClicked = d(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = d(this, "cancelBookingFormSubmitted", 7), this.cancelBookedEventError = d(this, "cancelBookedEventError", 7), this.cancelBookingFormError = d(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
265
315
|
this.goBackButtonClicked.emit();
|
|
266
|
-
}, this.handleSubmitCancelBooking = (
|
|
267
|
-
if (
|
|
316
|
+
}, this.handleSubmitCancelBooking = (s) => {
|
|
317
|
+
if (s.preventDefault(), !this.cancellationReason) {
|
|
268
318
|
this.cancellationError = "Please provide a reason for cancellation.", this.cancelBookingFormError.emit({ title: "Cancel booking form error", description: "Please provide a reason for cancellation." });
|
|
269
319
|
return;
|
|
270
320
|
}
|
|
271
321
|
c(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
272
|
-
const
|
|
273
|
-
this.cancelBookedEventError.emit(
|
|
322
|
+
const o = (i) => {
|
|
323
|
+
this.cancelBookedEventError.emit(i);
|
|
274
324
|
};
|
|
275
|
-
this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler:
|
|
276
|
-
}, this.handleOnChangeCancellationReason = (
|
|
277
|
-
this.cancellationError = "", this.cancellationReason =
|
|
278
|
-
}, this.cancelBookingId = void 0, this.cancellationReason = "", this.cancellationError = "";
|
|
325
|
+
this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler: o });
|
|
326
|
+
}, this.handleOnChangeCancellationReason = (s) => {
|
|
327
|
+
this.cancellationError = "", this.cancellationReason = s.target.value;
|
|
328
|
+
}, this.cancelBookingId = void 0, this.configSettings = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((n = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : n.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
329
|
+
}
|
|
330
|
+
configSettingsChangedHandler(e) {
|
|
331
|
+
var t;
|
|
332
|
+
this.cancellationPolicy = ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
279
333
|
}
|
|
280
334
|
connectedCallback() {
|
|
281
335
|
c("[nylas-cancel-booking-form] Component connected");
|
|
@@ -290,44 +344,50 @@ const Z = class {
|
|
|
290
344
|
c("[nylas-cancel-booking-form] Component disconnected");
|
|
291
345
|
}
|
|
292
346
|
render() {
|
|
293
|
-
return a(
|
|
347
|
+
return a(h, { key: "073a93d34ef7f08acaa827d0e5f391481572c447", part: "ncec" }, a("sp-theme", { key: "b2183d3473931a5d1dd18dfdbe32fed0128d5dc1", theme: "spectrum", scale: "medium" }, a("div", { key: "f9147a9d4041b5848bd11f06da7c96e98af3d9bd", class: "nylas-cancel-booking-form", part: "ncec__card" }, a("div", { key: "15da6ffbfe870b80bd057415469a4c94c1b3a243", class: "nylas-cancel-booking-form__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "f3f36d408dbbe9717ff2ca13981714c36a4ba160" })), a("h3", { key: "56cd0d658ba9a1c63cd0017514a190c42796dbf4", class: "nylas-cancel-booking-form__title", part: "ncec__title" }, "Cancel booking?"), a("div", { key: "db6672c70cc566544ec748f9c7a7426000e0c619", class: "nylas-cancel-booking-form__description", part: "ncec__description" }, this.cancellationPolicy), a("form", { key: "d227b962561915e823a151a289b135c1d9065510", onSubmit: this.handleSubmitCancelBooking }, a("sp-field-label", { key: "42eea73d2ffb041b90fbdffdc0c7e16603eee949", for: "cancel-reason", class: this.cancellationError ? "error" : "" }, "Reason for cancellation ", a("span", { key: "57978569e7bd5828b9dfaee053de9a8fae0892d5", class: "required" }, "*")), a("sp-textfield", { key: "08eb8ef56d7536053939086f5da1d5137e43b201", id: "cancel-reason", class: this.cancellationError ? "error" : "", part: "ncec__reason-textarea", multiline: !0, value: this.cancellationReason, onInput: this.handleOnChangeCancellationReason, onFocus: this.handleOnChangeCancellationReason, invalid: !!this.cancellationError }, a("sp-help-text", { key: "dd985c41efd6427e1cec09874caee5c5d345c1cb", slot: "negative-help-text" }, this.cancellationError)), a("sp-button", { key: "97705e808b56f0d373dc1fa705fd61b912ed643e", variant: "primary", class: "cancel", type: "submit", part: "ncec__button-cta" }, "Cancel booking"), a("sp-button", { key: "21ae78e3492ad79cbee485709bb863c29f4b041f", variant: "secondary", class: "back", treatment: "outline", part: "ncec__button-outline", onClick: this.handleGoBackClicked }, "Go back")))));
|
|
348
|
+
}
|
|
349
|
+
static get watchers() {
|
|
350
|
+
return {
|
|
351
|
+
configSettings: ["configSettingsChangedHandler"]
|
|
352
|
+
};
|
|
294
353
|
}
|
|
295
354
|
};
|
|
296
|
-
|
|
297
|
-
|
|
355
|
+
ue([
|
|
356
|
+
y({
|
|
298
357
|
name: "nylas-cancel-booking-form",
|
|
358
|
+
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
299
359
|
eventToProps: {
|
|
300
360
|
cancelBookingFormSubmitted: async (e, t) => {
|
|
301
|
-
const
|
|
302
|
-
s && (!
|
|
361
|
+
const n = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason), { errorHandler: s } = e.detail;
|
|
362
|
+
s && (!n || "error" in n) && s(n);
|
|
303
363
|
}
|
|
304
364
|
},
|
|
305
365
|
fireRegisterEvent: !0
|
|
306
366
|
}),
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
],
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
var
|
|
314
|
-
var
|
|
367
|
+
I("design:type", Function),
|
|
368
|
+
I("design:paramtypes", []),
|
|
369
|
+
I("design:returntype", void 0)
|
|
370
|
+
], Y.prototype, "render", null);
|
|
371
|
+
Y.style = pe;
|
|
372
|
+
const ye = ':host{display:block;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}', ge = ye;
|
|
373
|
+
var ve = function(e, t, n, s) {
|
|
374
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, r;
|
|
315
375
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
316
|
-
|
|
376
|
+
i = Reflect.decorate(e, t, n, s);
|
|
317
377
|
else
|
|
318
378
|
for (var l = e.length - 1; l >= 0; l--)
|
|
319
|
-
(
|
|
320
|
-
return
|
|
321
|
-
},
|
|
379
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
380
|
+
return o > 3 && i && Object.defineProperty(t, n, i), i;
|
|
381
|
+
}, R = function(e, t) {
|
|
322
382
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
323
383
|
return Reflect.metadata(e, t);
|
|
324
384
|
};
|
|
325
|
-
const
|
|
385
|
+
const X = class {
|
|
326
386
|
constructor(e) {
|
|
327
|
-
|
|
387
|
+
m(this, e), this.closeCancelEventCardClicked = d(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = d(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
328
388
|
this.isClosing = !0;
|
|
329
|
-
const t = (
|
|
330
|
-
this.cancelledEventCardError.emit(
|
|
389
|
+
const t = (n) => {
|
|
390
|
+
this.cancelledEventCardError.emit(n), this.isClosing = !1;
|
|
331
391
|
};
|
|
332
392
|
this.closeCancelEventCardClicked.emit({ errorHandler: t });
|
|
333
393
|
}, this.cancelledEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
|
|
@@ -346,91 +406,98 @@ const A = class {
|
|
|
346
406
|
}
|
|
347
407
|
render() {
|
|
348
408
|
var e, t;
|
|
349
|
-
return a(
|
|
409
|
+
return a(h, { key: "11c4720a791169b5d562f484fecc2e5586bbdeaf", part: "ncec" }, a("sp-theme", { key: "ccd04e6a1a895ad4be18bdb14d27a1c7403a0568", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "a0360afadc55f58d20e651cb33036aa364a3740e", class: "nylas-cancelled-event-card", part: "ncec__card" }, a("div", { key: "727eba1d97de774c9a51909bec714688d9e60c1c", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "bd96caf7b68ee65a470e5949d6622de0893c112d" })), a("h3", { key: "9bcb27d08117825255c2a5625e7b8f630e35b1e5", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, "Your booking has been cancelled successfully!"), a("div", { key: "f356c2776a296b89efe9ff9b02dd0f928ea1c0c8", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, "A cancellation email has been sent to ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), a("div", { key: "50130b11b9806a5c6adfd67f436d273fbec91774", class: "nylas-cancelled-event-card__cta" }, a("sp-button", { key: "77e8e62722ac4ace0a667b45feed6684b3bb6056", variant: "secondary", treatment: "outline", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? "Closing..." : "Close")))));
|
|
350
410
|
}
|
|
351
411
|
};
|
|
352
|
-
|
|
353
|
-
|
|
412
|
+
ve([
|
|
413
|
+
y({
|
|
354
414
|
name: "nylas-cancelled-event-card",
|
|
355
415
|
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
356
416
|
eventToProps: {
|
|
357
417
|
closeCancelEventCardClicked: async (e, t) => {
|
|
358
|
-
const
|
|
359
|
-
s && (!
|
|
418
|
+
const n = await t.scheduler.resetCancel(), { errorHandler: s } = e.detail;
|
|
419
|
+
s && (!n || "error" in n) && s(n);
|
|
360
420
|
}
|
|
361
421
|
},
|
|
362
422
|
fireRegisterEvent: !0
|
|
363
423
|
}),
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
],
|
|
368
|
-
|
|
369
|
-
const
|
|
370
|
-
function
|
|
371
|
-
function
|
|
372
|
-
return e(
|
|
373
|
-
}
|
|
374
|
-
return
|
|
375
|
-
const
|
|
376
|
-
return
|
|
377
|
-
},
|
|
424
|
+
R("design:type", Function),
|
|
425
|
+
R("design:paramtypes", []),
|
|
426
|
+
R("design:returntype", void 0)
|
|
427
|
+
], X.prototype, "render", null);
|
|
428
|
+
X.style = ge;
|
|
429
|
+
const P = /* @__PURE__ */ new Date(), F = /* @__PURE__ */ new Date();
|
|
430
|
+
function T(e, t, n, s) {
|
|
431
|
+
function o(i) {
|
|
432
|
+
return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
|
|
433
|
+
}
|
|
434
|
+
return o.floor = (i) => (e(i = /* @__PURE__ */ new Date(+i)), i), o.ceil = (i) => (e(i = new Date(i - 1)), t(i, 1), e(i), i), o.round = (i) => {
|
|
435
|
+
const r = o(i), l = o.ceil(i);
|
|
436
|
+
return i - r < l - i ? r : l;
|
|
437
|
+
}, o.offset = (i, r) => (t(i = /* @__PURE__ */ new Date(+i), r == null ? 1 : Math.floor(r)), i), o.range = (i, r, l) => {
|
|
378
438
|
const b = [];
|
|
379
|
-
if (
|
|
439
|
+
if (i = o.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < r) || !(l > 0))
|
|
380
440
|
return b;
|
|
381
|
-
let
|
|
441
|
+
let f;
|
|
382
442
|
do
|
|
383
|
-
b.push(
|
|
384
|
-
while (
|
|
443
|
+
b.push(f = /* @__PURE__ */ new Date(+i)), t(i, l), e(i);
|
|
444
|
+
while (f < i && i < r);
|
|
385
445
|
return b;
|
|
386
|
-
},
|
|
387
|
-
if (
|
|
388
|
-
for (; e(
|
|
389
|
-
|
|
390
|
-
}, (
|
|
391
|
-
if (
|
|
446
|
+
}, o.filter = (i) => T((r) => {
|
|
447
|
+
if (r >= r)
|
|
448
|
+
for (; e(r), !i(r); )
|
|
449
|
+
r.setTime(r - 1);
|
|
450
|
+
}, (r, l) => {
|
|
451
|
+
if (r >= r)
|
|
392
452
|
if (l < 0)
|
|
393
453
|
for (; ++l <= 0; )
|
|
394
|
-
for (; t(
|
|
454
|
+
for (; t(r, -1), !i(r); )
|
|
395
455
|
;
|
|
396
456
|
else
|
|
397
457
|
for (; --l >= 0; )
|
|
398
|
-
for (; t(
|
|
458
|
+
for (; t(r, 1), !i(r); )
|
|
399
459
|
;
|
|
400
|
-
}),
|
|
460
|
+
}), n && (o.count = (i, r) => (P.setTime(+i), F.setTime(+r), e(P), e(F), Math.floor(n(P, F))), o.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? o.filter(s ? (r) => s(r) % i === 0 : (r) => o.count(0, r) % i === 0) : o)), o;
|
|
401
461
|
}
|
|
402
|
-
const
|
|
462
|
+
const ke = 1e3, J = ke * 60, xe = J * 60, D = xe * 24, j = T(
|
|
403
463
|
(e) => e.setHours(0, 0, 0, 0),
|
|
404
464
|
(e, t) => e.setDate(e.getDate() + t),
|
|
405
|
-
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) *
|
|
465
|
+
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * J) / D,
|
|
406
466
|
(e) => e.getDate() - 1
|
|
407
467
|
);
|
|
408
|
-
|
|
468
|
+
T((e) => {
|
|
409
469
|
e.setUTCHours(0, 0, 0, 0);
|
|
410
470
|
}, (e, t) => {
|
|
411
471
|
e.setUTCDate(e.getUTCDate() + t);
|
|
412
|
-
}, (e, t) => (t - e) /
|
|
413
|
-
|
|
472
|
+
}, (e, t) => (t - e) / D, (e) => e.getUTCDate() - 1);
|
|
473
|
+
T((e) => {
|
|
414
474
|
e.setUTCHours(0, 0, 0, 0);
|
|
415
475
|
}, (e, t) => {
|
|
416
476
|
e.setUTCDate(e.getUTCDate() + t);
|
|
417
|
-
}, (e, t) => (t - e) /
|
|
418
|
-
const
|
|
419
|
-
var
|
|
420
|
-
var
|
|
477
|
+
}, (e, t) => (t - e) / D, (e) => Math.floor(e / D));
|
|
478
|
+
const Ce = ':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family)}.title h1{margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', we = Ce;
|
|
479
|
+
var _e = function(e, t, n, s) {
|
|
480
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, r;
|
|
421
481
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
422
|
-
|
|
482
|
+
i = Reflect.decorate(e, t, n, s);
|
|
423
483
|
else
|
|
424
484
|
for (var l = e.length - 1; l >= 0; l--)
|
|
425
|
-
(
|
|
426
|
-
return
|
|
427
|
-
},
|
|
485
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
486
|
+
return o > 3 && i && Object.defineProperty(t, n, i), i;
|
|
487
|
+
}, M = function(e, t) {
|
|
428
488
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
429
489
|
return Reflect.metadata(e, t);
|
|
430
490
|
};
|
|
431
|
-
const
|
|
491
|
+
const K = class {
|
|
432
492
|
constructor(e) {
|
|
433
|
-
|
|
493
|
+
m(this, e), this.dateSelected = d(this, "dateSelected", 7), this.monthChanged = d(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.configSettings = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
|
|
494
|
+
}
|
|
495
|
+
configSettingsChanged(e) {
|
|
496
|
+
var o;
|
|
497
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.available_days_in_future;
|
|
498
|
+
if (n === void 0)
|
|
499
|
+
return;
|
|
500
|
+
V(/* @__PURE__ */ new Date(), n).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
|
|
434
501
|
}
|
|
435
502
|
connectedCallback() {
|
|
436
503
|
}
|
|
@@ -439,43 +506,48 @@ const G = class {
|
|
|
439
506
|
componentWillLoad() {
|
|
440
507
|
}
|
|
441
508
|
getDates() {
|
|
442
|
-
const e =
|
|
443
|
-
return
|
|
509
|
+
const e = ne(this.month), t = ie(this.month);
|
|
510
|
+
return j.range(j.offset(t, -t.getDay()), j.offset(e, 7 - e.getDay()));
|
|
444
511
|
}
|
|
445
512
|
selectDate(e) {
|
|
446
513
|
this.dateSelected.emit(e);
|
|
447
514
|
}
|
|
448
515
|
changeMonth(e) {
|
|
449
|
-
var
|
|
516
|
+
var o, i;
|
|
450
517
|
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
451
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1),
|
|
452
|
-
|
|
518
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.available_days_in_future;
|
|
519
|
+
V(/* @__PURE__ */ new Date(), n).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month), this.selectDate();
|
|
453
520
|
}
|
|
454
|
-
isSelected(e, t,
|
|
455
|
-
return e && t &&
|
|
521
|
+
isSelected(e, t, n) {
|
|
522
|
+
return e && t && u(e, t) && n && (n == null ? void 0 : n.length) > 0;
|
|
456
523
|
}
|
|
457
524
|
isDisabled(e, t) {
|
|
458
|
-
return e && (t == null ? void 0 : t.find((
|
|
525
|
+
return e && (t == null ? void 0 : t.find((n) => u(n, e))) === void 0;
|
|
459
526
|
}
|
|
460
527
|
render() {
|
|
461
|
-
var e, t,
|
|
462
|
-
return a(
|
|
463
|
-
var
|
|
464
|
-
const
|
|
528
|
+
var e, t, n, s;
|
|
529
|
+
return a(h, { key: "bc2d37f59dc4cc59c9659a15ce640d3f3c738239", part: "ndp" }, a("div", { key: "7b39c6ff3b5c820d6ee4cc3419a80f9803011deb", class: "nylas-date-picker" }, a("div", { key: "e7e08bbe189da82d187241b1025633f9ea690bbe", class: "title", part: "'ndp__title" }, a("h1", { key: "6619e950e5b31181663916bb95eb72efcda2031b" }, a("person-icon", { key: "3db3207dea880167c6f7f4058887b51620da58f9" }), ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || ((n = this.configSettings) == null ? void 0 : n.organizer.email)), a("p", { key: "8a1ec0fe12579b46279b1c95af1928740b9fffb4" }, a("clock-icon", { key: "677dc941e4bba5387a16af1f47eb52ed0daf37ab" }), this.eventDuration ? oe(this.eventDuration) : "- minutes")), a("div", { key: "55ceabd5fe27d3261d8a1c320cc9d612829c50b5", class: "header flex-row" }, a("h2", { key: "0fb27b957ac9315139b1cc6ead9504d3b35549cd", part: "ndp__month-header" }, a("strong", { key: "c916747bc9714fa1e0743674aa8845f0bb3bc8c6" }, this.month.toLocaleDateString(void 0, { month: "long" })), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), a("div", { key: "f730a61b661c581d623eca6d56f809d40c0a775b", class: "pagination" }, a("button", { key: "69555f5b4de9306dedd29bdeeb90effbda01c521", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((s = this.selectableDates) != null && s.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, a("chevron-icon", { key: "ea5c5492aa75cbb1c94af57d01c091a353b7ee2a" })), a("button", { key: "9313976fea433d8babf3ce5a63891492e93c22bc", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, a("chevron-icon", { key: "81f86816719358949d8eef1e346702da314de68f" })))), a("div", { key: "32e3e0cf78205054739acc6ae3a3363b7d10c926", class: "dates" }, ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map((o) => a("div", { class: "day", part: "ndp__day" }, o)), this.dates.map((o, i) => {
|
|
530
|
+
var l;
|
|
531
|
+
const r = this.isDisabled(o, this.selectableDates);
|
|
465
532
|
return this.isLoading ? a("button", { disabled: !0, class: {
|
|
466
533
|
"date day-skeleton": !0,
|
|
467
|
-
"current-month":
|
|
468
|
-
}, style: { animationDelay: `${
|
|
534
|
+
"current-month": S(o, this.month)
|
|
535
|
+
}, style: { animationDelay: `${i * 20}ms` }, part: "ndp__date" }, o.getDate()) : a("button", { class: {
|
|
469
536
|
date: !0,
|
|
470
|
-
selected: !!(this.selectedDate &&
|
|
471
|
-
"current-day":
|
|
472
|
-
"current-month":
|
|
473
|
-
}, "aria-lang":
|
|
537
|
+
selected: !!(this.selectedDate && u(o, this.selectedDate) && this.selectableDates && ((l = this.selectableDates) == null ? void 0 : l.length) > 0),
|
|
538
|
+
"current-day": u(o, /* @__PURE__ */ new Date()),
|
|
539
|
+
"current-month": S(o, this.month)
|
|
540
|
+
}, "aria-lang": o.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: r, onClick: () => this.selectDate(o), part: `ndp__date ${this.isSelected(o, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${u(o, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${S(o, this.month) ? "ndp__date--current-month" : ""}` }, o.getDate());
|
|
474
541
|
}))));
|
|
475
542
|
}
|
|
543
|
+
static get watchers() {
|
|
544
|
+
return {
|
|
545
|
+
configSettings: ["configSettingsChanged"]
|
|
546
|
+
};
|
|
547
|
+
}
|
|
476
548
|
};
|
|
477
|
-
|
|
478
|
-
|
|
549
|
+
_e([
|
|
550
|
+
y({
|
|
479
551
|
name: "nylas-date-picker",
|
|
480
552
|
stateToProps: /* @__PURE__ */ new Map([
|
|
481
553
|
["scheduler.selectableDates", "selectableDates"],
|
|
@@ -491,27 +563,27 @@ ve([
|
|
|
491
563
|
},
|
|
492
564
|
fireRegisterEvent: !0
|
|
493
565
|
}),
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
],
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
var
|
|
501
|
-
var
|
|
566
|
+
M("design:type", Function),
|
|
567
|
+
M("design:paramtypes", []),
|
|
568
|
+
M("design:returntype", void 0)
|
|
569
|
+
], K.prototype, "render", null);
|
|
570
|
+
K.style = we;
|
|
571
|
+
const Ee = ':host{display:block;--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}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}', De = Ee;
|
|
572
|
+
var Te = function(e, t, n, s) {
|
|
573
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, r;
|
|
502
574
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
503
|
-
|
|
575
|
+
i = Reflect.decorate(e, t, n, s);
|
|
504
576
|
else
|
|
505
577
|
for (var l = e.length - 1; l >= 0; l--)
|
|
506
|
-
(
|
|
507
|
-
return
|
|
508
|
-
},
|
|
578
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
579
|
+
return o > 3 && i && Object.defineProperty(t, n, i), i;
|
|
580
|
+
}, N = function(e, t) {
|
|
509
581
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
510
582
|
return Reflect.metadata(e, t);
|
|
511
583
|
};
|
|
512
|
-
const
|
|
584
|
+
const Q = class {
|
|
513
585
|
constructor(e) {
|
|
514
|
-
|
|
586
|
+
m(this, e), this.timezoneChanged = d(this, "timezoneChanged", 7), this.languageChanged = d(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
|
|
515
587
|
}
|
|
516
588
|
connectedCallback() {
|
|
517
589
|
}
|
|
@@ -525,43 +597,43 @@ const q = class {
|
|
|
525
597
|
changeLanguage(e) {
|
|
526
598
|
this.selectedLanguage = e, this.languageChanged.emit(e);
|
|
527
599
|
}
|
|
528
|
-
|
|
529
|
-
const { name: t, value:
|
|
530
|
-
t === "timezone" ? this.changeTimezone(
|
|
600
|
+
nylasFormDropdownChangedHandler(e) {
|
|
601
|
+
const { name: t, value: n } = e.detail;
|
|
602
|
+
t === "timezone" ? this.changeTimezone(n) : t === "language" && this.changeLanguage(n);
|
|
531
603
|
}
|
|
532
604
|
getTimezoneLabelHTML(e) {
|
|
533
|
-
const t =
|
|
605
|
+
const t = re(e);
|
|
534
606
|
return a("span", { class: "timezone-label", style: {
|
|
535
607
|
display: "flex",
|
|
536
608
|
alignItems: "center",
|
|
537
609
|
justifyContent: "space-between",
|
|
538
610
|
width: "-webkit-fill-available"
|
|
539
|
-
} },
|
|
611
|
+
} }, _[e], " ", a("span", { class: "timezone-offset", style: {
|
|
540
612
|
fontSize: "14px",
|
|
541
613
|
fontWeight: "400",
|
|
542
614
|
color: "var(--nylas-base-500)"
|
|
543
615
|
} }, t));
|
|
544
616
|
}
|
|
545
617
|
render() {
|
|
546
|
-
const e = Object.keys(
|
|
547
|
-
labelHTML: this.getTimezoneLabelHTML(
|
|
548
|
-
label:
|
|
549
|
-
value:
|
|
550
|
-
})), t = Object.keys(
|
|
551
|
-
label:
|
|
552
|
-
value:
|
|
618
|
+
const e = Object.keys(_).map((n) => ({
|
|
619
|
+
labelHTML: this.getTimezoneLabelHTML(n),
|
|
620
|
+
label: _[n],
|
|
621
|
+
value: n
|
|
622
|
+
})), t = Object.keys(q).map((n) => ({
|
|
623
|
+
label: q[n],
|
|
624
|
+
value: n
|
|
553
625
|
}));
|
|
554
|
-
return a(
|
|
626
|
+
return a(h, { key: "b568b75977c586e88d88d69ce6a4b7651fd6123b" }, a("div", { key: "95b12f2d96e46b31ed606c85c4fe3151861d188c", class: "nylas-locale-switch" }, a("div", { key: "d44690dae20a0068ffe55ab87024c8e283acaa6c", class: {
|
|
555
627
|
"select-wrapper": !0,
|
|
556
628
|
timezone: !0
|
|
557
|
-
} }, a("select-dropdown", { key: "
|
|
629
|
+
} }, a("select-dropdown", { key: "09b895b074f36381567d439869b68d8e10869b2a", name: "timezone", options: e, defaultSelectedOption: e.find((n) => n.value == this.selectedTimezone) }, a("span", { key: "72a40810ca3d7a59b0e8d76be62c63f70c1cf183", slot: "select-icon" }, a("globe-icon", { key: "01dedea1be14b299cf447085b5778663015b2e2d", width: "20", height: "20" })))), a("div", { key: "2b4078132bc366f7784648cce51fe0ee33467d06", class: {
|
|
558
630
|
"select-wrapper": !0,
|
|
559
631
|
language: !0
|
|
560
|
-
} }, a("select-dropdown", { key: "
|
|
632
|
+
} }, a("select-dropdown", { key: "eb73c3eb853aba5c0acde42bf49dd09c19f1d43b", name: "language", options: t, defaultSelectedOption: t.find((n) => n.value == this.selectedLanguage) }, a("span", { key: "b2b1b5e1d8d2b85e67615c6f63a69ac955e3fc16", slot: "select-icon" }, a("translate-icon", { key: "161bb7dad0a08d8362c5c3cdd85238d732e5888c", width: "20", height: "20" }))))));
|
|
561
633
|
}
|
|
562
634
|
};
|
|
563
|
-
|
|
564
|
-
|
|
635
|
+
Te([
|
|
636
|
+
y({
|
|
565
637
|
name: "nylas-locale-switch",
|
|
566
638
|
stateToProps: /* @__PURE__ */ new Map([
|
|
567
639
|
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
@@ -574,23 +646,23 @@ Ce([
|
|
|
574
646
|
},
|
|
575
647
|
fireRegisterEvent: !0
|
|
576
648
|
}),
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
],
|
|
581
|
-
|
|
582
|
-
const
|
|
649
|
+
N("design:type", Function),
|
|
650
|
+
N("design:paramtypes", []),
|
|
651
|
+
N("design:returntype", void 0)
|
|
652
|
+
], Q.prototype, "render", null);
|
|
653
|
+
Q.style = De;
|
|
654
|
+
const Se = ".sc-nylas-logo-h{display:flex}", ze = Se, Be = class {
|
|
583
655
|
constructor(e) {
|
|
584
|
-
|
|
656
|
+
m(this, e), this.width = "69", this.height = "24";
|
|
585
657
|
}
|
|
586
658
|
render() {
|
|
587
|
-
return a("svg", { key: "
|
|
659
|
+
return a("svg", { key: "cc4e67942af5cfd37cdad41f7f8dc87652109481", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("g", { key: "5f5e9fd7f9ce51ec576b6004828e0c323dcb1701", "clip-path": "url(#clip0_455_3543)" }, a("path", { key: "0390e7e1cc90e26d025adccbb77df76b7c779b9e", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), a("path", { key: "08783eb775743742f7520a632016676f156469d3", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), a("path", { key: "e9c104e64b877dce04ae82221cd976688e97968f", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), a("path", { key: "144a43759016fd4da29dd3f0493d9221e666c89f", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), a("path", { key: "9f11d314804629377158c00854f3849d1033c601", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), a("path", { key: "f6591deaa756e6e18c08a65a9eefc453965296da", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), a("path", { key: "ee90a807361a94004319eb9c5f89082558211d05", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), a("path", { key: "ac09ff51d464eba8732f1c61f18eafd587227b93", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), a("defs", { key: "c0e42870fa615d20b75bb38e4ec4047f2aba08cc" }, a("clipPath", { key: "e19ed121d42704ac0bf568a704679ca03dd70ed7", id: "clip0_455_3543" }, a("rect", { key: "2848bbbc3c36ecb6bdbc7336e8ac07c966baca5b", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
588
660
|
}
|
|
589
661
|
};
|
|
590
|
-
|
|
591
|
-
const
|
|
662
|
+
Be.style = ze;
|
|
663
|
+
const Le = ':host{display:block;margin-bottom:-12px;width:100%;z-index: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}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error);background:rgb(255, 248, 248)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}', Ie = Le, Re = class {
|
|
592
664
|
constructor(e) {
|
|
593
|
-
|
|
665
|
+
m(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
594
666
|
}
|
|
595
667
|
onError(e) {
|
|
596
668
|
c(`[nylas-notification] Error: ${e.detail.title}`), this.handleNotification(e);
|
|
@@ -620,7 +692,7 @@ const Te = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas
|
|
|
620
692
|
if (this.notifications = [...this.notifications, { ...e.detail }], e.detail.ttl !== "none") {
|
|
621
693
|
const t = e.detail.ttl ? e.detail.ttl : this.ttl;
|
|
622
694
|
window.setTimeout(() => {
|
|
623
|
-
this.notifications = this.notifications.filter((
|
|
695
|
+
this.notifications = this.notifications.filter((n) => n.id !== e.detail.id);
|
|
624
696
|
}, t);
|
|
625
697
|
}
|
|
626
698
|
}
|
|
@@ -628,26 +700,26 @@ const Te = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas
|
|
|
628
700
|
this.notifications = this.notifications.filter((t) => t.id !== e);
|
|
629
701
|
}
|
|
630
702
|
render() {
|
|
631
|
-
return a(
|
|
703
|
+
return a(h, { key: "ab83962fa679505585445e3baab12b31bf1abd00" }, a(se, { key: "3f4c77b79718eb71600129910be78980a70c3022" }, this.notifications.map((e) => a("div", { class: `notif ${e.type}`, key: e.id }, a("div", { class: "content" }, a("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && a("warning-icon", null)), a("span", { class: "message" }, a("span", { class: "title" }, e.title), e.description && a("span", { class: "description" }, e.description))), a("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, a("close-icon", null)))), a("slot", { key: "45286b7e48b19c7b76089ef2d661e9cd176b4a8f" })));
|
|
632
704
|
}
|
|
633
705
|
};
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
var
|
|
637
|
-
var
|
|
706
|
+
Re.style = Ie;
|
|
707
|
+
const Pe = ":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}", Fe = Pe;
|
|
708
|
+
var je = function(e, t, n, s) {
|
|
709
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, r;
|
|
638
710
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
639
|
-
|
|
711
|
+
i = Reflect.decorate(e, t, n, s);
|
|
640
712
|
else
|
|
641
713
|
for (var l = e.length - 1; l >= 0; l--)
|
|
642
|
-
(
|
|
643
|
-
return
|
|
644
|
-
},
|
|
714
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
715
|
+
return o > 3 && i && Object.defineProperty(t, n, i), i;
|
|
716
|
+
}, O = function(e, t) {
|
|
645
717
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
646
718
|
return Reflect.metadata(e, t);
|
|
647
719
|
};
|
|
648
|
-
const
|
|
720
|
+
const ee = class {
|
|
649
721
|
constructor(e) {
|
|
650
|
-
|
|
722
|
+
m(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.startTime = "", this.endTime = "";
|
|
651
723
|
}
|
|
652
724
|
connectedCallback() {
|
|
653
725
|
}
|
|
@@ -664,7 +736,7 @@ const W = class {
|
|
|
664
736
|
}
|
|
665
737
|
render() {
|
|
666
738
|
var e;
|
|
667
|
-
return a(
|
|
739
|
+
return a(h, { key: "27aa2e0c4ea3a4ac04c24c3e7049360ab1da450c", part: "nsec" }, a("sp-theme", { key: "06a93ef1f378da9bf9c8eeb8cbb3b7ab912cbe39", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "cbeab1951966e48db4e7c0e652946099377abfaa", class: "event-card", part: "nsec__card" }, a("div", { key: "014aed3ae5739ec763f3fe0ff7b94f859a35090c", class: "calendar-icon", part: "nsec__icon" }, a("calendar-icon", { key: "b19e2752e3b87c07f14c23651416de2a1fa78ca5" })), a("div", { key: "d4adee688565fcec2e217cc2b3ae8bb2d2572630", class: "nylas-selected-event-card__date", part: "nsec__date" }, (e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(void 0, { dateStyle: "full" })), a("div", { key: "c9f15e73f1cf65d6df1739fe348abd9fe50c34d9", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), a("div", { key: "531c381692eefac442a0646d4584f9cf2a51808e", class: "event-timezone", part: "nsec__timezone" }, a("globe-icon", { key: "d6d7225298063ab5d5005f2c0a8d2a57de0d1a27" }), _[this.selectedTimezone])));
|
|
668
740
|
}
|
|
669
741
|
static get watchers() {
|
|
670
742
|
return {
|
|
@@ -672,8 +744,8 @@ const W = class {
|
|
|
672
744
|
};
|
|
673
745
|
}
|
|
674
746
|
};
|
|
675
|
-
|
|
676
|
-
|
|
747
|
+
je([
|
|
748
|
+
y({
|
|
677
749
|
name: "nylas-selected-event-card",
|
|
678
750
|
stateToProps: /* @__PURE__ */ new Map([
|
|
679
751
|
["scheduler.selectedDate", "selectedDate"],
|
|
@@ -683,28 +755,28 @@ Se([
|
|
|
683
755
|
eventToProps: {},
|
|
684
756
|
fireRegisterEvent: !0
|
|
685
757
|
}),
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
],
|
|
690
|
-
|
|
691
|
-
const
|
|
692
|
-
var
|
|
693
|
-
var
|
|
758
|
+
O("design:type", Function),
|
|
759
|
+
O("design:paramtypes", []),
|
|
760
|
+
O("design:returntype", void 0)
|
|
761
|
+
], ee.prototype, "render", null);
|
|
762
|
+
ee.style = Fe;
|
|
763
|
+
const Me = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .time-slot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}", Ne = Me;
|
|
764
|
+
var Oe = function(e, t, n, s) {
|
|
765
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, r;
|
|
694
766
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
695
|
-
|
|
767
|
+
i = Reflect.decorate(e, t, n, s);
|
|
696
768
|
else
|
|
697
769
|
for (var l = e.length - 1; l >= 0; l--)
|
|
698
|
-
(
|
|
699
|
-
return
|
|
700
|
-
},
|
|
770
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
771
|
+
return o > 3 && i && Object.defineProperty(t, n, i), i;
|
|
772
|
+
}, H = function(e, t) {
|
|
701
773
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
702
774
|
return Reflect.metadata(e, t);
|
|
703
775
|
};
|
|
704
|
-
const
|
|
776
|
+
const te = class {
|
|
705
777
|
constructor(e) {
|
|
706
|
-
|
|
707
|
-
t.preventDefault(), c("[nylas-timeslot-picker] Confirm timeslot",
|
|
778
|
+
m(this, e), this.timeslotSelected = d(this, "timeslotSelected", 7), this.timeslotConfirmed = d(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, n) => {
|
|
779
|
+
t.preventDefault(), c("[nylas-timeslot-picker] Confirm timeslot", n), this.timeslotConfirmed.emit(n);
|
|
708
780
|
}, this.handleMouseEnter = (t) => {
|
|
709
781
|
this.hoveredTimeslotIndex = t;
|
|
710
782
|
}, this.handleMouseLeave = () => {
|
|
@@ -717,7 +789,7 @@ const U = class {
|
|
|
717
789
|
}
|
|
718
790
|
async componentWillLoad() {
|
|
719
791
|
var t;
|
|
720
|
-
const e = (t = this.availability) == null ? void 0 : t.filter((
|
|
792
|
+
const e = (t = this.availability) == null ? void 0 : t.filter((n) => this.selectedDate && u(n.start_time, this.selectedDate)).map((n) => n);
|
|
721
793
|
this.times = e || [], c("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
722
794
|
}
|
|
723
795
|
async componentDidLoad() {
|
|
@@ -743,24 +815,24 @@ const U = class {
|
|
|
743
815
|
selectedDateChanged(e) {
|
|
744
816
|
var t;
|
|
745
817
|
if (c("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
746
|
-
const
|
|
747
|
-
this.times =
|
|
818
|
+
const n = (t = this.availability) == null ? void 0 : t.filter((s) => u(s.start_time, e)).map((s) => s);
|
|
819
|
+
this.times = n || [];
|
|
748
820
|
}
|
|
749
821
|
}
|
|
750
822
|
availabilityChanged(e) {
|
|
751
823
|
if (c("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
752
|
-
const t = e == null ? void 0 : e.filter((
|
|
824
|
+
const t = e == null ? void 0 : e.filter((n) => this.selectedDate && u(n.start_time, this.selectedDate)).map((n) => n);
|
|
753
825
|
this.times = t || [];
|
|
754
826
|
}
|
|
755
827
|
}
|
|
756
828
|
render() {
|
|
757
|
-
return this.isLoading ? a(
|
|
758
|
-
var
|
|
759
|
-
return a("button", { part: `ntp__timeslot ${((s = (
|
|
829
|
+
return this.isLoading ? a(h, null, a("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => a("div", { class: "time-slot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? a(h, null, a("div", { class: "empty" }, a("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? a(h, null, a("div", { class: "empty" }, a("span", null, "No time slots available for selected date"))) : this.selectedDate ? a(h, { part: "ntp" }, a("div", { class: "time-picker-wrapper" }, a("div", { class: "time-slots" }, this.times.map((e, t) => {
|
|
830
|
+
var n, s, o, i;
|
|
831
|
+
return a("button", { part: `ntp__timeslot ${((s = (n = this.selectedTimeslot) == null ? void 0 : n.start_time) == null ? void 0 : s.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
|
|
760
832
|
time: !0,
|
|
761
|
-
selected: typeof this.selectedTimeslot < "u" && ((
|
|
833
|
+
selected: typeof this.selectedTimeslot < "u" && ((i = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : i.getTime()) === e.start_time.getTime()
|
|
762
834
|
}, onClick: () => this.onClickSelectTime(e, t), onMouseEnter: () => this.handleMouseEnter(t), onMouseLeave: () => this.handleMouseLeave() }, this.hoveredTimeslotIndex == t || this.selectedTimeslotIndex == this.getTimeslotId(e.start_time, t) ? this.getTimeSlotLabel(e) : e.start_time.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone }));
|
|
763
|
-
})), this.selectedTimeslot && a("div", { class: "footer" }, a("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, a("slot", { name: "timeslot-picker-cta-label" }, "Next"))))) : a(
|
|
835
|
+
})), this.selectedTimeslot && a("div", { class: "footer" }, a("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, a("slot", { name: "timeslot-picker-cta-label" }, "Next"))))) : a(h, null);
|
|
764
836
|
}
|
|
765
837
|
static get watchers() {
|
|
766
838
|
return {
|
|
@@ -769,8 +841,8 @@ const U = class {
|
|
|
769
841
|
};
|
|
770
842
|
}
|
|
771
843
|
};
|
|
772
|
-
|
|
773
|
-
|
|
844
|
+
Oe([
|
|
845
|
+
y({
|
|
774
846
|
name: "nylas-timeslot-picker",
|
|
775
847
|
stateToProps: /* @__PURE__ */ new Map([
|
|
776
848
|
["scheduler.selectedDate", "selectedDate"],
|
|
@@ -789,20 +861,20 @@ je([
|
|
|
789
861
|
},
|
|
790
862
|
fireRegisterEvent: !0
|
|
791
863
|
}),
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
],
|
|
796
|
-
|
|
864
|
+
H("design:type", Function),
|
|
865
|
+
H("design:paramtypes", []),
|
|
866
|
+
H("design:returntype", void 0)
|
|
867
|
+
], te.prototype, "render", null);
|
|
868
|
+
te.style = Ne;
|
|
797
869
|
export {
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
870
|
+
W as nylas_booked_event_card,
|
|
871
|
+
U as nylas_booking_form,
|
|
872
|
+
Y as nylas_cancel_booking_form,
|
|
873
|
+
X as nylas_cancelled_event_card,
|
|
874
|
+
K as nylas_date_picker,
|
|
875
|
+
Q as nylas_locale_switch,
|
|
876
|
+
Be as nylas_logo,
|
|
877
|
+
Re as nylas_notification,
|
|
878
|
+
ee as nylas_selected_event_card,
|
|
879
|
+
te as nylas_timeslot_picker
|
|
808
880
|
};
|