@nylas/react 2.0.6 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/cjs/connect.js +1 -0
  2. package/dist/cjs/elements.js +1 -0
  3. package/dist/cjs/index.js +1 -0
  4. package/dist/cjs/notetaker.js +62 -0
  5. package/dist/cjs/utils.js +11 -0
  6. package/dist/connect.d.ts +1 -0
  7. package/dist/elements.d.ts +1 -0
  8. package/dist/es/connect.js +279 -0
  9. package/dist/es/elements.js +1319 -0
  10. package/dist/es/index.js +281 -0
  11. package/dist/es/notetaker.js +5784 -0
  12. package/dist/es/utils.js +12396 -0
  13. package/dist/lib/connect/index.d.ts +6 -0
  14. package/dist/lib/connect/types.d.ts +2 -0
  15. package/dist/lib/connect/useNylasConnect.d.ts +28 -0
  16. package/dist/lib/connect/useNylasConnect.test.d.ts +1 -0
  17. package/dist/lib/connect.d.ts +1 -0
  18. package/dist/lib/elements/components.d.ts +975 -0
  19. package/dist/lib/elements.d.ts +1 -0
  20. package/dist/lib/index.d.ts +3 -5
  21. package/dist/lib/notetaker.d.ts +1 -0
  22. package/dist/lib/utils.d.ts +2 -0
  23. package/dist/notetaker.d.ts +1 -0
  24. package/dist/utils.d.ts +1 -0
  25. package/package.json +37 -16
  26. package/dist/abstract-provider-45ada3b4-31e3ed72.cjs +0 -1
  27. package/dist/abstract-provider-45ada3b4-abd3105d.js +0 -187
  28. package/dist/add-circle-icon_2.entry-48953f9c.cjs +0 -1
  29. package/dist/add-circle-icon_2.entry-f6f8b5e5.js +0 -26
  30. package/dist/archive-icon.entry-b3a76711.js +0 -16
  31. package/dist/archive-icon.entry-e2880dc7.cjs +0 -1
  32. package/dist/arrow-icon.entry-84d1e26c.cjs +0 -1
  33. package/dist/arrow-icon.entry-9b3441aa.js +0 -16
  34. package/dist/bold-icon.entry-0749a116.js +0 -16
  35. package/dist/bold-icon.entry-e1d8ab5e.cjs +0 -1
  36. package/dist/button-component_2.entry-1a817230.cjs +0 -1
  37. package/dist/button-component_2.entry-6eb55e97.js +0 -27
  38. package/dist/calendar-agenda-fill-icon_37.entry-0ca8b9f4.cjs +0 -6
  39. package/dist/calendar-agenda-fill-icon_37.entry-4adf73a2.js +0 -5231
  40. package/dist/calendar-cancel-icon.entry-2a29cb3f.js +0 -16
  41. package/dist/calendar-cancel-icon.entry-e0dee585.cjs +0 -1
  42. package/dist/calendar-check-icon.entry-7f96d456.cjs +0 -1
  43. package/dist/calendar-check-icon.entry-c12b63ea.js +0 -16
  44. package/dist/calendar-icon.entry-a2d19ff2.cjs +0 -1
  45. package/dist/calendar-icon.entry-e82a5169.js +0 -16
  46. package/dist/checkbox-component.entry-59612a67.js +0 -52
  47. package/dist/checkbox-component.entry-ddce70bc.cjs +0 -1
  48. package/dist/checkbox-group_4.entry-3311da64.cjs +0 -28
  49. package/dist/checkbox-group_4.entry-7df47ad4.js +0 -10011
  50. package/dist/checkmark-circle-icon.entry-677b0def.js +0 -16
  51. package/dist/checkmark-circle-icon.entry-67df713b.cjs +0 -1
  52. package/dist/checkmark-icon_15.entry-2121e1b7.cjs +0 -5
  53. package/dist/checkmark-icon_15.entry-9fd0ec58.js +0 -1412
  54. package/dist/chevron-icon_3.entry-1a42235c.cjs +0 -1
  55. package/dist/chevron-icon_3.entry-f0ad71d9.js +0 -157
  56. package/dist/clock-icon_4.entry-88822a84.cjs +0 -1
  57. package/dist/clock-icon_4.entry-e7472d5f.js +0 -46
  58. package/dist/constants-f51538ef-cd2a67c4.cjs +0 -1
  59. package/dist/constants-f51538ef-e0a5f026.js +0 -876
  60. package/dist/customParseFormat-eeec04f5-3ad26beb.js +0 -135
  61. package/dist/customParseFormat-eeec04f5-d5957784.cjs +0 -1
  62. package/dist/delete-icon.entry-3cb58910.cjs +0 -1
  63. package/dist/delete-icon.entry-813429d7.js +0 -16
  64. package/dist/document-refresh-icon.entry-ae361b0b.cjs +0 -1
  65. package/dist/document-refresh-icon.entry-c224c778.js +0 -16
  66. package/dist/feedbackSync-0ebd0eda-803c3ebe.js +0 -6048
  67. package/dist/feedbackSync-0ebd0eda-e12b00d5.cjs +0 -448
  68. package/dist/folder-icon.entry-107841af.cjs +0 -1
  69. package/dist/folder-icon.entry-9c1f7c41.js +0 -16
  70. package/dist/forward-icon.entry-4ac22c16.js +0 -16
  71. package/dist/forward-icon.entry-6cec1f94.cjs +0 -1
  72. package/dist/globe-icon.entry-7798c93b.js +0 -16
  73. package/dist/globe-icon.entry-909c1382.cjs +0 -1
  74. package/dist/google-logo-icon_6.entry-1f4ad364.cjs +0 -2
  75. package/dist/google-logo-icon_6.entry-b198c90a.js +0 -1762
  76. package/dist/google-meet-icon_5.entry-82d87e77.cjs +0 -1
  77. package/dist/google-meet-icon_5.entry-fa6dc1dc.js +0 -56
  78. package/dist/inbox-icon.entry-1b123e64.js +0 -16
  79. package/dist/inbox-icon.entry-84f96d31.cjs +0 -1
  80. package/dist/index-140eb219.js +0 -24953
  81. package/dist/index-d8a42c15.cjs +0 -118
  82. package/dist/index.es-57d4a08f-184cbc01.js +0 -2724
  83. package/dist/index.es-57d4a08f-b0a2ca19.cjs +0 -7
  84. package/dist/info-icon_2.entry-f09e7dae.cjs +0 -1
  85. package/dist/info-icon_2.entry-f8b72d08.js +0 -35
  86. package/dist/input-component.entry-44607977.js +0 -93
  87. package/dist/input-component.entry-fd38953d.cjs +0 -1
  88. package/dist/input-dropdown_2.entry-4c2e5e1a.cjs +0 -1
  89. package/dist/input-dropdown_2.entry-6898b420.js +0 -252
  90. package/dist/italic-icon.entry-16aa1ada.js +0 -16
  91. package/dist/italic-icon.entry-beef2254.cjs +0 -1
  92. package/dist/lib/elements/index.d.ts +0 -133
  93. package/dist/lib/elements/react-component-lib/createComponent.d.ts +0 -10
  94. package/dist/lib/elements/react-component-lib/createOverlayComponent.d.ts +0 -21
  95. package/dist/lib/elements/react-component-lib/index.d.ts +0 -2
  96. package/dist/lib/elements/react-component-lib/interfaces.d.ts +0 -29
  97. package/dist/lib/elements/react-component-lib/utils/attachProps.d.ts +0 -9
  98. package/dist/lib/elements/react-component-lib/utils/case.d.ts +0 -2
  99. package/dist/lib/elements/react-component-lib/utils/dev.d.ts +0 -2
  100. package/dist/lib/elements/react-component-lib/utils/index.d.ts +0 -10
  101. package/dist/multi-select-dropdown.entry-50133d29.js +0 -130
  102. package/dist/multi-select-dropdown.entry-c82cd6d4.cjs +0 -1
  103. package/dist/nylas-booked-event-card_11.entry-56768a09.js +0 -1407
  104. package/dist/nylas-booked-event-card_11.entry-eb4b3c5c.cjs +0 -1
  105. package/dist/nylas-date-component_2.entry-93f2f352.cjs +0 -1
  106. package/dist/nylas-date-component_2.entry-df957150.js +0 -307
  107. package/dist/nylas-form-card.entry-4d95a4ad.cjs +0 -1
  108. package/dist/nylas-form-card.entry-7724e61f.js +0 -72
  109. package/dist/nylas-notification_2.entry-448c2cb8.cjs +0 -1
  110. package/dist/nylas-notification_2.entry-af763b6c.js +0 -85
  111. package/dist/nylas-scheduler-editor.entry-0e4ba46d.js +0 -1796
  112. package/dist/nylas-scheduler-editor.entry-e36cdd9d.cjs +0 -2
  113. package/dist/nylas-scheduling.entry-1b207e91.js +0 -999
  114. package/dist/nylas-scheduling.entry-904dd10e.cjs +0 -1
  115. package/dist/person-icon.entry-70d46ca6.cjs +0 -1
  116. package/dist/person-icon.entry-f2979577.js +0 -16
  117. package/dist/play-icon.entry-c2cf0b12.cjs +0 -1
  118. package/dist/play-icon.entry-d387df5d.js +0 -16
  119. package/dist/radio-button-group.entry-45dbd2df.js +0 -56
  120. package/dist/radio-button-group.entry-94e06176.cjs +0 -1
  121. package/dist/react.cjs +0 -1
  122. package/dist/react.js +0 -149
  123. package/dist/refresh-icon.entry-5ab20f26.cjs +0 -1
  124. package/dist/refresh-icon.entry-777cff27.js +0 -16
  125. package/dist/register-component-0aad9e3d-b395364a.js +0 -109
  126. package/dist/register-component-0aad9e3d-d2f2e543.cjs +0 -1
  127. package/dist/reply-all-icon.entry-3c90510e.cjs +0 -1
  128. package/dist/reply-all-icon.entry-e2dd6da9.js +0 -16
  129. package/dist/reply-icon.entry-00a97d9f.js +0 -16
  130. package/dist/reply-icon.entry-d96478be.cjs +0 -1
  131. package/dist/sent-icon.entry-2d16da4e.cjs +0 -1
  132. package/dist/sent-icon.entry-949cf214.js +0 -16
  133. package/dist/spam-icon.entry-3baf9e79.js +0 -16
  134. package/dist/spam-icon.entry-7ee61730.cjs +0 -1
  135. package/dist/star-icon.entry-9fdb278b.js +0 -16
  136. package/dist/star-icon.entry-dc702d73.cjs +0 -1
  137. package/dist/stop-icon.entry-b5ae7e55.cjs +0 -1
  138. package/dist/stop-icon.entry-efa1ea66.js +0 -16
  139. package/dist/textarea-component.entry-247aca42.cjs +0 -1
  140. package/dist/textarea-component.entry-7c6fc4d8.js +0 -55
  141. package/dist/toggle-switch.entry-a0295d17.js +0 -49
  142. package/dist/toggle-switch.entry-d52b0338.cjs +0 -1
  143. package/dist/translate-icon.entry-219cab17.js +0 -16
  144. package/dist/translate-icon.entry-985b3b29.cjs +0 -1
  145. package/dist/trash-fill-icon.entry-03c90559.js +0 -16
  146. package/dist/trash-fill-icon.entry-4dfd7d24.cjs +0 -1
  147. package/dist/underline-icon.entry-58fa18b5.js +0 -16
  148. package/dist/underline-icon.entry-c60b77a6.cjs +0 -1
@@ -1,1762 +0,0 @@
1
- import { r as te, h as n, a as m, b, i, q as _e, s as le, H as ce, g as pe, F as de, j as at } from "./index-140eb219.js";
2
- import { R as be } from "./register-component-0aad9e3d-b395364a.js";
3
- import { n as _ } from "./index.es-57d4a08f-184cbc01.js";
4
- import { C as I, D as $e, e as ot, b as st } from "./constants-f51538ef-e0a5f026.js";
5
- import { E as v, i as Je, a as Ve, c as Ze, b as We, f as qe } from "./feedbackSync-0ebd0eda-803c3ebe.js";
6
- import "react";
7
- import "react/jsx-runtime";
8
- import "react-dom";
9
- const rt = ".sc-google-logo-icon-h{display:flex}", it = rt, lt = class {
10
- constructor(e) {
11
- te(this, e), this.width = "24", this.height = "24";
12
- }
13
- render() {
14
- return n("svg", { key: "eb0615e5875a4d560edb09dd85fcf0b8bbeb5458", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "7d040d5b5bc8cf89eabff2ed2695f99bea692b4e", "clip-path": "url(#clip0_959_12452)" }, n("path", { key: "4ddc28c0799291a0c23538444f1c7f5a35959cac", 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" }), n("path", { key: "d5b051bacfa0110b66c99273ba6fd591a68237d1", 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" }), n("path", { key: "6fc0685305b1c96ce35fbf87ccab73f161d648c0", 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" }), n("path", { key: "5946c791195dd03d48b4938d8698ba8e01a7a0b3", 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" })), n("defs", { key: "9d33e98420dbd0f952496686fd02f41894ab49f4" }, n("clipPath", { key: "dd192b07d7651bbd74375c1a31e0f3027d9b9a10", id: "clip0_959_12452" }, n("rect", { key: "98c2344df7d506d2579cd793d89fb42feeace8fd", width: 24, height: 24, fill: "white" }))));
15
- }
16
- };
17
- lt.style = it;
18
- const dt = ".sc-microsoft-logo-icon-h{display:flex}", ct = dt, pt = class {
19
- constructor(e) {
20
- te(this, e), this.width = "22", this.height = "22";
21
- }
22
- render() {
23
- return n("svg", { key: "a6a6af29ed81710f3f493d849c90871991e0be0f", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "025c40cab8337a37897481fb47580f219b3ad528", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), n("path", { key: "d7e67a46de5217cfa54f8973616616a9fd4fb474", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), n("path", { key: "2f4162db32fb29afb4f88c3070e59e8dc574a732", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), n("path", { key: "4ec074b89f50e66765e199ae112d063ca21b541a", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
24
- }
25
- };
26
- pt.style = ct;
27
- var u;
28
- (function(e) {
29
- e.EventInfo = "eventInfo", e.Availability = "availability", e.BookingOptions = "bookingOptions", e.Communications = "communications", e.Participants = "participants", e.BookingForm = "bookingForm", e.PageStyles = "pageStyles";
30
- })(u || (u = {}));
31
- function bt({ id: e, formState: t, activeTab: a }, s) {
32
- return n(
33
- de,
34
- null,
35
- n(
36
- "div",
37
- { key: `event-info-${e}`, class: { hide: a !== u.EventInfo } },
38
- n(
39
- "nylas-event-info",
40
- null,
41
- n(
42
- "div",
43
- { slot: "inputs" },
44
- n("nylas-event-title", { name: "title", exportparts: "net, net__title, net__dropdown-content" }),
45
- n("nylas-event-duration", { name: "duration", exportparts: "ned, ned__error, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
46
- n("nylas-event-location", { name: "location", exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
47
- n("nylas-event-description", { name: "description", exportparts: "nedesc, nedesc__textarea" })
48
- )
49
- )
50
- ),
51
- n(
52
- "div",
53
- { key: `availability-${e}`, class: { hide: a !== u.Availability } },
54
- n("nylas-participant-booking-calendars", { participants: t.participants, name: "participant-booking-calendars", exportparts: "npbc, npbc__header, npbc__content, npbc__participant-container, npbc__participant-title" }),
55
- n("nylas-connected-calendars", { participants: t.participants, name: "connected-calendars", exportparts: "nccals, nccals__header, nccals__content, nccals__container, nccals__title, nccals__toggle-container, npbc__participant-toggle-container" }),
56
- n("nylas-availability-picker", { name: "availability", exportparts: "nap, nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
57
- ),
58
- n(
59
- "div",
60
- { key: `booking-options-${e}`, class: { hide: a !== u.BookingOptions } },
61
- n("nylas-scheduling-method", { name: "availability-method", readOnly: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
62
- n(
63
- "nylas-custom-booking-flow",
64
- { exportparts: "ncbflow, ncbflow__header, ncbflow__title, ncbflow__content" },
65
- n(
66
- "div",
67
- { slot: "inputs" },
68
- n("nylas-booking-confirmation-type", { name: "confirmation-type", exportparts: "nbct, nbct__header, nbct__dropdown, nbct__dropdown-button, nbct__dropdown-content" }),
69
- n("nylas-booking-confirmation-redirect", { name: "confirmation-redirect", exportparts: "nbcr, nbcr__header, nbcr__dropdown, nbcr__dropdown-button, nbcr__dropdown-content, nbcr__input-textfield" })
70
- )
71
- ),
72
- n("nylas-buffer-time", { name: "buffer-time", 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" }),
73
- n(
74
- "nylas-event-limits",
75
- null,
76
- n(
77
- "div",
78
- { slot: "inputs" },
79
- n("nylas-min-booking-notice", { name: "min-booking-notice", exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
80
- n("nylas-limit-future-bookings", { name: "limit-future-bookings", exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
81
- n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
82
- n("nylas-cancellation-policy", { name: "cancellation-policy", exportparts: "ncpolicy, ncpolicy__textarea" })
83
- )
84
- ),
85
- n("nylas-timeslot-interval", { name: "timeslot-interval", exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
86
- n("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
87
- ),
88
- n(
89
- "div",
90
- { key: `communications-${e}`, class: { hide: a !== u.Communications } },
91
- n("nylas-disable-emails", { name: "disable-emails", exportparts: "nde, nde__toggle-label, nde_toggle-input, nde_toggle-slider" }),
92
- !(t != null && t.disableEmails) && n(
93
- de,
94
- null,
95
- n("nylas-confirmation-email", { name: "confirmation-email-template", exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" }),
96
- n("nylas-reminder-emails", { name: "reminder-overrides", exportparts: "nre, nre__tab-heading, nre__header, nre__body, nre__confirmation-email-toggle--container, nre__summary, nrt, nrt__number-dropdown, nrt__number-dropdown-button, nrt__number-dropdown-content, nrt__period-dropdown, nrt__period-dropdown-button, nrt__period-dropdown-content, nrt__time-period-selector" })
97
- )
98
- ),
99
- n(
100
- "div",
101
- { key: `participants-${e}`, class: { hide: a !== u.Participants } },
102
- n("nylas-additional-participants", { name: "participants", exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" }),
103
- n("nylas-participants-custom-availability", { participants: t.participants, name: "participant-custom-availability", exportparts: "npca, npca__header, npca__content, npca__participant-container, npca__participant-title, npca__participant-toggle--container, npca__toggle-label, npca__toggle-input, npca__toggle-slider" })
104
- ),
105
- n(
106
- "div",
107
- { key: `page-styles-${e}`, class: { hide: a !== u.PageStyles } },
108
- n("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
109
- n("nylas-page-name", { name: "page-name", exportparts: "npn, npn__body, npn__header, npn__drawer-toggle--container, npn__input-textfield" }),
110
- n("nylas-page-styling", { name: "page-styling", exportparts: "nps, nps__header, nps__drawer-toggle--container, nps__body, nps__title-input-textfield, nps__company-logo-input-textfield, nps__color-picker, nps__color-picker-button, nps__color-picker-button-label, nps__color-picker-selected-label, nps__submit-button-label-input-textfield, nps__message-textarea" }, s)
111
- ),
112
- n(
113
- "div",
114
- { key: `booking-form-${e}`, class: { hide: a !== u.BookingForm } },
115
- n("nylas-booking-form-config", { name: "additional-fields", exportparts: "nbfc, nbfc__header, nbfc__add_field, nbfc__add_field-button, nbfc__add_field-content, nbfc__static_fields, nbfc__additional_fields, nbfc__form-field, nbfc__form-field-header, nbfc__form-field-content" })
116
- )
117
- );
118
- }
119
- const ut = '.sc-nylas-editor-tabs-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column;height:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:calc(100% - 80px);display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{border-right:none}}.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;text-align:left;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.sc-nylas-editor-tabs:last-of-type{margin-bottom:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.hide.sc-nylas-editor-tabs{display:none}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto;overflow-x:hidden;transition:opacity 0.05s ease-in;opacity:0}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.fadeIn.sc-nylas-editor-tabs{opacity:1}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .hide.sc-nylas-editor-tabs{display:none}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs h3.sc-nylas-editor-tabs{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:16px;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}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.save-changes.sc-nylas-editor-tabs{min-width:140px}button-component#report-issue.sc-nylas-editor-tabs{width:auto}nylas-feedback-form.sc-nylas-editor-tabs{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', ht = ut;
120
- var yt = function(e, t, a, s) {
121
- var l = arguments.length, r = l < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, o;
122
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
123
- r = Reflect.decorate(e, t, a, s);
124
- else
125
- for (var d = e.length - 1; d >= 0; d--)
126
- (o = e[d]) && (r = (l < 3 ? o(r) : l > 3 ? o(t, a, r) : o(t, a)) || r);
127
- return l > 3 && r && Object.defineProperty(t, a, r), r;
128
- }, ye = function(e, t) {
129
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
130
- return Reflect.metadata(e, t);
131
- };
132
- const Ke = class {
133
- constructor(e) {
134
- te(this, e), this.schedulerConfigChanged = m(this, "schedulerConfigChanged", 7), this.schedulerConfigCreated = m(this, "schedulerConfigCreated", 7), this.cancelButtonClick = m(this, "cancelButtonClick", 7), this.formSubmitted = m(this, "formSubmitted", 7), this.previewButtonClicked = m(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = m(this, "schedulerEditorFormUpdated", 7), this.nylasSchedulerError = m(this, "nylasSchedulerError", 6), this.dismissNotification = m(this, "dismissNotification", 7), this.formSubmissionHandler = async (t) => {
135
- var ve, Ce, we, ke, xe, Ee, Se, Te, Le, Fe, Oe, Be, Pe, He, Ne, ze, Ie;
136
- t.preventDefault();
137
- const a = await this.formSubmitted.emit();
138
- if (b("[nylas-editor-tabs]", "formSubmissionHandler", a), !this.formRef.checkValidity() || a.defaultPrevented) {
139
- this.setError({
140
- message: this.formRef.validationMessage || i.t("fixFormErrors"),
141
- type: _.Error,
142
- category: v.Component,
143
- title: i.t("nylasEditorTabs.formErrorTitle")
144
- });
145
- return;
146
- }
147
- this.isLoading = !0, this.hasUnsavedChanges = !1;
148
- const l = this.updateFormState();
149
- b("[nylas-editor-tabs]", "formState", l);
150
- const { title: r, description: o, duration: d, availability: c, bookingCalendar: p, location: h, bookingType: f, buffer: w, availableDaysInFuture: T, minCancellationNotice: O, minBookingNotice: U, cancellationPolicy: N, timeslotInterval: L, additionalGuestsHidden: z, hideCancellationOptions: D, hideReschedulingOptions: R, participants: F, participantOpenHours: E, participantSpecificDateOpenHours: B, additionalFields: C, participantCalendars: k, conferencing: A, participantBookingCalendars: S, reminders: $, emailTemplate: j, redirectUrl: G, availabilityMethod: J, slug: Z, appearance: Y, name: q, disableEmails: Q, organizerLocale: X } = l, x = ((Ce = (ve = this.selectedConfiguration) == null ? void 0 : ve.participants) == null ? void 0 : Ce.find((y) => y.is_organizer)) || (F == null ? void 0 : F.find((y) => y.is_organizer)), V = k && (x != null && x.email) ? k[x == null ? void 0 : x.email] : [], P = ((we = x == null ? void 0 : x.booking) == null ? void 0 : we.calendar_id) || p, H = d ? parseInt(d) : 30, M = F && (F == null ? void 0 : F.length) > 0 ? F : [
151
- {
152
- name: (x == null ? void 0 : x.name) ?? ((ke = this.currentUser) == null ? void 0 : ke.name) ?? "",
153
- email: (x == null ? void 0 : x.email) ?? ((xe = this.currentUser) == null ? void 0 : xe.email) ?? "",
154
- is_organizer: !0,
155
- timezone: (c == null ? void 0 : c.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
156
- availability: {
157
- calendar_ids: p && p !== "" ? [p] : ["primary"],
158
- open_hours: []
159
- },
160
- booking: {
161
- calendar_id: p && p !== "" ? p : "primary"
162
- }
163
- }
164
- ];
165
- let K = J || (((Te = (Se = (Ee = this.selectedConfiguration) == null ? void 0 : Ee.availability) == null ? void 0 : Se.availability_rules) == null ? void 0 : Te.availability_method) ?? "collective");
166
- this.selectedEventType && this.selectedEventType !== I.group && (K = this.selectedEventType === I.one_on_one ? I.collective : this.selectedEventType);
167
- const ne = {
168
- ...((Le = this.selectedConfiguration) == null ? void 0 : Le.id) && { id: this.selectedConfiguration.id },
169
- version: ((Fe = this.selectedConfiguration) == null ? void 0 : Fe.version) ?? "1.0.0",
170
- slug: Z,
171
- name: q,
172
- availability: {
173
- duration_minutes: H,
174
- interval_minutes: (L == null ? void 0 : L.interval) ?? H,
175
- round_to: L == null ? void 0 : L.roundTo,
176
- availability_rules: {
177
- availability_method: K,
178
- buffer: w || { before: 0, after: 0 },
179
- default_open_hours: (c == null ? void 0 : c.openHours) ?? ((Pe = (Be = (Oe = this.selectedConfiguration) == null ? void 0 : Oe.availability) == null ? void 0 : Be.availability_rules) == null ? void 0 : Pe.default_open_hours) ?? $e,
180
- round_robin_group_id: ((ze = (Ne = (He = this.selectedConfiguration) == null ? void 0 : He.availability) == null ? void 0 : Ne.availability_rules) == null ? void 0 : ze.round_robin_group_id) ?? ""
181
- }
182
- },
183
- participants: [
184
- ...M ? M.map((y) => {
185
- var Ge, Ue, De, Re, je, Me;
186
- let ee = (c == null ? void 0 : c.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
187
- if ((Ge = E == null ? void 0 : E[y.email]) != null && Ge.length && (ee = (De = (Ue = E == null ? void 0 : E[y.email]) == null ? void 0 : Ue[0]) == null ? void 0 : De.timezone), y.is_organizer) {
188
- const Ae = S != null && S[y.email] ? S == null ? void 0 : S[y.email] : P || "primary", he = k != null && k[y.email] ? k == null ? void 0 : k[y.email] : V != null && V.length ? V : ["primary"], nt = he.length === 1 && he[0] === "primary";
189
- return {
190
- name: y.name ?? "",
191
- email: y.email,
192
- is_organizer: !0,
193
- timezone: ee,
194
- availability: {
195
- calendar_ids: nt ? [Ae] : he,
196
- open_hours: (E == null ? void 0 : E[y.email]) ?? ((Re = y.availability) == null ? void 0 : Re.open_hours) ?? []
197
- },
198
- specific_date_open_hours: (B == null ? void 0 : B[y.email]) ?? y.specific_date_open_hours ?? [],
199
- booking: {
200
- calendar_id: Ae
201
- }
202
- };
203
- }
204
- const ae = S != null && S[y.email] ? { calendar_id: S == null ? void 0 : S[y.email] } : (y == null ? void 0 : y.booking) ?? void 0, ue = (k == null ? void 0 : k[y.email]) ?? ((je = y.availability) == null ? void 0 : je.calendar_ids) ?? ["primary"], tt = ue.length === 1 && ue[0] === "primary";
205
- return {
206
- ...y,
207
- timezone: ee,
208
- availability: y.availability ? {
209
- calendar_ids: tt && typeof ae < "u" ? [ae == null ? void 0 : ae.calendar_id] : ue,
210
- open_hours: (E == null ? void 0 : E[y.email]) ?? ((Me = y.availability) == null ? void 0 : Me.open_hours) ?? []
211
- } : void 0,
212
- booking: ae,
213
- specific_date_open_hours: (B == null ? void 0 : B[y.email]) ?? y.specific_date_open_hours ?? []
214
- };
215
- }) : []
216
- ],
217
- event_booking: {
218
- title: (r == null ? void 0 : r.toString()) ?? "",
219
- description: (o == null ? void 0 : o.toString()) ?? "",
220
- location: (h == null ? void 0 : h.toString()) ?? "",
221
- booking_type: (f == null ? void 0 : f.toString()) ?? "booking",
222
- timezone: (c == null ? void 0 : c.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
223
- conferencing: A,
224
- reminders: $,
225
- disable_emails: typeof Q == "boolean" ? Q : !1
226
- },
227
- scheduler: {
228
- cancellation_policy: N ?? "",
229
- available_days_in_future: T ?? 30,
230
- min_cancellation_notice: O ?? 0,
231
- min_booking_notice: U ?? 60,
232
- hide_additional_guests: z ?? !1,
233
- hide_cancellation_options: D ?? !1,
234
- hide_rescheduling_options: R ?? !1,
235
- additional_fields: C,
236
- email_template: j ? {
237
- ...j,
238
- organizer_locale: X || "en",
239
- logo: j.logo || ""
240
- } : void 0,
241
- confirmation_redirect_url: G
242
- },
243
- appearance: Y
244
- }, oe = _e(this.selectedConfiguration, ne || {}), W = this.action === "create" ? oe : ne;
245
- this.isConfigRoundRobin(W) && (W.participants = W.participants.map((y) => ({ ...y, is_organizer: void 0 })));
246
- const se = (y) => {
247
- this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
248
- this.changesSaved = !1;
249
- }, 5e3);
250
- }, re = this.checkForBookingFormErrors(W), ie = ((Ie = this.configurations) == null ? void 0 : Ie.find((y) => {
251
- var ee;
252
- return y.id === ((ee = this.selectedConfiguration) == null ? void 0 : ee.id);
253
- })) || {}, et = this.checkForOrganizerConfirmationError(_e(W, ie));
254
- re || et || this.schedulerConfigChanged.emit({ config: W, resetLoadingState: se, action: this.action, host: this.host });
255
- }, this.isConfigRoundRobin = (t) => {
256
- var a, s, l, r;
257
- return ((s = (a = t == null ? void 0 : t.availability) == null ? void 0 : a.availability_rules) == null ? void 0 : s.availability_method) === "max-availability" || ((r = (l = t.availability) == null ? void 0 : l.availability_rules) == null ? void 0 : r.availability_method) === "max-fairness";
258
- }, this.checkForOrganizerConfirmationError = (t) => {
259
- var o, d;
260
- let a = !1, s = "";
261
- const l = ((o = t.event_booking) == null ? void 0 : o.booking_type) === "organizer-confirmation", r = (d = t.scheduler) == null ? void 0 : d.organizer_confirmation_url;
262
- return l && !r && (s += "Organizer confirmation URL is required when using organizer confirmation booking type.", a = !0), a && (this.isLoading = !1, this.host.setError({
263
- message: s,
264
- type: _.Error,
265
- category: v.Component,
266
- title: "Error:"
267
- })), a;
268
- }, this.checkForBookingFormErrors = (t) => {
269
- var r;
270
- let a = !1, s = "";
271
- const l = (r = t.scheduler) == null ? void 0 : r.additional_fields;
272
- return l && (s = "", Object.entries(l).forEach((o) => {
273
- const d = o[1];
274
- if (d.label === "") {
275
- s += i.t("nylasEditorTabs.bookingFormError_label", { type: d.type }), a = !0;
276
- return;
277
- }
278
- if (d.options) {
279
- for (const c of d.options)
280
- if (c.trim() === "") {
281
- s += i.t("nylasEditorTabs.bookingFormError_option", { label: d.label, type: d.type }), a = !0;
282
- break;
283
- }
284
- }
285
- })), a && (this.isLoading = !1, this.host.setError({
286
- message: s,
287
- type: _.Error,
288
- category: v.Component,
289
- title: i.t("nylasEditorTabs.bookingFormError")
290
- })), a;
291
- }, this.calendars = void 0, this.selectedConfiguration = void 0, this.configurations = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.enableUserFeedback = !0, this.selectedLanguage = void 0, this.selectedEventType = void 0, this.themeConfig = void 0, this.action = "create", this.showFeedbackModal = !1, this.activeTab = u.EventInfo, this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.loaded = !1, this.formState = {}, this.error = {
292
- message: "",
293
- type: _.Error,
294
- category: v.Component,
295
- title: ""
296
- };
297
- }
298
- configChangedHandler(e) {
299
- b("[nylas-editor-tabs]", "configChangedHandler", e, this.selectedConfiguration), this.formState = {
300
- ...this.getFormStateFromConfig(e)
301
- }, e != null && e.id ? this.action = "edit" : this.action = "create";
302
- }
303
- userChangedHandler(e) {
304
- b("[nylas-editor-tabs]", "userChangedHandler", e), e && (this.formState = {
305
- ...this.getFormStateFromConfig(this.selectedConfiguration)
306
- });
307
- }
308
- selectedLanguageChangedHandler(e, t) {
309
- e !== t && (i.changeLanguage(e), this.error && this.error.message && (this.error = {
310
- ...this.error,
311
- message: i.t("fixFormErrors")
312
- }, this.showErrorNotification(this.error)));
313
- }
314
- themeConfigChangedHandler(e, t) {
315
- e !== t && this.applyThemeConfig(e);
316
- }
317
- applyThemeConfig(e) {
318
- if (e)
319
- for (const [t, a] of Object.entries(e))
320
- this.host.style.setProperty(`${t}`, a);
321
- }
322
- async schedulerConfigCreatedEventHandler(e) {
323
- return this.schedulerConfigCreated.emit(e);
324
- }
325
- async setError(e) {
326
- var t;
327
- this.error = {
328
- message: e.message,
329
- type: e.type,
330
- category: e.category,
331
- title: e.title || i.t("genericErrorTitle")
332
- }, (t = this.error) != null && t.message && this.showErrorNotification(this.error);
333
- }
334
- async resetError() {
335
- var e, t;
336
- (e = this.error) != null && e.message && this.dismissNotification.emit({ id: (t = this.error) == null ? void 0 : t.message.split(" ").join("-"), host: this.host }), this.error = {
337
- message: "",
338
- type: _.Error,
339
- category: v.Component,
340
- title: ""
341
- };
342
- }
343
- connectedCallback() {
344
- b("[nylas-editor-tabs]", "connectedCallback");
345
- }
346
- componentWillLoad() {
347
- b("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
348
- }
349
- componentDidLoad() {
350
- var t, a;
351
- b("[nylas-editor-tabs]", "componentDidLoad"), this.enableUserFeedback && !Je() && Ve({
352
- dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
353
- release: "2.0.6",
354
- integrations: (s) => [
355
- ...s.filter((l) => !1),
356
- qe({
357
- colorScheme: "system",
358
- autoInject: !1
359
- })
360
- ],
361
- autoSessionTracking: !1,
362
- beforeSend: () => null
363
- }), (t = this.selectedConfiguration) != null && t.id && this.configChangedHandler(this.selectedConfiguration);
364
- const e = (a = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : a.name;
365
- e && (this.activeTab = e), this.loaded = !0;
366
- }
367
- disconnectedCallback() {
368
- b("[nylas-editor-tabs]", "disconnectedCallback");
369
- }
370
- handleValueChanged(e) {
371
- b("[nylas-editor-tabs]", "handleValueChanged", e);
372
- const { name: t, value: a } = e.detail;
373
- console.debug("name", t, "value", a), this.setFormState(a, t), this.formState = { ...this.formState }, this.resetError(), ot.includes(t) && (this.hasUnsavedChanges = !0), this.schedulerEditorFormUpdated.emit({
374
- value: e.detail.value,
375
- name: e.detail.name
376
- });
377
- }
378
- feedbackModalClosedHandler() {
379
- this.showFeedbackModal = !1;
380
- }
381
- feedbackSubmittedHandler(e) {
382
- var s, l, r, o, d, c;
383
- const a = {
384
- eventId: Ze("Scheduler Editor User Feedback", {
385
- extra: {
386
- configId: (s = this.selectedConfiguration) == null ? void 0 : s.id,
387
- slug: (l = this.selectedConfiguration) == null ? void 0 : l.slug
388
- }
389
- }),
390
- message: e.detail.feedback
391
- };
392
- We(a, {
393
- includeReplay: !0,
394
- captureContext: {
395
- tags: {
396
- "nylas-web-element": "nylas-scheduler-editor",
397
- "nylas-web-element-version": "2.0.6",
398
- "nylas-config-id": (r = this.selectedConfiguration) == null ? void 0 : r.id,
399
- "nylas-slug": (o = this.selectedConfiguration) == null ? void 0 : o.slug,
400
- "host-url": window.location.href
401
- },
402
- extra: {
403
- configId: (d = this.selectedConfiguration) == null ? void 0 : d.id,
404
- slug: (c = this.selectedConfiguration) == null ? void 0 : c.slug
405
- }
406
- }
407
- }), this.showFeedbackModal = !1;
408
- }
409
- showErrorNotification(e) {
410
- e.message && this.nylasSchedulerError.emit({
411
- notification: {
412
- title: e.title,
413
- category: e.category || v.Component,
414
- type: e.type || _.Error,
415
- description: e.message,
416
- id: e.message.split(" ").join("-"),
417
- ttl: "none"
418
- },
419
- host: this.host
420
- });
421
- }
422
- getFormStateFromConfig(e) {
423
- var a, s, l, r, o, d, c, p, h, f, w, T, O, U, N, L, z, D, R, F, E, B, C, k, A, S, $, j, G, J, Z, Y, q, Q, X, x, V;
424
- let t = (a = e == null ? void 0 : e.participants) == null ? void 0 : a.find((P) => P.is_organizer);
425
- return !t && ((l = (s = e == null ? void 0 : e.availability) == null ? void 0 : s.availability_rules) == null ? void 0 : l.availability_method) !== "collective" && (t = (r = e == null ? void 0 : e.participants) == null ? void 0 : r.find((P) => {
426
- var H;
427
- return P.email === ((H = this.currentUser) == null ? void 0 : H.email);
428
- }), t && (t.is_organizer = !0)), e != null && e.appearance && console.info("Appearance settings have been returned from the given configuration; please remember to grab them from the configSettingsLoaded event and apply them as desired."), {
429
- title: ((o = e == null ? void 0 : e.event_booking) == null ? void 0 : o.title) ?? "",
430
- description: ((d = e == null ? void 0 : e.event_booking) == null ? void 0 : d.description) ?? "",
431
- duration: ((p = (c = e == null ? void 0 : e.availability) == null ? void 0 : c.duration_minutes) == null ? void 0 : p.toString()) ?? "30",
432
- availability: {
433
- timezone: ((h = e == null ? void 0 : e.event_booking) == null ? void 0 : h.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
434
- openHours: ((w = (f = e == null ? void 0 : e.availability) == null ? void 0 : f.availability_rules) == null ? void 0 : w.default_open_hours) ?? $e
435
- },
436
- additionalFields: ((T = e == null ? void 0 : e.scheduler) == null ? void 0 : T.additional_fields) ?? {},
437
- conferencing: ((O = e == null ? void 0 : e.event_booking) == null ? void 0 : O.conferencing) ?? {},
438
- calendarIds: ((U = t == null ? void 0 : t.availability) == null ? void 0 : U.calendar_ids) ?? [],
439
- participants: (e == null ? void 0 : e.participants) ?? [],
440
- bookingCalendar: ((N = t == null ? void 0 : t.booking) == null ? void 0 : N.calendar_id) ?? (t == null ? void 0 : t.email) ?? "",
441
- location: ((L = e == null ? void 0 : e.event_booking) == null ? void 0 : L.location) ?? "",
442
- bookingType: ((z = e == null ? void 0 : e.event_booking) == null ? void 0 : z.booking_type) ?? "booking",
443
- buffer: ((R = (D = e == null ? void 0 : e.availability) == null ? void 0 : D.availability_rules) == null ? void 0 : R.buffer) ?? { before: 0, after: 0 },
444
- cancellationPolicy: ((F = e == null ? void 0 : e.scheduler) == null ? void 0 : F.cancellation_policy) ?? "",
445
- availableDaysInFuture: ((E = e == null ? void 0 : e.scheduler) == null ? void 0 : E.available_days_in_future) ?? 30,
446
- minCancellationNotice: ((B = e == null ? void 0 : e.scheduler) == null ? void 0 : B.min_cancellation_notice) ?? 0,
447
- minBookingNotice: ((C = e == null ? void 0 : e.scheduler) == null ? void 0 : C.min_booking_notice) ?? 60,
448
- timeslotInterval: {
449
- interval: ((k = e == null ? void 0 : e.availability) == null ? void 0 : k.interval_minutes) ?? ((A = e == null ? void 0 : e.availability) == null ? void 0 : A.duration_minutes),
450
- roundTo: (S = e == null ? void 0 : e.availability) == null ? void 0 : S.round_to
451
- },
452
- additionalGuestsHidden: (($ = e == null ? void 0 : e.scheduler) == null ? void 0 : $.hide_additional_guests) ?? !1,
453
- hideCancellationOptions: ((j = e == null ? void 0 : e.scheduler) == null ? void 0 : j.hide_cancellation_options) ?? !1,
454
- hideReschedulingOptions: ((G = e == null ? void 0 : e.scheduler) == null ? void 0 : G.hide_rescheduling_options) ?? !1,
455
- participantBookingCalendars: ((J = e == null ? void 0 : e.participants) == null ? void 0 : J.reduce((P, H) => {
456
- var M, K;
457
- return (M = H.booking) != null && M.calendar_id && (P[H.email] = (K = H.booking) == null ? void 0 : K.calendar_id), P;
458
- })) ?? {},
459
- participantCalendars: ((Z = e == null ? void 0 : e.participants) == null ? void 0 : Z.reduce((P, H) => {
460
- var M;
461
- return P[H.email] = (M = H.availability) == null ? void 0 : M.calendar_ids, P;
462
- }, {})) ?? {},
463
- reminders: (Y = e == null ? void 0 : e.event_booking) == null ? void 0 : Y.reminders,
464
- emailTemplate: (q = e == null ? void 0 : e.scheduler) == null ? void 0 : q.email_template,
465
- redirectUrl: (Q = e == null ? void 0 : e.scheduler) == null ? void 0 : Q.confirmation_redirect_url,
466
- slug: e == null ? void 0 : e.slug,
467
- appearance: e == null ? void 0 : e.appearance,
468
- name: e == null ? void 0 : e.name,
469
- disableEmails: (X = e == null ? void 0 : e.event_booking) == null ? void 0 : X.disable_emails,
470
- organizerLocale: (V = (x = e == null ? void 0 : e.scheduler) == null ? void 0 : x.email_template) == null ? void 0 : V.organizer_locale
471
- };
472
- }
473
- setFormState(e, t) {
474
- switch (t) {
475
- case "title":
476
- this.formState.title = e.toString();
477
- break;
478
- case "description":
479
- this.formState.description = e.toString();
480
- break;
481
- case "duration":
482
- this.formState.duration = e.toString();
483
- break;
484
- case "availability":
485
- this.formState.availability = JSON.parse(e.toString());
486
- break;
487
- case "participants":
488
- this.formState.participants = JSON.parse(e.toString());
489
- break;
490
- case "booking-calendar":
491
- this.formState.bookingCalendar = e.toString();
492
- break;
493
- case "participant-booking-calendars":
494
- this.formState.participantBookingCalendars = JSON.parse(e.toString());
495
- break;
496
- case "location":
497
- this.formState.location = e.toString();
498
- break;
499
- case "conference":
500
- this.formState.conferencing = JSON.parse(e.toString());
501
- break;
502
- case "confirmation-type":
503
- this.formState.bookingType = e.toString();
504
- break;
505
- case "buffer-time":
506
- this.formState.buffer = JSON.parse(e.toString());
507
- break;
508
- case "limit-future-bookings":
509
- this.formState.availableDaysInFuture = parseInt(e.toString());
510
- break;
511
- case "min-cancellation-notice":
512
- this.formState.minCancellationNotice = parseInt(e.toString());
513
- break;
514
- case "min-booking-notice":
515
- this.formState.minBookingNotice = parseInt(e.toString());
516
- break;
517
- case "cancellation-policy":
518
- this.formState.cancellationPolicy = e.toString();
519
- break;
520
- case "timeslot-interval":
521
- this.formState.timeslotInterval = JSON.parse(e.toString());
522
- break;
523
- case "customize-booking-settings": {
524
- const a = JSON.parse(e.toString());
525
- this.formState.additionalGuestsHidden = a.additionalGuestsHidden, this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
526
- break;
527
- }
528
- case "participant-custom-availability": {
529
- const a = JSON.parse(e.toString());
530
- this.formState.participantOpenHours = a;
531
- break;
532
- }
533
- case "participant-custom-availability-specific-date": {
534
- const a = JSON.parse(e.toString());
535
- this.formState.participantSpecificDateOpenHours = a;
536
- break;
537
- }
538
- case "additional-fields":
539
- this.formState.additionalFields = JSON.parse(e.toString());
540
- break;
541
- case "connected-calendars":
542
- this.formState.participantCalendars = JSON.parse(e.toString());
543
- break;
544
- case "confirmation-email-template":
545
- this.formState.emailTemplate = JSON.parse(e.toString());
546
- break;
547
- case "disable-emails": {
548
- const { disableEmails: a, organizerLocale: s } = JSON.parse(e.toString());
549
- this.formState.disableEmails = a, this.formState.organizerLocale = s;
550
- break;
551
- }
552
- case "reminder-overrides":
553
- this.formState.reminders = JSON.parse(e.toString());
554
- break;
555
- case "confirmation-redirect":
556
- this.formState.redirectUrl = e.toString();
557
- break;
558
- case "availability-method":
559
- this.formState.availabilityMethod = e.toString();
560
- break;
561
- case "custom-event-slug":
562
- this.formState.slug = JSON.parse(e.toString());
563
- break;
564
- case "page-styling":
565
- this.formState.appearance = JSON.parse(e.toString());
566
- break;
567
- case "page-name":
568
- this.formState.name = JSON.parse(e.toString());
569
- break;
570
- }
571
- this.schedulerEditorFormUpdated.emit({
572
- value: e,
573
- name: t
574
- });
575
- }
576
- updateFormState() {
577
- return new FormData(this.formRef).forEach((t, a) => {
578
- this.setFormState(t, a);
579
- }), this.formState = { ...this.formState }, this.formState;
580
- }
581
- setActiveTab(e, t) {
582
- e.preventDefault(), this.updateFormState(), this.activeTab = t;
583
- }
584
- hideTab(e) {
585
- var t;
586
- return ((t = this.hideEditorTabs) == null ? void 0 : t.includes(e)) || !1;
587
- }
588
- onFeedbackClick(e) {
589
- e.preventDefault(), this.showFeedbackModal = !0;
590
- }
591
- render() {
592
- var e, t, a, s, l, r;
593
- return b("[nylas-editor-tabs]", "render", this.formState), n(ce, { key: "72e7c6a3ee3b8a45ca08be9b09bb6c4d3fe35448" }, n("nylas-notification", { key: "3001e1876764d1159fd0ce36158961d13729cb53" }), n("form", { key: "3efb8db4b99ec191dd38586162849374000301ef", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (o) => this.formRef = o, noValidate: !0 }, this.mode === "app" ? n("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, n("div", { class: "tabs", part: "editor__tabs net__tabs" }, n("button", { name: u.EventInfo, class: { tab: !0, active: this.activeTab == u.EventInfo, hide: this.hideTab(u.EventInfo) }, part: "editortab__event-info net__tab-event-info", onClick: (o) => this.setActiveTab(o, u.EventInfo) }, n("calendar-info-icon", { width: "16", height: "16" }), i.t("eventInfoTab")), n("button", { name: u.Availability, class: { tab: !0, active: this.activeTab == u.Availability, hide: this.hideTab(u.Availability) }, part: "editortab__availability net__tab-availability", onClick: (o) => this.setActiveTab(o, u.Availability) }, n("calendar-patterns-icon", { width: "16", height: "16" }), i.t("availabilityTab")), n("button", { name: u.Participants, class: { tab: !0, active: this.activeTab == u.Participants, hide: this.hideTab(u.Participants) }, part: "editortab__participants net__tab-participants", onClick: (o) => this.setActiveTab(o, u.Participants) }, n("people-icon", { width: "16", height: "16" }), i.t("participantsTab")), n("button", { name: u.BookingOptions, class: { tab: !0, active: this.activeTab == u.BookingOptions, hide: this.hideTab(u.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: (o) => this.setActiveTab(o, u.BookingOptions) }, n("flow-icon", { width: "16", height: "16" }), i.t("bookingOptionsTab")), n("button", { name: u.BookingForm, class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab(u.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: (o) => this.setActiveTab(o, u.BookingForm) }, this.activeTab == u.BookingForm ? n("calendar-agenda-fill-icon", { width: "16", height: "16" }) : n("calendar-agenda-icon", { width: "16", height: "16" }), i.t("bookingFormTab")), n("button", { name: u.Communications, class: { tab: !0, active: this.activeTab == "communications", hide: this.hideTab(u.Communications) }, onClick: (o) => this.setActiveTab(o, u.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == u.Communications ? n("envelope-fill-icon", { width: "16", height: "16" }) : n("envelope-icon", { width: "16", height: "16" }), i.t("communicationsTab")), n("button", { name: u.PageStyles, class: { tab: !0, active: this.activeTab == "pageStyles", hide: this.hideTab(u.PageStyles) }, onClick: (o) => this.setActiveTab(o, u.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == u.PageStyles ? n("paintbrush-fill-icon", { width: "16", height: "16" }) : n("paintbrush-icon", { width: "16", height: "16" }), i.t("pageStylesTab"))), n("div", { class: {
594
- "tab-content": !0,
595
- fadeIn: this.loaded
596
- }, part: "editor__tab-content net__tab-content" }, n(bt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new", i18next: i }))) : n("div", { class: "composable", key: (t = this.selectedConfiguration) == null ? void 0 : t.id }, n("slot", null)), n("div", { key: "d173c359a115d8ffedd09f7982b93ac8f56298ea", class: "footer", part: "editor__footer net__footer" }, n("div", { key: "e7d8eac3b589fdde61697b6f950ac14ca40e958b", class: "preview", part: "editor__footer-preview net__footer-preview" }, this.enableUserFeedback && n("button-component", { title: "Share your feedback", id: "report-issue", variant: "basic", onClick: (o) => this.onFeedbackClick(o) }, n("feedback-icon", null))), n("div", { key: "8ac0780973db9508e06823f6eec209d513adf70d", class: "buttons", part: "editor__footer-buttons net__footer-buttons" }, n("p", { key: "b99500cf3e2090bba348164e8ef694a31ba2292d", class: {
597
- "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
598
- "saved-changes": this.changesSaved,
599
- error: ((a = this.error) == null ? void 0 : a.message) !== "",
600
- "error-full-width": ((s = this.error) == null ? void 0 : s.message) !== "" && this.action === "create"
601
- } }, ((l = this.error) == null ? void 0 : l.message) == "" && this.hasUnsavedChanges && !this.changesSaved ? i.t("unsavedChangesLabel") : ((r = this.error) == null ? void 0 : r.message) == "" && this.changesSaved ? `${i.t("changesSavedLabel")}!` : ""), this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { title: "Preview", type: "button", disabled: this.isLoading, clickHandler: (o) => {
602
- o.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(le(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
603
- }, variant: "basic" }, n("eye-icon", null)), n("button-component", { key: "f3ce1536ba8ebb62758f8714056d528fd8258bfa", type: "button", disabled: this.isLoading, clickHandler: (o) => {
604
- o.preventDefault(), this.cancelButtonClick.emit(), this.host.resetError();
605
- }, variant: "basic", part: "editor__footer-cancel net__footer-cancel" }, i.t("cancelButton")), n("button-component", { key: "ceb6d081a90b0ff2a5d12cc4ec05d79fb726651e", class: { "save-changes": this.action === "edit" }, type: "submit", disabled: this.isLoading, part: "editor__footer-cta, net__footer-cta" }, this.isLoading ? n("span", null, i.t("savingButtonText"), n("loading-icon", null), " ") : this.action === "create" ? `${i.t("createButtonText")}` : `${i.t("saveChangesButtonText")}`)))), this.showFeedbackModal && n("nylas-feedback-form", null));
606
- }
607
- get host() {
608
- return pe(this);
609
- }
610
- static get watchers() {
611
- return {
612
- selectedConfiguration: ["configChangedHandler"],
613
- currentUser: ["userChangedHandler"],
614
- selectedLanguage: ["selectedLanguageChangedHandler"],
615
- themeConfig: ["themeConfigChangedHandler"]
616
- };
617
- }
618
- };
619
- yt([
620
- be({
621
- name: "nylas-editor-tabs",
622
- stateToProps: /* @__PURE__ */ new Map([
623
- ["schedulerConfig.calendars", "calendars"],
624
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
625
- ["schedulerConfig.currentUser", "currentUser"],
626
- ["schedulerConfig.configurations", "configurations"],
627
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
628
- ["schedulerConfig.selectedEventType", "selectedEventType"],
629
- ["schedulerConfig.themeConfig", "themeConfig"]
630
- ]),
631
- eventToProps: {
632
- schedulerConfigChanged: async (e, t) => {
633
- const { resetLoadingState: a, host: s, action: l, config: r } = e.detail, o = (d, c) => {
634
- const [p, h] = d;
635
- !p && h ? s.setError({
636
- message: h.message || i.t("genericErrorTitle"),
637
- type: _.Error,
638
- category: v.Component,
639
- title: c
640
- }) : p && !h && l === "create" && (s.schedulerConfigCreatedEventHandler({ config: p, action: l, host: s }), t.schedulerConfigStore.set("selectedEventType", void 0)), a && a(e);
641
- };
642
- if (l === "edit") {
643
- const d = await t.schedulerConfig.updateConfiguration(r);
644
- o(d, i.t("nylasEditorTabs.updateConfigError"));
645
- } else {
646
- const d = await t.schedulerConfig.createConfiguration(r);
647
- o(d, i.t("nylasEditorTabs.createConfigError"));
648
- }
649
- },
650
- cancelButtonClick: async (e, t) => {
651
- t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0);
652
- },
653
- previewButtonClicked: async (e, t) => {
654
- b("[nylas-editor-tabs]", "previewButtonClicked", t);
655
- },
656
- formSubmitted: async (e, t) => {
657
- b("[nylas-editor-tabs]", "formSubmitted", t);
658
- },
659
- schedulerEditorFormUpdated: async (e, t) => {
660
- b("[nylas-editor-tabs]", "schedulerEditorFormUpdated", e);
661
- },
662
- schedulerConfigCreated: async (e, t) => {
663
- b("[nylas-editor-tabs]", "schedulerConfigCreated", e);
664
- }
665
- },
666
- localPropsToProp: /* @__PURE__ */ new Map([
667
- ["schedulerPreviewLink", "schedulerPreviewLink"],
668
- ["enableUserFeedback", "enableUserFeedback"],
669
- ["hideEditorTabs", "hideEditorTabs"]
670
- ]),
671
- fireRegisterEvent: !0
672
- }),
673
- ye("design:type", Function),
674
- ye("design:paramtypes", []),
675
- ye("design:returntype", void 0)
676
- ], Ke.prototype, "render", null);
677
- Ke.style = ht;
678
- var g;
679
- (function(e) {
680
- e.BookingOptions = "bookingOptions", e.Communications = "communications", e.BookingForm = "bookingForm", e.PageStyles = "pageStyles", e.CalendarView = "calendarView";
681
- })(g || (g = {}));
682
- function gt({ id: e, formState: t, activeTab: a }, s) {
683
- return n(
684
- de,
685
- null,
686
- a === g.CalendarView && n(
687
- "div",
688
- { key: `calendar-view-${e}`, class: { hide: a !== g.CalendarView, "calendar-view": !0 } },
689
- n("nylas-event-calendar", null)
690
- ),
691
- n(
692
- "div",
693
- { key: `booking-options-${e}`, class: { hide: a !== g.BookingOptions } },
694
- n("nylas-scheduling-method", { name: "availability-method", readOnly: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
695
- n(
696
- "nylas-custom-booking-flow",
697
- { exportparts: "ncbflow, ncbflow__header, ncbflow__title, ncbflow__content" },
698
- n(
699
- "div",
700
- { slot: "inputs" },
701
- n("nylas-booking-confirmation-type", { name: "confirmation-type", showComponent: !1, exportparts: "nbct, nbct__header, nbct__dropdown, nbct__dropdown-button, nbct__dropdown-content" }),
702
- n("nylas-booking-confirmation-redirect", { name: "confirmation-redirect", exportparts: "nbcr, nbcr__header, nbcr__dropdown, nbcr__dropdown-button, nbcr__dropdown-content, nbcr__input-textfield" })
703
- )
704
- ),
705
- n(
706
- "nylas-event-limits",
707
- null,
708
- n(
709
- "div",
710
- { slot: "inputs" },
711
- n("nylas-min-booking-notice", { name: "min-booking-notice", exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
712
- n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
713
- n("nylas-cancellation-policy", { name: "cancellation-policy", exportparts: "ncpolicy, ncpolicy__textarea" })
714
- )
715
- ),
716
- n("nylas-customize-booking-settings", { showSettings: ["hideCancellationOptions", "hideReschedulingOptions"], name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
717
- ),
718
- n(
719
- "div",
720
- { key: `communications-${e}`, class: { hide: a !== g.Communications } },
721
- n("nylas-disable-emails", { name: "disable-emails", exportparts: "nde, nde__toggle-label, nde_toggle-input, nde_toggle-slider" }),
722
- !(t != null && t.disableEmails) && n(
723
- de,
724
- null,
725
- n("nylas-confirmation-email", { name: "confirmation-email-template", exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" }),
726
- n("nylas-reminder-emails", { name: "reminder-overrides", exportparts: "nre, nre__tab-heading, nre__header, nre__body, nre__confirmation-email-toggle--container, nre__summary, nrt, nrt__number-dropdown, nrt__number-dropdown-button, nrt__number-dropdown-content, nrt__period-dropdown, nrt__period-dropdown-button, nrt__period-dropdown-content, nrt__time-period-selector" })
727
- )
728
- ),
729
- n(
730
- "div",
731
- { key: `page-styles-${e}`, class: { hide: a !== g.PageStyles } },
732
- n("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
733
- n("nylas-page-name", { name: "page-name", requirePageName: !0, exportparts: "npn, npn__body, npn__header, npn__drawer-toggle--container, npn__input-textfield" }),
734
- n("nylas-page-styling", { name: "page-styling", exportparts: "nps, nps__header, nps__drawer-toggle--container, nps__body, nps__title-input-textfield, nps__company-logo-input-textfield, nps__color-picker, nps__color-picker-button, nps__color-picker-button-label, nps__color-picker-selected-label, nps__submit-button-label-input-textfield, nps__message-textarea" }, s)
735
- ),
736
- n(
737
- "div",
738
- { key: `booking-form-${e}`, class: { hide: a !== g.BookingForm } },
739
- n("nylas-booking-form-config", { name: "additional-fields", exportparts: "nbfc, nbfc__header, nbfc__add_field, nbfc__add_field-button, nbfc__add_field-content, nbfc__static_fields, nbfc__additional_fields, nbfc__form-field, nbfc__form-field-header, nbfc__form-field-content" })
740
- )
741
- );
742
- }
743
- const ft = '.sc-nylas-editor-tabs-group-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.scheduler-editor.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;height:inherit;position:relative}.scheduler-editor.sc-nylas-editor-tabs-group div.return-to-calendar-view.sc-nylas-editor-tabs-group{display:flex;border-bottom:1px solid var(--nylas-base-200)}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group{display:grid;grid-template-columns:minmax(224px, 25%) 1fr;height:auto;overflow-y:auto;min-height:calc(100% - 80px - 48px)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group{display:table-column-group;height:auto;min-height:calc(100% - 80px - 196px - 48px)}}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group{border-right:none}}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group{display:flex;align-items:center;text-align:left;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-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group:last-of-type{margin-bottom:0.25rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.active.sc-nylas-editor-tabs-group{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-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.hide.sc-nylas-editor-tabs-group{display:none}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group{max-width:692px;overflow-y:auto;overflow-x:hidden}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .hide.sc-nylas-editor-tabs-group{display:none}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .calendar-view.sc-nylas-editor-tabs-group{position:absolute;top:0;left:0;height:calc(100% - 80px);width:-webkit-fill-available;background:var(--nylas-base-0)}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-info.sc-nylas-editor-tabs-group,.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-limits.sc-nylas-editor-tabs-group{width:inherit}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-info.sc-nylas-editor-tabs-group div[slot=inputs].sc-nylas-editor-tabs-group,.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-limits.sc-nylas-editor-tabs-group div[slot=inputs].sc-nylas-editor-tabs-group{display:flex;flex-direction:column;gap:1rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group h3.sc-nylas-editor-tabs-group{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group p.sc-nylas-editor-tabs-group{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.footer.sc-nylas-editor-tabs-group{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group{flex-direction:column;height:auto;z-index:2}}.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group{display:flex;gap:16px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group button-component.page-settings-button.sc-nylas-editor-tabs-group{min-width:140px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group{display:flex;gap:16px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group{width:100%}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group button-component[title=Preview].sc-nylas-editor-tabs-group{width:48px}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.sc-nylas-editor-tabs-group{max-width:524px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.unsaved-changes.sc-nylas-editor-tabs-group{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.saved-changes.sc-nylas-editor-tabs-group{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.error.sc-nylas-editor-tabs-group{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.error-full-width.sc-nylas-editor-tabs-group{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button-component.sc-nylas-editor-tabs-group{width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group span.sc-nylas-editor-tabs-group{display:flex;align-items:center;justify-content:center;gap:0.5rem}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button-component.save-changes.sc-nylas-editor-tabs-group{min-width:140px}button-component#report-issue.sc-nylas-editor-tabs-group{width:auto}nylas-feedback-form.sc-nylas-editor-tabs-group{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', mt = ft;
744
- var _t = function(e, t, a, s) {
745
- var l = arguments.length, r = l < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, o;
746
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
747
- r = Reflect.decorate(e, t, a, s);
748
- else
749
- for (var d = e.length - 1; d >= 0; d--)
750
- (o = e[d]) && (r = (l < 3 ? o(r) : l > 3 ? o(t, a, r) : o(t, a)) || r);
751
- return l > 3 && r && Object.defineProperty(t, a, r), r;
752
- }, ge = function(e, t) {
753
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
754
- return Reflect.metadata(e, t);
755
- };
756
- const Ye = class {
757
- constructor(e) {
758
- te(this, e), this.schedulerConfigChanged = m(this, "schedulerConfigChanged", 7), this.schedulerConfigCreated = m(this, "schedulerConfigCreated", 7), this.cancelButtonClick = m(this, "cancelButtonClick", 7), this.formSubmitted = m(this, "formSubmitted", 7), this.previewButtonClicked = m(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = m(this, "schedulerEditorFormUpdated", 7), this.groupEventCreateTriggered = m(this, "groupEventCreateTriggered", 7), this.groupEventUpdateTriggered = m(this, "groupEventUpdateTriggered", 7), this.groupEventDeleteTriggered = m(this, "groupEventDeleteTriggered", 7), this.groupEventImportTriggered = m(this, "groupEventImportTriggered", 7), this.saveGroupEventChangesError = m(this, "saveGroupEventChangesError", 7), this.nylasSchedulerError = m(this, "nylasSchedulerError", 6), this.dismissNotification = m(this, "dismissNotification", 6), this.formSubmissionHandler = async (t) => {
759
- var x, V, P, H, M, K, ne, oe, W, se, re;
760
- t.preventDefault();
761
- const a = await this.formSubmitted.emit();
762
- if (b("[nylas-editor-tabs-group]", "formSubmissionHandler", a), !this.formRef.checkValidity() || a.defaultPrevented) {
763
- await this.host.setError({
764
- message: this.formRef.validationMessage || i.t("fixFormErrors"),
765
- type: _.Error,
766
- category: v.Component,
767
- title: i.t("nylasEditorTabs.formErrorTitle")
768
- });
769
- return;
770
- }
771
- this.isLoading = !0, this.hasUnsavedChanges = !1;
772
- const l = this.updateFormState();
773
- b("[nylas-editor-tabs-group]", "formState", l);
774
- const { title: r, description: o, bookingCalendar: d, location: c, bookingType: p, minCancellationNotice: h, minBookingNotice: f, cancellationPolicy: w, hideCancellationOptions: T, hideReschedulingOptions: O, additionalFields: U, conferencing: N, reminders: L, emailTemplate: z, redirectUrl: D, slug: R, appearance: F, name: E, eventCapacity: B, eventTimeslot: C, participants: k, disableEmails: A, organizerLocale: S } = l, $ = {
775
- ...((x = this.selectedConfiguration) == null ? void 0 : x.id) && { id: this.selectedConfiguration.id },
776
- slug: R,
777
- name: E,
778
- type: this.selectedEventType === I.group ? I.group : void 0,
779
- scheduler: {
780
- cancellation_policy: w ?? "",
781
- min_cancellation_notice: h ?? 0,
782
- min_booking_notice: f ?? 60,
783
- hide_cancellation_options: T ?? !1,
784
- hide_rescheduling_options: O ?? !1,
785
- additional_fields: U,
786
- email_template: z ? {
787
- ...z,
788
- organizer_locale: S || "en",
789
- logo: z.logo || ""
790
- } : void 0,
791
- confirmation_redirect_url: D
792
- },
793
- appearance: F,
794
- group_booking: {
795
- booking_type: p || "booking",
796
- disable_emails: typeof A == "boolean" ? A : !1,
797
- reminders: L,
798
- conferencing: N,
799
- calendar_id: d || "primary",
800
- default_capacity: B || 10
801
- }
802
- }, j = _e(this.selectedConfiguration, $ || {}), G = this.action === "create" ? j : $;
803
- delete G.availability, delete G.participants, delete G.event_booking;
804
- const J = (ie) => {
805
- this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
806
- this.changesSaved = !1;
807
- }, 3e3);
808
- };
809
- if (this.checkForBookingFormErrors(G))
810
- return;
811
- const Y = {
812
- name: ((V = this.currentUser) == null ? void 0 : V.name) ?? ((P = this.currentUser) == null ? void 0 : P.email) ?? "",
813
- email: ((H = this.currentUser) == null ? void 0 : H.email) ?? ""
814
- }, q = ((M = this.calendars) == null ? void 0 : M.find((ie) => ie.is_primary)) ?? ((K = this.calendars) == null ? void 0 : K[0]), Q = [{ ...Y, is_organizer: !0 }], X = (ne = this.selectedConfiguration) != null && ne.id ? void 0 : {
815
- title: r,
816
- description: o,
817
- location: N ? void 0 : c,
818
- conferencing: c ? void 0 : N,
819
- when: {
820
- start_time: ((oe = C == null ? void 0 : C.when) == null ? void 0 : oe.start_time) ?? 0,
821
- end_time: ((W = C == null ? void 0 : C.when) == null ? void 0 : W.end_time) ?? 0,
822
- start_timezone: ((se = C == null ? void 0 : C.when) == null ? void 0 : se.start_timezone) ?? "",
823
- end_timezone: ((re = C == null ? void 0 : C.when) == null ? void 0 : re.end_timezone) ?? ""
824
- },
825
- recurrence: (C == null ? void 0 : C.recurrence) ?? [],
826
- calendar_id: d || (q == null ? void 0 : q.id) || "primary",
827
- participants: k != null && k.length ? k : Q,
828
- organizer: Y,
829
- capacity: B || 10
830
- };
831
- this.schedulerConfigChanged.emit({ groupEvent: X || void 0, config: G, resetLoadingState: J, action: this.action, host: this.host });
832
- }, this.checkForBookingFormErrors = (t) => {
833
- var r;
834
- let a = !1, s = "";
835
- const l = (r = t.scheduler) == null ? void 0 : r.additional_fields;
836
- return l && (s = "", Object.entries(l).forEach((o) => {
837
- const d = o[1];
838
- if (d.label === "") {
839
- s += i.t("nylasEditorTabs.bookingFormError_label", { type: d.type }), a = !0;
840
- return;
841
- }
842
- if (d.options) {
843
- for (const c of d.options)
844
- if (c.trim() === "") {
845
- s += i.t("nylasEditorTabs.bookingFormError_option", { label: d.label, type: d.type }), a = !0;
846
- break;
847
- }
848
- }
849
- })), a && (this.isLoading = !1, this.host.setError({
850
- message: s,
851
- type: _.Error,
852
- category: v.Component,
853
- title: i.t("nylasEditorTabs.bookingFormError")
854
- })), a;
855
- }, this.calendars = void 0, this.selectedConfiguration = void 0, this.configurations = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.enableUserFeedback = !0, this.selectedLanguage = void 0, this.selectedEventType = void 0, this.selectedGroupEvent = void 0, this.themeConfig = void 0, this.action = "create", this.showFeedbackModal = !1, this.activeTab = g.CalendarView, this.isLoading = !1, this.componentLoaded = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = {
856
- message: "",
857
- type: _.Error,
858
- category: v.Component,
859
- title: ""
860
- };
861
- }
862
- configChangedHandler(e) {
863
- b("[nylas-editor-tabs-group]", "configChangedHandler", e, this.selectedConfiguration), this.formState = {
864
- ...this.getFormStateFromConfig(e)
865
- }, e != null && e.id ? this.action = "edit" : this.action = "create";
866
- }
867
- selectedGroupEventChangedHandler(e) {
868
- var t, a, s, l, r, o, d, c, p, h, f, w, T, O, U, N, L, z, D, R, F, E, B, C, k, A, S, $, j, G, J;
869
- b("[nylas-editor-tabs-group]", "selectedGroupEventChangedHandler", e, this.selectedConfiguration), this.formState = {
870
- ...this.formState,
871
- title: (a = (t = this.selectedGroupEvent) == null ? void 0 : t.event) == null ? void 0 : a.title,
872
- description: (l = (s = this.selectedGroupEvent) == null ? void 0 : s.event) == null ? void 0 : l.description,
873
- location: (o = (r = this.selectedGroupEvent) == null ? void 0 : r.event) == null ? void 0 : o.location,
874
- conferencing: (c = (d = this.selectedGroupEvent) == null ? void 0 : d.event) == null ? void 0 : c.conferencing,
875
- eventCapacity: (h = (p = this.selectedGroupEvent) == null ? void 0 : p.group_event_info) == null ? void 0 : h.capacity,
876
- participants: (T = (w = (f = this.selectedGroupEvent) == null ? void 0 : f.group_event_info) == null ? void 0 : w.participants) == null ? void 0 : T.map((Z) => ({
877
- name: Z.name,
878
- email: Z.email,
879
- is_organizer: !!Z.is_organizer
880
- })),
881
- eventTimeslot: (U = (O = this.selectedGroupEvent) == null ? void 0 : O.event) != null && U.when ? {
882
- when: {
883
- start_time: (z = (L = (N = this.selectedGroupEvent) == null ? void 0 : N.event) == null ? void 0 : L.when) == null ? void 0 : z.start_time,
884
- end_time: (F = (R = (D = this.selectedGroupEvent) == null ? void 0 : D.event) == null ? void 0 : R.when) == null ? void 0 : F.end_time,
885
- start_timezone: (C = (B = (E = this.selectedGroupEvent) == null ? void 0 : E.event) == null ? void 0 : B.when) == null ? void 0 : C.start_timezone,
886
- end_timezone: (S = (A = (k = this.selectedGroupEvent) == null ? void 0 : k.event) == null ? void 0 : A.when) == null ? void 0 : S.end_timezone
887
- },
888
- recurrence: (j = ($ = this.selectedGroupEvent) == null ? void 0 : $.group_event_info) != null && j.rrule ? (J = (G = this.selectedGroupEvent) == null ? void 0 : G.group_event_info) == null ? void 0 : J.rrule : []
889
- } : void 0
890
- };
891
- }
892
- userChangedHandler(e) {
893
- b("[nylas-editor-tabs-group]", "userChangedHandler", e), e && (this.formState = {
894
- ...this.getFormStateFromConfig(this.selectedConfiguration)
895
- });
896
- }
897
- selectedLanguageChangedHandler(e, t) {
898
- e !== t && (i.changeLanguage(e), this.error && this.error.message && (this.error = {
899
- ...this.error,
900
- message: i.t("fixFormErrors")
901
- }, this.showErrorNotification(this.error)));
902
- }
903
- themeConfigChangedHandler(e, t) {
904
- e !== t && this.applyThemeConfig(e);
905
- }
906
- applyThemeConfig(e) {
907
- if (e)
908
- for (const [t, a] of Object.entries(e))
909
- this.host.style.setProperty(`${t}`, a);
910
- }
911
- async schedulerConfigCreatedEventHandler(e) {
912
- return this.schedulerConfigCreated.emit(e);
913
- }
914
- async setError(e) {
915
- var t;
916
- this.error = {
917
- message: e.message,
918
- type: e.type,
919
- category: e.category,
920
- title: e.title || i.t("genericErrorTitle")
921
- }, (t = this.error) != null && t.message && this.showErrorNotification(this.error);
922
- }
923
- async resetError() {
924
- var e, t;
925
- (e = this.error) != null && e.message && this.dismissNotification.emit({ id: (t = this.error) == null ? void 0 : t.message.split(" ").join("-"), host: this.host }), this.error = {
926
- message: "",
927
- type: _.Error,
928
- category: v.Component,
929
- title: ""
930
- };
931
- }
932
- connectedCallback() {
933
- b("[nylas-editor-tabs-group]", "connectedCallback");
934
- }
935
- componentWillLoad() {
936
- b("[nylas-editor-tabs-group]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
937
- }
938
- componentDidLoad() {
939
- var t, a, s;
940
- b("[nylas-editor-tabs-group]", "componentDidLoad"), this.enableUserFeedback && !Je() && Ve({
941
- dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
942
- release: "2.0.6",
943
- integrations: (l) => [
944
- ...l.filter((r) => !1),
945
- qe({
946
- colorScheme: "system",
947
- autoInject: !1
948
- })
949
- ],
950
- autoSessionTracking: !1,
951
- beforeSend: () => null
952
- }), (t = this.selectedConfiguration) != null && t.id && this.configChangedHandler(this.selectedConfiguration);
953
- const e = (a = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : a.name;
954
- e && ((s = this.hideEditorTabs) != null && s.includes(this.activeTab)) && (this.activeTab = e), this.updateFormState(), this.componentLoaded = !0;
955
- }
956
- disconnectedCallback() {
957
- b("[nylas-editor-tabs-group]", "disconnectedCallback");
958
- }
959
- handleValueChanged(e) {
960
- b("[nylas-editor-tabs-group]", "handleValueChanged", e);
961
- const { name: t, value: a } = e.detail;
962
- console.log("name", t, "value", a), this.setFormState(a, t), this.formState = { ...this.formState }, st.includes(t) && (this.hasUnsavedChanges = !0), this.host.resetError(), this.schedulerEditorFormUpdated.emit({
963
- value: e.detail.value,
964
- name: e.detail.name
965
- });
966
- }
967
- feedbackModalClosedHandler() {
968
- this.showFeedbackModal = !1;
969
- }
970
- feedbackSubmittedHandler(e) {
971
- var s, l;
972
- const a = {
973
- eventId: Ze("Scheduler Editor User Feedback"),
974
- message: e.detail.feedback
975
- };
976
- We(a, {
977
- includeReplay: !0,
978
- captureContext: {
979
- tags: {
980
- "nylas-web-element": "nylas-scheduler-editor",
981
- "nylas-web-element-version": "2.0.6"
982
- },
983
- extra: {
984
- configId: (s = this.selectedConfiguration) == null ? void 0 : s.id,
985
- slug: (l = this.selectedConfiguration) == null ? void 0 : l.slug
986
- }
987
- }
988
- }), this.showFeedbackModal = !1;
989
- }
990
- importGroupEventHandler(e) {
991
- var t;
992
- this.groupEventImportTriggered.emit({ groupEvent: e.detail, configId: ((t = this.selectedConfiguration) == null ? void 0 : t.id) ?? "", host: this.host });
993
- }
994
- saveGroupEventChangesHandler(e) {
995
- var s, l, r, o, d, c, p, h, f;
996
- b("saveGroupEventChangesHandler", e.detail, this.selectedGroupEvent);
997
- const t = this.formRef.checkValidity(), a = this.getGroupEventDetailsFromFormState();
998
- if (this.resetError(), a.title || this.setError({
999
- message: i.t("nylasEditorTabsGroup.eventTitleRequired"),
1000
- type: _.Error,
1001
- category: v.Component,
1002
- title: i.t("nylasEditorTabs.formErrorTitle")
1003
- }), (!((s = a.when) != null && s.start_time) || !((l = a.when) != null && l.end_time)) && this.setError({
1004
- message: i.t("nylasEditorTabsGroup.eventTimeRequired"),
1005
- type: _.Error,
1006
- category: v.Component,
1007
- title: i.t("nylasEditorTabs.formErrorTitle")
1008
- }), (r = a.participants) != null && r.length || this.setError({
1009
- message: i.t("nylasEditorTabsGroup.participantsRequired"),
1010
- type: _.Error,
1011
- category: v.Component,
1012
- title: i.t("nylasEditorTabs.formErrorTitle")
1013
- }), (o = a.participants) != null && o.length && ((d = a.participants) != null && d.some((w) => !w.email)) && this.setError({
1014
- message: i.t("nylasEditorTabsGroup.participantEmailRequired"),
1015
- type: _.Error,
1016
- category: v.Component,
1017
- title: i.t("nylasEditorTabs.formErrorTitle")
1018
- }), ((c = this.error) == null ? void 0 : c.message) !== "" || !t) {
1019
- this.saveGroupEventChangesError.emit({
1020
- error: ((p = this.error) == null ? void 0 : p.message) ?? i.t("nylasEditorTabsGroup.errorOccured"),
1021
- configId: ((h = this.selectedConfiguration) == null ? void 0 : h.id) ?? "",
1022
- host: this.host
1023
- });
1024
- return;
1025
- }
1026
- this.groupEventUpdateTriggered.emit({
1027
- groupEvent: a,
1028
- chosenOption: e.detail.action,
1029
- configId: ((f = this.selectedConfiguration) == null ? void 0 : f.id) ?? "",
1030
- host: this.host
1031
- });
1032
- }
1033
- deleteGroupEventHandler(e) {
1034
- var a;
1035
- b("deleteGroupEventHandler", e.detail);
1036
- const t = this.getGroupEventDetailsFromFormState();
1037
- this.groupEventDeleteTriggered.emit({
1038
- groupEvent: t,
1039
- chosenOption: e.detail.action,
1040
- configId: ((a = this.selectedConfiguration) == null ? void 0 : a.id) ?? "",
1041
- host: this.host
1042
- });
1043
- }
1044
- createGroupEventHandler(e) {
1045
- var o, d, c, p, h, f, w;
1046
- const t = e.detail, a = {
1047
- name: ((o = this.currentUser) == null ? void 0 : o.name) ?? ((d = this.currentUser) == null ? void 0 : d.email) ?? "",
1048
- email: ((c = this.currentUser) == null ? void 0 : c.email) ?? ""
1049
- }, s = ((p = this.calendars) == null ? void 0 : p.find((T) => T.is_primary)) ?? ((h = this.calendars) == null ? void 0 : h[0]), l = ((f = this.formState) == null ? void 0 : f.conferencing) || t.conferencing, r = {
1050
- title: t.title,
1051
- description: t.description,
1052
- location: l ? void 0 : t.location,
1053
- participants: t.participants,
1054
- organizer: a,
1055
- conferencing: t.location ? {} : l,
1056
- when: t.eventTimeslot.when,
1057
- recurrence: t.eventTimeslot.recurrence,
1058
- calendar_id: (s == null ? void 0 : s.id) || "primary",
1059
- capacity: t.eventCapacity
1060
- };
1061
- this.groupEventCreateTriggered.emit({ groupEvent: r, configId: ((w = this.selectedConfiguration) == null ? void 0 : w.id) ?? "", host: this.host });
1062
- }
1063
- showErrorNotification(e) {
1064
- this.nylasSchedulerError.emit({
1065
- notification: {
1066
- title: e.title,
1067
- category: e.category || v.Component,
1068
- type: e.type || _.Error,
1069
- description: e.message,
1070
- id: e.message.split(" ").join("-"),
1071
- ttl: "none"
1072
- },
1073
- host: this.host
1074
- });
1075
- }
1076
- getGroupEventDetailsFromFormState() {
1077
- var f, w, T, O, U, N, L, z, D;
1078
- const e = ((f = this.calendars) == null ? void 0 : f.find((R) => R.is_primary)) ?? ((w = this.calendars) == null ? void 0 : w[0]), t = {
1079
- name: ((T = this.currentUser) == null ? void 0 : T.name) ?? ((O = this.currentUser) == null ? void 0 : O.email) ?? "",
1080
- email: ((U = this.currentUser) == null ? void 0 : U.email) ?? ""
1081
- }, a = [{ ...t, is_organizer: !0 }], { title: s, description: l, bookingCalendar: r, location: o, conferencing: d, eventCapacity: c, eventTimeslot: p, participants: h } = this.formState;
1082
- return {
1083
- title: s,
1084
- description: l,
1085
- location: d ? void 0 : o,
1086
- conferencing: o ? void 0 : d,
1087
- when: {
1088
- start_time: ((N = p == null ? void 0 : p.when) == null ? void 0 : N.start_time) ?? 0,
1089
- end_time: ((L = p == null ? void 0 : p.when) == null ? void 0 : L.end_time) ?? 0,
1090
- start_timezone: ((z = p == null ? void 0 : p.when) == null ? void 0 : z.start_timezone) ?? "",
1091
- end_timezone: ((D = p == null ? void 0 : p.when) == null ? void 0 : D.end_timezone) ?? ""
1092
- },
1093
- recurrence: (p == null ? void 0 : p.recurrence) ?? [],
1094
- calendar_id: r || (e == null ? void 0 : e.id) || "primary",
1095
- participants: h != null && h.length ? h : a,
1096
- organizer: t,
1097
- capacity: c || 10
1098
- };
1099
- }
1100
- getFormStateFromConfig(e) {
1101
- var t, a, s, l, r, o, d, c, p, h, f, w, T, O;
1102
- return e != null && e.appearance && console.info("Appearance settings have been returned from the given configuration; please remember to grab them from the configSettingsLoaded event and apply them as desired."), {
1103
- additionalFields: ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.additional_fields) ?? {},
1104
- bookingType: ((a = e == null ? void 0 : e.group_booking) == null ? void 0 : a.booking_type) ?? "booking",
1105
- cancellationPolicy: ((s = e == null ? void 0 : e.scheduler) == null ? void 0 : s.cancellation_policy) ?? "",
1106
- minCancellationNotice: ((l = e == null ? void 0 : e.scheduler) == null ? void 0 : l.min_cancellation_notice) ?? 0,
1107
- minBookingNotice: ((r = e == null ? void 0 : e.scheduler) == null ? void 0 : r.min_booking_notice) ?? 60,
1108
- hideCancellationOptions: ((o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.hide_cancellation_options) ?? !1,
1109
- hideReschedulingOptions: ((d = e == null ? void 0 : e.scheduler) == null ? void 0 : d.hide_rescheduling_options) ?? !1,
1110
- reminders: (c = e == null ? void 0 : e.group_booking) == null ? void 0 : c.reminders,
1111
- emailTemplate: (p = e == null ? void 0 : e.scheduler) == null ? void 0 : p.email_template,
1112
- redirectUrl: (h = e == null ? void 0 : e.scheduler) == null ? void 0 : h.confirmation_redirect_url,
1113
- slug: e == null ? void 0 : e.slug,
1114
- appearance: e == null ? void 0 : e.appearance,
1115
- name: e == null ? void 0 : e.name,
1116
- bookingCalendar: (f = e == null ? void 0 : e.group_booking) == null ? void 0 : f.calendar_id,
1117
- disableEmails: (w = e == null ? void 0 : e.group_booking) == null ? void 0 : w.disable_emails,
1118
- organizerLocale: (O = (T = e == null ? void 0 : e.scheduler) == null ? void 0 : T.email_template) == null ? void 0 : O.organizer_locale
1119
- };
1120
- }
1121
- setFormState(e, t) {
1122
- switch (t) {
1123
- case "title":
1124
- this.formState.title = e.toString();
1125
- break;
1126
- case "description":
1127
- this.formState.description = e.toString();
1128
- break;
1129
- case "location":
1130
- this.formState.location = e.toString();
1131
- break;
1132
- case "conference":
1133
- this.formState.conferencing = JSON.parse(e.toString());
1134
- break;
1135
- case "confirmation-type":
1136
- this.formState.bookingType = e.toString();
1137
- break;
1138
- case "min-cancellation-notice":
1139
- this.formState.minCancellationNotice = parseInt(e.toString());
1140
- break;
1141
- case "min-booking-notice":
1142
- this.formState.minBookingNotice = parseInt(e.toString());
1143
- break;
1144
- case "cancellation-policy":
1145
- this.formState.cancellationPolicy = e.toString();
1146
- break;
1147
- case "customize-booking-settings": {
1148
- const a = JSON.parse(e.toString());
1149
- this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
1150
- break;
1151
- }
1152
- case "booking-calendar":
1153
- this.formState.bookingCalendar = e.toString();
1154
- break;
1155
- case "event-capacity":
1156
- this.formState.eventCapacity = parseInt(String(e));
1157
- break;
1158
- case "additional-fields":
1159
- this.formState.additionalFields = JSON.parse(e.toString());
1160
- break;
1161
- case "confirmation-email-template":
1162
- this.formState.emailTemplate = JSON.parse(e.toString());
1163
- break;
1164
- case "reminder-overrides":
1165
- this.formState.reminders = JSON.parse(e.toString());
1166
- break;
1167
- case "confirmation-redirect":
1168
- this.formState.redirectUrl = e.toString();
1169
- break;
1170
- case "custom-event-slug":
1171
- console.debug("custom-event-slug", e), this.formState.slug = JSON.parse(e.toString());
1172
- break;
1173
- case "page-styling":
1174
- this.formState.appearance = JSON.parse(e.toString());
1175
- break;
1176
- case "page-name":
1177
- this.formState.name = JSON.parse(e.toString());
1178
- break;
1179
- case "participants": {
1180
- const a = JSON.parse(e.toString());
1181
- this.formState.participants = a.map((s) => ({
1182
- name: s.name,
1183
- email: s.email,
1184
- is_organizer: s.is_organizer
1185
- }));
1186
- break;
1187
- }
1188
- case "event-timeslot":
1189
- this.formState.eventTimeslot = JSON.parse(e.toString());
1190
- break;
1191
- case "disable-emails": {
1192
- const { disableEmails: a, organizerLocale: s } = JSON.parse(e.toString());
1193
- this.formState.disableEmails = a, this.formState.organizerLocale = s;
1194
- break;
1195
- }
1196
- }
1197
- this.schedulerEditorFormUpdated.emit({
1198
- value: e,
1199
- name: t
1200
- });
1201
- }
1202
- updateFormState() {
1203
- return new FormData(this.formRef).forEach((t, a) => {
1204
- this.setFormState(t, a);
1205
- }), this.formState = { ...this.formState }, this.formState;
1206
- }
1207
- setActiveTab(e, t) {
1208
- e.preventDefault(), this.updateFormState(), this.activeTab = t;
1209
- }
1210
- hideTab(e) {
1211
- var t;
1212
- return ((t = this.hideEditorTabs) == null ? void 0 : t.includes(e)) || !1;
1213
- }
1214
- onFeedbackClick(e) {
1215
- e.preventDefault(), this.showFeedbackModal = !0;
1216
- }
1217
- render() {
1218
- var e, t, a, s, l, r;
1219
- return b("[nylas-editor-tabs-group]", "render", this.formState), n(ce, { key: "76c493a97bfd6a0ba5a98233a2d4fecd29e73f4f" }, n("nylas-notification", { key: "28d9095c59ca8eb5a8bc2a10358263dd8b478657" }), n("form", { key: "70d81a11affc5eaa0d493f71a7da42588b7d2ea2", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (o) => this.formRef = o, noValidate: !0 }, this.mode === "app" ? n("div", { class: "return-to-calendar-view", part: "editor__return-to-calendar-view net__return-to-calendar-view" }, n("button-component", { id: "return-to-calendar-view-button", variant: "invisible", part: "nset__header__back-button", type: "button", onClick: (o) => {
1220
- this.setActiveTab(o, g.CalendarView);
1221
- } }, n("chevron-icon", { width: "16", height: "16" }), n("span", null, i.t("returnToCalendarView")))) : null, this.mode === "app" ? n("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, n("div", { class: "tabs", part: "editor__tabs net__tabs" }, n("button", { name: g.BookingOptions, class: { tab: !0, active: this.activeTab == g.BookingOptions, hide: this.hideTab(g.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: (o) => this.setActiveTab(o, g.BookingOptions) }, n("flow-icon", { width: "16", height: "16" }), i.t("bookingOptionsTab")), n("button", { name: g.BookingForm, class: { tab: !0, active: this.activeTab == g.BookingForm, hide: this.hideTab(g.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: (o) => this.setActiveTab(o, g.BookingForm) }, this.activeTab == g.BookingForm ? n("calendar-agenda-fill-icon", { width: "16", height: "16" }) : n("calendar-agenda-icon", { width: "16", height: "16" }), i.t("bookingFormTab")), n("button", { name: g.Communications, class: { tab: !0, active: this.activeTab == g.Communications, hide: this.hideTab(g.Communications) }, onClick: (o) => this.setActiveTab(o, g.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == g.Communications ? n("envelope-fill-icon", { width: "16", height: "16" }) : n("envelope-icon", { width: "16", height: "16" }), i.t("communicationsTab")), n("button", { name: g.PageStyles, class: { tab: !0, active: this.activeTab == g.PageStyles, hide: this.hideTab(g.PageStyles) }, onClick: (o) => this.setActiveTab(o, g.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == g.PageStyles ? n("paintbrush-fill-icon", { width: "16", height: "16" }) : n("paintbrush-icon", { width: "16", height: "16" }), i.t("pageStylesTab"))), n("div", { class: "tab-content", part: "editor__tab-content net__tab-content" }, n(gt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new", i18next: i }))) : n("div", { class: "composable", key: (t = this.selectedConfiguration) == null ? void 0 : t.id }, n("slot", null)), n("div", { key: "dd5ef485c1aa6955264379915867a5bda111a2b5", class: "footer", part: "editor__footer net__footer" }, n("div", { key: "5431c3dd9e45ee66cbd22c038546f6e97b82aff1", class: "preview", part: "editor__footer-preview net__footer-preview" }, this.enableUserFeedback && n("button-component", { title: "Share your feedback", id: "report-issue", variant: "basic", onClick: (o) => this.onFeedbackClick(o) }, n("feedback-icon", null)), this.activeTab === g.CalendarView && n("button-component", { class: "page-settings-button", title: "Go to page settings", id: "page-settings", variant: "basic", onClick: (o) => this.setActiveTab(o, g.BookingOptions) }, i.t("pageSettingsButton"))), n("div", { key: "c2369b6564211918ab7aa31123e01cb4f98d943d", class: "buttons", part: "editor__footer-buttons net__footer-buttons" }, n("p", { key: "ffbd97cdaa59620c641c5a2adac0af76633ff043", class: {
1222
- "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
1223
- "saved-changes": this.changesSaved,
1224
- error: ((a = this.error) == null ? void 0 : a.message) !== "",
1225
- "error-full-width": ((s = this.error) == null ? void 0 : s.message) !== "" && this.action === "create"
1226
- } }, ((l = this.error) == null ? void 0 : l.message) == "" && this.hasUnsavedChanges && !this.changesSaved && this.activeTab !== g.CalendarView ? i.t("unsavedChangesLabel") : ((r = this.error) == null ? void 0 : r.message) == "" && this.changesSaved ? `${i.t("changesSavedLabel")}!` : ""), n("div", { key: "4edf752dbbf6dd86f97da5cf285afde1f56f900f", class: "footer-buttons__row" }, this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { title: "Preview", type: "button", disabled: this.isLoading, clickHandler: (o) => {
1227
- o.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(le(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
1228
- }, variant: "basic" }, n("eye-icon", null)), n("button-component", { key: "8fc79265e7819c0aeeba204f9f4e1ed6502ce5a1", type: "button", disabled: this.isLoading, clickHandler: (o) => {
1229
- o.preventDefault(), this.cancelButtonClick.emit(), this.host.resetError();
1230
- }, variant: "basic", part: "editor__footer-cancel net__footer-cancel" }, i.t("cancelButton")), n("button-component", { key: "04509263358df45457a593c11f6b5625aedba833", class: { "save-changes": this.action === "edit" }, type: "submit", disabled: this.isLoading, part: "editor__footer-cta, net__footer-cta" }, this.componentLoaded ? this.isLoading ? n("span", null, i.t("savingButtonText"), n("loading-icon", null), " ") : this.action === "create" ? `${i.t("createButtonText")}` : `${i.t("saveChangesButtonText")}` : n("span", null, n("loading-icon", null), " ")))))), this.showFeedbackModal && n("nylas-feedback-form", null));
1231
- }
1232
- get host() {
1233
- return pe(this);
1234
- }
1235
- static get watchers() {
1236
- return {
1237
- selectedConfiguration: ["configChangedHandler"],
1238
- selectedGroupEvent: ["selectedGroupEventChangedHandler"],
1239
- currentUser: ["userChangedHandler"],
1240
- selectedLanguage: ["selectedLanguageChangedHandler"],
1241
- themeConfig: ["themeConfigChangedHandler"]
1242
- };
1243
- }
1244
- };
1245
- _t([
1246
- be({
1247
- name: "nylas-editor-tabs-group",
1248
- stateToProps: /* @__PURE__ */ new Map([
1249
- ["schedulerConfig.calendars", "calendars"],
1250
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
1251
- ["schedulerConfig.currentUser", "currentUser"],
1252
- ["schedulerConfig.configurations", "configurations"],
1253
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
1254
- ["schedulerConfig.selectedEventType", "selectedEventType"],
1255
- ["schedulerConfig.selectedGroupEvent", "selectedGroupEvent"],
1256
- ["schedulerConfig.themeConfig", "themeConfig"]
1257
- ]),
1258
- eventToProps: {
1259
- schedulerConfigChanged: async (e, t) => {
1260
- const { resetLoadingState: a, host: s, action: l, config: r, groupEvent: o } = e.detail, d = (c, p) => {
1261
- const [h, f] = c;
1262
- !h && f ? s.setError({
1263
- message: f.message || i.t("genericErrorTitle"),
1264
- type: _.Error,
1265
- category: v.Component,
1266
- title: p
1267
- }) : h && !f && l === "create" && s.schedulerConfigCreatedEventHandler({ config: h, action: l, host: s });
1268
- };
1269
- if (l === "edit") {
1270
- const c = await t.schedulerConfig.updateConfiguration(r);
1271
- d(c, i.t("nylasEditorTabs.updateConfigError")), a && a(e);
1272
- } else {
1273
- const c = await t.schedulerConfig.createConfiguration(r);
1274
- d(c, i.t("nylasEditorTabs.createConfigError"));
1275
- const [p, h] = c, f = p == null ? void 0 : p.id;
1276
- if (f && o) {
1277
- const w = await t.schedulerConfig.createGroupEvent(o, f);
1278
- d(w, i.t("nylasEditorTabsGroup.createGroupEventError"));
1279
- }
1280
- a && a(e);
1281
- }
1282
- },
1283
- cancelButtonClick: async (e, t) => {
1284
- t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0), t.schedulerConfigStore.set("selectedGroupEvent", void 0), t.schedulerConfigStore.set("groupEvents", []);
1285
- },
1286
- previewButtonClicked: async (e, t) => {
1287
- b("[nylas-editor-tabs-group]", "previewButtonClicked", t);
1288
- },
1289
- formSubmitted: async (e, t) => {
1290
- b("[nylas-editor-tabs-group]", "formSubmitted", t);
1291
- },
1292
- schedulerEditorFormUpdated: async (e, t) => {
1293
- b("[nylas-editor-tabs-group]", "schedulerEditorFormUpdated", e);
1294
- },
1295
- schedulerConfigCreated: async (e, t) => {
1296
- b("[nylas-editor-tabs-group]", "schedulerConfigCreated", e);
1297
- },
1298
- groupEventUpdateTriggered: async (e, t) => {
1299
- const { groupEvent: a, host: s, chosenOption: l, configId: r } = e.detail, o = await t.schedulerConfig.updateGroupEvent(a, l, r), [d, c] = o;
1300
- !d && c && s.setError({
1301
- message: c.message || i.t("genericErrorTitle"),
1302
- type: _.Error,
1303
- category: v.Component,
1304
- title: i.t("nylasEditorTabsGroup.updateGroupEventError")
1305
- });
1306
- },
1307
- groupEventDeleteTriggered: async (e, t) => {
1308
- const { groupEvent: a, chosenOption: s, configId: l, host: r } = e.detail, o = await t.schedulerConfig.deleteGroupEvent(a, s, l), [d, c] = o;
1309
- !d && c && r.setError({
1310
- message: c.message || i.t("genericErrorTitle"),
1311
- type: _.Error,
1312
- category: v.Component,
1313
- title: i.t("nylasEditorTabsGroup.deleteGroupEventError")
1314
- });
1315
- },
1316
- groupEventCreateTriggered: async (e, t) => {
1317
- const { groupEvent: a, configId: s, host: l } = e.detail, r = await t.schedulerConfig.createGroupEvent(a, s), [o, d] = r;
1318
- !o && d && l.setError({
1319
- message: d.message || i.t("genericErrorTitle"),
1320
- type: _.Error,
1321
- category: v.Component,
1322
- title: i.t("nylasEditorTabsGroup.createGroupEventError")
1323
- });
1324
- },
1325
- groupEventImportTriggered: async (e, t) => {
1326
- const { groupEvent: a, configId: s, host: l } = e.detail, r = await t.schedulerConfig.importGroupEvent([a], s), [o, d] = r;
1327
- if (!o && d && l.setError({
1328
- message: d.message || i.t("genericErrorTitle"),
1329
- type: _.Error,
1330
- category: v.Component,
1331
- title: i.t("nylasEditorTabsGroup.importGroupEventError")
1332
- }), o && o.import_failed && o.import_failed.length > 0) {
1333
- const c = o.import_failed.map((p) => p.reason).join(`
1334
- `);
1335
- l.setError({
1336
- message: c,
1337
- type: _.Error,
1338
- category: v.Component,
1339
- title: i.t("nylasEditorTabsGroup.importGroupEventError")
1340
- }), setTimeout(() => {
1341
- l.resetError();
1342
- }, 5e3);
1343
- }
1344
- },
1345
- saveGroupEventChangesError: async (e, t) => {
1346
- const { error: a, host: s } = e.detail;
1347
- b("[nylas-editor-tabs-group]", "saveGroupEventChangesError", a, s);
1348
- }
1349
- },
1350
- localPropsToProp: /* @__PURE__ */ new Map([
1351
- ["schedulerPreviewLink", "schedulerPreviewLink"],
1352
- ["enableUserFeedback", "enableUserFeedback"],
1353
- ["hideEditorTabs", "hideEditorTabs"]
1354
- ]),
1355
- fireRegisterEvent: !0
1356
- }),
1357
- ge("design:type", Function),
1358
- ge("design:paramtypes", []),
1359
- ge("design:returntype", void 0)
1360
- ], Ye.prototype, "render", null);
1361
- Ye.style = mt;
1362
- const vt = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:16px;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;flex-direction:column;position:relative;overflow-y:hidden}.configurations .table-container{overflow-y:auto;flex:1}@media screen and (max-width: 768px){.configurations .table-container{min-height:624px}}.configurations .table-container table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations .table-container table.no-configurations{height:100%}.configurations .table-container table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations .table-container table tr.hide{display:none}.configurations .table-container table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations .table-container table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations .table-container table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations .table-container table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations .table-container table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations .table-container table th,.configurations .table-container table td{text-align:left;padding:1rem;font-family:inherit}.configurations .table-container table .actions{display:flex;justify-content:flex-end;gap:1rem;text-align:right}.configurations .table-container table .actions button-component.edit-button{min-width:98px}@media screen and (max-width: 768px){.configurations .table-container table .actions{flex-direction:column;gap:0.5rem}}.configurations .table-container table .actions select-dropdown.last::part(sd_dropdown-content){bottom:54px}.configurations .table-container table .title{width:100%;max-width:300px}@media screen and (max-width: 768px){.configurations .table-container table .title{max-width:96px}}.configurations .table-container table .title div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.configurations .table-container table .title div.config-event-title{font-weight:600}.configurations .table-container table .title div.config-event-description{font-size:0.75rem}.configurations .pagination{padding:1rem;position:sticky;top:100%;display:flex;justify-content:flex-end;gap:0.5rem;background:var(--nylas-base-0);width:calc(100% - 2rem);z-index:2}.configurations .pagination td.arrows{display:flex;justify-content:flex-end;gap:0.5rem}.configurations .pagination button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background-color:transparent;color:var(--nylas-base-800);cursor:pointer}.configurations .pagination button:hover:not(:disabled){border:1px solid var(--nylas-primary)}.configurations .pagination button:active{border:1px solid var(--nylas-base-800)}.configurations .pagination button:disabled{border:1px solid var(--nylas-base-100);background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.configurations .pagination button.right{transform:rotate(180deg)}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}select-dropdown{width:auto;color:inherit}select-dropdown::part(sd_dropdown-button){display:block;height:48px;padding:0px 16px 8px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button){width:92px}}select-dropdown::part(sd_dropdown-content){width:120px;right:0}select-dropdown::part(sd_dropdown-labelhtml){display:flex;gap:0.5rem;align-items:center;color:var(--nylas-base-900)}select-dropdown::part(sd_dropdown-labelhtml):hover{color:var(--nylas-primary)}.card-wrapper{position:absolute;top:0;left:0;height:calc(100% + 4rem);width:-webkit-fill-available;width:-moz-available;width:fill-available;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.card-wrapper{justify-content:start;height:100%}}.card-modal{background:var(--nylas-base-0);display:flex;flex-direction:column;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);padding:32px;width:562px;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){.card-modal{width:auto;border-radius:0px}}.description.title-desc{margin-bottom:2rem}.description p{margin:0;font-size:18px;color:var(--nylas-base-600)}.footer{margin-top:1rem;padding-top:1rem;display:flex;justify-content:flex-end;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)}.close-button{width:100%;display:flex;justify-content:flex-end}.close-button button-component button{padding:0;height:auto}.close-button button-component button:hover{background-color:transparent !important}button-component{--dot-color:var(--nylas-base-700)}', Ct = vt;
1363
- var wt = function(e, t, a, s) {
1364
- var l = arguments.length, r = l < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, o;
1365
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1366
- r = Reflect.decorate(e, t, a, s);
1367
- else
1368
- for (var d = e.length - 1; d >= 0; d--)
1369
- (o = e[d]) && (r = (l < 3 ? o(r) : l > 3 ? o(t, a, r) : o(t, a)) || r);
1370
- return l > 3 && r && Object.defineProperty(t, a, r), r;
1371
- }, fe = function(e, t) {
1372
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1373
- return Reflect.metadata(e, t);
1374
- };
1375
- const Qe = class {
1376
- constructor(e) {
1377
- te(this, e), this.initListConfigurations = m(this, "initListConfigurations", 7), this.createButtonClick = m(this, "createButtonClick", 7), this.editButtonClick = m(this, "editButtonClick", 7), this.deleteButtonClick = m(this, "deleteButtonClick", 7), this.nylasSchedulerError = m(this, "nylasSchedulerError", 6), this.dismissNotification = m(this, "dismissNotification", 6), this.configurations = [], this.selectedLanguage = void 0, this.schedulerPreviewLink = "", this.listConfigurationsNextCursor = void 0, this.themeConfig = void 0, this.state = "loading", this.error = {
1378
- message: "",
1379
- type: _.Error,
1380
- category: v.Component,
1381
- title: ""
1382
- }, this.currentCursor = null, this.previousCursors = [], this.disableNextPageButton = !1, this.deleteConfigurationId = "", this.showDeleteButtonLoading = !1, this.editButtonLoadingId = "";
1383
- }
1384
- listConfigurationsNextCursorChangedHandler(e, t) {
1385
- if (!e || e === t) {
1386
- e === null && (this.disableNextPageButton = !0);
1387
- return;
1388
- }
1389
- this.disableNextPageButton = !1, this.currentCursor = e;
1390
- }
1391
- selectedLanguageChangedHandler(e, t) {
1392
- e !== t && i.changeLanguage(e);
1393
- }
1394
- themeConfigChangedHandler(e, t) {
1395
- e !== t && this.applyThemeConfig(e);
1396
- }
1397
- connectedCallback() {
1398
- b("[nylas-list-configurations]", "connectedCallback");
1399
- }
1400
- componentWillLoad() {
1401
- b("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
1402
- }
1403
- componentDidLoad() {
1404
- b("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit({
1405
- host: this.host
1406
- });
1407
- }
1408
- disconnectedCallback() {
1409
- b("[nylas-list-configurations]", "disconnectedCallback");
1410
- }
1411
- applyThemeConfig(e) {
1412
- if (e)
1413
- for (const [t, a] of Object.entries(e))
1414
- this.host.style.setProperty(`${t}`, a);
1415
- }
1416
- async handleNylasFormDropdownChanged(e) {
1417
- var l;
1418
- b("[nylas-list-configurations]", "handleNylasFormDropdownChanged", e.detail);
1419
- const { value: t } = e.detail, [a, s] = t.split("-");
1420
- switch (e.preventDefault(), a) {
1421
- case "delete":
1422
- this.deleteConfigurationId = (l = this.configurations[s]) == null ? void 0 : l.id;
1423
- break;
1424
- case "preview":
1425
- window.open(le(this.schedulerPreviewLink, this.configurations[s]), "_blank");
1426
- break;
1427
- case "copy":
1428
- await navigator.clipboard.writeText(le(this.schedulerPreviewLink, this.configurations[s]));
1429
- break;
1430
- }
1431
- }
1432
- async registerCallback() {
1433
- this.initListConfigurations.emit({
1434
- host: this.host
1435
- });
1436
- }
1437
- async getState() {
1438
- return this.state;
1439
- }
1440
- async setState(e) {
1441
- this.state = e;
1442
- }
1443
- async setError(e) {
1444
- var t;
1445
- this.error = {
1446
- message: e.message,
1447
- type: e.type,
1448
- category: e.category,
1449
- title: e.title || i.t("genericErrorTitle")
1450
- }, (t = this.error) != null && t.message && this.showErrorNotification(this.error);
1451
- }
1452
- async hideDeleteConfirmation() {
1453
- this.deleteConfigurationId = "", this.showDeleteButtonLoading = !1;
1454
- }
1455
- async hideEditButtonLoading() {
1456
- this.editButtonLoadingId = "";
1457
- }
1458
- showErrorNotification(e) {
1459
- this.nylasSchedulerError.emit({
1460
- notification: {
1461
- id: e.message.split(" ").join("-"),
1462
- type: e.type || _.Error,
1463
- title: e.title,
1464
- category: e.category || v.Component,
1465
- description: e.message,
1466
- ttl: "none"
1467
- },
1468
- host: this.host
1469
- });
1470
- }
1471
- closeModal(e) {
1472
- e.preventDefault(), this.deleteConfigurationId = "";
1473
- }
1474
- handleConfirmDeleteButtonClicked(e) {
1475
- e.preventDefault(), this.showDeleteButtonLoading = !0;
1476
- const t = this.configurations.find((a) => a.id === this.deleteConfigurationId);
1477
- t && (t != null && t.id) && this.deleteButtonClick.emit({ host: this.host, configuration: t });
1478
- }
1479
- getDurationString(e) {
1480
- if (!e)
1481
- return "—";
1482
- const t = Math.floor(e / 60), a = e % 60;
1483
- return `${t || ""} ${t ? `${t > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
1484
- }
1485
- getActionLabelHTML(e) {
1486
- const t = {
1487
- display: "inline-flex",
1488
- alignItems: "center",
1489
- gap: "0.5rem"
1490
- }, a = {
1491
- color: "var(--nylas-error)"
1492
- };
1493
- switch (e) {
1494
- case "preview":
1495
- return n("span", { style: t }, n("eye-icon", { width: "16", height: "16" }), i.t("nylasListConfigurations.previewButtonText"));
1496
- case "copy":
1497
- return n("span", { style: t }, n("copy-icon", { width: "16", height: "16" }), i.t("nylasListConfigurations.copyLinkButtonText"));
1498
- case "delete":
1499
- return n("span", { style: { ...t, ...a } }, n("delete-icon", { width: "15", height: "17" }), i.t("nylasListConfigurations.deleteButtonText"));
1500
- default:
1501
- return "";
1502
- }
1503
- }
1504
- previousPageClickedHandler() {
1505
- if (this.previousCursors.length === 0)
1506
- return;
1507
- this.currentCursor = this.previousCursors.pop() || null;
1508
- const e = this.previousCursors[this.previousCursors.length - 1] || void 0;
1509
- this.initListConfigurations.emit({
1510
- host: this.host,
1511
- cursor: e
1512
- });
1513
- }
1514
- nextPageClickedHandler() {
1515
- this.currentCursor && (this.previousCursors = [...this.previousCursors, this.currentCursor], this.initListConfigurations.emit({
1516
- host: this.host,
1517
- cursor: this.currentCursor
1518
- }));
1519
- }
1520
- render() {
1521
- var e;
1522
- return n(ce, null, n("nylas-notification", null), n("div", { class: "header" }, n("div", { class: "description" }, n("h2", null, i.t("allSchedulingPages")), n("p", null, i.t("createAndManageSchedulingPages"))), this.configurations && this.configurations.length > 0 && n("div", { class: "actions" }, n("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
1523
- this.createButtonClick.emit(this.host);
1524
- } }, i.t("createNewSchedulingPageButtonText")))), n("div", { class: "configurations" }, n("div", { class: "table-container" }, n("table", { class: {
1525
- "no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
1526
- } }, n("tr", { class: {
1527
- hide: this.state === "loading" || this.configurations && this.configurations.length === 0
1528
- } }, n("th", null, i.t("pageTitle")), n("th", null, i.t("durationTitle")), n("th", null)), this.state === "loading" && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("h3", null, i.t("loading"), "..."), n("p", null, i.t("loadingPagesDescription"))))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("calendar-icon", { width: "48", height: "48" }), n("h3", null, i.t("noSchedulingPages")), n("p", null, i.t("createFirstSchedulingPage")), n("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
1529
- this.createButtonClick.emit(this.host);
1530
- } }, i.t("createNewSchedulingPageButtonText"))))), this.state !== "loading" && ((e = this.configurations) == null ? void 0 : e.map((t, a) => {
1531
- var o, d, c, p;
1532
- const s = (a === this.configurations.length - 1 || a === this.configurations.length - 2) && this.configurations.length > 3, l = t, r = t;
1533
- return n("tr", { key: t == null ? void 0 : t.id }, n("td", null, n("div", { class: "title" }, n("div", { class: "config-event-title", title: (o = r == null ? void 0 : r.event_booking) == null ? void 0 : o.title }, ((d = r == null ? void 0 : r.event_booking) == null ? void 0 : d.title) || (l == null ? void 0 : l.name)), n("div", { class: "config-event-description" }, (c = r == null ? void 0 : r.event_booking) == null ? void 0 : c.description))), n("td", null, n("div", { class: "duration" }, this.getDurationString((p = r == null ? void 0 : r.availability) == null ? void 0 : p.duration_minutes))), n("td", null, n("div", { class: "actions" }, n("button-component", { class: "edit-button", variant: "basic", key: `edit-${a}`, disabled: this.editButtonLoadingId === `edit-${a}`, isLoading: this.editButtonLoadingId === `edit-${a}`, clickHandler: (h) => {
1534
- h.preventDefault(), this.editButtonLoadingId = `edit-${a}`, this.editButtonClick.emit({ host: this.host, configuration: t });
1535
- } }, this.editButtonLoadingId === `edit-${a}` ? null : n("edit-icon", { width: "16", height: "16" }), i.t("editSchedulingPageButtonText")), n("select-dropdown", { class: {
1536
- last: s
1537
- }, name: "actions", options: [
1538
- { value: `preview-${a}`, label: "Preview", labelHTML: this.getActionLabelHTML("preview") },
1539
- { value: `copy-${a}`, label: "Copy link", labelHTML: this.getActionLabelHTML("copy") },
1540
- { value: `delete-${a}`, label: "Delete", labelHTML: this.getActionLabelHTML("delete") }
1541
- ], defaultSelectedOption: { value: "", label: "" }, dropdownButtonText: "...", withSearch: !1, withChevron: !1, themeConfig: this.themeConfig, exportparts: "sd_dropdown: actions__dropdown, sd_dropdown-button: actions__dropdown-button, sd_dropdown-content: actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete" }))));
1542
- })))), n("div", { class: "pagination" }, n("button", { class: "arrow left", onClick: () => this.previousPageClickedHandler(), disabled: this.previousCursors.length <= 0 }, n("chevron-icon", null)), n("button", { class: "arrow right", onClick: () => this.nextPageClickedHandler(), disabled: this.disableNextPageButton }, n("chevron-icon", null)))), !!this.deleteConfigurationId && n("div", { class: "card-wrapper" }, n("div", { class: "card-modal" }, n("div", { class: "close-button" }, n("button-component", { tooltip: "Close", id: "close", variant: "invisible", onClick: (t) => this.closeModal(t), part: "nfbf__close-button" }, n("close-icon", null))), n("div", { class: "header" }, n("h2", { slot: "card-title", part: "nfbf__title" }, i.t("deleteSchedulingPageTitle"))), n("div", { class: "description title-desc" }, n("p", null, i.t("deleteSchedulingPageDescription"))), n("div", { class: {
1543
- footer: !0
1544
- } }, n("button-component", { variant: "basic", onClick: (t) => this.closeModal(t), part: "nfbf__button-outline nfbf__cancel-cta" }, `${i.t("deleteSchedulingPageCancelButton")}`), n("button-component", { variant: "destructive", onClick: (t) => this.handleConfirmDeleteButtonClicked(t), disabled: this.showDeleteButtonLoading, isLoading: this.showDeleteButtonLoading, part: "nfbf__button-outline nfbf__reschedule-cta" }, `${i.t("deleteSchedulingPageConfirmButton")}`)))));
1545
- }
1546
- get host() {
1547
- return pe(this);
1548
- }
1549
- static get watchers() {
1550
- return {
1551
- listConfigurationsNextCursor: ["listConfigurationsNextCursorChangedHandler"],
1552
- selectedLanguage: ["selectedLanguageChangedHandler"],
1553
- themeConfig: ["themeConfigChangedHandler"]
1554
- };
1555
- }
1556
- };
1557
- wt([
1558
- be({
1559
- name: "nylas-list-configurations",
1560
- stateToProps: /* @__PURE__ */ new Map([
1561
- ["schedulerConfig.configurations", "configurations"],
1562
- ["schedulerConfig.listConfigurationsNextCursor", "listConfigurationsNextCursor"],
1563
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
1564
- ["schedulerConfig.themeConfig", "themeConfig"]
1565
- ]),
1566
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
1567
- eventToProps: {
1568
- initListConfigurations: async (e, t) => {
1569
- const { host: a, cursor: s } = e.detail;
1570
- await a.setState("loading");
1571
- const [l, r] = await t.schedulerConfig.getConfigurations(s);
1572
- if (!l && r && r.message) {
1573
- await a.setState("error"), await a.setError({
1574
- message: r.message,
1575
- type: _.Error,
1576
- category: v.Component,
1577
- title: i.t("nylasEditorTabs.getConfigsError")
1578
- });
1579
- return;
1580
- }
1581
- await a.setState("loaded");
1582
- },
1583
- createButtonClick: async (e, t) => {
1584
- t.schedulerConfigStore.resetSelectedConfiguration();
1585
- const a = Object.entries(t.schedulerConfigStore.state.enableEventTypes || {}).filter(([s, l]) => l);
1586
- a.length === 1 ? (t.schedulerConfigStore.state.action = "create", t.schedulerConfigStore.state.selectedEventType = I[a[0][0]]) : t.schedulerConfigStore.state.action = "create-select";
1587
- },
1588
- deleteButtonClick: async (e, t) => {
1589
- const { host: a, configuration: s } = e.detail, [l, r] = await t.schedulerConfig.deleteConfiguration(s.id);
1590
- !l && r && r.message && (await a.setState("error"), await a.setError({
1591
- message: r.message,
1592
- type: _.Error,
1593
- category: v.Component,
1594
- title: i.t("nylasEditorTabs.deleteConfigError")
1595
- })), await a.hideDeleteConfirmation();
1596
- },
1597
- editButtonClick: async (e, t) => {
1598
- const { host: a, configuration: s } = e.detail;
1599
- if (s.type === "group") {
1600
- const { startTime: l, endTime: r } = at((/* @__PURE__ */ new Date()).toISOString(), "week");
1601
- t.schedulerConfigStore.state.calendarViewDateRange = {
1602
- start_time: l.toString(),
1603
- end_time: r.toString()
1604
- };
1605
- const [o, d] = await t.schedulerConfig.getGroupEvents(s.id, s);
1606
- if (!o && d && d.message) {
1607
- await a.setError({
1608
- message: d.message,
1609
- type: _.Error,
1610
- category: v.Component,
1611
- title: i.t("nylasEditorTabsGroup.getGroupEventsError")
1612
- }), a.hideEditButtonLoading();
1613
- return;
1614
- }
1615
- }
1616
- t.schedulerConfigStore.state.action = "edit", t.schedulerConfigStore.state.selectedConfiguration = s, a.hideEditButtonLoading();
1617
- }
1618
- },
1619
- fireRegisterEvent: !0
1620
- }),
1621
- fe("design:type", Function),
1622
- fe("design:paramtypes", []),
1623
- fe("design:returntype", void 0)
1624
- ], Qe.prototype, "render", null);
1625
- Qe.style = Ct;
1626
- const kt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-select-event-type{height:inherit;overflow-y:auto}.nylas-select-event-type div.header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--nylas-base-200)}.nylas-select-event-type div.header h2{font-size:18px;padding:0 24px;line-height:24px;margin:0;font-weight:600;color:var(--nylas-base-800)}.nylas-select-event-type div.header button-component button{background:transparent;border:none;cursor:pointer}.nylas-select-event-type div.header button-component button:hover,.nylas-select-event-type div.header button-component button:active{color:var(--nylas-primary);background-color:transparent}.nylas-select-event-type div.header button-component button:disabled{cursor:not-allowed}.nylas-select-event-type div.content{padding:40px}.nylas-select-event-type div.content h3{margin:0 0 32px 0;font-size:18px;line-height:24px;font-weight:600}.nylas-select-event-type div.content div.event-type{display:flex;flex-direction:column;gap:8px}.nylas-select-event-type div.content div.event-type div.event-type-option{padding:16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-3x);width:inherit;cursor:pointer;display:flex;flex-direction:column;gap:8px}.nylas-select-event-type div.content div.event-type div.event-type-option h4{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--nylas-base-900)}.nylas-select-event-type div.content div.event-type div.event-type-option p{margin:0;font-size:14px;line-height:21px;font-weight:400;color:var(--nylas-base-800)}', xt = kt;
1627
- var Et = function(e, t, a, s) {
1628
- var l = arguments.length, r = l < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, o;
1629
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1630
- r = Reflect.decorate(e, t, a, s);
1631
- else
1632
- for (var d = e.length - 1; d >= 0; d--)
1633
- (o = e[d]) && (r = (l < 3 ? o(r) : l > 3 ? o(t, a, r) : o(t, a)) || r);
1634
- return l > 3 && r && Object.defineProperty(t, a, r), r;
1635
- }, me = function(e, t) {
1636
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1637
- return Reflect.metadata(e, t);
1638
- };
1639
- const Xe = class {
1640
- constructor(e) {
1641
- te(this, e), this.returnToAllSchedulingPagesEvent = m(this, "returnToAllSchedulingPagesEvent", 7), this.createEventTypeSelected = m(this, "createEventTypeSelected", 7), this.participantOptions = void 0, this.name = "select-event-type", this.selectedLanguage = void 0, this.enableEventTypes = {
1642
- one_on_one: !0,
1643
- collective: !0,
1644
- max_fairness: !0,
1645
- max_availability: !0,
1646
- group: !0
1647
- }, this.themeConfig = void 0;
1648
- }
1649
- connectedCallback() {
1650
- b("nylas-select-event-type", "connectedCallback");
1651
- }
1652
- disconnectedCallback() {
1653
- b("nylas-select-event-type", "disconnectedCallback");
1654
- }
1655
- componentWillLoad() {
1656
- b("nylas-select-event-type", "componentWillLoad"), this.host.setAttribute("name", this.name);
1657
- }
1658
- componentDidLoad() {
1659
- b("nylas-select-event-type", "componentDidLoad");
1660
- }
1661
- elementNameChangedHandler(e) {
1662
- b("nylas-select-event-type", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1663
- }
1664
- selectedLanguageChangedHandler(e, t) {
1665
- e !== t && i.changeLanguage(e);
1666
- }
1667
- themeConfigChangedHandler(e, t) {
1668
- e !== t && this.applyThemeConfig(e);
1669
- }
1670
- applyThemeConfig(e) {
1671
- if (e)
1672
- for (const [t, a] of Object.entries(e))
1673
- this.host.style.setProperty(`${t}`, a);
1674
- }
1675
- render() {
1676
- var r;
1677
- const e = {
1678
- "one-on-one": "one_on_one",
1679
- collective: "collective",
1680
- "max-fairness": "max_fairness",
1681
- "max-availability": "max_availability",
1682
- group: "group"
1683
- }, t = [
1684
- {
1685
- label: i.t("nylasSelectEventType.eventTypeOptions.oneOnOne.label"),
1686
- value: I.one_on_one,
1687
- description: i.t("nylasSelectEventType.eventTypeOptions.oneOnOne.desc")
1688
- },
1689
- {
1690
- label: i.t("nylasSelectEventType.eventTypeOptions.collective.label"),
1691
- value: I.collective,
1692
- description: i.t("nylasSelectEventType.eventTypeOptions.collective.desc")
1693
- },
1694
- {
1695
- label: i.t("nylasSelectEventType.eventTypeOptions.maxFairness.label"),
1696
- value: I.max_fairness,
1697
- description: i.t("nylasSelectEventType.eventTypeOptions.maxFairness.desc")
1698
- },
1699
- {
1700
- label: i.t("nylasSelectEventType.eventTypeOptions.maxAvailability.label"),
1701
- value: I.max_availability,
1702
- description: i.t("nylasSelectEventType.eventTypeOptions.maxAvailability.desc")
1703
- },
1704
- {
1705
- label: i.t("nylasSelectEventType.eventTypeOptions.group.label"),
1706
- value: I.group,
1707
- description: i.t("nylasSelectEventType.eventTypeOptions.group.desc")
1708
- }
1709
- ], a = [I.collective, I.max_availability, I.max_fairness], s = this.participantOptions && ((r = this.participantOptions) == null ? void 0 : r.length) > 0 && !!this.participantOptions[0].email && !!this.participantOptions[0].name && !!this.participantOptions[0].calendars && this.participantOptions[0].calendars.length > 0, l = this.enableEventTypes ? t.filter((o) => {
1710
- const d = o.value, c = e[d];
1711
- return console.log("key", d, this.enableEventTypes ? this.enableEventTypes[c] : "no enableEventTypes"), a.includes(d) && !s ? !1 : this.enableEventTypes && this.enableEventTypes[c];
1712
- }) : t;
1713
- return n(ce, null, n("div", { class: "nylas-select-event-type", part: "nset" }, n("div", { class: "header", part: "nset__header" }, n("h2", null, i.t("nylasSelectEventType.createEventHeaderTitle")), n("button-component", { variant: "invisible", part: "nset__header__back-button", onClick: (o) => {
1714
- this.returnToAllSchedulingPagesEvent.emit();
1715
- } }, n("chevron-icon", { width: "16", height: "16" }), n("span", null, i.t("nylasSelectEventType.returnToAllSchedulingPages")))), n("div", { class: "content", part: "nset__content" }, n("h3", null, i.t("nylasSelectEventType.eventTypeHeaderTitle")), n("div", { class: "event-type", part: "nset__content__event-type" }, l.length === 0 && n("p", null, i.t("nylasSelectEventType.noEventTypesEnabled")), l.map((o) => n("div", { class: "event-type-option", onClick: (d) => {
1716
- this.createEventTypeSelected.emit({ eventType: o.value });
1717
- }, part: `nset__content__event-type-option-${o.value}` }, n("h4", null, o.label), n("p", null, o.description)))))));
1718
- }
1719
- get host() {
1720
- return pe(this);
1721
- }
1722
- static get watchers() {
1723
- return {
1724
- name: ["elementNameChangedHandler"],
1725
- selectedLanguage: ["selectedLanguageChangedHandler"],
1726
- themeConfig: ["themeConfigChangedHandler"]
1727
- };
1728
- }
1729
- };
1730
- Et([
1731
- be({
1732
- name: "nylas-select-event-type",
1733
- stateToProps: /* @__PURE__ */ new Map([
1734
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
1735
- ["schedulerConfig.additionalParticipants", "participantOptions"],
1736
- ["schedulerConfig.enableEventTypes", "enableEventTypes"],
1737
- ["schedulerConfig.themeConfig", "themeConfig"]
1738
- ]),
1739
- eventToProps: {
1740
- returnToAllSchedulingPagesEvent: async (e, t) => {
1741
- t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0);
1742
- },
1743
- createEventTypeSelected: async (e, t) => {
1744
- const { eventType: a } = e.detail;
1745
- t.schedulerConfigStore.state.action = "create", t.schedulerConfigStore.state.selectedEventType = a;
1746
- }
1747
- },
1748
- fireRegisterEvent: !0
1749
- }),
1750
- me("design:type", Function),
1751
- me("design:paramtypes", []),
1752
- me("design:returntype", void 0)
1753
- ], Xe.prototype, "render", null);
1754
- Xe.style = xt;
1755
- export {
1756
- lt as google_logo_icon,
1757
- pt as microsoft_logo_icon,
1758
- Ke as nylas_editor_tabs,
1759
- Ye as nylas_editor_tabs_group,
1760
- Qe as nylas_list_configurations,
1761
- Xe as nylas_select_event_type
1762
- };