@nylas/react 1.1.0-canary.5 → 1.1.0-canary.8

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 (108) hide show
  1. package/dist/add-circle-icon_22.entry-080abc71.cjs +1 -0
  2. package/dist/{add-circle-icon_22.entry-9f634efd.js → add-circle-icon_22.entry-bda9be31.js} +619 -532
  3. package/dist/{archive-icon_7.entry-6649ed76.cjs → archive-icon_7.entry-ca20da59.cjs} +1 -1
  4. package/dist/{archive-icon_7.entry-24bac466.js → archive-icon_7.entry-e2954750.js} +21 -21
  5. package/dist/arrow-icon.entry-03a85113.js +15 -0
  6. package/dist/{arrow-icon.entry-1fffd526.cjs → arrow-icon.entry-548b027e.cjs} +1 -1
  7. package/dist/{bold-icon_3.entry-72e585da.js → bold-icon_3.entry-70ffa7f0.js} +4 -4
  8. package/dist/{bold-icon_3.entry-5a01fecf.cjs → bold-icon_3.entry-9a7b1869.cjs} +1 -1
  9. package/dist/{calendar-cancel-icon.entry-0b52bdc9.cjs → calendar-cancel-icon.entry-45388fdc.cjs} +1 -1
  10. package/dist/{calendar-cancel-icon.entry-247b530c.js → calendar-cancel-icon.entry-6bbc119f.js} +5 -5
  11. package/dist/{calendar-check-icon_2.entry-d7bb76c7.cjs → calendar-check-icon_2.entry-6628456c.cjs} +1 -1
  12. package/dist/{calendar-check-icon_2.entry-dbb2df49.js → calendar-check-icon_2.entry-f633f7a6.js} +10 -10
  13. package/dist/{calendar-icon.entry-911773c4.cjs → calendar-icon.entry-379b1fa1.cjs} +1 -1
  14. package/dist/{calendar-icon.entry-d64cb3d3.js → calendar-icon.entry-62b82c27.js} +5 -5
  15. package/dist/{chevron-icon_3.entry-db9f8217.js → chevron-icon_3.entry-74425e1f.js} +11 -11
  16. package/dist/{chevron-icon_3.entry-b72f4cdb.cjs → chevron-icon_3.entry-7ff803ad.cjs} +1 -1
  17. package/dist/close-icon.entry-18e140ed.cjs +1 -0
  18. package/dist/close-icon.entry-6a8ea4a7.js +15 -0
  19. package/dist/{constants-6ee60d6d-d5928e79.js → constants-f34b9c6e-95a17764.js} +10 -1
  20. package/dist/{constants-6ee60d6d-09ee73d9.cjs → constants-f34b9c6e-e7137e51.cjs} +2 -2
  21. package/dist/{document-refresh-icon.entry-ee9632d7.js → document-refresh-icon.entry-32c75418.js} +2 -2
  22. package/dist/{document-refresh-icon.entry-5e8cc2f0.cjs → document-refresh-icon.entry-f15f795a.cjs} +1 -1
  23. package/dist/{elements-dc5b338e-29ef67ec.cjs → elements-dc5b338e-1f23530f.cjs} +1 -1
  24. package/dist/{elements-dc5b338e-e87f79b6.js → elements-dc5b338e-62fe1cf3.js} +1 -1
  25. package/dist/{focus-visible-e8093c16-e7357f74.js → focus-visible-e8093c16-1f664070.js} +1 -1
  26. package/dist/{focus-visible-e8093c16-61d506d2.cjs → focus-visible-e8093c16-f0f05815.cjs} +1 -1
  27. package/dist/{forward-icon_6.entry-f054ad9d.js → forward-icon_6.entry-7fab04d7.js} +9 -9
  28. package/dist/{forward-icon_6.entry-cac8473a.cjs → forward-icon_6.entry-ef5e2e0f.cjs} +2 -2
  29. package/dist/{globe-icon.entry-bc484551.cjs → globe-icon.entry-398a9826.cjs} +1 -1
  30. package/dist/{globe-icon.entry-2fde6ac4.js → globe-icon.entry-b8e1efae.js} +4 -4
  31. package/dist/google-logo-icon_4.entry-38d5c2f2.cjs +1 -0
  32. package/dist/google-logo-icon_4.entry-5eca9538.js +381 -0
  33. package/dist/{index-22f7e49c.cjs → index-93c50de4.cjs} +11 -11
  34. package/dist/{index-f9ba9aa8.js → index-f93f6948.js} +890 -855
  35. package/dist/{index.es-f57e612a-1d17c676.js → index.es-df564f87-b773d34f.js} +1 -1
  36. package/dist/{index.es-f57e612a-95ca3e17.cjs → index.es-df564f87-e4a4092a.cjs} +1 -1
  37. package/dist/{info-icon_2.entry-e67844eb.cjs → info-icon_2.entry-2eb70f49.cjs} +1 -1
  38. package/dist/{info-icon_2.entry-dbf3931a.js → info-icon_2.entry-6bbfa6dc.js} +5 -5
  39. package/dist/loading-icon.entry-b563b2e6.js +15 -0
  40. package/dist/loading-icon.entry-fb04b893.cjs +1 -0
  41. package/dist/{mailbox-store-47fc8a1a-cd3516a7.cjs → mailbox-store-69c5c5f6-631eddb5.cjs} +1 -1
  42. package/dist/{mailbox-store-47fc8a1a-2365f20f.js → mailbox-store-69c5c5f6-8ab4670b.js} +2 -2
  43. package/dist/{nylas-additional-participants.entry-7c568149.cjs → nylas-additional-participants.entry-33a45477.cjs} +1 -1
  44. package/dist/{nylas-additional-participants.entry-e8426256.js → nylas-additional-participants.entry-4b214308.js} +9 -9
  45. package/dist/{nylas-booked-event-card_10.entry-6a664889.cjs → nylas-booked-event-card_10.entry-3e225025.cjs} +1 -1
  46. package/dist/{nylas-booked-event-card_10.entry-ef767733.js → nylas-booked-event-card_10.entry-e93bc290.js} +7 -7
  47. package/dist/{nylas-form-card.entry-d8506b1f.js → nylas-form-card.entry-0748fdd5.js} +16 -16
  48. package/dist/{nylas-form-card.entry-e44169b6.cjs → nylas-form-card.entry-eb3607bc.cjs} +1 -1
  49. package/dist/{nylas-if-state.entry-044c49d2.cjs → nylas-if-state.entry-276d61ad.cjs} +1 -1
  50. package/dist/{nylas-if-state.entry-98a336df.js → nylas-if-state.entry-f8abd025.js} +2 -2
  51. package/dist/{nylas-list-folders.entry-55ce3403.js → nylas-list-folders.entry-78cc680e.js} +3 -3
  52. package/dist/{nylas-list-folders.entry-509f9be4.cjs → nylas-list-folders.entry-afe02f0e.cjs} +1 -1
  53. package/dist/{nylas-list-threads.entry-1f57382a.js → nylas-list-threads.entry-217088de.js} +4 -4
  54. package/dist/{nylas-list-threads.entry-c36e2cf3.cjs → nylas-list-threads.entry-6395c12f.cjs} +1 -1
  55. package/dist/{nylas-login.entry-76358c2f.js → nylas-login.entry-e4d57589.js} +7 -7
  56. package/dist/{nylas-login.entry-66f542b8.cjs → nylas-login.entry-ec81e21b.cjs} +1 -1
  57. package/dist/{nylas-mailbox-pagination.entry-5562257a.js → nylas-mailbox-pagination.entry-069673aa.js} +2 -2
  58. package/dist/{nylas-mailbox-pagination.entry-89b0dd99.cjs → nylas-mailbox-pagination.entry-d4d929f1.cjs} +1 -1
  59. package/dist/{nylas-mailbox-toolbar-button.entry-6b1b5b15.js → nylas-mailbox-toolbar-button.entry-03c5f5c8.js} +8 -8
  60. package/dist/{nylas-mailbox-toolbar-button.entry-573e0429.cjs → nylas-mailbox-toolbar-button.entry-2b9e4431.cjs} +1 -1
  61. package/dist/{nylas-mailbox.entry-e21a2f50.cjs → nylas-mailbox.entry-1342178d.cjs} +1 -1
  62. package/dist/{nylas-mailbox.entry-97c503f2.js → nylas-mailbox.entry-7e6b4791.js} +4 -4
  63. package/dist/{nylas-provider.entry-61899957.cjs → nylas-provider.entry-0ae8e70a.cjs} +1 -1
  64. package/dist/{nylas-provider.entry-07e1e26a.js → nylas-provider.entry-498a7be9.js} +16 -16
  65. package/dist/{nylas-scheduler-editor.entry-e326c9de.js → nylas-scheduler-editor.entry-4de2bb97.js} +66 -66
  66. package/dist/{nylas-scheduler-editor.entry-60fe38ce.cjs → nylas-scheduler-editor.entry-72c91b7d.cjs} +3 -3
  67. package/dist/{nylas-scheduling.entry-d88289db.cjs → nylas-scheduling.entry-1a004916.cjs} +1 -1
  68. package/dist/{nylas-scheduling.entry-be0cc090.js → nylas-scheduling.entry-4e18ab43.js} +3 -3
  69. package/dist/{nylas-threads-refresh.entry-c71ee775.cjs → nylas-threads-refresh.entry-d020c89e.cjs} +1 -1
  70. package/dist/{nylas-threads-refresh.entry-8201f8dd.js → nylas-threads-refresh.entry-fc2d8028.js} +11 -11
  71. package/dist/{nylas-threads-search.entry-912a90a4.cjs → nylas-threads-search.entry-0abcbc10.cjs} +1 -1
  72. package/dist/{nylas-threads-search.entry-fc477e01.js → nylas-threads-search.entry-f92f7e30.js} +12 -12
  73. package/dist/{nylas-view-thread.entry-d2953ea8.js → nylas-view-thread.entry-2f1474cf.js} +6 -6
  74. package/dist/{nylas-view-thread.entry-af418ddb.cjs → nylas-view-thread.entry-56080c89.cjs} +1 -1
  75. package/dist/{people-icon.entry-73cfa6f5.cjs → people-icon.entry-431e5044.cjs} +1 -1
  76. package/dist/{people-icon.entry-4b598fde.js → people-icon.entry-b4778e15.js} +7 -7
  77. package/dist/{play-icon_2.entry-d1c2f823.js → play-icon_2.entry-24ffa01f.js} +8 -8
  78. package/dist/play-icon_2.entry-f97db395.cjs +1 -0
  79. package/dist/react.cjs +1 -1
  80. package/dist/react.js +11 -11
  81. package/dist/{refresh-icon.entry-6aedfce6.js → refresh-icon.entry-8395104b.js} +4 -4
  82. package/dist/{refresh-icon.entry-42d543d0.cjs → refresh-icon.entry-cf4416b8.cjs} +1 -1
  83. package/dist/{register-component-cf5c8420-dc1bc0a4.js → register-component-b9cfcbaf-c0147194.js} +1 -1
  84. package/dist/{register-component-cf5c8420-d3fb6bf9.cjs → register-component-b9cfcbaf-d40e1f3c.cjs} +1 -1
  85. package/dist/scheduler-config-store-07d98279-0610e42f.cjs +1 -0
  86. package/dist/scheduler-config-store-07d98279-3b70606c.js +24 -0
  87. package/dist/scheduler-store-24fd0e91-2dba20c2.cjs +1 -0
  88. package/dist/{scheduler-store-39d37291-4e8e9ff9.js → scheduler-store-24fd0e91-47098841.js} +89 -80
  89. package/dist/{time-period-selector.entry-f1e27a00.js → time-period-selector.entry-1e849c2e.js} +2 -2
  90. package/dist/{time-period-selector.entry-fb3d0178.cjs → time-period-selector.entry-d8f3462f.cjs} +1 -1
  91. package/dist/{translate-icon.entry-0d44b6cb.cjs → translate-icon.entry-66533238.cjs} +1 -1
  92. package/dist/{translate-icon.entry-3db947f5.js → translate-icon.entry-d847f706.js} +5 -5
  93. package/dist/{warning-icon.entry-a20657e4.cjs → warning-icon.entry-1f0f00ed.cjs} +1 -1
  94. package/dist/warning-icon.entry-b5db0151.js +15 -0
  95. package/package.json +3 -3
  96. package/dist/add-circle-icon_22.entry-e7ec6c34.cjs +0 -1
  97. package/dist/arrow-icon.entry-82e59ce4.js +0 -15
  98. package/dist/close-icon.entry-9d141bb4.js +0 -15
  99. package/dist/close-icon.entry-da590fa2.cjs +0 -1
  100. package/dist/google-logo-icon_4.entry-a9848399.cjs +0 -1
  101. package/dist/google-logo-icon_4.entry-dca87e45.js +0 -349
  102. package/dist/loading-icon.entry-4566cba8.cjs +0 -1
  103. package/dist/loading-icon.entry-ae4c2d7e.js +0 -15
  104. package/dist/play-icon_2.entry-1a487abb.cjs +0 -1
  105. package/dist/scheduler-config-store-6222c0ed-000f1a4f.js +0 -18
  106. package/dist/scheduler-config-store-6222c0ed-758621fb.cjs +0 -1
  107. package/dist/scheduler-store-39d37291-b66c052c.cjs +0 -1
  108. package/dist/warning-icon.entry-a8ea0fe0.js +0 -15
@@ -1,349 +0,0 @@
1
- import { r as S, h as t, c as y, d, s as V, H as N, g as U } from "./index-f9ba9aa8.js";
2
- import { R as A } from "./register-component-cf5c8420-dc1bc0a4.js";
3
- import "react";
4
- import "react-dom";
5
- const W = ".sc-google-logo-icon-h{display:flex}", G = W, J = class {
6
- constructor(a) {
7
- S(this, a), this.width = "24", this.height = "24";
8
- }
9
- render() {
10
- return t("svg", { key: "e71880e55c9352a0e1ee2ad058727601f35e3ce4", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("g", { key: "7fec6b17669641c93baae51ca32571112071fef7", "clip-path": "url(#clip0_959_12452)" }, t("path", { key: "dc78e953321de09b2eb1a617d36757840fa3bc77", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), t("path", { key: "fd3fa31399c0daddb0666b5e5bfa22df37d707ed", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), t("path", { key: "ba6682324108438a8d09fd8c2f485fd902ac7d1e", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), t("path", { key: "8f343c03d1881b1db41b2f259c58b0ad37256909", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), t("defs", { key: "d139b2306583164474093240ab884fddbe240f16" }, t("clipPath", { key: "d54b7ab509f646be7407b61c0e6b49765f5325d7", id: "clip0_959_12452" }, t("rect", { key: "ac9a24a627127c049b291447ce1198424416f4ae", width: 24, height: 24, fill: "white" }))));
11
- }
12
- };
13
- J.style = G;
14
- const $ = ".sc-microsoft-logo-icon-h{display:flex}", q = $, K = class {
15
- constructor(a) {
16
- S(this, a), this.width = "22", this.height = "22";
17
- }
18
- render() {
19
- return t("svg", { key: "48516ac28c70d446ba44e3b65252920c4e8d3b06", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "29c0f58e11eb99e946fd2dcb33ef603620305d9d", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), t("path", { key: "6b5303ad19e48b6c0ad9842ee748dc7db17e2a68", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), t("path", { key: "278ce5362ac072c57040ad1bf944557f71809b5f", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), t("path", { key: "9c2b9b9c87a902dd80cae38db0c46c94435903c2", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
20
- }
21
- };
22
- K.style = q;
23
- function Q({ id: a, formState: e, activeTab: n, calendars: s }) {
24
- var o, i;
25
- switch (n) {
26
- case "eventInfo":
27
- const r = e.title, c = e.description, f = parseInt(e.duration), u = e.location;
28
- return t(
29
- "div",
30
- { key: a },
31
- t(
32
- "nylas-event-info",
33
- null,
34
- t(
35
- "div",
36
- { slot: "inputs" },
37
- t("nylas-event-title", { name: "title", eventTitle: r, exportparts: "net, net__title, net__dropdown-content" }),
38
- t("nylas-event-duration", { name: "duration", eventDurationMinutes: f, exportparts: "ned, ned__input, ned__dropdown, ned__dropdown-button, ned__dropdown-content" }),
39
- t("nylas-location-component", { name: "location", eventLocation: u, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
40
- t("nylas-event-description", { name: "description", eventDescription: c, exportparts: "nedesc, nedesc__textarea" })
41
- )
42
- )
43
- );
44
- case "availability":
45
- const b = e.availability, g = ((o = b == null ? void 0 : b[0]) == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone, h = (i = e.participants) == null ? void 0 : i.find((p) => p.is_organizer), l = (h == null ? void 0 : h.email) ?? "primary", m = e.calendarIds.length > 0 ? e.calendarIds : [l], v = e.bookingCalendar == "primary" ? l : e.bookingCalendar;
46
- return t(
47
- "div",
48
- { key: a },
49
- t("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: s ?? [], defaultBookingCalendar: v, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
50
- t("nylas-calendar-picker", { name: "calendars", calendars: s ?? [], defaultSelectedCalendars: m, organizerEmail: l, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
51
- t("nylas-availability-picker", { name: "availability", openHours: b, defaultTimezone: g, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
52
- );
53
- case "bookingOptions":
54
- return t(
55
- "div",
56
- { key: a },
57
- a == "new" && t("p", null, "Config"),
58
- t("nylas-buffer-time", { name: "buffer-time", buffer: e.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
59
- t("nylas-custom-booking-flow", { name: "booking-type", bookingType: e.bookingType, exportparts: "ncbf, ncbf__header, ncbf__dropdown, ncbf__dropdown-button, ncbf__dropdown-content" }),
60
- t(
61
- "nylas-event-limits",
62
- null,
63
- t(
64
- "div",
65
- { slot: "inputs" },
66
- t("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: e.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
67
- t("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: e.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" })
68
- )
69
- )
70
- );
71
- }
72
- }
73
- const X = '.sc-nylas-editor-tabs-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs .unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs .saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', Y = X;
74
- var ee = function(a, e, n, s) {
75
- var o = arguments.length, i = o < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, n) : s, r;
76
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
77
- i = Reflect.decorate(a, e, n, s);
78
- else
79
- for (var c = a.length - 1; c >= 0; c--)
80
- (r = a[c]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, n, i) : r(e, n)) || i);
81
- return o > 3 && i && Object.defineProperty(e, n, i), i;
82
- }, L = function(a, e) {
83
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
84
- return Reflect.metadata(a, e);
85
- };
86
- const Z = class {
87
- constructor(a) {
88
- S(this, a), this.schedulerConfigChanged = y(this, "schedulerConfigChanged", 7), this.cancelButtonClick = y(this, "cancelButtonClick", 7), this.previewButtonClicked = y(this, "previewButtonClicked", 7), this.formSubmissionHandler = async (e) => {
89
- var p, _, k, w, C, x, B, D, H, I, F, P, R, j, E, M;
90
- e.preventDefault(), this.isLoading = !0, this.hasUnsavedChanges = !1, this.updateFormState();
91
- const { title: n, description: s, duration: o, availability: i, calendarIds: r, bookingCalendar: c, location: f, bookingType: u, buffer: b, availableDaysInFuture: g, minCancellationNotice: h } = this.formState, l = (_ = (p = this.config) == null ? void 0 : p.participants) == null ? void 0 : _.find((O) => O.is_organizer), m = {
92
- ...((k = this.config) == null ? void 0 : k.id) && { id: this.config.id },
93
- version: ((w = this.config) == null ? void 0 : w.version) ?? "1.0.0",
94
- availability: {
95
- duration_minutes: o ? parseInt(o) : 0,
96
- availability_rules: {
97
- availability_method: ((B = (x = (C = this.config) == null ? void 0 : C.availability) == null ? void 0 : x.availability_rules) == null ? void 0 : B.availability_method) ?? "collective",
98
- buffer: b || { before: 0, after: 0 },
99
- default_open_hours: ((I = (H = (D = this.config) == null ? void 0 : D.availability) == null ? void 0 : H.availability_rules) == null ? void 0 : I.default_open_hours) ?? [],
100
- round_robin_group_id: ((R = (P = (F = this.config) == null ? void 0 : F.availability) == null ? void 0 : P.availability_rules) == null ? void 0 : R.round_robin_group_id) ?? ""
101
- }
102
- },
103
- participants: [
104
- {
105
- name: (l == null ? void 0 : l.name) ?? (l == null ? void 0 : l.email) ?? ((j = this.currentUser) == null ? void 0 : j.name) ?? ((E = this.currentUser) == null ? void 0 : E.email) ?? "",
106
- email: (l == null ? void 0 : l.email) ?? ((M = this.currentUser) == null ? void 0 : M.email) ?? "",
107
- is_organizer: !0,
108
- availability: {
109
- calendar_ids: r != null && r.length ? r : ["primary"],
110
- open_hours: i ?? []
111
- },
112
- booking: {
113
- calendar_id: c && c !== "" ? c : "primary"
114
- }
115
- }
116
- ],
117
- event_booking: {
118
- title: (n == null ? void 0 : n.toString()) ?? "",
119
- description: (s == null ? void 0 : s.toString()) ?? "",
120
- location: (f == null ? void 0 : f.toString()) ?? "",
121
- booking_type: (u == null ? void 0 : u.toString()) ?? "booking"
122
- },
123
- scheduler: {
124
- available_days_in_future: g ?? 30,
125
- min_cancellation_notice: h ?? 0
126
- }
127
- }, v = (O) => {
128
- this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
129
- this.changesSaved = !1;
130
- }, 5e3);
131
- };
132
- this.schedulerConfigChanged.emit({ config: m, resetLoadingState: v, action: this.action });
133
- }, this.calendars = void 0, this.config = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {};
134
- }
135
- configChangedHandler(a) {
136
- d("[nylas-editor-tabs]", "configChangedHandler", a, this.config), this.formState = {
137
- ...this.getFormStateFromConfig(a)
138
- }, a.id ? this.action = "edit" : this.action = "create";
139
- }
140
- connectedCallback() {
141
- d("[nylas-editor-tabs]", "connectedCallback");
142
- }
143
- componentWillLoad() {
144
- d("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.config);
145
- }
146
- componentDidLoad() {
147
- d("[nylas-editor-tabs]", "componentDidLoad");
148
- }
149
- disconnectedCallback() {
150
- d("[nylas-editor-tabs]", "disconnectedCallback");
151
- }
152
- handleValueChanged(a) {
153
- d("[nylas-editor-tabs]", "handleValueChanged", a), this.formState = { ...this.formState, [a.detail.name]: a.detail.value }, this.hasUnsavedChanges = !0;
154
- }
155
- getFormStateFromConfig(a) {
156
- var n, s, o, i, r, c, f, u, b, g, h, l, m, v, p, _, k, w, C;
157
- const e = (n = a == null ? void 0 : a.participants) == null ? void 0 : n.find((x) => x.is_organizer);
158
- return {
159
- title: ((s = a == null ? void 0 : a.event_booking) == null ? void 0 : s.title) ?? "",
160
- description: ((o = a == null ? void 0 : a.event_booking) == null ? void 0 : o.description) ?? "",
161
- duration: ((r = (i = a == null ? void 0 : a.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : r.toString()) ?? "10",
162
- availability: ((c = e == null ? void 0 : e.availability) == null ? void 0 : c.open_hours) ?? void 0,
163
- calendarIds: ((f = e == null ? void 0 : e.availability) == null ? void 0 : f.calendar_ids) ?? [],
164
- participants: (a == null ? void 0 : a.participants) ?? [],
165
- bookingCalendar: ((u = e == null ? void 0 : e.booking) == null ? void 0 : u.calendar_id) ?? (e == null ? void 0 : e.email) ?? "",
166
- location: ((g = (b = this.config) == null ? void 0 : b.event_booking) == null ? void 0 : g.location) ?? "",
167
- bookingType: ((l = (h = this.config) == null ? void 0 : h.event_booking) == null ? void 0 : l.booking_type) ?? "booking",
168
- buffer: ((p = (v = (m = this.config) == null ? void 0 : m.availability) == null ? void 0 : v.availability_rules) == null ? void 0 : p.buffer) ?? { before: 0, after: 0 },
169
- availableDaysInFuture: ((k = (_ = this.config) == null ? void 0 : _.scheduler) == null ? void 0 : k.available_days_in_future) ?? 30,
170
- minCancellationNotice: ((C = (w = this.config) == null ? void 0 : w.scheduler) == null ? void 0 : C.min_cancellation_notice) ?? 0
171
- };
172
- }
173
- updateFormState() {
174
- new FormData(this.formRef).forEach((e, n) => {
175
- switch (n) {
176
- case "title":
177
- this.formState.title = e.toString();
178
- break;
179
- case "description":
180
- this.formState.description = e.toString();
181
- break;
182
- case "duration":
183
- this.formState.duration = e.toString();
184
- break;
185
- case "availability":
186
- this.formState.availability = JSON.parse(e.toString());
187
- break;
188
- case "participants":
189
- this.formState.participants = JSON.parse(e.toString());
190
- break;
191
- case "calendars":
192
- this.formState.calendarIds = e.toString().split(",");
193
- break;
194
- case "booking-calendar":
195
- this.formState.bookingCalendar = e.toString();
196
- break;
197
- case "location":
198
- this.formState.location = e.toString();
199
- break;
200
- case "booking-type":
201
- this.formState.bookingType = e.toString();
202
- break;
203
- case "buffer-time":
204
- this.formState.buffer = JSON.parse(e.toString());
205
- break;
206
- case "limit-future-bookings":
207
- this.formState.availableDaysInFuture = parseInt(e.toString());
208
- break;
209
- case "min-cancellation-notice":
210
- this.formState.minCancellationNotice = parseInt(e.toString());
211
- break;
212
- }
213
- }), this.formState = { ...this.formState };
214
- }
215
- setActiveTab(a, e) {
216
- a.preventDefault(), this.updateFormState(), this.activeTab = e;
217
- }
218
- render() {
219
- var a;
220
- return d("[nylas-editor-tabs]", "render", this.formState), t(N, { key: "5a1e8ee246d47626dce5515c3ec4df3e6ae893a4" }, t("form", { key: "f49d1fa60f2724c5cae8c1328dfee945ae24f1e2", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (e) => this.formRef = e }, t("div", { key: "f0b678836e12c3878128e4b810e5541f00ddee29", class: "form-contents" }, t("div", { key: "910dc155a6b7b01e300084fe405da0d0b0801847", class: "tabs" }, t("button", { key: "80ca54ac98ae0d3b2298ae62253ffcb9d3ae539d", class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (e) => this.setActiveTab(e, "eventInfo") }, t("calendar-info-icon", { key: "842e45f308921afa7948f8408b84f95d7b802850", width: "16", height: "16" }), "Event Info"), t("button", { key: "7b79207240cbae5dcd554d448f68dc544f2e6c80", class: { tab: !0, active: this.activeTab == "availability" }, onClick: (e) => this.setActiveTab(e, "availability") }, t("calendar-patterns-icon", { key: "47b3d8cf7ee50eac7d377ab3faf35c27f1215e96", width: "16", height: "16" }), "Availability"), t("button", { key: "ffb175caa6ccc4ba377ee4947759d0561ebb089b", class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (e) => this.setActiveTab(e, "bookingOptions") }, t("flow-icon", { key: "fc3bec08bd5080e7b2ec7816bb3c021876c20d7c", width: "16", height: "16" }), "Booking Options")), t("div", { key: "80802e1388eb767bcea718907e75d5b4a2de3701", class: "tab-content" }, t(Q, { key: "5c5618341227447d2a41061f415e54d83efc354a", formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((a = this.config) == null ? void 0 : a.id) ?? "new" }))), t("div", { key: "d315bad7ea2efe6699557a5e07b55053926a7517", class: "footer" }, t("div", { key: "4c92a480ee6d2f04d9fa36f3e870d414835406e1", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && t("button-component", { type: "button", disabled: this.isLoading, clickHandler: (e) => {
221
- e.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(V(this.schedulerPreviewLink, this.config), "_blank");
222
- }, variant: "basic" }, "Preview")), t("div", { key: "22fdd2183dcc2c299d2fdacf0db8922a95a5692e", class: "buttons" }, t("p", { key: "63ea7b4d8362f409caec467a7bce22142ccc1b20", class: {
223
- "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
224
- "saved-changes": this.changesSaved
225
- } }, this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.changesSaved ? "Changes saved!" : ""), t("button-component", { key: "6ceded872ee5510234ff79bff3f0173a72314714", type: "button", disabled: this.isLoading, clickHandler: (e) => {
226
- e.preventDefault(), this.cancelButtonClick.emit();
227
- }, variant: "basic" }, "Cancel"), t("button-component", { key: "4f33ad6071f503837395d900b67fafc8605d8043", type: "submit", disabled: this.isLoading }, this.isLoading ? t("span", null, "Saving", t("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
228
- }
229
- get host() {
230
- return U(this);
231
- }
232
- static get watchers() {
233
- return {
234
- config: ["configChangedHandler"]
235
- };
236
- }
237
- };
238
- ee([
239
- A({
240
- name: "nylas-editor-tabs",
241
- stateToProps: /* @__PURE__ */ new Map([
242
- ["schedulerConfig.calendars", "calendars"],
243
- ["schedulerConfig.config", "config"],
244
- ["schedulerConfig.currentUser", "currentUser"]
245
- ]),
246
- eventToProps: {
247
- schedulerConfigChanged: async (a, e) => {
248
- const { resetLoadingState: n, action: s, config: o } = a.detail;
249
- n && n(a), s === "edit" ? await e.schedulerConfig.updateConfiguration(o) : await e.schedulerConfig.createConfiguration(o);
250
- },
251
- cancelButtonClick: async (a, e) => {
252
- e.schedulerConfigStore.state.action = null;
253
- }
254
- },
255
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
256
- fireRegisterEvent: !0
257
- }),
258
- L("design:type", Function),
259
- L("design:paramtypes", []),
260
- L("design:returntype", void 0)
261
- ], Z.prototype, "render", null);
262
- Z.style = Y;
263
- const te = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900)}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.configurations table{width:100%;border-spacing:0;border-collapse:collapse}.configurations table tr{border-bottom:1px solid var(--nylas-base-200)}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}', ae = te;
264
- var ne = function(a, e, n, s) {
265
- var o = arguments.length, i = o < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, n) : s, r;
266
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
267
- i = Reflect.decorate(a, e, n, s);
268
- else
269
- for (var c = a.length - 1; c >= 0; c--)
270
- (r = a[c]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, n, i) : r(e, n)) || i);
271
- return o > 3 && i && Object.defineProperty(e, n, i), i;
272
- }, T = function(a, e) {
273
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
274
- return Reflect.metadata(a, e);
275
- };
276
- const z = class {
277
- constructor(a) {
278
- S(this, a), this.initListConfigurations = y(this, "initListConfigurations", 7), this.createButtonClick = y(this, "createButtonClick", 7), this.editButtonClick = y(this, "editButtonClick", 7), this.deleteButtonClick = y(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading";
279
- }
280
- connectedCallback() {
281
- d("[nylas-list-configurations]", "connectedCallback");
282
- }
283
- componentWillLoad() {
284
- d("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
285
- }
286
- componentDidLoad() {
287
- d("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
288
- }
289
- disconnectedCallback() {
290
- d("[nylas-list-configurations]", "disconnectedCallback");
291
- }
292
- async getState() {
293
- return this.state;
294
- }
295
- async setState(a) {
296
- this.state = a;
297
- }
298
- render() {
299
- return t(N, { key: "c6579bd33e43be81caa460d87e99ed53f8123c6a" }, t("div", { key: "d3ff4fc25e34a2dab3820b774f52a845c37bb282", class: "nylas-list-configurations" }, t("div", { key: "fc6ff138be7cf63196217b7ef7524ae8f0a82c5c", class: "header" }, t("div", { key: "a518d44c645bfc5d5e8449119ebc4be7c475a5f3", class: "description" }, t("h2", { key: "a9d999a93c26ee3d9040dcae09306ecb7da43fb5" }, "All scheduling configurations"), t("p", { key: "6361799617ce1ccf7469cce6a0064d94d97701b0" }, "Create, edit and manage all your scheduling configurations.")), this.configurations && this.configurations.length > 0 && t("div", { class: "actions" }, t("button-component", { clickHandler: () => {
300
- this.createButtonClick.emit(this.host);
301
- } }, "Create new"))), t("div", { key: "3f26491b35427c4364bcc1c5e1cbffdfabd52d37", class: "configurations" }, t("table", { key: "ca8bf13b620b92cd4892b8dbf218988915ce4fc0" }, t("tr", { key: "09526ab48bbc988b0595f8060a184c340f1d43cc" }, t("th", { key: "7367e03d461f854eaf84e166d65471d356f44ee5" }, "Configuration event title"), t("th", { key: "f983dcae11fdd33e21f0f202eb9b43a7d409b714" }, "Duration"), t("th", { key: "828c60e134498a1db8bd31ce0311bb8a771cb435", class: "actions" }, "Actions")), this.state === "loading" && t("tr", { class: "no-configurations" }, t("td", { colSpan: 3 }, t("div", null, t("h3", null, "Loading..."), t("p", null, "Please wait while we fetch your configurations")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && t("tr", { class: "no-configurations" }, t("td", { colSpan: 3 }, t("div", null, t("calendar-icon", { width: "48", height: "48" }), t("h3", null, "No configurations found"), t("p", null, "Get started with creating your first scheduling page"), t("button-component", { clickHandler: () => {
302
- this.createButtonClick.emit(this.host);
303
- } }, "Create new")))), this.state !== "loading" && this.configurations.map((a) => t("tr", { key: a.id }, t("td", null, t("div", { class: "title" }, t("span", { class: "config-event-title" }, a.event_booking.title), t("span", { class: "config-event-description" }, a.event_booking.description))), t("td", null, t("div", null, a.availability.duration_minutes, " mins")), t("td", null, t("div", { class: "actions" }, t("button-component", { variant: "basic", clickHandler: (e) => {
304
- e.preventDefault(), window.open(V(this.schedulerPreviewLink, a), "_blank");
305
- } }, "Preview"), t("button-component", { variant: "basic", clickHandler: (e) => {
306
- e.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: a });
307
- } }, "Edit"), t("button-component", { variant: "basic", clickHandler: (e) => {
308
- e.preventDefault(), this.deleteButtonClick.emit({ host: this.host, configuration: a });
309
- } }, "Delete")))))))));
310
- }
311
- get host() {
312
- return U(this);
313
- }
314
- };
315
- ne([
316
- A({
317
- name: "nylas-list-configurations",
318
- stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
319
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
320
- eventToProps: {
321
- initListConfigurations: async (a, e) => {
322
- const n = a.detail;
323
- await n.setState("loading"), await e.schedulerConfig.getConfigurations(), await n.setState("loaded");
324
- },
325
- createButtonClick: async (a, e) => {
326
- e.schedulerConfigStore.state.config = {}, e.schedulerConfigStore.state.action = "create";
327
- },
328
- deleteButtonClick: async (a, e) => {
329
- const { configuration: n } = a.detail;
330
- await e.schedulerConfig.deleteConfiguration(n.id);
331
- },
332
- editButtonClick: async (a, e) => {
333
- const { configuration: n } = a.detail;
334
- e.schedulerConfigStore.state.config = n, e.schedulerConfigStore.state.action = "edit";
335
- }
336
- },
337
- fireRegisterEvent: !0
338
- }),
339
- T("design:type", Function),
340
- T("design:paramtypes", []),
341
- T("design:returntype", void 0)
342
- ], z.prototype, "render", null);
343
- z.style = ae;
344
- export {
345
- J as google_logo_icon,
346
- K as microsoft_logo_icon,
347
- Z as nylas_editor_tabs,
348
- z as nylas_list_configurations
349
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-22f7e49c.cjs");require("react");require("react-dom");const i=".wave{display:flex;align-items:center;justify-content:center}.dot{width:4px;height:4px;background-color:var(--dot-color, white);border-radius:50%;margin:0 2px;animation:wave 1.5s infinite ease-in-out}.dot:nth-child(2){animation-delay:0.2s}.dot:nth-child(3){animation-delay:0.4s}@keyframes wave{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}",d=i,a=class{constructor(t){e.registerInstance(this,t),this.width="15",this.height="15"}render(){return e.h("div",{key:"1ddcaec1e417a1f64df06138748153db8d32ef74",class:"wave"},e.h("div",{key:"848a317b57795f32569c4dab2a20c674f1c9cdd2",class:"dot"}),e.h("div",{key:"188f062fbbdef8c0a055624509ea47e8b3a18931",class:"dot"}),e.h("div",{key:"87aab825d2a0aca992d162d98ea84a325058b775",class:"dot"}))}};a.style=d;exports.loading_icon=a;
@@ -1,15 +0,0 @@
1
- import { r as e, h as a } from "./index-f9ba9aa8.js";
2
- import "react";
3
- import "react-dom";
4
- const i = ".wave{display:flex;align-items:center;justify-content:center}.dot{width:4px;height:4px;background-color:var(--dot-color, white);border-radius:50%;margin:0 2px;animation:wave 1.5s infinite ease-in-out}.dot:nth-child(2){animation-delay:0.2s}.dot:nth-child(3){animation-delay:0.4s}@keyframes wave{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}", d = i, n = class {
5
- constructor(t) {
6
- e(this, t), this.width = "15", this.height = "15";
7
- }
8
- render() {
9
- return a("div", { key: "1ddcaec1e417a1f64df06138748153db8d32ef74", class: "wave" }, a("div", { key: "848a317b57795f32569c4dab2a20c674f1c9cdd2", class: "dot" }), a("div", { key: "188f062fbbdef8c0a055624509ea47e8b3a18931", class: "dot" }), a("div", { key: "87aab825d2a0aca992d162d98ea84a325058b775", class: "dot" }));
10
- }
11
- };
12
- n.style = d;
13
- export {
14
- n as loading_icon
15
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-22f7e49c.cjs");require("react");require("react-dom");const o=".sc-play-icon-h{display:flex}",n=o,s=class{constructor(e){t.registerInstance(this,e),this.width="15",this.height="15"}render(){return t.h("svg",{key:"158d7ff5602edfbc5504f726ba391828ed3fcc0a",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"2a4e305d65f7f71dc7bb8227a97fd990ebfd3095",d:"M21 12L3 21V3L21 12Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};s.style=n;const h=".sc-stop-icon-h{display:flex}",r=h,i=class{constructor(e){t.registerInstance(this,e),this.width="15",this.height="15"}render(){return t.h("svg",{key:"29ab924a173c55e12e79b0e616c0564d18116302",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"7b83a1444fef0003787c7f556d5805c9a8f3924d",d:"M4 4H20V20H4V4Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};i.style=r;exports.play_icon=s;exports.stop_icon=i;
@@ -1,18 +0,0 @@
1
- import { e as r } from "./index-f9ba9aa8.js";
2
- function s(t = {}) {
3
- const n = {
4
- config: {},
5
- configurations: [],
6
- calendars: [],
7
- currentUser: null,
8
- action: null,
9
- defaultRequiresSessionAuth: !0,
10
- ...t
11
- }, e = r(n);
12
- return e.onChange("action", async (o) => {
13
- o || e.set("config", {});
14
- }), e;
15
- }
16
- export {
17
- s as C
18
- };
@@ -1 +0,0 @@
1
- "use strict";const o=require("./index-22f7e49c.cjs");function c(t={}){const n={config:{},configurations:[],calendars:[],currentUser:null,action:null,defaultRequiresSessionAuth:!0,...t},e=o.createStore(n);return e.onChange("action",async r=>{r||e.set("config",{})}),e}exports.CreateNylasSchedulerConfigStore=c;
@@ -1 +0,0 @@
1
- "use strict";const S=require("./index-22f7e49c.cjs");exports.ErrorCategory=void 0;(function(n){n.Component="component",n.Api="api",n.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var w;(function(n){n.endtime_not_in_future="endtime_not_in_future",n.no_booking_info="no_booking_info",n.no_timeslot_selected="no_timeslot_selected",n.no_booking_id="no_booking_id",n.invalid_start_time="invalid_start_time",n.invalid_end_time="invalid_end_time",n.invalid_timezone="invalid_timezone"})(w||(w={}));var I;(function(n){n.invalid_session="invalid_session",n.general_error="general_error",n.internal_error="internal_error",n.invalid_request_error="invalid_request_error",n.timeslot_not_available="timeslot_not_available"})(I||(I={}));class D{constructor(){this.component=t=>{const e=exports.ErrorCategory.Component,s=`${t} error`;return{endtime_not_in_future:(i='"endtime" can not be in the future')=>({title:s,message:i,category:e}),no_booking_info:(i="No booking info provided")=>({title:s,message:i,category:e}),no_timeslot_selected:(i="No timeslot selected")=>({title:s,message:i,category:e}),no_booking_id:(i="No booking id provided")=>({title:s,message:i,category:e}),invalid_start_time:(i="Invalid start time")=>({title:s,message:i,category:e}),invalid_end_time:(i="Invalid end time")=>({title:s,message:i,category:e}),invalid_timezone:(i="Invalid timezone")=>({title:s,message:i,category:e})}},this.api=t=>{const e=exports.ErrorCategory.Api,s=`${t} error`;return{invalid_session:i=>({title:s,message:i,category:e}),general_error:i=>({title:s,message:i,category:e}),internal_error:i=>({title:s,message:i,category:e}),invalid_request_error:i=>({title:s,message:i,category:e}),timeslot_not_available:i=>({title:s,message:i,category:e})}}}}class C{constructor({schedulerAPIURL:t,schedulerStore:e,sessionId:s,configId:i}){this.errors=new D,this.schedulerStore=e,this.schedulerAPIURL=t,this.sessionId=s,this.configId=i}getHeaders(){return this.configId?{}:{Authorization:`Bearer ${this.sessionId}`}}async makeAPIRequest(t,e,s,i={}){try{const r=new URL(this.schedulerAPIURL);return r.pathname=t,await(await fetch(decodeURIComponent(r.toString()),{method:e,headers:{"Content-Type":"application/json",...i},body:s})).json()}catch(r){return{error:{message:r.message,title:"API request failed",type:"api"}}}}selectDate(t){this.schedulerStore.set("selectedDate",t),this.schedulerStore.set("selectedTimeslot",null)}selectTime(t){this.schedulerStore.set("selectedTimeslot",t)}selectTimezone(t){this.schedulerStore.set("selectedTimezone",t)}toggleAdditionalData(t){this.schedulerStore.set("showBookingForm",t)}setParticipantName(t){const{bookingInfo:e}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...e,primaryParticipant:{...e==null?void 0:e.primaryParticipant,name:t}})}setParticipantEmail(t){const{bookingInfo:e}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...e,primaryParticipant:{...e==null?void 0:e.primaryParticipant,email:t}})}async setReschedule(t){const e=new Date;this.schedulerStore.set("rescheduleBookingId",t),this.schedulerStore.set("selectedTimeslot",null),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1);const s=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3,r=await this.getAvailability(s,i),a=this.schedulerStore.get("availability").find(l=>new Date(l.start_time)>new Date);let u=e;return a&&(u=a.start_time),this.schedulerStore.set("selectedDate",u),r}async setCancel(t){this.schedulerStore.set("cancelBookingId",t)}async bookTimeslot(t){var g;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:e,bookingInfo:s}=this.schedulerStore.state;if(!t&&!s)return{error:this.errors.component("Booking").no_booking_info()};const i=(t==null?void 0:t.timeslot)||e;if(!i)return{error:this.errors.component("Create Booking").no_timeslot_selected()};const r=t?t==null?void 0:t.primaryParticipant:s==null?void 0:s.primaryParticipant,a=t?(t==null?void 0:t.guests)||[]:(s==null?void 0:s.guests)||[],u=t?{...t==null?void 0:t.additionalFields,guests:a}:{...s==null?void 0:s.additionalFields,guests:a},l=this.getHeaders(),p=`/v3/scheduling/bookings${this.configId?`?configuration_id=${this.configId}`:""}`,d=await this.makeAPIRequest(decodeURIComponent(p),"POST",JSON.stringify({additional_fields:u,guest:{...r},start_time:i.start_time.getTime()/1e3,end_time:i.end_time.getTime()/1e3}),l);if("error"in d){this.schedulerStore.set("isLoading",!1);const c=(g=d.error)==null?void 0:g.type;let o=d.error;return c&&c in this.errors.api("Create Booking")&&(o=this.errors.api("Create Booking")[c]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}return"data"in d&&this.schedulerStore.set("eventInfo",d==null?void 0:d.data),this.schedulerStore.set("isLoading",!1),d}async getAvailability(t=0,e=0){var p,d,g;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,i=new Date,r=i.getTime();if(e&&e<r/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component("Get Availability").endtime_not_in_future()};if(!t){const c=new Date(i.getFullYear(),i.getMonth(),1);t=Math.floor(c.getTime()/1e3)}if(!e){const c=new Date(i.getFullYear(),i.getMonth()+1,0);e=Math.floor(c.getTime()/1e3)}s.append("start_time",encodeURIComponent(t.toString())),s.append("end_time",encodeURIComponent(e.toString())),this.configId&&s.append("configuration_id",encodeURIComponent(this.configId));const a=s.toString(),u=`/v3/scheduling/availability${a?`?${a}`:""}`,l=this.getHeaders(),h=await this.makeAPIRequest(decodeURIComponent(u),"GET",void 0,l);if("error"in h){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const c=(p=h.error)==null?void 0:p.type;let o=h.error;return c&&c in this.errors.api("Get Availability")&&(o=this.errors.api("Get Availability")[c]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}if("data"in h){const o=(((g=(d=h.data)==null?void 0:d.time_slots)==null?void 0:g.map(m=>({...m,start_time:new Date(m.start_time*1e3),end_time:new Date(m.end_time*1e3)})))||[]).filter(m=>m.start_time.getTime()>r);this.schedulerStore.set("availability",o)}return this.schedulerStore.set("isLoading",!1),h}async cancelBooking(t){var a;if(this.schedulerStore.set("isLoading",!0),!t)return{error:this.errors.component("Cancel Booking").no_booking_id()};const e=this.configId?`?configuration_id=${this.configId}`:"",s=`/v3/scheduling/bookings/${t}${e}`,i=this.getHeaders(),r=await this.makeAPIRequest(decodeURIComponent(s),"DELETE",JSON.stringify({action:"cancel"}),i);if("error"in r){this.schedulerStore.set("isLoading",!1);const u=(a=r.error)==null?void 0:a.type;let l=r.error;return u&&u in this.errors.api("Cancel Booking")&&(l=this.errors.api("Cancel Booking")[u]((l==null?void 0:l.message)||(l==null?void 0:l.title)||"Something went wrong")),{error:l}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:t}),this.schedulerStore.set("isLoading",!1),r}async rescheduleBooking(t,e){var y;if(this.schedulerStore.set("isLoading",!0),!t)return{error:this.errors.component("Reschedule Booking").no_booking_id()};const s=this.errors.api("Reschedule Booking"),i=this.errors.component("Reschedule Booking"),{bookingInfo:r,selectedTimeslot:a,selectedTimezone:u}=this.schedulerStore.state,{startTime:l,endTime:h,timezone:p}=e,d=l||(a==null?void 0:a.start_time);if(!d)return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const g=h||(a==null?void 0:a.end_time);if(!g)return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const c=p||u;if(!c)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const o=e?e==null?void 0:e.primaryParticipant:r==null?void 0:r.primaryParticipant,m=e?(e==null?void 0:e.guests)||[]:(r==null?void 0:r.guests)||[],b=e?{...e==null?void 0:e.additionalFields,guests:m}:{...r==null?void 0:r.additionalFields,guests:m},P=this.configId?`?configuration_id=${this.configId}`:"",k=`/v3/scheduling/bookings/${t}${P}`,T=this.getHeaders(),_=await this.makeAPIRequest(decodeURIComponent(k),"PATCH",JSON.stringify({start_time:d.getTime()/1e3,end_time:g.getTime()/1e3,time_zone:c,additional_fields:b,guest:{...o}}),T);if("error"in _){this.schedulerStore.set("isLoading",!1);const v=(y=_.error)==null?void 0:y.type;let f=_.error;v&&v in s&&(f=s[v]((f==null?void 0:f.message)||(f==null?void 0:f.title)||"Something went wrong"))}return"data"in _&&this.schedulerStore.set("eventInfo",_==null?void 0:_.data),this.schedulerStore.set("isLoading",!1),_}}function R(n={}){const t={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,selectableDates:null,availability:[],state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...n};S.debug("[defaultNylasStoreState]: ",t);const e=S.createStore(t);return e.onChange("availability",s=>{S.debug("[availability]: ",s);const i=s.map(r=>r.start_time);S.debug("[selectableDates]: ",i),e.set("selectableDates",i)}),e.reset=()=>{for(const s in t){const i=t[s];e.set(s,i)}},e}exports.CreateNylasSchedulerStore=R;exports.NylaSchedulerAPIConnector=C;
@@ -1,15 +0,0 @@
1
- import { r as t, h as e } from "./index-f9ba9aa8.js";
2
- import "react";
3
- import "react-dom";
4
- const a = ".sc-warning-icon-h{display:flex}", r = a, i = class {
5
- constructor(n) {
6
- t(this, n), this.width = "16", this.height = "16";
7
- }
8
- render() {
9
- return e("svg", { key: "9cbf680bd395a0537c848758fe4e58aee376e0c1", width: "21", height: "21", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "8e7a1fd6b1bcf424e569e7844165e6f7cc9078e9", d: "M10.149 7.054a.5.5 0 0 1 .5.5v4a.5.5 0 1 1-1 0v-4a.5.5 0 0 1 .5-.5Zm0 7.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.834 2.906a1.5 1.5 0 0 1 2.63 0l6.558 11.925a1.5 1.5 0 0 1-1.314 2.223H3.59a1.5 1.5 0 0 1-1.314-2.223L8.834 2.906Zm1.753.482a.5.5 0 0 0-.876 0L3.15 15.313a.5.5 0 0 0 .439.741h13.117a.5.5 0 0 0 .439-.741l-6.56-11.925Z", fill: "currentColor" }));
10
- }
11
- };
12
- i.style = r;
13
- export {
14
- i as warning_icon
15
- };