@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,680 @@
|
|
|
1
|
+
import { r as Z, h as e, c as C, z as Ht, d as h, A as q, H as Tt, g as Ft } from "./index-5ccfd9df.js";
|
|
2
|
+
import { R as Lt } from "./register-component-887199a9-b41dfa7a.js";
|
|
3
|
+
import { D as St } from "./constants-50c3e067-8a40a5fe.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const Ot = ".sc-google-logo-icon-h{display:flex}", Nt = Ot, Dt = class {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
Z(this, t), this.width = "24", this.height = "24";
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return e("svg", { key: "b781fdde5b113edf441b85a41dd339e850a4c481", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("g", { key: "505c76cc1dffb16d43f750db729d4053a56c9861", "clip-path": "url(#clip0_959_12452)" }, e("path", { key: "dc47586ebe2eaea9a86e4d62494c3abe6904b165", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), e("path", { key: "cfa9d34d6484eb60b5704408971fa7997a222d5d", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), e("path", { key: "1e8a544b04ad69554e113d7c6ad21b3a835f9091", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), e("path", { key: "46ac285b59acfae07e759d2e8a5cbc33ff308117", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), e("defs", { key: "b240ed7d2fe6fd66ad08e2027c46d91ba6dfffcf" }, e("clipPath", { key: "a8162755f64a8c24079204e20183351c13c4b596", id: "clip0_959_12452" }, e("rect", { key: "2b3769496afc5471b439b707c38b1cd32e636783", width: 24, height: 24, fill: "white" }))));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
Dt.style = Nt;
|
|
15
|
+
const It = ".sc-microsoft-logo-icon-h{display:flex}", Mt = It, Rt = class {
|
|
16
|
+
constructor(t) {
|
|
17
|
+
Z(this, t), this.width = "22", this.height = "22";
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return e("svg", { key: "a011c0a0f40814573704a9566bb429109d247186", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "300194559a21975360361ce1377249914fb51b19", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), e("path", { key: "7fb8a5187f170a02461ddb5a079dd3e7d4339767", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), e("path", { key: "e03ce5df50e32c135a64b2ff38e673098ba8b9f0", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), e("path", { key: "fdb3f765c39f7f3b60954f5c3181ee21cf3398ab", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
Rt.style = Mt;
|
|
24
|
+
var o;
|
|
25
|
+
(function(t) {
|
|
26
|
+
t.EventInfo = "eventInfo", t.Availability = "availability", t.BookingOptions = "bookingOptions", t.Communications = "communications", t.Participants = "participants", t.BookingForm = "bookingForm", t.PageStyles = "pageStyles";
|
|
27
|
+
})(o || (o = {}));
|
|
28
|
+
function Ut({ id: t, formState: a, activeTab: i, calendars: s, currentUser: d }) {
|
|
29
|
+
var n, c;
|
|
30
|
+
switch (i) {
|
|
31
|
+
case o.EventInfo:
|
|
32
|
+
const r = a.title, y = a.description, _ = parseInt(a.duration), x = a.location, T = a.conferencing;
|
|
33
|
+
return e(
|
|
34
|
+
"div",
|
|
35
|
+
{ key: t },
|
|
36
|
+
e(
|
|
37
|
+
"nylas-event-info",
|
|
38
|
+
null,
|
|
39
|
+
e(
|
|
40
|
+
"div",
|
|
41
|
+
{ slot: "inputs" },
|
|
42
|
+
e("nylas-event-title", { name: "title", eventTitle: r, exportparts: "net, net__title, net__dropdown-content" }),
|
|
43
|
+
e("nylas-event-duration", { name: "duration", eventDurationMinutes: _, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
|
|
44
|
+
e("nylas-event-location", { name: "location", eventLocation: x, eventConferencing: T, userProvider: d.provider, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
|
|
45
|
+
e("nylas-event-description", { name: "description", eventDescription: y, exportparts: "nedesc, nedesc__textarea" })
|
|
46
|
+
)
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
case o.Availability:
|
|
50
|
+
const F = a.availability.openHours, L = a.availability.timezone ? a.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
51
|
+
return e(
|
|
52
|
+
"div",
|
|
53
|
+
{ key: t },
|
|
54
|
+
e("nylas-participant-booking-calendars", { name: "participant-booking-calendars", participants: a.participants, calendars: s }),
|
|
55
|
+
e("nylas-connected-calendars", { name: "connected-calendars", participants: a.participants }),
|
|
56
|
+
e("nylas-availability-picker", { name: "availability", openHours: F, defaultTimezone: L, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
|
|
57
|
+
);
|
|
58
|
+
case o.BookingOptions:
|
|
59
|
+
return e(
|
|
60
|
+
"div",
|
|
61
|
+
{ key: t },
|
|
62
|
+
e("nylas-scheduling-method", { name: "availability-method", readOnly: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
63
|
+
e(
|
|
64
|
+
"nylas-custom-booking-flow",
|
|
65
|
+
null,
|
|
66
|
+
e(
|
|
67
|
+
"div",
|
|
68
|
+
{ slot: "inputs" },
|
|
69
|
+
e("nylas-booking-confirmation-type", { name: "confirmation-type", bookingType: a.bookingType, exportparts: "nbct, nbct__header, nbct__dropdown, nbct__dropdown-button, nbct__dropdown-content" }),
|
|
70
|
+
e("nylas-booking-confirmation-redirect", { name: "confirmation-redirect", redirectUrl: a.redirectUrl, exportparts: "nbcr, nbcr__header, nbcr__dropdown, nbcr__dropdown-button, nbcr__dropdown-content, nbcr__input-textfield" })
|
|
71
|
+
)
|
|
72
|
+
),
|
|
73
|
+
e("nylas-buffer-time", { name: "buffer-time", buffer: a.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
|
|
74
|
+
e(
|
|
75
|
+
"nylas-event-limits",
|
|
76
|
+
null,
|
|
77
|
+
e(
|
|
78
|
+
"div",
|
|
79
|
+
{ slot: "inputs" },
|
|
80
|
+
e("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: a.minBookingNotice, exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
|
|
81
|
+
e("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: a.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
|
|
82
|
+
e("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: a.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
|
|
83
|
+
e("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: a.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
84
|
+
)
|
|
85
|
+
),
|
|
86
|
+
e("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(a.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
|
|
87
|
+
e("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
|
|
88
|
+
);
|
|
89
|
+
case o.Communications:
|
|
90
|
+
return e(
|
|
91
|
+
"div",
|
|
92
|
+
{ key: t },
|
|
93
|
+
e(
|
|
94
|
+
"div",
|
|
95
|
+
{ class: "tab-header" },
|
|
96
|
+
e("h3", null, "Event communications"),
|
|
97
|
+
e("p", null, "Set up automatic confirmation emails.")
|
|
98
|
+
),
|
|
99
|
+
e("nylas-confirmation-email", { name: "confirmation-email-template", confirmationEmailTemplate: a.emailTemplate, isOpen: !((c = (n = a.reminders) == null ? void 0 : n.overrides) != null && c.length), participants: a.participants, exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" })
|
|
100
|
+
);
|
|
101
|
+
case o.Participants:
|
|
102
|
+
return e(
|
|
103
|
+
"div",
|
|
104
|
+
{ key: t },
|
|
105
|
+
e("nylas-additional-participants", { name: "participants", eventParticipants: a.participants, exportparts: "nap__title, nap__subtitle, nap__content, nap__input_group, nap__input_wrapper, nap__input, nap__remove-participant" }),
|
|
106
|
+
e("nylas-participants-custom-availability", { name: "participant-custom-availability", participants: a.participants, exportparts: "npca, npca__header, npca__content, npca__participant-container, npca__participant-title, npca__participant-toggle--container, npca__toggle-label, npca__toggle-input, npca__toggle-slider" })
|
|
107
|
+
);
|
|
108
|
+
case o.PageStyles:
|
|
109
|
+
return e(
|
|
110
|
+
"div",
|
|
111
|
+
null,
|
|
112
|
+
e("nylas-custom-event-slug", { name: "custom-event-slug", defaultUrlSlug: a.slug, exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
|
|
113
|
+
e("nylas-page-name", { name: "page-name", pageName: a.name, exportparts: "npn, npn__body, npn__header, npn__drawer-toggle--container, npn__input-textfield" }),
|
|
114
|
+
e("nylas-page-styling", { name: "page-styling", appearance: a.appearance, exportparts: "nps, nps__header, nps__drawer-toggle--container, nps__body, nps__title-input-textfield, nps__company-logo-input-textfield, nps__color-picker, nps__color-picker-button, nps__color-picker-button-label, nps__color-picker-selected-label, nps__submit-button-label-input-textfield, nps__message-textarea" })
|
|
115
|
+
);
|
|
116
|
+
case o.BookingForm:
|
|
117
|
+
const P = Object.entries(a.additionalFields).map(([E, v]) => ({ key: E, ...v }));
|
|
118
|
+
return e(
|
|
119
|
+
"div",
|
|
120
|
+
{ key: t },
|
|
121
|
+
e("nylas-booking-form-config", { name: "additional-fields", additonalFields: P })
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const zt = '.sc-nylas-editor-tabs-h{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}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column;height:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:calc(100% - 80px);display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.hide.sc-nylas-editor-tabs{display:none}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs h3.sc-nylas-editor-tabs{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', At = zt;
|
|
126
|
+
var jt = function(t, a, i, s) {
|
|
127
|
+
var d = arguments.length, n = d < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, i) : s, c;
|
|
128
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
129
|
+
n = Reflect.decorate(t, a, i, s);
|
|
130
|
+
else
|
|
131
|
+
for (var r = t.length - 1; r >= 0; r--)
|
|
132
|
+
(c = t[r]) && (n = (d < 3 ? c(n) : d > 3 ? c(a, i, n) : c(a, i)) || n);
|
|
133
|
+
return d > 3 && n && Object.defineProperty(a, i, n), n;
|
|
134
|
+
}, G = function(t, a) {
|
|
135
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
136
|
+
return Reflect.metadata(t, a);
|
|
137
|
+
};
|
|
138
|
+
const Pt = class {
|
|
139
|
+
constructor(t) {
|
|
140
|
+
Z(this, t), this.schedulerConfigChanged = C(this, "schedulerConfigChanged", 7), this.cancelButtonClick = C(this, "cancelButtonClick", 7), this.formSubmitted = C(this, "formSubmitted", 7), this.previewButtonClicked = C(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = C(this, "schedulerEditorFormUpdated", 7), this.setError = (a) => {
|
|
141
|
+
this.error = a.message;
|
|
142
|
+
}, this.formSubmissionHandler = async (a) => {
|
|
143
|
+
var K, Q, X, Y, tt, et, at, it, nt, st, ot, rt, lt, dt, ct, bt;
|
|
144
|
+
if (a.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity()) {
|
|
145
|
+
this.error = this.formRef.validationMessage || "Please fix the form errors.";
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
149
|
+
const s = this.updateFormState(), { title: d, description: n, duration: c, availability: r, bookingCalendar: y, location: _, bookingType: x, buffer: T, availableDaysInFuture: F, minCancellationNotice: L, minBookingNotice: P, cancellationPolicy: E, timeslotInterval: v, additionalGuestsHidden: N, hideCancellationOptions: D, hideReschedulingOptions: I, participants: w, participantOpenHours: u, additionalFields: M, participantCalendars: m, conferencing: R, participantBookingCalendars: p, reminders: U, emailTemplate: z, redirectUrl: A, availabilityMethod: B, slug: j, appearance: $, name: J } = s, b = ((Q = (K = this.selectedConfiguration) == null ? void 0 : K.participants) == null ? void 0 : Q.find((l) => l.is_organizer)) || (w == null ? void 0 : w.find((l) => l.is_organizer)), k = m && (b != null && b.email) ? m[b == null ? void 0 : b.email] : [], H = ((X = b == null ? void 0 : b.booking) == null ? void 0 : X.calendar_id) || y, g = c ? parseInt(c) : 30, f = w && (w == null ? void 0 : w.length) > 0 ? w : [
|
|
150
|
+
{
|
|
151
|
+
name: (b == null ? void 0 : b.name) ?? ((Y = this.currentUser) == null ? void 0 : Y.name) ?? "",
|
|
152
|
+
email: (b == null ? void 0 : b.email) ?? ((tt = this.currentUser) == null ? void 0 : tt.email) ?? "",
|
|
153
|
+
is_organizer: !0,
|
|
154
|
+
timezone: (r == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
155
|
+
availability: {
|
|
156
|
+
calendar_ids: k.length ? k : ["primary"],
|
|
157
|
+
open_hours: []
|
|
158
|
+
},
|
|
159
|
+
booking: {
|
|
160
|
+
calendar_id: y && y !== "" ? y : "primary"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
], S = {
|
|
164
|
+
...((et = this.selectedConfiguration) == null ? void 0 : et.id) && { id: this.selectedConfiguration.id },
|
|
165
|
+
version: ((at = this.selectedConfiguration) == null ? void 0 : at.version) ?? "1.0.0",
|
|
166
|
+
slug: j,
|
|
167
|
+
name: J,
|
|
168
|
+
availability: {
|
|
169
|
+
duration_minutes: g,
|
|
170
|
+
interval_minutes: (v == null ? void 0 : v.interval) ?? g,
|
|
171
|
+
round_to: v == null ? void 0 : v.roundTo,
|
|
172
|
+
availability_rules: {
|
|
173
|
+
availability_method: B || (((st = (nt = (it = this.selectedConfiguration) == null ? void 0 : it.availability) == null ? void 0 : nt.availability_rules) == null ? void 0 : st.availability_method) ?? "collective"),
|
|
174
|
+
buffer: T || { before: 0, after: 0 },
|
|
175
|
+
default_open_hours: (r == null ? void 0 : r.openHours) ?? ((lt = (rt = (ot = this.selectedConfiguration) == null ? void 0 : ot.availability) == null ? void 0 : rt.availability_rules) == null ? void 0 : lt.default_open_hours) ?? St,
|
|
176
|
+
round_robin_group_id: ((bt = (ct = (dt = this.selectedConfiguration) == null ? void 0 : dt.availability) == null ? void 0 : ct.availability_rules) == null ? void 0 : bt.round_robin_group_id) ?? ""
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
participants: [
|
|
180
|
+
...f == null ? void 0 : f.map((l) => {
|
|
181
|
+
var ht, ut, pt, mt, yt, ft, gt, _t, vt, wt, kt, Ct, xt;
|
|
182
|
+
return l.is_organizer ? {
|
|
183
|
+
name: l.name ?? "",
|
|
184
|
+
email: l.email,
|
|
185
|
+
is_organizer: !0,
|
|
186
|
+
timezone: ((ut = (ht = u == null ? void 0 : u[l.email]) == null ? void 0 : ht[0]) == null ? void 0 : ut.timezone) ?? ((yt = (mt = (pt = l.availability) == null ? void 0 : pt.open_hours) == null ? void 0 : mt[0]) == null ? void 0 : yt.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
187
|
+
availability: {
|
|
188
|
+
calendar_ids: m != null && m[l.email] ? m == null ? void 0 : m[l.email] : k != null && k.length ? k : ["primary"],
|
|
189
|
+
open_hours: (u == null ? void 0 : u[l.email]) ?? ((ft = l.availability) == null ? void 0 : ft.open_hours) ?? []
|
|
190
|
+
},
|
|
191
|
+
booking: {
|
|
192
|
+
calendar_id: p != null && p[l.email] ? p == null ? void 0 : p[l.email] : H || "primary"
|
|
193
|
+
}
|
|
194
|
+
} : {
|
|
195
|
+
...l,
|
|
196
|
+
timezone: ((_t = (gt = u == null ? void 0 : u[l.email]) == null ? void 0 : gt[0]) == null ? void 0 : _t.timezone) ?? ((kt = (wt = (vt = l.availability) == null ? void 0 : vt.open_hours) == null ? void 0 : wt[0]) == null ? void 0 : kt.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
197
|
+
availability: l.availability ? {
|
|
198
|
+
calendar_ids: (m == null ? void 0 : m[l.email]) ?? ((Ct = l.availability) == null ? void 0 : Ct.calendar_ids) ?? ["primary"],
|
|
199
|
+
open_hours: (u == null ? void 0 : u[l.email]) ?? ((xt = l.availability) == null ? void 0 : xt.open_hours) ?? []
|
|
200
|
+
} : void 0,
|
|
201
|
+
booking: p != null && p[l.email] ? { calendar_id: p == null ? void 0 : p[l.email] } : (l == null ? void 0 : l.booking) ?? void 0
|
|
202
|
+
};
|
|
203
|
+
})
|
|
204
|
+
],
|
|
205
|
+
event_booking: {
|
|
206
|
+
title: (d == null ? void 0 : d.toString()) ?? "",
|
|
207
|
+
description: (n == null ? void 0 : n.toString()) ?? "",
|
|
208
|
+
location: (_ == null ? void 0 : _.toString()) ?? "",
|
|
209
|
+
booking_type: (x == null ? void 0 : x.toString()) ?? "booking",
|
|
210
|
+
timezone: (r == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
211
|
+
conferencing: R,
|
|
212
|
+
reminders: U
|
|
213
|
+
},
|
|
214
|
+
scheduler: {
|
|
215
|
+
cancellation_policy: E ?? "",
|
|
216
|
+
available_days_in_future: F ?? 30,
|
|
217
|
+
min_cancellation_notice: L ?? 0,
|
|
218
|
+
min_booking_notice: P ?? 60,
|
|
219
|
+
hide_additional_guests: N ?? !1,
|
|
220
|
+
hide_cancellation_options: D ?? !1,
|
|
221
|
+
hide_rescheduling_options: I ?? !1,
|
|
222
|
+
additional_fields: M,
|
|
223
|
+
email_template: z,
|
|
224
|
+
confirmation_redirect_url: A
|
|
225
|
+
},
|
|
226
|
+
appearance: $
|
|
227
|
+
}, V = Ht(S, this.selectedConfiguration), O = this.action === "create" ? V : S;
|
|
228
|
+
this.isConfigRoundRobin(O) && (O.participants = O.participants.map((l) => ({ ...l, is_organizer: void 0 })));
|
|
229
|
+
const Bt = (l) => {
|
|
230
|
+
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
231
|
+
this.changesSaved = !1;
|
|
232
|
+
}, 5e3);
|
|
233
|
+
};
|
|
234
|
+
this.checkForClientSideErrors(O) || this.schedulerConfigChanged.emit({ config: O, resetLoadingState: Bt, setError: this.setError, action: this.action });
|
|
235
|
+
}, this.isConfigRoundRobin = (a) => {
|
|
236
|
+
var i, s, d, n;
|
|
237
|
+
return ((s = (i = a.availability) == null ? void 0 : i.availability_rules) == null ? void 0 : s.availability_method) === "max-availability" || ((n = (d = a.availability) == null ? void 0 : d.availability_rules) == null ? void 0 : n.availability_method) === "max-fairness";
|
|
238
|
+
}, this.checkForClientSideErrors = (a) => {
|
|
239
|
+
var n;
|
|
240
|
+
let i = !1, s = "";
|
|
241
|
+
const d = (n = a.scheduler) == null ? void 0 : n.additional_fields;
|
|
242
|
+
return d && (s = "Booking form error: ", Object.entries(d).forEach((c) => {
|
|
243
|
+
const r = c[1];
|
|
244
|
+
if (r.label === "") {
|
|
245
|
+
s += `Label is required for field of type ${r.type}.`, i = !0;
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (r.options) {
|
|
249
|
+
for (const y of r.options)
|
|
250
|
+
if (y === "") {
|
|
251
|
+
s += `Empty option detected inside ${r.label} of type ${r.type}.`, i = !0;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
})), i && (this.isLoading = !1, this.setError(new Error(s))), i;
|
|
256
|
+
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.action = "create", this.activeTab = o.EventInfo, this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
257
|
+
}
|
|
258
|
+
configChangedHandler(t) {
|
|
259
|
+
h("[nylas-editor-tabs]", "configChangedHandler", t, this.selectedConfiguration), this.formState = {
|
|
260
|
+
...this.getFormStateFromConfig(t)
|
|
261
|
+
}, t.id ? this.action = "edit" : this.action = "create";
|
|
262
|
+
}
|
|
263
|
+
userChangedHandler(t) {
|
|
264
|
+
h("[nylas-editor-tabs]", "userChangedHandler", t), t && (this.formState = {
|
|
265
|
+
...this.getFormStateFromConfig(this.selectedConfiguration)
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
connectedCallback() {
|
|
269
|
+
h("[nylas-editor-tabs]", "connectedCallback");
|
|
270
|
+
}
|
|
271
|
+
componentWillLoad() {
|
|
272
|
+
h("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
273
|
+
}
|
|
274
|
+
componentDidLoad() {
|
|
275
|
+
var a;
|
|
276
|
+
h("[nylas-editor-tabs]", "componentDidLoad");
|
|
277
|
+
const t = (a = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : a.name;
|
|
278
|
+
t && (this.activeTab = t);
|
|
279
|
+
}
|
|
280
|
+
disconnectedCallback() {
|
|
281
|
+
h("[nylas-editor-tabs]", "disconnectedCallback");
|
|
282
|
+
}
|
|
283
|
+
handleValueChanged(t) {
|
|
284
|
+
h("[nylas-editor-tabs]", "handleValueChanged", t);
|
|
285
|
+
const { name: a, value: i } = t.detail;
|
|
286
|
+
this.setFormState(i, a), this.formState = { ...this.formState }, this.hasUnsavedChanges = !0, this.error = "", this.schedulerEditorFormUpdated.emit({
|
|
287
|
+
value: t.detail.value,
|
|
288
|
+
name: t.detail.name
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
getFormStateFromConfig(t) {
|
|
292
|
+
var i, s, d, n, c, r, y, _, x, T, F, L, P, E, v, N, D, I, w, u, M, m, R, p, U, z, A, B, j, $, J, b, k, H;
|
|
293
|
+
let a = (i = t == null ? void 0 : t.participants) == null ? void 0 : i.find((g) => g.is_organizer);
|
|
294
|
+
return !a && ((d = (s = t == null ? void 0 : t.availability) == null ? void 0 : s.availability_rules) == null ? void 0 : d.availability_method) !== "collective" && (a = (n = t == null ? void 0 : t.participants) == null ? void 0 : n.find((g) => {
|
|
295
|
+
var f;
|
|
296
|
+
return g.email === ((f = this.currentUser) == null ? void 0 : f.email);
|
|
297
|
+
}), a && (a.is_organizer = !0)), t != null && t.appearance && console.info("Appearance settings have been returned from the given configuration; please remember to grab them from the configSettingsLoaded event and apply them as desired."), {
|
|
298
|
+
title: ((c = t == null ? void 0 : t.event_booking) == null ? void 0 : c.title) ?? "",
|
|
299
|
+
description: ((r = t == null ? void 0 : t.event_booking) == null ? void 0 : r.description) ?? "",
|
|
300
|
+
duration: ((_ = (y = t == null ? void 0 : t.availability) == null ? void 0 : y.duration_minutes) == null ? void 0 : _.toString()) ?? "30",
|
|
301
|
+
availability: {
|
|
302
|
+
timezone: ((x = t == null ? void 0 : t.event_booking) == null ? void 0 : x.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
303
|
+
openHours: ((F = (T = t == null ? void 0 : t.availability) == null ? void 0 : T.availability_rules) == null ? void 0 : F.default_open_hours) ?? St
|
|
304
|
+
},
|
|
305
|
+
additionalFields: ((L = t == null ? void 0 : t.scheduler) == null ? void 0 : L.additional_fields) ?? {},
|
|
306
|
+
conferencing: ((P = t == null ? void 0 : t.event_booking) == null ? void 0 : P.conferencing) ?? {},
|
|
307
|
+
calendarIds: ((E = a == null ? void 0 : a.availability) == null ? void 0 : E.calendar_ids) ?? [],
|
|
308
|
+
participants: (t == null ? void 0 : t.participants) ?? [],
|
|
309
|
+
bookingCalendar: ((v = a == null ? void 0 : a.booking) == null ? void 0 : v.calendar_id) ?? (a == null ? void 0 : a.email) ?? "",
|
|
310
|
+
location: ((N = t == null ? void 0 : t.event_booking) == null ? void 0 : N.location) ?? "",
|
|
311
|
+
bookingType: ((D = t == null ? void 0 : t.event_booking) == null ? void 0 : D.booking_type) ?? "booking",
|
|
312
|
+
buffer: ((w = (I = t == null ? void 0 : t.availability) == null ? void 0 : I.availability_rules) == null ? void 0 : w.buffer) ?? { before: 0, after: 0 },
|
|
313
|
+
cancellationPolicy: ((u = t == null ? void 0 : t.scheduler) == null ? void 0 : u.cancellation_policy) ?? "",
|
|
314
|
+
availableDaysInFuture: ((M = t == null ? void 0 : t.scheduler) == null ? void 0 : M.available_days_in_future) ?? 30,
|
|
315
|
+
minCancellationNotice: ((m = t == null ? void 0 : t.scheduler) == null ? void 0 : m.min_cancellation_notice) ?? 0,
|
|
316
|
+
minBookingNotice: ((R = t == null ? void 0 : t.scheduler) == null ? void 0 : R.min_booking_notice) ?? 60,
|
|
317
|
+
timeslotInterval: {
|
|
318
|
+
interval: ((p = t == null ? void 0 : t.availability) == null ? void 0 : p.interval_minutes) ?? ((U = t == null ? void 0 : t.availability) == null ? void 0 : U.duration_minutes),
|
|
319
|
+
roundTo: (z = t == null ? void 0 : t.availability) == null ? void 0 : z.round_to
|
|
320
|
+
},
|
|
321
|
+
additionalGuestsHidden: ((A = t == null ? void 0 : t.scheduler) == null ? void 0 : A.hide_additional_guests) ?? !1,
|
|
322
|
+
hideCancellationOptions: ((B = t == null ? void 0 : t.scheduler) == null ? void 0 : B.hide_cancellation_options) ?? !1,
|
|
323
|
+
hideReschedulingOptions: ((j = t == null ? void 0 : t.scheduler) == null ? void 0 : j.hide_rescheduling_options) ?? !1,
|
|
324
|
+
participantBookingCalendars: (($ = t == null ? void 0 : t.participants) == null ? void 0 : $.reduce((g, f) => {
|
|
325
|
+
var S, V;
|
|
326
|
+
return (S = f.booking) != null && S.calendar_id && (g[f.email] = (V = f.booking) == null ? void 0 : V.calendar_id), g;
|
|
327
|
+
})) ?? {},
|
|
328
|
+
participantCalendars: ((J = t == null ? void 0 : t.participants) == null ? void 0 : J.reduce((g, f) => {
|
|
329
|
+
var S;
|
|
330
|
+
return g[f.email] = (S = f.availability) == null ? void 0 : S.calendar_ids, g;
|
|
331
|
+
}, {})) ?? {},
|
|
332
|
+
reminders: (b = t == null ? void 0 : t.event_booking) == null ? void 0 : b.reminders,
|
|
333
|
+
emailTemplate: (k = t == null ? void 0 : t.scheduler) == null ? void 0 : k.email_template,
|
|
334
|
+
redirectUrl: (H = t == null ? void 0 : t.scheduler) == null ? void 0 : H.confirmation_redirect_url,
|
|
335
|
+
slug: t == null ? void 0 : t.slug,
|
|
336
|
+
appearance: t == null ? void 0 : t.appearance,
|
|
337
|
+
name: t == null ? void 0 : t.name
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
setFormState(t, a) {
|
|
341
|
+
switch (a) {
|
|
342
|
+
case "title":
|
|
343
|
+
this.formState.title = t.toString();
|
|
344
|
+
break;
|
|
345
|
+
case "description":
|
|
346
|
+
this.formState.description = t.toString();
|
|
347
|
+
break;
|
|
348
|
+
case "duration":
|
|
349
|
+
this.formState.duration = t.toString();
|
|
350
|
+
break;
|
|
351
|
+
case "availability":
|
|
352
|
+
this.formState.availability = JSON.parse(t.toString());
|
|
353
|
+
break;
|
|
354
|
+
case "participants":
|
|
355
|
+
this.formState.participants = JSON.parse(t.toString());
|
|
356
|
+
break;
|
|
357
|
+
case "booking-calendar":
|
|
358
|
+
this.formState.bookingCalendar = t.toString();
|
|
359
|
+
break;
|
|
360
|
+
case "participant-booking-calendars":
|
|
361
|
+
this.formState.participantBookingCalendars = JSON.parse(t.toString());
|
|
362
|
+
break;
|
|
363
|
+
case "location":
|
|
364
|
+
this.formState.location = t.toString();
|
|
365
|
+
break;
|
|
366
|
+
case "conference":
|
|
367
|
+
this.formState.conferencing = JSON.parse(t.toString());
|
|
368
|
+
break;
|
|
369
|
+
case "confirmation-type":
|
|
370
|
+
this.formState.bookingType = t.toString();
|
|
371
|
+
break;
|
|
372
|
+
case "buffer-time":
|
|
373
|
+
this.formState.buffer = JSON.parse(t.toString());
|
|
374
|
+
break;
|
|
375
|
+
case "limit-future-bookings":
|
|
376
|
+
this.formState.availableDaysInFuture = parseInt(t.toString());
|
|
377
|
+
break;
|
|
378
|
+
case "min-cancellation-notice":
|
|
379
|
+
this.formState.minCancellationNotice = parseInt(t.toString());
|
|
380
|
+
break;
|
|
381
|
+
case "min-booking-notice":
|
|
382
|
+
this.formState.minBookingNotice = parseInt(t.toString());
|
|
383
|
+
break;
|
|
384
|
+
case "cancellation-policy":
|
|
385
|
+
this.formState.cancellationPolicy = t.toString();
|
|
386
|
+
break;
|
|
387
|
+
case "timeslot-interval":
|
|
388
|
+
this.formState.timeslotInterval = JSON.parse(t.toString());
|
|
389
|
+
break;
|
|
390
|
+
case "customize-booking-settings":
|
|
391
|
+
const i = JSON.parse(t.toString());
|
|
392
|
+
this.formState.additionalGuestsHidden = i.additionalGuestsHidden, this.formState.hideCancellationOptions = i.hideCancellationOptions, this.formState.hideReschedulingOptions = i.hideReschedulingOptions;
|
|
393
|
+
break;
|
|
394
|
+
case "participant-custom-availability":
|
|
395
|
+
const s = JSON.parse(t.toString());
|
|
396
|
+
this.formState.participantOpenHours = s;
|
|
397
|
+
break;
|
|
398
|
+
case "additional-fields":
|
|
399
|
+
this.formState.additionalFields = t;
|
|
400
|
+
break;
|
|
401
|
+
case "connected-calendars":
|
|
402
|
+
this.formState.participantCalendars = JSON.parse(t.toString());
|
|
403
|
+
break;
|
|
404
|
+
case "confirmation-email-template":
|
|
405
|
+
this.formState.emailTemplate = JSON.parse(t.toString());
|
|
406
|
+
break;
|
|
407
|
+
case "reminder-overrides":
|
|
408
|
+
this.formState.reminders = { overrides: JSON.parse(t.toString()) };
|
|
409
|
+
break;
|
|
410
|
+
case "confirmation-redirect":
|
|
411
|
+
this.formState.redirectUrl = t.toString();
|
|
412
|
+
break;
|
|
413
|
+
case "availability-method":
|
|
414
|
+
this.formState.availabilityMethod = t.toString();
|
|
415
|
+
break;
|
|
416
|
+
case "custom-event-slug":
|
|
417
|
+
this.formState.slug = JSON.parse(t.toString());
|
|
418
|
+
break;
|
|
419
|
+
case "page-styling":
|
|
420
|
+
this.formState.appearance = JSON.parse(t.toString());
|
|
421
|
+
break;
|
|
422
|
+
case "page-name":
|
|
423
|
+
this.formState.name = JSON.parse(t.toString());
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
this.schedulerEditorFormUpdated.emit({
|
|
427
|
+
value: t,
|
|
428
|
+
name: a
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
updateFormState() {
|
|
432
|
+
return new FormData(this.formRef).forEach((a, i) => {
|
|
433
|
+
this.setFormState(a, i);
|
|
434
|
+
}), this.formState = { ...this.formState }, this.formState;
|
|
435
|
+
}
|
|
436
|
+
setActiveTab(t, a) {
|
|
437
|
+
t.preventDefault(), this.updateFormState(), this.activeTab = a;
|
|
438
|
+
}
|
|
439
|
+
hideTab(t) {
|
|
440
|
+
var a;
|
|
441
|
+
return ((a = this.hideEditorTabs) == null ? void 0 : a.includes(t)) || !1;
|
|
442
|
+
}
|
|
443
|
+
render() {
|
|
444
|
+
var t, a;
|
|
445
|
+
return h("[nylas-editor-tabs]", "render", this.formState), e(Tt, { key: "d639dd669c369eced02a79d283caa2cc00978230" }, e("form", { key: "28e1761ba3eecf78bfee29ffc5d4b8c323822930", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (i) => this.formRef = i, noValidate: !0 }, this.mode === "app" ? e("div", { class: "form-contents" }, e("div", { class: "tabs" }, e("button", { name: o.EventInfo, class: { tab: !0, active: this.activeTab == o.EventInfo, hide: this.hideTab(o.EventInfo) }, part: "editortab__event-info", onClick: (i) => this.setActiveTab(i, o.EventInfo) }, e("calendar-info-icon", { width: "16", height: "16" }), "Event info"), e("button", { name: o.Availability, class: { tab: !0, active: this.activeTab == o.Availability, hide: this.hideTab(o.Availability) }, part: "editortab__availability", onClick: (i) => this.setActiveTab(i, o.Availability) }, e("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), e("button", { name: o.Participants, class: { tab: !0, active: this.activeTab == o.Participants, hide: this.hideTab(o.Participants) }, part: "editortab__participants", onClick: (i) => this.setActiveTab(i, o.Participants) }, e("people-icon", { width: "16", height: "16" }), "Participants"), e("button", { name: o.BookingOptions, class: { tab: !0, active: this.activeTab == o.BookingOptions, hide: this.hideTab(o.BookingOptions) }, part: "editortab__booking-options", onClick: (i) => this.setActiveTab(i, o.BookingOptions) }, e("flow-icon", { width: "16", height: "16" }), "Booking options"), e("button", { name: o.BookingForm, class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab(o.BookingForm) }, part: "editortab__booking-form", onClick: (i) => this.setActiveTab(i, o.BookingForm) }, this.activeTab == o.BookingForm ? e("calendar-agenda-fill-icon", { width: "16", height: "16" }) : e("calendar-agenda-icon", { width: "16", height: "16" }), "Booking form"), e("button", { name: o.Communications, class: { tab: !0, active: this.activeTab == "communications" }, onClick: (i) => this.setActiveTab(i, o.Communications) }, this.activeTab == o.Communications ? e("envelope-fill-icon", { width: "16", height: "16" }) : e("envelope-icon", { width: "16", height: "16" }), "Communications"), e("button", { name: o.PageStyles, class: { tab: !0, active: this.activeTab == "pageStyles" }, onClick: (i) => this.setActiveTab(i, o.PageStyles) }, this.activeTab == o.PageStyles ? e("paintbrush-fill-icon", { width: "16", height: "16" }) : e("paintbrush-icon", { width: "16", height: "16" }), "Page styles")), e("div", { class: "tab-content" }, e(Ut, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((t = this.selectedConfiguration) == null ? void 0 : t.id) ?? "new" }))) : e("div", { class: "composable", key: (a = this.selectedConfiguration) == null ? void 0 : a.id }, e("slot", null)), e("div", { key: "b51f64962b9e05b1030f315a3b470fc659267526", class: "footer", part: "editor__footer" }, e("div", { key: "d6c13c06d5717c7a9642c135a7d687fc2588e638", class: "preview", part: "editor__footer-preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && e("button-component", { type: "button", disabled: this.isLoading, clickHandler: (i) => {
|
|
446
|
+
i.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(q(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
447
|
+
}, variant: "basic" }, "Preview")), e("div", { key: "c7d1b142f97896ef263164b80f04b4088c2361ab", class: "buttons", part: "editor__footer-buttons" }, e("p", { key: "dd883d581e33151ca83654b2a8d5f4764a7ff1ad", class: {
|
|
448
|
+
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
449
|
+
"saved-changes": this.changesSaved,
|
|
450
|
+
error: this.error !== "",
|
|
451
|
+
"error-full-width": this.error !== "" && this.action === "create"
|
|
452
|
+
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), e("button-component", { key: "b62f286d998cb3360527b219f1b6a6e7917c5a1d", type: "button", disabled: this.isLoading, clickHandler: (i) => {
|
|
453
|
+
i.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
454
|
+
}, variant: "basic", part: "editor__footer-cancel" }, "Back"), e("button-component", { key: "b1a282ca85acd8ad27451de7a588400068ab2160", type: "submit", disabled: this.isLoading, part: "editor__footer-cta" }, this.isLoading ? e("span", null, "Saving", e("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
|
|
455
|
+
}
|
|
456
|
+
get host() {
|
|
457
|
+
return Ft(this);
|
|
458
|
+
}
|
|
459
|
+
static get watchers() {
|
|
460
|
+
return {
|
|
461
|
+
selectedConfiguration: ["configChangedHandler"],
|
|
462
|
+
currentUser: ["userChangedHandler"]
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
jt([
|
|
467
|
+
Lt({
|
|
468
|
+
name: "nylas-editor-tabs",
|
|
469
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
470
|
+
["schedulerConfig.calendars", "calendars"],
|
|
471
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
472
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
473
|
+
["schedulerConfig.hideEditorTabs", "hideEditorTabs"]
|
|
474
|
+
]),
|
|
475
|
+
eventToProps: {
|
|
476
|
+
schedulerConfigChanged: async (t, a) => {
|
|
477
|
+
const { resetLoadingState: i, setError: s, action: d, config: n } = t.detail, c = (r) => {
|
|
478
|
+
const [y, _] = r;
|
|
479
|
+
!y && _ && s && s(_), i && i(t);
|
|
480
|
+
};
|
|
481
|
+
if (d === "edit") {
|
|
482
|
+
const r = await a.schedulerConfig.updateConfiguration(n);
|
|
483
|
+
c(r);
|
|
484
|
+
} else {
|
|
485
|
+
const r = await a.schedulerConfig.createConfiguration(n);
|
|
486
|
+
c(r);
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
cancelButtonClick: async (t, a) => {
|
|
490
|
+
a.schedulerConfigStore.state.action = null;
|
|
491
|
+
},
|
|
492
|
+
previewButtonClicked: async (t, a) => {
|
|
493
|
+
h("[nylas-editor-tabs]", "previewButtonClicked", a);
|
|
494
|
+
},
|
|
495
|
+
formSubmitted: async (t, a) => {
|
|
496
|
+
h("[nylas-editor-tabs]", "formSubmitted", a);
|
|
497
|
+
},
|
|
498
|
+
schedulerEditorFormUpdated: async (t, a) => {
|
|
499
|
+
h("[nylas-editor-tabs]", "schedulerEditorFormUpdated", t);
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
503
|
+
fireRegisterEvent: !0
|
|
504
|
+
}),
|
|
505
|
+
G("design:type", Function),
|
|
506
|
+
G("design:paramtypes", []),
|
|
507
|
+
G("design:returntype", void 0)
|
|
508
|
+
], Pt.prototype, "render", null);
|
|
509
|
+
Pt.style = At;
|
|
510
|
+
const $t = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--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}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;flex-direction:column;position:relative;overflow-y:hidden}.configurations .table-container{overflow-y:auto;flex:1}.configurations .table-container table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations .table-container table.no-configurations{height:100%}.configurations .table-container table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations .table-container table tr.hide{display:none}.configurations .table-container table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations .table-container table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations .table-container table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations .table-container table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations .table-container table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations .table-container table th,.configurations .table-container table td{text-align:left;padding:1rem;font-family:inherit}.configurations .table-container table .actions{text-align:right}.configurations .table-container table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations .table-container table .actions{flex-direction:column;gap:0.5rem}}.configurations .table-container table .title{width:100%;max-width:300px}@media screen and (max-width: 768px){.configurations .table-container table .title{max-width:96px}}.configurations .table-container table .title div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.configurations .table-container table .title div.config-event-title{font-weight:600}.configurations .table-container table .title div.config-event-description{font-size:0.75rem}.configurations .pagination{padding:1rem;position:sticky;top:100%;display:flex;justify-content:flex-end;gap:0.5rem;background:white;width:calc(100% - 2rem);z-index:2}.configurations .pagination td.arrows{display:flex;justify-content:flex-end;gap:0.5rem}.configurations .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);border:1px solid var(--nylas-base-300);background-color:transparent;color:var(--nylas-base-800);cursor:pointer}.configurations .pagination button:hover:not(:disabled){border:1px solid var(--nylas-primary)}.configurations .pagination button:active{border:1px solid var(--nylas-base-800)}.configurations .pagination button:disabled{border:1px solid var(--nylas-base-100);background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.configurations .pagination button.right{transform:rotate(180deg)}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){display:block;height:48px;padding:0px 16px 8px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button){width:92px}}select-dropdown::part(sd_dropdown-content){width:120px;right:0}select-dropdown::part(sd_dropdown-labelhtml){display:flex;gap:0.5rem;align-items:center;color:var(--nylas-base-900)}select-dropdown::part(sd_dropdown-labelhtml):hover{color:var(--nylas-primary)}', Jt = $t;
|
|
511
|
+
var Vt = function(t, a, i, s) {
|
|
512
|
+
var d = arguments.length, n = d < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, i) : s, c;
|
|
513
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
514
|
+
n = Reflect.decorate(t, a, i, s);
|
|
515
|
+
else
|
|
516
|
+
for (var r = t.length - 1; r >= 0; r--)
|
|
517
|
+
(c = t[r]) && (n = (d < 3 ? c(n) : d > 3 ? c(a, i, n) : c(a, i)) || n);
|
|
518
|
+
return d > 3 && n && Object.defineProperty(a, i, n), n;
|
|
519
|
+
}, W = function(t, a) {
|
|
520
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
521
|
+
return Reflect.metadata(t, a);
|
|
522
|
+
};
|
|
523
|
+
const Et = class {
|
|
524
|
+
constructor(t) {
|
|
525
|
+
Z(this, t), this.initListConfigurations = C(this, "initListConfigurations", 7), this.createButtonClick = C(this, "createButtonClick", 7), this.editButtonClick = C(this, "editButtonClick", 7), this.deleteButtonClick = C(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.listConfigurationsNextCursor = void 0, this.state = "loading", this.error = "", this.currentCursor = null, this.previousCursors = [], this.disableNextPageButton = !1;
|
|
526
|
+
}
|
|
527
|
+
listConfigurationsNextCursorChangedHandler(t, a) {
|
|
528
|
+
if (!t || t === a) {
|
|
529
|
+
t === null && (this.disableNextPageButton = !0);
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
this.disableNextPageButton = !1, this.currentCursor = t;
|
|
533
|
+
}
|
|
534
|
+
connectedCallback() {
|
|
535
|
+
h("[nylas-list-configurations]", "connectedCallback");
|
|
536
|
+
}
|
|
537
|
+
componentWillLoad() {
|
|
538
|
+
h("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
539
|
+
}
|
|
540
|
+
componentDidLoad() {
|
|
541
|
+
h("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit({
|
|
542
|
+
host: this.host
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
disconnectedCallback() {
|
|
546
|
+
h("[nylas-list-configurations]", "disconnectedCallback");
|
|
547
|
+
}
|
|
548
|
+
async handleNylasFormDropdownChanged(t) {
|
|
549
|
+
h("[nylas-list-configurations]", "handleNylasFormDropdownChanged", t.detail);
|
|
550
|
+
const { value: a } = t.detail, [i, s] = a.split("-");
|
|
551
|
+
switch (t.preventDefault(), i) {
|
|
552
|
+
case "delete":
|
|
553
|
+
this.deleteButtonClick.emit({ host: this.host, configuration: this.configurations[s] });
|
|
554
|
+
break;
|
|
555
|
+
case "preview":
|
|
556
|
+
window.open(q(this.schedulerPreviewLink, this.configurations[s]), "_blank");
|
|
557
|
+
break;
|
|
558
|
+
case "copy":
|
|
559
|
+
await navigator.clipboard.writeText(q(this.schedulerPreviewLink, this.configurations[s]));
|
|
560
|
+
break;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
async getState() {
|
|
564
|
+
return this.state;
|
|
565
|
+
}
|
|
566
|
+
async setState(t) {
|
|
567
|
+
this.state = t;
|
|
568
|
+
}
|
|
569
|
+
async setError(t) {
|
|
570
|
+
this.error = t;
|
|
571
|
+
}
|
|
572
|
+
getDurationString(t) {
|
|
573
|
+
const a = Math.floor(t / 60), i = t % 60;
|
|
574
|
+
return `${a || ""} ${a ? `${a > 1 ? "hours" : "hour"}` : ""} ${i || ""} ${i ? `${i > 1 ? "mins" : "min"}` : ""}`;
|
|
575
|
+
}
|
|
576
|
+
getActionLabelHTML(t) {
|
|
577
|
+
const a = {
|
|
578
|
+
display: "inline-flex",
|
|
579
|
+
alignItems: "center",
|
|
580
|
+
gap: "0.5rem"
|
|
581
|
+
}, i = {
|
|
582
|
+
color: "var(--nylas-error)"
|
|
583
|
+
};
|
|
584
|
+
switch (t) {
|
|
585
|
+
case "preview":
|
|
586
|
+
return e("span", { style: a }, e("eye-icon", { width: "16", height: "16" }), "Preview");
|
|
587
|
+
case "copy":
|
|
588
|
+
return e("span", { style: a }, e("copy-icon", { width: "16", height: "16" }), "Copy");
|
|
589
|
+
case "delete":
|
|
590
|
+
return e("span", { style: { ...a, ...i } }, e("delete-icon", { width: "15", height: "17" }), "Delete");
|
|
591
|
+
default:
|
|
592
|
+
return "";
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
previousPageClickedHandler() {
|
|
596
|
+
if (this.previousCursors.length === 0)
|
|
597
|
+
return;
|
|
598
|
+
this.currentCursor = this.previousCursors.pop() || null;
|
|
599
|
+
const t = this.previousCursors[this.previousCursors.length - 1] || void 0;
|
|
600
|
+
this.initListConfigurations.emit({
|
|
601
|
+
host: this.host,
|
|
602
|
+
cursor: t
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
nextPageClickedHandler() {
|
|
606
|
+
this.currentCursor && (this.previousCursors = [...this.previousCursors, this.currentCursor], this.initListConfigurations.emit({
|
|
607
|
+
host: this.host,
|
|
608
|
+
cursor: this.currentCursor
|
|
609
|
+
}));
|
|
610
|
+
}
|
|
611
|
+
render() {
|
|
612
|
+
return e(Tt, null, e("div", { class: "header" }, e("div", { class: "description" }, e("h2", null, "All Scheduling Pages"), e("p", null, "Create and manage your Scheduling Pages.")), this.configurations && this.configurations.length > 0 && e("div", { class: "actions" }, e("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
|
|
613
|
+
this.createButtonClick.emit(this.host);
|
|
614
|
+
} }, "Create new"))), e("div", { class: "configurations" }, e("div", { class: "table-container" }, e("table", { class: {
|
|
615
|
+
"no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
|
|
616
|
+
} }, e("tr", { class: {
|
|
617
|
+
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
618
|
+
} }, e("th", null, "Page title"), e("th", null, "Duration"), e("th", null)), this.state === "loading" && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("h3", null, "Loading..."), e("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("calendar-icon", { width: "48", height: "48" }), e("h3", null, "No scheduling pages found"), e("p", null, "Get started with creating your first scheduling page"), e("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
|
|
619
|
+
this.createButtonClick.emit(this.host);
|
|
620
|
+
} }, "Create new")))), this.state !== "loading" && this.configurations.map((t, a) => e("tr", { key: t.id }, e("td", null, e("div", { class: "title" }, e("div", { class: "config-event-title", title: t.event_booking.title }, t.event_booking.title), e("div", { class: "config-event-description" }, t.event_booking.description))), e("td", null, e("div", { class: "duration" }, this.getDurationString(t.availability.duration_minutes))), e("td", null, e("div", { class: "actions" }, e("button-component", { variant: "basic", key: `edit-${a}`, clickHandler: (i) => {
|
|
621
|
+
i.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
|
|
622
|
+
} }, e("edit-icon", { width: "16", height: "16" }), "Edit"), e("select-dropdown", { name: "actions", options: [
|
|
623
|
+
{ value: `preview-${a}`, label: "Preview", labelHTML: this.getActionLabelHTML("preview") },
|
|
624
|
+
{ value: `copy-${a}`, label: "Copy link", labelHTML: this.getActionLabelHTML("copy") },
|
|
625
|
+
{ value: `delete-${a}`, label: "Delete", labelHTML: this.getActionLabelHTML("delete") }
|
|
626
|
+
], defaultSelectedOption: { value: "", label: "" }, dropdownButtonText: "...", withSearch: !1, withChevron: !1, exportparts: "sd_dropdown: actions__dropdown, sd_dropdown-button: actions__dropdown-button, sd_dropdown-content: actions__dropdown-content" }))))))), e("div", { class: "pagination" }, e("button", { class: "arrow left", onClick: () => this.previousPageClickedHandler(), disabled: this.previousCursors.length <= 0 }, e("chevron-icon", null)), e("button", { class: "arrow right", onClick: () => this.nextPageClickedHandler(), disabled: this.disableNextPageButton }, e("chevron-icon", null)))), this.state === "error" && e("div", { class: "error-container" }, e("p", { class: "error" }, this.error)));
|
|
627
|
+
}
|
|
628
|
+
get host() {
|
|
629
|
+
return Ft(this);
|
|
630
|
+
}
|
|
631
|
+
static get watchers() {
|
|
632
|
+
return {
|
|
633
|
+
listConfigurationsNextCursor: ["listConfigurationsNextCursorChangedHandler"]
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
Vt([
|
|
638
|
+
Lt({
|
|
639
|
+
name: "nylas-list-configurations",
|
|
640
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
641
|
+
["schedulerConfig.configurations", "configurations"],
|
|
642
|
+
["schedulerConfig.listConfigurationsNextCursor", "listConfigurationsNextCursor"]
|
|
643
|
+
]),
|
|
644
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
645
|
+
eventToProps: {
|
|
646
|
+
initListConfigurations: async (t, a) => {
|
|
647
|
+
const { host: i, cursor: s } = t.detail;
|
|
648
|
+
await i.setState("loading");
|
|
649
|
+
const [d, n] = await a.schedulerConfig.getConfigurations(s);
|
|
650
|
+
if (!d && n && n.message) {
|
|
651
|
+
await i.setState("error"), await i.setError(n.message);
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
await i.setState("loaded");
|
|
655
|
+
},
|
|
656
|
+
createButtonClick: async (t, a) => {
|
|
657
|
+
a.schedulerConfigStore.resetSelectedConfiguration(), a.schedulerConfigStore.state.action = "create";
|
|
658
|
+
},
|
|
659
|
+
deleteButtonClick: async (t, a) => {
|
|
660
|
+
const { host: i, configuration: s } = t.detail, [d, n] = await a.schedulerConfig.deleteConfiguration(s.id);
|
|
661
|
+
!d && n && n.message && (await i.setState("error"), await i.setError(n.message));
|
|
662
|
+
},
|
|
663
|
+
editButtonClick: async (t, a) => {
|
|
664
|
+
const { configuration: i } = t.detail;
|
|
665
|
+
a.schedulerConfigStore.state.selectedConfiguration = i, a.schedulerConfigStore.state.action = "edit";
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
fireRegisterEvent: !0
|
|
669
|
+
}),
|
|
670
|
+
W("design:type", Function),
|
|
671
|
+
W("design:paramtypes", []),
|
|
672
|
+
W("design:returntype", void 0)
|
|
673
|
+
], Et.prototype, "render", null);
|
|
674
|
+
Et.style = Jt;
|
|
675
|
+
export {
|
|
676
|
+
Dt as google_logo_icon,
|
|
677
|
+
Rt as microsoft_logo_icon,
|
|
678
|
+
Pt as nylas_editor_tabs,
|
|
679
|
+
Et as nylas_list_configurations
|
|
680
|
+
};
|