@nylas/web-elements 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/dist/nylas-web-elements/{abstract-provider-D75Ucvku.js → abstract-provider-9AZudYSI.js} +2 -2
  2. package/dist/nylas-web-elements/{abstract-provider-D75Ucvku.js.map → abstract-provider-9AZudYSI.js.map} +1 -1
  3. package/dist/nylas-web-elements/add-circle-icon.entry.js +1 -1
  4. package/dist/nylas-web-elements/archive-icon.entry.js +1 -1
  5. package/dist/nylas-web-elements/arrow-icon.entry.js +1 -1
  6. package/dist/nylas-web-elements/bold-icon.entry.js +1 -1
  7. package/dist/nylas-web-elements/button-component.entry.js +1 -1
  8. package/dist/nylas-web-elements/calendar-agenda-fill-icon.entry.js +1 -1
  9. package/dist/nylas-web-elements/calendar-agenda-icon.entry.js +1 -1
  10. package/dist/nylas-web-elements/calendar-cancel-icon.entry.js +1 -1
  11. package/dist/nylas-web-elements/calendar-check-icon.entry.js +1 -1
  12. package/dist/nylas-web-elements/calendar-icon.entry.js +1 -1
  13. package/dist/nylas-web-elements/calendar-info-icon.entry.js +1 -1
  14. package/dist/nylas-web-elements/calendar-patterns-icon.entry.js +1 -1
  15. package/dist/nylas-web-elements/checkbox-component.entry.esm.js.map +1 -1
  16. package/dist/nylas-web-elements/checkbox-component.entry.js +1 -1
  17. package/dist/nylas-web-elements/checkbox-component.entry.js.map +1 -1
  18. package/dist/nylas-web-elements/checkbox-group.entry.js +1 -1
  19. package/dist/nylas-web-elements/checkmark-circle-icon.entry.js +1 -1
  20. package/dist/nylas-web-elements/checkmark-icon.entry.js +1 -1
  21. package/dist/nylas-web-elements/chevron-icon.entry.js +1 -1
  22. package/dist/nylas-web-elements/clock-icon.entry.js +1 -1
  23. package/dist/nylas-web-elements/close-icon.entry.js +1 -1
  24. package/dist/nylas-web-elements/copy-icon.entry.js +1 -1
  25. package/dist/nylas-web-elements/{customParseFormat-Bk5PI6Cs.js → customParseFormat-BJNMxHY2.js} +2 -2
  26. package/dist/nylas-web-elements/{customParseFormat-Bk5PI6Cs.js.map → customParseFormat-BJNMxHY2.js.map} +1 -1
  27. package/dist/nylas-web-elements/delete-icon.entry.js +1 -1
  28. package/dist/nylas-web-elements/document-refresh-icon.entry.js +1 -1
  29. package/dist/nylas-web-elements/dragable-icon.entry.js +1 -1
  30. package/dist/nylas-web-elements/edit-icon.entry.js +1 -1
  31. package/dist/nylas-web-elements/envelope-fill-icon.entry.js +1 -1
  32. package/dist/nylas-web-elements/envelope-icon.entry.js +1 -1
  33. package/dist/nylas-web-elements/eye-icon.entry.js +1 -1
  34. package/dist/nylas-web-elements/feedback-icon.entry.js +1 -1
  35. package/dist/nylas-web-elements/flow-icon.entry.js +1 -1
  36. package/dist/nylas-web-elements/folder-icon.entry.js +1 -1
  37. package/dist/nylas-web-elements/forward-icon.entry.js +1 -1
  38. package/dist/nylas-web-elements/globe-icon.entry.js +1 -1
  39. package/dist/nylas-web-elements/google-logo-icon.entry.js +1 -1
  40. package/dist/nylas-web-elements/google-meet-icon.entry.js +1 -1
  41. package/dist/nylas-web-elements/inbox-icon.entry.js +1 -1
  42. package/dist/nylas-web-elements/{index-BVtainOy.js → index-BPPwIJj2.js} +2 -2
  43. package/dist/nylas-web-elements/{index-BVtainOy.js.map → index-BPPwIJj2.js.map} +1 -1
  44. package/dist/nylas-web-elements/{index-B-KMpdMZ.js → index-Cbn5rIwb.js} +2 -2
  45. package/dist/nylas-web-elements/index-Cbn5rIwb.js.map +1 -0
  46. package/dist/nylas-web-elements/index.esm.js +1 -1
  47. package/dist/nylas-web-elements/info-icon.entry.js +1 -1
  48. package/dist/nylas-web-elements/input-color-picker.entry.js +1 -1
  49. package/dist/nylas-web-elements/input-component.entry.esm.js.map +1 -1
  50. package/dist/nylas-web-elements/input-component.entry.js +1 -1
  51. package/dist/nylas-web-elements/input-component.entry.js.map +1 -1
  52. package/dist/nylas-web-elements/input-dropdown.entry.esm.js.map +1 -1
  53. package/dist/nylas-web-elements/input-dropdown.entry.js +1 -1
  54. package/dist/nylas-web-elements/input-dropdown.entry.js.map +1 -1
  55. package/dist/nylas-web-elements/input-image-url.entry.js +1 -1
  56. package/dist/nylas-web-elements/italic-icon.entry.js +1 -1
  57. package/dist/nylas-web-elements/loading-icon.entry.js +1 -1
  58. package/dist/nylas-web-elements/location-icon.entry.js +1 -1
  59. package/dist/nylas-web-elements/location-off-icon.entry.js +1 -1
  60. package/dist/nylas-web-elements/microsoft-logo-icon.entry.js +1 -1
  61. package/dist/nylas-web-elements/microsoft-teams-icon.entry.js +1 -1
  62. package/dist/nylas-web-elements/multi-select-dropdown.entry.esm.js.map +1 -1
  63. package/dist/nylas-web-elements/multi-select-dropdown.entry.js +1 -1
  64. package/dist/nylas-web-elements/multi-select-dropdown.entry.js.map +1 -1
  65. package/dist/nylas-web-elements/nylas-additional-participants.entry.js +1 -1
  66. package/dist/nylas-web-elements/{nylas-api-request-B1V2koVc.js → nylas-api-request-rYAjhY1J.js} +2 -2
  67. package/dist/nylas-web-elements/{nylas-api-request-B1V2koVc.js.map → nylas-api-request-rYAjhY1J.js.map} +1 -1
  68. package/dist/nylas-web-elements/nylas-availability-picker.entry.js +1 -1
  69. package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +1 -1
  70. package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js +1 -1
  71. package/dist/nylas-web-elements/nylas-booking-confirmation-redirect.entry.js +1 -1
  72. package/dist/nylas-web-elements/nylas-booking-confirmation-type.entry.js +1 -1
  73. package/dist/nylas-web-elements/nylas-booking-form-config.entry.js +2 -2
  74. package/dist/nylas-web-elements/nylas-booking-form.entry.js +1 -1
  75. package/dist/nylas-web-elements/nylas-buffer-time.entry.js +1 -1
  76. package/dist/nylas-web-elements/nylas-calendar-picker.entry.js +1 -1
  77. package/dist/nylas-web-elements/nylas-cancel-booking-form.entry.js +1 -1
  78. package/dist/nylas-web-elements/nylas-cancellation-policy.entry.esm.js.map +1 -1
  79. package/dist/nylas-web-elements/nylas-cancellation-policy.entry.js +1 -1
  80. package/dist/nylas-web-elements/nylas-cancellation-policy.entry.js.map +1 -1
  81. package/dist/nylas-web-elements/nylas-cancelled-event-card.entry.js +1 -1
  82. package/dist/nylas-web-elements/nylas-confirmation-email.entry.js +1 -1
  83. package/dist/nylas-web-elements/nylas-confirmed-event-card.entry.js +1 -1
  84. package/dist/nylas-web-elements/nylas-connected-calendars.entry.js +1 -1
  85. package/dist/nylas-web-elements/nylas-custom-booking-flow.entry.js +1 -1
  86. package/dist/nylas-web-elements/nylas-custom-event-slug.entry.js +1 -1
  87. package/dist/nylas-web-elements/nylas-customize-booking-settings.entry.esm.js.map +1 -1
  88. package/dist/nylas-web-elements/nylas-customize-booking-settings.entry.js +1 -1
  89. package/dist/nylas-web-elements/nylas-customize-booking-settings.entry.js.map +1 -1
  90. package/dist/nylas-web-elements/nylas-date-component.entry.js +1 -1
  91. package/dist/nylas-web-elements/nylas-date-picker.entry.js +1 -1
  92. package/dist/nylas-web-elements/nylas-date-picker.entry.js.map +1 -1
  93. package/dist/nylas-web-elements/nylas-disable-emails.entry.js +1 -1
  94. package/dist/nylas-web-elements/nylas-editor-tabs-group.entry.esm.js.map +1 -1
  95. package/dist/nylas-web-elements/nylas-editor-tabs-group.entry.js +1 -1
  96. package/dist/nylas-web-elements/nylas-editor-tabs-group.entry.js.map +1 -1
  97. package/dist/nylas-web-elements/nylas-editor-tabs.entry.esm.js.map +1 -1
  98. package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +1 -1
  99. package/dist/nylas-web-elements/nylas-editor-tabs.entry.js.map +1 -1
  100. package/dist/nylas-web-elements/nylas-event-calendar.entry.js +1 -1
  101. package/dist/nylas-web-elements/nylas-event-capacity.entry.js +1 -1
  102. package/dist/nylas-web-elements/nylas-event-description.entry.esm.js.map +1 -1
  103. package/dist/nylas-web-elements/nylas-event-description.entry.js +1 -1
  104. package/dist/nylas-web-elements/nylas-event-description.entry.js.map +1 -1
  105. package/dist/nylas-web-elements/nylas-event-duration.entry.esm.js.map +1 -1
  106. package/dist/nylas-web-elements/nylas-event-duration.entry.js +1 -1
  107. package/dist/nylas-web-elements/nylas-event-duration.entry.js.map +1 -1
  108. package/dist/nylas-web-elements/nylas-event-info.entry.js +1 -1
  109. package/dist/nylas-web-elements/nylas-event-limits.entry.esm.js.map +1 -1
  110. package/dist/nylas-web-elements/nylas-event-limits.entry.js +1 -1
  111. package/dist/nylas-web-elements/nylas-event-limits.entry.js.map +1 -1
  112. package/dist/nylas-web-elements/nylas-event-location.entry.esm.js.map +1 -1
  113. package/dist/nylas-web-elements/nylas-event-location.entry.js +1 -1
  114. package/dist/nylas-web-elements/nylas-event-location.entry.js.map +1 -1
  115. package/dist/nylas-web-elements/nylas-event-timeslot.entry.js +1 -1
  116. package/dist/nylas-web-elements/nylas-event-title.entry.esm.js.map +1 -1
  117. package/dist/nylas-web-elements/nylas-event-title.entry.js +1 -1
  118. package/dist/nylas-web-elements/nylas-event-title.entry.js.map +1 -1
  119. package/dist/nylas-web-elements/nylas-feedback-form.entry.js +1 -1
  120. package/dist/nylas-web-elements/nylas-form-card.entry.esm.js.map +1 -1
  121. package/dist/nylas-web-elements/nylas-form-card.entry.js +1 -1
  122. package/dist/nylas-web-elements/nylas-form-card.entry.js.map +1 -1
  123. package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js +1 -1
  124. package/dist/nylas-web-elements/nylas-list-configurations.entry.js +1 -1
  125. package/dist/nylas-web-elements/nylas-locale-switch.entry.js +1 -1
  126. package/dist/nylas-web-elements/nylas-logo.entry.js +1 -1
  127. package/dist/nylas-web-elements/nylas-min-booking-notice.entry.js +1 -1
  128. package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js +1 -1
  129. package/dist/nylas-web-elements/nylas-notification.entry.js +1 -1
  130. package/dist/nylas-web-elements/nylas-notification.entry.js.map +1 -1
  131. package/dist/nylas-web-elements/nylas-organizer-confirmation-card.entry.js +1 -1
  132. package/dist/nylas-web-elements/nylas-page-name.entry.esm.js.map +1 -1
  133. package/dist/nylas-web-elements/nylas-page-name.entry.js +1 -1
  134. package/dist/nylas-web-elements/nylas-page-name.entry.js.map +1 -1
  135. package/dist/nylas-web-elements/nylas-page-styling.entry.js +1 -1
  136. package/dist/nylas-web-elements/nylas-participant-booking-calendars.entry.js +1 -1
  137. package/dist/nylas-web-elements/nylas-participants-custom-availability.entry.js +1 -1
  138. package/dist/nylas-web-elements/nylas-reminder-emails.entry.js +1 -1
  139. package/dist/nylas-web-elements/nylas-reminder-time.entry.js +1 -1
  140. package/dist/nylas-web-elements/nylas-scheduler-editor.entry.esm.js.map +1 -1
  141. package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +3 -3
  142. package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js.map +1 -1
  143. package/dist/nylas-web-elements/nylas-scheduling-method.entry.js +1 -1
  144. package/dist/nylas-web-elements/nylas-scheduling.entry.js +1 -1
  145. package/dist/nylas-web-elements/nylas-select-event-type.entry.js +1 -1
  146. package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +1 -1
  147. package/dist/nylas-web-elements/nylas-specific-time-availability-picker.entry.js +1 -1
  148. package/dist/nylas-web-elements/nylas-time-window-picker.entry.esm.js.map +1 -1
  149. package/dist/nylas-web-elements/nylas-time-window-picker.entry.js +1 -1
  150. package/dist/nylas-web-elements/nylas-time-window-picker.entry.js.map +1 -1
  151. package/dist/nylas-web-elements/nylas-timeslot-interval.entry.esm.js.map +1 -1
  152. package/dist/nylas-web-elements/nylas-timeslot-interval.entry.js +1 -1
  153. package/dist/nylas-web-elements/nylas-timeslot-interval.entry.js.map +1 -1
  154. package/dist/nylas-web-elements/nylas-timeslot-picker.entry.js +1 -1
  155. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  156. package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
  157. package/dist/nylas-web-elements/paintbrush-fill-icon.entry.js +1 -1
  158. package/dist/nylas-web-elements/paintbrush-icon.entry.js +1 -1
  159. package/dist/nylas-web-elements/people-icon.entry.js +1 -1
  160. package/dist/nylas-web-elements/person-clipboard-icon.entry.js +1 -1
  161. package/dist/nylas-web-elements/person-icon.entry.js +1 -1
  162. package/dist/nylas-web-elements/play-icon.entry.js +1 -1
  163. package/dist/nylas-web-elements/plus-icon.entry.js +1 -1
  164. package/dist/nylas-web-elements/radio-button-group.entry.esm.js.map +1 -1
  165. package/dist/nylas-web-elements/radio-button-group.entry.js +1 -1
  166. package/dist/nylas-web-elements/radio-button-group.entry.js.map +1 -1
  167. package/dist/nylas-web-elements/refresh-icon.entry.js +1 -1
  168. package/dist/nylas-web-elements/{register-component-BHk70oxk.js → register-component-Blj8K64f.js} +2 -2
  169. package/dist/nylas-web-elements/{register-component-BHk70oxk.js.map → register-component-Blj8K64f.js.map} +1 -1
  170. package/dist/nylas-web-elements/reply-all-icon.entry.js +1 -1
  171. package/dist/nylas-web-elements/reply-icon.entry.js +1 -1
  172. package/dist/nylas-web-elements/search-icon.entry.js +1 -1
  173. package/dist/nylas-web-elements/select-dropdown.entry.esm.js.map +1 -1
  174. package/dist/nylas-web-elements/select-dropdown.entry.js +1 -1
  175. package/dist/nylas-web-elements/select-dropdown.entry.js.map +1 -1
  176. package/dist/nylas-web-elements/sent-icon.entry.js +1 -1
  177. package/dist/nylas-web-elements/spam-icon.entry.js +1 -1
  178. package/dist/nylas-web-elements/star-icon.entry.js +1 -1
  179. package/dist/nylas-web-elements/stop-icon.entry.js +1 -1
  180. package/dist/nylas-web-elements/textarea-component.entry.esm.js.map +1 -1
  181. package/dist/nylas-web-elements/textarea-component.entry.js +1 -1
  182. package/dist/nylas-web-elements/textarea-component.entry.js.map +1 -1
  183. package/dist/nylas-web-elements/time-period-selector.entry.js +1 -1
  184. package/dist/nylas-web-elements/toggle-switch.entry.js +1 -1
  185. package/dist/nylas-web-elements/tooltip-component.entry.js +1 -1
  186. package/dist/nylas-web-elements/translate-icon.entry.js +1 -1
  187. package/dist/nylas-web-elements/trash-fill-icon.entry.js +1 -1
  188. package/dist/nylas-web-elements/trash-icon.entry.js +1 -1
  189. package/dist/nylas-web-elements/underline-icon.entry.js +1 -1
  190. package/dist/nylas-web-elements/{utils-Bj5Y75fX.js → utils-DhmCcrVs.js} +3 -3
  191. package/dist/nylas-web-elements/{utils-Bj5Y75fX.js.map → utils-DhmCcrVs.js.map} +1 -1
  192. package/dist/nylas-web-elements/warning-icon.entry.js +1 -1
  193. package/dist/nylas-web-elements/zoom-icon.entry.js +1 -1
  194. package/dist/types/components/design-system/input-component/input-component.d.ts +1 -0
  195. package/dist/types/components/design-system/multi-select-dropdown/multi-select-dropdown.d.ts +1 -0
  196. package/dist/types/components/design-system/textarea-component/textarea-component.d.ts +1 -0
  197. package/dist/types/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.d.ts +1 -1
  198. package/dist/types/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.d.ts +1 -0
  199. package/dist/types/components.d.ts +4 -4
  200. package/package.json +3 -3
  201. package/readme.md +1 -1
  202. package/dist/nylas-web-elements/index-B-KMpdMZ.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{r as e,a as s,h as n,d as l,e as t}from"./index-B-KMpdMZ.js";import{R as a}from"./register-component-BHk70oxk.js";import{i as o,b as r}from"./utils-Bj5Y75fX.js";const i=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-custom-event-slug{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;background-color:var(--nylas-base-0);color:var(--nylas-base-900)}.nylas-custom-event-slug .header{padding:1rem;display:grid;grid-template-columns:1fr auto}.nylas-custom-event-slug .header h3{border-radius:var(--nylas-border-radius-2x);margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-custom-event-slug .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-event-slug .header .drawer-toggle{display:flex;gap:24px;align-items:center}.nylas-custom-event-slug .header .drawer-toggle .chevron{display:flex;align-self:center;cursor:pointer}.nylas-custom-event-slug .header .drawer-toggle .chevron:hover,.nylas-custom-event-slug .header .drawer-toggle .chevron:active{color:var(--nylas-primary)}.nylas-custom-event-slug .header .drawer-toggle .chevron.open{transform:rotate(90deg)}.nylas-custom-event-slug .header .drawer-toggle .chevron.closed{transform:rotate(270deg)}.nylas-custom-event-slug .header .drawer-toggle .chevron.disabled{cursor:not-allowed;color:var(--nylas-base-300)}.nylas-custom-event-slug .header .drawer-toggle .chevron.disabled:hover{color:var(--nylas-base-300)}.nylas-custom-event-slug .nylas-custom-event-slug__body{display:grid;grid-template-columns:1fr;background-color:var(--nylas-base-25);border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x);border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.nylas-custom-event-slug .nylas-custom-event-slug__body{grid-template-columns:1fr}}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section{padding:1rem;display:flex;flex-direction:column;gap:1rem;color:var(--nylas-base-800)}@media screen and (max-width: 768px){.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section{border:none}}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row{display:flex;align-items:center;gap:1rem}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row label{display:flex;align-items:center}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row label span.required{color:var(--nylas-error, #cc4841)}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row label span.label-icon{margin-left:4px}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row label span.label-icon tooltip-component{display:flex}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row p{margin:0.25rem 0 0 0;font-size:16px;font-weight:500;line-height:24px;color:var(--nylas-base-900)}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row .input-container{width:100%}.nylas-custom-event-slug .nylas-custom-event-slug__body span.error-message{color:var(--nylas-error)}.nylas-custom-event-slug .nylas-custom-event-slug__body span.help-text{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-event-slug .nylas-custom-event-slug__input-wrapper{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%;width:-moz-available;width:-webkit-fill-available;display:flex;flex-direction:row;gap:0.125rem;border-radius:var(--nylas-border-radius-2x);z-index:1}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper:focus{outline-color:var(--nylas-primary)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper.error::placeholder{font-weight:400}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper::placeholder{color:var(--nylas-base-300)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper.focus{outline:2px solid var(--nylas-primary)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper.error{border-color:var(--nylas-error);outline:none}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper input-component::part(ic__input){outline:none;border:none;width:100%;font-size:16px;height:auto;padding-left:0px}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .prefix{z-index:0;margin-top:1px;color:var(--nylas-base-400);font-weight:500;font-size:24px}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon{margin-right:0.25rem;padding:0 0.75rem;height:100%;display:flex;align-items:center;right:0;cursor:pointer;user-select:none}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon.disabled{cursor:not-allowed}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon:hover svg path{fill:var(--nylas-primary)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon:active svg path{fill:var(--nylas-base-500)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon .copied{display:flex;align-items:center;font-size:0.875rem;gap:0.125rem}';var c=undefined&&undefined.__decorate||function(e,s,n,l){var t=arguments.length,a=t<3?s:l===null?l=Object.getOwnPropertyDescriptor(s,n):l,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,s,n,l);else for(var r=e.length-1;r>=0;r--)if(o=e[r])a=(t<3?o(a):t>3?o(s,n,a):o(s,n))||a;return t>3&&a&&Object.defineProperty(s,n,a),a};var u=undefined&&undefined.__metadata||function(e,s){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,s)};const d=class{constructor(n){e(this,n);this.valueChanged=s(this,"valueChanged",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.isOpen=true;this.slugErrorMessage="";this.name="custom-event-slug";this.requiresSlug=false;this.focus=false;this.copied=false;this.requiredError=o.t("fieldRequired",{field:"Slug"});this.patternError=o.t("invalidInputFormat",{field:"Slug"})}connectedCallback(){r("nylas-custom-event-slug","connectedCallback")}disconnectedCallback(){r("nylas-custom-event-slug","disconnectedCallback")}componentWillLoad(){r("nylas-custom-event-slug","componentWillLoad");this.host.setAttribute("name",this.name)}componentDidLoad(){r("nylas-custom-event-slug","componentDidLoad");if(this.selectedConfiguration){this.selectedConfigurationChangedHandler(this.selectedConfiguration)}else{console.log("No selected configuration found");this.urlSlug=this.defaultUrlSlug||""}}componentWillUpdate(){r("nylas-custom-event-slug","componentWillUpdate")}componentDidUpdate(){r("nylas-custom-event-slug","componentDidUpdate")}componentWillRender(){r("nylas-custom-event-slug","componentWillRender")}componentDidRender(){r("nylas-custom-event-slug","componentDidRender")}elementNameChangedHandler(e){r("nylas-custom-event-slug","elementNameChangedHandler",e);this.host.setAttribute("name",e)}selectedConfigurationChangedHandler(e){r("nylas-custom-booking-flow","selectedConfigurationChangedHandler",e);this.urlSlug=e?.slug||this.defaultUrlSlug||""}selectedLanguageChangedHandler(e,s){if(e===s)return;o.changeLanguage(e);this.requiredError=o.t("fieldRequired",{field:"Slug"});this.patternError=o.t("invalidInputFormat",{field:"Slug"})}themeConfigChangedHandler(e,s){if(e===s)return;this.applyThemeConfig(e)}async nylasFormInputChangeHandler(e){const{name:s,value:n}=e.detail;this.internals.setValidity({});if(s==="event-slug"){this.urlSlug=n;this.internals.setFormValue(JSON.stringify(n),this.name);this.valueChanged.emit({value:JSON.stringify(n),name:this.name})}}async nylasFormInputFocusHandler(){this.focus=true}async nylasFormInputBlurHandler(){this.slugErrorMessage="";this.internals.setValidity({});this.focus=false;if(this.requiresSlug&&this.urlSlug.trim()===""){this.internals.setValidity({customError:true},o.t("nylasCustomEventSlug.slugRequiredErrorMessage"));this.slugErrorMessage=o.t("nylasCustomEventSlug.slugRequiredErrorMessage");return}if(!/^[A-Za-z0-9._-]*$/.test(this.urlSlug.trim())){this.internals.setValidity({customError:true},o.t("nylasCustomEventSlug.slugErrorMessage"));this.slugErrorMessage=o.t("nylasCustomEventSlug.slugErrorMessage")}}formSubmittedHandler(e){r("nylas-event-title","formSubmittedHandler",e);this.nylasFormInputBlurHandler()}applyThemeConfig(e){if(e){for(const[s,n]of Object.entries(e)){this.host.style.setProperty(`${s}`,n)}}}toggleDrawer(){this.isOpen=!this.isOpen}async copyToClipboard(){try{await navigator.clipboard.writeText(`${this.urlSlug}`);this.copied=true;setTimeout((()=>{this.copied=false}),1e3)}catch(e){console.error("Failed to copy: ",e)}}render(){if(!this.requiresSlug)return null;const e=typeof this.urlSlug!=="undefined";return n(l,null,n("div",{class:"nylas-custom-event-slug",part:"nces"},n("div",{class:"header",part:"nces__header"},n("div",null,n("h3",null,o.t("nylasCustomEventSlug.headerTitle")),n("p",null,o.t("nylasCustomEventSlug.headerSubTitle"))),n("div",{class:"drawer-toggle",part:"nces__drawer-toggle--container"},n("span",{class:`chevron ${this.isOpen?"open":"closed"} `,onClick:()=>this.toggleDrawer()},n("chevron-icon",{width:"24",height:"24"})))),this.isOpen&&n("div",{class:"nylas-custom-event-slug__body",part:"nces__body"},n("div",{class:"nylas-custom-event-slug__section"},n("div",{class:"nylas-custom-event-slug__row"},n("div",{class:"input-container"},n("label",null,o.t("nylasCustomEventSlug.eventSlugLabel"),n("span",{class:"label-icon"},n("tooltip-component",null,n("info-icon",{slot:"tooltip-icon"}),n("span",{slot:"tooltip-content"},o.t("nylasCustomEventSlug.tooltip.desc"))))),n("div",{class:{"nylas-custom-event-slug__input-wrapper":true,focus:this.focus,error:!!this.slugErrorMessage}},n("div",{slot:"prefix",class:"prefix"},"/"),e&&n("input-component",{name:"event-slug",id:"event-slug",type:"text",required:false,placeholder:"my-link-name",exportparts:"ic_input: nces__input-textfield",defaultValue:this.urlSlug,requiredError:this.requiredError,patternError:this.patternError,themeConfig:this.themeConfig}),n("div",{slot:"icon",class:{icon:true,disabled:!this.urlSlug},onClick:()=>!this.copied&&!!this.urlSlug&&this.copyToClipboard()},this.copied?n("div",{class:"copied"},n("checkmark-icon",{width:"12",height:"18"})," ",o.t("nylasCustomEventSlug.copied")):n("copy-icon",{width:"12",height:"18"}))),this.slugErrorMessage&&n("span",{class:"error-message"},this.slugErrorMessage)))))))}static get formAssociated(){return true}get host(){return t(this)}static get watchers(){return{name:["elementNameChangedHandler"],selectedConfiguration:["selectedConfigurationChangedHandler"],selectedLanguage:["selectedLanguageChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};c([a({name:"nylas-custom-event-slug",stateToProps:new Map([["schedulerConfig.requiresSlug","requiresSlug"],["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.selectedLanguage","selectedLanguage"],["schedulerConfig.themeConfig","themeConfig"]]),eventToProps:{valueChanged:async(e,s)=>{const{valueChanged:n}=e.detail;if(n){n(e)}}},fireRegisterEvent:true}),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],d.prototype,"render",null);d.style=i;export{d as nylas_custom_event_slug};
1
+ import{r as e,a as s,h as n,d as l,e as t}from"./index-Cbn5rIwb.js";import{R as a}from"./register-component-Blj8K64f.js";import{i as o,b as r}from"./utils-DhmCcrVs.js";const i=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-custom-event-slug{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;background-color:var(--nylas-base-0);color:var(--nylas-base-900)}.nylas-custom-event-slug .header{padding:1rem;display:grid;grid-template-columns:1fr auto}.nylas-custom-event-slug .header h3{border-radius:var(--nylas-border-radius-2x);margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-custom-event-slug .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-event-slug .header .drawer-toggle{display:flex;gap:24px;align-items:center}.nylas-custom-event-slug .header .drawer-toggle .chevron{display:flex;align-self:center;cursor:pointer}.nylas-custom-event-slug .header .drawer-toggle .chevron:hover,.nylas-custom-event-slug .header .drawer-toggle .chevron:active{color:var(--nylas-primary)}.nylas-custom-event-slug .header .drawer-toggle .chevron.open{transform:rotate(90deg)}.nylas-custom-event-slug .header .drawer-toggle .chevron.closed{transform:rotate(270deg)}.nylas-custom-event-slug .header .drawer-toggle .chevron.disabled{cursor:not-allowed;color:var(--nylas-base-300)}.nylas-custom-event-slug .header .drawer-toggle .chevron.disabled:hover{color:var(--nylas-base-300)}.nylas-custom-event-slug .nylas-custom-event-slug__body{display:grid;grid-template-columns:1fr;background-color:var(--nylas-base-25);border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x);border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.nylas-custom-event-slug .nylas-custom-event-slug__body{grid-template-columns:1fr}}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section{padding:1rem;display:flex;flex-direction:column;gap:1rem;color:var(--nylas-base-800)}@media screen and (max-width: 768px){.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section{border:none}}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row{display:flex;align-items:center;gap:1rem}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row label{display:flex;align-items:center}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row label span.required{color:var(--nylas-error, #cc4841)}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row label span.label-icon{margin-left:4px}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row label span.label-icon tooltip-component{display:flex}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row p{margin:0.25rem 0 0 0;font-size:16px;font-weight:500;line-height:24px;color:var(--nylas-base-900)}.nylas-custom-event-slug .nylas-custom-event-slug__body .nylas-custom-event-slug__section .nylas-custom-event-slug__row .input-container{width:100%}.nylas-custom-event-slug .nylas-custom-event-slug__body span.error-message{color:var(--nylas-error)}.nylas-custom-event-slug .nylas-custom-event-slug__body span.help-text{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-event-slug .nylas-custom-event-slug__input-wrapper{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%;width:-moz-available;width:-webkit-fill-available;display:flex;flex-direction:row;gap:0.125rem;border-radius:var(--nylas-border-radius-2x);z-index:1}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper:focus{outline-color:var(--nylas-primary)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper.error::placeholder{font-weight:400}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper::placeholder{color:var(--nylas-base-300)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper.focus{outline:2px solid var(--nylas-primary)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper.error{border-color:var(--nylas-error);outline:none}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper input-component::part(ic__input){outline:none;border:none;width:100%;font-size:16px;height:auto;padding-left:0px}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .prefix{z-index:0;margin-top:1px;color:var(--nylas-base-400);font-weight:500;font-size:24px}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon{margin-right:0.25rem;padding:0 0.75rem;height:100%;display:flex;align-items:center;right:0;cursor:pointer;user-select:none}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon.disabled{cursor:not-allowed}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon:hover svg path{fill:var(--nylas-primary)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon:active svg path{fill:var(--nylas-base-500)}.nylas-custom-event-slug .nylas-custom-event-slug__input-wrapper .icon .copied{display:flex;align-items:center;font-size:0.875rem;gap:0.125rem}';var c=undefined&&undefined.__decorate||function(e,s,n,l){var t=arguments.length,a=t<3?s:l===null?l=Object.getOwnPropertyDescriptor(s,n):l,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,s,n,l);else for(var r=e.length-1;r>=0;r--)if(o=e[r])a=(t<3?o(a):t>3?o(s,n,a):o(s,n))||a;return t>3&&a&&Object.defineProperty(s,n,a),a};var u=undefined&&undefined.__metadata||function(e,s){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,s)};const d=class{constructor(n){e(this,n);this.valueChanged=s(this,"valueChanged",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.isOpen=true;this.slugErrorMessage="";this.name="custom-event-slug";this.requiresSlug=false;this.focus=false;this.copied=false;this.requiredError=o.t("fieldRequired",{field:"Slug"});this.patternError=o.t("invalidInputFormat",{field:"Slug"})}connectedCallback(){r("nylas-custom-event-slug","connectedCallback")}disconnectedCallback(){r("nylas-custom-event-slug","disconnectedCallback")}componentWillLoad(){r("nylas-custom-event-slug","componentWillLoad");this.host.setAttribute("name",this.name)}componentDidLoad(){r("nylas-custom-event-slug","componentDidLoad");if(this.selectedConfiguration){this.selectedConfigurationChangedHandler(this.selectedConfiguration)}else{console.log("No selected configuration found");this.urlSlug=this.defaultUrlSlug||""}}componentWillUpdate(){r("nylas-custom-event-slug","componentWillUpdate")}componentDidUpdate(){r("nylas-custom-event-slug","componentDidUpdate")}componentWillRender(){r("nylas-custom-event-slug","componentWillRender")}componentDidRender(){r("nylas-custom-event-slug","componentDidRender")}elementNameChangedHandler(e){r("nylas-custom-event-slug","elementNameChangedHandler",e);this.host.setAttribute("name",e)}selectedConfigurationChangedHandler(e){r("nylas-custom-booking-flow","selectedConfigurationChangedHandler",e);this.urlSlug=e?.slug||this.defaultUrlSlug||""}selectedLanguageChangedHandler(e,s){if(e===s)return;o.changeLanguage(e);this.requiredError=o.t("fieldRequired",{field:"Slug"});this.patternError=o.t("invalidInputFormat",{field:"Slug"})}themeConfigChangedHandler(e,s){if(e===s)return;this.applyThemeConfig(e)}async nylasFormInputChangeHandler(e){const{name:s,value:n}=e.detail;this.internals.setValidity({});if(s==="event-slug"){this.urlSlug=n;this.internals.setFormValue(JSON.stringify(n),this.name);this.valueChanged.emit({value:JSON.stringify(n),name:this.name})}}async nylasFormInputFocusHandler(){this.focus=true}async nylasFormInputBlurHandler(){this.slugErrorMessage="";this.internals.setValidity({});this.focus=false;if(this.requiresSlug&&this.urlSlug.trim()===""){this.internals.setValidity({customError:true},o.t("nylasCustomEventSlug.slugRequiredErrorMessage"));this.slugErrorMessage=o.t("nylasCustomEventSlug.slugRequiredErrorMessage");return}if(!/^[A-Za-z0-9._-]*$/.test(this.urlSlug.trim())){this.internals.setValidity({customError:true},o.t("nylasCustomEventSlug.slugErrorMessage"));this.slugErrorMessage=o.t("nylasCustomEventSlug.slugErrorMessage")}}formSubmittedHandler(e){r("nylas-event-title","formSubmittedHandler",e);this.nylasFormInputBlurHandler()}applyThemeConfig(e){if(e){for(const[s,n]of Object.entries(e)){this.host.style.setProperty(`${s}`,n)}}}toggleDrawer(){this.isOpen=!this.isOpen}async copyToClipboard(){try{await navigator.clipboard.writeText(`${this.urlSlug}`);this.copied=true;setTimeout((()=>{this.copied=false}),1e3)}catch(e){console.error("Failed to copy: ",e)}}render(){if(!this.requiresSlug)return null;const e=typeof this.urlSlug!=="undefined";return n(l,null,n("div",{class:"nylas-custom-event-slug",part:"nces"},n("div",{class:"header",part:"nces__header"},n("div",null,n("h3",null,o.t("nylasCustomEventSlug.headerTitle")),n("p",null,o.t("nylasCustomEventSlug.headerSubTitle"))),n("div",{class:"drawer-toggle",part:"nces__drawer-toggle--container"},n("span",{class:`chevron ${this.isOpen?"open":"closed"} `,onClick:()=>this.toggleDrawer()},n("chevron-icon",{width:"24",height:"24"})))),this.isOpen&&n("div",{class:"nylas-custom-event-slug__body",part:"nces__body"},n("div",{class:"nylas-custom-event-slug__section"},n("div",{class:"nylas-custom-event-slug__row"},n("div",{class:"input-container"},n("label",null,o.t("nylasCustomEventSlug.eventSlugLabel"),n("span",{class:"label-icon"},n("tooltip-component",null,n("info-icon",{slot:"tooltip-icon"}),n("span",{slot:"tooltip-content"},o.t("nylasCustomEventSlug.tooltip.desc"))))),n("div",{class:{"nylas-custom-event-slug__input-wrapper":true,focus:this.focus,error:!!this.slugErrorMessage}},n("div",{slot:"prefix",class:"prefix"},"/"),e&&n("input-component",{name:"event-slug",id:"event-slug",type:"text",required:false,placeholder:"my-link-name",exportparts:"ic_input: nces__input-textfield",defaultValue:this.urlSlug,requiredError:this.requiredError,patternError:this.patternError,themeConfig:this.themeConfig}),n("div",{slot:"icon",class:{icon:true,disabled:!this.urlSlug},onClick:()=>!this.copied&&!!this.urlSlug&&this.copyToClipboard()},this.copied?n("div",{class:"copied"},n("checkmark-icon",{width:"12",height:"18"})," ",o.t("nylasCustomEventSlug.copied")):n("copy-icon",{width:"12",height:"18"}))),this.slugErrorMessage&&n("span",{class:"error-message"},this.slugErrorMessage)))))))}static get formAssociated(){return true}get host(){return t(this)}static get watchers(){return{name:["elementNameChangedHandler"],selectedConfiguration:["selectedConfigurationChangedHandler"],selectedLanguage:["selectedLanguageChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};c([a({name:"nylas-custom-event-slug",stateToProps:new Map([["schedulerConfig.requiresSlug","requiresSlug"],["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.selectedLanguage","selectedLanguage"],["schedulerConfig.themeConfig","themeConfig"]]),eventToProps:{valueChanged:async(e,s)=>{const{valueChanged:n}=e.detail;if(n){n(e)}}},fireRegisterEvent:true}),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],d.prototype,"render",null);d.style=i;export{d as nylas_custom_event_slug};
2
2
  //# sourceMappingURL=nylas-custom-event-slug.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-customize-booking-settings.entry.esm.js","sources":["src/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.scss?tag=nylas-customize-booking-settings&encapsulation=shadow","src/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-customize-booking-settings {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n\n .header {\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n }\n }\n\n .nylas-customize-booking-settings__settings {\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n padding: 1rem;\n margin: 1rem 0;\n background-color: var(--nylas-base-25);\n\n .nylas-customize-booking-settings__settings-div {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n }\n}\n\n.label {\n margin-left: 32px;\n font-size: 16px;\n font-weight: 400;\n color: var(--nylas-base-800);\n line-height: 24px;\n\n .label-contents {\n margin: 0;\n display: inline-block;\n color: var(--nylas-base-800);\n @media #{$mobile} {\n display: block;\n }\n }\n\n tooltip-component {\n display: inline-block;\n }\n}\n\ntooltip-component#guests::part(tc__content) {\n @media #{$mobile} {\n left: 58px;\n }\n}\n\ntooltip-component#reschedule::part(tc__content) {\n left: 58px;\n\n @media #{$mobile} {\n left: 58px;\n }\n}\n\ntooltip-component#cancel::part(tc__content) {\n left: -58px;\n\n @media #{$mobile} {\n left: 58px;\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-customize-booking-settings` component is a UI component that displays the booking calendar picker.\n * @part ncbs - The booking calendar picker container\n * @part ncbs__header - The header of the booking calendar picker\n * @part ncbs__settings - The settings container\n * @part ncbs__settings-div - The div inside the settings container that contains the checkbox and tooltip for each setting\n * @part ncbs__additional_guests - The additional guests setting\n * @part ncbs__cancellation_options - The cancellation options setting\n * @part ncbs__rescheduling_options - The rescheduling options setting\n */\n@Component({\n tag: 'nylas-customize-booking-settings',\n styleUrl: 'nylas-customize-booking-settings.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasCustomizeBookingSettings {\n @Element() host!: HTMLNylasCustomizeBookingSettingsElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The default additional guests hidden setting as set in the configuration.\n */\n @Prop() defaultHideAdditionalGuests: boolean = this.selectedConfiguration?.scheduler?.hide_additional_guests ?? false;\n\n /**\n * @standalone\n * The default hide cancellation options setting as set in the configuration.\n */\n @Prop() defaultHideCancellationOptions: boolean = this.selectedConfiguration?.scheduler?.hide_cancellation_options ?? false;\n\n /**\n * @standalone\n * The default hide rescheduling options setting as set in the configuration.\n */\n @Prop() defaultHideReschedulingOptions: boolean = this.selectedConfiguration?.scheduler?.hide_rescheduling_options ?? false;\n\n /**\n * @standalone\n * The name of the calendar picker.\n */\n @Prop() name: string = 'customize-booking-settings';\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * This prop is used to determined which settings are visible in the component.\n */\n @Prop() showSettings: string[] = ['allowGuestsToInvite', 'hideCancellationOptions', 'hideReschedulingOptions'];\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * State to store the allowed additional guests setting.\n */\n @State() allowGuestsToInvite!: boolean;\n\n /**\n * State to store the hide cancel booking setting.\n */\n @State() hideCancellationOptions!: boolean;\n\n /**\n * State to store the hide reschedule booking setting.\n */\n @State() hideReschedulingOptions!: boolean;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * This event is fired when the booking settings are changed.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-customize-booking-settings', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-customize-booking-settings', 'selectedConfigurationChangedHandler', newValue);\n this.allowGuestsToInvite = !newValue?.scheduler?.hide_additional_guests;\n this.hideCancellationOptions = newValue?.scheduler?.hide_cancellation_options ?? false;\n this.hideReschedulingOptions = newValue?.scheduler?.hide_rescheduling_options ?? false;\n this.handleSettingValues(false);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-customize-booking-settings', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-customize-booking-settings', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-customize-booking-settings', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n this.allowGuestsToInvite = !this.defaultHideAdditionalGuests;\n this.hideCancellationOptions = this.defaultHideCancellationOptions;\n this.hideReschedulingOptions = this.defaultHideReschedulingOptions;\n }\n\n componentDidLoad() {\n debug('nylas-customize-booking-settings', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n // Set the default values if the selected configuration is not available\n this.allowGuestsToInvite = !this.defaultHideAdditionalGuests;\n this.hideCancellationOptions = this.defaultHideCancellationOptions;\n this.hideReschedulingOptions = this.defaultHideReschedulingOptions;\n this.handleSettingValues(false);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-customize-booking-settings', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-customize-booking-settings', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-customize-booking-settings', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-customize-booking-settings', 'componentDidRender');\n }\n\n @Listen('nylasFormCheckboxChanged')\n nylasFormCheckboxChangedHandler(event: CustomEvent<{ checked: boolean; name: string }>) {\n debug('nylas-customize-booking-settings', 'nylasFormCheckboxChangedHandler', event.detail);\n const { name, checked } = event.detail;\n\n if (name === 'hide_additional_guests') {\n this.allowGuestsToInvite = checked;\n } else if (name === 'hide_cancellation_options') {\n this.hideCancellationOptions = checked;\n } else if (name === 'hide_rescheduling_options') {\n this.hideReschedulingOptions = checked;\n }\n this.handleSettingValues();\n }\n\n handleSettingValues(valueChanged: boolean = true) {\n if (valueChanged) {\n this.valueChanged.emit({\n value: JSON.stringify({\n additionalGuestsHidden: this.showSettings.includes('allowGuestsToInvite') ? !this.allowGuestsToInvite : undefined,\n hideCancellationOptions: this.hideCancellationOptions,\n hideReschedulingOptions: this.hideReschedulingOptions,\n }),\n name: this.name,\n });\n }\n this.isInternalsAvailable &&\n this.internals.setFormValue(\n JSON.stringify({\n additionalGuestsHidden: this.showSettings.includes('allowGuestsToInvite') ? !this.allowGuestsToInvite : undefined,\n hideCancellationOptions: this.hideCancellationOptions,\n hideReschedulingOptions: this.hideReschedulingOptions,\n }),\n this.name,\n );\n }\n\n /**\n * This method is essentially a workaround to check if the internals are available because\n * the unit tests in stencil do not support the internals.\n * @returns boolean\n */\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function';\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasCustomizeBookingSettings, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-customize-booking-settings',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n fireRegisterEvent: true,\n })\n render() {\n const showComponent = typeof this.hideCancellationOptions === 'boolean' && typeof this.hideReschedulingOptions === 'boolean' && typeof this.allowGuestsToInvite === 'boolean';\n const showHideAdditionalGuests = this.showSettings.includes('allowGuestsToInvite');\n\n return (\n <Host>\n {showComponent && (\n <div class=\"nylas-customize-booking-settings\" part=\"ncbs\">\n <div class=\"header\" part=\"ncbs__header\">\n <h3>{i18next.t('nylasCustomizeBookingSettings.headerTitle')}</h3>\n <p>{i18next.t('nylasCustomizeBookingSettings.headerSubTitle')}</p>\n </div>\n\n <div class=\"nylas-customize-booking-settings__settings\" part=\"ncbs__settings\">\n {showHideAdditionalGuests && (\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__additional_guests\">\n <checkbox-component\n name=\"hide_additional_guests\"\n label={i18next.t('nylasCustomizeBookingSettings.allowGuests.label')}\n checked={this.allowGuestsToInvite}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">\n {i18next.t('nylasCustomizeBookingSettings.allowGuests.label', { interpolation: { escapeValue: false, escape: s => `${s}`, useRawValueToEscape: true } })}\n </p>\n </span>\n </checkbox-component>\n </div>\n )}\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__rescheduling_options\">\n <checkbox-component\n name=\"hide_rescheduling_options\"\n label=\"Hide 'Reschedule' option on booking page and emails.\"\n checked={this.hideReschedulingOptions}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">{i18next.t('nylasCustomizeBookingSettings.hideReschedule.label')}</p>\n <tooltip-component id=\"reschedule\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasCustomizeBookingSettings.hideReschedule.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </checkbox-component>\n </div>\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__cancellation_options\">\n <checkbox-component\n name=\"hide_cancellation_options\"\n label=\"Hide 'Cancel' option on booking page and emails.\"\n checked={this.hideCancellationOptions}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">{i18next.t('nylasCustomizeBookingSettings.hideCancel.label')}</p>\n <tooltip-component id=\"cancel\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasCustomizeBookingSettings.hideCancel.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </checkbox-component>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"names":["i18next"],"mappings":";;;;AAAA,MAAM,gCAAgC,GAAG,oyHAAoyH;;;;;;;;;;;;;;;;MCyBh0H,6BAA6B,GAAA,MAAA;AAN1C,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;AAiBU,QAAA,IAA2B,CAAA,2BAAA,GAAY,IAAI,CAAC,qBAAqB,EAAE,SAAS,EAAE,sBAAsB,IAAI,KAAK;AAM7G,QAAA,IAA8B,CAAA,8BAAA,GAAY,IAAI,CAAC,qBAAqB,EAAE,SAAS,EAAE,yBAAyB,IAAI,KAAK;AAMnH,QAAA,IAA8B,CAAA,8BAAA,GAAY,IAAI,CAAC,qBAAqB,EAAE,SAAS,EAAE,yBAAyB,IAAI,KAAK;AAMnH,QAAA,IAAI,CAAA,IAAA,GAAW,4BAA4B;QAU3C,IAAY,CAAA,YAAA,GAAa,CAAC,qBAAqB,EAAE,yBAAyB,EAAE,yBAAyB,CAAC;AAsP/G;AA5MC,IAAA,yBAAyB,CAAC,QAAgB,EAAA;AACxC,QAAA,KAAK,CAAC,kCAAkC,EAAE,2BAA2B,EAAE,QAAQ,CAAC;QAChF,IAAI,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AAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAoED,EAAA,6BAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;"}
1
+ {"version":3,"file":"nylas-customize-booking-settings.entry.esm.js","sources":["src/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.scss?tag=nylas-customize-booking-settings&encapsulation=shadow","src/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-customize-booking-settings {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n\n .header {\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n }\n }\n\n .nylas-customize-booking-settings__settings {\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n padding: 1rem;\n margin: 1rem 0;\n background-color: var(--nylas-base-25);\n\n .nylas-customize-booking-settings__settings-div {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n }\n}\n\n.label {\n margin-left: 32px;\n font-size: 16px;\n font-weight: 400;\n color: var(--nylas-base-800);\n line-height: 24px;\n\n .label-contents {\n margin: 0;\n display: inline-block;\n color: var(--nylas-base-800);\n @media #{$mobile} {\n display: block;\n }\n }\n\n tooltip-component {\n display: inline-block;\n }\n}\n\ntooltip-component#guests::part(tc__content) {\n @media #{$mobile} {\n left: 58px;\n }\n}\n\ntooltip-component#reschedule::part(tc__content) {\n left: 58px;\n\n @media #{$mobile} {\n left: 58px;\n }\n}\n\ntooltip-component#cancel::part(tc__content) {\n left: -58px;\n\n @media #{$mobile} {\n left: 58px;\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-customize-booking-settings` component is a UI component that displays the booking calendar picker.\n * @part ncbs - The booking calendar picker container\n * @part ncbs__header - The header of the booking calendar picker\n * @part ncbs__settings - The settings container\n * @part ncbs__settings-div - The div inside the settings container that contains the checkbox and tooltip for each setting\n * @part ncbs__additional_guests - The additional guests setting\n * @part ncbs__cancellation_options - The cancellation options setting\n * @part ncbs__rescheduling_options - The rescheduling options setting\n */\n@Component({\n tag: 'nylas-customize-booking-settings',\n styleUrl: 'nylas-customize-booking-settings.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasCustomizeBookingSettings {\n @Element() host!: HTMLNylasCustomizeBookingSettingsElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The default additional guests hidden setting as set in the configuration.\n */\n @Prop() defaultHideAdditionalGuests: boolean = this.selectedConfiguration?.scheduler?.hide_additional_guests ?? false;\n\n /**\n * @standalone\n * The default hide cancellation options setting as set in the configuration.\n */\n @Prop() defaultHideCancellationOptions: boolean = this.selectedConfiguration?.scheduler?.hide_cancellation_options ?? false;\n\n /**\n * @standalone\n * The default hide rescheduling options setting as set in the configuration.\n */\n @Prop() defaultHideReschedulingOptions: boolean = this.selectedConfiguration?.scheduler?.hide_rescheduling_options ?? false;\n\n /**\n * @standalone\n * The name of the calendar picker.\n */\n @Prop() name: string = 'customize-booking-settings';\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * This prop is used to determined which settings are visible in the component.\n */\n @Prop() showSettings: string[] = ['allowGuestsToInvite', 'hideCancellationOptions', 'hideReschedulingOptions'];\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * State to store the allowed additional guests setting.\n */\n @State() allowGuestsToInvite!: boolean;\n\n /**\n * State to store the hide cancel booking setting.\n */\n @State() hideCancellationOptions!: boolean;\n\n /**\n * State to store the hide reschedule booking setting.\n */\n @State() hideReschedulingOptions!: boolean;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * This event is fired when the booking settings are changed.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-customize-booking-settings', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-customize-booking-settings', 'selectedConfigurationChangedHandler', newValue);\n this.allowGuestsToInvite = !newValue?.scheduler?.hide_additional_guests;\n this.hideCancellationOptions = newValue?.scheduler?.hide_cancellation_options ?? false;\n this.hideReschedulingOptions = newValue?.scheduler?.hide_rescheduling_options ?? false;\n this.handleSettingValues(false);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-customize-booking-settings', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-customize-booking-settings', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-customize-booking-settings', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n this.allowGuestsToInvite = !this.defaultHideAdditionalGuests;\n this.hideCancellationOptions = this.defaultHideCancellationOptions;\n this.hideReschedulingOptions = this.defaultHideReschedulingOptions;\n }\n\n componentDidLoad() {\n debug('nylas-customize-booking-settings', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n // Set the default values if the selected configuration is not available\n this.allowGuestsToInvite = !this.defaultHideAdditionalGuests;\n this.hideCancellationOptions = this.defaultHideCancellationOptions;\n this.hideReschedulingOptions = this.defaultHideReschedulingOptions;\n this.handleSettingValues(false);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-customize-booking-settings', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-customize-booking-settings', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-customize-booking-settings', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-customize-booking-settings', 'componentDidRender');\n }\n\n @Listen('nylasFormCheckboxToggled')\n nylasFormCheckboxToggledHandler(event: CustomEvent<{ checked: boolean; name: string }>) {\n debug('nylas-customize-booking-settings', 'nylasFormCheckboxToggledHandler', event.detail);\n const { name, checked } = event.detail;\n\n if (name === 'hide_additional_guests') {\n this.allowGuestsToInvite = checked;\n } else if (name === 'hide_cancellation_options') {\n this.hideCancellationOptions = checked;\n } else if (name === 'hide_rescheduling_options') {\n this.hideReschedulingOptions = checked;\n }\n this.handleSettingValues();\n }\n\n handleSettingValues(valueChanged: boolean = true) {\n if (valueChanged) {\n this.valueChanged.emit({\n value: JSON.stringify({\n additionalGuestsHidden: this.showSettings.includes('allowGuestsToInvite') ? !this.allowGuestsToInvite : undefined,\n hideCancellationOptions: this.hideCancellationOptions,\n hideReschedulingOptions: this.hideReschedulingOptions,\n }),\n name: this.name,\n });\n }\n this.isInternalsAvailable &&\n this.internals.setFormValue(\n JSON.stringify({\n additionalGuestsHidden: this.showSettings.includes('allowGuestsToInvite') ? !this.allowGuestsToInvite : undefined,\n hideCancellationOptions: this.hideCancellationOptions,\n hideReschedulingOptions: this.hideReschedulingOptions,\n }),\n this.name,\n );\n }\n\n /**\n * This method is essentially a workaround to check if the internals are available because\n * the unit tests in stencil do not support the internals.\n * @returns boolean\n */\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function';\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasCustomizeBookingSettings, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-customize-booking-settings',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n fireRegisterEvent: true,\n })\n render() {\n const showComponent = typeof this.hideCancellationOptions === 'boolean' && typeof this.hideReschedulingOptions === 'boolean' && typeof this.allowGuestsToInvite === 'boolean';\n const showHideAdditionalGuests = this.showSettings.includes('allowGuestsToInvite');\n\n return (\n <Host>\n {showComponent && (\n <div class=\"nylas-customize-booking-settings\" part=\"ncbs\">\n <div class=\"header\" part=\"ncbs__header\">\n <h3>{i18next.t('nylasCustomizeBookingSettings.headerTitle')}</h3>\n <p>{i18next.t('nylasCustomizeBookingSettings.headerSubTitle')}</p>\n </div>\n\n <div class=\"nylas-customize-booking-settings__settings\" part=\"ncbs__settings\">\n {showHideAdditionalGuests && (\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__additional_guests\">\n <checkbox-component\n name=\"hide_additional_guests\"\n label={i18next.t('nylasCustomizeBookingSettings.allowGuests.label')}\n checked={this.allowGuestsToInvite}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">\n {i18next.t('nylasCustomizeBookingSettings.allowGuests.label', { interpolation: { escapeValue: false, escape: s => `${s}`, useRawValueToEscape: true } })}\n </p>\n </span>\n </checkbox-component>\n </div>\n )}\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__rescheduling_options\">\n <checkbox-component\n name=\"hide_rescheduling_options\"\n label=\"Hide 'Reschedule' option on booking page and emails.\"\n checked={this.hideReschedulingOptions}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">{i18next.t('nylasCustomizeBookingSettings.hideReschedule.label')}</p>\n <tooltip-component id=\"reschedule\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasCustomizeBookingSettings.hideReschedule.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </checkbox-component>\n </div>\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__cancellation_options\">\n <checkbox-component\n name=\"hide_cancellation_options\"\n label=\"Hide 'Cancel' option on booking page and emails.\"\n checked={this.hideCancellationOptions}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">{i18next.t('nylasCustomizeBookingSettings.hideCancel.label')}</p>\n <tooltip-component id=\"cancel\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasCustomizeBookingSettings.hideCancel.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </checkbox-component>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"names":["i18next"],"mappings":";;;;AAAA,MAAM,gCAAgC,G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AAC,CAAC,gDAAgD,CAAC,CAAK,EAC3F,CAAmB,CAAA,mBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAE,EAAC,QAAQ,EAAA,EAC5B,CAAW,CAAA,WAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,cAAc,EAAG,CAAA,EACjC,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,iBAAiB,EAAA,EAAEA,QAAO,CAAC,CAAC,CAAC,uDAAuD,CAAC,CAAQ,CACtF,CACf,CACY,CACjB,CACF,CACF,CACP,CACI;;;;;;;;;;;AAjEX,UAAA,CAAA;AATC,IAAA,iBAAiB,CAAmH;AACnI,QAAA,IAAI,EAAE,kCAAkC;QACxC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAoED,EAAA,6BAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;"}
@@ -1,2 +1,2 @@
1
- import{r as e,a as n,h as s,d as o,e as t}from"./index-B-KMpdMZ.js";import{R as a}from"./register-component-BHk70oxk.js";import{b as l,i}from"./utils-Bj5Y75fX.js";const c=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-customize-booking-settings{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-customize-booking-settings .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-customize-booking-settings .header h3{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-customize-booking-settings .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-customize-booking-settings .nylas-customize-booking-settings__settings{display:flex;flex-direction:column;gap:1.5rem;padding:1rem;margin:1rem 0;background-color:var(--nylas-base-25)}.nylas-customize-booking-settings .nylas-customize-booking-settings__settings .nylas-customize-booking-settings__settings-div{display:flex;align-items:center;gap:4px}.label{margin-left:32px;font-size:16px;font-weight:400;color:var(--nylas-base-800);line-height:24px}.label .label-contents{margin:0;display:inline-block;color:var(--nylas-base-800)}@media screen and (max-width: 768px){.label .label-contents{display:block}}.label tooltip-component{display:inline-block}@media screen and (max-width: 768px){tooltip-component#guests::part(tc__content){left:58px}}tooltip-component#reschedule::part(tc__content){left:58px}@media screen and (max-width: 768px){tooltip-component#reschedule::part(tc__content){left:58px}}tooltip-component#cancel::part(tc__content){left:-58px}@media screen and (max-width: 768px){tooltip-component#cancel::part(tc__content){left:58px}}';var d=undefined&&undefined.__decorate||function(e,n,s,o){var t=arguments.length,a=t<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,s):o,l;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,n,s,o);else for(var i=e.length-1;i>=0;i--)if(l=e[i])a=(t<3?l(a):t>3?l(n,s,a):l(n,s))||a;return t>3&&a&&Object.defineProperty(n,s,a),a};var r=undefined&&undefined.__metadata||function(e,n){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,n)};const f=class{constructor(s){e(this,s);this.valueChanged=n(this,"valueChanged",7);if(s.$hostElement$["s-ei"]){this.internals=s.$hostElement$["s-ei"]}else{this.internals=s.$hostElement$.attachInternals();s.$hostElement$["s-ei"]=this.internals}this.defaultHideAdditionalGuests=this.selectedConfiguration?.scheduler?.hide_additional_guests??false;this.defaultHideCancellationOptions=this.selectedConfiguration?.scheduler?.hide_cancellation_options??false;this.defaultHideReschedulingOptions=this.selectedConfiguration?.scheduler?.hide_rescheduling_options??false;this.name="customize-booking-settings";this.showSettings=["allowGuestsToInvite","hideCancellationOptions","hideReschedulingOptions"]}elementNameChangedHandler(e){l("nylas-customize-booking-settings","elementNameChangedHandler",e);this.host.setAttribute("name",e)}selectedConfigurationChangedHandler(e){l("nylas-customize-booking-settings","selectedConfigurationChangedHandler",e);this.allowGuestsToInvite=!e?.scheduler?.hide_additional_guests;this.hideCancellationOptions=e?.scheduler?.hide_cancellation_options??false;this.hideReschedulingOptions=e?.scheduler?.hide_rescheduling_options??false;this.handleSettingValues(false)}selectedLanguageChangedHandler(e,n){if(e===n)return;i.changeLanguage(e)}themeConfigChangedHandler(e,n){if(e===n)return;this.applyThemeConfig(e)}connectedCallback(){l("nylas-customize-booking-settings","connectedCallback")}disconnectedCallback(){l("nylas-customize-booking-settings","disconnectedCallback")}componentWillLoad(){l("nylas-customize-booking-settings","componentWillLoad");this.host.setAttribute("name",this.name);this.allowGuestsToInvite=!this.defaultHideAdditionalGuests;this.hideCancellationOptions=this.defaultHideCancellationOptions;this.hideReschedulingOptions=this.defaultHideReschedulingOptions}componentDidLoad(){l("nylas-customize-booking-settings","componentDidLoad");if(this.selectedConfiguration){this.selectedConfigurationChangedHandler(this.selectedConfiguration)}else{this.allowGuestsToInvite=!this.defaultHideAdditionalGuests;this.hideCancellationOptions=this.defaultHideCancellationOptions;this.hideReschedulingOptions=this.defaultHideReschedulingOptions;this.handleSettingValues(false)}}componentWillUpdate(){l("nylas-customize-booking-settings","componentWillUpdate")}componentDidUpdate(){l("nylas-customize-booking-settings","componentDidUpdate")}componentWillRender(){l("nylas-customize-booking-settings","componentWillRender")}componentDidRender(){l("nylas-customize-booking-settings","componentDidRender")}nylasFormCheckboxChangedHandler(e){l("nylas-customize-booking-settings","nylasFormCheckboxChangedHandler",e.detail);const{name:n,checked:s}=e.detail;if(n==="hide_additional_guests"){this.allowGuestsToInvite=s}else if(n==="hide_cancellation_options"){this.hideCancellationOptions=s}else if(n==="hide_rescheduling_options"){this.hideReschedulingOptions=s}this.handleSettingValues()}handleSettingValues(e=true){if(e){this.valueChanged.emit({value:JSON.stringify({additionalGuestsHidden:this.showSettings.includes("allowGuestsToInvite")?!this.allowGuestsToInvite:undefined,hideCancellationOptions:this.hideCancellationOptions,hideReschedulingOptions:this.hideReschedulingOptions}),name:this.name})}this.isInternalsAvailable&&this.internals.setFormValue(JSON.stringify({additionalGuestsHidden:this.showSettings.includes("allowGuestsToInvite")?!this.allowGuestsToInvite:undefined,hideCancellationOptions:this.hideCancellationOptions,hideReschedulingOptions:this.hideReschedulingOptions}),this.name)}get isInternalsAvailable(){return this.internals!==undefined&&typeof this.internals.setFormValue==="function"}applyThemeConfig(e){if(e){for(const[n,s]of Object.entries(e)){this.host.style.setProperty(`${n}`,s)}}}render(){const e=typeof this.hideCancellationOptions==="boolean"&&typeof this.hideReschedulingOptions==="boolean"&&typeof this.allowGuestsToInvite==="boolean";const n=this.showSettings.includes("allowGuestsToInvite");return s(o,{key:"95ee32383eaa0f79e514d3f90f874e900c7057c6"},e&&s("div",{key:"d96541bb348fe46e355b447abf6d6291db9c0299",class:"nylas-customize-booking-settings",part:"ncbs"},s("div",{key:"efbffadde8d8466b3b1d9203d532b7dea728ca49",class:"header",part:"ncbs__header"},s("h3",{key:"7ddf24e09757783d1216faa39eec302a4e8d331e"},i.t("nylasCustomizeBookingSettings.headerTitle")),s("p",{key:"f8bde08f579e3be007cb5fe0fc68b6ef3ab83229"},i.t("nylasCustomizeBookingSettings.headerSubTitle"))),s("div",{key:"7bb596aaaf49bc800edd71d63645e2af05662bed",class:"nylas-customize-booking-settings__settings",part:"ncbs__settings"},n&&s("div",{key:"ede3b1d6b0fd4d59626f61aec1add16cda8b8002",class:"nylas-customize-booking-settings__settings-div",part:"ncbs__settings-div , ncbs__additional_guests"},s("checkbox-component",{key:"6d4a3a2361f4df65f2f94cf6a1ef69bb34216976",name:"hide_additional_guests",label:i.t("nylasCustomizeBookingSettings.allowGuests.label"),checked:this.allowGuestsToInvite,themeConfig:this.themeConfig},s("span",{key:"7d426dd4481591be7755ed0989bce4ff4706fe80",slot:"label",class:"label"},s("p",{key:"5621e3efc18389b312151e7dd026633c13646bd7",class:"label-contents"},i.t("nylasCustomizeBookingSettings.allowGuests.label",{interpolation:{escapeValue:false,escape:e=>`${e}`,useRawValueToEscape:true}}))))),s("div",{key:"e25be0d663eb39d3bc3b8f4648ef808dd95056bf",class:"nylas-customize-booking-settings__settings-div",part:"ncbs__settings-div , ncbs__rescheduling_options"},s("checkbox-component",{key:"59e251874e791ec3d2f8f836ad8ac7bf19497479",name:"hide_rescheduling_options",label:"Hide 'Reschedule' option on booking page and emails.",checked:this.hideReschedulingOptions,themeConfig:this.themeConfig},s("span",{key:"1f29b9f236fb4b31f0b115b1f7333399dc69aa21",slot:"label",class:"label"},s("p",{key:"28844c642af4b021616a0cea37c272fbe1f98e22",class:"label-contents"},i.t("nylasCustomizeBookingSettings.hideReschedule.label")),s("tooltip-component",{key:"74aca93907522bdbc3cb8db891ae6fabb35eb6d9",id:"reschedule"},s("info-icon",{key:"2b27396051a0d40f56f143315a3806473baf4d53",slot:"tooltip-icon"}),s("span",{key:"1147361d074a455299abbbe20716f08c04072485",slot:"tooltip-content"},i.t("nylasCustomizeBookingSettings.hideReschedule.tooltip.desc")))))),s("div",{key:"bf575c9682410e79e7034725728da16d87ddb672",class:"nylas-customize-booking-settings__settings-div",part:"ncbs__settings-div , ncbs__cancellation_options"},s("checkbox-component",{key:"01fba11b486e0f4ca85266d25f239a9da9d7839c",name:"hide_cancellation_options",label:"Hide 'Cancel' option on booking page and emails.",checked:this.hideCancellationOptions,themeConfig:this.themeConfig},s("span",{key:"196335e07150e4223748fcd1d249dfd035c063f6",slot:"label",class:"label"},s("p",{key:"7b5e1b8b0cfc4f0d3f7aac800e99a088ce9aff18",class:"label-contents"},i.t("nylasCustomizeBookingSettings.hideCancel.label")),s("tooltip-component",{key:"4bd6ec7108e7946e7b63e531e303d0af15cbe73b",id:"cancel"},s("info-icon",{key:"47c37ec2380e81cbb6003fabdeced7b0eea35488",slot:"tooltip-icon"}),s("span",{key:"d50a4c634bca4866a36e3860c71db291cc347c25",slot:"tooltip-content"},i.t("nylasCustomizeBookingSettings.hideCancel.tooltip.desc")))))))))}static get formAssociated(){return true}get host(){return t(this)}static get watchers(){return{name:["elementNameChangedHandler"],selectedConfiguration:["selectedConfigurationChangedHandler"],selectedLanguage:["selectedLanguageChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};d([a({name:"nylas-customize-booking-settings",stateToProps:new Map([["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.selectedLanguage","selectedLanguage"],["schedulerConfig.themeConfig","themeConfig"]]),fireRegisterEvent:true}),r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],f.prototype,"render",null);f.style=c;export{f as nylas_customize_booking_settings};
1
+ import{r as e,a as s,h as n,d as o,e as t}from"./index-Cbn5rIwb.js";import{R as a}from"./register-component-Blj8K64f.js";import{b as l,i}from"./utils-DhmCcrVs.js";const c=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-customize-booking-settings{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-customize-booking-settings .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-customize-booking-settings .header h3{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-customize-booking-settings .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-customize-booking-settings .nylas-customize-booking-settings__settings{display:flex;flex-direction:column;gap:1.5rem;padding:1rem;margin:1rem 0;background-color:var(--nylas-base-25)}.nylas-customize-booking-settings .nylas-customize-booking-settings__settings .nylas-customize-booking-settings__settings-div{display:flex;align-items:center;gap:4px}.label{margin-left:32px;font-size:16px;font-weight:400;color:var(--nylas-base-800);line-height:24px}.label .label-contents{margin:0;display:inline-block;color:var(--nylas-base-800)}@media screen and (max-width: 768px){.label .label-contents{display:block}}.label tooltip-component{display:inline-block}@media screen and (max-width: 768px){tooltip-component#guests::part(tc__content){left:58px}}tooltip-component#reschedule::part(tc__content){left:58px}@media screen and (max-width: 768px){tooltip-component#reschedule::part(tc__content){left:58px}}tooltip-component#cancel::part(tc__content){left:-58px}@media screen and (max-width: 768px){tooltip-component#cancel::part(tc__content){left:58px}}';var d=undefined&&undefined.__decorate||function(e,s,n,o){var t=arguments.length,a=t<3?s:o===null?o=Object.getOwnPropertyDescriptor(s,n):o,l;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,s,n,o);else for(var i=e.length-1;i>=0;i--)if(l=e[i])a=(t<3?l(a):t>3?l(s,n,a):l(s,n))||a;return t>3&&a&&Object.defineProperty(s,n,a),a};var r=undefined&&undefined.__metadata||function(e,s){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,s)};const f=class{constructor(n){e(this,n);this.valueChanged=s(this,"valueChanged",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.defaultHideAdditionalGuests=this.selectedConfiguration?.scheduler?.hide_additional_guests??false;this.defaultHideCancellationOptions=this.selectedConfiguration?.scheduler?.hide_cancellation_options??false;this.defaultHideReschedulingOptions=this.selectedConfiguration?.scheduler?.hide_rescheduling_options??false;this.name="customize-booking-settings";this.showSettings=["allowGuestsToInvite","hideCancellationOptions","hideReschedulingOptions"]}elementNameChangedHandler(e){l("nylas-customize-booking-settings","elementNameChangedHandler",e);this.host.setAttribute("name",e)}selectedConfigurationChangedHandler(e){l("nylas-customize-booking-settings","selectedConfigurationChangedHandler",e);this.allowGuestsToInvite=!e?.scheduler?.hide_additional_guests;this.hideCancellationOptions=e?.scheduler?.hide_cancellation_options??false;this.hideReschedulingOptions=e?.scheduler?.hide_rescheduling_options??false;this.handleSettingValues(false)}selectedLanguageChangedHandler(e,s){if(e===s)return;i.changeLanguage(e)}themeConfigChangedHandler(e,s){if(e===s)return;this.applyThemeConfig(e)}connectedCallback(){l("nylas-customize-booking-settings","connectedCallback")}disconnectedCallback(){l("nylas-customize-booking-settings","disconnectedCallback")}componentWillLoad(){l("nylas-customize-booking-settings","componentWillLoad");this.host.setAttribute("name",this.name);this.allowGuestsToInvite=!this.defaultHideAdditionalGuests;this.hideCancellationOptions=this.defaultHideCancellationOptions;this.hideReschedulingOptions=this.defaultHideReschedulingOptions}componentDidLoad(){l("nylas-customize-booking-settings","componentDidLoad");if(this.selectedConfiguration){this.selectedConfigurationChangedHandler(this.selectedConfiguration)}else{this.allowGuestsToInvite=!this.defaultHideAdditionalGuests;this.hideCancellationOptions=this.defaultHideCancellationOptions;this.hideReschedulingOptions=this.defaultHideReschedulingOptions;this.handleSettingValues(false)}}componentWillUpdate(){l("nylas-customize-booking-settings","componentWillUpdate")}componentDidUpdate(){l("nylas-customize-booking-settings","componentDidUpdate")}componentWillRender(){l("nylas-customize-booking-settings","componentWillRender")}componentDidRender(){l("nylas-customize-booking-settings","componentDidRender")}nylasFormCheckboxToggledHandler(e){l("nylas-customize-booking-settings","nylasFormCheckboxToggledHandler",e.detail);const{name:s,checked:n}=e.detail;if(s==="hide_additional_guests"){this.allowGuestsToInvite=n}else if(s==="hide_cancellation_options"){this.hideCancellationOptions=n}else if(s==="hide_rescheduling_options"){this.hideReschedulingOptions=n}this.handleSettingValues()}handleSettingValues(e=true){if(e){this.valueChanged.emit({value:JSON.stringify({additionalGuestsHidden:this.showSettings.includes("allowGuestsToInvite")?!this.allowGuestsToInvite:undefined,hideCancellationOptions:this.hideCancellationOptions,hideReschedulingOptions:this.hideReschedulingOptions}),name:this.name})}this.isInternalsAvailable&&this.internals.setFormValue(JSON.stringify({additionalGuestsHidden:this.showSettings.includes("allowGuestsToInvite")?!this.allowGuestsToInvite:undefined,hideCancellationOptions:this.hideCancellationOptions,hideReschedulingOptions:this.hideReschedulingOptions}),this.name)}get isInternalsAvailable(){return this.internals!==undefined&&typeof this.internals.setFormValue==="function"}applyThemeConfig(e){if(e){for(const[s,n]of Object.entries(e)){this.host.style.setProperty(`${s}`,n)}}}render(){const e=typeof this.hideCancellationOptions==="boolean"&&typeof this.hideReschedulingOptions==="boolean"&&typeof this.allowGuestsToInvite==="boolean";const s=this.showSettings.includes("allowGuestsToInvite");return n(o,{key:"95ee32383eaa0f79e514d3f90f874e900c7057c6"},e&&n("div",{key:"d96541bb348fe46e355b447abf6d6291db9c0299",class:"nylas-customize-booking-settings",part:"ncbs"},n("div",{key:"efbffadde8d8466b3b1d9203d532b7dea728ca49",class:"header",part:"ncbs__header"},n("h3",{key:"7ddf24e09757783d1216faa39eec302a4e8d331e"},i.t("nylasCustomizeBookingSettings.headerTitle")),n("p",{key:"f8bde08f579e3be007cb5fe0fc68b6ef3ab83229"},i.t("nylasCustomizeBookingSettings.headerSubTitle"))),n("div",{key:"7bb596aaaf49bc800edd71d63645e2af05662bed",class:"nylas-customize-booking-settings__settings",part:"ncbs__settings"},s&&n("div",{key:"ede3b1d6b0fd4d59626f61aec1add16cda8b8002",class:"nylas-customize-booking-settings__settings-div",part:"ncbs__settings-div , ncbs__additional_guests"},n("checkbox-component",{key:"6d4a3a2361f4df65f2f94cf6a1ef69bb34216976",name:"hide_additional_guests",label:i.t("nylasCustomizeBookingSettings.allowGuests.label"),checked:this.allowGuestsToInvite,themeConfig:this.themeConfig},n("span",{key:"7d426dd4481591be7755ed0989bce4ff4706fe80",slot:"label",class:"label"},n("p",{key:"5621e3efc18389b312151e7dd026633c13646bd7",class:"label-contents"},i.t("nylasCustomizeBookingSettings.allowGuests.label",{interpolation:{escapeValue:false,escape:e=>`${e}`,useRawValueToEscape:true}}))))),n("div",{key:"e25be0d663eb39d3bc3b8f4648ef808dd95056bf",class:"nylas-customize-booking-settings__settings-div",part:"ncbs__settings-div , ncbs__rescheduling_options"},n("checkbox-component",{key:"59e251874e791ec3d2f8f836ad8ac7bf19497479",name:"hide_rescheduling_options",label:"Hide 'Reschedule' option on booking page and emails.",checked:this.hideReschedulingOptions,themeConfig:this.themeConfig},n("span",{key:"1f29b9f236fb4b31f0b115b1f7333399dc69aa21",slot:"label",class:"label"},n("p",{key:"28844c642af4b021616a0cea37c272fbe1f98e22",class:"label-contents"},i.t("nylasCustomizeBookingSettings.hideReschedule.label")),n("tooltip-component",{key:"74aca93907522bdbc3cb8db891ae6fabb35eb6d9",id:"reschedule"},n("info-icon",{key:"2b27396051a0d40f56f143315a3806473baf4d53",slot:"tooltip-icon"}),n("span",{key:"1147361d074a455299abbbe20716f08c04072485",slot:"tooltip-content"},i.t("nylasCustomizeBookingSettings.hideReschedule.tooltip.desc")))))),n("div",{key:"bf575c9682410e79e7034725728da16d87ddb672",class:"nylas-customize-booking-settings__settings-div",part:"ncbs__settings-div , ncbs__cancellation_options"},n("checkbox-component",{key:"01fba11b486e0f4ca85266d25f239a9da9d7839c",name:"hide_cancellation_options",label:"Hide 'Cancel' option on booking page and emails.",checked:this.hideCancellationOptions,themeConfig:this.themeConfig},n("span",{key:"196335e07150e4223748fcd1d249dfd035c063f6",slot:"label",class:"label"},n("p",{key:"7b5e1b8b0cfc4f0d3f7aac800e99a088ce9aff18",class:"label-contents"},i.t("nylasCustomizeBookingSettings.hideCancel.label")),n("tooltip-component",{key:"4bd6ec7108e7946e7b63e531e303d0af15cbe73b",id:"cancel"},n("info-icon",{key:"47c37ec2380e81cbb6003fabdeced7b0eea35488",slot:"tooltip-icon"}),n("span",{key:"d50a4c634bca4866a36e3860c71db291cc347c25",slot:"tooltip-content"},i.t("nylasCustomizeBookingSettings.hideCancel.tooltip.desc")))))))))}static get formAssociated(){return true}get host(){return t(this)}static get watchers(){return{name:["elementNameChangedHandler"],selectedConfiguration:["selectedConfigurationChangedHandler"],selectedLanguage:["selectedLanguageChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};d([a({name:"nylas-customize-booking-settings",stateToProps:new Map([["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.selectedLanguage","selectedLanguage"],["schedulerConfig.themeConfig","themeConfig"]]),fireRegisterEvent:true}),r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],f.prototype,"render",null);f.style=c;export{f as nylas_customize_booking_settings};
2
2
  //# sourceMappingURL=nylas-customize-booking-settings.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["nylasCustomizeBookingSettingsCss","NylasCustomizeBookingSettings","constructor","hostRef","this","defaultHideAdditionalGuests","selectedConfiguration","scheduler","hide_additional_guests","defaultHideCancellationOptions","hide_cancellation_options","defaultHideReschedulingOptions","hide_rescheduling_options","name","showSettings","elementNameChangedHandler","newValue","debug","host","setAttribute","selectedConfigurationChangedHandler","allowGuestsToInvite","hideCancellationOptions","hideReschedulingOptions","handleSettingValues","selectedLanguageChangedHandler","newVal","oldVal","i18next","changeLanguage","themeConfigChangedHandler","applyThemeConfig","connectedCallback","disconnectedCallback","componentWillLoad","componentDidLoad","componentWillUpdate","componentDidUpdate","componentWillRender","componentDidRender","nylasFormCheckboxChangedHandler","event","detail","checked","valueChanged","emit","value","JSON","stringify","additionalGuestsHidden","includes","undefined","isInternalsAvailable","internals","setFormValue","themeConfig","key","Object","entries","style","setProperty","render","showComponent","showHideAdditionalGuests","h","Host","class","part","t","label","slot","interpolation","escapeValue","escape","s","useRawValueToEscape","id","__decorate","RegisterComponent","stateToProps","Map","fireRegisterEvent","prototype"],"sources":["src/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.scss?tag=nylas-customize-booking-settings&encapsulation=shadow","src/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-customize-booking-settings {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n\n .header {\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n }\n }\n\n .nylas-customize-booking-settings__settings {\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n padding: 1rem;\n margin: 1rem 0;\n background-color: var(--nylas-base-25);\n\n .nylas-customize-booking-settings__settings-div {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n }\n}\n\n.label {\n margin-left: 32px;\n font-size: 16px;\n font-weight: 400;\n color: var(--nylas-base-800);\n line-height: 24px;\n\n .label-contents {\n margin: 0;\n display: inline-block;\n color: var(--nylas-base-800);\n @media #{$mobile} {\n display: block;\n }\n }\n\n tooltip-component {\n display: inline-block;\n }\n}\n\ntooltip-component#guests::part(tc__content) {\n @media #{$mobile} {\n left: 58px;\n }\n}\n\ntooltip-component#reschedule::part(tc__content) {\n left: 58px;\n\n @media #{$mobile} {\n left: 58px;\n }\n}\n\ntooltip-component#cancel::part(tc__content) {\n left: -58px;\n\n @media #{$mobile} {\n left: 58px;\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-customize-booking-settings` component is a UI component that displays the booking calendar picker.\n * @part ncbs - The booking calendar picker container\n * @part ncbs__header - The header of the booking calendar picker\n * @part ncbs__settings - The settings container\n * @part ncbs__settings-div - The div inside the settings container that contains the checkbox and tooltip for each setting\n * @part ncbs__additional_guests - The additional guests setting\n * @part ncbs__cancellation_options - The cancellation options setting\n * @part ncbs__rescheduling_options - The rescheduling options setting\n */\n@Component({\n tag: 'nylas-customize-booking-settings',\n styleUrl: 'nylas-customize-booking-settings.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasCustomizeBookingSettings {\n @Element() host!: HTMLNylasCustomizeBookingSettingsElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The default additional guests hidden setting as set in the configuration.\n */\n @Prop() defaultHideAdditionalGuests: boolean = this.selectedConfiguration?.scheduler?.hide_additional_guests ?? false;\n\n /**\n * @standalone\n * The default hide cancellation options setting as set in the configuration.\n */\n @Prop() defaultHideCancellationOptions: boolean = this.selectedConfiguration?.scheduler?.hide_cancellation_options ?? false;\n\n /**\n * @standalone\n * The default hide rescheduling options setting as set in the configuration.\n */\n @Prop() defaultHideReschedulingOptions: boolean = this.selectedConfiguration?.scheduler?.hide_rescheduling_options ?? false;\n\n /**\n * @standalone\n * The name of the calendar picker.\n */\n @Prop() name: string = 'customize-booking-settings';\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * This prop is used to determined which settings are visible in the component.\n */\n @Prop() showSettings: string[] = ['allowGuestsToInvite', 'hideCancellationOptions', 'hideReschedulingOptions'];\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * State to store the allowed additional guests setting.\n */\n @State() allowGuestsToInvite!: boolean;\n\n /**\n * State to store the hide cancel booking setting.\n */\n @State() hideCancellationOptions!: boolean;\n\n /**\n * State to store the hide reschedule booking setting.\n */\n @State() hideReschedulingOptions!: boolean;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * This event is fired when the booking settings are changed.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-customize-booking-settings', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-customize-booking-settings', 'selectedConfigurationChangedHandler', newValue);\n this.allowGuestsToInvite = !newValue?.scheduler?.hide_additional_guests;\n this.hideCancellationOptions = newValue?.scheduler?.hide_cancellation_options ?? false;\n this.hideReschedulingOptions = newValue?.scheduler?.hide_rescheduling_options ?? false;\n this.handleSettingValues(false);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-customize-booking-settings', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-customize-booking-settings', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-customize-booking-settings', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n this.allowGuestsToInvite = !this.defaultHideAdditionalGuests;\n this.hideCancellationOptions = this.defaultHideCancellationOptions;\n this.hideReschedulingOptions = this.defaultHideReschedulingOptions;\n }\n\n componentDidLoad() {\n debug('nylas-customize-booking-settings', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n // Set the default values if the selected configuration is not available\n this.allowGuestsToInvite = !this.defaultHideAdditionalGuests;\n this.hideCancellationOptions = this.defaultHideCancellationOptions;\n this.hideReschedulingOptions = this.defaultHideReschedulingOptions;\n this.handleSettingValues(false);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-customize-booking-settings', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-customize-booking-settings', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-customize-booking-settings', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-customize-booking-settings', 'componentDidRender');\n }\n\n @Listen('nylasFormCheckboxChanged')\n nylasFormCheckboxChangedHandler(event: CustomEvent<{ checked: boolean; name: string }>) {\n debug('nylas-customize-booking-settings', 'nylasFormCheckboxChangedHandler', event.detail);\n const { name, checked } = event.detail;\n\n if (name === 'hide_additional_guests') {\n this.allowGuestsToInvite = checked;\n } else if (name === 'hide_cancellation_options') {\n this.hideCancellationOptions = checked;\n } else if (name === 'hide_rescheduling_options') {\n this.hideReschedulingOptions = checked;\n }\n this.handleSettingValues();\n }\n\n handleSettingValues(valueChanged: boolean = true) {\n if (valueChanged) {\n this.valueChanged.emit({\n value: JSON.stringify({\n additionalGuestsHidden: this.showSettings.includes('allowGuestsToInvite') ? !this.allowGuestsToInvite : undefined,\n hideCancellationOptions: this.hideCancellationOptions,\n hideReschedulingOptions: this.hideReschedulingOptions,\n }),\n name: this.name,\n });\n }\n this.isInternalsAvailable &&\n this.internals.setFormValue(\n JSON.stringify({\n additionalGuestsHidden: this.showSettings.includes('allowGuestsToInvite') ? !this.allowGuestsToInvite : undefined,\n hideCancellationOptions: this.hideCancellationOptions,\n hideReschedulingOptions: this.hideReschedulingOptions,\n }),\n this.name,\n );\n }\n\n /**\n * This method is essentially a workaround to check if the internals are available because\n * the unit tests in stencil do not support the internals.\n * @returns boolean\n */\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function';\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasCustomizeBookingSettings, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-customize-booking-settings',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n fireRegisterEvent: true,\n })\n render() {\n const showComponent = typeof this.hideCancellationOptions === 'boolean' && typeof this.hideReschedulingOptions === 'boolean' && typeof this.allowGuestsToInvite === 'boolean';\n const showHideAdditionalGuests = this.showSettings.includes('allowGuestsToInvite');\n\n return (\n <Host>\n {showComponent && (\n <div class=\"nylas-customize-booking-settings\" part=\"ncbs\">\n <div class=\"header\" part=\"ncbs__header\">\n <h3>{i18next.t('nylasCustomizeBookingSettings.headerTitle')}</h3>\n <p>{i18next.t('nylasCustomizeBookingSettings.headerSubTitle')}</p>\n </div>\n\n <div class=\"nylas-customize-booking-settings__settings\" part=\"ncbs__settings\">\n {showHideAdditionalGuests && (\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__additional_guests\">\n <checkbox-component\n name=\"hide_additional_guests\"\n label={i18next.t('nylasCustomizeBookingSettings.allowGuests.label')}\n checked={this.allowGuestsToInvite}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">\n {i18next.t('nylasCustomizeBookingSettings.allowGuests.label', { interpolation: { escapeValue: false, escape: s => `${s}`, useRawValueToEscape: true } })}\n </p>\n </span>\n </checkbox-component>\n </div>\n )}\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__rescheduling_options\">\n <checkbox-component\n name=\"hide_rescheduling_options\"\n label=\"Hide 'Reschedule' option on booking page and emails.\"\n checked={this.hideReschedulingOptions}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">{i18next.t('nylasCustomizeBookingSettings.hideReschedule.label')}</p>\n <tooltip-component id=\"reschedule\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasCustomizeBookingSettings.hideReschedule.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </checkbox-component>\n </div>\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__cancellation_options\">\n <checkbox-component\n name=\"hide_cancellation_options\"\n label=\"Hide 'Cancel' option on booking page and emails.\"\n checked={this.hideCancellationOptions}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">{i18next.t('nylasCustomizeBookingSettings.hideCancel.label')}</p>\n <tooltip-component id=\"cancel\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasCustomizeBooking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AM,SACvBF,EAAG,KAAAR,IAAA,2CAAAU,MAAM,kBAAkBtC,EAAQwC,EAAE,uDACrCJ,EAAmB,qBAAAR,IAAA,2CAAAoB,GAAG,cACpBZ,EAAW,aAAAR,IAAA,2CAAAc,KAAK,iBAChBN,EAAA,QAAAR,IAAA,2CAAMc,KAAK,mBAAmB1C,EAAQwC,EAAE,kEAKhDJ,EAAA,OAAAR,IAAA,2CAAKU,MAAM,iDAAiDC,KAAK,mDAC/DH,EAAA,sBAAAR,IAAA,2CACE3C,KAAK,4BACLwD,MAAM,mDACN1B,QAASvC,KAAKkB,wBACdiC,YAAanD,KAAKmD,aAElBS,EAAA,QAAAR,IAAA,2CAAMc,KAAK,QAAQJ,MAAM,SACvBF,EAAG,KAAAR,IAAA,2CAAAU,MAAM,kBAAkBtC,EAAQwC,EAAE,mDACrCJ,EAAmB,qBAAAR,IAAA,2CAAAoB,GAAG,UACpBZ,EAAW,aAAAR,IAAA,2CAAAc,KAAK,iBAChBN,EAAM,QAAAR,IAAA,2CAAAc,KAAK,mBAAmB1C,EAAQwC,EAAE,gE,kSAzD5DS,EAAA,CATCC,EAAoI,CACnIjE,KAAM,mCACNkE,aAAc,IAAIC,IAAI,CACpB,CAAC,wCAAyC,yBAC1C,CAAC,mCAAoC,oBACrC,CAAC,8BAA+B,iBAElCC,kBAAmB,O,mFAqEpBhF,EAAAiF,UAAA,e","ignoreList":[]}
1
+ {"version":3,"names":["nylasCustomizeBookingSettingsCss","NylasCustomizeBookingSettings","constructor","hostRef","this","defaultHideAdditionalGuests","selectedConfiguration","scheduler","hide_additional_guests","defaultHideCancellationOptions","hide_cancellation_options","defaultHideReschedulingOptions","hide_rescheduling_options","name","showSettings","elementNameChangedHandler","newValue","debug","host","setAttribute","selectedConfigurationChangedHandler","allowGuestsToInvite","hideCancellationOptions","hideReschedulingOptions","handleSettingValues","selectedLanguageChangedHandler","newVal","oldVal","i18next","changeLanguage","themeConfigChangedHandler","applyThemeConfig","connectedCallback","disconnectedCallback","componentWillLoad","componentDidLoad","componentWillUpdate","componentDidUpdate","componentWillRender","componentDidRender","nylasFormCheckboxToggledHandler","event","detail","checked","valueChanged","emit","value","JSON","stringify","additionalGuestsHidden","includes","undefined","isInternalsAvailable","internals","setFormValue","themeConfig","key","Object","entries","style","setProperty","render","showComponent","showHideAdditionalGuests","h","Host","class","part","t","label","slot","interpolation","escapeValue","escape","s","useRawValueToEscape","id","__decorate","RegisterComponent","stateToProps","Map","fireRegisterEvent","prototype"],"sources":["src/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.scss?tag=nylas-customize-booking-settings&encapsulation=shadow","src/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-customize-booking-settings {\n width: inherit;\n display: flex;\n flex-direction: column;\n margin: 1rem;\n border-radius: var(--nylas-border-radius-2x);\n border: 1px solid var(--nylas-base-200);\n\n .header {\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-base-200);\n\n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nylas-base-900);\n text-align: left;\n }\n\n p {\n margin: 0.25rem 0 0 0;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n text-align: left;\n }\n }\n\n .nylas-customize-booking-settings__settings {\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n padding: 1rem;\n margin: 1rem 0;\n background-color: var(--nylas-base-25);\n\n .nylas-customize-booking-settings__settings-div {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n }\n}\n\n.label {\n margin-left: 32px;\n font-size: 16px;\n font-weight: 400;\n color: var(--nylas-base-800);\n line-height: 24px;\n\n .label-contents {\n margin: 0;\n display: inline-block;\n color: var(--nylas-base-800);\n @media #{$mobile} {\n display: block;\n }\n }\n\n tooltip-component {\n display: inline-block;\n }\n}\n\ntooltip-component#guests::part(tc__content) {\n @media #{$mobile} {\n left: 58px;\n }\n}\n\ntooltip-component#reschedule::part(tc__content) {\n left: 58px;\n\n @media #{$mobile} {\n left: 58px;\n }\n}\n\ntooltip-component#cancel::part(tc__content) {\n left: -58px;\n\n @media #{$mobile} {\n left: 58px;\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-customize-booking-settings` component is a UI component that displays the booking calendar picker.\n * @part ncbs - The booking calendar picker container\n * @part ncbs__header - The header of the booking calendar picker\n * @part ncbs__settings - The settings container\n * @part ncbs__settings-div - The div inside the settings container that contains the checkbox and tooltip for each setting\n * @part ncbs__additional_guests - The additional guests setting\n * @part ncbs__cancellation_options - The cancellation options setting\n * @part ncbs__rescheduling_options - The rescheduling options setting\n */\n@Component({\n tag: 'nylas-customize-booking-settings',\n styleUrl: 'nylas-customize-booking-settings.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasCustomizeBookingSettings {\n @Element() host!: HTMLNylasCustomizeBookingSettingsElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The default additional guests hidden setting as set in the configuration.\n */\n @Prop() defaultHideAdditionalGuests: boolean = this.selectedConfiguration?.scheduler?.hide_additional_guests ?? false;\n\n /**\n * @standalone\n * The default hide cancellation options setting as set in the configuration.\n */\n @Prop() defaultHideCancellationOptions: boolean = this.selectedConfiguration?.scheduler?.hide_cancellation_options ?? false;\n\n /**\n * @standalone\n * The default hide rescheduling options setting as set in the configuration.\n */\n @Prop() defaultHideReschedulingOptions: boolean = this.selectedConfiguration?.scheduler?.hide_rescheduling_options ?? false;\n\n /**\n * @standalone\n * The name of the calendar picker.\n */\n @Prop() name: string = 'customize-booking-settings';\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * This prop is used to determined which settings are visible in the component.\n */\n @Prop() showSettings: string[] = ['allowGuestsToInvite', 'hideCancellationOptions', 'hideReschedulingOptions'];\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * State to store the allowed additional guests setting.\n */\n @State() allowGuestsToInvite!: boolean;\n\n /**\n * State to store the hide cancel booking setting.\n */\n @State() hideCancellationOptions!: boolean;\n\n /**\n * State to store the hide reschedule booking setting.\n */\n @State() hideReschedulingOptions!: boolean;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * This event is fired when the booking settings are changed.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-customize-booking-settings', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-customize-booking-settings', 'selectedConfigurationChangedHandler', newValue);\n this.allowGuestsToInvite = !newValue?.scheduler?.hide_additional_guests;\n this.hideCancellationOptions = newValue?.scheduler?.hide_cancellation_options ?? false;\n this.hideReschedulingOptions = newValue?.scheduler?.hide_rescheduling_options ?? false;\n this.handleSettingValues(false);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-customize-booking-settings', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-customize-booking-settings', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-customize-booking-settings', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n this.allowGuestsToInvite = !this.defaultHideAdditionalGuests;\n this.hideCancellationOptions = this.defaultHideCancellationOptions;\n this.hideReschedulingOptions = this.defaultHideReschedulingOptions;\n }\n\n componentDidLoad() {\n debug('nylas-customize-booking-settings', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n // Set the default values if the selected configuration is not available\n this.allowGuestsToInvite = !this.defaultHideAdditionalGuests;\n this.hideCancellationOptions = this.defaultHideCancellationOptions;\n this.hideReschedulingOptions = this.defaultHideReschedulingOptions;\n this.handleSettingValues(false);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-customize-booking-settings', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-customize-booking-settings', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-customize-booking-settings', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-customize-booking-settings', 'componentDidRender');\n }\n\n @Listen('nylasFormCheckboxToggled')\n nylasFormCheckboxToggledHandler(event: CustomEvent<{ checked: boolean; name: string }>) {\n debug('nylas-customize-booking-settings', 'nylasFormCheckboxToggledHandler', event.detail);\n const { name, checked } = event.detail;\n\n if (name === 'hide_additional_guests') {\n this.allowGuestsToInvite = checked;\n } else if (name === 'hide_cancellation_options') {\n this.hideCancellationOptions = checked;\n } else if (name === 'hide_rescheduling_options') {\n this.hideReschedulingOptions = checked;\n }\n this.handleSettingValues();\n }\n\n handleSettingValues(valueChanged: boolean = true) {\n if (valueChanged) {\n this.valueChanged.emit({\n value: JSON.stringify({\n additionalGuestsHidden: this.showSettings.includes('allowGuestsToInvite') ? !this.allowGuestsToInvite : undefined,\n hideCancellationOptions: this.hideCancellationOptions,\n hideReschedulingOptions: this.hideReschedulingOptions,\n }),\n name: this.name,\n });\n }\n this.isInternalsAvailable &&\n this.internals.setFormValue(\n JSON.stringify({\n additionalGuestsHidden: this.showSettings.includes('allowGuestsToInvite') ? !this.allowGuestsToInvite : undefined,\n hideCancellationOptions: this.hideCancellationOptions,\n hideReschedulingOptions: this.hideReschedulingOptions,\n }),\n this.name,\n );\n }\n\n /**\n * This method is essentially a workaround to check if the internals are available because\n * the unit tests in stencil do not support the internals.\n * @returns boolean\n */\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function';\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasCustomizeBookingSettings, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-customize-booking-settings',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n fireRegisterEvent: true,\n })\n render() {\n const showComponent = typeof this.hideCancellationOptions === 'boolean' && typeof this.hideReschedulingOptions === 'boolean' && typeof this.allowGuestsToInvite === 'boolean';\n const showHideAdditionalGuests = this.showSettings.includes('allowGuestsToInvite');\n\n return (\n <Host>\n {showComponent && (\n <div class=\"nylas-customize-booking-settings\" part=\"ncbs\">\n <div class=\"header\" part=\"ncbs__header\">\n <h3>{i18next.t('nylasCustomizeBookingSettings.headerTitle')}</h3>\n <p>{i18next.t('nylasCustomizeBookingSettings.headerSubTitle')}</p>\n </div>\n\n <div class=\"nylas-customize-booking-settings__settings\" part=\"ncbs__settings\">\n {showHideAdditionalGuests && (\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__additional_guests\">\n <checkbox-component\n name=\"hide_additional_guests\"\n label={i18next.t('nylasCustomizeBookingSettings.allowGuests.label')}\n checked={this.allowGuestsToInvite}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">\n {i18next.t('nylasCustomizeBookingSettings.allowGuests.label', { interpolation: { escapeValue: false, escape: s => `${s}`, useRawValueToEscape: true } })}\n </p>\n </span>\n </checkbox-component>\n </div>\n )}\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__rescheduling_options\">\n <checkbox-component\n name=\"hide_rescheduling_options\"\n label=\"Hide 'Reschedule' option on booking page and emails.\"\n checked={this.hideReschedulingOptions}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">{i18next.t('nylasCustomizeBookingSettings.hideReschedule.label')}</p>\n <tooltip-component id=\"reschedule\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasCustomizeBookingSettings.hideReschedule.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </checkbox-component>\n </div>\n <div class=\"nylas-customize-booking-settings__settings-div\" part=\"ncbs__settings-div , ncbs__cancellation_options\">\n <checkbox-component\n name=\"hide_cancellation_options\"\n label=\"Hide 'Cancel' option on booking page and emails.\"\n checked={this.hideCancellationOptions}\n themeConfig={this.themeConfig}\n >\n <span slot=\"label\" class=\"label\">\n <p class=\"label-contents\">{i18next.t('nylasCustomizeBookingSettings.hideCancel.label')}</p>\n <tooltip-component id=\"cancel\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasCust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QJ,MAAM,SACvBF,EAAG,KAAAR,IAAA,2CAAAU,MAAM,kBAAkBtC,EAAQwC,EAAE,uDACrCJ,EAAmB,qBAAAR,IAAA,2CAAAoB,GAAG,cACpBZ,EAAW,aAAAR,IAAA,2CAAAc,KAAK,iBAChBN,EAAA,QAAAR,IAAA,2CAAMc,KAAK,mBAAmB1C,EAAQwC,EAAE,kEAKhDJ,EAAA,OAAAR,IAAA,2CAAKU,MAAM,iDAAiDC,KAAK,mDAC/DH,EAAA,sBAAAR,IAAA,2CACE3C,KAAK,4BACLwD,MAAM,mDACN1B,QAASvC,KAAKkB,wBACdiC,YAAanD,KAAKmD,aAElBS,EAAA,QAAAR,IAAA,2CAAMc,KAAK,QAAQJ,MAAM,SACvBF,EAAG,KAAAR,IAAA,2CAAAU,MAAM,kBAAkBtC,EAAQwC,EAAE,mDACrCJ,EAAmB,qBAAAR,IAAA,2CAAAoB,GAAG,UACpBZ,EAAW,aAAAR,IAAA,2CAAAc,KAAK,iBAChBN,EAAM,QAAAR,IAAA,2CAAAc,KAAK,mBAAmB1C,EAAQwC,EAAE,gE,kSAzD5DS,EAAA,CATCC,EAAoI,CACnIjE,KAAM,mCACNkE,aAAc,IAAIC,IAAI,CACpB,CAAC,wCAAyC,yBAC1C,CAAC,mCAAoC,oBACrC,CAAC,8BAA+B,iBAElCC,kBAAmB,O,mFAqEpBhF,EAAAiF,UAAA,e","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as e,a,h as s,e as l}from"./index-B-KMpdMZ.js";import{n as r}from"./utils-Bj5Y75fX.js";const t=':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;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);border-color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=date]{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%;width:100%;width:-moz-available;width:-webkit-fill-available;font-family:var(--nylas-font-family);padding:0 8px;cursor:pointer}input[type=date]:focus{outline-color:var(--nylas-primary)}input[type=date].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=date].error::placeholder{font-weight:400}input[type=date]::placeholder{color:var(--nylas-base-300)}input[type=date]::-webkit-calendar-picker-indicator{filter:invert(37%) sepia(51%) saturate(6324%) hue-rotate(215deg) brightness(94%) contrast(95%);cursor:pointer}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}';const o={date:"YYYY-MM-DD"};const n=class{constructor(s){e(this,s);this.nylasFormInputChanged=a(this,"nylasFormInputChanged",7);this.nylasFormInputFocused=a(this,"nylasFormInputFocused",7);this.nylasFormInputBlurred=a(this,"nylasFormInputBlurred",7);this.name="input";this.label="";this.placeholder=o["date"];this.required=false;this.readOnly=false;this.autoFocus=false;this.maxLength=255;this.patternError="";this.requiredError="";this.errorMessage="";this.hasError=false;this.error="";this.isDateValid=true}handleDefaultValueChange(e){this.value=r(e);if(this.value){this.validatePattern(this.value,true)}}themeConfigChangedHandler(e,a){if(e===a)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[a,s]of Object.entries(e)){this.el.style.setProperty(`${a}`,s)}}}componentDidLoad(){this.value=r(this.defaultValue||"");if(this.value){this.validatePattern(this.value,true)}this.applyThemeConfig(this.themeConfig)}handleBookingFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}async handleFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}handleInput(e){this.error="";const a=e.target;this.value=r(a.value);this.isDateValid=a.validity.valid;this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"})}handleBlur(){this.nylasFormInputBlurred.emit({value:this.value,name:this.name})}handleFocus(){this.nylasFormInputFocused.emit({value:this.value,name:this.name})}validatePattern(e,a=false){this.error="";if(!a&&(this.required&&!this.isDateValid||this.minDate&&new Date(this.minDate)>new Date(e))){this.error=this.errorMessage||"Please enter a valid date";this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"});return}if(this.required&&!e){this.error=this.requiredError||"This field is required.";return}if(!this.pattern||!e&&!this.required)return;if(this.pattern.test(e)){this.error=""}else{this.error=this.patternError||"Invalid format."}}render(){return s("label",{key:"6ecd49870a622b642ad4aab21e4cd9ef8dad9734",part:"ic__label",class:{error:!!this.error||this.hasError}},this.label&&s("p",{key:"a1b05b55eede8e141825432c1b682afe7d265c22"},s("span",{key:"b6acf957bb65c85b4a20fc73724185c101de7c09",class:"label"},this.label),this.required&&s("span",{key:"77e09efda3787ec53f12a03c725747f9177511d7",class:"required"},"*")),s("div",{key:"622508961bdfe6eba6921879267e83d7ca5dbf5c",part:"ic__input_wrapper",class:"input_wrapper"},s("input",{key:"18dc2f64cc67899136b145b0e8d64bddbbea75e1",type:"date",name:this.name,part:"ic__date",title:this.readOnly?"read-only field":undefined,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,min:this.minDate,maxLength:this.maxLength,placeholder:this.placeholder,class:{error:!!this.error||this.hasError},onInput:e=>this.handleInput(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),s("slot",{key:"2069e97cb03ca3880ed2fcc41a8e5ee174621707",name:"additional-input"})),this.error&&s("span",{key:"eef365e0a17f7ea186c7a31f05d32edfdc3f70d6",class:"error help-text"},this.error))}get el(){return l(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"],themeConfig:["themeConfigChangedHandler"]}}};n.style=t;export{n as nylas_date_component};
1
+ import{r as e,a,h as s,e as l}from"./index-Cbn5rIwb.js";import{n as r}from"./utils-DhmCcrVs.js";const t=':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;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);border-color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=date]{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%;width:100%;width:-moz-available;width:-webkit-fill-available;font-family:var(--nylas-font-family);padding:0 8px;cursor:pointer}input[type=date]:focus{outline-color:var(--nylas-primary)}input[type=date].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=date].error::placeholder{font-weight:400}input[type=date]::placeholder{color:var(--nylas-base-300)}input[type=date]::-webkit-calendar-picker-indicator{filter:invert(37%) sepia(51%) saturate(6324%) hue-rotate(215deg) brightness(94%) contrast(95%);cursor:pointer}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}';const o={date:"YYYY-MM-DD"};const n=class{constructor(s){e(this,s);this.nylasFormInputChanged=a(this,"nylasFormInputChanged",7);this.nylasFormInputFocused=a(this,"nylasFormInputFocused",7);this.nylasFormInputBlurred=a(this,"nylasFormInputBlurred",7);this.name="input";this.label="";this.placeholder=o["date"];this.required=false;this.readOnly=false;this.autoFocus=false;this.maxLength=255;this.patternError="";this.requiredError="";this.errorMessage="";this.hasError=false;this.error="";this.isDateValid=true}handleDefaultValueChange(e){this.value=r(e);if(this.value){this.validatePattern(this.value,true)}}themeConfigChangedHandler(e,a){if(e===a)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[a,s]of Object.entries(e)){this.el.style.setProperty(`${a}`,s)}}}componentDidLoad(){this.value=r(this.defaultValue||"");if(this.value){this.validatePattern(this.value,true)}this.applyThemeConfig(this.themeConfig)}handleBookingFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}async handleFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}handleInput(e){this.error="";const a=e.target;this.value=r(a.value);this.isDateValid=a.validity.valid;this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"})}handleBlur(){this.nylasFormInputBlurred.emit({value:this.value,name:this.name})}handleFocus(){this.nylasFormInputFocused.emit({value:this.value,name:this.name})}validatePattern(e,a=false){this.error="";if(!a&&(this.required&&!this.isDateValid||this.minDate&&new Date(this.minDate)>new Date(e))){this.error=this.errorMessage||"Please enter a valid date";this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"});return}if(this.required&&!e){this.error=this.requiredError||"This field is required.";return}if(!this.pattern||!e&&!this.required)return;if(this.pattern.test(e)){this.error=""}else{this.error=this.patternError||"Invalid format."}}render(){return s("label",{key:"6ecd49870a622b642ad4aab21e4cd9ef8dad9734",part:"ic__label",class:{error:!!this.error||this.hasError}},this.label&&s("p",{key:"a1b05b55eede8e141825432c1b682afe7d265c22"},s("span",{key:"b6acf957bb65c85b4a20fc73724185c101de7c09",class:"label"},this.label),this.required&&s("span",{key:"77e09efda3787ec53f12a03c725747f9177511d7",class:"required"},"*")),s("div",{key:"622508961bdfe6eba6921879267e83d7ca5dbf5c",part:"ic__input_wrapper",class:"input_wrapper"},s("input",{key:"18dc2f64cc67899136b145b0e8d64bddbbea75e1",type:"date",name:this.name,part:"ic__date",title:this.readOnly?"read-only field":undefined,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,min:this.minDate,maxLength:this.maxLength,placeholder:this.placeholder,class:{error:!!this.error||this.hasError},onInput:e=>this.handleInput(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),s("slot",{key:"2069e97cb03ca3880ed2fcc41a8e5ee174621707",name:"additional-input"})),this.error&&s("span",{key:"eef365e0a17f7ea186c7a31f05d32edfdc3f70d6",class:"error help-text"},this.error))}get el(){return l(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"],themeConfig:["themeConfigChangedHandler"]}}};n.style=t;export{n as nylas_date_component};
2
2
  //# sourceMappingURL=nylas-date-component.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as e,a as t,h as n,d as r,e as o}from"./index-B-KMpdMZ.js";import{R as i}from"./register-component-BHk70oxk.js";import{d as a,u as s,t as f,e as l,i as c,o as u,b as d,p as h,q as y,r as b,v as p,w as g}from"./utils-Bj5Y75fX.js";const w=new Date,m=new Date;function v(e,t,n,r){function o(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}o.floor=t=>(e(t=new Date(+t)),t);o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n);o.round=e=>{const t=o(e),n=o.ceil(e);return e-t<n-e?t:n};o.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e);o.range=(n,r,i)=>{const a=[];n=o.ceil(n);i=i==null?1:Math.floor(i);if(!(n<r)||!(i>0))return a;let s;do{a.push(s=new Date(+n)),t(n,i),e(n)}while(s<n&&n<r);return a};o.filter=n=>v((t=>{if(t>=t)while(e(t),!n(t))t.setTime(t-1)}),((e,r)=>{if(e>=e){if(r<0)while(++r<=0){while(t(e,-1),!n(e)){}}else while(--r>=0){while(t(e,+1),!n(e)){}}}}));if(n){o.count=(t,r)=>{w.setTime(+t),m.setTime(+r);e(w),e(m);return Math.floor(n(w,m))};o.every=e=>{e=Math.floor(e);return!isFinite(e)||!(e>0)?null:!(e>1)?o:o.filter(r?t=>r(t)%e===0:t=>o.count(0,t)%e===0)}}return o}const M=v((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));M.every=e=>{e=Math.floor(e);if(!isFinite(e)||!(e>0))return null;if(!(e>1))return M;return v((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e))};const x=M.range;const k=1e3;const D=k*60;const _=D*60;const A=_*24;const C=A*7;const j=A*30;const S=A*365;const T=v((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*k)}),((e,t)=>(t-e)/k),(e=>e.getUTCSeconds()));const N=T.range;const E=v((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*k)}),((e,t)=>{e.setTime(+e+t*D)}),((e,t)=>(t-e)/D),(e=>e.getMinutes()));const z=E.range;const F=v((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*D)}),((e,t)=>(t-e)/D),(e=>e.getUTCMinutes()));const R=F.range;const L=v((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*k-e.getMinutes()*D)}),((e,t)=>{e.setTime(+e+t*_)}),((e,t)=>(t-e)/_),(e=>e.getHours()));const O=L.range;const $=v((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*_)}),((e,t)=>(t-e)/_),(e=>e.getUTCHours()));const U=$.range;const B=v((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*D)/A),(e=>e.getDate()-1));const I=B.range;const P=v((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/A),(e=>e.getUTCDate()-1));const X=P.range;const q=v((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/A),(e=>Math.floor(e/A)));const H=q.range;function K(e){return v((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7);t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+t*7)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*D)/C))}const W=K(0);const Y=K(1);const Z=K(2);const G=K(3);const J=K(4);const Q=K(5);const V=K(6);const ee=W.range;const te=Y.range;const ne=Z.range;const re=G.range;const oe=J.range;const ie=Q.range;const ae=V.range;function se(e){return v((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7);t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)}),((e,t)=>(t-e)/C))}const fe=se(0);const le=se(1);const ce=se(2);const ue=se(3);const de=se(4);const he=se(5);const ye=se(6);const be=fe.range;const pe=le.range;const ge=ce.range;const we=ue.range;const me=de.range;const ve=he.range;const Me=ye.range;const xe=v((e=>{e.setDate(1);e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12),(e=>e.getMonth()));const ke=xe.range;const De=v((e=>{e.setUTCDate(1);e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12),(e=>e.getUTCMonth()));const _e=De.range;const Ae=v((e=>{e.setMonth(0,1);e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));Ae.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:v((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e);t.setMonth(0,1);t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)}));const Ce=Ae.range;const je=v((e=>{e.setUTCMonth(0,1);e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));je.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:v((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e);t.setUTCMonth(0,1);t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}));const Se=je.range;function Te(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ne(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ee(e){let t,n,r;if(e.length!==2){t=Te;n=(t,n)=>Te(e(t),n);r=(t,n)=>e(t)-n}else{t=e===Te||e===Ne?e:ze;n=e;r=e}function o(e,r,o=0,i=e.length){if(o<i){if(t(r,r)!==0)return i;do{const t=o+i>>>1;if(n(e[t],r)<0)o=t+1;else i=t}while(o<i)}return o}function i(e,r,o=0,i=e.length){if(o<i){if(t(r,r)!==0)return i;do{const t=o+i>>>1;if(n(e[t],r)<=0)o=t+1;else i=t}while(o<i)}return o}function a(e,t,n=0,i=e.length){const a=o(e,t,n,i-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a}return{left:o,center:a,right:i}}function ze(){return 0}function Fe(e){return e===null?NaN:+e}function*Re(e,t){if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){yield t}}}else{let n=-1;for(let r of e){if((r=t(r,++n,e))!=null&&(r=+r)>=r){yield r}}}}const Le=Ee(Te);const Oe=Le.right;const $e=Le.left;const Ue=Ee(Fe).center;function Be(e,t){if(!((t=+t)>=0))throw new RangeError("invalid r");let n=e.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!t)return e;const r=We(t);const o=e.slice();r(e,o,0,n,1);r(o,e,0,n,1);r(e,o,0,n,1);return e}const Ie=Xe(We);const Pe=Xe(Ke);function Xe(e){return function(t,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:o,width:i,height:a}=t;if(!((i=Math.floor(i))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==undefined?a:o.length/i))>=0))throw new RangeError("invalid height");if(!i||!a||!n&&!r)return t;const s=n&&e(n);const f=r&&e(r);const l=o.slice();if(s&&f){qe(s,l,o,i,a);qe(s,o,l,i,a);qe(s,l,o,i,a);He(f,o,l,i,a);He(f,l,o,i,a);He(f,o,l,i,a)}else if(s){qe(s,o,l,i,a);qe(s,l,o,i,a);qe(s,o,l,i,a)}else if(f){He(f,o,l,i,a);He(f,l,o,i,a);He(f,o,l,i,a)}return t}}function qe(e,t,n,r,o){for(let i=0,a=r*o;i<a;){e(t,n,i,i+=r,1)}}function He(e,t,n,r,o){for(let i=0,a=r*o;i<r;++i){e(t,n,i,i+a,r)}}function Ke(e){const t=We(e);return(e,n,r,o,i)=>{r<<=2,o<<=2,i<<=2;t(e,n,r+0,o+0,i);t(e,n,r+1,o+1,i);t(e,n,r+2,o+2,i);t(e,n,r+3,o+3,i)}}function We(e){const t=Math.floor(e);if(t===e)return Ye(e);const n=e-t;const r=2*e+1;return(e,o,i,a,s)=>{if(!((a-=s)>=i))return;let f=t*o[i];const l=s*t;const c=l+s;for(let e=i,t=i+l;e<t;e+=s){f+=o[Math.min(a,e)]}for(let t=i,u=a;t<=u;t+=s){f+=o[Math.min(a,t+l)];e[t]=(f+n*(o[Math.max(i,t-c)]+o[Math.min(a,t+c)]))/r;f-=o[Math.max(i,t-l)]}}}function Ye(e){const t=2*e+1;return(n,r,o,i,a)=>{if(!((i-=a)>=o))return;let s=e*r[o];const f=a*e;for(let e=o,t=o+f;e<t;e+=a){s+=r[Math.min(i,e)]}for(let e=o,l=i;e<=l;e+=a){s+=r[Math.min(i,e+f)];n[e]=s/t;s-=r[Math.max(o,e-f)]}}}function Ze(e,t){let n=0;if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){++n}}}else{let r=-1;for(let o of e){if((o=t(o,++r,e))!=null&&(o=+o)>=o){++n}}}return n}function Ge(e){return e.length|0}function Je(e){return!(e>0)}function Qe(e){return typeof e!=="object"||"length"in e?e:Array.from(e)}function Ve(e){return t=>e(...t)}function et(...e){const t=typeof e[e.length-1]==="function"&&Ve(e.pop());e=e.map(Qe);const n=e.map(Ge);const r=e.length-1;const o=new Array(r+1).fill(0);const i=[];if(r<0||n.some(Je))return i;while(true){i.push(o.map(((t,n)=>e[n][t])));let a=r;while(++o[a]===n[a]){if(a===0)return t?i.map(t):i;o[a--]=0}}}function tt(e,t){var n=0,r=0;return Float64Array.from(e,t===undefined?e=>n+=+e||0:o=>n+=+t(o,r++,e)||0)}function nt(e,t){let n=0;let r;let o=0;let i=0;if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){r=t-o;o+=r/++n;i+=r*(t-o)}}}else{let a=-1;for(let s of e){if((s=t(s,++a,e))!=null&&(s=+s)>=s){r=s-o;o+=r/++n;i+=r*(s-o)}}}if(n>1)return i/(n-1)}function rt(e,t){const n=nt(e,t);return n?Math.sqrt(n):n}function ot(e,t){let n;let r;if(t===undefined){for(const t of e){if(t!=null){if(n===undefined){if(t>=t)n=r=t}else{if(n>t)n=t;if(r<t)r=t}}}}else{let o=-1;for(let i of e){if((i=t(i,++o,e))!=null){if(n===undefined){if(i>=i)n=r=i}else{if(n>i)n=i;if(r<i)r=i}}}}return[n,r]}class it{constructor(){this._partials=new Float64Array(32);this._n=0}add(e){const t=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const o=t[r],i=e+o,a=Math.abs(e)<Math.abs(o)?e-(i-o):o-(i-e);if(a)t[n++]=a;e=i}t[n]=e;this._n=n+1;return this}valueOf(){const e=this._partials;let t=this._n,n,r,o,i=0;if(t>0){i=e[--t];while(t>0){n=i;r=e[--t];i=n+r;o=r-(i-n);if(o)break}if(t>0&&(o<0&&e[t-1]<0||o>0&&e[t-1]>0)){r=o*2;n=i+r;if(r==n-i)i=n}}return i}}function at(e,t){const n=new it;if(t===undefined){for(let t of e){if(t=+t){n.add(t)}}}else{let r=-1;for(let o of e){if(o=+t(o,++r,e)){n.add(o)}}}return+n}function st(e,t){const n=new it;let r=-1;return Float64Array.from(e,t===undefined?e=>n.add(+e||0):o=>n.add(+t(o,++r,e)||0))}class ft extends Map{constructor(e,t=ht){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}});if(e!=null)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(ct(this,e))}has(e){return super.has(ct(this,e))}set(e,t){return super.set(ut(this,e),t)}delete(e){return super.delete(dt(this,e))}}class lt extends Set{constructor(e,t=ht){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}});if(e!=null)for(const t of e)this.add(t)}has(e){return super.has(ct(this,e))}add(e){return super.add(ut(this,e))}delete(e){return super.delete(dt(this,e))}}function ct({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function ut({_intern:e,_key:t},n){const r=t(n);if(e.has(r))return e.get(r);e.set(r,n);return n}function dt({_intern:e,_key:t},n){const r=t(n);if(e.has(r)){n=e.get(r);e.delete(r)}return n}function ht(e){return e!==null&&typeof e==="object"?e.valueOf():e}function yt(e){return e}function bt(e,...t){return _t(e,yt,yt,t)}function pt(e,...t){return _t(e,Array.from,yt,t)}function gt(e,t){for(let n=1,r=t.length;n<r;++n){e=e.flatMap((e=>e.pop().map((([t,n])=>[...e,t,n]))))}return e}function wt(e,...t){return gt(pt(e,...t),t)}function mt(e,t,...n){return gt(Mt(e,t,...n),n)}function vt(e,t,...n){return _t(e,yt,t,n)}function Mt(e,t,...n){return _t(e,Array.from,t,n)}function xt(e,...t){return _t(e,yt,Dt,t)}function kt(e,...t){return _t(e,Array.from,Dt,t)}function Dt(e){if(e.length!==1)throw new Error("duplicate key");return e[0]}function _t(e,t,n,r){return function e(o,i){if(i>=r.length)return n(o);const a=new ft;const s=r[i++];let f=-1;for(const e of o){const t=s(e,++f,o);const n=a.get(t);if(n)n.push(e);else a.set(t,[e])}for(const[t,n]of a){a.set(t,e(n,i))}return t(a)}(e,0)}function At(e,t){return Array.from(t,(t=>e[t]))}function Ct(e,...t){if(typeof e[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){const r=Uint32Array.from(e,((e,t)=>t));if(t.length>1){t=t.map((t=>e.map(t)));r.sort(((e,n)=>{for(const r of t){const t=St(r[e],r[n]);if(t)return t}}))}else{n=e.map(n);r.sort(((e,t)=>St(n[e],n[t])))}return At(e,r)}return e.sort(jt(n))}function jt(e=Te){if(e===Te)return St;if(typeof e!=="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);if(r||r===0)return r;return(e(n,n)===0)-(e(t,t)===0)}}function St(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function Tt(e,t,n){return(t.length!==2?Ct(vt(e,t,n),(([e,t],[n,r])=>Te(t,r)||Te(e,n))):Ct(bt(e,n),(([e,n],[r,o])=>t(n,o)||Te(e,r)))).map((([e])=>e))}var Nt=Array.prototype;var Et=Nt.slice;var zt=Nt.map;function Ft(e){return()=>e}const Rt=Math.sqrt(50),Lt=Math.sqrt(10),Ot=Math.sqrt(2);function $t(e,t,n){const r=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),a=i>=Rt?10:i>=Lt?5:i>=Ot?2:1;let s,f,l;if(o<0){l=Math.pow(10,-o)/a;s=Math.round(e*l);f=Math.round(t*l);if(s/l<e)++s;if(f/l>t)--f;l=-l}else{l=Math.pow(10,o)*a;s=Math.round(e/l);f=Math.round(t/l);if(s*l<e)++s;if(f*l>t)--f}if(f<s&&.5<=n&&n<2)return $t(e,t,n*2);return[s,f,l]}function Ut(e,t,n){t=+t,e=+e,n=+n;if(!(n>0))return[];if(e===t)return[e];const r=t<e,[o,i,a]=r?$t(t,e,n):$t(e,t,n);if(!(i>=o))return[];const s=i-o+1,f=new Array(s);if(r){if(a<0)for(let e=0;e<s;++e)f[e]=(i-e)/-a;else for(let e=0;e<s;++e)f[e]=(i-e)*a}else{if(a<0)for(let e=0;e<s;++e)f[e]=(o+e)/-a;else for(let e=0;e<s;++e)f[e]=(o+e)*a}return f}function Bt(e,t,n){t=+t,e=+e,n=+n;return $t(e,t,n)[2]}function It(e,t,n){t=+t,e=+e,n=+n;const r=t<e,o=r?Bt(t,e,n):Bt(e,t,n);return(r?-1:1)*(o<0?1/-o:o)}function Pt(e,t,n){let r;while(true){const o=Bt(e,t,n);if(o===r||o===0||!isFinite(o)){return[e,t]}else if(o>0){e=Math.floor(e/o)*o;t=Math.ceil(t/o)*o}else if(o<0){e=Math.ceil(e*o)/o;t=Math.floor(t*o)/o}r=o}}function Xt(e){return Math.max(1,Math.ceil(Math.log(Ze(e))/Math.LN2)+1)}function qt(){var e=yt,t=ot,n=Xt;function r(r){if(!Array.isArray(r))r=Array.from(r);var o,i=r.length,a,s,f=new Array(i);for(o=0;o<i;++o){f[o]=e(r[o],o,r)}var l=t(f),c=l[0],u=l[1],d=n(f,c,u);if(!Array.isArray(d)){const e=u,n=+d;if(t===ot)[c,u]=Pt(c,u,n);d=Ut(c,u,n);if(d[0]<=c)s=Bt(c,u,n);if(d[d.length-1]>=u){if(e>=u&&t===ot){const e=Bt(c,u,n);if(isFinite(e)){if(e>0){u=(Math.floor(u/e)+1)*e}else if(e<0){u=(Math.ceil(u*-e)+1)/-e}}}else{d.pop()}}}var h=d.length,y=0,b=h;while(d[y]<=c)++y;while(d[b-1]>u)--b;if(y||b<h)d=d.slice(y,b),h=b-y;var p=new Array(h+1),g;for(o=0;o<=h;++o){g=p[o]=[];g.x0=o>0?d[o-1]:c;g.x1=o<h?d[o]:u}if(isFinite(s)){if(s>0){for(o=0;o<i;++o){if((a=f[o])!=null&&c<=a&&a<=u){p[Math.min(h,Math.floor((a-c)/s))].push(r[o])}}}else if(s<0){for(o=0;o<i;++o){if((a=f[o])!=null&&c<=a&&a<=u){const e=Math.floor((c-a)*s);p[Math.min(h,e+(d[e]<=a))].push(r[o])}}}}else{for(o=0;o<i;++o){if((a=f[o])!=null&&c<=a&&a<=u){p[Oe(d,a,0,h)].push(r[o])}}}return p}r.value=function(t){return arguments.length?(e=typeof t==="function"?t:Ft(t),r):e};r.domain=function(e){return arguments.length?(t=typeof e==="function"?e:Ft([e[0],e[1]]),r):t};r.thresholds=function(e){return arguments.length?(n=typeof e==="function"?e:Ft(Array.isArray(e)?Et.call(e):e),r):n};return r}function Ht(e,t){let n;if(t===undefined){for(const t of e){if(t!=null&&(n<t||n===undefined&&t>=t)){n=t}}}else{let r=-1;for(let o of e){if((o=t(o,++r,e))!=null&&(n<o||n===undefined&&o>=o)){n=o}}}return n}function Kt(e,t){let n;let r=-1;let o=-1;if(t===undefined){for(const t of e){++o;if(t!=null&&(n<t||n===undefined&&t>=t)){n=t,r=o}}}else{for(let i of e){if((i=t(i,++o,e))!=null&&(n<i||n===undefined&&i>=i)){n=i,r=o}}}return r}function Wt(e,t){let n;if(t===undefined){for(const t of e){if(t!=null&&(n>t||n===undefined&&t>=t)){n=t}}}else{let r=-1;for(let o of e){if((o=t(o,++r,e))!=null&&(n>o||n===undefined&&o>=o)){n=o}}}return n}function Yt(e,t){let n;let r=-1;let o=-1;if(t===undefined){for(const t of e){++o;if(t!=null&&(n>t||n===undefined&&t>=t)){n=t,r=o}}}else{for(let i of e){if((i=t(i,++o,e))!=null&&(n>i||n===undefined&&i>=i)){n=i,r=o}}}return r}function Zt(e,t,n=0,r=Infinity,o){t=Math.floor(t);n=Math.floor(Math.max(0,n));r=Math.floor(Math.min(e.length-1,r));if(!(n<=t&&t<=r))return e;o=o===undefined?St:jt(o);while(r>n){if(r-n>600){const i=r-n+1;const a=t-n+1;const s=Math.log(i);const f=.5*Math.exp(2*s/3);const l=.5*Math.sqrt(s*f*(i-f)/i)*(a-i/2<0?-1:1);const c=Math.max(n,Math.floor(t-a*f/i+l));const u=Math.min(r,Math.floor(t+(i-a)*f/i+l));Zt(e,t,c,u,o)}const i=e[t];let a=n;let s=r;Gt(e,n,t);if(o(e[r],i)>0)Gt(e,n,r);while(a<s){Gt(e,a,s),++a,--s;while(o(e[a],i)<0)++a;while(o(e[s],i)>0)--s}if(o(e[n],i)===0)Gt(e,n,s);else++s,Gt(e,s,r);if(s<=t)n=s+1;if(t<=s)r=s-1}return e}function Gt(e,t,n){const r=e[t];e[t]=e[n];e[n]=r}function Jt(e,t=Te){let n;let r=false;if(t.length===1){let o;for(const i of e){const e=t(i);if(r?Te(e,o)>0:Te(e,e)===0){n=i;o=e;r=true}}}else{for(const o of e){if(r?t(o,n)>0:t(o,o)===0){n=o;r=true}}}return n}function Qt(e,t,n){e=Float64Array.from(Re(e,n));if(!(r=e.length)||isNaN(t=+t))return;if(t<=0||r<2)return Wt(e);if(t>=1)return Ht(e);var r,o=(r-1)*t,i=Math.floor(o),a=Ht(Zt(e,i).subarray(0,i+1)),s=Wt(e.subarray(i+1));return a+(s-a)*(o-i)}function Vt(e,t,n=Fe){if(!(r=e.length)||isNaN(t=+t))return;if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,i=Math.floor(o),a=+n(e[i],i,e),s=+n(e[i+1],i+1,e);return a+(s-a)*(o-i)}function en(e,t,n=Fe){if(isNaN(t=+t))return;r=Float64Array.from(e,((t,r)=>Fe(n(e[r],r,e))));if(t<=0)return Yt(r);if(t>=1)return Kt(r);var r,o=Uint32Array.from(e,((e,t)=>t)),i=r.length-1,a=Math.floor(i*t);Zt(o,a,0,i,((e,t)=>St(r[e],r[t])));a=Jt(o.subarray(0,a+1),(e=>r[e]));return a>=0?a:-1}function tn(e,t,n){const r=Ze(e),o=Qt(e,.75)-Qt(e,.25);return r&&o?Math.ceil((n-t)/(2*o*Math.pow(r,-1/3))):1}function nn(e,t,n){const r=Ze(e),o=rt(e);return r&&o?Math.ceil((n-t)*Math.cbrt(r)/(3.49*o)):1}function rn(e,t){let n=0;let r=0;if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){++n,r+=t}}}else{let o=-1;for(let i of e){if((i=t(i,++o,e))!=null&&(i=+i)>=i){++n,r+=i}}}if(n)return r/n}function on(e,t){return Qt(e,.5,t)}function an(e,t){return en(e,.5,t)}function*sn(e){for(const t of e){yield*t}}function fn(e){return Array.from(sn(e))}function ln(e,t){const n=new ft;if(t===undefined){for(let t of e){if(t!=null&&t>=t){n.set(t,(n.get(t)||0)+1)}}}else{let r=-1;for(let o of e){if((o=t(o,++r,e))!=null&&o>=o){n.set(o,(n.get(o)||0)+1)}}}let r;let o=0;for(const[e,t]of n){if(t>o){o=t;r=e}}return r}function cn(e,t=un){const n=[];let r;let o=false;for(const i of e){if(o)n.push(t(r,i));r=i;o=true}return n}function un(e,t){return[e,t]}function dn(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);while(++r<o){i[r]=e+r*n}return i}function hn(e,t=Te){if(typeof e[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");let n=Array.from(e);const r=new Float64Array(n.length);if(t.length!==2)n=n.map(t),t=Te;const o=(e,r)=>t(n[e],n[r]);let i,a;e=Uint32Array.from(n,((e,t)=>t));e.sort(t===Te?(e,t)=>St(n[e],n[t]):jt(o));e.forEach(((e,t)=>{const n=o(e,i===undefined?e:i);if(n>=0){if(i===undefined||n>0)i=e,a=t;r[e]=a}else{r[e]=NaN}}));return r}function yn(e,t=Te){let n;let r=false;if(t.length===1){let o;for(const i of e){const e=t(i);if(r?Te(e,o)<0:Te(e,e)===0){n=i;o=e;r=true}}}else{for(const o of e){if(r?t(o,n)<0:t(o,o)===0){n=o;r=true}}}return n}function bn(e,t=Te){if(t.length===1)return Yt(e,t);let n;let r=-1;let o=-1;for(const i of e){++o;if(r<0?t(i,i)===0:t(i,n)<0){n=i;r=o}}return r}function pn(e,t=Te){if(t.length===1)return Kt(e,t);let n;let r=-1;let o=-1;for(const i of e){++o;if(r<0?t(i,i)===0:t(i,n)>0){n=i;r=o}}return r}function gn(e,t){const n=bn(e,t);return n<0?undefined:n}var wn=mn(Math.random);function mn(e){return function t(n,r=0,o=n.length){let i=o-(r=+r);while(i){const t=e()*i--|0,o=n[i+r];n[i+r]=n[t+r];n[t+r]=o}return n}}function vn(e,t){let n=0;if(t===undefined){for(let t of e){if(t=+t){n+=t}}}else{let r=-1;for(let o of e){if(o=+t(o,++r,e)){n+=o}}}return n}function Mn(e){if(!(i=e.length))return[];for(var t=-1,n=Wt(e,xn),r=new Array(n);++t<n;){for(var o=-1,i,a=r[t]=new Array(i);++o<i;){a[o]=e[o][t]}}return r}function xn(e){return e.length}function kn(){return Mn(arguments)}function Dn(e,t){if(typeof t!=="function")throw new TypeError("test is not a function");let n=-1;for(const r of e){if(!t(r,++n,e)){return false}}return true}function _n(e,t){if(typeof t!=="function")throw new TypeError("test is not a function");let n=-1;for(const r of e){if(t(r,++n,e)){return true}}return false}function An(e,t){if(typeof t!=="function")throw new TypeError("test is not a function");const n=[];let r=-1;for(const o of e){if(t(o,++r,e)){n.push(o)}}return n}function Cn(e,t){if(typeof e[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");if(typeof t!=="function")throw new TypeError("mapper is not a function");return Array.from(e,((n,r)=>t(n,r,e)))}function jn(e,t,n){if(typeof t!=="function")throw new TypeError("reducer is not a function");const r=e[Symbol.iterator]();let o,i,a=-1;if(arguments.length<3){({done:o,value:n}=r.next());if(o)return;++a}while(({done:o,value:i}=r.next()),!o){n=t(n,i,++a,e)}return n}function Sn(e){if(typeof e[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function Tn(e,...t){e=new lt(e);for(const n of t){for(const t of n){e.delete(t)}}return e}function Nn(e,t){const n=t[Symbol.iterator](),r=new lt;for(const t of e){if(r.has(t))return false;let e,o;while(({value:e,done:o}=n.next())){if(o)break;if(Object.is(t,e))return false;r.add(e)}}return true}function En(e,...t){e=new lt(e);t=t.map(zn);e:for(const n of e){for(const r of t){if(!r.has(n)){e.delete(n);continue e}}}return e}function zn(e){return e instanceof lt?e:new lt(e)}function Fn(e,t){const n=e[Symbol.iterator](),r=new Set;for(const e of t){const t=Rn(e);if(r.has(t))continue;let o,i;while(({value:o,done:i}=n.next())){if(i)return false;const e=Rn(o);r.add(e);if(Object.is(t,e))break}}return true}function Rn(e){return e!==null&&typeof e==="object"?e.valueOf():e}function Ln(e,t){return Fn(t,e)}function On(...e){const t=new lt;for(const n of e){for(const e of n){t.add(e)}}return t}function $n(e,t,n,r,o,i){const a=[[T,1,k],[T,5,5*k],[T,15,15*k],[T,30,30*k],[i,1,D],[i,5,5*D],[i,15,15*D],[i,30,30*D],[o,1,_],[o,3,3*_],[o,6,6*_],[o,12,12*_],[r,1,A],[r,2,2*A],[n,1,C],[t,1,j],[t,3,3*j],[e,1,S]];function s(e,t,n){const r=t<e;if(r)[e,t]=[t,e];const o=n&&typeof n.range==="function"?n:f(e,t,n);const i=o?o.range(e,+t+1):[];return r?i.reverse():i}function f(t,n,r){const o=Math.abs(n-t)/r;const i=Ee((([,,e])=>e)).right(a,o);if(i===a.length)return e.every(It(t/S,n/S,r));if(i===0)return M.every(Math.max(It(t,n,r),1));const[s,f]=a[o/a[i-1][2]<a[i][2]/o?i-1:i];return s.every(f)}return[s,f]}const[Un,Bn]=$n(je,De,fe,q,$,F);const[In,Pn]=$n(Ae,xe,W,B,L,E);const Xn=':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);color:var(--nylas-base-800)}.title h1{max-width:376px;margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}@media screen and (max-width: 768px){.dates .date{width:-webkit-fill-available;width:-moz-available;width:fill-available}}@media screen and (max-width: 412px){.dates .date{height:38px;min-width:none}}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}';var qn=undefined&&undefined.__decorate||function(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)if(a=e[s])i=(o<3?a(i):o>3?a(t,n,i):a(t,n))||i;return o>3&&i&&Object.defineProperty(t,n,i),i};var Hn=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};a.extend(s);a.extend(f);const Kn=class{constructor(n){e(this,n);this.dateSelected=t(this,"dateSelected",7);this.monthChanged=t(this,"monthChanged",7);this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone;this.month=this.selectedDate||new Date;this.dates=this.getDates();this.disableNextMonthButton=false;this.selectableDatesTimezone=[]}configSettingsChanged(e){const t=new Date(this.month.getFullYear(),this.month.getMonth()+1,1);const n=e?.scheduler?.available_days_in_future;if(n===undefined){return}const r=l(new Date,n);if(r.getTime()<t.getTime()){this.disableNextMonthButton=true}else{this.disableNextMonthButton=false}}selectedLanguageChanged(e){c.changeLanguage(e)}themeConfigChanged(e){this.applyThemeConfig(e)}selectedDateChanged(e){if(!e||!u(e,this.month)){this.month=e||new Date}this.dates=this.getDates()}convertDatesToTimezone(e,t){if(!e||e.length===0){return[]}return e.map((e=>{const n=a(e).tz(t);return new Date(n.year(),n.month(),n.date())}))}selectedTimezoneChanged(e){this.selectableDatesTimezone=this.convertDatesToTimezone(this.selectableDates,e)}selectableDatesChanged(e){this.selectableDatesTimezone=this.convertDatesToTimezone(e,this.selectedTimezone)}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}componentDidLoad(){d(`[nylas-date-picker] Component did load`);this.applyThemeConfig(this.themeConfig);this.month=this.selectedDate||new Date;this.dates=this.getDates();this.selectableDatesTimezone=this.convertDatesToTimezone(this.selectableDates,this.selectedTimezone)}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}getDates(){const e=h(this.month);const t=y(this.month);return B.range(B.offset(t,-t.getDay()),B.offset(e,7-e.getDay()))}selectDate(e){this.dateSelected.emit(e)}changeMonth(e){this.month=new Date(this.month.getFullYear(),this.month.getMonth()+e,1);const t=new Date(this.month.getFullYear(),this.month.getMonth()+1,1);const n=this.configSettings?.scheduler?.available_days_in_future;const r=l(new Date,n);if(r.getTime()<t.getTime()){this.disableNextMonthButton=true}else{this.disableNextMonthButton=false}this.dates=this.getDates();this.monthChanged.emit(this.month)}isSelected(e,t,n){return e&&t&&b(e,t)&&n&&n?.length>0}isDisabled(e){if(!e||!this.selectableDatesTimezone||this.selectableDatesTimezone.length===0){return true}return!this.selectableDatesTimezone.some((t=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()))}render(){return n(r,{key:"6bc5744daa73c89526583fdf6d1134b54f598062",part:"ndp"},n("div",{key:"72fb486640a3f7a101f0f8f2cca9812d30a3c7d6",class:"nylas-date-picker"},n("div",{key:"46b2b4d70109b44409ff47971a0e727accee3a62",class:"title",part:"ndp__title"},this.configSettings?.name?n("h1",null,this.configSettings?.name):this.configSettings?.organizer?.name&&n("h1",null,n("person-icon",null),this.configSettings?.organizer?.name||"Organizer"),n("p",{key:"e24aea79246e0e690596f9f2b530e9d4ed7babca"},n("clock-icon",{key:"0da52a004965badc9ae8cd78a4ef474bb5ea925b"}),this.eventDuration?p(this.eventDuration):`- ${c.t("time.minutes")}`)),n("div",{key:"281342b177b8f8f7b16a206904a7639bed46a224",class:"header flex-row"},n("h2",{key:"30df8d0a31b3145ebdce3ccf6a7937cc7495253a",part:"ndp__month-header"},n("strong",{key:"d8031d30573fbfae4e7ad88473ed7824eaec61e1"},g(this.month.toLocaleDateString("en-US",{month:"long"}).toLowerCase()))," ",this.month.toLocaleDateString(undefined,{year:"numeric"})),n("div",{key:"ab697dcdd6966308c34594db03f2ea243800cc17",class:"pagination"},n("button",{key:"59d3379c67530c6976eb24ee7c48bde72a6e696f",title:"Previous month",onClick:()=>this.changeMonth(-1),class:{"chevron-left":true,button:true},disabled:this.month<=new Date,part:"ndp__month-button"},n("chevron-icon",{key:"9a1aa55fcc903a21a6f6bed5773b334c4a9e555d"})),n("button",{key:"8b6eb2c927b2b9b2219cd02123dfeee8d281e5f6",title:"Next month",onClick:()=>this.changeMonth(1),class:{"chevron-right":true,button:true},disabled:this.disableNextMonthButton,part:"ndp__month-button"},n("chevron-icon",{key:"fbfde219be4418ff3724fb4abbf2c9a52793ad46"})))),n("div",{key:"36047845060b1c4489e3ec6b68dfd9fecee2043c",class:"dates"},[c.t("days.sunday"),c.t("days.monday"),c.t("days.tuesday"),c.t("days.wednesday"),c.t("days.thursday"),c.t("days.friday"),c.t("days.saturday")].map((e=>n("div",{class:"day",part:"ndp__day"},e))),this.dates.map(((e,t)=>{const r=this.isDisabled(e);if(this.isLoading){return n("button",{disabled:true,class:{"date day-skeleton":true,"current-month":u(e,this.month)},style:{animationDelay:`${t*20}ms`},part:`ndp__date ndp__date--disabled`},e.getDate())}return n("button",{class:{date:true,selected:!!(this.selectedDate&&b(e,this.selectedDate)&&this.selectableDates&&this.selectableDates?.length>0),"current-day":b(e,new Date),"current-month":u(e,this.month)},"aria-label":e.toLocaleDateString(undefined,{dateStyle:"full"}),disabled:r,onClick:()=>this.selectDate(e),part:`ndp__date ${this.isSelected(e,this.selectedDate,this.selectableDates)?"ndp__date--selected":""} ${b(e,new Date)?"ndp__date--current-day":""} ${u(e,this.month)?"ndp__date--current-month":""}`},e.getDate())})))))}get host(){return o(this)}static get watchers(){return{configSettings:["configSettingsChanged"],selectedLanguage:["selectedLanguageChanged"],themeConfig:["themeConfigChanged"],selectedDate:["selectedDateChanged"],selectedTimezone:["selectedTimezoneChanged"],selectableDates:["selectableDatesChanged"]}}};qn([i({name:"nylas-date-picker",stateToProps:new Map([["scheduler.selectableDates","selectableDates"],["scheduler.selectedDate","selectedDate"],["scheduler.isLoading","isLoading"],["scheduler.configSettings","configSettings"],["scheduler.eventDuration","eventDuration"],["scheduler.selectedLanguage","selectedLanguage"],["scheduler.themeConfig","themeConfig"],["scheduler.selectedTimezone","selectedTimezone"]]),eventToProps:{dateSelected:async(e,t)=>{d("nylas-date-picker","dateSelected",e.detail);t.scheduler.selectDate(e.detail)},monthChanged:async(e,t)=>{d("nylas-date-picker","monthChanged",e.detail)}},fireRegisterEvent:true}),Hn("design:type",Function),Hn("design:paramtypes",[]),Hn("design:returntype",void 0)],Kn.prototype,"render",null);Kn.style=Xn;export{Kn as nylas_date_picker};
1
+ import{r as e,a as t,h as n,d as r,e as o}from"./index-Cbn5rIwb.js";import{R as i}from"./register-component-Blj8K64f.js";import{d as a,u as s,t as f,e as l,i as c,o as u,b as d,p as h,q as y,r as b,v as p,w}from"./utils-DhmCcrVs.js";const g=new Date,m=new Date;function v(e,t,n,r){function o(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}o.floor=t=>(e(t=new Date(+t)),t);o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n);o.round=e=>{const t=o(e),n=o.ceil(e);return e-t<n-e?t:n};o.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e);o.range=(n,r,i)=>{const a=[];n=o.ceil(n);i=i==null?1:Math.floor(i);if(!(n<r)||!(i>0))return a;let s;do{a.push(s=new Date(+n)),t(n,i),e(n)}while(s<n&&n<r);return a};o.filter=n=>v((t=>{if(t>=t)while(e(t),!n(t))t.setTime(t-1)}),((e,r)=>{if(e>=e){if(r<0)while(++r<=0){while(t(e,-1),!n(e)){}}else while(--r>=0){while(t(e,+1),!n(e)){}}}}));if(n){o.count=(t,r)=>{g.setTime(+t),m.setTime(+r);e(g),e(m);return Math.floor(n(g,m))};o.every=e=>{e=Math.floor(e);return!isFinite(e)||!(e>0)?null:!(e>1)?o:o.filter(r?t=>r(t)%e===0:t=>o.count(0,t)%e===0)}}return o}const M=v((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));M.every=e=>{e=Math.floor(e);if(!isFinite(e)||!(e>0))return null;if(!(e>1))return M;return v((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e))};const x=M.range;const k=1e3;const D=k*60;const _=D*60;const A=_*24;const C=A*7;const j=A*30;const S=A*365;const T=v((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*k)}),((e,t)=>(t-e)/k),(e=>e.getUTCSeconds()));const N=T.range;const E=v((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*k)}),((e,t)=>{e.setTime(+e+t*D)}),((e,t)=>(t-e)/D),(e=>e.getMinutes()));const z=E.range;const F=v((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*D)}),((e,t)=>(t-e)/D),(e=>e.getUTCMinutes()));const R=F.range;const L=v((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*k-e.getMinutes()*D)}),((e,t)=>{e.setTime(+e+t*_)}),((e,t)=>(t-e)/_),(e=>e.getHours()));const O=L.range;const $=v((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*_)}),((e,t)=>(t-e)/_),(e=>e.getUTCHours()));const I=$.range;const U=v((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*D)/A),(e=>e.getDate()-1));const P=U.range;const q=v((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/A),(e=>e.getUTCDate()-1));const B=q.range;const K=v((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/A),(e=>Math.floor(e/A)));const V=K.range;function W(e){return v((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7);t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+t*7)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*D)/C))}const X=W(0);const G=W(1);const H=W(2);const J=W(3);const Q=W(4);const Y=W(5);const Z=W(6);const ee=X.range;const te=G.range;const ne=H.range;const re=J.range;const oe=Q.range;const ie=Y.range;const ae=Z.range;function se(e){return v((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7);t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)}),((e,t)=>(t-e)/C))}const fe=se(0);const le=se(1);const ce=se(2);const ue=se(3);const de=se(4);const he=se(5);const ye=se(6);const be=fe.range;const pe=le.range;const we=ce.range;const ge=ue.range;const me=de.range;const ve=he.range;const Me=ye.range;const xe=v((e=>{e.setDate(1);e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12),(e=>e.getMonth()));const ke=xe.range;const De=v((e=>{e.setUTCDate(1);e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12),(e=>e.getUTCMonth()));const _e=De.range;const Ae=v((e=>{e.setMonth(0,1);e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));Ae.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:v((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e);t.setMonth(0,1);t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)}));const Ce=Ae.range;const je=v((e=>{e.setUTCMonth(0,1);e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));je.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:v((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e);t.setUTCMonth(0,1);t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}));const Se=je.range;function Te(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ne(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ee(e){let t,n,r;if(e.length!==2){t=Te;n=(t,n)=>Te(e(t),n);r=(t,n)=>e(t)-n}else{t=e===Te||e===Ne?e:ze;n=e;r=e}function o(e,r,o=0,i=e.length){if(o<i){if(t(r,r)!==0)return i;do{const t=o+i>>>1;if(n(e[t],r)<0)o=t+1;else i=t}while(o<i)}return o}function i(e,r,o=0,i=e.length){if(o<i){if(t(r,r)!==0)return i;do{const t=o+i>>>1;if(n(e[t],r)<=0)o=t+1;else i=t}while(o<i)}return o}function a(e,t,n=0,i=e.length){const a=o(e,t,n,i-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a}return{left:o,center:a,right:i}}function ze(){return 0}function Fe(e){return e===null?NaN:+e}function*Re(e,t){if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){yield t}}}else{let n=-1;for(let r of e){if((r=t(r,++n,e))!=null&&(r=+r)>=r){yield r}}}}const Le=Ee(Te);const Oe=Le.right;const $e=Le.left;const Ie=Ee(Fe).center;function Ue(e,t){if(!((t=+t)>=0))throw new RangeError("invalid r");let n=e.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!t)return e;const r=Xe(t);const o=e.slice();r(e,o,0,n,1);r(o,e,0,n,1);r(e,o,0,n,1);return e}const Pe=Be(Xe);const qe=Be(We);function Be(e){return function(t,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:o,width:i,height:a}=t;if(!((i=Math.floor(i))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==undefined?a:o.length/i))>=0))throw new RangeError("invalid height");if(!i||!a||!n&&!r)return t;const s=n&&e(n);const f=r&&e(r);const l=o.slice();if(s&&f){Ke(s,l,o,i,a);Ke(s,o,l,i,a);Ke(s,l,o,i,a);Ve(f,o,l,i,a);Ve(f,l,o,i,a);Ve(f,o,l,i,a)}else if(s){Ke(s,o,l,i,a);Ke(s,l,o,i,a);Ke(s,o,l,i,a)}else if(f){Ve(f,o,l,i,a);Ve(f,l,o,i,a);Ve(f,o,l,i,a)}return t}}function Ke(e,t,n,r,o){for(let i=0,a=r*o;i<a;){e(t,n,i,i+=r,1)}}function Ve(e,t,n,r,o){for(let i=0,a=r*o;i<r;++i){e(t,n,i,i+a,r)}}function We(e){const t=Xe(e);return(e,n,r,o,i)=>{r<<=2,o<<=2,i<<=2;t(e,n,r+0,o+0,i);t(e,n,r+1,o+1,i);t(e,n,r+2,o+2,i);t(e,n,r+3,o+3,i)}}function Xe(e){const t=Math.floor(e);if(t===e)return Ge(e);const n=e-t;const r=2*e+1;return(e,o,i,a,s)=>{if(!((a-=s)>=i))return;let f=t*o[i];const l=s*t;const c=l+s;for(let e=i,t=i+l;e<t;e+=s){f+=o[Math.min(a,e)]}for(let t=i,u=a;t<=u;t+=s){f+=o[Math.min(a,t+l)];e[t]=(f+n*(o[Math.max(i,t-c)]+o[Math.min(a,t+c)]))/r;f-=o[Math.max(i,t-l)]}}}function Ge(e){const t=2*e+1;return(n,r,o,i,a)=>{if(!((i-=a)>=o))return;let s=e*r[o];const f=a*e;for(let e=o,t=o+f;e<t;e+=a){s+=r[Math.min(i,e)]}for(let e=o,l=i;e<=l;e+=a){s+=r[Math.min(i,e+f)];n[e]=s/t;s-=r[Math.max(o,e-f)]}}}function He(e,t){let n=0;if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){++n}}}else{let r=-1;for(let o of e){if((o=t(o,++r,e))!=null&&(o=+o)>=o){++n}}}return n}function Je(e){return e.length|0}function Qe(e){return!(e>0)}function Ye(e){return typeof e!=="object"||"length"in e?e:Array.from(e)}function Ze(e){return t=>e(...t)}function et(...e){const t=typeof e[e.length-1]==="function"&&Ze(e.pop());e=e.map(Ye);const n=e.map(Je);const r=e.length-1;const o=new Array(r+1).fill(0);const i=[];if(r<0||n.some(Qe))return i;while(true){i.push(o.map(((t,n)=>e[n][t])));let a=r;while(++o[a]===n[a]){if(a===0)return t?i.map(t):i;o[a--]=0}}}function tt(e,t){var n=0,r=0;return Float64Array.from(e,t===undefined?e=>n+=+e||0:o=>n+=+t(o,r++,e)||0)}function nt(e,t){let n=0;let r;let o=0;let i=0;if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){r=t-o;o+=r/++n;i+=r*(t-o)}}}else{let a=-1;for(let s of e){if((s=t(s,++a,e))!=null&&(s=+s)>=s){r=s-o;o+=r/++n;i+=r*(s-o)}}}if(n>1)return i/(n-1)}function rt(e,t){const n=nt(e,t);return n?Math.sqrt(n):n}function ot(e,t){let n;let r;if(t===undefined){for(const t of e){if(t!=null){if(n===undefined){if(t>=t)n=r=t}else{if(n>t)n=t;if(r<t)r=t}}}}else{let o=-1;for(let i of e){if((i=t(i,++o,e))!=null){if(n===undefined){if(i>=i)n=r=i}else{if(n>i)n=i;if(r<i)r=i}}}}return[n,r]}class it{constructor(){this._partials=new Float64Array(32);this._n=0}add(e){const t=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const o=t[r],i=e+o,a=Math.abs(e)<Math.abs(o)?e-(i-o):o-(i-e);if(a)t[n++]=a;e=i}t[n]=e;this._n=n+1;return this}valueOf(){const e=this._partials;let t=this._n,n,r,o,i=0;if(t>0){i=e[--t];while(t>0){n=i;r=e[--t];i=n+r;o=r-(i-n);if(o)break}if(t>0&&(o<0&&e[t-1]<0||o>0&&e[t-1]>0)){r=o*2;n=i+r;if(r==n-i)i=n}}return i}}function at(e,t){const n=new it;if(t===undefined){for(let t of e){if(t=+t){n.add(t)}}}else{let r=-1;for(let o of e){if(o=+t(o,++r,e)){n.add(o)}}}return+n}function st(e,t){const n=new it;let r=-1;return Float64Array.from(e,t===undefined?e=>n.add(+e||0):o=>n.add(+t(o,++r,e)||0))}class ft extends Map{constructor(e,t=ht){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}});if(e!=null)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(ct(this,e))}has(e){return super.has(ct(this,e))}set(e,t){return super.set(ut(this,e),t)}delete(e){return super.delete(dt(this,e))}}class lt extends Set{constructor(e,t=ht){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}});if(e!=null)for(const t of e)this.add(t)}has(e){return super.has(ct(this,e))}add(e){return super.add(ut(this,e))}delete(e){return super.delete(dt(this,e))}}function ct({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function ut({_intern:e,_key:t},n){const r=t(n);if(e.has(r))return e.get(r);e.set(r,n);return n}function dt({_intern:e,_key:t},n){const r=t(n);if(e.has(r)){n=e.get(r);e.delete(r)}return n}function ht(e){return e!==null&&typeof e==="object"?e.valueOf():e}function yt(e){return e}function bt(e,...t){return _t(e,yt,yt,t)}function pt(e,...t){return _t(e,Array.from,yt,t)}function wt(e,t){for(let n=1,r=t.length;n<r;++n){e=e.flatMap((e=>e.pop().map((([t,n])=>[...e,t,n]))))}return e}function gt(e,...t){return wt(pt(e,...t),t)}function mt(e,t,...n){return wt(Mt(e,t,...n),n)}function vt(e,t,...n){return _t(e,yt,t,n)}function Mt(e,t,...n){return _t(e,Array.from,t,n)}function xt(e,...t){return _t(e,yt,Dt,t)}function kt(e,...t){return _t(e,Array.from,Dt,t)}function Dt(e){if(e.length!==1)throw new Error("duplicate key");return e[0]}function _t(e,t,n,r){return function e(o,i){if(i>=r.length)return n(o);const a=new ft;const s=r[i++];let f=-1;for(const e of o){const t=s(e,++f,o);const n=a.get(t);if(n)n.push(e);else a.set(t,[e])}for(const[t,n]of a){a.set(t,e(n,i))}return t(a)}(e,0)}function At(e,t){return Array.from(t,(t=>e[t]))}function Ct(e,...t){if(typeof e[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){const r=Uint32Array.from(e,((e,t)=>t));if(t.length>1){t=t.map((t=>e.map(t)));r.sort(((e,n)=>{for(const r of t){const t=St(r[e],r[n]);if(t)return t}}))}else{n=e.map(n);r.sort(((e,t)=>St(n[e],n[t])))}return At(e,r)}return e.sort(jt(n))}function jt(e=Te){if(e===Te)return St;if(typeof e!=="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);if(r||r===0)return r;return(e(n,n)===0)-(e(t,t)===0)}}function St(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function Tt(e,t,n){return(t.length!==2?Ct(vt(e,t,n),(([e,t],[n,r])=>Te(t,r)||Te(e,n))):Ct(bt(e,n),(([e,n],[r,o])=>t(n,o)||Te(e,r)))).map((([e])=>e))}var Nt=Array.prototype;var Et=Nt.slice;var zt=Nt.map;function Ft(e){return()=>e}const Rt=Math.sqrt(50),Lt=Math.sqrt(10),Ot=Math.sqrt(2);function $t(e,t,n){const r=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),a=i>=Rt?10:i>=Lt?5:i>=Ot?2:1;let s,f,l;if(o<0){l=Math.pow(10,-o)/a;s=Math.round(e*l);f=Math.round(t*l);if(s/l<e)++s;if(f/l>t)--f;l=-l}else{l=Math.pow(10,o)*a;s=Math.round(e/l);f=Math.round(t/l);if(s*l<e)++s;if(f*l>t)--f}if(f<s&&.5<=n&&n<2)return $t(e,t,n*2);return[s,f,l]}function It(e,t,n){t=+t,e=+e,n=+n;if(!(n>0))return[];if(e===t)return[e];const r=t<e,[o,i,a]=r?$t(t,e,n):$t(e,t,n);if(!(i>=o))return[];const s=i-o+1,f=new Array(s);if(r){if(a<0)for(let e=0;e<s;++e)f[e]=(i-e)/-a;else for(let e=0;e<s;++e)f[e]=(i-e)*a}else{if(a<0)for(let e=0;e<s;++e)f[e]=(o+e)/-a;else for(let e=0;e<s;++e)f[e]=(o+e)*a}return f}function Ut(e,t,n){t=+t,e=+e,n=+n;return $t(e,t,n)[2]}function Pt(e,t,n){t=+t,e=+e,n=+n;const r=t<e,o=r?Ut(t,e,n):Ut(e,t,n);return(r?-1:1)*(o<0?1/-o:o)}function qt(e,t,n){let r;while(true){const o=Ut(e,t,n);if(o===r||o===0||!isFinite(o)){return[e,t]}else if(o>0){e=Math.floor(e/o)*o;t=Math.ceil(t/o)*o}else if(o<0){e=Math.ceil(e*o)/o;t=Math.floor(t*o)/o}r=o}}function Bt(e){return Math.max(1,Math.ceil(Math.log(He(e))/Math.LN2)+1)}function Kt(){var e=yt,t=ot,n=Bt;function r(r){if(!Array.isArray(r))r=Array.from(r);var o,i=r.length,a,s,f=new Array(i);for(o=0;o<i;++o){f[o]=e(r[o],o,r)}var l=t(f),c=l[0],u=l[1],d=n(f,c,u);if(!Array.isArray(d)){const e=u,n=+d;if(t===ot)[c,u]=qt(c,u,n);d=It(c,u,n);if(d[0]<=c)s=Ut(c,u,n);if(d[d.length-1]>=u){if(e>=u&&t===ot){const e=Ut(c,u,n);if(isFinite(e)){if(e>0){u=(Math.floor(u/e)+1)*e}else if(e<0){u=(Math.ceil(u*-e)+1)/-e}}}else{d.pop()}}}var h=d.length,y=0,b=h;while(d[y]<=c)++y;while(d[b-1]>u)--b;if(y||b<h)d=d.slice(y,b),h=b-y;var p=new Array(h+1),w;for(o=0;o<=h;++o){w=p[o]=[];w.x0=o>0?d[o-1]:c;w.x1=o<h?d[o]:u}if(isFinite(s)){if(s>0){for(o=0;o<i;++o){if((a=f[o])!=null&&c<=a&&a<=u){p[Math.min(h,Math.floor((a-c)/s))].push(r[o])}}}else if(s<0){for(o=0;o<i;++o){if((a=f[o])!=null&&c<=a&&a<=u){const e=Math.floor((c-a)*s);p[Math.min(h,e+(d[e]<=a))].push(r[o])}}}}else{for(o=0;o<i;++o){if((a=f[o])!=null&&c<=a&&a<=u){p[Oe(d,a,0,h)].push(r[o])}}}return p}r.value=function(t){return arguments.length?(e=typeof t==="function"?t:Ft(t),r):e};r.domain=function(e){return arguments.length?(t=typeof e==="function"?e:Ft([e[0],e[1]]),r):t};r.thresholds=function(e){return arguments.length?(n=typeof e==="function"?e:Ft(Array.isArray(e)?Et.call(e):e),r):n};return r}function Vt(e,t){let n;if(t===undefined){for(const t of e){if(t!=null&&(n<t||n===undefined&&t>=t)){n=t}}}else{let r=-1;for(let o of e){if((o=t(o,++r,e))!=null&&(n<o||n===undefined&&o>=o)){n=o}}}return n}function Wt(e,t){let n;let r=-1;let o=-1;if(t===undefined){for(const t of e){++o;if(t!=null&&(n<t||n===undefined&&t>=t)){n=t,r=o}}}else{for(let i of e){if((i=t(i,++o,e))!=null&&(n<i||n===undefined&&i>=i)){n=i,r=o}}}return r}function Xt(e,t){let n;if(t===undefined){for(const t of e){if(t!=null&&(n>t||n===undefined&&t>=t)){n=t}}}else{let r=-1;for(let o of e){if((o=t(o,++r,e))!=null&&(n>o||n===undefined&&o>=o)){n=o}}}return n}function Gt(e,t){let n;let r=-1;let o=-1;if(t===undefined){for(const t of e){++o;if(t!=null&&(n>t||n===undefined&&t>=t)){n=t,r=o}}}else{for(let i of e){if((i=t(i,++o,e))!=null&&(n>i||n===undefined&&i>=i)){n=i,r=o}}}return r}function Ht(e,t,n=0,r=Infinity,o){t=Math.floor(t);n=Math.floor(Math.max(0,n));r=Math.floor(Math.min(e.length-1,r));if(!(n<=t&&t<=r))return e;o=o===undefined?St:jt(o);while(r>n){if(r-n>600){const i=r-n+1;const a=t-n+1;const s=Math.log(i);const f=.5*Math.exp(2*s/3);const l=.5*Math.sqrt(s*f*(i-f)/i)*(a-i/2<0?-1:1);const c=Math.max(n,Math.floor(t-a*f/i+l));const u=Math.min(r,Math.floor(t+(i-a)*f/i+l));Ht(e,t,c,u,o)}const i=e[t];let a=n;let s=r;Jt(e,n,t);if(o(e[r],i)>0)Jt(e,n,r);while(a<s){Jt(e,a,s),++a,--s;while(o(e[a],i)<0)++a;while(o(e[s],i)>0)--s}if(o(e[n],i)===0)Jt(e,n,s);else++s,Jt(e,s,r);if(s<=t)n=s+1;if(t<=s)r=s-1}return e}function Jt(e,t,n){const r=e[t];e[t]=e[n];e[n]=r}function Qt(e,t=Te){let n;let r=false;if(t.length===1){let o;for(const i of e){const e=t(i);if(r?Te(e,o)>0:Te(e,e)===0){n=i;o=e;r=true}}}else{for(const o of e){if(r?t(o,n)>0:t(o,o)===0){n=o;r=true}}}return n}function Yt(e,t,n){e=Float64Array.from(Re(e,n));if(!(r=e.length)||isNaN(t=+t))return;if(t<=0||r<2)return Xt(e);if(t>=1)return Vt(e);var r,o=(r-1)*t,i=Math.floor(o),a=Vt(Ht(e,i).subarray(0,i+1)),s=Xt(e.subarray(i+1));return a+(s-a)*(o-i)}function Zt(e,t,n=Fe){if(!(r=e.length)||isNaN(t=+t))return;if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,i=Math.floor(o),a=+n(e[i],i,e),s=+n(e[i+1],i+1,e);return a+(s-a)*(o-i)}function en(e,t,n=Fe){if(isNaN(t=+t))return;r=Float64Array.from(e,((t,r)=>Fe(n(e[r],r,e))));if(t<=0)return Gt(r);if(t>=1)return Wt(r);var r,o=Uint32Array.from(e,((e,t)=>t)),i=r.length-1,a=Math.floor(i*t);Ht(o,a,0,i,((e,t)=>St(r[e],r[t])));a=Qt(o.subarray(0,a+1),(e=>r[e]));return a>=0?a:-1}function tn(e,t,n){const r=He(e),o=Yt(e,.75)-Yt(e,.25);return r&&o?Math.ceil((n-t)/(2*o*Math.pow(r,-1/3))):1}function nn(e,t,n){const r=He(e),o=rt(e);return r&&o?Math.ceil((n-t)*Math.cbrt(r)/(3.49*o)):1}function rn(e,t){let n=0;let r=0;if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){++n,r+=t}}}else{let o=-1;for(let i of e){if((i=t(i,++o,e))!=null&&(i=+i)>=i){++n,r+=i}}}if(n)return r/n}function on(e,t){return Yt(e,.5,t)}function an(e,t){return en(e,.5,t)}function*sn(e){for(const t of e){yield*t}}function fn(e){return Array.from(sn(e))}function ln(e,t){const n=new ft;if(t===undefined){for(let t of e){if(t!=null&&t>=t){n.set(t,(n.get(t)||0)+1)}}}else{let r=-1;for(let o of e){if((o=t(o,++r,e))!=null&&o>=o){n.set(o,(n.get(o)||0)+1)}}}let r;let o=0;for(const[e,t]of n){if(t>o){o=t;r=e}}return r}function cn(e,t=un){const n=[];let r;let o=false;for(const i of e){if(o)n.push(t(r,i));r=i;o=true}return n}function un(e,t){return[e,t]}function dn(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);while(++r<o){i[r]=e+r*n}return i}function hn(e,t=Te){if(typeof e[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");let n=Array.from(e);const r=new Float64Array(n.length);if(t.length!==2)n=n.map(t),t=Te;const o=(e,r)=>t(n[e],n[r]);let i,a;e=Uint32Array.from(n,((e,t)=>t));e.sort(t===Te?(e,t)=>St(n[e],n[t]):jt(o));e.forEach(((e,t)=>{const n=o(e,i===undefined?e:i);if(n>=0){if(i===undefined||n>0)i=e,a=t;r[e]=a}else{r[e]=NaN}}));return r}function yn(e,t=Te){let n;let r=false;if(t.length===1){let o;for(const i of e){const e=t(i);if(r?Te(e,o)<0:Te(e,e)===0){n=i;o=e;r=true}}}else{for(const o of e){if(r?t(o,n)<0:t(o,o)===0){n=o;r=true}}}return n}function bn(e,t=Te){if(t.length===1)return Gt(e,t);let n;let r=-1;let o=-1;for(const i of e){++o;if(r<0?t(i,i)===0:t(i,n)<0){n=i;r=o}}return r}function pn(e,t=Te){if(t.length===1)return Wt(e,t);let n;let r=-1;let o=-1;for(const i of e){++o;if(r<0?t(i,i)===0:t(i,n)>0){n=i;r=o}}return r}function wn(e,t){const n=bn(e,t);return n<0?undefined:n}var gn=mn(Math.random);function mn(e){return function t(n,r=0,o=n.length){let i=o-(r=+r);while(i){const t=e()*i--|0,o=n[i+r];n[i+r]=n[t+r];n[t+r]=o}return n}}function vn(e,t){let n=0;if(t===undefined){for(let t of e){if(t=+t){n+=t}}}else{let r=-1;for(let o of e){if(o=+t(o,++r,e)){n+=o}}}return n}function Mn(e){if(!(i=e.length))return[];for(var t=-1,n=Xt(e,xn),r=new Array(n);++t<n;){for(var o=-1,i,a=r[t]=new Array(i);++o<i;){a[o]=e[o][t]}}return r}function xn(e){return e.length}function kn(){return Mn(arguments)}function Dn(e,t){if(typeof t!=="function")throw new TypeError("test is not a function");let n=-1;for(const r of e){if(!t(r,++n,e)){return false}}return true}function _n(e,t){if(typeof t!=="function")throw new TypeError("test is not a function");let n=-1;for(const r of e){if(t(r,++n,e)){return true}}return false}function An(e,t){if(typeof t!=="function")throw new TypeError("test is not a function");const n=[];let r=-1;for(const o of e){if(t(o,++r,e)){n.push(o)}}return n}function Cn(e,t){if(typeof e[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");if(typeof t!=="function")throw new TypeError("mapper is not a function");return Array.from(e,((n,r)=>t(n,r,e)))}function jn(e,t,n){if(typeof t!=="function")throw new TypeError("reducer is not a function");const r=e[Symbol.iterator]();let o,i,a=-1;if(arguments.length<3){({done:o,value:n}=r.next());if(o)return;++a}while(({done:o,value:i}=r.next()),!o){n=t(n,i,++a,e)}return n}function Sn(e){if(typeof e[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function Tn(e,...t){e=new lt(e);for(const n of t){for(const t of n){e.delete(t)}}return e}function Nn(e,t){const n=t[Symbol.iterator](),r=new lt;for(const t of e){if(r.has(t))return false;let e,o;while(({value:e,done:o}=n.next())){if(o)break;if(Object.is(t,e))return false;r.add(e)}}return true}function En(e,...t){e=new lt(e);t=t.map(zn);e:for(const n of e){for(const r of t){if(!r.has(n)){e.delete(n);continue e}}}return e}function zn(e){return e instanceof lt?e:new lt(e)}function Fn(e,t){const n=e[Symbol.iterator](),r=new Set;for(const e of t){const t=Rn(e);if(r.has(t))continue;let o,i;while(({value:o,done:i}=n.next())){if(i)return false;const e=Rn(o);r.add(e);if(Object.is(t,e))break}}return true}function Rn(e){return e!==null&&typeof e==="object"?e.valueOf():e}function Ln(e,t){return Fn(t,e)}function On(...e){const t=new lt;for(const n of e){for(const e of n){t.add(e)}}return t}function $n(e,t,n,r,o,i){const a=[[T,1,k],[T,5,5*k],[T,15,15*k],[T,30,30*k],[i,1,D],[i,5,5*D],[i,15,15*D],[i,30,30*D],[o,1,_],[o,3,3*_],[o,6,6*_],[o,12,12*_],[r,1,A],[r,2,2*A],[n,1,C],[t,1,j],[t,3,3*j],[e,1,S]];function s(e,t,n){const r=t<e;if(r)[e,t]=[t,e];const o=n&&typeof n.range==="function"?n:f(e,t,n);const i=o?o.range(e,+t+1):[];return r?i.reverse():i}function f(t,n,r){const o=Math.abs(n-t)/r;const i=Ee((([,,e])=>e)).right(a,o);if(i===a.length)return e.every(Pt(t/S,n/S,r));if(i===0)return M.every(Math.max(Pt(t,n,r),1));const[s,f]=a[o/a[i-1][2]<a[i][2]/o?i-1:i];return s.every(f)}return[s,f]}const[In,Un]=$n(je,De,fe,K,$,F);const[Pn,qn]=$n(Ae,xe,X,U,L,E);const Bn=':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);color:var(--nylas-base-800)}.title h1{max-width:376px;margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}@media screen and (max-width: 768px){.dates .date{width:-webkit-fill-available;width:-moz-available;width:fill-available}}@media screen and (max-width: 412px){.dates .date{height:38px;min-width:none}}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}';var Kn=undefined&&undefined.__decorate||function(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)if(a=e[s])i=(o<3?a(i):o>3?a(t,n,i):a(t,n))||i;return o>3&&i&&Object.defineProperty(t,n,i),i};var Vn=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};a.extend(s);a.extend(f);const Wn=class{constructor(n){e(this,n);this.dateSelected=t(this,"dateSelected",7);this.monthChanged=t(this,"monthChanged",7);this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone;this.month=this.selectedDate||new Date;this.dates=this.getDates();this.disableNextMonthButton=false;this.selectableDatesTimezone=[]}configSettingsChanged(e){const t=new Date(this.month.getFullYear(),this.month.getMonth()+1,1);const n=e?.scheduler?.available_days_in_future;if(n===undefined){return}const r=l(new Date,n);if(r.getTime()<t.getTime()){this.disableNextMonthButton=true}else{this.disableNextMonthButton=false}}selectedLanguageChanged(e){c.changeLanguage(e)}themeConfigChanged(e){this.applyThemeConfig(e)}selectedDateChanged(e){if(!e||!u(e,this.month)){this.month=e||new Date}this.dates=this.getDates()}convertDatesToTimezone(e,t){if(!e||e.length===0){return[]}return e.map((e=>{const n=a(e).tz(t);return new Date(n.year(),n.month(),n.date())}))}selectedTimezoneChanged(e){this.selectableDatesTimezone=this.convertDatesToTimezone(this.selectableDates,e)}selectableDatesChanged(e){this.selectableDatesTimezone=this.convertDatesToTimezone(e,this.selectedTimezone)}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}componentDidLoad(){d(`[nylas-date-picker] Component did load`);this.applyThemeConfig(this.themeConfig);this.month=this.selectedDate||new Date;this.dates=this.getDates();this.selectableDatesTimezone=this.convertDatesToTimezone(this.selectableDates,this.selectedTimezone)}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}getDates(){const e=h(this.month);const t=y(this.month);return U.range(U.offset(t,-t.getDay()),U.offset(e,7-e.getDay()))}selectDate(e){this.dateSelected.emit(e)}changeMonth(e){this.month=new Date(this.month.getFullYear(),this.month.getMonth()+e,1);const t=new Date(this.month.getFullYear(),this.month.getMonth()+1,1);const n=this.configSettings?.scheduler?.available_days_in_future;const r=l(new Date,n);if(r.getTime()<t.getTime()){this.disableNextMonthButton=true}else{this.disableNextMonthButton=false}this.dates=this.getDates();this.monthChanged.emit(this.month)}isSelected(e,t,n){return e&&t&&b(e,t)&&n&&n?.length>0}isDisabled(e){if(!e||!this.selectableDatesTimezone||this.selectableDatesTimezone.length===0){return true}return!this.selectableDatesTimezone.some((t=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()))}render(){return n(r,{key:"6bc5744daa73c89526583fdf6d1134b54f598062",part:"ndp"},n("div",{key:"72fb486640a3f7a101f0f8f2cca9812d30a3c7d6",class:"nylas-date-picker"},n("div",{key:"46b2b4d70109b44409ff47971a0e727accee3a62",class:"title",part:"ndp__title"},this.configSettings?.name?n("h1",null,this.configSettings?.name):this.configSettings?.organizer?.name&&n("h1",null,n("person-icon",null),this.configSettings?.organizer?.name||"Organizer"),n("p",{key:"e24aea79246e0e690596f9f2b530e9d4ed7babca"},n("clock-icon",{key:"0da52a004965badc9ae8cd78a4ef474bb5ea925b"}),this.eventDuration?p(this.eventDuration):`- ${c.t("time.minutes")}`)),n("div",{key:"281342b177b8f8f7b16a206904a7639bed46a224",class:"header flex-row"},n("h2",{key:"30df8d0a31b3145ebdce3ccf6a7937cc7495253a",part:"ndp__month-header"},n("strong",{key:"d8031d30573fbfae4e7ad88473ed7824eaec61e1"},w(this.month.toLocaleDateString("en-US",{month:"long"}).toLowerCase()))," ",this.month.toLocaleDateString(undefined,{year:"numeric"})),n("div",{key:"ab697dcdd6966308c34594db03f2ea243800cc17",class:"pagination"},n("button",{key:"59d3379c67530c6976eb24ee7c48bde72a6e696f",title:"Previous month",onClick:()=>this.changeMonth(-1),class:{"chevron-left":true,button:true},disabled:this.month<=new Date,part:"ndp__month-button"},n("chevron-icon",{key:"9a1aa55fcc903a21a6f6bed5773b334c4a9e555d"})),n("button",{key:"8b6eb2c927b2b9b2219cd02123dfeee8d281e5f6",title:"Next month",onClick:()=>this.changeMonth(1),class:{"chevron-right":true,button:true},disabled:this.disableNextMonthButton,part:"ndp__month-button"},n("chevron-icon",{key:"fbfde219be4418ff3724fb4abbf2c9a52793ad46"})))),n("div",{key:"36047845060b1c4489e3ec6b68dfd9fecee2043c",class:"dates"},[c.t("days.sunday"),c.t("days.monday"),c.t("days.tuesday"),c.t("days.wednesday"),c.t("days.thursday"),c.t("days.friday"),c.t("days.saturday")].map((e=>n("div",{class:"day",part:"ndp__day"},e))),this.dates.map(((e,t)=>{const r=this.isDisabled(e);if(this.isLoading){return n("button",{disabled:true,class:{"date day-skeleton":true,"current-month":u(e,this.month)},style:{animationDelay:`${t*20}ms`},part:`ndp__date ndp__date--disabled`},e.getDate())}return n("button",{class:{date:true,selected:!!(this.selectedDate&&b(e,this.selectedDate)&&this.selectableDates&&this.selectableDates?.length>0),"current-day":b(e,new Date),"current-month":u(e,this.month)},"aria-label":e.toLocaleDateString(undefined,{dateStyle:"full"}),disabled:r,onClick:()=>this.selectDate(e),part:`ndp__date ${this.isSelected(e,this.selectedDate,this.selectableDates)?"ndp__date--selected":""} ${b(e,new Date)?"ndp__date--current-day":""} ${u(e,this.month)?"ndp__date--current-month":""}`},e.getDate())})))))}get host(){return o(this)}static get watchers(){return{configSettings:["configSettingsChanged"],selectedLanguage:["selectedLanguageChanged"],themeConfig:["themeConfigChanged"],selectedDate:["selectedDateChanged"],selectedTimezone:["selectedTimezoneChanged"],selectableDates:["selectableDatesChanged"]}}};Kn([i({name:"nylas-date-picker",stateToProps:new Map([["scheduler.selectableDates","selectableDates"],["scheduler.selectedDate","selectedDate"],["scheduler.isLoading","isLoading"],["scheduler.configSettings","configSettings"],["scheduler.eventDuration","eventDuration"],["scheduler.selectedLanguage","selectedLanguage"],["scheduler.themeConfig","themeConfig"],["scheduler.selectedTimezone","selectedTimezone"]]),eventToProps:{dateSelected:async(e,t)=>{d("nylas-date-picker","dateSelected",e.detail);t.scheduler.selectDate(e.detail)},monthChanged:async(e,t)=>{d("nylas-date-picker","monthChanged",e.detail)}},fireRegisterEvent:true}),Vn("design:type",Function),Vn("design:paramtypes",[]),Vn("design:returntype",void 0)],Wn.prototype,"render",null);Wn.style=Bn;export{Wn as nylas_date_picker};
2
2
  //# sourceMappingURL=nylas-date-picker.entry.js.map