@nylas/web-elements 0.0.0-test-20250319204140 → 0.0.0-test-20250320184617

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 (172) hide show
  1. package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +26 -26
  2. package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +4813 -4805
  3. package/dist/cjs/button-component_2.cjs.entry.js +1 -1
  4. package/dist/cjs/button-component_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js +17 -18
  6. package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js.map +1 -1
  7. package/dist/cjs/chevron-icon_3.cjs.entry.js +1 -1
  8. package/dist/cjs/chevron-icon_3.cjs.entry.js.map +1 -1
  9. package/dist/cjs/google-logo-icon_6.cjs.entry.js +5 -5
  10. package/dist/cjs/google-logo-icon_6.cjs.entry.js.map +1 -1
  11. package/dist/cjs/input-dropdown_2.cjs.entry.js +2 -2
  12. package/dist/cjs/input-dropdown_2.cjs.entry.js.map +1 -1
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/multi-select-dropdown_2.cjs.entry.js +2 -2
  15. package/dist/cjs/multi-select-dropdown_2.cjs.entry.js.map +1 -1
  16. package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js +14 -10
  17. package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js.map +1 -1
  18. package/dist/cjs/nylas-key-points.cjs.entry.js +1 -1
  19. package/dist/cjs/nylas-key-points.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nylas-provider.cjs.entry.js +1 -1
  21. package/dist/cjs/nylas-provider.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nylas-scheduling.cjs.entry.js +1 -1
  23. package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  25. package/dist/cjs/{scheduler-store-c1fc5cf3.js → scheduler-store-df3a9a3a.js} +9 -1
  26. package/dist/cjs/scheduler-store-df3a9a3a.js.map +1 -0
  27. package/dist/collection/components/design-system/button-component/button-component.js +4 -3
  28. package/dist/collection/components/design-system/button-component/button-component.js.map +1 -1
  29. package/dist/collection/components/design-system/input-dropdown/input-dropdown.js +10 -7
  30. package/dist/collection/components/design-system/input-dropdown/input-dropdown.js.map +1 -1
  31. package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js +5 -4
  32. package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js.map +1 -1
  33. package/dist/collection/components/design-system/select-dropdown/select-dropdown.js +13 -9
  34. package/dist/collection/components/design-system/select-dropdown/select-dropdown.js.map +1 -1
  35. package/dist/collection/components/design-system/time-period-selector/time-period-selector.js +3 -3
  36. package/dist/collection/components/design-system/time-period-selector/time-period-selector.js.map +1 -1
  37. package/dist/collection/components/nylas-notebook/nylas-key-points/nylas-key-points.js +4 -3
  38. package/dist/collection/components/nylas-notebook/nylas-key-points/nylas-key-points.js.map +1 -1
  39. package/dist/collection/components/nylas-provider/nylas-provider.js +1 -1
  40. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +13 -11
  41. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -1
  42. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +3 -3
  43. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -1
  44. package/dist/collection/components/scheduler/nylas-booking-form/test/nylas-booking-form.spec.js +8 -6
  45. package/dist/collection/components/scheduler/nylas-booking-form/test/nylas-booking-form.spec.js.map +1 -1
  46. package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js +8 -10
  47. package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js.map +1 -1
  48. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +2 -2
  49. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
  50. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js +2 -2
  51. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js.map +1 -1
  52. package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js +36 -21
  53. package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js.map +1 -1
  54. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js +15 -16
  55. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js.map +1 -1
  56. package/dist/collection/connector/nylas-scheduler-connector/errors/index.js +1 -29
  57. package/dist/collection/connector/nylas-scheduler-connector/errors/index.js.map +1 -1
  58. package/dist/collection/connector/shared/api/auth.js.map +1 -1
  59. package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
  60. package/dist/collection/types/index.js +29 -0
  61. package/dist/collection/types/index.js.map +1 -1
  62. package/dist/components/button-component2.js +1 -1
  63. package/dist/components/button-component2.js.map +1 -1
  64. package/dist/components/input-dropdown2.js +1 -1
  65. package/dist/components/input-dropdown2.js.map +1 -1
  66. package/dist/components/multi-select-dropdown2.js +2 -2
  67. package/dist/components/multi-select-dropdown2.js.map +1 -1
  68. package/dist/components/nylas-booked-event-card2.js +9 -5
  69. package/dist/components/nylas-booked-event-card2.js.map +1 -1
  70. package/dist/components/nylas-booking-form2.js +3 -3
  71. package/dist/components/nylas-booking-form2.js.map +1 -1
  72. package/dist/components/nylas-buffer-time2.js +2 -2
  73. package/dist/components/nylas-buffer-time2.js.map +1 -1
  74. package/dist/components/nylas-editor-tabs-group2.js +5 -5
  75. package/dist/components/nylas-editor-tabs-group2.js.map +1 -1
  76. package/dist/components/nylas-event-duration2.js +15 -16
  77. package/dist/components/nylas-event-duration2.js.map +1 -1
  78. package/dist/components/nylas-key-points.js +1 -1
  79. package/dist/components/nylas-key-points.js.map +1 -1
  80. package/dist/components/nylas-organizer-confirmation-card2.js +4 -4
  81. package/dist/components/nylas-organizer-confirmation-card2.js.map +1 -1
  82. package/dist/components/nylas-provider.js.map +1 -1
  83. package/dist/components/nylas-scheduling.js.map +1 -1
  84. package/dist/components/scheduler-store.js +8 -0
  85. package/dist/components/scheduler-store.js.map +1 -1
  86. package/dist/components/select-dropdown2.js +1 -1
  87. package/dist/components/select-dropdown2.js.map +1 -1
  88. package/dist/components/time-period-selector2.js +1 -1
  89. package/dist/components/time-period-selector2.js.map +1 -1
  90. package/dist/esm/button-component_2.entry.js +1 -1
  91. package/dist/esm/button-component_2.entry.js.map +1 -1
  92. package/dist/esm/calendar-agenda-fill-icon_36.entry.js +17 -18
  93. package/dist/esm/calendar-agenda-fill-icon_36.entry.js.map +1 -1
  94. package/dist/esm/chevron-icon_3.entry.js +1 -1
  95. package/dist/esm/chevron-icon_3.entry.js.map +1 -1
  96. package/dist/esm/google-logo-icon_6.entry.js +5 -5
  97. package/dist/esm/google-logo-icon_6.entry.js.map +1 -1
  98. package/dist/esm/input-dropdown_2.entry.js +2 -2
  99. package/dist/esm/input-dropdown_2.entry.js.map +1 -1
  100. package/dist/esm/loader.js +1 -1
  101. package/dist/esm/multi-select-dropdown_2.entry.js +2 -2
  102. package/dist/esm/multi-select-dropdown_2.entry.js.map +1 -1
  103. package/dist/esm/nylas-booked-event-card_12.entry.js +14 -10
  104. package/dist/esm/nylas-booked-event-card_12.entry.js.map +1 -1
  105. package/dist/esm/nylas-key-points.entry.js +1 -1
  106. package/dist/esm/nylas-key-points.entry.js.map +1 -1
  107. package/dist/esm/nylas-provider.entry.js +1 -1
  108. package/dist/esm/nylas-provider.entry.js.map +1 -1
  109. package/dist/esm/nylas-scheduling.entry.js +1 -1
  110. package/dist/esm/nylas-scheduling.entry.js.map +1 -1
  111. package/dist/esm/nylas-web-elements.js +1 -1
  112. package/dist/esm/{scheduler-store-bbb4cf8d.js → scheduler-store-ef022be9.js} +9 -1
  113. package/dist/esm/scheduler-store-ef022be9.js.map +1 -0
  114. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  115. package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
  116. package/dist/nylas-web-elements/{p-c3cfe486.entry.js → p-09bbd467.entry.js} +2 -2
  117. package/dist/nylas-web-elements/p-09bbd467.entry.js.map +1 -0
  118. package/dist/nylas-web-elements/{p-6371e0a3.entry.js → p-0d80f50b.entry.js} +2 -2
  119. package/dist/nylas-web-elements/p-0d80f50b.entry.js.map +1 -0
  120. package/dist/nylas-web-elements/p-13a6c977.entry.js +2 -0
  121. package/dist/nylas-web-elements/p-13a6c977.entry.js.map +1 -0
  122. package/dist/nylas-web-elements/{p-14569ed8.entry.js → p-1fb32e0e.entry.js} +2 -2
  123. package/dist/nylas-web-elements/p-1fb32e0e.entry.js.map +1 -0
  124. package/dist/nylas-web-elements/{p-19f6fcf8.entry.js → p-3ca36162.entry.js} +2 -2
  125. package/dist/nylas-web-elements/p-3ca36162.entry.js.map +1 -0
  126. package/dist/nylas-web-elements/{p-78bd1f85.entry.js → p-51434e4a.entry.js} +2 -2
  127. package/dist/nylas-web-elements/p-51434e4a.entry.js.map +1 -0
  128. package/dist/nylas-web-elements/p-731a856b.js +2 -0
  129. package/dist/nylas-web-elements/p-731a856b.js.map +1 -0
  130. package/dist/nylas-web-elements/p-7b787c73.entry.js +8 -0
  131. package/dist/nylas-web-elements/p-7b787c73.entry.js.map +1 -0
  132. package/dist/nylas-web-elements/{p-f7ea608d.entry.js → p-a906d005.entry.js} +2 -2
  133. package/dist/nylas-web-elements/p-a906d005.entry.js.map +1 -0
  134. package/dist/nylas-web-elements/p-ab3ba8dc.entry.js +2 -0
  135. package/dist/nylas-web-elements/p-ab3ba8dc.entry.js.map +1 -0
  136. package/dist/nylas-web-elements/{p-91bc630c.entry.js → p-b1c57792.entry.js} +2 -2
  137. package/dist/nylas-web-elements/p-b1c57792.entry.js.map +1 -0
  138. package/dist/types/components/design-system/button-component/button-component.d.ts +1 -2
  139. package/dist/types/components/design-system/input-dropdown/input-dropdown.d.ts +1 -6
  140. package/dist/types/components/design-system/multi-select-dropdown/multi-select-dropdown.d.ts +1 -7
  141. package/dist/types/components/design-system/select-dropdown/select-dropdown.d.ts +1 -6
  142. package/dist/types/components/design-system/time-period-selector/time-period-selector.d.ts +1 -1
  143. package/dist/types/components/nylas-notebook/nylas-key-points/nylas-key-points.d.ts +1 -6
  144. package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +2 -1
  145. package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +1 -1
  146. package/dist/types/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.d.ts +1 -1
  147. package/dist/types/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.d.ts +17 -16
  148. package/dist/types/components/scheduler-editor/nylas-event-duration/nylas-event-duration.d.ts +2 -2
  149. package/dist/types/components.d.ts +17 -17
  150. package/dist/types/connector/nylas-connector/index.d.ts +1 -1
  151. package/dist/types/connector/nylas-scheduler-connector/errors/index.d.ts +1 -31
  152. package/dist/types/connector/shared/api/auth.d.ts +1 -1
  153. package/dist/types/connector/shared/api/scheduler.d.ts +1 -1
  154. package/dist/types/types/index.d.ts +36 -0
  155. package/package.json +2 -2
  156. package/dist/cjs/scheduler-store-c1fc5cf3.js.map +0 -1
  157. package/dist/esm/scheduler-store-bbb4cf8d.js.map +0 -1
  158. package/dist/nylas-web-elements/p-14569ed8.entry.js.map +0 -1
  159. package/dist/nylas-web-elements/p-19f6fcf8.entry.js.map +0 -1
  160. package/dist/nylas-web-elements/p-463d9c42.entry.js +0 -8
  161. package/dist/nylas-web-elements/p-463d9c42.entry.js.map +0 -1
  162. package/dist/nylas-web-elements/p-6371e0a3.entry.js.map +0 -1
  163. package/dist/nylas-web-elements/p-78bd1f85.entry.js.map +0 -1
  164. package/dist/nylas-web-elements/p-91bc630c.entry.js.map +0 -1
  165. package/dist/nylas-web-elements/p-ac757a7b.entry.js +0 -2
  166. package/dist/nylas-web-elements/p-ac757a7b.entry.js.map +0 -1
  167. package/dist/nylas-web-elements/p-b0f18064.entry.js +0 -2
  168. package/dist/nylas-web-elements/p-b0f18064.entry.js.map +0 -1
  169. package/dist/nylas-web-elements/p-c3cfe486.entry.js.map +0 -1
  170. package/dist/nylas-web-elements/p-f0c25e38.js +0 -2
  171. package/dist/nylas-web-elements/p-f0c25e38.js.map +0 -1
  172. package/dist/nylas-web-elements/p-f7ea608d.entry.js.map +0 -1
@@ -1 +0,0 @@
1
- {"file":"scheduler-store-bbb4cf8d.js","mappings":";;;IAAY;AAAZ,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAQD,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,qEAA+C,CAAA;IAC/C,yDAAmC,CAAA;IACnC,mEAA6C,CAAA;IAC7C,mEAA6C,CAAA;IAC7C,qDAA+B,CAAA;IAC/B,yCAAmB,CAAA;IACnB,+DAAyC,CAAA;IACzC,2DAAqC,CAAA;IACrC,2DAAqC,CAAA;IACrC,mDAA6B,CAAA;AAC/B,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AAED,IAAY,YAQX;AARD,WAAY,YAAY;IACtB,mDAAmC,CAAA;IACnC,+CAA+B,CAAA;IAC/B,iDAAiC,CAAA;IACjC,+DAA+C,CAAA;IAC/C,iEAAiD,CAAA;IACjD,iDAAiC,CAAA;IACjC,mDAAmC,CAAA;AACrC,CAAC,EARW,YAAY,KAAZ,YAAY,QAQvB;MAEY,MAAM;IAAnB;QACE,cAAS,GAAG,CAAC,MAAc;YACzB,MAAM,QAAQ,GAAG,aAAa,CAAC,SAAS,CAAC;YACzC,MAAM,KAAK,GAAG,GAAG,MAAM,QAAQ,CAAC;YAChC,OAAO;gBACL,qBAAqB,EAAE,CAAC,UA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CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,KAAK,CAAC,CAAC;QAC1G,KAAK,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC;QAC9C,KAAK,CAAC,GAAG,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;KAC7C,CAAC,CAAC;IAOH,KAAK,CAAC,KAAK,GAAG;QACZ,KAAK,MAAM,GAAG,IAAI,sBAAsB,EAAE;YACxC,MAAM,KAAK,GAAG,sBAAsB,CAAC,GAA0C,CAAC,CAAC;YACjF,KAAK,CAAC,GAAG,CAAC,GAAU,EAAE,KAAK,CAAC,CAAC;SAC9B;KACF,CAAC;IAEF,OAAO,KAAK,CAAC;AACf;;;;","names":["i18next"],"sources":["src/connector/nylas-scheduler-connector/errors/index.ts","src/connector/shared/api/scheduler.ts","src/stores/scheduler-store.ts"],"sourcesContent":["export enum ErrorCategory {\n Component = 'component',\n Api = 'api',\n Auth = 'auth',\n}\n\nexport interface ErrorDetails {\n title: string;\n message: string;\n category: ErrorCategory;\n}\n\nexport enum ComponentErrorType {\n endtime_not_in_future = 'endtime_not_in_future',\n no_booking_info = 'no_booking_info',\n no_timeslot_selected = 'no_timeslot_selected',\n no_timezone_selected = 'no_timezone_selected',\n no_booking_id = 'no_booking_id',\n no_salt = 'no_salt',\n invalid_start_time = 'invalid_start_time',\n invalid_end_time = 'invalid_end_time',\n invalid_timezone = 'invalid_timezone',\n no_config_id = 'no_config_id',\n}\n\nexport enum APIErrorType {\n invalid_session = 'invalid_session',\n general_error = 'general_error',\n internal_error = 'internal_error',\n invalid_request_error = 'invalid_request_error',\n timeslot_not_available = 'timeslot_not_available',\n provider_error = 'provider_error',\n not_found_error = 'not_found_error',\n}\n\nexport class Errors {\n component = (_title: string): Record<ComponentErrorType, (message?: string) => ErrorDetails> => {\n const category = ErrorCategory.Component;\n const title = `${_title} Error`;\n return {\n endtime_not_in_future: (message: string = '\"endtime\" can not be in the future') => {\n return {\n title,\n message,\n category,\n };\n },\n no_booking_info: (message: string = 'No booking info provided') => {\n return {\n title,\n message,\n category,\n };\n },\n no_timeslot_selected: (message: string = 'No timeslot selected') => {\n return {\n title,\n message,\n category,\n };\n },\n no_timezone_selected: (message: string = 'No timezone selected') => {\n return {\n title,\n message,\n category,\n };\n },\n no_booking_id: (message: string = 'No booking id provided') => {\n return {\n title,\n message,\n category,\n };\n },\n no_salt: (message: string = 'No salt provided') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_start_time: (message: string = 'Invalid start time') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_end_time: (message: string = 'Invalid end time') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_timezone: (message: string = 'Invalid timezone') => {\n return {\n title,\n message,\n category,\n };\n },\n no_config_id: (message: string = 'No configuration id provided') => {\n return {\n title,\n message,\n category,\n };\n },\n };\n };\n\n api = (_title: string): Record<APIErrorType, (message: string) => ErrorDetails> => {\n const category = ErrorCategory.Api;\n const title = `${_title} Error`;\n\n return {\n invalid_session: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n general_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n internal_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_request_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n timeslot_not_available: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n provider_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n not_found_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n };\n };\n}\n","import { AvailabilityResponse, NylasSchedulerBookingDataWithFlatFields, NylasEvent, UISettingsResponse } from '@/common/types';\nimport { NylasSchedulerStoreType } from '../../../components';\nimport type { NylasErrorResponse, NylasResponse, NylasSchedulerBookingData, NylasSchedulerResponse, Timeslot } from '@nylas/core';\nimport { APIErrorType, Errors } from '@/connector/nylas-scheduler-connector/errors';\nimport { addDaysToCurrentDate } from '@/utils/utils';\nimport i18next from '@/utils/i18n';\n\ntype NylasSchedulerAPIConnectorOptions = {\n schedulerAPIURL: string;\n schedulerStore: NylasSchedulerStoreType;\n sessionId?: string;\n configId?: string;\n slug?: string;\n clientId?: string;\n};\n\n/**\n * NylaSchedulerConnector\n * This class is used to make API requests to the scheduler.\n */\nexport class NylaSchedulerAPIConnector {\n private schedulerStore: NylasSchedulerStoreType;\n private schedulerAPIURL: string;\n private sessionId: string | undefined;\n private configId: string | undefined;\n private slug: string | undefined;\n private clientId: string | undefined;\n private errors = new Errors();\n\n constructor({ schedulerAPIURL, schedulerStore, sessionId, configId, slug, clientId }: NylasSchedulerAPIConnectorOptions) {\n this.schedulerStore = schedulerStore;\n this.schedulerAPIURL = schedulerAPIURL;\n this.sessionId = sessionId;\n this.configId = configId;\n this.slug = slug;\n this.clientId = clientId;\n }\n\n private getHeaders() {\n return this.sessionId\n ? {\n Authorization: `Bearer ${this.sessionId}`,\n }\n : {};\n }\n\n /**\n * Makes an API request to the scheduler.\n * @param path The path to the API endpoint.\n * @param method The HTTP method.\n * @param body The request body (if any).\n * @returns {Promise<T>}\n */\n public async makeAPIRequest<T>(path: string, method: string, body: string | undefined, headers = {}): Promise<NylasResponse<T>> {\n try {\n const schedulerURL = new URL(this.schedulerAPIURL);\n const version = process.env.PACKAGE_VERSION || 'latest';\n schedulerURL.pathname = path;\n const response = await fetch(decodeURIComponent(schedulerURL.toString()), {\n method,\n headers: {\n 'Content-Type': 'application/json',\n 'Origin': window.location.origin,\n 'X-Source': 'nylas-scheduling',\n 'X-Nylas-Web-Elements-Version': version,\n ...headers,\n },\n body,\n });\n // The server returns a json object for errors: eg.\n // {\n // \"request_id\": \"<request_id>\",\n // \"error\": {\n // \"type\": \"not_found_error\",\n // \"message\": \"Session not found\"\n // }\n // }\n const data = await response.json();\n return data as NylasResponse<T>;\n } catch (error: any) {\n // NOTE: current server implementation doesn't return a JSON object for errors on some endpoints\n // handle this case by returning the error response as a string to be handled downstream\n return {\n error: {\n message: error.message,\n title: 'API request failed',\n type: 'api',\n },\n } as NylasErrorResponse;\n }\n }\n\n private getErrorMessage(error: NylasErrorResponse['error']) {\n let errorMessage = error?.message || error?.title || 'Something went wrong';\n if (error?.type === 'provider_error') {\n errorMessage = error?.provider_error?.error?.message || error?.provider_error?.error?.title || 'Something went wrong';\n }\n return errorMessage;\n }\n\n public setConfigId(configId: string) {\n this.configId = configId;\n }\n\n /**\n * Selects a date in the scheduler.\n */\n public selectDate(date: Date) {\n this.schedulerStore.set('selectedDate', date);\n this.schedulerStore.set('selectedTimeslot', null);\n }\n\n /**\n * Selects a time in the scheduler.\n */\n public selectTime(time: Timeslot) {\n this.schedulerStore.set('selectedTimeslot', time);\n }\n\n /**\n * Sets the timezone in the scheduler.\n */\n public selectTimezone(timezone: string) {\n this.schedulerStore.set('selectedTimezone', timezone);\n }\n\n /**\n * Sets the language in the scheduler.\n */\n public selectLanguage(language: string) {\n this.schedulerStore.set('selectedLanguage', language);\n i18next.changeLanguage(language);\n }\n\n /**\n * Toggles showBookingForm\n * @param value boolean\n */\n public async toggleAdditionalData(value: boolean) {\n if (!value) {\n // Refetch availability\n await this.refetchAvailability();\n }\n this.schedulerStore.set('showBookingForm', value);\n }\n\n /**\n * Set/update the name of the participant booking the event.\n */\n public setParticipantName(name: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n name,\n },\n });\n }\n\n /**\n * Set/update the email of the participant booking the event.\n */\n public setParticipantEmail(email: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n email,\n },\n });\n }\n\n private async refetchAvailability() {\n const today = new Date();\n // Refetch availability\n const startTime = new Date(today.getFullYear(), today.getMonth(), 1).getTime() / 1000;\n const startTimeWithOffset = startTime < today.getTime() / 1000 ? Math.floor(today.getTime() / 1000) : startTime;\n const endTime = new Date(today.getFullYear(), today.getMonth() + 1, 1).getTime() / 1000;\n const result = await this.getAvailability(startTimeWithOffset, endTime);\n return result;\n }\n\n private async resetStoreStateAndFetchAvailability() {\n const today = new Date();\n // Refetch availability\n const result = await this.refetchAvailability();\n // Set selected date to first available date\n const firstAvailableDate = this.schedulerStore.get('availability').find((timeslot: any) => new Date(timeslot.start_time) > new Date());\n let _selectedDate = today;\n if (firstAvailableDate) {\n _selectedDate = firstAvailableDate.start_time;\n }\n this.schedulerStore.set('selectedDate', _selectedDate);\n // Reset store state\n this.schedulerStore.set('eventInfo', null);\n this.schedulerStore.set('showBookingForm', false);\n this.schedulerStore.set('selectedTimeslot', null);\n\n return result;\n }\n\n /**\n * Set reschedule booking id\n */\n public async setReschedule(bookingID: string) {\n this.schedulerStore.set('isLoading', true);\n const eventInfo = this.schedulerStore.state.eventInfo;\n if (eventInfo) {\n this.schedulerStore.set('reschedulingEventInfo', eventInfo);\n }\n this.schedulerStore.set('rescheduleBookingId', bookingID);\n await this.getUISettings();\n // Set reschedule booking id\n const result = await this.resetStoreStateAndFetchAvailability().finally(() => {\n this.schedulerStore.set('isLoading', false);\n });\n\n return result;\n }\n\n /**\n * Set cancel booking id\n */\n public async setCancel(bookingID: string) {\n this.schedulerStore.set('cancelBookingId', bookingID);\n }\n\n /**\n * Set reject booking id\n */\n public async setReject(bookingID: string) {\n this.schedulerStore.set('rejectBookingId', bookingID);\n }\n\n public async resetCancel() {\n const result = await this.resetStoreStateAndFetchAvailability();\n this.schedulerStore.set('cancelBookingId', '');\n this.schedulerStore.set('rejectBookingId', '');\n this.schedulerStore.set('cancelledEventInfo', null);\n return result;\n }\n\n public async goBack() {\n this.schedulerStore.set('cancelBookingId', '');\n return;\n }\n\n public async resetConfirm() {\n const result = await this.resetStoreStateAndFetchAvailability();\n this.schedulerStore.set('organizerConfirmationBookingId', '');\n this.schedulerStore.set('confirmedEventInfo', undefined);\n return result;\n }\n\n /**\n * Book the selected timeslot.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async bookTimeslot(data?: NylasSchedulerBookingDataWithFlatFields & { timeslot?: Timeslot }): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n const { selectedTimeslot, selectedTimezone, bookingInfo, selectedLanguage } = this.schedulerStore.state;\n\n if (!data && !bookingInfo) {\n return { error: this.errors.component(i18next.t('createBookingErrorTitle')).no_booking_info() };\n }\n\n const timeslot = data?.timeslot || selectedTimeslot;\n if (!timeslot) {\n return { error: this.errors.component(i18next.t('createBookingErrorTitle')).no_timeslot_selected() };\n }\n\n const timezone = data && data?.timezone ? data?.timezone : selectedTimezone;\n const language = selectedLanguage || 'en-US';\n\n if (!timezone) {\n return { error: this.errors.component(i18next.t('createBookingErrorTitle')).no_timezone_selected() };\n }\n\n const order = [...this.schedulerStore.get('availabilityOrderEmails')];\n\n let participantToBookWith = '';\n const emails = timeslot?.emails || [];\n\n const addFields = {};\n Object.entries(bookingInfo?.additionalFields || {}).forEach(([key, entry]) => {\n addFields[key] = (entry as { value: string; type?: string }).value;\n });\n\n const primaryGuest = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? data?.additionalFields : addFields;\n\n const headers = this.getHeaders();\n const configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n const url = `/v3/scheduling/bookings${configIdParam}`;\n\n // If the order array is empty, make a single request without retries\n if (order.length === 0) {\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'POST',\n JSON.stringify({\n additional_fields,\n additional_guests: guests,\n guest: { ...primaryGuest },\n start_time: timeslot.start_time.getTime() / 1000,\n end_time: timeslot.end_time.getTime() / 1000,\n timezone,\n event_id: timeslot?.event_id || undefined,\n master_id: timeslot?.master_id || undefined,\n calendar_id: timeslot?.calendar_id || undefined,\n email_language: this.getTwoLetterLanguageCode(language),\n }),\n headers,\n );\n\n this.schedulerStore.set('isLoading', false);\n if ('data' in response) {\n this.schedulerStore.set('eventInfo', response.data);\n return response;\n }\n return { error: response.error };\n }\n\n while (order.length > 0) {\n participantToBookWith = order.shift()!;\n\n if (!emails.includes(participantToBookWith)) {\n continue; // Skip if the email is not part of the timeslot\n }\n\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'POST',\n JSON.stringify({\n participants: participantToBookWith ? [{ email: participantToBookWith }] : undefined,\n additional_fields,\n additional_guests: guests,\n guest: { ...primaryGuest },\n start_time: timeslot.start_time.getTime() / 1000,\n end_time: timeslot.end_time.getTime() / 1000,\n timezone: timezone,\n email_language: this.getTwoLetterLanguageCode(language),\n }),\n headers,\n );\n\n if ('data' in response) {\n // Successful booking\n this.schedulerStore.set('isLoading', false);\n this.schedulerStore.set('eventInfo', response?.data);\n return response;\n } else if (response.error?.message?.startsWith('The selected timeslot is unavailable')) {\n // Retry with the next email in the order\n continue;\n } else {\n // Return other errors\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('createBookingErrorTitle'))) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(i18next.t('createBookingErrorTitle'))[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n }\n\n // If no emails in order succeed\n this.schedulerStore.set('isLoading', false);\n return {\n error: this.errors.api(i18next.t('createBookingErrorTitle')).timeslot_not_available('The selected timeslot is unavailable'),\n };\n }\n\n /**\n * Get UI settings for the scheduler.\n */\n public async getUISettings(): Promise<NylasSchedulerResponse<UISettingsResponse>> {\n this.schedulerStore.set('isLoading', true);\n const bookingId = this.schedulerStore.get('rescheduleBookingId');\n const headers = this.getHeaders();\n let configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n if (bookingId && !!configIdParam) {\n configIdParam += `&booking_id=${bookingId}`;\n } else if (bookingId) {\n configIdParam += `?booking_id=${bookingId}`;\n }\n\n const url = `/v3/scheduling/ui-settings${configIdParam}`;\n\n const response = await this.makeAPIRequest<UISettingsResponse>(url, 'GET', undefined, headers);\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('getUISettingErrorTitle'))) {\n error = this.errors.api(i18next.t('getUISettingErrorTitle'))[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n if ('data' in response) {\n this.schedulerStore.set('configSettings', response.data);\n }\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n private getTwoLetterLanguageCode(language: string) {\n return language.split('-')[0];\n }\n\n private getStartTimeWithMinBookingNotice(startTime: number) {\n const scheduler = this.schedulerStore.get('configSettings')?.scheduler;\n const min_booking_notice = scheduler?.min_booking_notice;\n if (!min_booking_notice) {\n return startTime;\n }\n const today = new Date().getTime();\n\n if (startTime < (today + min_booking_notice * 60 * 1000) / 1000) {\n return Math.floor((today + min_booking_notice * 60 * 1000) / 1000);\n } else {\n return startTime;\n }\n }\n\n private getEndTimeForAvailableDaysInFuture(endTime: number) {\n const today = new Date();\n const availableDaysInFuture = this.schedulerStore.get('configSettings')?.scheduler?.available_days_in_future;\n const endTimeForAvailableDaysInFuture = Math.floor(addDaysToCurrentDate(today, availableDaysInFuture).getTime() / 1000);\n const endTimeWithOffset = Math.min(endTimeForAvailableDaysInFuture, endTime);\n return endTimeWithOffset;\n }\n\n /**\n * Gets the availability for a page.\n * @param startTime The start time.\n * @param endTime The end time.\n * @returns {Promise<AvailabilityResponse>}\n */\n public async getAvailability(startTime: number = 0, endTime: number = 0): Promise<NylasSchedulerResponse<AvailabilityResponse>> {\n this.schedulerStore.set('isLoading', true);\n const params = new URLSearchParams();\n const now = new Date();\n const nowTime = now.getTime();\n\n if (endTime && endTime < nowTime / 1000) {\n this.schedulerStore.set('isLoading', false);\n const error = this.errors.component(i18next.t('getAvailabilityErrorTitle')).endtime_not_in_future();\n return { error };\n }\n\n // Calculate the start of the current month if startTime is not provided\n if (!startTime) {\n const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);\n startTime = Math.floor(startOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n // Calculate the end of the current month if endTime is not provided\n if (!endTime) {\n const endOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0); // Setting day to 0 gets the last day of the previous month, so in this case, the last day of the current month\n endTime = Math.floor(endOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n endTime = this.getEndTimeForAvailableDaysInFuture(endTime);\n const startTimeWithMinBooking = this.getStartTimeWithMinBookingNotice(startTime);\n startTime = startTimeWithMinBooking;\n endTime = startTimeWithMinBooking > endTime ? startTimeWithMinBooking + 1 : endTime;\n\n params.append('start_time', encodeURIComponent(startTime.toString()));\n params.append('end_time', encodeURIComponent(endTime.toString()));\n if (this.configId && !this.sessionId) {\n params.append('configuration_id', encodeURIComponent(this.configId));\n } else if (this.slug && this.clientId && !this.sessionId) {\n params.append('slug', encodeURIComponent(this.slug));\n params.append('client_id', encodeURIComponent(this.clientId));\n }\n\n const rescheduleBookingId = this.schedulerStore.get('rescheduleBookingId');\n if (rescheduleBookingId) {\n params.append('booking_id', encodeURIComponent(rescheduleBookingId));\n }\n const queryString = params.toString();\n const url = `/v3/scheduling/availability${queryString ? `?${queryString}` : ''}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<AvailabilityResponse>(decodeURIComponent(url), 'GET', undefined, headers);\n\n if ('error' in response) {\n this.schedulerStore.set('availability', []);\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('getAvailabilityErrorTitle'))) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(i18next.t('getAvailabilityErrorTitle'))[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n\n if ('data' in response) {\n const availability =\n response.data?.time_slots?.map(timeslot => {\n return {\n ...timeslot,\n start_time: new Date(timeslot.start_time * 1000),\n end_time: new Date(timeslot.end_time * 1000),\n };\n }) || [];\n\n // Filter out timeslots that are in the past\n const availabilityTimeslotsFiltered = availability.filter(timeslot => timeslot.start_time.getTime() > nowTime);\n const availabilityTimeslotSorted = availabilityTimeslotsFiltered.sort((a, b) => a.start_time.getTime() - b.start_time.getTime());\n this.schedulerStore.set('availability', availabilityTimeslotSorted);\n const order = response.data?.order || [];\n this.schedulerStore.set('availabilityOrderEmails', order);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Cancels a booking.\n * @param bookingId The booking ID.\n */\n public async cancelBooking(bookingId: string, reason: string): Promise<NylasSchedulerResponse<Partial<NylasEvent>>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component(i18next.t('cancelBookingErrorTitle')).no_booking_id() };\n }\n const configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<Partial<NylasEvent>>(\n decodeURIComponent(url),\n 'DELETE',\n JSON.stringify({\n action: 'cancel',\n cancellation_reason: reason,\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('cancelBookingErrorTitle'))) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(i18next.t('cancelBookingErrorTitle'))[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n\n this.schedulerStore.set('cancelledEventInfo', {\n booking_id: bookingId,\n });\n this.schedulerStore.set('rescheduleBookingId', '');\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Reschedules a booking.\n * @param bookingId The booking ID.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async rescheduleBooking(bookingId: string, data: NylasSchedulerBookingDataWithFlatFields): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component(i18next.t('rescheduleBookingErrorTitle')).no_booking_id() };\n }\n const apiErrors = this.errors.api(i18next.t('rescheduleBookingErrorTitle'));\n const componentErrors = this.errors.component(i18next.t('rescheduleBookingErrorTitle'));\n const { bookingInfo, selectedTimeslot, selectedTimezone, selectedLanguage } = this.schedulerStore.state;\n // Validate data\n const { startTime, endTime, timezone } = data;\n const start_time = startTime || selectedTimeslot?.start_time;\n\n if (!start_time) {\n return { error: componentErrors.invalid_start_time('Please pass \"startTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n const end_time = endTime || selectedTimeslot?.end_time;\n if (!end_time) {\n return { error: componentErrors.invalid_end_time('Please pass \"endTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n\n const order = this.schedulerStore.get('availabilityOrderEmails');\n let participantToBookWith = '';\n if (order.length > 0) {\n // Get the emails in the timeslot\n const emails = selectedTimeslot?.emails || [];\n for (let i = 0; i < order.length; i++) {\n if (emails.includes(order[i])) {\n participantToBookWith = order[i];\n break;\n }\n }\n }\n\n const time_zone = timezone || selectedTimezone;\n if (!time_zone) {\n return { error: componentErrors.invalid_timezone('Please pass \"timezone\" in data or set \"selectedTimezone\" in the defaultSchedulerState.') };\n }\n const addFields = {};\n Object.entries(bookingInfo?.additionalFields || {}).forEach(([key, entry]) => {\n addFields[key] = (entry as { value: string; type?: string }).value;\n });\n const primaryGuest = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? data?.additionalFields : addFields;\n\n const configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'PATCH',\n JSON.stringify({\n start_time: start_time.getTime() / 1000,\n end_time: end_time.getTime() / 1000,\n timezone: time_zone,\n additional_fields,\n guest: { ...primaryGuest },\n additional_guests: guests,\n participants: participantToBookWith ? [{ email: participantToBookWith }] : undefined,\n email_language: this.getTwoLetterLanguageCode(selectedLanguage),\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in apiErrors) {\n const errorMessage = this.getErrorMessage(error);\n error = apiErrors[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n\n const eventInfo = this.schedulerStore.get('reschedulingEventInfo');\n if ('data' in response) {\n this.schedulerStore.set('eventInfo', response?.data);\n } else if (eventInfo) {\n this.schedulerStore.set('eventInfo', eventInfo);\n } else {\n // We should technically never reach this point\n const event = {\n booking_id: bookingId,\n } as NylasEvent;\n this.schedulerStore.set('eventInfo', event);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Updates the booking.\n * @param bookingId The booking ID.\n */\n public async updateBooking(payload: { bookingId: string; status: 'confirmed' | 'cancelled'; reason?: string }): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n const { bookingId, status, reason } = payload;\n const salt = this.schedulerStore.get('organizerConfirmationSalt');\n const errorTitle = status === 'confirmed' ? i18next.t('confirmBookingErrorTitle') : i18next.t('rejectBookingErrorTitle');\n\n if (!bookingId) {\n return { error: this.errors.component(errorTitle).no_booking_id() };\n }\n if (!salt) {\n return { error: this.errors.component(errorTitle).no_salt() };\n }\n\n const configIdParam =\n !this.sessionId && this.configId\n ? `?configuration_id=${this.configId}`\n : !this.sessionId && this.slug && this.clientId\n ? `?slug=${this.slug}&client_id=${this.clientId}`\n : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'PUT',\n JSON.stringify({\n status: status,\n cancellation_reason: reason,\n salt,\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(errorTitle)) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(errorTitle)[errorType as APIErrorType](errorMessage);\n }\n return { error };\n }\n\n if ('data' in response && status === 'confirmed') {\n this.schedulerStore.set('confirmedEventInfo', response?.data);\n } else if ('request_id' in response && status === 'cancelled') {\n this.schedulerStore.set('cancelledEventInfo', {\n booking_id: bookingId,\n });\n }\n\n this.schedulerStore.set('organizerConfirmationBookingId', '');\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Validate timeslot for group event booking\n */\n public async validateGroupEventTimeslot(timeslot: Timeslot) {\n this.schedulerStore.set('isLoading', true);\n const configId = this.schedulerStore.get('configSettings')?.configuration_id;\n if (!configId) {\n return { error: this.errors.component(i18next.t('validateTimeslotErrorTitle')).no_config_id() };\n }\n\n const headers = this.getHeaders();\n const url = `/v3/scheduling/configurations/${configId}/group-events/validate-timeslot`;\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'POST',\n JSON.stringify({\n ...timeslot,\n start_time: timeslot.start_time.getTime() / 1000,\n end_time: timeslot.end_time.getTime() / 1000,\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api(i18next.t('validateTimeslotErrorTitle'))) {\n const errorMessage = this.getErrorMessage(error);\n error = this.errors.api(i18next.t('validateTimeslotErrorTitle'))[errorType as APIErrorType](errorMessage);\n }\n this.refetchAvailability();\n return { error };\n }\n\n this.schedulerStore.set('selectedTimeslot', timeslot);\n this.schedulerStore.set('showBookingForm', true);\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n}\n","import { DataState, NylasEvent } from '@/common/types';\nimport { debug } from '@/utils/utils';\nimport { AdditionalFields, Appearance, NylasSchedulerBookingData, ThemeConfig, Timeslot } from '@nylas/core';\nimport { createStore } from '@stencil/store';\n\nexport type AvailabilityTimeslot = {\n emails: string[];\n start_time: Date;\n end_time: Date;\n capacity?: number;\n event_id?: string;\n master_id?: string;\n calendar_id?: string;\n};\n\nexport type LoadingState = {\n api: 'availability' | 'createBooking' | 'cancelBooking' | 'rescheduleBooking';\n};\n\nexport type ConfigSettings = {\n configuration_id: string;\n booking?: {\n additional_fields: Record<string, string>;\n additional_guests: {\n email: string;\n name: string;\n }[];\n booking_ref: string;\n booking_ref_salt: string;\n guest: {\n email: string;\n name: string;\n };\n timezone: string;\n email_language: string;\n event_data: {\n location: string;\n when: {\n start_time: Date;\n end_time: Date;\n end_timezone: string;\n start_timezone: string;\n object: string;\n };\n };\n event_organizer: {\n name: string;\n email: string;\n is_organizer: boolean;\n };\n };\n scheduler: {\n available_days_in_future: number;\n min_cancellation_notice: number;\n min_booking_notice: number;\n rescheduling_url?: string;\n cancellation_url?: string;\n cancellation_policy?: string;\n hide_additional_guests?: boolean;\n hide_cancellation_options?: boolean;\n hide_rescheduling_options?: boolean;\n additional_fields?: Record<string, AdditionalFields>;\n confirmation_redirect_url?: string;\n organizer_confirmation_url?: string;\n };\n organizer: {\n name: string;\n email: string;\n };\n slug: string;\n appearance: Appearance;\n booking_type: string;\n name: string;\n};\n\nexport interface NylasSchedulerStoreState {\n selectedDate: Date | null;\n selectedLanguage: string;\n selectedTimezone: string;\n selectedTimeslot: Timeslot | null;\n availabilityOrderEmails: string[];\n showBookingForm: boolean;\n selectableDates: Date[] | null;\n eventDuration: number;\n availability: AvailabilityTimeslot[];\n state: DataState;\n eventInfo: NylasEvent | null;\n cancelledEventInfo: Partial<NylasEvent> | null;\n reschedulingEventInfo?: NylasEvent;\n confirmedEventInfo?: NylasEvent;\n bookingInfo?: NylasSchedulerBookingData;\n rescheduleBookingId?: string;\n cancelBookingId?: string;\n isLoading: boolean;\n nylasBranding?: boolean;\n configSettings?: ConfigSettings;\n organizerConfirmationBookingId?: string;\n rejectBookingId?: string;\n organizerConfirmationSalt?: string;\n themeConfig?: ThemeConfig;\n hour12?: boolean;\n}\n\nexport type NylasSchedulerStoreType = ReturnType<typeof CreateNylasSchedulerStore>;\n\nexport function CreateNylasSchedulerStore(defaultState: Partial<NylasSchedulerStoreState> = {}) {\n const defaultNylasStoreState: NylasSchedulerStoreState = {\n selectedDate: null,\n selectedLanguage: navigator.language,\n selectedTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n selectedTimeslot: null,\n showBookingForm: false,\n availabilityOrderEmails: [],\n selectableDates: null,\n availability: [],\n eventDuration: 0,\n state: 'ready',\n eventInfo: null,\n cancelledEventInfo: null,\n isLoading: false,\n nylasBranding: true,\n ...defaultState,\n };\n debug(`[defaultNylasStoreState]: `, defaultNylasStoreState);\n const store = createStore<NylasSchedulerStoreState>(defaultNylasStoreState);\n\n store.onChange('availability', availability => {\n debug(`[availability]: `, availability);\n const selectableDates = availability.map(timeslot => timeslot.start_time);\n debug(`[selectableDates]: `, selectableDates);\n store.set('selectableDates', selectableDates);\n const timeslot = availability[0];\n if (!timeslot) return;\n const durationMinutes = Math.floor((timeslot.end_time.getTime() - timeslot.start_time.getTime()) / 60000);\n debug(`[durationMinutes]: `, durationMinutes);\n store.set('eventDuration', durationMinutes);\n });\n\n /**\n * Reset the Nylas store to its default state.\n * There is something wrong with the stencil/store reset method,\n * so we have to do it via this hack.\n */\n store.reset = () => {\n for (const key in defaultNylasStoreState) {\n const value = defaultNylasStoreState[key as keyof typeof defaultNylasStoreState];\n store.set(key as any, value);\n }\n };\n\n return store;\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"version":3,"names":["NylasAuthConnector","constructor","nylasAuth","nylasAuthStore","this","validateSession","isAuthenticated","isAccessTokenValid","logout","tokenInfo","getTokenInfo","expireTimeCheck","currentTimeInSeconds","Math","floor","Date","now","expires_in","debug","refreshAccessToken","state","getHostedAuthRedirectURL","scopes","email","provider","manageHostedAuthCodeExchange","currentUrl","url","URL","code","searchParams","get","exchangeAuthCodeForTokenInfo","NylasConnector","router","nylasSchedulerStore","nylasSchedulerConfigStore","schedulerAPIURL","init","authStore","schedulerStore","schedulerConfigStore","auth","_authConnector","scheduler","_schedulerAPIConnector","NylaSchedulerAPIConnector","getAuth","resetStores","reset","PolyFillHashChangeEvent","Event","type","eventInitDict","super","oldURL","newURL","HashRouter","routeChangeListeners","destroy","window","removeEventListener","onRouteChange","bind","addEventListener","HashChangeEvent","event","location","href","addRouteChangeListener","route","listener","push","navigate","shallow","history","pushState","hash","setRoute","matchRoute","path","routeParts","split","pathParts","length","i","routePart","pathPart","startsWith","getRouteParams","routeParams","routeConfigParts","forEach","index","key","substring","getRouteWithParams","routeWithParams","Object","keys","replace","getRoute","async","indexOf","getBasePath","CreateNylasAuthStore","defaultState","defaultNylasStoreState","store","createStore","value","set","nylasProviderCss","NylasProviderStyle0","NylasProvider","handleAuthChange","loggedIn","emit","host","loggedOut","connectedCallback","componentWillLoad","stores","CreateNylasSchedulerStore","schedulerConfig","CreateNylasSchedulerConfigStore","baseProvider","NylasBaseProvider","automaticComponentRegistration","eventOverrides","NylasAuth","apiUri","elementsApiUri","storageType","clientId","defaultScopes","redirectURI","authConfig","getStore","Error","nylasConnector","initEvent","defaultPrevented","componentDidLoad","onChange","componentDisconnected","registerComponentHandler","registerComponent","detail","unregisterComponentHandler","unregisterComponent","getNylasAuth","getNylasConnector","getAuthStore","getNylasSchedulerStore","getNylasSchedulerConfigStore","render","h","Host"],"sources":["src/connector/shared/api/auth.ts","src/connector/nylas-connector/index.ts","src/routers/hash-router.ts","src/stores/auth-store.ts","src/components/nylas-provider/nylas-provider.css?tag=nylas-provider&encapsulation=shadow","src/components/nylas-provider/nylas-provider.tsx"],"sourcesContent":["import { debug } from '@/utils/utils';\nimport { NylasAuthStoreType, NylasAuthType } from '../../..';\nimport { TokenInfo } from '@nylas/core/lib/auth';\nexport class NylasAuthConnector {\n private nylasAuth: NylasAuthType;\n private nylasAuthStore: NylasAuthStoreType;\n\n constructor(nylasAuth: NylasAuthType, nylasAuthStore: NylasAuthStoreType) {\n this.nylasAuth = nylasAuth;\n this.nylasAuthStore = nylasAuthStore;\n }\n\n /**\n * Validates the current session and updates the store with the token info\n * if the user is authenticated.\n * If the user is not authenticated, the store is reset.\n * @returns {Promise<void>}\n */\n public async validateSession(): Promise<void> {\n const isAuthenticated = await this.isAccessTokenValid();\n if (!isAuthenticated) {\n // Reset the store if the access token is not valid\n this.logout();\n } else {\n // If the user is authenticated, update the store with the token info\n let tokenInfo = await this.nylasAuth.getTokenInfo();\n if (tokenInfo) {\n // If token is expired or about to expire (in 5 minutes), refresh it\n const expireTimeCheck = 5 * 60 * 1000; // 5 minutes\n const currentTimeInSeconds = Math.floor(Date.now() / 1000);\n\n if (tokenInfo.expires_in && tokenInfo.expires_in - currentTimeInSeconds < expireTimeCheck) {\n debug('[NylasAuthConnectorMixin] Refreshing access token');\n tokenInfo = await this.nylasAuth.refreshAccessToken();\n if (!tokenInfo) {\n debug('[NylasAuthConnectorMixin] Token is expired and could not be refreshed. Logging out.');\n this.logout();\n return;\n }\n }\n\n this.nylasAuthStore.state.tokenInfo = tokenInfo;\n }\n }\n this.nylasAuthStore.state.isAuthenticated = isAuthenticated;\n }\n\n /**\n * Returns true if the user is authenticated.\n * @returns {Promise<boolean>}\n */\n public async isAuthenticated(): Promise<boolean> {\n return this.nylasAuth.isAuthenticated();\n }\n\n /**\n * Returns the token info if the user is authenticated.\n * @returns {Promise<TokenInfo>}\n */\n public async getTokenInfo(): Promise<TokenInfo | null> {\n return this.nylasAuth.getTokenInfo();\n }\n\n /**\n * Returns true if the access token is valid.\n * @returns {Promise<boolean>}\n */\n public async isAccessTokenValid(): Promise<boolean> {\n return this.nylasAuth.isAccessTokenValid();\n }\n\n /**\n * Removes the token info from the store and logs the user out.\n * @returns {Promise<void>}\n */\n public async logout(): Promise<void> {\n await this.nylasAuth.logout();\n }\n\n /**\n * Returns the URL to redirect the user to for authentication.\n * @param scopes An array of scopes to request from the user.\n * @param email The email address of the user to authenticate.\n * @param provider The provider to use for authentication.\n * @returns {Promise<string>}\n */\n public async getHostedAuthRedirectURL(scopes?: string[], email?: string, provider?: string): Promise<string> {\n return this.nylasAuth.getHostedAuthRedirectURL(scopes, email, provider);\n }\n\n /**\n * Exchanges the auth code for a token info and updates the store.\n * @param currentUrl The current URL of the page.\n * @returns {Promise<TokenInfo | null>}\n */\n public async manageHostedAuthCodeExchange(currentUrl: string): Promise<TokenInfo | null> {\n const url = new URL(currentUrl);\n const code = url.searchParams.get('code');\n\n if (code) {\n const tokenInfo = await this.nylasAuth.exchangeAuthCodeForTokenInfo(code);\n if (tokenInfo) {\n this.nylasAuthStore.state.tokenInfo = tokenInfo;\n this.nylasAuthStore.state.isAuthenticated = true;\n return tokenInfo;\n }\n }\n\n return null;\n }\n}\n","import { RouterInterface } from '@/routers/router-interface';\nimport { NylasAuthStoreType } from '@/stores/auth-store';\nimport { NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { NylasSchedulerStoreType } from '@/stores/scheduler-store';\nimport { debug } from '@/utils/utils';\nimport type { NylasAuthType } from '@nylas/core';\nimport { NylasConnectorInterface } from '../connector-interface';\nimport { NylasAuthConnector } from '../shared/api/auth';\nimport { NylaSchedulerAPIConnector } from '../shared/api/scheduler';\n/**\n * Base class for the Nylas connector.\n */\nexport class NylasConnector implements NylasConnectorInterface {\n public router: RouterInterface;\n public nylasAuth: NylasAuthType;\n public nylasAuthStore: NylasAuthStoreType;\n public nylasSchedulerStore: NylasSchedulerStoreType;\n public nylasSchedulerConfigStore: NylasSchedulerConfigStoreType;\n public schedulerAPIURL: string;\n\n private _authConnector: NylasAuthConnector | undefined;\n private _schedulerAPIConnector: NylaSchedulerAPIConnector | undefined;\n\n constructor(\n router: RouterInterface,\n nylasAuth: NylasAuthType,\n nylasAuthStore: NylasAuthStoreType,\n nylasSchedulerStore: NylasSchedulerStoreType,\n nylasSchedulerConfigStore: NylasSchedulerConfigStoreType,\n schedulerAPIURL: string = 'https://api.us.nylas.com',\n ) {\n this.router = router;\n this.schedulerAPIURL = schedulerAPIURL;\n this.nylasAuth = nylasAuth;\n this.nylasAuthStore = nylasAuthStore;\n this.nylasSchedulerStore = nylasSchedulerStore;\n this.nylasSchedulerConfigStore = nylasSchedulerConfigStore;\n }\n\n public init() {\n debug('NylasConnector init');\n }\n\n public get authStore() {\n return this.nylasAuthStore;\n }\n\n public get schedulerStore() {\n return this.nylasSchedulerStore;\n }\n\n public get schedulerConfigStore() {\n return this.nylasSchedulerConfigStore;\n }\n\n public get auth() {\n if (this._authConnector) {\n return this._authConnector;\n }\n this._authConnector = new NylasAuthConnector(this.nylasAuth, this.nylasAuthStore);\n return this._authConnector;\n }\n\n public get scheduler() {\n if (this._schedulerAPIConnector) {\n return this._schedulerAPIConnector;\n }\n this._schedulerAPIConnector = new NylaSchedulerAPIConnector({\n schedulerAPIURL: this.schedulerAPIURL,\n schedulerStore: this.schedulerStore,\n });\n return this._schedulerAPIConnector;\n }\n\n public getAuth() {\n return this.nylasAuth;\n }\n\n public resetStores() {\n this.nylasAuthStore.reset();\n }\n\n public async logout() {\n await this.nylasAuth.logout();\n this.resetStores();\n }\n}\n\nexport type PublicMethods<T> = {\n [K in keyof T]: T[K] extends Function ? (string extends K ? never : K) : never;\n}[keyof T];\n\nexport type NylasConnectorPublicMethods = PublicMethods<NylasConnector>;\n","import { debug } from '@/utils/utils';\nimport { RouteListener, RouteParams, RoutePath, RouterInterface } from './router-interface';\n\nexport class PolyFillHashChangeEvent extends Event {\n oldURL?: string;\n newURL?: string;\n\n constructor(type: string, eventInitDict: HashChangeEventInit) {\n super(type, eventInitDict);\n this.oldURL = eventInitDict.oldURL;\n this.newURL = eventInitDict.newURL;\n }\n}\n\nexport class HashRouter implements RouterInterface {\n private routeChangeListeners: [route: RoutePath, RouteListener<any>][] = [];\n\n constructor() {\n debug('HashRouter constructor');\n }\n\n // Destroy the router\n public destroy(): void {\n debug('HashRouter destroy');\n window.removeEventListener('hashchange', this.onRouteChange.bind(this));\n }\n\n // Initialize the router\n public init(): void {\n debug('HashRouter init');\n window.addEventListener('hashchange', this.onRouteChange.bind(this));\n\n // Trigger the initial route change\n if (typeof HashChangeEvent !== 'undefined') {\n const event: HashChangeEvent = new HashChangeEvent('hashchange', { oldURL: '', newURL: window.location.href });\n this.onRouteChange(event);\n } else {\n const event: Event = new PolyFillHashChangeEvent('hashchange', { oldURL: '', newURL: window.location.href });\n this.onRouteChange(event as HashChangeEvent);\n }\n }\n\n public addRouteChangeListener<Path extends RoutePath>(route: Path, listener: RouteListener<Path>): void {\n debug('HashRouter addRouteChangeListener');\n this.routeChangeListeners.push([route, listener]);\n }\n\n public navigate(route: string, shallow: boolean): void {\n debug('HashRouter navigate');\n\n // If we're navigating shallow, don't add a new history entry\n if (shallow) {\n return window.history.pushState(null, '', `#${route}`);\n }\n\n window.location.hash = route;\n }\n\n public setRoute(route: string): void {\n debug('HashRouter setRoute');\n window.location.hash = route;\n }\n\n // Matches a route and executes the callback\n public matchRoute(route: string, path: string): boolean {\n const routeParts = route.split('/');\n const pathParts = path.split('/');\n\n // If the route is `/` an the hash is empty, match the route\n debug(`HashRouter matchRoute route=${route} path=${path}`, { routeParts, pathParts });\n if (routeParts[1] === '' && pathParts[0] === '') {\n return true;\n }\n\n if (routeParts.length !== pathParts.length) {\n return false;\n }\n\n for (let i = 0; i < routeParts.length; i++) {\n const routePart = routeParts[i];\n const pathPart = pathParts[i];\n if (routePart.startsWith(':')) {\n continue;\n }\n if (routePart !== pathPart) {\n return false;\n }\n }\n\n return true;\n }\n\n // Parse the route and return the route params\n public getRouteParams<Path extends RoutePath>(route: Path): RouteParams<Path> {\n debug('HashRouter getRouteParams');\n const routeParams: RouteParams<Path> = {} as RouteParams<Path>;\n const routeParts = route.split('/');\n const routeConfigParts = window.location.hash.split('/');\n routeParts.forEach((routePart, index) => {\n if (routePart.startsWith(':')) {\n const key = routePart.substring(1) as keyof RouteParams<Path>;\n routeParams[key] = routeConfigParts[index] as RouteParams<Path>[keyof RouteParams<Path>]; // Cast the value to string\n }\n });\n return routeParams;\n }\n\n public getRouteWithParams(route: string, routeParams: Record<string, any>): string {\n debug('HashRouter getRouteWithParams');\n let routeWithParams = route;\n Object.keys(routeParams).forEach(key => {\n routeWithParams = routeWithParams.replace(`:${key}`, routeParams[key]);\n });\n return routeWithParams;\n }\n\n public getRoute(): string {\n debug('HashRouter getRoute');\n return window.location.hash;\n }\n\n public onRouteChange(event: HashChangeEvent): void {\n this.routeChangeListeners.forEach(async ([route, listener]) => {\n const path = event.newURL.indexOf('#') === -1 ? '' : event.newURL.substring(event.newURL.indexOf('#') + 1);\n debug(`HashRouter onRouteChange route=${route} path=${path}`, { event });\n if (!this.matchRoute(route, path)) {\n debug(`HashRouter onRouteChange route=${route} path=${path} does not match`);\n return;\n }\n const routeParams = this.getRouteParams(route) as RouteParams<RoutePath>;\n await listener(route, path, routeParams);\n });\n }\n\n public getBasePath(): string {\n debug('HashRouter getBasePath');\n return '';\n }\n}\n","import { TokenInfo } from '@nylas/core/dist/auth';\nimport { createStore } from '@stencil/store';\nimport { DataState } from '@/common/types';\n\nexport interface NylasAuthStoreState {\n isAuthenticated: boolean;\n tokenInfo: TokenInfo | null;\n state: DataState;\n}\n\nexport type NylasAuthStoreType = ReturnType<typeof CreateNylasAuthStore>;\n\nexport function CreateNylasAuthStore(defaultState: Partial<NylasAuthStoreState> = {}) {\n const defaultNylasStoreState: NylasAuthStoreState = {\n isAuthenticated: false,\n tokenInfo: null,\n state: 'ready',\n ...defaultState,\n };\n const store = createStore<NylasAuthStoreState>(defaultNylasStoreState);\n\n /**\n * Reset the Nylas store to its default state.\n * There is something wrong with the stencil/store reset method,\n * so we have to do it via this hack.\n */\n store.reset = () => {\n for (const key in defaultNylasStoreState) {\n const value = defaultNylasStoreState[key as keyof typeof defaultNylasStoreState];\n store.set(key as any, value);\n }\n };\n\n return store;\n}\n",":host {\n display: contents;\n}\n","import { NylasBaseProvider } from '@/common/abstract-provider';\nimport { RegisteredComponent } from '@/common/register-component';\nimport { NylasConnector } from '@/connector/nylas-connector';\nimport { HashRouter } from '@/routers/hash-router';\nimport { CreateNylasAuthStore, NylasAuthStoreType } from '@/stores/auth-store';\nimport { CreateNylasSchedulerStore, NylasSchedulerStoreType } from '@/stores/scheduler-store';\nimport type { AuthConfig, NylasAuthType } from '@nylas/core';\nimport { NylasAuth } from '@nylas/core';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, h } from '@stencil/core';\nimport type { EventOverride } from '@/common/component-types';\nimport { debug } from '@/utils/utils';\nimport { CreateNylasSchedulerConfigStore, NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\n\n/**\n * The Nylas Provider component.\n * This component is used to manage the Nylas Provider.\n * It is used to manage the Nylas Auth instance, the Nylas Connector instance,\n * and the Nylas Store instance.\n */\n@Component({\n tag: 'nylas-provider',\n styleUrl: 'nylas-provider.css',\n shadow: true,\n})\nexport class NylasProvider {\n /**\n * Stores to be used by the provider.\n */\n private stores?: {\n auth: NylasAuthStoreType;\n scheduler: NylasSchedulerStoreType;\n schedulerConfig: NylasSchedulerConfigStoreType;\n };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Auth instance.\n * Used to manage all things authentication with Nylas.\n */\n private nylasAuth?: NylasAuthType;\n\n /**\n * The Nylas Mailbox Connector instance.\n * The branins of the provider. It manages data fetching and state synchronization.\n */\n private nylasConnector?: NylasConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasProviderElement;\n\n /**\n * The Nylas Auth configuration.\n * Used to manage all things authentication with Nylas.\n */\n @Prop({ attribute: 'auth-config' }) readonly authConfig?: AuthConfig;\n\n /**\n * This provides a way to override the default event handlers.\n */\n @Prop() eventOverrides: EventOverride<Exclude<typeof this.nylasConnector, undefined>> = {};\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @Prop() automaticComponentRegistration: boolean = true;\n\n /**\n * This event is fired when the provider is initialized.\n * It can be used to set the initial state of the provider,\n * or to prevent the provider from firing some default behavior.\n */\n @Event({ cancelable: true }) init!: EventEmitter<HTMLNylasProviderElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) loggedIn!: EventEmitter<HTMLNylasProviderElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) loggedOut!: EventEmitter<HTMLNylasProviderElement>;\n\n connectedCallback() {\n debug('[nylas-provider] connectedCallback');\n }\n\n async componentWillLoad() {\n debug('[nylas-provider] componentWillLoad');\n\n this.stores = {\n auth: CreateNylasAuthStore(),\n scheduler: CreateNylasSchedulerStore(),\n schedulerConfig: CreateNylasSchedulerConfigStore(),\n };\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n const router = new HashRouter();\n\n /**\n * Create the NylasAuth instance.\n * This is used to manage all things authentication with Nylas.\n */\n this.nylasAuth = NylasAuth({\n apiUri: 'https://api.us.nylas.com',\n elementsApiUri: 'https://elements.us.nylas.com',\n storageType: 'indexeddb',\n clientId: 'YOUR_CLIENT_ID',\n defaultScopes: [],\n redirectURI: '/',\n ...this.authConfig,\n });\n\n const nylasAuthStore = this.baseProvider?.getStore('auth');\n if (!nylasAuthStore) {\n throw new Error('The auth store is not set');\n }\n\n const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');\n if (!nylasSchedulerStore) {\n throw new Error('The scheduler store is not set');\n }\n\n const nylasSchedulerConfigStore = this.baseProvider?.getStore('schedulerConfig');\n if (!nylasSchedulerConfigStore) {\n throw new Error('The scheduler config store is not set');\n }\n\n this.nylasConnector = new NylasConnector(router, this.nylasAuth, nylasAuthStore, nylasSchedulerStore, nylasSchedulerConfigStore);\n\n const initEvent = this.init.emit(this.host);\n if (!initEvent.defaultPrevented) {\n /**\n * By default, on init, we will validate the session.\n * This will check if the user is logged in and if the session is still valid.\n * If the session is not valid, the user will be logged out.\n */\n await this.nylasConnector?.auth.validateSession();\n }\n\n /**\n * Listen for changes in the NylasAuth isAuthenticated state.\n * This is used to fire the loggedIn and loggedOut events.\n */\n this.handleAuthChange(nylasAuthStore.state.isAuthenticated);\n\n this.baseProvider?.componentWillLoad(this.nylasConnector);\n }\n\n componentDidLoad() {\n const nylasAuthStore = this.baseProvider?.getStore('auth');\n nylasAuthStore?.onChange('isAuthenticated', this.handleAuthChange);\n\n this.baseProvider?.componentDidLoad();\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n /**\n * This method is used to handle changes in the NylasAuth isAuthenticated state\n * @param isAuthenticated isAuthenticated state\n * @returns void\n */\n private handleAuthChange = async (isAuthenticated: boolean) => {\n if (isAuthenticated) {\n this.loggedIn.emit(this.host);\n } else {\n this.loggedOut.emit(this.host);\n }\n };\n\n /**\n * This method is used to retrieve the NylasAuth instance\n * @returns The NylasAuth instance\n */\n @Method()\n async getNylasAuth(): Promise<NylasAuthType | undefined> {\n return this.nylasAuth;\n }\n\n /**\n * This method is used to retrieve the NylasConnector instance\n * @returns The NylasConnector instance\n */\n @Method()\n async getNylasConnector() {\n return this.nylasConnector;\n }\n\n /**\n * This method is used to retrieve the authStore instance\n * @returns The authStore instance\n */\n @Method()\n async getAuthStore(): Promise<NylasAuthStoreType | undefined> {\n return this.baseProvider?.getStore('auth');\n }\n\n /**\n * This method is used to retrieve the NylasScheduler instance\n * @returns The NylasScheduler instance\n */\n @Method()\n async getNylasSchedulerStore(): Promise<NylasSchedulerStoreType | undefined> {\n return this.baseProvider?.getStore('scheduler');\n }\n\n /**\n * This method is used to retrieve the NylasSchedulerConfig instance\n * @returns The NylasSchedulerConfig instance\n */\n @Method()\n async getNylasSchedulerConfigStore(): Promise<NylasSchedulerConfigStoreType | undefined> {\n return this.baseProvider?.getStore('schedulerConfig');\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"gSAGaA,EAIX,WAAAC,CAAYC,EAA0BC,GACpCC,KAAKF,UAAYA,EACjBE,KAAKD,eAAiBA,C,CASjB,qBAAME,GACX,MAAMC,QAAwBF,KAAKG,qBACnC,IAAKD,EAAiB,CAEpBF,KAAKI,Q,KACA,CAEL,IAAIC,QAAkBL,KAAKF,U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SAAS,Y,CAQrC,kCAAMiB,GACJ,OAAOvJ,KAAK0H,cAAcY,SAAS,kB,CAGrC,MAAAkB,GACE,OACEC,EAACC,EAAI,CAAAhE,IAAA,4CACH+D,EAAA,QAAA/D,IAAA,6C"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["buttonComponentCss","ButtonComponentStyle0","ButtonComponent","render","className","this","variant","disabled","h","key","class","type","title","tooltip","onClick","clickHandler","onMouseOver","mouseOverHandler","onMouseOut","mouseOutHandler","onFocus","focusHandler","onBlur","blurHandler","isLoading","slot","loadingCss","LoadingIconStyle0","LoadingIcon"],"sources":["src/components/design-system/button-component/button-component.scss?tag=button-component&encapsulation=scoped","src/components/design-system/button-component/button-component.tsx","src/common/icons/loading.css?tag=loading-icon&encapsulation=shadow","src/common/icons/loading.tsx"],"sourcesContent":["@import '../../../common/mixins/buttons.scss';\n@import '../../../common/styles/variables.scss';\n\nbutton {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n height: 48px;\n border: none;\n border-radius: var(--nylas-border-radius-2x);\n font-size: 16px;\n line-height: 24px;\n padding: 0 1rem;\n cursor: pointer;\n font-family: var(--nylas-font-family);\n font-weight: 600;\n width: 100%;\n\n @media #{$mobile} {\n width: 100%;\n }\n\n &.button-primary {\n @include primary-button;\n }\n\n &.button-basic {\n border: 1px solid var(--nylas-base-300);\n color: var(--nylas-base-700);\n background: transparent;\n\n &:hover {\n background: transparent;\n border-color: var(--nylas-primary);\n }\n\n &:active {\n background: transparent;\n border-color: var(--nylas-base-600);\n border-width: 2px;\n }\n\n &:disabled {\n background: transparent;\n border-color: var(--nylas-base-300);\n color: var(--nylas-base-300);\n cursor: not-allowed;\n }\n }\n\n &.button-destructive {\n border: 1px solid var(--nylas-base-300);\n color: var(--nylas-error);\n background: transparent;\n\n &:hover {\n background: transparent;\n border-color: var(--nylas-error);\n }\n\n &:active {\n background: transparent;\n border-color: var(--nylas-error-pressed);\n border-width: 2px;\n color: var(--nylas-error-pressed);\n }\n\n &:disabled {\n background: transparent;\n border-color: var(--nylas-base-300);\n color: var(--nylas-base-300);\n cursor: not-allowed;\n }\n }\n\n &.button-invisible {\n background: transparent;\n color: var(--nylas-base-800);\n border: none;\n\n &:hover {\n background: var(--nylas-base-50);\n color: var(--nylas-primary);\n }\n\n &:active {\n background: var(--nylas-base-50);\n color: var(--nylas-base-850);\n }\n\n &:disabled {\n background: transparent;\n color: var(--nylas-base-300);\n cursor: not-allowed;\n }\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\ntype ButtonType = 'primary' | 'basic' | 'destructive' | 'invisible';\n\n@Component({\n tag: 'button-component',\n styleUrl: 'button-component.scss',\n scoped: true,\n})\nexport class ButtonComponent {\n // Define a prop to accept the button type\n @Prop() variant: ButtonType = 'primary';\n\n // Define a prop for disabled state\n @Prop() disabled: boolean = false;\n\n @Prop() type: string = 'button';\n @Prop() tooltip: string = '';\n @Prop() isLoading: boolean = false;\n @Prop() clickHandler?: (event: MouseEvent) => void;\n @Prop() mouseOverHandler?: (event: MouseEvent) => void;\n @Prop() mouseOutHandler?: (event: MouseEvent) => void;\n @Prop() focusHandler?: (event: FocusEvent) => void;\n @Prop() blurHandler?: (event: FocusEvent) => void;\n\n render() {\n const className = `button-${this.variant}` + (this.disabled ? ' disabled' : '');\n\n return (\n <button\n class={className}\n disabled={this.disabled}\n type=\"type\"\n title={this.tooltip}\n onClick={this.clickHandler}\n onMouseOver={this.mouseOverHandler}\n onMouseOut={this.mouseOutHandler}\n onFocus={this.focusHandler}\n onBlur={this.blurHandler}\n >\n {!!this.isLoading && <loading-icon slot=\"icon\"></loading-icon>}\n <slot></slot>\n </button>\n );\n }\n}\n",".wave {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.dot {\n width: 4px;\n height: 4px;\n background-color: var(--dot-color, white);\n border-radius: 50%;\n margin: 0 2px;\n animation: wave 1.5s infinite ease-in-out;\n}\n\n.dot:nth-child(2) {\n animation-delay: 0.2s;\n}\n\n.dot:nth-child(3) {\n animation-delay: 0.4s;\n}\n\n@keyframes wave {\n 0%,\n 60%,\n 100% {\n transform: translateY(0);\n }\n 30% {\n transform: translateY(-4px);\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'loading-icon',\n styleUrl: 'loading.css',\n shadow: true,\n})\nexport class LoadingIcon {\n @Prop() width: string = '15';\n @Prop() height: string = '15';\n\n render() {\n return (\n // Loading icon svg\n <div class=\"wave\">\n <div class=\"dot\"></div>\n <div class=\"dot\"></div>\n <div class=\"dot\"></div>\n </div>\n );\n }\n}\n"],"mappings":"2CAAA,MAAMA,EAAqB,o1EAC3B,MAAAC,EAAeD,E,MCOFE,EAAe,M,sCAEI,U,cAGF,M,UAEL,S,aACG,G,eACG,M,kJAO7B,MAAAC,GACE,MAAMC,EAAY,UAAUC,KAAKC,WAAaD,KAAKE,SAAW,YAAc,IAE5E,OACEC,EAAA,UAAAC,IAAA,2CACEC,MAAON,EACPG,SAAUF,KAAKE,SACfI,KAAK,OACLC,MAAOP,KAAKQ,QACZC,QAAST,KAAKU,aACdC,YAAaX,KAAKY,iBAClBC,WAAYb,KAAKc,gBACjBC,QAASf,KAAKgB,aACdC,OAAQjB,KAAKkB,eAEVlB,KAAKmB,WAAahB,EAAA,gBAAciB,KAAK,SACxCjB,EAAA,QAAAC,IAAA,6C,aCxCR,MAAMiB,EAAa,6WACnB,MAAAC,EAAeD,E,MCMFE,EAAW,M,oCACE,K,YACC,I,CAEzB,MAAAzB,GACE,OAEEK,EAAA,OAAAC,IAAA,2CAAKC,MAAM,QACTF,EAAA,OAAAC,IAAA,2CAAKC,MAAM,QACXF,EAAA,OAAAC,IAAA,2CAAKC,MAAM,QACXF,EAAA,OAAAC,IAAA,2CAAKC,MAAM,Q"}