@nylas/react 1.1.0-canary.17 → 1.1.0-canary.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_2.entry-3ca337a6.js +25 -0
- package/dist/add-circle-icon_2.entry-adde5fdf.cjs +1 -0
- package/dist/{archive-icon_7.entry-8c8317e9.cjs → archive-icon_7.entry-2b56ef80.cjs} +1 -1
- package/dist/{archive-icon_7.entry-60e900b6.js → archive-icon_7.entry-896a1054.js} +14 -14
- package/dist/{arrow-icon.entry-2d4e9572.cjs → arrow-icon.entry-0288f3fc.cjs} +1 -1
- package/dist/arrow-icon.entry-9aaa93fd.js +15 -0
- package/dist/{bold-icon_3.entry-557c6007.js → bold-icon_3.entry-0061cf1f.js} +6 -6
- package/dist/{bold-icon_3.entry-ba732761.cjs → bold-icon_3.entry-e7810620.cjs} +1 -1
- package/dist/button-component_4.entry-276606e6.js +115 -0
- package/dist/button-component_4.entry-e53a8f37.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_35.entry-a19cae9c.js +4178 -0
- package/dist/calendar-agenda-fill-icon_35.entry-fa968081.cjs +7 -0
- package/dist/{calendar-cancel-icon.entry-820cf967.js → calendar-cancel-icon.entry-71eae711.js} +5 -5
- package/dist/{calendar-cancel-icon.entry-b2657caf.cjs → calendar-cancel-icon.entry-8e8b25b6.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-b13e7cbb.cjs → calendar-check-icon_2.entry-562e98cf.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-128a5d67.js → calendar-check-icon_2.entry-6f971ca2.js} +9 -9
- package/dist/{calendar-icon.entry-d17d7cfb.cjs → calendar-icon.entry-3a59af30.cjs} +1 -1
- package/dist/{calendar-icon.entry-a43e6011.js → calendar-icon.entry-3e496896.js} +2 -2
- package/dist/{chevron-icon_3.entry-e0796c69.js → chevron-icon_3.entry-7eac0ed5.js} +37 -34
- package/dist/chevron-icon_3.entry-7ff10540.cjs +1 -0
- package/dist/{clock-icon_2.entry-e959ae50.js → clock-icon_2.entry-120d672e.js} +9 -9
- package/dist/{clock-icon_2.entry-267614c2.cjs → clock-icon_2.entry-43873262.cjs} +1 -1
- package/dist/{constants-f34b9c6e-ebc2e19c.cjs → constants-7ce66b44-a951d78c.cjs} +5 -5
- package/dist/{constants-f34b9c6e-efe2836b.js → constants-7ce66b44-e7ca66c2.js} +484 -383
- package/dist/copy-icon_4.entry-57874c4f.cjs +1 -0
- package/dist/copy-icon_4.entry-9a949d24.js +45 -0
- package/dist/{document-refresh-icon.entry-b4c217df.js → document-refresh-icon.entry-f0d95ac8.js} +5 -5
- package/dist/{document-refresh-icon.entry-b8850675.cjs → document-refresh-icon.entry-f1d3f32d.cjs} +1 -1
- package/dist/elements/index.d.ts +14 -0
- package/dist/{elements-dc5b338e-a33785e3.cjs → elements-dc5b338e-62b53496.cjs} +1 -1
- package/dist/{elements-dc5b338e-b0a290ae.js → elements-dc5b338e-974e2077.js} +1 -1
- package/dist/{focus-visible-e8093c16-5f1ae916.js → focus-visible-e8093c16-7a512fc0.js} +1 -1
- package/dist/{focus-visible-e8093c16-d2afb13d.cjs → focus-visible-e8093c16-923e1041.cjs} +1 -1
- package/dist/{forward-icon_6.entry-0009e4f0.cjs → forward-icon_6.entry-45b70066.cjs} +2 -2
- package/dist/{forward-icon_6.entry-53683e82.js → forward-icon_6.entry-675c0b73.js} +9 -9
- package/dist/{globe-icon.entry-dbb47687.js → globe-icon.entry-3296e427.js} +2 -2
- package/dist/{globe-icon.entry-df67eab8.cjs → globe-icon.entry-7ecd6221.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-aa9f8b35.js +584 -0
- package/dist/google-logo-icon_4.entry-fd734a59.cjs +1 -0
- package/dist/index-53420959-1c0d390d.js +5 -0
- package/dist/index-53420959-8e7b10db.cjs +1 -0
- package/dist/{index-5851f0a2.js → index-5efb84b8.js} +813 -793
- package/dist/{index-6d9eeb53-2f37342f.js → index-6d9eeb53-4e2a7f9f.js} +2 -2
- package/dist/{index-6d9eeb53-ded66877.cjs → index-6d9eeb53-aa1dfa96.cjs} +1 -1
- package/dist/index-d36b8fb8.cjs +42 -0
- package/dist/{index.es-9cc0eb3c-2cf4632f.js → index.es-9cc0eb3c-65f8af0c.js} +1 -1
- package/dist/{index.es-9cc0eb3c-e8de46e6.cjs → index.es-9cc0eb3c-8eefd4fc.cjs} +1 -1
- package/dist/{info-icon_2.entry-e355fb7d.cjs → info-icon_2.entry-e612f1d6.cjs} +1 -1
- package/dist/{info-icon_2.entry-c27ac645.js → info-icon_2.entry-f06c8dd0.js} +3 -3
- package/dist/{input-dropdown_2.entry-9e50060e.cjs → input-dropdown_2.entry-ad380260.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-ce1da1b3.js → input-dropdown_2.entry-ccd95678.js} +3 -3
- package/dist/loading-icon.entry-678a6b3f.cjs +1 -0
- package/dist/{loading-icon.entry-4ab88ed8.js → loading-icon.entry-9e6670d5.js} +2 -2
- package/dist/{mailbox-store-64b4ef7c-ebe84c96.cjs → mailbox-store-64b4ef7c-9bd02ffd.cjs} +1 -1
- package/dist/{mailbox-store-64b4ef7c-47dac9aa.js → mailbox-store-64b4ef7c-b56d5e78.js} +2 -2
- package/dist/multi-select-dropdown.entry-5bb80d89.cjs +1 -0
- package/dist/multi-select-dropdown.entry-edf10867.js +91 -0
- package/dist/{nylas-booked-event-card_10.entry-ef9c2d62.js → nylas-booked-event-card_10.entry-92f6e85d.js} +276 -244
- package/dist/nylas-booked-event-card_10.entry-ad4671b2.cjs +1 -0
- package/dist/{nylas-custom-booking-flow.entry-f31400e2.js → nylas-custom-booking-flow.entry-b39a2bf2.js} +3 -3
- package/dist/{nylas-custom-booking-flow.entry-c59c1306.cjs → nylas-custom-booking-flow.entry-cef0041a.cjs} +1 -1
- package/dist/{nylas-form-card.entry-b189e066.js → nylas-form-card.entry-bf4545e2.js} +18 -18
- package/dist/{nylas-form-card.entry-bc048703.cjs → nylas-form-card.entry-fba5d623.cjs} +1 -1
- package/dist/{nylas-if-state.entry-5bdf8669.js → nylas-if-state.entry-2739dc10.js} +3 -3
- package/dist/{nylas-if-state.entry-933c79e0.cjs → nylas-if-state.entry-d7b818a6.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-5d1bef7f.cjs → nylas-list-folders.entry-0ec6ba20.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-f0e7ae4e.js → nylas-list-folders.entry-3197e390.js} +3 -3
- package/dist/{nylas-list-threads.entry-3e300e7e.cjs → nylas-list-threads.entry-2a7e1e84.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-3f7451ad.js → nylas-list-threads.entry-9004c490.js} +3 -3
- package/dist/{nylas-login.entry-dbf9e11f.cjs → nylas-login.entry-c2ffd6a5.cjs} +1 -1
- package/dist/{nylas-login.entry-e3b757a0.js → nylas-login.entry-f2927406.js} +7 -7
- package/dist/{nylas-mailbox-pagination.entry-0db12a01.cjs → nylas-mailbox-pagination.entry-839c9ad3.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-6c845a2a.js → nylas-mailbox-pagination.entry-e9356835.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-ec196947.js → nylas-mailbox-toolbar-button.entry-298a3c47.js} +4 -4
- package/dist/{nylas-mailbox-toolbar-button.entry-553f041a.cjs → nylas-mailbox-toolbar-button.entry-43812d51.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-1552ad11.js → nylas-mailbox.entry-aa42f6c4.js} +7 -7
- package/dist/{nylas-mailbox.entry-c0bbca56.cjs → nylas-mailbox.entry-cf13ddf5.cjs} +1 -1
- package/dist/{nylas-provider.entry-6d286e92.js → nylas-provider.entry-1a3a195f.js} +8 -8
- package/dist/{nylas-provider.entry-d4bf23c2.cjs → nylas-provider.entry-843b5593.cjs} +1 -1
- package/dist/nylas-scheduler-editor.entry-048e7a8f.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-caa1026b.js → nylas-scheduler-editor.entry-d56d6d2a.js} +138 -119
- package/dist/nylas-scheduling.entry-0ad9b1d0.cjs +1 -0
- package/dist/{nylas-scheduling.entry-19ff3d50.js → nylas-scheduling.entry-7039a890.js} +52 -52
- package/dist/{nylas-threads-refresh.entry-bc4c10ea.cjs → nylas-threads-refresh.entry-9cae6ac8.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-6acf3c2b.js → nylas-threads-refresh.entry-d951050a.js} +4 -4
- package/dist/{nylas-threads-search.entry-ee28712c.cjs → nylas-threads-search.entry-0d34c5a8.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-82fa1504.js → nylas-threads-search.entry-7a4bbc75.js} +8 -8
- package/dist/{nylas-time-window-picker.entry-131f84b4.cjs → nylas-time-window-picker.entry-062bc8c1.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-3c45d82e.js → nylas-time-window-picker.entry-210c3f1a.js} +2 -2
- package/dist/{nylas-view-thread.entry-695a7b0b.js → nylas-view-thread.entry-8b39a997.js} +6 -6
- package/dist/{nylas-view-thread.entry-0d9a4aa9.cjs → nylas-view-thread.entry-db78ed9c.cjs} +1 -1
- package/dist/play-icon_2.entry-19271982.cjs +1 -0
- package/dist/play-icon_2.entry-c53f3cac.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +115 -101
- package/dist/{refresh-icon.entry-43267155.js → refresh-icon.entry-75139a0c.js} +2 -2
- package/dist/{refresh-icon.entry-28e3ade7.cjs → refresh-icon.entry-e695cf7f.cjs} +1 -1
- package/dist/{register-component-a5a9ca5d-538c35c3.js → register-component-a5a9ca5d-d69a7a05.js} +1 -1
- package/dist/{register-component-a5a9ca5d-8b06415c.cjs → register-component-a5a9ca5d-eebf89e7.cjs} +1 -1
- package/dist/scheduler-config-store-9ccfba4d-22a58b7d.cjs +1 -0
- package/dist/{scheduler-config-store-4a50a03d-4a2e2abf.js → scheduler-config-store-9ccfba4d-fd62a421.js} +8 -6
- package/dist/{scheduler-store-f02ce045-121c1e09.js → scheduler-store-8a400448-3b007d4d.js} +125 -96
- package/dist/scheduler-store-8a400448-44e0edad.cjs +1 -0
- package/dist/{textarea-component.entry-402a369b.cjs → textarea-component.entry-48feabb3.cjs} +1 -1
- package/dist/{textarea-component.entry-1ec19adb.js → textarea-component.entry-ead5ab00.js} +7 -6
- package/dist/{translate-icon.entry-d412697e.js → translate-icon.entry-55043beb.js} +6 -6
- package/dist/{translate-icon.entry-59f4e190.cjs → translate-icon.entry-5f62bc61.cjs} +1 -1
- package/dist/{warning-icon.entry-aa6b2c2c.cjs → warning-icon.entry-2e0a80da.cjs} +1 -1
- package/dist/{warning-icon.entry-3ee1f451.js → warning-icon.entry-fa644462.js} +5 -5
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-936fd73b.cjs +0 -1
- package/dist/add-circle-icon_2.entry-ce6aaa1d.js +0 -25
- package/dist/arrow-icon.entry-057db95a.js +0 -15
- package/dist/button-component.entry-22d0ac2e.js +0 -16
- package/dist/button-component.entry-385f9581.cjs +0 -1
- package/dist/calendar-info-icon_28.entry-b4f09bfe.cjs +0 -1
- package/dist/calendar-info-icon_28.entry-b71c23c5.js +0 -2083
- package/dist/chevron-icon_3.entry-4807a0b1.cjs +0 -1
- package/dist/google-logo-icon_4.entry-77f3b86e.js +0 -454
- package/dist/google-logo-icon_4.entry-c5db1be3.cjs +0 -1
- package/dist/index-53420959-16700a42.cjs +0 -1
- package/dist/index-53420959-f0c4f9af.js +0 -5
- package/dist/index-769f0fdd.cjs +0 -42
- package/dist/input-component.entry-a38a65da.js +0 -45
- package/dist/input-component.entry-ef2b397d.cjs +0 -1
- package/dist/loading-icon.entry-175aca19.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-6de99d57.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-00a71304.cjs +0 -2
- package/dist/nylas-scheduling.entry-f1fb67d2.cjs +0 -1
- package/dist/play-icon_2.entry-ab47588e.js +0 -25
- package/dist/play-icon_2.entry-b1167d3a.cjs +0 -1
- package/dist/scheduler-config-store-4a50a03d-40e87f35.cjs +0 -1
- package/dist/scheduler-store-f02ce045-f11cfad9.cjs +0 -1
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
import { r as R, h as i, c as k, x as xt, d as h, y as A, H as gt, g as _t } from "./index-5efb84b8.js";
|
|
2
|
+
import { R as vt } from "./register-component-a5a9ca5d-d69a7a05.js";
|
|
3
|
+
import { D as mt } from "./constants-7ce66b44-e7ca66c2.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const St = ".sc-google-logo-icon-h{display:flex}", Lt = St, Tt = class {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
R(this, t), this.width = "24", this.height = "24";
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return i("svg", { key: "555521f048f2f287de7572071b43a53efeae7a10", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("g", { key: "2613493e10c2c2bd60da54b6c5ec674ae56d4bb0", "clip-path": "url(#clip0_959_12452)" }, i("path", { key: "8467e8ba5977837e472bec1d8a2bec6ed08bbb8f", 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" }), i("path", { key: "0a575c6bc170567883e793eebca58942de623a13", 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" }), i("path", { key: "4c4e6d0e4d8555fd3f7dedc24ccc27a5ac3209ea", 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" }), i("path", { key: "d6dca8d2887f09a6d7a95b84238ec7615e3530c3", 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" })), i("defs", { key: "5ea0838d988413517f09c07e413d97db3b942375" }, i("clipPath", { key: "dd0a31b400e699406e194711fcbc949d5f3c8304", id: "clip0_959_12452" }, i("rect", { key: "86cb4fe6ed9cada88e94516cf76ddaa3a2d62311", width: 24, height: 24, fill: "white" }))));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
Tt.style = Lt;
|
|
15
|
+
const Ft = ".sc-microsoft-logo-icon-h{display:flex}", Ht = Ft, Bt = class {
|
|
16
|
+
constructor(t) {
|
|
17
|
+
R(this, t), this.width = "22", this.height = "22";
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return i("svg", { key: "da59f9b8e18c52e2ca12e97ce694b7abc30aea0d", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "ef4d02c0f11fd9df3a3e1a781d2379526404c469", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), i("path", { key: "9799ab150bbdee2cf4ec6275b2388fe2c00dd85e", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), i("path", { key: "65f7ee7dedd27844e342d2f1e7065814c6012c46", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), i("path", { key: "a21de9dcc8252feec5b07059371eba058b2d071c", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
Bt.style = Ht;
|
|
24
|
+
function Dt({ id: t, formState: e, activeTab: a, calendars: o, currentUser: r }) {
|
|
25
|
+
switch (a) {
|
|
26
|
+
case "eventInfo":
|
|
27
|
+
const n = e.title, l = e.description, s = parseInt(e.duration), u = e.location, p = e.conferencing;
|
|
28
|
+
return i(
|
|
29
|
+
"div",
|
|
30
|
+
{ key: t },
|
|
31
|
+
i(
|
|
32
|
+
"nylas-event-info",
|
|
33
|
+
null,
|
|
34
|
+
i(
|
|
35
|
+
"div",
|
|
36
|
+
{ slot: "inputs" },
|
|
37
|
+
i("nylas-event-title", { name: "title", eventTitle: n, exportparts: "net, net__title, net__dropdown-content" }),
|
|
38
|
+
i("nylas-event-duration", { name: "duration", eventDurationMinutes: s, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
|
|
39
|
+
i("nylas-event-location", { name: "location", eventLocation: u, eventConferencing: p, userProvider: r.provider, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
|
|
40
|
+
i("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
|
|
41
|
+
)
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
case "availability":
|
|
45
|
+
const _ = e.availability.openHours, S = e.availability.timezone ? e.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
46
|
+
return i(
|
|
47
|
+
"div",
|
|
48
|
+
{ key: t },
|
|
49
|
+
i("nylas-participant-booking-calendars", { name: "participant-booking-calendars", participants: e.participants, calendars: o }),
|
|
50
|
+
i("nylas-connected-calendars", { name: "connected-calendars", participants: e.participants }),
|
|
51
|
+
i("nylas-availability-picker", { name: "availability", openHours: _, defaultTimezone: S, 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" })
|
|
52
|
+
);
|
|
53
|
+
case "bookingOptions":
|
|
54
|
+
return i(
|
|
55
|
+
"div",
|
|
56
|
+
{ key: t },
|
|
57
|
+
i("nylas-buffer-time", { name: "buffer-time", buffer: e.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" }),
|
|
58
|
+
i(
|
|
59
|
+
"nylas-event-limits",
|
|
60
|
+
null,
|
|
61
|
+
i(
|
|
62
|
+
"div",
|
|
63
|
+
{ slot: "inputs" },
|
|
64
|
+
i("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: e.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" }),
|
|
65
|
+
i("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: e.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" }),
|
|
66
|
+
i("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: e.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" }),
|
|
67
|
+
i("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: e.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
68
|
+
)
|
|
69
|
+
),
|
|
70
|
+
i("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(e.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
|
|
71
|
+
i("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" })
|
|
72
|
+
);
|
|
73
|
+
case "participants":
|
|
74
|
+
return i(
|
|
75
|
+
"div",
|
|
76
|
+
{ key: t },
|
|
77
|
+
i("nylas-additional-participants", { name: "participants", eventParticipants: e.participants, exportparts: "nap__title, nap__subtitle, nap__content, nap__input_group, nap__input_wrapper, nap__input, nap__remove-participant" }),
|
|
78
|
+
i("nylas-participants-custom-availability", { name: "participant-custom-availability", participants: e.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" })
|
|
79
|
+
);
|
|
80
|
+
case "bookingForm":
|
|
81
|
+
const L = Object.entries(e.additionalFields).map(([T, F]) => ({ key: T, ...F }));
|
|
82
|
+
return i(
|
|
83
|
+
"div",
|
|
84
|
+
{ key: t },
|
|
85
|
+
i("nylas-booking-form-config", { name: "additional-fields", additonalFields: L })
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const Pt = '.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}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;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}.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}', Nt = Pt;
|
|
90
|
+
var Et = function(t, e, a, o) {
|
|
91
|
+
var r = arguments.length, n = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, a) : o, l;
|
|
92
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
93
|
+
n = Reflect.decorate(t, e, a, o);
|
|
94
|
+
else
|
|
95
|
+
for (var s = t.length - 1; s >= 0; s--)
|
|
96
|
+
(l = t[s]) && (n = (r < 3 ? l(n) : r > 3 ? l(e, a, n) : l(e, a)) || n);
|
|
97
|
+
return r > 3 && n && Object.defineProperty(e, a, n), n;
|
|
98
|
+
}, j = function(t, e) {
|
|
99
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
100
|
+
return Reflect.metadata(t, e);
|
|
101
|
+
};
|
|
102
|
+
const wt = class {
|
|
103
|
+
constructor(t) {
|
|
104
|
+
R(this, t), this.schedulerConfigChanged = k(this, "schedulerConfigChanged", 7), this.cancelButtonClick = k(this, "cancelButtonClick", 7), this.formSubmitted = k(this, "formSubmitted", 7), this.previewButtonClicked = k(this, "previewButtonClicked", 7), this.setError = (e) => {
|
|
105
|
+
this.error = e.message;
|
|
106
|
+
}, this.formSubmissionHandler = async (e) => {
|
|
107
|
+
var $, U, Z, V, J, G, W, q, K, Q, X, Y, tt, et, it, at;
|
|
108
|
+
if (e.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity()) {
|
|
109
|
+
this.error = this.formRef.validationMessage || "Please fix the form errors.";
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
113
|
+
const o = this.updateFormState(), { title: r, description: n, duration: l, availability: s, bookingCalendar: u, location: p, bookingType: _, buffer: S, availableDaysInFuture: L, minCancellationNotice: T, minBookingNotice: F, cancellationPolicy: P, timeslotInterval: y, additionalGuestsHidden: N, hideCancellationOptions: E, hideReschedulingOptions: O, participants: v, participantOpenHours: b, additionalFields: I, participantCalendars: w, conferencing: M, participantBookingCalendars: m } = o, c = (U = ($ = this.selectedConfiguration) == null ? void 0 : $.participants) == null ? void 0 : U.find((d) => d.is_organizer), C = w && (c != null && c.email) ? w[c == null ? void 0 : c.email] : [], H = ((Z = c == null ? void 0 : c.booking) == null ? void 0 : Z.calendar_id) || u, B = l ? parseInt(l) : 30, f = v && (v == null ? void 0 : v.length) > 0 ? v : [
|
|
114
|
+
{
|
|
115
|
+
name: (c == null ? void 0 : c.name) ?? ((V = this.currentUser) == null ? void 0 : V.name) ?? "",
|
|
116
|
+
email: (c == null ? void 0 : c.email) ?? ((J = this.currentUser) == null ? void 0 : J.email) ?? "",
|
|
117
|
+
is_organizer: !0,
|
|
118
|
+
timezone: (s == null ? void 0 : s.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
119
|
+
availability: {
|
|
120
|
+
calendar_ids: C.length ? C : ["primary"],
|
|
121
|
+
open_hours: []
|
|
122
|
+
},
|
|
123
|
+
booking: {
|
|
124
|
+
calendar_id: u && u !== "" ? u : "primary"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
], g = {
|
|
128
|
+
...((G = this.selectedConfiguration) == null ? void 0 : G.id) && { id: this.selectedConfiguration.id },
|
|
129
|
+
version: ((W = this.selectedConfiguration) == null ? void 0 : W.version) ?? "1.0.0",
|
|
130
|
+
availability: {
|
|
131
|
+
duration_minutes: B,
|
|
132
|
+
interval_minutes: (y == null ? void 0 : y.interval) ?? B,
|
|
133
|
+
round_to: y == null ? void 0 : y.roundTo,
|
|
134
|
+
availability_rules: {
|
|
135
|
+
availability_method: ((Q = (K = (q = this.selectedConfiguration) == null ? void 0 : q.availability) == null ? void 0 : K.availability_rules) == null ? void 0 : Q.availability_method) ?? "collective",
|
|
136
|
+
buffer: S || { before: 0, after: 0 },
|
|
137
|
+
default_open_hours: (s == null ? void 0 : s.openHours) ?? ((tt = (Y = (X = this.selectedConfiguration) == null ? void 0 : X.availability) == null ? void 0 : Y.availability_rules) == null ? void 0 : tt.default_open_hours) ?? mt,
|
|
138
|
+
round_robin_group_id: ((at = (it = (et = this.selectedConfiguration) == null ? void 0 : et.availability) == null ? void 0 : it.availability_rules) == null ? void 0 : at.round_robin_group_id) ?? ""
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
participants: [
|
|
142
|
+
...f == null ? void 0 : f.map((d) => {
|
|
143
|
+
var nt, st, ot, rt, lt, dt, ct, bt, ht, ut, pt, ft, yt;
|
|
144
|
+
return d.is_organizer ? {
|
|
145
|
+
name: d.name ?? "",
|
|
146
|
+
email: d.email,
|
|
147
|
+
is_organizer: !0,
|
|
148
|
+
timezone: ((st = (nt = b == null ? void 0 : b[d.email]) == null ? void 0 : nt[0]) == null ? void 0 : st.timezone) ?? ((lt = (rt = (ot = d.availability) == null ? void 0 : ot.open_hours) == null ? void 0 : rt[0]) == null ? void 0 : lt.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
149
|
+
availability: {
|
|
150
|
+
calendar_ids: C.length ? C : ["primary"],
|
|
151
|
+
open_hours: (b == null ? void 0 : b[d.email]) ?? ((dt = d.availability) == null ? void 0 : dt.open_hours) ?? []
|
|
152
|
+
},
|
|
153
|
+
booking: {
|
|
154
|
+
calendar_id: H || "primary"
|
|
155
|
+
}
|
|
156
|
+
} : {
|
|
157
|
+
...d,
|
|
158
|
+
timezone: ((bt = (ct = b == null ? void 0 : b[d.email]) == null ? void 0 : ct[0]) == null ? void 0 : bt.timezone) ?? ((pt = (ut = (ht = d.availability) == null ? void 0 : ht.open_hours) == null ? void 0 : ut[0]) == null ? void 0 : pt.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
159
|
+
availability: d.availability ? {
|
|
160
|
+
calendar_ids: (w == null ? void 0 : w[d.email]) ?? ((ft = d.availability) == null ? void 0 : ft.calendar_ids) ?? ["primary"],
|
|
161
|
+
open_hours: (b == null ? void 0 : b[d.email]) ?? ((yt = d.availability) == null ? void 0 : yt.open_hours) ?? []
|
|
162
|
+
} : void 0,
|
|
163
|
+
booking: m != null && m[d.email] ? { calendar_id: m == null ? void 0 : m[d.email] } : void 0
|
|
164
|
+
};
|
|
165
|
+
})
|
|
166
|
+
],
|
|
167
|
+
event_booking: {
|
|
168
|
+
title: (r == null ? void 0 : r.toString()) ?? "",
|
|
169
|
+
description: (n == null ? void 0 : n.toString()) ?? "",
|
|
170
|
+
location: (p == null ? void 0 : p.toString()) ?? "",
|
|
171
|
+
booking_type: (_ == null ? void 0 : _.toString()) ?? "booking",
|
|
172
|
+
timezone: (s == null ? void 0 : s.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
173
|
+
conferencing: M
|
|
174
|
+
},
|
|
175
|
+
scheduler: {
|
|
176
|
+
cancellation_policy: P ?? "",
|
|
177
|
+
available_days_in_future: L ?? 30,
|
|
178
|
+
min_cancellation_notice: T ?? 0,
|
|
179
|
+
min_booking_notice: F ?? 60,
|
|
180
|
+
hide_additional_guests: N ?? !1,
|
|
181
|
+
hide_cancellation_options: E ?? !1,
|
|
182
|
+
hide_rescheduling_options: O ?? !1,
|
|
183
|
+
additional_fields: I
|
|
184
|
+
}
|
|
185
|
+
}, x = xt(g, this.selectedConfiguration), D = this.action === "create" ? x : g, Ct = (d) => {
|
|
186
|
+
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
187
|
+
this.changesSaved = !1;
|
|
188
|
+
}, 5e3);
|
|
189
|
+
};
|
|
190
|
+
this.checkForClientSideErrors(D) || this.schedulerConfigChanged.emit({ config: D, resetLoadingState: Ct, setError: this.setError, action: this.action });
|
|
191
|
+
}, this.checkForClientSideErrors = (e) => {
|
|
192
|
+
var n;
|
|
193
|
+
let a = !1, o = "";
|
|
194
|
+
const r = (n = e.scheduler) == null ? void 0 : n.additional_fields;
|
|
195
|
+
return r && (o = "Booking form error: ", Object.entries(r).forEach((l) => {
|
|
196
|
+
const s = l[1];
|
|
197
|
+
if (s.label === "") {
|
|
198
|
+
o += `Label is required for field of type ${s.type}.`, a = !0;
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (s.options) {
|
|
202
|
+
for (const u of s.options)
|
|
203
|
+
if (u === "") {
|
|
204
|
+
o += `Empty option detected inside ${s.label} of type ${s.type}.`, a = !0;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
})), a && (this.isLoading = !1, this.setError(new Error(o))), a;
|
|
209
|
+
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
210
|
+
}
|
|
211
|
+
configChangedHandler(t) {
|
|
212
|
+
h("[nylas-editor-tabs]", "configChangedHandler", t, this.selectedConfiguration), this.formState = {
|
|
213
|
+
...this.getFormStateFromConfig(t)
|
|
214
|
+
}, t.id ? this.action = "edit" : this.action = "create";
|
|
215
|
+
}
|
|
216
|
+
connectedCallback() {
|
|
217
|
+
h("[nylas-editor-tabs]", "connectedCallback");
|
|
218
|
+
}
|
|
219
|
+
componentWillLoad() {
|
|
220
|
+
h("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
221
|
+
}
|
|
222
|
+
componentDidLoad() {
|
|
223
|
+
h("[nylas-editor-tabs]", "componentDidLoad");
|
|
224
|
+
}
|
|
225
|
+
disconnectedCallback() {
|
|
226
|
+
h("[nylas-editor-tabs]", "disconnectedCallback");
|
|
227
|
+
}
|
|
228
|
+
handleValueChanged(t) {
|
|
229
|
+
h("[nylas-editor-tabs]", "handleValueChanged", t);
|
|
230
|
+
const { name: e, value: a } = t.detail;
|
|
231
|
+
this.setFormState(a, e), this.formState = { ...this.formState }, this.hasUnsavedChanges = !0, this.error = "";
|
|
232
|
+
}
|
|
233
|
+
getFormStateFromConfig(t) {
|
|
234
|
+
var a, o, r, n, l, s, u, p, _, S, L, T, F, P, y, N, E, O, v, b, I, w, M, m, c, C, H, B;
|
|
235
|
+
const e = (a = t == null ? void 0 : t.participants) == null ? void 0 : a.find((f) => f.is_organizer);
|
|
236
|
+
return {
|
|
237
|
+
title: ((o = t == null ? void 0 : t.event_booking) == null ? void 0 : o.title) ?? "",
|
|
238
|
+
description: ((r = t == null ? void 0 : t.event_booking) == null ? void 0 : r.description) ?? "",
|
|
239
|
+
duration: ((l = (n = t == null ? void 0 : t.availability) == null ? void 0 : n.duration_minutes) == null ? void 0 : l.toString()) ?? "30",
|
|
240
|
+
availability: {
|
|
241
|
+
timezone: ((s = t == null ? void 0 : t.event_booking) == null ? void 0 : s.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
242
|
+
openHours: ((p = (u = t == null ? void 0 : t.availability) == null ? void 0 : u.availability_rules) == null ? void 0 : p.default_open_hours) ?? mt
|
|
243
|
+
},
|
|
244
|
+
additionalFields: ((_ = t == null ? void 0 : t.scheduler) == null ? void 0 : _.additional_fields) ?? {},
|
|
245
|
+
conferencing: ((S = t == null ? void 0 : t.event_booking) == null ? void 0 : S.conferencing) ?? {},
|
|
246
|
+
calendarIds: ((L = e == null ? void 0 : e.availability) == null ? void 0 : L.calendar_ids) ?? [],
|
|
247
|
+
participants: (t == null ? void 0 : t.participants) ?? [],
|
|
248
|
+
bookingCalendar: ((T = e == null ? void 0 : e.booking) == null ? void 0 : T.calendar_id) ?? (e == null ? void 0 : e.email) ?? "",
|
|
249
|
+
location: ((F = t == null ? void 0 : t.event_booking) == null ? void 0 : F.location) ?? "",
|
|
250
|
+
bookingType: ((P = t == null ? void 0 : t.event_booking) == null ? void 0 : P.booking_type) ?? "booking",
|
|
251
|
+
buffer: ((N = (y = t == null ? void 0 : t.availability) == null ? void 0 : y.availability_rules) == null ? void 0 : N.buffer) ?? { before: 0, after: 0 },
|
|
252
|
+
cancellationPolicy: ((E = t == null ? void 0 : t.scheduler) == null ? void 0 : E.cancellation_policy) ?? "",
|
|
253
|
+
availableDaysInFuture: ((O = t == null ? void 0 : t.scheduler) == null ? void 0 : O.available_days_in_future) ?? 30,
|
|
254
|
+
minCancellationNotice: ((v = t == null ? void 0 : t.scheduler) == null ? void 0 : v.min_cancellation_notice) ?? 0,
|
|
255
|
+
minBookingNotice: ((b = t == null ? void 0 : t.scheduler) == null ? void 0 : b.min_booking_notice) ?? 60,
|
|
256
|
+
timeslotInterval: {
|
|
257
|
+
interval: ((I = t == null ? void 0 : t.availability) == null ? void 0 : I.interval_minutes) ?? ((w = t == null ? void 0 : t.availability) == null ? void 0 : w.duration_minutes),
|
|
258
|
+
roundTo: (M = t == null ? void 0 : t.availability) == null ? void 0 : M.round_to
|
|
259
|
+
},
|
|
260
|
+
additionalGuestsHidden: ((m = t == null ? void 0 : t.scheduler) == null ? void 0 : m.hide_additional_guests) ?? !1,
|
|
261
|
+
hideCancellationOptions: ((c = t == null ? void 0 : t.scheduler) == null ? void 0 : c.hide_cancellation_options) ?? !1,
|
|
262
|
+
hideReschedulingOptions: ((C = t == null ? void 0 : t.scheduler) == null ? void 0 : C.hide_rescheduling_options) ?? !1,
|
|
263
|
+
participantBookingCalendars: ((H = t == null ? void 0 : t.participants) == null ? void 0 : H.reduce((f, g) => {
|
|
264
|
+
var x, D;
|
|
265
|
+
return (x = g.booking) != null && x.calendar_id && (f[g.email] = (D = g.booking) == null ? void 0 : D.calendar_id), f;
|
|
266
|
+
})) ?? {},
|
|
267
|
+
participantCalendars: ((B = t == null ? void 0 : t.participants) == null ? void 0 : B.reduce((f, g) => {
|
|
268
|
+
var x;
|
|
269
|
+
return f[g.email] = (x = g.availability) == null ? void 0 : x.calendar_ids, f;
|
|
270
|
+
}, {})) ?? {}
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
setFormState(t, e) {
|
|
274
|
+
switch (e) {
|
|
275
|
+
case "title":
|
|
276
|
+
this.formState.title = t.toString();
|
|
277
|
+
break;
|
|
278
|
+
case "description":
|
|
279
|
+
this.formState.description = t.toString();
|
|
280
|
+
break;
|
|
281
|
+
case "duration":
|
|
282
|
+
this.formState.duration = t.toString();
|
|
283
|
+
break;
|
|
284
|
+
case "availability":
|
|
285
|
+
this.formState.availability = JSON.parse(t.toString());
|
|
286
|
+
break;
|
|
287
|
+
case "participants":
|
|
288
|
+
this.formState.participants = JSON.parse(t.toString());
|
|
289
|
+
break;
|
|
290
|
+
case "booking-calendar":
|
|
291
|
+
this.formState.bookingCalendar = t.toString();
|
|
292
|
+
break;
|
|
293
|
+
case "participant-booking-calendars":
|
|
294
|
+
this.formState.participantBookingCalendars = JSON.parse(t.toString());
|
|
295
|
+
break;
|
|
296
|
+
case "location":
|
|
297
|
+
this.formState.location = t.toString();
|
|
298
|
+
break;
|
|
299
|
+
case "conference":
|
|
300
|
+
this.formState.conferencing = JSON.parse(t.toString());
|
|
301
|
+
break;
|
|
302
|
+
case "booking-type":
|
|
303
|
+
this.formState.bookingType = t.toString();
|
|
304
|
+
break;
|
|
305
|
+
case "buffer-time":
|
|
306
|
+
this.formState.buffer = JSON.parse(t.toString());
|
|
307
|
+
break;
|
|
308
|
+
case "limit-future-bookings":
|
|
309
|
+
this.formState.availableDaysInFuture = parseInt(t.toString());
|
|
310
|
+
break;
|
|
311
|
+
case "min-cancellation-notice":
|
|
312
|
+
this.formState.minCancellationNotice = parseInt(t.toString());
|
|
313
|
+
break;
|
|
314
|
+
case "min-booking-notice":
|
|
315
|
+
this.formState.minBookingNotice = parseInt(t.toString());
|
|
316
|
+
break;
|
|
317
|
+
case "cancellation-policy":
|
|
318
|
+
this.formState.cancellationPolicy = t.toString();
|
|
319
|
+
break;
|
|
320
|
+
case "timeslot-interval":
|
|
321
|
+
this.formState.timeslotInterval = JSON.parse(t.toString());
|
|
322
|
+
break;
|
|
323
|
+
case "customize-booking-settings":
|
|
324
|
+
const a = JSON.parse(t.toString());
|
|
325
|
+
this.formState.additionalGuestsHidden = a.additionalGuestsHidden, this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
|
|
326
|
+
break;
|
|
327
|
+
case "participant-custom-availability":
|
|
328
|
+
const o = JSON.parse(t.toString());
|
|
329
|
+
this.formState.participantOpenHours = o;
|
|
330
|
+
break;
|
|
331
|
+
case "additional-fields":
|
|
332
|
+
this.formState.additionalFields = t;
|
|
333
|
+
break;
|
|
334
|
+
case "connected-calendars":
|
|
335
|
+
this.formState.participantCalendars = JSON.parse(t.toString());
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
updateFormState() {
|
|
340
|
+
return new FormData(this.formRef).forEach((e, a) => {
|
|
341
|
+
this.setFormState(e, a);
|
|
342
|
+
}), this.formState = { ...this.formState }, this.formState;
|
|
343
|
+
}
|
|
344
|
+
setActiveTab(t, e) {
|
|
345
|
+
t.preventDefault(), this.updateFormState(), this.activeTab = e;
|
|
346
|
+
}
|
|
347
|
+
hideTab(t) {
|
|
348
|
+
var e;
|
|
349
|
+
return ((e = this.hideEditorTabs) == null ? void 0 : e.includes(t)) || !1;
|
|
350
|
+
}
|
|
351
|
+
render() {
|
|
352
|
+
var t;
|
|
353
|
+
return h("[nylas-editor-tabs]", "render", this.formState), i(gt, { key: "6636487c6ce64dddbcb5b393c9240fae3dacab62" }, i("form", { key: "10a616e5d8c6b19d650bbbaa26bdcb178b050161", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (e) => this.formRef = e, noValidate: !0 }, this.mode === "app" ? i("div", { class: "form-contents" }, i("div", { class: "tabs" }, i("button", { class: { tab: !0, active: this.activeTab == "eventInfo", hide: this.hideTab("eventInfo") }, part: "editortab__event-info", onClick: (e) => this.setActiveTab(e, "eventInfo") }, i("calendar-info-icon", { width: "16", height: "16" }), "Event info"), i("button", { class: { tab: !0, active: this.activeTab == "availability", hide: this.hideTab("availability") }, part: "editortab__availability", onClick: (e) => this.setActiveTab(e, "availability") }, i("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), i("button", { class: { tab: !0, active: this.activeTab == "participants", hide: this.hideTab("participants") }, part: "editortab__participants", onClick: (e) => this.setActiveTab(e, "participants") }, i("people-icon", { width: "16", height: "16" }), "Participants"), i("button", { class: { tab: !0, active: this.activeTab == "bookingOptions", hide: this.hideTab("bookingOptions") }, part: "editortab__booking-options", onClick: (e) => this.setActiveTab(e, "bookingOptions") }, i("flow-icon", { width: "16", height: "16" }), "Booking options"), i("button", { class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab("bookingForm") }, part: "editortab__booking-form", onClick: (e) => this.setActiveTab(e, "bookingForm") }, this.activeTab == "bookingForm" ? i("calendar-agenda-fill-icon", { width: "16", height: "16" }) : i("calendar-agenda-icon", { width: "16", height: "16" }), "Booking form")), i("div", { class: "tab-content" }, i(Dt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((t = this.selectedConfiguration) == null ? void 0 : t.id) ?? "new" }))) : i("slot", null), i("div", { key: "280c0c7aeb9199c53586cc211ae473bbe23efc88", class: "footer" }, i("div", { key: "8ae601f7812e3a0ad346dea9d79bde817c477fcd", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && i("button-component", { type: "button", disabled: this.isLoading, clickHandler: (e) => {
|
|
354
|
+
e.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(A(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
355
|
+
}, variant: "basic" }, "Preview")), i("div", { key: "9442375eebbac6e0edf76ccd81be5607c3427120", class: "buttons" }, i("p", { key: "3bac06ac6145e732ee05ed8b953a4bac8dc123d3", class: {
|
|
356
|
+
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
357
|
+
"saved-changes": this.changesSaved,
|
|
358
|
+
error: this.error !== "",
|
|
359
|
+
"error-full-width": this.error !== "" && this.action === "create"
|
|
360
|
+
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), i("button-component", { key: "b6347b69d1a624d9dd65e2831a0a7ae92bfd95b6", type: "button", disabled: this.isLoading, clickHandler: (e) => {
|
|
361
|
+
e.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
362
|
+
}, variant: "basic" }, "Back"), i("button-component", { key: "28222fdd8258c009690d25ccbf05ad86abcc1cd3", type: "submit", disabled: this.isLoading }, this.isLoading ? i("span", null, "Saving", i("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
|
|
363
|
+
}
|
|
364
|
+
get host() {
|
|
365
|
+
return _t(this);
|
|
366
|
+
}
|
|
367
|
+
static get watchers() {
|
|
368
|
+
return {
|
|
369
|
+
selectedConfiguration: ["configChangedHandler"]
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
Et([
|
|
374
|
+
vt({
|
|
375
|
+
name: "nylas-editor-tabs",
|
|
376
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
377
|
+
["schedulerConfig.calendars", "calendars"],
|
|
378
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
379
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
380
|
+
["schedulerConfig.hideEditorTabs", "hideEditorTabs"]
|
|
381
|
+
]),
|
|
382
|
+
eventToProps: {
|
|
383
|
+
schedulerConfigChanged: async (t, e) => {
|
|
384
|
+
const { resetLoadingState: a, setError: o, action: r, config: n } = t.detail, l = (s) => {
|
|
385
|
+
const [u, p] = s;
|
|
386
|
+
!u && p && o && o(p), a && a(t);
|
|
387
|
+
};
|
|
388
|
+
if (r === "edit") {
|
|
389
|
+
const s = await e.schedulerConfig.updateConfiguration(n);
|
|
390
|
+
l(s);
|
|
391
|
+
} else {
|
|
392
|
+
const s = await e.schedulerConfig.createConfiguration(n);
|
|
393
|
+
l(s);
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
cancelButtonClick: async (t, e) => {
|
|
397
|
+
e.schedulerConfigStore.state.action = null;
|
|
398
|
+
},
|
|
399
|
+
previewButtonClicked: async (t, e) => {
|
|
400
|
+
h("[nylas-editor-tabs]", "previewButtonClicked", e);
|
|
401
|
+
},
|
|
402
|
+
formSubmitted: async (t, e) => {
|
|
403
|
+
h("[nylas-editor-tabs]", "formSubmitted", e);
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
407
|
+
fireRegisterEvent: !0
|
|
408
|
+
}),
|
|
409
|
+
j("design:type", Function),
|
|
410
|
+
j("design:paramtypes", []),
|
|
411
|
+
j("design:returntype", void 0)
|
|
412
|
+
], wt.prototype, "render", null);
|
|
413
|
+
wt.style = Nt;
|
|
414
|
+
const Ot = ':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:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations table th.actions-header{text-align:right}.configurations 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 tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .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)}', It = Ot;
|
|
415
|
+
var Mt = function(t, e, a, o) {
|
|
416
|
+
var r = arguments.length, n = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, a) : o, l;
|
|
417
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
418
|
+
n = Reflect.decorate(t, e, a, o);
|
|
419
|
+
else
|
|
420
|
+
for (var s = t.length - 1; s >= 0; s--)
|
|
421
|
+
(l = t[s]) && (n = (r < 3 ? l(n) : r > 3 ? l(e, a, n) : l(e, a)) || n);
|
|
422
|
+
return r > 3 && n && Object.defineProperty(e, a, n), n;
|
|
423
|
+
}, z = function(t, e) {
|
|
424
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
425
|
+
return Reflect.metadata(t, e);
|
|
426
|
+
};
|
|
427
|
+
const kt = class {
|
|
428
|
+
constructor(t) {
|
|
429
|
+
R(this, t), this.initListConfigurations = k(this, "initListConfigurations", 7), this.createButtonClick = k(this, "createButtonClick", 7), this.editButtonClick = k(this, "editButtonClick", 7), this.deleteButtonClick = k(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.listConfigurationsNextCursor = void 0, this.state = "loading", this.error = "", this.currentCursor = null, this.previousCursors = [], this.disableNextPageButton = !1;
|
|
430
|
+
}
|
|
431
|
+
listConfigurationsNextCursorChangedHandler(t, e) {
|
|
432
|
+
if (!t || t === e) {
|
|
433
|
+
t === null && (this.disableNextPageButton = !0);
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
this.disableNextPageButton = !1, this.currentCursor = t;
|
|
437
|
+
}
|
|
438
|
+
connectedCallback() {
|
|
439
|
+
h("[nylas-list-configurations]", "connectedCallback");
|
|
440
|
+
}
|
|
441
|
+
componentWillLoad() {
|
|
442
|
+
h("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
443
|
+
}
|
|
444
|
+
componentDidLoad() {
|
|
445
|
+
h("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit({
|
|
446
|
+
host: this.host
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
disconnectedCallback() {
|
|
450
|
+
h("[nylas-list-configurations]", "disconnectedCallback");
|
|
451
|
+
}
|
|
452
|
+
async handleNylasFormDropdownChanged(t) {
|
|
453
|
+
h("[nylas-list-configurations]", "handleNylasFormDropdownChanged", t.detail);
|
|
454
|
+
const { value: e } = t.detail, [a, o] = e.split("-");
|
|
455
|
+
switch (t.preventDefault(), a) {
|
|
456
|
+
case "delete":
|
|
457
|
+
this.deleteButtonClick.emit({ host: this.host, configuration: this.configurations[o] });
|
|
458
|
+
break;
|
|
459
|
+
case "preview":
|
|
460
|
+
window.open(A(this.schedulerPreviewLink, this.configurations[o]), "_blank");
|
|
461
|
+
break;
|
|
462
|
+
case "copy":
|
|
463
|
+
await navigator.clipboard.writeText(A(this.schedulerPreviewLink, this.configurations[o]));
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
async getState() {
|
|
468
|
+
return this.state;
|
|
469
|
+
}
|
|
470
|
+
async setState(t) {
|
|
471
|
+
this.state = t;
|
|
472
|
+
}
|
|
473
|
+
async setError(t) {
|
|
474
|
+
this.error = t;
|
|
475
|
+
}
|
|
476
|
+
getDurationString(t) {
|
|
477
|
+
const e = Math.floor(t / 60), a = t % 60;
|
|
478
|
+
return `${e || ""} ${e ? `${e > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
|
|
479
|
+
}
|
|
480
|
+
getActionLabelHTML(t) {
|
|
481
|
+
const e = {
|
|
482
|
+
display: "inline-flex",
|
|
483
|
+
alignItems: "center",
|
|
484
|
+
gap: "0.5rem"
|
|
485
|
+
}, a = {
|
|
486
|
+
color: "var(--nylas-error)"
|
|
487
|
+
};
|
|
488
|
+
switch (t) {
|
|
489
|
+
case "preview":
|
|
490
|
+
return i("span", { style: e }, i("eye-icon", { width: "16", height: "16" }), "Preview");
|
|
491
|
+
case "copy":
|
|
492
|
+
return i("span", { style: e }, i("copy-icon", { width: "16", height: "16" }), "Copy");
|
|
493
|
+
case "delete":
|
|
494
|
+
return i("span", { style: { ...e, ...a } }, i("delete-icon", { width: "15", height: "17" }), "Delete");
|
|
495
|
+
default:
|
|
496
|
+
return "";
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
previousPageClickedHandler() {
|
|
500
|
+
if (this.previousCursors.length === 0)
|
|
501
|
+
return;
|
|
502
|
+
this.currentCursor = this.previousCursors.pop() || null;
|
|
503
|
+
const t = this.previousCursors[this.previousCursors.length - 1] || void 0;
|
|
504
|
+
this.initListConfigurations.emit({
|
|
505
|
+
host: this.host,
|
|
506
|
+
cursor: t
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
nextPageClickedHandler() {
|
|
510
|
+
this.currentCursor && (this.previousCursors = [...this.previousCursors, this.currentCursor], this.initListConfigurations.emit({
|
|
511
|
+
host: this.host,
|
|
512
|
+
cursor: this.currentCursor
|
|
513
|
+
}));
|
|
514
|
+
}
|
|
515
|
+
render() {
|
|
516
|
+
return i(gt, null, i("div", { class: "header" }, i("div", { class: "description" }, i("h2", null, "All scheduling pages"), i("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && i("div", { class: "actions" }, i("button-component", { clickHandler: () => {
|
|
517
|
+
this.createButtonClick.emit(this.host);
|
|
518
|
+
} }, "Create new"))), i("div", { class: "configurations" }, i("table", { class: {
|
|
519
|
+
"no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
|
|
520
|
+
} }, i("tr", { class: {
|
|
521
|
+
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
522
|
+
} }, i("th", null, "Scheduling page title"), i("th", null, "Duration"), i("th", { class: "actions-header" }, "Actions")), this.state === "loading" && i("tr", { class: "no-configurations" }, i("td", { colSpan: 3 }, i("div", null, i("h3", null, "Loading..."), i("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && i("tr", { class: "no-configurations" }, i("td", { colSpan: 3 }, i("div", null, i("calendar-icon", { width: "48", height: "48" }), i("h3", null, "No scheduling pages found"), i("p", null, "Get started with creating your first scheduling page"), i("button-component", { clickHandler: () => {
|
|
523
|
+
this.createButtonClick.emit(this.host);
|
|
524
|
+
} }, "Create new")))), this.state !== "loading" && this.configurations.map((t, e) => i("tr", { key: t.id }, i("td", null, i("div", { class: "title" }, i("span", { class: "config-event-title" }, t.event_booking.title), i("span", { class: "config-event-description" }, t.event_booking.description))), i("td", null, i("div", null, this.getDurationString(t.availability.duration_minutes))), i("td", null, i("div", { class: "actions" }, i("button-component", { variant: "basic", key: `edit-${e}`, clickHandler: (a) => {
|
|
525
|
+
a.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
|
|
526
|
+
} }, i("edit-icon", { width: "16", height: "16" }), "Edit"), i("select-dropdown", { name: "actions", options: [
|
|
527
|
+
{ value: `preview-${e}`, label: "Preview", labelHTML: this.getActionLabelHTML("preview") },
|
|
528
|
+
{ value: `copy-${e}`, label: "Copy link", labelHTML: this.getActionLabelHTML("copy") },
|
|
529
|
+
{ value: `delete-${e}`, label: "Delete", labelHTML: this.getActionLabelHTML("delete") }
|
|
530
|
+
], 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" })))))), i("div", { class: "pagination" }, i("button", { class: "arrow left", onClick: () => this.previousPageClickedHandler(), disabled: this.previousCursors.length <= 0 }, i("chevron-icon", null)), i("button", { class: "arrow right", onClick: () => this.nextPageClickedHandler(), disabled: this.disableNextPageButton }, i("chevron-icon", null)))), this.state === "error" && i("div", { class: "error-container" }, i("p", { class: "error" }, this.error)));
|
|
531
|
+
}
|
|
532
|
+
get host() {
|
|
533
|
+
return _t(this);
|
|
534
|
+
}
|
|
535
|
+
static get watchers() {
|
|
536
|
+
return {
|
|
537
|
+
listConfigurationsNextCursor: ["listConfigurationsNextCursorChangedHandler"]
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
Mt([
|
|
542
|
+
vt({
|
|
543
|
+
name: "nylas-list-configurations",
|
|
544
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
545
|
+
["schedulerConfig.configurations", "configurations"],
|
|
546
|
+
["schedulerConfig.listConfigurationsNextCursor", "listConfigurationsNextCursor"]
|
|
547
|
+
]),
|
|
548
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
549
|
+
eventToProps: {
|
|
550
|
+
initListConfigurations: async (t, e) => {
|
|
551
|
+
const { host: a, cursor: o } = t.detail;
|
|
552
|
+
await a.setState("loading");
|
|
553
|
+
const [r, n] = await e.schedulerConfig.getConfigurations(o);
|
|
554
|
+
if (!r && n && n.message) {
|
|
555
|
+
await a.setState("error"), await a.setError(n.message);
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
await a.setState("loaded");
|
|
559
|
+
},
|
|
560
|
+
createButtonClick: async (t, e) => {
|
|
561
|
+
e.schedulerConfigStore.resetSelectedConfiguration(), e.schedulerConfigStore.state.action = "create";
|
|
562
|
+
},
|
|
563
|
+
deleteButtonClick: async (t, e) => {
|
|
564
|
+
const { host: a, configuration: o } = t.detail, [r, n] = await e.schedulerConfig.deleteConfiguration(o.id);
|
|
565
|
+
!r && n && n.message && (await a.setState("error"), await a.setError(n.message));
|
|
566
|
+
},
|
|
567
|
+
editButtonClick: async (t, e) => {
|
|
568
|
+
const { configuration: a } = t.detail;
|
|
569
|
+
e.schedulerConfigStore.state.selectedConfiguration = a, e.schedulerConfigStore.state.action = "edit";
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
fireRegisterEvent: !0
|
|
573
|
+
}),
|
|
574
|
+
z("design:type", Function),
|
|
575
|
+
z("design:paramtypes", []),
|
|
576
|
+
z("design:returntype", void 0)
|
|
577
|
+
], kt.prototype, "render", null);
|
|
578
|
+
kt.style = It;
|
|
579
|
+
export {
|
|
580
|
+
Tt as google_logo_icon,
|
|
581
|
+
Bt as microsoft_logo_icon,
|
|
582
|
+
wt as nylas_editor_tabs,
|
|
583
|
+
kt as nylas_list_configurations
|
|
584
|
+
};
|