@nylas/react 0.0.0-canary-20240925163706

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.
Files changed (135) hide show
  1. package/LICENSE.md +22 -0
  2. package/README.md +111 -0
  3. package/dist/add-circle-icon_2.entry-19a0fe6b.js +25 -0
  4. package/dist/add-circle-icon_2.entry-6f0ef50b.cjs +1 -0
  5. package/dist/archive-icon.entry-7caa062b.js +15 -0
  6. package/dist/archive-icon.entry-d9a39415.cjs +1 -0
  7. package/dist/arrow-icon.entry-29ce2105.cjs +1 -0
  8. package/dist/arrow-icon.entry-ab601786.js +15 -0
  9. package/dist/bold-icon.entry-6ff126e7.cjs +1 -0
  10. package/dist/bold-icon.entry-e389dd6a.js +15 -0
  11. package/dist/button-component_2.entry-06af034d.js +26 -0
  12. package/dist/button-component_2.entry-837792bd.cjs +1 -0
  13. package/dist/calendar-agenda-fill-icon_51.entry-6c5c6fd4.js +5336 -0
  14. package/dist/calendar-agenda-fill-icon_51.entry-aaa927bb.cjs +7 -0
  15. package/dist/calendar-cancel-icon.entry-bf97fa74.js +15 -0
  16. package/dist/calendar-cancel-icon.entry-da33711a.cjs +1 -0
  17. package/dist/calendar-check-icon_2.entry-0fcc2bd1.cjs +1 -0
  18. package/dist/calendar-check-icon_2.entry-e9709591.js +25 -0
  19. package/dist/calendar-icon.entry-056c8caf.cjs +1 -0
  20. package/dist/calendar-icon.entry-70cca97a.js +15 -0
  21. package/dist/checkbox-component_2.entry-88af9f01.js +79 -0
  22. package/dist/checkbox-component_2.entry-cf19cd62.cjs +1 -0
  23. package/dist/chevron-icon_3.entry-1c22f6d3.js +143 -0
  24. package/dist/chevron-icon_3.entry-85d098ed.cjs +1 -0
  25. package/dist/clock-icon_4.entry-5edf8fcd.js +45 -0
  26. package/dist/clock-icon_4.entry-7b892d79.cjs +1 -0
  27. package/dist/constants-c31dccfe-54f255f4.cjs +15 -0
  28. package/dist/constants-c31dccfe-93b0694c.js +3883 -0
  29. package/dist/copy-icon.entry-b3b8e543.js +15 -0
  30. package/dist/copy-icon.entry-fcd2c006.cjs +1 -0
  31. package/dist/core-js-38e53e34.cjs +4 -0
  32. package/dist/core-js-a9d3b6e1.js +3297 -0
  33. package/dist/delete-icon.entry-9745ae8b.cjs +1 -0
  34. package/dist/delete-icon.entry-f982c1a7.js +15 -0
  35. package/dist/document-refresh-icon.entry-5a30a275.cjs +1 -0
  36. package/dist/document-refresh-icon.entry-defaaba2.js +15 -0
  37. package/dist/dom-68f08be9.cjs +15 -0
  38. package/dist/dom-86e17616.js +664 -0
  39. package/dist/elements/index.d.ts +128 -0
  40. package/dist/elements/react-component-lib/createComponent.d.ts +10 -0
  41. package/dist/elements/react-component-lib/createOverlayComponent.d.ts +21 -0
  42. package/dist/elements/react-component-lib/index.d.ts +2 -0
  43. package/dist/elements/react-component-lib/interfaces.d.ts +29 -0
  44. package/dist/elements/react-component-lib/utils/attachProps.d.ts +9 -0
  45. package/dist/elements/react-component-lib/utils/case.d.ts +2 -0
  46. package/dist/elements/react-component-lib/utils/dev.d.ts +2 -0
  47. package/dist/elements/react-component-lib/utils/index.d.ts +10 -0
  48. package/dist/feedbackSync-ab657d65-b98458dc.cjs +448 -0
  49. package/dist/feedbackSync-ab657d65-d6521095.js +6035 -0
  50. package/dist/folder-icon.entry-08cf370b.js +15 -0
  51. package/dist/folder-icon.entry-425f61ef.cjs +1 -0
  52. package/dist/forward-icon.entry-4acbada4.js +15 -0
  53. package/dist/forward-icon.entry-7062edbf.cjs +1 -0
  54. package/dist/globe-icon.entry-51e847a3.js +15 -0
  55. package/dist/globe-icon.entry-b779a059.cjs +1 -0
  56. package/dist/google-logo-icon_4.entry-96a8caee.cjs +1 -0
  57. package/dist/google-logo-icon_4.entry-c44f16cc.js +715 -0
  58. package/dist/inbox-icon.entry-04d81697.cjs +1 -0
  59. package/dist/inbox-icon.entry-6e3a9428.js +15 -0
  60. package/dist/index-87381561.cjs +81 -0
  61. package/dist/index-995dd3b3.js +12865 -0
  62. package/dist/index.d.ts +6 -0
  63. package/dist/index.es-b475d61f-f250d992.cjs +7 -0
  64. package/dist/index.es-b475d61f-f52875ad.js +3129 -0
  65. package/dist/info-icon_2.entry-c3f4b245.js +34 -0
  66. package/dist/info-icon_2.entry-d733f421.cjs +1 -0
  67. package/dist/input-color-picker.entry-02e48131.js +48 -0
  68. package/dist/input-color-picker.entry-516445b9.cjs +1 -0
  69. package/dist/input-component.entry-5bb8197a.cjs +1 -0
  70. package/dist/input-component.entry-dbff4e12.js +70 -0
  71. package/dist/input-dropdown.entry-7b40f8a7.cjs +1 -0
  72. package/dist/input-dropdown.entry-cc4182c4.js +134 -0
  73. package/dist/italic-icon.entry-494a04f1.js +15 -0
  74. package/dist/italic-icon.entry-bd268b46.cjs +1 -0
  75. package/dist/multi-select-dropdown.entry-55f7dd99.cjs +1 -0
  76. package/dist/multi-select-dropdown.entry-b9ac9a80.js +95 -0
  77. package/dist/nylas-booked-event-card_12.entry-a1048d4e.cjs +1 -0
  78. package/dist/nylas-booked-event-card_12.entry-ac8f1a11.js +1139 -0
  79. package/dist/nylas-form-card.entry-9957f25c.cjs +1 -0
  80. package/dist/nylas-form-card.entry-9ec44108.js +57 -0
  81. package/dist/nylas-if-state.entry-934980c1.js +94 -0
  82. package/dist/nylas-if-state.entry-f7087bb0.cjs +1 -0
  83. package/dist/nylas-login.entry-074778e6.cjs +1 -0
  84. package/dist/nylas-login.entry-17a6788a.js +73 -0
  85. package/dist/nylas-provider.entry-0edfffb0.cjs +1 -0
  86. package/dist/nylas-provider.entry-58e44ef6.js +264 -0
  87. package/dist/nylas-reminder-emails.entry-0129ea1f.cjs +4 -0
  88. package/dist/nylas-reminder-emails.entry-dec904fb.js +168 -0
  89. package/dist/nylas-reminder-time_2.entry-48b85638.js +108 -0
  90. package/dist/nylas-reminder-time_2.entry-6d8982d9.cjs +1 -0
  91. package/dist/nylas-scheduler-editor.entry-a913f2b3.js +1447 -0
  92. package/dist/nylas-scheduler-editor.entry-b293366d.cjs +2 -0
  93. package/dist/nylas-scheduling.entry-29b473ef.js +400 -0
  94. package/dist/nylas-scheduling.entry-5d751778.cjs +1 -0
  95. package/dist/nylas-time-window-picker.entry-aa613b4d.cjs +1 -0
  96. package/dist/nylas-time-window-picker.entry-d2e2210e.js +316 -0
  97. package/dist/person-icon.entry-11852b43.cjs +1 -0
  98. package/dist/person-icon.entry-767695db.js +15 -0
  99. package/dist/play-icon.entry-125d062f.cjs +1 -0
  100. package/dist/play-icon.entry-9e385af9.js +15 -0
  101. package/dist/react.cjs +1 -0
  102. package/dist/react.js +136 -0
  103. package/dist/refresh-icon.entry-13e06ddd.cjs +1 -0
  104. package/dist/refresh-icon.entry-339c1223.js +15 -0
  105. package/dist/register-component-679c1308-0b6682e1.cjs +1 -0
  106. package/dist/register-component-679c1308-3b561946.js +109 -0
  107. package/dist/reply-all-icon.entry-e56e8608.cjs +1 -0
  108. package/dist/reply-all-icon.entry-f82e7b24.js +15 -0
  109. package/dist/reply-icon.entry-319e75df.js +15 -0
  110. package/dist/reply-icon.entry-ebb08667.cjs +1 -0
  111. package/dist/scheduler-config-store-2a3b403d-aed2458a.cjs +1 -0
  112. package/dist/scheduler-config-store-2a3b403d-f5b7b06f.js +27 -0
  113. package/dist/scheduler-store-908886c8-75b1f2d8.js +474 -0
  114. package/dist/scheduler-store-908886c8-9c388312.cjs +1 -0
  115. package/dist/sent-icon.entry-2f7a8e18.js +15 -0
  116. package/dist/sent-icon.entry-393a90a3.cjs +1 -0
  117. package/dist/spam-icon.entry-d7853085.cjs +1 -0
  118. package/dist/spam-icon.entry-de7c7233.js +15 -0
  119. package/dist/star-icon.entry-c8fa29e1.cjs +1 -0
  120. package/dist/star-icon.entry-cfb5c8e5.js +15 -0
  121. package/dist/stop-icon.entry-c6e9fd7f.js +15 -0
  122. package/dist/stop-icon.entry-e5415d24.cjs +1 -0
  123. package/dist/textarea-component.entry-6f80f914.js +37 -0
  124. package/dist/textarea-component.entry-d46ad4ac.cjs +1 -0
  125. package/dist/time-period-selector.entry-2eaf3ddb.cjs +1 -0
  126. package/dist/time-period-selector.entry-f8be5854.js +80 -0
  127. package/dist/translate-icon.entry-dc151da3.cjs +1 -0
  128. package/dist/translate-icon.entry-ffb6d5bf.js +15 -0
  129. package/dist/trash-fill-icon.entry-063b2e26.cjs +1 -0
  130. package/dist/trash-fill-icon.entry-a9966957.js +15 -0
  131. package/dist/underline-icon.entry-b992a0fc.js +15 -0
  132. package/dist/underline-icon.entry-c77e97df.cjs +1 -0
  133. package/dist/warning-icon.entry-0cae2440.cjs +1 -0
  134. package/dist/warning-icon.entry-28c1b03b.js +15 -0
  135. package/package.json +50 -0
@@ -0,0 +1,1139 @@
1
+ import { r as C, c as h, d, h as n, i as c, k as J, H as g, s as U, q as de, g as W, j as X, t as fe, v as he, w as E, x as me, y as pe, z as R, F as be } from "./index-995dd3b3.js";
2
+ import { R as x } from "./register-component-679c1308-3b561946.js";
3
+ import { T as L, a as K, g as ue, b as Y } from "./constants-c31dccfe-93b0694c.js";
4
+ import "react";
5
+ import "react-dom";
6
+ const ge = ":host{display:block}.nylas-booked-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 0;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400;border-bottom:1px solid var(--nylas-base-200);width:inherit;padding:0 0 1.5rem}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booked-event-header .card-description{text-align:center}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.button-container{width:inherit}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);border-top:1px solid var(--nylas-base-200);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}", ye = ge;
7
+ var ve = function(e, t, a, r) {
8
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
9
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
10
+ i = Reflect.decorate(e, t, a, r);
11
+ else
12
+ for (var l = e.length - 1; l >= 0; l--)
13
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
14
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
15
+ }, j = function(e, t) {
16
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
17
+ return Reflect.metadata(e, t);
18
+ };
19
+ const Q = class {
20
+ constructor(e) {
21
+ C(this, e), this.cancelBookingButtonClicked = h(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = h(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = h(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = h(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
22
+ var o, i;
23
+ const t = new Date(this.selectedTimeslot.start_time), a = (i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.min_cancellation_notice;
24
+ t.getTime() - a * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
25
+ error: {
26
+ title: "Cancellation Error",
27
+ message: `You cannot cancel the booking within ${a} minutes of the event.`
28
+ }
29
+ }) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
30
+ }, this.handleRescheduleButtonClicked = () => {
31
+ const t = (a) => {
32
+ this.rescheduleBookedEventError.emit(a);
33
+ };
34
+ this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
35
+ }, this.getPaticipantType = (t) => {
36
+ switch (t) {
37
+ case "host":
38
+ return "Host";
39
+ case "you":
40
+ return "You";
41
+ default:
42
+ return "";
43
+ }
44
+ }, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.configSettings = void 0, this.isLoading = void 0, this.selectedLanguage = navigator.language;
45
+ }
46
+ connectedCallback() {
47
+ }
48
+ disconnectedCallback() {
49
+ }
50
+ async componentWillLoad() {
51
+ d("[nylas-booked-event-card] Component will load");
52
+ }
53
+ async componentDidLoad() {
54
+ d("[nylas-booked-event-card] Component did load"), this.eventInfo || console.warn('[nylas-booked-event-card] "eventInfo" prop missing. Please provide the event info to display the event details in the booked event card component.'), this.bookingInfo || console.warn('[nylas-booked-event-card] "bookingInfo" prop missing. Please provide the booking info to display the guest details in the booked event card component.');
55
+ }
56
+ render() {
57
+ var a, r, o, i, s, l, u, m, f, b, p, y, k, v, _, w, B, T;
58
+ const e = (a = this.configSettings) == null ? void 0 : a.booking_type, t = e && e !== "booking";
59
+ return n(g, { key: "6780a2a0b1c59efc4311278e85e6800f72ab6a98", part: "nbec" }, n("div", { key: "eed7c01aaaca8c92a65beccac1242efe1194f4a3", class: "nylas-booked-event-card" }, n("div", { key: "f20609db6794c30012f299017b01bf63752b6b7f", class: "booked-event-timezone" }, n("globe-icon", { key: "e2f277abf894b2c34e32f4cec4309e81a1b6e19b" }), L[this.selectedTimezone]), n("div", { key: "84c8bcdc7f247eade07d502cd480430cfb2894fd", class: "event-card-wrapper", part: "nbec__card" }, n("div", { key: "58835f4e2b261dff59e212573a2391cac9217cb6", class: "calendar-icon" }, n("calendar-check-icon", { key: "53e406d85941c03c7d0c7c5e86e071f948fe85bd" })), n("div", { key: "0e16b5cabfe5afcea5fd15fefbf88ed2558c5492", class: "booked-event-header" }, n("h2", { key: "8ad08c13c5860cf47b217cc9c6d82dddb0940894", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${c.t("bookingRescheduled")}` : t && !this.isLoading ? `${c.t("bookingSent")}` : `${c.t("bookingConfirmed")}`, "!"), n("div", { key: "07a056ef47e7d3c173c7ad67acedc5b94748d28f", class: "card-description", part: "nbec__description" }, t ? c.t("bookingSentDescription") : n("span", null, c.t("bookingConfirmedDescription")))), n("div", { key: "4d4f43295cef324b63b3d5fa6f3476dcf3163d25", class: "booking-date-time" }, n("checkmark-circle-icon", { key: "2c717204ed669e40898c8b23dd408e3c62608e8f" }), n("h3", { key: "1a2ec41f82e740d9bdbac8fe1a818454e402db2f" }, c.t("bookingDateAndTimeHeader")), n("p", { key: "1451ecae33ccfbe9f0bc4b682d90a64313f1120c" }, (r = this.selectedTimeslot) != null && r.start_time ? J(new Date((o = this.selectedTimeslot) == null ? void 0 : o.start_time).toLocaleDateString(K[this.selectedLanguage], { dateStyle: "full" })) : "-", " ", n("br", { key: "df6922d0097f6d3aa7b17dee26a7903e89c9258c" }), new Date((i = this.selectedTimeslot) == null ? void 0 : i.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date((s = this.selectedTimeslot) == null ? void 0 : s.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), n("div", { key: "6e4264737dc50225feeec5374a6bec91de77a0ea", class: "booking-participants" }), !t && n("div", { class: "button-container" }, n("div", { class: {
60
+ footer: !0,
61
+ "no-footer": ((u = (l = this.configSettings) == null ? void 0 : l.scheduler) == null ? void 0 : u.hide_cancellation_options) && ((f = (m = this.configSettings) == null ? void 0 : m.scheduler) == null ? void 0 : f.hide_rescheduling_options) || ((b = this.configSettings) == null ? void 0 : b.booking_type) === "organizer-confirmation",
62
+ "no-template-cols": ((y = (p = this.configSettings) == null ? void 0 : p.scheduler) == null ? void 0 : y.hide_cancellation_options) || ((v = (k = this.configSettings) == null ? void 0 : k.scheduler) == null ? void 0 : v.hide_rescheduling_options)
63
+ } }, !((w = (_ = this.configSettings) == null ? void 0 : _.scheduler) != null && w.hide_cancellation_options) && n("button-component", { variant: "destructive", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${c.t("cancelBookingButton")}`), !((T = (B = this.configSettings) == null ? void 0 : B.scheduler) != null && T.hide_rescheduling_options) && n("button-component", { variant: "basic", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, `${c.t("rescheduleBookingButton")}`))))));
64
+ }
65
+ };
66
+ ve([
67
+ x({
68
+ name: "nylas-booked-event-card",
69
+ stateToProps: /* @__PURE__ */ new Map([
70
+ ["scheduler.bookingInfo", "bookingInfo"],
71
+ ["scheduler.rescheduleBookingId", "rescheduleBookingId"],
72
+ ["scheduler.selectedTimezone", "selectedTimezone"],
73
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
74
+ ["scheduler.isLoading", "isLoading"],
75
+ ["scheduler.selectedLanguage", "selectedLanguage"],
76
+ ["scheduler.configSettings", "configSettings"]
77
+ ]),
78
+ eventToProps: {
79
+ cancelBookingButtonClicked: async (e, t) => {
80
+ t.scheduler.setCancel(e.detail.bookingId);
81
+ },
82
+ rescheduleButtonClicked: async (e, t) => {
83
+ const a = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: r } = e.detail;
84
+ r && (!a || "error" in a) && r(a);
85
+ },
86
+ rescheduleBookedEventError: async (e, t) => {
87
+ d("nylas-booked-event-card", "rescheduleBookedEventError", e.detail);
88
+ },
89
+ cancelBookedEventValidationError: async (e, t) => {
90
+ d("nylas-booked-event-card", "cancelBookedEventValidationError", e.detail);
91
+ }
92
+ },
93
+ fireRegisterEvent: !0
94
+ }),
95
+ j("design:type", Function),
96
+ j("design:paramtypes", []),
97
+ j("design:returntype", void 0)
98
+ ], Q.prototype, "render", null);
99
+ Q.style = ye;
100
+ const ke = ":host{display:block;height:100%}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{grid-template-columns:1fr}}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}button-component.back button{--dot-color:var(--nylas-base-800)}.guest-email-input{position:relative;display:flex;width:100%}", Ce = ke;
101
+ var _e = function(e, t, a, r) {
102
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
103
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
104
+ i = Reflect.decorate(e, t, a, r);
105
+ else
106
+ for (var l = e.length - 1; l >= 0; l--)
107
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
108
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
109
+ }, F = function(e, t) {
110
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
111
+ return Reflect.metadata(e, t);
112
+ };
113
+ const S = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, ee = class {
114
+ constructor(e) {
115
+ C(this, e), this.nameChanged = h(this, "nameChanged", 7), this.emailChanged = h(this, "emailChanged", 7), this.backButtonClicked = h(this, "backButtonClicked", 7), this.detailsConfirmed = h(this, "detailsConfirmed", 7), this.bookingFormError = h(this, "bookingFormError", 7), this.bookingFormSubmitted = h(this, "bookingFormSubmitted", 7), this.handleGuestChange = (t, a) => {
116
+ this.resetGuestEmailError(t);
117
+ const r = [...this.guestEmails];
118
+ r[t] = U(a), this.guestEmails = [...r];
119
+ }, this.handleGuestBlur = (t, a) => {
120
+ if (this.resetGuestEmailError(t), a === "") {
121
+ this.guestEmailErrors[t] = c.t("fieldRequired", { field: c.t("email") });
122
+ return;
123
+ }
124
+ if (!S.test(a)) {
125
+ this.guestEmailErrors[t] = c.t("invalidInputFormat", { field: c.t("email") });
126
+ return;
127
+ }
128
+ this.handleGuestChange(t, a);
129
+ }, this.addGuestButtonClickedHandler = (t) => {
130
+ t.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
131
+ }, this.removeGuestButtonClickHandler = (t, a) => {
132
+ t.preventDefault(), this.resetGuestEmailError(a);
133
+ const r = [...this.guestEmails];
134
+ r.splice(a, 1), this.guestEmails = [...r];
135
+ }, this.handleBackButtonClicked = (t) => {
136
+ t.preventDefault(), this.backButtonLoading = !0, this.backButtonClicked.emit();
137
+ }, this.bookButtonClickedHandler = async (t) => {
138
+ var l, u, m, f, b, p, y;
139
+ if (t.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
140
+ return;
141
+ d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
142
+ const r = this.name || ((u = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : u.name), o = this.email || ((f = (m = this.bookingInfo) == null ? void 0 : m.primaryParticipant) == null ? void 0 : f.email);
143
+ if (!r || r === "") {
144
+ this.isNameValid = !1, this.validationError.name = c.t("fieldRequired", { field: c.t("name") }) || "Name is required", this.bookingFormError.emit({
145
+ title: "Booking form error",
146
+ description: "Name is required"
147
+ });
148
+ return;
149
+ }
150
+ if (!o || o === "") {
151
+ this.isEmailValid = !1, this.validationError.email = c.t("fieldRequired", { field: c.t("email") }) || "Email is required", this.bookingFormError.emit({
152
+ title: "Booking form error",
153
+ description: "Email is required"
154
+ });
155
+ return;
156
+ }
157
+ if (!S.test(o)) {
158
+ this.isEmailValid = !1, this.validationError.email = c.t("invalidInputFormat", { field: c.t("email") }), this.bookingFormError.emit({
159
+ title: "Booking form error",
160
+ description: c.t("invalidInputFormat", { field: c.t("email") }) || "Invalid email"
161
+ });
162
+ return;
163
+ }
164
+ let i = [];
165
+ if (this.guestEmails.length > 0) {
166
+ let k = !1;
167
+ if (this.guestEmails.forEach((v, _) => {
168
+ v === "" ? (k = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [_]: c.t("fieldRequired", { field: c.t("email") }) }) : S.test(v) || (k = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [_]: c.t("invalidInputFormat", { field: c.t("email") }) });
169
+ }), k) {
170
+ this.bookingFormError.emit({
171
+ title: "Booking form error",
172
+ description: c.t("invalidInputFormat", { field: c.t("guestEmail") }) || "Invalid guest email"
173
+ });
174
+ return;
175
+ }
176
+ i = this.guestEmails.map((v) => ({ name: v.trim(), email: v.trim() }));
177
+ } else
178
+ (b = this.bookingInfo) != null && b.guests && (i = (p = this.bookingInfo) == null ? void 0 : p.guests);
179
+ const s = {};
180
+ (y = this.bookingInfo) != null && y.additionalFields && Object.entries(this.bookingInfo.additionalFields).forEach(([k, v]) => {
181
+ var _, w;
182
+ k in ((w = (_ = this.configSettings) == null ? void 0 : _.scheduler) == null ? void 0 : w.additional_fields) && (s[k] = v.value);
183
+ }), this.detailsConfirmed.emit({
184
+ primaryParticipant: {
185
+ name: r,
186
+ email: o
187
+ },
188
+ guests: i,
189
+ additionalFields: { ...s, ...this.additionalFields }
190
+ });
191
+ }, this.updateAdditionalFields = (t, a) => {
192
+ this.additionalFields && (this.additionalFields[t] = a);
193
+ }, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.validationError = { name: "", email: "" }, this.backButtonLoading = !1;
194
+ }
195
+ connectedCallback() {
196
+ }
197
+ disconnectedCallback() {
198
+ }
199
+ componentWillLoad() {
200
+ var e, t, a;
201
+ d("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && ((e = this.bookingInfo) != null && e.primaryParticipant) && (this.name = (t = this.bookingInfo.primaryParticipant) == null ? void 0 : t.name, this.email = (a = this.bookingInfo.primaryParticipant) == null ? void 0 : a.email);
202
+ }
203
+ bookingInfoChangedHandler(e) {
204
+ e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
205
+ }
206
+ changeName(e) {
207
+ this.isNameValid = !0, this.validationError.name = "", this.name = de(e), this.nameChanged.emit(e);
208
+ }
209
+ changeEmail(e) {
210
+ this.isEmailValid = !0, this.validationError.email = "", this.email = U(e), this.emailChanged.emit(e);
211
+ }
212
+ resetGuestEmailError(e) {
213
+ const t = { ...this.guestEmailErrors };
214
+ delete t[e], this.guestEmailErrors = { ...t };
215
+ }
216
+ nylasFormInputChangedHandler(e) {
217
+ switch (e.detail.name) {
218
+ case "name":
219
+ this.changeName(e.detail.value);
220
+ break;
221
+ case "email":
222
+ this.changeEmail(e.detail.value);
223
+ break;
224
+ default:
225
+ if (e.detail.error) {
226
+ this.bookingFormError.emit({
227
+ title: "Booking form error",
228
+ description: e.detail.error
229
+ });
230
+ return;
231
+ }
232
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
233
+ break;
234
+ }
235
+ }
236
+ selectOptionChangedHandler(e) {
237
+ if (e.detail.error) {
238
+ this.bookingFormError.emit({
239
+ title: "Booking form error",
240
+ description: e.detail.error
241
+ });
242
+ return;
243
+ }
244
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
245
+ }
246
+ switchToggledHandler(e) {
247
+ this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
248
+ }
249
+ checkboxToggledHandler(e) {
250
+ this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
251
+ }
252
+ radioChangedHandler(e) {
253
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
254
+ }
255
+ dropdownDefaultSelectedHandler(e) {
256
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
257
+ }
258
+ render() {
259
+ var e, t, a, r, o, i, s, l, u;
260
+ return n(g, { key: "c5759aaa6dd8fe46bbca8d6948cb2f8b62b2f596" }, n("form", { key: "8b1def5e7238fe8c31fe190f772d5b852ea7297b", onSubmit: (m) => this.bookButtonClickedHandler(m), noValidate: !0 }, n("div", { key: "0ac8350dd52ee87af62aff182bbb2a302b4b9488", class: "nylas-booking-form", part: "nbf" }, n("div", { key: "3eed8eda2bc3e0e34d9ef72178d308276036abc3", class: "input-wrapper", part: "nbf__input-wrapper" }, n("input-component", { key: "2e6a8c3e0c578e98cb16133d5c2d2c3638b12a8e", label: c.t("name"), name: "name", id: "name", defaultValue: ((t = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : t.name) || this.name, placeholder: c.t("namePlaceholder"), type: "text", required: !0, requiredError: c.t("fieldRequired", { field: c.t("name") }), patternError: c.t("invalidInputFormat", { field: c.t("name") }), part: "nbf__input-textfield" })), n("div", { key: "f750e23602d5cd20020ad18293a6122c46e858a8", class: "input-wrapper", part: "nbf__input-wrapper" }, n("input-component", { key: "d3e76502be140769b1bcfdca4e5fc119aa080b20", label: c.t("email"), name: "email", id: "email", pattern: S, defaultValue: ((r = (a = this.bookingInfo) == null ? void 0 : a.primaryParticipant) == null ? void 0 : r.email) || this.email, placeholder: c.t("emailPlaceholder"), type: "email", required: !0, requiredError: c.t("fieldRequired", { field: c.t("email") }), patternError: c.t("invalidInputFormat", { field: c.t("email") }), part: "nbf__input-textfield" })), ((i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.hide_additional_guests) !== !0 && n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, this.guestEmails.map((m, f) => n("div", { class: "input-wrapper button-wrapper" }, n("label", { class: {
261
+ error: !!this.guestEmailErrors[f]
262
+ } }, c.t("guestEmail")), n("div", { class: "guest-email-input" }, n("input", { type: "email", id: `guest-email-${f}`, maxLength: 100, class: {
263
+ "guest-email": !0,
264
+ error: !!this.guestEmailErrors[f]
265
+ }, placeholder: c.t("guestEmailPlaceholder"), value: m, "data-index": f, part: "nbf__input-textfield", onBlur: (b) => {
266
+ var p;
267
+ return this.handleGuestBlur(f, (p = b.target) == null ? void 0 : p.value);
268
+ }, onInput: (b) => {
269
+ var p;
270
+ return this.handleGuestChange(f, (p = b.target) == null ? void 0 : p.value);
271
+ } }), n("button-component", { variant: "basic", tooltip: "Remove guest", onClick: (b) => this.removeGuestButtonClickHandler(b, f), class: {
272
+ "remove-guest": !0,
273
+ error: !!this.guestEmailErrors[f]
274
+ } }, n("close-icon", null))), n("p", { class: "help-text" }, this.guestEmailErrors[f]))), n("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (m) => this.addGuestButtonClickedHandler(m) }, n("div", { class: "button-content" }, n("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${c.t("addAnotherGuest")}` : `${c.t("addGuest")}`))), (u = Object.entries(((l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.additional_fields) || {})) == null ? void 0 : u.sort((m, f) => m[1].order - f[1].order).map((m) => {
275
+ var k, v, _, w, B, T;
276
+ const f = m[1], b = f.label, p = m[0], y = ((_ = (v = (k = this.bookingInfo) == null ? void 0 : k.additionalFields) == null ? void 0 : v[p]) == null ? void 0 : _.value) || "";
277
+ switch (f.type) {
278
+ case "dropdown":
279
+ return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("select-dropdown", { label: b, name: p, id: p, withSearch: !1, defaultSelectedOption: y ? { value: y, label: y } : void 0, options: (w = f.options) == null ? void 0 : w.map((D) => ({ value: D, label: D })), required: f.required, exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
280
+ case "checkbox":
281
+ return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("checkbox-component", { label: b, name: p, id: p, checked: y === "true", required: f.required, part: "nbf__checkbox-component" }));
282
+ case "radio_button":
283
+ return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("radio-button-group", { label: b, name: p, id: p, defaultSelectedValue: y || ((B = f.options) == null ? void 0 : B[0]) || "", options: (T = f.options) == null ? void 0 : T.map((D) => ({ value: D, label: D })), required: f.required, part: "nbf__radio-button-group" }));
284
+ case "multi_line_text":
285
+ return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("textarea-component", { label: b, defaultValue: y, name: p, id: p, required: f.required, part: "nbf__textarea-component" }));
286
+ default:
287
+ return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("input-component", { label: b, name: p, id: p, type: f.type, defaultValue: y || "", requiredError: c.t("fieldRequired", { field: b }), required: f.required, part: "nbf__input-textfield" }));
288
+ }
289
+ })), n("div", { key: "49ce45d55dd541515a7015e352f864e8287cdfa4", class: "cta" }, n("button-component", { key: "0afa9b48216531170197a6bece9520d111789f5d", variant: "basic", class: "back", part: "nbf__button-outline", isLoading: this.backButtonLoading && this.isLoading, onClick: this.handleBackButtonClicked }, n("slot", { key: "5396a9449f932af8c7ad4a1b93f0a11ef1c7b9e4", name: "booking-form-back-label" }, `${c.t("backButton")}`)), n("button-component", { key: "26090462808119a30db0506ddc1eed26ceaab8b7", variant: "primary", isLoading: !this.backButtonLoading && this.isLoading, disabled: this.isLoading, part: "nbf__button-primary", type: "submit" }, n("slot", { key: "18c5675de4b737b486a122f31ba1049f6271e645", name: "booking-form-book-label" }, `${c.t("bookNowButton")}`)))));
290
+ }
291
+ get host() {
292
+ return W(this);
293
+ }
294
+ static get watchers() {
295
+ return {
296
+ bookingInfo: ["bookingInfoChangedHandler"]
297
+ };
298
+ }
299
+ };
300
+ _e([
301
+ x({
302
+ name: "nylas-booking-form",
303
+ stateToProps: /* @__PURE__ */ new Map([
304
+ ["scheduler.isLoading", "isLoading"],
305
+ ["scheduler.bookingInfo", "bookingInfo"],
306
+ ["scheduler.eventInfo", "eventInfo"],
307
+ ["scheduler.configSettings", "configSettings"]
308
+ ]),
309
+ eventToProps: {
310
+ backButtonClicked: async (e, t) => {
311
+ t.scheduler.toggleAdditionalData(!1);
312
+ },
313
+ nameChanged: async (e, t) => {
314
+ t.scheduler.setParticipantName(e.detail);
315
+ },
316
+ emailChanged: async (e, t) => {
317
+ t.scheduler.setParticipantEmail(e.detail);
318
+ },
319
+ detailsConfirmed: async (e, t) => {
320
+ d("nylas-booking-form", "detailsConfirmed", e.detail);
321
+ },
322
+ bookingFormSubmitted: async (e, t) => {
323
+ d("nylas-booking-form", "bookingFormSubmitted", e.detail);
324
+ },
325
+ bookingFormError: async (e, t) => {
326
+ d("nylas-booking-form", "bookingFormError", e.detail);
327
+ }
328
+ },
329
+ fireRegisterEvent: !0
330
+ }),
331
+ F("design:type", Function),
332
+ F("design:paramtypes", []),
333
+ F("design:returntype", void 0)
334
+ ], ee.prototype, "render", null);
335
+ ee.style = Ce;
336
+ const xe = ":host{display:block;width:400px;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form form{width:100%}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600);padding-bottom:1.25rem}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}.footer{display:grid;grid-template-columns:1fr 1fr;width:100%;padding-top:1.25rem;gap:1rem;border-top:1px solid var(--nylas-base-200);margin-top:1.25rem}", we = xe;
337
+ var Ee = function(e, t, a, r) {
338
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
339
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
340
+ i = Reflect.decorate(e, t, a, r);
341
+ else
342
+ for (var l = e.length - 1; l >= 0; l--)
343
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
344
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
345
+ }, P = function(e, t) {
346
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
347
+ return Reflect.metadata(e, t);
348
+ };
349
+ const te = class {
350
+ constructor(e) {
351
+ var t, a;
352
+ C(this, e), this.goBackButtonClicked = h(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = h(this, "cancelBookingFormSubmitted", 7), this.triggerValidation = h(this, "triggerValidation", 7), this.cancelBookedEventError = h(this, "cancelBookedEventError", 7), this.cancelBookingFormError = h(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
353
+ this.goBackButtonClicked.emit();
354
+ }, this.handleSubmitCancelBooking = (r) => {
355
+ var s, l, u;
356
+ if (this.triggerValidation.emit({}), r.preventDefault(), !this.cancellationReason) {
357
+ this.cancellationError = c.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: c.t("cancelBokingFormError"), description: c.t("cancellationErrorMessage") });
358
+ return;
359
+ }
360
+ const o = (l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.min_cancellation_notice;
361
+ if (this.selectedTimeslot && o && new Date((u = this.selectedTimeslot) == null ? void 0 : u.start_time).getTime() - o * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
362
+ this.cancelBookedEventError.emit({
363
+ error: {
364
+ title: c.t("cancellationErrorTitle"),
365
+ message: c.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: o })
366
+ }
367
+ });
368
+ return;
369
+ }
370
+ d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
371
+ const i = (m) => {
372
+ this.cancelBookedEventError.emit(m);
373
+ };
374
+ this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler: i }) : this.rejectBookingId && this.cancelBookingFormSubmitted.emit({ bookingId: this.rejectBookingId, action: "reject", reason: this.cancellationReason, errorHandler: i });
375
+ }, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((a = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : a.cancellation_policy) || "Your current timeslot will become available to others.";
376
+ }
377
+ configSettingsChangedHandler(e) {
378
+ var t;
379
+ this.cancellationPolicy = ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.cancellation_policy) || "Your current timeslot will become available to others.";
380
+ }
381
+ connectedCallback() {
382
+ d("[nylas-cancel-booking-form] Component connected");
383
+ }
384
+ async componentWillLoad() {
385
+ d("[nylas-cancel-booking-form] Component will load");
386
+ }
387
+ async componentDidLoad() {
388
+ d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.');
389
+ }
390
+ disconnectedCallback() {
391
+ d("[nylas-cancel-booking-form] Component disconnected");
392
+ }
393
+ handleNylasFormInputChanged(e) {
394
+ this.triggerValidation.emit({}), e.detail.name === "cancel-reason" && (this.cancellationReason = e.detail.value, this.cancellationError = e.detail.error);
395
+ }
396
+ render() {
397
+ var e, t;
398
+ return n(g, { key: "6f680273959b2726cc68cb465aeacce03447ba8e", part: "ncbf" }, n("div", { key: "be243375f24e2029af0ad14c990a254c7f005631", class: "nylas-cancel-booking-form", part: "ncbf__card" }, n("div", { key: "5bef53a115c1108a0ff15ed52b773e03456ed249", class: "nylas-cancel-booking-form__calendar-icon", part: "ncbf__icon" }, n("calendar-cancel-icon", { key: "baa79cd9b1b8fea1019ccacdf0679b702d2f07a2" })), n("h3", { key: "260994a6886a04baccbba07198cb7b55843dcb94", class: "nylas-cancel-booking-form__title", part: "ncbf__title" }, c.t("cancelBookingTitle")), n("div", { key: "5b551fb4c2f91a043b1a06b64dd635cfb2a6465e", class: "nylas-cancel-booking-form__description", part: "ncbf__description" }, (t = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && t.cancellation_policy ? this.cancellationPolicy : `${c.t("cancelBookingMessage")}`), n("form", { key: "535c7fbc0ccd04b614b0b52e39c183bcc0bd4501", onSubmit: this.handleSubmitCancelBooking }, n("textarea-component", { key: "349fa734e6ca521418f315feca30de5c67c5b4ab", id: "cancel-reason", name: "cancel-reason", required: !0, label: c.t("reasonForCancellation"), class: this.cancellationError ? "error" : "", part: "ncbf__reason-textarea", defaultValue: this.cancellationReason }), n("div", { key: "c260628841bb3872a9a1439499c42e494894af9e", class: "footer" }, n("button-component", { key: "1de46efdfe24eaffae44d5a649f9b3ad6a11b3b6", variant: "destructive", class: "cancel", type: "submit", part: "ncbf__button-cta", disabled: this.isLoading }, c.t("cancelBookingButton")), !!this.eventInfo && n("button-component", { variant: "basic", class: "back", part: "ncbf__button-outline", onClick: this.handleGoBackClicked }, c.t("goBackButton"))))));
399
+ }
400
+ static get watchers() {
401
+ return {
402
+ configSettings: ["configSettingsChangedHandler"]
403
+ };
404
+ }
405
+ };
406
+ Ee([
407
+ x({
408
+ name: "nylas-cancel-booking-form",
409
+ stateToProps: /* @__PURE__ */ new Map([
410
+ ["scheduler.configSettings", "configSettings"],
411
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
412
+ ["scheduler.eventInfo", "eventInfo"],
413
+ ["scheduler.isLoading", "isLoading"],
414
+ ["scheduler.cancelBookingId", "cancelBookingId"],
415
+ ["scheduler.rejectBookingId", "rejectBookingId"]
416
+ ]),
417
+ eventToProps: {
418
+ cancelBookingFormSubmitted: async (e, t) => {
419
+ const { action: a, errorHandler: r } = e.detail;
420
+ if (a === "cancel") {
421
+ const o = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason);
422
+ r && (!o || "error" in o) && r(o);
423
+ } else if (a === "reject") {
424
+ const o = await t.scheduler.updateBooking({
425
+ bookingId: e.detail.bookingId,
426
+ status: "cancelled",
427
+ reason: e.detail.reason
428
+ });
429
+ r && (!o || "error" in o) && r(o);
430
+ }
431
+ },
432
+ goBackButtonClicked: async (e, t) => {
433
+ d("nylas-cancel-booking-form", "goBackButtonClicked", e.detail), t.scheduler.goBack();
434
+ },
435
+ cancelBookedEventError: async (e, t) => {
436
+ d("nylas-cancel-booking-form", "cancelBookedEventError", e.detail);
437
+ },
438
+ cancelBookingFormError: async (e, t) => {
439
+ d("nylas-cancel-booking-form", "cancelBookingFormError", e.detail);
440
+ }
441
+ },
442
+ fireRegisterEvent: !0
443
+ }),
444
+ P("design:type", Function),
445
+ P("design:paramtypes", []),
446
+ P("design:returntype", void 0)
447
+ ], te.prototype, "render", null);
448
+ te.style = we;
449
+ const Be = ":host{display:block}.nylas-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}", Te = Be;
450
+ var De = function(e, t, a, r) {
451
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
452
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
453
+ i = Reflect.decorate(e, t, a, r);
454
+ else
455
+ for (var l = e.length - 1; l >= 0; l--)
456
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
457
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
458
+ }, M = function(e, t) {
459
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
460
+ return Reflect.metadata(e, t);
461
+ };
462
+ const ne = class {
463
+ constructor(e) {
464
+ C(this, e), this.closeCancelEventCardClicked = h(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = h(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
465
+ this.isClosing = !0;
466
+ const t = (a) => {
467
+ this.cancelledEventCardError.emit(a), this.isClosing = !1;
468
+ };
469
+ this.closeCancelEventCardClicked.emit({ errorHandler: t });
470
+ }, this.cancelledEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
471
+ }
472
+ connectedCallback() {
473
+ d("[nylas-cancelled-event-card] Component connected");
474
+ }
475
+ async componentWillLoad() {
476
+ d("[nylas-cancelled-event-card] Component will load");
477
+ }
478
+ async componentDidLoad() {
479
+ d("[nylas-cancelled-event-card] Component did load"), this.cancelledEventInfo || console.warn('[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.');
480
+ }
481
+ disconnectedCallback() {
482
+ d("[nylas-cancelled-event-card] Component disconnected");
483
+ }
484
+ render() {
485
+ var e, t;
486
+ return n(g, { key: "e890d06179d7e35d38abe0f30934645d0dd0866f", part: "ncec" }, n("div", { key: "c2e455774c4d962dbd178c967d6ffcf0dad495e8", class: "nylas-cancelled-event-card", part: "ncec__card" }, n("div", { key: "dae3d09a326b89e8d5c5ac662b663a87332b483f", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "908f8f9dce64ef8a02d12b8bea383a9e65662def" })), n("h3", { key: "61a2d624b51686a6a1d9e045a3efa99f204c9e21", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, c.t("bookingCancelledTitle"), "!"), n("div", { key: "0cbf5bce08b5b623729e0741108ecd1a169c0cdb", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, c.t("bookingCancelledMessage"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), n("div", { key: "e43af5b395977d607b3c427bcb7d6062db8d6678", class: "nylas-cancelled-event-card__cta" }, n("button-component", { key: "36bb4ba3bf9fa46a52f5fd7b452bf8e001341d00", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${c.t("closingButton")}...` : `${c.t("closeButton")}`))));
487
+ }
488
+ };
489
+ De([
490
+ x({
491
+ name: "nylas-cancelled-event-card",
492
+ stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
493
+ eventToProps: {
494
+ closeCancelEventCardClicked: async (e, t) => {
495
+ const a = await t.scheduler.resetCancel(), { errorHandler: r } = e.detail;
496
+ r && (!a || "error" in a) && r(a);
497
+ },
498
+ cancelledEventCardError: async (e, t) => {
499
+ d("nylas-cancelled-event-card", "cancelledEventCardError", e.detail);
500
+ }
501
+ },
502
+ fireRegisterEvent: !0
503
+ }),
504
+ M("design:type", Function),
505
+ M("design:paramtypes", []),
506
+ M("design:returntype", void 0)
507
+ ], ne.prototype, "render", null);
508
+ ne.style = Te;
509
+ const Le = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-confirmed-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-confirmed-event-card{width:inherit}}.nylas-confirmed-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-confirmed-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-confirmed-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-confirmed-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}', Se = Le;
510
+ var ze = function(e, t, a, r) {
511
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
512
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
513
+ i = Reflect.decorate(e, t, a, r);
514
+ else
515
+ for (var l = e.length - 1; l >= 0; l--)
516
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
517
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
518
+ }, N = function(e, t) {
519
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
520
+ return Reflect.metadata(e, t);
521
+ };
522
+ const ae = class {
523
+ constructor(e) {
524
+ C(this, e), this.closeConfirmEventCardClicked = h(this, "closeConfirmEventCardClicked", 7), this.confirmedEventCardError = h(this, "confirmedEventCardError", 7), this.handleCloseClicked = () => {
525
+ this.isClosing = !0;
526
+ const t = (a) => {
527
+ this.confirmedEventCardError.emit(a), this.isClosing = !1;
528
+ };
529
+ this.closeConfirmEventCardClicked.emit({ errorHandler: t });
530
+ }, this.confirmedEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
531
+ }
532
+ connectedCallback() {
533
+ d("[nylas-confirmed-event-card] Component connected");
534
+ }
535
+ async componentWillLoad() {
536
+ d("[nylas-confirmed-event-card] Component will load");
537
+ }
538
+ async componentDidLoad() {
539
+ d("[nylas-confirmed-event-card] Component did load"), this.confirmedEventInfo || console.warn('[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.');
540
+ }
541
+ disconnectedCallback() {
542
+ d("[nylas-confirmed-event-card] Component disconnected");
543
+ }
544
+ render() {
545
+ var e, t;
546
+ return n(g, { key: "b9b4c10f89c27f54070faa3f2ad53b9fbd9f38d8", part: "ncec" }, n("div", { key: "6009b8d7f5b8f8b9d87fc5621250f07c2e5af38d", class: "nylas-confirmed-event-card", part: "ncec__card" }, n("div", { key: "427eb1b59885d8d273842c45a15576a418e5c6ea", class: "nylas-confirmed-event-card__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "f08b3c34d88bcc72b7fc48807ceb10b5d040a7b6" })), n("h3", { key: "56bc3626c7f84bf4aa6c536e0d978eaab6aabec1", class: "nylas-confirmed-event-card__title", part: "ncec__title" }, c.t("confirmedEventCardTitle"), "!"), n("div", { key: "8f84edf7d10c1a70437e0487ade88d13d9fe8c59", class: "nylas-confirmed-event-card__description", part: "ncec__description" }, c.t("confirmedEventCardDescription"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), n("div", { key: "90d3967b143032d09c8d99d65d711cb4619c1314", class: "nylas-confirmed-event-card__cta" }, n("button-component", { key: "ae8791ba490a8565045287720ceebc0978a85ed9", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${c.t("closingButton")}...` : `${c.t("closeButton")}`))));
547
+ }
548
+ };
549
+ ze([
550
+ x({
551
+ name: "nylas-confirmed-event-card",
552
+ stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
553
+ eventToProps: {
554
+ closeConfirmEventCardClicked: async (e, t) => {
555
+ const a = await t.scheduler.resetConfirm(), { errorHandler: r } = e.detail;
556
+ r && (!a || "error" in a) && r(a);
557
+ }
558
+ },
559
+ fireRegisterEvent: !0
560
+ }),
561
+ N("design:type", Function),
562
+ N("design:paramtypes", []),
563
+ N("design:returntype", void 0)
564
+ ], ae.prototype, "render", null);
565
+ ae.style = Se;
566
+ const O = /* @__PURE__ */ new Date(), $ = /* @__PURE__ */ new Date();
567
+ function I(e, t, a, r) {
568
+ function o(i) {
569
+ return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
570
+ }
571
+ return o.floor = (i) => (e(i = /* @__PURE__ */ new Date(+i)), i), o.ceil = (i) => (e(i = new Date(i - 1)), t(i, 1), e(i), i), o.round = (i) => {
572
+ const s = o(i), l = o.ceil(i);
573
+ return i - s < l - i ? s : l;
574
+ }, o.offset = (i, s) => (t(i = /* @__PURE__ */ new Date(+i), s == null ? 1 : Math.floor(s)), i), o.range = (i, s, l) => {
575
+ const u = [];
576
+ if (i = o.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < s) || !(l > 0))
577
+ return u;
578
+ let m;
579
+ do
580
+ u.push(m = /* @__PURE__ */ new Date(+i)), t(i, l), e(i);
581
+ while (m < i && i < s);
582
+ return u;
583
+ }, o.filter = (i) => I((s) => {
584
+ if (s >= s)
585
+ for (; e(s), !i(s); )
586
+ s.setTime(s - 1);
587
+ }, (s, l) => {
588
+ if (s >= s)
589
+ if (l < 0)
590
+ for (; ++l <= 0; )
591
+ for (; t(s, -1), !i(s); )
592
+ ;
593
+ else
594
+ for (; --l >= 0; )
595
+ for (; t(s, 1), !i(s); )
596
+ ;
597
+ }), a && (o.count = (i, s) => (O.setTime(+i), $.setTime(+s), e(O), e($), Math.floor(a(O, $))), o.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? o.filter(r ? (s) => r(s) % i === 0 : (s) => o.count(0, s) % i === 0) : o)), o;
598
+ }
599
+ const Ie = 1e3, ie = Ie * 60, Re = ie * 60, z = Re * 24, H = I(
600
+ (e) => e.setHours(0, 0, 0, 0),
601
+ (e, t) => e.setDate(e.getDate() + t),
602
+ (e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * ie) / z,
603
+ (e) => e.getDate() - 1
604
+ );
605
+ I((e) => {
606
+ e.setUTCHours(0, 0, 0, 0);
607
+ }, (e, t) => {
608
+ e.setUTCDate(e.getUTCDate() + t);
609
+ }, (e, t) => (t - e) / z, (e) => e.getUTCDate() - 1);
610
+ I((e) => {
611
+ e.setUTCHours(0, 0, 0, 0);
612
+ }, (e, t) => {
613
+ e.setUTCDate(e.getUTCDate() + t);
614
+ }, (e, t) => (t - e) / z, (e) => Math.floor(e / z));
615
+ const je = ':host{display:block;min-height:444px}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family)}.title h1{margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', Fe = je;
616
+ var Pe = function(e, t, a, r) {
617
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
618
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
619
+ i = Reflect.decorate(e, t, a, r);
620
+ else
621
+ for (var l = e.length - 1; l >= 0; l--)
622
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
623
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
624
+ }, q = function(e, t) {
625
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
626
+ return Reflect.metadata(e, t);
627
+ };
628
+ const oe = class {
629
+ constructor(e) {
630
+ C(this, e), this.dateSelected = h(this, "dateSelected", 7), this.monthChanged = h(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.configSettings = void 0, this.selectedLanguage = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
631
+ }
632
+ configSettingsChanged(e) {
633
+ var o;
634
+ const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.available_days_in_future;
635
+ if (a === void 0)
636
+ return;
637
+ X(/* @__PURE__ */ new Date(), a).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
638
+ }
639
+ selectedLanguageChanged(e) {
640
+ c.changeLanguage(e);
641
+ }
642
+ connectedCallback() {
643
+ }
644
+ disconnectedCallback() {
645
+ }
646
+ componentWillLoad() {
647
+ }
648
+ getDates() {
649
+ const e = fe(this.month), t = he(this.month);
650
+ return H.range(H.offset(t, -t.getDay()), H.offset(e, 7 - e.getDay()));
651
+ }
652
+ selectDate(e) {
653
+ this.dateSelected.emit(e);
654
+ }
655
+ changeMonth(e) {
656
+ var o, i;
657
+ this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
658
+ const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.available_days_in_future;
659
+ X(/* @__PURE__ */ new Date(), a).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
660
+ }
661
+ isSelected(e, t, a) {
662
+ return e && t && E(e, t) && a && (a == null ? void 0 : a.length) > 0;
663
+ }
664
+ isDisabled(e, t) {
665
+ return e && (t == null ? void 0 : t.find((a) => E(a, e))) === void 0;
666
+ }
667
+ render() {
668
+ var e, t, a, r, o, i, s;
669
+ return n(g, { key: "3e6dd28572687991de4841d639c5bdbd5d2d6e0b", part: "ndp" }, n("div", { key: "b8a31231d9e04035c468f9c025bbd3adb4f0dbb2", class: "nylas-date-picker" }, n("div", { key: "c25024241ce71fb94bcc485cc32614c820a69fee", class: "title", part: "ndp__title" }, (e = this.configSettings) != null && e.name ? n("h1", null, (t = this.configSettings) == null ? void 0 : t.name) : ((r = (a = this.configSettings) == null ? void 0 : a.organizer) == null ? void 0 : r.name) && n("h1", null, n("person-icon", null), ((i = (o = this.configSettings) == null ? void 0 : o.organizer) == null ? void 0 : i.name) || "Organizer"), n("p", { key: "f51da2bb7f8b5d6b84ea5a9ea66aef03b9e10e12" }, n("clock-icon", { key: "42a947b00a14afe7c57c716e37ef4d418e55e337" }), this.eventDuration ? me(this.eventDuration) : `- ${c.t("time.minutes")}`)), n("div", { key: "bb264f745cbe51ece10238e3a2f3fae55d2f1bdb", class: "header flex-row" }, n("h2", { key: "16ecbac96e4ede32b8b524a645f96e30d16e2814", part: "ndp__month-header" }, n("strong", { key: "aaf8064ac4ebd41680fb4c147b5a23fc7e5554f2" }, pe(this.month.toLocaleDateString(void 0, { month: "long" }).toLocaleLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), n("div", { key: "8d5fdca1f4de5d8b75c89ebf6bc6d964b39b8351", class: "pagination" }, n("button", { key: "f70a9c3d9a8bbcf75ce3f702f82d161a59e7c7c8", title: "Previous month", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((s = this.selectableDates) != null && s.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, n("chevron-icon", { key: "8069fa1e5bfc7ef18f2f67f2ddb2fcfcb026ced3" })), n("button", { key: "6fde72c0e1bc2554ef284517637f35de19fcdd38", title: "Next month", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, n("chevron-icon", { key: "79ec52b0c06fa56a763a9cb604ab54c746c63468" })))), n("div", { key: "f099f477ac31c9e686f24b721d3032455653cdea", class: "dates" }, [
670
+ c.t("days.sunday"),
671
+ c.t("days.monday"),
672
+ c.t("days.tuesday"),
673
+ c.t("days.wednesday"),
674
+ c.t("days.thursday"),
675
+ c.t("days.friday"),
676
+ c.t("days.saturday")
677
+ ].map((l) => n("div", { class: "day", part: "ndp__day" }, l)), this.dates.map((l, u) => {
678
+ var f;
679
+ const m = this.isDisabled(l, this.selectableDates);
680
+ return this.isLoading ? n("button", { disabled: !0, class: {
681
+ "date day-skeleton": !0,
682
+ "current-month": R(l, this.month)
683
+ }, style: { animationDelay: `${u * 20}ms` }, part: "ndp__date ndp__date--disabled" }, l.getDate()) : n("button", { class: {
684
+ date: !0,
685
+ selected: !!(this.selectedDate && E(l, this.selectedDate) && this.selectableDates && ((f = this.selectableDates) == null ? void 0 : f.length) > 0),
686
+ "current-day": E(l, /* @__PURE__ */ new Date()),
687
+ "current-month": R(l, this.month)
688
+ }, "aria-lang": l.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: m, onClick: () => this.selectDate(l), part: `ndp__date ${this.isSelected(l, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${E(l, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${R(l, this.month) ? "ndp__date--current-month" : ""}` }, l.getDate());
689
+ }))));
690
+ }
691
+ static get watchers() {
692
+ return {
693
+ configSettings: ["configSettingsChanged"],
694
+ selectedLanguage: ["selectedLanguageChanged"]
695
+ };
696
+ }
697
+ };
698
+ Pe([
699
+ x({
700
+ name: "nylas-date-picker",
701
+ stateToProps: /* @__PURE__ */ new Map([
702
+ ["scheduler.selectableDates", "selectableDates"],
703
+ ["scheduler.selectedDate", "selectedDate"],
704
+ ["scheduler.isLoading", "isLoading"],
705
+ ["scheduler.configSettings", "configSettings"],
706
+ ["scheduler.eventDuration", "eventDuration"],
707
+ ["scheduler.selectedLanguage", "selectedLanguage"]
708
+ ]),
709
+ eventToProps: {
710
+ dateSelected: async (e, t) => {
711
+ d("nylas-date-picker", "dateSelected", e.detail), t.scheduler.selectDate(e.detail);
712
+ },
713
+ monthChanged: async (e, t) => {
714
+ d("nylas-date-picker", "monthChanged", e.detail);
715
+ }
716
+ },
717
+ fireRegisterEvent: !0
718
+ }),
719
+ q("design:type", Function),
720
+ q("design:paramtypes", []),
721
+ q("design:returntype", void 0)
722
+ ], oe.prototype, "render", null);
723
+ oe.style = Fe;
724
+ const Me = ":host{display:block}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}", Ne = Me;
725
+ var Oe = function(e, t, a, r) {
726
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
727
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
728
+ i = Reflect.decorate(e, t, a, r);
729
+ else
730
+ for (var l = e.length - 1; l >= 0; l--)
731
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
732
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
733
+ }, A = function(e, t) {
734
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
735
+ return Reflect.metadata(e, t);
736
+ };
737
+ const re = class {
738
+ constructor(e) {
739
+ C(this, e), this.timezoneChanged = h(this, "timezoneChanged", 7), this.languageChanged = h(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
740
+ }
741
+ connectedCallback() {
742
+ }
743
+ disconnectedCallback() {
744
+ }
745
+ componentWillLoad() {
746
+ }
747
+ changeTimezone(e) {
748
+ this.selectedTimezone = e, this.timezoneChanged.emit(e);
749
+ }
750
+ changeLanguage(e) {
751
+ this.selectedLanguage = e, this.languageChanged.emit(e);
752
+ }
753
+ nylasFormDropdownChangedHandler(e) {
754
+ const { name: t, value: a } = e.detail;
755
+ t === "timezone" ? this.changeTimezone(a) : t === "language" && this.changeLanguage(a);
756
+ }
757
+ getTimezoneLabelHTML(e) {
758
+ const t = ue(e);
759
+ return n("span", { class: "timezone-label", style: {
760
+ display: "flex",
761
+ alignItems: "center",
762
+ justifyContent: "space-between",
763
+ width: "-webkit-fill-available"
764
+ } }, L[e], " ", n("span", { class: "timezone-offset", style: {
765
+ fontSize: "14px",
766
+ fontWeight: "400",
767
+ color: "var(--nylas-base-500)"
768
+ } }, t));
769
+ }
770
+ render() {
771
+ const e = Object.keys(L).map((a) => ({
772
+ labelHTML: this.getTimezoneLabelHTML(a),
773
+ label: L[a],
774
+ value: a
775
+ })), t = Object.keys(Y).map((a) => ({
776
+ label: Y[a],
777
+ value: a
778
+ }));
779
+ return n(g, { key: "8e8ec3819083fb25cb8620f14aa1f140a995ec89" }, n("div", { key: "45aaebcd9f80d54dc01b5d611094fa05225c8331", class: "nylas-locale-switch", part: "nls" }, n("div", { key: "47d8166b91a3ef742b14e5783338c3701be85eb7", class: {
780
+ "select-wrapper": !0,
781
+ timezone: !0
782
+ }, part: "nls__timezone" }, n("select-dropdown", { key: "71edd2352b6067a18b9ba676495e59c954e6c07d", name: "timezone", options: e, defaultSelectedOption: e.find((a) => a.value == this.selectedTimezone), exportparts: "sd_dropdown: nls__timezone-dropdown, sd_dropdown-button: nls__timezone-drop-button, sd_dropdown-button-selected-label: nls__timezone-drop-button-selected-label, sd_dropdown-content: nls__timezone-drop-content, sd_dropdown_label: nls__timezone-drop-label" }, n("span", { key: "f48e3c11a1981e32b75f5425570db0b584db7f51", slot: "select-icon" }, n("globe-icon", { key: "6b6721c8d88d715dbcb52d2e2750c22015ac252c", width: "20", height: "20" })))), n("div", { key: "fe652536d637774336cad11a65bba7bfd8636972", class: {
783
+ "select-wrapper": !0,
784
+ language: !0
785
+ }, part: "nls__language" }, n("select-dropdown", { key: "f83f8dbf84878fb1670d4a6f59b045c111420ce1", name: "language", options: t, defaultSelectedOption: t.find((a) => a.value == this.selectedLanguage), exportparts: "sd_dropdown: nls__language-dropdown, sd_dropdown-button: nls__language-drop-button, sd_dropdown-content: nls__language-drop-content, sd_dropdown_label: nls__language-drop-label" }, n("span", { key: "3d66833265053e81c9333b5d36ae822ed3a17878", slot: "select-icon" }, n("translate-icon", { key: "30121c5733873930e7e1e3bdaedf11bd2f258139", width: "20", height: "20" }))))));
786
+ }
787
+ };
788
+ Oe([
789
+ x({
790
+ name: "nylas-locale-switch",
791
+ stateToProps: /* @__PURE__ */ new Map([
792
+ ["scheduler.selectedLanguage", "selectedLanguage"],
793
+ ["scheduler.selectedTimezone", "selectedTimezone"]
794
+ ]),
795
+ eventToProps: {
796
+ timezoneChanged: async (e, t) => {
797
+ d("nylas-locale-switch", "timezoneChanged", e.detail), t.scheduler.selectTimezone(e.detail);
798
+ },
799
+ languageChanged: async (e, t) => {
800
+ d("nylas-locale-switch", "languageChanged", e.detail), t.scheduler.selectLanguage(e.detail);
801
+ }
802
+ },
803
+ fireRegisterEvent: !0
804
+ }),
805
+ A("design:type", Function),
806
+ A("design:paramtypes", []),
807
+ A("design:returntype", void 0)
808
+ ], re.prototype, "render", null);
809
+ re.style = Ne;
810
+ const $e = ".sc-nylas-logo-h{display:flex}", He = $e, qe = class {
811
+ constructor(e) {
812
+ C(this, e), this.width = "69", this.height = "24";
813
+ }
814
+ render() {
815
+ return n("svg", { key: "aeb5a7e31cfa6b2846b43e3d1ea193a0d153dac4", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "425c49e05a92478dba4bc83fadecdd8ecd547847", "clip-path": "url(#clip0_455_3543)" }, n("path", { key: "32bb9a4fbd72da875039ed9986b04f7a5dd322ad", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), n("path", { key: "e2ab1ab8a9eb353201c2510647cca662e1078b52", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), n("path", { key: "bf60edb0f9ef7af659f002e137f22d437bb5156e", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), n("path", { key: "91492a460d37310bd3d7296ed085052c5f5d5ff7", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), n("path", { key: "9fc1463f04937f556f2a92080601c06823b65fff", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), n("path", { key: "1d7377b0a33ddd2289ea3248c5f3f8ca5843797d", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), n("path", { key: "363876835f54604ef28b9991316d8456435b490f", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), n("path", { key: "72a40845c1767db7f047c30d97327c42989e0cec", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), n("defs", { key: "fd197f32005cc211e8c265d9909df3a33911fd08" }, n("clipPath", { key: "fc1ae55255e6bd8e6b2e97348a9a76c92c433876", id: "clip0_455_3543" }, n("rect", { key: "c67f2f37b5f3a524e3c89aa3eba842cfc3c86c0c", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
816
+ }
817
+ };
818
+ qe.style = He;
819
+ const Ae = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error);background:rgb(255, 248, 248)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}', Ve = Ae, Ze = class {
820
+ constructor(e) {
821
+ C(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
822
+ }
823
+ onError(e) {
824
+ d(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
825
+ }
826
+ onWarning(e) {
827
+ d(`[nylas-notification] Warning: ${e.detail.notification.title}`), this.handleNotification(e);
828
+ }
829
+ onInfo(e) {
830
+ d(`[nylas-notification] Info: ${e.detail.notification.title}`), this.handleNotification(e);
831
+ }
832
+ onSuccess(e) {
833
+ d(`[nylas-notification] Success: ${e.detail.notification.title}`), this.handleNotification(e);
834
+ }
835
+ isChildOf(e) {
836
+ let t = this.host.parentNode;
837
+ for (; t; ) {
838
+ if (t === e)
839
+ return !0;
840
+ t instanceof ShadowRoot ? t = t.host : t = t.parentNode;
841
+ }
842
+ return !1;
843
+ }
844
+ handleNotification(e) {
845
+ const t = e.detail.host;
846
+ if (e.defaultPrevented) {
847
+ d("[nylas-notification] Event default prevented");
848
+ return;
849
+ }
850
+ if (t && !this.isChildOf(t)) {
851
+ d("[nylas-notification] Host not a parent");
852
+ return;
853
+ }
854
+ if (this.ttl === 0) {
855
+ d("[nylas-notification] TTL is 0");
856
+ return;
857
+ }
858
+ if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.notification.category)) {
859
+ d("[nylas-notification] Category not allowed");
860
+ return;
861
+ }
862
+ if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
863
+ const a = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
864
+ window.setTimeout(() => {
865
+ this.notifications = this.notifications.filter((r) => r.id !== e.detail.notification.id);
866
+ }, a);
867
+ }
868
+ }
869
+ dismissNotification(e) {
870
+ this.notifications = this.notifications.filter((t) => t.id !== e);
871
+ }
872
+ render() {
873
+ return n(g, { key: "83454a1a73a488653b469774ee8915e21d892d65" }, n(be, { key: "34b9bdef55e83f345074ad482a256f7eb3ed719e" }, this.notifications.map((e) => n("div", { class: `notif ${e.type}`, key: e.id }, n("div", { class: "content" }, n("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && n("warning-icon", null)), n("span", { class: "message" }, n("span", { class: "title" }, e.title), e.description && n("span", { class: "description" }, e.description))), n("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, n("close-icon", null)))), n("slot", { key: "bff0a753c23041a123bea8391363b0caad111342" })));
874
+ }
875
+ get host() {
876
+ return W(this);
877
+ }
878
+ };
879
+ Ze.style = Ve;
880
+ const Ge = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.event-card-wrapper{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.manage-booking-description{border-top:1px solid var(--nylas-base-200)}.manage-booking-description p{font-size:16px;margin:1rem;padding:0.5rem 1rem;font-weight:400;color:var(--nylas-base-800)}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{--dot-color:var(--nylas-base-700)}', We = Ge;
881
+ var Ue = function(e, t, a, r) {
882
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
883
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
884
+ i = Reflect.decorate(e, t, a, r);
885
+ else
886
+ for (var l = e.length - 1; l >= 0; l--)
887
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
888
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
889
+ }, V = function(e, t) {
890
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
891
+ return Reflect.metadata(e, t);
892
+ };
893
+ const se = class {
894
+ constructor(e) {
895
+ C(this, e), this.rejectBookingButtonClicked = h(this, "rejectBookingButtonClicked", 7), this.confirmBookingButtonClicked = h(this, "confirmBookingButtonClicked", 7), this.confirmBookingError = h(this, "confirmBookingError", 7), this.handleConfirmBookingButtonClicked = () => {
896
+ this.action = "confirm";
897
+ const t = (a) => {
898
+ this.confirmBookingError.emit(a);
899
+ };
900
+ this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler: t });
901
+ }, this.handleRejectBookingButtonClicked = () => {
902
+ this.action = "reject", this.organizerConfirmationBookingId && !this.isLoading && this.rejectBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host });
903
+ }, this.organizerConfirmationBookingId = void 0, this.configSettings = void 0, this.isLoading = void 0, this.selectedLanguage = navigator.language, this.action = null;
904
+ }
905
+ connectedCallback() {
906
+ }
907
+ disconnectedCallback() {
908
+ }
909
+ async componentWillLoad() {
910
+ d("[nylas-organizer-confirmation-card] Component will load");
911
+ }
912
+ async componentDidLoad() {
913
+ d("[nylas-organizer-confirmation-card] Component did load");
914
+ }
915
+ async resetAction() {
916
+ this.action = null;
917
+ }
918
+ render() {
919
+ var e, t, a, r, o, i, s, l, u, m, f, b;
920
+ return n(g, { key: "123955b645210a040f6916e9a85847c934222b79", part: "nmcc" }, n("div", { key: "cc41530612eaf960219e9a9eeab0b77f76d35c5e", class: "event-card-wrapper", part: "nmccc__card" }, n("div", { key: "c24348bc400422f9aa2136b0a895fc4b8b5d5591", class: "calendar-icon" }, n("calendar-check-icon", { key: "fb172e317fabeea80d213a1c2b98aa67ed63f641" })), n("div", { key: "4d75233d1b6601beca52683ad9313e3cc2c12404", class: "booked-event-header" }, n("h2", { key: "7f27dbb922928b25f1fe97929356d9f4f6060759", slot: "card-title", part: "nmcc__title" }, !!this.organizerConfirmationBookingId && `${c.t("bookingPendingTitle")}!`)), n("div", { key: "faf8aec0e5815abc2dac1e0dc3a8527b8394ea3c", class: "manage-booking-description" }, n("p", { key: "b6eb26a6f6f6af476dbceffee3ccadf10c0f97a9" }, c.t("bookingPendingnDescription"))), n("div", { key: "73009ddd0596cd27c1da6c0c5252ee2766475297", class: {
921
+ footer: !0,
922
+ "no-footer": ((t = (e = this.configSettings) == null ? void 0 : e.scheduler) == null ? void 0 : t.hide_cancellation_options) && ((r = (a = this.configSettings) == null ? void 0 : a.scheduler) == null ? void 0 : r.hide_rescheduling_options),
923
+ "no-template-cols": ((i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.hide_cancellation_options) || ((l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.hide_rescheduling_options)
924
+ } }, !((m = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && m.hide_cancellation_options) && n("button-component", { variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${c.t("rejectBookingButton")}`), !((b = (f = this.configSettings) == null ? void 0 : f.scheduler) != null && b.hide_rescheduling_options) && n("button-component", { variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${c.t("confirmBookingButton")}`))));
925
+ }
926
+ get host() {
927
+ return W(this);
928
+ }
929
+ };
930
+ Ue([
931
+ x({
932
+ name: "nylas-organizer-confirmation-card",
933
+ stateToProps: /* @__PURE__ */ new Map([
934
+ ["scheduler.organizerConfirmationBookingId", "organizerConfirmationBookingId"],
935
+ ["scheduler.configSettings", "configSettings"],
936
+ ["scheduler.isLoading", "isLoading"],
937
+ ["scheduler.selectedLanguage", "selectedLanguage"]
938
+ ]),
939
+ eventToProps: {
940
+ rejectBookingButtonClicked: async (e, t) => {
941
+ t.scheduler.setReject(e.detail.bookingId);
942
+ },
943
+ confirmBookingButtonClicked: async (e, t) => {
944
+ const { host: a } = e.detail, r = await t.scheduler.updateBooking({
945
+ bookingId: e.detail.bookingId,
946
+ status: "confirmed"
947
+ }), { errorHandler: o } = e.detail;
948
+ o && (!r || "error" in r) && o(r), await a.resetAction();
949
+ }
950
+ },
951
+ fireRegisterEvent: !0
952
+ }),
953
+ V("design:type", Function),
954
+ V("design:paramtypes", []),
955
+ V("design:returntype", void 0)
956
+ ], se.prototype, "render", null);
957
+ se.style = We;
958
+ const Xe = ":host{display:block;position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}", Ye = Xe;
959
+ var Je = function(e, t, a, r) {
960
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
961
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
962
+ i = Reflect.decorate(e, t, a, r);
963
+ else
964
+ for (var l = e.length - 1; l >= 0; l--)
965
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
966
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
967
+ }, Z = function(e, t) {
968
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
969
+ return Reflect.metadata(e, t);
970
+ };
971
+ const le = class {
972
+ constructor(e) {
973
+ C(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.startTime = "", this.endTime = "";
974
+ }
975
+ connectedCallback() {
976
+ }
977
+ disconnectedCallback() {
978
+ }
979
+ async componentWillLoad() {
980
+ d("[nylas-selected-event-card] Component will load");
981
+ }
982
+ async componentDidLoad() {
983
+ var t, a;
984
+ d("[nylas-selected-event-card] Component did load"), this.selectedDate || console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.'), this.selectedTimeslot || console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.');
985
+ const e = new Intl.DateTimeFormat("en-US", {
986
+ hour: "2-digit",
987
+ minute: "2-digit",
988
+ timeZone: this.selectedTimezone
989
+ });
990
+ this.startTime = e.format(new Date((t = this.selectedTimeslot) == null ? void 0 : t.start_time)), this.endTime = e.format(new Date((a = this.selectedTimeslot) == null ? void 0 : a.end_time));
991
+ }
992
+ render() {
993
+ var e;
994
+ return n(g, { key: "2b4257d6793fd263e7978504b88e270d77e2e78f", part: "nsec" }, n("div", { key: "8eb84c0c375afd9824d88337003d09b7fe3db171", class: "event-card", part: "nsec__card" }, n("div", { key: "bc7d364f1ec772f06f5eab4549b0433cb947f68d", class: "calendar-icon", part: "nsec__icon" }, n("calendar-icon", { key: "a3f38777fea8b17714ad0dc34cd236a93e4360fd" })), n("div", { key: "1d23698c5a8d627bc10c7969e269a381584b6477", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? J((e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(K[this.selectedLanguage || navigator.language], { dateStyle: "full", timeZone: this.selectedTimezone })) : "-"), n("div", { key: "4e02d04cc6918076935614be321619a9df16430d", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), n("div", { key: "ad39ae7e3df5e6652b0dad88b98695cfee00e3db", class: "event-timezone", part: "nsec__timezone" }, n("globe-icon", { key: "23b1e1fd15842a65278a969e1ce3aea0313ea46e" }), L[this.selectedTimezone]));
995
+ }
996
+ };
997
+ Je([
998
+ x({
999
+ name: "nylas-selected-event-card",
1000
+ stateToProps: /* @__PURE__ */ new Map([
1001
+ ["scheduler.selectedDate", "selectedDate"],
1002
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
1003
+ ["scheduler.selectedTimezone", "selectedTimezone"],
1004
+ ["scheduler.selectedLanguage", "selectedLanguage"]
1005
+ ]),
1006
+ eventToProps: {},
1007
+ fireRegisterEvent: !0
1008
+ }),
1009
+ Z("design:type", Function),
1010
+ Z("design:paramtypes", []),
1011
+ Z("design:returntype", void 0)
1012
+ ], le.prototype, "render", null);
1013
+ le.style = Ye;
1014
+ const Ke = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .timeslot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}", Qe = Ke;
1015
+ var et = function(e, t, a, r) {
1016
+ var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
1017
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1018
+ i = Reflect.decorate(e, t, a, r);
1019
+ else
1020
+ for (var l = e.length - 1; l >= 0; l--)
1021
+ (s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
1022
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
1023
+ }, G = function(e, t) {
1024
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1025
+ return Reflect.metadata(e, t);
1026
+ };
1027
+ const ce = class {
1028
+ constructor(e) {
1029
+ C(this, e), this.timeslotSelected = h(this, "timeslotSelected", 7), this.timeslotConfirmed = h(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, a) => {
1030
+ t.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", a), this.timeslotConfirmed.emit(a);
1031
+ }, this.handleMouseEnter = (t) => {
1032
+ this.hoveredTimeslotIndex = t;
1033
+ }, this.handleMouseLeave = () => {
1034
+ this.hoveredTimeslotIndex = -1;
1035
+ }, this.selectedDate = /* @__PURE__ */ new Date(), this.availability = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
1036
+ }
1037
+ selectedLanguageChanged(e) {
1038
+ c.changeLanguage(e);
1039
+ }
1040
+ selectedDateChanged(e) {
1041
+ var t;
1042
+ if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
1043
+ const a = (t = this.availability) == null ? void 0 : t.filter((r) => E(r.start_time, e)).map((r) => r);
1044
+ this.times = a || [];
1045
+ }
1046
+ }
1047
+ availabilityChanged(e) {
1048
+ if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
1049
+ const t = e == null ? void 0 : e.filter((a) => this.selectedDate && E(a.start_time, this.selectedDate)).map((a) => a);
1050
+ this.times = t || [];
1051
+ }
1052
+ }
1053
+ connectedCallback() {
1054
+ }
1055
+ disconnectedCallback() {
1056
+ }
1057
+ async componentWillLoad() {
1058
+ var t;
1059
+ const e = (t = this.availability) == null ? void 0 : t.filter((a) => this.selectedDate && E(a.start_time, this.selectedDate)).map((a) => a);
1060
+ this.times = e || [], d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
1061
+ }
1062
+ async componentDidLoad() {
1063
+ d("[nylas-timeslot-picker] Component did load");
1064
+ }
1065
+ getTimeslotId(e, t) {
1066
+ return `${e.toLocaleDateString()}-${t}`;
1067
+ }
1068
+ onClickSelectTime(e, t) {
1069
+ d("[nylas-timeslot-picker] Time selected", e, t), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, t), this.timeslotSelected.emit({
1070
+ start_time: e.start_time,
1071
+ end_time: e.end_time,
1072
+ emails: e.emails
1073
+ });
1074
+ }
1075
+ getTimeSlotLabel(e) {
1076
+ const t = new Intl.DateTimeFormat("en-US", {
1077
+ hour: "2-digit",
1078
+ minute: "2-digit",
1079
+ timeZone: this.selectedTimezone
1080
+ });
1081
+ return `${t.format(e.start_time)} - ${t.format(e.end_time)}`;
1082
+ }
1083
+ render() {
1084
+ return this.isLoading ? n(g, null, n("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => n("div", { class: "timeslot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? n(g, null, n("div", { class: "empty" }, n("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? n(g, null, n("div", { class: "empty" }, n("span", null, "No time slots available for selected date"))) : this.selectedDate ? n(g, { part: "ntp" }, n("div", { class: "time-picker-wrapper" }, n("div", { class: "timeslots" }, this.times.map((e, t) => {
1085
+ var a, r, o, i;
1086
+ return n("button", { part: `ntp__timeslot ${((r = (a = this.selectedTimeslot) == null ? void 0 : a.start_time) == null ? void 0 : r.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
1087
+ time: !0,
1088
+ selected: typeof this.selectedTimeslot < "u" && ((i = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : i.getTime()) === e.start_time.getTime()
1089
+ }, onClick: () => this.onClickSelectTime(e, t), onMouseEnter: () => this.handleMouseEnter(t), onMouseLeave: () => this.handleMouseLeave() }, this.hoveredTimeslotIndex == t || this.selectedTimeslotIndex == this.getTimeslotId(e.start_time, t) ? this.getTimeSlotLabel(e) : e.start_time.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone }));
1090
+ })), this.selectedTimeslot && n("div", { class: "footer" }, n("button-component", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, n("slot", { name: "timeslot-picker-cta-label" }, c.t("nextButton")))))) : n(g, null);
1091
+ }
1092
+ static get watchers() {
1093
+ return {
1094
+ selectedLanguage: ["selectedLanguageChanged"],
1095
+ selectedDate: ["selectedDateChanged"],
1096
+ availability: ["availabilityChanged"]
1097
+ };
1098
+ }
1099
+ };
1100
+ et([
1101
+ x({
1102
+ name: "nylas-timeslot-picker",
1103
+ stateToProps: /* @__PURE__ */ new Map([
1104
+ ["scheduler.selectedDate", "selectedDate"],
1105
+ ["scheduler.availability", "availability"],
1106
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
1107
+ ["scheduler.selectedTimezone", "selectedTimezone"],
1108
+ ["scheduler.selectedLanguage", "selectedLanguage"],
1109
+ ["scheduler.isLoading", "isLoading"]
1110
+ ]),
1111
+ eventToProps: {
1112
+ timeslotSelected: async (e, t) => {
1113
+ d("nylas-timeslot-picker", "timeslotSelected", e.detail), t.scheduler.selectTime(e.detail);
1114
+ },
1115
+ timeslotConfirmed: async (e, t) => {
1116
+ d("nylas-timeslot-picker", "timeslotConfirmed", e.detail), e.detail && t.scheduler.toggleAdditionalData(!0);
1117
+ }
1118
+ },
1119
+ fireRegisterEvent: !0
1120
+ }),
1121
+ G("design:type", Function),
1122
+ G("design:paramtypes", []),
1123
+ G("design:returntype", void 0)
1124
+ ], ce.prototype, "render", null);
1125
+ ce.style = Qe;
1126
+ export {
1127
+ Q as nylas_booked_event_card,
1128
+ ee as nylas_booking_form,
1129
+ te as nylas_cancel_booking_form,
1130
+ ne as nylas_cancelled_event_card,
1131
+ ae as nylas_confirmed_event_card,
1132
+ oe as nylas_date_picker,
1133
+ re as nylas_locale_switch,
1134
+ qe as nylas_logo,
1135
+ Ze as nylas_notification,
1136
+ se as nylas_organizer_confirmation_card,
1137
+ le as nylas_selected_event_card,
1138
+ ce as nylas_timeslot_picker
1139
+ };