@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.3

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 (133) hide show
  1. package/dist/add-circle-icon_22.entry-8d0ac489.cjs +1 -0
  2. package/dist/add-circle-icon_22.entry-da31fa71.js +1733 -0
  3. package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-7aad8104.cjs} +1 -1
  4. package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-bc2418f7.js} +20 -20
  5. package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-6eba68a9.cjs} +1 -1
  6. package/dist/arrow-icon.entry-9a932082.js +15 -0
  7. package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-5f7e3755.js} +4 -4
  8. package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-db17d481.cjs} +1 -1
  9. package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-1ff7845a.js} +4 -4
  10. package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-a5141f82.cjs} +1 -1
  11. package/dist/calendar-check-icon_2.entry-c3add652.cjs +1 -0
  12. package/dist/calendar-check-icon_2.entry-d7421059.js +25 -0
  13. package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-4458997f.js} +2 -2
  14. package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-445d624a.cjs} +1 -1
  15. package/dist/chevron-icon_3.entry-8961e6bb.cjs +1 -0
  16. package/dist/chevron-icon_3.entry-f7f3d487.js +117 -0
  17. package/dist/close-icon.entry-6dd5ff0a.js +15 -0
  18. package/dist/close-icon.entry-ebc527c5.cjs +1 -0
  19. package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-6ee60d6d-4cd16450.js} +1656 -2374
  20. package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-6ee60d6d-6c0540db.cjs} +6 -6
  21. package/dist/document-refresh-icon.entry-298b2133.cjs +1 -0
  22. package/dist/document-refresh-icon.entry-bdc323b5.js +15 -0
  23. package/dist/elements/index.d.ts +31 -2
  24. package/dist/{forward-icon_6.entry-3345af84.cjs → forward-icon_6.entry-15208ea9.cjs} +3 -3
  25. package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-62759373.js} +127 -127
  26. package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-9e082178.js} +4 -4
  27. package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-c8302bf5.cjs} +1 -1
  28. package/dist/google-logo-icon_3.entry-0c095209.js +258 -0
  29. package/dist/google-logo-icon_3.entry-f8433ff9.cjs +1 -0
  30. package/dist/index-0f3bd8df.js +1824 -0
  31. package/dist/index-7a55dc33.cjs +30 -0
  32. package/dist/index.d.ts +3 -1
  33. package/dist/index.es-2578c6a5-098d48d0.cjs +7 -0
  34. package/dist/{index-b30d446a-a90f84b2.js → index.es-2578c6a5-71441142.js} +833 -933
  35. package/dist/info-icon_2.entry-73106882.js +34 -0
  36. package/dist/info-icon_2.entry-ca224a3b.cjs +1 -0
  37. package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-012644b7.js} +4 -4
  38. package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-f9f5e66f.cjs} +1 -1
  39. package/dist/mailbox-store-bb21512c-045c3ea0.cjs +1 -0
  40. package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-bb21512c-615660ef.js} +17 -16
  41. package/dist/nylas-additional-participants.entry-a50ef8e2.cjs +1 -0
  42. package/dist/nylas-additional-participants.entry-db85836a.js +83 -0
  43. package/dist/nylas-booked-event-card_10.entry-b49b2369.js +784 -0
  44. package/dist/nylas-booked-event-card_10.entry-fccb783c.cjs +1 -0
  45. package/dist/nylas-form-card.entry-090a4d3b.js +56 -0
  46. package/dist/nylas-form-card.entry-f5230005.cjs +1 -0
  47. package/dist/nylas-if-state.entry-7924dde0.js +96 -0
  48. package/dist/nylas-if-state.entry-ff9c9a85.cjs +1 -0
  49. package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-9dd96530.js} +9 -8
  50. package/dist/nylas-list-folders.entry-dbfc2cf8.cjs +1 -0
  51. package/dist/nylas-list-threads.entry-6bcc0328.cjs +1 -0
  52. package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-b435eaae.js} +5 -4
  53. package/dist/nylas-login.entry-1623d309.cjs +1 -0
  54. package/dist/nylas-login.entry-97350c76.js +75 -0
  55. package/dist/nylas-mailbox-pagination.entry-1776eb16.cjs +1 -0
  56. package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-ceef8be2.js} +4 -3
  57. package/dist/nylas-mailbox-toolbar-button.entry-7d3f79b9.cjs +1 -0
  58. package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-e6b3d3a4.js} +11 -10
  59. package/dist/nylas-mailbox.entry-06d8014a.js +136 -0
  60. package/dist/nylas-mailbox.entry-ae8da6ff.cjs +1 -0
  61. package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-8b9c2b69.js} +46 -33
  62. package/dist/nylas-provider.entry-97c9e272.cjs +1 -0
  63. package/dist/nylas-scheduler-editor.entry-c3791787.js +2181 -0
  64. package/dist/nylas-scheduler-editor.entry-f6cf1cd9.cjs +7 -0
  65. package/dist/nylas-scheduling.entry-08ae840a.cjs +1 -0
  66. package/dist/nylas-scheduling.entry-6380509a.js +237 -0
  67. package/dist/nylas-threads-refresh.entry-246e6d77.cjs +1 -0
  68. package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-eaee86fb.js} +6 -5
  69. package/dist/nylas-threads-search.entry-42a2acb1.cjs +1 -0
  70. package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-7e12758e.js} +15 -14
  71. package/dist/nylas-view-thread.entry-78e6927a.cjs +1 -0
  72. package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-b936e76a.js} +5 -4
  73. package/dist/people-icon.entry-5c8ee696.js +15 -0
  74. package/dist/people-icon.entry-bcf848c0.cjs +1 -0
  75. package/dist/play-icon_2.entry-356e63cc.js +25 -0
  76. package/dist/play-icon_2.entry-92e78f1b.cjs +1 -0
  77. package/dist/react.cjs +1 -1
  78. package/dist/react.js +92 -61
  79. package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-77f0c377.js} +2 -2
  80. package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-bec053b6.cjs} +1 -1
  81. package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-dc659dc3-0fdb18dc.js} +2 -2
  82. package/dist/{register-component-152c6ad2-0df7215b.cjs → register-component-dc659dc3-f58bf25b.cjs} +1 -1
  83. package/dist/scheduler-config-store-51ee4f42-ce3a9b0e.cjs +1 -0
  84. package/dist/scheduler-config-store-51ee4f42-e02895da.js +14 -0
  85. package/dist/{scheduler-store-7d48e682-0c0c3991.js → scheduler-store-72116723-3ba2480c.js} +100 -95
  86. package/dist/scheduler-store-72116723-db9d91f6.cjs +1 -0
  87. package/dist/time-period-selector.entry-decd251b.js +78 -0
  88. package/dist/time-period-selector.entry-f25fad77.cjs +1 -0
  89. package/dist/translate-icon.entry-cac02c46.js +15 -0
  90. package/dist/translate-icon.entry-dd5b707c.cjs +1 -0
  91. package/dist/utils-c00bdc3c-89ab163d.js +2111 -0
  92. package/dist/utils-c00bdc3c-94b9c3b6.cjs +8 -0
  93. package/dist/warning-icon.entry-370b9cf0.js +15 -0
  94. package/dist/warning-icon.entry-8af8a742.cjs +1 -0
  95. package/package.json +7 -4
  96. package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
  97. package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
  98. package/dist/arrow-icon.entry-8b2e96a6.js +0 -15
  99. package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
  100. package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
  101. package/dist/chevron-icon.entry-58366662.cjs +0 -1
  102. package/dist/chevron-icon.entry-5e11cef5.js +0 -15
  103. package/dist/close-icon_2.entry-011d9cf4.js +0 -25
  104. package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
  105. package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
  106. package/dist/document-refresh-icon.entry-9083a2e9.js +0 -15
  107. package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
  108. package/dist/duration-bddc4a13-179ce826.js +0 -41
  109. package/dist/index-3b6f5cd5.cjs +0 -30
  110. package/dist/index-630f4e87.js +0 -1498
  111. package/dist/index-b30d446a-cbbef925.cjs +0 -7
  112. package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
  113. package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
  114. package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
  115. package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
  116. package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
  117. package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
  118. package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
  119. package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
  120. package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
  121. package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
  122. package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
  123. package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
  124. package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
  125. package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
  126. package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
  127. package/dist/play-icon_2.entry-ed5877e3.js +0 -25
  128. package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
  129. package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
  130. package/dist/search-icon_3.entry-292138c3.js +0 -101
  131. package/dist/search-icon_3.entry-8e555357.cjs +0 -1
  132. package/dist/utils-5074a070-ce33ee6b.js +0 -119
  133. package/dist/utils-5074a070-d5ba6add.cjs +0 -2
@@ -0,0 +1,784 @@
1
+ import { r as f, c as d, h as t, H as b, g as q, F as X } from "./index-0f3bd8df.js";
2
+ import { R as h } from "./register-component-dc659dc3-0fdb18dc.js";
3
+ import { d as c, k as Y, l as J, m, n as C } from "./utils-c00bdc3c-89ab163d.js";
4
+ import { T as u, g as K, L as F } from "./constants-6ee60d6d-4cd16450.js";
5
+ import "react";
6
+ import "react-dom";
7
+ import "./_commonjsHelpers-57e89916-af061c86.js";
8
+ const Q = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 0;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:1rem;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', ee = Q;
9
+ var ae = function(e, a, n, s) {
10
+ var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
11
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
12
+ i = Reflect.decorate(e, a, n, s);
13
+ else
14
+ for (var l = e.length - 1; l >= 0; l--)
15
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
16
+ return o > 3 && i && Object.defineProperty(a, n, i), i;
17
+ }, w = function(e, a) {
18
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
19
+ return Reflect.metadata(e, a);
20
+ };
21
+ const M = class {
22
+ constructor(e) {
23
+ f(this, e), this.cancelBookingButtonClicked = d(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = d(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = d(this, "rescheduleBookedEventError", 7), this.handleCancelBookingButtonClicked = () => {
24
+ this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
25
+ }, this.handleRescheduleButtonClicked = () => {
26
+ const a = (n) => {
27
+ this.rescheduleBookedEventError.emit(n);
28
+ };
29
+ this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: a });
30
+ }, this.getOrganizer = (a) => a == null ? void 0 : a.organizer, this.getPaticipantType = (a) => {
31
+ switch (a) {
32
+ case "host":
33
+ return "Host";
34
+ case "you":
35
+ return "You";
36
+ default:
37
+ return "";
38
+ }
39
+ }, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0;
40
+ }
41
+ connectedCallback() {
42
+ }
43
+ disconnectedCallback() {
44
+ }
45
+ async componentWillLoad() {
46
+ c("[nylas-booked-event-card] Component will load");
47
+ }
48
+ async componentDidLoad() {
49
+ c("[nylas-booked-event-card] Component did load");
50
+ }
51
+ render() {
52
+ var e, a, n, s, o, i;
53
+ return t(b, { key: "1585329ee957e66c757861d989d29a9c1bb1451f", part: "nbec" }, t("sp-theme", { key: "113da8c82dd485188d40f1dea9f814be0c408ca2", theme: "spectrum", color: "dark", scale: "medium" }, t("div", { key: "af6b0a085e582f2d7bdb5503b9d5b6d3c7042fd3", class: "booked-event-timezone" }, t("globe-icon", { key: "0c3fbff398a24c97d82bb74434d9da574349919f" }), u[this.selectedTimezone]), t("div", { key: "136d5341ef1d252b525359418e8df0a43f4160a0", class: "event-card-wrapper", part: "nbec__card" }, t("div", { key: "767bcbb50f4ae8c294f3ab3733fe99cd7c4c78e1", class: "calendar-icon" }, t("calendar-check-icon", { key: "e6fd3ec502795fbcaaf9d34b5b5c4cee2d732d4f" })), t("div", { key: "7dfa8cc7719760d396716ec81ab0022c01bbe22f", class: "booked-event-header" }, t("h2", { key: "34a452c275a3880f64575735a9e67db5a8cdea45", slot: "card-title", part: "nbec__title" }, "Booking ", this.rescheduleBookingId ? "rescheduled" : "confirmed", "!"), t("div", { key: "a081b1a3791e2e80dd651d1f9dbf5de2f2057f9a", part: "nbec__description" }, ((e = this.getOrganizer(this.eventInfo)) == null ? void 0 : e.name) || ((a = this.getOrganizer(this.eventInfo)) == null ? void 0 : a.email), " & ", ((s = (n = this.bookingInfo) == null ? void 0 : n.primaryParticipant) == null ? void 0 : s.name) || ((i = (o = this.bookingInfo) == null ? void 0 : o.primaryParticipant) == null ? void 0 : i.email))), t("sp-divider", { key: "0744f0fa4f3fff8f2dc0dec978632496d26bfae6" }), t("div", { key: "38460fbfbe5d19b4f0d48cb0df02e6d12c2f2740", class: "booking-date-time" }, t("checkmark-circle-icon", { key: "1e282c329489e4def089d8fca1bd532557f91b92" }), t("h3", { key: "34bebd074562352d54628f763c339ccd4c44918a" }, "Booking date and time"), t("p", { key: "d897859d30e6dd6651c0d4b0079bf0eab1df0356" }, new Date(this.selectedTimeslot.start_time).toLocaleDateString(void 0, { dateStyle: "full" }), " ", t("br", { key: "2aa56898e654721616459102329cbe498232d3e8" }), new Date(this.selectedTimeslot.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date(this.selectedTimeslot.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), t("div", { key: "5009ca55f795c2fd1240ed8bbc50216c4e66be87", class: "booking-participants" }), t("sp-divider", { key: "4b5b4325dda3f935387218429823b850d2a12f0e" }), t("div", { key: "d25cc602a134085c19f0acea006db0707ceae7e5", class: "footer" }, t("sp-button", { key: "4625e515f2f79d6ecb0bb37813efe100c03cdaf2", variant: "secondary", treatment: "outline", class: "cancel", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, "Cancel booking"), t("sp-button", { key: "9cbdc95cd53aa2d536751984b91ef5974e71179d", variant: "secondary", treatment: "outline", class: "reschedule", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, "Reschedule")))));
54
+ }
55
+ };
56
+ ae([
57
+ h({
58
+ name: "nylas-booked-event-card",
59
+ stateToProps: /* @__PURE__ */ new Map([
60
+ ["scheduler.bookingInfo", "bookingInfo"],
61
+ ["scheduler.rescheduleBookingId", "rescheduleBookingId"],
62
+ ["scheduler.selectedTimezone", "selectedTimezone"],
63
+ ["scheduler.selectedTimeslot", "selectedTimeslot"]
64
+ ]),
65
+ eventToProps: {
66
+ cancelBookingButtonClicked: async (e, a) => {
67
+ a.scheduler.setCancel(e.detail.bookingId);
68
+ },
69
+ rescheduleButtonClicked: async (e, a) => {
70
+ const n = await a.scheduler.setReschedule(e.detail.bookingId), { errorHandler: s } = e.detail;
71
+ s && (!n || "error" in n) && s(n);
72
+ }
73
+ },
74
+ fireRegisterEvent: !0
75
+ }),
76
+ w("design:type", Function),
77
+ w("design:paramtypes", []),
78
+ w("design:returntype", void 0)
79
+ ], M.prototype, "render", null);
80
+ M.style = ee;
81
+ const te = ':host{display:block;height:100%;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family)}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}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].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].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}', ne = te;
82
+ var ie = function(e, a, n, s) {
83
+ var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
84
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
85
+ i = Reflect.decorate(e, a, n, s);
86
+ else
87
+ for (var l = e.length - 1; l >= 0; l--)
88
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
89
+ return o > 3 && i && Object.defineProperty(a, n, i), i;
90
+ }, _ = function(e, a) {
91
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
92
+ return Reflect.metadata(e, a);
93
+ };
94
+ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, $ = class {
95
+ constructor(e) {
96
+ f(this, e), this.nameChanged = d(this, "nameChanged", 7), this.emailChanged = d(this, "emailChanged", 7), this.backButtonClicked = d(this, "backButtonClicked", 7), this.detailsConfirmed = d(this, "detailsConfirmed", 7), this.bookingFormError = d(this, "bookingFormError", 7), this.handleGuestChange = (a, n) => {
97
+ this.resetGuestEmailError(a);
98
+ const s = [...this.guestEmails];
99
+ s[a] = n, this.guestEmails = [...s];
100
+ }, this.handleGuestBlur = (a, n) => {
101
+ if (this.resetGuestEmailError(a), n === "") {
102
+ this.guestEmailErrors[a] = "Email is required";
103
+ return;
104
+ }
105
+ if (!E.test(n)) {
106
+ this.guestEmailErrors[a] = "Enter a valid email address";
107
+ return;
108
+ }
109
+ this.handleGuestChange(a, n);
110
+ }, this.addGuestButtonClickedHandler = () => {
111
+ this.guestEmails = [...this.guestEmails, ""];
112
+ }, this.removeGuestButtonClickHandler = (a, n) => {
113
+ a.preventDefault(), this.resetGuestEmailError(n);
114
+ const s = [...this.guestEmails];
115
+ s.splice(n, 1), this.guestEmails = [...s];
116
+ }, this.handleBackButtonClicked = () => {
117
+ this.backButtonClicked.emit();
118
+ }, this.bookButtonClickedHandler = async (a) => {
119
+ var i, r, l, p, y, P, O;
120
+ a.preventDefault(), c("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
121
+ const n = this.name || ((r = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : r.name), s = this.email || ((p = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : p.email);
122
+ if (!n || n === "") {
123
+ this.isNameValid = !1, this.validationError.name = "Name is required", this.bookingFormError.emit({
124
+ title: "Booking form error",
125
+ description: "Name is required"
126
+ });
127
+ return;
128
+ }
129
+ if (!s || s === "") {
130
+ this.isEmailValid = !1, this.validationError.email = "Email is required", this.bookingFormError.emit({
131
+ title: "Booking form error",
132
+ description: "Email is required"
133
+ });
134
+ return;
135
+ }
136
+ if (!E.test(s)) {
137
+ this.isEmailValid = !1, this.validationError.email = "Enter a valid email address", this.bookingFormError.emit({
138
+ title: "Booking form error",
139
+ description: "Invalid email"
140
+ });
141
+ return;
142
+ }
143
+ let o = [];
144
+ if (this.guestEmails.length > 0) {
145
+ let x = !1;
146
+ if (this.guestEmails.forEach((g, N) => {
147
+ g === "" ? (x = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [N]: "Email is required" }) : E.test(g) || (x = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [N]: "Enter a valid email address" });
148
+ }), x) {
149
+ this.bookingFormError.emit({
150
+ title: "Booking form error",
151
+ description: "Invalid guest email"
152
+ });
153
+ return;
154
+ }
155
+ o = this.guestEmails.map((g) => ({ name: "", email: g.trim() }));
156
+ } else
157
+ (y = this.bookingInfo) != null && y.guests && (o = (P = this.bookingInfo) == null ? void 0 : P.guests);
158
+ this.detailsConfirmed.emit({
159
+ primaryParticipant: {
160
+ name: n,
161
+ email: s
162
+ },
163
+ guests: o,
164
+ additionalFields: {
165
+ ...(O = this.bookingInfo) == null ? void 0 : O.additionalFields
166
+ }
167
+ });
168
+ }, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.validationError = { name: "", email: "" };
169
+ }
170
+ connectedCallback() {
171
+ }
172
+ disconnectedCallback() {
173
+ }
174
+ componentWillLoad() {
175
+ var e, a;
176
+ c("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && (this.name = (e = this.bookingInfo.primaryParticipant) == null ? void 0 : e.name, this.email = (a = this.bookingInfo.primaryParticipant) == null ? void 0 : a.email);
177
+ }
178
+ bookingInfoChangedHandler(e) {
179
+ e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
180
+ }
181
+ changeName(e) {
182
+ this.isNameValid = !0, this.validationError.name = "", this.name = e, this.nameChanged.emit(e);
183
+ }
184
+ changeEmail(e) {
185
+ this.isEmailValid = !0, this.validationError.email = "", this.email = e, this.emailChanged.emit(e);
186
+ }
187
+ resetGuestEmailError(e) {
188
+ const a = { ...this.guestEmailErrors };
189
+ delete a[e], this.guestEmailErrors = { ...a };
190
+ }
191
+ render() {
192
+ return t(b, { key: "5a255277a21fa84d100bb53d13bb9dce0ce58e24" }, t("form", { key: "19b7aecb9223557f0ff9d4c062968c3242026f0c", onSubmit: (e) => this.bookButtonClickedHandler(e), noValidate: !0 }, t("div", { key: "49276b2a59934eeaeb38c06db6968f957b7b9bee", class: "nylas-booking-form" }, t("slot", { key: "ee0a8c29c1fb6b7273d6a2d3c8cb88180f0e9dbf", name: "custom-booking-form" }, t("div", { key: "662e46f3a7925282f824547a069f52584b94d564", class: "input-wrapper" }, t("label", { key: "a01c1903ee983e1555006ad14e75cd1b2c3036ff", htmlFor: "name", class: { "input-label": !0, error: !this.isNameValid }, part: "nbf__input-label" }, "Name ", t("span", { key: "4729d580bbf9d851c2ac8b686dc826c4e3e4616f", class: "required" }, "*")), t("input", { key: "51754a63345f1d0332a38f646dde6a8a998c8dee", id: "name", type: "text", placeholder: "Enter your name", value: this.name, class: {
193
+ input: !0,
194
+ error: !this.isNameValid
195
+ }, part: "nbf__input-textfield", onInput: (e) => {
196
+ var a;
197
+ return this.changeName((a = e.target) == null ? void 0 : a.value);
198
+ } }), t("p", { key: "b8a6660e959a877421bdfffdb87279d8f09123b8", class: "help-text" }, this.validationError.name)), t("div", { key: "e78a74e67abde7e61c1d3c555c234817770a4040", class: "input-wrapper" }, t("label", { key: "d5507037f5c668f58e14031dba4276900ef5ed09", htmlFor: "email", class: { "input-label": !0, error: !this.isEmailValid }, part: "nbf__input-label" }, "Email ", t("span", { key: "514f00587069ac1cfc6d16bfd30750d6d501817d", class: "required" }, "*")), t("input", { key: "0b80ded98b2174f783fa9e7c951a47661aa894f6", id: "email", type: "email", placeholder: "Enter your email", value: this.email, class: {
199
+ input: !0,
200
+ error: !this.isEmailValid
201
+ }, part: "nbf__input-textfield", onInput: (e) => {
202
+ var a;
203
+ return this.changeEmail((a = e.target) == null ? void 0 : a.value);
204
+ } }), t("p", { key: "ba185ccb2bec87049e94d8c5f8d211a838de0025", class: "help-text" }, this.validationError.email)))), t("div", { key: "56e2cce79371533ad66cccad95a79dd8935fe3eb", class: "cta" }, t("sp-button", { key: "2b6410b3cf2b7634737aa858396290ad065dfcfc", treatment: "outline", variant: "secondary", class: "back", part: "nbf__button-outline", onClick: this.handleBackButtonClicked }, t("slot", { key: "4ba60a2fb3542434ede16ea382ec4ca80cb8d422", name: "booking-form-back-label" }, "Back")), t("sp-button", { key: "49dd32531d7b55529bb73bc82eb0b91820c6ea33", variant: "primary", class: "book", part: "nbf__button-primary", type: "submit" }, this.isLoading && t("loading-icon", { slot: "icon" }), t("slot", { key: "a57ae44c1c3a1b020a110f0156435f27897410c6", name: "booking-form-book-label" }, "Book now")))));
205
+ }
206
+ get host() {
207
+ return q(this);
208
+ }
209
+ static get watchers() {
210
+ return {
211
+ bookingInfo: ["bookingInfoChangedHandler"]
212
+ };
213
+ }
214
+ };
215
+ ie([
216
+ h({
217
+ name: "nylas-booking-form",
218
+ stateToProps: /* @__PURE__ */ new Map([
219
+ ["scheduler.isLoading", "isLoading"],
220
+ ["scheduler.bookingInfo", "bookingInfo"],
221
+ ["scheduler.eventInfo", "eventInfo"]
222
+ ]),
223
+ eventToProps: {
224
+ backButtonClicked: async (e, a) => {
225
+ a.scheduler.toggleAdditionalData(!1);
226
+ },
227
+ nameChanged: async (e, a) => {
228
+ a.scheduler.setParticipantName(e.detail);
229
+ },
230
+ emailChanged: async (e, a) => {
231
+ a.scheduler.setParticipantEmail(e.detail);
232
+ }
233
+ },
234
+ fireRegisterEvent: !0
235
+ }),
236
+ _("design:type", Function),
237
+ _("design:paramtypes", []),
238
+ _("design:returntype", void 0)
239
+ ], $.prototype, "render", null);
240
+ $.style = ne;
241
+ const se = ':host{display:block;width:400px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}', re = se;
242
+ var oe = function(e, a, n, s) {
243
+ var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
244
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
245
+ i = Reflect.decorate(e, a, n, s);
246
+ else
247
+ for (var l = e.length - 1; l >= 0; l--)
248
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
249
+ return o > 3 && i && Object.defineProperty(a, n, i), i;
250
+ }, T = function(e, a) {
251
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
252
+ return Reflect.metadata(e, a);
253
+ };
254
+ const H = class {
255
+ constructor(e) {
256
+ f(this, e), this.goBackButtonClicked = d(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = d(this, "cancelBookingFormSubmitted", 7), this.cancelBookedEventError = d(this, "cancelBookedEventError", 7), this.cancelBookingFormError = d(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
257
+ this.goBackButtonClicked.emit();
258
+ }, this.handleSubmitCancelBooking = (a) => {
259
+ if (a.preventDefault(), !this.cancellationReason) {
260
+ this.cancellationError = "Please provide a reason for cancellation.", this.cancelBookingFormError.emit({ title: "Cancel booking form error", description: "Please provide a reason for cancellation." });
261
+ return;
262
+ }
263
+ c(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
264
+ const n = (s) => {
265
+ this.cancelBookedEventError.emit(s);
266
+ };
267
+ this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler: n });
268
+ }, this.handleOnChangeCancellationReason = (a) => {
269
+ this.cancellationError = "", this.cancellationReason = a.target.value;
270
+ }, this.cancelBookingId = void 0, this.cancellationReason = "", this.cancellationError = "";
271
+ }
272
+ connectedCallback() {
273
+ c("[nylas-cancel-booking-form] Component connected");
274
+ }
275
+ async componentWillLoad() {
276
+ c("[nylas-cancel-booking-form] Component will load");
277
+ }
278
+ async componentDidLoad() {
279
+ c("[nylas-cancel-booking-form] Component did load");
280
+ }
281
+ disconnectedCallback() {
282
+ c("[nylas-cancel-booking-form] Component disconnected");
283
+ }
284
+ render() {
285
+ return t(b, { key: "3e77b83049c0b9cd2ed968cc97e665017f76837e", part: "ncec" }, t("sp-theme", { key: "857ac295df09b0f642eb1e9d01021531b935c7ad", theme: "spectrum", scale: "medium" }, t("div", { key: "9f52787bc3efc81618e5eac14219c5674f4efe5a", class: "nylas-cancel-booking-form", part: "ncec__card" }, t("div", { key: "07ddd2cd5664aacf4e123d822bde07af562a8571", class: "nylas-cancel-booking-form__calendar-icon", part: "ncec__icon" }, t("calendar-cancel-icon", { key: "04ccbf1eb7ccd7d9053265e1991f8fd494b7e4ae" })), t("h3", { key: "2fdbd40021dae8eb98e4288793af8719d3cc6226", class: "nylas-cancel-booking-form__title", part: "ncec__title" }, "Cancel booking?"), t("div", { key: "3af3918de0c111bcf90f6ad44a468efdcab185ac", class: "nylas-cancel-booking-form__description", part: "ncec__description" }, "Your current timeslot will become available to others."), t("form", { key: "7e136e261b22e513b395e47dfc2db696aced945f", onSubmit: this.handleSubmitCancelBooking }, t("sp-field-label", { key: "fa566625fafbc74f98bb7c012dcb1c71093c0227", for: "cancel-reason", class: this.cancellationError ? "error" : "" }, "Reason for cancellation ", t("span", { key: "fb567a86677bfc33c63b6118ed9ce71eed7a5084", class: "required" }, "*")), t("sp-textfield", { key: "c585d1f070700a4ccb39d52fdc7dba764c19d43f", id: "cancel-reason", class: this.cancellationError ? "error" : "", part: "ncec__reason-textarea", multiline: !0, value: this.cancellationReason, onInput: this.handleOnChangeCancellationReason, onFocus: this.handleOnChangeCancellationReason, invalid: !!this.cancellationError }, t("sp-help-text", { key: "cf6d0e82b648ee662fa9244a793cfcaa64913c4c", slot: "negative-help-text" }, this.cancellationError)), t("sp-button", { key: "b8e17a34e57faaaa61585ea4beb2205537c38c49", variant: "primary", class: "cancel", type: "submit", part: "ncec__button-cta" }, "Cancel booking"), t("sp-button", { key: "eafb068d14d0680d8ea5cd7e42fd358d3582e99a", variant: "secondary", class: "back", treatment: "outline", part: "ncec__button-outline", onClick: this.handleGoBackClicked }, "Go back")))));
286
+ }
287
+ };
288
+ oe([
289
+ h({
290
+ name: "nylas-cancel-booking-form",
291
+ eventToProps: {
292
+ cancelBookingFormSubmitted: async (e, a) => {
293
+ const n = await a.scheduler.cancelBooking(e.detail.bookingId), { errorHandler: s } = e.detail;
294
+ s && (!n || "error" in n) && s(n);
295
+ }
296
+ },
297
+ fireRegisterEvent: !0
298
+ }),
299
+ T("design:type", Function),
300
+ T("design:paramtypes", []),
301
+ T("design:returntype", void 0)
302
+ ], H.prototype, "render", null);
303
+ H.style = re;
304
+ const le = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}', ce = le;
305
+ var de = function(e, a, n, s) {
306
+ var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
307
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
308
+ i = Reflect.decorate(e, a, n, s);
309
+ else
310
+ for (var l = e.length - 1; l >= 0; l--)
311
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
312
+ return o > 3 && i && Object.defineProperty(a, n, i), i;
313
+ }, D = function(e, a) {
314
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
315
+ return Reflect.metadata(e, a);
316
+ };
317
+ const Z = class {
318
+ constructor(e) {
319
+ f(this, e), this.closeCancelEventCardClicked = d(this, "closeCancelEventCardClicked", 7), this.handleCloseClicked = () => {
320
+ this.closeCancelEventCardClicked.emit();
321
+ }, this.cancelledEventInfo = void 0;
322
+ }
323
+ connectedCallback() {
324
+ c("[nylas-cancelled-event-card] Component connected");
325
+ }
326
+ async componentWillLoad() {
327
+ c("[nylas-cancelled-event-card] Component will load");
328
+ }
329
+ async componentDidLoad() {
330
+ c("[nylas-cancelled-event-card] Component did load");
331
+ }
332
+ disconnectedCallback() {
333
+ c("[nylas-cancelled-event-card] Component disconnected");
334
+ }
335
+ render() {
336
+ return t(b, { key: "52b1d729c8df61770be08c165665671f54189c9a", part: "ncec" }, t("sp-theme", { key: "94633560e146be20b9321e9548edb007bf570e1c", theme: "spectrum", color: "dark", scale: "medium" }, t("div", { key: "a18a0006aa5e84e58daa6f9446e2b85908867196", class: "nylas-cancelled-event-card", part: "ncec__card" }, t("div", { key: "67cc5524db58cb7777feaf9b249070e5d713b17b", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, t("calendar-cancel-icon", { key: "87b0379d4847388505e4f6ddd62d059af9156303" })), t("h3", { key: "b7d36ece20f5926c8bb2d0e796a35ed44772e8cf", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, "Your booking has been cancelled successfully!"), t("div", { key: "808a6cdf14cec2782990c85e06c23e5b9936bc56", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, "A cancellation email has been sent to the participants."), t("div", { key: "cfd161ea961c637ab2247a568143e659bfb1b7da", class: "nylas-cancelled-event-card__cta" }, t("sp-button", { key: "ab549c146571e0dd4e86cce46d9947875794a437", variant: "secondary", treatment: "outline", part: "ncec__button-outline", onClick: this.handleCloseClicked }, "Close")))));
337
+ }
338
+ };
339
+ de([
340
+ h({
341
+ name: "nylas-cancelled-event-card",
342
+ eventToProps: {},
343
+ fireRegisterEvent: !0
344
+ }),
345
+ D("design:type", Function),
346
+ D("design:paramtypes", []),
347
+ D("design:returntype", void 0)
348
+ ], Z.prototype, "render", null);
349
+ Z.style = ce;
350
+ const z = /* @__PURE__ */ new Date(), L = /* @__PURE__ */ new Date();
351
+ function k(e, a, n, s) {
352
+ function o(i) {
353
+ return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
354
+ }
355
+ return o.floor = (i) => (e(i = /* @__PURE__ */ new Date(+i)), i), o.ceil = (i) => (e(i = new Date(i - 1)), a(i, 1), e(i), i), o.round = (i) => {
356
+ const r = o(i), l = o.ceil(i);
357
+ return i - r < l - i ? r : l;
358
+ }, o.offset = (i, r) => (a(i = /* @__PURE__ */ new Date(+i), r == null ? 1 : Math.floor(r)), i), o.range = (i, r, l) => {
359
+ const p = [];
360
+ if (i = o.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < r) || !(l > 0))
361
+ return p;
362
+ let y;
363
+ do
364
+ p.push(y = /* @__PURE__ */ new Date(+i)), a(i, l), e(i);
365
+ while (y < i && i < r);
366
+ return p;
367
+ }, o.filter = (i) => k((r) => {
368
+ if (r >= r)
369
+ for (; e(r), !i(r); )
370
+ r.setTime(r - 1);
371
+ }, (r, l) => {
372
+ if (r >= r)
373
+ if (l < 0)
374
+ for (; ++l <= 0; )
375
+ for (; a(r, -1), !i(r); )
376
+ ;
377
+ else
378
+ for (; --l >= 0; )
379
+ for (; a(r, 1), !i(r); )
380
+ ;
381
+ }), n && (o.count = (i, r) => (z.setTime(+i), L.setTime(+r), e(z), e(L), Math.floor(n(z, L))), o.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? o.filter(s ? (r) => s(r) % i === 0 : (r) => o.count(0, r) % i === 0) : o)), o;
382
+ }
383
+ const be = 1e3, A = be * 60, fe = A * 60, v = fe * 24, B = k(
384
+ (e) => e.setHours(0, 0, 0, 0),
385
+ (e, a) => e.setDate(e.getDate() + a),
386
+ (e, a) => (a - e - (a.getTimezoneOffset() - e.getTimezoneOffset()) * A) / v,
387
+ (e) => e.getDate() - 1
388
+ );
389
+ k((e) => {
390
+ e.setUTCHours(0, 0, 0, 0);
391
+ }, (e, a) => {
392
+ e.setUTCDate(e.getUTCDate() + a);
393
+ }, (e, a) => (a - e) / v, (e) => e.getUTCDate() - 1);
394
+ k((e) => {
395
+ e.setUTCHours(0, 0, 0, 0);
396
+ }, (e, a) => {
397
+ e.setUTCDate(e.getUTCDate() + a);
398
+ }, (e, a) => (a - e) / v, (e) => Math.floor(e / v));
399
+ const me = ':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}@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:1rem}.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)}', he = me;
400
+ var pe = function(e, a, n, s) {
401
+ var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
402
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
403
+ i = Reflect.decorate(e, a, n, s);
404
+ else
405
+ for (var l = e.length - 1; l >= 0; l--)
406
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
407
+ return o > 3 && i && Object.defineProperty(a, n, i), i;
408
+ }, R = function(e, a) {
409
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
410
+ return Reflect.metadata(e, a);
411
+ };
412
+ const V = class {
413
+ constructor(e) {
414
+ f(this, e), this.dateSelected = d(this, "dateSelected", 7), this.monthChanged = d(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.isLoading = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates();
415
+ }
416
+ connectedCallback() {
417
+ }
418
+ disconnectedCallback() {
419
+ }
420
+ componentWillLoad() {
421
+ }
422
+ getDates() {
423
+ const e = Y(this.month), a = J(this.month);
424
+ return B.range(B.offset(a, -a.getDay()), B.offset(e, 7 - e.getDay()));
425
+ }
426
+ selectDate(e) {
427
+ this.dateSelected.emit(e);
428
+ }
429
+ changeMonth(e) {
430
+ this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1), this.dates = this.getDates(), this.monthChanged.emit(this.month), this.selectDate();
431
+ }
432
+ isSelected(e, a, n) {
433
+ return e && a && m(e, a) && n && (n == null ? void 0 : n.length) > 0;
434
+ }
435
+ isDisabled(e, a) {
436
+ return e && (a == null ? void 0 : a.find((n) => m(n, e))) === void 0;
437
+ }
438
+ render() {
439
+ var e, a;
440
+ return t(b, { key: "da3c7e290b60613575379d559e03d5e1dca04535", part: "ndp" }, t("div", { key: "4bb1b14f4f609f601b27f7ad2eb4baeed6cc4d55", class: "nylas-date-picker" }, t("div", { key: "5d6c68298c5e9606bae9e45a99f0c59da3d36854", class: "header flex-row" }, t("h2", { key: "2504a779961e1e07a881f2eb2f5ffa5d8329e627", part: "ndp__month-header" }, t("strong", { key: "433fdd38ccf5b49144bafd3b284acd26b94d19c4" }, this.month.toLocaleDateString(void 0, { month: "long" })), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), t("div", { key: "ffaa3276b249a85dc197828625835ad1f2278179", class: "pagination" }, t("button", { key: "451c9d09fc01e4c7ae35742d7c6b4b2f3da4d3ee", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((e = this.selectableDates) != null && e.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, t("chevron-icon", { key: "3a23fa0fb325feab4b56477602f122b800dce5ce" })), t("button", { key: "56b81156d02525a70c6c567e5facb1d9995ea2de", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: !((a = this.selectableDates) != null && a.length), part: "ndp__month-button" }, t("chevron-icon", { key: "1329d513678bffec6bc21d579b240e7af29ec530" })))), t("div", { key: "14eb94fe04ca2797f3377057a87825689b818719", class: "dates" }, ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map((n) => t("div", { class: "day", part: "ndp__day" }, n)), this.dates.map((n, s) => {
441
+ var i;
442
+ const o = this.isDisabled(n, this.selectableDates);
443
+ return this.isLoading ? t("button", { disabled: !0, class: {
444
+ "date day-skeleton": !0,
445
+ "current-month": C(n, this.month)
446
+ }, style: { animationDelay: `${s * 20}ms` }, part: "ndp__date" }, n.getDate()) : t("button", { class: {
447
+ date: !0,
448
+ selected: !!(this.selectedDate && m(n, this.selectedDate) && this.selectableDates && ((i = this.selectableDates) == null ? void 0 : i.length) > 0),
449
+ "current-day": m(n, /* @__PURE__ */ new Date()),
450
+ "current-month": C(n, this.month)
451
+ }, "aria-lang": n.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: o, onClick: () => this.selectDate(n), part: `ndp__date ${this.isSelected(n, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${m(n, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${C(n, this.month) ? "ndp__date--current-month" : ""}` }, n.getDate());
452
+ }))));
453
+ }
454
+ };
455
+ pe([
456
+ h({
457
+ name: "nylas-date-picker",
458
+ stateToProps: /* @__PURE__ */ new Map([
459
+ ["scheduler.selectableDates", "selectableDates"],
460
+ ["scheduler.selectedDate", "selectedDate"],
461
+ ["scheduler.isLoading", "isLoading"]
462
+ ]),
463
+ eventToProps: {
464
+ dateSelected: async (e, a) => {
465
+ a.scheduler.selectDate(e.detail);
466
+ }
467
+ },
468
+ fireRegisterEvent: !0
469
+ }),
470
+ R("design:type", Function),
471
+ R("design:paramtypes", []),
472
+ R("design:returntype", void 0)
473
+ ], V.prototype, "render", null);
474
+ V.style = he;
475
+ const ye = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:68px;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}', ue = ye;
476
+ var ge = function(e, a, n, s) {
477
+ var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
478
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
479
+ i = Reflect.decorate(e, a, n, s);
480
+ else
481
+ for (var l = e.length - 1; l >= 0; l--)
482
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
483
+ return o > 3 && i && Object.defineProperty(a, n, i), i;
484
+ }, S = function(e, a) {
485
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
486
+ return Reflect.metadata(e, a);
487
+ };
488
+ const G = class {
489
+ constructor(e) {
490
+ f(this, e), this.timezoneChanged = d(this, "timezoneChanged", 7), this.languageChanged = d(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
491
+ }
492
+ connectedCallback() {
493
+ }
494
+ disconnectedCallback() {
495
+ }
496
+ componentWillLoad() {
497
+ }
498
+ changeTimezone(e) {
499
+ this.selectedTimezone = e, this.timezoneChanged.emit(e);
500
+ }
501
+ changeLanguage(e) {
502
+ this.selectedLanguage = e, this.languageChanged.emit(e);
503
+ }
504
+ selectedOptionChangedHandler(e) {
505
+ const { name: a, value: n } = e.detail;
506
+ a === "timezone" ? this.changeTimezone(n) : a === "language" && this.changeLanguage(n);
507
+ }
508
+ getTimezoneLabelHTML(e) {
509
+ const a = K(e);
510
+ return t("span", { class: "timezone-label", style: {
511
+ display: "flex",
512
+ alignItems: "center",
513
+ justifyContent: "space-between",
514
+ width: "-webkit-fill-available"
515
+ } }, u[e], " ", t("span", { class: "timezone-offset", style: {
516
+ fontSize: "14px",
517
+ fontWeight: "400",
518
+ color: "var(--nylas-base-500)"
519
+ } }, a));
520
+ }
521
+ render() {
522
+ const e = Object.keys(u).map((n) => ({
523
+ labelHTML: this.getTimezoneLabelHTML(n),
524
+ label: u[n],
525
+ value: n
526
+ })), a = Object.keys(F).map((n) => ({
527
+ label: F[n],
528
+ value: n
529
+ }));
530
+ return t(b, { key: "688b90cbd1410a8025a8becfd3f979fc854c60a2" }, t("div", { key: "a4f485ce6204d89e16336c93809dbcf5ebf862ef", class: "nylas-locale-switch" }, t("div", { key: "5525e493d2f8e3258a2fe8b4c739db49d7ef1a35", class: {
531
+ "select-wrapper": !0,
532
+ timezone: !0
533
+ } }, t("select-dropdown", { key: "68f7f48a2cada4cc0c7327431f15384d17ebc261", name: "timezone", options: e, defaultSelectedOption: e.find((n) => n.value == this.selectedTimezone) }, t("span", { key: "d1213a8cba28b2163997cdb4bce7e13d7485e869", slot: "select-icon" }, t("globe-icon", { key: "f11285b20c93a42a0f195f89966bc7ff7b2d7322", width: "20", height: "20" })))), t("div", { key: "0287627954a80ef5092ded694e61ec2a19606667", class: {
534
+ "select-wrapper": !0,
535
+ language: !0
536
+ } }, t("select-dropdown", { key: "1bd58884de605b22cb6a5631b8e9f960cfa058d4", name: "language", options: a, defaultSelectedOption: a.find((n) => n.value == this.selectedLanguage) }, t("span", { key: "0681b6c8296d60c258c2df3bcb60d895c0e0c533", slot: "select-icon" }, t("translate-icon", { key: "bd3f346f56da2a139c5050799c9e2774d311d72c", width: "20", height: "20" }))))));
537
+ }
538
+ };
539
+ ge([
540
+ h({
541
+ name: "nylas-locale-switch",
542
+ stateToProps: /* @__PURE__ */ new Map([
543
+ ["scheduler.selectedLanguage", "selectedLanguage"],
544
+ ["scheduler.selectedTimezone", "selectedTimezone"]
545
+ ]),
546
+ eventToProps: {
547
+ timezoneChanged: async (e, a) => {
548
+ a.scheduler.selectTimezone(e.detail);
549
+ }
550
+ },
551
+ fireRegisterEvent: !0
552
+ }),
553
+ S("design:type", Function),
554
+ S("design:paramtypes", []),
555
+ S("design:returntype", void 0)
556
+ ], G.prototype, "render", null);
557
+ G.style = ue;
558
+ const ve = ".sc-nylas-logo-h{display:flex}", ke = ve, xe = class {
559
+ constructor(e) {
560
+ f(this, e), this.width = "69", this.height = "24";
561
+ }
562
+ render() {
563
+ return t("svg", { key: "a305694aba91cff6d13167eab106e824536728cd", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("g", { key: "790edf0bee99fea0fe2cef131ed9a3340ff1ec70", "clip-path": "url(#clip0_455_3543)" }, t("path", { key: "bd29c1fe02931e4a6dceee45711ef6c212164d77", 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" }), t("path", { key: "6ad33f3a2c1524777ef9f33d8fccdefa87c6c4de", 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" }), t("path", { key: "cff70a4c9e84c0c16cbbc8f3a1e9432200e2f6c7", 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" }), t("path", { key: "f8deff8d4ba7374b51cd83e2dd01d58b75cc751a", 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" }), t("path", { key: "0cc0f9ff674f031b72ebff2b4b4642f678a74a08", 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" }), t("path", { key: "fbc997ce655d72115a3f091a0c3df101d4311842", 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" }), t("path", { key: "1000a3c24e6495f474df5ffc6af307466f4c6fb6", 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" }), t("path", { key: "048a76e10c0489b5361747c3ff711e0c771071fc", 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" })), t("defs", { key: "2ecd1149d28e4b4d5d5fce2e3775933ae12a1983" }, t("clipPath", { key: "b0b608b033eafd9eb2ada24432d379f539f725e3", id: "clip0_455_3543" }, t("rect", { key: "0277917a58837afc24f997ef1a66f8f415b9072e", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
564
+ }
565
+ };
566
+ xe.style = ke;
567
+ const Ce = ':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)}.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}', we = Ce, _e = class {
568
+ constructor(e) {
569
+ f(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
570
+ }
571
+ onError(e) {
572
+ c(`[nylas-notification] Error: ${e.detail.title}`), this.handleNotification(e);
573
+ }
574
+ onWarning(e) {
575
+ c(`[nylas-notification] Warning: ${e.detail.title}`), this.handleNotification(e);
576
+ }
577
+ onInfo(e) {
578
+ c(`[nylas-notification] Info: ${e.detail.title}`), this.handleNotification(e);
579
+ }
580
+ onSuccess(e) {
581
+ c(`[nylas-notification] Success: ${e.detail.title}`), this.handleNotification(e);
582
+ }
583
+ handleNotification(e) {
584
+ if (e.defaultPrevented) {
585
+ c("[nylas-notification] Event default prevented");
586
+ return;
587
+ }
588
+ if (this.ttl === 0) {
589
+ c("[nylas-notification] TTL is 0");
590
+ return;
591
+ }
592
+ if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.category)) {
593
+ c("[nylas-notification] Category not allowed");
594
+ return;
595
+ }
596
+ if (this.notifications = [...this.notifications, { ...e.detail }], e.detail.ttl !== "none") {
597
+ const a = e.detail.ttl ? e.detail.ttl : this.ttl;
598
+ window.setTimeout(() => {
599
+ this.notifications = this.notifications.filter((n) => n.id !== e.detail.id);
600
+ }, a);
601
+ }
602
+ }
603
+ dismissNotification(e) {
604
+ this.notifications = this.notifications.filter((a) => a.id !== e);
605
+ }
606
+ render() {
607
+ return t(b, { key: "947c58f3617a73e55731cc6f6c03c1931008d000" }, t(X, { key: "d84045b56a35c322a194e4bf4c9d3982a5ce6d32" }, this.notifications.map((e) => t("div", { class: `notif ${e.type}`, key: e.id }, t("div", { class: "content" }, t("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && t("warning-icon", null)), t("span", { class: "message" }, t("span", { class: "title" }, e.title), e.description && t("span", { class: "description" }, e.description))), t("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, t("close-icon", null)))), t("slot", { key: "e246e847f46fe0d99370eb909cc89a3546186089" })));
608
+ }
609
+ };
610
+ _e.style = we;
611
+ const Ee = ":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:min(max(14px, 3vw), 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}}", Te = Ee;
612
+ var De = function(e, a, n, s) {
613
+ var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
614
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
615
+ i = Reflect.decorate(e, a, n, s);
616
+ else
617
+ for (var l = e.length - 1; l >= 0; l--)
618
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
619
+ return o > 3 && i && Object.defineProperty(a, n, i), i;
620
+ }, I = function(e, a) {
621
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
622
+ return Reflect.metadata(e, a);
623
+ };
624
+ const W = class {
625
+ constructor(e) {
626
+ f(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.startTime = "", this.endTime = "";
627
+ }
628
+ connectedCallback() {
629
+ }
630
+ disconnectedCallback() {
631
+ }
632
+ async componentWillLoad() {
633
+ c("[nylas-selected-event-card] Component will load");
634
+ }
635
+ async componentDidLoad() {
636
+ c("[nylas-selected-event-card] Component did load");
637
+ }
638
+ handleSelectedTimeslotChange(e) {
639
+ this.startTime = new Date(e == null ? void 0 : e.start_time).toLocaleString(void 0, { timeStyle: "short" }), this.endTime = new Date(e == null ? void 0 : e.end_time).toLocaleString(void 0, { timeStyle: "short" });
640
+ }
641
+ render() {
642
+ var e;
643
+ return t(b, { key: "1104fd2969ab03bb794c17bbf08f1600a200448c", part: "nsec" }, t("sp-theme", { key: "674934ecb54519d9e8c227a9946b9725518b77e5", theme: "spectrum", color: "dark", scale: "medium" }, t("div", { key: "4d492e825e93b93ff96af4970812178656de4ab8", class: "event-card", part: "nsec__card" }, t("div", { key: "239131412dab45da5b1f7bfe3b4a2eda45a2978b", class: "calendar-icon", part: "nsec__icon" }, t("calendar-icon", { key: "a2fa2f47b94a2c331d4cac88ef736faef3e30dae" })), t("div", { key: "81c873d5c2019b6ae1d8b746685dbe5efc2d7d0b", class: "nylas-selected-event-card__date", part: "nsec__date" }, (e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(void 0, { dateStyle: "full" })), t("div", { key: "67348e66fd879ead10594b216a2d66cf7da272aa", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), t("div", { key: "0fc6452dae7c5998a70d116c9bdfe25ab109661c", class: "event-timezone", part: "nsec__timezone" }, t("globe-icon", { key: "86c4a1e2728a30e34805a7c286378fe9adef110e" }), u[this.selectedTimezone])));
644
+ }
645
+ static get watchers() {
646
+ return {
647
+ selectedTimeslot: ["handleSelectedTimeslotChange"]
648
+ };
649
+ }
650
+ };
651
+ De([
652
+ h({
653
+ name: "nylas-selected-event-card",
654
+ stateToProps: /* @__PURE__ */ new Map([
655
+ ["scheduler.selectedDate", "selectedDate"],
656
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
657
+ ["scheduler.selectedTimezone", "selectedTimezone"]
658
+ ]),
659
+ eventToProps: {},
660
+ fireRegisterEvent: !0
661
+ }),
662
+ I("design:type", Function),
663
+ I("design:paramtypes", []),
664
+ I("design:returntype", void 0)
665
+ ], W.prototype, "render", null);
666
+ W.style = Te;
667
+ const ze = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .time-slot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}", Le = ze;
668
+ var Be = function(e, a, n, s) {
669
+ var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
670
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
671
+ i = Reflect.decorate(e, a, n, s);
672
+ else
673
+ for (var l = e.length - 1; l >= 0; l--)
674
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
675
+ return o > 3 && i && Object.defineProperty(a, n, i), i;
676
+ }, j = function(e, a) {
677
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
678
+ return Reflect.metadata(e, a);
679
+ };
680
+ const U = class {
681
+ constructor(e) {
682
+ f(this, e), this.timeslotSelected = d(this, "timeslotSelected", 7), this.timeslotConfirmed = d(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (a, n) => {
683
+ a.preventDefault(), c("[nylas-timeslot-picker] Confirm timeslot", n), this.timeslotConfirmed.emit(n);
684
+ }, this.handleMouseEnter = (a) => {
685
+ this.hoveredTimeslotIndex = a;
686
+ }, this.handleMouseLeave = () => {
687
+ this.hoveredTimeslotIndex = -1;
688
+ }, this.selectedDate = /* @__PURE__ */ new Date(), this.availability = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
689
+ }
690
+ connectedCallback() {
691
+ }
692
+ disconnectedCallback() {
693
+ }
694
+ async componentWillLoad() {
695
+ var a;
696
+ const e = (a = this.availability) == null ? void 0 : a.filter((n) => this.selectedDate && m(n.start_time, this.selectedDate)).map((n) => n);
697
+ this.times = e || [], c("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
698
+ }
699
+ async componentDidLoad() {
700
+ c("[nylas-timeslot-picker] Component did load");
701
+ }
702
+ getTimeslotId(e, a) {
703
+ return `${e.toLocaleDateString()}-${a}`;
704
+ }
705
+ onClickSelectTime(e, a) {
706
+ c("[nylas-timeslot-picker] Time selected", e, a), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, a), this.timeslotSelected.emit({
707
+ start_time: e.start_time,
708
+ end_time: e.end_time
709
+ });
710
+ }
711
+ getTimeSlotLabel(e) {
712
+ const a = new Intl.DateTimeFormat("en-US", {
713
+ hour: "numeric",
714
+ minute: "numeric",
715
+ timeZone: this.selectedTimezone
716
+ });
717
+ return `${a.format(e.start_time)} - ${a.format(e.end_time)}`;
718
+ }
719
+ selectedDateChanged(e) {
720
+ var a;
721
+ if (c("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
722
+ const n = (a = this.availability) == null ? void 0 : a.filter((s) => m(s.start_time, e)).map((s) => s);
723
+ this.times = n || [];
724
+ }
725
+ }
726
+ availabilityChanged(e) {
727
+ if (c("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
728
+ const a = e == null ? void 0 : e.filter((n) => this.selectedDate && m(n.start_time, this.selectedDate)).map((n) => n);
729
+ this.times = a || [];
730
+ }
731
+ }
732
+ render() {
733
+ return this.isLoading ? t(b, null, t("div", { class: "loading" }, new Array(6).fill(0).map((e, a) => t("div", { class: "time-slot-skeleton", style: { animationDelay: `${a * 20}ms` } })))) : this.availability && this.availability.length === 0 ? t(b, null, t("div", { class: "empty" }, t("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? t(b, null, t("div", { class: "empty" }, t("span", null, "No time slots available for selected date"))) : this.selectedDate ? t(b, { part: "ntp" }, t("div", { class: "time-picker-wrapper" }, t("div", { class: "time-slots" }, this.times.map((e, a) => {
734
+ var n, s, o, i;
735
+ return t("button", { part: `ntp__timeslot ${((s = (n = this.selectedTimeslot) == null ? void 0 : n.start_time) == null ? void 0 : s.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
736
+ time: !0,
737
+ selected: typeof this.selectedTimeslot < "u" && ((i = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : i.getTime()) === e.start_time.getTime()
738
+ }, onClick: () => this.onClickSelectTime(e, a), onMouseEnter: () => this.handleMouseEnter(a), onMouseLeave: () => this.handleMouseLeave() }, this.hoveredTimeslotIndex == a || this.selectedTimeslotIndex == this.getTimeslotId(e.start_time, a) ? this.getTimeSlotLabel(e) : e.start_time.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone }));
739
+ })), this.selectedTimeslot && t("div", { class: "footer" }, t("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, t("slot", { name: "timeslot-picker-cta-label" }, "Next"))))) : t(b, null);
740
+ }
741
+ static get watchers() {
742
+ return {
743
+ selectedDate: ["selectedDateChanged"],
744
+ availability: ["availabilityChanged"]
745
+ };
746
+ }
747
+ };
748
+ Be([
749
+ h({
750
+ name: "nylas-timeslot-picker",
751
+ stateToProps: /* @__PURE__ */ new Map([
752
+ ["scheduler.selectedDate", "selectedDate"],
753
+ ["scheduler.availability", "availability"],
754
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
755
+ ["scheduler.selectedTimezone", "selectedTimezone"],
756
+ ["scheduler.isLoading", "isLoading"]
757
+ ]),
758
+ eventToProps: {
759
+ timeslotSelected: async (e, a) => {
760
+ a.scheduler.selectTime(e.detail);
761
+ },
762
+ timeslotConfirmed: async (e, a) => {
763
+ e.detail && a.scheduler.toggleAdditionalData(!0);
764
+ }
765
+ },
766
+ fireRegisterEvent: !0
767
+ }),
768
+ j("design:type", Function),
769
+ j("design:paramtypes", []),
770
+ j("design:returntype", void 0)
771
+ ], U.prototype, "render", null);
772
+ U.style = Le;
773
+ export {
774
+ M as nylas_booked_event_card,
775
+ $ as nylas_booking_form,
776
+ H as nylas_cancel_booking_form,
777
+ Z as nylas_cancelled_event_card,
778
+ V as nylas_date_picker,
779
+ G as nylas_locale_switch,
780
+ xe as nylas_logo,
781
+ _e as nylas_notification,
782
+ W as nylas_selected_event_card,
783
+ U as nylas_timeslot_picker
784
+ };