@nylas/react 2.0.0 → 2.0.1

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 (169) hide show
  1. package/dist/abstract-provider-efe136bd-2041bdce.js +187 -0
  2. package/dist/abstract-provider-efe136bd-b4663c02.cjs +1 -0
  3. package/dist/add-circle-icon_2.entry-5204c48a.cjs +1 -0
  4. package/dist/add-circle-icon_2.entry-ea1692a4.js +26 -0
  5. package/dist/archive-icon.entry-0b585dff.js +16 -0
  6. package/dist/archive-icon.entry-c2c66bca.cjs +1 -0
  7. package/dist/{arrow-icon.entry-9414299f.js → arrow-icon.entry-2e61394e.js} +5 -5
  8. package/dist/arrow-icon.entry-9d471162.cjs +1 -0
  9. package/dist/{bold-icon.entry-c781e9c1.cjs → bold-icon.entry-5c37622f.cjs} +1 -1
  10. package/dist/{bold-icon.entry-b72aed9f.js → bold-icon.entry-8ef1b653.js} +2 -2
  11. package/dist/{button-component_2.entry-73f76545.cjs → button-component_2.entry-8335ee1e.cjs} +1 -1
  12. package/dist/{button-component_2.entry-36e49459.js → button-component_2.entry-c906230f.js} +9 -9
  13. package/dist/calendar-agenda-fill-icon_36.entry-59c0a997.cjs +6 -0
  14. package/dist/{calendar-agenda-fill-icon_36.entry-efa7ad26.js → calendar-agenda-fill-icon_36.entry-5f184433.js} +900 -881
  15. package/dist/{calendar-cancel-icon.entry-01c388eb.cjs → calendar-cancel-icon.entry-65a4a34e.cjs} +1 -1
  16. package/dist/{calendar-cancel-icon.entry-0f739a8a.js → calendar-cancel-icon.entry-dd6ac4db.js} +5 -5
  17. package/dist/{calendar-check-icon_2.entry-5febbadf.cjs → calendar-check-icon_2.entry-ded15038.cjs} +1 -1
  18. package/dist/{calendar-check-icon_2.entry-dfb0036d.js → calendar-check-icon_2.entry-f9b50bb8.js} +3 -3
  19. package/dist/{calendar-icon.entry-f197396d.js → calendar-icon.entry-a2a1ddbc.js} +2 -2
  20. package/dist/{calendar-icon.entry-9743e0b7.cjs → calendar-icon.entry-ca512dd6.cjs} +1 -1
  21. package/dist/checkbox-component_2.entry-d6128246.js +115 -0
  22. package/dist/checkbox-component_2.entry-d79b5d1d.cjs +1 -0
  23. package/dist/checkbox-group_4.entry-2946c7ef.cjs +28 -0
  24. package/dist/{nylas-event-calendar_3.entry-9abd46c2.js → checkbox-group_4.entry-e5145451.js} +1038 -923
  25. package/dist/{checkmark-icon_15.entry-5c09cff5.js → checkmark-icon_15.entry-6e92e93e.js} +19 -19
  26. package/dist/{checkmark-icon_15.entry-35dd97b7.cjs → checkmark-icon_15.entry-a75a1825.cjs} +2 -2
  27. package/dist/{chevron-icon_3.entry-4a72f211.js → chevron-icon_3.entry-6eaa3513.js} +16 -16
  28. package/dist/{chevron-icon_3.entry-e0608b7c.cjs → chevron-icon_3.entry-9193a885.cjs} +1 -1
  29. package/dist/{clock-icon_4.entry-0afe79c2.js → clock-icon_4.entry-2c93270e.js} +8 -8
  30. package/dist/{clock-icon_4.entry-202ce025.cjs → clock-icon_4.entry-ae2272f4.cjs} +1 -1
  31. package/dist/{customParseFormat-d1de5ed0-c0ef002d.js → customParseFormat-edc38d83-b3722499.js} +1 -1
  32. package/dist/{customParseFormat-d1de5ed0-65a0bba3.cjs → customParseFormat-edc38d83-fa9c77d9.cjs} +1 -1
  33. package/dist/{delete-icon.entry-580bfcc9.js → delete-icon.entry-6684eba6.js} +2 -2
  34. package/dist/{delete-icon.entry-762ac892.cjs → delete-icon.entry-b9e4f2c7.cjs} +1 -1
  35. package/dist/{document-refresh-icon.entry-4e0f0c61.cjs → document-refresh-icon.entry-7afe6163.cjs} +1 -1
  36. package/dist/document-refresh-icon.entry-fba9f60b.js +16 -0
  37. package/dist/{feedbackSync-172f942c-42124493.js → feedbackSync-e4378c0b-23289195.js} +811 -798
  38. package/dist/{feedbackSync-172f942c-62f72bd2.cjs → feedbackSync-e4378c0b-7876d067.cjs} +26 -26
  39. package/dist/{folder-icon.entry-54c3cc66.js → folder-icon.entry-430c6b47.js} +4 -4
  40. package/dist/{folder-icon.entry-2694e253.cjs → folder-icon.entry-b1632bf3.cjs} +1 -1
  41. package/dist/{forward-icon.entry-5e540f05.js → forward-icon.entry-5e53da76.js} +2 -2
  42. package/dist/{forward-icon.entry-f07102d8.cjs → forward-icon.entry-7626dcca.cjs} +1 -1
  43. package/dist/{globe-icon_2.entry-aaceb196.js → globe-icon_2.entry-646eae41.js} +20 -20
  44. package/dist/{globe-icon_2.entry-14a4c168.cjs → globe-icon_2.entry-bbb0a6ce.cjs} +1 -1
  45. package/dist/{google-logo-icon_6.entry-00d40db2.js → google-logo-icon_6.entry-5951a546.js} +682 -488
  46. package/dist/google-logo-icon_6.entry-e39dd9cb.cjs +2 -0
  47. package/dist/{google-meet-icon_5.entry-f1f05903.js → google-meet-icon_5.entry-a54c83da.js} +14 -14
  48. package/dist/{google-meet-icon_5.entry-6c20e149.cjs → google-meet-icon_5.entry-c13e0738.cjs} +1 -1
  49. package/dist/inbox-icon.entry-7bee82b3.js +16 -0
  50. package/dist/inbox-icon.entry-911b047a.cjs +1 -0
  51. package/dist/index-71f61ea9.js +24544 -0
  52. package/dist/index-f769bc2a.cjs +118 -0
  53. package/dist/index.d.ts +1 -4
  54. package/dist/index.es-6a9d55cf-122c27e0.js +2724 -0
  55. package/dist/index.es-6a9d55cf-458ba0e0.cjs +7 -0
  56. package/dist/{info-icon_2.entry-bbcefb9a.cjs → info-icon_2.entry-471b836b.cjs} +1 -1
  57. package/dist/{info-icon_2.entry-b3b313ab.js → info-icon_2.entry-6ff2f004.js} +3 -3
  58. package/dist/{input-component.entry-401b9ba5.js → input-component.entry-781b584c.js} +12 -12
  59. package/dist/{input-component.entry-ec8e8e7c.cjs → input-component.entry-b6a9b4cb.cjs} +1 -1
  60. package/dist/{input-dropdown_2.entry-c37f392c.js → input-dropdown_2.entry-1feebcba.js} +3 -3
  61. package/dist/{input-dropdown_2.entry-8cb11601.cjs → input-dropdown_2.entry-c71d14ff.cjs} +1 -1
  62. package/dist/{italic-icon.entry-6675558a.cjs → italic-icon.entry-16debde5.cjs} +1 -1
  63. package/dist/italic-icon.entry-9ef7f4a2.js +16 -0
  64. package/dist/{elements → lib/elements}/index.d.ts +1 -1
  65. package/dist/lib/index.d.ts +5 -0
  66. package/dist/lib/main.d.ts +0 -0
  67. package/dist/lib/notetaker/CalendarSync/CalendarSync.d.ts +37 -0
  68. package/dist/lib/notetaker/CalendarSync/CalendarSync.spec.d.ts +0 -0
  69. package/dist/lib/notetaker/SendNotetaker/SendNotetaker.d.ts +31 -0
  70. package/dist/lib/notetaker/SendNotetaker/SendNotetaker.spec.d.ts +1 -0
  71. package/dist/lib/notetaker/Transcript/Transcript.d.ts +23 -0
  72. package/dist/lib/notetaker/Transcript/Transcript.spec.d.ts +0 -0
  73. package/dist/lib/notetaker/VideoPlayer/VideoPlayer.d.ts +22 -0
  74. package/dist/lib/notetaker/VideoPlayer/VideoPlayer.spec.d.ts +1 -0
  75. package/dist/lib/notetaker/index.d.ts +9 -0
  76. package/dist/lib/notetaker/lib/constants.d.ts +12 -0
  77. package/dist/lib/notetaker/lib/http-client.d.ts +2 -0
  78. package/dist/lib/notetaker/lib/primitives.d.ts +66 -0
  79. package/dist/lib/notetaker/lib/store.d.ts +7 -0
  80. package/dist/lib/notetaker/types.d.ts +42 -0
  81. package/dist/multi-select-dropdown.entry-0a6f9417.cjs +1 -0
  82. package/dist/multi-select-dropdown.entry-1b27c746.js +121 -0
  83. package/dist/nylas-booked-event-card_11.entry-74fba802.cjs +1 -0
  84. package/dist/{nylas-booked-event-card_12.entry-e7464ae7.js → nylas-booked-event-card_11.entry-802671ee.js} +469 -534
  85. package/dist/{nylas-form-card.entry-cbb00fba.cjs → nylas-form-card.entry-59a837c9.cjs} +1 -1
  86. package/dist/{nylas-form-card.entry-a3186807.js → nylas-form-card.entry-7da9a312.js} +3 -3
  87. package/dist/nylas-notification_2.entry-8f8bad34.cjs +1 -0
  88. package/dist/nylas-notification_2.entry-b16bb805.js +85 -0
  89. package/dist/{nylas-scheduler-editor.entry-7b188a38.js → nylas-scheduler-editor.entry-cbe3e1e3.js} +160 -136
  90. package/dist/nylas-scheduler-editor.entry-e33e11fb.cjs +2 -0
  91. package/dist/nylas-scheduling.entry-4223e50b.cjs +1 -0
  92. package/dist/{nylas-scheduling.entry-e9929b03.js → nylas-scheduling.entry-6fb094a8.js} +295 -295
  93. package/dist/{person-icon.entry-d2856f08.js → person-icon.entry-6232e6fd.js} +7 -7
  94. package/dist/{person-icon.entry-8998fdb8.cjs → person-icon.entry-beb26b48.cjs} +1 -1
  95. package/dist/play-icon.entry-16a1c1ac.js +16 -0
  96. package/dist/{play-icon.entry-99eb969b.cjs → play-icon.entry-9060d0d8.cjs} +1 -1
  97. package/dist/{radio-button-group.entry-bc3b12fd.js → radio-button-group.entry-5a3728cd.js} +2 -2
  98. package/dist/{radio-button-group.entry-d66edd04.cjs → radio-button-group.entry-6935c39d.cjs} +1 -1
  99. package/dist/react.cjs +1 -1
  100. package/dist/react.js +135 -126
  101. package/dist/{refresh-icon.entry-99d1982d.cjs → refresh-icon.entry-2411b2e1.cjs} +1 -1
  102. package/dist/{refresh-icon.entry-d6df8b1c.js → refresh-icon.entry-4f56e72b.js} +2 -2
  103. package/dist/{register-component-62d792d4-448b6a43.js → register-component-a1c3d7b4-774feacc.js} +1 -1
  104. package/dist/{register-component-62d792d4-c6e7d129.cjs → register-component-a1c3d7b4-97d7a6f5.cjs} +1 -1
  105. package/dist/{reply-all-icon.entry-d7c44139.cjs → reply-all-icon.entry-b4b6926b.cjs} +1 -1
  106. package/dist/{reply-all-icon.entry-7ebf01a0.js → reply-all-icon.entry-b4b917ec.js} +2 -2
  107. package/dist/{reply-icon.entry-d1622d85.js → reply-icon.entry-24f6f4c6.js} +5 -5
  108. package/dist/{reply-icon.entry-058c00e8.cjs → reply-icon.entry-454545ed.cjs} +1 -1
  109. package/dist/sent-icon.entry-d9a79336.cjs +1 -0
  110. package/dist/sent-icon.entry-fa59ce85.js +16 -0
  111. package/dist/spam-icon.entry-da39987e.cjs +1 -0
  112. package/dist/spam-icon.entry-fb18a08b.js +16 -0
  113. package/dist/{star-icon.entry-98b80645.js → star-icon.entry-406472c1.js} +4 -4
  114. package/dist/{star-icon.entry-4db13fdb.cjs → star-icon.entry-833f35a7.cjs} +1 -1
  115. package/dist/{stop-icon.entry-0290fd30.js → stop-icon.entry-1b6ae838.js} +2 -2
  116. package/dist/{stop-icon.entry-9d7b53fd.cjs → stop-icon.entry-3258db59.cjs} +1 -1
  117. package/dist/style.css +1 -0
  118. package/dist/test/vitest.setup.d.ts +0 -0
  119. package/dist/{textarea-component.entry-9b474ab5.cjs → textarea-component.entry-0ae18897.cjs} +1 -1
  120. package/dist/{textarea-component.entry-a62c257b.js → textarea-component.entry-569a281e.js} +2 -2
  121. package/dist/{toggle-switch.entry-5dbfcd48.cjs → toggle-switch.entry-60d75f16.cjs} +1 -1
  122. package/dist/{toggle-switch.entry-e423b793.js → toggle-switch.entry-dc3f796b.js} +4 -4
  123. package/dist/{translate-icon.entry-60c55a2e.js → translate-icon.entry-297cf20f.js} +4 -4
  124. package/dist/{translate-icon.entry-f82fa6fc.cjs → translate-icon.entry-c183ecb5.cjs} +1 -1
  125. package/dist/trash-fill-icon.entry-3d8a2e5e.js +16 -0
  126. package/dist/trash-fill-icon.entry-94d4f66c.cjs +1 -0
  127. package/dist/{underline-icon.entry-40028bc6.js → underline-icon.entry-4a9105c7.js} +2 -2
  128. package/dist/{underline-icon.entry-0807a43d.cjs → underline-icon.entry-50d1e766.cjs} +1 -1
  129. package/package.json +41 -17
  130. package/dist/add-circle-icon_2.entry-8a1c55bc.cjs +0 -1
  131. package/dist/add-circle-icon_2.entry-b4bbcfee.js +0 -26
  132. package/dist/archive-icon.entry-a2492cf3.js +0 -16
  133. package/dist/archive-icon.entry-e48d2356.cjs +0 -1
  134. package/dist/arrow-icon.entry-b1ecb2aa.cjs +0 -1
  135. package/dist/calendar-agenda-fill-icon_36.entry-e9b92e0e.cjs +0 -6
  136. package/dist/checkbox-component.entry-1aa5782f.cjs +0 -1
  137. package/dist/checkbox-component.entry-72a6aa72.js +0 -43
  138. package/dist/document-refresh-icon.entry-e500b4e3.js +0 -16
  139. package/dist/google-logo-icon_6.entry-fa76ffe3.cjs +0 -2
  140. package/dist/inbox-icon.entry-9a4628f2.cjs +0 -1
  141. package/dist/inbox-icon.entry-aa78ba8c.js +0 -16
  142. package/dist/index-1e75512f.cjs +0 -57
  143. package/dist/index-e8380973.js +0 -18492
  144. package/dist/index.es-fc8588de-034ead51.cjs +0 -7
  145. package/dist/index.es-fc8588de-c943eef6.js +0 -2908
  146. package/dist/italic-icon.entry-0e85d0d9.js +0 -16
  147. package/dist/multi-select-dropdown_2.entry-3eecf18a.js +0 -193
  148. package/dist/multi-select-dropdown_2.entry-e37c501d.cjs +0 -1
  149. package/dist/nylas-booked-event-card_12.entry-fddc9ab8.cjs +0 -1
  150. package/dist/nylas-event-calendar_3.entry-e6669bbf.cjs +0 -11
  151. package/dist/nylas-scheduler-editor.entry-5c92901a.cjs +0 -2
  152. package/dist/nylas-scheduling.entry-970240f6.cjs +0 -1
  153. package/dist/play-icon.entry-f949a80f.js +0 -16
  154. package/dist/sent-icon.entry-6c604512.cjs +0 -1
  155. package/dist/sent-icon.entry-fe12bc2f.js +0 -16
  156. package/dist/spam-icon.entry-45e5292e.cjs +0 -1
  157. package/dist/spam-icon.entry-b97c7709.js +0 -16
  158. package/dist/trash-fill-icon.entry-095caae3.cjs +0 -1
  159. package/dist/trash-fill-icon.entry-825055fd.js +0 -16
  160. package/dist/warning-icon.entry-24e37759.js +0 -16
  161. package/dist/warning-icon.entry-fce7c14f.cjs +0 -1
  162. /package/dist/{elements → lib/elements}/react-component-lib/createComponent.d.ts +0 -0
  163. /package/dist/{elements → lib/elements}/react-component-lib/createOverlayComponent.d.ts +0 -0
  164. /package/dist/{elements → lib/elements}/react-component-lib/index.d.ts +0 -0
  165. /package/dist/{elements → lib/elements}/react-component-lib/interfaces.d.ts +0 -0
  166. /package/dist/{elements → lib/elements}/react-component-lib/utils/attachProps.d.ts +0 -0
  167. /package/dist/{elements → lib/elements}/react-component-lib/utils/case.d.ts +0 -0
  168. /package/dist/{elements → lib/elements}/react-component-lib/utils/dev.d.ts +0 -0
  169. /package/dist/{elements → lib/elements}/react-component-lib/utils/index.d.ts +0 -0
@@ -1,2 +0,0 @@
1
- "use strict";var ae=Object.defineProperty;var de=(r,t,n)=>t in r?ae(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var I=(r,t,n)=>(de(r,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const index=require("./index-1e75512f.cjs"),index_esFc8588de=require("./index.es-fc8588de-034ead51.cjs"),constantsF51538ef=require("./constants-f51538ef-cd2a67c4.cjs");require("react");require("react/jsx-runtime");require("react-dom");index.dayjs.extend(index.utc);index.dayjs.extend(index.timezone);class NylasSchedulerConfigAPIConnector{constructor({nylasApiRequest:t,nylasSchedulerConfigStore:n}){this.nylasApiRequest=t,this.nylasSchedulerConfigStore=n}async currentUser(){return this.nylasApiRequest?this.nylasApiRequest.currentUser():(console.warn("Nylas API Request is not initialized"),null)}async getCalendars(){var s;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching calendars: Nylas API Request is not initialized"});const[t,n]=await this.nylasApiRequest.request({method:"GET",path:"calendars"});return n?index.dataResponse(null,{message:"Error fetching calendars: "+n.message}):index_esFc8588de.Xr(t)?index.dataResponse(null,{message:"Error fetching calendars: "+((s=t.error)==null?void 0:s.message)}):(this.nylasSchedulerConfigStore.state.calendars=t.data,index.dataResponse(t.data))}async getConfigurationById(t,n=!1){var d;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching configuration: Nylas API Request is not initialized"});if(!n){const c=this.nylasSchedulerConfigStore.state.configurations.find(l=>l.id===t);if(c)return this.nylasSchedulerConfigStore.state.selectedConfiguration=c,index.dataResponse(c)}const[s,a]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${t}`});return a?index.dataResponse(null,{message:"Error fetching configuration: "+a.message}):index_esFc8588de.Xr(s)?index.dataResponse(null,{message:"Error fetching configuration: "+((d=s.error)==null?void 0:d.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=s.data,this.nylasSchedulerConfigStore.state.configurations.find(c=>c.id===t)?this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map(c=>c.id===t?s.data:c):this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,s.data],index.dataResponse(s.data))}async getConfigurations(t){var d;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching configurations: Nylas API Request is not initialized"});const n=50,[s,a]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations?limit=${n}${t?`&page_token=${t}`:""}`});return a?index.dataResponse(null,{message:"Error fetching configurations: "+a.message}):index_esFc8588de.Xr(s)?index.dataResponse(null,{message:"Error fetching configurations: "+((d=s.error)==null?void 0:d.message)}):(this.nylasSchedulerConfigStore.state.configurations=s.data,this.nylasSchedulerConfigStore.state.listConfigurationsNextCursor=s.next_cursor||null,index.dataResponse(s.data))}async getMasterEventById(t){var h,u;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching master event: Nylas API Request is not initialized"});const n=this.nylasSchedulerConfigStore.state.selectedGroupEvent,s=(h=n==null?void 0:n.event)==null?void 0:h.calendar_id;if(!s)return console.warn("Calendar ID is not present"),index.dataResponse(null,{message:"Error fetching master event: Calendar ID is not present"});const a=new URLSearchParams;a.append("calendar_id",s);const[d,c]=await this.nylasApiRequest.request({method:"GET",path:`events/${t}?${a.toString()}`});if(c)return index.dataResponse(null,{message:"Error fetching master event: "+c.message});if(index_esFc8588de.Xr(d))return index.dataResponse(null,{message:"Error fetching master event: "+((u=d.error)==null?void 0:u.message)});const l=this.nylasSchedulerConfigStore.state.masterGroupEvents;return l[t]?this.nylasSchedulerConfigStore.state.masterGroupEvents[t]=d.data:this.nylasSchedulerConfigStore.state.masterGroupEvents={...l,[t]:d.data},index.dataResponse(d.data)}async createConfiguration(t){var a;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error creating configuration: Nylas API Request is not initialized"});const[n,s]=await this.nylasApiRequest.request({method:"POST",path:"scheduling/configurations",body:t});return s?index.dataResponse(null,{message:"Error creating configuration: "+s.message}):index_esFc8588de.Xr(n)?index.dataResponse(null,{message:"Error creating configuration: "+((a=n.error)==null?void 0:a.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data,this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data],index.dataResponse(n.data))}async updateConfiguration(t){var a;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error updating configuration: Nylas API Request is not initialized"});const[n,s]=await this.nylasApiRequest.request({method:"PUT",path:`scheduling/configurations/${t.id}`,body:t});return s?index.dataResponse(null,{message:"Error updating configuration: "+s.message}):index_esFc8588de.Xr(n)?index.dataResponse(null,{message:"Error updating configuration: "+((a=n.error)==null?void 0:a.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data,this.nylasSchedulerConfigStore.state.configurations.find(d=>d.id===t.id)?this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map(d=>d.id===t.id?n.data:d):this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data],index.dataResponse(n.data))}async deleteConfiguration(t){var a,d;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error deleting configuration: Nylas API Request is not initialized"});const[n,s]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${t}`});return s?index.dataResponse(null,{message:"Error deleting configuration: "+s.message}):index_esFc8588de.Xr(n)?index.dataResponse(null,{message:"Error deleting configuration: "+((a=n.error)==null?void 0:a.message)}):(this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.filter(c=>c.id!==t),((d=this.nylasSchedulerConfigStore.state.selectedConfiguration)==null?void 0:d.id)===t&&this.nylasSchedulerConfigStore.resetSelectedConfiguration(),index.dataResponse(n.data))}async createGroupEvent(t,n){var d;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error creating group event: Nylas API Request is not initialized"});const[s,a]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${n}/group-events`,body:t});return a?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error creating group event: "+a.message})):index_esFc8588de.Xr(s)?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error creating group event: "+((d=s.error)==null?void 0:d.message)})):(this.nylasSchedulerConfigStore.state.selectedGroupEvent=s.data,await this.getGroupEvents(n),this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(s.data))}async getGroupEvents(t){var l,h,u;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching group events: Nylas API Request is not initialized"});const n=new URLSearchParams;n.append("show_all","true");const s=this.nylasSchedulerConfigStore.state.calendarViewDateRange;if(s)n.append("start_time",s.start_time),n.append("end_time",s.end_time);else{const{startTime:g,endTime:f}=index.getCalendarRange(new Date().toISOString(),"week");n.append("start_time",g.toString()),n.append("end_time",f.toString())}const a=(h=(l=this.nylasSchedulerConfigStore.state.selectedConfiguration)==null?void 0:l.group_booking)==null?void 0:h.calendar_id;a&&n.append("calendar_id",a);const[d,c]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${t}/group-events?${n.toString()}`});return c?index.dataResponse(null,{message:"Error fetching group events: "+c.message}):index_esFc8588de.Xr(d)?index.dataResponse(null,{message:"Error fetching group events: "+((u=d.error)==null?void 0:u.message)}):(this.nylasSchedulerConfigStore.state.groupEvents=d.data,index.dataResponse(d.data))}async updateGroupEventById(t,n){var c;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error updating group event: Nylas API Request is not initialized"});const s=t.id;delete t.id;const[a,d]=await this.nylasApiRequest.request({method:"PATCH",path:`scheduling/configurations/${n}/group-events/${s}`,body:t});return d?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error updating group event: "+d.message})):index_esFc8588de.Xr(a)?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error updating group event: "+((c=a.error)==null?void 0:c.message)})):(this.nylasSchedulerConfigStore.state.selectedGroupEvent=a.data,await this.getGroupEvents(n),this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(a.data))}async updateGroupEvent(t,n,s){var f,y,p,m,S,_,v,R,T,O,P,N,k,A;this.nylasSchedulerConfigStore.state.isLoading=!0;const a=this.nylasSchedulerConfigStore.state.selectedGroupEvent,d=(f=a==null?void 0:a.event)==null?void 0:f.master_event_id,c=(y=a==null?void 0:a.event)==null?void 0:y.id,l=(m=(p=a==null?void 0:a.event)==null?void 0:p.when)==null?void 0:m.start_time,h=(_=(S=a==null?void 0:a.group_event_info)==null?void 0:S.rrule)==null?void 0:_[0],u=h?h.split(";").filter(x=>!x.startsWith("UNTIL")).join(";"):"",g=l?index.dayjs(l*1e3).subtract(1,"minute").format("YYYYMMDDTHHmmss[Z]"):"";if(n==="this")return this.updateGroupEventById({...t,id:c,recurrence:d?void 0:t.recurrence},s);if(n==="future"&&d){const x=await this.createGroupEvent(t,s),b={location:(v=a==null?void 0:a.event)==null?void 0:v.location,conferencing:(R=a==null?void 0:a.event)==null?void 0:R.conferencing,title:(T=a==null?void 0:a.event)==null?void 0:T.title,description:(O=a==null?void 0:a.event)==null?void 0:O.description,capacity:(P=a==null?void 0:a.group_event_info)==null?void 0:P.capacity,calendar_id:(N=a==null?void 0:a.event)==null?void 0:N.calendar_id,recurrence:u?[u+";UNTIL="+g]:[`RRULE:FREQ=DAILY;UNTIL=${g}`]};return await this.updateGroupEventById({...b,id:d},s),[b,x]}else if(n==="all"){const x=t==null?void 0:t.when,b=(k=a==null?void 0:a.event)==null?void 0:k.when,U=(A=this.nylasSchedulerConfigStore.state.masterGroupEvents)==null?void 0:A[d];let w=U==null?void 0:U.when;return(x==null?void 0:x.start_time)!==(b==null?void 0:b.start_time)&&(w={...w,start_time:(x==null?void 0:x.start_time)||(w==null?void 0:w.start_time)}),(x==null?void 0:x.end_time)!==(b==null?void 0:b.end_time)&&(w={...w,end_time:(x==null?void 0:x.end_time)||(w==null?void 0:w.end_time)}),(x==null?void 0:x.start_timezone)!==(b==null?void 0:b.start_timezone)&&(w={...w,start_timezone:(x==null?void 0:x.start_timezone)||(w==null?void 0:w.start_timezone)}),(x==null?void 0:x.end_timezone)!==(b==null?void 0:b.end_timezone)&&(w={...w,end_timezone:(x==null?void 0:x.end_timezone)||(w==null?void 0:w.end_timezone)}),this.updateGroupEventById({...t,when:w,id:d},s)}throw this.nylasSchedulerConfigStore.state.isLoading=!1,new Error("Invalid option")}async deleteGroupEvent(t,n,s){var y,p,m,S,_,v,R,T,O,P,N,k;this.nylasSchedulerConfigStore.state.isLoading=!0;const a=this.nylasSchedulerConfigStore.state.selectedGroupEvent,d=(y=a==null?void 0:a.event)==null?void 0:y.master_event_id,c=(p=a==null?void 0:a.event)==null?void 0:p.id,l=(S=(m=a==null?void 0:a.event)==null?void 0:m.when)==null?void 0:S.start_time,h=(v=(_=a==null?void 0:a.group_event_info)==null?void 0:_.rrule)==null?void 0:v[0],u=h?h.split(";").filter(A=>!A.startsWith("UNTIL")).join(";"):"",g=l?index.dayjs(l*1e3).format("YYYYMMDDTHHmmss[Z]"):"",f={location:(R=a==null?void 0:a.event)==null?void 0:R.location,conferencing:(T=a==null?void 0:a.event)==null?void 0:T.conferencing,title:(O=a==null?void 0:a.event)==null?void 0:O.title,description:(P=a==null?void 0:a.event)==null?void 0:P.description,capacity:(N=a==null?void 0:a.group_event_info)==null?void 0:N.capacity,calendar_id:(k=a==null?void 0:a.event)==null?void 0:k.calendar_id,recurrence:u?[u+";UNTIL="+g]:[`RRULE:UNTIL=${g}`]};if(n==="this"&&c)return this.deleteGroupEventById(c,s);if(n==="future"&&d&&c)return await this.deleteGroupEventById(c,s),await this.updateGroupEventById({...f,id:d},s);if(n==="all"&&d)return this.deleteGroupEventById(d,s);throw this.nylasSchedulerConfigStore.state.isLoading=!1,new Error("Invalid option")}async deleteGroupEventById(t,n){var l,h,u;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error deleting group event: Nylas API Request is not initialized"});const s=new URLSearchParams,a=(h=(l=this.nylasSchedulerConfigStore.state.selectedConfiguration)==null?void 0:l.group_booking)==null?void 0:h.calendar_id;a&&s.append("calendar_id",a);const[d,c]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${n}/group-events/${t}?calendar_id=${a}`});return c?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error deleting group event: "+c.message})):index_esFc8588de.Xr(d)?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error deleting group event: "+((u=d.error)==null?void 0:u.message)})):(await this.getGroupEvents(n),this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(d.data))}async importGroupEvent(t,n){var l,h,u,g,f;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error importing group event: Nylas API Request is not initialized"});const s=new URLSearchParams,a=(h=(l=this.nylasSchedulerConfigStore.state.selectedConfiguration)==null?void 0:l.group_booking)==null?void 0:h.calendar_id;a&&s.append("calendar_id",a);const[d,c]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${n}/import-group-events?${s.toString()}`,body:t});return c?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error importing group event: "+c.message})):index_esFc8588de.Xr(d)?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error importing group event: "+((u=d.error)==null?void 0:u.message)})):(((f=(g=d.data)==null?void 0:g.imported_events)==null?void 0:f.length)>0&&await this.getGroupEvents(n),this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(d.data))}}class NylasSchedulerConfigConnector{constructor({nylasApiRequest:t,nylasSchedulerConfigStore:n}){this.nylasApiRequest=t,this.nylasSchedulerConfigStore=n}init(){index.debug("NylasSchedulerConfigConnector init")}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get schedulerConfig(){return this._schedulerConfigConnector?this._schedulerConfigConnector:(this._schedulerConfigConnector=new NylasSchedulerConfigAPIConnector({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore}),this._schedulerConfigConnector)}resetStores(){index.debug("NylasSchedulerConfigConnector resetStores"),this.nylasSchedulerConfigStore.reset()}async logout(){index.debug("NylasSchedulerConfigConnector logout"),this.resetStores()}}function CreateNylasSchedulerConfigStore(r={}){const t={selectedConfiguration:{},configurations:[],groupEvents:[],listConfigurationsNextCursor:null,calendars:[],currentUser:null,action:null,additionalParticipants:[],requiresSlug:!1,masterGroupEvents:{},isLoading:!1,...r},n=index.createStore(t);function s(){n.set("selectedConfiguration",{...r.selectedConfiguration})}return n.onChange("action",async a=>{a||s()}),{...n,resetSelectedConfiguration:s}}class LocalStorage{get(t){return new Promise(n=>{const s=window.localStorage.getItem(t);n(s?JSON.parse(s):null)})}async remove(t){return window.localStorage.removeItem(t),new Promise(n=>{n(null)})}set(t,n){return window.localStorage.setItem(t,JSON.stringify(n)),new Promise(s=>{s(null)})}}const PKCE_KEY="pkce",GRANT_KEY="grant",USER_KEY="user";class Storage{constructor(t){I(this,"Storage",new LocalStorage);if(t){this.Storage=t;return}}setPKCE(t){const n=index.Buffer.from(t);this.Storage.set(PKCE_KEY,n.toString("base64"))}async getPKCE(){try{const t=await this.Storage.get(PKCE_KEY);if(t)return index.Buffer.from(t,"base64").toString("utf8")}catch{return null}return null}removePKCE(){this.Storage.remove(PKCE_KEY)}setGrant(t,n=!1){const{grant_id:s}=t;this.Storage.set(`${GRANT_KEY}${n?"-"+s:""}`,t)}removeGrant(t,n=!1){this.Storage.remove(`${GRANT_KEY}${n?"-"+t:""}`)}async getGrant(t,n=!1){const s=await this.Storage.get(`${GRANT_KEY}${n?"-"+t:""}`);return s||null}async setUserToken(t){const n=await this.getUserTokens();if(n)if(n.find(a=>a.sub===t.sub)){const a=n.map(d=>(d.sub===t.sub&&(d=t),d));this.Storage.set(USER_KEY,a)}else{const a=[...n,t];this.Storage.set(USER_KEY,a)}else this.Storage.set(USER_KEY,[t])}async getUserToken(t=""){const n=await this.Storage.get(USER_KEY);return n?t===""?n[0]:n.find(a=>a.sub===t):null}async getUserTokens(){const t=await this.Storage.get(USER_KEY);return t||null}removeUserTokens(){this.Storage.remove(USER_KEY)}async removeUserToken(t){const n=await this.getUserTokens(),s=n==null?void 0:n.filter(a=>a.sub!==t);this.Storage.set(USER_KEY,s)}async clearSession(){const t=await this.getUserTokens();t==null||t.forEach(n=>{this.removeGrant(n.sub)}),this.removePKCE(),this.removeUserTokens()}}class IndexedDBStorage{constructor(){I(this,"databaseName","identity-db");I(this,"storeName","identity")}get(t){const n=this;return new Promise((s,a)=>{n.openDatabase().then(function(d){const c=d.transaction(n.storeName,"readwrite"),h=c.objectStore(n.storeName).get(t);h.onsuccess=()=>{s(h.result)},h.onerror=()=>{a(h.error)},c.oncomplete=()=>{d.close()}})})}async remove(t){const n=this;return new Promise((s,a)=>{const d=indexedDB.open(this.databaseName);d.onupgradeneeded=function(c){c.target.result.createObjectStore(n.storeName)},d.onerror=()=>{a(d.error)},d.onsuccess=c=>{const l=c.target.result,h=l.transaction(this.storeName,"readwrite"),g=h.objectStore(this.storeName).delete(t);g.onsuccess=()=>{s(null)},g.onerror=()=>{a(g.error)},h.oncomplete=()=>{l.close()}}})}set(t,n){return new Promise((s,a)=>{const d=indexedDB.open(this.databaseName);d.onerror=()=>{a(d.error)},d.onupgradeneeded=c=>{c.target.result.createObjectStore(this.storeName)},d.onsuccess=c=>{const l=c.target.result,h=l.transaction(this.storeName,"readwrite"),g=h.objectStore(this.storeName).put(n,t);g.onsuccess=()=>{s(n)},g.onerror=()=>{a(g.error)},h.oncomplete=()=>{l.close()}}})}openDatabase(){const t=this;return new Promise(function(n,s){const a=indexedDB.open(t.databaseName,2);a.onupgradeneeded=function(d){d.target.result.createObjectStore(t.storeName)},a.onsuccess=function(d){n(d.target.result)},a.onerror=function(d){s(d.error)}})}}var sha256={exports:{}};(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof index.process=="object"&&index.process.versions&&index.process.versions.node;NODE_JS?root=index.commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(r){return Object.prototype.toString.call(r)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return typeof r=="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});var createOutputMethod=function(r,t){return function(n){return new Sha256(t,!0).update(n)[r]()}},createMethod=function(r){var t=createOutputMethod("hex",r);NODE_JS&&(t=nodeWrap(t,r)),t.create=function(){return new Sha256(r)},t.update=function(a){return t.create().update(a)};for(var n=0;n<OUTPUT_TYPES.length;++n){var s=OUTPUT_TYPES[n];t[s]=createOutputMethod(s,r)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(r){if(typeof r=="string")return crypto.createHash(algorithm).update(r,"utf8").digest("hex");if(r==null)throw new Error(ERROR);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(r)).digest("hex"):method(r)};return nodeMethod},createHmacOutputMethod=function(r,t){return function(n,s){return new HmacSha256(n,t,!0).update(s)[r]()}},createHmacMethod=function(r){var t=createHmacOutputMethod("hex",r);t.create=function(a){return new HmacSha256(a,r)},t.update=function(a,d){return t.create(a).update(d)};for(var n=0;n<OUTPUT_TYPES.length;++n){var s=OUTPUT_TYPES[n];t[s]=createHmacOutputMethod(s,r)}return t};function Sha256(r,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=r}Sha256.prototype.update=function(r){if(!this.finalized){var t,n=typeof r;if(n!=="string"){if(n==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);t=!0}for(var s,a=0,d,c=r.length,l=this.blocks;a<c;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),t)for(d=this.start;a<c&&d<64;++a)l[d>>2]|=r[a]<<SHIFT[d++&3];else for(d=this.start;a<c&&d<64;++a)s=r.charCodeAt(a),s<128?l[d>>2]|=s<<SHIFT[d++&3]:s<2048?(l[d>>2]|=(192|s>>6)<<SHIFT[d++&3],l[d>>2]|=(128|s&63)<<SHIFT[d++&3]):s<55296||s>=57344?(l[d>>2]|=(224|s>>12)<<SHIFT[d++&3],l[d>>2]|=(128|s>>6&63)<<SHIFT[d++&3],l[d>>2]|=(128|s&63)<<SHIFT[d++&3]):(s=65536+((s&1023)<<10|r.charCodeAt(++a)&1023),l[d>>2]|=(240|s>>18)<<SHIFT[d++&3],l[d>>2]|=(128|s>>12&63)<<SHIFT[d++&3],l[d>>2]|=(128|s>>6&63)<<SHIFT[d++&3],l[d>>2]|=(128|s&63)<<SHIFT[d++&3]);this.lastByteIndex=d,this.bytes+=d-this.start,d>=64?(this.block=l[16],this.start=d-64,this.hash(),this.hashed=!0):this.start=d}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var r=this.blocks,t=this.lastByteIndex;r[16]=this.block,r[t>>2]|=EXTRA[t&3],this.block=r[16],t>=56&&(this.hashed||this.hash(),r[0]=this.block,r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),r[14]=this.hBytes<<3|this.bytes>>>29,r[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var r=this.h0,t=this.h1,n=this.h2,s=this.h3,a=this.h4,d=this.h5,c=this.h6,l=this.h7,h=this.blocks,u,g,f,y,p,m,S,_,v,R,T;for(u=16;u<64;++u)p=h[u-15],g=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,p=h[u-2],f=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,h[u]=h[u-16]+g+h[u-7]+f<<0;for(T=t&n,u=0;u<64;u+=4)this.first?(this.is224?(_=300032,p=h[0]-1413257819,l=p-150054599<<0,s=p+24177077<<0):(_=704751109,p=h[0]-210244248,l=p-1521486534<<0,s=p+143694565<<0),this.first=!1):(g=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),f=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),_=r&t,y=_^r&n^T,S=a&d^~a&c,p=l+f+S+K[u]+h[u],m=g+y,l=s+p<<0,s=p+m<<0),g=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),f=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),v=s&r,y=v^s&t^_,S=l&a^~l&d,p=c+f+S+K[u+1]+h[u+1],m=g+y,c=n+p<<0,n=p+m<<0,g=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),f=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),R=n&s,y=R^n&r^v,S=c&l^~c&a,p=d+f+S+K[u+2]+h[u+2],m=g+y,d=t+p<<0,t=p+m<<0,g=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),f=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),T=t&n,y=T^t&s^R,S=d&c^~d&l,p=a+f+S+K[u+3]+h[u+3],m=g+y,a=r+p<<0,r=p+m<<0;this.h0=this.h0+r<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+s<<0,this.h4=this.h4+a<<0,this.h5=this.h5+d<<0,this.h6=this.h6+c<<0,this.h7=this.h7+l<<0},Sha256.prototype.hex=function(){this.finalize();var r=this.h0,t=this.h1,n=this.h2,s=this.h3,a=this.h4,d=this.h5,c=this.h6,l=this.h7,h=HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[d>>28&15]+HEX_CHARS[d>>24&15]+HEX_CHARS[d>>20&15]+HEX_CHARS[d>>16&15]+HEX_CHARS[d>>12&15]+HEX_CHARS[d>>8&15]+HEX_CHARS[d>>4&15]+HEX_CHARS[d&15]+HEX_CHARS[c>>28&15]+HEX_CHARS[c>>24&15]+HEX_CHARS[c>>20&15]+HEX_CHARS[c>>16&15]+HEX_CHARS[c>>12&15]+HEX_CHARS[c>>8&15]+HEX_CHARS[c>>4&15]+HEX_CHARS[c&15];return this.is224||(h+=HEX_CHARS[l>>28&15]+HEX_CHARS[l>>24&15]+HEX_CHARS[l>>20&15]+HEX_CHARS[l>>16&15]+HEX_CHARS[l>>12&15]+HEX_CHARS[l>>8&15]+HEX_CHARS[l>>4&15]+HEX_CHARS[l&15]),h},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var r=this.h0,t=this.h1,n=this.h2,s=this.h3,a=this.h4,d=this.h5,c=this.h6,l=this.h7,h=[r>>24&255,r>>16&255,r>>8&255,r&255,t>>24&255,t>>16&255,t>>8&255,t&255,n>>24&255,n>>16&255,n>>8&255,n&255,s>>24&255,s>>16&255,s>>8&255,s&255,a>>24&255,a>>16&255,a>>8&255,a&255,d>>24&255,d>>16&255,d>>8&255,d&255,c>>24&255,c>>16&255,c>>8&255,c&255];return this.is224||h.push(l>>24&255,l>>16&255,l>>8&255,l&255),h},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var r=new ArrayBuffer(this.is224?28:32),t=new DataView(r);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),r};function HmacSha256(r,t,n){var s,a=typeof r;if(a==="string"){var d=[],c=r.length,l=0,h;for(s=0;s<c;++s)h=r.charCodeAt(s),h<128?d[l++]=h:h<2048?(d[l++]=192|h>>6,d[l++]=128|h&63):h<55296||h>=57344?(d[l++]=224|h>>12,d[l++]=128|h>>6&63,d[l++]=128|h&63):(h=65536+((h&1023)<<10|r.charCodeAt(++s)&1023),d[l++]=240|h>>18,d[l++]=128|h>>12&63,d[l++]=128|h>>6&63,d[l++]=128|h&63);r=d}else if(a==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);r.length>64&&(r=new Sha256(t,!0).update(r).array());var u=[],g=[];for(s=0;s<64;++s){var f=r[s]||0;u[s]=92^f,g[s]=54^f}Sha256.call(this,t,n),this.update(g),this.oKeyPad=u,this.inner=!0,this.sharedMemory=n}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var r=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(r),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256);var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(r){return typeof r=="string"&&REGEX.test(r)}var byteToHex=[];for(var i=0;i<256;++i)byteToHex.push((i+256).toString(16).substr(1));function stringify(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(byteToHex[r[t+0]]+byteToHex[r[t+1]]+byteToHex[r[t+2]]+byteToHex[r[t+3]]+"-"+byteToHex[r[t+4]]+byteToHex[r[t+5]]+"-"+byteToHex[r[t+6]]+byteToHex[r[t+7]]+"-"+byteToHex[r[t+8]]+byteToHex[r[t+9]]+"-"+byteToHex[r[t+10]]+byteToHex[r[t+11]]+byteToHex[r[t+12]]+byteToHex[r[t+13]]+byteToHex[r[t+14]]+byteToHex[r[t+15]]).toLowerCase();if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}function v4(r,t,n){r=r||{};var s=r.random||(r.rng||rng)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t){n=n||0;for(var a=0;a<16;++a)t[n+a]=s[a];return t}return stringify(s)}async function getBytes(r,t){const n=r.getReader();let s;for(;!(s=await n.read()).done;)t(s.value)}function getLines(r){let t,n,s,a=!1;return function(c){t===void 0?(t=c,n=0,s=-1):t=concat(t,c);const l=t.length;let h=0;for(;n<l;){a&&(t[n]===10&&(h=++n),a=!1);let u=-1;for(;n<l&&u===-1;++n)switch(t[n]){case 58:s===-1&&(s=n-h);break;case 13:a=!0;case 10:u=n;break}if(u===-1)break;r(t.subarray(h,u),s),h=n,s=-1}h===l?t=void 0:h!==0&&(t=t.subarray(h),n-=h)}}function getMessages(r,t,n){let s=newMessage();const a=new TextDecoder;return function(c,l){if(c.length===0)n==null||n(s),s=newMessage();else if(l>0){const h=a.decode(c.subarray(0,l)),u=l+(c[l+1]===32?2:1),g=a.decode(c.subarray(u));switch(h){case"data":s.data=s.data?s.data+`
2
- `+g:g;break;case"event":s.event=g;break;case"id":r(s.id=g);break;case"retry":const f=parseInt(g,10);isNaN(f)||t(s.retry=f);break}}}}function concat(r,t){const n=new Uint8Array(r.length+t.length);return n.set(r),n.set(t,r.length),n}function newMessage(){return{data:"",event:"",id:"",retry:void 0}}var __rest=function(r,t){var n={};for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&t.indexOf(s)<0&&(n[s]=r[s]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(r);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(r,s[a])&&(n[s[a]]=r[s[a]]);return n};const EventStreamContentType="text/event-stream",DefaultRetryInterval=1e3,LastEventId="last-event-id";function fetchEventSource(r,t){var{signal:n,headers:s,onopen:a,onmessage:d,onclose:c,onerror:l,openWhenHidden:h,fetch:u}=t,g=__rest(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((f,y)=>{const p=Object.assign({},s);p.accept||(p.accept=EventStreamContentType);let m;function S(){m.abort(),document.hidden||P()}h||document.addEventListener("visibilitychange",S);let _=DefaultRetryInterval,v=0;function R(){document.removeEventListener("visibilitychange",S),window.clearTimeout(v),m.abort()}n==null||n.addEventListener("abort",()=>{R(),f()});const T=u??window.fetch,O=a??defaultOnOpen;async function P(){var N;m=new AbortController;try{const k=await T(r,Object.assign(Object.assign({},g),{headers:p,signal:m.signal}));await O(k),await getBytes(k.body,getLines(getMessages(A=>{A?p[LastEventId]=A:delete p[LastEventId]},A=>{_=A},d))),c==null||c(),R(),f()}catch(k){if(!m.signal.aborted)try{const A=(N=l==null?void 0:l(k))!==null&&N!==void 0?N:_;window.clearTimeout(v),v=window.setTimeout(P,A)}catch(A){R(),y(A)}}}P()})}function defaultOnOpen(r){const t=r.headers.get("content-type");if(!(t!=null&&t.startsWith(EventStreamContentType)))throw new Error(`Expected content-type to be ${EventStreamContentType}, Actual: ${t}`)}function Base64EncodeUrl(r){return r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function getTimestamp(){return Math.floor(Date.now()/1e3)}function e(r){this.message=r}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r$1=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,s,a=0,d=0,c="";s=t.charAt(d++);~s&&(n=a%4?64*n+s:s,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);return c};function t$1(r){var t=r.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(r$1(n).replace(/(.)/g,function(s,a){var d=a.charCodeAt(0).toString(16).toUpperCase();return d.length<2&&(d="0"+d),"%"+d}))}(t)}catch{return r$1(t)}}function n$1(r){this.message=r}function o(r,t){if(typeof r!="string")throw new n$1("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(t$1(r.split(".")[n]))}catch(s){throw new n$1("Invalid token specified: "+s.message)}}n$1.prototype=new Error,n$1.prototype.name="InvalidTokenError";class NylasSessions{constructor(t){I(this,"clientId");I(this,"redirectUri");I(this,"accessType","online");I(this,"domain","http://api.nylas.com");I(this,"versioned",!1);I(this,"Storage");I(this,"hosted",!1);I(this,"multiAccount",!1);I(this,"loginId","");if(this.clientId=t.clientId,this.redirectUri=t.redirectUri,t.domain&&(this.domain=t.domain,this.domain.substring(this.domain.length-3).includes("/v")&&(this.versioned=!0)),t.multiAccount&&(this.multiAccount=t.multiAccount),t.sw){const n=new IndexedDBStorage;this.Storage=new Storage(n)}else this.Storage=new Storage;t.accessType&&(this.accessType=t.accessType),t.loginId&&(this.loginId=t.loginId),t.hosted&&(this.hosted=t.hosted),t.disableInitCodeExchange!==!0&&this.codeExchange(null)}async validateAccessToken(t=""){const n=await this.Storage.getGrant(t,this.multiAccount);if(!n)return!1;const{access_token:s}=n;try{return!!(await(await fetch(`${this.domain}/connect/tokeninfo?access_token=${s}`,{method:"GET"})).json()).data}catch{return!1}}async validateIDToken(t=""){const n=await this.Storage.getGrant(t,this.multiAccount);if(!n)return!1;const{id_token:s}=n;try{const a=await fetch(`${this.domain}/connect/tokeninfo?id_token=${s}`,{method:"GET"});return!(a.status!==200||!(await a.json()).data)}catch{return!1}}getDomain(){return this.domain}async auth(t){this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin))&&await this.hostedSetCodeChallenge();const n=await this.generateAuthURL(t);if(t.popup){this.popUp(n);return}return n}async generateAuthURL(t){const n=await this.getCodeChallege();let s=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;return n&&(s+=`&code_challenge=${n}&code_challenge_method=S256&options=rotate_refresh_token`),t.provider&&(s+=`&provider=${t.provider}`),t.loginHint&&(s+=`&login_hint=${t.loginHint}`,t.includeGrantScopes&&(s+=`&include_grant_scopes=${t.includeGrantScopes}`)),t.scope&&(s+=`&scope=${t.scope.join(" ")}`),t.prompt&&(s+=`&prompt=${t.prompt}`),t.metadata&&(s+=`&metadata=${t.metadata}`),(t.state||this.loginId)&&(s+=`&state=${this.loginId?this.loginId:t.state}`),s}async generateReauthURL(t,n){if(!t)throw new Error("Grant ID is required");const s=await this.Storage.getUserToken(t),a=await this.getCodeChallege();let d=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;return a&&(d+=`&code_challenge=${a}&code_challenge_method=S256&options=rotate_refresh_token`),s!=null&&s.provider&&(d+=`&provider=${s.provider}`),s!=null&&s.email&&(d+=`&login_hint=${s.email}`),n&&(d+=`&scope=${n.join(" ")}`),d}async generateCodeChallenge(){if(await this.Storage.getPKCE())return;const n=v4();this.Storage.setPKCE(n)}async hostedSetCodeChallenge(){if(!this.hosted)throw console.error("Method only used with hosted flag enabled");const n=new URLSearchParams(window.location.search).get("code_challenge");if(!n){if(await this.Storage.getPKCE())return;console.warn("Code challenge is recomended");return}this.Storage.setPKCE(n)}async getCodeChallege(){if(this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin))){const s=new URLSearchParams(window.location.search).get("code_challenge");return s||(console.warn("Code challenge is recomended"),"")}const t=await this.Storage.getPKCE();if(t){const n=sha256.exports.sha256(t);let s=index.Buffer.from(n).toString("base64");return s=Base64EncodeUrl(s),s}return""}async isLoggedIn(){if(this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin)))return!1;const t=await this.Storage.getUserTokens();return t&&t.length>0?(this.multiAccount&&await this.generateCodeChallenge(),!0):(await this.generateCodeChallenge(),!1)}isMultiAccount(){return this.multiAccount}async logout(){const t=await this.getProfile();await this.Storage.clearSession();const n={detail:t};window.dispatchEvent(new CustomEvent("onLogoutSuccess",n))}async getProfile(t=""){let n;return t?n=await this.Storage.getUserToken(t):n=await this.Storage.getUserToken(),n||null}async getProfiles(){const t=await this.Storage.getUserTokens();return t||null}async removeProfile(t){return await this.Storage.removeUserToken(t),await this.Storage.removeGrant(t),null}async authIMAP(t){const n=await this.getCodeChallege(),s={imap_username:t.imap_username,imap_password:t.imap_password,imap_host:t.imap_host,imap_port:t.imap_port,type:t.type,smtp_host:t.smtp_host,smtp_port:t.smtp_port,provider:t.provider,redirect_uri:this.redirectUri,state:t.state,public_application_id:this.clientId,access_type:this.accessType};return this.loginId&&(s.id=this.loginId),t.smtp_username&&t.smtp_password&&(s.smtp_username=t.smtp_username,s.smtp_password=t.smtp_password),n!=""&&(s.code_challenge=n,s.code_challenge_method="S256"),await(await fetch(`${this.domain}/connect/login/imap`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(s)})).json()}async authEWS(t){const n=await this.getCodeChallege(),s={...t,provider:"ews",redirect_uri:this.redirectUri,public_application_id:this.clientId,access_type:this.accessType};return this.loginId&&(s.id=this.loginId),n!=""&&(s.code_challenge=n,s.code_challenge_method="S256"),await(await fetch(`${this.domain}/connect/login/ews`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(s)})).json()}async detectEmail(t){return await(await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/providers/detect?client_id=${this.clientId}&email=${t}`,{method:"POST",headers:new Headers({"content-type":"application/json"})})).json()}async applicationInfo(){return(await(await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/applications?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})})).json()).data}async getAvailableProviders(){const t=await fetch(`${this.domain}/connect/providers/find?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})});return t?(await t.json()).data:null}onLoginSuccess(t){window.addEventListener("onLoginSuccess",n=>t(n))}onLogoutSuccess(t){window.addEventListener("onLogoutSuccess",n=>t(n))}onLoginFail(t){window.addEventListener("onLoginFail",n=>t(n))}onTokenRefreshSuccess(t){window.addEventListener("onTokenRefreshSuccess",n=>t(n))}onTokenRefreshFail(t){window.addEventListener("onTokenRefreshFail",n=>t(n))}onSessionExpired(t){window.addEventListener("onSessionExpired",n=>t(n))}async codeExchange(t){let n=new URLSearchParams(window.location.search);t&&(n=new URLSearchParams(t));const s=n.get("code"),a=n.get("state"),d=n.get("error"),c=n.get("error_description"),l=n.get("error_code");if(d&&c&&l){const u={detail:{error:d,error_description:c,error_code:l}};return window.dispatchEvent(new CustomEvent("onLoginFail",u)),window.history.pushState({},document.title,window.location.pathname),!1}if(!s)return console.warn("No code found"),!1;if(window.opener&&window.name==="uas-popup")return console.warn("Popup window detected"),!1;const h=await this.Storage.getPKCE();if(!h)return console.warn("No code verifier found"),!1;try{const u={client_id:this.clientId,redirect_uri:this.redirectUri,code:s,grant_type:"authorization_code",code_verifier:h},f=await(await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(u)})).json();if(f){if(f.error){const p={detail:f};return window.dispatchEvent(new CustomEvent("onLoginFail",p)),!0}const y=await this.handleCodeExchangeResponse(f);if(y.valid){a&&(y.data.state=a);const p={detail:y.data};window.dispatchEvent(new CustomEvent("onLoginSuccess",p)),window.history.pushState({},document.title,window.location.pathname)}else{const p={detail:y.data};return window.dispatchEvent(new CustomEvent("onLoginFail",p)),!0}}return this.Storage.removePKCE(),!0}catch(u){const g={detail:u};return window.dispatchEvent(new CustomEvent("onLoginFail",g)),window.history.pushState({},document.title,window.location.pathname),!1}}async tokenExchange(t=""){const n=await this.Storage.getGrant(t,this.multiAccount);if(!n)return!1;const s=n.refresh_token;try{const a={client_id:this.clientId,redirect_uri:this.redirectUri,refresh_token:s,grant_type:"refresh_token"},c=await(await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(a)})).json();if(c){if(c.error){const g={detail:c};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",g)),!0}const l=getTimestamp();if(c.expires_in=l+c.expires_in,this.Storage.setGrant(c,this.multiAccount),!await this.validateIDToken(t)){const g={detail:c};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",g)),!0}const u={detail:c};return window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess",u)),!0}this.Storage.removePKCE()}catch(a){const d={detail:a};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",d)),!1}}async handleCodeExchangeResponse(t){if(t.error)return{data:t,valid:!1};const s=getTimestamp();t.expires_in=s+t.expires_in,this.Storage.setGrant(t,this.multiAccount);const a=o(t.id_token);return a.status="authenticated",this.Storage.setUserToken(a),await this.validateIDToken(a.sub)?{data:t,valid:!0}:{data:t,valid:!1}}async popUp(t){const a=window.screenX+(window.outerWidth-500)/2,d=window.screenY+(window.outerHeight-600)/2.5,c="uas-popup",l=t,h=window.open(l,c,`width=500,height=600,left=${a},top=${d}`);if(!h)return;const u=setInterval(async()=>{if(h.closed){const g={detail:{error_description:"OAuth provider window closed"}};window.dispatchEvent(new CustomEvent("onLoginFail",g)),u&&clearInterval(u);return}try{const g=h.location.href.split("?");if(!g[0])return;const f=h.location.search;if(h.history.pushState({},document.title,window.location.pathname),g[0]===this.redirectUri&&g.length>1){const y=await this.codeExchange(f);h.close(),y&&location.reload(),u&&clearInterval(u);return}}catch{return}},1e3)}async getAccessToken(t=""){const n=getTimestamp(),s=await this.Storage.getGrant(t,this.multiAccount);if(!s)return null;const{access_token:a,expires_in:d}=s,c=a;return c&&d&&d>getTimestamp()&&d-n>30?c:(await this.tokenExchange(t),(await this.Storage.getGrant(t,this.multiAccount)).access_token)}async sse(t,n){const s=n.headers||{},a=s["Grant-ID"];let d="";if(this.multiAccount){if(!a)throw this.logout(),new Error("Grant ID is required for multi account calls");d=await this.getAccessToken(a)}else d=await this.getAccessToken();return delete s["Grant-ID"],s.Authorization=`Bearer ${d}`,s["content-type"]||(s["content-type"]="application/json"),fetchEventSource(`${this.domain}/${t}`,{...n,headers:s})}async fetch(t,n,s=!0,a){let d="",c=1;if(this.multiAccount){if(!n.grant_id)throw this.logout(),new Error("Grant ID is required for multi account calls");const h=await this.getProfiles();c=h?h.length:1,d=await this.getAccessToken(n.grant_id)}else d=await this.getAccessToken();if(!d)throw new Error("Access token not found");let l=n.headers;Headers.prototype.isPrototypeOf(l)?(l.append("Authorization",`Bearer ${d}`),l.has("content-type")||l.append("content-type","application/json")):l=new Headers({Authorization:`Bearer ${d}`,"content-type":"application/json"});try{n!=null&&n.body&&(n.body=JSON.stringify(n==null?void 0:n.body));const h=await fetch(`${a||this.domain}/${t}`,{...n,headers:l});if(!s)return h;const u=await(h==null?void 0:h.json());if(!await this.isAuthenticatedResponse(h.status,u)){if(c>1){const f=await this.getProfile(n.grant_id);if(f){f.status="unauthorized",await this.Storage.setUserToken(f);const y={detail:{user:f}};window.dispatchEvent(new CustomEvent("onSessionExpired",y))}}else{const y={detail:{user:await this.Storage.getUserToken()}};window.dispatchEvent(new CustomEvent("onSessionExpired",y))}this.logout();return}return u}catch(h){throw h}}async fetchRequest(t,n,s,a=!0,d,c){const l=await this.isLoggedIn(),h=new URL(t,d??this.domain),u=new Headers;if(u.append("Accept","application/json"),u.append("Content-Type","application/json"),u.append("User-Agent","nylas-identity"),l){const y=await this.getAccessToken();u.append("Authorization",`Bearer ${y}`)}const g=await fetch(h.toString(),{method:n||"GET",headers:u,mode:"cors",referrer:location.origin,body:s?JSON.stringify(s):void 0,...c||{}});return a?await g.json():g.body}async isAuthenticatedResponse(t,n){var s;return!(t==401&&((s=n==null?void 0:n.error)==null?void 0:s.type)=="token.unauthorized_access")}addAPIKey(t,n,s){this.Storage.setUserToken({aud:"https://api-staging.us.nylas.com/",exp:2e9,email_verified:!0,iat:getTimestamp(),iss:"",email:n,provider:"virtual-calendar",status:"authenticated",name:n,sub:t}),this.Storage.setGrant({grant_id:t,access_token:s,expires_in:2e9},this.multiAccount)}}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(r,t,n){this.props=r,this.context=t,this.refs=D,this.updater=n||B}E.prototype.isReactComponent={};E.prototype.setState=function(r,t){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,t,"setState")};E.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(r,t,n){this.props=r,this.context=t,this.refs=D,this.updater=n||B}var H=G.prototype=new F;H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;const LoginRequired=({authenticationUrl:r})=>index.h("div",{class:"login-required",part:"nse__login-required login-component"},index.h("div",{class:"card",part:"nse__login-required-card"},index.h("p",{part:"nse__login-required-text"},"Log into your account to use the Scheduler Editor."),index.h("button",{class:"google-button",part:"nse__login-required-google-button",onClick:async t=>{t.preventDefault();const n=await r("google");n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},index.h("span",{class:"icon"},index.h("google-logo-icon",{width:"15",height:"15"})),"Continue with Google"),index.h("button",{class:"microsoft-button",part:"nse__login-required-microsoft-button",onClick:async t=>{t.preventDefault();const n=await r("microsoft");n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},index.h("span",{class:"icon"},index.h("microsoft-logo-icon",{width:"15",height:"15"})),"Continue with Microsoft"),index.h("button",{class:"other-provider-button",part:"nse__login-required-other-provider-button",onClick:async t=>{t.preventDefault();const n=await r();n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},"View all providers ",index.h("chevron-icon",{width:"17",height:"17"})),index.h("small",{class:"disclaimer-text",part:"nse__login-required-disclaimer-text"},"* You will be redirected to authenticate your account.")));function ExpressFlow({currentUser:r,calendars:t,selectedEventType:n}){const s=(t==null?void 0:t.find(a=>a.is_primary))||(t==null?void 0:t[0]);switch(n){case constantsF51538ef.CONFIGURATION_EVENT_TYPE.one_on_one:case constantsF51538ef.CONFIGURATION_EVENT_TYPE.max_availability:case constantsF51538ef.CONFIGURATION_EVENT_TYPE.max_fairness:return index.h(index.Fragment,null,index.h("nylas-event-info",null,index.h("div",{slot:"inputs"},index.h("nylas-event-title",null),index.h("nylas-event-duration",null),index.h("nylas-event-location",{userProvider:r.provider}))),index.h("nylas-booking-calendar-picker",{exportparts:"nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content",expressFlow:!0,calendars:t,currentUser:r,defaultBookingCalendar:s==null?void 0:s.id}),index.h("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}));case constantsF51538ef.CONFIGURATION_EVENT_TYPE.collective:return index.h(index.Fragment,null,index.h("nylas-event-info",null,index.h("div",{slot:"inputs"},index.h("nylas-event-title",null),index.h("nylas-event-duration",null),index.h("nylas-event-location",{userProvider:r.provider}))),index.h("nylas-booking-calendar-picker",{exportparts:"nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content",expressFlow:!0,calendars:t,currentUser:r,defaultBookingCalendar:s==null?void 0:s.id}),index.h("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}),index.h("nylas-additional-participants",{name:"participants",eventParticipants:[{name:(r==null?void 0:r.name)||(r==null?void 0:r.email),email:(r==null?void 0:r.email)||"",is_organizer:!0}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}));case constantsF51538ef.CONFIGURATION_EVENT_TYPE.group:return index.h(index.Fragment,null,index.h("nylas-event-info",null,index.h("div",{slot:"inputs"},index.h("nylas-event-title",{noTemplates:!0}),index.h("nylas-event-description",{noTemplates:!0,hideAutoPopulateButton:!0}),index.h("nylas-event-location",{userProvider:r.provider}),index.h("nylas-event-timeslot",{name:"event-timeslot"}),index.h("nylas-event-capacity",null))),index.h("nylas-booking-calendar-picker",{exportparts:"nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content",expressFlow:!0,calendars:t,currentUser:r,defaultBookingCalendar:s==null?void 0:s.id}),index.h("nylas-additional-participants",{name:"participants",eventParticipants:[{name:(r==null?void 0:r.name)||(r==null?void 0:r.email),email:(r==null?void 0:r.email)||"",is_organizer:!0}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}),index.h("nylas-page-name",{requirePageName:!0,pageName:"Group events page"}),index.h("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}))}}const nylasSchedulerEditorCss=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 0px 6px -2px rgba(0, 0, 0, 0.05), 0px 5px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-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{width:-moz-available;width:-webkit-fill-available;width:fill-available;min-width:325px}}div.scheduler-editor-content{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-content--group{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content--group{height:auto}}div.scheduler-editor-header{display:grid;grid-template-columns:1fr auto auto;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900);min-width:924px}@media screen and (max-width: 768px){div.scheduler-editor-header{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;margin:0;font-size:18px;line-height:24px;font-weight:600}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary);background-color:transparent}div.scheduler-editor-header button:disabled{cursor:not-allowed}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button){border:none;padding:4px;margin-right:8px}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button):hover{outline:none;color:var(--nylas-primary)}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){min-width:132px}@media screen and (max-width: 768px){div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){width:-webkit-fill-available;width:fill-available;width:-moz-available}}nylas-select-event-type{height:inherit;width:calc(924px + 2rem)}@media screen and (max-width: 768px){nylas-select-event-type{width:auto}}nylas-editor-tabs,nylas-editor-tabs-group{width:auto;height:inherit}nylas-editor-tabs .row,nylas-editor-tabs-group .row{display:flex;gap:1rem}nylas-editor-tabs .composable,nylas-editor-tabs-group .composable{height:inherit;overflow:auto}nylas-editor-tabs nylas-event-info div[slot=inputs],nylas-editor-tabs nylas-event-limits div[slot=inputs],nylas-editor-tabs-group nylas-event-info div[slot=inputs],nylas-editor-tabs-group nylas-event-limits div[slot=inputs]{display:flex;flex-direction:column;gap:1rem}.card{display:flex;flex-direction:column;padding:2rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;max-width:fit-content;align-self:center}.login-required{height:inherit;overflow-y:auto;display:flex;flex-direction:column;justify-content:center;padding:2rem 1rem;background-color:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.login-required{height:auto}}.login-required p{margin:0 0 1rem}.login-required .microsoft-button,.login-required .google-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;margin-bottom:1rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;justify-content:center;gap:0.5rem;align-items:center}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;border:0;background-color:var(--nylas-base-0);height:48px;margin-bottom:1rem;font-size:0.95rem;justify-content:center;gap:0.25rem;align-items:center}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button svg{transform:rotate(180deg)}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .disclaimer-text{font-size:0.75rem;color:var(--nylas-base-600);align-self:center}.list-configurations{padding:2rem;height:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}',NylasSchedulerEditorStyle0=nylasSchedulerEditorCss,NylasSchedulerEditor=class{constructor(r){index.registerInstance(this,r),this.init=index.createEvent(this,"init",7),this.loggedIn=index.createEvent(this,"loggedIn",7),this.loggedOut=index.createEvent(this,"loggedOut",7),this.schedulerConfigCloseClicked=index.createEvent(this,"schedulerConfigCloseClicked",7),this.handleSchedulerConfigCloseClicked=t=>{const n=this.schedulerConfigCloseClicked.emit(this.host);"schedulerConfigCloseClicked"in this.eventOverrides&&this.eventOverrides.schedulerConfigCloseClicked(n,this.nylasSchedulerConfigConnector),n.defaultPrevented||(localStorage.removeItem("grant"),localStorage.removeItem("user"),window.location.reload())},this.authenticationUrl=async t=>this.nylasApiRequest?await this.nylasApiRequest.authenticationUrl({provider:t})||"":(console.error("[nylas-scheduler-editor] Nylas API Request is not initialized."),""),this.configurationId=void 0,this.nylasApiRequest=void 0,this.nylasSessionsConfig=void 0,this.defaultAuthArgs=void 0,this.eventOverrides={},this.schedulerPreviewLink="",this.defaultSchedulerConfigState=void 0,this.mode="app",this.additionalParticipants=void 0,this.hideEditorTabs=[],this.conferenceProviders=void 0,this.requiresSlug=!1,this.enableUserFeedback=!0,this.defaultLanguage=void 0,this.localization=void 0,this.nylasBranding=!0,this.experimentalFeatures=void 0,this.enableEventTypes={one_on_one:!0,collective:!0,max_fairness:!0,max_availability:!0,group:!0},this.automaticComponentRegistration=!0,this.selectedLanguage=this.defaultLanguage||constantsF51538ef.LANGUAGE_CODE.en,this.langVersion=0}connectedCallback(){index.debug("[nylas-scheduler-editor] connectedCallback")}async componentWillLoad(){var s,a,d,c,l,h,u,g;index.debug("[nylas-scheduler-editor] componentWillLoad");const r=(s=this.additionalParticipants)==null?void 0:s.filter(f=>{var p;const y=((p=f.calendars)==null?void 0:p.length)>0?f.calendars.filter(m=>m.id&&m.name):[];if(f.name&&f.email&&y.length>0)return{name:f.name,email:f.email,calendars:y}});if(this.stores={schedulerConfig:CreateNylasSchedulerConfigStore({...this.defaultSchedulerConfigState,additionalParticipants:r,conferenceProviders:this.conferenceProviders,requiresSlug:this.requiresSlug,selectedLanguage:this.defaultLanguage||constantsF51538ef.LANGUAGE_CODE.en,nylasBranding:this.nylasBranding,experimentalFeatures:this.experimentalFeatures,enableEventTypes:this.enableEventTypes})},!this.nylasApiRequest&&this.nylasSessionsConfig){const f=new NylasSessions(this.nylasSessionsConfig);await f.isLoggedIn(),f.onLoginSuccess(async()=>{var p,m;const y=await((m=(p=this.nylasSchedulerConfigConnector)==null?void 0:p.schedulerConfig)==null?void 0:m.currentUser());if(y){const S=this.loggedIn.emit(this.host);"loggedIn"in this.eventOverrides&&await this.eventOverrides.loggedIn(S,this.nylasSchedulerConfigConnector),S.defaultPrevented||await this.loggedInHandler(y)}}),f.onLoginFail(async()=>{var p,m;(m=(p=this.stores)==null?void 0:p.schedulerConfig)==null||m.set("currentUser",null);const y=this.loggedOut.emit(this.host);"loggedOut"in this.eventOverrides&&(await this.eventOverrides.loggedOut(y,this.nylasSchedulerConfigConnector),y.defaultPrevented)}),this.nylasApiRequest=new index.NylasIdentityRequestWrapper(f)}this.nylasApiRequest&&this.defaultAuthArgs&&this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs),this.baseProvider=new index_esFc8588de.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const t=this.baseProvider.getStore("schedulerConfig");this.nylasSchedulerConfigConnector=new NylasSchedulerConfigConnector({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:t});const n=this.init.emit(this.host);if("init"in this.eventOverrides&&await this.eventOverrides.init(n,this.nylasSchedulerConfigConnector),!n.defaultPrevented){const f=await((d=(a=this.nylasSchedulerConfigConnector)==null?void 0:a.schedulerConfig)==null?void 0:d.currentUser());if(f){const y=this.loggedIn.emit(this.host);"loggedIn"in this.eventOverrides&&await this.eventOverrides.loggedIn(y,this.nylasSchedulerConfigConnector),y.defaultPrevented||await this.loggedInHandler(f)}else{(l=(c=this.stores)==null?void 0:c.schedulerConfig)==null||l.set("currentUser",null);const y=this.loggedOut.emit(this.host);if("loggedOut"in this.eventOverrides&&(await this.eventOverrides.loggedOut(y,this.nylasSchedulerConfigConnector),y.defaultPrevented))return}}(u=(h=this.stores)==null?void 0:h.schedulerConfig)==null||u.onChange("selectedConfiguration",async f=>{f&&f.id&&(this.configurationId=f.id)}),(g=this.baseProvider)==null||g.componentWillLoad(this.nylasSchedulerConfigConnector)}async componentDidLoad(){var r;index.debug("[nylas-scheduler-editor] componentDidLoad"),await((r=this.baseProvider)==null?void 0:r.componentDidLoad()),this.updateLocalization(this.localization)}async componentDisconnected(){var r;await((r=this.baseProvider)==null?void 0:r.componentDisconnected())}async configurationIdChanged(r){var t,n,s,a,d,c,l,h;r?(await((n=(t=this.nylasSchedulerConfigConnector)==null?void 0:t.schedulerConfig)==null?void 0:n.getConfigurationById(r)),(a=(s=this.stores)==null?void 0:s.schedulerConfig)==null||a.set("action","edit")):((c=(d=this.stores)==null?void 0:d.schedulerConfig)==null||c.set("selectedConfiguration",{}),(h=(l=this.stores)==null?void 0:l.schedulerConfig)==null||h.set("action",null))}updateLocalization(r){r&&(Object.keys(r).forEach(t=>{t in constantsF51538ef.LANGUAGE_CODE&&index.instance.addResourceBundle(t,"translation",r[t],!1,!0)}),this.langVersion++)}updateNylasBranding(r){var t,n;(n=(t=this.stores)==null?void 0:t.schedulerConfig)==null||n.set("nylasBranding",r)}updateExperimentalFeatures(r){var t,n;(n=(t=this.stores)==null?void 0:t.schedulerConfig)==null||n.set("experimentalFeatures",r)}updateEnableEventTypes(r){var t,n;(n=(t=this.stores)==null?void 0:t.schedulerConfig)==null||n.set("enableEventTypes",r)}async store(){var r;return(r=this.stores)==null?void 0:r.schedulerConfig}async schedulerConnector(){return this.nylasSchedulerConfigConnector}async registerComponentHandler(r){var t;(t=this.baseProvider)==null||t.registerComponent(r.detail)}async unregisterComponentHandler(r){var t;(t=this.baseProvider)==null||t.unregisterComponent(r.detail)}nylasFormDropdownChangedHandler(r){var s,a;const{name:t,value:n}=r.detail;t==="language"&&(this.selectedLanguage=constantsF51538ef.LANGUAGE_CODE[n],index.instance.changeLanguage(this.selectedLanguage),(a=(s=this.stores)==null?void 0:s.schedulerConfig)==null||a.set("selectedLanguage",this.selectedLanguage))}async loggedInHandler(r){var t,n,s,a,d,c,l;if((n=(t=this.stores)==null?void 0:t.schedulerConfig)==null||n.set("currentUser",r),!!this.nylasSchedulerConfigConnector&&(await((s=this.nylasSchedulerConfigConnector.schedulerConfig)==null?void 0:s.getCalendars()),this.configurationId)){const h=await((a=this.nylasSchedulerConfigConnector.schedulerConfig)==null?void 0:a.getConfigurationById(this.configurationId));h&&((d=h[0])!=null&&d.id)&&((l=(c=this.stores)==null?void 0:c.schedulerConfig)==null||l.set("action","edit"))}}render(){var a,d,c,l,h,u,g,f,y,p,m,S,_,v,R,T,O,P,N,k,A,x,b,U,w,L,$,X,j,z,Y,M,V,J,W,Z,Q,ee,te,ne,se,ie,re,oe;const r=this.host.querySelector('[slot="custom-page-style-inputs"]'),t=(c=(d=(a=this.stores)==null?void 0:a.schedulerConfig)==null?void 0:d.state.selectedConfiguration)==null?void 0:c.id,n=Object.keys(constantsF51538ef.LANGUAGE_MAP).map(q=>({label:constantsF51538ef.LANGUAGE_MAP[q],value:q})),s=((h=(l=this.stores)==null?void 0:l.schedulerConfig)==null?void 0:h.state.selectedEventType)===constantsF51538ef.CONFIGURATION_EVENT_TYPE.group||((f=(g=(u=this.stores)==null?void 0:u.schedulerConfig)==null?void 0:g.state.selectedConfiguration)==null?void 0:f.type)===constantsF51538ef.CONFIGURATION_EVENT_TYPE.group;return index.h(index.Host,{key:"33481780f28849b0db13759a7c2868446db68e52"},index.h("div",{key:"c1d8968a3833afc945b8f12cae92ae903fac55df",class:"scheduler-editor-header",part:"nse__header"},index.h("h1",{key:"9225e1fe985975a052579ad19b2a39cf58e10636",class:"scheduler-editor-title",part:"nse__title"},index.h("calendar-icon",{key:"6643a8d8ec40bd49ad6874558a46ff7b4881e999",width:"18",height:"18"}),index.instance.t("schedulerEditorTitle")),index.h("div",{key:"5f39a141b7621cd12a4286f50a4f7ff88ee22960",class:{language:!0},part:"nse__language"},index.h("select-dropdown",{key:"f39d2f85796930affa228b770d20ff2322bcf664",name:"language",searchPlaceholder:index.instance.t("search"),options:n,withChevron:!1,defaultSelectedOption:n.find(q=>q.value==this.selectedLanguage),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},index.h("span",{key:"1d6480fdbcc79b7752bda9693e1afa4280a9fc88",slot:"select-icon"},index.h("translate-icon",{key:"13819cc3e68b82b92d8a0b905155628cb357b6f2",width:"20",height:"20"})))),index.h("button",{key:"e59c5d9ee944a731eb4aaf9314315f4eaab8aeed",class:"scheduler-editor-close",title:"logout",onClick:q=>this.handleSchedulerConfigCloseClicked(q),part:"nse__close-button"},index.h("close-icon",{key:"e02c1e6fee18ba347eb5155eb638b5a45dc4ff98",width:"18",height:"18"}))),index.h("div",{key:"f3694ba504ab3814d18647454c6c817e35997922",class:{"scheduler-editor-content":!0,"scheduler-editor-content--group":s},part:"nse__content"},((p=(y=this.stores)==null?void 0:y.schedulerConfig)==null?void 0:p.state.currentUser)&&this.stores.schedulerConfig.state.action===null&&index.h("div",{class:"list-configurations",part:"nse__list-configurations"},index.h("nylas-list-configurations",{exportparts:"nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete"})),((S=(m=this.stores)==null?void 0:m.schedulerConfig)==null?void 0:S.state.currentUser)&&this.stores.schedulerConfig.state.action==="create-select"&&index.h("nylas-select-event-type",null),((v=(_=this.stores)==null?void 0:_.schedulerConfig)==null?void 0:v.state.currentUser)&&this.stores.schedulerConfig.state.action==="create"&&s&&index.h("nylas-editor-tabs-group",{mode:"composable"},index.h(ExpressFlow,{selectedEventType:((O=(T=(R=this.stores)==null?void 0:R.schedulerConfig)==null?void 0:T.state)==null?void 0:O.selectedEventType)||constantsF51538ef.CONFIGURATION_EVENT_TYPE.one_on_one,currentUser:(N=(P=this.stores)==null?void 0:P.schedulerConfig)==null?void 0:N.state.currentUser,calendars:(x=(A=(k=this.stores)==null?void 0:k.schedulerConfig)==null?void 0:A.state)==null?void 0:x.calendars,selectedConfiguration:(w=(U=(b=this.stores)==null?void 0:b.schedulerConfig)==null?void 0:U.state)==null?void 0:w.selectedConfiguration})),(($=(L=this.stores)==null?void 0:L.schedulerConfig)==null?void 0:$.state.currentUser)&&this.stores.schedulerConfig.state.action==="create"&&!s&&index.h("nylas-editor-tabs",{mode:"composable"},index.h(ExpressFlow,{selectedEventType:((z=(j=(X=this.stores)==null?void 0:X.schedulerConfig)==null?void 0:j.state)==null?void 0:z.selectedEventType)||constantsF51538ef.CONFIGURATION_EVENT_TYPE.one_on_one,currentUser:(M=(Y=this.stores)==null?void 0:Y.schedulerConfig)==null?void 0:M.state.currentUser,calendars:(W=(J=(V=this.stores)==null?void 0:V.schedulerConfig)==null?void 0:J.state)==null?void 0:W.calendars,selectedConfiguration:(ee=(Q=(Z=this.stores)==null?void 0:Z.schedulerConfig)==null?void 0:Q.state)==null?void 0:ee.selectedConfiguration})),((ne=(te=this.stores)==null?void 0:te.schedulerConfig)==null?void 0:ne.state.currentUser)&&this.stores.schedulerConfig.state.action==="edit"&&s&&index.h("nylas-editor-tabs-group",{key:t,mode:this.mode},this.mode==="composable"&&index.h("slot",null),this.mode==="app"&&r&&index.h("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:t},index.h("slot",{name:"custom-page-style-inputs"}))),((ie=(se=this.stores)==null?void 0:se.schedulerConfig)==null?void 0:ie.state.currentUser)&&this.stores.schedulerConfig.state.action==="edit"&&!s&&index.h("nylas-editor-tabs",{key:t,mode:this.mode},this.mode==="composable"&&index.h("slot",null),this.mode==="app"&&r&&index.h("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:t},index.h("slot",{name:"custom-page-style-inputs"}))),!((oe=(re=this.stores)==null?void 0:re.schedulerConfig)!=null&&oe.state.currentUser)&&index.h("slot",{name:"login-required"},index.h(LoginRequired,{authenticationUrl:this.authenticationUrl}))))}get host(){return index.getElement(this)}static get watchers(){return{configurationId:["configurationIdChanged"],localization:["updateLocalization"],nylasBranding:["updateNylasBranding"],experimentalFeatures:["updateExperimentalFeatures"],enableEventTypes:["updateEnableEventTypes"]}}};NylasSchedulerEditor.style=NylasSchedulerEditorStyle0;exports.nylas_scheduler_editor=NylasSchedulerEditor;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-1e75512f.cjs"),R=require("./index.es-fc8588de-034ead51.cjs"),X=require("./constants-f51538ef-cd2a67c4.cjs"),M=require("./feedbackSync-172f942c-62f72bd2.cjs");require("react");require("react/jsx-runtime");require("react-dom");var H;(function(n){n.Error="error",n.Warning="warning",n.Info="info",n.Success="success"})(H||(H={}));var L;(function(n){n.Component="component",n.Api="api",n.Auth="auth"})(L||(L={}));var q;(function(n){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"})(q||(q={}));class Z{constructor(){this.component=e=>{const t=L.Component,o=`${e} Error`;return{endtime_not_in_future:(s='"endtime" can not be in the future')=>({title:o,message:s,category:t}),no_booking_info:(s="No booking info provided")=>({title:o,message:s,category:t}),no_timeslot_selected:(s="No timeslot selected")=>({title:o,message:s,category:t}),no_timezone_selected:(s="No timezone selected")=>({title:o,message:s,category:t}),no_booking_id:(s="No booking id provided")=>({title:o,message:s,category:t}),no_salt:(s="No salt provided")=>({title:o,message:s,category:t}),invalid_start_time:(s="Invalid start time")=>({title:o,message:s,category:t}),invalid_end_time:(s="Invalid end time")=>({title:o,message:s,category:t}),invalid_timezone:(s="Invalid timezone")=>({title:o,message:s,category:t}),no_config_id:(s="No configuration id provided")=>({title:o,message:s,category:t})}},this.api=e=>{const t=L.Api,o=`${e} Error`;return{invalid_session:s=>({title:o,message:s,category:t}),general_error:s=>({title:o,message:s,category:t}),internal_error:s=>({title:o,message:s,category:t}),invalid_request_error:s=>({title:o,message:s,category:t}),timeslot_not_available:s=>({title:o,message:s,category:t}),provider_error:s=>({title:o,message:s,category:t}),not_found_error:s=>({title:o,message:s,category:t})}}}}class K{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:o,configId:s,slug:a,clientId:r}){this.errors=new Z,this.schedulerStore=t,this.schedulerAPIURL=e,this.sessionId=o,this.configId=s,this.slug=a,this.clientId=r}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,o,s={}){try{const a=new URL(this.schedulerAPIURL),r="2.0.0";return a.pathname=e,await(await fetch(decodeURIComponent(a.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,"X-Source":"nylas-scheduling","X-Nylas-Web-Elements-Version":r,...s},body:o})).json()}catch(a){return{error:{message:a.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){var o,s,a,r;let t=(e==null?void 0:e.message)||(e==null?void 0:e.title)||"Something went wrong";return(e==null?void 0:e.type)==="provider_error"&&(t=((s=(o=e==null?void 0:e.provider_error)==null?void 0:o.error)==null?void 0:s.message)||((r=(a=e==null?void 0:e.provider_error)==null?void 0:a.error)==null?void 0:r.title)||"Something went wrong"),t}setConfigId(e){this.configId=e}selectDate(e){this.schedulerStore.set("selectedDate",e),this.schedulerStore.set("selectedTimeslot",null)}selectTime(e){this.schedulerStore.set("selectedTimeslot",e)}selectTimezone(e){this.schedulerStore.set("selectedTimezone",e)}selectLanguage(e){this.schedulerStore.set("selectedLanguage",e),i.instance.changeLanguage(e)}async toggleAdditionalData(e){e||await this.refetchAvailability(),this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,email:e}})}async refetchAvailability(){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,o=t<e.getTime()/1e3?Math.floor(e.getTime()/1e3):t,s=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;return await this.getAvailability(o,s)}async resetStoreStateAndFetchAvailability(){const e=new Date,t=await this.refetchAvailability(),o=this.schedulerStore.get("availability").find(a=>new Date(a.start_time)>new Date);let s=e;return o&&(s=o.start_time),this.schedulerStore.set("selectedDate",s),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1),this.schedulerStore.set("selectedTimeslot",null),t}async setReschedule(e){this.schedulerStore.set("isLoading",!0);const t=this.schedulerStore.state.eventInfo;return t&&this.schedulerStore.set("reschedulingEventInfo",t),this.schedulerStore.set("rescheduleBookingId",e),await this.getUISettings(),await this.resetStoreStateAndFetchAvailability().finally(()=>{this.schedulerStore.set("isLoading",!1)})}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async setReject(e){this.schedulerStore.set("rejectBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("cancelBookingId",""),this.schedulerStore.set("rejectBookingId",""),this.schedulerStore.set("cancelledEventInfo",null),e}async goBack(){this.schedulerStore.set("cancelBookingId","")}async resetConfirm(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("organizerConfirmationBookingId",""),this.schedulerStore.set("confirmedEventInfo",void 0),e}async bookTimeslot(e){var T,I,B;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:t,selectedTimezone:o,bookingInfo:s,selectedLanguage:a}=this.schedulerStore.state;if(!e&&!s)return{error:this.errors.component(i.instance.t("createBookingErrorTitle")).no_booking_info()};const r=(e==null?void 0:e.timeslot)||t;if(!r)return{error:this.errors.component(i.instance.t("createBookingErrorTitle")).no_timeslot_selected()};const l=e&&(e!=null&&e.timezone)?e==null?void 0:e.timezone:o,c=a||"en-US";if(!l)return{error:this.errors.component(i.instance.t("createBookingErrorTitle")).no_timezone_selected()};const u=[...this.schedulerStore.get("availabilityOrderEmails")];let d="";const g=(r==null?void 0:r.emails)||[],h={};Object.entries((s==null?void 0:s.additionalFields)||{}).forEach(([_,x])=>{h[_]=x.value});const m=e?e==null?void 0:e.primaryParticipant:s==null?void 0:s.primaryParticipant,p=e?(e==null?void 0:e.guests)||[]:(s==null?void 0:s.guests)||[],w=e?e==null?void 0:e.additionalFields:h,f=this.getHeaders(),k=`/v3/scheduling/bookings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:""}`;if(u.length===0){const _=await this.makeAPIRequest(decodeURIComponent(k),"POST",JSON.stringify({additional_fields:w,additional_guests:p,guest:{...m},start_time:r.start_time.getTime()/1e3,end_time:r.end_time.getTime()/1e3,timezone:l,event_id:(r==null?void 0:r.event_id)||void 0,master_id:(r==null?void 0:r.master_id)||void 0,calendar_id:(r==null?void 0:r.calendar_id)||void 0,email_language:this.getTwoLetterLanguageCode(c)}),f);return this.schedulerStore.set("isLoading",!1),"data"in _?(this.schedulerStore.set("eventInfo",_.data),_):{error:_.error}}for(;u.length>0;){if(d=u.shift(),!g.includes(d))continue;const _=await this.makeAPIRequest(decodeURIComponent(k),"POST",JSON.stringify({participants:d?[{email:d}]:void 0,additional_fields:w,additional_guests:p,guest:{...m},start_time:r.start_time.getTime()/1e3,end_time:r.end_time.getTime()/1e3,timezone:l,email_language:this.getTwoLetterLanguageCode(c)}),f);if("data"in _)return this.schedulerStore.set("isLoading",!1),this.schedulerStore.set("eventInfo",_==null?void 0:_.data),_;if((I=(T=_.error)==null?void 0:T.message)!=null&&I.startsWith("The selected timeslot is unavailable"))continue;{this.schedulerStore.set("isLoading",!1);const x=(B=_.error)==null?void 0:B.type;let D=_.error;if(x&&x in this.errors.api(i.instance.t("createBookingErrorTitle"))){const z=this.getErrorMessage(D);D=this.errors.api(i.instance.t("createBookingErrorTitle"))[x](z)}return{error:D}}}return this.schedulerStore.set("isLoading",!1),{error:this.errors.api(i.instance.t("createBookingErrorTitle")).timeslot_not_available("The selected timeslot is unavailable")}}async getUISettings(){var r;this.schedulerStore.set("isLoading",!0);const e=this.schedulerStore.get("rescheduleBookingId"),t=this.getHeaders();let o=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";e&&o?o+=`&booking_id=${e}`:e&&(o+=`?booking_id=${e}`);const s=`/v3/scheduling/ui-settings${o}`,a=await this.makeAPIRequest(s,"GET",void 0,t);if("error"in a){this.schedulerStore.set("isLoading",!1);const l=(r=a.error)==null?void 0:r.type;let c=a.error;return l&&l in this.errors.api(i.instance.t("getUISettingErrorTitle"))&&(c=this.errors.api(i.instance.t("getUISettingErrorTitle"))[l]((c==null?void 0:c.message)||(c==null?void 0:c.title)||"Something went wrong")),{error:c}}return"data"in a&&this.schedulerStore.set("configSettings",a.data),this.schedulerStore.set("isLoading",!1),a}getTwoLetterLanguageCode(e){return e.split("-")[0]}getStartTimeWithMinBookingNotice(e){var a;const t=(a=this.schedulerStore.get("configSettings"))==null?void 0:a.scheduler,o=t==null?void 0:t.min_booking_notice;if(!o)return e;const s=new Date().getTime();return e<(s+o*60*1e3)/1e3?Math.floor((s+o*60*1e3)/1e3):e}getEndTimeForAvailableDaysInFuture(e){var r,l;const t=new Date,o=(l=(r=this.schedulerStore.get("configSettings"))==null?void 0:r.scheduler)==null?void 0:l.available_days_in_future,s=Math.floor(i.addDaysToCurrentDate(t,o).getTime()/1e3);return Math.min(s,e)}async getAvailability(e=0,t=0){var h,m,p,w;this.schedulerStore.set("isLoading",!0);const o=new URLSearchParams,s=new Date,a=s.getTime();if(t&&t<a/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component(i.instance.t("getAvailabilityErrorTitle")).endtime_not_in_future()};if(!e){const f=new Date(s.getFullYear(),s.getMonth(),1);e=Math.floor(f.getTime()/1e3)}if(!t){const f=new Date(s.getFullYear(),s.getMonth()+1,0);t=Math.floor(f.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(t);const r=this.getStartTimeWithMinBookingNotice(e);e=r,t=r>t?r+1:t,o.append("start_time",encodeURIComponent(e.toString())),o.append("end_time",encodeURIComponent(t.toString())),this.configId&&!this.sessionId?o.append("configuration_id",encodeURIComponent(this.configId)):this.slug&&this.clientId&&!this.sessionId&&(o.append("slug",encodeURIComponent(this.slug)),o.append("client_id",encodeURIComponent(this.clientId)));const l=this.schedulerStore.get("rescheduleBookingId");l&&o.append("booking_id",encodeURIComponent(l));const c=o.toString(),u=`/v3/scheduling/availability${c?`?${c}`:""}`,d=this.getHeaders(),g=await this.makeAPIRequest(decodeURIComponent(u),"GET",void 0,d);if("error"in g){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const f=(h=g.error)==null?void 0:h.type;let v=g.error;if(f&&f in this.errors.api(i.instance.t("getAvailabilityErrorTitle"))){const k=this.getErrorMessage(v);v=this.errors.api(i.instance.t("getAvailabilityErrorTitle"))[f](k)}return{error:v}}if("data"in g){const k=(((p=(m=g.data)==null?void 0:m.time_slots)==null?void 0:p.map(I=>({...I,start_time:new Date(I.start_time*1e3),end_time:new Date(I.end_time*1e3)})))||[]).filter(I=>I.start_time.getTime()>a).sort((I,B)=>I.start_time.getTime()-B.start_time.getTime());this.schedulerStore.set("availability",k);const T=((w=g.data)==null?void 0:w.order)||[];this.schedulerStore.set("availabilityOrderEmails",T)}return this.schedulerStore.set("isLoading",!1),g}async cancelBooking(e,t){var l;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(i.instance.t("cancelBookingErrorTitle")).no_booking_id()};const o=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",s=`/v3/scheduling/bookings/${e}${o}`,a=this.getHeaders(),r=await this.makeAPIRequest(decodeURIComponent(s),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),a);if("error"in r){this.schedulerStore.set("isLoading",!1);const c=(l=r.error)==null?void 0:l.type;let u=r.error;if(c&&c in this.errors.api(i.instance.t("cancelBookingErrorTitle"))){const d=this.getErrorMessage(u);u=this.errors.api(i.instance.t("cancelBookingErrorTitle"))[c](d)}return{error:u}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:e}),this.schedulerStore.set("rescheduleBookingId",""),this.schedulerStore.set("isLoading",!1),r}async rescheduleBooking(e,t){var F;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(i.instance.t("rescheduleBookingErrorTitle")).no_booking_id()};const o=this.errors.api(i.instance.t("rescheduleBookingErrorTitle")),s=this.errors.component(i.instance.t("rescheduleBookingErrorTitle")),{bookingInfo:a,selectedTimeslot:r,selectedTimezone:l,selectedLanguage:c}=this.schedulerStore.state,{startTime:u,endTime:d,timezone:g}=t,h=u||(r==null?void 0:r.start_time);if(!h)return{error:s.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const m=d||(r==null?void 0:r.end_time);if(!m)return{error:s.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const p=this.schedulerStore.get("availabilityOrderEmails");let w="";if(p.length>0){const y=(r==null?void 0:r.emails)||[];for(let C=0;C<p.length;C++)if(y.includes(p[C])){w=p[C];break}}const f=g||l;if(!f)return{error:s.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const v=(r==null?void 0:r.event_id)||void 0,k=(r==null?void 0:r.master_id)||void 0,T=(r==null?void 0:r.calendar_id)||void 0,I={};Object.entries((a==null?void 0:a.additionalFields)||{}).forEach(([y,C])=>{I[y]=C.value});const B=t?t==null?void 0:t.primaryParticipant:a==null?void 0:a.primaryParticipant,_=t?(t==null?void 0:t.guests)||[]:(a==null?void 0:a.guests)||[],x=t?t==null?void 0:t.additionalFields:I,D=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",z=`/v3/scheduling/bookings/${e}${D}`,b=this.getHeaders(),S=await this.makeAPIRequest(decodeURIComponent(z),"PATCH",JSON.stringify({start_time:h.getTime()/1e3,end_time:m.getTime()/1e3,timezone:f,additional_fields:x,guest:{...B},additional_guests:_,participants:w?[{email:w}]:void 0,email_language:this.getTwoLetterLanguageCode(c),event_id:v,master_id:k,calendar_id:T}),b);if("error"in S){this.schedulerStore.set("isLoading",!1);const y=(F=S.error)==null?void 0:F.type;let C=S.error;if(y&&y in o){const U=this.getErrorMessage(C);C=o[y](U)}return{error:C}}const A=this.schedulerStore.get("reschedulingEventInfo");if("data"in S)this.schedulerStore.set("eventInfo",S==null?void 0:S.data);else if(A)this.schedulerStore.set("eventInfo",A);else{const y={booking_id:e};this.schedulerStore.set("eventInfo",y)}return this.schedulerStore.set("isLoading",!1),S}async updateBooking(e){var g;this.schedulerStore.set("isLoading",!0);const{bookingId:t,status:o,reason:s}=e,a=this.schedulerStore.get("organizerConfirmationSalt"),r=o==="confirmed"?i.instance.t("confirmBookingErrorTitle"):i.instance.t("rejectBookingErrorTitle");if(!t)return{error:this.errors.component(r).no_booking_id()};if(!a)return{error:this.errors.component(r).no_salt()};const l=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",c=`/v3/scheduling/bookings/${t}${l}`,u=this.getHeaders(),d=await this.makeAPIRequest(decodeURIComponent(c),"PUT",JSON.stringify({status:o,cancellation_reason:s,salt:a}),u);if("error"in d){this.schedulerStore.set("isLoading",!1);const h=(g=d.error)==null?void 0:g.type;let m=d.error;if(h&&h in this.errors.api(r)){const p=this.getErrorMessage(m);m=this.errors.api(r)[h](p)}return{error:m}}return"data"in d&&o==="confirmed"?this.schedulerStore.set("confirmedEventInfo",d==null?void 0:d.data):"request_id"in d&&o==="cancelled"&&this.schedulerStore.set("cancelledEventInfo",{booking_id:t}),this.schedulerStore.set("organizerConfirmationBookingId",""),this.schedulerStore.set("isLoading",!1),d}async validateGroupEventTimeslot(e){var r,l;this.schedulerStore.set("isLoading",!0);const t=(r=this.schedulerStore.get("configSettings"))==null?void 0:r.configuration_id;if(!t)return{error:this.errors.component(i.instance.t("validateTimeslotErrorTitle")).no_config_id()};const o=this.getHeaders(),s=`/v3/scheduling/configurations/${t}/group-events/validate-timeslot`,a=await this.makeAPIRequest(decodeURIComponent(s),"POST",JSON.stringify({...e,start_time:e.start_time.getTime()/1e3,end_time:e.end_time.getTime()/1e3}),o);if("error"in a){this.schedulerStore.set("isLoading",!1);const c=(l=a.error)==null?void 0:l.type;let u=a.error;if(c&&c in this.errors.api(i.instance.t("validateTimeslotErrorTitle"))){const d=this.getErrorMessage(u);u=this.errors.api(i.instance.t("validateTimeslotErrorTitle"))[c](d)}return this.refetchAvailability(),{error:u}}return this.schedulerStore.set("selectedTimeslot",e),this.schedulerStore.set("showBookingForm",!0),this.schedulerStore.set("isLoading",!1),a}}class Q{constructor({schedulerAPIURL:e,nylasSchedulerStore:t,sessionId:o,configId:s,slug:a,clientId:r}){if(!e)throw new Error("schedulerAPIURL is required");if(!t)throw new Error("nylasSchedulerStore is required");if(!o&&!s&&!(a||r))throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");e==="/"&&(e=new URL(window.location.href).origin),this.configId=s,this.sessionId=o,this.schedulerAPIURL=e,this.nylasSchedulerStore=t,this.slug=a,this.clientId=r}init(){i.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new K({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}function V(n={}){const e={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,availabilityOrderEmails:[],selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...n};i.debug("[defaultNylasStoreState]: ",e);const t=i.createStore(e);return t.onChange("availability",o=>{i.debug("[availability]: ",o);const s=o.map(l=>l.start_time);i.debug("[selectableDates]: ",s),t.set("selectableDates",s);const a=o[0];if(!a)return;const r=Math.floor((a.end_time.getTime()-a.start_time.getTime())/6e4);i.debug("[durationMinutes]: ",r),t.set("eventDuration",r)}),t.reset=()=>{for(const o in e){const s=e[o];t.set(o,s)}},t}const P=(n,e)=>{const t=n.isLoading,o=n.showNotification,s=n.nylasBranding;return i.h(i.Fragment,null,o&&i.h("nylas-notification",null),t&&i.h("div",{class:"loading"},i.h("div",{class:"left"},i.h("div",{class:"skeleton"})),i.h("div",{class:"right"},i.h("div",{class:"skeleton"}),i.h("div",{class:"skeleton"}),i.h("div",{class:"skeleton"}),i.h("div",{class:"skeleton"}),i.h("div",{class:"skeleton"}))),!t&&e,i.h("div",{class:"footer"},s&&i.h("a",{href:"https://scheduler.nylas.com?utm_source=powered-by-nylas-logoutm_medium=link&utm_campaign=get-scheduler&utm_id=get-scheduler",class:"powered-by-nylas",target:"_blank",rel:"noreferrer noopener"},"Powered by ",i.h("span",{class:"sr-only"},"Nylas"),i.h("nylas-logo",{"aria-hidden":!0}))))},W=(n,e)=>i.h("div",{class:"message-banner"},e),ee=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-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;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto;border-left:none}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer .powered-by-nylas{display:flex;align-items:center;text-decoration:none;color:var(--nylas-base-500)}.footer .powered-by-nylas:hover{color:var(--nylas-base-800)}.footer svg{fill:var(--nylas-base-500)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}',te=ee,G={title:i.instance.t("genericErrorTitle"),type:R.nr.Error,category:L.Component},J=class{constructor(n){i.registerInstance(this,n),this.init=i.createEvent(this,"init",7),this.schedulerWillLoad=i.createEvent(this,"schedulerWillLoad",7),this.schedulerDidLoad=i.createEvent(this,"schedulerDidLoad",7),this.nylasSchedulerError=i.createEvent(this,"nylasSchedulerError",7),this.nylasSchedulerInfo=i.createEvent(this,"nylasSchedulerInfo",7),this.configSettingsLoaded=i.createEvent(this,"configSettingsLoaded",7),this.bookingRefExtracted=i.createEvent(this,"bookingRefExtracted",7),this.bookedEventInfo=i.createEvent(this,"bookedEventInfo",7),this.mode="app",this.defaultSchedulerState=void 0,this.sessionId=void 0,this.schedulerApiUrl="https://api.us.nylas.com",this.bookingInfo=void 0,this.rescheduleBookingRef=void 0,this.cancelBookingRef=void 0,this.organizerConfirmationBookingRef=void 0,this.configurationId=void 0,this.slug=void 0,this.clientId=void 0,this.nylasBranding=!0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.localization=void 0,this.showNotification=!0,this.enableUserFeedback=!0,this.hour12=void 0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(navigator.language,{dateStyle:"full"})||`${i.instance.t("noDateSelected")}`,this.refConfigId=void 0,this.language=navigator.language,this.showFeedbackModal=!1,this.bookingInfoConfirmed=null}connectedCallback(){i.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var s,a;i.debug("[nylas-scheduler] Component will load"),this.enableUserFeedback&&!M.isInitialized()&&M.init({dsn:"https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",release:"2.0.0",integrations:r=>[...r.filter(l=>!1),M.feedbackSyncIntegration({colorScheme:"system",autoInject:!1})],autoSessionTracking:!1,beforeSend:()=>null});const n=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerWillLoad(n,this.nylasSchedulerConnector),n.defaultPrevented))return;this.stores={scheduler:V({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,themeConfig:this.themeConfig,hour12:this.hour12,...this.defaultSchedulerState})},this.baseProvider=new R.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.refConfigId=this.configurationId;let e;if(this.rescheduleBookingRef){const[r,l,c]=i.compactStringToUUIDs(this.rescheduleBookingRef);this.refConfigId=r,this.stores.scheduler.set("rescheduleBookingId",l),e=this.bookingRefExtracted.emit({configurationId:r,bookingId:l})}else if(this.cancelBookingRef){const[r,l,c]=i.compactStringToUUIDs(this.cancelBookingRef);this.refConfigId=r,this.stores.scheduler.set("cancelBookingId",l),e=this.bookingRefExtracted.emit({configurationId:r,bookingId:l})}else if(this.organizerConfirmationBookingRef){const[r,l,c]=i.compactStringToUUIDs(this.organizerConfirmationBookingRef);this.refConfigId=r,this.stores.scheduler.set("organizerConfirmationBookingId",l),this.stores.scheduler.set("organizerConfirmationSalt",c),e=this.bookingRefExtracted.emit({configurationId:r,bookingId:l,salt:c})}if("bookingRefExtracted"in this.eventOverrides&&(await this.eventOverrides.bookingRefExtracted(e,this.nylasSchedulerConnector),e.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;const t=(s=this.baseProvider)==null?void 0:s.getStore("scheduler");this.nylasSchedulerConnector=new Q({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:t});const o=this.init.emit(this.host);"init"in this.eventOverrides&&(await this.eventOverrides.init(o,this.nylasSchedulerConnector),o.defaultPrevented)||((a=this.baseProvider)==null||a.componentWillLoad(this.nylasSchedulerConnector),this.applyThemeConfig(this.themeConfig))}async componentDidLoad(){var c,u,d,g,h,m,p,w;(c=this.baseProvider)==null||c.componentDidLoad();const n=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerDidLoad(n,this.nylasSchedulerConnector),n.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;this.localizationChanged(this.localization);const e=await((u=this.nylasSchedulerConnector)==null?void 0:u.scheduler.getUISettings());if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e==null?void 0:e.error)},host:this.host});return}else{"data"in e&&((d=e.data)!=null&&d.appearance)&&console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");const f=this.configSettingsLoaded.emit({settings:e});if("configSettingsLoaded"in this.eventOverrides&&(await this.eventOverrides.configSettingsLoaded(f,this.nylasSchedulerConnector),f.defaultPrevented))return}const t=(g=this.baseProvider)==null?void 0:g.getStore("scheduler"),o=(m=(h=t==null?void 0:t.get("configSettings"))==null?void 0:h.scheduler)==null?void 0:m.available_days_in_future,s=t==null?void 0:t.get("selectedTimeslot");if(s&&(s!=null&&s.start_time)){if(!this.isTimeslotValid(s))return;if(t!=null&&t.get("showBookingForm")){t==null||t.set("selectedDate",s.start_time);return}}const a=t==null?void 0:t.get("selectedDate"),r=t==null?void 0:t.get("availability");let l;if(!(r&&r.length>0)){if(a){const{startTime:f,endTime:v,endTimeForAvailableDaysInFuture:k}=this.validateAvailableDaysInFuture(a,o||30);a.getTime()<k*1e3&&(l=await((w=this.nylasSchedulerConnector)==null?void 0:w.scheduler.getAvailability(f,v)))}else{const f=new Date,{startTime:v,endTime:k,endTimeForAvailableDaysInFuture:T}=this.validateAvailableDaysInFuture(f,o||30);f.getTime()<T*1e3&&(l=await((p=this.nylasSchedulerConnector)==null?void 0:p.scheduler.getAvailability(v,k)))}if((!l||"error"in l)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(l==null?void 0:l.error)},host:this.host}),!a){let f=new Date;const v=t==null?void 0:t.get("availability").find(k=>new Date(k.start_time)>new Date);v&&(f=v.start_time),t==null||t.set("selectedDate",f)}}}componentDisconnected(){var n;(n=this.baseProvider)==null||n.componentDisconnected()}bookingInfoChanged(n){var e;(e=this.stores)==null||e.scheduler.set("bookingInfo",n)}rescheduleBookingRefChanged(n){var e,t;if(n){const[o,s]=i.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("rescheduleBookingId",s),this.refConfigId=o,(t=this.nylasSchedulerConnector)==null||t.scheduler.setConfigId(o)}}cancelBookingRefChanged(n){var e,t;if(n){const[o,s]=i.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("cancelBookingId",s),this.refConfigId=o,(t=this.nylasSchedulerConnector)==null||t.scheduler.setConfigId(o)}}organizerConfirmationBookingRefChanged(n){var e,t;if(n){const[o,s]=i.compactStringToUUIDs(n);(e=this.stores)==null||e.scheduler.set("organizerConfirmationBookingId",s),this.refConfigId=o,(t=this.nylasSchedulerConnector)==null||t.scheduler.setConfigId(o)}}localizationChanged(n){n&&Object.keys(n).forEach(e=>{e in X.LANGUAGE_CODE&&i.instance.addResourceBundle(e,"translation",n[e],!1,!0)})}themeConfigChanged(n){var e,t;(t=(e=this.baseProvider)==null?void 0:e.getStore("scheduler"))==null||t.set("themeConfig",n),this.applyThemeConfig(n)}languageChanged(n){const e=n.detail;this.language=e,i.instance.changeLanguage(e)}async registerComponentHandler(n){var e;(e=this.baseProvider)==null||e.registerComponent(n.detail)}async unregisterComponentHandler(n){var e;(e=this.baseProvider)==null||e.unregisterComponent(n.detail)}async monthChangedHandler(n){var r,l,c,u,d,g,h;const e=n.detail,t=(u=(c=(l=(r=this.nylasSchedulerConnector)==null?void 0:r.schedulerStore)==null?void 0:l.get("configSettings"))==null?void 0:c.scheduler)==null?void 0:u.available_days_in_future,{startTime:o,endTime:s,endTimeForAvailableDaysInFuture:a}=this.validateAvailableDaysInFuture(e,t||30);if(!n.defaultPrevented&&o<a&&e.getTime()<a*1e3){const m=await((d=this.nylasSchedulerConnector)==null?void 0:d.scheduler.getAvailability(o,s));(!m||"error"in m)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(m==null?void 0:m.error)},host:this.host});const p=(g=this.stores)==null?void 0:g.scheduler.get("selectableDates");p&&p.length>0&&((h=this.stores)==null||h.scheduler.set("selectedDate",p[0]))}}mapToBookingData(n){var r,l,c;const e=(r=this.stores)==null?void 0:r.scheduler.get("selectedTimeslot"),t=(l=this.stores)==null?void 0:l.scheduler.get("selectedLanguage"),o=(c=this.stores)==null?void 0:c.scheduler.get("selectedTimezone"),s=e!=null&&e.start_time?new Date(e==null?void 0:e.start_time).getTime()/1e3:"",a=e!=null&&e.end_time?new Date(e==null?void 0:e.end_time).getTime()/1e3:"";return{additional_guests:n.guests,guest:{...n.primaryParticipant},additional_fields:{...n.additionalFields},start_time:s,end_time:a,email_language:t,timezone:o}}async bookButtonClickedHandler(n){var c,u,d,g;if(n.defaultPrevented)return;const e=n.detail,t=this.mapToBookingData(e);this.bookingInfoConfirmed=e;const s=(u=(c=this.nylasSchedulerConnector)==null?void 0:c.schedulerStore)==null?void 0:u.get("rescheduleBookingId");if(s){const h=await((d=this.nylasSchedulerConnector)==null?void 0:d.scheduler.rescheduleBooking(s,e));(!h||"error"in h)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(h==null?void 0:h.error)},host:this.host});const m=h==null?void 0:h.data,p=this.bookedEventInfo.emit({...h,data:{...m,...t}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...m},"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(p,this.nylasSchedulerConnector);return}const a=await((g=this.nylasSchedulerConnector)==null?void 0:g.scheduler.bookTimeslot(e));(!a||"error"in a)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(a==null?void 0:a.error)},host:this.host});const r=a==null?void 0:a.data,l=this.bookedEventInfo.emit({...a,data:{...r,...t}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...r},"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(l,this.nylasSchedulerConnector)}dateSelectedHandler(n){const e=n.detail;this.selectedDateLabel=e?e.toLocaleDateString(this.language,{dateStyle:"full"}):`${i.instance.t("noDateSelected")}`}cancelBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}confirmBookingErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}feedbackModalClosedHandler(){this.showFeedbackModal=!1}eventIsFullHandler(n){const e=n.detail.error;n.detail.type==="error"?this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:e})},host:this.host}):this.nylasSchedulerInfo.emit({notification:{title:"Event is full",category:L.Component,type:R.nr.Info,description:"The event you selected is full. Please try a different time.",id:new Date().getTime().toString(),ttl:3e3},host:this.host})}feedbackSubmittedHandler(n){const t={eventId:M.captureMessage("Scheduling Page User Feedback",{extra:{configId:this.configurationId,slug:this.slug}}),message:n.detail.feedback};M.captureFeedback(t,{includeReplay:!0,captureContext:{tags:{"nylas-web-element":"nylas-scheduling","nylas-web-element-version":"2.0.0","nylas-config-id":this.configurationId,"nylas-slug":this.slug,"host-url":window.location.href},extra:{configId:this.configurationId,slug:this.slug}}}),this.showFeedbackModal=!1}async getNylasSchedulerStore(){var n;return(n=this.baseProvider)==null?void 0:n.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(n){return{title:(n==null?void 0:n.title)||G.title,category:(n==null?void 0:n.category)||G.category,type:R.nr.Error,description:(n==null?void 0:n.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let n="";return this.sessionId||(n+=i.instance.t("sessionIdRequiredErrorMessage")),!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)&&(n=i.instance.t("sessionIdRequiredErrorMessage")+" "+i.instance.t("publicConfigErrorMessage")),this.nylasSchedulerError.emit({notification:{title:i.instance.t("schedulingComponentErrorTitle"),category:L.Component,type:R.nr.Error,description:n,id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1}return!0}isTimeslotValid(n){return new Date(n.start_time)<new Date?(this.nylasSchedulerError.emit({notification:{title:i.instance.t("invalidTimeslotErrorTitle"),category:L.Component,type:R.nr.Error,description:i.instance.t("invalidTimeslotErrorMessage"),id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1):!0}validateAvailableDaysInFuture(n,e){const t=new Date,o=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,s=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,a=Math.floor(i.addDaysToCurrentDate(t,e).getTime()/1e3),r=Math.min(a,s);return{startTime:o<t.getTime()/1e3?Math.floor(t.getTime()/1e3):o,endTime:r,endTimeForAvailableDaysInFuture:a}}applyThemeConfig(n){if(n)for(const[e,t]of Object.entries(n))this.host.style.setProperty(`${e}`,t)}onFeedbackClick(n){n.preventDefault(),this.showFeedbackModal=!0}redirectToCustomUrl(n){window.location.assign(n)}render(){var p,w,f,v,k,T,I,B,_,x,D,z;const n=this.mode==="app",e=(p=this.baseProvider)==null?void 0:p.getStore("scheduler"),t=e==null?void 0:e.get("eventInfo"),o=e==null?void 0:e.get("showBookingForm"),s=e==null?void 0:e.get("cancelledEventInfo"),a=e==null?void 0:e.get("cancelBookingId"),r=e==null?void 0:e.get("selectedTimeslot"),l=e==null?void 0:e.get("rescheduleBookingId"),c=e==null?void 0:e.get("organizerConfirmationBookingId"),u=e==null?void 0:e.get("rejectBookingId"),d=e==null?void 0:e.get("confirmedEventInfo"),g=(e==null?void 0:e.get("nylasBranding"))||this.nylasBranding,h=e==null?void 0:e.get("selectedDate"),m=(f=(w=e==null?void 0:e.get("configSettings"))==null?void 0:w.scheduler)==null?void 0:f.confirmation_redirect_url;if(this.selectedDateLabel=h&&this.language?i.capitalizeFirstLetter(h.toLocaleDateString(this.language,{dateStyle:"full"})):`${i.instance.t("noDateSelected")}`,n&&(a||u)&&!s)return i.h(i.Host,null,i.h(P,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},i.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},i.h("nylas-cancel-booking-form",{selectedTimeslot:r,cancelBookingId:a,rejectBookingId:u,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))),this.enableUserFeedback&&i.h("button-component",{id:"report-issue",variant:"basic",onClick:b=>this.onFeedbackClick(b)},i.h("feedback-icon",null)),this.showFeedbackModal&&i.h("nylas-feedback-form",null));if(n&&c)return i.h(i.Host,null,i.h(P,null,i.h("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},i.h("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:c,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))),this.enableUserFeedback&&i.h("button-component",{id:"report-issue",variant:"basic",onClick:b=>this.onFeedbackClick(b)},i.h("feedback-icon",null)),this.showFeedbackModal&&i.h("nylas-feedback-form",null));if(n&&s)return i.h(i.Host,null,i.h(P,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},i.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},i.h("nylas-cancelled-event-card",{cancelledEventInfo:s,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&i.h("button-component",{id:"report-issue",variant:"basic",onClick:b=>this.onFeedbackClick(b)},i.h("feedback-icon",null)),this.showFeedbackModal&&i.h("nylas-feedback-form",null));if(n&&d)return i.h(i.Host,null,i.h(P,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},i.h("div",{class:"cancelled-event-page",part:"confirmed-event-page"},i.h("nylas-confirmed-event-card",{confirmedEventInfo:d,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&i.h("button-component",{id:"report-issue",variant:"basic",onClick:b=>this.onFeedbackClick(b)},i.h("feedback-icon",null)),this.showFeedbackModal&&i.h("nylas-feedback-form",null));if(n&&t&&m){const b=(v=this.bookingInfoConfirmed)==null?void 0:v.primaryParticipant,S=(k=this.bookingInfoConfirmed)==null?void 0:k.location,A=(T=this.bookingInfoConfirmed)==null?void 0:T.booking_ref,F=((I=this.bookingInfoConfirmed)==null?void 0:I.additionalFields)||{};if(this.bookingInfo&&typeof((B=this.bookingInfo)==null?void 0:B.additionalFields)<"u"){const O=this.bookingInfo.additionalFields;Object.keys(O).forEach(N=>{!F[N]&&(O!=null&&O[N])&&(F[N]=O[N].value)})}const y=(_=this.stores)==null?void 0:_.scheduler.get("selectedTimeslot"),C=(x=this.stores)==null?void 0:x.scheduler.get("selectedTimezone"),U=(D=this.stores)==null?void 0:D.scheduler.get("selectedLanguage"),$=(z=this.stores)==null?void 0:z.scheduler.get("configSettings"),j=this.configurationId?this.configurationId:$==null?void 0:$.configuration_id,Y=window.location.search,E=new URLSearchParams(Y);E.set("booking_id",t.booking_id),b!=null&&b.name&&E.set("name",b.name),b!=null&&b.email&&E.set("email",b.email),y!=null&&y.start_time&&E.set("start_time",(new Date(y.start_time).getTime()/1e3).toString()),y!=null&&y.end_time&&E.set("end_time",(new Date(y.end_time).getTime()/1e3).toString()),C&&E.set("tz",C),U&&E.set("language",U),F&&E.set("additional_values",JSON.stringify(F)),this.slug&&E.set("page_slug",this.slug),j&&E.set("config_id",j),S&&E.set("location",S),A&&E.set("booking_ref",A),this.redirectToCustomUrl(`${m}?${E.toString()}`);return}if(n&&t)return i.h(i.Host,null,i.h(P,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},i.h("div",{class:"booked-event-page",part:"booked-event-page ns_booked-event-page"},i.h("nylas-booked-event-card",{selectedTimeslot:r,eventInfo:t,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))),this.enableUserFeedback&&i.h("button-component",{id:"report-issue",variant:"basic",onClick:b=>this.onFeedbackClick(b)},i.h("feedback-icon",null)),this.showFeedbackModal&&i.h("nylas-feedback-form",null));if(n&&(!t||l)&&!o){const b=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return i.h(i.Host,null,i.h(P,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},l&&i.h(W,null,`${i.instance.t("rescheduleTitle")}`),i.h("div",{class:"select-date-page",part:"select-date-page ns_select-date-page"},i.h("div",{class:"left-panel",part:"ns_left-panel"},i.h("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),i.h("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),i.h("div",{class:`right-panel ${l?"reschedule":""}`,part:`ns_right-panel ${l?"ns_reschedule":""}`},i.h("h2",{part:"ns_right-panel__title"},i.h("calendar-icon",{part:"ns_right-panel__calendar-icon"}),i.h("span",{id:"selectedDate",part:"ns_right-panel__selected-date"},this.selectedDateLabel)),i.h("nylas-timeslot-picker",{exportparts:"ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},b&&i.h("span",{slot:"timeslot-picker-cta-label"},i.h("slot",{name:"timeslot-picker-cta-label"})))))),this.enableUserFeedback&&i.h("button-component",{id:"report-issue",variant:"basic",onClick:S=>this.onFeedbackClick(S)},i.h("feedback-icon",null)),this.showFeedbackModal&&i.h("nylas-feedback-form",null))}return n&&!t&&o?i.h(i.Host,null,i.h(P,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},l&&i.h(W,null,`${i.instance.t("rescheduleTitle")}`),i.h("div",{class:"additional-data-page",part:"additional-data-page ns_additional-data-page"},i.h("div",{class:"left-panel ns_left-panel",part:"ns_left-panel"},i.h("div",{class:"wrapper",part:"ns_left-panel__wrapper"},i.h("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),i.h("div",{class:`right-panel ${l?"reschedule":""}`,part:`ns_right-panel ${l?"ns_reschedule":""}`},i.h("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"})))),this.enableUserFeedback&&i.h("button-component",{id:"report-issue",variant:"basic",onClick:b=>this.onFeedbackClick(b)},i.h("feedback-icon",null)),this.showFeedbackModal&&i.h("nylas-feedback-form",null)):i.h(i.Host,null,i.h("slot",null))}get host(){return i.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],themeConfig:["themeConfigChanged"]}}};J.style=te;exports.nylas_scheduling=J;
@@ -1,16 +0,0 @@
1
- import { r as s, h as t } from "./index-e8380973.js";
2
- import "react";
3
- import "react/jsx-runtime";
4
- import "react-dom";
5
- const e = ".sc-play-icon-h{display:flex}", i = e, r = class {
6
- constructor(o) {
7
- s(this, o), this.width = "15", this.height = "15";
8
- }
9
- render() {
10
- return t("svg", { key: "bd7e6c0150dac4f37e144c9750140dd990612a40", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "785ae52fc510f9d7a9a478027c7e392580134425", d: "M21 12L3 21V3L21 12Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
11
- }
12
- };
13
- r.style = i;
14
- export {
15
- r as play_icon
16
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-1e75512f.cjs");require("react");require("react/jsx-runtime");require("react-dom");const c=".sc-sent-icon-h{display:flex}",i=c,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"8ef0cc601ee3b4eee35b06dd2e703b78097db2f3",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"48e4732c8b29a8f67d5c05d949e526bb3d8265d2",d:"M21.5 12L3.5 3.5L3.5 20.5L21.5 12Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"ac59135a61f3304c0ea3d5905eec1cafc47d91cd",d:"M3.5 3.5L12 10.5",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"6200596d2992c44eb57da99e86e0fccfab225ce8",d:"M3.5 20.5L12 13.5",stroke:"auto","stroke-width":"1.5"}))}};t.style=i;exports.sent_icon=t;
@@ -1,16 +0,0 @@
1
- import { r as s, h as t } from "./index-e8380973.js";
2
- import "react";
3
- import "react/jsx-runtime";
4
- import "react-dom";
5
- const o = ".sc-sent-icon-h{display:flex}", c = o, i = class {
6
- constructor(e) {
7
- s(this, e), this.width = "15", this.height = "15";
8
- }
9
- render() {
10
- return t("svg", { key: "8ef0cc601ee3b4eee35b06dd2e703b78097db2f3", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "48e4732c8b29a8f67d5c05d949e526bb3d8265d2", d: "M21.5 12L3.5 3.5L3.5 20.5L21.5 12Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "ac59135a61f3304c0ea3d5905eec1cafc47d91cd", d: "M3.5 3.5L12 10.5", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "6200596d2992c44eb57da99e86e0fccfab225ce8", d: "M3.5 20.5L12 13.5", stroke: "auto", "stroke-width": "1.5" }));
11
- }
12
- };
13
- i.style = c;
14
- export {
15
- i as sent_icon
16
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-1e75512f.cjs");require("react");require("react/jsx-runtime");require("react-dom");const i=".sc-spam-icon-h{display:flex}",r=i,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"e4b51898e2533ea3cd40a8b7a97fdd65e65a07fd",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"203ee22867f877e1744ebcdaa1fd0ca084f8cb6b",d:"M20 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H20C21.1046 21 22 20.1046 22 19V5C22 3.89543 21.1046 3 20 3Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"8541a8d9c8dc64e909f6de9d58381ba10380b1f6",d:"M2 5L12 12.5L22 5",stroke:"auto","stroke-width":"1.5"}))}};t.style=r;exports.spam_icon=t;
@@ -1,16 +0,0 @@
1
- import { r as s, h as t } from "./index-e8380973.js";
2
- import "react";
3
- import "react/jsx-runtime";
4
- import "react-dom";
5
- const o = ".sc-spam-icon-h{display:flex}", i = o, a = class {
6
- constructor(e) {
7
- s(this, e), this.width = "15", this.height = "15";
8
- }
9
- render() {
10
- return t("svg", { key: "e4b51898e2533ea3cd40a8b7a97fdd65e65a07fd", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "203ee22867f877e1744ebcdaa1fd0ca084f8cb6b", d: "M20 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H20C21.1046 21 22 20.1046 22 19V5C22 3.89543 21.1046 3 20 3Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "8541a8d9c8dc64e909f6de9d58381ba10380b1f6", d: "M2 5L12 12.5L22 5", stroke: "auto", "stroke-width": "1.5" }));
11
- }
12
- };
13
- a.style = i;
14
- export {
15
- a as spam_icon
16
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-1e75512f.cjs");require("react");require("react/jsx-runtime");require("react-dom");const i=".sc-trash-fill-icon-h{display:flex}",h=i,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"ad2097e898ad6426697c0be069096cba0bce325d",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"5069815e3a78b039700962c41f82fe83a9911787",d:"M3 6H5H21",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"709eb0e7ba963e5f06bf2686e3cb7575034bf396",d:"M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"65f9c4e6f7f5bb3776bebaeb4ab5daef8ca99cfb",d:"M10 11V17",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"97555b9bba0b031d02856bffc99db16fa1225966",d:"M14 11V17",stroke:"auto","stroke-width":"1.5"}))}};t.style=h;exports.trash_fill_icon=t;
@@ -1,16 +0,0 @@
1
- import { r as s, h as t } from "./index-e8380973.js";
2
- import "react";
3
- import "react/jsx-runtime";
4
- import "react-dom";
5
- const o = ".sc-trash-fill-icon-h{display:flex}", a = o, i = class {
6
- constructor(e) {
7
- s(this, e), this.width = "15", this.height = "15";
8
- }
9
- render() {
10
- return t("svg", { key: "ad2097e898ad6426697c0be069096cba0bce325d", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "5069815e3a78b039700962c41f82fe83a9911787", d: "M3 6H5H21", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "709eb0e7ba963e5f06bf2686e3cb7575034bf396", d: "M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "65f9c4e6f7f5bb3776bebaeb4ab5daef8ca99cfb", d: "M10 11V17", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "97555b9bba0b031d02856bffc99db16fa1225966", d: "M14 11V17", stroke: "auto", "stroke-width": "1.5" }));
11
- }
12
- };
13
- i.style = a;
14
- export {
15
- i as trash_fill_icon
16
- };
@@ -1,16 +0,0 @@
1
- import { r as n, h as t } from "./index-e8380973.js";
2
- import "react";
3
- import "react/jsx-runtime";
4
- import "react-dom";
5
- const r = ".sc-warning-icon-h{display:flex}", s = r, e = class {
6
- constructor(i) {
7
- n(this, i), this.width = "16", this.height = "16";
8
- }
9
- render() {
10
- return t("svg", { key: "28614e2b11b84f94fe14363668367e901ccc33b0", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "0f5b29190a240a22b0ebc4c8638f1593d9f0f08c", d: "M7.68551 1.35232L1.12678 13.2773C0.576954 14.277 1.3002 15.5002 2.4411 15.5002H15.5586C16.6995 15.5002 17.4227 14.277 16.8729 13.2773L10.3142 1.35232C9.74426 0.316153 8.2554 0.316157 7.68551 1.35232ZM8.99982 5.25016C9.41403 5.25016 9.74982 5.58595 9.74982 6.00016V10.0002C9.74982 10.4144 9.41403 10.7502 8.99982 10.7502C8.5856 10.7502 8.24982 10.4144 8.24982 10.0002V6.00016C8.24982 5.58595 8.5856 5.25016 8.99982 5.25016ZM9.74982 12.2502C9.74982 12.6644 9.41403 13.0002 8.99982 13.0002C8.5856 13.0002 8.24982 12.6644 8.24982 12.2502C8.24982 11.8359 8.5856 11.5002 8.99982 11.5002C9.41403 11.5002 9.74982 11.8359 9.74982 12.2502Z", fill: "currentColor" }));
11
- }
12
- };
13
- e.style = s;
14
- export {
15
- e as warning_icon
16
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-1e75512f.cjs");require("react");require("react/jsx-runtime");require("react-dom");const n=".sc-warning-icon-h{display:flex}",r=n,t=class{constructor(i){e.registerInstance(this,i),this.width="16",this.height="16"}render(){return e.h("svg",{key:"28614e2b11b84f94fe14363668367e901ccc33b0",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"0f5b29190a240a22b0ebc4c8638f1593d9f0f08c",d:"M7.68551 1.35232L1.12678 13.2773C0.576954 14.277 1.3002 15.5002 2.4411 15.5002H15.5586C16.6995 15.5002 17.4227 14.277 16.8729 13.2773L10.3142 1.35232C9.74426 0.316153 8.2554 0.316157 7.68551 1.35232ZM8.99982 5.25016C9.41403 5.25016 9.74982 5.58595 9.74982 6.00016V10.0002C9.74982 10.4144 9.41403 10.7502 8.99982 10.7502C8.5856 10.7502 8.24982 10.4144 8.24982 10.0002V6.00016C8.24982 5.58595 8.5856 5.25016 8.99982 5.25016ZM9.74982 12.2502C9.74982 12.6644 9.41403 13.0002 8.99982 13.0002C8.5856 13.0002 8.24982 12.6644 8.24982 12.2502C8.24982 11.8359 8.5856 11.5002 8.99982 11.5002C9.41403 11.5002 9.74982 11.8359 9.74982 12.2502Z",fill:"currentColor"}))}};t.style=r;exports.warning_icon=t;