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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/add-circle-icon_22.entry-8d0ac489.cjs +1 -0
  2. package/dist/add-circle-icon_22.entry-da31fa71.js +1733 -0
  3. package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-7aad8104.cjs} +1 -1
  4. package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-bc2418f7.js} +20 -20
  5. package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-6eba68a9.cjs} +1 -1
  6. package/dist/arrow-icon.entry-9a932082.js +15 -0
  7. package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-5f7e3755.js} +4 -4
  8. package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-db17d481.cjs} +1 -1
  9. package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-1ff7845a.js} +4 -4
  10. package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-a5141f82.cjs} +1 -1
  11. package/dist/calendar-check-icon_2.entry-c3add652.cjs +1 -0
  12. package/dist/calendar-check-icon_2.entry-d7421059.js +25 -0
  13. package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-4458997f.js} +2 -2
  14. package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-445d624a.cjs} +1 -1
  15. package/dist/chevron-icon_3.entry-8961e6bb.cjs +1 -0
  16. package/dist/chevron-icon_3.entry-f7f3d487.js +117 -0
  17. package/dist/close-icon.entry-6dd5ff0a.js +15 -0
  18. package/dist/close-icon.entry-ebc527c5.cjs +1 -0
  19. package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-6ee60d6d-4cd16450.js} +1656 -2374
  20. package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-6ee60d6d-6c0540db.cjs} +6 -6
  21. package/dist/document-refresh-icon.entry-298b2133.cjs +1 -0
  22. package/dist/document-refresh-icon.entry-bdc323b5.js +15 -0
  23. package/dist/elements/index.d.ts +31 -2
  24. package/dist/{forward-icon_6.entry-3345af84.cjs → forward-icon_6.entry-15208ea9.cjs} +3 -3
  25. package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-62759373.js} +127 -127
  26. package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-9e082178.js} +4 -4
  27. package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-c8302bf5.cjs} +1 -1
  28. package/dist/google-logo-icon_3.entry-0c095209.js +258 -0
  29. package/dist/google-logo-icon_3.entry-f8433ff9.cjs +1 -0
  30. package/dist/index-0f3bd8df.js +1824 -0
  31. package/dist/index-7a55dc33.cjs +30 -0
  32. package/dist/index.d.ts +3 -1
  33. package/dist/index.es-2578c6a5-098d48d0.cjs +7 -0
  34. package/dist/{index-b30d446a-a90f84b2.js → index.es-2578c6a5-71441142.js} +833 -933
  35. package/dist/info-icon_2.entry-73106882.js +34 -0
  36. package/dist/info-icon_2.entry-ca224a3b.cjs +1 -0
  37. package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-012644b7.js} +4 -4
  38. package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-f9f5e66f.cjs} +1 -1
  39. package/dist/mailbox-store-bb21512c-045c3ea0.cjs +1 -0
  40. package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-bb21512c-615660ef.js} +17 -16
  41. package/dist/nylas-additional-participants.entry-a50ef8e2.cjs +1 -0
  42. package/dist/nylas-additional-participants.entry-db85836a.js +83 -0
  43. package/dist/nylas-booked-event-card_10.entry-b49b2369.js +784 -0
  44. package/dist/nylas-booked-event-card_10.entry-fccb783c.cjs +1 -0
  45. package/dist/nylas-form-card.entry-090a4d3b.js +56 -0
  46. package/dist/nylas-form-card.entry-f5230005.cjs +1 -0
  47. package/dist/nylas-if-state.entry-7924dde0.js +96 -0
  48. package/dist/nylas-if-state.entry-ff9c9a85.cjs +1 -0
  49. package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-9dd96530.js} +9 -8
  50. package/dist/nylas-list-folders.entry-dbfc2cf8.cjs +1 -0
  51. package/dist/nylas-list-threads.entry-6bcc0328.cjs +1 -0
  52. package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-b435eaae.js} +5 -4
  53. package/dist/nylas-login.entry-1623d309.cjs +1 -0
  54. package/dist/nylas-login.entry-97350c76.js +75 -0
  55. package/dist/nylas-mailbox-pagination.entry-1776eb16.cjs +1 -0
  56. package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-ceef8be2.js} +4 -3
  57. package/dist/nylas-mailbox-toolbar-button.entry-7d3f79b9.cjs +1 -0
  58. package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-e6b3d3a4.js} +11 -10
  59. package/dist/nylas-mailbox.entry-06d8014a.js +136 -0
  60. package/dist/nylas-mailbox.entry-ae8da6ff.cjs +1 -0
  61. package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-8b9c2b69.js} +46 -33
  62. package/dist/nylas-provider.entry-97c9e272.cjs +1 -0
  63. package/dist/nylas-scheduler-editor.entry-c3791787.js +2181 -0
  64. package/dist/nylas-scheduler-editor.entry-f6cf1cd9.cjs +7 -0
  65. package/dist/nylas-scheduling.entry-08ae840a.cjs +1 -0
  66. package/dist/nylas-scheduling.entry-6380509a.js +237 -0
  67. package/dist/nylas-threads-refresh.entry-246e6d77.cjs +1 -0
  68. package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-eaee86fb.js} +6 -5
  69. package/dist/nylas-threads-search.entry-42a2acb1.cjs +1 -0
  70. package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-7e12758e.js} +15 -14
  71. package/dist/nylas-view-thread.entry-78e6927a.cjs +1 -0
  72. package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-b936e76a.js} +5 -4
  73. package/dist/people-icon.entry-5c8ee696.js +15 -0
  74. package/dist/people-icon.entry-bcf848c0.cjs +1 -0
  75. package/dist/play-icon_2.entry-356e63cc.js +25 -0
  76. package/dist/play-icon_2.entry-92e78f1b.cjs +1 -0
  77. package/dist/react.cjs +1 -1
  78. package/dist/react.js +92 -61
  79. package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-77f0c377.js} +2 -2
  80. package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-bec053b6.cjs} +1 -1
  81. package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-dc659dc3-0fdb18dc.js} +2 -2
  82. package/dist/{register-component-152c6ad2-0df7215b.cjs → register-component-dc659dc3-f58bf25b.cjs} +1 -1
  83. package/dist/scheduler-config-store-51ee4f42-ce3a9b0e.cjs +1 -0
  84. package/dist/scheduler-config-store-51ee4f42-e02895da.js +14 -0
  85. package/dist/{scheduler-store-7d48e682-0c0c3991.js → scheduler-store-72116723-3ba2480c.js} +100 -95
  86. package/dist/scheduler-store-72116723-db9d91f6.cjs +1 -0
  87. package/dist/time-period-selector.entry-decd251b.js +78 -0
  88. package/dist/time-period-selector.entry-f25fad77.cjs +1 -0
  89. package/dist/translate-icon.entry-cac02c46.js +15 -0
  90. package/dist/translate-icon.entry-dd5b707c.cjs +1 -0
  91. package/dist/utils-c00bdc3c-89ab163d.js +2111 -0
  92. package/dist/utils-c00bdc3c-94b9c3b6.cjs +8 -0
  93. package/dist/warning-icon.entry-370b9cf0.js +15 -0
  94. package/dist/warning-icon.entry-8af8a742.cjs +1 -0
  95. package/package.json +7 -4
  96. package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
  97. package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
  98. package/dist/arrow-icon.entry-8b2e96a6.js +0 -15
  99. package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
  100. package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
  101. package/dist/chevron-icon.entry-58366662.cjs +0 -1
  102. package/dist/chevron-icon.entry-5e11cef5.js +0 -15
  103. package/dist/close-icon_2.entry-011d9cf4.js +0 -25
  104. package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
  105. package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
  106. package/dist/document-refresh-icon.entry-9083a2e9.js +0 -15
  107. package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
  108. package/dist/duration-bddc4a13-179ce826.js +0 -41
  109. package/dist/index-3b6f5cd5.cjs +0 -30
  110. package/dist/index-630f4e87.js +0 -1498
  111. package/dist/index-b30d446a-cbbef925.cjs +0 -7
  112. package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
  113. package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
  114. package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
  115. package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
  116. package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
  117. package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
  118. package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
  119. package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
  120. package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
  121. package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
  122. package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
  123. package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
  124. package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
  125. package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
  126. package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
  127. package/dist/play-icon_2.entry-ed5877e3.js +0 -25
  128. package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
  129. package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
  130. package/dist/search-icon_3.entry-292138c3.js +0 -101
  131. package/dist/search-icon_3.entry-8e555357.cjs +0 -1
  132. package/dist/utils-5074a070-ce33ee6b.js +0 -119
  133. package/dist/utils-5074a070-d5ba6add.cjs +0 -2
@@ -0,0 +1,1733 @@
1
+ import { r as y, h as a, c as w, H as k, g as x } from "./index-0f3bd8df.js";
2
+ import { d, o as j, q as H, r as ve, s as V, v as ae, w as ie, x as ke, y as we, z as W, A as We } from "./utils-c00bdc3c-89ab163d.js";
3
+ import { R as _ } from "./register-component-dc659dc3-0fdb18dc.js";
4
+ import { T as xe, E as _e } from "./constants-6ee60d6d-4cd16450.js";
5
+ import { c as Ve } from "./_commonjsHelpers-57e89916-af061c86.js";
6
+ import "react";
7
+ import "react-dom";
8
+ const Ue = ".sc-add-circle-icon-h{display:flex}", Ze = Ue, Ye = class {
9
+ constructor(e) {
10
+ y(this, e), this.width = "24", this.height = "25";
11
+ }
12
+ render() {
13
+ return a("svg", { key: "f3782ba9b526dffdc7335be8e63861fd3b99588f", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "f882c2d15fc67cc99d93f748e2917eb7a675655d", 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" }));
14
+ }
15
+ };
16
+ Ye.style = Ze;
17
+ const Ke = "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}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}", qe = Ke, Je = class {
18
+ constructor(e) {
19
+ 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;
20
+ }
21
+ render() {
22
+ const e = `button-${this.variant}` + (this.disabled ? " disabled" : "");
23
+ return a("button", { key: "cfd8e89f59f914245d2c8c8c78476a36d27da859", class: e, disabled: this.disabled, type: "type", onClick: this.clickHandler, onMouseOver: this.mouseOverHandler, onMouseOut: this.mouseOutHandler, onFocus: this.focusHandler, onBlur: this.blurHandler }, a("slot", { key: "4535ee0ad60500247597e0bc127634b04dbe560e" }));
24
+ }
25
+ };
26
+ Je.style = qe;
27
+ const Ge = ".sc-calendar-info-icon-h{display:flex}", Xe = Ge, Qe = class {
28
+ constructor(e) {
29
+ y(this, e), this.width = "20", this.height = "20";
30
+ }
31
+ render() {
32
+ return a("svg", { key: "a81da147ac49427181db4dddb65aec3a24224ef7", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "95ead56b8fdb4b038cc1811615ffb5117f146920", 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" }));
33
+ }
34
+ };
35
+ Qe.style = Xe;
36
+ const et = ".sc-calendar-patterns-icon-h{display:flex}", tt = et, nt = class {
37
+ constructor(e) {
38
+ y(this, e), this.width = "20", this.height = "20";
39
+ }
40
+ render() {
41
+ return a("svg", { key: "240e5d737e5c6e987cae5c658dfbb6f60eec94c9", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "7247ab8bb25c0b25173b6acf384866da1a07b59b", 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" }));
42
+ }
43
+ };
44
+ nt.style = tt;
45
+ const at = ".sc-flow-icon-h{display:flex}", it = at, st = class {
46
+ constructor(e) {
47
+ y(this, e), this.width = "16", this.height = "12";
48
+ }
49
+ render() {
50
+ return a("svg", { key: "64cf30f0de8e94ba60072d0b1b36caa28b5123fa", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "5af4e418bffe3e59f56d8a9831b3b80b8e45248f", 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" }));
51
+ }
52
+ };
53
+ st.style = it;
54
+ const ot = ".sc-location-icon-h{display:flex}", lt = ot, rt = class {
55
+ constructor(e) {
56
+ y(this, e), this.width = "16", this.height = "18";
57
+ }
58
+ render() {
59
+ return a("svg", { key: "99aeec9d05c84b5b625d6dde77e639b66da0ba74", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "20ab637f3fb7ba64b1bf145f6a8308632d6ceaa4", 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" }));
60
+ }
61
+ };
62
+ rt.style = lt;
63
+ const dt = ".sc-location-off-icon-h{display:flex}", ct = dt, ft = class {
64
+ constructor(e) {
65
+ y(this, e), this.width = "16", this.height = "18";
66
+ }
67
+ render() {
68
+ return a("svg", { key: "6ff327f807c0b46549b39b02a5f04e46bdfddfdc", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "4802054ea26248eaf04c81ed9eeaca8c7535c4bf", 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" }));
69
+ }
70
+ };
71
+ ft.style = ct;
72
+ const pt = ':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)}', bt = pt, ut = class {
73
+ constructor(e) {
74
+ 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;
75
+ }
76
+ componentDidRender() {
77
+ d("multi-select-dropdown", "componentDidRender"), this.isOpen && this.shouldFocusFirstOption && (this.ariaActivedescendant = this.availableOptions[0].value, this.focusOption(0), this.shouldFocusFirstOption = !1);
78
+ }
79
+ handleOutsideClick(e) {
80
+ !e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
81
+ }
82
+ selectOption(e) {
83
+ this.availableOptions = this.availableOptions.map((n) => (n.value === e.value && (n.selected = !e.selected), n));
84
+ const t = this.availableOptions.filter((n) => n.selected).map((n) => n.value);
85
+ this.selectedOptionsChanged.emit({
86
+ value: t,
87
+ name: this.name
88
+ });
89
+ }
90
+ toggleDropdown() {
91
+ this.isOpen = !this.isOpen, this.isOpen ? this.shouldFocusFirstOption = !0 : this.ariaActivedescendant = "";
92
+ }
93
+ handleSelectButtonKeyDown(e) {
94
+ switch (e.key) {
95
+ case "ArrowDown":
96
+ case "Enter":
97
+ e.preventDefault(), this.isOpen || this.toggleDropdown();
98
+ break;
99
+ case "Escape":
100
+ this.isOpen = !1;
101
+ break;
102
+ }
103
+ }
104
+ handleListboxKeydown(e) {
105
+ const t = this.availableOptions, n = t.findIndex((s) => s.value === this.ariaActivedescendant);
106
+ switch (e.key) {
107
+ case "ArrowDown":
108
+ case "Tab":
109
+ if (e.shiftKey) {
110
+ e.preventDefault();
111
+ const o = n - 1 >= 0 ? n - 1 : t.length - 1;
112
+ this.ariaActivedescendant = t[o].value, this.focusOption(o);
113
+ } else {
114
+ e.preventDefault();
115
+ const o = n + 1 < t.length ? n + 1 : 0;
116
+ this.ariaActivedescendant = t[o].value, this.focusOption(o);
117
+ }
118
+ break;
119
+ case "ArrowUp":
120
+ e.preventDefault();
121
+ const s = n - 1 >= 0 ? n - 1 : t.length - 1;
122
+ this.ariaActivedescendant = t[s].value, this.focusOption(s);
123
+ break;
124
+ case "Enter":
125
+ e.preventDefault(), this.ariaActivedescendant && this.selectOption(t[n]);
126
+ break;
127
+ case "Escape":
128
+ this.isOpen = !1;
129
+ break;
130
+ }
131
+ }
132
+ focusOption(e) {
133
+ var o;
134
+ const t = this.availableOptions[e];
135
+ if (!t)
136
+ return;
137
+ const n = t.value, s = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
138
+ s && (s.focus(), s.scrollIntoView({ behavior: "smooth", block: "nearest" }));
139
+ }
140
+ getSelectedOptions() {
141
+ return this.availableOptions.filter((e) => e.selected);
142
+ }
143
+ renderOption(e) {
144
+ return a("li", { key: e.value, id: e.value, role: "option", tabindex: "0", "aria-selected": e.selected ? "true" : "false", onClick: (t) => {
145
+ t.stopImmediatePropagation(), this.selectOption(e);
146
+ }, class: { selected: !!e.selected } }, a("label", { htmlFor: e.value }, a("input", { "aria-hidden": "true", id: e.value, type: "checkbox", checked: e.selected }), a("span", null, e.label)));
147
+ }
148
+ render() {
149
+ var e, t;
150
+ return a(k, { key: "1cd6593ab9c3fba5bd85b4c6c3b72b5c02d56a06" }, a("div", { key: "4824791de73b31be01c7801569564c8444e14d25", class: "dropdown", part: "msd_dropdown" }, a("label", { key: "9cfb0b87aa5f514d2030ddb0b7f3a53d49ed623a", class: "dropdown-label" }, this.label, a("slot", { key: "e3e3db4816a4599b82ad9802b50540e4d5029ffe", name: "label-icon", "aria-hidden": "true" })), a("button", { key: "b00feb7b276c455987f5e9d957eecb88ba3bc65e", 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) }, a("slot", { key: "e0abc205d785aaada5884a21e0b94f02828ba09c", name: "select-icon", "aria-hidden": "true" }), a("span", { key: "9c69fcf904171f8cd7129dcf65d00e4ac2e72c4a", 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)), a("span", { key: "71f33e2a554531bb2cb498f857157bdaa28facea", class: this.isOpen ? "open" : "closed", "aria-hidden": "true" }, a("chevron-icon", { key: "0f418f723c61306bfa1efb8a5934957d211f3fce", width: "16", height: "16" }))), this.isOpen ? null : a("div", { class: "selected-options" }, this.getSelectedOptions().map((n) => a("span", { class: "selected-option" }, n.label, a("button", { key: n.label, onClick: () => this.selectOption(n) }, a("close-icon", null))))), this.isOpen ? a("div", { class: "dropdown-content", part: "msd_dropdown-content" }, a("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));
151
+ }
152
+ get el() {
153
+ return x(this);
154
+ }
155
+ };
156
+ ut.style = bt;
157
+ const ht = ':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)}', mt = ht;
158
+ var yt = function(e, t, n, s) {
159
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
160
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
161
+ i = Reflect.decorate(e, t, n, s);
162
+ else
163
+ for (var r = e.length - 1; r >= 0; r--)
164
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
165
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
166
+ }, se = function(e, t) {
167
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
168
+ return Reflect.metadata(e, t);
169
+ };
170
+ const Ce = class {
171
+ constructor(e) {
172
+ 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.openHours = void 0, this.name = "availability", this.defaultTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.schedule = {
173
+ SUN: [],
174
+ MON: [{ start: "09:00am", end: "05:00pm" }],
175
+ TUE: [{ start: "09:00am", end: "05:00pm" }],
176
+ WED: [{ start: "09:00am", end: "05:00pm" }],
177
+ THU: [{ start: "09:00am", end: "05:00pm" }],
178
+ FRI: [{ start: "09:00am", end: "05:00pm" }],
179
+ SAT: []
180
+ }, this.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.overlapDays = {};
181
+ }
182
+ elementNameChangedHandler(e) {
183
+ d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
184
+ }
185
+ scheduleChanged(e, t) {
186
+ var n;
187
+ if (e !== t) {
188
+ this.valueChanged.emit({
189
+ value: this.scheduleToOpenHours(e, this.timezone),
190
+ name: this.name
191
+ });
192
+ let s = {};
193
+ if (Object.keys(e).forEach((o) => {
194
+ const i = e[o];
195
+ if (i.length > 0) {
196
+ const l = this.getOverlaps(i);
197
+ l.length > 0 && (s[o] = l);
198
+ }
199
+ }), this.overlapDays = s, typeof this.internals.setFormValue != "function")
200
+ return;
201
+ if (Object.keys(s).length > 0) {
202
+ const o = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(Object.keys(s)[0]);
203
+ o && this.internals.setValidity({ customError: !0 }, "Overlapping time ranges found", o);
204
+ } else
205
+ this.internals.setValidity({ customError: !1 }), this.internals.setFormValue(JSON.stringify(this.scheduleToOpenHours(e, this.timezone)));
206
+ }
207
+ }
208
+ selectedOptionChangedHandler(e) {
209
+ const { name: t, value: n } = e.detail;
210
+ if (t === "timezone") {
211
+ if (this.timezone = n, typeof this.internals.setFormValue != "function")
212
+ return;
213
+ this.internals.setFormValue(JSON.stringify(this.scheduleToOpenHours(this.schedule, this.timezone)));
214
+ }
215
+ }
216
+ connectedCallback() {
217
+ d("nylas-availability-picker", "connectedCallback");
218
+ }
219
+ disconnectedCallback() {
220
+ d("nylas-availability-picker", "disconnectedCallback");
221
+ }
222
+ componentWillLoad() {
223
+ d("nylas-availability-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
224
+ }
225
+ componentDidLoad() {
226
+ d("nylas-availability-picker", "componentDidLoad"), this.openHours && this.openHours.length > 0 && this.updateSchedule(this.openHours), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(JSON.stringify(this.scheduleToOpenHours(this.schedule, this.timezone)));
227
+ }
228
+ getOverlaps(e) {
229
+ let t = e.map((s, o) => ({
230
+ start: j(s.start),
231
+ end: j(s.end),
232
+ originalIndex: o
233
+ }));
234
+ t.sort((s, o) => s.start - o.start);
235
+ let n = [];
236
+ for (let s = 1; s < t.length; s++)
237
+ t[s].start < t[s - 1].end && (n.includes(t[s].originalIndex) || n.push(t[s].originalIndex), n.includes(t[s - 1].originalIndex) || n.push(t[s - 1].originalIndex));
238
+ return n.sort((s, o) => s - o);
239
+ }
240
+ addTimeRange(e) {
241
+ const t = this.schedule[e], n = 0, s = 1425;
242
+ if (t.length === 0)
243
+ this.schedule[e] = [{ start: "09:00am", end: "05:00pm" }];
244
+ else {
245
+ const o = t.map((l) => ({
246
+ start: j(l.start),
247
+ end: j(l.end)
248
+ })).sort((l, r) => l.start - r.start), i = o[o.length - 1].end;
249
+ if (i + 60 <= s)
250
+ this.schedule[e].push({
251
+ start: H(W(i)),
252
+ end: H(W(i + 60))
253
+ });
254
+ else {
255
+ let l = !1;
256
+ if (o[0].start > n + 60 && (this.schedule[e].push({
257
+ start: H(W(n)),
258
+ end: H(W(n + 60))
259
+ }), l = !0), !l)
260
+ for (let r = 0; r < o.length - 1; r++) {
261
+ const b = o[r].end;
262
+ if (o[r + 1].start - b >= 60) {
263
+ this.schedule[e].push({
264
+ start: H(W(b)),
265
+ end: H(W(b + 60))
266
+ });
267
+ break;
268
+ }
269
+ }
270
+ }
271
+ }
272
+ this.schedule[e].sort((o, i) => j(o.start) - j(i.start)), this.schedule = { ...this.schedule };
273
+ }
274
+ removeTimeRange(e, t) {
275
+ this.schedule[e].splice(t, 1), this.schedule = { ...this.schedule };
276
+ }
277
+ setTime(e, t, n) {
278
+ const [s, o] = e.split("_"), [i, l] = s.split(":");
279
+ o === "start" ? this.schedule[i][l].start = n : o === "end" && (this.schedule[i][l].end = n), this.internals.setValidity({ customError: !1 }), this.schedule = { ...this.schedule };
280
+ }
281
+ setFormError(e, t, n) {
282
+ var l;
283
+ const [s, o] = e.split("_"), i = (l = this.host.shadowRoot) == null ? void 0 : l.getElementById(e);
284
+ i && this.internals.setValidity({ customError: !0 }, `Invalid ${o} time`, i);
285
+ }
286
+ updateSchedule(e) {
287
+ const t = {
288
+ SUN: [],
289
+ MON: [],
290
+ TUE: [],
291
+ WED: [],
292
+ THU: [],
293
+ FRI: [],
294
+ SAT: []
295
+ };
296
+ e.forEach((n) => {
297
+ n.days.forEach((s) => {
298
+ const o = this.getDayKey(s), i = H(n.start), l = H(n.end), r = { start: i, end: l };
299
+ let b = !1;
300
+ t[o] && (b = t[o].some((f) => f.start === r.start && f.end === r.end)), b || (t[o] ? t[o].push(r) : t[o] = [r]);
301
+ });
302
+ }), e.length === 0 && (this.timezone = e[0].timezone), this.timezone = e[0].timezone, this.schedule = t;
303
+ }
304
+ getDayKey(e) {
305
+ return ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"][e];
306
+ }
307
+ scheduleToOpenHours(e, t = "UTC") {
308
+ const n = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
309
+ let s = /* @__PURE__ */ new Map();
310
+ n.forEach((i, l) => {
311
+ e[i] && e[i].forEach((r) => {
312
+ const b = ve(r.start), f = ve(r.end), h = `${b}-${f}`;
313
+ if (!s.has(h))
314
+ s.set(h, { days: [l], start: b, end: f });
315
+ else {
316
+ let p = s.get(h);
317
+ p && (p.days.push(l), s.set(h, p));
318
+ }
319
+ });
320
+ });
321
+ let o = [];
322
+ return s.forEach((i, l) => {
323
+ o.push({
324
+ days: i.days,
325
+ start: i.start,
326
+ end: i.end,
327
+ timezone: t
328
+ });
329
+ }), o;
330
+ }
331
+ render() {
332
+ const e = Object.keys(xe).map((t) => ({
333
+ label: xe[t],
334
+ value: t
335
+ }));
336
+ return a(k, { key: "440dc2f314a9c47eb8186f4ed965ed3052301ddf" }, a("div", { key: "2d31ef10ae53275fc065f4e9f68c32f42b60d829", class: "nylas-availability-picker" }, a("div", { key: "aa6695b6054b81ece7ede5f5e089545a041800f6", class: "header", part: "nap__header" }, a("h3", { key: "86e0d18ca7b70d74159c5cead0d6f5a17a145fa7" }, "General availability"), a("p", { key: "05da67e03befbe936793af5ee98f801b512d28e7" }, "Set your availability for scheduling meetings.")), a("div", { key: "84c6bf714ccea4aff07d6e660d8ca3f96ce9a8cc", class: "content" }, a("div", { key: "16edf74e06bed5440df5f5ea73e90cfa83d08b29", class: "select-timezone", part: "nap__select-timezone" }, a("h4", { key: "1025677efcaf114cb86ce57324c299eeea79b37e", class: "sub-header" }, "Select timezone", a("span", { key: "6d65a6457da202c5a3d5c5cd4e185903a12cec7f", class: "icon" }, a("tooltip-component", { key: "61a40ea06c06f1d306a8b352d9ae883d09768249" }, a("info-icon", { key: "2d447cc2e6a619ee7b1cf1fd3e2b6424fcd6db5b", slot: "tooltip-icon" }), a("span", { key: "35742354ba0841bc1c17170094bab09d536208e6", slot: "tooltip-content" }, "Select your timezone for displaying availability.")))), a("select-dropdown", { key: "3532c95b077fc701cdbf89cd13668acc675cf0e4", 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) }, a("span", { key: "c1e870c593966e29d72c3f519f3309f84e4b9a9a", slot: "select-icon" }, a("globe-icon", { key: "df23e31168778926b6118651cd636ab801f062f1", width: "20", height: "20" })))), a("div", { key: "5ad8cf7078dc104d1258f77e1c69bebf8c82d8dd", class: "availability", part: "nap__availability" }, Object.keys(this.schedule).map((t) => {
337
+ const n = t, s = this.schedule[t];
338
+ return a("div", { class: "availability-day" }, a("div", { class: "day", part: "nap__day" }, a("input", { type: "checkbox", name: n, id: n, checked: s.length > 0, onClick: () => {
339
+ s.length > 0 ? this.schedule[n] = [] : this.schedule[n] = [{ start: "09:00am", end: "05:00pm" }], this.schedule = { ...this.schedule };
340
+ } }), a("label", { htmlFor: n, "aria-label": "Select day" }, n)), a("div", { class: "time-ranges", part: "nap__time-ranges" }, s.length ? null : a("span", { class: "unavailable" }, "Unavailable"), s.length > 0 && s.map((o, i) => {
341
+ var b, f;
342
+ const l = `${t}:${i}_start`, r = `${t}:${i}_end`;
343
+ return a("div", { class: "time-range", part: "nap__time-range" }, a("div", { class: "pickers" }, a("nylas-time-window-picker", { id: l, hasError: (b = this.overlapDays[n]) == null ? void 0 : b.includes(i), 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: (h, p) => this.setTime(l, h, p), setFormError: (h, p) => this.setFormError(l, h, p) }), a("span", null, " - "), a("nylas-time-window-picker", { id: r, hasError: (f = this.overlapDays[n]) == null ? void 0 : f.includes(i), 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: (h, p) => this.setTime(r, h, p), setFormError: (h, p) => this.setFormError(r, h, p) })), a("button", { onClick: () => this.removeTimeRange(n, i) }, a("close-icon", null)));
344
+ }), a("p", { class: "error" }, this.overlapDays[n] ? "Overlapping time ranges" : "")), a("div", null, s.length > 0 ? a("button", { onClick: () => this.addTimeRange(n), part: "nap__add-time-range" }, a("add-circle-icon", null)) : null));
345
+ })))));
346
+ }
347
+ static get formAssociated() {
348
+ return !0;
349
+ }
350
+ get host() {
351
+ return x(this);
352
+ }
353
+ static get watchers() {
354
+ return {
355
+ name: ["elementNameChangedHandler"],
356
+ schedule: ["scheduleChanged"]
357
+ };
358
+ }
359
+ };
360
+ yt([
361
+ _({
362
+ name: "nylas-availability-picker",
363
+ fireRegisterEvent: !0
364
+ }),
365
+ se("design:type", Function),
366
+ se("design:paramtypes", []),
367
+ se("design:returntype", void 0)
368
+ ], Ce.prototype, "render", null);
369
+ Ce.style = mt;
370
+ const gt = ':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}', vt = gt;
371
+ var kt = function(e, t, n, s) {
372
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
373
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
374
+ i = Reflect.decorate(e, t, n, s);
375
+ else
376
+ for (var r = e.length - 1; r >= 0; r--)
377
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
378
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
379
+ }, oe = function(e, t) {
380
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
381
+ return Reflect.metadata(e, t);
382
+ };
383
+ const Te = class {
384
+ constructor(e) {
385
+ 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.name = "calendar", this.defaultBookingCalendar = "", this.selectedCalendar = "";
386
+ }
387
+ connectedCallback() {
388
+ d("nylas-booking-calendar-picker", "connectedCallback");
389
+ }
390
+ disconnectedCallback() {
391
+ d("nylas-booking-calendar-picker", "disconnectedCallback");
392
+ }
393
+ componentWillLoad() {
394
+ d("nylas-booking-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
395
+ }
396
+ componentDidLoad() {
397
+ d("nylas-booking-calendar-picker", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultBookingCalendar.toString(), "booking-calendar"), this.selectedCalendar = this.defaultBookingCalendar;
398
+ }
399
+ componentWillUpdate() {
400
+ d("nylas-booking-calendar-picker", "componentWillUpdate");
401
+ }
402
+ componentDidUpdate() {
403
+ d("nylas-booking-calendar-picker", "componentDidUpdate");
404
+ }
405
+ componentWillRender() {
406
+ d("nylas-booking-calendar-picker", "componentWillRender");
407
+ }
408
+ componentDidRender() {
409
+ d("nylas-booking-calendar-picker", "componentDidRender");
410
+ }
411
+ elementNameChangedHandler(e) {
412
+ d("nylas-booking-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
413
+ }
414
+ selectedOptionChangedHandler(e) {
415
+ d("nylas-booking-calendar-picker", "selectedOptionChangedHandler", e.detail);
416
+ const t = (n) => {
417
+ const { value: s } = n.detail;
418
+ this.selectedCalendar = s, this.internals.setFormValue(s.toString(), "booking-calendar");
419
+ };
420
+ this.valueChanged.emit({ ...e.detail, valueChanged: t });
421
+ }
422
+ render() {
423
+ var t;
424
+ const e = ((t = this.calendars) == null ? void 0 : t.map((n) => ({
425
+ value: n.id,
426
+ label: n.name
427
+ }))) ?? [];
428
+ return a(k, null, a("div", { class: "nylas-booking-calendar-picker", part: "nbcp" }, a("div", { class: "header", part: "nbcp__header" }, a("h3", null, "Calendar booking"), a("p", null, "Choose calendar where you’d like the event bookings to show up.")), e.length > 0 ? a("div", { class: "nylas-booking-calendar-picker__dropdown" }, a("span", { class: "label", part: "nbcp__input-label" }, "Select a calendar to book meetings on", a("tooltip-component", null, a("info-icon", { slot: "tooltip-icon" }), a("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."))), a("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] })) : a("div", { class: "nylas-booking-calendar-picker__loading" }, a("span", { class: "label" }, "Select a calendar to book meetings on ", a("info-icon", null)), a("div", { class: "loading-button" }, a("span", null, "Loading...")))));
429
+ }
430
+ static get formAssociated() {
431
+ return !0;
432
+ }
433
+ get host() {
434
+ return x(this);
435
+ }
436
+ static get watchers() {
437
+ return {
438
+ name: ["elementNameChangedHandler"]
439
+ };
440
+ }
441
+ };
442
+ kt([
443
+ _({
444
+ name: "nylas-booking-calendar-picker",
445
+ eventToProps: {
446
+ valueChanged: async (e, t) => {
447
+ const { valueChanged: n } = e.detail;
448
+ n && n(e);
449
+ }
450
+ },
451
+ fireRegisterEvent: !0
452
+ }),
453
+ oe("design:type", Function),
454
+ oe("design:paramtypes", []),
455
+ oe("design:returntype", void 0)
456
+ ], Te.prototype, "render", null);
457
+ Te.style = vt;
458
+ 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}', xt = wt;
459
+ var _t = function(e, t, n, s) {
460
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
461
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
462
+ i = Reflect.decorate(e, t, n, s);
463
+ else
464
+ for (var r = e.length - 1; r >= 0; r--)
465
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
466
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
467
+ }, le = function(e, t) {
468
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
469
+ return Reflect.metadata(e, t);
470
+ };
471
+ const Oe = class {
472
+ constructor(e) {
473
+ 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;
474
+ }
475
+ connectedCallback() {
476
+ d("nylas-buffer-time", "connectedCallback");
477
+ }
478
+ disconnectedCallback() {
479
+ d("nylas-buffer-time", "disconnectedCallback");
480
+ }
481
+ componentWillLoad() {
482
+ d("nylas-buffer-time", "componentWillLoad"), this.host.setAttribute("name", this.name);
483
+ }
484
+ componentDidLoad() {
485
+ if (d("nylas-buffer-time", "componentDidLoad"), typeof this.internals.setFormValue == "function") {
486
+ const e = {
487
+ before: this.selectedBeforeBufferTime,
488
+ after: this.selectedAfterBufferTime
489
+ };
490
+ this.internals.setFormValue(JSON.stringify(e), this.name);
491
+ }
492
+ this.selectedAfterBufferTime = this.buffer.after, this.selectedBeforeBufferTime = this.buffer.before;
493
+ }
494
+ componentWillUpdate() {
495
+ d("nylas-buffer-time", "componentWillUpdate");
496
+ }
497
+ componentDidUpdate() {
498
+ d("nylas-buffer-time", "componentDidUpdate");
499
+ }
500
+ componentWillRender() {
501
+ d("nylas-buffer-time", "componentWillRender");
502
+ }
503
+ componentDidRender() {
504
+ d("nylas-buffer-time", "componentDidRender");
505
+ }
506
+ elementNameChangedHandler(e) {
507
+ d("nylas-buffer-time", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
508
+ }
509
+ selectedOptionChangedHandler(e) {
510
+ d("nylas-buffer-time", "selectedOptionChangedHandler", e.detail);
511
+ const t = (n) => {
512
+ const { value: s, name: o } = n.detail;
513
+ o === "before-buffer-time" ? this.selectedBeforeBufferTime = parseInt(s) : o === "after-buffer-time" && (this.selectedAfterBufferTime = parseInt(s));
514
+ const i = {
515
+ before: this.selectedBeforeBufferTime,
516
+ after: this.selectedAfterBufferTime
517
+ };
518
+ this.internals.setFormValue(JSON.stringify(i), "booking-calendar");
519
+ };
520
+ this.valueChanged.emit({ ...e.detail, valueChanged: t });
521
+ }
522
+ renderPreview() {
523
+ const s = (l) => {
524
+ const r = Math.floor(l / 30), b = l % 30 / 30 * 20;
525
+ return {
526
+ fullSlots: r,
527
+ partialFillHeight: b
528
+ };
529
+ }, o = () => {
530
+ const { fullSlots: l, partialFillHeight: r } = s(this.selectedBeforeBufferTime);
531
+ return Array.from({ length: 4 }, (b, f) => {
532
+ const h = this.selectedBeforeBufferTime > 0 && f > 4 - l - 1, p = this.selectedBeforeBufferTime > 0 && f === 4 - l - 1 && r > 0;
533
+ let v = {};
534
+ return h && !p ? v.backgroundColor = "var(--nylas-base-100)" : p && (v.background = `linear-gradient(to top, var(--nylas-base-100) ${r}px, transparent 0)`), a("div", { key: f, class: `slot ${h ? "active" : ""}`, style: {
535
+ height: "20px",
536
+ ...v
537
+ } });
538
+ });
539
+ }, i = () => {
540
+ const { fullSlots: l, partialFillHeight: r } = s(this.selectedAfterBufferTime);
541
+ return Array.from({ length: 4 }, (b, f) => {
542
+ const h = this.selectedAfterBufferTime > 0 && f < l, p = f === l && r > 0;
543
+ let v = {};
544
+ return h && !p ? v.backgroundColor = "var(--nylas-base-100)" : p && (v.background = `linear-gradient(to bottom, var(--nylas-base-100) ${r}px, transparent 0)`), a("div", { key: f, class: `slot ${h ? "active" : ""}`, style: {
545
+ height: "20px",
546
+ ...v
547
+ } });
548
+ });
549
+ };
550
+ return a("div", { class: "preview-container" }, o(), a("div", { class: "event-slot", style: { height: "40px" } }), i());
551
+ }
552
+ render() {
553
+ const e = Array.from({ length: 121 }, (t, n) => ({
554
+ label: n.toString(),
555
+ value: n
556
+ }));
557
+ return a(k, null, a("div", { class: "nylas-buffer-time", part: "nbt" }, a("div", { class: "header", part: "nbt__header" }, a("h3", null, "Buffer time"), a("p", null, "Add buffer time before and after the event.")), a("div", { class: "nylas-buffer-time__body", part: "nbt__body" }, a("div", { class: "nylas-buffer-time__dropdown" }, a("div", { class: "nylas-buffer-time__row" }, a("label", null, "Before the event"), a("div", { class: "dropdown-container" }, a("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] }), a("span", null, "mins"))), a("div", { class: "nylas-buffer-time__row" }, a("label", null, "After the event"), a("div", { class: "dropdown-container" }, a("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] }), a("span", null, "mins")))), a("div", { class: "nylas-buffer-time__preview", part: "nbt__preview" }, a("h4", null, "PREVIEW"), this.renderPreview()))));
558
+ }
559
+ static get formAssociated() {
560
+ return !0;
561
+ }
562
+ get host() {
563
+ return x(this);
564
+ }
565
+ static get watchers() {
566
+ return {
567
+ name: ["elementNameChangedHandler"]
568
+ };
569
+ }
570
+ };
571
+ _t([
572
+ _({
573
+ name: "nylas-buffer-time",
574
+ eventToProps: {
575
+ valueChanged: async (e, t) => {
576
+ const { valueChanged: n } = e.detail;
577
+ n && n(e);
578
+ }
579
+ },
580
+ fireRegisterEvent: !0
581
+ }),
582
+ le("design:type", Function),
583
+ le("design:paramtypes", []),
584
+ le("design:returntype", void 0)
585
+ ], Oe.prototype, "render", null);
586
+ Oe.style = xt;
587
+ const Ct = ':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}', Tt = Ct;
588
+ var Ot = function(e, t, n, s) {
589
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
590
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
591
+ i = Reflect.decorate(e, t, n, s);
592
+ else
593
+ for (var r = e.length - 1; r >= 0; r--)
594
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
595
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
596
+ }, re = function(e, t) {
597
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
598
+ return Reflect.metadata(e, t);
599
+ };
600
+ const De = class {
601
+ constructor(e) {
602
+ 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.organizerEmail = void 0, this.name = "calendar", this.defaultSelectedCalendars = [], this.selectedCalendars = [];
603
+ }
604
+ connectedCallback() {
605
+ d("nylas-calendar-picker", "connectedCallback");
606
+ }
607
+ disconnectedCallback() {
608
+ d("nylas-calendar-picker", "disconnectedCallback");
609
+ }
610
+ componentWillLoad() {
611
+ d("nylas-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
612
+ }
613
+ componentDidLoad() {
614
+ d("nylas-calendar-picker", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultSelectedCalendars.toString(), "calendar");
615
+ }
616
+ componentWillUpdate() {
617
+ d("nylas-calendar-picker", "componentWillUpdate");
618
+ }
619
+ componentDidUpdate() {
620
+ d("nylas-calendar-picker", "componentDidUpdate");
621
+ }
622
+ componentWillRender() {
623
+ d("nylas-calendar-picker", "componentWillRender");
624
+ }
625
+ componentDidRender() {
626
+ d("nylas-calendar-picker", "componentDidRender");
627
+ }
628
+ elementNameChangedHandler(e) {
629
+ d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
630
+ }
631
+ selectedOptionsChangedHandler(e) {
632
+ d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
633
+ const t = (n) => {
634
+ const { value: s } = n.detail;
635
+ this.selectedCalendars = [...s], this.internals.setFormValue(s.toString(), "calendar");
636
+ };
637
+ this.valueChanged.emit({ ...e.detail, name: this.name, valueChangedHandler: t });
638
+ }
639
+ render() {
640
+ var t;
641
+ const e = ((t = this.calendars) == null ? void 0 : t.map((n) => {
642
+ var s, o;
643
+ return {
644
+ value: n.id,
645
+ label: n.name,
646
+ selected: ((s = this.defaultSelectedCalendars) == null ? void 0 : s.includes(n.id)) || ((o = this.defaultSelectedCalendars) == null ? void 0 : o.includes("primary")) && n.id === this.organizerEmail
647
+ };
648
+ })) ?? [];
649
+ return a(k, null, a("div", { class: "nylas-calendar-picker", part: "ncp" }, a("div", { class: "header", part: "ncp__header" }, a("h3", null, "Calendar availability"), a("p", null, "Select calendars that you’d like to use for checking your availability.")), e.length > 0 ? a("div", { class: "nylas-calendar-picker__dropdown" }, a("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" }, a("span", { slot: "label-icon" }, a("tooltip-component", null, a("info-icon", { slot: "tooltip-icon" }), a("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."))))) : a("div", { class: "nylas-calendar-picker__loading" }, a("span", { class: "label" }, "Select calendars that will be checked for availability ", a("info-icon", null)), a("div", { class: "loading-button" }, a("span", null, "Loading...")))));
650
+ }
651
+ static get formAssociated() {
652
+ return !0;
653
+ }
654
+ get host() {
655
+ return x(this);
656
+ }
657
+ static get watchers() {
658
+ return {
659
+ name: ["elementNameChangedHandler"]
660
+ };
661
+ }
662
+ };
663
+ Ot([
664
+ _({
665
+ name: "nylas-calendar-picker",
666
+ eventToProps: {
667
+ valueChanged: async (e, t) => {
668
+ const { valueChangedHandler: n } = e.detail;
669
+ n && n(e);
670
+ }
671
+ },
672
+ fireRegisterEvent: !0
673
+ }),
674
+ re("design:type", Function),
675
+ re("design:paramtypes", []),
676
+ re("design:returntype", void 0)
677
+ ], De.prototype, "render", null);
678
+ De.style = Tt;
679
+ const Dt = ':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}', It = Dt;
680
+ var St = function(e, t, n, s) {
681
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
682
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
683
+ i = Reflect.decorate(e, t, n, s);
684
+ else
685
+ for (var r = e.length - 1; r >= 0; r--)
686
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
687
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
688
+ }, de = function(e, t) {
689
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
690
+ return Reflect.metadata(e, t);
691
+ };
692
+ const Ie = class {
693
+ constructor(e) {
694
+ 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 = "booking-type", this.bookingType = "", this.selectedBookingType = "";
695
+ }
696
+ connectedCallback() {
697
+ d("nylas-custom-booking-flow", "connectedCallback");
698
+ }
699
+ disconnectedCallback() {
700
+ d("nylas-custom-booking-flow", "disconnectedCallback");
701
+ }
702
+ componentWillLoad() {
703
+ d("nylas-custom-booking-flow", "componentWillLoad"), this.host.setAttribute("name", this.name);
704
+ }
705
+ componentDidLoad() {
706
+ d("nylas-custom-booking-flow", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.bookingType.toString(), "booking-calendar"), this.selectedBookingType = this.bookingType;
707
+ }
708
+ componentWillUpdate() {
709
+ d("nylas-custom-booking-flow", "componentWillUpdate");
710
+ }
711
+ componentDidUpdate() {
712
+ d("nylas-custom-booking-flow", "componentDidUpdate");
713
+ }
714
+ componentWillRender() {
715
+ d("nylas-custom-booking-flow", "componentWillRender");
716
+ }
717
+ componentDidRender() {
718
+ d("nylas-custom-booking-flow", "componentDidRender");
719
+ }
720
+ elementNameChangedHandler(e) {
721
+ d("nylas-custom-booking-flow", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
722
+ }
723
+ selectedOptionChangedHandler(e) {
724
+ d("nylas-custom-booking-flow", "selectedOptionChangedHandler", e.detail);
725
+ const t = (n) => {
726
+ const { value: s } = n.detail;
727
+ this.selectedBookingType = s, this.internals.setFormValue(s.toString(), "booking-calendar");
728
+ };
729
+ this.valueChanged.emit({ ...e.detail, valueChanged: t });
730
+ }
731
+ render() {
732
+ const e = [
733
+ {
734
+ label: "Automatically accept bookings",
735
+ value: "booking"
736
+ },
737
+ {
738
+ label: "Manually confirm/decline bookings",
739
+ value: "pre-booking"
740
+ }
741
+ ];
742
+ return a(k, { key: "fe9e837aba8f846a0b77a21eee365080d41b4e57" }, a("div", { key: "2405db5290bcd44a602fd9f91bb91e13a9d7ffc7", class: "nylas-custom-booking-flow", part: "ncbf" }, a("div", { key: "2de829660fdba0da9e6cbcd6281c427b65414d90", class: "header", part: "ncbf__header" }, a("h3", { key: "13e3b9e450f54f04538c773ab2564513cdaf0fa5" }, "Customize booking flow"), a("p", { key: "9436439f81faf9aed4ff9029c5c0a08a268b5e59" }, "Customize how new bookings are handled when a booking is completed.")), e.length > 0 ? a("div", { class: "nylas-custom-booking-flow__dropdown" }, a("span", { class: "label" }, "After a booking is confirmed", a("tooltip-component", null, a("info-icon", { slot: "tooltip-icon" }), a("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."))), a("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] })) : a("div", { class: "nylas-custom-booking-flow__loading" }, a("span", { class: "label" }, "Select a calendar to book meetings on ", a("info-icon", null)), a("div", { class: "loading-button" }, a("span", null, "Loading...")))));
743
+ }
744
+ static get formAssociated() {
745
+ return !0;
746
+ }
747
+ get host() {
748
+ return x(this);
749
+ }
750
+ static get watchers() {
751
+ return {
752
+ name: ["elementNameChangedHandler"]
753
+ };
754
+ }
755
+ };
756
+ St([
757
+ _({
758
+ name: "nylas-custom-booking-flow",
759
+ eventToProps: {
760
+ valueChanged: async (e, t) => {
761
+ const { valueChanged: n } = e.detail;
762
+ n && n(e);
763
+ }
764
+ },
765
+ fireRegisterEvent: !0
766
+ }),
767
+ de("design:type", Function),
768
+ de("design:paramtypes", []),
769
+ de("design:returntype", void 0)
770
+ ], Ie.prototype, "render", null);
771
+ Ie.style = It;
772
+ const Et = ':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:14px;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}', $t = Et;
773
+ var Lt = function(e, t, n, s) {
774
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
775
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
776
+ i = Reflect.decorate(e, t, n, s);
777
+ else
778
+ for (var r = e.length - 1; r >= 0; r--)
779
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
780
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
781
+ }, ce = function(e, t) {
782
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
783
+ return Reflect.metadata(e, t);
784
+ };
785
+ const Se = class {
786
+ constructor(e) {
787
+ 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.eventDescription = void 0, this.description = this.eventDescription ?? "", this.name = "description";
788
+ }
789
+ elementNameChangedHandler(e) {
790
+ d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
791
+ }
792
+ connectedCallback() {
793
+ d("nylas-event-description", "connectedCallback");
794
+ }
795
+ componentWillLoad() {
796
+ d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
797
+ }
798
+ componentDidLoad() {
799
+ d("nylas-event-description", "componentDidLoad");
800
+ }
801
+ disconnectedCallback() {
802
+ d("nylas-event-description", "disconnectedCallback");
803
+ }
804
+ handleChange(e) {
805
+ this.description = e.target.value, this.internals.setFormValue(e.target.value, "description"), this.valueChanged.emit({ value: e.target.value, name: this.name });
806
+ }
807
+ render() {
808
+ return a(k, { key: "5519bbdfdc7e253bf5b83c18decd714e54f58714" }, a("div", { key: "36541738e7d447cb6f9b3bf0f931c851efb0d8fe", class: "nylas-event-description", part: "nedesc" }, a("label", { key: "c0eb70c7e36360844559e0fd0a451243fb6f5860", htmlFor: "description" }, "Event description", a("span", { key: "98c176eaa09ccdac28fbba62f67ceeb8a6fed751", class: "label-icon" }, a("tooltip-component", { key: "553ca988451d6053a8863a52cbcdcb12dd041362" }, a("info-icon", { key: "015507616ffc54352cbecc9766e59d0db4a25367", slot: "tooltip-icon" }), a("span", { key: "86efa5b15ae112f6f974ba32e8c138e2c906184f", slot: "tooltip-content" }, "Provide any additional details for your event.")))), a("textarea", { key: "619f982afa3f2af2794d93cc0df930db618a3e5e", id: "description", part: "nedesc__textarea", name: "description", value: this.description, maxlength: "8192", onInput: (e) => this.handleChange(e) })));
809
+ }
810
+ static get formAssociated() {
811
+ return !0;
812
+ }
813
+ get host() {
814
+ return x(this);
815
+ }
816
+ static get watchers() {
817
+ return {
818
+ name: ["elementNameChangedHandler"]
819
+ };
820
+ }
821
+ };
822
+ Lt([
823
+ _({
824
+ name: "nylas-event-description",
825
+ eventToProps: {},
826
+ fireRegisterEvent: !0
827
+ }),
828
+ ce("design:type", Function),
829
+ ce("design:paramtypes", []),
830
+ ce("design:returntype", void 0)
831
+ ], Se.prototype, "render", null);
832
+ Se.style = $t;
833
+ 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:14px;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;
834
+ var Ht = function(e, t, n, s) {
835
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
836
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
837
+ i = Reflect.decorate(e, t, n, s);
838
+ else
839
+ for (var r = e.length - 1; r >= 0; r--)
840
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
841
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
842
+ }, fe = function(e, t) {
843
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
844
+ return Reflect.metadata(e, t);
845
+ };
846
+ const Ee = class {
847
+ constructor(e) {
848
+ 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 = "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;
849
+ }
850
+ elementNameChangedHandler(e) {
851
+ d("nylas-event-duration", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
852
+ }
853
+ durationMinutesChangedHandler(e, t) {
854
+ d("nylas-event-duration", "durationMinutesChangedHandler", e), e !== t && this.valueChanged.emit({ value: e.toString(), name: this.name });
855
+ }
856
+ connectedCallback() {
857
+ d("nylas-event-duration", "connectedCallback");
858
+ }
859
+ componentWillLoad() {
860
+ d("nylas-event-duration", "componentWillLoad"), this.host.setAttribute("name", this.name);
861
+ }
862
+ componentDidLoad() {
863
+ d("nylas-event-duration", "componentDidLoad"), this.internals.setFormValue(this.durationMinutes.toString(), "duration");
864
+ }
865
+ disconnectedCallback() {
866
+ d("nylas-event-duration", "disconnectedCallback");
867
+ }
868
+ handleChange(e) {
869
+ this.duration = e.target.value, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), this.name);
870
+ }
871
+ handleBlur() {
872
+ (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.duration > 720 && this.durationIncrement === 1 && (this.duration = 720), this.duration > 12 && this.durationIncrement === 60 && (this.duration = 12), this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
873
+ }
874
+ selectedOptionChangedHandler(e) {
875
+ d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
876
+ const { value: t } = e.detail;
877
+ 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");
878
+ }
879
+ render() {
880
+ const e = [
881
+ { value: 1, label: "minutes" },
882
+ { value: 60, label: "hours" }
883
+ ];
884
+ return a(k, { key: "b4c54d309345b6333578f1f8f49fbe9be7e50af7" }, a("div", { key: "401311ed8b0deb33eeb1013264f192ba87b0d118", class: "nylas-event-duration", part: "ned" }, a("label", { key: "5de11caa4aff28ca3fb11811e21adecfed22d32d", htmlFor: "duration" }, "Event duration", a("span", { key: "592731edca9c0c4ca63250e1fc3d964e4c7b271d", class: "required" }, "*"), a("span", { key: "b9f6a70dc84222e68d2251f485bbd3545d05fcde", class: "label-icon" }, a("tooltip-component", { key: "8fa85c6907a3625c1f50750b962014e7d413ea34" }, a("info-icon", { key: "677374d62adb9c9e27307b64bd69a979a28f32eb", slot: "tooltip-icon" }), a("span", { key: "d2ebc474b7876c3e23e31a296c826557b329be61", slot: "tooltip-content" }, "Set the duration of your event.")))), a("div", { key: "1240a158b86d06ed9e3859487e8688fc2cfea9e5", class: "nylas-event-duration__wrapper" }, a("input", { key: "fffb610158d4b056761f41e9b2ffd0e0aa5b1bfd", type: "number", part: "ned_input", id: "duration", name: "duration", value: this.duration, onBlur: () => this.handleBlur(), onInput: (t) => this.handleChange(t), min: 5 }), a("select-dropdown", { key: "8cf3f16c86c0220f992f69e4cfa012c170145b9e", 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 }))));
885
+ }
886
+ static get formAssociated() {
887
+ return !0;
888
+ }
889
+ get host() {
890
+ return x(this);
891
+ }
892
+ static get watchers() {
893
+ return {
894
+ name: ["elementNameChangedHandler"],
895
+ durationMinutes: ["durationMinutesChangedHandler"]
896
+ };
897
+ }
898
+ };
899
+ Ht([
900
+ _({
901
+ name: "nylas-event-duration",
902
+ eventToProps: {},
903
+ fireRegisterEvent: !0
904
+ }),
905
+ fe("design:type", Function),
906
+ fe("design:paramtypes", []),
907
+ fe("design:returntype", void 0)
908
+ ], Ee.prototype, "render", null);
909
+ Ee.style = Ft;
910
+ const Mt = ':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}', Nt = Mt;
911
+ var Rt = function(e, t, n, s) {
912
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
913
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
914
+ i = Reflect.decorate(e, t, n, s);
915
+ else
916
+ for (var r = e.length - 1; r >= 0; r--)
917
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
918
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
919
+ }, pe = function(e, t) {
920
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
921
+ return Reflect.metadata(e, t);
922
+ };
923
+ const $e = class {
924
+ constructor(e) {
925
+ y(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
926
+ }
927
+ connectedCallback() {
928
+ d("nylas-event-info", "connectedCallback");
929
+ }
930
+ componentWillLoad() {
931
+ d("nylas-event-info", "componentWillLoad");
932
+ }
933
+ componentDidLoad() {
934
+ d("nylas-event-info", "componentDidLoad");
935
+ }
936
+ disconnectedCallback() {
937
+ d("nylas-event-info", "disconnectedCallback");
938
+ }
939
+ render() {
940
+ return a(k, { key: "61e095027d4b933ff2d2cc17a5a9d8a6d1add51e" }, a("nylas-form-card", { key: "0aa8cfa9d92db31b33e30879f1baeda834a0b2f0" }, a("h1", { key: "1f8cb65c3b5b821d7f59b06a4ee338e2fd6bcc5b", slot: "header-title", class: "nylas-event-info__title" }, "Event information"), a("h3", { key: "40698f86b92127532457ece61c931eabced1ec25", slot: "header-subtitle", class: "nylas-event-info__subtitle" }, "Enter all event information."), a("div", { key: "724866551790e31b39fa016f6b88629573639cd6", slot: "content", class: "nylas-event-info__content" }, a("slot", { key: "ef0cd2dd50b7f160d2806d4e4b04f9fd39d1bf83", name: "inputs" }))));
941
+ }
942
+ static get formAssociated() {
943
+ return !0;
944
+ }
945
+ };
946
+ Rt([
947
+ _({
948
+ name: "nylas-event-info",
949
+ eventToProps: {},
950
+ fireRegisterEvent: !0
951
+ }),
952
+ pe("design:type", Function),
953
+ pe("design:paramtypes", []),
954
+ pe("design:returntype", void 0)
955
+ ], $e.prototype, "render", null);
956
+ $e.style = Nt;
957
+ 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}', Pt = zt;
958
+ var Bt = function(e, t, n, s) {
959
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
960
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
961
+ i = Reflect.decorate(e, t, n, s);
962
+ else
963
+ for (var r = e.length - 1; r >= 0; r--)
964
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
965
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
966
+ }, be = function(e, t) {
967
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
968
+ return Reflect.metadata(e, t);
969
+ };
970
+ const Le = class {
971
+ constructor(e) {
972
+ y(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
973
+ }
974
+ connectedCallback() {
975
+ d("nylas-event-limits", "connectedCallback");
976
+ }
977
+ componentWillLoad() {
978
+ d("nylas-event-limits", "componentWillLoad");
979
+ }
980
+ componentDidLoad() {
981
+ d("nylas-event-limits", "componentDidLoad");
982
+ }
983
+ disconnectedCallback() {
984
+ d("nylas-event-limits", "disconnectedCallback");
985
+ }
986
+ render() {
987
+ return a(k, { key: "5a2ad0ec53b85623d821f78858c3cff8b5e1a251" }, a("nylas-form-card", { key: "047025e1b53e4b92d4c5add386bae10702a493a0" }, a("h1", { key: "6e4f9438417a7a7037dda67b1b3ebdd09306f748", slot: "header-title", class: "nylas-event-limits__title" }, "Set event limits"), a("h3", { key: "6b2c72590cf35181cba99fdf7ce58a5d55eae153", slot: "header-subtitle", class: "nylas-event-limits__subtitle" }, "Customize event limits for the event."), a("div", { key: "ed1adf0a9eee51c73b86d78430d77b51db60d9a4", slot: "content", class: "nylas-event-limits__content" }, a("slot", { key: "b9a4299a7edfc2673afaab690ff610d449f8cd57", name: "inputs" }))));
988
+ }
989
+ static get formAssociated() {
990
+ return !0;
991
+ }
992
+ };
993
+ Bt([
994
+ _({
995
+ name: "nylas-event-limits",
996
+ eventToProps: {},
997
+ fireRegisterEvent: !0
998
+ }),
999
+ be("design:type", Function),
1000
+ be("design:paramtypes", []),
1001
+ be("design:returntype", void 0)
1002
+ ], Le.prototype, "render", null);
1003
+ Le.style = Pt;
1004
+ const jt = ':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 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 label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;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)}', Wt = jt;
1005
+ var Vt = function(e, t, n, s) {
1006
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
1007
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1008
+ i = Reflect.decorate(e, t, n, s);
1009
+ else
1010
+ for (var r = e.length - 1; r >= 0; r--)
1011
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
1012
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
1013
+ }, ue = function(e, t) {
1014
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1015
+ return Reflect.metadata(e, t);
1016
+ };
1017
+ const Ae = class {
1018
+ constructor(e) {
1019
+ 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.eventTitle = void 0, this.name = "title", this.showTokens = !1, this.availableTokens = _e.map((t) => ({
1020
+ label: t.token,
1021
+ value: t.value,
1022
+ labelHTML: t
1023
+ })), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 };
1024
+ }
1025
+ elementNameChangedHandler(e) {
1026
+ d("nylas-event-title", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1027
+ }
1028
+ ariaActivedescendantChangedHandler(e) {
1029
+ var t, n;
1030
+ if (d("nylas-event-title", "ariaActivedescendantChangedHandler", e), e !== "") {
1031
+ const s = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(e);
1032
+ s == null || s.classList.add("active");
1033
+ } else {
1034
+ const s = (n = this.host.shadowRoot) == null ? void 0 : n.querySelectorAll(".token-options li.active");
1035
+ s == null || s.forEach((o) => o.classList.remove("active"));
1036
+ }
1037
+ }
1038
+ connectedCallback() {
1039
+ d("nylas-event-title", "connectedCallback");
1040
+ }
1041
+ componentWillLoad() {
1042
+ d("nylas-event-title", "componentWillLoad"), this.host.setAttribute("name", this.name);
1043
+ }
1044
+ componentDidLoad() {
1045
+ d("nylas-event-title", "componentDidLoad"), this.updateEventTitleFromProp(this.eventTitle || "");
1046
+ }
1047
+ disconnectedCallback() {
1048
+ d("nylas-event-title", "disconnectedCallback");
1049
+ }
1050
+ updateEventTitleFromProp(e) {
1051
+ d("nylas-event-title", "eventTitleChangedHandler", e), this.titleRef.innerHTML = this.highlightTokens(), this.titleRef.focus();
1052
+ }
1053
+ highlightTokens() {
1054
+ let e = this.eventTitle || "";
1055
+ return _e.forEach((t) => {
1056
+ const n = t.value, s = new RegExp(`(\\${n})(?!\\w)`, "g");
1057
+ e = e.replace(s, '<span class="highlighted-tag">$1</span>');
1058
+ }), e;
1059
+ }
1060
+ getCurrentSelectionForBrowser() {
1061
+ var n, s, o;
1062
+ const e = (i, l, r) => {
1063
+ const b = i.replace(/[\u200B-\u200D\uFEFF]/g, ""), f = b.lastIndexOf("$"), h = b.substring(f).split(" ")[0];
1064
+ return {
1065
+ focusOffset: l,
1066
+ dollarIndex: f,
1067
+ lastWord: h,
1068
+ currentText: b,
1069
+ node: r
1070
+ };
1071
+ }, t = We();
1072
+ switch (console.log("currentBrowser", t), t) {
1073
+ case "Chrome":
1074
+ const i = (n = this.host.shadowRoot) == null ? void 0 : n.getSelection(), l = i == null ? void 0 : i.focusNode, r = (l == null ? void 0 : l.nodeValue) || "";
1075
+ return e(r, (i == null ? void 0 : i.focusOffset) || -1, l);
1076
+ case "Firefox":
1077
+ const b = document.getSelection(), f = ((s = b == null ? void 0 : b.anchorNode) == null ? void 0 : s.nodeValue) || "";
1078
+ return e(f, (b == null ? void 0 : b.focusOffset) || -1, b == null ? void 0 : b.anchorNode);
1079
+ case "Safari":
1080
+ const h = window.getSelection(), p = h == null ? void 0 : h.getComposedRanges(this.host.shadowRoot)[0], v = ((o = p == null ? void 0 : p.startContainer) == null ? void 0 : o.nodeValue) || "";
1081
+ return e(v, (p == null ? void 0 : p.endOffset) || -1, p == null ? void 0 : p.startContainer);
1082
+ default:
1083
+ return console.warn("Browser not supported"), null;
1084
+ }
1085
+ }
1086
+ handleChange(e) {
1087
+ const t = e.target.textContent || "", n = this.getCurrentSelectionForBrowser();
1088
+ if (!n) {
1089
+ this.updateEventTitle(t), this.resetDropdown();
1090
+ return;
1091
+ }
1092
+ const { focusOffset: s, dollarIndex: o, lastWord: i, currentText: l } = n;
1093
+ if (o === -1 || s < o) {
1094
+ this.updateEventTitle(t), this.resetDropdown();
1095
+ return;
1096
+ }
1097
+ i.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
1098
+ $value: i,
1099
+ fullText: l,
1100
+ index: o,
1101
+ focusOffset: s
1102
+ }, this.populateSuggestionsDropdown(i)) : this.resetDropdown(), this.updateEventTitle(t);
1103
+ }
1104
+ handleInputKeyDown(e) {
1105
+ var t, n, s, o;
1106
+ if (e.key === "Enter") {
1107
+ e.preventDefault();
1108
+ const i = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(this.ariaActivedescendant);
1109
+ i && (i.click(), this.ariaActivedescendant = "");
1110
+ } else if (e.key === "ArrowDown") {
1111
+ e.preventDefault();
1112
+ const i = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(this.ariaActivedescendant);
1113
+ if (i) {
1114
+ const l = i.nextElementSibling;
1115
+ l ? this.ariaActivedescendant = l.id : this.ariaActivedescendant = this.filteredTokens[0].label;
1116
+ } else
1117
+ this.ariaActivedescendant = this.filteredTokens[0].label;
1118
+ } else if (e.key === "ArrowUp") {
1119
+ e.preventDefault();
1120
+ const i = (s = this.host.shadowRoot) == null ? void 0 : s.getElementById(this.ariaActivedescendant);
1121
+ if (i) {
1122
+ const l = i.previousElementSibling;
1123
+ l ? this.ariaActivedescendant = l.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1124
+ } else
1125
+ this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1126
+ } else if (e.key === "Escape")
1127
+ e.preventDefault(), this.resetDropdown();
1128
+ else if (e.key === "Backspace" || e.key === "Delete") {
1129
+ const i = this.getCurrentSelectionForBrowser();
1130
+ i != null && i.currentText.startsWith("${") && (o = i == null ? void 0 : i.node) != null && o.parentNode && i.node.parentNode.removeChild(i.node);
1131
+ }
1132
+ }
1133
+ selectOption(e, t) {
1134
+ var c;
1135
+ e.preventDefault();
1136
+ const n = this.currentWord.fullText, s = this.currentWord.$value;
1137
+ let o = this.titleRef.firstChild, i = null;
1138
+ for (; o; ) {
1139
+ if (o.nodeType === 3) {
1140
+ const u = ((c = o.textContent) == null ? void 0 : c.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", m = n.replace(/[\u200B-\u200D\uFEFF]/g, "");
1141
+ if (u.includes(m)) {
1142
+ i = o;
1143
+ break;
1144
+ }
1145
+ }
1146
+ o = o.nextSibling;
1147
+ }
1148
+ if (!i)
1149
+ return;
1150
+ const l = i.textContent || "", r = l.indexOf(s), b = l.substring(0, r), f = l.substring(r + s.length), h = document.createTextNode(b), p = document.createRange(), v = document.createElement("span");
1151
+ v.classList.add("highlighted-tag"), v.textContent = `${t.value}`;
1152
+ const Z = document.createTextNode(f);
1153
+ if (f !== "")
1154
+ i.replaceWith(h, v, Z), p.setStart(Z, 0);
1155
+ else {
1156
+ const u = document.createTextNode("​");
1157
+ i.replaceWith(h, v, u), p.setStart(u, 0);
1158
+ }
1159
+ this.resetDropdown(), this.titleRef.focus();
1160
+ const $ = window.getSelection();
1161
+ p.collapse(!0), $ == null || $.removeAllRanges(), $ == null || $.addRange(p), this.updateEventTitle(this.titleRef.textContent || "");
1162
+ }
1163
+ populateSuggestionsDropdown(e = "") {
1164
+ 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);
1165
+ }
1166
+ updateEventTitle(e) {
1167
+ const t = e.replace(/ +/g, " ");
1168
+ this.valueChanged.emit({ value: t, name: this.name });
1169
+ }
1170
+ resetDropdown() {
1171
+ this.showTokens = !1, this.ariaActivedescendant = "";
1172
+ }
1173
+ getLabelHTML(e) {
1174
+ return a("div", { class: "token-label" }, a("span", { class: "token" }, e.token), a("span", { class: "description" }, e.description));
1175
+ }
1176
+ render() {
1177
+ var e;
1178
+ return a(k, { key: "a58acf57120285f1c42b0df698b31e298b40407d" }, a("div", { key: "ed5b5e3d7694fbce89647344b066326271786779", class: "nylas-event-title", part: "net" }, a("label", { key: "102d6d0df0164809afe2f215408cc321703c38bc", htmlFor: "title" }, "Event title", a("span", { key: "e024b656ae41640181ba67aed42a52509774354c", class: "required" }, "*"), a("span", { key: "7116bafdab5470e86ba2acdafc2236610b79ea59", class: "label-icon" }, a("tooltip-component", { key: "71a50958f2f04cdfe0cc35c17f60c64f3b910e84" }, a("info-icon", { key: "92e96b68f699d4aff80e028538259e27ba803e18", slot: "tooltip-icon" }), a("span", { key: "5c29a9e8bde6f4cd8df38082b70ad15682e4b687", slot: "tooltip-content" }, "Enter a title for your event.")))), a("div", { key: "72f580436b050b2af9b78149e3b8831912847e7f", class: "title", 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 && a("div", { class: "token-options", part: "net__dropdown-content" }, a("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => a("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))))), a("span", { key: "a75e5bea3c3841e1030ff676465c036006cf617f", class: "help-text" }, "Create a dynamic templated event title by typing $. Learn more")));
1179
+ }
1180
+ static get formAssociated() {
1181
+ return !0;
1182
+ }
1183
+ get host() {
1184
+ return x(this);
1185
+ }
1186
+ static get watchers() {
1187
+ return {
1188
+ name: ["elementNameChangedHandler"],
1189
+ ariaActivedescendant: ["ariaActivedescendantChangedHandler"]
1190
+ };
1191
+ }
1192
+ };
1193
+ Vt([
1194
+ _({
1195
+ name: "nylas-event-title",
1196
+ eventToProps: {},
1197
+ fireRegisterEvent: !0
1198
+ }),
1199
+ ue("design:type", Function),
1200
+ ue("design:paramtypes", []),
1201
+ ue("design:returntype", void 0)
1202
+ ], Ae.prototype, "render", null);
1203
+ Ae.style = Wt;
1204
+ const Ut = ':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}', Zt = Ut;
1205
+ var Yt = function(e, t, n, s) {
1206
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
1207
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1208
+ i = Reflect.decorate(e, t, n, s);
1209
+ else
1210
+ for (var r = e.length - 1; r >= 0; r--)
1211
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
1212
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
1213
+ }, he = function(e, t) {
1214
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1215
+ return Reflect.metadata(e, t);
1216
+ };
1217
+ const Fe = class {
1218
+ constructor(e) {
1219
+ 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.availableDaysInFuture = void 0, this.name = "limit-future-bookings", this.selectedNumber = 1, this.selectedPeriod = "day";
1220
+ }
1221
+ elementNameChangedHandler(e) {
1222
+ d("nylas-limit-future-bookings", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1223
+ }
1224
+ availableDaysInFutureChanged(e) {
1225
+ const { number: t, period: n } = this.calculateNumberAndPeriodFromDays(e);
1226
+ this.selectedNumber = t, this.selectedPeriod = n;
1227
+ }
1228
+ connectedCallback() {
1229
+ d("nylas-limit-future-bookings", "connectedCallback");
1230
+ }
1231
+ componentWillLoad() {
1232
+ d("nylas-limit-future-bookings", "componentWillLoad"), this.host.setAttribute("name", this.name);
1233
+ }
1234
+ componentDidLoad() {
1235
+ var e;
1236
+ 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);
1237
+ }
1238
+ disconnectedCallback() {
1239
+ d("nylas-limit-future-bookings", "disconnectedCallback");
1240
+ }
1241
+ timePeriodChangedHandler(e) {
1242
+ const { number: t, period: n } = e.detail;
1243
+ let s;
1244
+ n === "day" ? s = t : n === "week" ? s = t * 7 : s = t * 30, this.valueChanged.emit({ value: s, name: this.name }), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(s.toString(), this.name);
1245
+ }
1246
+ calculateNumberAndPeriodFromDays(e) {
1247
+ return e >= 30 && e % 30 === 0 ? { number: e / 30, period: "month" } : e >= 7 && e % 7 === 0 ? { number: e / 7, period: "week" } : { number: e, period: "day" };
1248
+ }
1249
+ render() {
1250
+ return a(k, { key: "8057320077aad1ea65297b4cac79fe11f69ab161" }, a("div", { key: "991d810bee6817a1ec26482807fece9d884b7844", class: "nylas-limit-future-bookings", part: "nlfb" }, a("label", { key: "caf0946d5a7cb202dc02cd596a7721e52278cb55" }, "Limit future bookings", a("span", { key: "fff09830bc407f7ce1fecf7e6809f2a030ce9a3e", class: "label-icon" }, a("tooltip-component", { key: "8c9cd31ae211d1d3a7f017032d7c1abb3f1c7df6" }, a("info-icon", { key: "43f8b14a4b28effd21e9b5a87b20f63b6bf0061d", slot: "tooltip-icon" }), a("span", { key: "bdfebd15750111829926da4dc0820f562c4fd9aa", slot: "tooltip-content" }, "Set a limit on how far in the future bookings can be made.")))), a("time-period-selector", { key: "de949c9c3aa9234102159bdec61efc061ac49408", 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 })));
1251
+ }
1252
+ static get formAssociated() {
1253
+ return !0;
1254
+ }
1255
+ get host() {
1256
+ return x(this);
1257
+ }
1258
+ static get watchers() {
1259
+ return {
1260
+ name: ["elementNameChangedHandler"],
1261
+ availableDaysInFuture: ["availableDaysInFutureChanged"]
1262
+ };
1263
+ }
1264
+ };
1265
+ Yt([
1266
+ _({
1267
+ name: "nylas-limit-future-bookings",
1268
+ eventToProps: {},
1269
+ fireRegisterEvent: !0
1270
+ }),
1271
+ he("design:type", Function),
1272
+ he("design:paramtypes", []),
1273
+ he("design:returntype", void 0)
1274
+ ], Fe.prototype, "render", null);
1275
+ Fe.style = Zt;
1276
+ const Kt = ':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-nylas-base-800);font-size:14px;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}', qt = Kt;
1277
+ var Jt = function(e, t, n, s) {
1278
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
1279
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1280
+ i = Reflect.decorate(e, t, n, s);
1281
+ else
1282
+ for (var r = e.length - 1; r >= 0; r--)
1283
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
1284
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
1285
+ }, me = function(e, t) {
1286
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1287
+ return Reflect.metadata(e, t);
1288
+ };
1289
+ const He = class {
1290
+ constructor(e) {
1291
+ 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.eventLocation = void 0, this.location = this.eventLocation ?? "", this.selectedLocationOption = this.eventLocation ? "custom" : "none", this.name = "location";
1292
+ }
1293
+ elementNameChangedHandler(e) {
1294
+ d("nylas-location-component", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1295
+ }
1296
+ eventLocationChangedHandler(e, t) {
1297
+ d("nylas-location-component", "eventLocationChangedHandler", e), e !== t && (this.selectedLocationOption = e ? "custom" : "none");
1298
+ }
1299
+ connectedCallback() {
1300
+ d("nylas-location-component", "connectedCallback");
1301
+ }
1302
+ componentWillLoad() {
1303
+ d("nylas-location-component", "componentWillLoad"), this.host.setAttribute("name", this.name);
1304
+ }
1305
+ componentDidLoad() {
1306
+ d("nylas-location-component", "componentDidLoad");
1307
+ }
1308
+ disconnectedCallback() {
1309
+ d("nylas-location-component", "disconnectedCallback");
1310
+ }
1311
+ selectedOptionChangedHandler(e) {
1312
+ this.selectedLocationOption = e.detail.value, this.selectedLocationOption === "none" && (this.location = "", this.setFormValue("", "location"), this.valueChanged.emit({ value: "", name: this.name }));
1313
+ }
1314
+ setFormValue(e, t) {
1315
+ typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, t);
1316
+ }
1317
+ handleChange(e) {
1318
+ this.location = e.target.value, this.setFormValue(e.target.value, "location"), this.valueChanged.emit({ value: e.target.value, name: this.name });
1319
+ }
1320
+ render() {
1321
+ const e = [
1322
+ { value: "none", label: "None" },
1323
+ { value: "custom", label: "Custom location" }
1324
+ ], t = {
1325
+ none: a("location-off-icon", { key: "b6ed0f7da911d13fe204658d1dbfbc29d569a99a" }),
1326
+ custom: a("location-icon", { key: "08a5c193876813578037ee6003ab03fd947fb87d" })
1327
+ };
1328
+ return a(k, { key: "e512133eb2a9213bfacc2edad0581b7a6ad41bbc" }, a("div", { key: "1f0e59707c41f7836805ff26efbd5cc119dfef11", class: "nylas-event-location", part: "nel" }, a("label", { key: "60e264aa383ae29342678ecf23b12631fff1bc98", htmlFor: "location" }, "Location type", a("span", { key: "64c34dbeafa4b5c033be3d1facede6e737b915e1", class: "label-icon" }, a("tooltip-component", { key: "0c569694141c72418e997a85328127968d05eac1" }, a("info-icon", { key: "411fe82e0b6296b34aae95459c9da8bc07bd8131", slot: "tooltip-icon" }), a("span", { key: "67b4582af4fe7085c748e842b5fda1a46a454edf", 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.")))), a("div", { key: "3f7b59eaae37afcd7abc4af3c608c5e6dc3ebc30", class: "location-input" }, a("select-dropdown", { key: "424550ac2c3fd61e7c59d2e8c98cedfd156d5661", 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" }, a("span", { key: "300fd4134259f97fcf3ba09d3d296c15ca18eec7", slot: "select-icon" }, t[this.selectedLocationOption])), this.selectedLocationOption === "custom" && a("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: (n) => this.handleChange(n) }))));
1329
+ }
1330
+ static get formAssociated() {
1331
+ return !0;
1332
+ }
1333
+ get host() {
1334
+ return x(this);
1335
+ }
1336
+ static get watchers() {
1337
+ return {
1338
+ name: ["elementNameChangedHandler"],
1339
+ eventLocation: ["eventLocationChangedHandler"]
1340
+ };
1341
+ }
1342
+ };
1343
+ Jt([
1344
+ _({
1345
+ name: "nylas-location-component",
1346
+ eventToProps: {},
1347
+ fireRegisterEvent: !0
1348
+ }),
1349
+ me("design:type", Function),
1350
+ me("design:paramtypes", []),
1351
+ me("design:returntype", void 0)
1352
+ ], He.prototype, "render", null);
1353
+ He.style = qt;
1354
+ const Gt = ':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}', Xt = Gt;
1355
+ var Qt = function(e, t, n, s) {
1356
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
1357
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1358
+ i = Reflect.decorate(e, t, n, s);
1359
+ else
1360
+ for (var r = e.length - 1; r >= 0; r--)
1361
+ (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
1362
+ return o > 3 && i && Object.defineProperty(t, n, i), i;
1363
+ }, ye = function(e, t) {
1364
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1365
+ return Reflect.metadata(e, t);
1366
+ };
1367
+ const Me = class {
1368
+ constructor(e) {
1369
+ 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.minCancellationNotice = void 0, this.name = "min-cancellation-notice", this.selectedNumber = 1, this.selectedPeriod = "day";
1370
+ }
1371
+ elementNameChangedHandler(e) {
1372
+ d("nylas-min-cancellation-notice", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1373
+ }
1374
+ availableDaysInFutureChanged(e) {
1375
+ const { number: t, period: n } = this.calculateNumberAndPeriodFromMinutes(e);
1376
+ this.selectedNumber = t, this.selectedPeriod = n;
1377
+ }
1378
+ connectedCallback() {
1379
+ d("nylas-min-cancellation-notice", "connectedCallback");
1380
+ }
1381
+ componentWillLoad() {
1382
+ d("nylas-min-cancellation-notice", "componentWillLoad"), this.host.setAttribute("name", this.name);
1383
+ }
1384
+ componentDidLoad() {
1385
+ var e;
1386
+ 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);
1387
+ }
1388
+ disconnectedCallback() {
1389
+ d("nylas-min-cancellation-notice", "disconnectedCallback");
1390
+ }
1391
+ timePeriodChangedHandler(e) {
1392
+ const { number: t, period: n } = e.detail;
1393
+ let s;
1394
+ const o = 60, i = o * 24, l = i * 7, r = i * 30;
1395
+ n === "minute" ? s = t : n === "hour" ? s = t * o : n === "day" ? s = t * i : n === "week" ? s = t * l : n === "month" ? s = t * r : s = 0, this.valueChanged.emit({ value: s, name: this.name }), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(s.toString(), this.name);
1396
+ }
1397
+ calculateNumberAndPeriodFromMinutes(e) {
1398
+ return e >= 43200 ? { number: Math.floor(e / 43200), period: "month" } : e >= 10080 ? { number: Math.floor(e / 10080), period: "week" } : e >= 1440 ? { number: Math.floor(e / 1440), period: "day" } : e >= 60 ? { number: Math.floor(e / 60), period: "hour" } : { number: e, period: "minute" };
1399
+ }
1400
+ render() {
1401
+ return a(k, { key: "594c4e6ca9c565f486f5c09159de518fe586f7b8" }, a("div", { key: "712baa63d3ea867b5a7893a254954fcea49c80f0", class: "nylas-min-cancellation-notice", part: "nmcn" }, a("label", { key: "7256ab66b7908dc8b972b2987276e0d2d04dd0ee" }, "Minimum cancellation notice", a("span", { key: "515772bd9028f2718ad350acef7b293269e12279", class: "label-icon" }, a("tooltip-component", { key: "1fe93b6067d38d4d78fe0c16fbd21d67ea5db0fd" }, a("info-icon", { key: "2b1e4eb5c88b329441a98009d2e81fbe6c807ccd", slot: "tooltip-icon" }), a("span", { key: "44f83c20d9041f31bb4b58c190c5877cfcdd41b3", slot: "tooltip-content" }, "Set the minimum amount of time required to cancel an event.")))), a("time-period-selector", { key: "4b1725b8d90355b2481a37d8b894414ea5549cd8", 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 })));
1402
+ }
1403
+ static get formAssociated() {
1404
+ return !0;
1405
+ }
1406
+ get host() {
1407
+ return x(this);
1408
+ }
1409
+ static get watchers() {
1410
+ return {
1411
+ name: ["elementNameChangedHandler"],
1412
+ availableDaysInFuture: ["availableDaysInFutureChanged"]
1413
+ };
1414
+ }
1415
+ };
1416
+ Qt([
1417
+ _({
1418
+ name: "nylas-min-cancellation-notice",
1419
+ eventToProps: {},
1420
+ fireRegisterEvent: !0
1421
+ }),
1422
+ ye("design:type", Function),
1423
+ ye("design:paramtypes", []),
1424
+ ye("design:returntype", void 0)
1425
+ ], Me.prototype, "render", null);
1426
+ Me.style = Xt;
1427
+ var Ne = { exports: {} };
1428
+ (function(e, t) {
1429
+ (function(n, s) {
1430
+ e.exports = s();
1431
+ })(Ve, function() {
1432
+ 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" }, s = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, o = /\d\d/, i = /\d\d?/, l = /\d*[^-_:/,()\s\d]+/, r = {}, b = function(c) {
1433
+ return (c = +c) + (c > 68 ? 1900 : 2e3);
1434
+ }, f = function(c) {
1435
+ return function(u) {
1436
+ this[c] = +u;
1437
+ };
1438
+ }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(c) {
1439
+ (this.zone || (this.zone = {})).offset = function(u) {
1440
+ if (!u || u === "Z")
1441
+ return 0;
1442
+ var m = u.match(/([+-]|\d\d)/g), g = 60 * m[1] + (+m[2] || 0);
1443
+ return g === 0 ? 0 : m[0] === "+" ? -g : g;
1444
+ }(c);
1445
+ }], p = function(c) {
1446
+ var u = r[c];
1447
+ return u && (u.indexOf ? u : u.s.concat(u.f));
1448
+ }, v = function(c, u) {
1449
+ var m, g = r.meridiem;
1450
+ if (g) {
1451
+ for (var D = 1; D <= 24; D += 1)
1452
+ if (c.indexOf(g(D, 0, u)) > -1) {
1453
+ m = D > 12;
1454
+ break;
1455
+ }
1456
+ } else
1457
+ m = c === (u ? "pm" : "PM");
1458
+ return m;
1459
+ }, Z = { A: [l, function(c) {
1460
+ this.afternoon = v(c, !1);
1461
+ }], a: [l, function(c) {
1462
+ this.afternoon = v(c, !0);
1463
+ }], S: [/\d/, function(c) {
1464
+ this.milliseconds = 100 * +c;
1465
+ }], SS: [o, function(c) {
1466
+ this.milliseconds = 10 * +c;
1467
+ }], SSS: [/\d{3}/, function(c) {
1468
+ this.milliseconds = +c;
1469
+ }], s: [i, f("seconds")], ss: [i, f("seconds")], m: [i, f("minutes")], mm: [i, f("minutes")], H: [i, f("hours")], h: [i, f("hours")], HH: [i, f("hours")], hh: [i, f("hours")], D: [i, f("day")], DD: [o, f("day")], Do: [l, function(c) {
1470
+ var u = r.ordinal, m = c.match(/\d+/);
1471
+ if (this.day = m[0], u)
1472
+ for (var g = 1; g <= 31; g += 1)
1473
+ u(g).replace(/\[|\]/g, "") === c && (this.day = g);
1474
+ }], M: [i, f("month")], MM: [o, f("month")], MMM: [l, function(c) {
1475
+ var u = p("months"), m = (p("monthsShort") || u.map(function(g) {
1476
+ return g.slice(0, 3);
1477
+ })).indexOf(c) + 1;
1478
+ if (m < 1)
1479
+ throw new Error();
1480
+ this.month = m % 12 || m;
1481
+ }], MMMM: [l, function(c) {
1482
+ var u = p("months").indexOf(c) + 1;
1483
+ if (u < 1)
1484
+ throw new Error();
1485
+ this.month = u % 12 || u;
1486
+ }], Y: [/[+-]?\d+/, f("year")], YY: [o, function(c) {
1487
+ this.year = b(c);
1488
+ }], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
1489
+ function $(c) {
1490
+ var u, m;
1491
+ u = c, m = r && r.formats;
1492
+ for (var g = (c = u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(N, L, O) {
1493
+ var C = O && O.toUpperCase();
1494
+ return L || m[O] || n[O] || m[C].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(A, F, R) {
1495
+ return F || R.slice(1);
1496
+ });
1497
+ })).match(s), D = g.length, I = 0; I < D; I += 1) {
1498
+ var U = g[I], M = Z[U], S = M && M[0], E = M && M[1];
1499
+ g[I] = E ? { regex: S, parser: E } : U.replace(/^\[|\]$/g, "");
1500
+ }
1501
+ return function(N) {
1502
+ for (var L = {}, O = 0, C = 0; O < D; O += 1) {
1503
+ var A = g[O];
1504
+ if (typeof A == "string")
1505
+ C += A.length;
1506
+ else {
1507
+ var F = A.regex, R = A.parser, Y = N.slice(C), P = F.exec(Y)[0];
1508
+ R.call(L, P), N = N.replace(P, "");
1509
+ }
1510
+ }
1511
+ return function(z) {
1512
+ var T = z.afternoon;
1513
+ if (T !== void 0) {
1514
+ var B = z.hours;
1515
+ T ? B < 12 && (z.hours += 12) : B === 12 && (z.hours = 0), delete z.afternoon;
1516
+ }
1517
+ }(L), L;
1518
+ };
1519
+ }
1520
+ return function(c, u, m) {
1521
+ m.p.customParseFormat = !0, c && c.parseTwoDigitYear && (b = c.parseTwoDigitYear);
1522
+ var g = u.prototype, D = g.parse;
1523
+ g.parse = function(I) {
1524
+ var U = I.date, M = I.utc, S = I.args;
1525
+ this.$u = M;
1526
+ var E = S[1];
1527
+ if (typeof E == "string") {
1528
+ var N = S[2] === !0, L = S[3] === !0, O = N || L, C = S[2];
1529
+ L && (C = S[2]), r = this.$locale(), !N && C && (r = m.Ls[C]), this.$d = function(Y, P, z) {
1530
+ try {
1531
+ if (["x", "X"].indexOf(P) > -1)
1532
+ return new Date((P === "X" ? 1e3 : 1) * Y);
1533
+ var T = $(P)(Y), B = T.year, K = T.month, Re = T.day, ze = T.hours, Pe = T.minutes, Be = T.seconds, je = T.milliseconds, ge = T.zone, J = /* @__PURE__ */ new Date(), G = Re || (B || K ? 1 : J.getDate()), X = B || J.getFullYear(), q = 0;
1534
+ B && !K || (q = K > 0 ? K - 1 : J.getMonth());
1535
+ var Q = ze || 0, ee = Pe || 0, te = Be || 0, ne = je || 0;
1536
+ 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);
1537
+ } catch {
1538
+ return /* @__PURE__ */ new Date("");
1539
+ }
1540
+ }(U, E, M), this.init(), C && C !== !0 && (this.$L = this.locale(C).$L), O && U != this.format(E) && (this.$d = /* @__PURE__ */ new Date("")), r = {};
1541
+ } else if (E instanceof Array)
1542
+ for (var A = E.length, F = 1; F <= A; F += 1) {
1543
+ S[1] = E[F - 1];
1544
+ var R = m.apply(this, S);
1545
+ if (R.isValid()) {
1546
+ this.$d = R.$d, this.$L = R.$L, this.init();
1547
+ break;
1548
+ }
1549
+ F === A && (this.$d = /* @__PURE__ */ new Date(""));
1550
+ }
1551
+ else
1552
+ D.call(this, I);
1553
+ };
1554
+ };
1555
+ });
1556
+ })(Ne);
1557
+ const en = Ne.exports, tn = ':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}', nn = tn;
1558
+ V.extend(en);
1559
+ const an = class {
1560
+ constructor(e) {
1561
+ 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;
1562
+ }
1563
+ handleOutsideClick(e) {
1564
+ !e.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
1565
+ }
1566
+ minimumStartTimeChangedHandler() {
1567
+ if (this.minimumStartTime) {
1568
+ let e = V().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4, -2)));
1569
+ 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();
1570
+ const t = V(this.times[0].value, "hh:mma");
1571
+ V(this.time, "hh:mma").isBefore(t) && (this.err = "Invalid", this.setFormError(null, "Invalid"));
1572
+ }
1573
+ }
1574
+ componentDidRender() {
1575
+ if (this.showTimes && this.shouldAutoScroll) {
1576
+ const e = ae(this.time), t = this.times.findIndex((n) => n.value === e);
1577
+ t > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(t));
1578
+ return;
1579
+ }
1580
+ }
1581
+ handleTimeChange(e, t) {
1582
+ const n = t.split(":");
1583
+ 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);
1584
+ }
1585
+ handleTimeAutocomplete(e) {
1586
+ var n;
1587
+ const t = (n = e.target) == null ? void 0 : n.value;
1588
+ if (!ie(t)) {
1589
+ this.err = "Invalid", this.setFormError(e, "Invalid");
1590
+ return;
1591
+ }
1592
+ if (t === "") {
1593
+ const s = ke().format("hh:mma");
1594
+ this.setTime(e, s);
1595
+ return;
1596
+ }
1597
+ if (!we(t)) {
1598
+ const s = ae(t);
1599
+ this.setTime(s);
1600
+ return;
1601
+ }
1602
+ this.setTime(e, t);
1603
+ }
1604
+ handleOnInput(e) {
1605
+ var n;
1606
+ const t = (n = e.target) == null ? void 0 : n.value;
1607
+ if (ie(t)) {
1608
+ if (t === "") {
1609
+ const s = ke().format("hh:mma"), o = this.times.findIndex((i) => i.value === s);
1610
+ o > -1 && this.scrollToViewWithinParent(o);
1611
+ return;
1612
+ }
1613
+ if (!we(t)) {
1614
+ const s = ae(t), o = this.times.findIndex((i) => i.value === s);
1615
+ o > -1 && this.scrollToViewWithinParent(o);
1616
+ return;
1617
+ }
1618
+ }
1619
+ }
1620
+ generateTimes() {
1621
+ const e = [];
1622
+ let t = V().set("hour", 0).set("minute", 0).set("second", 0);
1623
+ this.minimumStartTime && (t = V(this.minimumStartTime, "hh:mma"));
1624
+ const n = t.endOf("day").diff(t, "minutes"), s = Math.round(n / 15);
1625
+ for (let o = 0; o < s + 1; o++) {
1626
+ const i = t.add(o * 15, "minute");
1627
+ if (o == s && i.format("hh:mma").includes("am"))
1628
+ break;
1629
+ e.push({ id: o, value: i.format("hh:mma") });
1630
+ }
1631
+ return e;
1632
+ }
1633
+ handleComboboxKeyDown(e) {
1634
+ if (e.key === "ArrowDown") {
1635
+ if (e.preventDefault(), !this.showTimes) {
1636
+ this.showTimes = !0, this.shouldAutoScroll = !0;
1637
+ return;
1638
+ }
1639
+ if (this.ariaActivedescendant === "")
1640
+ this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
1641
+ else {
1642
+ const t = this.times.findIndex((s) => s.id.toString() === this.ariaActivedescendant), n = t + 1 < this.times.length ? t + 1 : 0;
1643
+ this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
1644
+ }
1645
+ } else if (e.key === "ArrowUp")
1646
+ if (e.preventDefault(), this.ariaActivedescendant === "")
1647
+ this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
1648
+ else {
1649
+ const t = this.times.findIndex((s) => s.id.toString() === this.ariaActivedescendant), n = t - 1 >= 0 ? t - 1 : this.times.length - 1;
1650
+ this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
1651
+ }
1652
+ else
1653
+ e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
1654
+ }
1655
+ handleListboxKeydown(e) {
1656
+ const t = this.times, n = t.findIndex((s) => s.id.toString() === this.ariaActivedescendant);
1657
+ if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
1658
+ e.preventDefault();
1659
+ const s = n + 1 < t.length ? n + 1 : 0;
1660
+ this.ariaActivedescendant = t[s].id.toString(), this.focusOption(s);
1661
+ } else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
1662
+ e.preventDefault();
1663
+ const s = n - 1 >= 0 ? n - 1 : t.length - 1;
1664
+ this.ariaActivedescendant = t[s].id.toString(), this.focusOption(s);
1665
+ } else if (e.key === "Enter") {
1666
+ if (e.preventDefault(), this.ariaActivedescendant) {
1667
+ const s = t[n];
1668
+ this.handleTimeChange(e, s.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
1669
+ }
1670
+ } else
1671
+ e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
1672
+ }
1673
+ scrollToViewWithinParent(e) {
1674
+ var l;
1675
+ const t = this.times[e], n = (l = this.el.shadowRoot) == null ? void 0 : l.getElementById(t.id.toString()), s = this.timeMenu;
1676
+ this.ariaActivedescendant = t.id.toString();
1677
+ const o = n.getBoundingClientRect(), i = s.getBoundingClientRect();
1678
+ o.top < i.top ? s.scrollTop -= i.top - o.top : o.bottom > i.bottom && (s.scrollTop += o.bottom - i.bottom), o.left < i.left ? s.scrollLeft -= i.left - o.left : o.right > i.right && (s.scrollLeft += o.right - i.right);
1679
+ }
1680
+ focusOption(e) {
1681
+ var o;
1682
+ const t = this.times[e];
1683
+ if (!t)
1684
+ return;
1685
+ const n = t.id.toString(), s = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
1686
+ s && (s.focus(), s.scrollIntoView({ behavior: "smooth", block: "nearest" }));
1687
+ }
1688
+ render() {
1689
+ return a(k, { key: "ce9cc8b8d7672d0e8389051d271e2369598f3e0f" }, a("div", { key: "c12333b0675d581b6f84b5d332d05deeceabab32", class: "time-picker", part: "time-picker" }, a("input", { key: "65e951f23fce142c529933e8f0311a124b32c948", type: "text", name: this.name, id: this.name, part: "time-input", class: {
1690
+ "time-input": !0,
1691
+ error: !!this.err || this.hasError
1692
+ }, ref: (e) => this.timeInput = e, value: this.time, onClick: () => {
1693
+ this.showTimes = !0, this.shouldAutoScroll = !0;
1694
+ }, "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 && a("div", { class: "invalid-time-icon" }), this.showTimes && a("div", { class: "times", part: "times", ref: (e) => this.timeMenu = e }, a("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.times.map((e) => a("li", { tabindex: "0", key: e.id, id: e.id.toString(), class: {
1695
+ focused: this.ariaActivedescendant === e.id.toString()
1696
+ }, onClick: (t) => {
1697
+ this.handleTimeChange(t, e.value), this.showTimes = !1, this.timeInput.focus();
1698
+ }, role: "option" }, `${e.value}`)))), !this.showTimes && this.err && a("p", { class: "error", id: "email-error" }, this.err)));
1699
+ }
1700
+ get el() {
1701
+ return x(this);
1702
+ }
1703
+ static get watchers() {
1704
+ return {
1705
+ minimumStartTime: ["minimumStartTimeChangedHandler"]
1706
+ };
1707
+ }
1708
+ };
1709
+ an.style = nn;
1710
+ export {
1711
+ Ye as add_circle_icon,
1712
+ Je as button_component,
1713
+ Qe as calendar_info_icon,
1714
+ nt as calendar_patterns_icon,
1715
+ st as flow_icon,
1716
+ rt as location_icon,
1717
+ ft as location_off_icon,
1718
+ ut as multi_select_dropdown,
1719
+ Ce as nylas_availability_picker,
1720
+ Te as nylas_booking_calendar_picker,
1721
+ Oe as nylas_buffer_time,
1722
+ De as nylas_calendar_picker,
1723
+ Ie as nylas_custom_booking_flow,
1724
+ Se as nylas_event_description,
1725
+ Ee as nylas_event_duration,
1726
+ $e as nylas_event_info,
1727
+ Le as nylas_event_limits,
1728
+ Ae as nylas_event_title,
1729
+ Fe as nylas_limit_future_bookings,
1730
+ He as nylas_location_component,
1731
+ Me as nylas_min_cancellation_notice,
1732
+ an as nylas_time_window_picker
1733
+ };