@nylas/react 1.1.0-canary.8 → 1.1.0
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/README.md +110 -2
- package/dist/add-circle-icon_2.entry-7165bd0e.js +25 -0
- package/dist/add-circle-icon_2.entry-f1ddca18.cjs +1 -0
- package/dist/{archive-icon_7.entry-e2954750.js → archive-icon_7.entry-7411c224.js} +16 -16
- package/dist/archive-icon_7.entry-e3df60ed.cjs +1 -0
- package/dist/{arrow-icon.entry-548b027e.cjs → arrow-icon.entry-280e18b0.cjs} +1 -1
- package/dist/{arrow-icon.entry-03a85113.js → arrow-icon.entry-38949317.js} +4 -4
- package/dist/{bold-icon_3.entry-70ffa7f0.js → bold-icon_3.entry-5963945c.js} +4 -4
- package/dist/{bold-icon_3.entry-9a7b1869.cjs → bold-icon_3.entry-5dffbedd.cjs} +1 -1
- package/dist/button-component_2.entry-237733b4.js +26 -0
- package/dist/button-component_2.entry-b29d2873.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_48.entry-9afba869.js +5105 -0
- package/dist/calendar-agenda-fill-icon_48.entry-d3830dbb.cjs +7 -0
- package/dist/{calendar-cancel-icon.entry-45388fdc.cjs → calendar-cancel-icon.entry-77ccf227.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-6bbc119f.js → calendar-cancel-icon.entry-780723a6.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-f633f7a6.js → calendar-check-icon_2.entry-2c89c230.js} +7 -7
- package/dist/{calendar-check-icon_2.entry-6628456c.cjs → calendar-check-icon_2.entry-b37ac7f0.cjs} +1 -1
- package/dist/{calendar-icon.entry-62b82c27.js → calendar-icon.entry-02dd3990.js} +4 -4
- package/dist/{calendar-icon.entry-379b1fa1.cjs → calendar-icon.entry-ffc93569.cjs} +1 -1
- package/dist/checkbox-component_2.entry-00b6a1e9.cjs +1 -0
- package/dist/checkbox-component_2.entry-ee9d0e6c.js +56 -0
- package/dist/chevron-icon_3.entry-468abc26.cjs +1 -0
- package/dist/chevron-icon_3.entry-f62e9ef1.js +129 -0
- package/dist/clock-icon_4.entry-766a1b23.js +45 -0
- package/dist/clock-icon_4.entry-7dc2cc4a.cjs +1 -0
- package/dist/{constants-f34b9c6e-95a17764.js → constants-50c3e067-8a40a5fe.js} +885 -751
- package/dist/{constants-f34b9c6e-e7137e51.cjs → constants-50c3e067-9f2a6372.cjs} +5 -5
- package/dist/copy-icon.entry-2a841508.js +15 -0
- package/dist/copy-icon.entry-e5251410.cjs +1 -0
- package/dist/delete-icon_2.entry-1a5c39dc.cjs +1 -0
- package/dist/delete-icon_2.entry-64555a2f.js +25 -0
- package/dist/{document-refresh-icon.entry-32c75418.js → document-refresh-icon.entry-4bf6398b.js} +4 -4
- package/dist/document-refresh-icon.entry-fdc7ddda.cjs +1 -0
- package/dist/elements/index.d.ts +47 -1
- package/dist/{elements-dc5b338e-62fe1cf3.js → elements-dc5b338e-2da1fe61.js} +1 -1
- package/dist/{elements-dc5b338e-1f23530f.cjs → elements-dc5b338e-c8016c3d.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-f0f05815.cjs → focus-visible-e8093c16-0a38a184.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-1f664070.js → focus-visible-e8093c16-9d0c98c0.js} +1 -1
- package/dist/{forward-icon_6.entry-7fab04d7.js → forward-icon_6.entry-390ef70a.js} +9 -9
- package/dist/{forward-icon_6.entry-ef5e2e0f.cjs → forward-icon_6.entry-7238ef38.cjs} +3 -3
- package/dist/{globe-icon.entry-398a9826.cjs → globe-icon.entry-81f42f89.cjs} +1 -1
- package/dist/{globe-icon.entry-b8e1efae.js → globe-icon.entry-8d106260.js} +5 -5
- package/dist/google-logo-icon_4.entry-aabd3886.js +680 -0
- package/dist/google-logo-icon_4.entry-fa2b8999.cjs +1 -0
- package/dist/index-53420959-5fc8ad2b.js +5 -0
- package/dist/index-53420959-fcf45780.cjs +1 -0
- package/dist/index-5ccfd9df.js +7859 -0
- package/dist/index-6d9eeb53-58c8980a.js +4971 -0
- package/dist/index-6d9eeb53-b2a6d09f.cjs +41 -0
- package/dist/index-eb33703c.cjs +42 -0
- package/dist/{index.es-df564f87-b773d34f.js → index.es-c9454237-00ccd1e6.js} +6 -8
- package/dist/{index.es-df564f87-e4a4092a.cjs → index.es-c9454237-b64161d1.cjs} +6 -6
- package/dist/{info-icon_2.entry-2eb70f49.cjs → info-icon_2.entry-b2e11336.cjs} +1 -1
- package/dist/{info-icon_2.entry-6bbfa6dc.js → info-icon_2.entry-bb8ed71c.js} +3 -3
- package/dist/input-component.entry-378b1ccc.cjs +1 -0
- package/dist/input-component.entry-cb86170f.js +65 -0
- package/dist/input-dropdown.entry-98954c93.cjs +1 -0
- package/dist/input-dropdown.entry-a76c339e.js +134 -0
- package/dist/{mailbox-store-69c5c5f6-631eddb5.cjs → mailbox-store-edc386fc-156b7236.cjs} +1 -1
- package/dist/{mailbox-store-69c5c5f6-8ab4670b.js → mailbox-store-edc386fc-8bc7558b.js} +2 -2
- package/dist/multi-select-dropdown.entry-40b855e1.cjs +1 -0
- package/dist/multi-select-dropdown.entry-6b686695.js +91 -0
- package/dist/nylas-booked-event-card_12.entry-9d693125.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-e861bb16.js +1134 -0
- package/dist/nylas-form-card.entry-b158d789.js +57 -0
- package/dist/nylas-form-card.entry-ca4a8746.cjs +1 -0
- package/dist/{nylas-if-state.entry-f8abd025.js → nylas-if-state.entry-8e4d922c.js} +8 -8
- package/dist/{nylas-if-state.entry-276d61ad.cjs → nylas-if-state.entry-95fac42d.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-78cc680e.js → nylas-list-folders.entry-83c39684.js} +8 -8
- package/dist/{nylas-list-folders.entry-afe02f0e.cjs → nylas-list-folders.entry-8a22e0c8.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-6395c12f.cjs → nylas-list-threads.entry-54c582af.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-217088de.js → nylas-list-threads.entry-7ea370e1.js} +4 -4
- package/dist/{nylas-login.entry-e4d57589.js → nylas-login.entry-9115fd81.js} +7 -7
- package/dist/{nylas-login.entry-ec81e21b.cjs → nylas-login.entry-fb627e40.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-d4d929f1.cjs → nylas-mailbox-pagination.entry-04626d27.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-069673aa.js → nylas-mailbox-pagination.entry-3ff02cf9.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-2b9e4431.cjs → nylas-mailbox-toolbar-button.entry-8d00c789.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-03c5f5c8.js → nylas-mailbox-toolbar-button.entry-f752e925.js} +4 -4
- package/dist/{nylas-mailbox.entry-7e6b4791.js → nylas-mailbox.entry-99c27b6c.js} +4 -4
- package/dist/{nylas-mailbox.entry-1342178d.cjs → nylas-mailbox.entry-b3974f4e.cjs} +1 -1
- package/dist/{nylas-provider.entry-0ae8e70a.cjs → nylas-provider.entry-a3ad02a5.cjs} +1 -1
- package/dist/{nylas-provider.entry-498a7be9.js → nylas-provider.entry-c206aa32.js} +39 -39
- package/dist/nylas-reminder-emails.entry-414ce6fe.js +129 -0
- package/dist/nylas-reminder-emails.entry-59c07bfe.cjs +4 -0
- package/dist/nylas-reminder-time_2.entry-197d83a0.js +105 -0
- package/dist/nylas-reminder-time_2.entry-d79dcd85.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-7f389982.js +1447 -0
- package/dist/nylas-scheduler-editor.entry-f1c6964a.cjs +2 -0
- package/dist/nylas-scheduling.entry-1a8bd6fc.cjs +1 -0
- package/dist/nylas-scheduling.entry-4fa5381d.js +345 -0
- package/dist/{nylas-threads-refresh.entry-fc2d8028.js → nylas-threads-refresh.entry-20602e7b.js} +4 -4
- package/dist/{nylas-threads-refresh.entry-d020c89e.cjs → nylas-threads-refresh.entry-56b53449.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-f92f7e30.js → nylas-threads-search.entry-8872473c.js} +12 -12
- package/dist/{nylas-threads-search.entry-0abcbc10.cjs → nylas-threads-search.entry-8e0ec3ae.cjs} +1 -1
- package/dist/nylas-time-window-picker.entry-9ac542b7.js +316 -0
- package/dist/nylas-time-window-picker.entry-ca47f721.cjs +1 -0
- package/dist/{nylas-view-thread.entry-56080c89.cjs → nylas-view-thread.entry-1f758e43.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-2f1474cf.js → nylas-view-thread.entry-dcd3d5be.js} +6 -6
- package/dist/person-icon.entry-63b28ace.cjs +1 -0
- package/dist/person-icon.entry-93130c05.js +15 -0
- package/dist/{play-icon_2.entry-24ffa01f.js → play-icon_2.entry-6a99c32d.js} +6 -6
- package/dist/play-icon_2.entry-b67fb649.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +136 -90
- package/dist/{refresh-icon.entry-8395104b.js → refresh-icon.entry-84783c91.js} +4 -4
- package/dist/{refresh-icon.entry-cf4416b8.cjs → refresh-icon.entry-b49792fc.cjs} +1 -1
- package/dist/{register-component-b9cfcbaf-d40e1f3c.cjs → register-component-887199a9-003f96c5.cjs} +1 -1
- package/dist/{register-component-b9cfcbaf-c0147194.js → register-component-887199a9-b41dfa7a.js} +1 -1
- package/dist/scheduler-config-store-2a3b403d-73610089.js +27 -0
- package/dist/scheduler-config-store-2a3b403d-a5e3433a.cjs +1 -0
- package/dist/scheduler-store-fe281404-bddb1b6a.js +469 -0
- package/dist/scheduler-store-fe281404-c3e477f6.cjs +1 -0
- package/dist/textarea-component.entry-28c4bc05.cjs +1 -0
- package/dist/textarea-component.entry-40e959e5.js +36 -0
- package/dist/time-period-selector.entry-af71523a.cjs +1 -0
- package/dist/time-period-selector.entry-da5d8652.js +93 -0
- package/dist/{translate-icon.entry-d847f706.js → translate-icon.entry-92b83635.js} +5 -5
- package/dist/{translate-icon.entry-66533238.cjs → translate-icon.entry-a2ed4f76.cjs} +1 -1
- package/dist/warning-icon.entry-19f721c3.js +15 -0
- package/dist/warning-icon.entry-3ab9a59e.cjs +1 -0
- package/package.json +3 -3
- package/dist/add-circle-icon_22.entry-080abc71.cjs +0 -1
- package/dist/add-circle-icon_22.entry-bda9be31.js +0 -1818
- package/dist/archive-icon_7.entry-ca20da59.cjs +0 -1
- package/dist/chevron-icon_3.entry-74425e1f.js +0 -117
- package/dist/chevron-icon_3.entry-7ff803ad.cjs +0 -1
- package/dist/close-icon.entry-18e140ed.cjs +0 -1
- package/dist/close-icon.entry-6a8ea4a7.js +0 -15
- package/dist/document-refresh-icon.entry-f15f795a.cjs +0 -1
- package/dist/google-logo-icon_4.entry-38d5c2f2.cjs +0 -1
- package/dist/google-logo-icon_4.entry-5eca9538.js +0 -381
- package/dist/index-93c50de4.cjs +0 -37
- package/dist/index-f93f6948.js +0 -4006
- package/dist/loading-icon.entry-b563b2e6.js +0 -15
- package/dist/loading-icon.entry-fb04b893.cjs +0 -1
- package/dist/nylas-additional-participants.entry-33a45477.cjs +0 -1
- package/dist/nylas-additional-participants.entry-4b214308.js +0 -81
- package/dist/nylas-booked-event-card_10.entry-3e225025.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-e93bc290.js +0 -782
- package/dist/nylas-form-card.entry-0748fdd5.js +0 -54
- package/dist/nylas-form-card.entry-eb3607bc.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-4de2bb97.js +0 -2275
- package/dist/nylas-scheduler-editor.entry-72c91b7d.cjs +0 -7
- package/dist/nylas-scheduling.entry-1a004916.cjs +0 -1
- package/dist/nylas-scheduling.entry-4e18ab43.js +0 -235
- package/dist/people-icon.entry-431e5044.cjs +0 -1
- package/dist/people-icon.entry-b4778e15.js +0 -15
- package/dist/play-icon_2.entry-f97db395.cjs +0 -1
- package/dist/scheduler-config-store-07d98279-0610e42f.cjs +0 -1
- package/dist/scheduler-config-store-07d98279-3b70606c.js +0 -24
- package/dist/scheduler-store-24fd0e91-2dba20c2.cjs +0 -1
- package/dist/scheduler-store-24fd0e91-47098841.js +0 -302
- package/dist/time-period-selector.entry-1e849c2e.js +0 -76
- package/dist/time-period-selector.entry-d8f3462f.cjs +0 -1
- package/dist/warning-icon.entry-1f0f00ed.cjs +0 -1
- package/dist/warning-icon.entry-b5db0151.js +0 -15
|
@@ -0,0 +1,1134 @@
|
|
|
1
|
+
import { r as v, c as m, d, h as n, k as c, n as Y, H as g, g as Z, m as U, C as ce, D as de, E as x, G as fe, I as he, J as L, F as me } from "./index-5ccfd9df.js";
|
|
2
|
+
import { R as k } from "./register-component-887199a9-b41dfa7a.js";
|
|
3
|
+
import { T as E, a as J, g as pe, b as X } from "./constants-50c3e067-8a40a5fe.js";
|
|
4
|
+
import { s as S } from "./index-6d9eeb53-58c8980a.js";
|
|
5
|
+
import "./index-53420959-5fc8ad2b.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
const be = ":host{display:block}.nylas-booked-event-card{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}.booked-event-header .card-description{text-align:center}.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-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}", ue = be;
|
|
9
|
+
var ge = function(e, t, a, r) {
|
|
10
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
11
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
12
|
+
i = Reflect.decorate(e, t, a, r);
|
|
13
|
+
else
|
|
14
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
15
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
16
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
17
|
+
}, z = function(e, t) {
|
|
18
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
19
|
+
return Reflect.metadata(e, t);
|
|
20
|
+
};
|
|
21
|
+
const K = class {
|
|
22
|
+
constructor(e) {
|
|
23
|
+
v(this, e), this.cancelBookingButtonClicked = m(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = m(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = m(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = m(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
24
|
+
var o, i;
|
|
25
|
+
const t = new Date(this.selectedTimeslot.start_time), a = (i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.min_cancellation_notice;
|
|
26
|
+
t.getTime() - a * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
|
|
27
|
+
error: {
|
|
28
|
+
title: "Cancellation Error",
|
|
29
|
+
message: `You cannot cancel the booking within ${a} minutes of the event.`
|
|
30
|
+
}
|
|
31
|
+
}) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
32
|
+
}, this.handleRescheduleButtonClicked = () => {
|
|
33
|
+
const t = (a) => {
|
|
34
|
+
this.rescheduleBookedEventError.emit(a);
|
|
35
|
+
};
|
|
36
|
+
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
|
|
37
|
+
}, this.getPaticipantType = (t) => {
|
|
38
|
+
switch (t) {
|
|
39
|
+
case "host":
|
|
40
|
+
return "Host";
|
|
41
|
+
case "you":
|
|
42
|
+
return "You";
|
|
43
|
+
default:
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.configSettings = void 0, this.isLoading = void 0, this.selectedLanguage = navigator.language;
|
|
47
|
+
}
|
|
48
|
+
connectedCallback() {
|
|
49
|
+
}
|
|
50
|
+
disconnectedCallback() {
|
|
51
|
+
}
|
|
52
|
+
async componentWillLoad() {
|
|
53
|
+
d("[nylas-booked-event-card] Component will load");
|
|
54
|
+
}
|
|
55
|
+
async componentDidLoad() {
|
|
56
|
+
d("[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
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
var a, r, o, i, s, l, u, h, f, b, p, _, C, y, w, G, V, W;
|
|
60
|
+
const e = (a = this.configSettings) == null ? void 0 : a.booking_type, t = e && e !== "booking";
|
|
61
|
+
return n(g, { key: "6780a2a0b1c59efc4311278e85e6800f72ab6a98", part: "nbec" }, n("div", { key: "eed7c01aaaca8c92a65beccac1242efe1194f4a3", class: "nylas-booked-event-card" }, n("div", { key: "f20609db6794c30012f299017b01bf63752b6b7f", class: "booked-event-timezone" }, n("globe-icon", { key: "e2f277abf894b2c34e32f4cec4309e81a1b6e19b" }), E[this.selectedTimezone]), n("div", { key: "84c8bcdc7f247eade07d502cd480430cfb2894fd", class: "event-card-wrapper", part: "nbec__card" }, n("div", { key: "58835f4e2b261dff59e212573a2391cac9217cb6", class: "calendar-icon" }, n("calendar-check-icon", { key: "53e406d85941c03c7d0c7c5e86e071f948fe85bd" })), n("div", { key: "0e16b5cabfe5afcea5fd15fefbf88ed2558c5492", class: "booked-event-header" }, n("h2", { key: "8ad08c13c5860cf47b217cc9c6d82dddb0940894", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${c.t("bookingRescheduled")}` : t && !this.isLoading ? `${c.t("bookingSent")}` : `${c.t("bookingConfirmed")}`, "!"), n("div", { key: "07a056ef47e7d3c173c7ad67acedc5b94748d28f", class: "card-description", part: "nbec__description" }, t ? c.t("bookingSentDescription") : n("span", null, c.t("bookingConfirmedDescription")))), n("sp-divider", { key: "6aa78f2076d54974efc582fc85366238670bf844" }), n("div", { key: "252ff9346adc7af45eb2f8a740cb32c4ea90dc07", class: "booking-date-time" }, n("checkmark-circle-icon", { key: "a68a6dc9008dede91e318b0af6eb7c4ac18acc30" }), n("h3", { key: "082335ac6daf9344372befc4f6e3e91fa96bf0c0" }, c.t("bookingDateAndTimeHeader")), n("p", { key: "9961f6b1ffcf0abbe1c07884534f67a46dc470de" }, (r = this.selectedTimeslot) != null && r.start_time ? Y(new Date((o = this.selectedTimeslot) == null ? void 0 : o.start_time).toLocaleDateString(J[this.selectedLanguage], { dateStyle: "full" })) : "-", " ", n("br", { key: "e99ec5fb975ac10af2106eb62cfc2b6ab252081c" }), new Date((i = this.selectedTimeslot) == null ? void 0 : i.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date((s = this.selectedTimeslot) == null ? void 0 : s.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), n("div", { key: "cc0fe939d878ddbf1e240865d54c91cc545ff9a6", class: "booking-participants" }), !t && n("div", null, n("sp-divider", null), n("div", { class: {
|
|
62
|
+
footer: !0,
|
|
63
|
+
"no-footer": ((u = (l = this.configSettings) == null ? void 0 : l.scheduler) == null ? void 0 : u.hide_cancellation_options) && ((f = (h = this.configSettings) == null ? void 0 : h.scheduler) == null ? void 0 : f.hide_rescheduling_options) || ((b = this.configSettings) == null ? void 0 : b.booking_type) === "organizer-confirmation",
|
|
64
|
+
"no-template-cols": ((_ = (p = this.configSettings) == null ? void 0 : p.scheduler) == null ? void 0 : _.hide_cancellation_options) || ((y = (C = this.configSettings) == null ? void 0 : C.scheduler) == null ? void 0 : y.hide_rescheduling_options)
|
|
65
|
+
} }, !((G = (w = this.configSettings) == null ? void 0 : w.scheduler) != null && G.hide_cancellation_options) && n("button-component", { variant: "destructive", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${c.t("cancelBookingButton")}`), !((W = (V = this.configSettings) == null ? void 0 : V.scheduler) != null && W.hide_rescheduling_options) && n("button-component", { variant: "basic", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, `${c.t("rescheduleBookingButton")}`))))));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
ge([
|
|
69
|
+
k({
|
|
70
|
+
name: "nylas-booked-event-card",
|
|
71
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
72
|
+
["scheduler.bookingInfo", "bookingInfo"],
|
|
73
|
+
["scheduler.rescheduleBookingId", "rescheduleBookingId"],
|
|
74
|
+
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
75
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
76
|
+
["scheduler.isLoading", "isLoading"],
|
|
77
|
+
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
78
|
+
["scheduler.configSettings", "configSettings"]
|
|
79
|
+
]),
|
|
80
|
+
eventToProps: {
|
|
81
|
+
cancelBookingButtonClicked: async (e, t) => {
|
|
82
|
+
t.scheduler.setCancel(e.detail.bookingId);
|
|
83
|
+
},
|
|
84
|
+
rescheduleButtonClicked: async (e, t) => {
|
|
85
|
+
const a = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: r } = e.detail;
|
|
86
|
+
r && (!a || "error" in a) && r(a);
|
|
87
|
+
},
|
|
88
|
+
rescheduleBookedEventError: async (e, t) => {
|
|
89
|
+
d("nylas-booked-event-card", "rescheduleBookedEventError", e.detail);
|
|
90
|
+
},
|
|
91
|
+
cancelBookedEventValidationError: async (e, t) => {
|
|
92
|
+
d("nylas-booked-event-card", "cancelBookedEventValidationError", e.detail);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
fireRegisterEvent: !0
|
|
96
|
+
}),
|
|
97
|
+
z("design:type", Function),
|
|
98
|
+
z("design:paramtypes", []),
|
|
99
|
+
z("design:returntype", void 0)
|
|
100
|
+
], K.prototype, "render", null);
|
|
101
|
+
K.style = ue;
|
|
102
|
+
const ye = ":host{display:block;height:100%}.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:grid;grid-template-columns:1fr 1fr;gap:0.5rem;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{grid-template-columns:1fr}}.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)}button-component.back button{--dot-color:var(--nylas-base-800)}.guest-email-input{position:relative;display:flex;width:100%}", ve = ye;
|
|
103
|
+
var ke = function(e, t, a, r) {
|
|
104
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
105
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
106
|
+
i = Reflect.decorate(e, t, a, r);
|
|
107
|
+
else
|
|
108
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
109
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
110
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
111
|
+
}, I = function(e, t) {
|
|
112
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
113
|
+
return Reflect.metadata(e, t);
|
|
114
|
+
};
|
|
115
|
+
const B = /^[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])?)*$/, Q = class {
|
|
116
|
+
constructor(e) {
|
|
117
|
+
v(this, e), this.nameChanged = m(this, "nameChanged", 7), this.emailChanged = m(this, "emailChanged", 7), this.backButtonClicked = m(this, "backButtonClicked", 7), this.detailsConfirmed = m(this, "detailsConfirmed", 7), this.bookingFormError = m(this, "bookingFormError", 7), this.bookingFormSubmitted = m(this, "bookingFormSubmitted", 7), this.handleGuestChange = (t, a) => {
|
|
118
|
+
this.resetGuestEmailError(t);
|
|
119
|
+
const r = [...this.guestEmails];
|
|
120
|
+
r[t] = S(a), this.guestEmails = [...r];
|
|
121
|
+
}, this.handleGuestBlur = (t, a) => {
|
|
122
|
+
if (this.resetGuestEmailError(t), a === "") {
|
|
123
|
+
this.guestEmailErrors[t] = c.t("fieldRequired", { field: c.t("email") });
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (!B.test(a)) {
|
|
127
|
+
this.guestEmailErrors[t] = c.t("invalidInputFormat", { field: c.t("email") });
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.handleGuestChange(t, a);
|
|
131
|
+
}, this.addGuestButtonClickedHandler = (t) => {
|
|
132
|
+
t.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
|
|
133
|
+
}, this.removeGuestButtonClickHandler = (t, a) => {
|
|
134
|
+
t.preventDefault(), this.resetGuestEmailError(a);
|
|
135
|
+
const r = [...this.guestEmails];
|
|
136
|
+
r.splice(a, 1), this.guestEmails = [...r];
|
|
137
|
+
}, this.handleBackButtonClicked = (t) => {
|
|
138
|
+
t.preventDefault(), this.backButtonLoading = !0, this.backButtonClicked.emit();
|
|
139
|
+
}, this.bookButtonClickedHandler = async (t) => {
|
|
140
|
+
var l, u, h, f, b, p, _;
|
|
141
|
+
if (t.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
|
|
142
|
+
return;
|
|
143
|
+
d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
144
|
+
const r = this.name || ((u = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : u.name), o = this.email || ((f = (h = this.bookingInfo) == null ? void 0 : h.primaryParticipant) == null ? void 0 : f.email);
|
|
145
|
+
if (!r || r === "") {
|
|
146
|
+
this.isNameValid = !1, this.validationError.name = c.t("fieldRequired", { field: c.t("name") }) || "Name is required", this.bookingFormError.emit({
|
|
147
|
+
title: "Booking form error",
|
|
148
|
+
description: "Name is required"
|
|
149
|
+
});
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (!o || o === "") {
|
|
153
|
+
this.isEmailValid = !1, this.validationError.email = c.t("fieldRequired", { field: c.t("email") }) || "Email is required", this.bookingFormError.emit({
|
|
154
|
+
title: "Booking form error",
|
|
155
|
+
description: "Email is required"
|
|
156
|
+
});
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (!B.test(o)) {
|
|
160
|
+
this.isEmailValid = !1, this.validationError.email = c.t("invalidInputFormat", { field: c.t("email") }), this.bookingFormError.emit({
|
|
161
|
+
title: "Booking form error",
|
|
162
|
+
description: c.t("invalidInputFormat", { field: c.t("email") }) || "Invalid email"
|
|
163
|
+
});
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
let i = [];
|
|
167
|
+
if (this.guestEmails.length > 0) {
|
|
168
|
+
let C = !1;
|
|
169
|
+
if (this.guestEmails.forEach((y, w) => {
|
|
170
|
+
y === "" ? (C = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [w]: c.t("fieldRequired", { field: c.t("email") }) }) : B.test(y) || (C = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [w]: c.t("invalidInputFormat", { field: c.t("email") }) });
|
|
171
|
+
}), C) {
|
|
172
|
+
this.bookingFormError.emit({
|
|
173
|
+
title: "Booking form error",
|
|
174
|
+
description: c.t("invalidInputFormat", { field: c.t("guestEmail") }) || "Invalid guest email"
|
|
175
|
+
});
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
i = this.guestEmails.map((y) => ({ name: y.trim(), email: y.trim() }));
|
|
179
|
+
} else
|
|
180
|
+
(b = this.bookingInfo) != null && b.guests && (i = (p = this.bookingInfo) == null ? void 0 : p.guests);
|
|
181
|
+
const s = ((_ = this.bookingInfo) == null ? void 0 : _.additionalFields) || [];
|
|
182
|
+
this.detailsConfirmed.emit({
|
|
183
|
+
primaryParticipant: {
|
|
184
|
+
name: r,
|
|
185
|
+
email: o
|
|
186
|
+
},
|
|
187
|
+
guests: i,
|
|
188
|
+
additionalFields: { ...s, ...this.additionalFields }
|
|
189
|
+
});
|
|
190
|
+
}, this.updateAdditionalFields = (t, a) => {
|
|
191
|
+
this.additionalFields && (this.additionalFields[t] = a);
|
|
192
|
+
}, 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: "" }, this.backButtonLoading = !1;
|
|
193
|
+
}
|
|
194
|
+
connectedCallback() {
|
|
195
|
+
}
|
|
196
|
+
disconnectedCallback() {
|
|
197
|
+
}
|
|
198
|
+
componentWillLoad() {
|
|
199
|
+
var e, t, a;
|
|
200
|
+
d("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 = (a = this.bookingInfo.primaryParticipant) == null ? void 0 : a.email);
|
|
201
|
+
}
|
|
202
|
+
bookingInfoChangedHandler(e) {
|
|
203
|
+
e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
|
|
204
|
+
}
|
|
205
|
+
changeName(e) {
|
|
206
|
+
this.isNameValid = !0, this.validationError.name = "", this.name = S(e), this.nameChanged.emit(e);
|
|
207
|
+
}
|
|
208
|
+
changeEmail(e) {
|
|
209
|
+
this.isEmailValid = !0, this.validationError.email = "", this.email = S(e), this.emailChanged.emit(e);
|
|
210
|
+
}
|
|
211
|
+
resetGuestEmailError(e) {
|
|
212
|
+
const t = { ...this.guestEmailErrors };
|
|
213
|
+
delete t[e], this.guestEmailErrors = { ...t };
|
|
214
|
+
}
|
|
215
|
+
nylasFormInputChangedHandler(e) {
|
|
216
|
+
switch (e.detail.name) {
|
|
217
|
+
case "name":
|
|
218
|
+
this.changeName(e.detail.value);
|
|
219
|
+
break;
|
|
220
|
+
case "email":
|
|
221
|
+
this.changeEmail(e.detail.value);
|
|
222
|
+
break;
|
|
223
|
+
default:
|
|
224
|
+
if (e.detail.error) {
|
|
225
|
+
this.bookingFormError.emit({
|
|
226
|
+
title: "Booking form error",
|
|
227
|
+
description: e.detail.error
|
|
228
|
+
});
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
selectOptionChangedHandler(e) {
|
|
236
|
+
if (e.detail.error) {
|
|
237
|
+
this.bookingFormError.emit({
|
|
238
|
+
title: "Booking form error",
|
|
239
|
+
description: e.detail.error
|
|
240
|
+
});
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
244
|
+
}
|
|
245
|
+
switchToggledHandler(e) {
|
|
246
|
+
this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
|
|
247
|
+
}
|
|
248
|
+
checkboxToggledHandler(e) {
|
|
249
|
+
this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
|
|
250
|
+
}
|
|
251
|
+
radioChangedHandler(e) {
|
|
252
|
+
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
253
|
+
}
|
|
254
|
+
render() {
|
|
255
|
+
var e, t, a, r, o, i, s, l, u;
|
|
256
|
+
return n(g, { key: "dfb03508147a9d448ceea7f38fed7892ab86987d" }, n("form", { key: "e5dcfede19cd4d8f05c97e3fcaf60ef96ff1a0aa", onSubmit: (h) => this.bookButtonClickedHandler(h), noValidate: !0 }, n("div", { key: "400a076bfb94aad8a6172a5608f80a8c4586c370", class: "nylas-booking-form", part: "nbf" }, n("div", { key: "e22f48464b29f08e1fb09be0b419b2e1f7fb2214", class: "input-wrapper", part: "nbf__input-wrapper" }, n("input-component", { key: "2324c8cb0b108123f6d42538424cdba56ce17980", label: c.t("name"), name: "name", id: "name", defaultValue: ((t = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : t.name) || this.name, placeholder: c.t("namePlaceholder"), type: "text", required: !0, requiredError: c.t("fieldRequired", { field: c.t("name") }), patternError: c.t("invalidInputFormat", { field: c.t("name") }), part: "nbf__input-textfield" })), n("div", { key: "a7d061e77007e5cc4459a52b7cdb4b44f37d4a65", class: "input-wrapper", part: "nbf__input-wrapper" }, n("input-component", { key: "2b33dd7abbb7c129ca2e78b21b72f76284d359ad", label: c.t("email"), name: "email", id: "email", pattern: B, defaultValue: ((r = (a = this.bookingInfo) == null ? void 0 : a.primaryParticipant) == null ? void 0 : r.email) || this.email, placeholder: c.t("emailPlaceholder"), type: "email", required: !0, requiredError: c.t("fieldRequired", { field: c.t("email") }), patternError: c.t("invalidInputFormat", { field: c.t("email") }), part: "nbf__input-textfield" })), ((i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.hide_additional_guests) !== !0 && n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, this.guestEmails.map((h, f) => n("div", { class: "input-wrapper button-wrapper" }, n("label", { class: {
|
|
257
|
+
error: !!this.guestEmailErrors[f]
|
|
258
|
+
} }, c.t("guestEmail")), n("div", { class: "guest-email-input" }, n("input", { type: "email", id: `guest-email-${f}`, maxLength: 100, class: {
|
|
259
|
+
"guest-email": !0,
|
|
260
|
+
error: !!this.guestEmailErrors[f]
|
|
261
|
+
}, placeholder: c.t("guestEmailPlaceholder"), value: h, "data-index": f, part: "nbf__input-textfield", onBlur: (b) => {
|
|
262
|
+
var p;
|
|
263
|
+
return this.handleGuestBlur(f, (p = b.target) == null ? void 0 : p.value);
|
|
264
|
+
}, onInput: (b) => {
|
|
265
|
+
var p;
|
|
266
|
+
return this.handleGuestChange(f, (p = b.target) == null ? void 0 : p.value);
|
|
267
|
+
} }), n("button-component", { variant: "basic", onClick: (b) => this.removeGuestButtonClickHandler(b, f), class: {
|
|
268
|
+
"remove-guest": !0,
|
|
269
|
+
error: !!this.guestEmailErrors[f]
|
|
270
|
+
} }, n("close-icon", null))), n("p", { class: "help-text" }, this.guestEmailErrors[f]))), n("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (h) => this.addGuestButtonClickedHandler(h) }, n("div", { class: "button-content" }, n("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${c.t("addAnotherGuest")}` : `${c.t("addGuest")}`))), (u = Object.entries(((l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.additional_fields) || {})) == null ? void 0 : u.sort((h, f) => h[1].order - f[1].order).map((h) => {
|
|
271
|
+
var _, C;
|
|
272
|
+
const f = h[1], b = f.label, p = h[0];
|
|
273
|
+
switch (f.type) {
|
|
274
|
+
case "dropdown":
|
|
275
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("select-dropdown", { label: b, name: p, id: p, withSearch: !1, options: (_ = f.options) == null ? void 0 : _.map((y) => ({ value: y, label: y })), required: f.required, exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
|
|
276
|
+
case "checkbox":
|
|
277
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("checkbox-component", { label: b, name: p, id: p, required: f.required, part: "nbf__checkbox-component" }));
|
|
278
|
+
case "radio_button":
|
|
279
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("radio-button-group", { label: b, name: p, id: p, options: (C = f.options) == null ? void 0 : C.map((y) => ({ value: y, label: y })), required: f.required, part: "nbf__radio-button-group" }));
|
|
280
|
+
case "multi_line_text":
|
|
281
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("textarea-component", { label: b, name: p, id: p, required: f.required, part: "nbf__textarea-component" }));
|
|
282
|
+
default:
|
|
283
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("input-component", { label: b, name: p, id: p, type: f.type, requiredError: c.t("fieldRequired", { field: b }), required: f.required, part: "nbf__input-textfield" }));
|
|
284
|
+
}
|
|
285
|
+
})), n("div", { key: "9acfd79d281a81fe59b500ba66c3b98bd0d4b99f", class: "cta" }, n("button-component", { key: "11c577d9ee364e234996f30146e4ed28c643aa9f", variant: "basic", class: "back", part: "nbf__button-outline", isLoading: this.backButtonLoading && this.isLoading, onClick: this.handleBackButtonClicked }, n("slot", { key: "a7a74fb24614c31de5126bd7136d3fb112531433", name: "booking-form-back-label" }, `${c.t("backButton")}`)), n("button-component", { key: "615977369ab688a40fe3402d6f7dc4e770e2758e", variant: "primary", isLoading: !this.backButtonLoading && this.isLoading, disabled: this.isLoading, part: "nbf__button-primary", type: "submit" }, n("slot", { key: "d0b82dcf39d789b9c1ba94ffebda4c034d17e558", name: "booking-form-book-label" }, `${c.t("bookNowButton")}`)))));
|
|
286
|
+
}
|
|
287
|
+
get host() {
|
|
288
|
+
return Z(this);
|
|
289
|
+
}
|
|
290
|
+
static get watchers() {
|
|
291
|
+
return {
|
|
292
|
+
bookingInfo: ["bookingInfoChangedHandler"]
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
ke([
|
|
297
|
+
k({
|
|
298
|
+
name: "nylas-booking-form",
|
|
299
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
300
|
+
["scheduler.isLoading", "isLoading"],
|
|
301
|
+
["scheduler.bookingInfo", "bookingInfo"],
|
|
302
|
+
["scheduler.eventInfo", "eventInfo"],
|
|
303
|
+
["scheduler.configSettings", "configSettings"]
|
|
304
|
+
]),
|
|
305
|
+
eventToProps: {
|
|
306
|
+
backButtonClicked: async (e, t) => {
|
|
307
|
+
t.scheduler.toggleAdditionalData(!1);
|
|
308
|
+
},
|
|
309
|
+
nameChanged: async (e, t) => {
|
|
310
|
+
t.scheduler.setParticipantName(e.detail);
|
|
311
|
+
},
|
|
312
|
+
emailChanged: async (e, t) => {
|
|
313
|
+
t.scheduler.setParticipantEmail(e.detail);
|
|
314
|
+
},
|
|
315
|
+
detailsConfirmed: async (e, t) => {
|
|
316
|
+
d("nylas-booking-form", "detailsConfirmed", e.detail);
|
|
317
|
+
},
|
|
318
|
+
bookingFormSubmitted: async (e, t) => {
|
|
319
|
+
d("nylas-booking-form", "bookingFormSubmitted", e.detail);
|
|
320
|
+
},
|
|
321
|
+
bookingFormError: async (e, t) => {
|
|
322
|
+
d("nylas-booking-form", "bookingFormError", e.detail);
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
fireRegisterEvent: !0
|
|
326
|
+
}),
|
|
327
|
+
I("design:type", Function),
|
|
328
|
+
I("design:paramtypes", []),
|
|
329
|
+
I("design:returntype", void 0)
|
|
330
|
+
], Q.prototype, "render", null);
|
|
331
|
+
Q.style = ve;
|
|
332
|
+
const Ce = ":host{display:block;width:400px}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)}", _e = Ce;
|
|
333
|
+
var xe = function(e, t, a, r) {
|
|
334
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
335
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
336
|
+
i = Reflect.decorate(e, t, a, r);
|
|
337
|
+
else
|
|
338
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
339
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
340
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
341
|
+
}, R = function(e, t) {
|
|
342
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
343
|
+
return Reflect.metadata(e, t);
|
|
344
|
+
};
|
|
345
|
+
const ee = class {
|
|
346
|
+
constructor(e) {
|
|
347
|
+
var t, a;
|
|
348
|
+
v(this, e), this.goBackButtonClicked = m(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = m(this, "cancelBookingFormSubmitted", 7), this.cancelBookedEventError = m(this, "cancelBookedEventError", 7), this.cancelBookingFormError = m(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
349
|
+
this.goBackButtonClicked.emit();
|
|
350
|
+
}, this.handleSubmitCancelBooking = (r) => {
|
|
351
|
+
var s, l, u;
|
|
352
|
+
if (r.preventDefault(), !this.cancellationReason) {
|
|
353
|
+
this.cancellationError = c.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: c.t("cancelBokingFormError"), description: c.t("cancellationErrorMessage") });
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
const o = (l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.min_cancellation_notice;
|
|
357
|
+
if (this.selectedTimeslot && o && new Date((u = this.selectedTimeslot) == null ? void 0 : u.start_time).getTime() - o * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
|
|
358
|
+
this.cancelBookedEventError.emit({
|
|
359
|
+
error: {
|
|
360
|
+
title: c.t("cancellationErrorTitle"),
|
|
361
|
+
message: c.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: o })
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
367
|
+
const i = (h) => {
|
|
368
|
+
this.cancelBookedEventError.emit(h);
|
|
369
|
+
};
|
|
370
|
+
this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler: i }) : this.rejectBookingId && this.cancelBookingFormSubmitted.emit({ bookingId: this.rejectBookingId, action: "reject", reason: this.cancellationReason, errorHandler: i });
|
|
371
|
+
}, this.handleOnChangeCancellationReason = (r) => {
|
|
372
|
+
this.cancellationError = "", this.cancellationReason = r.target.value;
|
|
373
|
+
}, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((a = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : a.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
374
|
+
}
|
|
375
|
+
configSettingsChangedHandler(e) {
|
|
376
|
+
var t;
|
|
377
|
+
this.cancellationPolicy = ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
378
|
+
}
|
|
379
|
+
connectedCallback() {
|
|
380
|
+
d("[nylas-cancel-booking-form] Component connected");
|
|
381
|
+
}
|
|
382
|
+
async componentWillLoad() {
|
|
383
|
+
d("[nylas-cancel-booking-form] Component will load");
|
|
384
|
+
}
|
|
385
|
+
async componentDidLoad() {
|
|
386
|
+
d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.');
|
|
387
|
+
}
|
|
388
|
+
disconnectedCallback() {
|
|
389
|
+
d("[nylas-cancel-booking-form] Component disconnected");
|
|
390
|
+
}
|
|
391
|
+
render() {
|
|
392
|
+
var e, t;
|
|
393
|
+
return n(g, { key: "c23cc27036e9e9bc962167c488cc9421bab8fb85", part: "ncbf" }, n("sp-theme", { key: "b564e8a58f6ae6d9a34cd0a6ae4c9e367a1ee311", theme: "spectrum", scale: "medium" }, n("div", { key: "0a798c5147cea6ef02bb6726dc6aeed66bfc5926", class: "nylas-cancel-booking-form", part: "ncbf__card" }, n("div", { key: "411397b4068f43df5b1bdff6cfe695d4f78acb9a", class: "nylas-cancel-booking-form__calendar-icon", part: "ncbf__icon" }, n("calendar-cancel-icon", { key: "c059338046a04a4022b83808ba893832151315cb" })), n("h3", { key: "a40f68d17842070b4ec26bb5850c6f02f4a25a98", class: "nylas-cancel-booking-form__title", part: "ncbf__title" }, c.t("cancelBookingTitle")), n("div", { key: "eddc7863de85447503e4c3ed846738415b8b5421", class: "nylas-cancel-booking-form__description", part: "ncbf__description" }, (t = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && t.cancellation_policy ? this.cancellationPolicy : `${c.t("cancelBookingMessage")}`), n("form", { key: "62561eacf920107009da52b42c4be8b02d04d8ef", onSubmit: this.handleSubmitCancelBooking }, n("sp-field-label", { key: "f274ccd80f41d9f507948891eaca7b9514c4d9b3", for: "cancel-reason", class: this.cancellationError ? "error" : "" }, c.t("reasonForCancellation"), " ", n("span", { key: "6507452f20b4a430e831ca7c5b5710f0f3eed303", class: "required" }, "*")), n("sp-textfield", { key: "416b5d42e480b98dbe23d74327e3706cbed1dae3", id: "cancel-reason", class: this.cancellationError ? "error" : "", part: "ncbf__reason-textarea", multiline: !0, value: this.cancellationReason, onInput: this.handleOnChangeCancellationReason, onFocus: this.handleOnChangeCancellationReason, invalid: !!this.cancellationError }, n("sp-help-text", { key: "7fa251f7672461e8d2da6d7f09fc6a46203f6ce2", slot: "negative-help-text" }, this.cancellationError)), n("sp-button", { key: "11be3a657ed63a5ca9410df88ad94a80a3b6a4d2", variant: "primary", class: "cancel", type: "submit", part: "ncbf__button-cta", disabled: this.isLoading }, c.t("cancelBookingButton")), !!this.eventInfo && n("sp-button", { variant: "secondary", class: "back", treatment: "outline", part: "ncbf__button-outline", onClick: this.handleGoBackClicked }, c.t("goBackButton"))))));
|
|
394
|
+
}
|
|
395
|
+
static get watchers() {
|
|
396
|
+
return {
|
|
397
|
+
configSettings: ["configSettingsChangedHandler"]
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
xe([
|
|
402
|
+
k({
|
|
403
|
+
name: "nylas-cancel-booking-form",
|
|
404
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
405
|
+
["scheduler.configSettings", "configSettings"],
|
|
406
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
407
|
+
["scheduler.eventInfo", "eventInfo"],
|
|
408
|
+
["scheduler.isLoading", "isLoading"],
|
|
409
|
+
["scheduler.cancelBookingId", "cancelBookingId"],
|
|
410
|
+
["scheduler.rejectBookingId", "rejectBookingId"]
|
|
411
|
+
]),
|
|
412
|
+
eventToProps: {
|
|
413
|
+
cancelBookingFormSubmitted: async (e, t) => {
|
|
414
|
+
const { action: a, errorHandler: r } = e.detail;
|
|
415
|
+
if (a === "cancel") {
|
|
416
|
+
const o = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason);
|
|
417
|
+
r && (!o || "error" in o) && r(o);
|
|
418
|
+
} else if (a === "reject") {
|
|
419
|
+
const o = await t.scheduler.updateBooking({
|
|
420
|
+
bookingId: e.detail.bookingId,
|
|
421
|
+
status: "cancelled",
|
|
422
|
+
reason: e.detail.reason
|
|
423
|
+
});
|
|
424
|
+
r && (!o || "error" in o) && r(o);
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
goBackButtonClicked: async (e, t) => {
|
|
428
|
+
d("nylas-cancel-booking-form", "goBackButtonClicked", e.detail), t.scheduler.goBack();
|
|
429
|
+
},
|
|
430
|
+
cancelBookedEventError: async (e, t) => {
|
|
431
|
+
d("nylas-cancel-booking-form", "cancelBookedEventError", e.detail);
|
|
432
|
+
},
|
|
433
|
+
cancelBookingFormError: async (e, t) => {
|
|
434
|
+
d("nylas-cancel-booking-form", "cancelBookingFormError", e.detail);
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
fireRegisterEvent: !0
|
|
438
|
+
}),
|
|
439
|
+
R("design:type", Function),
|
|
440
|
+
R("design:paramtypes", []),
|
|
441
|
+
R("design:returntype", void 0)
|
|
442
|
+
], ee.prototype, "render", null);
|
|
443
|
+
ee.style = _e;
|
|
444
|
+
const we = ":host{display:block}.nylas-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);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%}button-component{width:100%}", Ee = we;
|
|
445
|
+
var Be = function(e, t, a, r) {
|
|
446
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
447
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
448
|
+
i = Reflect.decorate(e, t, a, r);
|
|
449
|
+
else
|
|
450
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
451
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
452
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
453
|
+
}, j = function(e, t) {
|
|
454
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
455
|
+
return Reflect.metadata(e, t);
|
|
456
|
+
};
|
|
457
|
+
const te = class {
|
|
458
|
+
constructor(e) {
|
|
459
|
+
v(this, e), this.closeCancelEventCardClicked = m(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = m(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
460
|
+
this.isClosing = !0;
|
|
461
|
+
const t = (a) => {
|
|
462
|
+
this.cancelledEventCardError.emit(a), this.isClosing = !1;
|
|
463
|
+
};
|
|
464
|
+
this.closeCancelEventCardClicked.emit({ errorHandler: t });
|
|
465
|
+
}, this.cancelledEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
|
|
466
|
+
}
|
|
467
|
+
connectedCallback() {
|
|
468
|
+
d("[nylas-cancelled-event-card] Component connected");
|
|
469
|
+
}
|
|
470
|
+
async componentWillLoad() {
|
|
471
|
+
d("[nylas-cancelled-event-card] Component will load");
|
|
472
|
+
}
|
|
473
|
+
async componentDidLoad() {
|
|
474
|
+
d("[nylas-cancelled-event-card] Component did load"), this.cancelledEventInfo || console.warn('[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.');
|
|
475
|
+
}
|
|
476
|
+
disconnectedCallback() {
|
|
477
|
+
d("[nylas-cancelled-event-card] Component disconnected");
|
|
478
|
+
}
|
|
479
|
+
render() {
|
|
480
|
+
var e, t;
|
|
481
|
+
return n(g, { key: "8111e14b17a302b19c8378770d4b24312abcbaea", part: "ncec" }, n("div", { key: "40868919cdd31072168ef1b56411c575a4185397", class: "nylas-cancelled-event-card", part: "ncec__card" }, n("div", { key: "301ec3b37640d03287a4f039f87f5d630fb7fcc6", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "9f3a6448d55f2fa864558789232149af80b260f9" })), n("h3", { key: "1c462c7b2c6a9a03878cb752efa87fbcf991551d", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, c.t("bookingCancelledTitle"), "!"), n("div", { key: "65cf7fe3b2b9ea22bb4e31b80a8dd4101ee9b95b", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, c.t("bookingCancelledMessage"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), n("div", { key: "64d328e3bfd3f573374f18f93101c8ffca343ffa", class: "nylas-cancelled-event-card__cta" }, n("button-component", { key: "5a63b7ec5acb381f457d9b8a4f37440ebece4ea9", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${c.t("closingButton")}...` : `${c.t("closeButton")}`))));
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
Be([
|
|
485
|
+
k({
|
|
486
|
+
name: "nylas-cancelled-event-card",
|
|
487
|
+
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
488
|
+
eventToProps: {
|
|
489
|
+
closeCancelEventCardClicked: async (e, t) => {
|
|
490
|
+
const a = await t.scheduler.resetCancel(), { errorHandler: r } = e.detail;
|
|
491
|
+
r && (!a || "error" in a) && r(a);
|
|
492
|
+
},
|
|
493
|
+
cancelledEventCardError: async (e, t) => {
|
|
494
|
+
d("nylas-cancelled-event-card", "cancelledEventCardError", e.detail);
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
fireRegisterEvent: !0
|
|
498
|
+
}),
|
|
499
|
+
j("design:type", Function),
|
|
500
|
+
j("design:paramtypes", []),
|
|
501
|
+
j("design:returntype", void 0)
|
|
502
|
+
], te.prototype, "render", null);
|
|
503
|
+
te.style = Ee;
|
|
504
|
+
const Te = ':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-confirmed-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);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-confirmed-event-card{width:inherit}}.nylas-confirmed-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-confirmed-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-confirmed-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-confirmed-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%}button-component{width:100%}', De = Te;
|
|
505
|
+
var Le = function(e, t, a, r) {
|
|
506
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
507
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
508
|
+
i = Reflect.decorate(e, t, a, r);
|
|
509
|
+
else
|
|
510
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
511
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
512
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
513
|
+
}, F = function(e, t) {
|
|
514
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
515
|
+
return Reflect.metadata(e, t);
|
|
516
|
+
};
|
|
517
|
+
const ne = class {
|
|
518
|
+
constructor(e) {
|
|
519
|
+
v(this, e), this.closeConfirmEventCardClicked = m(this, "closeConfirmEventCardClicked", 7), this.confirmedEventCardError = m(this, "confirmedEventCardError", 7), this.handleCloseClicked = () => {
|
|
520
|
+
this.isClosing = !0;
|
|
521
|
+
const t = (a) => {
|
|
522
|
+
this.confirmedEventCardError.emit(a), this.isClosing = !1;
|
|
523
|
+
};
|
|
524
|
+
this.closeConfirmEventCardClicked.emit({ errorHandler: t });
|
|
525
|
+
}, this.confirmedEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
|
|
526
|
+
}
|
|
527
|
+
connectedCallback() {
|
|
528
|
+
d("[nylas-confirmed-event-card] Component connected");
|
|
529
|
+
}
|
|
530
|
+
async componentWillLoad() {
|
|
531
|
+
d("[nylas-confirmed-event-card] Component will load");
|
|
532
|
+
}
|
|
533
|
+
async componentDidLoad() {
|
|
534
|
+
d("[nylas-confirmed-event-card] Component did load"), this.confirmedEventInfo || console.warn('[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.');
|
|
535
|
+
}
|
|
536
|
+
disconnectedCallback() {
|
|
537
|
+
d("[nylas-confirmed-event-card] Component disconnected");
|
|
538
|
+
}
|
|
539
|
+
render() {
|
|
540
|
+
var e, t;
|
|
541
|
+
return n(g, { key: "6aeced068b3230d9e9f355edf8d63e18bceee16a", part: "ncec" }, n("div", { key: "1b8a17385b2d2a02a8d26bad8a15f441c3e2b103", class: "nylas-confirmed-event-card", part: "ncec__card" }, n("div", { key: "50326736ae43ee91ca028f4db425689250bd1fa3", class: "nylas-confirmed-event-card__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "548af2467f3ff98b5252f4394a06d6eab9574e74" })), n("h3", { key: "3d106503a148346f7fa252966671c88a7d7bc52a", class: "nylas-confirmed-event-card__title", part: "ncec__title" }, c.t("confirmedEventCardTitle"), "!"), n("div", { key: "87a843031357c84da0d402c214ef13be08c40537", class: "nylas-confirmed-event-card__description", part: "ncec__description" }, c.t("confirmedEventCardDescription"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), n("div", { key: "9b615e9ae0a49cd70860390a2d603e614077c969", class: "nylas-confirmed-event-card__cta" }, n("button-component", { key: "5c0c63ca72303829bbb1b586375ac93c6a0a1968", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${c.t("closingButton")}...` : `${c.t("closeButton")}`))));
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
Le([
|
|
545
|
+
k({
|
|
546
|
+
name: "nylas-confirmed-event-card",
|
|
547
|
+
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
548
|
+
eventToProps: {
|
|
549
|
+
closeConfirmEventCardClicked: async (e, t) => {
|
|
550
|
+
const a = await t.scheduler.resetConfirm(), { errorHandler: r } = e.detail;
|
|
551
|
+
r && (!a || "error" in a) && r(a);
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
fireRegisterEvent: !0
|
|
555
|
+
}),
|
|
556
|
+
F("design:type", Function),
|
|
557
|
+
F("design:paramtypes", []),
|
|
558
|
+
F("design:returntype", void 0)
|
|
559
|
+
], ne.prototype, "render", null);
|
|
560
|
+
ne.style = De;
|
|
561
|
+
const P = /* @__PURE__ */ new Date(), M = /* @__PURE__ */ new Date();
|
|
562
|
+
function D(e, t, a, r) {
|
|
563
|
+
function o(i) {
|
|
564
|
+
return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
|
|
565
|
+
}
|
|
566
|
+
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) => {
|
|
567
|
+
const s = o(i), l = o.ceil(i);
|
|
568
|
+
return i - s < l - i ? s : l;
|
|
569
|
+
}, o.offset = (i, s) => (t(i = /* @__PURE__ */ new Date(+i), s == null ? 1 : Math.floor(s)), i), o.range = (i, s, l) => {
|
|
570
|
+
const u = [];
|
|
571
|
+
if (i = o.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < s) || !(l > 0))
|
|
572
|
+
return u;
|
|
573
|
+
let h;
|
|
574
|
+
do
|
|
575
|
+
u.push(h = /* @__PURE__ */ new Date(+i)), t(i, l), e(i);
|
|
576
|
+
while (h < i && i < s);
|
|
577
|
+
return u;
|
|
578
|
+
}, o.filter = (i) => D((s) => {
|
|
579
|
+
if (s >= s)
|
|
580
|
+
for (; e(s), !i(s); )
|
|
581
|
+
s.setTime(s - 1);
|
|
582
|
+
}, (s, l) => {
|
|
583
|
+
if (s >= s)
|
|
584
|
+
if (l < 0)
|
|
585
|
+
for (; ++l <= 0; )
|
|
586
|
+
for (; t(s, -1), !i(s); )
|
|
587
|
+
;
|
|
588
|
+
else
|
|
589
|
+
for (; --l >= 0; )
|
|
590
|
+
for (; t(s, 1), !i(s); )
|
|
591
|
+
;
|
|
592
|
+
}), a && (o.count = (i, s) => (P.setTime(+i), M.setTime(+s), e(P), e(M), Math.floor(a(P, M))), o.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? o.filter(r ? (s) => r(s) % i === 0 : (s) => o.count(0, s) % i === 0) : o)), o;
|
|
593
|
+
}
|
|
594
|
+
const Se = 1e3, ae = Se * 60, ze = ae * 60, T = ze * 24, N = D(
|
|
595
|
+
(e) => e.setHours(0, 0, 0, 0),
|
|
596
|
+
(e, t) => e.setDate(e.getDate() + t),
|
|
597
|
+
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * ae) / T,
|
|
598
|
+
(e) => e.getDate() - 1
|
|
599
|
+
);
|
|
600
|
+
D((e) => {
|
|
601
|
+
e.setUTCHours(0, 0, 0, 0);
|
|
602
|
+
}, (e, t) => {
|
|
603
|
+
e.setUTCDate(e.getUTCDate() + t);
|
|
604
|
+
}, (e, t) => (t - e) / T, (e) => e.getUTCDate() - 1);
|
|
605
|
+
D((e) => {
|
|
606
|
+
e.setUTCHours(0, 0, 0, 0);
|
|
607
|
+
}, (e, t) => {
|
|
608
|
+
e.setUTCDate(e.getUTCDate() + t);
|
|
609
|
+
}, (e, t) => (t - e) / T, (e) => Math.floor(e / T));
|
|
610
|
+
const Ie = ':host{display:block;min-height:444px}@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)}', Re = Ie;
|
|
611
|
+
var je = function(e, t, a, r) {
|
|
612
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
613
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
614
|
+
i = Reflect.decorate(e, t, a, r);
|
|
615
|
+
else
|
|
616
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
617
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
618
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
619
|
+
}, O = function(e, t) {
|
|
620
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
621
|
+
return Reflect.metadata(e, t);
|
|
622
|
+
};
|
|
623
|
+
const ie = class {
|
|
624
|
+
constructor(e) {
|
|
625
|
+
v(this, e), this.dateSelected = m(this, "dateSelected", 7), this.monthChanged = m(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.configSettings = void 0, this.selectedLanguage = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
|
|
626
|
+
}
|
|
627
|
+
configSettingsChanged(e) {
|
|
628
|
+
var o;
|
|
629
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.available_days_in_future;
|
|
630
|
+
if (a === void 0)
|
|
631
|
+
return;
|
|
632
|
+
U(/* @__PURE__ */ new Date(), a).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
|
|
633
|
+
}
|
|
634
|
+
selectedLanguageChanged(e) {
|
|
635
|
+
c.changeLanguage(e);
|
|
636
|
+
}
|
|
637
|
+
connectedCallback() {
|
|
638
|
+
}
|
|
639
|
+
disconnectedCallback() {
|
|
640
|
+
}
|
|
641
|
+
componentWillLoad() {
|
|
642
|
+
}
|
|
643
|
+
getDates() {
|
|
644
|
+
const e = ce(this.month), t = de(this.month);
|
|
645
|
+
return N.range(N.offset(t, -t.getDay()), N.offset(e, 7 - e.getDay()));
|
|
646
|
+
}
|
|
647
|
+
selectDate(e) {
|
|
648
|
+
this.dateSelected.emit(e);
|
|
649
|
+
}
|
|
650
|
+
changeMonth(e) {
|
|
651
|
+
var o, i;
|
|
652
|
+
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
653
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.available_days_in_future;
|
|
654
|
+
U(/* @__PURE__ */ new Date(), a).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
|
|
655
|
+
}
|
|
656
|
+
isSelected(e, t, a) {
|
|
657
|
+
return e && t && x(e, t) && a && (a == null ? void 0 : a.length) > 0;
|
|
658
|
+
}
|
|
659
|
+
isDisabled(e, t) {
|
|
660
|
+
return e && (t == null ? void 0 : t.find((a) => x(a, e))) === void 0;
|
|
661
|
+
}
|
|
662
|
+
render() {
|
|
663
|
+
var e, t, a, r, o, i, s;
|
|
664
|
+
return n(g, { key: "d190c559015a241a9d3f9c079b3537b53474bdf0", part: "ndp" }, n("div", { key: "94cdb44f8708d7463e160d840a76460df41de7d2", class: "nylas-date-picker" }, n("div", { key: "36768c11483f7974d4446a79d8d6909f25955050", class: "title", part: "ndp__title" }, (e = this.configSettings) != null && e.name ? n("h1", null, (t = this.configSettings) == null ? void 0 : t.name) : ((r = (a = this.configSettings) == null ? void 0 : a.organizer) == null ? void 0 : r.name) && n("h1", null, n("person-icon", null), ((i = (o = this.configSettings) == null ? void 0 : o.organizer) == null ? void 0 : i.name) || "Organizer"), n("p", { key: "1e10af49ec273f1b7e73d470e7c21c4191842bd2" }, n("clock-icon", { key: "2e8efb77352487e3f8e111a0148c51d182d46267" }), this.eventDuration ? fe(this.eventDuration) : `- ${c.t("time.minutes")}`)), n("div", { key: "ff6508bda67fbd265e7632d6e09ec25e03563e59", class: "header flex-row" }, n("h2", { key: "02e919f318f30ded3b2a5d076920f4e27fe4b2a0", part: "ndp__month-header" }, n("strong", { key: "e103cb35117d4eff63ad8555b1a2f79d0630d9e6" }, he(this.month.toLocaleDateString(void 0, { month: "long" }).toLocaleLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), n("div", { key: "7360abf866211cd5612697ad152e78303a8b3d4a", class: "pagination" }, n("button", { key: "da9d6193ce2d5cc95d3921b9d9c6c8c73c51a64e", 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" }, n("chevron-icon", { key: "a38ff287446d5ebfcb1a9429df2e9abd0e4b9ea1" })), n("button", { key: "2343638469b399f42bfe510b0c7bc1f7bb6cc882", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, n("chevron-icon", { key: "26376c6666d4285c063c0b413dd5f024b32e2d66" })))), n("div", { key: "1bc9aef1cbee7eec4c8982f2c14d76a9b5345114", class: "dates" }, [
|
|
665
|
+
c.t("days.sunday"),
|
|
666
|
+
c.t("days.monday"),
|
|
667
|
+
c.t("days.tuesday"),
|
|
668
|
+
c.t("days.wednesday"),
|
|
669
|
+
c.t("days.thursday"),
|
|
670
|
+
c.t("days.friday"),
|
|
671
|
+
c.t("days.saturday")
|
|
672
|
+
].map((l) => n("div", { class: "day", part: "ndp__day" }, l)), this.dates.map((l, u) => {
|
|
673
|
+
var f;
|
|
674
|
+
const h = this.isDisabled(l, this.selectableDates);
|
|
675
|
+
return this.isLoading ? n("button", { disabled: !0, class: {
|
|
676
|
+
"date day-skeleton": !0,
|
|
677
|
+
"current-month": L(l, this.month)
|
|
678
|
+
}, style: { animationDelay: `${u * 20}ms` }, part: "ndp__date ndp__date--disabled" }, l.getDate()) : n("button", { class: {
|
|
679
|
+
date: !0,
|
|
680
|
+
selected: !!(this.selectedDate && x(l, this.selectedDate) && this.selectableDates && ((f = this.selectableDates) == null ? void 0 : f.length) > 0),
|
|
681
|
+
"current-day": x(l, /* @__PURE__ */ new Date()),
|
|
682
|
+
"current-month": L(l, this.month)
|
|
683
|
+
}, "aria-lang": l.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: h, onClick: () => this.selectDate(l), part: `ndp__date ${this.isSelected(l, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${x(l, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${L(l, this.month) ? "ndp__date--current-month" : ""}` }, l.getDate());
|
|
684
|
+
}))));
|
|
685
|
+
}
|
|
686
|
+
static get watchers() {
|
|
687
|
+
return {
|
|
688
|
+
configSettings: ["configSettingsChanged"],
|
|
689
|
+
selectedLanguage: ["selectedLanguageChanged"]
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
je([
|
|
694
|
+
k({
|
|
695
|
+
name: "nylas-date-picker",
|
|
696
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
697
|
+
["scheduler.selectableDates", "selectableDates"],
|
|
698
|
+
["scheduler.selectedDate", "selectedDate"],
|
|
699
|
+
["scheduler.isLoading", "isLoading"],
|
|
700
|
+
["scheduler.configSettings", "configSettings"],
|
|
701
|
+
["scheduler.eventDuration", "eventDuration"],
|
|
702
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
703
|
+
]),
|
|
704
|
+
eventToProps: {
|
|
705
|
+
dateSelected: async (e, t) => {
|
|
706
|
+
d("nylas-date-picker", "dateSelected", e.detail), t.scheduler.selectDate(e.detail);
|
|
707
|
+
},
|
|
708
|
+
monthChanged: async (e, t) => {
|
|
709
|
+
d("nylas-date-picker", "monthChanged", e.detail);
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
fireRegisterEvent: !0
|
|
713
|
+
}),
|
|
714
|
+
O("design:type", Function),
|
|
715
|
+
O("design:paramtypes", []),
|
|
716
|
+
O("design:returntype", void 0)
|
|
717
|
+
], ie.prototype, "render", null);
|
|
718
|
+
ie.style = Re;
|
|
719
|
+
const Fe = ":host{display:block}.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}", Pe = Fe;
|
|
720
|
+
var Me = function(e, t, a, r) {
|
|
721
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
722
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
723
|
+
i = Reflect.decorate(e, t, a, r);
|
|
724
|
+
else
|
|
725
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
726
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
727
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
728
|
+
}, $ = function(e, t) {
|
|
729
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
730
|
+
return Reflect.metadata(e, t);
|
|
731
|
+
};
|
|
732
|
+
const oe = class {
|
|
733
|
+
constructor(e) {
|
|
734
|
+
v(this, e), this.timezoneChanged = m(this, "timezoneChanged", 7), this.languageChanged = m(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
|
|
735
|
+
}
|
|
736
|
+
connectedCallback() {
|
|
737
|
+
}
|
|
738
|
+
disconnectedCallback() {
|
|
739
|
+
}
|
|
740
|
+
componentWillLoad() {
|
|
741
|
+
}
|
|
742
|
+
changeTimezone(e) {
|
|
743
|
+
this.selectedTimezone = e, this.timezoneChanged.emit(e);
|
|
744
|
+
}
|
|
745
|
+
changeLanguage(e) {
|
|
746
|
+
this.selectedLanguage = e, this.languageChanged.emit(e);
|
|
747
|
+
}
|
|
748
|
+
nylasFormDropdownChangedHandler(e) {
|
|
749
|
+
const { name: t, value: a } = e.detail;
|
|
750
|
+
t === "timezone" ? this.changeTimezone(a) : t === "language" && this.changeLanguage(a);
|
|
751
|
+
}
|
|
752
|
+
getTimezoneLabelHTML(e) {
|
|
753
|
+
const t = pe(e);
|
|
754
|
+
return n("span", { class: "timezone-label", style: {
|
|
755
|
+
display: "flex",
|
|
756
|
+
alignItems: "center",
|
|
757
|
+
justifyContent: "space-between",
|
|
758
|
+
width: "-webkit-fill-available"
|
|
759
|
+
} }, E[e], " ", n("span", { class: "timezone-offset", style: {
|
|
760
|
+
fontSize: "14px",
|
|
761
|
+
fontWeight: "400",
|
|
762
|
+
color: "var(--nylas-base-500)"
|
|
763
|
+
} }, t));
|
|
764
|
+
}
|
|
765
|
+
render() {
|
|
766
|
+
const e = Object.keys(E).map((a) => ({
|
|
767
|
+
labelHTML: this.getTimezoneLabelHTML(a),
|
|
768
|
+
label: E[a],
|
|
769
|
+
value: a
|
|
770
|
+
})), t = Object.keys(X).map((a) => ({
|
|
771
|
+
label: X[a],
|
|
772
|
+
value: a
|
|
773
|
+
}));
|
|
774
|
+
return n(g, { key: "2fe8f980818094bf4eb48eba4d0f0cb793e751d5" }, n("div", { key: "72091abf67ed29d4ce3f78697bc7d2bfddab8d4e", class: "nylas-locale-switch", part: "nls" }, n("div", { key: "ef9897cc34c3661dc1f8dc8d2ee749baf7985394", class: {
|
|
775
|
+
"select-wrapper": !0,
|
|
776
|
+
timezone: !0
|
|
777
|
+
}, part: "nls__timezone" }, n("select-dropdown", { key: "8231931bb66ee011fb069a6375fcab7f068e1074", name: "timezone", options: e, defaultSelectedOption: e.find((a) => a.value == this.selectedTimezone), exportparts: "sd_dropdown: nls__timezone-dropdown, sd_dropdown-button: nls__timezone-drop-button, sd_dropdown-button-selected-label: nls__timezone-drop-button-selected-label, sd_dropdown-content: nls__timezone-drop-content, sd_dropdown_label: nls__timezone-drop-label" }, n("span", { key: "30be0f1f09a1c77ee06feed2c07bbf843faf45c4", slot: "select-icon" }, n("globe-icon", { key: "8e7bd4883ab9f444dfcb5970032f2c78a13adf6c", width: "20", height: "20" })))), n("div", { key: "6b121b74543d494e58925086acab47b4b1bcd6ed", class: {
|
|
778
|
+
"select-wrapper": !0,
|
|
779
|
+
language: !0
|
|
780
|
+
}, part: "nls__language" }, n("select-dropdown", { key: "437741d5c3f9ba6f9714f845ac66c76bc6c11bf9", name: "language", options: t, defaultSelectedOption: t.find((a) => a.value == this.selectedLanguage), exportparts: "sd_dropdown: nls__language-dropdown, sd_dropdown-button: nls__language-drop-button, sd_dropdown-content: nls__language-drop-content, sd_dropdown_label: nls__language-drop-label" }, n("span", { key: "1e673936054269e88d3a37acd62794e7b7bbb0a4", slot: "select-icon" }, n("translate-icon", { key: "532aee94adb88cf58f931acc07f13ce118432b7a", width: "20", height: "20" }))))));
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
Me([
|
|
784
|
+
k({
|
|
785
|
+
name: "nylas-locale-switch",
|
|
786
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
787
|
+
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
788
|
+
["scheduler.selectedTimezone", "selectedTimezone"]
|
|
789
|
+
]),
|
|
790
|
+
eventToProps: {
|
|
791
|
+
timezoneChanged: async (e, t) => {
|
|
792
|
+
d("nylas-locale-switch", "timezoneChanged", e.detail), t.scheduler.selectTimezone(e.detail);
|
|
793
|
+
},
|
|
794
|
+
languageChanged: async (e, t) => {
|
|
795
|
+
d("nylas-locale-switch", "languageChanged", e.detail), t.scheduler.selectLanguage(e.detail);
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
fireRegisterEvent: !0
|
|
799
|
+
}),
|
|
800
|
+
$("design:type", Function),
|
|
801
|
+
$("design:paramtypes", []),
|
|
802
|
+
$("design:returntype", void 0)
|
|
803
|
+
], oe.prototype, "render", null);
|
|
804
|
+
oe.style = Pe;
|
|
805
|
+
const Ne = ".sc-nylas-logo-h{display:flex}", Oe = Ne, $e = class {
|
|
806
|
+
constructor(e) {
|
|
807
|
+
v(this, e), this.width = "69", this.height = "24";
|
|
808
|
+
}
|
|
809
|
+
render() {
|
|
810
|
+
return n("svg", { key: "62786f105ea17d662148ee8a8a97a397bee50e45", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "27a9c38a84b51a44eae6bc0c08ead1d4fce68815", "clip-path": "url(#clip0_455_3543)" }, n("path", { key: "a954ebae988f6b08047b498b3444f68ffbaa0530", 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" }), n("path", { key: "6e057919c60d85b58ed033aa2e0f0d93554ddbd9", 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" }), n("path", { key: "b104e5d73e7dfbd840100a6507d0b02daf8b7a07", 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" }), n("path", { key: "ba17d039113072d87b932fbcd35c243f7c3a1dad", 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" }), n("path", { key: "31e8e8d8fe03990bcb6fac14a5219da26507771d", 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" }), n("path", { key: "e4e6f17228b2499684877aa1c64a1ae43d73a6ca", 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" }), n("path", { key: "cfc3767672eb65001d4da892afc19f1449447f27", 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" }), n("path", { key: "511032934c5c0e3d7efa7abc6edfaa06ce439c53", 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" })), n("defs", { key: "5f19de093c147c05f652e0640808dd2f26043e2b" }, n("clipPath", { key: "0e83255b87bc46aa72af9f0c039735ade92ee6f5", id: "clip0_455_3543" }, n("rect", { key: "25748901605b52c92da15ee761410aa41989576a", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
$e.style = Oe;
|
|
814
|
+
const He = ':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}', qe = He, Ae = class {
|
|
815
|
+
constructor(e) {
|
|
816
|
+
v(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
817
|
+
}
|
|
818
|
+
onError(e) {
|
|
819
|
+
d(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
820
|
+
}
|
|
821
|
+
onWarning(e) {
|
|
822
|
+
d(`[nylas-notification] Warning: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
823
|
+
}
|
|
824
|
+
onInfo(e) {
|
|
825
|
+
d(`[nylas-notification] Info: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
826
|
+
}
|
|
827
|
+
onSuccess(e) {
|
|
828
|
+
d(`[nylas-notification] Success: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
829
|
+
}
|
|
830
|
+
isChildOf(e) {
|
|
831
|
+
let t = this.host.parentNode;
|
|
832
|
+
for (; t; ) {
|
|
833
|
+
if (t === e)
|
|
834
|
+
return !0;
|
|
835
|
+
t instanceof ShadowRoot ? t = t.host : t = t.parentNode;
|
|
836
|
+
}
|
|
837
|
+
return !1;
|
|
838
|
+
}
|
|
839
|
+
handleNotification(e) {
|
|
840
|
+
const t = e.detail.host;
|
|
841
|
+
if (e.defaultPrevented) {
|
|
842
|
+
d("[nylas-notification] Event default prevented");
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
if (t && !this.isChildOf(t)) {
|
|
846
|
+
d("[nylas-notification] Host not a parent");
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
if (this.ttl === 0) {
|
|
850
|
+
d("[nylas-notification] TTL is 0");
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.notification.category)) {
|
|
854
|
+
d("[nylas-notification] Category not allowed");
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
|
|
858
|
+
const a = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
|
|
859
|
+
window.setTimeout(() => {
|
|
860
|
+
this.notifications = this.notifications.filter((r) => r.id !== e.detail.notification.id);
|
|
861
|
+
}, a);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
dismissNotification(e) {
|
|
865
|
+
this.notifications = this.notifications.filter((t) => t.id !== e);
|
|
866
|
+
}
|
|
867
|
+
render() {
|
|
868
|
+
return n(g, { key: "54093d8c69f9b02151d78c8f5dec317f38398da7" }, n(me, { key: "63d98e4cff641402e4c4ca8bb15da6cccf3cef1f" }, this.notifications.map((e) => n("div", { class: `notif ${e.type}`, key: e.id }, n("div", { class: "content" }, n("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && n("warning-icon", null)), n("span", { class: "message" }, n("span", { class: "title" }, e.title), e.description && n("span", { class: "description" }, e.description))), n("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, n("close-icon", null)))), n("slot", { key: "d0a2c31db9054a57d7fd8d585e781760ea326772" })));
|
|
869
|
+
}
|
|
870
|
+
get host() {
|
|
871
|
+
return Z(this);
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
Ae.style = qe;
|
|
875
|
+
const Ze = ':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}.event-card-wrapper{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;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}.manage-booking-description p{font-size:16px;margin:1rem;padding:0.5rem 1rem;font-weight:400;color:var(--nylas-base-800)}.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-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{--dot-color:var(--nylas-base-700)}', Ge = Ze;
|
|
876
|
+
var Ve = function(e, t, a, r) {
|
|
877
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
878
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
879
|
+
i = Reflect.decorate(e, t, a, r);
|
|
880
|
+
else
|
|
881
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
882
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
883
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
884
|
+
}, H = function(e, t) {
|
|
885
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
886
|
+
return Reflect.metadata(e, t);
|
|
887
|
+
};
|
|
888
|
+
const re = class {
|
|
889
|
+
constructor(e) {
|
|
890
|
+
v(this, e), this.rejectBookingButtonClicked = m(this, "rejectBookingButtonClicked", 7), this.confirmBookingButtonClicked = m(this, "confirmBookingButtonClicked", 7), this.confirmBookingError = m(this, "confirmBookingError", 7), this.handleConfirmBookingButtonClicked = () => {
|
|
891
|
+
this.action = "confirm";
|
|
892
|
+
const t = (a) => {
|
|
893
|
+
this.confirmBookingError.emit(a);
|
|
894
|
+
};
|
|
895
|
+
this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler: t });
|
|
896
|
+
}, this.handleRejectBookingButtonClicked = () => {
|
|
897
|
+
this.action = "reject", this.organizerConfirmationBookingId && !this.isLoading && this.rejectBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host });
|
|
898
|
+
}, this.organizerConfirmationBookingId = void 0, this.configSettings = void 0, this.isLoading = void 0, this.selectedLanguage = navigator.language, this.action = null;
|
|
899
|
+
}
|
|
900
|
+
connectedCallback() {
|
|
901
|
+
}
|
|
902
|
+
disconnectedCallback() {
|
|
903
|
+
}
|
|
904
|
+
async componentWillLoad() {
|
|
905
|
+
d("[nylas-organizer-confirmation-card] Component will load");
|
|
906
|
+
}
|
|
907
|
+
async componentDidLoad() {
|
|
908
|
+
d("[nylas-organizer-confirmation-card] Component did load");
|
|
909
|
+
}
|
|
910
|
+
async resetAction() {
|
|
911
|
+
this.action = null;
|
|
912
|
+
}
|
|
913
|
+
render() {
|
|
914
|
+
var e, t, a, r, o, i, s, l, u, h, f, b;
|
|
915
|
+
return n(g, { key: "839b395b61d539c43b224264acdd51b81bd76826", part: "nmcc" }, n("div", { key: "4ad358bc63d92e18006dc68325c5bb0bf6180852", class: "event-card-wrapper", part: "nmccc__card" }, n("div", { key: "cfdc822118cf6c4ea8c0a3efd8c238891d67e49f", class: "calendar-icon" }, n("calendar-check-icon", { key: "43e01d426c51e0d3fd694487f4180786f82dd6fe" })), n("div", { key: "4e1c5112ad8b4ca95baf8f4e9c300a09e628898a", class: "booked-event-header" }, n("h2", { key: "5a71b067467eeb1c826681f58313ee1f1d3df518", slot: "card-title", part: "nmcc__title" }, !!this.organizerConfirmationBookingId && `${c.t("bookingPendingTitle")}!`)), n("sp-divider", { key: "94047165a8891ac94c26b491a621fc054508e75c" }), n("div", { key: "975e8a2d0aee7987cc836c8d2a793aac1e85d158", class: "manage-booking-description" }, n("p", { key: "cd855f151660804718225e70290db3cfa1fb6f49" }, c.t("bookingPendingnDescription"))), n("div", { key: "68e5c2e8ffbbae7ab5167963553e71823322efd3", class: {
|
|
916
|
+
footer: !0,
|
|
917
|
+
"no-footer": ((t = (e = this.configSettings) == null ? void 0 : e.scheduler) == null ? void 0 : t.hide_cancellation_options) && ((r = (a = this.configSettings) == null ? void 0 : a.scheduler) == null ? void 0 : r.hide_rescheduling_options),
|
|
918
|
+
"no-template-cols": ((i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.hide_cancellation_options) || ((l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.hide_rescheduling_options)
|
|
919
|
+
} }, !((h = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && h.hide_cancellation_options) && n("button-component", { variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${c.t("rejectBookingButton")}`), !((b = (f = this.configSettings) == null ? void 0 : f.scheduler) != null && b.hide_rescheduling_options) && n("button-component", { variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${c.t("confirmBookingButton")}`))));
|
|
920
|
+
}
|
|
921
|
+
get host() {
|
|
922
|
+
return Z(this);
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
Ve([
|
|
926
|
+
k({
|
|
927
|
+
name: "nylas-organizer-confirmation-card",
|
|
928
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
929
|
+
["scheduler.organizerConfirmationBookingId", "organizerConfirmationBookingId"],
|
|
930
|
+
["scheduler.configSettings", "configSettings"],
|
|
931
|
+
["scheduler.isLoading", "isLoading"],
|
|
932
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
933
|
+
]),
|
|
934
|
+
eventToProps: {
|
|
935
|
+
rejectBookingButtonClicked: async (e, t) => {
|
|
936
|
+
t.scheduler.setReject(e.detail.bookingId);
|
|
937
|
+
},
|
|
938
|
+
confirmBookingButtonClicked: async (e, t) => {
|
|
939
|
+
const { host: a } = e.detail, r = await t.scheduler.updateBooking({
|
|
940
|
+
bookingId: e.detail.bookingId,
|
|
941
|
+
status: "confirmed"
|
|
942
|
+
}), { errorHandler: o } = e.detail;
|
|
943
|
+
o && (!r || "error" in r) && o(r), await a.resetAction();
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
fireRegisterEvent: !0
|
|
947
|
+
}),
|
|
948
|
+
H("design:type", Function),
|
|
949
|
+
H("design:paramtypes", []),
|
|
950
|
+
H("design:returntype", void 0)
|
|
951
|
+
], re.prototype, "render", null);
|
|
952
|
+
re.style = Ge;
|
|
953
|
+
const We = ":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}}", Ue = We;
|
|
954
|
+
var Xe = function(e, t, a, r) {
|
|
955
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
956
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
957
|
+
i = Reflect.decorate(e, t, a, r);
|
|
958
|
+
else
|
|
959
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
960
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
961
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
962
|
+
}, q = function(e, t) {
|
|
963
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
964
|
+
return Reflect.metadata(e, t);
|
|
965
|
+
};
|
|
966
|
+
const se = class {
|
|
967
|
+
constructor(e) {
|
|
968
|
+
v(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.startTime = "", this.endTime = "";
|
|
969
|
+
}
|
|
970
|
+
connectedCallback() {
|
|
971
|
+
}
|
|
972
|
+
disconnectedCallback() {
|
|
973
|
+
}
|
|
974
|
+
async componentWillLoad() {
|
|
975
|
+
d("[nylas-selected-event-card] Component will load");
|
|
976
|
+
}
|
|
977
|
+
async componentDidLoad() {
|
|
978
|
+
var t, a;
|
|
979
|
+
d("[nylas-selected-event-card] Component did load"), this.selectedDate || console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.'), this.selectedTimeslot || console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.');
|
|
980
|
+
const e = new Intl.DateTimeFormat("en-US", {
|
|
981
|
+
hour: "2-digit",
|
|
982
|
+
minute: "2-digit",
|
|
983
|
+
timeZone: this.selectedTimezone
|
|
984
|
+
});
|
|
985
|
+
this.startTime = e.format(new Date((t = this.selectedTimeslot) == null ? void 0 : t.start_time)), this.endTime = e.format(new Date((a = this.selectedTimeslot) == null ? void 0 : a.end_time));
|
|
986
|
+
}
|
|
987
|
+
render() {
|
|
988
|
+
var e;
|
|
989
|
+
return n(g, { key: "9035d3c6fe9872655571ac627d2dbfe8764d6e9b", part: "nsec" }, n("sp-theme", { key: "40cd2417a429a3bc6a98afceccb74b6379900113", theme: "spectrum", color: "dark", scale: "medium" }, n("div", { key: "fb36fd5eafaffcc5d362ddffc431bf88cf85c06a", class: "event-card", part: "nsec__card" }, n("div", { key: "5184615145e94f5700d614712eda07c51db376e1", class: "calendar-icon", part: "nsec__icon" }, n("calendar-icon", { key: "1c8a688aa6fe0f4b36b55de11875714d7f5c9060" })), n("div", { key: "29b7c385c0c3de4c041c13535bdfbbb8f89881ad", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? Y((e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(J[this.selectedLanguage || navigator.language], { dateStyle: "full", timeZone: this.selectedTimezone })) : "-"), n("div", { key: "848b9c798e2d2b93a1ef94d8b2c70accdc6802ea", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), n("div", { key: "08f1c572c7d885b43c486110b112451f4fb04733", class: "event-timezone", part: "nsec__timezone" }, n("globe-icon", { key: "2ca21c52f31db1fb973d23c604575f89639c8181" }), E[this.selectedTimezone])));
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
Xe([
|
|
993
|
+
k({
|
|
994
|
+
name: "nylas-selected-event-card",
|
|
995
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
996
|
+
["scheduler.selectedDate", "selectedDate"],
|
|
997
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
998
|
+
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
999
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
1000
|
+
]),
|
|
1001
|
+
eventToProps: {},
|
|
1002
|
+
fireRegisterEvent: !0
|
|
1003
|
+
}),
|
|
1004
|
+
q("design:type", Function),
|
|
1005
|
+
q("design:paramtypes", []),
|
|
1006
|
+
q("design:returntype", void 0)
|
|
1007
|
+
], se.prototype, "render", null);
|
|
1008
|
+
se.style = Ue;
|
|
1009
|
+
const Ye = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{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 .timeslot-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)}", Je = Ye;
|
|
1010
|
+
var Ke = function(e, t, a, r) {
|
|
1011
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
1012
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1013
|
+
i = Reflect.decorate(e, t, a, r);
|
|
1014
|
+
else
|
|
1015
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
1016
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
1017
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
1018
|
+
}, A = function(e, t) {
|
|
1019
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1020
|
+
return Reflect.metadata(e, t);
|
|
1021
|
+
};
|
|
1022
|
+
const le = class {
|
|
1023
|
+
constructor(e) {
|
|
1024
|
+
v(this, e), this.timeslotSelected = m(this, "timeslotSelected", 7), this.timeslotConfirmed = m(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, a) => {
|
|
1025
|
+
t.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", a), this.timeslotConfirmed.emit(a);
|
|
1026
|
+
}, this.handleMouseEnter = (t) => {
|
|
1027
|
+
this.hoveredTimeslotIndex = t;
|
|
1028
|
+
}, this.handleMouseLeave = () => {
|
|
1029
|
+
this.hoveredTimeslotIndex = -1;
|
|
1030
|
+
}, this.selectedDate = /* @__PURE__ */ new Date(), this.availability = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
|
|
1031
|
+
}
|
|
1032
|
+
selectedLanguageChanged(e) {
|
|
1033
|
+
c.changeLanguage(e);
|
|
1034
|
+
}
|
|
1035
|
+
selectedDateChanged(e) {
|
|
1036
|
+
var t;
|
|
1037
|
+
if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
1038
|
+
const a = (t = this.availability) == null ? void 0 : t.filter((r) => x(r.start_time, e)).map((r) => r);
|
|
1039
|
+
this.times = a || [];
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
availabilityChanged(e) {
|
|
1043
|
+
if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
1044
|
+
const t = e == null ? void 0 : e.filter((a) => this.selectedDate && x(a.start_time, this.selectedDate)).map((a) => a);
|
|
1045
|
+
this.times = t || [];
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
connectedCallback() {
|
|
1049
|
+
}
|
|
1050
|
+
disconnectedCallback() {
|
|
1051
|
+
}
|
|
1052
|
+
async componentWillLoad() {
|
|
1053
|
+
var t;
|
|
1054
|
+
const e = (t = this.availability) == null ? void 0 : t.filter((a) => this.selectedDate && x(a.start_time, this.selectedDate)).map((a) => a);
|
|
1055
|
+
this.times = e || [], d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
1056
|
+
}
|
|
1057
|
+
async componentDidLoad() {
|
|
1058
|
+
d("[nylas-timeslot-picker] Component did load");
|
|
1059
|
+
}
|
|
1060
|
+
getTimeslotId(e, t) {
|
|
1061
|
+
return `${e.toLocaleDateString()}-${t}`;
|
|
1062
|
+
}
|
|
1063
|
+
onClickSelectTime(e, t) {
|
|
1064
|
+
d("[nylas-timeslot-picker] Time selected", e, t), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, t), this.timeslotSelected.emit({
|
|
1065
|
+
start_time: e.start_time,
|
|
1066
|
+
end_time: e.end_time,
|
|
1067
|
+
emails: e.emails
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
getTimeSlotLabel(e) {
|
|
1071
|
+
const t = new Intl.DateTimeFormat("en-US", {
|
|
1072
|
+
hour: "2-digit",
|
|
1073
|
+
minute: "2-digit",
|
|
1074
|
+
timeZone: this.selectedTimezone
|
|
1075
|
+
});
|
|
1076
|
+
return `${t.format(e.start_time)} - ${t.format(e.end_time)}`;
|
|
1077
|
+
}
|
|
1078
|
+
render() {
|
|
1079
|
+
return this.isLoading ? n(g, null, n("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => n("div", { class: "timeslot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? n(g, null, n("div", { class: "empty" }, n("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? n(g, null, n("div", { class: "empty" }, n("span", null, "No time slots available for selected date"))) : this.selectedDate ? n(g, { part: "ntp" }, n("div", { class: "time-picker-wrapper" }, n("div", { class: "timeslots" }, this.times.map((e, t) => {
|
|
1080
|
+
var a, r, o, i;
|
|
1081
|
+
return n("button", { part: `ntp__timeslot ${((r = (a = this.selectedTimeslot) == null ? void 0 : a.start_time) == null ? void 0 : r.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
|
|
1082
|
+
time: !0,
|
|
1083
|
+
selected: typeof this.selectedTimeslot < "u" && ((i = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : i.getTime()) === e.start_time.getTime()
|
|
1084
|
+
}, 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 }));
|
|
1085
|
+
})), this.selectedTimeslot && n("div", { class: "footer" }, n("button-component", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, n("slot", { name: "timeslot-picker-cta-label" }, c.t("nextButton")))))) : n(g, null);
|
|
1086
|
+
}
|
|
1087
|
+
static get watchers() {
|
|
1088
|
+
return {
|
|
1089
|
+
selectedLanguage: ["selectedLanguageChanged"],
|
|
1090
|
+
selectedDate: ["selectedDateChanged"],
|
|
1091
|
+
availability: ["availabilityChanged"]
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
Ke([
|
|
1096
|
+
k({
|
|
1097
|
+
name: "nylas-timeslot-picker",
|
|
1098
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1099
|
+
["scheduler.selectedDate", "selectedDate"],
|
|
1100
|
+
["scheduler.availability", "availability"],
|
|
1101
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
1102
|
+
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
1103
|
+
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
1104
|
+
["scheduler.isLoading", "isLoading"]
|
|
1105
|
+
]),
|
|
1106
|
+
eventToProps: {
|
|
1107
|
+
timeslotSelected: async (e, t) => {
|
|
1108
|
+
d("nylas-timeslot-picker", "timeslotSelected", e.detail), t.scheduler.selectTime(e.detail);
|
|
1109
|
+
},
|
|
1110
|
+
timeslotConfirmed: async (e, t) => {
|
|
1111
|
+
d("nylas-timeslot-picker", "timeslotConfirmed", e.detail), e.detail && t.scheduler.toggleAdditionalData(!0);
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
fireRegisterEvent: !0
|
|
1115
|
+
}),
|
|
1116
|
+
A("design:type", Function),
|
|
1117
|
+
A("design:paramtypes", []),
|
|
1118
|
+
A("design:returntype", void 0)
|
|
1119
|
+
], le.prototype, "render", null);
|
|
1120
|
+
le.style = Je;
|
|
1121
|
+
export {
|
|
1122
|
+
K as nylas_booked_event_card,
|
|
1123
|
+
Q as nylas_booking_form,
|
|
1124
|
+
ee as nylas_cancel_booking_form,
|
|
1125
|
+
te as nylas_cancelled_event_card,
|
|
1126
|
+
ne as nylas_confirmed_event_card,
|
|
1127
|
+
ie as nylas_date_picker,
|
|
1128
|
+
oe as nylas_locale_switch,
|
|
1129
|
+
$e as nylas_logo,
|
|
1130
|
+
Ae as nylas_notification,
|
|
1131
|
+
re as nylas_organizer_confirmation_card,
|
|
1132
|
+
se as nylas_selected_event_card,
|
|
1133
|
+
le as nylas_timeslot_picker
|
|
1134
|
+
};
|