@nylas/react 1.1.0-canary.19 → 1.1.0-canary.21

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 (145) hide show
  1. package/dist/add-circle-icon_2.entry-29cc2385.cjs +1 -0
  2. package/dist/add-circle-icon_2.entry-b8d6df60.js +69 -0
  3. package/dist/{archive-icon_7.entry-896a1054.js → archive-icon_7.entry-3830776a.js} +18 -18
  4. package/dist/{archive-icon_7.entry-2b56ef80.cjs → archive-icon_7.entry-afaef817.cjs} +1 -1
  5. package/dist/{arrow-icon.entry-9aaa93fd.js → arrow-icon.entry-19f00716.js} +1 -1
  6. package/dist/{arrow-icon.entry-0288f3fc.cjs → arrow-icon.entry-460cdd9f.cjs} +1 -1
  7. package/dist/{bold-icon_3.entry-e7810620.cjs → bold-icon_3.entry-1893eeec.cjs} +1 -1
  8. package/dist/{bold-icon_3.entry-0061cf1f.js → bold-icon_3.entry-80abafbb.js} +3 -3
  9. package/dist/button-component.entry-36137536.js +16 -0
  10. package/dist/button-component.entry-b78dc39e.cjs +1 -0
  11. package/dist/calendar-agenda-fill-icon_40.entry-62c66fce.cjs +10 -0
  12. package/dist/{calendar-agenda-fill-icon_35.entry-a19cae9c.js → calendar-agenda-fill-icon_40.entry-f19d6ad7.js} +1474 -1077
  13. package/dist/{calendar-cancel-icon.entry-8e8b25b6.cjs → calendar-cancel-icon.entry-0d83ee82.cjs} +1 -1
  14. package/dist/{calendar-cancel-icon.entry-71eae711.js → calendar-cancel-icon.entry-1fae00c5.js} +1 -1
  15. package/dist/{calendar-check-icon_2.entry-6f971ca2.js → calendar-check-icon_2.entry-159c38af.js} +1 -1
  16. package/dist/{calendar-check-icon_2.entry-562e98cf.cjs → calendar-check-icon_2.entry-e01c9028.cjs} +1 -1
  17. package/dist/{calendar-icon.entry-3a59af30.cjs → calendar-icon.entry-2e701aab.cjs} +1 -1
  18. package/dist/{calendar-icon.entry-3e496896.js → calendar-icon.entry-3af9cb76.js} +1 -1
  19. package/dist/checkbox-component_2.entry-5eee51f6.js +56 -0
  20. package/dist/checkbox-component_2.entry-9ff2c85b.cjs +1 -0
  21. package/dist/checkmark-icon.entry-0749b942.js +15 -0
  22. package/dist/checkmark-icon.entry-f96f1117.cjs +1 -0
  23. package/dist/{chevron-icon_3.entry-7eac0ed5.js → chevron-icon_3.entry-2e9eebbc.js} +10 -10
  24. package/dist/{chevron-icon_3.entry-7ff10540.cjs → chevron-icon_3.entry-c3989df2.cjs} +1 -1
  25. package/dist/clock-icon_4.entry-9395d0cb.js +45 -0
  26. package/dist/clock-icon_4.entry-d4563931.cjs +1 -0
  27. package/dist/close-icon.entry-cf9f0a69.js +15 -0
  28. package/dist/close-icon.entry-e24af309.cjs +1 -0
  29. package/dist/{constants-7ce66b44-e7ca66c2.js → constants-67de2eec-b17f5b96.js} +37 -17
  30. package/dist/{constants-7ce66b44-a951d78c.cjs → constants-67de2eec-e3b50fc6.cjs} +5 -5
  31. package/dist/{copy-icon_4.entry-9a949d24.js → copy-icon_3.entry-7b276fa2.js} +9 -19
  32. package/dist/copy-icon_3.entry-7de3667f.cjs +1 -0
  33. package/dist/document-refresh-icon.entry-582ac233.cjs +1 -0
  34. package/dist/{document-refresh-icon.entry-f0d95ac8.js → document-refresh-icon.entry-6dd65cb6.js} +2 -2
  35. package/dist/elements/index.d.ts +8 -0
  36. package/dist/{elements-dc5b338e-62b53496.cjs → elements-dc5b338e-158dce67.cjs} +1 -1
  37. package/dist/{elements-dc5b338e-974e2077.js → elements-dc5b338e-5e8a704b.js} +1 -1
  38. package/dist/{focus-visible-e8093c16-923e1041.cjs → focus-visible-e8093c16-5883a317.cjs} +1 -1
  39. package/dist/{focus-visible-e8093c16-7a512fc0.js → focus-visible-e8093c16-9d88e8ee.js} +1 -1
  40. package/dist/{forward-icon_6.entry-45b70066.cjs → forward-icon_6.entry-a59dada5.cjs} +3 -3
  41. package/dist/{forward-icon_6.entry-675c0b73.js → forward-icon_6.entry-acdf04ad.js} +7 -7
  42. package/dist/{globe-icon.entry-3296e427.js → globe-icon.entry-389c0391.js} +2 -2
  43. package/dist/{globe-icon.entry-7ecd6221.cjs → globe-icon.entry-eef27331.cjs} +1 -1
  44. package/dist/google-logo-icon_4.entry-e9be320c.cjs +1 -0
  45. package/dist/google-logo-icon_4.entry-eae19fc8.js +637 -0
  46. package/dist/index-53420959-82a5306f.cjs +1 -0
  47. package/dist/index-53420959-9b1699ec.js +5 -0
  48. package/dist/{index-6d9eeb53-aa1dfa96.cjs → index-6d9eeb53-15c69801.cjs} +1 -1
  49. package/dist/{index-6d9eeb53-4e2a7f9f.js → index-6d9eeb53-c70fc8a7.js} +2 -2
  50. package/dist/index-db48e0b6.cjs +42 -0
  51. package/dist/index-f8317a8e.js +7638 -0
  52. package/dist/{index.es-9cc0eb3c-65f8af0c.js → index.es-b16d0cf5-386496a9.js} +1 -1
  53. package/dist/{index.es-9cc0eb3c-8eefd4fc.cjs → index.es-b16d0cf5-d7f30c4a.cjs} +1 -1
  54. package/dist/{info-icon_2.entry-e612f1d6.cjs → info-icon_2.entry-63914227.cjs} +1 -1
  55. package/dist/{info-icon_2.entry-f06c8dd0.js → info-icon_2.entry-97d75550.js} +5 -5
  56. package/dist/input-dropdown.entry-4d29246a.js +132 -0
  57. package/dist/input-dropdown.entry-629d7b54.cjs +1 -0
  58. package/dist/loading-icon.entry-2f15a09f.cjs +1 -0
  59. package/dist/loading-icon.entry-fc9bc740.js +15 -0
  60. package/dist/{mailbox-store-64b4ef7c-9bd02ffd.cjs → mailbox-store-f11de360-02a6de93.cjs} +1 -1
  61. package/dist/{mailbox-store-64b4ef7c-b56d5e78.js → mailbox-store-f11de360-d781fd36.js} +2 -2
  62. package/dist/{multi-select-dropdown.entry-5bb80d89.cjs → multi-select-dropdown.entry-68fcca98.cjs} +1 -1
  63. package/dist/{multi-select-dropdown.entry-edf10867.js → multi-select-dropdown.entry-8e14e9af.js} +2 -2
  64. package/dist/nylas-booked-event-card_10.entry-4da23b61.cjs +1 -0
  65. package/dist/{nylas-booked-event-card_10.entry-92f6e85d.js → nylas-booked-event-card_10.entry-9487941d.js} +357 -316
  66. package/dist/{nylas-custom-booking-flow.entry-b39a2bf2.js → nylas-custom-booking-flow.entry-0e16973b.js} +32 -32
  67. package/dist/{nylas-custom-booking-flow.entry-cef0041a.cjs → nylas-custom-booking-flow.entry-338b0a8f.cjs} +1 -1
  68. package/dist/nylas-form-card.entry-ca669dea.cjs +1 -0
  69. package/dist/{nylas-form-card.entry-bf4545e2.js → nylas-form-card.entry-ccfa5692.js} +10 -10
  70. package/dist/{nylas-if-state.entry-2739dc10.js → nylas-if-state.entry-93935670.js} +2 -2
  71. package/dist/{nylas-if-state.entry-d7b818a6.cjs → nylas-if-state.entry-faa11bb6.cjs} +1 -1
  72. package/dist/{nylas-list-folders.entry-3197e390.js → nylas-list-folders.entry-14fc1fe8.js} +4 -4
  73. package/dist/{nylas-list-folders.entry-0ec6ba20.cjs → nylas-list-folders.entry-e7e179ea.cjs} +1 -1
  74. package/dist/{nylas-list-threads.entry-9004c490.js → nylas-list-threads.entry-2118b146.js} +3 -3
  75. package/dist/{nylas-list-threads.entry-2a7e1e84.cjs → nylas-list-threads.entry-3f52fc06.cjs} +1 -1
  76. package/dist/{nylas-login.entry-f2927406.js → nylas-login.entry-87a902d6.js} +7 -7
  77. package/dist/{nylas-login.entry-c2ffd6a5.cjs → nylas-login.entry-915f0284.cjs} +1 -1
  78. package/dist/{nylas-mailbox-pagination.entry-839c9ad3.cjs → nylas-mailbox-pagination.entry-9aa8a606.cjs} +1 -1
  79. package/dist/{nylas-mailbox-pagination.entry-e9356835.js → nylas-mailbox-pagination.entry-eedbf796.js} +2 -2
  80. package/dist/{nylas-mailbox-toolbar-button.entry-298a3c47.js → nylas-mailbox-toolbar-button.entry-40b75810.js} +2 -2
  81. package/dist/{nylas-mailbox-toolbar-button.entry-43812d51.cjs → nylas-mailbox-toolbar-button.entry-ba5b826e.cjs} +1 -1
  82. package/dist/{nylas-mailbox.entry-aa42f6c4.js → nylas-mailbox.entry-179e5a5c.js} +3 -3
  83. package/dist/{nylas-mailbox.entry-cf13ddf5.cjs → nylas-mailbox.entry-31de7f8f.cjs} +1 -1
  84. package/dist/{nylas-provider.entry-843b5593.cjs → nylas-provider.entry-46fe01b6.cjs} +1 -1
  85. package/dist/{nylas-provider.entry-1a3a195f.js → nylas-provider.entry-7b70bbdc.js} +36 -36
  86. package/dist/{nylas-scheduler-editor.entry-048e7a8f.cjs → nylas-scheduler-editor.entry-76b68f66.cjs} +2 -2
  87. package/dist/{nylas-scheduler-editor.entry-d56d6d2a.js → nylas-scheduler-editor.entry-f1f80de1.js} +7 -10
  88. package/dist/{nylas-scheduling.entry-7039a890.js → nylas-scheduling.entry-31d13205.js} +83 -70
  89. package/dist/nylas-scheduling.entry-3ce8c52f.cjs +1 -0
  90. package/dist/{nylas-threads-refresh.entry-d951050a.js → nylas-threads-refresh.entry-a3ea46aa.js} +2 -2
  91. package/dist/{nylas-threads-refresh.entry-9cae6ac8.cjs → nylas-threads-refresh.entry-c9f9db8c.cjs} +1 -1
  92. package/dist/{nylas-threads-search.entry-7a4bbc75.js → nylas-threads-search.entry-01482ddf.js} +8 -8
  93. package/dist/{nylas-threads-search.entry-0d34c5a8.cjs → nylas-threads-search.entry-a4ab0d47.cjs} +1 -1
  94. package/dist/{nylas-time-window-picker.entry-062bc8c1.cjs → nylas-time-window-picker.entry-5a3bb0b7.cjs} +1 -1
  95. package/dist/{nylas-time-window-picker.entry-210c3f1a.js → nylas-time-window-picker.entry-5f063b2b.js} +18 -18
  96. package/dist/{nylas-view-thread.entry-db78ed9c.cjs → nylas-view-thread.entry-82e78b82.cjs} +1 -1
  97. package/dist/{nylas-view-thread.entry-8b39a997.js → nylas-view-thread.entry-cb057b9e.js} +6 -6
  98. package/dist/person-icon.entry-3e30c63c.js +15 -0
  99. package/dist/person-icon.entry-78cdc7f9.cjs +1 -0
  100. package/dist/play-icon_2.entry-4fb1938c.cjs +1 -0
  101. package/dist/play-icon_2.entry-71eaad5c.js +25 -0
  102. package/dist/react.cjs +1 -1
  103. package/dist/react.js +116 -108
  104. package/dist/{refresh-icon.entry-e695cf7f.cjs → refresh-icon.entry-3570353d.cjs} +1 -1
  105. package/dist/{refresh-icon.entry-75139a0c.js → refresh-icon.entry-db85d14d.js} +4 -4
  106. package/dist/{register-component-a5a9ca5d-d69a7a05.js → register-component-b2a51b20-8a262dcf.js} +1 -1
  107. package/dist/{register-component-a5a9ca5d-eebf89e7.cjs → register-component-b2a51b20-9a913603.cjs} +1 -1
  108. package/dist/{scheduler-config-store-9ccfba4d-22a58b7d.cjs → scheduler-config-store-9ccfba4d-6806e3cb.cjs} +1 -1
  109. package/dist/{scheduler-config-store-9ccfba4d-fd62a421.js → scheduler-config-store-9ccfba4d-a6745ccc.js} +1 -1
  110. package/dist/{scheduler-store-8a400448-3b007d4d.js → scheduler-store-db06b30a-1e63b67f.js} +119 -116
  111. package/dist/scheduler-store-db06b30a-d5e6b6c3.cjs +1 -0
  112. package/dist/{textarea-component.entry-48feabb3.cjs → textarea-component.entry-be870b8f.cjs} +1 -1
  113. package/dist/{textarea-component.entry-ead5ab00.js → textarea-component.entry-f5f402a1.js} +4 -4
  114. package/dist/time-period-selector.entry-d1a8470b.js +93 -0
  115. package/dist/time-period-selector.entry-fc7d61c6.cjs +1 -0
  116. package/dist/{translate-icon.entry-5f62bc61.cjs → translate-icon.entry-3ae0ddae.cjs} +1 -1
  117. package/dist/{translate-icon.entry-55043beb.js → translate-icon.entry-b91a0449.js} +2 -2
  118. package/dist/{warning-icon.entry-2e0a80da.cjs → warning-icon.entry-54127f45.cjs} +1 -1
  119. package/dist/{warning-icon.entry-fa644462.js → warning-icon.entry-acdc811b.js} +5 -5
  120. package/package.json +3 -3
  121. package/dist/add-circle-icon_2.entry-3ca337a6.js +0 -25
  122. package/dist/add-circle-icon_2.entry-adde5fdf.cjs +0 -1
  123. package/dist/button-component_4.entry-276606e6.js +0 -115
  124. package/dist/button-component_4.entry-e53a8f37.cjs +0 -1
  125. package/dist/calendar-agenda-fill-icon_35.entry-fa968081.cjs +0 -7
  126. package/dist/clock-icon_2.entry-120d672e.js +0 -25
  127. package/dist/clock-icon_2.entry-43873262.cjs +0 -1
  128. package/dist/copy-icon_4.entry-57874c4f.cjs +0 -1
  129. package/dist/document-refresh-icon.entry-f1d3f32d.cjs +0 -1
  130. package/dist/google-logo-icon_4.entry-aa9f8b35.js +0 -584
  131. package/dist/google-logo-icon_4.entry-fd734a59.cjs +0 -1
  132. package/dist/index-53420959-1c0d390d.js +0 -5
  133. package/dist/index-53420959-8e7b10db.cjs +0 -1
  134. package/dist/index-5efb84b8.js +0 -5011
  135. package/dist/index-d36b8fb8.cjs +0 -42
  136. package/dist/input-dropdown_2.entry-ad380260.cjs +0 -1
  137. package/dist/input-dropdown_2.entry-ccd95678.js +0 -220
  138. package/dist/loading-icon.entry-678a6b3f.cjs +0 -1
  139. package/dist/loading-icon.entry-9e6670d5.js +0 -15
  140. package/dist/nylas-booked-event-card_10.entry-ad4671b2.cjs +0 -1
  141. package/dist/nylas-form-card.entry-fba5d623.cjs +0 -1
  142. package/dist/nylas-scheduling.entry-0ad9b1d0.cjs +0 -1
  143. package/dist/play-icon_2.entry-19271982.cjs +0 -1
  144. package/dist/play-icon_2.entry-c53f3cac.js +0 -25
  145. package/dist/scheduler-store-8a400448-44e0edad.cjs +0 -1
@@ -1,12 +1,12 @@
1
- import { r as s, h as c } from "./index-5efb84b8.js";
1
+ import { r as e, h as c } from "./index-f8317a8e.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const t = ".sc-refresh-icon-h{display:flex}", l = t, h = class {
5
- constructor(e) {
6
- s(this, e), this.width = "15", this.height = "15";
5
+ constructor(s) {
6
+ e(this, s), this.width = "15", this.height = "15";
7
7
  }
8
8
  render() {
9
- return c("svg", { key: "b8e3ce375654d185239b5e565cd67dfe716be159", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 32 32", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, c("path", { key: "ac2d663d785eb66715cc6f3e7af97ffda35ec883", d: "M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z" }));
9
+ return c("svg", { key: "03402ef22595092998627fb5f41087a831ab4320", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 32 32", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, c("path", { key: "2e4a1b6a6a02bd6b0bc5e58ed07e5f5903dbcd44", d: "M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z" }));
10
10
  }
11
11
  };
12
12
  h.style = l;
@@ -1,4 +1,4 @@
1
- import { d, Q as m, g as P } from "./index-5efb84b8.js";
1
+ import { d, T as m, g as P } from "./index-f8317a8e.js";
2
2
  function b(e, o, i = "registerComponent") {
3
3
  return new CustomEvent(i, {
4
4
  bubbles: !0,
@@ -1 +1 @@
1
- "use strict";const s=require("./index-d36b8fb8.cjs");function m(e,o,u="registerComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function P(e,o,u="unregisterComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function b(e){return(o,u)=>{const r=e.name;s.debug(`[${r}] Registering component ${r} being called on ${u}`);const l=o.componentWillLoad;if(!l){s.error(`[${r}] componentWillLoad lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const p=o.connectedCallback;if(!p){s.error(`[${r}] connectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const a=o.disconnectedCallback;if(!a){s.error(`[${r}] disconnectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}if(e.storeToProps&&e.stateToProps){const n=Array.from(e.storeToProps.values()),t=Array.from(e.stateToProps.values()),i=n.filter(c=>t.includes(c));if(i.length>0){s.error(`[${r}] Overlapping prop keys detected in ${r} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${i.join(", ")}`);return}}const d=new Map;e.eventToProps&&Object.keys(e.eventToProps).forEach(n=>{var t;d.set(n,(t=e.eventToProps)==null?void 0:t[n])}),o.connectedCallback=function(){s.debug(`[~${r}] connectedCallback called`);const n=p==null?void 0:p.call(this),t=s.getElement(this);return t.dataset.nylasId||(Object.defineProperty(t,"registerNylasComponent",{get(){return!0},enumerable:!0}),Object.defineProperty(t,"stateToProps",{get(){return e.stateToProps},enumerable:!0}),Object.defineProperty(t,"getStoresToProp",{get(){return e.getStoresToProp},enumerable:!0}),Object.defineProperty(t,"storeToProps",{get(){return e.storeToProps},enumerable:!0}),Object.defineProperty(t,"eventToProps",{get(){return d},enumerable:!0}),Object.defineProperty(t,"authToProp",{get(){return e.authToProp},enumerable:!0}),Object.defineProperty(t,"connectorToProp",{get(){return e.connectorToProp},enumerable:!0}),Object.defineProperty(t,"localPropsToProp",{get(){return e.localPropsToProp},enumerable:!0})),n},e.fireRegisterEvent&&(o.componentWillLoad=function(){const n=l==null?void 0:l.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=m(o,i,e.registrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired registration event`),n},o.disconnectedCallback=function(){const n=a==null?void 0:a.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=P(o,i,e.unregistrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired unregistration event`),n})}}exports.RegisterComponent=b;
1
+ "use strict";const s=require("./index-db48e0b6.cjs");function m(e,o,u="registerComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function P(e,o,u="unregisterComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function b(e){return(o,u)=>{const r=e.name;s.debug(`[${r}] Registering component ${r} being called on ${u}`);const l=o.componentWillLoad;if(!l){s.error(`[${r}] componentWillLoad lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const p=o.connectedCallback;if(!p){s.error(`[${r}] connectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const a=o.disconnectedCallback;if(!a){s.error(`[${r}] disconnectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}if(e.storeToProps&&e.stateToProps){const n=Array.from(e.storeToProps.values()),t=Array.from(e.stateToProps.values()),i=n.filter(c=>t.includes(c));if(i.length>0){s.error(`[${r}] Overlapping prop keys detected in ${r} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${i.join(", ")}`);return}}const d=new Map;e.eventToProps&&Object.keys(e.eventToProps).forEach(n=>{var t;d.set(n,(t=e.eventToProps)==null?void 0:t[n])}),o.connectedCallback=function(){s.debug(`[~${r}] connectedCallback called`);const n=p==null?void 0:p.call(this),t=s.getElement(this);return t.dataset.nylasId||(Object.defineProperty(t,"registerNylasComponent",{get(){return!0},enumerable:!0}),Object.defineProperty(t,"stateToProps",{get(){return e.stateToProps},enumerable:!0}),Object.defineProperty(t,"getStoresToProp",{get(){return e.getStoresToProp},enumerable:!0}),Object.defineProperty(t,"storeToProps",{get(){return e.storeToProps},enumerable:!0}),Object.defineProperty(t,"eventToProps",{get(){return d},enumerable:!0}),Object.defineProperty(t,"authToProp",{get(){return e.authToProp},enumerable:!0}),Object.defineProperty(t,"connectorToProp",{get(){return e.connectorToProp},enumerable:!0}),Object.defineProperty(t,"localPropsToProp",{get(){return e.localPropsToProp},enumerable:!0})),n},e.fireRegisterEvent&&(o.componentWillLoad=function(){const n=l==null?void 0:l.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=m(o,i,e.registrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired registration event`),n},o.disconnectedCallback=function(){const n=a==null?void 0:a.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=P(o,i,e.unregistrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired unregistration event`),n})}}exports.RegisterComponent=b;
@@ -1 +1 @@
1
- "use strict";const r=require("./index-d36b8fb8.cjs");function a(n={}){const i={selectedConfiguration:{},configurations:[],listConfigurationsNextCursor:null,calendars:[],currentUser:null,action:null,additionalParticipants:[],hideEditorTabs:[],...n},e=r.createStore(i);function t(){e.set("selectedConfiguration",{...n.selectedConfiguration})}return e.onChange("action",async o=>{o||t()}),{...e,resetSelectedConfiguration:t}}exports.CreateNylasSchedulerConfigStore=a;
1
+ "use strict";const r=require("./index-db48e0b6.cjs");function a(n={}){const i={selectedConfiguration:{},configurations:[],listConfigurationsNextCursor:null,calendars:[],currentUser:null,action:null,additionalParticipants:[],hideEditorTabs:[],...n},e=r.createStore(i);function t(){e.set("selectedConfiguration",{...n.selectedConfiguration})}return e.onChange("action",async o=>{o||t()}),{...e,resetSelectedConfiguration:t}}exports.CreateNylasSchedulerConfigStore=a;
@@ -1,4 +1,4 @@
1
- import { e as r } from "./index-5efb84b8.js";
1
+ import { e as r } from "./index-f8317a8e.js";
2
2
  function s(n = {}) {
3
3
  const o = {
4
4
  selectedConfiguration: {},
@@ -1,4 +1,4 @@
1
- import { d as b, e as z, l as R } from "./index-5efb84b8.js";
1
+ import { d as b, e as z, k as d, m as F } from "./index-f8317a8e.js";
2
2
  var k;
3
3
  (function(a) {
4
4
  a.Component = "component", a.Api = "api", a.Auth = "auth";
@@ -7,11 +7,11 @@ var A;
7
7
  (function(a) {
8
8
  a.endtime_not_in_future = "endtime_not_in_future", a.no_booking_info = "no_booking_info", a.no_timeslot_selected = "no_timeslot_selected", a.no_timezone_selected = "no_timezone_selected", a.no_booking_id = "no_booking_id", a.invalid_start_time = "invalid_start_time", a.invalid_end_time = "invalid_end_time", a.invalid_timezone = "invalid_timezone";
9
9
  })(A || (A = {}));
10
- var B;
10
+ var L;
11
11
  (function(a) {
12
12
  a.invalid_session = "invalid_session", a.general_error = "general_error", a.internal_error = "internal_error", a.invalid_request_error = "invalid_request_error", a.timeslot_not_available = "timeslot_not_available", a.provider_error = "provider_error", a.not_found_error = "not_found_error";
13
- })(B || (B = {}));
14
- class F {
13
+ })(L || (L = {}));
14
+ class R {
15
15
  constructor() {
16
16
  this.component = (e) => {
17
17
  const t = k.Component, s = `${e} Error`;
@@ -99,9 +99,9 @@ class F {
99
99
  };
100
100
  }
101
101
  }
102
- class U {
102
+ class C {
103
103
  constructor({ schedulerAPIURL: e, schedulerStore: t, sessionId: s, configId: i }) {
104
- this.errors = new F(), this.schedulerStore = t, this.schedulerAPIURL = e, this.sessionId = s, this.configId = i;
104
+ this.errors = new R(), this.schedulerStore = t, this.schedulerAPIURL = e, this.sessionId = s, this.configId = i;
105
105
  }
106
106
  getHeaders() {
107
107
  return this.sessionId ? {
@@ -110,8 +110,8 @@ class U {
110
110
  }
111
111
  async makeAPIRequest(e, t, s, i = {}) {
112
112
  try {
113
- const n = new URL(this.schedulerAPIURL);
114
- return n.pathname = e, await (await fetch(decodeURIComponent(n.toString()), {
113
+ const r = new URL(this.schedulerAPIURL);
114
+ return r.pathname = e, await (await fetch(decodeURIComponent(r.toString()), {
115
115
  method: t,
116
116
  headers: {
117
117
  "Content-Type": "application/json",
@@ -120,10 +120,10 @@ class U {
120
120
  },
121
121
  body: s
122
122
  })).json();
123
- } catch (n) {
123
+ } catch (r) {
124
124
  return {
125
125
  error: {
126
- message: n.message,
126
+ message: r.message,
127
127
  title: "API request failed",
128
128
  type: "api"
129
129
  }
@@ -131,9 +131,9 @@ class U {
131
131
  }
132
132
  }
133
133
  getErrorMessage(e) {
134
- var s, i, n, r;
134
+ var s, i, r, n;
135
135
  let t = (e == null ? void 0 : e.message) || (e == null ? void 0 : e.title) || "Something went wrong";
136
- return (e == null ? void 0 : e.type) === "provider_error" && (t = ((i = (s = e == null ? void 0 : e.provider_error) == null ? void 0 : s.error) == null ? void 0 : i.message) || ((r = (n = e == null ? void 0 : e.provider_error) == null ? void 0 : n.error) == null ? void 0 : r.title) || "Something went wrong"), t;
136
+ return (e == null ? void 0 : e.type) === "provider_error" && (t = ((i = (s = e == null ? void 0 : e.provider_error) == null ? void 0 : s.error) == null ? void 0 : i.message) || ((n = (r = e == null ? void 0 : e.provider_error) == null ? void 0 : r.error) == null ? void 0 : n.title) || "Something went wrong"), t;
137
137
  }
138
138
  setConfigId(e) {
139
139
  this.configId = e;
@@ -147,6 +147,9 @@ class U {
147
147
  selectTimezone(e) {
148
148
  this.schedulerStore.set("selectedTimezone", e);
149
149
  }
150
+ selectLanguage(e) {
151
+ this.schedulerStore.set("selectedLanguage", e), d.changeLanguage(e);
152
+ }
150
153
  async toggleAdditionalData(e) {
151
154
  e || await this.refetchAvailability(), this.schedulerStore.set("showBookingForm", e);
152
155
  }
@@ -175,7 +178,7 @@ class U {
175
178
  return await this.getAvailability(s, i);
176
179
  }
177
180
  async resetStoreStateAndFetchAvailability() {
178
- const e = /* @__PURE__ */ new Date(), t = await this.refetchAvailability(), s = this.schedulerStore.get("availability").find((n) => new Date(n.start_time) > /* @__PURE__ */ new Date());
181
+ const e = /* @__PURE__ */ new Date(), t = await this.refetchAvailability(), s = this.schedulerStore.get("availability").find((r) => new Date(r.start_time) > /* @__PURE__ */ new Date());
179
182
  let i = e;
180
183
  return s && (i = s.start_time), this.schedulerStore.set("selectedDate", i), this.schedulerStore.set("eventInfo", null), this.schedulerStore.set("showBookingForm", !1), this.schedulerStore.set("selectedTimeslot", null), t;
181
184
  }
@@ -194,57 +197,57 @@ class U {
194
197
  return this.schedulerStore.set("cancelBookingId", ""), this.schedulerStore.set("cancelledEventInfo", null), e;
195
198
  }
196
199
  async bookTimeslot(e) {
197
- var g;
200
+ var m;
198
201
  this.schedulerStore.set("isLoading", !0);
199
202
  const { selectedTimeslot: t, selectedTimezone: s, bookingInfo: i } = this.schedulerStore.state;
200
203
  if (!e && !i)
201
- return { error: this.errors.component("Booking").no_booking_info() };
202
- const n = (e == null ? void 0 : e.timeslot) || t;
203
- if (!n)
204
- return { error: this.errors.component("Create Booking").no_timeslot_selected() };
205
- const r = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s;
204
+ return { error: this.errors.component(d.t("createBookingErrorTitle")).no_booking_info() };
205
+ const r = (e == null ? void 0 : e.timeslot) || t;
206
206
  if (!r)
207
- return { error: this.errors.component("Create Booking").no_timezone_selected() };
207
+ return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timeslot_selected() };
208
+ const n = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s;
209
+ if (!n)
210
+ return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timezone_selected() };
208
211
  const o = this.schedulerStore.get("availabilityOrderEmails");
209
- let h = "";
212
+ let u = "";
210
213
  if (o.length > 0) {
211
- const u = n.emails;
214
+ const g = r.emails;
212
215
  for (let c = 0; c < o.length; c++)
213
- if (u.includes(o[c])) {
214
- h = o[c];
216
+ if (g.includes(o[c])) {
217
+ u = o[c];
215
218
  break;
216
219
  }
217
220
  }
218
- const m = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, d = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], v = e ? e == null ? void 0 : e.additionalFields : i == null ? void 0 : i.additionalFields, y = this.getHeaders(), f = `/v3/scheduling/bookings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : ""}`, l = await this.makeAPIRequest(decodeURIComponent(f), "POST", JSON.stringify({
219
- participants: h ? [{ email: h }] : void 0,
220
- additional_fields: v,
221
- additional_guests: d,
222
- guest: { ...m },
223
- start_time: n.start_time.getTime() / 1e3,
224
- end_time: n.end_time.getTime() / 1e3,
225
- timezone: r
226
- }), y);
221
+ const _ = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, h = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], y = e ? e == null ? void 0 : e.additionalFields : i == null ? void 0 : i.additionalFields, I = this.getHeaders(), S = `/v3/scheduling/bookings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : ""}`, l = await this.makeAPIRequest(decodeURIComponent(S), "POST", JSON.stringify({
222
+ participants: u ? [{ email: u }] : void 0,
223
+ additional_fields: y,
224
+ additional_guests: h,
225
+ guest: { ..._ },
226
+ start_time: r.start_time.getTime() / 1e3,
227
+ end_time: r.end_time.getTime() / 1e3,
228
+ timezone: n
229
+ }), I);
227
230
  if ("error" in l) {
228
231
  this.schedulerStore.set("isLoading", !1);
229
- const u = (g = l.error) == null ? void 0 : g.type;
232
+ const g = (m = l.error) == null ? void 0 : m.type;
230
233
  let c = l.error;
231
- if (u && u in this.errors.api("Create Booking")) {
234
+ if (g && g in this.errors.api("Create Booking")) {
232
235
  const w = this.getErrorMessage(c);
233
- c = this.errors.api("Create Booking")[u](w);
236
+ c = this.errors.api("Create Booking")[g](w);
234
237
  }
235
238
  return { error: c };
236
239
  }
237
240
  return "data" in l && this.schedulerStore.set("eventInfo", l == null ? void 0 : l.data), this.schedulerStore.set("isLoading", !1), l;
238
241
  }
239
242
  async getUISettings() {
240
- var n;
243
+ var r;
241
244
  this.schedulerStore.set("isLoading", !0);
242
245
  const e = this.getHeaders(), s = `/v3/scheduling/ui-settings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : ""}`, i = await this.makeAPIRequest(s, "GET", void 0, e);
243
246
  if ("error" in i) {
244
247
  this.schedulerStore.set("isLoading", !1);
245
- const r = (n = i.error) == null ? void 0 : n.type;
248
+ const n = (r = i.error) == null ? void 0 : r.type;
246
249
  let o = i.error;
247
- return r && r in this.errors.api("Get UI Settings") && (o = this.errors.api("Get UI Settings")[r]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
250
+ return n && n in this.errors.api(d.t("getUISettingErrorTitle")) && (o = this.errors.api(d.t("getUISettingErrorTitle"))[n]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
248
251
  }
249
252
  return "data" in i && this.schedulerStore.set("configSettings", i.data), this.schedulerStore.set("isLoading", !1), i;
250
253
  }
@@ -254,16 +257,16 @@ class U {
254
257
  return s ? e + s * 60 : e;
255
258
  }
256
259
  getEndTimeForAvailableDaysInFuture(e) {
257
- var r, o;
258
- const t = /* @__PURE__ */ new Date(), s = (o = (r = this.schedulerStore.get("configSettings")) == null ? void 0 : r.scheduler) == null ? void 0 : o.available_days_in_future, i = Math.floor(R(t, s).getTime() / 1e3);
260
+ var n, o;
261
+ const t = /* @__PURE__ */ new Date(), s = (o = (n = this.schedulerStore.get("configSettings")) == null ? void 0 : n.scheduler) == null ? void 0 : o.available_days_in_future, i = Math.floor(F(t, s).getTime() / 1e3);
259
262
  return Math.min(i, e);
260
263
  }
261
264
  async getAvailability(e = 0, t = 0) {
262
- var v, y, _, f;
265
+ var y, I, f, S;
263
266
  this.schedulerStore.set("isLoading", !0);
264
- const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), n = i.getTime();
265
- if (t && t < n / 1e3)
266
- return this.schedulerStore.set("isLoading", !1), { error: this.errors.component("Get Availability").endtime_not_in_future() };
267
+ const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), r = i.getTime();
268
+ if (t && t < r / 1e3)
269
+ return this.schedulerStore.set("isLoading", !1), { error: this.errors.component(d.t("getAvailabilityErrorTitle")).endtime_not_in_future() };
267
270
  if (!e) {
268
271
  const l = new Date(i.getFullYear(), i.getMonth(), 1);
269
272
  e = Math.floor(l.getTime() / 1e3);
@@ -273,110 +276,110 @@ class U {
273
276
  t = Math.floor(l.getTime() / 1e3);
274
277
  }
275
278
  t = this.getEndTimeForAvailableDaysInFuture(t), s.append("start_time", encodeURIComponent(e.toString())), s.append("end_time", encodeURIComponent(t.toString())), this.configId && !this.sessionId && s.append("configuration_id", encodeURIComponent(this.configId));
276
- const r = this.schedulerStore.get("rescheduleBookingId");
277
- r && s.append("booking_id", encodeURIComponent(r));
278
- const o = s.toString(), h = `/v3/scheduling/availability${o ? `?${o}` : ""}`, m = this.getHeaders(), d = await this.makeAPIRequest(decodeURIComponent(h), "GET", void 0, m);
279
- if ("error" in d) {
279
+ const n = this.schedulerStore.get("rescheduleBookingId");
280
+ n && s.append("booking_id", encodeURIComponent(n));
281
+ const o = s.toString(), u = `/v3/scheduling/availability${o ? `?${o}` : ""}`, _ = this.getHeaders(), h = await this.makeAPIRequest(decodeURIComponent(u), "GET", void 0, _);
282
+ if ("error" in h) {
280
283
  this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
281
- const l = (v = d.error) == null ? void 0 : v.type;
282
- let g = d.error;
283
- if (l && l in this.errors.api("Get Availability")) {
284
- const u = this.getErrorMessage(g);
285
- g = this.errors.api("Get Availability")[l](u);
284
+ const l = (y = h.error) == null ? void 0 : y.type;
285
+ let m = h.error;
286
+ if (l && l in this.errors.api(d.t("getAvailabilityErrorTitle"))) {
287
+ const g = this.getErrorMessage(m);
288
+ m = this.errors.api(d.t("getAvailabilityErrorTitle"))[l](g);
286
289
  }
287
- return { error: g };
290
+ return { error: m };
288
291
  }
289
- if ("data" in d) {
290
- const g = (((_ = (y = d.data) == null ? void 0 : y.time_slots) == null ? void 0 : _.map((c) => ({
292
+ if ("data" in h) {
293
+ const m = (((f = (I = h.data) == null ? void 0 : I.time_slots) == null ? void 0 : f.map((c) => ({
291
294
  ...c,
292
295
  start_time: new Date(c.start_time * 1e3),
293
296
  end_time: new Date(c.end_time * 1e3)
294
- }))) || []).filter((c) => c.start_time.getTime() > n);
295
- this.schedulerStore.set("availability", g);
296
- const u = ((f = d.data) == null ? void 0 : f.order) || [];
297
- this.schedulerStore.set("availabilityOrderEmails", u);
297
+ }))) || []).filter((c) => c.start_time.getTime() > r);
298
+ this.schedulerStore.set("availability", m);
299
+ const g = ((S = h.data) == null ? void 0 : S.order) || [];
300
+ this.schedulerStore.set("availabilityOrderEmails", g);
298
301
  }
299
- return this.schedulerStore.set("isLoading", !1), d;
302
+ return this.schedulerStore.set("isLoading", !1), h;
300
303
  }
301
304
  async cancelBooking(e, t) {
302
305
  var o;
303
306
  if (this.schedulerStore.set("isLoading", !0), !e)
304
- return { error: this.errors.component("Cancel Booking").no_booking_id() };
305
- const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : "", i = `/v3/scheduling/bookings/${e}${s}`, n = this.getHeaders(), r = await this.makeAPIRequest(decodeURIComponent(i), "DELETE", JSON.stringify({
307
+ return { error: this.errors.component(d.t("cancelBookingErrorTitle")).no_booking_id() };
308
+ const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : "", i = `/v3/scheduling/bookings/${e}${s}`, r = this.getHeaders(), n = await this.makeAPIRequest(decodeURIComponent(i), "DELETE", JSON.stringify({
306
309
  action: "cancel",
307
310
  cancellation_reason: t
308
- }), n);
309
- if ("error" in r) {
311
+ }), r);
312
+ if ("error" in n) {
310
313
  this.schedulerStore.set("isLoading", !1);
311
- const h = (o = r.error) == null ? void 0 : o.type;
312
- let m = r.error;
313
- if (h && h in this.errors.api("Cancel Booking")) {
314
- const d = this.getErrorMessage(m);
315
- m = this.errors.api("Cancel Booking")[h](d);
314
+ const u = (o = n.error) == null ? void 0 : o.type;
315
+ let _ = n.error;
316
+ if (u && u in this.errors.api(d.t("cancelBookingErrorTitle"))) {
317
+ const h = this.getErrorMessage(_);
318
+ _ = this.errors.api(d.t("cancelBookingErrorTitle"))[u](h);
316
319
  }
317
- return { error: m };
320
+ return { error: _ };
318
321
  }
319
322
  return this.schedulerStore.set("cancelledEventInfo", {
320
323
  booking_id: e
321
- }), this.schedulerStore.set("rescheduleBookingId", ""), this.schedulerStore.set("isLoading", !1), r;
324
+ }), this.schedulerStore.set("rescheduleBookingId", ""), this.schedulerStore.set("isLoading", !1), n;
322
325
  }
323
326
  async rescheduleBooking(e, t) {
324
- var D;
327
+ var E;
325
328
  if (this.schedulerStore.set("isLoading", !0), !e)
326
- return { error: this.errors.component("Reschedule Booking").no_booking_id() };
327
- const s = this.errors.api("Reschedule Booking"), i = this.errors.component("Reschedule Booking"), { bookingInfo: n, selectedTimeslot: r, selectedTimezone: o } = this.schedulerStore.state, { startTime: h, endTime: m, timezone: d } = t, v = h || (r == null ? void 0 : r.start_time);
328
- if (!v)
329
- return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
330
- const y = m || (r == null ? void 0 : r.end_time);
329
+ return { error: this.errors.component(d.t("rescheduleBookingErrorTitle")).no_booking_id() };
330
+ const s = this.errors.api(d.t("rescheduleBookingErrorTitle")), i = this.errors.component(d.t("rescheduleBookingErrorTitle")), { bookingInfo: r, selectedTimeslot: n, selectedTimezone: o } = this.schedulerStore.state, { startTime: u, endTime: _, timezone: h } = t, y = u || (n == null ? void 0 : n.start_time);
331
331
  if (!y)
332
+ return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
333
+ const I = _ || (n == null ? void 0 : n.end_time);
334
+ if (!I)
332
335
  return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
333
- const _ = this.schedulerStore.get("availabilityOrderEmails");
334
- let f = "";
335
- if (_.length > 0) {
336
- const I = (r == null ? void 0 : r.emails) || [];
337
- for (let p = 0; p < _.length; p++)
338
- if (I.includes(_[p])) {
339
- f = _[p];
336
+ const f = this.schedulerStore.get("availabilityOrderEmails");
337
+ let S = "";
338
+ if (f.length > 0) {
339
+ const T = (n == null ? void 0 : n.emails) || [];
340
+ for (let v = 0; v < f.length; v++)
341
+ if (T.includes(f[v])) {
342
+ S = f[v];
340
343
  break;
341
344
  }
342
345
  }
343
- const l = d || o;
346
+ const l = h || o;
344
347
  if (!l)
345
348
  return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
346
- const g = t ? t == null ? void 0 : t.primaryParticipant : n == null ? void 0 : n.primaryParticipant, u = t ? (t == null ? void 0 : t.guests) || [] : (n == null ? void 0 : n.guests) || [], c = t ? t == null ? void 0 : t.additionalFields : n == null ? void 0 : n.additionalFields, w = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : "", P = `/v3/scheduling/bookings/${e}${w}`, L = this.getHeaders(), S = await this.makeAPIRequest(decodeURIComponent(P), "PATCH", JSON.stringify({
347
- start_time: v.getTime() / 1e3,
348
- end_time: y.getTime() / 1e3,
349
+ const m = t ? t == null ? void 0 : t.primaryParticipant : r == null ? void 0 : r.primaryParticipant, g = t ? (t == null ? void 0 : t.guests) || [] : (r == null ? void 0 : r.guests) || [], c = t ? t == null ? void 0 : t.additionalFields : r == null ? void 0 : r.additionalFields, w = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : "", B = `/v3/scheduling/bookings/${e}${w}`, P = this.getHeaders(), p = await this.makeAPIRequest(decodeURIComponent(B), "PATCH", JSON.stringify({
350
+ start_time: y.getTime() / 1e3,
351
+ end_time: I.getTime() / 1e3,
349
352
  time_zone: l,
350
353
  additional_fields: c,
351
- guest: { ...g },
352
- additional_guests: u,
353
- participants: f ? [{ email: f }] : void 0
354
- }), L);
355
- if ("error" in S) {
354
+ guest: { ...m },
355
+ additional_guests: g,
356
+ participants: S ? [{ email: S }] : void 0
357
+ }), P);
358
+ if ("error" in p) {
356
359
  this.schedulerStore.set("isLoading", !1);
357
- const I = (D = S.error) == null ? void 0 : D.type;
358
- let p = S.error;
359
- if (I && I in s) {
360
- const M = this.getErrorMessage(p);
361
- p = s[I](M);
360
+ const T = (E = p.error) == null ? void 0 : E.type;
361
+ let v = p.error;
362
+ if (T && T in s) {
363
+ const M = this.getErrorMessage(v);
364
+ v = s[T](M);
362
365
  }
363
- return { error: p };
366
+ return { error: v };
364
367
  }
365
- const T = this.schedulerStore.get("reschedulingEventInfo");
366
- if ("data" in S)
367
- this.schedulerStore.set("eventInfo", S == null ? void 0 : S.data);
368
- else if (T)
369
- this.schedulerStore.set("eventInfo", T);
368
+ const D = this.schedulerStore.get("reschedulingEventInfo");
369
+ if ("data" in p)
370
+ this.schedulerStore.set("eventInfo", p == null ? void 0 : p.data);
371
+ else if (D)
372
+ this.schedulerStore.set("eventInfo", D);
370
373
  else {
371
- const I = {
374
+ const T = {
372
375
  booking_id: e
373
376
  };
374
- this.schedulerStore.set("eventInfo", I);
377
+ this.schedulerStore.set("eventInfo", T);
375
378
  }
376
- return this.schedulerStore.set("isLoading", !1), S;
379
+ return this.schedulerStore.set("isLoading", !1), p;
377
380
  }
378
381
  }
379
- function E(a = {}) {
382
+ function N(a = {}) {
380
383
  const e = {
381
384
  selectedDate: null,
382
385
  selectedLanguage: navigator.language,
@@ -400,11 +403,11 @@ function E(a = {}) {
400
403
  b("[availability]: ", s);
401
404
  const i = s.map((o) => o.start_time);
402
405
  b("[selectableDates]: ", i), t.set("selectableDates", i);
403
- const n = s[0];
404
- if (!n)
406
+ const r = s[0];
407
+ if (!r)
405
408
  return;
406
- const r = Math.floor((n.end_time.getTime() - n.start_time.getTime()) / 6e4);
407
- b("[durationMinutes]: ", r), t.set("eventDuration", r);
409
+ const n = Math.floor((r.end_time.getTime() - r.start_time.getTime()) / 6e4);
410
+ b("[durationMinutes]: ", n), t.set("eventDuration", n);
408
411
  }), t.reset = () => {
409
412
  for (const s in e) {
410
413
  const i = e[s];
@@ -413,7 +416,7 @@ function E(a = {}) {
413
416
  }, t;
414
417
  }
415
418
  export {
416
- E as C,
419
+ N as C,
417
420
  k as E,
418
- U as N
421
+ C as N
419
422
  };
@@ -0,0 +1 @@
1
+ "use strict";const c=require("./index-db48e0b6.cjs");exports.ErrorCategory=void 0;(function(a){a.Component="component",a.Api="api",a.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var D;(function(a){a.endtime_not_in_future="endtime_not_in_future",a.no_booking_info="no_booking_info",a.no_timeslot_selected="no_timeslot_selected",a.no_timezone_selected="no_timezone_selected",a.no_booking_id="no_booking_id",a.invalid_start_time="invalid_start_time",a.invalid_end_time="invalid_end_time",a.invalid_timezone="invalid_timezone"})(D||(D={}));var E;(function(a){a.invalid_session="invalid_session",a.general_error="general_error",a.internal_error="internal_error",a.invalid_request_error="invalid_request_error",a.timeslot_not_available="timeslot_not_available",a.provider_error="provider_error",a.not_found_error="not_found_error"})(E||(E={}));class P{constructor(){this.component=e=>{const t=exports.ErrorCategory.Component,s=`${e} Error`;return{endtime_not_in_future:(i='"endtime" can not be in the future')=>({title:s,message:i,category:t}),no_booking_info:(i="No booking info provided")=>({title:s,message:i,category:t}),no_timeslot_selected:(i="No timeslot selected")=>({title:s,message:i,category:t}),no_timezone_selected:(i="No timezone selected")=>({title:s,message:i,category:t}),no_booking_id:(i="No booking id provided")=>({title:s,message:i,category:t}),invalid_start_time:(i="Invalid start time")=>({title:s,message:i,category:t}),invalid_end_time:(i="Invalid end time")=>({title:s,message:i,category:t}),invalid_timezone:(i="Invalid timezone")=>({title:s,message:i,category:t})}},this.api=e=>{const t=exports.ErrorCategory.Api,s=`${e} Error`;return{invalid_session:i=>({title:s,message:i,category:t}),general_error:i=>({title:s,message:i,category:t}),internal_error:i=>({title:s,message:i,category:t}),invalid_request_error:i=>({title:s,message:i,category:t}),timeslot_not_available:i=>({title:s,message:i,category:t}),provider_error:i=>({title:s,message:i,category:t}),not_found_error:i=>({title:s,message:i,category:t})}}}}class M{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:s,configId:i}){this.errors=new P,this.schedulerStore=t,this.schedulerAPIURL=e,this.sessionId=s,this.configId=i}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,s,i={}){try{const r=new URL(this.schedulerAPIURL);return r.pathname=e,await(await fetch(decodeURIComponent(r.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,...i},body:s})).json()}catch(r){return{error:{message:r.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){var s,i,r,n;let t=(e==null?void 0:e.message)||(e==null?void 0:e.title)||"Something went wrong";return(e==null?void 0:e.type)==="provider_error"&&(t=((i=(s=e==null?void 0:e.provider_error)==null?void 0:s.error)==null?void 0:i.message)||((n=(r=e==null?void 0:e.provider_error)==null?void 0:r.error)==null?void 0:n.title)||"Something went wrong"),t}setConfigId(e){this.configId=e}selectDate(e){this.schedulerStore.set("selectedDate",e),this.schedulerStore.set("selectedTimeslot",null)}selectTime(e){this.schedulerStore.set("selectedTimeslot",e)}selectTimezone(e){this.schedulerStore.set("selectedTimezone",e)}selectLanguage(e){this.schedulerStore.set("selectedLanguage",e),c.instance.changeLanguage(e)}async toggleAdditionalData(e){e||await this.refetchAvailability(),this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,email:e}})}async refetchAvailability(){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,s=t<e.getTime()/1e3?Math.floor(e.getTime()/1e3):t,i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;return await this.getAvailability(s,i)}async resetStoreStateAndFetchAvailability(){const e=new Date,t=await this.refetchAvailability(),s=this.schedulerStore.get("availability").find(r=>new Date(r.start_time)>new Date);let i=e;return s&&(i=s.start_time),this.schedulerStore.set("selectedDate",i),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1),this.schedulerStore.set("selectedTimeslot",null),t}async setReschedule(e){this.schedulerStore.set("isLoading",!0);const t=this.schedulerStore.state.eventInfo;return t&&this.schedulerStore.set("reschedulingEventInfo",t),this.schedulerStore.set("rescheduleBookingId",e),await this.resetStoreStateAndFetchAvailability().finally(()=>{this.schedulerStore.set("isLoading",!1)})}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("cancelBookingId",""),this.schedulerStore.set("cancelledEventInfo",null),e}async bookTimeslot(e){var m;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:t,selectedTimezone:s,bookingInfo:i}=this.schedulerStore.state;if(!e&&!i)return{error:this.errors.component(c.instance.t("createBookingErrorTitle")).no_booking_info()};const r=(e==null?void 0:e.timeslot)||t;if(!r)return{error:this.errors.component(c.instance.t("createBookingErrorTitle")).no_timeslot_selected()};const n=e&&(e!=null&&e.timezone)?e==null?void 0:e.timezone:s;if(!n)return{error:this.errors.component(c.instance.t("createBookingErrorTitle")).no_timezone_selected()};const o=this.schedulerStore.get("availabilityOrderEmails");let u="";if(o.length>0){const g=r.emails;for(let d=0;d<o.length;d++)if(g.includes(o[d])){u=o[d];break}}const _=e?e==null?void 0:e.primaryParticipant:i==null?void 0:i.primaryParticipant,h=e?(e==null?void 0:e.guests)||[]:(i==null?void 0:i.guests)||[],y=e?e==null?void 0:e.additionalFields:i==null?void 0:i.additionalFields,I=this.getHeaders(),S=`/v3/scheduling/bookings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:""}`,l=await this.makeAPIRequest(decodeURIComponent(S),"POST",JSON.stringify({participants:u?[{email:u}]:void 0,additional_fields:y,additional_guests:h,guest:{..._},start_time:r.start_time.getTime()/1e3,end_time:r.end_time.getTime()/1e3,timezone:n}),I);if("error"in l){this.schedulerStore.set("isLoading",!1);const g=(m=l.error)==null?void 0:m.type;let d=l.error;if(g&&g in this.errors.api("Create Booking")){const T=this.getErrorMessage(d);d=this.errors.api("Create Booking")[g](T)}return{error:d}}return"data"in l&&this.schedulerStore.set("eventInfo",l==null?void 0:l.data),this.schedulerStore.set("isLoading",!1),l}async getUISettings(){var r;this.schedulerStore.set("isLoading",!0);const e=this.getHeaders(),s=`/v3/scheduling/ui-settings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:""}`,i=await this.makeAPIRequest(s,"GET",void 0,e);if("error"in i){this.schedulerStore.set("isLoading",!1);const n=(r=i.error)==null?void 0:r.type;let o=i.error;return n&&n in this.errors.api(c.instance.t("getUISettingErrorTitle"))&&(o=this.errors.api(c.instance.t("getUISettingErrorTitle"))[n]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}return"data"in i&&this.schedulerStore.set("configSettings",i.data),this.schedulerStore.set("isLoading",!1),i}getStartTimeWithMinBookingNotice(e){var i;const t=(i=this.schedulerStore.get("configSettings"))==null?void 0:i.scheduler,s=t==null?void 0:t.min_booking_notice;return s?e+s*60:e}getEndTimeForAvailableDaysInFuture(e){var n,o;const t=new Date,s=(o=(n=this.schedulerStore.get("configSettings"))==null?void 0:n.scheduler)==null?void 0:o.available_days_in_future,i=Math.floor(c.addDaysToCurrentDate(t,s).getTime()/1e3);return Math.min(i,e)}async getAvailability(e=0,t=0){var y,I,f,S;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,i=new Date,r=i.getTime();if(t&&t<r/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component(c.instance.t("getAvailabilityErrorTitle")).endtime_not_in_future()};if(!e){const l=new Date(i.getFullYear(),i.getMonth(),1);e=Math.floor(l.getTime()/1e3)}if(e=this.getStartTimeWithMinBookingNotice(e),!t){const l=new Date(i.getFullYear(),i.getMonth()+1,0);t=Math.floor(l.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(t),s.append("start_time",encodeURIComponent(e.toString())),s.append("end_time",encodeURIComponent(t.toString())),this.configId&&!this.sessionId&&s.append("configuration_id",encodeURIComponent(this.configId));const n=this.schedulerStore.get("rescheduleBookingId");n&&s.append("booking_id",encodeURIComponent(n));const o=s.toString(),u=`/v3/scheduling/availability${o?`?${o}`:""}`,_=this.getHeaders(),h=await this.makeAPIRequest(decodeURIComponent(u),"GET",void 0,_);if("error"in h){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const l=(y=h.error)==null?void 0:y.type;let m=h.error;if(l&&l in this.errors.api(c.instance.t("getAvailabilityErrorTitle"))){const g=this.getErrorMessage(m);m=this.errors.api(c.instance.t("getAvailabilityErrorTitle"))[l](g)}return{error:m}}if("data"in h){const m=(((f=(I=h.data)==null?void 0:I.time_slots)==null?void 0:f.map(d=>({...d,start_time:new Date(d.start_time*1e3),end_time:new Date(d.end_time*1e3)})))||[]).filter(d=>d.start_time.getTime()>r);this.schedulerStore.set("availability",m);const g=((S=h.data)==null?void 0:S.order)||[];this.schedulerStore.set("availabilityOrderEmails",g)}return this.schedulerStore.set("isLoading",!1),h}async cancelBooking(e,t){var o;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(c.instance.t("cancelBookingErrorTitle")).no_booking_id()};const s=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:"",i=`/v3/scheduling/bookings/${e}${s}`,r=this.getHeaders(),n=await this.makeAPIRequest(decodeURIComponent(i),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),r);if("error"in n){this.schedulerStore.set("isLoading",!1);const u=(o=n.error)==null?void 0:o.type;let _=n.error;if(u&&u in this.errors.api(c.instance.t("cancelBookingErrorTitle"))){const h=this.getErrorMessage(_);_=this.errors.api(c.instance.t("cancelBookingErrorTitle"))[u](h)}return{error:_}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:e}),this.schedulerStore.set("rescheduleBookingId",""),this.schedulerStore.set("isLoading",!1),n}async rescheduleBooking(e,t){var w;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(c.instance.t("rescheduleBookingErrorTitle")).no_booking_id()};const s=this.errors.api(c.instance.t("rescheduleBookingErrorTitle")),i=this.errors.component(c.instance.t("rescheduleBookingErrorTitle")),{bookingInfo:r,selectedTimeslot:n,selectedTimezone:o}=this.schedulerStore.state,{startTime:u,endTime:_,timezone:h}=t,y=u||(n==null?void 0:n.start_time);if(!y)return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const I=_||(n==null?void 0:n.end_time);if(!I)return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const f=this.schedulerStore.get("availabilityOrderEmails");let S="";if(f.length>0){const b=(n==null?void 0:n.emails)||[];for(let v=0;v<f.length;v++)if(b.includes(f[v])){S=f[v];break}}const l=h||o;if(!l)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const m=t?t==null?void 0:t.primaryParticipant:r==null?void 0:r.primaryParticipant,g=t?(t==null?void 0:t.guests)||[]:(r==null?void 0:r.guests)||[],d=t?t==null?void 0:t.additionalFields:r==null?void 0:r.additionalFields,T=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:"",A=`/v3/scheduling/bookings/${e}${T}`,L=this.getHeaders(),p=await this.makeAPIRequest(decodeURIComponent(A),"PATCH",JSON.stringify({start_time:y.getTime()/1e3,end_time:I.getTime()/1e3,time_zone:l,additional_fields:d,guest:{...m},additional_guests:g,participants:S?[{email:S}]:void 0}),L);if("error"in p){this.schedulerStore.set("isLoading",!1);const b=(w=p.error)==null?void 0:w.type;let v=p.error;if(b&&b in s){const B=this.getErrorMessage(v);v=s[b](B)}return{error:v}}const k=this.schedulerStore.get("reschedulingEventInfo");if("data"in p)this.schedulerStore.set("eventInfo",p==null?void 0:p.data);else if(k)this.schedulerStore.set("eventInfo",k);else{const b={booking_id:e};this.schedulerStore.set("eventInfo",b)}return this.schedulerStore.set("isLoading",!1),p}}function z(a={}){const e={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,availabilityOrderEmails:[],selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...a};c.debug("[defaultNylasStoreState]: ",e);const t=c.createStore(e);return t.onChange("availability",s=>{c.debug("[availability]: ",s);const i=s.map(o=>o.start_time);c.debug("[selectableDates]: ",i),t.set("selectableDates",i);const r=s[0];if(!r)return;const n=Math.floor((r.end_time.getTime()-r.start_time.getTime())/6e4);c.debug("[durationMinutes]: ",n),t.set("eventDuration",n)}),t.reset=()=>{for(const s in e){const i=e[s];t.set(s,i)}},t}exports.CreateNylasSchedulerStore=z;exports.NylaSchedulerAPIConnector=M;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-d36b8fb8.cjs"),r=require("./index-6d9eeb53-aa1dfa96.cjs");require("./index-53420959-8e7b10db.cjs");require("react");require("react-dom");const l=':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:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}',n=l,t=class{constructor(e){a.registerInstance(this,e),this.nylasFormInputChanged=a.createEvent(this,"nylasFormInputChanged",7),this.name="textarea",this.defaultValue="",this.label="",this.placeholder="",this.required=!1,this.readOnly=!1,this.autoFocus=!1,this.maxLength=255,this.type="multi_line_text",this.value="",this.error=""}componentWillLoad(){this.value=r.sanitizeHtml$1(this.defaultValue)}handleBookingFormSubmitted(e){this.validate(this.value),this.error&&e.preventDefault()}handleInput(e){const s=e.target;this.value=r.sanitizeHtml$1(s.value),this.nylasFormInputChanged.emit({value:this.value,name:this.name,error:this.error,label:this.label,type:this.type})}validate(e){this.required&&!e?this.error=`${this.label} is required.`:e.length>this.maxLength?this.error=`${this.label} cannot exceed ${this.maxLength} characters.`:this.error=""}render(){return a.h("label",{key:"d3b47fecea63bd4674d4d9e67e7f74697004b03e",part:"tc__label",class:{error:!!this.error}},a.h("p",{key:"81b682db7ded02d9111661e2ffe1cc0650546bfc"},a.h("span",{key:"2e2120f1d32af6b5fffff7ee913f01c6d73155eb",class:"label"},this.label),this.required&&a.h("span",{class:"required"},"*")),a.h("textarea",{key:"bc7426f389b42a25a251a3b8b878e3b2ee8fd5a0",name:this.name,placeholder:this.placeholder,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,onInput:e=>this.handleInput(e),class:{error:!!this.error},part:"tc__textarea"}),this.error&&a.h("span",{class:"error help-text"},this.error))}};t.style=n;exports.textarea_component=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-db48e0b6.cjs"),r=require("./index-6d9eeb53-15c69801.cjs");require("./index-53420959-82a5306f.cjs");require("react");require("react-dom");const l=':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:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}',n=l,t=class{constructor(e){a.registerInstance(this,e),this.nylasFormInputChanged=a.createEvent(this,"nylasFormInputChanged",7),this.name="textarea",this.defaultValue="",this.label="",this.placeholder="",this.required=!1,this.readOnly=!1,this.autoFocus=!1,this.maxLength=255,this.type="multi_line_text",this.value="",this.error=""}componentWillLoad(){this.value=r.sanitizeHtml$1(this.defaultValue)}handleBookingFormSubmitted(e){this.validate(this.value),this.error&&e.preventDefault()}handleInput(e){const s=e.target;this.value=r.sanitizeHtml$1(s.value),this.nylasFormInputChanged.emit({value:this.value,name:this.name,error:this.error,label:this.label,type:this.type})}validate(e){this.required&&!e?this.error=`${this.label} is required.`:e.length>this.maxLength?this.error=`${this.label} cannot exceed ${this.maxLength} characters.`:this.error=""}render(){return a.h("label",{key:"c4613e2747b6ef5345a0c83ad10c1708b39a40f5",part:"tc__label",class:{error:!!this.error}},a.h("p",{key:"c59a2f5b0f2ebf9f995bc9583c36cca7efe44364"},a.h("span",{key:"9a3eb4aa71ad8f8d71ee644e3c4c137e6f1b4bb0",class:"label"},this.label),this.required&&a.h("span",{class:"required"},"*")),a.h("textarea",{key:"d3536d83d71282935863a947fc3dd0ced53e0e0b",name:this.name,placeholder:this.placeholder,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,onInput:e=>this.handleInput(e),class:{error:!!this.error},part:"tc__textarea"}),this.error&&a.h("span",{class:"error help-text"},this.error))}};t.style=n;exports.textarea_component=t;
@@ -1,6 +1,6 @@
1
- import { r as t, c as l, h as a } from "./index-5efb84b8.js";
2
- import { s as r } from "./index-6d9eeb53-4e2a7f9f.js";
3
- import "./index-53420959-1c0d390d.js";
1
+ import { r as t, c as l, h as a } from "./index-f8317a8e.js";
2
+ import { s as r } from "./index-6d9eeb53-c70fc8a7.js";
3
+ import "./index-53420959-9b1699ec.js";
4
4
  import "react";
5
5
  import "react-dom";
6
6
  const n = ':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:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}', i = n, o = class {
@@ -27,7 +27,7 @@ const n = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--n
27
27
  this.required && !e ? this.error = `${this.label} is required.` : e.length > this.maxLength ? this.error = `${this.label} cannot exceed ${this.maxLength} characters.` : this.error = "";
28
28
  }
29
29
  render() {
30
- return a("label", { key: "d3b47fecea63bd4674d4d9e67e7f74697004b03e", part: "tc__label", class: { error: !!this.error } }, a("p", { key: "81b682db7ded02d9111661e2ffe1cc0650546bfc" }, a("span", { key: "2e2120f1d32af6b5fffff7ee913f01c6d73155eb", class: "label" }, this.label), this.required && a("span", { class: "required" }, "*")), a("textarea", { key: "bc7426f389b42a25a251a3b8b878e3b2ee8fd5a0", name: this.name, placeholder: this.placeholder, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, maxLength: this.maxLength, onInput: (e) => this.handleInput(e), class: { error: !!this.error }, part: "tc__textarea" }), this.error && a("span", { class: "error help-text" }, this.error));
30
+ return a("label", { key: "c4613e2747b6ef5345a0c83ad10c1708b39a40f5", part: "tc__label", class: { error: !!this.error } }, a("p", { key: "c59a2f5b0f2ebf9f995bc9583c36cca7efe44364" }, a("span", { key: "9a3eb4aa71ad8f8d71ee644e3c4c137e6f1b4bb0", class: "label" }, this.label), this.required && a("span", { class: "required" }, "*")), a("textarea", { key: "d3536d83d71282935863a947fc3dd0ced53e0e0b", name: this.name, placeholder: this.placeholder, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, maxLength: this.maxLength, onInput: (e) => this.handleInput(e), class: { error: !!this.error }, part: "tc__textarea" }), this.error && a("span", { class: "error help-text" }, this.error));
31
31
  }
32
32
  };
33
33
  o.style = i;