@nylas/react 1.1.1 → 1.1.2

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 (120) hide show
  1. package/dist/{add-circle-icon_2.entry-b14ecb5c.js → add-circle-icon_2.entry-611be49d.js} +1 -1
  2. package/dist/{add-circle-icon_2.entry-c6211866.cjs → add-circle-icon_2.entry-f1383568.cjs} +1 -1
  3. package/dist/{archive-icon_7.entry-54fc1f03.cjs → archive-icon_7.entry-59cc6868.cjs} +1 -1
  4. package/dist/{archive-icon_7.entry-3fe7721a.js → archive-icon_7.entry-5e6ba9e7.js} +1 -1
  5. package/dist/{arrow-icon.entry-cc936041.js → arrow-icon.entry-9c19a803.js} +1 -1
  6. package/dist/{arrow-icon.entry-1dfee3bc.cjs → arrow-icon.entry-a924df13.cjs} +1 -1
  7. package/dist/{bold-icon_3.entry-e2a1d434.js → bold-icon_3.entry-2935a3df.js} +1 -1
  8. package/dist/{bold-icon_3.entry-4b9de887.cjs → bold-icon_3.entry-ffe02f93.cjs} +1 -1
  9. package/dist/{button-component_2.entry-3639ade6.js → button-component_2.entry-93aa59a2.js} +1 -1
  10. package/dist/{button-component_2.entry-5666fdfa.cjs → button-component_2.entry-b9d3f6a2.cjs} +1 -1
  11. package/dist/{calendar-agenda-fill-icon_48.entry-56e364cd.js → calendar-agenda-fill-icon_48.entry-476bc4ef.js} +8 -8
  12. package/dist/{calendar-agenda-fill-icon_48.entry-bf278e34.cjs → calendar-agenda-fill-icon_48.entry-c4ea84b3.cjs} +2 -2
  13. package/dist/{calendar-cancel-icon.entry-ac1cb5dd.cjs → calendar-cancel-icon.entry-11bb8656.cjs} +1 -1
  14. package/dist/{calendar-cancel-icon.entry-dcd777cd.js → calendar-cancel-icon.entry-ee0acc54.js} +1 -1
  15. package/dist/{calendar-check-icon_2.entry-7ad1b2a0.cjs → calendar-check-icon_2.entry-14548656.cjs} +1 -1
  16. package/dist/{calendar-check-icon_2.entry-6330bd2d.js → calendar-check-icon_2.entry-54a82e1e.js} +1 -1
  17. package/dist/{calendar-icon.entry-5849a547.cjs → calendar-icon.entry-1a17f887.cjs} +1 -1
  18. package/dist/{calendar-icon.entry-8559fa0d.js → calendar-icon.entry-29f7003b.js} +1 -1
  19. package/dist/{checkbox-component_2.entry-6cf5da6b.cjs → checkbox-component_2.entry-84a17232.cjs} +1 -1
  20. package/dist/{checkbox-component_2.entry-1474c465.js → checkbox-component_2.entry-dfec10cb.js} +1 -1
  21. package/dist/chevron-icon_3.entry-5da08d02.cjs +1 -0
  22. package/dist/{chevron-icon_3.entry-cb757aa3.js → chevron-icon_3.entry-826e81d4.js} +20 -9
  23. package/dist/{clock-icon_4.entry-642f4dc6.js → clock-icon_4.entry-36d97f00.js} +1 -1
  24. package/dist/{clock-icon_4.entry-36a33de5.cjs → clock-icon_4.entry-dafdd895.cjs} +1 -1
  25. package/dist/{constants-50c3e067-4e027da4.cjs → constants-50c3e067-1fe54cf3.cjs} +1 -1
  26. package/dist/{constants-50c3e067-83f1d865.js → constants-50c3e067-fed7fb48.js} +1 -1
  27. package/dist/{copy-icon.entry-60740516.js → copy-icon.entry-6d1a649d.js} +1 -1
  28. package/dist/{copy-icon.entry-fb63cf53.cjs → copy-icon.entry-eec265da.cjs} +1 -1
  29. package/dist/{delete-icon_2.entry-d1af0606.cjs → delete-icon_2.entry-160ba41e.cjs} +1 -1
  30. package/dist/{delete-icon_2.entry-45851bc5.js → delete-icon_2.entry-528a3879.js} +1 -1
  31. package/dist/{document-refresh-icon.entry-1731d4d9.cjs → document-refresh-icon.entry-276704dc.cjs} +1 -1
  32. package/dist/{document-refresh-icon.entry-5db0830a.js → document-refresh-icon.entry-6565f3b5.js} +1 -1
  33. package/dist/{elements-dc5b338e-3099ee02.js → elements-dc5b338e-2d3857dc.js} +1 -1
  34. package/dist/{elements-dc5b338e-ab9afb63.cjs → elements-dc5b338e-b06b2857.cjs} +1 -1
  35. package/dist/{focus-visible-e8093c16-811f50fa.cjs → focus-visible-e8093c16-47e61336.cjs} +1 -1
  36. package/dist/{focus-visible-e8093c16-067a8f23.js → focus-visible-e8093c16-6f68eb89.js} +1 -1
  37. package/dist/{forward-icon_6.entry-e7c5fa46.js → forward-icon_6.entry-ed6ab66a.js} +2 -2
  38. package/dist/{forward-icon_6.entry-4e9c9686.cjs → forward-icon_6.entry-fed8994d.cjs} +1 -1
  39. package/dist/{globe-icon.entry-aa3f3ea3.js → globe-icon.entry-154ccdb5.js} +1 -1
  40. package/dist/{globe-icon.entry-74f79652.cjs → globe-icon.entry-95fc0408.cjs} +1 -1
  41. package/dist/{google-logo-icon_4.entry-3fe41d69.js → google-logo-icon_4.entry-68cfa3fe.js} +3 -3
  42. package/dist/{google-logo-icon_4.entry-0332a181.cjs → google-logo-icon_4.entry-afffb209.cjs} +1 -1
  43. package/dist/{index-a134f625.js → index-1322d804.js} +50 -50
  44. package/dist/{index-2a53b6a8.cjs → index-c4e817ef.cjs} +2 -2
  45. package/dist/{index.es-79f5b771-ce07d6fc.js → index.es-79f5b771-04cd3414.js} +1 -1
  46. package/dist/{index.es-79f5b771-64a1baf0.cjs → index.es-79f5b771-08cc349d.cjs} +1 -1
  47. package/dist/{info-icon_2.entry-a3f40027.cjs → info-icon_2.entry-2af880b8.cjs} +1 -1
  48. package/dist/{info-icon_2.entry-fed731f4.js → info-icon_2.entry-49261a0a.js} +1 -1
  49. package/dist/{input-color-picker.entry-cbdce7a1.cjs → input-color-picker.entry-57adff77.cjs} +1 -1
  50. package/dist/{input-color-picker.entry-37826630.js → input-color-picker.entry-aefe0e26.js} +1 -1
  51. package/dist/{input-component.entry-e71b7062.cjs → input-component.entry-09c3c9b6.cjs} +1 -1
  52. package/dist/{input-component.entry-b83b7103.js → input-component.entry-d7c2724b.js} +1 -1
  53. package/dist/{input-dropdown.entry-db0dae5f.js → input-dropdown.entry-e573ade0.js} +1 -1
  54. package/dist/{input-dropdown.entry-150819cd.cjs → input-dropdown.entry-e7d26273.cjs} +1 -1
  55. package/dist/{mailbox-store-9c52a3fa-80fe343c.js → mailbox-store-9c52a3fa-27f8f7e6.js} +2 -2
  56. package/dist/{mailbox-store-9c52a3fa-04f22f60.cjs → mailbox-store-9c52a3fa-6b39645f.cjs} +1 -1
  57. package/dist/{multi-select-dropdown.entry-6b429b39.js → multi-select-dropdown.entry-15cacb87.js} +1 -1
  58. package/dist/{multi-select-dropdown.entry-629329d7.cjs → multi-select-dropdown.entry-46b2b1c9.cjs} +1 -1
  59. package/dist/{nylas-booked-event-card_12.entry-c22c02b4.js → nylas-booked-event-card_12.entry-3921071a.js} +195 -192
  60. package/dist/nylas-booked-event-card_12.entry-47c5381d.cjs +1 -0
  61. package/dist/{nylas-form-card.entry-f3d6a1e4.js → nylas-form-card.entry-ca835017.js} +2 -2
  62. package/dist/{nylas-form-card.entry-2ced5eef.cjs → nylas-form-card.entry-db3f0e3b.cjs} +1 -1
  63. package/dist/{nylas-if-state.entry-862ad978.js → nylas-if-state.entry-4159d41d.js} +2 -2
  64. package/dist/{nylas-if-state.entry-55c32c0c.cjs → nylas-if-state.entry-5410607c.cjs} +1 -1
  65. package/dist/{nylas-list-folders.entry-77e936f7.cjs → nylas-list-folders.entry-0f143930.cjs} +1 -1
  66. package/dist/{nylas-list-folders.entry-544fd38d.js → nylas-list-folders.entry-6b4a3d96.js} +2 -2
  67. package/dist/{nylas-list-threads.entry-71411da7.js → nylas-list-threads.entry-62108562.js} +2 -2
  68. package/dist/{nylas-list-threads.entry-82e04782.cjs → nylas-list-threads.entry-68b6f32b.cjs} +1 -1
  69. package/dist/{nylas-login.entry-48179c01.js → nylas-login.entry-590e7fba.js} +2 -2
  70. package/dist/{nylas-login.entry-3ccc2bef.cjs → nylas-login.entry-f1d7bc7d.cjs} +1 -1
  71. package/dist/{nylas-mailbox-pagination.entry-d31f9aa4.cjs → nylas-mailbox-pagination.entry-8377fdee.cjs} +1 -1
  72. package/dist/{nylas-mailbox-pagination.entry-77cf03b5.js → nylas-mailbox-pagination.entry-ba1af8fb.js} +2 -2
  73. package/dist/{nylas-mailbox-toolbar-button.entry-40e3c373.js → nylas-mailbox-toolbar-button.entry-4497acd0.js} +2 -2
  74. package/dist/{nylas-mailbox-toolbar-button.entry-33aad610.cjs → nylas-mailbox-toolbar-button.entry-6a5d8387.cjs} +1 -1
  75. package/dist/{nylas-mailbox.entry-f4066fb2.js → nylas-mailbox.entry-917c22f5.js} +3 -3
  76. package/dist/{nylas-mailbox.entry-963de1c3.cjs → nylas-mailbox.entry-a07652b4.cjs} +1 -1
  77. package/dist/{nylas-provider.entry-08767da3.cjs → nylas-provider.entry-0e520ac3.cjs} +1 -1
  78. package/dist/{nylas-provider.entry-c61428b1.js → nylas-provider.entry-20c47b14.js} +5 -5
  79. package/dist/{nylas-reminder-emails.entry-cd8e1d2e.js → nylas-reminder-emails.entry-088ee120.js} +2 -2
  80. package/dist/{nylas-reminder-emails.entry-d42a7f1d.cjs → nylas-reminder-emails.entry-69626e7f.cjs} +1 -1
  81. package/dist/{nylas-reminder-time_2.entry-d7115393.js → nylas-reminder-time_2.entry-0357f280.js} +3 -3
  82. package/dist/{nylas-reminder-time_2.entry-e5540fdd.cjs → nylas-reminder-time_2.entry-b5c181db.cjs} +1 -1
  83. package/dist/{nylas-scheduler-editor.entry-65eb4938.js → nylas-scheduler-editor.entry-6bb290ed.js} +6 -6
  84. package/dist/{nylas-scheduler-editor.entry-67904653.cjs → nylas-scheduler-editor.entry-d2c3bddc.cjs} +2 -2
  85. package/dist/{nylas-scheduling.entry-7aad4f63.js → nylas-scheduling.entry-bc9c25c5.js} +126 -112
  86. package/dist/nylas-scheduling.entry-dc92d5e7.cjs +1 -0
  87. package/dist/{nylas-threads-refresh.entry-d025575a.js → nylas-threads-refresh.entry-45d7d171.js} +2 -2
  88. package/dist/{nylas-threads-refresh.entry-1b8befab.cjs → nylas-threads-refresh.entry-6636e7b1.cjs} +1 -1
  89. package/dist/{nylas-threads-search.entry-a254c36e.js → nylas-threads-search.entry-4460aa9b.js} +2 -2
  90. package/dist/{nylas-threads-search.entry-78c06183.cjs → nylas-threads-search.entry-ae87695a.cjs} +1 -1
  91. package/dist/{nylas-time-window-picker.entry-30baeb50.cjs → nylas-time-window-picker.entry-1b449403.cjs} +1 -1
  92. package/dist/{nylas-time-window-picker.entry-89c15823.js → nylas-time-window-picker.entry-260f52a6.js} +1 -1
  93. package/dist/{nylas-view-thread.entry-c8d56573.js → nylas-view-thread.entry-5821630b.js} +2 -2
  94. package/dist/{nylas-view-thread.entry-939a4561.cjs → nylas-view-thread.entry-5a9b353a.cjs} +1 -1
  95. package/dist/{person-icon.entry-5ab75598.cjs → person-icon.entry-b4ce06b7.cjs} +1 -1
  96. package/dist/{person-icon.entry-8aef4041.js → person-icon.entry-ed6786db.js} +1 -1
  97. package/dist/{play-icon_2.entry-4b068c1b.js → play-icon_2.entry-261ea828.js} +1 -1
  98. package/dist/{play-icon_2.entry-392ad303.cjs → play-icon_2.entry-87fe39a9.cjs} +1 -1
  99. package/dist/react.cjs +1 -1
  100. package/dist/react.js +1 -1
  101. package/dist/{refresh-icon.entry-9ea254c9.cjs → refresh-icon.entry-21ac359d.cjs} +1 -1
  102. package/dist/{refresh-icon.entry-a754a2b5.js → refresh-icon.entry-87af05b0.js} +1 -1
  103. package/dist/{register-component-ea95564d-e19ec159.js → register-component-ea95564d-843da1da.js} +1 -1
  104. package/dist/{register-component-ea95564d-ab3d630f.cjs → register-component-ea95564d-a64ee107.cjs} +1 -1
  105. package/dist/{scheduler-config-store-2a3b403d-581c70cf.js → scheduler-config-store-2a3b403d-8553b685.js} +1 -1
  106. package/dist/{scheduler-config-store-2a3b403d-4e10b542.cjs → scheduler-config-store-2a3b403d-88840eb1.cjs} +1 -1
  107. package/dist/{scheduler-store-9ff4914b-6e28240e.cjs → scheduler-store-9ff4914b-63dc472a.cjs} +1 -1
  108. package/dist/{scheduler-store-9ff4914b-b71a0aca.js → scheduler-store-9ff4914b-d1a624f8.js} +1 -1
  109. package/dist/{textarea-component.entry-70bb02bf.cjs → textarea-component.entry-cbffb0b0.cjs} +1 -1
  110. package/dist/{textarea-component.entry-a5daab6c.js → textarea-component.entry-dad42f20.js} +1 -1
  111. package/dist/{time-period-selector.entry-25348de7.js → time-period-selector.entry-79c94da3.js} +1 -1
  112. package/dist/{time-period-selector.entry-6306e456.cjs → time-period-selector.entry-e54d0989.cjs} +1 -1
  113. package/dist/{translate-icon.entry-785fa109.cjs → translate-icon.entry-8e9eeeba.cjs} +1 -1
  114. package/dist/{translate-icon.entry-b6094ecc.js → translate-icon.entry-ef6266c4.js} +1 -1
  115. package/dist/{warning-icon.entry-94e34c58.cjs → warning-icon.entry-34c85de2.cjs} +1 -1
  116. package/dist/{warning-icon.entry-4b400ee2.js → warning-icon.entry-adf18211.js} +1 -1
  117. package/package.json +2 -2
  118. package/dist/chevron-icon_3.entry-41170718.cjs +0 -1
  119. package/dist/nylas-booked-event-card_12.entry-660af56a.cjs +0 -1
  120. package/dist/nylas-scheduling.entry-50e41d85.cjs +0 -1
@@ -1,18 +1,18 @@
1
- import { k as h, r as z, c as _, d as E, l as I, m as O, n as N, h as n, H as y, g as A, F as D } from "./index-a134f625.js";
2
- import { n as x, N as P } from "./index.es-79f5b771-ce07d6fc.js";
3
- import { E as B, C as F, N as S } from "./scheduler-store-9ff4914b-b71a0aca.js";
4
- import { L as j, a as M } from "./constants-50c3e067-83f1d865.js";
1
+ import { k as g, r as R, c as _, d as E, l as I, m as O, n as N, h as i, H as y, g as A, F as D } from "./index-1322d804.js";
2
+ import { n as x, N as P } from "./index.es-79f5b771-04cd3414.js";
3
+ import { E as B, C as F, N as S } from "./scheduler-store-9ff4914b-d1a624f8.js";
4
+ import { L as j, a as M } from "./constants-50c3e067-fed7fb48.js";
5
5
  import "react";
6
6
  import "react-dom";
7
7
  class H {
8
- constructor({ schedulerAPIURL: e, nylasSchedulerStore: i, sessionId: o, configId: s, slug: d, clientId: r }) {
8
+ constructor({ schedulerAPIURL: e, nylasSchedulerStore: n, sessionId: a, configId: o, slug: r, clientId: d }) {
9
9
  if (!e)
10
10
  throw new Error("schedulerAPIURL is required");
11
- if (!i)
11
+ if (!n)
12
12
  throw new Error("nylasSchedulerStore is required");
13
- if (!o && !s && !(d || r))
13
+ if (!a && !o && !(r || d))
14
14
  throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");
15
- e === "/" && (e = new URL(window.location.href).origin), this.configId = s, this.sessionId = o, this.schedulerAPIURL = e, this.nylasSchedulerStore = i, this.slug = d, this.clientId = r;
15
+ e === "/" && (e = new URL(window.location.href).origin), this.configId = o, this.sessionId = a, this.schedulerAPIURL = e, this.nylasSchedulerStore = n, this.slug = r, this.clientId = d;
16
16
  }
17
17
  init() {
18
18
  E("NylasConnector init");
@@ -35,46 +35,46 @@ class H {
35
35
  }
36
36
  }
37
37
  const k = (t, e) => {
38
- const i = t.isLoading, o = t.showNotification, s = t.nylasBranding;
39
- return n(
38
+ const n = t.isLoading, a = t.showNotification, o = t.nylasBranding;
39
+ return i(
40
40
  D,
41
41
  null,
42
- o && n("nylas-notification", null),
43
- i && n(
42
+ a && i("nylas-notification", null),
43
+ n && i(
44
44
  "div",
45
45
  { class: "loading" },
46
- n(
46
+ i(
47
47
  "div",
48
48
  { class: "left" },
49
- n("div", { class: "skeleton" })
49
+ i("div", { class: "skeleton" })
50
50
  ),
51
- n(
51
+ i(
52
52
  "div",
53
53
  { class: "right" },
54
- n("div", { class: "skeleton" }),
55
- n("div", { class: "skeleton" }),
56
- n("div", { class: "skeleton" }),
57
- n("div", { class: "skeleton" }),
58
- n("div", { class: "skeleton" })
54
+ i("div", { class: "skeleton" }),
55
+ i("div", { class: "skeleton" }),
56
+ i("div", { class: "skeleton" }),
57
+ i("div", { class: "skeleton" }),
58
+ i("div", { class: "skeleton" })
59
59
  )
60
60
  ),
61
- !i && e,
62
- n("div", { class: "footer" }, s && n(
61
+ !n && e,
62
+ i("div", { class: "footer" }, o && i(
63
63
  D,
64
64
  null,
65
65
  "Powered by ",
66
- n("nylas-logo", null)
66
+ i("nylas-logo", null)
67
67
  ))
68
68
  );
69
- }, L = (t, e) => n("div", { class: "message-banner" }, e), U = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}', W = U, T = { title: h.t("genericErrorTitle"), type: x.Error, category: B.Component }, $ = class {
69
+ }, L = (t, e) => i("div", { class: "message-banner" }, e), U = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}', W = U, T = { title: g.t("genericErrorTitle"), type: x.Error, category: B.Component }, $ = class {
70
70
  constructor(t) {
71
- z(this, t), this.init = _(this, "init", 7), this.schedulerWillLoad = _(this, "schedulerWillLoad", 7), this.schedulerDidLoad = _(this, "schedulerDidLoad", 7), this.nylasSchedulerError = _(this, "nylasSchedulerError", 7), this.configSettingsLoaded = _(this, "configSettingsLoaded", 7), this.bookingRefExtracted = _(this, "bookingRefExtracted", 7), this.bookedEventInfo = _(this, "bookedEventInfo", 7), this.mode = "app", this.defaultSchedulerState = void 0, this.sessionId = void 0, this.schedulerApiUrl = "https://api.us.nylas.com", this.bookingInfo = void 0, this.rescheduleBookingRef = void 0, this.cancelBookingRef = void 0, this.organizerConfirmationBookingRef = void 0, this.configurationId = void 0, this.slug = void 0, this.clientId = void 0, this.nylasBranding = !0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.localization = void 0, this.showNotification = !0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, { dateStyle: "full" }) || `${h.t("noDateSelected")}`, this.refConfigId = void 0, this.language = navigator.language;
71
+ R(this, t), this.init = _(this, "init", 7), this.schedulerWillLoad = _(this, "schedulerWillLoad", 7), this.schedulerDidLoad = _(this, "schedulerDidLoad", 7), this.nylasSchedulerError = _(this, "nylasSchedulerError", 7), this.configSettingsLoaded = _(this, "configSettingsLoaded", 7), this.bookingRefExtracted = _(this, "bookingRefExtracted", 7), this.bookedEventInfo = _(this, "bookedEventInfo", 7), this.mode = "app", this.defaultSchedulerState = void 0, this.sessionId = void 0, this.schedulerApiUrl = "https://api.us.nylas.com", this.bookingInfo = void 0, this.rescheduleBookingRef = void 0, this.cancelBookingRef = void 0, this.organizerConfirmationBookingRef = void 0, this.configurationId = void 0, this.slug = void 0, this.clientId = void 0, this.nylasBranding = !0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.localization = void 0, this.showNotification = !0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, { dateStyle: "full" }) || `${g.t("noDateSelected")}`, this.refConfigId = void 0, this.language = navigator.language;
72
72
  }
73
73
  connectedCallback() {
74
74
  E("[nylas-scheduler] connectedCallback");
75
75
  }
76
76
  async componentWillLoad() {
77
- var s, d;
77
+ var o, r;
78
78
  E("[nylas-scheduler] Component will load");
79
79
  const t = this.schedulerWillLoad.emit(this.host);
80
80
  if ("schedulerWillLoad" in this.eventOverrides && (await this.eventOverrides.schedulerWillLoad(t, this.nylasSchedulerConnector), t.defaultPrevented))
@@ -88,68 +88,69 @@ const k = (t, e) => {
88
88
  }, this.baseProvider = new P(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.refConfigId = this.configurationId;
89
89
  let e;
90
90
  if (this.rescheduleBookingRef) {
91
- const [r, a, l] = I(this.rescheduleBookingRef);
92
- this.refConfigId = r, this.stores.scheduler.set("rescheduleBookingId", a), e = this.bookingRefExtracted.emit({ configurationId: r, bookingId: a });
91
+ const [d, s, l] = I(this.rescheduleBookingRef);
92
+ this.refConfigId = d, this.stores.scheduler.set("rescheduleBookingId", s), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s });
93
93
  } else if (this.cancelBookingRef) {
94
- const [r, a, l] = I(this.cancelBookingRef);
95
- this.refConfigId = r, this.stores.scheduler.set("cancelBookingId", a), e = this.bookingRefExtracted.emit({ configurationId: r, bookingId: a });
94
+ const [d, s, l] = I(this.cancelBookingRef);
95
+ this.refConfigId = d, this.stores.scheduler.set("cancelBookingId", s), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s });
96
96
  } else if (this.organizerConfirmationBookingRef) {
97
- const [r, a, l] = I(this.organizerConfirmationBookingRef);
98
- this.refConfigId = r, this.stores.scheduler.set("organizerConfirmationBookingId", a), this.stores.scheduler.set("organizerConfirmationSalt", l), e = this.bookingRefExtracted.emit({ configurationId: r, bookingId: a, salt: l });
97
+ const [d, s, l] = I(this.organizerConfirmationBookingRef);
98
+ this.refConfigId = d, this.stores.scheduler.set("organizerConfirmationBookingId", s), this.stores.scheduler.set("organizerConfirmationSalt", l), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s, salt: l });
99
99
  }
100
100
  if ("bookingRefExtracted" in this.eventOverrides && (await this.eventOverrides.bookingRefExtracted(e, this.nylasSchedulerConnector), e.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
101
101
  return;
102
- const i = (s = this.baseProvider) == null ? void 0 : s.getStore("scheduler");
102
+ const n = (o = this.baseProvider) == null ? void 0 : o.getStore("scheduler");
103
103
  this.nylasSchedulerConnector = new H({
104
104
  schedulerAPIURL: this.schedulerApiUrl,
105
105
  sessionId: this.sessionId,
106
106
  configId: this.refConfigId,
107
107
  slug: this.slug,
108
108
  clientId: this.clientId,
109
- nylasSchedulerStore: i
109
+ nylasSchedulerStore: n
110
110
  });
111
- const o = this.init.emit(this.host);
112
- "init" in this.eventOverrides && (await this.eventOverrides.init(o, this.nylasSchedulerConnector), o.defaultPrevented) || ((d = this.baseProvider) == null || d.componentWillLoad(this.nylasSchedulerConnector), this.applyThemeConfig(this.themeConfig));
111
+ const a = this.init.emit(this.host);
112
+ "init" in this.eventOverrides && (await this.eventOverrides.init(a, this.nylasSchedulerConnector), a.defaultPrevented) || ((r = this.baseProvider) == null || r.componentWillLoad(this.nylasSchedulerConnector), this.applyThemeConfig(this.themeConfig));
113
113
  }
114
114
  async componentDidLoad() {
115
- var l, c, p, g, b, u, m, w;
115
+ var l, p, m, h, c, f, b, w;
116
116
  (l = this.baseProvider) == null || l.componentDidLoad();
117
117
  const t = this.schedulerDidLoad.emit(this.host);
118
118
  if ("schedulerDidLoad" in this.eventOverrides && (await this.eventOverrides.schedulerDidLoad(t, this.nylasSchedulerConnector), t.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
119
119
  return;
120
120
  this.localizationChanged(this.localization);
121
- const e = await ((c = this.nylasSchedulerConnector) == null ? void 0 : c.scheduler.getUISettings());
122
- if (!e || "error" in e)
121
+ const e = await ((p = this.nylasSchedulerConnector) == null ? void 0 : p.scheduler.getUISettings());
122
+ if (!e || "error" in e) {
123
123
  this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(e == null ? void 0 : e.error) }, host: this.host });
124
- else {
125
- "data" in e && ((p = e.data) != null && p.appearance) && console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");
126
- const f = this.configSettingsLoaded.emit({ settings: e });
127
- if ("configSettingsLoaded" in this.eventOverrides && (await this.eventOverrides.configSettingsLoaded(f, this.nylasSchedulerConnector), f.defaultPrevented))
124
+ return;
125
+ } else {
126
+ "data" in e && ((m = e.data) != null && m.appearance) && console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");
127
+ const u = this.configSettingsLoaded.emit({ settings: e });
128
+ if ("configSettingsLoaded" in this.eventOverrides && (await this.eventOverrides.configSettingsLoaded(u, this.nylasSchedulerConnector), u.defaultPrevented))
128
129
  return;
129
130
  }
130
- const i = (g = this.baseProvider) == null ? void 0 : g.getStore("scheduler"), o = (u = (b = i == null ? void 0 : i.get("configSettings")) == null ? void 0 : b.scheduler) == null ? void 0 : u.available_days_in_future, s = i == null ? void 0 : i.get("selectedTimeslot");
131
- if (s && (s != null && s.start_time)) {
132
- if (!this.isTimeslotValid(s))
131
+ const n = (h = this.baseProvider) == null ? void 0 : h.getStore("scheduler"), a = (f = (c = n == null ? void 0 : n.get("configSettings")) == null ? void 0 : c.scheduler) == null ? void 0 : f.available_days_in_future, o = n == null ? void 0 : n.get("selectedTimeslot");
132
+ if (o && (o != null && o.start_time)) {
133
+ if (!this.isTimeslotValid(o))
133
134
  return;
134
- if (i != null && i.get("showBookingForm")) {
135
- i == null || i.set("selectedDate", s.start_time);
135
+ if (n != null && n.get("showBookingForm")) {
136
+ n == null || n.set("selectedDate", o.start_time);
136
137
  return;
137
138
  }
138
139
  }
139
- const d = i == null ? void 0 : i.get("selectedDate"), r = i == null ? void 0 : i.get("availability");
140
- let a;
141
- if (!(r && r.length > 0)) {
142
- if (d) {
143
- const { startTime: f, endTime: v, endTimeForAvailableDaysInFuture: C } = this.validateAvailableDaysInFuture(d, o || 30);
144
- d.getTime() < C * 1e3 && (a = await ((w = this.nylasSchedulerConnector) == null ? void 0 : w.scheduler.getAvailability(f, v)));
140
+ const r = n == null ? void 0 : n.get("selectedDate"), d = n == null ? void 0 : n.get("availability");
141
+ let s;
142
+ if (!(d && d.length > 0)) {
143
+ if (r) {
144
+ const { startTime: u, endTime: v, endTimeForAvailableDaysInFuture: C } = this.validateAvailableDaysInFuture(r, a || 30);
145
+ r.getTime() < C * 1e3 && (s = await ((w = this.nylasSchedulerConnector) == null ? void 0 : w.scheduler.getAvailability(u, v)));
145
146
  } else {
146
- const f = /* @__PURE__ */ new Date(), { startTime: v, endTime: C, endTimeForAvailableDaysInFuture: R } = this.validateAvailableDaysInFuture(f, o || 30);
147
- f.getTime() < R * 1e3 && (a = await ((m = this.nylasSchedulerConnector) == null ? void 0 : m.scheduler.getAvailability(v, C)));
147
+ const u = /* @__PURE__ */ new Date(), { startTime: v, endTime: C, endTimeForAvailableDaysInFuture: z } = this.validateAvailableDaysInFuture(u, a || 30);
148
+ u.getTime() < z * 1e3 && (s = await ((b = this.nylasSchedulerConnector) == null ? void 0 : b.scheduler.getAvailability(v, C)));
148
149
  }
149
- if ((!a || "error" in a) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(a == null ? void 0 : a.error) }, host: this.host }), !d) {
150
- let f = /* @__PURE__ */ new Date();
151
- const v = i == null ? void 0 : i.get("availability").find((C) => new Date(C.start_time) > /* @__PURE__ */ new Date());
152
- v && (f = v.start_time), i == null || i.set("selectedDate", f);
150
+ if ((!s || "error" in s) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(s == null ? void 0 : s.error) }, host: this.host }), !r) {
151
+ let u = /* @__PURE__ */ new Date();
152
+ const v = n == null ? void 0 : n.get("availability").find((C) => new Date(C.start_time) > /* @__PURE__ */ new Date());
153
+ v && (u = v.start_time), n == null || n.set("selectedDate", u);
153
154
  }
154
155
  }
155
156
  }
@@ -162,29 +163,29 @@ const k = (t, e) => {
162
163
  (e = this.stores) == null || e.scheduler.set("bookingInfo", t);
163
164
  }
164
165
  rescheduleBookingRefChanged(t) {
165
- var e, i;
166
+ var e, n;
166
167
  if (t) {
167
- const [o, s] = I(t);
168
- (e = this.stores) == null || e.scheduler.set("rescheduleBookingId", s), this.refConfigId = o, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(o);
168
+ const [a, o] = I(t);
169
+ (e = this.stores) == null || e.scheduler.set("rescheduleBookingId", o), this.refConfigId = a, (n = this.nylasSchedulerConnector) == null || n.scheduler.setConfigId(a);
169
170
  }
170
171
  }
171
172
  cancelBookingRefChanged(t) {
172
- var e, i;
173
+ var e, n;
173
174
  if (t) {
174
- const [o, s] = I(t);
175
- (e = this.stores) == null || e.scheduler.set("cancelBookingId", s), this.refConfigId = o, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(o);
175
+ const [a, o] = I(t);
176
+ (e = this.stores) == null || e.scheduler.set("cancelBookingId", o), this.refConfigId = a, (n = this.nylasSchedulerConnector) == null || n.scheduler.setConfigId(a);
176
177
  }
177
178
  }
178
179
  organizerConfirmationBookingRefChanged(t) {
179
- var e, i;
180
+ var e, n;
180
181
  if (t) {
181
- const [o, s] = I(t);
182
- (e = this.stores) == null || e.scheduler.set("organizerConfirmationBookingId", s), this.refConfigId = o, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(o);
182
+ const [a, o] = I(t);
183
+ (e = this.stores) == null || e.scheduler.set("organizerConfirmationBookingId", o), this.refConfigId = a, (n = this.nylasSchedulerConnector) == null || n.scheduler.setConfigId(a);
183
184
  }
184
185
  }
185
186
  localizationChanged(t) {
186
187
  t && Object.keys(t).forEach((e) => {
187
- e in j && (h.addResourceBundle(e, "translation", t[e], !1, !0), this.language = this.language);
188
+ e in j && (g.addResourceBundle(e, "translation", t[e], !1, !0), this.language = this.language);
188
189
  });
189
190
  }
190
191
  themeConfigChanged(t) {
@@ -192,7 +193,7 @@ const k = (t, e) => {
192
193
  }
193
194
  languageChanged(t) {
194
195
  const e = t.detail;
195
- this.language = e, h.changeLanguage(e);
196
+ this.language = e, g.changeLanguage(e);
196
197
  }
197
198
  async registerComponentHandler(t) {
198
199
  var e;
@@ -203,33 +204,46 @@ const k = (t, e) => {
203
204
  (e = this.baseProvider) == null || e.unregisterComponent(t.detail);
204
205
  }
205
206
  async monthChangedHandler(t) {
206
- var r, a, l, c, p, g, b;
207
- const e = t.detail, i = (c = (l = (a = (r = this.nylasSchedulerConnector) == null ? void 0 : r.schedulerStore) == null ? void 0 : a.get("configSettings")) == null ? void 0 : l.scheduler) == null ? void 0 : c.available_days_in_future, { startTime: o, endTime: s, endTimeForAvailableDaysInFuture: d } = this.validateAvailableDaysInFuture(e, i || 30);
208
- if (o < d && e.getTime() < d * 1e3) {
209
- const u = await ((p = this.nylasSchedulerConnector) == null ? void 0 : p.scheduler.getAvailability(o, s));
210
- (!u || "error" in u) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(u == null ? void 0 : u.error) }, host: this.host });
211
- const m = (g = this.stores) == null ? void 0 : g.scheduler.get("selectableDates");
212
- m && m.length > 0 && ((b = this.stores) == null || b.scheduler.set("selectedDate", m[0]));
207
+ var d, s, l, p, m, h, c;
208
+ const e = t.detail, n = (p = (l = (s = (d = this.nylasSchedulerConnector) == null ? void 0 : d.schedulerStore) == null ? void 0 : s.get("configSettings")) == null ? void 0 : l.scheduler) == null ? void 0 : p.available_days_in_future, { startTime: a, endTime: o, endTimeForAvailableDaysInFuture: r } = this.validateAvailableDaysInFuture(e, n || 30);
209
+ if (a < r && e.getTime() < r * 1e3) {
210
+ const f = await ((m = this.nylasSchedulerConnector) == null ? void 0 : m.scheduler.getAvailability(a, o));
211
+ (!f || "error" in f) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(f == null ? void 0 : f.error) }, host: this.host });
212
+ const b = (h = this.stores) == null ? void 0 : h.scheduler.get("selectableDates");
213
+ b && b.length > 0 && ((c = this.stores) == null || c.scheduler.set("selectedDate", b[0]));
213
214
  }
214
215
  }
216
+ mapToBookingData(t) {
217
+ var d, s, l;
218
+ const e = (d = this.stores) == null ? void 0 : d.scheduler.get("selectedTimeslot"), n = (s = this.stores) == null ? void 0 : s.scheduler.get("selectedLanguage"), a = (l = this.stores) == null ? void 0 : l.scheduler.get("selectedTimezone"), o = e != null && e.start_time ? new Date(e == null ? void 0 : e.start_time).getTime() / 1e3 : "", r = e != null && e.end_time ? new Date(e == null ? void 0 : e.end_time).getTime() / 1e3 : "";
219
+ return {
220
+ additional_guests: t.guests,
221
+ guest: t.primaryParticipant,
222
+ additional_fields: t.additionalFields,
223
+ start_time: o,
224
+ end_time: r,
225
+ email_language: n,
226
+ timezone: a
227
+ };
228
+ }
215
229
  async bookButtonClickedHandler(t) {
216
- var d, r, a, l;
217
- const i = (r = (d = this.nylasSchedulerConnector) == null ? void 0 : d.schedulerStore) == null ? void 0 : r.get("rescheduleBookingId");
218
- if (i) {
219
- const c = await ((a = this.nylasSchedulerConnector) == null ? void 0 : a.scheduler.rescheduleBooking(i, t.detail));
230
+ var l, p, m, h;
231
+ const e = t.detail, n = this.mapToBookingData(e), o = (p = (l = this.nylasSchedulerConnector) == null ? void 0 : l.schedulerStore) == null ? void 0 : p.get("rescheduleBookingId");
232
+ if (o) {
233
+ const c = await ((m = this.nylasSchedulerConnector) == null ? void 0 : m.scheduler.rescheduleBooking(o, e));
220
234
  (!c || "error" in c) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(c == null ? void 0 : c.error) }, host: this.host });
221
- const p = this.bookedEventInfo.emit({ ...c });
222
- "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(p, this.nylasSchedulerConnector);
235
+ const f = c == null ? void 0 : c.data, b = this.bookedEventInfo.emit({ ...c, data: { ...f, ...n } });
236
+ "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(b, this.nylasSchedulerConnector);
223
237
  return;
224
238
  }
225
- const o = await ((l = this.nylasSchedulerConnector) == null ? void 0 : l.scheduler.bookTimeslot(t.detail));
226
- (!o || "error" in o) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(o == null ? void 0 : o.error) }, host: this.host });
227
- const s = this.bookedEventInfo.emit({ ...o });
239
+ const r = await ((h = this.nylasSchedulerConnector) == null ? void 0 : h.scheduler.bookTimeslot(e));
240
+ (!r || "error" in r) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(r == null ? void 0 : r.error) }, host: this.host });
241
+ const d = r == null ? void 0 : r.data, s = this.bookedEventInfo.emit({ ...r, data: { ...d, ...n } });
228
242
  "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(s, this.nylasSchedulerConnector);
229
243
  }
230
244
  dateSelectedHandler(t) {
231
245
  const e = t.detail;
232
- this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${h.t("noDateSelected")}`;
246
+ this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${g.t("noDateSelected")}`;
233
247
  }
234
248
  cancelBookedEventErrorHandler(t) {
235
249
  this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t.detail.error) }, host: this.host });
@@ -266,9 +280,9 @@ const k = (t, e) => {
266
280
  checkIfSessionIdOrConfigIdExists() {
267
281
  if (!this.sessionId && !this.refConfigId && !(this.slug && this.clientId)) {
268
282
  let t = "";
269
- return this.sessionId || (t += h.t("sessionIdRequiredErrorMessage")), !this.sessionId && !this.refConfigId && !(this.slug && this.clientId) && (t = h.t("sessionIdRequiredErrorMessage") + " " + h.t("publicConfigErrorMessage")), this.nylasSchedulerError.emit({
283
+ return this.sessionId || (t += g.t("sessionIdRequiredErrorMessage")), !this.sessionId && !this.refConfigId && !(this.slug && this.clientId) && (t = g.t("sessionIdRequiredErrorMessage") + " " + g.t("publicConfigErrorMessage")), this.nylasSchedulerError.emit({
270
284
  notification: {
271
- title: h.t("schedulingComponentErrorTitle"),
285
+ title: g.t("schedulingComponentErrorTitle"),
272
286
  category: B.Component,
273
287
  type: x.Error,
274
288
  description: t,
@@ -283,10 +297,10 @@ const k = (t, e) => {
283
297
  isTimeslotValid(t) {
284
298
  return new Date(t.start_time) < /* @__PURE__ */ new Date() ? (this.nylasSchedulerError.emit({
285
299
  notification: {
286
- title: h.t("invalidTimeslotErrorTitle"),
300
+ title: g.t("invalidTimeslotErrorTitle"),
287
301
  category: B.Component,
288
302
  type: x.Error,
289
- description: h.t("invalidTimeslotErrorMessage"),
303
+ description: g.t("invalidTimeslotErrorMessage"),
290
304
  id: (/* @__PURE__ */ new Date()).getTime().toString(),
291
305
  ttl: "none"
292
306
  },
@@ -294,36 +308,36 @@ const k = (t, e) => {
294
308
  }), !1) : !0;
295
309
  }
296
310
  validateAvailableDaysInFuture(t, e) {
297
- const i = /* @__PURE__ */ new Date(), o = new Date(t.getFullYear(), t.getMonth(), 1).getTime() / 1e3, s = new Date(t.getFullYear(), t.getMonth() + 1, 1).getTime() / 1e3, d = Math.floor(O(i, e).getTime() / 1e3), r = Math.min(d, s);
298
- return { startTime: o < i.getTime() / 1e3 ? Math.floor(i.getTime() / 1e3) : o, endTime: r, endTimeForAvailableDaysInFuture: d };
311
+ const n = /* @__PURE__ */ new Date(), a = new Date(t.getFullYear(), t.getMonth(), 1).getTime() / 1e3, o = new Date(t.getFullYear(), t.getMonth() + 1, 1).getTime() / 1e3, r = Math.floor(O(n, e).getTime() / 1e3), d = Math.min(r, o);
312
+ return { startTime: a < n.getTime() / 1e3 ? Math.floor(n.getTime() / 1e3) : a, endTime: d, endTimeForAvailableDaysInFuture: r };
299
313
  }
300
314
  applyThemeConfig(t) {
301
315
  if (t)
302
- for (const [e, i] of Object.entries(t))
303
- this.host.style.setProperty(`${e}`, i);
316
+ for (const [e, n] of Object.entries(t))
317
+ this.host.style.setProperty(`${e}`, n);
304
318
  }
305
319
  render() {
306
- var m, w, f;
307
- const t = this.mode === "app", e = (m = this.baseProvider) == null ? void 0 : m.getStore("scheduler"), i = e == null ? void 0 : e.get("eventInfo"), o = e == null ? void 0 : e.get("showBookingForm"), s = e == null ? void 0 : e.get("cancelledEventInfo"), d = e == null ? void 0 : e.get("cancelBookingId"), r = e == null ? void 0 : e.get("selectedTimeslot"), a = e == null ? void 0 : e.get("rescheduleBookingId"), l = e == null ? void 0 : e.get("organizerConfirmationBookingId"), c = e == null ? void 0 : e.get("rejectBookingId"), p = e == null ? void 0 : e.get("confirmedEventInfo"), g = (e == null ? void 0 : e.get("nylasBranding")) || this.nylasBranding, b = e == null ? void 0 : e.get("selectedDate"), u = (f = (w = e == null ? void 0 : e.get("configSettings")) == null ? void 0 : w.scheduler) == null ? void 0 : f.confirmation_redirect_url;
308
- if (this.selectedDateLabel = b && this.language ? N(b.toLocaleDateString(M[this.language], { dateStyle: "full" })) : `${h.t("noDateSelected")}`, t && (d || c) && !s)
309
- return n(y, null, n(k, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, n("nylas-cancel-booking-form", { selectedTimeslot: r, cancelBookingId: d, rejectBookingId: c, exportparts: "ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card" }))));
320
+ var b, w, u;
321
+ const t = this.mode === "app", e = (b = this.baseProvider) == null ? void 0 : b.getStore("scheduler"), n = e == null ? void 0 : e.get("eventInfo"), a = e == null ? void 0 : e.get("showBookingForm"), o = e == null ? void 0 : e.get("cancelledEventInfo"), r = e == null ? void 0 : e.get("cancelBookingId"), d = e == null ? void 0 : e.get("selectedTimeslot"), s = e == null ? void 0 : e.get("rescheduleBookingId"), l = e == null ? void 0 : e.get("organizerConfirmationBookingId"), p = e == null ? void 0 : e.get("rejectBookingId"), m = e == null ? void 0 : e.get("confirmedEventInfo"), h = (e == null ? void 0 : e.get("nylasBranding")) || this.nylasBranding, c = e == null ? void 0 : e.get("selectedDate"), f = (u = (w = e == null ? void 0 : e.get("configSettings")) == null ? void 0 : w.scheduler) == null ? void 0 : u.confirmation_redirect_url;
322
+ if (this.selectedDateLabel = c && this.language ? N(c.toLocaleDateString(M[this.language], { dateStyle: "full" })) : `${g.t("noDateSelected")}`, t && (r || p) && !o)
323
+ return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, i("nylas-cancel-booking-form", { selectedTimeslot: d, cancelBookingId: r, rejectBookingId: p, exportparts: "ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card" }))));
310
324
  if (t && l)
311
- return n(y, null, n(k, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "manual-confirmation-page", part: "manual-confirmation-page" }, n("nylas-organizer-confirmation-card", { organizerConfirmationBookingId: l, exportparts: "nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline" }))));
312
- if (t && s)
313
- return n(y, null, n(k, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, n("nylas-cancelled-event-card", { cancelledEventInfo: s, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))));
314
- if (t && p)
315
- return n(y, null, n(k, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, n("nylas-confirmed-event-card", { confirmedEventInfo: p, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))));
316
- if (t && i && u) {
317
- window.location.assign(u);
325
+ return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "manual-confirmation-page", part: "manual-confirmation-page" }, i("nylas-organizer-confirmation-card", { organizerConfirmationBookingId: l, exportparts: "nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline" }))));
326
+ if (t && o)
327
+ return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, i("nylas-cancelled-event-card", { cancelledEventInfo: o, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))));
328
+ if (t && m)
329
+ return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, i("nylas-confirmed-event-card", { confirmedEventInfo: m, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))));
330
+ if (t && n && f) {
331
+ window.location.assign(f);
318
332
  return;
319
333
  }
320
- if (t && i)
321
- return n(y, null, n(k, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "booked-event-page", part: "booked-event-page" }, n("nylas-booked-event-card", { selectedTimeslot: r, eventInfo: i, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))));
322
- if (t && (!i || a) && !o) {
334
+ if (t && n)
335
+ return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, i("div", { class: "booked-event-page", part: "booked-event-page" }, i("nylas-booked-event-card", { selectedTimeslot: d, eventInfo: n, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))));
336
+ if (t && (!n || s) && !a) {
323
337
  const v = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
324
- return n(y, null, n(k, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, a && n(L, null, `${h.t("rescheduleTitle")}`), n("div", { class: "select-date-page", part: "select-date-page" }, n("div", { class: "left-panel" }, n("nylas-date-picker", { exportparts: "ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), n("nylas-locale-switch", { exportparts: "nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label" })), n("div", { class: `right-panel ${a ? "reschedule" : ""}` }, n("h2", null, n("calendar-icon", null), n("span", { id: "selectedDate" }, this.selectedDateLabel)), n("nylas-timeslot-picker", { exportparts: "ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary" }, v && n("span", { slot: "timeslot-picker-cta-label" }, n("slot", { name: "timeslot-picker-cta-label" })))))));
338
+ return i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, s && i(L, null, `${g.t("rescheduleTitle")}`), i("div", { class: "select-date-page", part: "select-date-page" }, i("div", { class: "left-panel" }, i("nylas-date-picker", { exportparts: "ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), i("nylas-locale-switch", { exportparts: "nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label" })), i("div", { class: `right-panel ${s ? "reschedule" : ""}` }, i("h2", null, i("calendar-icon", null), i("span", { id: "selectedDate" }, this.selectedDateLabel)), i("nylas-timeslot-picker", { exportparts: "ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary" }, v && i("span", { slot: "timeslot-picker-cta-label" }, i("slot", { name: "timeslot-picker-cta-label" })))))));
325
339
  }
326
- return t && !i && o ? n(y, null, n(k, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, a && n(L, null, `${h.t("rescheduleTitle")}`), n("div", { class: "additional-data-page", part: "additional-data-page" }, n("div", { class: "left-panel" }, n("div", { class: "wrapper" }, n("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone" }))), n("div", { class: `right-panel ${a ? "reschedule" : ""}` }, n("nylas-booking-form", { exportparts: "nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content" }))))) : n(y, null, n("slot", null));
340
+ return t && !n && a ? i(y, null, i(k, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, s && i(L, null, `${g.t("rescheduleTitle")}`), i("div", { class: "additional-data-page", part: "additional-data-page" }, i("div", { class: "left-panel" }, i("div", { class: "wrapper" }, i("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone" }))), i("div", { class: `right-panel ${s ? "reschedule" : ""}` }, i("nylas-booking-form", { exportparts: "nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content" }))))) : i(y, null, i("slot", null));
327
341
  }
328
342
  get host() {
329
343
  return A(this);
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-c4e817ef.cjs"),I=require("./index.es-79f5b771-08cc349d.cjs"),k=require("./scheduler-store-9ff4914b-63dc472a.cjs"),w=require("./constants-50c3e067-1fe54cf3.cjs");require("react");require("react-dom");class B{constructor({schedulerAPIURL:e,nylasSchedulerStore:i,sessionId:a,configId:o,slug:r,clientId:d}){if(!e)throw new Error("schedulerAPIURL is required");if(!i)throw new Error("nylasSchedulerStore is required");if(!a&&!o&&!(r||d))throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");e==="/"&&(e=new URL(window.location.href).origin),this.configId=o,this.sessionId=a,this.schedulerAPIURL=e,this.nylasSchedulerStore=i,this.slug=r,this.clientId=d}init(){t.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new k.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}const v=(n,e)=>{const i=n.isLoading,a=n.showNotification,o=n.nylasBranding;return t.h(t.Fragment,null,a&&t.h("nylas-notification",null),i&&t.h("div",{class:"loading"},t.h("div",{class:"left"},t.h("div",{class:"skeleton"})),t.h("div",{class:"right"},t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}))),!i&&e,t.h("div",{class:"footer"},o&&t.h(t.Fragment,null,"Powered by ",t.h("nylas-logo",null))))},C=(n,e)=>t.h("div",{class:"message-banner"},e),T=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}',L=T,x={title:t.instance.t("genericErrorTitle"),type:I.nr.Error,category:k.ErrorCategory.Component},E=class{constructor(n){t.registerInstance(this,n),this.init=t.createEvent(this,"init",7),this.schedulerWillLoad=t.createEvent(this,"schedulerWillLoad",7),this.schedulerDidLoad=t.createEvent(this,"schedulerDidLoad",7),this.nylasSchedulerError=t.createEvent(this,"nylasSchedulerError",7),this.configSettingsLoaded=t.createEvent(this,"configSettingsLoaded",7),this.bookingRefExtracted=t.createEvent(this,"bookingRefExtracted",7),this.bookedEventInfo=t.createEvent(this,"bookedEventInfo",7),this.mode="app",this.defaultSchedulerState=void 0,this.sessionId=void 0,this.schedulerApiUrl="https://api.us.nylas.com",this.bookingInfo=void 0,this.rescheduleBookingRef=void 0,this.cancelBookingRef=void 0,this.organizerConfirmationBookingRef=void 0,this.configurationId=void 0,this.slug=void 0,this.clientId=void 0,this.nylasBranding=!0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.localization=void 0,this.showNotification=!0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(void 0,{dateStyle:"full"})||`${t.instance.t("noDateSelected")}`,this.refConfigId=void 0,this.language=navigator.language}connectedCallback(){t.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var o,r;t.debug("[nylas-scheduler] Component will load");const n=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerWillLoad(n,this.nylasSchedulerConnector),n.defaultPrevented))return;this.stores={scheduler:k.CreateNylasSchedulerStore({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})},this.baseProvider=new I.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.refConfigId=this.configurationId;let e;if(this.rescheduleBookingRef){const[d,s,l]=t.compactStringToUUIDs(this.rescheduleBookingRef);this.refConfigId=d,this.stores.scheduler.set("rescheduleBookingId",s),e=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.cancelBookingRef){const[d,s,l]=t.compactStringToUUIDs(this.cancelBookingRef);this.refConfigId=d,this.stores.scheduler.set("cancelBookingId",s),e=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.organizerConfirmationBookingRef){const[d,s,l]=t.compactStringToUUIDs(this.organizerConfirmationBookingRef);this.refConfigId=d,this.stores.scheduler.set("organizerConfirmationBookingId",s),this.stores.scheduler.set("organizerConfirmationSalt",l),e=this.bookingRefExtracted.emit({configurationId:d,bookingId:s,salt:l})}if("bookingRefExtracted"in this.eventOverrides&&(await this.eventOverrides.bookingRefExtracted(e,this.nylasSchedulerConnector),e.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;const i=(o=this.baseProvider)==null?void 0:o.getStore("scheduler");this.nylasSchedulerConnector=new B({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:i});const a=this.init.emit(this.host);"init"in this.eventOverrides&&(await this.eventOverrides.init(a,this.nylasSchedulerConnector),a.defaultPrevented)||((r=this.baseProvider)==null||r.componentWillLoad(this.nylasSchedulerConnector),this.applyThemeConfig(this.themeConfig))}async componentDidLoad(){var l,u,p,h,c,g,m,y;(l=this.baseProvider)==null||l.componentDidLoad();const n=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerDidLoad(n,this.nylasSchedulerConnector),n.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;this.localizationChanged(this.localization);const e=await((u=this.nylasSchedulerConnector)==null?void 0:u.scheduler.getUISettings());if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e==null?void 0:e.error)},host:this.host});return}else{"data"in e&&((p=e.data)!=null&&p.appearance)&&console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");const f=this.configSettingsLoaded.emit({settings:e});if("configSettingsLoaded"in this.eventOverrides&&(await this.eventOverrides.configSettingsLoaded(f,this.nylasSchedulerConnector),f.defaultPrevented))return}const i=(h=this.baseProvider)==null?void 0:h.getStore("scheduler"),a=(g=(c=i==null?void 0:i.get("configSettings"))==null?void 0:c.scheduler)==null?void 0:g.available_days_in_future,o=i==null?void 0:i.get("selectedTimeslot");if(o&&(o!=null&&o.start_time)){if(!this.isTimeslotValid(o))return;if(i!=null&&i.get("showBookingForm")){i==null||i.set("selectedDate",o.start_time);return}}const r=i==null?void 0:i.get("selectedDate"),d=i==null?void 0:i.get("availability");let s;if(!(d&&d.length>0)){if(r){const{startTime:f,endTime:b,endTimeForAvailableDaysInFuture:_}=this.validateAvailableDaysInFuture(r,a||30);r.getTime()<_*1e3&&(s=await((y=this.nylasSchedulerConnector)==null?void 0:y.scheduler.getAvailability(f,b)))}else{const f=new Date,{startTime:b,endTime:_,endTimeForAvailableDaysInFuture:D}=this.validateAvailableDaysInFuture(f,a||30);f.getTime()<D*1e3&&(s=await((m=this.nylasSchedulerConnector)==null?void 0:m.scheduler.getAvailability(b,_)))}if((!s||"error"in s)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(s==null?void 0:s.error)},host:this.host}),!r){let f=new Date;const b=i==null?void 0:i.get("availability").find(_=>new Date(_.start_time)>new Date);b&&(f=b.start_time),i==null||i.set("selectedDate",f)}}}componentDisconnected(){var n;(n=this.baseProvider)==null||n.componentDisconnected()}bookingInfoChanged(n){var e;(e=this.stores)==null||e.scheduler.set("bookingInfo",n)}rescheduleBookingRefChanged(n){var e,i;if(n){const[a,o]=t.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("rescheduleBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}cancelBookingRefChanged(n){var e,i;if(n){const[a,o]=t.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("cancelBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}organizerConfirmationBookingRefChanged(n){var e,i;if(n){const[a,o]=t.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("organizerConfirmationBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}localizationChanged(n){n&&Object.keys(n).forEach(e=>{e in w.LANGUAGE_CODE&&(t.instance.addResourceBundle(e,"translation",n[e],!1,!0),this.language=this.language)})}themeConfigChanged(n){this.applyThemeConfig(n)}languageChanged(n){const e=n.detail;this.language=e,t.instance.changeLanguage(e)}async registerComponentHandler(n){var e;(e=this.baseProvider)==null||e.registerComponent(n.detail)}async unregisterComponentHandler(n){var e;(e=this.baseProvider)==null||e.unregisterComponent(n.detail)}async monthChangedHandler(n){var d,s,l,u,p,h,c;const e=n.detail,i=(u=(l=(s=(d=this.nylasSchedulerConnector)==null?void 0:d.schedulerStore)==null?void 0:s.get("configSettings"))==null?void 0:l.scheduler)==null?void 0:u.available_days_in_future,{startTime:a,endTime:o,endTimeForAvailableDaysInFuture:r}=this.validateAvailableDaysInFuture(e,i||30);if(a<r&&e.getTime()<r*1e3){const g=await((p=this.nylasSchedulerConnector)==null?void 0:p.scheduler.getAvailability(a,o));(!g||"error"in g)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(g==null?void 0:g.error)},host:this.host});const m=(h=this.stores)==null?void 0:h.scheduler.get("selectableDates");m&&m.length>0&&((c=this.stores)==null||c.scheduler.set("selectedDate",m[0]))}}mapToBookingData(n){var d,s,l;const e=(d=this.stores)==null?void 0:d.scheduler.get("selectedTimeslot"),i=(s=this.stores)==null?void 0:s.scheduler.get("selectedLanguage"),a=(l=this.stores)==null?void 0:l.scheduler.get("selectedTimezone"),o=e!=null&&e.start_time?new Date(e==null?void 0:e.start_time).getTime()/1e3:"",r=e!=null&&e.end_time?new Date(e==null?void 0:e.end_time).getTime()/1e3:"";return{additional_guests:n.guests,guest:n.primaryParticipant,additional_fields:n.additionalFields,start_time:o,end_time:r,email_language:i,timezone:a}}async bookButtonClickedHandler(n){var l,u,p,h;const e=n.detail,i=this.mapToBookingData(e),o=(u=(l=this.nylasSchedulerConnector)==null?void 0:l.schedulerStore)==null?void 0:u.get("rescheduleBookingId");if(o){const c=await((p=this.nylasSchedulerConnector)==null?void 0:p.scheduler.rescheduleBooking(o,e));(!c||"error"in c)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(c==null?void 0:c.error)},host:this.host});const g=c==null?void 0:c.data,m=this.bookedEventInfo.emit({...c,data:{...g,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(m,this.nylasSchedulerConnector);return}const r=await((h=this.nylasSchedulerConnector)==null?void 0:h.scheduler.bookTimeslot(e));(!r||"error"in r)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r==null?void 0:r.error)},host:this.host});const d=r==null?void 0:r.data,s=this.bookedEventInfo.emit({...r,data:{...d,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(s,this.nylasSchedulerConnector)}dateSelectedHandler(n){const e=n.detail;this.selectedDateLabel=e?e.toLocaleDateString(void 0,{dateStyle:"full"}):`${t.instance.t("noDateSelected")}`}cancelBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}confirmBookingErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}async getNylasSchedulerStore(){var n;return(n=this.baseProvider)==null?void 0:n.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(n){return{title:(n==null?void 0:n.title)||x.title,category:(n==null?void 0:n.category)||x.category,type:I.nr.Error,description:(n==null?void 0:n.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let n="";return this.sessionId||(n+=t.instance.t("sessionIdRequiredErrorMessage")),!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)&&(n=t.instance.t("sessionIdRequiredErrorMessage")+" "+t.instance.t("publicConfigErrorMessage")),this.nylasSchedulerError.emit({notification:{title:t.instance.t("schedulingComponentErrorTitle"),category:k.ErrorCategory.Component,type:I.nr.Error,description:n,id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1}return!0}isTimeslotValid(n){return new Date(n.start_time)<new Date?(this.nylasSchedulerError.emit({notification:{title:t.instance.t("invalidTimeslotErrorTitle"),category:k.ErrorCategory.Component,type:I.nr.Error,description:t.instance.t("invalidTimeslotErrorMessage"),id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1):!0}validateAvailableDaysInFuture(n,e){const i=new Date,a=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,o=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,r=Math.floor(t.addDaysToCurrentDate(i,e).getTime()/1e3),d=Math.min(r,o);return{startTime:a<i.getTime()/1e3?Math.floor(i.getTime()/1e3):a,endTime:d,endTimeForAvailableDaysInFuture:r}}applyThemeConfig(n){if(n)for(const[e,i]of Object.entries(n))this.host.style.setProperty(`${e}`,i)}render(){var m,y,f;const n=this.mode==="app",e=(m=this.baseProvider)==null?void 0:m.getStore("scheduler"),i=e==null?void 0:e.get("eventInfo"),a=e==null?void 0:e.get("showBookingForm"),o=e==null?void 0:e.get("cancelledEventInfo"),r=e==null?void 0:e.get("cancelBookingId"),d=e==null?void 0:e.get("selectedTimeslot"),s=e==null?void 0:e.get("rescheduleBookingId"),l=e==null?void 0:e.get("organizerConfirmationBookingId"),u=e==null?void 0:e.get("rejectBookingId"),p=e==null?void 0:e.get("confirmedEventInfo"),h=(e==null?void 0:e.get("nylasBranding"))||this.nylasBranding,c=e==null?void 0:e.get("selectedDate"),g=(f=(y=e==null?void 0:e.get("configSettings"))==null?void 0:y.scheduler)==null?void 0:f.confirmation_redirect_url;if(this.selectedDateLabel=c&&this.language?t.capitalizeFirstLetter(c.toLocaleDateString(w.LANGUAGE_CODE_MAP[this.language],{dateStyle:"full"})):`${t.instance.t("noDateSelected")}`,n&&(r||u)&&!o)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},t.h("nylas-cancel-booking-form",{selectedTimeslot:d,cancelBookingId:r,rejectBookingId:u,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))));if(n&&l)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},t.h("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:l,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))));if(n&&o)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},t.h("nylas-cancelled-event-card",{cancelledEventInfo:o,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))));if(n&&p)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancelled-event-page",part:"confirmed-event-page"},t.h("nylas-confirmed-event-card",{confirmedEventInfo:p,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))));if(n&&i&&g){window.location.assign(g);return}if(n&&i)return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"booked-event-page",part:"booked-event-page"},t.h("nylas-booked-event-card",{selectedTimeslot:d,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))));if(n&&(!i||s)&&!a){const b=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},s&&t.h(C,null,`${t.instance.t("rescheduleTitle")}`),t.h("div",{class:"select-date-page",part:"select-date-page"},t.h("div",{class:"left-panel"},t.h("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),t.h("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),t.h("div",{class:`right-panel ${s?"reschedule":""}`},t.h("h2",null,t.h("calendar-icon",null),t.h("span",{id:"selectedDate"},this.selectedDateLabel)),t.h("nylas-timeslot-picker",{exportparts:"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},b&&t.h("span",{slot:"timeslot-picker-cta-label"},t.h("slot",{name:"timeslot-picker-cta-label"})))))))}return n&&!i&&a?t.h(t.Host,null,t.h(v,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},s&&t.h(C,null,`${t.instance.t("rescheduleTitle")}`),t.h("div",{class:"additional-data-page",part:"additional-data-page"},t.h("div",{class:"left-panel"},t.h("div",{class:"wrapper"},t.h("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),t.h("div",{class:`right-panel ${s?"reschedule":""}`},t.h("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"}))))):t.h(t.Host,null,t.h("slot",null))}get host(){return t.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],themeConfig:["themeConfigChanged"]}}};E.style=L;exports.nylas_scheduling=E;
@@ -1,5 +1,5 @@
1
- import { r as f, c as p, d as i, h as o, H as u } from "./index-a134f625.js";
2
- import { R as m } from "./register-component-ea95564d-e19ec159.js";
1
+ import { r as f, c as p, d as i, h as o, H as u } from "./index-1322d804.js";
2
+ import { R as m } from "./register-component-ea95564d-843da1da.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  const g = ":host{display:contents}.container{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.pull-to-refresh{display:none;border:0;background-color:transparent;text-align:center;width:100%;justify-content:center}.pulling{position:relative;display:flex;margin:0 auto;padding:1rem}.pulling svg{width:24px;height:24px;color:var(--nylas-color-primary-500);transform:rotate(90deg)}.refreshing{position:relative;display:flex;margin:0 auto;padding:1rem}.refreshing svg{width:24px;height:24px;fill:var(--nylas-color-primary-500);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}", y = g;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-2a53b6a8.cjs"),d=require("./register-component-ea95564d-ab3d630f.cjs");require("react");require("react-dom");const f=":host{display:contents}.container{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.pull-to-refresh{display:none;border:0;background-color:transparent;text-align:center;width:100%;justify-content:center}.pulling{position:relative;display:flex;margin:0 auto;padding:1rem}.pulling svg{width:24px;height:24px;color:var(--nylas-color-primary-500);transform:rotate(90deg)}.refreshing{position:relative;display:flex;margin:0 auto;padding:1rem}.refreshing svg{width:24px;height:24px;fill:var(--nylas-color-primary-500);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}",u=f;var p=function(t,e,n,a){var i=arguments.length,r=i<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,n):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,e,n,a);else for(var h=t.length-1;h>=0;h--)(o=t[h])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);return i>3&&r&&Object.defineProperty(e,n,r),r},l=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)};const c=class{constructor(t){s.registerInstance(this,t),this.refresh=s.createEvent(this,"refresh",7),this.threshold=100,this.onTouchStart=e=>{var n,a,i,r;s.debug("[nylas-threads-refresh] Touch start",e.touches[0].pageY,(n=this.containerElement)==null?void 0:n.scrollTop,(a=this.containerElement)==null?void 0:a.offsetHeight,(i=this.contentElement)==null?void 0:i.scrollTop),((r=this.containerElement)==null?void 0:r.scrollTop)===0?this.start=e.touches[0].pageY:this.start=0},this.onTouchMove=e=>{this.start&&(e.touches[0].pageY-this.start>this.threshold?this.pulling=!0:this.pulling=!1)},this.onTouchEnd=e=>{this.start&&(e.changedTouches[0].pageY-this.start>this.threshold&&(this.pulling=!1,this.refresh.emit({updateState:this.updateState})),this.start=0)},this.start=0,this.state="ready",this.pulling=!1,s.debug("[nylas-threads-refresh] Constructor"),this.updateState=this.updateState.bind(this)}connectedCallback(){}async componentWillLoad(){s.debug("[nylas-threads-refresh] Component will load")}componentDidLoad(){var t,e,n;s.debug("[nylas-threads-refresh] Component did load"),(t=this.containerElement)==null||t.addEventListener("touchstart",this.onTouchStart),(e=this.containerElement)==null||e.addEventListener("touchmove",this.onTouchMove),(n=this.containerElement)==null||n.addEventListener("touchend",this.onTouchEnd)}disconnectedCallback(){var t,e,n;s.debug("[nylas-threads-refresh] Component disconnected"),(t=this.containerElement)==null||t.removeEventListener("touchstart",this.onTouchStart),(e=this.containerElement)==null||e.removeEventListener("touchmove",this.onTouchMove),(n=this.containerElement)==null||n.removeEventListener("touchend",this.onTouchEnd)}async updateState(t){this.state=t}render(){return s.h(s.Host,{key:"0e7150c1fd50e5422e124ac007132ae2ecc0006b"},s.h("div",{key:"730765ce38847fdbe691f2b9cfeda44e1a46259b",class:"container",ref:t=>this.containerElement=t},s.h("button",{key:"55427e329f0405960f22f736f10722e620931516",class:{"pull-to-refresh":!0,pulling:this.pulling,refreshing:this.state==="loading"},"aria-label":"Refreshing..."},this.state==="loading"&&s.h("refresh-icon",{slot:"icon"}),this.state!=="loading"&&s.h("arrow-icon",{slot:"icon"})),s.h("div",{key:"585886ff635733f5e0398ca9cfe11944860f5a61",class:"content",ref:t=>this.contentElement=t},s.h("slot",{key:"f61cab9fae1aae81ecb0e7a6544ddb4b845c91b4"}))))}};p([d.RegisterComponent({name:"nylas-threads-refresh",eventToProps:{refresh:async(t,e)=>{s.debug("[nylas-threads-refresh] Refreshing threads");const{updateState:n}=t.detail;await n("loading"),await e.threads.getThreads(void 0,"overwrite",!1),await n("ready")}},fireRegisterEvent:!0}),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],c.prototype,"render",null);c.style=u;exports.nylas_threads_refresh=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-c4e817ef.cjs"),d=require("./register-component-ea95564d-a64ee107.cjs");require("react");require("react-dom");const f=":host{display:contents}.container{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.pull-to-refresh{display:none;border:0;background-color:transparent;text-align:center;width:100%;justify-content:center}.pulling{position:relative;display:flex;margin:0 auto;padding:1rem}.pulling svg{width:24px;height:24px;color:var(--nylas-color-primary-500);transform:rotate(90deg)}.refreshing{position:relative;display:flex;margin:0 auto;padding:1rem}.refreshing svg{width:24px;height:24px;fill:var(--nylas-color-primary-500);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}",u=f;var p=function(t,e,n,a){var i=arguments.length,r=i<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,n):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,e,n,a);else for(var h=t.length-1;h>=0;h--)(o=t[h])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);return i>3&&r&&Object.defineProperty(e,n,r),r},l=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)};const c=class{constructor(t){s.registerInstance(this,t),this.refresh=s.createEvent(this,"refresh",7),this.threshold=100,this.onTouchStart=e=>{var n,a,i,r;s.debug("[nylas-threads-refresh] Touch start",e.touches[0].pageY,(n=this.containerElement)==null?void 0:n.scrollTop,(a=this.containerElement)==null?void 0:a.offsetHeight,(i=this.contentElement)==null?void 0:i.scrollTop),((r=this.containerElement)==null?void 0:r.scrollTop)===0?this.start=e.touches[0].pageY:this.start=0},this.onTouchMove=e=>{this.start&&(e.touches[0].pageY-this.start>this.threshold?this.pulling=!0:this.pulling=!1)},this.onTouchEnd=e=>{this.start&&(e.changedTouches[0].pageY-this.start>this.threshold&&(this.pulling=!1,this.refresh.emit({updateState:this.updateState})),this.start=0)},this.start=0,this.state="ready",this.pulling=!1,s.debug("[nylas-threads-refresh] Constructor"),this.updateState=this.updateState.bind(this)}connectedCallback(){}async componentWillLoad(){s.debug("[nylas-threads-refresh] Component will load")}componentDidLoad(){var t,e,n;s.debug("[nylas-threads-refresh] Component did load"),(t=this.containerElement)==null||t.addEventListener("touchstart",this.onTouchStart),(e=this.containerElement)==null||e.addEventListener("touchmove",this.onTouchMove),(n=this.containerElement)==null||n.addEventListener("touchend",this.onTouchEnd)}disconnectedCallback(){var t,e,n;s.debug("[nylas-threads-refresh] Component disconnected"),(t=this.containerElement)==null||t.removeEventListener("touchstart",this.onTouchStart),(e=this.containerElement)==null||e.removeEventListener("touchmove",this.onTouchMove),(n=this.containerElement)==null||n.removeEventListener("touchend",this.onTouchEnd)}async updateState(t){this.state=t}render(){return s.h(s.Host,{key:"0e7150c1fd50e5422e124ac007132ae2ecc0006b"},s.h("div",{key:"730765ce38847fdbe691f2b9cfeda44e1a46259b",class:"container",ref:t=>this.containerElement=t},s.h("button",{key:"55427e329f0405960f22f736f10722e620931516",class:{"pull-to-refresh":!0,pulling:this.pulling,refreshing:this.state==="loading"},"aria-label":"Refreshing..."},this.state==="loading"&&s.h("refresh-icon",{slot:"icon"}),this.state!=="loading"&&s.h("arrow-icon",{slot:"icon"})),s.h("div",{key:"585886ff635733f5e0398ca9cfe11944860f5a61",class:"content",ref:t=>this.contentElement=t},s.h("slot",{key:"f61cab9fae1aae81ecb0e7a6544ddb4b845c91b4"}))))}};p([d.RegisterComponent({name:"nylas-threads-refresh",eventToProps:{refresh:async(t,e)=>{s.debug("[nylas-threads-refresh] Refreshing threads");const{updateState:n}=t.detail;await n("loading"),await e.threads.getThreads(void 0,"overwrite",!1),await n("ready")}},fireRegisterEvent:!0}),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],c.prototype,"render",null);c.style=u;exports.nylas_threads_refresh=c;
@@ -1,5 +1,5 @@
1
- import { r as u, c as y, d as l, h as i, H as f } from "./index-a134f625.js";
2
- import { R as p } from "./register-component-ea95564d-e19ec159.js";
1
+ import { r as u, c as y, d as l, h as i, H as f } from "./index-1322d804.js";
2
+ import { R as p } from "./register-component-ea95564d-843da1da.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  const m = ":host{display:block}sp-search{width:100%;border:0}", b = m;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-2a53b6a8.cjs"),h=require("./register-component-ea95564d-ab3d630f.cjs");require("react");require("react-dom");const u=":host{display:block}sp-search{width:100%;border:0}",y=u;var f=function(t,e,s,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,s):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,e,s,n);else for(var i=t.length-1;i>=0;i--)(c=t[i])&&(r=(o<3?c(r):o>3?c(e,s,r):c(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r},d=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)};const l=class{constructor(t){a.registerInstance(this,t),this.search=a.createEvent(this,"search",7),this.onSearch=async e=>{e.preventDefault(),e.stopPropagation();const n=e.target.value;n!==this.internalQuery&&(this.internalQuery=n,this.search.emit(this.internalQuery))},this.query="",this.internalQuery=""}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){a.debug("[nylas-threads-search] Component will load")}async componentDidLoad(){a.debug("[nylas-threads-search] Component did load")}onQueryChange(){this.internalQuery=this.query}render(){return a.h(a.Host,{key:"6d49d740fb64cff220ddf6b74ca0393a3b6fd83a"},a.h("sp-theme",{key:"fda27523444c0c7350cdfdf6d1a29dd1d63158f5",scale:"medium",color:"dark"},a.h("sp-search",{key:"bb840884220a5008c144f90775ea10291c507b51",quiet:!0,onSubmit:this.onSearch,onBlur:this.onSearch,value:this.internalQuery})))}static get watchers(){return{query:["onQueryChange"]}}};f([h.RegisterComponent({name:"nylas-pagination",stateToProps:new Map([["mailbox.searchQuery","query"]]),eventToProps:{search:async(t,e)=>{await e.threads.getThreads({search_query_native:t.detail||void 0,page_token:void 0})}},fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],l.prototype,"render",null);l.style=y;exports.nylas_threads_search=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-c4e817ef.cjs"),h=require("./register-component-ea95564d-a64ee107.cjs");require("react");require("react-dom");const u=":host{display:block}sp-search{width:100%;border:0}",y=u;var f=function(t,e,s,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,s):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,e,s,n);else for(var i=t.length-1;i>=0;i--)(c=t[i])&&(r=(o<3?c(r):o>3?c(e,s,r):c(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r},d=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)};const l=class{constructor(t){a.registerInstance(this,t),this.search=a.createEvent(this,"search",7),this.onSearch=async e=>{e.preventDefault(),e.stopPropagation();const n=e.target.value;n!==this.internalQuery&&(this.internalQuery=n,this.search.emit(this.internalQuery))},this.query="",this.internalQuery=""}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){a.debug("[nylas-threads-search] Component will load")}async componentDidLoad(){a.debug("[nylas-threads-search] Component did load")}onQueryChange(){this.internalQuery=this.query}render(){return a.h(a.Host,{key:"6d49d740fb64cff220ddf6b74ca0393a3b6fd83a"},a.h("sp-theme",{key:"fda27523444c0c7350cdfdf6d1a29dd1d63158f5",scale:"medium",color:"dark"},a.h("sp-search",{key:"bb840884220a5008c144f90775ea10291c507b51",quiet:!0,onSubmit:this.onSearch,onBlur:this.onSearch,value:this.internalQuery})))}static get watchers(){return{query:["onQueryChange"]}}};f([h.RegisterComponent({name:"nylas-pagination",stateToProps:new Map([["mailbox.searchQuery","query"]]),eventToProps:{search:async(t,e)=>{await e.threads.getThreads({search_query_native:t.detail||void 0,page_token:void 0})}},fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],l.prototype,"render",null);l.style=y;exports.nylas_threads_search=l;