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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/add-circle-icon_22.entry-080abc71.cjs +1 -0
  2. package/dist/add-circle-icon_22.entry-bda9be31.js +1818 -0
  3. package/dist/archive-icon_7.entry-ca20da59.cjs +1 -0
  4. package/dist/archive-icon_7.entry-e2954750.js +75 -0
  5. package/dist/arrow-icon.entry-03a85113.js +15 -0
  6. package/dist/arrow-icon.entry-548b027e.cjs +1 -0
  7. package/dist/bold-icon_3.entry-70ffa7f0.js +35 -0
  8. package/dist/bold-icon_3.entry-9a7b1869.cjs +1 -0
  9. package/dist/calendar-cancel-icon.entry-45388fdc.cjs +1 -0
  10. package/dist/calendar-cancel-icon.entry-6bbc119f.js +15 -0
  11. package/dist/calendar-check-icon_2.entry-6628456c.cjs +1 -0
  12. package/dist/calendar-check-icon_2.entry-f633f7a6.js +25 -0
  13. package/dist/calendar-icon.entry-379b1fa1.cjs +1 -0
  14. package/dist/calendar-icon.entry-62b82c27.js +15 -0
  15. package/dist/chevron-icon_3.entry-74425e1f.js +117 -0
  16. package/dist/chevron-icon_3.entry-7ff803ad.cjs +1 -0
  17. package/dist/close-icon.entry-18e140ed.cjs +1 -0
  18. package/dist/close-icon.entry-6a8ea4a7.js +15 -0
  19. package/dist/constants-f34b9c6e-95a17764.js +3749 -0
  20. package/dist/constants-f34b9c6e-e7137e51.cjs +15 -0
  21. package/dist/document-refresh-icon.entry-32c75418.js +15 -0
  22. package/dist/document-refresh-icon.entry-f15f795a.cjs +1 -0
  23. package/dist/{elements-dc5b338e-96e197ca.cjs → elements-dc5b338e-1f23530f.cjs} +1 -1
  24. package/dist/{elements-dc5b338e-6078b875.js → elements-dc5b338e-62fe1cf3.js} +1 -1
  25. package/dist/{focus-visible-e8093c16-ab01d60a.js → focus-visible-e8093c16-1f664070.js} +1 -1
  26. package/dist/{focus-visible-e8093c16-018ffd63.cjs → focus-visible-e8093c16-f0f05815.cjs} +1 -1
  27. package/dist/forward-icon_6.entry-7fab04d7.js +953 -0
  28. package/dist/forward-icon_6.entry-ef5e2e0f.cjs +3 -0
  29. package/dist/globe-icon.entry-398a9826.cjs +1 -0
  30. package/dist/globe-icon.entry-b8e1efae.js +15 -0
  31. package/dist/google-logo-icon_4.entry-38d5c2f2.cjs +1 -0
  32. package/dist/google-logo-icon_4.entry-5eca9538.js +381 -0
  33. package/dist/index-93c50de4.cjs +37 -0
  34. package/dist/{index-1fd24ccf.js → index-f93f6948.js} +1586 -1162
  35. package/dist/index.es-df564f87-b773d34f.js +3137 -0
  36. package/dist/index.es-df564f87-e4a4092a.cjs +7 -0
  37. package/dist/info-icon_2.entry-2eb70f49.cjs +1 -0
  38. package/dist/info-icon_2.entry-6bbfa6dc.js +34 -0
  39. package/dist/loading-icon.entry-b563b2e6.js +15 -0
  40. package/dist/loading-icon.entry-fb04b893.cjs +1 -0
  41. package/dist/mailbox-store-69c5c5f6-631eddb5.cjs +1 -0
  42. package/dist/mailbox-store-69c5c5f6-8ab4670b.js +380 -0
  43. package/dist/nylas-additional-participants.entry-33a45477.cjs +1 -0
  44. package/dist/nylas-additional-participants.entry-4b214308.js +81 -0
  45. package/dist/nylas-booked-event-card_10.entry-3e225025.cjs +1 -0
  46. package/dist/nylas-booked-event-card_10.entry-e93bc290.js +782 -0
  47. package/dist/nylas-form-card.entry-0748fdd5.js +54 -0
  48. package/dist/nylas-form-card.entry-eb3607bc.cjs +1 -0
  49. package/dist/nylas-if-state.entry-276d61ad.cjs +1 -0
  50. package/dist/nylas-if-state.entry-f8abd025.js +94 -0
  51. package/dist/nylas-list-folders.entry-78cc680e.js +120 -0
  52. package/dist/nylas-list-folders.entry-afe02f0e.cjs +1 -0
  53. package/dist/nylas-list-threads.entry-217088de.js +70 -0
  54. package/dist/nylas-list-threads.entry-6395c12f.cjs +1 -0
  55. package/dist/nylas-login.entry-e4d57589.js +73 -0
  56. package/dist/nylas-login.entry-ec81e21b.cjs +1 -0
  57. package/dist/nylas-mailbox-pagination.entry-069673aa.js +101 -0
  58. package/dist/nylas-mailbox-pagination.entry-d4d929f1.cjs +1 -0
  59. package/dist/nylas-mailbox-toolbar-button.entry-03c5f5c8.js +82 -0
  60. package/dist/nylas-mailbox-toolbar-button.entry-2b9e4431.cjs +1 -0
  61. package/dist/nylas-mailbox.entry-1342178d.cjs +1 -0
  62. package/dist/nylas-mailbox.entry-7e6b4791.js +134 -0
  63. package/dist/nylas-provider.entry-0ae8e70a.cjs +1 -0
  64. package/dist/nylas-provider.entry-498a7be9.js +145 -0
  65. package/dist/nylas-scheduler-editor.entry-4de2bb97.js +2275 -0
  66. package/dist/nylas-scheduler-editor.entry-72c91b7d.cjs +7 -0
  67. package/dist/nylas-scheduling.entry-1a004916.cjs +1 -0
  68. package/dist/nylas-scheduling.entry-4e18ab43.js +235 -0
  69. package/dist/nylas-threads-refresh.entry-d020c89e.cjs +1 -0
  70. package/dist/nylas-threads-refresh.entry-fc2d8028.js +74 -0
  71. package/dist/nylas-threads-search.entry-0abcbc10.cjs +1 -0
  72. package/dist/nylas-threads-search.entry-f92f7e30.js +69 -0
  73. package/dist/nylas-view-thread.entry-2f1474cf.js +203 -0
  74. package/dist/nylas-view-thread.entry-56080c89.cjs +1 -0
  75. package/dist/people-icon.entry-431e5044.cjs +1 -0
  76. package/dist/people-icon.entry-b4778e15.js +15 -0
  77. package/dist/play-icon_2.entry-24ffa01f.js +25 -0
  78. package/dist/play-icon_2.entry-f97db395.cjs +1 -0
  79. package/dist/react.cjs +1 -1
  80. package/dist/react.js +54 -54
  81. package/dist/refresh-icon.entry-8395104b.js +15 -0
  82. package/dist/refresh-icon.entry-cf4416b8.cjs +1 -0
  83. package/dist/register-component-b9cfcbaf-c0147194.js +109 -0
  84. package/dist/register-component-b9cfcbaf-d40e1f3c.cjs +1 -0
  85. package/dist/scheduler-config-store-07d98279-0610e42f.cjs +1 -0
  86. package/dist/scheduler-config-store-07d98279-3b70606c.js +24 -0
  87. package/dist/scheduler-store-24fd0e91-2dba20c2.cjs +1 -0
  88. package/dist/scheduler-store-24fd0e91-47098841.js +302 -0
  89. package/dist/time-period-selector.entry-1e849c2e.js +76 -0
  90. package/dist/time-period-selector.entry-d8f3462f.cjs +1 -0
  91. package/dist/translate-icon.entry-66533238.cjs +1 -0
  92. package/dist/translate-icon.entry-d847f706.js +15 -0
  93. package/dist/warning-icon.entry-1f0f00ed.cjs +1 -0
  94. package/dist/warning-icon.entry-b5db0151.js +15 -0
  95. package/package.json +2 -2
  96. package/dist/index-823fdc6f.cjs +0 -36
@@ -0,0 +1,1818 @@
1
+ import { r as y, h as i, c as w, d, H as x, g as _, z as W, A as M, B as ve, C as We, i as Ue, D as Z, E as ae, G as ie, I as ke, J as xe, K as U, L as Ze } from "./index-f93f6948.js";
2
+ import { R as C } from "./register-component-b9cfcbaf-c0147194.js";
3
+ import { T as we, E as _e } from "./constants-f34b9c6e-95a17764.js";
4
+ import "react";
5
+ import "react-dom";
6
+ const Ye = ".sc-add-circle-icon-h{display:flex}", Ke = Ye, Ve = class {
7
+ constructor(e) {
8
+ y(this, e), this.width = "24", this.height = "25";
9
+ }
10
+ render() {
11
+ return i("svg", { key: "58ce81214aeed7ddc1ce5f76d674aba576422d48", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "2a47ed74601a5370f0300da06295a2b5969d7e5f", d: "M12 2.5c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10ZM12 4a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm0 3.5a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 12 7.5Z", fill: "currentColor" }));
12
+ }
13
+ };
14
+ Ve.style = Ke;
15
+ const qe = "button.sc-button-component{height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;font-family:var(--nylas-font-family);font-weight:600}@media screen and (max-width: 768px){button.sc-button-component{width:100%}}button.button-primary.sc-button-component{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer}button.button-primary.sc-button-component:hover{background:var(--nylas-base-600)}button.button-primary.sc-button-component:active{background:var(--nylas-base-800)}button.button-primary.sc-button-component:disabled{background:var(--nylas-base-300);cursor:not-allowed}button.button-basic.sc-button-component{border:1px solid var(--nylas-base-300);color:var(--nylas-base-700);background:transparent}button.button-basic.sc-button-component:hover{background:transparent;border-color:var(--nylas-primary)}button.button-basic.sc-button-component:active{background:transparent;border-color:var(--nylas-base-600);border-width:2px}button.button-basic.sc-button-component:disabled{background:transparent;border-color:var(--nylas-base-300);color:var(--nylas-base-300);cursor:not-allowed}button.button-destructive.sc-button-component{border:1px solid var(--nylas-base-300);color:var(--nylas-error);background:transparent}button.button-destructive.sc-button-component:hover{background:transparent;border-color:var(--nylas-error)}button.button-destructive.sc-button-component:active{background:transparent;border-color:var(--nylas-error-pressed);border-width:2px;color:var(--nylas-error-pressed)}button.button-destructive.sc-button-component:disabled{background:transparent;border-color:var(--nylas-base-300);color:var(--nylas-base-300);cursor:not-allowed}", Je = qe, Ge = class {
16
+ constructor(e) {
17
+ y(this, e), this.variant = "primary", this.disabled = !1, this.type = "button", this.clickHandler = void 0, this.mouseOverHandler = void 0, this.mouseOutHandler = void 0, this.focusHandler = void 0, this.blurHandler = void 0;
18
+ }
19
+ render() {
20
+ const e = `button-${this.variant}` + (this.disabled ? " disabled" : "");
21
+ return i("button", { key: "3ac840e8b65854c2e4bdabe93b21b5bcda99e4db", class: e, disabled: this.disabled, type: "type", onClick: this.clickHandler, onMouseOver: this.mouseOverHandler, onMouseOut: this.mouseOutHandler, onFocus: this.focusHandler, onBlur: this.blurHandler }, i("slot", { key: "110df0711566be0df89f2e04aed008dcaf91e9f3" }));
22
+ }
23
+ };
24
+ Ge.style = Je;
25
+ const Xe = ".sc-calendar-info-icon-h{display:flex}", Qe = Xe, et = class {
26
+ constructor(e) {
27
+ y(this, e), this.width = "20", this.height = "20";
28
+ }
29
+ render() {
30
+ return i("svg", { key: "4c290eae1d55ec9df96cbe6d9ba85d5d8b7ee102", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "a2a76a5d0183952d59f1d2f448dc7c460694e410", d: "M12 0C13.3807 0 14.5 1.11929 14.5 2.5V6.59971C14.1832 6.43777 13.8486 6.30564 13.5 6.20703V4H1.5V11.5C1.5 12.3284 2.17157 13 3 13H6.70703C6.80564 13.3486 6.93777 13.6832 7.09971 14H3C1.61929 14 0.5 12.8807 0.5 11.5V2.5C0.5 1.11929 1.61929 0 3 0H12ZM12 1H3C2.17157 1 1.5 1.67157 1.5 2.5V3H13.5V2.5C13.5 1.67157 12.8284 1 12 1ZM11.375 9.5C11.375 9.15482 11.6548 8.875 12 8.875C12.3452 8.875 12.625 9.15482 12.625 9.5C12.625 9.84518 12.3452 10.125 12 10.125C11.6548 10.125 11.375 9.84518 11.375 9.5ZM12.5 13.5C12.5 13.7761 12.2761 14 12 14C11.7239 14 11.5 13.7761 11.5 13.5V11.5C11.5 11.2239 11.7239 11 12 11C12.2761 11 12.5 11.2239 12.5 11.5V13.5ZM7.5 11.5C7.5 9.01472 9.51472 7 12 7C14.4853 7 16.5 9.01472 16.5 11.5C16.5 13.9853 14.4853 16 12 16C9.51472 16 7.5 13.9853 7.5 11.5ZM8.5 11.5C8.5 13.433 10.067 15 12 15C13.933 15 15.5 13.433 15.5 11.5C15.5 9.567 13.933 8 12 8C10.067 8 8.5 9.567 8.5 11.5Z", fill: "currentColor" }));
31
+ }
32
+ };
33
+ et.style = Qe;
34
+ const tt = ".sc-calendar-patterns-icon-h{display:flex}", nt = tt, at = class {
35
+ constructor(e) {
36
+ y(this, e), this.width = "20", this.height = "20";
37
+ }
38
+ render() {
39
+ return i("svg", { key: "cf8071f578ad04793f5bd5b446dccaa1f6d4c1a3", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "8e8a3c7d87bc41c6d6973a34863d05d996155c1d", d: "M3.25 0H11.75C13.2688 0 14.5 1.23122 14.5 2.75V11.25C14.5 12.7688 13.2688 14 11.75 14H3.25C1.73122 14 0.5 12.7688 0.5 11.25V2.75C0.5 1.23122 1.73122 0 3.25 0ZM2 2.75V4H13V2.75C13 2.05964 12.4404 1.5 11.75 1.5H3.25C2.55964 1.5 2 2.05964 2 2.75ZM12.2071 5L8.20711 9H10.7929L13 6.79289V5H12.2071ZM10.7929 5H8.20711L4.20711 9H6.79289L10.7929 5ZM2.79289 9L6.79289 5H4.20711L2 7.20711V9H2.79289ZM2 5.79289L2.79289 5H2V5.79289ZM12.2071 9H13V8.20711L12.2071 9Z", fill: "currentColor" }));
40
+ }
41
+ };
42
+ at.style = nt;
43
+ const it = ".sc-flow-icon-h{display:flex}", st = it, ot = class {
44
+ constructor(e) {
45
+ y(this, e), this.width = "16", this.height = "12";
46
+ }
47
+ render() {
48
+ return i("svg", { key: "e0f4da46b751754406e8b0551890a1bffb1100e4", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "21997cb261d91c8589c3e87a01036dc8f91a8d9b", d: "M13 1.66211C11.8954 1.66211 11 2.55754 11 3.66211C11 4.76668 11.8954 5.66211 13 5.66211C14.1046 5.66211 15 4.76668 15 3.66211C15 2.55754 14.1046 1.66211 13 1.66211ZM10.0407 3.16678C10.2768 1.74563 11.5119 0.662109 13 0.662109C14.6569 0.662109 16 2.00526 16 3.66211C16 5.31896 14.6569 6.66211 13 6.66211C11.5162 6.66211 10.2839 5.58482 10.0428 4.16971C9.37629 4.23688 8.82682 4.7426 8.71466 5.41551L8.27173 8.07311C8.07929 9.22776 7.11428 10.087 5.9593 10.1574C5.72319 11.5786 4.48813 12.6621 3 12.6621C1.34315 12.6621 0 11.319 0 9.66211C0 8.00526 1.34315 6.66211 3 6.66211C4.48384 6.66211 5.71607 7.73939 5.95724 9.15451C6.62371 9.08734 7.17318 8.58162 7.28534 7.90871L7.72827 5.25111C7.92071 4.09646 8.88571 3.23718 10.0407 3.16678ZM3 7.66211C1.89543 7.66211 1 8.55754 1 9.66211C1 10.7667 1.89543 11.6621 3 11.6621C4.10457 11.6621 5 10.7667 5 9.66211C5 8.55754 4.10457 7.66211 3 7.66211Z", fill: "currentColor" }));
49
+ }
50
+ };
51
+ ot.style = st;
52
+ const lt = ".sc-location-icon-h{display:flex}", rt = lt, dt = class {
53
+ constructor(e) {
54
+ y(this, e), this.width = "16", this.height = "18";
55
+ }
56
+ render() {
57
+ return i("svg", { key: "4888ed340800392ac9bb38eb4b868fca595db537", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "20cfaacf5cb828569e0b4ec6d2e83fe3b5264b32", d: "M10 7.66211C10 9.31896 8.65685 10.6621 7 10.6621C5.34315 10.6621 4 9.31896 4 7.66211C4 6.00526 5.34315 4.66211 7 4.66211C8.65685 4.66211 10 6.00526 10 7.66211ZM9 7.66211C9 6.55754 8.10457 5.66211 7 5.66211C5.89543 5.66211 5 6.55754 5 7.66211C5 8.76668 5.89543 9.66211 7 9.66211C8.10457 9.66211 9 8.76668 9 7.66211ZM11.9497 12.6171C14.6834 9.88221 14.6834 5.44812 11.9497 2.71326C9.21608 -0.0216067 4.78392 -0.0216067 2.05025 2.71326C-0.683418 5.44812 -0.683418 9.88221 2.05025 12.6171L3.57128 14.1159L5.61408 16.101L5.74691 16.2188C6.52168 16.8468 7.65623 16.8076 8.38611 16.1012L10.8223 13.7312L11.9497 12.6171ZM2.75499 3.4183C5.09944 1.07282 8.90055 1.07282 11.245 3.4183C13.5294 5.70364 13.5879 9.3725 11.4207 11.7288L11.245 11.912L9.92371 13.216L7.69315 15.3846L7.60016 15.4642C7.24594 15.732 6.7543 15.732 6.40012 15.4642L6.30713 15.3845L3.3263 12.4791L2.75499 11.912L2.57927 11.7288C0.412077 9.3725 0.47065 5.70364 2.75499 3.4183Z", fill: "currentColor" }));
58
+ }
59
+ };
60
+ dt.style = rt;
61
+ const ct = ".sc-location-off-icon-h{display:flex}", ft = ct, pt = class {
62
+ constructor(e) {
63
+ y(this, e), this.width = "16", this.height = "18";
64
+ }
65
+ render() {
66
+ return i("svg", { key: "b61c56b0a012359592a4c2575f130ece6fd412c6", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "6be791c9a59fa3634f65881dfbca7adc5e3355d3", d: "M0.146447 0.808556C0.341709 0.613294 0.658291 0.613294 0.853553 0.808556L15.8536 15.8086C16.0488 16.0038 16.0488 16.3204 15.8536 16.5157C15.6583 16.7109 15.3417 16.7109 15.1464 16.5157L12.0938 13.463L11.8223 13.7312L9.38611 16.1012C8.65623 16.8076 7.52168 16.8468 6.74691 16.2188L6.61408 16.101L4.57128 14.1159L3.05025 12.6171C0.607421 10.1732 0.347525 6.37239 2.27056 3.63976L0.146447 1.51566C-0.0488155 1.3204 -0.0488155 1.00382 0.146447 0.808556ZM9.07768 10.4469C8.74346 10.576 8.38024 10.6468 8.0005 10.6468C6.34839 10.6468 5.00909 9.30689 5.00909 7.65406C5.00909 7.27461 5.07967 6.91166 5.20843 6.57763L2.98793 4.35713C1.49206 6.62038 1.68917 9.67377 3.57927 11.7288L3.75499 11.912L4.3263 12.4791L7.30713 15.3845L7.40012 15.4642C7.7543 15.732 8.24594 15.732 8.60016 15.4642L8.69315 15.3846L10.9237 13.216L11.3883 12.7575L9.07768 10.4469ZM9.85409 8.39486L10.5983 9.13904C10.8487 8.70143 10.9919 8.19447 10.9919 7.65406C10.9919 6.00122 9.65261 4.66134 8.0005 4.66134C7.45986 4.66134 6.95271 4.80482 6.51504 5.05581L7.25921 5.79998C7.48839 5.70819 7.73855 5.6577 8.0005 5.6577C9.10258 5.6577 9.99599 6.5515 9.99599 7.65406C9.99599 7.91581 9.94564 8.16581 9.85409 8.39486ZM4.35291 2.89368C6.70671 1.08827 10.0908 1.26314 12.245 3.4183C14.3986 5.57283 14.5739 8.95702 12.771 11.3118L13.4812 12.022C15.6702 9.27273 15.493 5.25762 12.9497 2.71326C10.4058 0.168159 6.39081 -0.00843871 3.64269 2.18347L4.35291 2.89368Z", fill: "currentColor" }));
67
+ }
68
+ };
69
+ pt.style = ft;
70
+ const bt = ':host{display:block;width:inherit;--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}.dropdown{display:inline-block;width:100%;position:relative}.dropdown .dropdown-label{display:flex;align-items:center;gap:0.25rem;color:var(--nylas-base-800)}.dropbtn{width:inherit;height:48px;color:black;padding:0.5rem;font-size:1rem;cursor:pointer;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{border:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content ul li label{display:flex;align-items:center;gap:0.5rem}.dropdown-content ul li label input{margin:0}.selected-options{display:flex;flex-wrap:wrap;gap:0.5rem;padding:0.5rem 0;margin-top:0.25rem;background:var(--nylas-base-0)}.selected-options .selected-option{display:flex;align-items:center;gap:0.5rem;padding:4px 8px;border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-100);color:var(--nylas-base-800);font-size:16px;font-weight:500;line-height:1.5rem;letter-spacing:0.5px}.selected-options .selected-option button{background:transparent;border:none;cursor:pointer;padding:0}.selected-options .selected-option button:hover{color:var(--nylas-primary)}', ut = bt, ht = class {
71
+ constructor(e) {
72
+ y(this, e), this.selectedOptionsChanged = w(this, "selectedOptionsChanged", 7), this.name = void 0, this.label = void 0, this.options = [], this.availableOptions = this.options, this.isOpen = !1, this.ariaActivedescendant = "", this.shouldFocusFirstOption = !1;
73
+ }
74
+ componentDidRender() {
75
+ d("multi-select-dropdown", "componentDidRender"), this.isOpen && this.shouldFocusFirstOption && (this.ariaActivedescendant = this.availableOptions[0].value, this.focusOption(0), this.shouldFocusFirstOption = !1);
76
+ }
77
+ handleOutsideClick(e) {
78
+ !e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
79
+ }
80
+ selectOption(e) {
81
+ this.availableOptions = this.availableOptions.map((n) => (n.value === e.value && (n.selected = !e.selected), n));
82
+ const t = this.availableOptions.filter((n) => n.selected).map((n) => n.value);
83
+ this.selectedOptionsChanged.emit({
84
+ value: t,
85
+ name: this.name
86
+ });
87
+ }
88
+ toggleDropdown() {
89
+ this.isOpen = !this.isOpen, this.isOpen ? this.shouldFocusFirstOption = !0 : this.ariaActivedescendant = "";
90
+ }
91
+ handleSelectButtonKeyDown(e) {
92
+ switch (e.key) {
93
+ case "ArrowDown":
94
+ case "Enter":
95
+ e.preventDefault(), this.isOpen || this.toggleDropdown();
96
+ break;
97
+ case "Escape":
98
+ this.isOpen = !1;
99
+ break;
100
+ }
101
+ }
102
+ handleListboxKeydown(e) {
103
+ const t = this.availableOptions, n = t.findIndex((a) => a.value === this.ariaActivedescendant);
104
+ switch (e.key) {
105
+ case "ArrowDown":
106
+ case "Tab":
107
+ if (e.shiftKey) {
108
+ e.preventDefault();
109
+ const o = n - 1 >= 0 ? n - 1 : t.length - 1;
110
+ this.ariaActivedescendant = t[o].value, this.focusOption(o);
111
+ } else {
112
+ e.preventDefault();
113
+ const o = n + 1 < t.length ? n + 1 : 0;
114
+ this.ariaActivedescendant = t[o].value, this.focusOption(o);
115
+ }
116
+ break;
117
+ case "ArrowUp":
118
+ e.preventDefault();
119
+ const a = n - 1 >= 0 ? n - 1 : t.length - 1;
120
+ this.ariaActivedescendant = t[a].value, this.focusOption(a);
121
+ break;
122
+ case "Enter":
123
+ e.preventDefault(), this.ariaActivedescendant && this.selectOption(t[n]);
124
+ break;
125
+ case "Escape":
126
+ this.isOpen = !1;
127
+ break;
128
+ }
129
+ }
130
+ focusOption(e) {
131
+ var o;
132
+ const t = this.availableOptions[e];
133
+ if (!t)
134
+ return;
135
+ const n = t.value, a = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
136
+ a && (a.focus(), a.scrollIntoView({ behavior: "smooth", block: "nearest" }));
137
+ }
138
+ getSelectedOptions() {
139
+ return this.availableOptions.filter((e) => e.selected);
140
+ }
141
+ renderOption(e) {
142
+ return i("li", { key: e.value, id: e.value, role: "option", tabindex: "0", "aria-selected": e.selected ? "true" : "false", onClick: (t) => {
143
+ t.stopImmediatePropagation(), this.selectOption(e);
144
+ }, class: { selected: !!e.selected } }, i("label", { htmlFor: e.value }, i("input", { "aria-hidden": "true", id: e.value, type: "checkbox", checked: e.selected }), i("span", null, e.label)));
145
+ }
146
+ render() {
147
+ var e, t;
148
+ return i(x, { key: "4ef13670e3dfbf55e023ac7532d93c48d21f3004" }, i("div", { key: "8626f138f5be677421697067460ef76d0a7cc697", class: "dropdown", part: "msd_dropdown" }, i("label", { key: "b723c488dac91c39f285aae1a3f7928844753bf1", class: "dropdown-label" }, this.label, i("slot", { key: "5bdec320647a41de57671c75523a453ccb07af2a", name: "label-icon", "aria-hidden": "true" })), i("button", { key: "f7d7cf144ac2fec93171b5ac6cd42be4be6b5c93", part: "msd_dropdown-button", class: { dropbtn: !0, open: this.isOpen }, onClick: () => this.toggleDropdown(), "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name, onKeyDown: (n) => this.handleSelectButtonKeyDown(n) }, i("slot", { key: "021e59628b8da260b308819614297c177a666334", name: "select-icon", "aria-hidden": "true" }), i("span", { key: "4a8c921538a23abe4c7efbeb176fb806587092c9", class: "selected-option", part: "msd_dropdown-button-selected-label" }, this.getSelectedOptions().length > 1 ? `Multiple ${this.name}s selected` : ((e = this.availableOptions.filter((n) => n.selected)[0]) == null ? void 0 : e.label) ?? ((t = this.availableOptions[0]) == null ? void 0 : t.label)), i("span", { key: "fc771549d102fb27e33d128504d09fa6151154e9", class: this.isOpen ? "open" : "closed", "aria-hidden": "true" }, i("chevron-icon", { key: "bd8282695d11bcfb617da05a75d0a2335650f705", width: "16", height: "16" }))), this.isOpen ? null : i("div", { class: "selected-options" }, this.getSelectedOptions().map((n) => i("span", { class: "selected-option" }, n.label, i("button", { key: n.label, onClick: () => this.selectOption(n) }, i("close-icon", null))))), this.isOpen ? i("div", { class: "dropdown-content", part: "msd_dropdown-content" }, i("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-multiselectable": !0, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (n) => this.handleListboxKeydown(n) }, this.availableOptions.map((n) => this.renderOption(n)))) : null));
149
+ }
150
+ get el() {
151
+ return _(this);
152
+ }
153
+ };
154
+ ht.style = ut;
155
+ const mt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-availability-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-availability-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-availability-picker .header h3{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-availability-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-availability-picker .content{padding:1rem;color:var(--nylas-base-900);font-size:16px;font-family:var(--nylas-font-family)}@media screen and (max-width: 504px){.nylas-availability-picker .content{font-size:15px}}.nylas-availability-picker .content .select-timezone{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--nylas-base-200);padding-bottom:1rem;gap:1rem}.nylas-availability-picker .content .select-timezone h4{display:flex;gap:0.5rem;align-items:center;margin:0;font-size:16px;font-weight:500;line-height:20px}@media screen and (max-width: 504px){.nylas-availability-picker .content .select-timezone h4{font-size:15px}}.nylas-availability-picker .content .select-timezone select-dropdown{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-availability-picker .content .availability{display:flex;flex-direction:column;gap:1rem;padding:0 0.5rem;margin:1rem 0}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability{gap:0.5rem;padding:0}}.nylas-availability-picker .content .availability .availability-day{display:grid;grid-template-columns:minmax(auto, 65px) 1fr minmax(auto, 40px);gap:1rem;align-items:baseline}@media screen and (max-width: 768px){.nylas-availability-picker .content .availability .availability-day{grid-template-columns:78px 1fr auto}}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day{display:inline-grid;gap:8px;grid-template-columns:60px 1fr auto}}.nylas-availability-picker .content .availability .availability-day .day{display:flex;gap:0.5rem;align-items:center}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day .day{gap:0.25rem}}.nylas-availability-picker .content .availability .availability-day .day input[type=checkbox]{transform:scale(1.3)}.nylas-availability-picker .content .availability .availability-day .time-ranges span.unavailable{height:48px;display:flex;align-items:center;justify-content:center}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range{display:flex;gap:1.5rem;justify-content:space-between;align-items:baseline}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range{justify-content:unset;gap:0.5rem}}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers{display:flex;gap:1rem}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers{gap:0.5rem}}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers span{margin-top:0.75rem}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range:not(:last-of-type){margin-bottom:1rem}.nylas-availability-picker .content .availability .availability-day .time-ranges p.error{color:var(--nylas-error)}.nylas-availability-picker .content .availability .availability-day button{border:none;background:transparent;height:40px;cursor:pointer;color:var(--nylas-base-800)}.nylas-availability-picker .content .availability .availability-day button:hover,.nylas-availability-picker .content .availability .availability-day button:active{color:var(--nylas-primary)}', yt = mt;
156
+ var gt = function(e, t, n, a) {
157
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
158
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
159
+ s = Reflect.decorate(e, t, n, a);
160
+ else
161
+ for (var r = e.length - 1; r >= 0; r--)
162
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
163
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
164
+ }, se = function(e, t) {
165
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
166
+ return Reflect.metadata(e, t);
167
+ };
168
+ const Ce = class {
169
+ constructor(e) {
170
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.openHours = void 0, this.name = "availability", this.defaultTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.schedule = {
171
+ SUN: [],
172
+ MON: [{ start: "09:00am", end: "05:00pm" }],
173
+ TUE: [{ start: "09:00am", end: "05:00pm" }],
174
+ WED: [{ start: "09:00am", end: "05:00pm" }],
175
+ THU: [{ start: "09:00am", end: "05:00pm" }],
176
+ FRI: [{ start: "09:00am", end: "05:00pm" }],
177
+ SAT: []
178
+ }, this.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.overlapDays = {};
179
+ }
180
+ elementNameChangedHandler(e) {
181
+ d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
182
+ }
183
+ configChangedHandler(e) {
184
+ var n, a, o;
185
+ const t = (n = e == null ? void 0 : e.participants) == null ? void 0 : n.find((s) => s.is_organizer);
186
+ t && ((a = t == null ? void 0 : t.availability) != null && a.open_hours) && this.openHoursToSchedule((o = t == null ? void 0 : t.availability) == null ? void 0 : o.open_hours);
187
+ }
188
+ scheduleChanged(e, t) {
189
+ var n;
190
+ if (e !== t) {
191
+ this.valueChanged.emit({
192
+ value: {
193
+ openHours: this.scheduleToOpenHours(e),
194
+ timezone: this.timezone
195
+ },
196
+ name: this.name
197
+ });
198
+ let a = {};
199
+ if (Object.keys(e).forEach((o) => {
200
+ const s = e[o];
201
+ if (s.length > 0) {
202
+ const l = this.getOverlaps(s);
203
+ l.length > 0 && (a[o] = l);
204
+ }
205
+ }), this.overlapDays = a, typeof this.internals.setFormValue != "function")
206
+ return;
207
+ if (Object.keys(a).length > 0) {
208
+ const o = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(Object.keys(a)[0]);
209
+ o && this.internals.setValidity({ customError: !0 }, "Overlapping time ranges found", o);
210
+ } else
211
+ this.internals.setValidity({ customError: !1 }), this.internals.setFormValue(JSON.stringify({
212
+ openHours: this.scheduleToOpenHours(this.schedule),
213
+ timezone: this.timezone
214
+ }));
215
+ }
216
+ }
217
+ selectedOptionChangedHandler(e) {
218
+ const { name: t, value: n } = e.detail;
219
+ if (t === "timezone") {
220
+ if (this.timezone = n, typeof this.internals.setFormValue != "function")
221
+ return;
222
+ this.internals.setFormValue(JSON.stringify({
223
+ openHours: this.scheduleToOpenHours(this.schedule),
224
+ timezone: this.timezone
225
+ }));
226
+ }
227
+ }
228
+ connectedCallback() {
229
+ d("nylas-availability-picker", "connectedCallback");
230
+ }
231
+ disconnectedCallback() {
232
+ d("nylas-availability-picker", "disconnectedCallback");
233
+ }
234
+ componentWillLoad() {
235
+ d("nylas-availability-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
236
+ }
237
+ componentDidLoad() {
238
+ d("nylas-availability-picker", "componentDidLoad"), this.openHours && this.openHours.length > 0 && this.openHoursToSchedule(this.openHours), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(JSON.stringify({
239
+ openHours: this.scheduleToOpenHours(this.schedule),
240
+ timezone: this.timezone
241
+ }));
242
+ }
243
+ getOverlaps(e) {
244
+ let t = e.map((a, o) => ({
245
+ start: W(a.start),
246
+ end: W(a.end),
247
+ originalIndex: o
248
+ }));
249
+ t.sort((a, o) => a.start - o.start);
250
+ let n = [];
251
+ for (let a = 1; a < t.length; a++)
252
+ t[a].start < t[a - 1].end && (n.includes(t[a].originalIndex) || n.push(t[a].originalIndex), n.includes(t[a - 1].originalIndex) || n.push(t[a - 1].originalIndex));
253
+ return n.sort((a, o) => a - o);
254
+ }
255
+ addTimeRange(e) {
256
+ const t = this.schedule[e], n = 0, a = 1425;
257
+ if (t.length === 0)
258
+ this.schedule[e] = [{ start: "09:00am", end: "05:00pm" }];
259
+ else {
260
+ const o = t.map((l) => ({
261
+ start: W(l.start),
262
+ end: W(l.end)
263
+ })).sort((l, r) => l.start - r.start), s = o[o.length - 1].end;
264
+ if (s + 60 <= a)
265
+ this.schedule[e].push({
266
+ start: M(U(s)),
267
+ end: M(U(s + 60))
268
+ });
269
+ else {
270
+ let l = !1;
271
+ if (o[0].start > n + 60 && (this.schedule[e].push({
272
+ start: M(U(n)),
273
+ end: M(U(n + 60))
274
+ }), l = !0), !l)
275
+ for (let r = 0; r < o.length - 1; r++) {
276
+ const u = o[r].end;
277
+ if (o[r + 1].start - u >= 60) {
278
+ this.schedule[e].push({
279
+ start: M(U(u)),
280
+ end: M(U(u + 60))
281
+ });
282
+ break;
283
+ }
284
+ }
285
+ }
286
+ }
287
+ this.schedule[e].sort((o, s) => W(o.start) - W(s.start)), this.schedule = { ...this.schedule };
288
+ }
289
+ removeTimeRange(e, t) {
290
+ this.schedule[e].splice(t, 1), this.schedule = { ...this.schedule };
291
+ }
292
+ setTime(e, t, n) {
293
+ const [a, o] = e.split("_"), [s, l] = a.split(":");
294
+ o === "start" ? this.schedule[s][l].start = n : o === "end" && (this.schedule[s][l].end = n), this.internals.setValidity({ customError: !1 }), this.schedule = { ...this.schedule };
295
+ }
296
+ setFormError(e, t, n) {
297
+ var l;
298
+ const [a, o] = e.split("_"), s = (l = this.host.shadowRoot) == null ? void 0 : l.getElementById(e);
299
+ s && this.internals.setValidity({ customError: !0 }, `Invalid ${o} time`, s);
300
+ }
301
+ openHoursToSchedule(e) {
302
+ const t = {
303
+ SUN: [],
304
+ MON: [],
305
+ TUE: [],
306
+ WED: [],
307
+ THU: [],
308
+ FRI: [],
309
+ SAT: []
310
+ };
311
+ e.forEach((n) => {
312
+ n.days.forEach((a) => {
313
+ const o = this.getDayKey(a), s = M(n.start), l = M(n.end), r = { start: s, end: l };
314
+ let u = !1;
315
+ t[o] && (u = t[o].some((f) => f.start === r.start && f.end === r.end)), u || (t[o] ? t[o].push(r) : t[o] = [r]);
316
+ });
317
+ }), this.timezone = this.defaultTimezone, this.schedule = t;
318
+ }
319
+ getDayKey(e) {
320
+ return ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"][e];
321
+ }
322
+ scheduleToOpenHours(e) {
323
+ const t = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
324
+ let n = /* @__PURE__ */ new Map();
325
+ t.forEach((o, s) => {
326
+ e[o] && e[o].forEach((l) => {
327
+ const r = ve(l.start), u = ve(l.end), f = `${r}-${u}`;
328
+ if (!n.has(f))
329
+ n.set(f, { days: [s], start: r, end: u });
330
+ else {
331
+ let p = n.get(f);
332
+ p && (p.days.push(s), n.set(f, p));
333
+ }
334
+ });
335
+ });
336
+ let a = [];
337
+ return n.forEach((o, s) => {
338
+ a.push({
339
+ days: o.days,
340
+ start: o.start,
341
+ end: o.end
342
+ });
343
+ }), a;
344
+ }
345
+ render() {
346
+ const e = Object.keys(we).map((t) => ({
347
+ label: we[t],
348
+ value: t
349
+ }));
350
+ return i(x, { key: "396ba889df619966df24cb5eb33de1a77be3a2ba" }, i("div", { key: "bb2a28befc3aa0481fe265a6af99049b528fca42", class: "nylas-availability-picker" }, i("div", { key: "729c24276d5e773dfbc67791fede7aa0c0bcc747", class: "header", part: "nap__header" }, i("h3", { key: "ba7c73778a8b3dd197ca850cead346d2f00836b7" }, "General availability"), i("p", { key: "6f946e8e00921f0620b16a3412f290f176dd5b9b" }, "Set your availability for scheduling meetings.")), i("div", { key: "7753c38b6160be28c495cc9803015e0dc0003b2a", class: "content" }, i("div", { key: "8d79379263f772f29443b24f5996d017db12e764", class: "select-timezone", part: "nap__select-timezone" }, i("h4", { key: "e6a3658ecf3d92c0dda352532a3a0c71fb59f96e", class: "sub-header" }, "Select timezone", i("span", { key: "fdb95f85f111a1557897309ff0bd682a77499684", class: "icon" }, i("tooltip-component", { key: "37b47d8e5b24bd4620e6be932ea23c8553b4822f" }, i("info-icon", { key: "f1192d767cc0e1c67f989b47af093e3539d7c55c", slot: "tooltip-icon" }), i("span", { key: "2b3b949fc18e0118199a3ed9668ec0ca19283c79", slot: "tooltip-content" }, "Select your timezone for displaying availability.")))), i("select-dropdown", { key: "4729bd6e7b7c05a3fb47cf94010a00db51394c7e", name: "timezone", exportparts: "sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content", options: e, defaultSelectedOption: e.find((t) => t.value === this.defaultTimezone) }, i("span", { key: "2157b7fb691541f42713a77dc1338dbb9f0e26c2", slot: "select-icon" }, i("globe-icon", { key: "17138c37b7df667e46873af1caa5278120fa4ce1", width: "20", height: "20" })))), i("div", { key: "9a49a84812b5fb544ebfd07d5dd1aba35679224e", class: "availability", part: "nap__availability" }, Object.keys(this.schedule).map((t) => {
351
+ const n = t, a = this.schedule[t];
352
+ return i("div", { class: "availability-day" }, i("div", { class: "day", part: "nap__day" }, i("input", { type: "checkbox", name: n, id: n, checked: a.length > 0, onClick: () => {
353
+ a.length > 0 ? this.schedule[n] = [] : this.schedule[n] = [{ start: "09:00am", end: "05:00pm" }], this.schedule = { ...this.schedule };
354
+ } }), i("label", { htmlFor: n, "aria-label": "Select day" }, n)), i("div", { class: "time-ranges", part: "nap__time-ranges" }, a.length ? null : i("span", { class: "unavailable" }, "Unavailable"), a.length > 0 && a.map((o, s) => {
355
+ var u, f;
356
+ const l = `${t}:${s}_start`, r = `${t}:${s}_end`;
357
+ return i("div", { class: "time-range", part: "nap__time-range" }, i("div", { class: "pickers" }, i("nylas-time-window-picker", { id: l, hasError: (u = this.overlapDays[n]) == null ? void 0 : u.includes(s), time: o.start, name: l, key: l, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times", setTime: (p, h) => this.setTime(l, p, h), setFormError: (p, h) => this.setFormError(l, p, h) }), i("span", null, " - "), i("nylas-time-window-picker", { id: r, hasError: (f = this.overlapDays[n]) == null ? void 0 : f.includes(s), time: o.end, name: r, key: r, minimumStartTime: o.start, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times", setTime: (p, h) => this.setTime(r, p, h), setFormError: (p, h) => this.setFormError(r, p, h) })), i("button", { onClick: () => this.removeTimeRange(n, s) }, i("close-icon", null)));
358
+ }), i("p", { class: "error" }, this.overlapDays[n] ? "Overlapping time ranges" : "")), i("div", null, a.length > 0 ? i("button", { onClick: () => this.addTimeRange(n), part: "nap__add-time-range" }, i("add-circle-icon", null)) : null));
359
+ })))));
360
+ }
361
+ static get formAssociated() {
362
+ return !0;
363
+ }
364
+ get host() {
365
+ return _(this);
366
+ }
367
+ static get watchers() {
368
+ return {
369
+ name: ["elementNameChangedHandler"],
370
+ selectedConfiguration: ["configChangedHandler"],
371
+ schedule: ["scheduleChanged"]
372
+ };
373
+ }
374
+ };
375
+ gt([
376
+ C({
377
+ name: "nylas-availability-picker",
378
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
379
+ fireRegisterEvent: !0
380
+ }),
381
+ se("design:type", Function),
382
+ se("design:paramtypes", []),
383
+ se("design:returntype", void 0)
384
+ ], Ce.prototype, "render", null);
385
+ Ce.style = yt;
386
+ const vt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-booking-calendar-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-booking-calendar-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-booking-calendar-picker .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-booking-calendar-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading{padding-bottom:1rem;display:flex;flex-direction:column;gap:4px}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading .label{display:flex;align-items:center;gap:0.5rem;margin:1rem 1rem 0;color:var(--nylas-base-800)}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading .loading-button{margin:0 1rem;padding:0;width:inherit;height:48px;color:black;font-size:1rem;cursor:not-allowed;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading .loading-button span{padding:0 1rem}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown{padding:1rem;display:flex;flex-direction:column;gap:4px}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown span.label{display:flex;align-items:center;gap:4px;color:var(--nylas-base-800)}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown span.label tooltip-component{display:flex}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown){width:100%}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown-content){width:100%;max-width:unset}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', kt = vt;
387
+ var xt = function(e, t, n, a) {
388
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
389
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
390
+ s = Reflect.decorate(e, t, n, a);
391
+ else
392
+ for (var r = e.length - 1; r >= 0; r--)
393
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
394
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
395
+ }, oe = function(e, t) {
396
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
397
+ return Reflect.metadata(e, t);
398
+ };
399
+ const Te = class {
400
+ constructor(e) {
401
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.calendars = void 0, this.currentUser = void 0, this.name = "booking-calendar", this.defaultBookingCalendar = "", this.selectedCalendar = "";
402
+ }
403
+ connectedCallback() {
404
+ d("nylas-booking-calendar-picker", "connectedCallback");
405
+ }
406
+ disconnectedCallback() {
407
+ d("nylas-booking-calendar-picker", "disconnectedCallback");
408
+ }
409
+ componentWillLoad() {
410
+ d("nylas-booking-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
411
+ }
412
+ componentDidLoad() {
413
+ var e, t;
414
+ d("nylas-booking-calendar-picker", "componentDidLoad"), this.defaultBookingCalendar = this.defaultBookingCalendar || ((e = this.currentUser) == null ? void 0 : e.email) || "", typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultBookingCalendar.toString(), "booking-calendar"), this.selectedCalendar = this.defaultBookingCalendar || ((t = this.currentUser) == null ? void 0 : t.email) || "";
415
+ }
416
+ componentWillUpdate() {
417
+ d("nylas-booking-calendar-picker", "componentWillUpdate");
418
+ }
419
+ componentDidUpdate() {
420
+ d("nylas-booking-calendar-picker", "componentDidUpdate");
421
+ }
422
+ componentWillRender() {
423
+ d("nylas-booking-calendar-picker", "componentWillRender");
424
+ }
425
+ componentDidRender() {
426
+ d("nylas-booking-calendar-picker", "componentDidRender");
427
+ }
428
+ elementNameChangedHandler(e) {
429
+ d("nylas-booking-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
430
+ }
431
+ selectedOptionChangedHandler(e) {
432
+ d("nylas-booking-calendar-picker", "selectedOptionChangedHandler", e.detail);
433
+ const t = (n) => {
434
+ const { value: a } = n.detail;
435
+ this.selectedCalendar = a, this.internals.setFormValue(a.toString(), this.name);
436
+ };
437
+ this.valueChanged.emit({ value: e.detail.value, name: this.name, valueChanged: t });
438
+ }
439
+ render() {
440
+ var t;
441
+ const e = ((t = this.calendars) == null ? void 0 : t.map((n) => ({
442
+ value: n.id,
443
+ label: n.name
444
+ }))) ?? [];
445
+ return i(x, null, i("div", { class: "nylas-booking-calendar-picker", part: "nbcp" }, i("div", { class: "header", part: "nbcp__header" }, i("h3", null, "Calendar booking"), i("p", null, "Choose calendar where you’d like the event bookings to show up.")), e.length > 0 ? i("div", { class: "nylas-booking-calendar-picker__dropdown" }, i("span", { class: "label", part: "nbcp__input-label" }, "Select a calendar to book meetings on", i("tooltip-component", null, i("info-icon", { slot: "tooltip-icon" }), i("span", { slot: "tooltip-content" }, "Check availability across one or multiple calendars. If multiple calendars are selected, you must be available across all of them to be considered available."))), i("select-dropdown", { name: "booking-calendar", options: e, withSearch: !1, exportparts: "sd_dropdown: nbcp__dropdown, sd_dropdown-button: nbcp__dropdown-button, sd_dropdown-content: nbcp__dropdown-content", defaultSelectedOption: e.find((n) => n.value == this.defaultBookingCalendar) ?? e[0] })) : i("div", { class: "nylas-booking-calendar-picker__loading" }, i("span", { class: "label" }, "Select a calendar to book meetings on ", i("info-icon", null)), i("div", { class: "loading-button" }, i("span", null, "Loading...")))));
446
+ }
447
+ static get formAssociated() {
448
+ return !0;
449
+ }
450
+ get host() {
451
+ return _(this);
452
+ }
453
+ static get watchers() {
454
+ return {
455
+ name: ["elementNameChangedHandler"]
456
+ };
457
+ }
458
+ };
459
+ xt([
460
+ C({
461
+ name: "nylas-booking-calendar-picker",
462
+ stateToProps: /* @__PURE__ */ new Map([
463
+ ["schedulerConfig.calendars", "calendars"],
464
+ ["schedulerConfig.currentUser", "currentUser"]
465
+ ]),
466
+ eventToProps: {
467
+ valueChanged: async (e, t) => {
468
+ const { valueChanged: n } = e.detail;
469
+ n && n(e);
470
+ }
471
+ },
472
+ fireRegisterEvent: !0
473
+ }),
474
+ oe("design:type", Function),
475
+ oe("design:paramtypes", []),
476
+ oe("design:returntype", void 0)
477
+ ], Te.prototype, "render", null);
478
+ Te.style = kt;
479
+ const wt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-buffer-time{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200);text-align:left}.nylas-buffer-time .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-buffer-time .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-buffer-time .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-buffer-time .nylas-buffer-time__body{display:grid;grid-template-columns:1fr auto}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown{padding:1rem;display:flex;flex-direction:column;gap:1rem;border-right:1px solid var(--nylas-base-200)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown .nylas-buffer-time__row{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:1rem}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown .nylas-buffer-time__row label{width:200px}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown .nylas-buffer-time__row .dropdown-container{display:flex;gap:1rem;align-items:center}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview{width:200px;padding:1rem;background:var(--nylas-base-25);border-bottom-right-radius:var(--nylas-border-radius-2x)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview h4{font-size:12px;line-height:24px;color:var(--nylas-base-600);font-family:var(--nylas-font-family);font-weight:500;text-align:center}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .slot{background-color:transparent;border-top:1px solid var(--nylas-base-300)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .slot.active{background-color:var(--nylas-base-100)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .slot:last-of-type{border-bottom:1px solid var(--nylas-base-300)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .event-slot{background-color:var(--nylas-base-600);border-top:1px solid var(--nylas-base-300);border-bottom:1px solid var(--nylas-base-300)}.nylas-buffer-time .nylas-buffer-time__dropdown select-dropdown::part(sd_dropdown-button){width:104px;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-buffer-time .nylas-buffer-time__dropdown select-dropdown::part(sd_dropdown-content){width:100%}.nylas-buffer-time .nylas-buffer-time__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', _t = wt;
480
+ var Ct = function(e, t, n, a) {
481
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
482
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
483
+ s = Reflect.decorate(e, t, n, a);
484
+ else
485
+ for (var r = e.length - 1; r >= 0; r--)
486
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
487
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
488
+ }, le = function(e, t) {
489
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
490
+ return Reflect.metadata(e, t);
491
+ };
492
+ const Ee = class {
493
+ constructor(e) {
494
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "buffer-time", this.buffer = { before: 0, after: 0 }, this.selectedBeforeBufferTime = this.buffer.before, this.selectedAfterBufferTime = this.buffer.after;
495
+ }
496
+ connectedCallback() {
497
+ d("nylas-buffer-time", "connectedCallback");
498
+ }
499
+ disconnectedCallback() {
500
+ d("nylas-buffer-time", "disconnectedCallback");
501
+ }
502
+ componentWillLoad() {
503
+ d("nylas-buffer-time", "componentWillLoad"), this.host.setAttribute("name", this.name);
504
+ }
505
+ componentDidLoad() {
506
+ if (d("nylas-buffer-time", "componentDidLoad"), typeof this.internals.setFormValue == "function") {
507
+ const e = {
508
+ before: this.selectedBeforeBufferTime,
509
+ after: this.selectedAfterBufferTime
510
+ };
511
+ this.internals.setFormValue(JSON.stringify(e), this.name);
512
+ }
513
+ this.selectedAfterBufferTime = this.buffer.after, this.selectedBeforeBufferTime = this.buffer.before;
514
+ }
515
+ componentWillUpdate() {
516
+ d("nylas-buffer-time", "componentWillUpdate");
517
+ }
518
+ componentDidUpdate() {
519
+ d("nylas-buffer-time", "componentDidUpdate");
520
+ }
521
+ componentWillRender() {
522
+ d("nylas-buffer-time", "componentWillRender");
523
+ }
524
+ componentDidRender() {
525
+ d("nylas-buffer-time", "componentDidRender");
526
+ }
527
+ elementNameChangedHandler(e) {
528
+ d("nylas-buffer-time", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
529
+ }
530
+ selectedOptionChangedHandler(e) {
531
+ d("nylas-buffer-time", "selectedOptionChangedHandler", e.detail);
532
+ const t = (n) => {
533
+ const { value: a, name: o } = n.detail;
534
+ o === "before-buffer-time" ? this.selectedBeforeBufferTime = parseInt(a) : o === "after-buffer-time" && (this.selectedAfterBufferTime = parseInt(a));
535
+ const s = {
536
+ before: this.selectedBeforeBufferTime,
537
+ after: this.selectedAfterBufferTime
538
+ };
539
+ this.internals.setFormValue(JSON.stringify(s), "booking-calendar");
540
+ };
541
+ this.valueChanged.emit({ ...e.detail, valueChanged: t });
542
+ }
543
+ renderPreview() {
544
+ const a = (l) => {
545
+ const r = Math.floor(l / 30), u = l % 30 / 30 * 20;
546
+ return {
547
+ fullSlots: r,
548
+ partialFillHeight: u
549
+ };
550
+ }, o = () => {
551
+ const { fullSlots: l, partialFillHeight: r } = a(this.selectedBeforeBufferTime);
552
+ return Array.from({ length: 4 }, (u, f) => {
553
+ const p = this.selectedBeforeBufferTime > 0 && f > 4 - l - 1, h = this.selectedBeforeBufferTime > 0 && f === 4 - l - 1 && r > 0;
554
+ let v = {};
555
+ return p && !h ? v.backgroundColor = "var(--nylas-base-100)" : h && (v.background = `linear-gradient(to top, var(--nylas-base-100) ${r}px, transparent 0)`), i("div", { key: f, class: `slot ${p ? "active" : ""}`, style: {
556
+ height: "20px",
557
+ ...v
558
+ } });
559
+ });
560
+ }, s = () => {
561
+ const { fullSlots: l, partialFillHeight: r } = a(this.selectedAfterBufferTime);
562
+ return Array.from({ length: 4 }, (u, f) => {
563
+ const p = this.selectedAfterBufferTime > 0 && f < l, h = f === l && r > 0;
564
+ let v = {};
565
+ return p && !h ? v.backgroundColor = "var(--nylas-base-100)" : h && (v.background = `linear-gradient(to bottom, var(--nylas-base-100) ${r}px, transparent 0)`), i("div", { key: f, class: `slot ${p ? "active" : ""}`, style: {
566
+ height: "20px",
567
+ ...v
568
+ } });
569
+ });
570
+ };
571
+ return i("div", { class: "preview-container" }, o(), i("div", { class: "event-slot", style: { height: "40px" } }), s());
572
+ }
573
+ render() {
574
+ const e = Array.from({ length: 121 }, (t, n) => ({
575
+ label: n.toString(),
576
+ value: n
577
+ }));
578
+ return i(x, null, i("div", { class: "nylas-buffer-time", part: "nbt" }, i("div", { class: "header", part: "nbt__header" }, i("h3", null, "Buffer time"), i("p", null, "Add buffer time before and after the event.")), i("div", { class: "nylas-buffer-time__body", part: "nbt__body" }, i("div", { class: "nylas-buffer-time__dropdown" }, i("div", { class: "nylas-buffer-time__row" }, i("label", null, "Before the event"), i("div", { class: "dropdown-container" }, i("select-dropdown", { id: "before-buffer-time", name: "before-buffer-time", exportparts: "sd_dropdown: nbt__dropdown-before, sd_dropdown-button: nbt__dropdown-button-before, sd_dropdown-content: nbt__dropdown-content-before", options: e, defaultSelectedOption: e.find((t) => t.value == this.selectedBeforeBufferTime) ?? e[0] }), i("span", null, "mins"))), i("div", { class: "nylas-buffer-time__row" }, i("label", null, "After the event"), i("div", { class: "dropdown-container" }, i("select-dropdown", { id: "after-buffer-time", name: "after-buffer-time", exportparts: "sd_dropdown: nbt__dropdown-after, sd_dropdown-button: nbt__dropdown-button-after, sd_dropdown-content: nbt__dropdown-content-after", options: e, defaultSelectedOption: e.find((t) => t.value == this.selectedAfterBufferTime) ?? e[0] }), i("span", null, "mins")))), i("div", { class: "nylas-buffer-time__preview", part: "nbt__preview" }, i("h4", null, "PREVIEW"), this.renderPreview()))));
579
+ }
580
+ static get formAssociated() {
581
+ return !0;
582
+ }
583
+ get host() {
584
+ return _(this);
585
+ }
586
+ static get watchers() {
587
+ return {
588
+ name: ["elementNameChangedHandler"]
589
+ };
590
+ }
591
+ };
592
+ Ct([
593
+ C({
594
+ name: "nylas-buffer-time",
595
+ eventToProps: {
596
+ valueChanged: async (e, t) => {
597
+ const { valueChanged: n } = e.detail;
598
+ n && n(e);
599
+ }
600
+ },
601
+ fireRegisterEvent: !0
602
+ }),
603
+ le("design:type", Function),
604
+ le("design:paramtypes", []),
605
+ le("design:returntype", void 0)
606
+ ], Ee.prototype, "render", null);
607
+ Ee.style = _t;
608
+ const Tt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-calendar-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-calendar-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-calendar-picker .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-calendar-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-calendar-picker .nylas-calendar-picker__loading{padding-bottom:1rem;display:flex;flex-direction:column;gap:4px}.nylas-calendar-picker .nylas-calendar-picker__loading .label{display:flex;align-items:center;gap:0.5rem;margin:1rem 1rem 0;color:var(--nylas-base-800)}.nylas-calendar-picker .nylas-calendar-picker__loading .label tooltip-component{display:flex}.nylas-calendar-picker .nylas-calendar-picker__loading .loading-button{margin:0 1rem;padding:0;width:inherit;height:48px;color:black;font-size:1rem;cursor:not-allowed;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-calendar-picker .nylas-calendar-picker__loading .loading-button span{padding:0 1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown{padding:1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown){width:100%;display:flex;flex-direction:column;gap:4px}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown-content){width:100%;max-width:unset}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Et = Tt;
609
+ var Ot = function(e, t, n, a) {
610
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
611
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
612
+ s = Reflect.decorate(e, t, n, a);
613
+ else
614
+ for (var r = e.length - 1; r >= 0; r--)
615
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
616
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
617
+ }, re = function(e, t) {
618
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
619
+ return Reflect.metadata(e, t);
620
+ };
621
+ const Oe = class {
622
+ constructor(e) {
623
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.calendars = void 0, this.currentUser = void 0, this.name = "calendar", this.defaultSelectedCalendars = [], this.selectedCalendars = [];
624
+ }
625
+ elementNameChangedHandler(e) {
626
+ d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
627
+ }
628
+ connectedCallback() {
629
+ d("nylas-calendar-picker", "connectedCallback");
630
+ }
631
+ disconnectedCallback() {
632
+ d("nylas-calendar-picker", "disconnectedCallback");
633
+ }
634
+ componentWillLoad() {
635
+ d("nylas-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
636
+ }
637
+ componentDidLoad() {
638
+ d("nylas-calendar-picker", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultSelectedCalendars.toString(), "calendar");
639
+ }
640
+ componentWillUpdate() {
641
+ d("nylas-calendar-picker", "componentWillUpdate");
642
+ }
643
+ componentDidUpdate() {
644
+ d("nylas-calendar-picker", "componentDidUpdate");
645
+ }
646
+ componentWillRender() {
647
+ d("nylas-calendar-picker", "componentWillRender");
648
+ }
649
+ componentDidRender() {
650
+ d("nylas-calendar-picker", "componentDidRender");
651
+ }
652
+ selectedOptionsChangedHandler(e) {
653
+ d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
654
+ const t = (n) => {
655
+ const { value: a } = n.detail;
656
+ this.selectedCalendars = [...a], this.internals.setFormValue(a.toString(), "calendar");
657
+ };
658
+ this.valueChanged.emit({ ...e.detail, name: this.name, valueChangedHandler: t });
659
+ }
660
+ render() {
661
+ var t;
662
+ const e = ((t = this.calendars) == null ? void 0 : t.map((n) => {
663
+ var a, o, s, l;
664
+ return {
665
+ value: n.id,
666
+ label: n.name,
667
+ selected: ((a = this.defaultSelectedCalendars) == null ? void 0 : a.includes(n.id)) || ((o = this.defaultSelectedCalendars) != null && o.includes("primary") || ((s = this.defaultSelectedCalendars) == null ? void 0 : s.length) === 0 ? n.id === ((l = this.currentUser) == null ? void 0 : l.email) : !1)
668
+ };
669
+ })) ?? [];
670
+ return i(x, null, i("div", { class: "nylas-calendar-picker", part: "ncp" }, i("div", { class: "header", part: "ncp__header" }, i("h3", null, "Calendar availability"), i("p", null, "Select calendars that you’d like to use for checking your availability.")), e.length > 0 ? i("div", { class: "nylas-calendar-picker__dropdown" }, i("multi-select-dropdown", { name: "calendar", label: "Select calendars that will be checked for availability", options: e, exportparts: "msd__dropdown: ncp__dropdown, msd__dropdown-button: ncp__dropdown-button, msd__dropdown-content: ncp__dropdown-content" }, i("span", { slot: "label-icon" }, i("tooltip-component", null, i("info-icon", { slot: "tooltip-icon" }), i("span", { slot: "tooltip-content" }, "Check availability across one or multiple calendars. If multiple calendars are selected, you must be available across all of them to be considered available. The default is your primary calendar if none are selected."))))) : i("div", { class: "nylas-calendar-picker__loading" }, i("span", { class: "label" }, "Select calendars that will be checked for availability ", i("info-icon", null)), i("div", { class: "loading-button" }, i("span", null, "Loading...")))));
671
+ }
672
+ static get formAssociated() {
673
+ return !0;
674
+ }
675
+ get host() {
676
+ return _(this);
677
+ }
678
+ static get watchers() {
679
+ return {
680
+ name: ["elementNameChangedHandler"]
681
+ };
682
+ }
683
+ };
684
+ Ot([
685
+ C({
686
+ name: "nylas-calendar-picker",
687
+ stateToProps: /* @__PURE__ */ new Map([
688
+ ["schedulerConfig.calendars", "calendars"],
689
+ ["schedulerConfig.currentUser", "currentUser"]
690
+ ]),
691
+ eventToProps: {
692
+ valueChanged: async (e, t) => {
693
+ const { valueChangedHandler: n } = e.detail;
694
+ n && n(e);
695
+ }
696
+ },
697
+ fireRegisterEvent: !0
698
+ }),
699
+ re("design:type", Function),
700
+ re("design:paramtypes", []),
701
+ re("design:returntype", void 0)
702
+ ], Oe.prototype, "render", null);
703
+ Oe.style = Et;
704
+ const St = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-custom-booking-flow{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-custom-booking-flow .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-custom-booking-flow .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-custom-booking-flow .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-custom-booking-flow .nylas-custom-booking-flow__loading{padding-bottom:1rem}.nylas-custom-booking-flow .nylas-custom-booking-flow__loading .label{display:flex;align-items:center;gap:0.5rem;margin:1rem 1rem 0;color:var(--nylas-base-800)}.nylas-custom-booking-flow .nylas-custom-booking-flow__loading .loading-button{margin:0 1rem;padding:0;width:inherit;height:48px;color:black;font-size:1rem;cursor:not-allowed;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-custom-booking-flow .nylas-custom-booking-flow__loading .loading-button span{padding:0 1rem}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown{padding:1rem}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown span.label{display:flex;align-items:center;gap:4px;color:var(--nylas-base-800)}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown span.label tooltip-component{display:flex}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown select-dropdown::part(sd_dropdown){width:100%}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown select-dropdown::part(sd_dropdown-content){width:100%;max-width:unset}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Dt = St;
705
+ var It = function(e, t, n, a) {
706
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
707
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
708
+ s = Reflect.decorate(e, t, n, a);
709
+ else
710
+ for (var r = e.length - 1; r >= 0; r--)
711
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
712
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
713
+ }, de = function(e, t) {
714
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
715
+ return Reflect.metadata(e, t);
716
+ };
717
+ const Se = class {
718
+ constructor(e) {
719
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.name = "booking-type", this.bookingType = "", this.selectedBookingType = "";
720
+ }
721
+ elementNameChangedHandler(e) {
722
+ d("nylas-custom-booking-flow", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
723
+ }
724
+ selectedConfigurationChangedHandler(e, t) {
725
+ var n, a;
726
+ d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e, t), (n = e == null ? void 0 : e.event_booking) != null && n.booking_type && (this.bookingType = (a = e == null ? void 0 : e.event_booking) == null ? void 0 : a.booking_type), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.bookingType.toString(), "booking-calendar"), this.selectedBookingType = this.bookingType;
727
+ }
728
+ connectedCallback() {
729
+ d("nylas-custom-booking-flow", "connectedCallback");
730
+ }
731
+ disconnectedCallback() {
732
+ d("nylas-custom-booking-flow", "disconnectedCallback");
733
+ }
734
+ componentWillLoad() {
735
+ d("nylas-custom-booking-flow", "componentWillLoad"), this.host.setAttribute("name", this.name);
736
+ }
737
+ componentDidLoad() {
738
+ d("nylas-custom-booking-flow", "componentDidLoad");
739
+ }
740
+ componentWillUpdate() {
741
+ d("nylas-custom-booking-flow", "componentWillUpdate");
742
+ }
743
+ componentDidUpdate() {
744
+ d("nylas-custom-booking-flow", "componentDidUpdate");
745
+ }
746
+ componentWillRender() {
747
+ d("nylas-custom-booking-flow", "componentWillRender");
748
+ }
749
+ componentDidRender() {
750
+ d("nylas-custom-booking-flow", "componentDidRender");
751
+ }
752
+ selectedOptionChangedHandler(e) {
753
+ d("nylas-custom-booking-flow", "selectedOptionChangedHandler", e.detail);
754
+ const t = (n) => {
755
+ const { value: a } = n.detail;
756
+ this.selectedBookingType = a, this.internals.setFormValue(a.toString(), "booking-calendar");
757
+ };
758
+ this.valueChanged.emit({ ...e.detail, valueChanged: t });
759
+ }
760
+ render() {
761
+ const e = [
762
+ {
763
+ label: "Automatically accept bookings",
764
+ value: "booking"
765
+ },
766
+ {
767
+ label: "Manually confirm/decline bookings",
768
+ value: "pre-booking"
769
+ }
770
+ ];
771
+ return i(x, { key: "7f019073e242dce64522e27262298e480b0fb346" }, i("div", { key: "47bd77bcd4c4a1a9a845581bb6ad77b6dd7d65e7", class: "nylas-custom-booking-flow", part: "ncbf" }, i("div", { key: "17386ac59d7680789dda85e832c84061225b6b04", class: "header", part: "ncbf__header" }, i("h3", { key: "5368e8f321140f2bfaf60f6ca3f732f584824301" }, "Customize booking flow"), i("p", { key: "65a0d4d41804f41f7c01a682e4b8b97ebc2c4ef2" }, "Customize how new bookings are handled when a booking is completed.")), e.length > 0 ? i("div", { class: "nylas-custom-booking-flow__dropdown" }, i("span", { class: "label" }, "After a booking is confirmed", i("tooltip-component", null, i("info-icon", { slot: "tooltip-icon" }), i("span", { slot: "tooltip-content" }, "Choose how you’d like to handle new bookings. If you choose to manually confirm/decline bookings, you will be able to review and accept or decline each booking request."))), i("select-dropdown", { name: "booking-type", options: e, withSearch: !1, exportparts: "sd_dropdown: ncbf__dropdown, sd_dropdown-button: ncbf__dropdown-button, sd_dropdown-content: ncbf__dropdown-content", defaultSelectedOption: e.find((t) => t.value == this.bookingType) ?? e[0] })) : i("div", { class: "nylas-custom-booking-flow__loading" }, i("span", { class: "label" }, "Select a calendar to book meetings on ", i("info-icon", null)), i("div", { class: "loading-button" }, i("span", null, "Loading...")))));
772
+ }
773
+ static get formAssociated() {
774
+ return !0;
775
+ }
776
+ get host() {
777
+ return _(this);
778
+ }
779
+ static get watchers() {
780
+ return {
781
+ name: ["elementNameChangedHandler"],
782
+ selectedConfiguration: ["selectedConfigurationChangedHandler"]
783
+ };
784
+ }
785
+ };
786
+ It([
787
+ C({
788
+ name: "nylas-custom-booking-flow",
789
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
790
+ eventToProps: {
791
+ valueChanged: async (e, t) => {
792
+ const { valueChanged: n } = e.detail;
793
+ n && n(e);
794
+ }
795
+ },
796
+ fireRegisterEvent: !0
797
+ }),
798
+ de("design:type", Function),
799
+ de("design:paramtypes", []),
800
+ de("design:returntype", void 0)
801
+ ], Se.prototype, "render", null);
802
+ Se.style = Dt;
803
+ const $t = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-description{display:flex;flex-direction:column;gap:4px}.nylas-event-description label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-description label span.label-icon{margin-left:4px}.nylas-event-description label span.label-icon tooltip-component{display:flex}.nylas-event-description textarea{padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px;border:1px solid var(--nylas-base-200)}.nylas-event-description textarea::-webkit-resizer{display:none}', Lt = $t;
804
+ var Ht = function(e, t, n, a) {
805
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
806
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
807
+ s = Reflect.decorate(e, t, n, a);
808
+ else
809
+ for (var r = e.length - 1; r >= 0; r--)
810
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
811
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
812
+ }, ce = function(e, t) {
813
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
814
+ return Reflect.metadata(e, t);
815
+ };
816
+ const De = class {
817
+ constructor(e) {
818
+ var t, n;
819
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventDescription = void 0, this.description = this.eventDescription || ((n = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : n.description) || "", this.name = "description";
820
+ }
821
+ elementNameChangedHandler(e) {
822
+ d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
823
+ }
824
+ selectedConfigurationChangedHandler(e, t) {
825
+ var n, a;
826
+ d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e, t), (n = e == null ? void 0 : e.event_booking) != null && n.description && (this.description = (a = e == null ? void 0 : e.event_booking) == null ? void 0 : a.description);
827
+ }
828
+ connectedCallback() {
829
+ d("nylas-event-description", "connectedCallback");
830
+ }
831
+ componentWillLoad() {
832
+ d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
833
+ }
834
+ componentDidLoad() {
835
+ d("nylas-event-description", "componentDidLoad");
836
+ }
837
+ disconnectedCallback() {
838
+ d("nylas-event-description", "disconnectedCallback");
839
+ }
840
+ handleChange(e) {
841
+ this.description = e.target.value, this.internals.setFormValue(e.target.value, "description"), this.valueChanged.emit({ value: e.target.value, name: this.name });
842
+ }
843
+ render() {
844
+ return i(x, { key: "08b8a3b8865cc09c467b5b8abc36d2d0f7039fcd" }, i("div", { key: "b906947588ca23a2edec4f31f04935cdc82bad96", class: "nylas-event-description", part: "nedesc" }, i("label", { key: "144ddfc7a8eb64434981122cc3df24dc89a00c63", htmlFor: "description" }, "Event description", i("span", { key: "6effc462e60a48b4eb55e325baf24f51f7c25854", class: "label-icon" }, i("tooltip-component", { key: "ee1d7faad42bdae393e4a20b9ec499c217aa21fc" }, i("info-icon", { key: "aecfd40dca5604d491e085be8fedb92e75276547", slot: "tooltip-icon" }), i("span", { key: "ce7cfceffe163a4c231813ed85ff7ebc80c8515d", slot: "tooltip-content" }, "Provide any additional details for your event.")))), i("textarea", { key: "0445a874c8d219548447a56780e435b986e159bc", id: "description", part: "nedesc__textarea", name: "description", value: this.description, maxlength: "8192", onInput: (e) => this.handleChange(e) })));
845
+ }
846
+ static get formAssociated() {
847
+ return !0;
848
+ }
849
+ get host() {
850
+ return _(this);
851
+ }
852
+ static get watchers() {
853
+ return {
854
+ name: ["elementNameChangedHandler"],
855
+ selectedConfiguration: ["selectedConfigurationChangedHandler"]
856
+ };
857
+ }
858
+ };
859
+ Ht([
860
+ C({
861
+ name: "nylas-event-description",
862
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
863
+ eventToProps: {},
864
+ fireRegisterEvent: !0
865
+ }),
866
+ ce("design:type", Function),
867
+ ce("design:paramtypes", []),
868
+ ce("design:returntype", void 0)
869
+ ], De.prototype, "render", null);
870
+ De.style = Lt;
871
+ const At = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-duration{display:flex;flex-direction:column;gap:4px}.nylas-event-duration label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-duration label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-duration label span.label-icon{margin-left:4px}.nylas-event-duration label span.label-icon tooltip-component{display:flex}.nylas-event-duration__wrapper{display:flex;align-items:center;gap:0.5rem}.nylas-event-duration__wrapper input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);font-size:16px;line-height:24px;width:48px}.nylas-event-duration__wrapper select-dropdown::part(sd_dropdown-button){border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px}.nylas-event-duration__wrapper select-dropdown::part(sd_dropdown-button-selected-label){font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Ft = At;
872
+ var Mt = function(e, t, n, a) {
873
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
874
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
875
+ s = Reflect.decorate(e, t, n, a);
876
+ else
877
+ for (var r = e.length - 1; r >= 0; r--)
878
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
879
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
880
+ }, fe = function(e, t) {
881
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
882
+ return Reflect.metadata(e, t);
883
+ };
884
+ const Ie = class {
885
+ constructor(e) {
886
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.name = "duration", this.eventDurationMinutes = void 0, this.duration = this.eventDurationMinutes ? this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes : 5, this.durationMinutes = this.eventDurationMinutes ?? 5, this.durationIncrement = this.eventDurationMinutes && this.eventDurationMinutes >= 60 ? 60 : 1;
887
+ }
888
+ elementNameChangedHandler(e) {
889
+ d("nylas-event-duration", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
890
+ }
891
+ selectedConfigurationChangedHandler(e) {
892
+ var n;
893
+ const t = (n = e == null ? void 0 : e.availability) == null ? void 0 : n.duration_minutes;
894
+ t && (this.duration = t >= 60 ? t / 60 : t, this.durationMinutes = t ?? 5, this.durationIncrement = t >= 60 ? 60 : 1);
895
+ }
896
+ durationMinutesChangedHandler(e, t) {
897
+ d("nylas-event-duration", "durationMinutesChangedHandler", e), e !== t && this.valueChanged.emit({ value: e.toString(), name: this.name });
898
+ }
899
+ connectedCallback() {
900
+ d("nylas-event-duration", "connectedCallback");
901
+ }
902
+ componentWillLoad() {
903
+ d("nylas-event-duration", "componentWillLoad"), this.host.setAttribute("name", this.name);
904
+ }
905
+ componentDidLoad() {
906
+ d("nylas-event-duration", "componentDidLoad"), this.internals.setFormValue(this.durationMinutes.toString(), "duration");
907
+ }
908
+ disconnectedCallback() {
909
+ d("nylas-event-duration", "disconnectedCallback");
910
+ }
911
+ handleChange(e) {
912
+ this.duration = e.target.value, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), this.name);
913
+ }
914
+ handleBlur() {
915
+ (this.duration === null || this.duration === void 0) && this.durationIncrement === 1 && (this.duration = 5), (this.duration <= 0 || this.duration === null || this.duration === void 0) && this.durationIncrement === 60 && (this.duration = 1), this.duration < 5 && this.durationIncrement === 1 && (this.duration = 5), this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
916
+ }
917
+ selectedOptionChangedHandler(e) {
918
+ d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
919
+ const { value: t } = e.detail;
920
+ this.durationIncrement = parseInt(t), this.durationIncrement === 1 ? this.duration = 5 : this.duration = 1, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
921
+ }
922
+ render() {
923
+ const e = [
924
+ { value: 1, label: "minutes" },
925
+ { value: 60, label: "hours" }
926
+ ];
927
+ return i(x, { key: "ff6384009f8323807da45260c85f9a833ca78605" }, i("div", { key: "9a495df4f19b186fb856b96b2165cf16f633c1d3", class: "nylas-event-duration", part: "ned" }, i("label", { key: "ddd0d777d526ebe86fb0353c74fb59d0acc9bb0c", htmlFor: "duration" }, "Event duration", i("span", { key: "4d4a72dcd4d5eb94065b92f680143837bacdf064", class: "required" }, "*"), i("span", { key: "0b4bf5ea22e494b579deeb5eb94b33e19f7805d7", class: "label-icon" }, i("tooltip-component", { key: "7ba13f0936a66b5d5ce8abdddaa2719ee944a53c" }, i("info-icon", { key: "c27304efca28e235f150d421b88ebb09b68705fd", slot: "tooltip-icon" }), i("span", { key: "f86eaf51c1360414af98ce557128fafb3c02b6d4", slot: "tooltip-content" }, "Set the duration of your event.")))), i("div", { key: "be06a61abc967a09375fb1cb4e634409f4b51909", class: "nylas-event-duration__wrapper" }, i("input", { key: "f89c51721313e11ead928cfa70b7a2953b8daaa5", type: "number", part: "ned_input", id: "duration", name: "duration", value: this.duration, onBlur: () => this.handleBlur(), onInput: (t) => this.handleChange(t), min: 5 }), i("select-dropdown", { key: "aed386f87a5b232f8b65a110d167e342f009a420", name: "event-duration", options: e, exportparts: "sd__dropdown: ned__dropdown, sd__dropdown-button: ned__dropdown-button, sd__dropdown-content: ned__dropdown-content", defaultSelectedOption: e.find((t) => t.value == this.durationIncrement) ?? e[0], withSearch: !1 }))));
928
+ }
929
+ static get formAssociated() {
930
+ return !0;
931
+ }
932
+ get host() {
933
+ return _(this);
934
+ }
935
+ static get watchers() {
936
+ return {
937
+ name: ["elementNameChangedHandler"],
938
+ selectedConfiguration: ["selectedConfigurationChangedHandler"],
939
+ durationMinutes: ["durationMinutesChangedHandler"]
940
+ };
941
+ }
942
+ };
943
+ Mt([
944
+ C({
945
+ name: "nylas-event-duration",
946
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
947
+ eventToProps: {},
948
+ fireRegisterEvent: !0
949
+ }),
950
+ fe("design:type", Function),
951
+ fe("design:paramtypes", []),
952
+ fe("design:returntype", void 0)
953
+ ], Ie.prototype, "render", null);
954
+ Ie.style = Ft;
955
+ const Nt = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-info__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-event-info__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-event-info__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-event-info__block{display:flex;justify-content:space-between;gap:0.5rem}', Rt = Nt;
956
+ var Pt = function(e, t, n, a) {
957
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
958
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
959
+ s = Reflect.decorate(e, t, n, a);
960
+ else
961
+ for (var r = e.length - 1; r >= 0; r--)
962
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
963
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
964
+ }, pe = function(e, t) {
965
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
966
+ return Reflect.metadata(e, t);
967
+ };
968
+ const $e = class {
969
+ constructor(e) {
970
+ y(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
971
+ }
972
+ connectedCallback() {
973
+ d("nylas-event-info", "connectedCallback");
974
+ }
975
+ componentWillLoad() {
976
+ d("nylas-event-info", "componentWillLoad");
977
+ }
978
+ componentDidLoad() {
979
+ d("nylas-event-info", "componentDidLoad");
980
+ }
981
+ disconnectedCallback() {
982
+ d("nylas-event-info", "disconnectedCallback");
983
+ }
984
+ render() {
985
+ return i(x, { key: "73cf50f7f006fed6b41256b3f83c6a549f6919f8" }, i("nylas-form-card", { key: "f34f24881a48a3af65e665693548388a9cbebb5f" }, i("h1", { key: "5e6ff9922a926b74bbaafe8502bae2724bd6ee3a", slot: "header-title", class: "nylas-event-info__title" }, "Event information"), i("h3", { key: "2a127a2206f7dec1b1cc93804588a8b96a893f83", slot: "header-subtitle", class: "nylas-event-info__subtitle" }, "Enter all event information."), i("div", { key: "b3dcd7ddb2bbb278327ca059e1d8fce793645a47", slot: "content", class: "nylas-event-info__content" }, i("slot", { key: "7868be55755715b91a591f92225f13aeb5dbf00d", name: "inputs" }))));
986
+ }
987
+ static get formAssociated() {
988
+ return !0;
989
+ }
990
+ };
991
+ Pt([
992
+ C({
993
+ name: "nylas-event-info",
994
+ eventToProps: {},
995
+ fireRegisterEvent: !0
996
+ }),
997
+ pe("design:type", Function),
998
+ pe("design:paramtypes", []),
999
+ pe("design:returntype", void 0)
1000
+ ], $e.prototype, "render", null);
1001
+ $e.style = Rt;
1002
+ const zt = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-limits__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-event-limits__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-event-limits__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-event-limits__block{display:flex;justify-content:space-between;gap:0.5rem}', Bt = zt;
1003
+ var jt = function(e, t, n, a) {
1004
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1005
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1006
+ s = Reflect.decorate(e, t, n, a);
1007
+ else
1008
+ for (var r = e.length - 1; r >= 0; r--)
1009
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1010
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1011
+ }, be = function(e, t) {
1012
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1013
+ return Reflect.metadata(e, t);
1014
+ };
1015
+ const Le = class {
1016
+ constructor(e) {
1017
+ y(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
1018
+ }
1019
+ connectedCallback() {
1020
+ d("nylas-event-limits", "connectedCallback");
1021
+ }
1022
+ componentWillLoad() {
1023
+ d("nylas-event-limits", "componentWillLoad");
1024
+ }
1025
+ componentDidLoad() {
1026
+ d("nylas-event-limits", "componentDidLoad");
1027
+ }
1028
+ disconnectedCallback() {
1029
+ d("nylas-event-limits", "disconnectedCallback");
1030
+ }
1031
+ render() {
1032
+ return i(x, { key: "2cc9ace0192971cd75683313d64f3ef06d400136" }, i("nylas-form-card", { key: "cbca7bb803781e3c93a85c73e56e762f9daa2f9d" }, i("h1", { key: "5a55b7edf422b59b251c2df6d9cf174d83c012eb", slot: "header-title", class: "nylas-event-limits__title" }, "Set event limits"), i("h3", { key: "70415910cf84c503291373387bdab5c6da95e091", slot: "header-subtitle", class: "nylas-event-limits__subtitle" }, "Customize event limits for the event."), i("div", { key: "0735659855b9ad599c70dc8045e2477b853571e6", slot: "content", class: "nylas-event-limits__content" }, i("slot", { key: "a35e9bcc861998b14d5bbf630d6c1fcbd038fbdf", name: "inputs" }))));
1033
+ }
1034
+ static get formAssociated() {
1035
+ return !0;
1036
+ }
1037
+ };
1038
+ jt([
1039
+ C({
1040
+ name: "nylas-event-limits",
1041
+ eventToProps: {},
1042
+ fireRegisterEvent: !0
1043
+ }),
1044
+ be("design:type", Function),
1045
+ be("design:paramtypes", []),
1046
+ be("design:returntype", void 0)
1047
+ ], Le.prototype, "render", null);
1048
+ Le.style = Bt;
1049
+ const Wt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-title{display:flex;flex-direction:column;gap:4px;position:relative;text-align:left}.nylas-event-title div.title{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);overflow:scroll;white-space:nowrap;scrollbar-width:thin}.nylas-event-title div.title::-webkit-scrollbar{width:6px;height:6px}.nylas-event-title div.title.error{border-color:var(--nylas-error);outline:none}.nylas-event-title input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-event-title span.help-text{color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:21px}.nylas-event-title span.error-message{color:var(--nylas-error)}.nylas-event-title label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-title label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-title label span.label-icon{margin-left:4px}.nylas-event-title label span.label-icon tooltip-component{display:flex}.highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:5px;margin-left:4px}.token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:80px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.token-options{right:0;width:325px;max-width:unset}}.token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.token-options ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.token-options ul li:hover,.token-options ul li:focus,.token-options ul li:active,.token-options ul li.active{background-color:var(--nylas-base-100)}.token-options ul li:hover .token-label .token,.token-options ul li:focus .token-label .token,.token-options ul li:active .token-label .token,.token-options ul li.active .token-label .token{color:var(--nylas-primary)}.token-options .selected{background-color:var(--nylas-base-100)}', Ut = Wt;
1050
+ var Zt = function(e, t, n, a) {
1051
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1052
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1053
+ s = Reflect.decorate(e, t, n, a);
1054
+ else
1055
+ for (var r = e.length - 1; r >= 0; r--)
1056
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1057
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1058
+ }, ue = function(e, t) {
1059
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1060
+ return Reflect.metadata(e, t);
1061
+ };
1062
+ const He = class {
1063
+ constructor(e) {
1064
+ var t, n;
1065
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventTitle = (n = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : n.title, this.name = "title", this.showTokens = !1, this.availableTokens = _e.map((a) => ({
1066
+ label: a.token,
1067
+ value: a.value,
1068
+ labelHTML: a
1069
+ })), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "";
1070
+ }
1071
+ elementNameChangedHandler(e) {
1072
+ d("nylas-event-title", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1073
+ }
1074
+ ariaActivedescendantChangedHandler(e) {
1075
+ var t, n;
1076
+ if (d("nylas-event-title", "ariaActivedescendantChangedHandler", e), e !== "") {
1077
+ const a = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(e);
1078
+ a == null || a.classList.add("active");
1079
+ } else {
1080
+ const a = (n = this.host.shadowRoot) == null ? void 0 : n.querySelectorAll(".token-options li.active");
1081
+ a == null || a.forEach((o) => o.classList.remove("active"));
1082
+ }
1083
+ }
1084
+ configChangedHandler(e) {
1085
+ var n;
1086
+ const t = (n = e == null ? void 0 : e.event_booking) == null ? void 0 : n.title;
1087
+ t && this.updateEventTitleFromProp(t);
1088
+ }
1089
+ connectedCallback() {
1090
+ d("nylas-event-title", "connectedCallback");
1091
+ }
1092
+ componentWillLoad() {
1093
+ d("nylas-event-title", "componentWillLoad"), this.host.setAttribute("name", this.name);
1094
+ }
1095
+ componentDidLoad() {
1096
+ d("nylas-event-title", "componentDidLoad"), this.updateEventTitleFromProp(this.eventTitle || "");
1097
+ }
1098
+ disconnectedCallback() {
1099
+ d("nylas-event-title", "disconnectedCallback");
1100
+ }
1101
+ formSubmittedHandler(e) {
1102
+ var t, n;
1103
+ d("nylas-event-title", "formSubmittedHandler", e), (n = (t = this.internals) == null ? void 0 : t.validity) != null && n.valid ? this.validationError = "" : this.validationError = "Event title is required";
1104
+ }
1105
+ updateEventTitleFromProp(e) {
1106
+ var t, n;
1107
+ d("nylas-event-title", "eventTitleChangedHandler", e), this.titleRef && (this.titleRef.innerHTML = this.highlightTokens(e), this.titleRef.focus(), typeof this.internals.setValidity == "function" && (e === "" ? (t = this.internals) == null || t.setValidity({ customError: !0 }, "Event title is required", this.titleRef) : (n = this.internals) == null || n.setValidity({ customError: !1 })));
1108
+ }
1109
+ highlightTokens(e) {
1110
+ let t = e;
1111
+ return _e.forEach((n) => {
1112
+ const a = n.value, o = new RegExp(`(\\${a})(?!\\w)`, "g");
1113
+ t = t.replace(o, '<span class="highlighted-tag">$1</span>');
1114
+ }), t;
1115
+ }
1116
+ getCurrentSelectionForBrowser() {
1117
+ var a, o, s;
1118
+ const e = (l, r, u, f) => {
1119
+ const p = l.replace(/[\u200B-\u200D\uFEFF]/g, ""), h = p.lastIndexOf("$"), v = p.substring(h).split(" ")[0];
1120
+ return {
1121
+ focusOffset: r,
1122
+ dollarIndex: h,
1123
+ lastWord: v,
1124
+ currentText: p,
1125
+ node: u,
1126
+ allSelected: f
1127
+ };
1128
+ }, t = (l) => {
1129
+ var r, u;
1130
+ return l.anchorOffset === 0 && l.focusOffset === ((u = (r = l.focusNode) == null ? void 0 : r.nodeValue) == null ? void 0 : u.length);
1131
+ };
1132
+ switch (Ze()) {
1133
+ case "Chrome":
1134
+ const l = (a = this.host.shadowRoot) == null ? void 0 : a.getSelection(), r = l == null ? void 0 : l.focusNode, u = (r == null ? void 0 : r.nodeValue) || "", f = l && t(l);
1135
+ return e(u, (l == null ? void 0 : l.focusOffset) || -1, r, f);
1136
+ case "Firefox":
1137
+ const p = document.getSelection(), h = ((o = p == null ? void 0 : p.anchorNode) == null ? void 0 : o.nodeValue) || "", v = p && t(p);
1138
+ return e(h, (p == null ? void 0 : p.focusOffset) || -1, p == null ? void 0 : p.anchorNode, v);
1139
+ case "Safari":
1140
+ const O = window.getSelection(), k = O == null ? void 0 : O.getComposedRanges(this.host.shadowRoot)[0], c = ((s = k == null ? void 0 : k.startContainer) == null ? void 0 : s.nodeValue) || "", b = O && t(O);
1141
+ return e(c, (k == null ? void 0 : k.endOffset) || -1, k == null ? void 0 : k.startContainer, b);
1142
+ default:
1143
+ return console.warn("Browser not supported"), null;
1144
+ }
1145
+ }
1146
+ handleChange(e) {
1147
+ const t = e.target.textContent || "", n = this.getCurrentSelectionForBrowser();
1148
+ if (!n) {
1149
+ this.updateEventTitle(t), this.resetDropdown();
1150
+ return;
1151
+ }
1152
+ const { focusOffset: a, dollarIndex: o, lastWord: s, currentText: l } = n;
1153
+ if (o === -1 || a < o) {
1154
+ this.updateEventTitle(t), this.resetDropdown();
1155
+ return;
1156
+ }
1157
+ s.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
1158
+ $value: s,
1159
+ fullText: l,
1160
+ index: o,
1161
+ focusOffset: a
1162
+ }, this.populateSuggestionsDropdown(s)) : this.resetDropdown(), this.updateEventTitle(t);
1163
+ }
1164
+ handleInputKeyDown(e) {
1165
+ var n, a, o, s;
1166
+ const t = this.getCurrentSelectionForBrowser();
1167
+ if (t != null && t.allSelected && !We(e) && (this.titleRef.innerHTML = ""), e.key === "Enter") {
1168
+ e.preventDefault();
1169
+ const l = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(this.ariaActivedescendant);
1170
+ l && (l.click(), this.ariaActivedescendant = "");
1171
+ } else if (e.key === "ArrowDown") {
1172
+ e.preventDefault();
1173
+ const l = (a = this.host.shadowRoot) == null ? void 0 : a.getElementById(this.ariaActivedescendant);
1174
+ if (l) {
1175
+ const r = l.nextElementSibling;
1176
+ r ? this.ariaActivedescendant = r.id : this.ariaActivedescendant = this.filteredTokens[0].label;
1177
+ } else
1178
+ this.ariaActivedescendant = this.filteredTokens[0].label;
1179
+ } else if (e.key === "ArrowUp") {
1180
+ e.preventDefault();
1181
+ const l = (o = this.host.shadowRoot) == null ? void 0 : o.getElementById(this.ariaActivedescendant);
1182
+ if (l) {
1183
+ const r = l.previousElementSibling;
1184
+ r ? this.ariaActivedescendant = r.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1185
+ } else
1186
+ this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1187
+ } else
1188
+ e.key === "Escape" ? (e.preventDefault(), this.resetDropdown()) : (e.key === "Backspace" || e.key === "Delete") && (t != null && t.currentText.startsWith("${") && (s = t == null ? void 0 : t.node) != null && s.parentNode && t.node.parentNode.removeChild(t.node), (this.titleRef.textContent === "" || (t == null ? void 0 : t.currentText) === "" || t != null && t.allSelected) && (this.titleRef.innerHTML = ""));
1189
+ }
1190
+ selectOption(e, t) {
1191
+ var c;
1192
+ e.preventDefault();
1193
+ const n = this.currentWord.fullText, a = this.currentWord.$value;
1194
+ let o = this.titleRef.firstChild, s = null;
1195
+ for (; o; ) {
1196
+ if (o.nodeType === 3) {
1197
+ const b = ((c = o.textContent) == null ? void 0 : c.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", m = n.replace(/[\u200B-\u200D\uFEFF]/g, "");
1198
+ if (b.includes(m)) {
1199
+ s = o;
1200
+ break;
1201
+ }
1202
+ }
1203
+ o = o.nextSibling;
1204
+ }
1205
+ if (!s)
1206
+ return;
1207
+ const l = s.textContent || "", r = l.indexOf(a), u = l.substring(0, r), f = l.substring(r + a.length), p = document.createTextNode(u), h = document.createRange(), v = document.createElement("span");
1208
+ v.classList.add("highlighted-tag"), v.textContent = `${t.value}`;
1209
+ const O = document.createTextNode(f);
1210
+ if (f !== "")
1211
+ s.replaceWith(p, v, O), h.setStart(O, 1);
1212
+ else {
1213
+ const b = document.createTextNode("​");
1214
+ s.replaceWith(p, v, b), h.setStart(b, 1);
1215
+ }
1216
+ this.resetDropdown(), this.titleRef.focus();
1217
+ const k = window.getSelection();
1218
+ h.collapse(!0), k == null || k.removeAllRanges(), k == null || k.addRange(h), this.updateEventTitle(this.titleRef.textContent || "");
1219
+ }
1220
+ populateSuggestionsDropdown(e = "") {
1221
+ this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
1222
+ }
1223
+ updateEventTitle(e) {
1224
+ var n, a, o;
1225
+ const t = e.replace(/ +/g, " ");
1226
+ t === "" ? ((n = this.internals) == null || n.setValidity({ customError: !0 }, "Event title is required", this.titleRef), this.validationError = "Event title is required") : ((a = this.internals) == null || a.setValidity({ customError: !1 }), this.validationError = ""), (o = this.internals) == null || o.setFormValue(t, this.name), this.valueChanged.emit({ value: t, name: this.name });
1227
+ }
1228
+ resetDropdown() {
1229
+ this.showTokens = !1, this.ariaActivedescendant = "";
1230
+ }
1231
+ getLabelHTML(e) {
1232
+ return i("div", { class: "token-label" }, i("span", { class: "token" }, e.token), i("span", { class: "description" }, e.description));
1233
+ }
1234
+ render() {
1235
+ var e;
1236
+ return i(x, { key: "e0ddf6c13a5a0c0d2e0db9188365418fb7484dcf" }, i("div", { key: "a3b8e594c8d9632709e777891f04df0aaaf7c5c3", class: "nylas-event-title", part: "net" }, i("label", { key: "e5794d2cd8be0b1666bfa67c3ea657da5dc8d45d", htmlFor: "title" }, "Event title", i("span", { key: "1210caceb7bf824f01559460e1c5e572cb2dad92", class: "required" }, "*"), i("span", { key: "4280ec285221e6db76ca08723fe3888a1d2643e3", class: "label-icon" }, i("tooltip-component", { key: "d6c05fb79cf39656af7589a2e9de9ef832d7a2f8" }, i("info-icon", { key: "a4659d97d60d00dfcc2c993e70da5cfd05904f78", slot: "tooltip-icon" }), i("span", { key: "738bfa669eec42b417be02fbad0584af34044c83", slot: "tooltip-content" }, "Enter a title for your event.")))), i("div", { key: "df102dc899f8de91154689d9cdaae28465380622", class: {
1237
+ title: !0,
1238
+ error: this.validationError !== ""
1239
+ }, part: "net__title", ref: (t) => this.titleRef = t, contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t) }), this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && i("div", { class: "token-options", part: "net__dropdown-content" }, i("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => i("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (n) => this.selectOption(n, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), i("span", { key: "ec769eea7e2e3ff6d64bef0f5099540c93ba80ab", class: "help-text" }, "Create a dynamic templated event title by typing $. Learn more"), this.validationError != "" && i("span", { class: "error-message" }, this.validationError)));
1240
+ }
1241
+ static get formAssociated() {
1242
+ return !0;
1243
+ }
1244
+ get host() {
1245
+ return _(this);
1246
+ }
1247
+ static get watchers() {
1248
+ return {
1249
+ name: ["elementNameChangedHandler"],
1250
+ ariaActivedescendant: ["ariaActivedescendantChangedHandler"],
1251
+ selectedConfiguration: ["configChangedHandler"]
1252
+ };
1253
+ }
1254
+ };
1255
+ Zt([
1256
+ C({
1257
+ name: "nylas-event-title",
1258
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
1259
+ eventToProps: {},
1260
+ fireRegisterEvent: !0
1261
+ }),
1262
+ ue("design:type", Function),
1263
+ ue("design:paramtypes", []),
1264
+ ue("design:returntype", void 0)
1265
+ ], He.prototype, "render", null);
1266
+ He.style = Ut;
1267
+ const Yt = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-limit-future-bookings{display:flex;justify-content:space-between;font-family:var(--nylas-font-family)}.nylas-limit-future-bookings label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-limit-future-bookings label span.label-icon{margin-left:4px}.nylas-limit-future-bookings label span.label-icon tooltip-component{display:flex}', Kt = Yt;
1268
+ var Vt = function(e, t, n, a) {
1269
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1270
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1271
+ s = Reflect.decorate(e, t, n, a);
1272
+ else
1273
+ for (var r = e.length - 1; r >= 0; r--)
1274
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1275
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1276
+ }, he = function(e, t) {
1277
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1278
+ return Reflect.metadata(e, t);
1279
+ };
1280
+ const Ae = class {
1281
+ constructor(e) {
1282
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.availableDaysInFuture = void 0, this.name = "limit-future-bookings", this.selectedNumber = 1, this.selectedPeriod = "day";
1283
+ }
1284
+ elementNameChangedHandler(e) {
1285
+ d("nylas-limit-future-bookings", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1286
+ }
1287
+ selectedConfigurationChangedHandler(e) {
1288
+ var n;
1289
+ const t = (n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.available_days_in_future;
1290
+ t && this.updateNumberAndPeriodFromDays(t);
1291
+ }
1292
+ availableDaysInFutureChanged(e) {
1293
+ this.updateNumberAndPeriodFromDays(e);
1294
+ }
1295
+ connectedCallback() {
1296
+ d("nylas-limit-future-bookings", "connectedCallback");
1297
+ }
1298
+ componentWillLoad() {
1299
+ d("nylas-limit-future-bookings", "componentWillLoad"), this.host.setAttribute("name", this.name);
1300
+ }
1301
+ componentDidLoad() {
1302
+ var e;
1303
+ d("nylas-limit-future-bookings", "componentDidLoad"), this.availableDaysInFutureChanged(this.availableDaysInFuture ?? 1), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(((e = this.availableDaysInFuture) == null ? void 0 : e.toString()) ?? "1", this.name);
1304
+ }
1305
+ disconnectedCallback() {
1306
+ d("nylas-limit-future-bookings", "disconnectedCallback");
1307
+ }
1308
+ timePeriodChangedHandler(e) {
1309
+ const { number: t, period: n } = e.detail;
1310
+ let a;
1311
+ n === "day" ? a = t : n === "week" ? a = t * 7 : a = t * 30, this.valueChanged.emit({ value: a, name: "availableDaysInFuture" }), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(a.toString(), this.name);
1312
+ }
1313
+ updateNumberAndPeriodFromDays(e) {
1314
+ let t, n;
1315
+ e >= 30 && e % 30 === 0 ? (t = e / 30, n = "month") : e >= 7 && e % 7 === 0 ? (t = e / 7, n = "week") : (t = e, n = "day"), this.selectedNumber = t, this.selectedPeriod = n;
1316
+ }
1317
+ render() {
1318
+ return i(x, { key: "1bb30d8045366579b327f32f954d64c3360efa11" }, i("div", { key: "2594946bd35a01a0ab64288c54fe886f4577d8b5", class: "nylas-limit-future-bookings", part: "nlfb" }, i("label", { key: "cf955eb319e09617dd95037d66a387122238d17c" }, "Limit future bookings", i("span", { key: "4f5658353873122f083faec5504856902bdba106", class: "label-icon" }, i("tooltip-component", { key: "ee20b3543178702592b83e70a5a85988d0c3cd29" }, i("info-icon", { key: "dfe75e502418b3f00a29d3d0fb76338056089266", slot: "tooltip-icon" }), i("span", { key: "c7226da2491e6c3beda2f9739afda6220c37c0e1", slot: "tooltip-content" }, "Set a limit on how far in the future bookings can be made.")))), i("time-period-selector", { key: "5ad178b3d7158738a2882cb5a6554727de34a23d", id: "limit-future-bookings", timePeriods: ["day", "week", "month"], exportparts: "tps__number-dropdown: nlfb__number-dropdown, tps__number-dropdown-button: nlfb__number-dropdown-button, tps__number-dropdown-content: nlfb__number-dropdown-content, tps__period-dropdown: nlfb__period-dropdown, tps__period-dropdown-button: nlfb__period-dropdown-button, tps__period-dropdown-content: nlfb__period-dropdown-content", defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod })));
1319
+ }
1320
+ static get formAssociated() {
1321
+ return !0;
1322
+ }
1323
+ get host() {
1324
+ return _(this);
1325
+ }
1326
+ static get watchers() {
1327
+ return {
1328
+ name: ["elementNameChangedHandler"],
1329
+ selectedConfiguration: ["selectedConfigurationChangedHandler"],
1330
+ availableDaysInFuture: ["availableDaysInFutureChanged"]
1331
+ };
1332
+ }
1333
+ };
1334
+ Vt([
1335
+ C({
1336
+ name: "nylas-limit-future-bookings",
1337
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
1338
+ eventToProps: {},
1339
+ fireRegisterEvent: !0
1340
+ }),
1341
+ he("design:type", Function),
1342
+ he("design:paramtypes", []),
1343
+ he("design:returntype", void 0)
1344
+ ], Ae.prototype, "render", null);
1345
+ Ae.style = Kt;
1346
+ const qt = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-location{display:flex;flex-direction:column;gap:4px;font-family:var(--nylas-font-family)}.nylas-event-location label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-location label span.label-icon{margin-left:4px}.nylas-event-location label span.label-icon tooltip-component{display:flex}.nylas-event-location span[slot=select-icon]{border-right:1px solid var(--nylas-base-200);padding:16px 0.75rem 16px 0.5rem;border-radius:var(--nylas-border-radius-2x);border-bottom-right-radius:0;border-top-right-radius:0;height:20px}.nylas-event-location div.location-input{display:grid;grid-template-columns:auto 1fr;width:100%;gap:0.5rem}.nylas-event-location div.location-input input{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}.nylas-event-location select-dropdown{width:208px}@media screen and (max-width: 768px){.nylas-event-location select-dropdown{width:100%}}.nylas-event-location select-dropdown::part(sd_dropdown){width:100%}.nylas-event-location select-dropdown::part(sd_dropdown-content){left:calc(35px + 0.5rem)}.nylas-event-location select-dropdown::part(sd_dropdown-button){display:flex;justify-content:space-between;width:100%;border:1px solid var(--nylas-base-200);padding:0 0.5rem}.nylas-event-location select-dropdown::part(sd_dropdown-button-selected-label){display:inline-flex;align-self:center;padding:14px 0;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Jt = qt;
1347
+ var Gt = function(e, t, n, a) {
1348
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1349
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1350
+ s = Reflect.decorate(e, t, n, a);
1351
+ else
1352
+ for (var r = e.length - 1; r >= 0; r--)
1353
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1354
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1355
+ }, me = function(e, t) {
1356
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1357
+ return Reflect.metadata(e, t);
1358
+ };
1359
+ const Fe = class {
1360
+ constructor(e) {
1361
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventLocation = void 0, this.location = this.eventLocation ?? "", this.selectedLocationOption = this.eventLocation ? "custom" : "none", this.name = "location";
1362
+ }
1363
+ elementNameChangedHandler(e) {
1364
+ d("nylas-location-component", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1365
+ }
1366
+ selectedConfigurationChangedHandler(e, t) {
1367
+ var a;
1368
+ d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e, t);
1369
+ const n = (a = e == null ? void 0 : e.event_booking) == null ? void 0 : a.location;
1370
+ n && (this.selectedLocationOption = n ? "custom" : "none", this.location = n);
1371
+ }
1372
+ eventLocationChangedHandler(e, t) {
1373
+ d("nylas-location-component", "eventLocationChangedHandler", e), e !== t && (this.selectedLocationOption = e ? "custom" : "none");
1374
+ }
1375
+ connectedCallback() {
1376
+ d("nylas-location-component", "connectedCallback");
1377
+ }
1378
+ componentWillLoad() {
1379
+ d("nylas-location-component", "componentWillLoad"), this.host.setAttribute("name", this.name);
1380
+ }
1381
+ componentDidLoad() {
1382
+ d("nylas-location-component", "componentDidLoad");
1383
+ }
1384
+ disconnectedCallback() {
1385
+ d("nylas-location-component", "disconnectedCallback");
1386
+ }
1387
+ selectedOptionChangedHandler(e) {
1388
+ this.selectedLocationOption = e.detail.value, this.selectedLocationOption === "none" && (this.location = "", this.setFormValue("", "location"), this.valueChanged.emit({ value: "", name: this.name }));
1389
+ }
1390
+ setFormValue(e, t) {
1391
+ typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, t);
1392
+ }
1393
+ handleChange(e) {
1394
+ this.location = e.target.value, this.setFormValue(e.target.value, "location"), this.valueChanged.emit({ value: e.target.value, name: this.name });
1395
+ }
1396
+ render() {
1397
+ const e = [
1398
+ { value: "none", label: "None" },
1399
+ { value: "custom", label: "Custom location" }
1400
+ ], t = {
1401
+ none: i("location-off-icon", { key: "5344819790f0d245e78de8808b05005eaa610991" }),
1402
+ custom: i("location-icon", { key: "6d931006f7ea79e3290bde60cbdd3c1ca8e827f8" })
1403
+ };
1404
+ return i(x, { key: "2117e5636492cd1b3bc3b975fdc1398c030df9a4" }, i("div", { key: "093c3fdfaf0ad88955f8f785a5c589708d941e57", class: "nylas-event-location", part: "nel" }, i("label", { key: "e2754216f675fc82cdc7813bacfe0e928e9ed50e", htmlFor: "location" }, "Location type", i("span", { key: "e402fccc0065a4f6fd0cbd05af345b73b06c4464", class: "label-icon" }, i("tooltip-component", { key: "c818dbca3cbbf29e34c56bbc9caea7fc3816d808" }, i("info-icon", { key: "5ea673e0d49efe7e0a4ac04c3ec64427a63b8843", slot: "tooltip-icon" }), i("span", { key: "dac6ddf369aa6caf62a870ca349745f546ed3959", slot: "tooltip-content" }, "Choose how you’ll meet with the participants at the scheduled time. Pick from available conferencing options or add a custom location.")))), i("div", { key: "bf334b9e8e03b660f661d264c9ca52444ee859b6", class: "location-input" }, i("select-dropdown", { key: "f216e1589bb3b72a9ed6b9cfbec5683795e1b08e", withSearch: !1, name: "location", options: e, defaultSelectedOption: e.find((n) => n.value == this.selectedLocationOption), exportparts: "sd__dropdown: nel__dropdown, sd__dropdown-button: nel__dropdown-button, sd__dropdown-content: nel__dropdown-content" }, i("span", { key: "6ca96d9f95ac189195c1490e6872b2478cd0d270", slot: "select-icon" }, t[this.selectedLocationOption])), this.selectedLocationOption === "custom" && i("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: (n) => this.handleChange(n) }))));
1405
+ }
1406
+ static get formAssociated() {
1407
+ return !0;
1408
+ }
1409
+ get host() {
1410
+ return _(this);
1411
+ }
1412
+ static get watchers() {
1413
+ return {
1414
+ name: ["elementNameChangedHandler"],
1415
+ selectedConfiguration: ["selectedConfigurationChangedHandler"],
1416
+ eventLocation: ["eventLocationChangedHandler"]
1417
+ };
1418
+ }
1419
+ };
1420
+ Gt([
1421
+ C({
1422
+ name: "nylas-location-component",
1423
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
1424
+ eventToProps: {},
1425
+ fireRegisterEvent: !0
1426
+ }),
1427
+ me("design:type", Function),
1428
+ me("design:paramtypes", []),
1429
+ me("design:returntype", void 0)
1430
+ ], Fe.prototype, "render", null);
1431
+ Fe.style = Jt;
1432
+ const Xt = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-min-cancellation-notice{display:flex;justify-content:space-between;font-family:var(--nylas-font-family)}.nylas-min-cancellation-notice label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-min-cancellation-notice label span.label-icon{margin-left:4px}.nylas-min-cancellation-notice label span.label-icon tooltip-component{display:flex}', Qt = Xt;
1433
+ var en = function(e, t, n, a) {
1434
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1435
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1436
+ s = Reflect.decorate(e, t, n, a);
1437
+ else
1438
+ for (var r = e.length - 1; r >= 0; r--)
1439
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1440
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1441
+ }, ye = function(e, t) {
1442
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1443
+ return Reflect.metadata(e, t);
1444
+ };
1445
+ const Me = class {
1446
+ constructor(e) {
1447
+ y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.minCancellationNotice = void 0, this.name = "min-cancellation-notice", this.selectedNumber = 1, this.selectedPeriod = "day";
1448
+ }
1449
+ elementNameChangedHandler(e) {
1450
+ d("nylas-min-cancellation-notice", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1451
+ }
1452
+ selectedConfigurationChangedHandler(e) {
1453
+ var n;
1454
+ const t = (n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.min_cancellation_notice;
1455
+ t && this.updateNumberAndPeriodFromMinutes(t);
1456
+ }
1457
+ availableDaysInFutureChanged(e) {
1458
+ this.updateNumberAndPeriodFromMinutes(e);
1459
+ }
1460
+ connectedCallback() {
1461
+ d("nylas-min-cancellation-notice", "connectedCallback");
1462
+ }
1463
+ componentWillLoad() {
1464
+ d("nylas-min-cancellation-notice", "componentWillLoad"), this.host.setAttribute("name", this.name);
1465
+ }
1466
+ componentDidLoad() {
1467
+ var e;
1468
+ d("nylas-min-cancellation-notice", "componentDidLoad"), this.availableDaysInFutureChanged(this.minCancellationNotice ?? 1), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(((e = this.minCancellationNotice) == null ? void 0 : e.toString()) ?? "1", this.name);
1469
+ }
1470
+ disconnectedCallback() {
1471
+ d("nylas-min-cancellation-notice", "disconnectedCallback");
1472
+ }
1473
+ timePeriodChangedHandler(e) {
1474
+ const { number: t, period: n } = e.detail;
1475
+ let a;
1476
+ const o = 60, s = o * 24, l = s * 7, r = s * 30;
1477
+ n === "minute" ? a = t : n === "hour" ? a = t * o : n === "day" ? a = t * s : n === "week" ? a = t * l : n === "month" ? a = t * r : a = 0, this.valueChanged.emit({ value: a, name: "minCancellationNotice" }), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(a.toString(), this.name);
1478
+ }
1479
+ updateNumberAndPeriodFromMinutes(e) {
1480
+ let s, l;
1481
+ e >= 43200 ? (s = Math.floor(e / 43200), l = "month") : e >= 10080 ? (s = Math.floor(e / 10080), l = "week") : e >= 1440 ? (s = Math.floor(e / 1440), l = "day") : e >= 60 ? (s = Math.floor(e / 60), l = "hour") : (s = e, l = "minute"), this.selectedNumber = s, this.selectedPeriod = l;
1482
+ }
1483
+ render() {
1484
+ return i(x, { key: "d2eb0d080d1ce4645a642a4f5d55270ed170e882" }, i("div", { key: "2743c3c781ad47c9d0d53fdad2773f45d172e1f4", class: "nylas-min-cancellation-notice", part: "nmcn" }, i("label", { key: "457729b50558651645ecb10398586af1078cfd34" }, "Minimum cancellation notice", i("span", { key: "00b310035def5b8bbc183fa03d2bcb37d7c04b42", class: "label-icon" }, i("tooltip-component", { key: "27c7695f6302e2d043899656f15a70846c2858e2" }, i("info-icon", { key: "10f878cb410cc284e86890a0d6047c27bdc7f455", slot: "tooltip-icon" }), i("span", { key: "e853afaa116b43371d01fcb3b801e622902e22cd", slot: "tooltip-content" }, "Set the minimum amount of time required to cancel an event.")))), i("time-period-selector", { key: "8bb3955f8cce7661e213fbf2c107f8326937b467", id: "min-cancellation-notice", exportparts: "tps__number-dropdown: nmcn__number-dropdown, tps__number-dropdown-button: nmcn__number-dropdown-button, tps__number-dropdown-content: nmcn__number-dropdown-content, tps__period-dropdown: nmcn__period-dropdown, tps__period-dropdown-button: nmcn__period-dropdown-button, tps__period-dropdown-content: nmcn__period-dropdown-content", timePeriods: ["minute", "hour", "day", "week"], defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod })));
1485
+ }
1486
+ static get formAssociated() {
1487
+ return !0;
1488
+ }
1489
+ get host() {
1490
+ return _(this);
1491
+ }
1492
+ static get watchers() {
1493
+ return {
1494
+ name: ["elementNameChangedHandler"],
1495
+ selectedConfiguration: ["selectedConfigurationChangedHandler"],
1496
+ availableDaysInFuture: ["availableDaysInFutureChanged"]
1497
+ };
1498
+ }
1499
+ };
1500
+ en([
1501
+ C({
1502
+ name: "nylas-min-cancellation-notice",
1503
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
1504
+ eventToProps: {},
1505
+ fireRegisterEvent: !0
1506
+ }),
1507
+ ye("design:type", Function),
1508
+ ye("design:paramtypes", []),
1509
+ ye("design:returntype", void 0)
1510
+ ], Me.prototype, "render", null);
1511
+ Me.style = Qt;
1512
+ var Ne = { exports: {} };
1513
+ (function(e, t) {
1514
+ (function(n, a) {
1515
+ e.exports = a();
1516
+ })(Ue, function() {
1517
+ var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, a = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, o = /\d\d/, s = /\d\d?/, l = /\d*[^-_:/,()\s\d]+/, r = {}, u = function(c) {
1518
+ return (c = +c) + (c > 68 ? 1900 : 2e3);
1519
+ }, f = function(c) {
1520
+ return function(b) {
1521
+ this[c] = +b;
1522
+ };
1523
+ }, p = [/[+-]\d\d:?(\d\d)?|Z/, function(c) {
1524
+ (this.zone || (this.zone = {})).offset = function(b) {
1525
+ if (!b || b === "Z")
1526
+ return 0;
1527
+ var m = b.match(/([+-]|\d\d)/g), g = 60 * m[1] + (+m[2] || 0);
1528
+ return g === 0 ? 0 : m[0] === "+" ? -g : g;
1529
+ }(c);
1530
+ }], h = function(c) {
1531
+ var b = r[c];
1532
+ return b && (b.indexOf ? b : b.s.concat(b.f));
1533
+ }, v = function(c, b) {
1534
+ var m, g = r.meridiem;
1535
+ if (g) {
1536
+ for (var D = 1; D <= 24; D += 1)
1537
+ if (c.indexOf(g(D, 0, b)) > -1) {
1538
+ m = D > 12;
1539
+ break;
1540
+ }
1541
+ } else
1542
+ m = c === (b ? "pm" : "PM");
1543
+ return m;
1544
+ }, O = { A: [l, function(c) {
1545
+ this.afternoon = v(c, !1);
1546
+ }], a: [l, function(c) {
1547
+ this.afternoon = v(c, !0);
1548
+ }], S: [/\d/, function(c) {
1549
+ this.milliseconds = 100 * +c;
1550
+ }], SS: [o, function(c) {
1551
+ this.milliseconds = 10 * +c;
1552
+ }], SSS: [/\d{3}/, function(c) {
1553
+ this.milliseconds = +c;
1554
+ }], s: [s, f("seconds")], ss: [s, f("seconds")], m: [s, f("minutes")], mm: [s, f("minutes")], H: [s, f("hours")], h: [s, f("hours")], HH: [s, f("hours")], hh: [s, f("hours")], D: [s, f("day")], DD: [o, f("day")], Do: [l, function(c) {
1555
+ var b = r.ordinal, m = c.match(/\d+/);
1556
+ if (this.day = m[0], b)
1557
+ for (var g = 1; g <= 31; g += 1)
1558
+ b(g).replace(/\[|\]/g, "") === c && (this.day = g);
1559
+ }], M: [s, f("month")], MM: [o, f("month")], MMM: [l, function(c) {
1560
+ var b = h("months"), m = (h("monthsShort") || b.map(function(g) {
1561
+ return g.slice(0, 3);
1562
+ })).indexOf(c) + 1;
1563
+ if (m < 1)
1564
+ throw new Error();
1565
+ this.month = m % 12 || m;
1566
+ }], MMMM: [l, function(c) {
1567
+ var b = h("months").indexOf(c) + 1;
1568
+ if (b < 1)
1569
+ throw new Error();
1570
+ this.month = b % 12 || b;
1571
+ }], Y: [/[+-]?\d+/, f("year")], YY: [o, function(c) {
1572
+ this.year = u(c);
1573
+ }], YYYY: [/\d{4}/, f("year")], Z: p, ZZ: p };
1574
+ function k(c) {
1575
+ var b, m;
1576
+ b = c, m = r && r.formats;
1577
+ for (var g = (c = b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(R, H, S) {
1578
+ var T = S && S.toUpperCase();
1579
+ return H || m[S] || n[S] || m[T].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(A, F, P) {
1580
+ return F || P.slice(1);
1581
+ });
1582
+ })).match(a), D = g.length, I = 0; I < D; I += 1) {
1583
+ var Y = g[I], N = O[Y], $ = N && N[0], L = N && N[1];
1584
+ g[I] = L ? { regex: $, parser: L } : Y.replace(/^\[|\]$/g, "");
1585
+ }
1586
+ return function(R) {
1587
+ for (var H = {}, S = 0, T = 0; S < D; S += 1) {
1588
+ var A = g[S];
1589
+ if (typeof A == "string")
1590
+ T += A.length;
1591
+ else {
1592
+ var F = A.regex, P = A.parser, K = R.slice(T), B = F.exec(K)[0];
1593
+ P.call(H, B), R = R.replace(B, "");
1594
+ }
1595
+ }
1596
+ return function(z) {
1597
+ var E = z.afternoon;
1598
+ if (E !== void 0) {
1599
+ var j = z.hours;
1600
+ E ? j < 12 && (z.hours += 12) : j === 12 && (z.hours = 0), delete z.afternoon;
1601
+ }
1602
+ }(H), H;
1603
+ };
1604
+ }
1605
+ return function(c, b, m) {
1606
+ m.p.customParseFormat = !0, c && c.parseTwoDigitYear && (u = c.parseTwoDigitYear);
1607
+ var g = b.prototype, D = g.parse;
1608
+ g.parse = function(I) {
1609
+ var Y = I.date, N = I.utc, $ = I.args;
1610
+ this.$u = N;
1611
+ var L = $[1];
1612
+ if (typeof L == "string") {
1613
+ var R = $[2] === !0, H = $[3] === !0, S = R || H, T = $[2];
1614
+ H && (T = $[2]), r = this.$locale(), !R && T && (r = m.Ls[T]), this.$d = function(K, B, z) {
1615
+ try {
1616
+ if (["x", "X"].indexOf(B) > -1)
1617
+ return new Date((B === "X" ? 1e3 : 1) * K);
1618
+ var E = k(B)(K), j = E.year, V = E.month, Re = E.day, Pe = E.hours, ze = E.minutes, Be = E.seconds, je = E.milliseconds, ge = E.zone, J = /* @__PURE__ */ new Date(), G = Re || (j || V ? 1 : J.getDate()), X = j || J.getFullYear(), q = 0;
1619
+ j && !V || (q = V > 0 ? V - 1 : J.getMonth());
1620
+ var Q = Pe || 0, ee = ze || 0, te = Be || 0, ne = je || 0;
1621
+ return ge ? new Date(Date.UTC(X, q, G, Q, ee, te, ne + 60 * ge.offset * 1e3)) : z ? new Date(Date.UTC(X, q, G, Q, ee, te, ne)) : new Date(X, q, G, Q, ee, te, ne);
1622
+ } catch {
1623
+ return /* @__PURE__ */ new Date("");
1624
+ }
1625
+ }(Y, L, N), this.init(), T && T !== !0 && (this.$L = this.locale(T).$L), S && Y != this.format(L) && (this.$d = /* @__PURE__ */ new Date("")), r = {};
1626
+ } else if (L instanceof Array)
1627
+ for (var A = L.length, F = 1; F <= A; F += 1) {
1628
+ $[1] = L[F - 1];
1629
+ var P = m.apply(this, $);
1630
+ if (P.isValid()) {
1631
+ this.$d = P.$d, this.$L = P.$L, this.init();
1632
+ break;
1633
+ }
1634
+ F === A && (this.$d = /* @__PURE__ */ new Date(""));
1635
+ }
1636
+ else
1637
+ D.call(this, I);
1638
+ };
1639
+ };
1640
+ });
1641
+ })(Ne);
1642
+ const tn = Ne.exports, nn = ':host{display:block;position:relative;--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}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}', an = nn;
1643
+ Z.extend(tn);
1644
+ const sn = class {
1645
+ constructor(e) {
1646
+ y(this, e), this.timeChange = w(this, "timeChange", 7), this.time = void 0, this.minimumStartTime = null, this.placeholder = "hh:mmam/pm", this.setTime = void 0, this.name = void 0, this.hasError = !1, this.setFormError = void 0, this.err = "", this.showTimes = !1, this.ariaActivedescendant = "", this.times = this.generateTimes(), this.shouldAutoScroll = !1;
1647
+ }
1648
+ handleOutsideClick(e) {
1649
+ !e.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
1650
+ }
1651
+ minimumStartTimeChangedHandler() {
1652
+ if (this.minimumStartTime) {
1653
+ let e = Z().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4, -2)));
1654
+ this.minimumStartTime.slice(-2).toLowerCase() === "pm" && parseInt(this.minimumStartTime) !== 12 ? e = e.add(12, "hour") : this.minimumStartTime.slice(-2).toLowerCase() === "am" && parseInt(this.minimumStartTime) === 12 && (e = e.subtract(12, "hour")), this.times = this.generateTimes();
1655
+ const t = Z(this.times[0].value, "hh:mma");
1656
+ Z(this.time, "hh:mma").isBefore(t) && (this.err = "Invalid", this.setFormError(null, "Invalid"));
1657
+ }
1658
+ }
1659
+ componentDidRender() {
1660
+ if (this.showTimes && this.shouldAutoScroll) {
1661
+ const e = ae(this.time), t = this.times.findIndex((n) => n.value === e);
1662
+ t > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(t));
1663
+ return;
1664
+ }
1665
+ }
1666
+ handleTimeChange(e, t) {
1667
+ const n = t.split(":");
1668
+ n[0] === "00" && n[1].slice(-2) == "pm" && (this.err = "Invalid", this.setFormError(e, "Invalid")), ie(t) ? (this.err = "", this.setFormError(null)) : (this.err = "Invalid", this.setFormError(e, "Invalid")), this.setTime(e, t), this.timeChange.emit(t);
1669
+ }
1670
+ handleTimeAutocomplete(e) {
1671
+ var n;
1672
+ const t = (n = e.target) == null ? void 0 : n.value;
1673
+ if (!ie(t)) {
1674
+ this.err = "Invalid", this.setFormError(e, "Invalid");
1675
+ return;
1676
+ }
1677
+ if (t === "") {
1678
+ const a = ke().format("hh:mma");
1679
+ this.setTime(e, a);
1680
+ return;
1681
+ }
1682
+ if (!xe(t)) {
1683
+ const a = ae(t);
1684
+ this.setTime(a);
1685
+ return;
1686
+ }
1687
+ this.setTime(e, t);
1688
+ }
1689
+ handleOnInput(e) {
1690
+ var n;
1691
+ const t = (n = e.target) == null ? void 0 : n.value;
1692
+ if (ie(t)) {
1693
+ if (t === "") {
1694
+ const a = ke().format("hh:mma"), o = this.times.findIndex((s) => s.value === a);
1695
+ o > -1 && this.scrollToViewWithinParent(o);
1696
+ return;
1697
+ }
1698
+ if (!xe(t)) {
1699
+ const a = ae(t), o = this.times.findIndex((s) => s.value === a);
1700
+ o > -1 && this.scrollToViewWithinParent(o);
1701
+ return;
1702
+ }
1703
+ }
1704
+ }
1705
+ generateTimes() {
1706
+ const e = [];
1707
+ let t = Z().set("hour", 0).set("minute", 0).set("second", 0);
1708
+ this.minimumStartTime && (t = Z(this.minimumStartTime, "hh:mma"));
1709
+ const n = t.endOf("day").diff(t, "minutes"), a = Math.round(n / 15);
1710
+ for (let o = 0; o < a + 1; o++) {
1711
+ const s = t.add(o * 15, "minute");
1712
+ if (o == a && s.format("hh:mma").includes("am"))
1713
+ break;
1714
+ e.push({ id: o, value: s.format("hh:mma") });
1715
+ }
1716
+ return e;
1717
+ }
1718
+ handleComboboxKeyDown(e) {
1719
+ if (e.key === "ArrowDown") {
1720
+ if (e.preventDefault(), !this.showTimes) {
1721
+ this.showTimes = !0, this.shouldAutoScroll = !0;
1722
+ return;
1723
+ }
1724
+ if (this.ariaActivedescendant === "")
1725
+ this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
1726
+ else {
1727
+ const t = this.times.findIndex((a) => a.id.toString() === this.ariaActivedescendant), n = t + 1 < this.times.length ? t + 1 : 0;
1728
+ this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
1729
+ }
1730
+ } else if (e.key === "ArrowUp")
1731
+ if (e.preventDefault(), this.ariaActivedescendant === "")
1732
+ this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
1733
+ else {
1734
+ const t = this.times.findIndex((a) => a.id.toString() === this.ariaActivedescendant), n = t - 1 >= 0 ? t - 1 : this.times.length - 1;
1735
+ this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
1736
+ }
1737
+ else
1738
+ e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
1739
+ }
1740
+ handleListboxKeydown(e) {
1741
+ const t = this.times, n = t.findIndex((a) => a.id.toString() === this.ariaActivedescendant);
1742
+ if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
1743
+ e.preventDefault();
1744
+ const a = n + 1 < t.length ? n + 1 : 0;
1745
+ this.ariaActivedescendant = t[a].id.toString(), this.focusOption(a);
1746
+ } else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
1747
+ e.preventDefault();
1748
+ const a = n - 1 >= 0 ? n - 1 : t.length - 1;
1749
+ this.ariaActivedescendant = t[a].id.toString(), this.focusOption(a);
1750
+ } else if (e.key === "Enter") {
1751
+ if (e.preventDefault(), this.ariaActivedescendant) {
1752
+ const a = t[n];
1753
+ this.handleTimeChange(e, a.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
1754
+ }
1755
+ } else
1756
+ e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
1757
+ }
1758
+ scrollToViewWithinParent(e) {
1759
+ var l;
1760
+ const t = this.times[e], n = (l = this.el.shadowRoot) == null ? void 0 : l.getElementById(t.id.toString()), a = this.timeMenu;
1761
+ this.ariaActivedescendant = t.id.toString();
1762
+ const o = n.getBoundingClientRect(), s = a.getBoundingClientRect();
1763
+ o.top < s.top ? a.scrollTop -= s.top - o.top : o.bottom > s.bottom && (a.scrollTop += o.bottom - s.bottom), o.left < s.left ? a.scrollLeft -= s.left - o.left : o.right > s.right && (a.scrollLeft += o.right - s.right);
1764
+ }
1765
+ focusOption(e) {
1766
+ var o;
1767
+ const t = this.times[e];
1768
+ if (!t)
1769
+ return;
1770
+ const n = t.id.toString(), a = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
1771
+ a && (a.focus(), a.scrollIntoView({ behavior: "smooth", block: "nearest" }));
1772
+ }
1773
+ render() {
1774
+ return i(x, { key: "fe86daaa8256c8fb59ffe2dfcbf50220f3a7b746" }, i("div", { key: "8cffe49df87c5bf2b73cef66236c806b47d623d4", class: "time-picker", part: "time-picker" }, i("input", { key: "6f735244c63287b0ec0668b688bbb18bb405346b", type: "text", name: this.name, id: this.name, part: "time-input", class: {
1775
+ "time-input": !0,
1776
+ error: !!this.err || this.hasError
1777
+ }, ref: (e) => this.timeInput = e, value: this.time, onClick: () => {
1778
+ this.showTimes = !0, this.shouldAutoScroll = !0;
1779
+ }, "aria-haspopup": "listbox", "aria-label": this.name, "aria-expanded": this.showTimes ? "true" : "false", placeholder: this.placeholder, onKeyDown: (e) => this.handleComboboxKeyDown(e), onInput: (e) => this.handleOnInput(e), onBlur: (e) => this.handleTimeAutocomplete(e) }), this.err && i("div", { class: "invalid-time-icon" }), this.showTimes && i("div", { class: "times", part: "times", ref: (e) => this.timeMenu = e }, i("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.times.map((e) => i("li", { tabindex: "0", key: e.id, id: e.id.toString(), class: {
1780
+ focused: this.ariaActivedescendant === e.id.toString()
1781
+ }, onClick: (t) => {
1782
+ this.handleTimeChange(t, e.value), this.showTimes = !1, this.timeInput.focus();
1783
+ }, role: "option" }, `${e.value}`)))), !this.showTimes && this.err && i("p", { class: "error", id: "email-error" }, this.err)));
1784
+ }
1785
+ get el() {
1786
+ return _(this);
1787
+ }
1788
+ static get watchers() {
1789
+ return {
1790
+ minimumStartTime: ["minimumStartTimeChangedHandler"]
1791
+ };
1792
+ }
1793
+ };
1794
+ sn.style = an;
1795
+ export {
1796
+ Ve as add_circle_icon,
1797
+ Ge as button_component,
1798
+ et as calendar_info_icon,
1799
+ at as calendar_patterns_icon,
1800
+ ot as flow_icon,
1801
+ dt as location_icon,
1802
+ pt as location_off_icon,
1803
+ ht as multi_select_dropdown,
1804
+ Ce as nylas_availability_picker,
1805
+ Te as nylas_booking_calendar_picker,
1806
+ Ee as nylas_buffer_time,
1807
+ Oe as nylas_calendar_picker,
1808
+ Se as nylas_custom_booking_flow,
1809
+ De as nylas_event_description,
1810
+ Ie as nylas_event_duration,
1811
+ $e as nylas_event_info,
1812
+ Le as nylas_event_limits,
1813
+ He as nylas_event_title,
1814
+ Ae as nylas_limit_future_bookings,
1815
+ Fe as nylas_location_component,
1816
+ Me as nylas_min_cancellation_notice,
1817
+ sn as nylas_time_window_picker
1818
+ };