@nylas/web-elements 2.2.3 → 2.2.4
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.
- package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +6 -6
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +8 -4
- package/dist/cjs/{abstract-provider-DgXx6GdP.js → abstract-provider-zsdLocfY.js} +3 -3
- package/dist/cjs/{abstract-provider-DgXx6GdP.js.map → abstract-provider-zsdLocfY.js.map} +1 -1
- package/dist/cjs/calendar-agenda-fill-icon_37.cjs.entry.js +2 -2
- package/dist/cjs/checkbox-group_4.cjs.entry.js +3 -3
- package/dist/cjs/checkmark-icon_15.cjs.entry.js +2 -2
- package/dist/cjs/{customParseFormat-Bdpj2-4E.js → customParseFormat-C-iBDSmX.js} +3 -3
- package/dist/cjs/{customParseFormat-Bdpj2-4E.js.map → customParseFormat-C-iBDSmX.js.map} +1 -1
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +6 -6
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/input-component.cjs.entry.js +1 -1
- package/dist/cjs/input-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/multi-select-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/{nylas-api-request-DJrUeZUS.js → nylas-api-request-NWvuBdgU.js} +3 -3
- package/dist/cjs/{nylas-api-request-DJrUeZUS.js.map → nylas-api-request-NWvuBdgU.js.map} +1 -1
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js +2 -2
- package/dist/cjs/nylas-date-component_2.cjs.entry.js +2 -2
- package/dist/cjs/nylas-form-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +5 -5
- package/dist/cjs/nylas-scheduling.cjs.entry.js +5 -5
- package/dist/cjs/{register-component-BUZgs2ll.js → register-component-CdldTaNr.js} +3 -3
- package/dist/cjs/{register-component-BUZgs2ll.js.map → register-component-CdldTaNr.js.map} +1 -1
- package/dist/cjs/textarea-component.cjs.entry.js +1 -1
- package/dist/cjs/{utils-CwHkARFg.js → utils-BaL-chu7.js} +10 -3
- package/dist/{esm/utils-DnxlJ1jl.js.map → cjs/utils-BaL-chu7.js.map} +1 -1
- package/dist/collection/utils/utils.js +8 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/input-component.js +1 -1
- package/dist/components/input-image-url.js +1 -1
- package/dist/components/multi-select-dropdown.js +1 -1
- package/dist/components/nylas-additional-participants.js +1 -1
- package/dist/components/nylas-availability-picker.js +1 -1
- package/dist/components/nylas-booked-event-card.js +1 -1
- package/dist/components/nylas-booking-calendar-picker.js +1 -1
- package/dist/components/nylas-booking-confirmation-redirect.js +1 -1
- package/dist/components/nylas-booking-confirmation-type.js +1 -1
- package/dist/components/nylas-booking-form-config.js +1 -1
- package/dist/components/nylas-booking-form.js +1 -1
- package/dist/components/nylas-buffer-time.js +1 -1
- package/dist/components/nylas-calendar-picker.js +1 -1
- package/dist/components/nylas-cancel-booking-form.js +1 -1
- package/dist/components/nylas-cancellation-policy.js +1 -1
- package/dist/components/nylas-cancelled-event-card.js +1 -1
- package/dist/components/nylas-confirmation-email.js +1 -1
- package/dist/components/nylas-confirmed-event-card.js +1 -1
- package/dist/components/nylas-connected-calendars.js +1 -1
- package/dist/components/nylas-custom-booking-flow.js +1 -1
- package/dist/components/nylas-custom-event-slug.js +1 -1
- package/dist/components/nylas-customize-booking-settings.js +1 -1
- package/dist/components/nylas-date-component.js +1 -1
- package/dist/components/nylas-date-picker.js +1 -1
- package/dist/components/nylas-disable-emails.js +1 -1
- package/dist/components/nylas-editor-tabs-group.js +1 -1
- package/dist/components/nylas-editor-tabs.js +1 -1
- package/dist/components/nylas-event-calendar.js +1 -1
- package/dist/components/nylas-event-capacity.js +1 -1
- package/dist/components/nylas-event-description.js +1 -1
- package/dist/components/nylas-event-duration.js +1 -1
- package/dist/components/nylas-event-info.js +1 -1
- package/dist/components/nylas-event-limits.js +1 -1
- package/dist/components/nylas-event-location.js +1 -1
- package/dist/components/nylas-event-timeslot.js +1 -1
- package/dist/components/nylas-event-title.js +1 -1
- package/dist/components/nylas-feedback-form.js +1 -1
- package/dist/components/nylas-form-card.js +1 -1
- package/dist/components/nylas-limit-future-bookings.js +1 -1
- package/dist/components/nylas-list-configurations.js +1 -1
- package/dist/components/nylas-locale-switch.js +1 -1
- package/dist/components/nylas-min-booking-notice.js +1 -1
- package/dist/components/nylas-min-cancellation-notice.js +1 -1
- package/dist/components/nylas-notification.js +1 -1
- package/dist/components/nylas-organizer-confirmation-card.js +1 -1
- package/dist/components/nylas-page-name.js +1 -1
- package/dist/components/nylas-page-styling.js +1 -1
- package/dist/components/nylas-participant-booking-calendars.js +1 -1
- package/dist/components/nylas-participants-custom-availability.js +1 -1
- package/dist/components/nylas-reminder-emails.js +1 -1
- package/dist/components/nylas-reminder-time.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +55 -55
- package/dist/components/nylas-scheduling-method.js +1 -1
- package/dist/components/nylas-scheduling.js +21 -21
- package/dist/components/nylas-select-event-type.js +1 -1
- package/dist/components/nylas-selected-event-card.js +1 -1
- package/dist/components/nylas-specific-time-availability-picker.js +1 -1
- package/dist/components/nylas-time-window-picker.js +1 -1
- package/dist/components/nylas-timeslot-interval.js +1 -1
- package/dist/components/nylas-timeslot-picker.js +1 -1
- package/dist/components/{p-CURQD4Ll.js → p--1ZpL3Z_.js} +8 -8
- package/dist/components/{p-CURQD4Ll.js.map → p--1ZpL3Z_.js.map} +1 -1
- package/dist/components/{p-DmZgeeQD.js → p--EFSc8kQ.js} +4 -4
- package/dist/components/{p-DmZgeeQD.js.map → p--EFSc8kQ.js.map} +1 -1
- package/dist/components/{p-dosNJKV2.js → p-B1vZbLyd.js} +4 -4
- package/dist/components/{p-dosNJKV2.js.map → p-B1vZbLyd.js.map} +1 -1
- package/dist/components/{p-DM4H8E4y.js → p-B3Mdq6rL.js} +4 -4
- package/dist/components/{p-DM4H8E4y.js.map → p-B3Mdq6rL.js.map} +1 -1
- package/dist/components/{p-DGxaBD9x.js → p-B7v1iPw1.js} +3 -3
- package/dist/components/{p-DGxaBD9x.js.map → p-B7v1iPw1.js.map} +1 -1
- package/dist/components/{p-DEy4gcRj.js → p-B86z20mN.js} +41 -41
- package/dist/components/{p-DEy4gcRj.js.map → p-B86z20mN.js.map} +1 -1
- package/dist/components/{p-CB2_BMlD.js → p-B9BW5SHF.js} +6 -6
- package/dist/components/{p-CB2_BMlD.js.map → p-B9BW5SHF.js.map} +1 -1
- package/dist/components/{p-BuZyzxqv.js → p-B9uipWU2.js} +4 -4
- package/dist/components/{p-BuZyzxqv.js.map → p-B9uipWU2.js.map} +1 -1
- package/dist/components/{p-DSO080eR.js → p-BDayBBhB.js} +5 -5
- package/dist/components/{p-DSO080eR.js.map → p-BDayBBhB.js.map} +1 -1
- package/dist/components/{p-BEAD1juA.js → p-BFNg3bKj.js} +5 -5
- package/dist/components/{p-BEAD1juA.js.map → p-BFNg3bKj.js.map} +1 -1
- package/dist/components/{p-CzJz0rnK.js → p-BI0Stv78.js} +17 -17
- package/dist/components/{p-CzJz0rnK.js.map → p-BI0Stv78.js.map} +1 -1
- package/dist/components/{p-D-2UWdRa.js → p-BKk2JkBe.js} +5 -5
- package/dist/components/{p-D-2UWdRa.js.map → p-BKk2JkBe.js.map} +1 -1
- package/dist/components/{p-C1-hLcxk.js → p-BQ1_MrWH.js} +3 -3
- package/dist/components/{p-C1-hLcxk.js.map → p-BQ1_MrWH.js.map} +1 -1
- package/dist/components/{p-D_R3qufs.js → p-BQIvfRRF.js} +3 -3
- package/dist/components/{p-D_R3qufs.js.map → p-BQIvfRRF.js.map} +1 -1
- package/dist/components/{p-mN6J_IWv.js → p-BV55-Kie.js} +5 -5
- package/dist/components/{p-mN6J_IWv.js.map → p-BV55-Kie.js.map} +1 -1
- package/dist/components/{p-CKuq2LL7.js → p-B_imcHCC.js} +5 -5
- package/dist/components/{p-CKuq2LL7.js.map → p-B_imcHCC.js.map} +1 -1
- package/dist/components/{p-CuHnb1-_.js → p-Bb0z-pD8.js} +5 -5
- package/dist/components/{p-CuHnb1-_.js.map → p-Bb0z-pD8.js.map} +1 -1
- package/dist/components/{p-5XVfomzJ.js → p-BdOvTsvK.js} +4 -4
- package/dist/components/{p-5XVfomzJ.js.map → p-BdOvTsvK.js.map} +1 -1
- package/dist/components/{p-DlaQufsy.js → p-Bm9KAv3a.js} +5 -5
- package/dist/components/{p-DlaQufsy.js.map → p-Bm9KAv3a.js.map} +1 -1
- package/dist/components/{p-DSSPyNIm.js → p-Br9o8ik9.js} +5 -5
- package/dist/components/{p-DSSPyNIm.js.map → p-Br9o8ik9.js.map} +1 -1
- package/dist/components/{p-Byz3JKQu.js → p-C5CEB4Wv.js} +4 -4
- package/dist/components/{p-Byz3JKQu.js.map → p-C5CEB4Wv.js.map} +1 -1
- package/dist/components/{p-C2yVHIMC.js → p-C8R_xU8K.js} +4 -4
- package/dist/components/{p-C2yVHIMC.js.map → p-C8R_xU8K.js.map} +1 -1
- package/dist/components/{p-BeD_Q4wQ.js → p-CEO6ZorI.js} +4 -4
- package/dist/components/{p-BeD_Q4wQ.js.map → p-CEO6ZorI.js.map} +1 -1
- package/dist/components/{p-BWZppI8r.js → p-CHDVqP3u.js} +5 -5
- package/dist/components/{p-BWZppI8r.js.map → p-CHDVqP3u.js.map} +1 -1
- package/dist/components/{p-2BdSZySU.js → p-CULO8bTo.js} +10 -3
- package/dist/components/{p-2BdSZySU.js.map → p-CULO8bTo.js.map} +1 -1
- package/dist/components/{p-Ci-3P4oO.js → p-Ce1kG2WA.js} +3 -3
- package/dist/components/{p-Ci-3P4oO.js.map → p-Ce1kG2WA.js.map} +1 -1
- package/dist/components/{p-DMDjzHug.js → p-ClSuoTwF.js} +7 -7
- package/dist/components/{p-DMDjzHug.js.map → p-ClSuoTwF.js.map} +1 -1
- package/dist/components/{p-B02Z2Glh.js → p-ClgCA2l0.js} +3 -3
- package/dist/components/{p-B02Z2Glh.js.map → p-ClgCA2l0.js.map} +1 -1
- package/dist/components/{p-CBysed0C.js → p-CrQflZZw.js} +8 -8
- package/dist/components/{p-CBysed0C.js.map → p-CrQflZZw.js.map} +1 -1
- package/dist/components/{p-Vc2ZLSUH.js → p-Cs-xmxxD.js} +4 -4
- package/dist/components/{p-Vc2ZLSUH.js.map → p-Cs-xmxxD.js.map} +1 -1
- package/dist/components/{p-CKsgq31s.js → p-Cs0aVgFp.js} +6 -6
- package/dist/components/{p-CKsgq31s.js.map → p-Cs0aVgFp.js.map} +1 -1
- package/dist/components/{p-DZGwcMTu.js → p-CtNJhj7s.js} +3 -3
- package/dist/components/{p-DZGwcMTu.js.map → p-CtNJhj7s.js.map} +1 -1
- package/dist/components/{p-DjlPLeVk.js → p-Cvb13C1p.js} +4 -4
- package/dist/components/{p-DjlPLeVk.js.map → p-Cvb13C1p.js.map} +1 -1
- package/dist/components/{p-C16rvsMT.js → p-Cw7ajY2U.js} +4 -4
- package/dist/components/{p-C16rvsMT.js.map → p-Cw7ajY2U.js.map} +1 -1
- package/dist/components/{p-Cu74bJsj.js → p-D-TAjvsg.js} +6 -6
- package/dist/components/{p-Cu74bJsj.js.map → p-D-TAjvsg.js.map} +1 -1
- package/dist/components/{p-CHs824QK.js → p-D4-3Jhnx.js} +5 -5
- package/dist/components/{p-CHs824QK.js.map → p-D4-3Jhnx.js.map} +1 -1
- package/dist/components/{p-NvfvY9LE.js → p-D50fisuR.js} +5 -5
- package/dist/components/{p-NvfvY9LE.js.map → p-D50fisuR.js.map} +1 -1
- package/dist/components/{p-CKg1LT6_.js → p-D5apK1Vq.js} +4 -4
- package/dist/components/{p-CKg1LT6_.js.map → p-D5apK1Vq.js.map} +1 -1
- package/dist/components/{p-Dfd5wo37.js → p-D6dFiHrw.js} +4 -4
- package/dist/components/{p-Dfd5wo37.js.map → p-D6dFiHrw.js.map} +1 -1
- package/dist/components/{p-C6SF5Gq_.js → p-DAJXx2tg.js} +7 -7
- package/dist/components/{p-C6SF5Gq_.js.map → p-DAJXx2tg.js.map} +1 -1
- package/dist/components/{p-MX2k8GbG.js → p-DBRBbTgP.js} +3 -3
- package/dist/components/{p-MX2k8GbG.js.map → p-DBRBbTgP.js.map} +1 -1
- package/dist/components/{p-jbmfeNc8.js → p-DCM7ntGT.js} +5 -5
- package/dist/components/{p-jbmfeNc8.js.map → p-DCM7ntGT.js.map} +1 -1
- package/dist/components/{p-CmY1th_s.js → p-DNkQVYN2.js} +8 -8
- package/dist/components/{p-CmY1th_s.js.map → p-DNkQVYN2.js.map} +1 -1
- package/dist/components/{p-CLQqLmc2.js → p-DOSWGUBW.js} +4 -4
- package/dist/components/{p-CLQqLmc2.js.map → p-DOSWGUBW.js.map} +1 -1
- package/dist/components/{p-C9ADvO-t.js → p-DTpqylfB.js} +5 -5
- package/dist/components/{p-C9ADvO-t.js.map → p-DTpqylfB.js.map} +1 -1
- package/dist/components/{p-DMpwL-p1.js → p-DUV1Jj8E.js} +4 -4
- package/dist/components/{p-DMpwL-p1.js.map → p-DUV1Jj8E.js.map} +1 -1
- package/dist/components/{p-Dq6X5eqK.js → p-DWA-qoxj.js} +5 -5
- package/dist/components/{p-Dq6X5eqK.js.map → p-DWA-qoxj.js.map} +1 -1
- package/dist/components/{p-CPMSwD22.js → p-Dh07gHmd.js} +4 -4
- package/dist/components/{p-CPMSwD22.js.map → p-Dh07gHmd.js.map} +1 -1
- package/dist/components/{p-CFOX1cL3.js → p-DjX1ll1V.js} +4 -4
- package/dist/components/{p-CFOX1cL3.js.map → p-DjX1ll1V.js.map} +1 -1
- package/dist/components/{p-BEmFBKxz.js → p-DnoDC0Rk.js} +4 -4
- package/dist/components/{p-BEmFBKxz.js.map → p-DnoDC0Rk.js.map} +1 -1
- package/dist/components/{p-x0Q884CI.js → p-Dnw0IV6v.js} +3 -3
- package/dist/components/{p-x0Q884CI.js.map → p-Dnw0IV6v.js.map} +1 -1
- package/dist/components/{p-vvfFiGWj.js → p-DpEIiPGz.js} +5 -5
- package/dist/components/{p-vvfFiGWj.js.map → p-DpEIiPGz.js.map} +1 -1
- package/dist/components/{p-BnY2Hut1.js → p-DpkYFbEV.js} +5 -5
- package/dist/components/{p-BnY2Hut1.js.map → p-DpkYFbEV.js.map} +1 -1
- package/dist/components/{p--4oNPYSm.js → p-DtDGPXZR.js} +3 -3
- package/dist/components/{p--4oNPYSm.js.map → p-DtDGPXZR.js.map} +1 -1
- package/dist/components/{p-xh3aXihe.js → p-FoOzqqac.js} +4 -4
- package/dist/components/{p-xh3aXihe.js.map → p-FoOzqqac.js.map} +1 -1
- package/dist/components/{p-Dv7dtg64.js → p-JCwXrScM.js} +4 -4
- package/dist/components/{p-Dv7dtg64.js.map → p-JCwXrScM.js.map} +1 -1
- package/dist/components/{p-1rV-8ZUh.js → p-SPJ9n09E.js} +4 -4
- package/dist/components/{p-1rV-8ZUh.js.map → p-SPJ9n09E.js.map} +1 -1
- package/dist/components/{p-BtGEJFmy.js → p-Y0BOy8RT.js} +5 -5
- package/dist/components/{p-BtGEJFmy.js.map → p-Y0BOy8RT.js.map} +1 -1
- package/dist/components/{p-Dtd_Ib72.js → p-ZAV15ivS.js} +4 -4
- package/dist/components/{p-Dtd_Ib72.js.map → p-ZAV15ivS.js.map} +1 -1
- package/dist/components/{p-Br3ELPNn.js → p-b2NfdiFD.js} +7 -7
- package/dist/components/{p-Br3ELPNn.js.map → p-b2NfdiFD.js.map} +1 -1
- package/dist/components/{p-DcoRpHVy.js → p-cT1Q8Q-G.js} +3 -3
- package/dist/components/{p-DcoRpHVy.js.map → p-cT1Q8Q-G.js.map} +1 -1
- package/dist/components/{p-BWEpzVzc.js → p-do98tB-v.js} +49 -49
- package/dist/components/{p-BWEpzVzc.js.map → p-do98tB-v.js.map} +1 -1
- package/dist/components/{p-BnOrZCZZ.js → p-eeUTE5dj.js} +5 -5
- package/dist/components/{p-BnOrZCZZ.js.map → p-eeUTE5dj.js.map} +1 -1
- package/dist/components/{p-D3Env71G.js → p-y65kyIKd.js} +5 -5
- package/dist/components/{p-D3Env71G.js.map → p-y65kyIKd.js.map} +1 -1
- package/dist/components/textarea-component.js +1 -1
- package/dist/components/time-period-selector.js +1 -1
- package/dist/esm/{abstract-provider-Q7IKOl7h.js → abstract-provider-BB9roR3Q.js} +3 -3
- package/dist/esm/{abstract-provider-Q7IKOl7h.js.map → abstract-provider-BB9roR3Q.js.map} +1 -1
- package/dist/esm/calendar-agenda-fill-icon_37.entry.js +2 -2
- package/dist/esm/checkbox-group_4.entry.js +3 -3
- package/dist/esm/checkmark-icon_15.entry.js +2 -2
- package/dist/esm/{customParseFormat-gHKplwOp.js → customParseFormat-CjpPVRFa.js} +3 -3
- package/dist/esm/{customParseFormat-gHKplwOp.js.map → customParseFormat-CjpPVRFa.js.map} +1 -1
- package/dist/esm/google-logo-icon_6.entry.js +6 -6
- package/dist/esm/index.js +2 -2
- package/dist/esm/input-component.entry.js +1 -1
- package/dist/esm/input-dropdown_2.entry.js +1 -1
- package/dist/esm/multi-select-dropdown.entry.js +1 -1
- package/dist/esm/{nylas-api-request-Coaaqm1X.js → nylas-api-request-CbAsnDfU.js} +3 -3
- package/dist/esm/{nylas-api-request-Coaaqm1X.js.map → nylas-api-request-CbAsnDfU.js.map} +1 -1
- package/dist/esm/nylas-booked-event-card_11.entry.js +2 -2
- package/dist/esm/nylas-date-component_2.entry.js +2 -2
- package/dist/esm/nylas-form-card.entry.js +2 -2
- package/dist/esm/nylas-notification_2.entry.js +1 -1
- package/dist/esm/nylas-scheduler-editor.entry.js +5 -5
- package/dist/esm/nylas-scheduling.entry.js +5 -5
- package/dist/esm/{register-component-Bxz7u8ui.js → register-component-ocgdvMkV.js} +3 -3
- package/dist/esm/{register-component-Bxz7u8ui.js.map → register-component-ocgdvMkV.js.map} +1 -1
- package/dist/esm/textarea-component.entry.js +1 -1
- package/dist/esm/{utils-DnxlJ1jl.js → utils-C_2w_vhw.js} +10 -3
- package/dist/{cjs/utils-CwHkARFg.js.map → esm/utils-C_2w_vhw.js.map} +1 -1
- package/dist/nylas-web-elements/index.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/{p-83fab90d.entry.js → p-188523a9.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-dc3e8535.entry.js → p-219e3cc9.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-3b6e4413.entry.js → p-2262d385.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-2b2206aa.entry.js → p-2a10c747.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-aa2b9589.entry.js → p-4d43c9b1.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-9efadc84.entry.js → p-4ee0ae59.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-74a6fce6.entry.js → p-5cb4f7d7.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-2173b61a.entry.js → p-639a80ee.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-84c9a2b6.entry.js → p-74891f9e.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-B905HoVp.js → p-C5h3pVnq.js} +2 -2
- package/dist/nylas-web-elements/{p-B905HoVp.js.map → p-C5h3pVnq.js.map} +1 -1
- package/dist/nylas-web-elements/{p-DnxlJ1jl.js → p-C_2w_vhw.js} +2 -2
- package/dist/nylas-web-elements/{p-DnxlJ1jl.js.map → p-C_2w_vhw.js.map} +1 -1
- package/dist/nylas-web-elements/{p-Bq0zsHur.js → p-D6lQUyrh.js} +2 -2
- package/dist/nylas-web-elements/{p-Bq0zsHur.js.map → p-D6lQUyrh.js.map} +1 -1
- package/dist/nylas-web-elements/{p-hL_mOqrh.js → p-Dygm6M6b.js} +2 -2
- package/dist/nylas-web-elements/{p-hL_mOqrh.js.map → p-Dygm6M6b.js.map} +1 -1
- package/dist/nylas-web-elements/{p-e2ad4b2e.entry.js → p-ad78b292.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-768e56a0.entry.js → p-d37b7367.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-4eb6d084.entry.js → p-e3bdf91a.entry.js} +3 -3
- package/dist/nylas-web-elements/{p-f7fcae84.entry.js → p-e40b0d20.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-1b2c854d.entry.js → p-f31106cf.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-Cpf48kAH.js → p-mqq2iF4Q.js} +2 -2
- package/dist/nylas-web-elements/{p-Cpf48kAH.js.map → p-mqq2iF4Q.js.map} +1 -1
- package/package.json +1 -1
- /package/dist/nylas-web-elements/{p-83fab90d.entry.js.map → p-188523a9.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-dc3e8535.entry.js.map → p-219e3cc9.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3b6e4413.entry.js.map → p-2262d385.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2b2206aa.entry.js.map → p-2a10c747.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-aa2b9589.entry.js.map → p-4d43c9b1.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9efadc84.entry.js.map → p-4ee0ae59.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-74a6fce6.entry.js.map → p-5cb4f7d7.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2173b61a.entry.js.map → p-639a80ee.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-84c9a2b6.entry.js.map → p-74891f9e.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-e2ad4b2e.entry.js.map → p-ad78b292.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-768e56a0.entry.js.map → p-d37b7367.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-4eb6d084.entry.js.map → p-e3bdf91a.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f7fcae84.entry.js.map → p-e40b0d20.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-1b2c854d.entry.js.map → p-f31106cf.entry.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as e,F as t,r as n,c as i,H as s,a as r}from"./p-0EQQA0nE.js";import{N as o}from"./p-Cpf48kAH.js";import{N as a}from"./p-B905HoVp.js";import{d as c,u as l,t as u,a as d,g as h,b as f,i as p}from"./p-DnxlJ1jl.js";import{X as g}from"./p-CRJfdY84.js";import{c as y}from"./p-_i6H-yQH.js";import{C as w,L as b,a as m}from"./p-COJy29df.js";c.extend(l);c.extend(u);class v{constructor({nylasApiRequest:e,nylasSchedulerConfigStore:t}){this.groupEventsCache=new Map;this.CACHE_DURATION=1*60*1e3;this.nylasApiRequest=e;this.nylasSchedulerConfigStore=t}async currentUser(){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return null}return this.nylasApiRequest.currentUser()}async getCalendars(){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching calendars: Nylas API Request is not initialized"})}const e=[];let t=null;const n=50;do{const[i,s]=await this.nylasApiRequest.request({method:"GET",path:`calendars?limit=${n}${t?`&page_token=${t}`:""}`});if(s){return d(null,{message:"Error fetching calendars: "+s.message})}if(g(i)){return d(null,{message:"Error fetching calendars: "+i.error?.message})}e.push(...i.data);t=i.next_cursor||null}while(t);this.nylasSchedulerConfigStore.state.calendars=e;return d(e)}async getConfigurationById(e,t=false){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching configuration: Nylas API Request is not initialized"})}if(!t){const t=this.nylasSchedulerConfigStore.state.configurations.find((t=>t.id===e));if(t){this.nylasSchedulerConfigStore.state.selectedConfiguration=t;return d(t)}}const[n,i]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${e}`});if(i){return d(null,{message:"Error fetching configuration: "+i.message})}if(g(n)){return d(null,{message:"Error fetching configuration: "+n.error?.message})}this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data;if(this.nylasSchedulerConfigStore.state.configurations.find((t=>t.id===e))){this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map((t=>t.id===e?n.data:t))}else{this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data]}return d(n.data)}async getConfigurations(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching configurations: Nylas API Request is not initialized"})}const t=50;const[n,i]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations?limit=${t}${e?`&page_token=${e}`:""}`});if(i){return d(null,{message:"Error fetching configurations: "+i.message})}if(g(n)){return d(null,{message:"Error fetching configurations: "+n.error?.message})}this.nylasSchedulerConfigStore.state.configurations=n.data;this.nylasSchedulerConfigStore.state.listConfigurationsNextCursor=n.next_cursor||null;return d(n.data)}async getMasterEventById(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching master event: Nylas API Request is not initialized"})}const t=this.nylasSchedulerConfigStore.state.selectedGroupEvent;const n=t?.event?.calendar_id;if(!n){console.warn("Calendar ID is not present");return d(null,{message:"Error fetching master event: Calendar ID is not present"})}const i=new URLSearchParams;i.append("calendar_id",n);const[s,r]=await this.nylasApiRequest.request({method:"GET",path:`events/${e}?${i.toString()}`});if(r){return d(null,{message:"Error fetching master event: "+r.message})}if(g(s)){return d(null,{message:"Error fetching master event: "+s.error?.message})}const o=this.nylasSchedulerConfigStore.state.masterGroupEvents;if(o[e]){this.nylasSchedulerConfigStore.state.masterGroupEvents[e]=s.data}else{this.nylasSchedulerConfigStore.state.masterGroupEvents={...o,[e]:s.data}}return d(s.data)}async createConfiguration(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error creating configuration: Nylas API Request is not initialized"})}const[t,n]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations`,body:e});if(n){return d(null,{message:"Error creating configuration: "+n.message})}if(g(t)){return d(null,{message:"Error creating configuration: "+t.error?.message})}this.nylasSchedulerConfigStore.state.selectedConfiguration=t.data;this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,t.data];return d(t.data)}async updateConfiguration(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error updating configuration: Nylas API Request is not initialized"})}const[t,n]=await this.nylasApiRequest.request({method:"PUT",path:`scheduling/configurations/${e.id}`,body:e});if(n){return d(null,{message:"Error updating configuration: "+n.message})}if(g(t)){return d(null,{message:"Error updating configuration: "+t.error?.message})}this.nylasSchedulerConfigStore.state.selectedConfiguration=t.data;if(this.nylasSchedulerConfigStore.state.configurations.find((t=>t.id===e.id))){this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map((n=>n.id===e.id?t.data:n))}else{this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,t.data]}return d(t.data)}async deleteConfiguration(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error deleting configuration: Nylas API Request is not initialized"})}const[t,n]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${e}`});if(n){return d(null,{message:"Error deleting configuration: "+n.message})}if(g(t)){return d(null,{message:"Error deleting configuration: "+t.error?.message})}this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.filter((t=>t.id!==e));if(this.nylasSchedulerConfigStore.state.selectedConfiguration?.id===e){this.nylasSchedulerConfigStore.resetSelectedConfiguration()}return d(t.data)}async createGroupEvent(e,t){this.nylasSchedulerConfigStore.state.isLoading=true;if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error creating group event: Nylas API Request is not initialized"})}const[n,i]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${t}/group-events`,body:e});if(i){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error creating group event: "+i.message})}if(g(n)){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error creating group event: "+n.error?.message})}this.nylasSchedulerConfigStore.state.selectedGroupEvent=n.data;await this.getGroupEvents(t,this.nylasSchedulerConfigStore.state.selectedConfiguration);this.nylasSchedulerConfigStore.state.isLoading=false;return d(n.data)}async getGroupEvents(e,t){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching group events: Nylas API Request is not initialized"})}const n=new URLSearchParams;n.append("show_all","true");const i=this.nylasSchedulerConfigStore.state.calendarViewDateRange;let s;let r;if(i){s=i.start_time;r=i.end_time}else{const e=h((new Date).toISOString(),"week");s=e.startTime.toString();r=e.endTime.toString()}const o=`${e}-${s}-${r}`;const a=this.groupEventsCache.get(o);if(a&&Date.now()-a.timestamp<this.CACHE_DURATION){this.nylasSchedulerConfigStore.state.groupEvents=a.data;return d(a.data)}n.append("start_time",s);n.append("end_time",r);const c=t?.group_booking?.calendar_id;if(c){n.append("calendar_id",c)}const[l,u]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${e}/group-events?${n.toString()}`});if(u){return d(null,{message:"Error fetching group events: "+u.message})}if(g(l)){return d(null,{message:"Error fetching group events: "+l.error?.message})}this.groupEventsCache.set(o,{data:l.data,timestamp:Date.now()});this.cleanupExpiredCache();this.nylasSchedulerConfigStore.state.groupEvents=l.data;return d(l.data)}cleanupExpiredCache(){const e=Date.now();for(const[t,n]of this.groupEventsCache.entries()){if(e-n.timestamp>this.CACHE_DURATION){this.groupEventsCache.delete(t)}}}async updateGroupEventById(e,t){this.nylasSchedulerConfigStore.state.isLoading=true;if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error updating group event: Nylas API Request is not initialized"})}const n=e.id;delete e.id;const[i,s]=await this.nylasApiRequest.request({method:"PATCH",path:`scheduling/configurations/${t}/group-events/${n}`,body:e});if(s){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error updating group event: "+s.message})}if(g(i)){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error updating group event: "+i.error?.message})}this.nylasSchedulerConfigStore.state.selectedGroupEvent=i.data;await this.getGroupEvents(t,this.nylasSchedulerConfigStore.state.selectedConfiguration);this.nylasSchedulerConfigStore.state.isLoading=false;return d(i.data)}async updateGroupEvent(e,t,n){this.nylasSchedulerConfigStore.state.isLoading=true;const i=this.nylasSchedulerConfigStore.state.selectedGroupEvent;const s=i?.event?.master_event_id;const r=i?.event?.id;const o=i?.event?.when?.start_time;const a=i?.group_event_info?.rrule?.[0];const l=a?a.split(";").filter((e=>!e.startsWith("UNTIL"))).join(";"):"";const u=o?c(o*1e3).subtract(1,"minute").format("YYYYMMDDTHHmmss[Z]"):"";if(t==="this"){return this.updateGroupEventById({...e,id:r,recurrence:s?undefined:e.recurrence},n)}else if(t==="future"&&s){const t=await this.createGroupEvent(e,n);const r={location:i?.event?.location,conferencing:i?.event?.conferencing,title:i?.event?.title,description:i?.event?.description,capacity:i?.group_event_info?.capacity,calendar_id:i?.event?.calendar_id,recurrence:l?[l+";UNTIL="+u]:[`RRULE:FREQ=DAILY;UNTIL=${u}`]};await this.updateGroupEventById({...r,id:s},n);return[r,t]}else if(t==="all"){const t=e?.when;const r=i?.event?.when;const o=this.nylasSchedulerConfigStore.state.masterGroupEvents?.[s];let a=o?.when;if(t?.start_time!==r?.start_time){a={...a,start_time:t?.start_time||a?.start_time}}if(t?.end_time!==r?.end_time){a={...a,end_time:t?.end_time||a?.end_time}}if(t?.start_timezone!==r?.start_timezone){a={...a,start_timezone:t?.start_timezone||a?.start_timezone}}if(t?.end_timezone!==r?.end_timezone){a={...a,end_timezone:t?.end_timezone||a?.end_timezone}}return this.updateGroupEventById({...e,when:a,id:s},n)}this.nylasSchedulerConfigStore.state.isLoading=false;throw new Error("Invalid option")}async deleteGroupEvent(e,t,n){this.nylasSchedulerConfigStore.state.isLoading=true;const i=this.nylasSchedulerConfigStore.state.selectedGroupEvent;const s=i?.event?.master_event_id;const r=i?.event?.id;const o=i?.event?.when?.start_time;const a=i?.group_event_info?.rrule?.[0];const l=a?a.split(";").filter((e=>!e.startsWith("UNTIL"))).join(";"):"";const u=o?c(o*1e3).format("YYYYMMDDTHHmmss[Z]"):"";const d={location:i?.event?.location,conferencing:i?.event?.conferencing,title:i?.event?.title,description:i?.event?.description,capacity:i?.group_event_info?.capacity,calendar_id:i?.event?.calendar_id,recurrence:l?[l+";UNTIL="+u]:[`RRULE:UNTIL=${u}`]};if(t==="this"&&r){return this.deleteGroupEventById(r,n)}else if(t==="future"&&s&&r){await this.deleteGroupEventById(r,n);return await this.updateGroupEventById({...d,id:s},n)}else if(t==="all"&&s){return this.deleteGroupEventById(s,n)}this.nylasSchedulerConfigStore.state.isLoading=false;throw new Error("Invalid option")}async deleteGroupEventById(e,t){this.nylasSchedulerConfigStore.state.isLoading=true;if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error deleting group event: Nylas API Request is not initialized"})}const n=new URLSearchParams;const i=this.nylasSchedulerConfigStore.state.selectedConfiguration?.group_booking?.calendar_id;if(i){n.append("calendar_id",i)}const[s,r]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${t}/group-events/${e}?calendar_id=${i}`});if(r){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error deleting group event: "+r.message})}if(g(s)){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error deleting group event: "+s.error?.message})}await this.getGroupEvents(t,this.nylasSchedulerConfigStore.state.selectedConfiguration);this.nylasSchedulerConfigStore.state.isLoading=false;return d(s.data)}async importGroupEvent(e,t){this.nylasSchedulerConfigStore.state.isLoading=true;if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error importing group event: Nylas API Request is not initialized"})}const n=new URLSearchParams;const i=this.nylasSchedulerConfigStore.state.selectedConfiguration?.group_booking?.calendar_id;if(i){n.append("calendar_id",i)}const[s,r]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${t}/import-group-events?${n.toString()}`,body:e});if(r){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error importing group event: "+r.message})}if(g(s)){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error importing group event: "+s.error?.message})}if(s.data?.imported_events?.length>0){await this.getGroupEvents(t,this.nylasSchedulerConfigStore.state.selectedConfiguration)}this.nylasSchedulerConfigStore.state.isLoading=false;return d(s.data)}}class _{constructor({nylasApiRequest:e,nylasSchedulerConfigStore:t}){this.nylasApiRequest=e;this.nylasSchedulerConfigStore=t}init(){f("NylasSchedulerConfigConnector init")}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get schedulerConfig(){if(this._schedulerConfigConnector){return this._schedulerConfigConnector}this._schedulerConfigConnector=new v({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore});return this._schedulerConfigConnector}resetStores(){f("NylasSchedulerConfigConnector resetStores");this.nylasSchedulerConfigStore.reset()}async logout(){f("NylasSchedulerConfigConnector logout");this.resetStores()}}function E(e={}){const t={selectedConfiguration:{},configurations:[],groupEvents:[],listConfigurationsNextCursor:null,calendars:[],currentUser:null,action:null,additionalParticipants:[],requiresSlug:false,masterGroupEvents:{},isLoading:false,...e};const n=y(t);function i(){n.set("selectedConfiguration",{...e["selectedConfiguration"]})}n.onChange("action",(async e=>{if(!e){i()}}));return{...n,resetSelectedConfiguration:i}}class k{get(e){return new Promise((t=>{const n=globalThis.window?.localStorage.getItem(e);if(!n){t(null)}else{t(JSON.parse(n))}}))}async remove(e){globalThis.window?.localStorage.removeItem(e);return new Promise((e=>{e(null)}))}set(e,t){globalThis.window?.localStorage.setItem(e,JSON.stringify(t));return new Promise((e=>{e(null)}))}}const x="pkce";const C="grant";const $="user";const T=e=>{if(typeof globalThis.btoa==="function"&&typeof TextEncoder!=="undefined"){const t=(new TextEncoder).encode(e);let n="";for(let e=0;e<t.length;e++){n+=String.fromCharCode(t[e])}return globalThis.btoa(n)}if(typeof globalThis.Buffer!=="undefined"){return globalThis.Buffer.from(e,"utf8").toString("base64")}throw new Error("Base64 encoding is not supported in this environment")};const S=e=>{if(typeof globalThis.atob==="function"&&typeof TextDecoder!=="undefined"){const t=globalThis.atob(e);const n=new Uint8Array(t.length);for(let e=0;e<t.length;e++){n[e]=t.charCodeAt(e)}return(new TextDecoder).decode(n)}if(typeof globalThis.Buffer!=="undefined"){return globalThis.Buffer.from(e,"base64").toString("utf8")}throw new Error("Base64 decoding is not supported in this environment")};class P{Storage=new k;constructor(e){if(e){this.Storage=e;return}}setPKCE(e){const t=T(e);this.Storage.set(x,t)}async getPKCE(){try{const e=await this.Storage.get(x);if(e){return S(e)}}catch(e){return null}return null}removePKCE(){this.Storage.remove(x)}setGrant(e,t=false){const{grant_id:n}=e;this.Storage.set(`${C}${t?"-"+n:""}`,e)}removeGrant(e,t=false){this.Storage.remove(`${C}${t?"-"+e:""}`)}async getGrant(e,t=false){const n=await this.Storage.get(`${C}${t?"-"+e:""}`);if(n){return n}return null}async setUserToken(e){const t=await this.getUserTokens();if(t){const n=t.find((t=>t.sub===e.sub));if(!n){const n=[...t,e];this.Storage.set($,n)}else{const n=t.map((t=>{if(t.sub===e.sub){t=e}return t}));this.Storage.set($,n)}}else{this.Storage.set($,[e])}}async getUserToken(e=""){const t=await this.Storage.get($);if(t){if(e===""){return t[0]}const n=t.find((t=>t.sub===e));return n}return null}async getUserTokens(){const e=await this.Storage.get($);if(e){return e}return null}removeUserTokens(){this.Storage.remove($)}async removeUserToken(e){const t=await this.getUserTokens();const n=t?.filter((t=>t.sub!==e));this.Storage.set($,n)}async clearSession(){const e=await this.getUserTokens();e?.forEach((e=>{this.removeGrant(e.sub)}));this.removePKCE();this.removeUserTokens()}}class R{databaseName="identity-db";storeName="identity";get(e){const t=this;return new Promise(((n,i)=>{t.openDatabase().then((function(s){const r=s.transaction(t.storeName,"readwrite");const o=r.objectStore(t.storeName);const a=o.get(e);a.onsuccess=()=>{n(a.result)};a.onerror=()=>{i(a.error)};r.oncomplete=()=>{s.close()}}))}))}async remove(e){const t=this;return new Promise(((n,i)=>{const s=indexedDB.open(this.databaseName);s.onupgradeneeded=function(e){const n=e.target.result;n.createObjectStore(t.storeName)};s.onerror=()=>{i(s.error)};s.onsuccess=t=>{const s=t.target.result;const r=s.transaction(this.storeName,"readwrite");const o=r.objectStore(this.storeName);const a=o.delete(e);a.onsuccess=()=>{n(null)};a.onerror=()=>{i(a.error)};r.oncomplete=()=>{s.close()}}}))}set(e,t){return new Promise(((n,i)=>{const s=indexedDB.open(this.databaseName);s.onerror=()=>{i(s.error)};s.onupgradeneeded=e=>{const t=e.target.result;t.createObjectStore(this.storeName)};s.onsuccess=s=>{const r=s.target.result;const o=r.transaction(this.storeName,"readwrite");const a=o.objectStore(this.storeName);const c=a.put(t,e);c.onsuccess=()=>{n(t)};c.onerror=()=>{i(c.error)};o.oncomplete=()=>{r.close()}}}))}openDatabase(){const e=this;return new Promise((function(t,n){const i=indexedDB.open(e.databaseName,2);i.onupgradeneeded=function(t){const n=t.target.result;n.createObjectStore(e.storeName)};i.onsuccess=function(e){t(e.target.result)};i.onerror=function(e){n(e.error)}}))}}var I;var q=new Uint8Array(16);function A(){if(!I){I=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!=="undefined"&&typeof msCrypto.getRandomValues==="function"&&msCrypto.getRandomValues.bind(msCrypto);if(!I){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return I(q)}var N=/^(?:[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 U(e){return typeof e==="string"&&N.test(e)}var j=[];for(var L=0;L<256;++L){j.push((L+256).toString(16).substr(1))}function z(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=(j[e[t+0]]+j[e[t+1]]+j[e[t+2]]+j[e[t+3]]+"-"+j[e[t+4]]+j[e[t+5]]+"-"+j[e[t+6]]+j[e[t+7]]+"-"+j[e[t+8]]+j[e[t+9]]+"-"+j[e[t+10]]+j[e[t+11]]+j[e[t+12]]+j[e[t+13]]+j[e[t+14]]+j[e[t+15]]).toLowerCase();if(!U(n)){throw TypeError("Stringified UUID is invalid")}return n}function O(e,t,n){e=e||{};var i=e.random||(e.rng||A)();i[6]=i[6]&15|64;i[8]=i[8]&63|128;return z(i)}async function D(e,t){const n=e.getReader();let i;while(!(i=await n.read()).done){t(i.value)}}function H(e){let t;let n;let i;let s=false;return function r(o){if(t===undefined){t=o;n=0;i=-1}else{t=B(t,o)}const a=t.length;let c=0;while(n<a){if(s){if(t[n]===10){c=++n}s=false}let r=-1;for(;n<a&&r===-1;++n){switch(t[n]){case 58:if(i===-1){i=n-c}break;case 13:s=true;case 10:r=n;break}}if(r===-1){break}e(t.subarray(c,r),i);c=n;i=-1}if(c===a){t=undefined}else if(c!==0){t=t.subarray(c);n-=c}}}function G(e,t,n){let i=F();const s=new TextDecoder;return function r(o,a){if(o.length===0){n===null||n===void 0?void 0:n(i);i=F()}else if(a>0){const n=s.decode(o.subarray(0,a));const r=a+(o[a+1]===32?2:1);const c=s.decode(o.subarray(r));switch(n){case"data":i.data=i.data?i.data+"\n"+c:c;break;case"event":i.event=c;break;case"id":e(i.id=c);break;case"retry":const n=parseInt(c,10);if(!isNaN(n)){t(i.retry=n)}break}}}}function B(e,t){const n=new Uint8Array(e.length+t.length);n.set(e);n.set(t,e.length);return n}function F(){return{data:"",event:"",id:"",retry:undefined}}var J=undefined&&undefined.__rest||function(e,t){var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0)n[i]=e[i];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++){if(t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s]))n[i[s]]=e[i[s]]}return n};const M="text/event-stream";const Y=1e3;const V="last-event-id";function W(e,t){var{signal:n,headers:i,onopen:s,onmessage:r,onclose:o,onerror:a,openWhenHidden:c,fetch:l}=t,u=J(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,d)=>{const h=Object.assign({},i);if(!h.accept){h.accept=M}let f;function p(){f.abort();if(!document.hidden){v()}}if(!c){document.addEventListener("visibilitychange",p)}let g=Y;let y=0;function w(){document.removeEventListener("visibilitychange",p);window.clearTimeout(y);f.abort()}n===null||n===void 0?void 0:n.addEventListener("abort",(()=>{w();t()}));const b=l!==null&&l!==void 0?l:window.fetch;const m=s!==null&&s!==void 0?s:K;async function v(){var n;f=new AbortController;try{const n=await b(e,Object.assign(Object.assign({},u),{headers:h,signal:f.signal}));await m(n);await D(n.body,H(G((e=>{if(e){h[V]=e}else{delete h[V]}}),(e=>{g=e}),r)));o===null||o===void 0?void 0:o();w();t()}catch(e){if(!f.signal.aborted){try{const t=(n=a===null||a===void 0?void 0:a(e))!==null&&n!==void 0?n:g;window.clearTimeout(y);y=window.setTimeout(v,t)}catch(e){w();d(e)}}}}v()}))}function K(e){const t=e.headers.get("content-type");if(!(t===null||t===void 0?void 0:t.startsWith(M))){throw new Error(`Expected content-type to be ${M}, Actual: ${t}`)}}function Q(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Z(){return Math.floor(Date.now()/1e3)}async function X(e){const t=(new TextEncoder).encode(e);const n=await crypto.subtle.digest("SHA-256",t);const i=Array.from(new Uint8Array(n));const s=i.map((e=>e.toString(16).padStart(2,"0"))).join("");return s}function ee(e){this.message=e}ee.prototype=new Error,ee.prototype.name="InvalidCharacterError";var te="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new ee("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,r=0,o="";i=t.charAt(r++);~i&&(n=s%4?64*n+i:i,s++%4)?o+=String.fromCharCode(255&n>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};function ne(e){var t=e.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(e){return decodeURIComponent(te(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return te(t)}}function ie(e){this.message=e}function se(e,t){if("string"!=typeof e)throw new ie("Invalid token specified");var n=true===(t=t||{}).header?0:1;try{return JSON.parse(ne(e.split(".")[n]))}catch(e){throw new ie("Invalid token specified: "+e.message)}}ie.prototype=new Error,ie.prototype.name="InvalidTokenError";class re{clientId;redirectUri;accessType="online";domain="http://api.nylas.com";versioned=false;Storage;hosted=false;multiAccount=false;loginId="";constructor(e){this.clientId=e.clientId;this.redirectUri=e.redirectUri;if(e.domain){this.domain=e.domain;const t=this.domain.substring(this.domain.length-3);if(t.includes("/v")){this.versioned=true}}if(e.multiAccount){this.multiAccount=e.multiAccount}if(e.sw){const e=new R;this.Storage=new P(e)}else{this.Storage=new P}if(e.accessType){this.accessType=e.accessType}if(e.loginId){this.loginId=e.loginId}if(e.hosted){this.hosted=e.hosted}if(e.disableInitCodeExchange!==true){this.codeExchange(null)}}async validateAccessToken(e=""){const t=await this.Storage.getGrant(e,this.multiAccount);if(!t){return false}const{access_token:n}=t;try{const e=await fetch(`${this.domain}/connect/tokeninfo?access_token=${n}`,{method:"GET"});const t=await e.json();if(!t.data){return false}return true}catch(e){return false}}async validateIDToken(e=""){const t=await this.Storage.getGrant(e,this.multiAccount);if(!t){return false}const{id_token:n}=t;try{const e=await fetch(`${this.domain}/connect/tokeninfo?id_token=${n}`,{method:"GET"});if(e.status!==200){return false}const t=await e.json();if(!t.data){return false}return true}catch(e){return false}}getDomain(){return this.domain}async auth(e){if(this.hosted&&(this.domain===globalThis.window?.location.origin||this.versioned&&this.domain.includes(globalThis.window?.location.origin))){await this.hostedSetCodeChallenge()}const t=await this.generateAuthURL(e);if(e.popup){this.popUp(t);return}return t}async generateAuthURL(e){const t=await this.getCodeChallege();let n=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;if(t){n+=`&code_challenge=${t}&code_challenge_method=S256&options=rotate_refresh_token`}if(e.provider){n+=`&provider=${e.provider}`}if(e.loginHint){n+=`&login_hint=${e.loginHint}`;if(e.includeGrantScopes){n+=`&include_grant_scopes=${e.includeGrantScopes}`}}if(e.scope){n+=`&scope=${e.scope.join(" ")}`}if(e.prompt){n+=`&prompt=${e.prompt}`}if(e.metadata){n+=`&metadata=${e.metadata}`}if(e.state||this.loginId){n+=`&state=${this.loginId?this.loginId:e.state}`}return n}async generateReauthURL(e,t){if(!e){throw new Error("Grant ID is required")}const n=await this.Storage.getUserToken(e);const i=await this.getCodeChallege();let s=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;if(i){s+=`&code_challenge=${i}&code_challenge_method=S256&options=rotate_refresh_token`}if(n?.provider){s+=`&provider=${n.provider}`}if(n?.email){s+=`&login_hint=${n.email}`}if(t){s+=`&scope=${t.join(" ")}`}return s}async generateCodeChallenge(){const e=await this.Storage.getPKCE();if(e){return}const t=O();this.Storage.setPKCE(t);return}async hostedSetCodeChallenge(){if(!this.hosted){throw console.error("Method only used with hosted flag enabled")}const e=new URLSearchParams(globalThis.window?.location.search);const t=e.get("code_challenge");if(!t){const e=await this.Storage.getPKCE();if(e){return}console.warn("Code challenge is recomended");return}this.Storage.setPKCE(t)}async getCodeChallege(){if(this.hosted&&(this.domain===globalThis.window?.location.origin||this.versioned&&this.domain.includes(globalThis.window?.location.origin))){const e=new URLSearchParams(globalThis.window?.location.search);const t=e.get("code_challenge");if(!t){console.warn("Code challenge is recomended");return""}return t}const e=await this.Storage.getPKCE();if(e){const t=await X(e);let n=btoa(unescape(encodeURIComponent(t)));n=Q(n);return n}return""}async isLoggedIn(){if(this.hosted&&(this.domain===globalThis.window?.location.origin||this.versioned&&this.domain.includes(globalThis.window?.location.origin))){return false}const e=await this.Storage.getUserTokens();if(e&&e.length>0){if(this.multiAccount){await this.generateCodeChallenge()}return true}await this.generateCodeChallenge();return false}isMultiAccount(){return this.multiAccount}async logout(){const e=await this.getProfile();await this.Storage.clearSession();const t={detail:e};window.dispatchEvent(new CustomEvent("onLogoutSuccess",t))}async getProfile(e=""){let t;if(e){t=await this.Storage.getUserToken(e)}else{t=await this.Storage.getUserToken()}if(t){return t}return null}async getProfiles(){const e=await this.Storage.getUserTokens();if(e){return e}return null}async removeProfile(e){await this.Storage.removeUserToken(e);await this.Storage.removeGrant(e);return null}async authIMAP(e){const t=await this.getCodeChallege();const n={imap_username:e.imap_username,imap_password:e.imap_password,imap_host:e.imap_host,imap_port:e.imap_port,type:e.type,smtp_host:e.smtp_host,smtp_port:e.smtp_port,provider:e.provider,redirect_uri:this.redirectUri,state:e.state,public_application_id:this.clientId,access_type:this.accessType};if(this.loginId){n.id=this.loginId}if(e.smtp_username&&e.smtp_password){n.smtp_username=e.smtp_username;n.smtp_password=e.smtp_password}if(t!=""){n.code_challenge=t;n.code_challenge_method="S256"}const i=await fetch(`${this.domain}/connect/login/imap`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(n)});const s=await i.json();return s}async authEWS(e){const t=await this.getCodeChallege();const n={...e,provider:"ews",redirect_uri:this.redirectUri,public_application_id:this.clientId,access_type:this.accessType};if(this.loginId){n.id=this.loginId}if(t!=""){n.code_challenge=t;n.code_challenge_method="S256"}const i=await fetch(`${this.domain}/connect/login/ews`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(n)});const s=await i.json();return s}async detectEmail(e){const t=await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/providers/detect?client_id=${this.clientId}&email=${e}`,{method:"POST",headers:new Headers({"content-type":"application/json"})});const n=await t.json();return n}async applicationInfo(){const e=await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/applications?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})});const t=await e.json();return t.data}async getAvailableProviders(){const e=await fetch(`${this.domain}/connect/providers/find?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})});if(e){const t=await e.json();const n=t.data;return n}return null}onLoginSuccess(e){window.addEventListener("onLoginSuccess",(t=>e(t)))}onLogoutSuccess(e){window.addEventListener("onLogoutSuccess",(t=>e(t)))}onLoginFail(e){window.addEventListener("onLoginFail",(t=>e(t)))}onTokenRefreshSuccess(e){window.addEventListener("onTokenRefreshSuccess",(t=>e(t)))}onTokenRefreshFail(e){window.addEventListener("onTokenRefreshFail",(t=>e(t)))}onSessionExpired(e){window.addEventListener("onSessionExpired",(t=>e(t)))}async codeExchange(e){let t=new URLSearchParams(globalThis.window?.location.search);if(e){t=new URLSearchParams(e)}const n=t.get("code");const i=t.get("state");const s=t.get("error");const r=t.get("error_description");const o=t.get("error_code");if(s&&r&&o){const e={detail:{error:s,error_description:r,error_code:o}};window.dispatchEvent(new CustomEvent("onLoginFail",e));window.history.pushState({},document.title,globalThis.window?.location.pathname);return false}if(!n){console.warn("No code found");return false}if(window.opener&&window.name==="uas-popup"){console.warn("Popup window detected");return false}const a=await this.Storage.getPKCE();if(!a){console.warn("No code verifier found");return false}try{const e={client_id:this.clientId,redirect_uri:this.redirectUri,code:n,grant_type:"authorization_code",code_verifier:a};const t=await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(e)});const s=await t.json();if(s){if(s.error){const e={detail:s};window.dispatchEvent(new CustomEvent("onLoginFail",e));return true}const e=await this.handleCodeExchangeResponse(s);if(!e.valid){const t={detail:e.data};window.dispatchEvent(new CustomEvent("onLoginFail",t));return true}else{if(i){e.data.state=i}const t={detail:e.data};window.dispatchEvent(new CustomEvent("onLoginSuccess",t));window.history.pushState({},document.title,window.location.pathname)}}this.Storage.removePKCE();return true}catch(s){const e={detail:s};window.dispatchEvent(new CustomEvent("onLoginFail",e));window.history.pushState({},document.title,globalThis.window?.location.pathname);return false}}async tokenExchange(e=""){const t=await this.Storage.getGrant(e,this.multiAccount);if(!t){return false}const n=t.refresh_token;try{const t={client_id:this.clientId,redirect_uri:this.redirectUri,refresh_token:n,grant_type:"refresh_token"};const i=await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(t)});const s=await i.json();if(s){if(s.error){const e={detail:s};window.dispatchEvent(new CustomEvent("onTokenRefreshFail",e));return true}const t=Z();s.expires_in=t+s.expires_in;this.Storage.setGrant(s,this.multiAccount);const n=await this.validateIDToken(e);if(!n){const e={detail:s};window.dispatchEvent(new CustomEvent("onTokenRefreshFail",e));return true}const i={detail:s};window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess",i));return true}this.Storage.removePKCE()}catch(e){const t={detail:e};window.dispatchEvent(new CustomEvent("onTokenRefreshFail",t));return false}}async handleCodeExchangeResponse(e){const t=true;if(e.error){return{data:e,valid:false}}const n=Z();e.expires_in=n+e.expires_in;this.Storage.setGrant(e,this.multiAccount);const i=se(e.id_token);i.status="authenticated";this.Storage.setUserToken(i);const s=await this.validateIDToken(i.sub);if(!s){return{data:e,valid:false}}return{data:e,valid:t}}async popUp(e){const t=500;const n=600;const i=window.screenX+(window.outerWidth-t)/2;const s=window.screenY+(window.outerHeight-n)/2.5;const r=`uas-popup`;const o=e;const a=window.open(o,r,`width=${t},height=${n},left=${i},top=${s}`);if(!a){return}const c=setInterval((async()=>{if(a.closed){const e={detail:{error_description:"OAuth provider window closed"}};window.dispatchEvent(new CustomEvent("onLoginFail",e));c&&clearInterval(c);return}try{const e=a.location.href.split("?");if(!e[0]){return}const t=a.location.search;a.history.pushState({},document.title,window.location.pathname);if(e[0]===this.redirectUri&&e.length>1){const e=await this.codeExchange(t);a.close();if(e){location.reload()}c&&clearInterval(c);return}}catch(e){return}}),1e3)}async getAccessToken(e=""){const t=Z();const n=await this.Storage.getGrant(e,this.multiAccount);if(!n){return null}const{access_token:i,expires_in:s}=n;const r=i;if(r){if(s&&s>Z()){const e=s-t;if(e>30){return r}}}await this.tokenExchange(e);const o=await this.Storage.getGrant(e,this.multiAccount);return o.access_token}async sse(e,t){const n=t.headers||{};const i=n["Grant-ID"];let s="";if(this.multiAccount){if(!i){this.logout();throw new Error("Grant ID is required for multi account calls")}s=await this.getAccessToken(i)}else{s=await this.getAccessToken()}delete n["Grant-ID"];n["Authorization"]=`Bearer ${s}`;if(!n["content-type"]){n["content-type"]="application/json"}return W(`${this.domain}/${e}`,{...t,headers:n})}async fetch(e,t,n=true,i){let s="";let r=1;if(this.multiAccount){if(!t.grant_id){this.logout();throw new Error("Grant ID is required for multi account calls")}const e=await this.getProfiles();r=e?e.length:1;s=await this.getAccessToken(t.grant_id)}else{s=await this.getAccessToken()}if(!s){throw new Error("Access token not found")}let o=t.headers;if(!Headers.prototype.isPrototypeOf(o)){o=new Headers({Authorization:`Bearer ${s}`,"content-type":"application/json"})}else{o.append("Authorization",`Bearer ${s}`);if(!o.has("content-type")){o.append("content-type","application/json")}}try{if(t?.body){t.body=JSON.stringify(t?.body)}const s=await fetch(`${i||this.domain}/${e}`,{...t,headers:o});if(!n){return s}const a=await(s?.json());const c=await this.isAuthenticatedResponse(s.status,a);if(!c){if(r>1){const e=await this.getProfile(t.grant_id);if(e){e.status="unauthorized";await this.Storage.setUserToken(e);const t={detail:{user:e}};window.dispatchEvent(new CustomEvent("onSessionExpired",t))}}else{const e=await this.Storage.getUserToken();const t={detail:{user:e}};window.dispatchEvent(new CustomEvent("onSessionExpired",t))}this.logout();return}return a}catch(e){throw e}}async fetchRequest(e,t,n,i=true,s,r){const o=await this.isLoggedIn();const a=new URL(e,s??this.domain);const c=new Headers;c.append("Accept","application/json");c.append("Content-Type","application/json");c.append("User-Agent","nylas-identity");if(o){const e=await this.getAccessToken();c.append("Authorization",`Bearer ${e}`)}const l=await fetch(a.toString(),{method:t||"GET",headers:c,mode:"cors",referrer:globalThis.window?.location.origin,body:n?JSON.stringify(n):undefined,...r||{}});if(!i){return l.body}const u=await l.json();return u}async isAuthenticatedResponse(e,t){if(e==401&&t?.error?.type=="token.unauthorized_access"){return false}return true}addAPIKey(e,t,n){this.Storage.setUserToken({aud:"https://api-staging.us.nylas.com/",exp:2e9,email_verified:true,iat:Z(),iss:"",email:t,provider:"virtual-calendar",status:"authenticated",name:t,sub:e});this.Storage.setGrant({grant_id:e,access_token:n,expires_in:2e9},this.multiAccount)}}var oe={exports:{}};var ae={};
|
|
1
|
+
import{h as e,F as t,r as n,c as i,H as s,a as r}from"./p-0EQQA0nE.js";import{N as o}from"./p-mqq2iF4Q.js";import{N as a}from"./p-C5h3pVnq.js";import{d as c,u as l,t as u,a as d,g as h,b as f,i as p}from"./p-C_2w_vhw.js";import{X as g}from"./p-CRJfdY84.js";import{c as y}from"./p-_i6H-yQH.js";import{C as w,L as b,a as m}from"./p-COJy29df.js";c.extend(l);c.extend(u);class v{constructor({nylasApiRequest:e,nylasSchedulerConfigStore:t}){this.groupEventsCache=new Map;this.CACHE_DURATION=1*60*1e3;this.nylasApiRequest=e;this.nylasSchedulerConfigStore=t}async currentUser(){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return null}return this.nylasApiRequest.currentUser()}async getCalendars(){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching calendars: Nylas API Request is not initialized"})}const e=[];let t=null;const n=50;do{const[i,s]=await this.nylasApiRequest.request({method:"GET",path:`calendars?limit=${n}${t?`&page_token=${t}`:""}`});if(s){return d(null,{message:"Error fetching calendars: "+s.message})}if(g(i)){return d(null,{message:"Error fetching calendars: "+i.error?.message})}e.push(...i.data);t=i.next_cursor||null}while(t);this.nylasSchedulerConfigStore.state.calendars=e;return d(e)}async getConfigurationById(e,t=false){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching configuration: Nylas API Request is not initialized"})}if(!t){const t=this.nylasSchedulerConfigStore.state.configurations.find((t=>t.id===e));if(t){this.nylasSchedulerConfigStore.state.selectedConfiguration=t;return d(t)}}const[n,i]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${e}`});if(i){return d(null,{message:"Error fetching configuration: "+i.message})}if(g(n)){return d(null,{message:"Error fetching configuration: "+n.error?.message})}this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data;if(this.nylasSchedulerConfigStore.state.configurations.find((t=>t.id===e))){this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map((t=>t.id===e?n.data:t))}else{this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data]}return d(n.data)}async getConfigurations(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching configurations: Nylas API Request is not initialized"})}const t=50;const[n,i]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations?limit=${t}${e?`&page_token=${e}`:""}`});if(i){return d(null,{message:"Error fetching configurations: "+i.message})}if(g(n)){return d(null,{message:"Error fetching configurations: "+n.error?.message})}this.nylasSchedulerConfigStore.state.configurations=n.data;this.nylasSchedulerConfigStore.state.listConfigurationsNextCursor=n.next_cursor||null;return d(n.data)}async getMasterEventById(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching master event: Nylas API Request is not initialized"})}const t=this.nylasSchedulerConfigStore.state.selectedGroupEvent;const n=t?.event?.calendar_id;if(!n){console.warn("Calendar ID is not present");return d(null,{message:"Error fetching master event: Calendar ID is not present"})}const i=new URLSearchParams;i.append("calendar_id",n);const[s,r]=await this.nylasApiRequest.request({method:"GET",path:`events/${e}?${i.toString()}`});if(r){return d(null,{message:"Error fetching master event: "+r.message})}if(g(s)){return d(null,{message:"Error fetching master event: "+s.error?.message})}const o=this.nylasSchedulerConfigStore.state.masterGroupEvents;if(o[e]){this.nylasSchedulerConfigStore.state.masterGroupEvents[e]=s.data}else{this.nylasSchedulerConfigStore.state.masterGroupEvents={...o,[e]:s.data}}return d(s.data)}async createConfiguration(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error creating configuration: Nylas API Request is not initialized"})}const[t,n]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations`,body:e});if(n){return d(null,{message:"Error creating configuration: "+n.message})}if(g(t)){return d(null,{message:"Error creating configuration: "+t.error?.message})}this.nylasSchedulerConfigStore.state.selectedConfiguration=t.data;this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,t.data];return d(t.data)}async updateConfiguration(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error updating configuration: Nylas API Request is not initialized"})}const[t,n]=await this.nylasApiRequest.request({method:"PUT",path:`scheduling/configurations/${e.id}`,body:e});if(n){return d(null,{message:"Error updating configuration: "+n.message})}if(g(t)){return d(null,{message:"Error updating configuration: "+t.error?.message})}this.nylasSchedulerConfigStore.state.selectedConfiguration=t.data;if(this.nylasSchedulerConfigStore.state.configurations.find((t=>t.id===e.id))){this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map((n=>n.id===e.id?t.data:n))}else{this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,t.data]}return d(t.data)}async deleteConfiguration(e){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error deleting configuration: Nylas API Request is not initialized"})}const[t,n]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${e}`});if(n){return d(null,{message:"Error deleting configuration: "+n.message})}if(g(t)){return d(null,{message:"Error deleting configuration: "+t.error?.message})}this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.filter((t=>t.id!==e));if(this.nylasSchedulerConfigStore.state.selectedConfiguration?.id===e){this.nylasSchedulerConfigStore.resetSelectedConfiguration()}return d(t.data)}async createGroupEvent(e,t){this.nylasSchedulerConfigStore.state.isLoading=true;if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error creating group event: Nylas API Request is not initialized"})}const[n,i]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${t}/group-events`,body:e});if(i){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error creating group event: "+i.message})}if(g(n)){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error creating group event: "+n.error?.message})}this.nylasSchedulerConfigStore.state.selectedGroupEvent=n.data;await this.getGroupEvents(t,this.nylasSchedulerConfigStore.state.selectedConfiguration);this.nylasSchedulerConfigStore.state.isLoading=false;return d(n.data)}async getGroupEvents(e,t){if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error fetching group events: Nylas API Request is not initialized"})}const n=new URLSearchParams;n.append("show_all","true");const i=this.nylasSchedulerConfigStore.state.calendarViewDateRange;let s;let r;if(i){s=i.start_time;r=i.end_time}else{const e=h((new Date).toISOString(),"week");s=e.startTime.toString();r=e.endTime.toString()}const o=`${e}-${s}-${r}`;const a=this.groupEventsCache.get(o);if(a&&Date.now()-a.timestamp<this.CACHE_DURATION){this.nylasSchedulerConfigStore.state.groupEvents=a.data;return d(a.data)}n.append("start_time",s);n.append("end_time",r);const c=t?.group_booking?.calendar_id;if(c){n.append("calendar_id",c)}const[l,u]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${e}/group-events?${n.toString()}`});if(u){return d(null,{message:"Error fetching group events: "+u.message})}if(g(l)){return d(null,{message:"Error fetching group events: "+l.error?.message})}this.groupEventsCache.set(o,{data:l.data,timestamp:Date.now()});this.cleanupExpiredCache();this.nylasSchedulerConfigStore.state.groupEvents=l.data;return d(l.data)}cleanupExpiredCache(){const e=Date.now();for(const[t,n]of this.groupEventsCache.entries()){if(e-n.timestamp>this.CACHE_DURATION){this.groupEventsCache.delete(t)}}}async updateGroupEventById(e,t){this.nylasSchedulerConfigStore.state.isLoading=true;if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error updating group event: Nylas API Request is not initialized"})}const n=e.id;delete e.id;const[i,s]=await this.nylasApiRequest.request({method:"PATCH",path:`scheduling/configurations/${t}/group-events/${n}`,body:e});if(s){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error updating group event: "+s.message})}if(g(i)){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error updating group event: "+i.error?.message})}this.nylasSchedulerConfigStore.state.selectedGroupEvent=i.data;await this.getGroupEvents(t,this.nylasSchedulerConfigStore.state.selectedConfiguration);this.nylasSchedulerConfigStore.state.isLoading=false;return d(i.data)}async updateGroupEvent(e,t,n){this.nylasSchedulerConfigStore.state.isLoading=true;const i=this.nylasSchedulerConfigStore.state.selectedGroupEvent;const s=i?.event?.master_event_id;const r=i?.event?.id;const o=i?.event?.when?.start_time;const a=i?.group_event_info?.rrule?.[0];const l=a?a.split(";").filter((e=>!e.startsWith("UNTIL"))).join(";"):"";const u=o?c(o*1e3).subtract(1,"minute").format("YYYYMMDDTHHmmss[Z]"):"";if(t==="this"){return this.updateGroupEventById({...e,id:r,recurrence:s?undefined:e.recurrence},n)}else if(t==="future"&&s){const t=await this.createGroupEvent(e,n);const r={location:i?.event?.location,conferencing:i?.event?.conferencing,title:i?.event?.title,description:i?.event?.description,capacity:i?.group_event_info?.capacity,calendar_id:i?.event?.calendar_id,recurrence:l?[l+";UNTIL="+u]:[`RRULE:FREQ=DAILY;UNTIL=${u}`]};await this.updateGroupEventById({...r,id:s},n);return[r,t]}else if(t==="all"){const t=e?.when;const r=i?.event?.when;const o=this.nylasSchedulerConfigStore.state.masterGroupEvents?.[s];let a=o?.when;if(t?.start_time!==r?.start_time){a={...a,start_time:t?.start_time||a?.start_time}}if(t?.end_time!==r?.end_time){a={...a,end_time:t?.end_time||a?.end_time}}if(t?.start_timezone!==r?.start_timezone){a={...a,start_timezone:t?.start_timezone||a?.start_timezone}}if(t?.end_timezone!==r?.end_timezone){a={...a,end_timezone:t?.end_timezone||a?.end_timezone}}return this.updateGroupEventById({...e,when:a,id:s},n)}this.nylasSchedulerConfigStore.state.isLoading=false;throw new Error("Invalid option")}async deleteGroupEvent(e,t,n){this.nylasSchedulerConfigStore.state.isLoading=true;const i=this.nylasSchedulerConfigStore.state.selectedGroupEvent;const s=i?.event?.master_event_id;const r=i?.event?.id;const o=i?.event?.when?.start_time;const a=i?.group_event_info?.rrule?.[0];const l=a?a.split(";").filter((e=>!e.startsWith("UNTIL"))).join(";"):"";const u=o?c(o*1e3).format("YYYYMMDDTHHmmss[Z]"):"";const d={location:i?.event?.location,conferencing:i?.event?.conferencing,title:i?.event?.title,description:i?.event?.description,capacity:i?.group_event_info?.capacity,calendar_id:i?.event?.calendar_id,recurrence:l?[l+";UNTIL="+u]:[`RRULE:UNTIL=${u}`]};if(t==="this"&&r){return this.deleteGroupEventById(r,n)}else if(t==="future"&&s&&r){await this.deleteGroupEventById(r,n);return await this.updateGroupEventById({...d,id:s},n)}else if(t==="all"&&s){return this.deleteGroupEventById(s,n)}this.nylasSchedulerConfigStore.state.isLoading=false;throw new Error("Invalid option")}async deleteGroupEventById(e,t){this.nylasSchedulerConfigStore.state.isLoading=true;if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error deleting group event: Nylas API Request is not initialized"})}const n=new URLSearchParams;const i=this.nylasSchedulerConfigStore.state.selectedConfiguration?.group_booking?.calendar_id;if(i){n.append("calendar_id",i)}const[s,r]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${t}/group-events/${e}?calendar_id=${i}`});if(r){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error deleting group event: "+r.message})}if(g(s)){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error deleting group event: "+s.error?.message})}await this.getGroupEvents(t,this.nylasSchedulerConfigStore.state.selectedConfiguration);this.nylasSchedulerConfigStore.state.isLoading=false;return d(s.data)}async importGroupEvent(e,t){this.nylasSchedulerConfigStore.state.isLoading=true;if(!this.nylasApiRequest){console.warn("Nylas API Request is not initialized");return d(null,{message:"Error importing group event: Nylas API Request is not initialized"})}const n=new URLSearchParams;const i=this.nylasSchedulerConfigStore.state.selectedConfiguration?.group_booking?.calendar_id;if(i){n.append("calendar_id",i)}const[s,r]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${t}/import-group-events?${n.toString()}`,body:e});if(r){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error importing group event: "+r.message})}if(g(s)){this.nylasSchedulerConfigStore.state.isLoading=false;return d(null,{message:"Error importing group event: "+s.error?.message})}if(s.data?.imported_events?.length>0){await this.getGroupEvents(t,this.nylasSchedulerConfigStore.state.selectedConfiguration)}this.nylasSchedulerConfigStore.state.isLoading=false;return d(s.data)}}class _{constructor({nylasApiRequest:e,nylasSchedulerConfigStore:t}){this.nylasApiRequest=e;this.nylasSchedulerConfigStore=t}init(){f("NylasSchedulerConfigConnector init")}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get schedulerConfig(){if(this._schedulerConfigConnector){return this._schedulerConfigConnector}this._schedulerConfigConnector=new v({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore});return this._schedulerConfigConnector}resetStores(){f("NylasSchedulerConfigConnector resetStores");this.nylasSchedulerConfigStore.reset()}async logout(){f("NylasSchedulerConfigConnector logout");this.resetStores()}}function E(e={}){const t={selectedConfiguration:{},configurations:[],groupEvents:[],listConfigurationsNextCursor:null,calendars:[],currentUser:null,action:null,additionalParticipants:[],requiresSlug:false,masterGroupEvents:{},isLoading:false,...e};const n=y(t);function i(){n.set("selectedConfiguration",{...e["selectedConfiguration"]})}n.onChange("action",(async e=>{if(!e){i()}}));return{...n,resetSelectedConfiguration:i}}class k{get(e){return new Promise((t=>{const n=globalThis.window?.localStorage.getItem(e);if(!n){t(null)}else{t(JSON.parse(n))}}))}async remove(e){globalThis.window?.localStorage.removeItem(e);return new Promise((e=>{e(null)}))}set(e,t){globalThis.window?.localStorage.setItem(e,JSON.stringify(t));return new Promise((e=>{e(null)}))}}const x="pkce";const C="grant";const $="user";const T=e=>{if(typeof globalThis.btoa==="function"&&typeof TextEncoder!=="undefined"){const t=(new TextEncoder).encode(e);let n="";for(let e=0;e<t.length;e++){n+=String.fromCharCode(t[e])}return globalThis.btoa(n)}if(typeof globalThis.Buffer!=="undefined"){return globalThis.Buffer.from(e,"utf8").toString("base64")}throw new Error("Base64 encoding is not supported in this environment")};const S=e=>{if(typeof globalThis.atob==="function"&&typeof TextDecoder!=="undefined"){const t=globalThis.atob(e);const n=new Uint8Array(t.length);for(let e=0;e<t.length;e++){n[e]=t.charCodeAt(e)}return(new TextDecoder).decode(n)}if(typeof globalThis.Buffer!=="undefined"){return globalThis.Buffer.from(e,"base64").toString("utf8")}throw new Error("Base64 decoding is not supported in this environment")};class P{Storage=new k;constructor(e){if(e){this.Storage=e;return}}setPKCE(e){const t=T(e);this.Storage.set(x,t)}async getPKCE(){try{const e=await this.Storage.get(x);if(e){return S(e)}}catch(e){return null}return null}removePKCE(){this.Storage.remove(x)}setGrant(e,t=false){const{grant_id:n}=e;this.Storage.set(`${C}${t?"-"+n:""}`,e)}removeGrant(e,t=false){this.Storage.remove(`${C}${t?"-"+e:""}`)}async getGrant(e,t=false){const n=await this.Storage.get(`${C}${t?"-"+e:""}`);if(n){return n}return null}async setUserToken(e){const t=await this.getUserTokens();if(t){const n=t.find((t=>t.sub===e.sub));if(!n){const n=[...t,e];this.Storage.set($,n)}else{const n=t.map((t=>{if(t.sub===e.sub){t=e}return t}));this.Storage.set($,n)}}else{this.Storage.set($,[e])}}async getUserToken(e=""){const t=await this.Storage.get($);if(t){if(e===""){return t[0]}const n=t.find((t=>t.sub===e));return n}return null}async getUserTokens(){const e=await this.Storage.get($);if(e){return e}return null}removeUserTokens(){this.Storage.remove($)}async removeUserToken(e){const t=await this.getUserTokens();const n=t?.filter((t=>t.sub!==e));this.Storage.set($,n)}async clearSession(){const e=await this.getUserTokens();e?.forEach((e=>{this.removeGrant(e.sub)}));this.removePKCE();this.removeUserTokens()}}class R{databaseName="identity-db";storeName="identity";get(e){const t=this;return new Promise(((n,i)=>{t.openDatabase().then((function(s){const r=s.transaction(t.storeName,"readwrite");const o=r.objectStore(t.storeName);const a=o.get(e);a.onsuccess=()=>{n(a.result)};a.onerror=()=>{i(a.error)};r.oncomplete=()=>{s.close()}}))}))}async remove(e){const t=this;return new Promise(((n,i)=>{const s=indexedDB.open(this.databaseName);s.onupgradeneeded=function(e){const n=e.target.result;n.createObjectStore(t.storeName)};s.onerror=()=>{i(s.error)};s.onsuccess=t=>{const s=t.target.result;const r=s.transaction(this.storeName,"readwrite");const o=r.objectStore(this.storeName);const a=o.delete(e);a.onsuccess=()=>{n(null)};a.onerror=()=>{i(a.error)};r.oncomplete=()=>{s.close()}}}))}set(e,t){return new Promise(((n,i)=>{const s=indexedDB.open(this.databaseName);s.onerror=()=>{i(s.error)};s.onupgradeneeded=e=>{const t=e.target.result;t.createObjectStore(this.storeName)};s.onsuccess=s=>{const r=s.target.result;const o=r.transaction(this.storeName,"readwrite");const a=o.objectStore(this.storeName);const c=a.put(t,e);c.onsuccess=()=>{n(t)};c.onerror=()=>{i(c.error)};o.oncomplete=()=>{r.close()}}}))}openDatabase(){const e=this;return new Promise((function(t,n){const i=indexedDB.open(e.databaseName,2);i.onupgradeneeded=function(t){const n=t.target.result;n.createObjectStore(e.storeName)};i.onsuccess=function(e){t(e.target.result)};i.onerror=function(e){n(e.error)}}))}}var I;var q=new Uint8Array(16);function A(){if(!I){I=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!=="undefined"&&typeof msCrypto.getRandomValues==="function"&&msCrypto.getRandomValues.bind(msCrypto);if(!I){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return I(q)}var N=/^(?:[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 U(e){return typeof e==="string"&&N.test(e)}var L=[];for(var j=0;j<256;++j){L.push((j+256).toString(16).substr(1))}function z(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=(L[e[t+0]]+L[e[t+1]]+L[e[t+2]]+L[e[t+3]]+"-"+L[e[t+4]]+L[e[t+5]]+"-"+L[e[t+6]]+L[e[t+7]]+"-"+L[e[t+8]]+L[e[t+9]]+"-"+L[e[t+10]]+L[e[t+11]]+L[e[t+12]]+L[e[t+13]]+L[e[t+14]]+L[e[t+15]]).toLowerCase();if(!U(n)){throw TypeError("Stringified UUID is invalid")}return n}function O(e,t,n){e=e||{};var i=e.random||(e.rng||A)();i[6]=i[6]&15|64;i[8]=i[8]&63|128;return z(i)}async function D(e,t){const n=e.getReader();let i;while(!(i=await n.read()).done){t(i.value)}}function G(e){let t;let n;let i;let s=false;return function r(o){if(t===undefined){t=o;n=0;i=-1}else{t=H(t,o)}const a=t.length;let c=0;while(n<a){if(s){if(t[n]===10){c=++n}s=false}let r=-1;for(;n<a&&r===-1;++n){switch(t[n]){case 58:if(i===-1){i=n-c}break;case 13:s=true;case 10:r=n;break}}if(r===-1){break}e(t.subarray(c,r),i);c=n;i=-1}if(c===a){t=undefined}else if(c!==0){t=t.subarray(c);n-=c}}}function F(e,t,n){let i=B();const s=new TextDecoder;return function r(o,a){if(o.length===0){n===null||n===void 0?void 0:n(i);i=B()}else if(a>0){const n=s.decode(o.subarray(0,a));const r=a+(o[a+1]===32?2:1);const c=s.decode(o.subarray(r));switch(n){case"data":i.data=i.data?i.data+"\n"+c:c;break;case"event":i.event=c;break;case"id":e(i.id=c);break;case"retry":const n=parseInt(c,10);if(!isNaN(n)){t(i.retry=n)}break}}}}function H(e,t){const n=new Uint8Array(e.length+t.length);n.set(e);n.set(t,e.length);return n}function B(){return{data:"",event:"",id:"",retry:undefined}}var M=undefined&&undefined.__rest||function(e,t){var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0)n[i]=e[i];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++){if(t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s]))n[i[s]]=e[i[s]]}return n};const J="text/event-stream";const Y=1e3;const V="last-event-id";function Q(e,t){var{signal:n,headers:i,onopen:s,onmessage:r,onclose:o,onerror:a,openWhenHidden:c,fetch:l}=t,u=M(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,d)=>{const h=Object.assign({},i);if(!h.accept){h.accept=J}let f;function p(){f.abort();if(!document.hidden){v()}}if(!c){document.addEventListener("visibilitychange",p)}let g=Y;let y=0;function w(){document.removeEventListener("visibilitychange",p);window.clearTimeout(y);f.abort()}n===null||n===void 0?void 0:n.addEventListener("abort",(()=>{w();t()}));const b=l!==null&&l!==void 0?l:window.fetch;const m=s!==null&&s!==void 0?s:W;async function v(){var n;f=new AbortController;try{const n=await b(e,Object.assign(Object.assign({},u),{headers:h,signal:f.signal}));await m(n);await D(n.body,G(F((e=>{if(e){h[V]=e}else{delete h[V]}}),(e=>{g=e}),r)));o===null||o===void 0?void 0:o();w();t()}catch(e){if(!f.signal.aborted){try{const t=(n=a===null||a===void 0?void 0:a(e))!==null&&n!==void 0?n:g;window.clearTimeout(y);y=window.setTimeout(v,t)}catch(e){w();d(e)}}}}v()}))}function W(e){const t=e.headers.get("content-type");if(!(t===null||t===void 0?void 0:t.startsWith(J))){throw new Error(`Expected content-type to be ${J}, Actual: ${t}`)}}function K(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Z(){return Math.floor(Date.now()/1e3)}async function X(e){const t=(new TextEncoder).encode(e);const n=await crypto.subtle.digest("SHA-256",t);const i=Array.from(new Uint8Array(n));const s=i.map((e=>e.toString(16).padStart(2,"0"))).join("");return s}function ee(e){this.message=e}ee.prototype=new Error,ee.prototype.name="InvalidCharacterError";var te="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new ee("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,r=0,o="";i=t.charAt(r++);~i&&(n=s%4?64*n+i:i,s++%4)?o+=String.fromCharCode(255&n>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};function ne(e){var t=e.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(e){return decodeURIComponent(te(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return te(t)}}function ie(e){this.message=e}function se(e,t){if("string"!=typeof e)throw new ie("Invalid token specified");var n=true===(t=t||{}).header?0:1;try{return JSON.parse(ne(e.split(".")[n]))}catch(e){throw new ie("Invalid token specified: "+e.message)}}ie.prototype=new Error,ie.prototype.name="InvalidTokenError";class re{clientId;redirectUri;accessType="online";domain="http://api.nylas.com";versioned=false;Storage;hosted=false;multiAccount=false;loginId="";constructor(e){this.clientId=e.clientId;this.redirectUri=e.redirectUri;if(e.domain){this.domain=e.domain;const t=this.domain.substring(this.domain.length-3);if(t.includes("/v")){this.versioned=true}}if(e.multiAccount){this.multiAccount=e.multiAccount}if(e.sw){const e=new R;this.Storage=new P(e)}else{this.Storage=new P}if(e.accessType){this.accessType=e.accessType}if(e.loginId){this.loginId=e.loginId}if(e.hosted){this.hosted=e.hosted}if(e.disableInitCodeExchange!==true){this.codeExchange(null)}}async validateAccessToken(e=""){const t=await this.Storage.getGrant(e,this.multiAccount);if(!t){return false}const{access_token:n}=t;try{const e=await fetch(`${this.domain}/connect/tokeninfo?access_token=${n}`,{method:"GET"});const t=await e.json();if(!t.data){return false}return true}catch(e){return false}}async validateIDToken(e=""){const t=await this.Storage.getGrant(e,this.multiAccount);if(!t){return false}const{id_token:n}=t;try{const e=await fetch(`${this.domain}/connect/tokeninfo?id_token=${n}`,{method:"GET"});if(e.status!==200){return false}const t=await e.json();if(!t.data){return false}return true}catch(e){return false}}getDomain(){return this.domain}async auth(e){if(this.hosted&&(this.domain===globalThis.window?.location.origin||this.versioned&&this.domain.includes(globalThis.window?.location.origin))){await this.hostedSetCodeChallenge()}const t=await this.generateAuthURL(e);if(e.popup){this.popUp(t);return}return t}async generateAuthURL(e){const t=await this.getCodeChallege();let n=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;if(t){n+=`&code_challenge=${t}&code_challenge_method=S256&options=rotate_refresh_token`}if(e.provider){n+=`&provider=${e.provider}`}if(e.loginHint){n+=`&login_hint=${e.loginHint}`;if(e.includeGrantScopes){n+=`&include_grant_scopes=${e.includeGrantScopes}`}}if(e.scope){n+=`&scope=${e.scope.join(" ")}`}if(e.prompt){n+=`&prompt=${e.prompt}`}if(e.metadata){n+=`&metadata=${e.metadata}`}if(e.state||this.loginId){n+=`&state=${this.loginId?this.loginId:e.state}`}return n}async generateReauthURL(e,t){if(!e){throw new Error("Grant ID is required")}const n=await this.Storage.getUserToken(e);const i=await this.getCodeChallege();let s=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;if(i){s+=`&code_challenge=${i}&code_challenge_method=S256&options=rotate_refresh_token`}if(n?.provider){s+=`&provider=${n.provider}`}if(n?.email){s+=`&login_hint=${n.email}`}if(t){s+=`&scope=${t.join(" ")}`}return s}async generateCodeChallenge(){const e=await this.Storage.getPKCE();if(e){return}const t=O();this.Storage.setPKCE(t);return}async hostedSetCodeChallenge(){if(!this.hosted){throw console.error("Method only used with hosted flag enabled")}const e=new URLSearchParams(globalThis.window?.location.search);const t=e.get("code_challenge");if(!t){const e=await this.Storage.getPKCE();if(e){return}console.warn("Code challenge is recomended");return}this.Storage.setPKCE(t)}async getCodeChallege(){if(this.hosted&&(this.domain===globalThis.window?.location.origin||this.versioned&&this.domain.includes(globalThis.window?.location.origin))){const e=new URLSearchParams(globalThis.window?.location.search);const t=e.get("code_challenge");if(!t){console.warn("Code challenge is recomended");return""}return t}const e=await this.Storage.getPKCE();if(e){const t=await X(e);let n=btoa(unescape(encodeURIComponent(t)));n=K(n);return n}return""}async isLoggedIn(){if(this.hosted&&(this.domain===globalThis.window?.location.origin||this.versioned&&this.domain.includes(globalThis.window?.location.origin))){return false}const e=await this.Storage.getUserTokens();if(e&&e.length>0){if(this.multiAccount){await this.generateCodeChallenge()}return true}await this.generateCodeChallenge();return false}isMultiAccount(){return this.multiAccount}async logout(){const e=await this.getProfile();await this.Storage.clearSession();const t={detail:e};window.dispatchEvent(new CustomEvent("onLogoutSuccess",t))}async getProfile(e=""){let t;if(e){t=await this.Storage.getUserToken(e)}else{t=await this.Storage.getUserToken()}if(t){return t}return null}async getProfiles(){const e=await this.Storage.getUserTokens();if(e){return e}return null}async removeProfile(e){await this.Storage.removeUserToken(e);await this.Storage.removeGrant(e);return null}async authIMAP(e){const t=await this.getCodeChallege();const n={imap_username:e.imap_username,imap_password:e.imap_password,imap_host:e.imap_host,imap_port:e.imap_port,type:e.type,smtp_host:e.smtp_host,smtp_port:e.smtp_port,provider:e.provider,redirect_uri:this.redirectUri,state:e.state,public_application_id:this.clientId,access_type:this.accessType};if(this.loginId){n.id=this.loginId}if(e.smtp_username&&e.smtp_password){n.smtp_username=e.smtp_username;n.smtp_password=e.smtp_password}if(t!=""){n.code_challenge=t;n.code_challenge_method="S256"}const i=await fetch(`${this.domain}/connect/login/imap`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(n)});const s=await i.json();return s}async authEWS(e){const t=await this.getCodeChallege();const n={...e,provider:"ews",redirect_uri:this.redirectUri,public_application_id:this.clientId,access_type:this.accessType};if(this.loginId){n.id=this.loginId}if(t!=""){n.code_challenge=t;n.code_challenge_method="S256"}const i=await fetch(`${this.domain}/connect/login/ews`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(n)});const s=await i.json();return s}async detectEmail(e){const t=await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/providers/detect?client_id=${this.clientId}&email=${e}`,{method:"POST",headers:new Headers({"content-type":"application/json"})});const n=await t.json();return n}async applicationInfo(){const e=await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/applications?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})});const t=await e.json();return t.data}async getAvailableProviders(){const e=await fetch(`${this.domain}/connect/providers/find?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})});if(e){const t=await e.json();const n=t.data;return n}return null}onLoginSuccess(e){window.addEventListener("onLoginSuccess",(t=>e(t)))}onLogoutSuccess(e){window.addEventListener("onLogoutSuccess",(t=>e(t)))}onLoginFail(e){window.addEventListener("onLoginFail",(t=>e(t)))}onTokenRefreshSuccess(e){window.addEventListener("onTokenRefreshSuccess",(t=>e(t)))}onTokenRefreshFail(e){window.addEventListener("onTokenRefreshFail",(t=>e(t)))}onSessionExpired(e){window.addEventListener("onSessionExpired",(t=>e(t)))}async codeExchange(e){let t=new URLSearchParams(globalThis.window?.location.search);if(e){t=new URLSearchParams(e)}const n=t.get("code");const i=t.get("state");const s=t.get("error");const r=t.get("error_description");const o=t.get("error_code");if(s&&r&&o){const e={detail:{error:s,error_description:r,error_code:o}};window.dispatchEvent(new CustomEvent("onLoginFail",e));window.history.pushState({},document.title,globalThis.window?.location.pathname);return false}if(!n){console.warn("No code found");return false}if(window.opener&&window.name==="uas-popup"){console.warn("Popup window detected");return false}const a=await this.Storage.getPKCE();if(!a){console.warn("No code verifier found");return false}try{const e={client_id:this.clientId,redirect_uri:this.redirectUri,code:n,grant_type:"authorization_code",code_verifier:a};const t=await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(e)});const s=await t.json();if(s){if(s.error){const e={detail:s};window.dispatchEvent(new CustomEvent("onLoginFail",e));return true}const e=await this.handleCodeExchangeResponse(s);if(!e.valid){const t={detail:e.data};window.dispatchEvent(new CustomEvent("onLoginFail",t));return true}else{if(i){e.data.state=i}const t={detail:e.data};window.dispatchEvent(new CustomEvent("onLoginSuccess",t));window.history.pushState({},document.title,window.location.pathname)}}this.Storage.removePKCE();return true}catch(s){const e={detail:s};window.dispatchEvent(new CustomEvent("onLoginFail",e));window.history.pushState({},document.title,globalThis.window?.location.pathname);return false}}async tokenExchange(e=""){const t=await this.Storage.getGrant(e,this.multiAccount);if(!t){return false}const n=t.refresh_token;try{const t={client_id:this.clientId,redirect_uri:this.redirectUri,refresh_token:n,grant_type:"refresh_token"};const i=await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(t)});const s=await i.json();if(s){if(s.error){const e={detail:s};window.dispatchEvent(new CustomEvent("onTokenRefreshFail",e));return true}const t=Z();s.expires_in=t+s.expires_in;this.Storage.setGrant(s,this.multiAccount);const n=await this.validateIDToken(e);if(!n){const e={detail:s};window.dispatchEvent(new CustomEvent("onTokenRefreshFail",e));return true}const i={detail:s};window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess",i));return true}this.Storage.removePKCE()}catch(e){const t={detail:e};window.dispatchEvent(new CustomEvent("onTokenRefreshFail",t));return false}}async handleCodeExchangeResponse(e){const t=true;if(e.error){return{data:e,valid:false}}const n=Z();e.expires_in=n+e.expires_in;this.Storage.setGrant(e,this.multiAccount);const i=se(e.id_token);i.status="authenticated";this.Storage.setUserToken(i);const s=await this.validateIDToken(i.sub);if(!s){return{data:e,valid:false}}return{data:e,valid:t}}async popUp(e){const t=500;const n=600;const i=window.screenX+(window.outerWidth-t)/2;const s=window.screenY+(window.outerHeight-n)/2.5;const r=`uas-popup`;const o=e;const a=window.open(o,r,`width=${t},height=${n},left=${i},top=${s}`);if(!a){return}const c=setInterval((async()=>{if(a.closed){const e={detail:{error_description:"OAuth provider window closed"}};window.dispatchEvent(new CustomEvent("onLoginFail",e));c&&clearInterval(c);return}try{const e=a.location.href.split("?");if(!e[0]){return}const t=a.location.search;a.history.pushState({},document.title,window.location.pathname);if(e[0]===this.redirectUri&&e.length>1){const e=await this.codeExchange(t);a.close();if(e){location.reload()}c&&clearInterval(c);return}}catch(e){return}}),1e3)}async getAccessToken(e=""){const t=Z();const n=await this.Storage.getGrant(e,this.multiAccount);if(!n){return null}const{access_token:i,expires_in:s}=n;const r=i;if(r){if(s&&s>Z()){const e=s-t;if(e>30){return r}}}await this.tokenExchange(e);const o=await this.Storage.getGrant(e,this.multiAccount);return o.access_token}async sse(e,t){const n=t.headers||{};const i=n["Grant-ID"];let s="";if(this.multiAccount){if(!i){this.logout();throw new Error("Grant ID is required for multi account calls")}s=await this.getAccessToken(i)}else{s=await this.getAccessToken()}delete n["Grant-ID"];n["Authorization"]=`Bearer ${s}`;if(!n["content-type"]){n["content-type"]="application/json"}return Q(`${this.domain}/${e}`,{...t,headers:n})}async fetch(e,t,n=true,i){let s="";let r=1;if(this.multiAccount){if(!t.grant_id){this.logout();throw new Error("Grant ID is required for multi account calls")}const e=await this.getProfiles();r=e?e.length:1;s=await this.getAccessToken(t.grant_id)}else{s=await this.getAccessToken()}if(!s){throw new Error("Access token not found")}let o=t.headers;if(!Headers.prototype.isPrototypeOf(o)){o=new Headers({Authorization:`Bearer ${s}`,"content-type":"application/json"})}else{o.append("Authorization",`Bearer ${s}`);if(!o.has("content-type")){o.append("content-type","application/json")}}try{if(t?.body){t.body=JSON.stringify(t?.body)}const s=await fetch(`${i||this.domain}/${e}`,{...t,headers:o});if(!n){return s}const a=await(s?.json());const c=await this.isAuthenticatedResponse(s.status,a);if(!c){if(r>1){const e=await this.getProfile(t.grant_id);if(e){e.status="unauthorized";await this.Storage.setUserToken(e);const t={detail:{user:e}};window.dispatchEvent(new CustomEvent("onSessionExpired",t))}}else{const e=await this.Storage.getUserToken();const t={detail:{user:e}};window.dispatchEvent(new CustomEvent("onSessionExpired",t))}this.logout();return}return a}catch(e){throw e}}async fetchRequest(e,t,n,i=true,s,r){const o=await this.isLoggedIn();const a=new URL(e,s??this.domain);const c=new Headers;c.append("Accept","application/json");c.append("Content-Type","application/json");c.append("User-Agent","nylas-identity");if(o){const e=await this.getAccessToken();c.append("Authorization",`Bearer ${e}`)}const l=await fetch(a.toString(),{method:t||"GET",headers:c,mode:"cors",referrer:globalThis.window?.location.origin,body:n?JSON.stringify(n):undefined,...r||{}});if(!i){return l.body}const u=await l.json();return u}async isAuthenticatedResponse(e,t){if(e==401&&t?.error?.type=="token.unauthorized_access"){return false}return true}addAPIKey(e,t,n){this.Storage.setUserToken({aud:"https://api-staging.us.nylas.com/",exp:2e9,email_verified:true,iat:Z(),iss:"",email:t,provider:"virtual-calendar",status:"authenticated",name:t,sub:e});this.Storage.setGrant({grant_id:e,access_token:n,expires_in:2e9},this.multiAccount)}}var oe={exports:{}};var ae={};
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -7,5 +7,5 @@ import{h as e,F as t,r as n,c as i,H as s,a as r}from"./p-0EQQA0nE.js";import{N
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var ce;function le(){if(ce)return ae;ce=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator;function h(e){if(null===e||"object"!==typeof e)return null;e=d&&e[d]||e["@@iterator"];return"function"===typeof e?e:null}var f={isMounted:function(){return false},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,g={};function y(e,t,n){this.props=e;this.context=t;this.refs=g;this.updater=n||f}y.prototype.isReactComponent={};y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)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,e,t,"setState")};y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function w(){}w.prototype=y.prototype;function b(e,t,n){this.props=e;this.context=t;this.refs=g;this.updater=n||f}var m=b.prototype=new w;m.constructor=b;p(m,y.prototype);m.isPureReactComponent=true;var v=Array.isArray,_=Object.prototype.hasOwnProperty,E={current:null},k={key:true,ref:true,__self:true,__source:true};function x(t,n,i){var s,r={},o=null,a=null;if(null!=n)for(s in void 0!==n.ref&&(a=n.ref),void 0!==n.key&&(o=""+n.key),n)_.call(n,s)&&!k.hasOwnProperty(s)&&(r[s]=n[s]);var c=arguments.length-2;if(1===c)r.children=i;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}if(t&&t.defaultProps)for(s in c=t.defaultProps,c)void 0===r[s]&&(r[s]=c[s]);return{$$typeof:e,type:t,key:o,ref:a,props:r,_owner:E.current}}function C(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}function $(t){return"object"===typeof t&&null!==t&&t.$$typeof===e}function T(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}var S=/\/+/g;function P(e,t){return"object"===typeof e&&null!==e&&null!=e.key?T(""+e.key):t.toString(36)}function R(n,i,s,r,o){var a=typeof n;if("undefined"===a||"boolean"===a)n=null;var c=false;if(null===n)c=true;else switch(a){case"string":case"number":c=true;break;case"object":switch(n.$$typeof){case e:case t:c=true}}if(c)return c=n,o=o(c),n=""===r?"."+P(c,0):r,v(o)?(s="",null!=n&&(s=n.replace(S,"$&/")+"/"),R(o,i,s,"",(function(e){return e}))):null!=o&&($(o)&&(o=C(o,s+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(S,"$&/")+"/")+n)),i.push(o)),1;c=0;r=""===r?".":r+":";if(v(n))for(var l=0;l<n.length;l++){a=n[l];var u=r+P(a,l);c+=R(a,i,s,u,o)}else if(u=h(n),"function"===typeof u)for(n=u.call(n),l=0;!(a=n.next()).done;)a=a.value,u=r+P(a,l++),c+=R(a,i,s,u,o);else if("object"===a)throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.");return c}function I(e,t,n){if(null==e)return e;var i=[],s=0;R(e,i,"","",(function(e){return t.call(n,e,s++)}));return i}function q(e){if(-1===e._status){var t=e._result;t=t();t.then((function(t){if(0===e._status||-1===e._status)e._status=1,e._result=t}),(function(t){if(0===e._status||-1===e._status)e._status=2,e._result=t}));-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var A={current:null},N={transition:null},U={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:N,ReactCurrentOwner:E};ae.Children={map:I,forEach:function(e,t,n){I(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;I(e,(function(){t++}));return t},toArray:function(e){return I(e,(function(e){return e}))||[]},only:function(e){if(!$(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=y;ae.Fragment=n;ae.Profiler=s;ae.PureComponent=b;ae.StrictMode=i;ae.Suspense=c;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U;ae.cloneElement=function(t,n,i){if(null===t||void 0===t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=p({},t.props),r=t.key,o=t.ref,a=t._owner;if(null!=n){void 0!==n.ref&&(o=n.ref,a=E.current);void 0!==n.key&&(r=""+n.key);if(t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(l in n)_.call(n,l)&&!k.hasOwnProperty(l)&&(s[l]=void 0===n[l]&&void 0!==c?c[l]:n[l])}var l=arguments.length-2;if(1===l)s.children=i;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}return{$$typeof:e,type:t.type,key:r,ref:o,props:s,_owner:a}};ae.createContext=function(e){e={$$typeof:o,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};e.Provider={$$typeof:r,_context:e};return e.Consumer=e};ae.createElement=x;ae.createFactory=function(e){var t=x.bind(null,e);t.type=e;return t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:a,render:e}};ae.isValidElement=$;ae.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:q}};ae.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}};ae.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}};ae.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};ae.useCallback=function(e,t){return A.current.useCallback(e,t)};ae.useContext=function(e){return A.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return A.current.useDeferredValue(e)};ae.useEffect=function(e,t){return A.current.useEffect(e,t)};ae.useId=function(){return A.current.useId()};ae.useImperativeHandle=function(e,t,n){return A.current.useImperativeHandle(e,t,n)};ae.useInsertionEffect=function(e,t){return A.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return A.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return A.current.useMemo(e,t)};ae.useReducer=function(e,t,n){return A.current.useReducer(e,t,n)};ae.useRef=function(e){return A.current.useRef(e)};ae.useState=function(e){return A.current.useState(e)};ae.useSyncExternalStore=function(e,t,n){return A.current.useSyncExternalStore(e,t,n)};ae.useTransition=function(){return A.current.useTransition()};ae.version="18.2.0";return ae}var ue;function de(){if(ue)return oe.exports;ue=1;{oe.exports=le()}return oe.exports}de();const he=({authenticationUrl:t})=>e("div",{class:"login-required",part:"nse__login-required login-component"},e("div",{class:"card",part:"nse__login-required-card"},e("p",{part:"nse__login-required-text"},"Log into your account to use the Scheduler Editor."),e("button",{class:"google-button",part:"nse__login-required-google-button",onClick:async e=>{e.preventDefault();const n=await t("google");if(n){window.location.href=n}else{console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`)}}},e("span",{class:"icon"},e("google-logo-icon",{width:"15",height:"15"})),"Continue with Google"),e("button",{class:"microsoft-button",part:"nse__login-required-microsoft-button",onClick:async e=>{e.preventDefault();const n=await t("microsoft");if(n){window.location.href=n}else{console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`)}}},e("span",{class:"icon"},e("microsoft-logo-icon",{width:"15",height:"15"})),"Continue with Microsoft"),e("button",{class:"other-provider-button",part:"nse__login-required-other-provider-button",onClick:async e=>{e.preventDefault();const n=await t();if(n){window.location.href=n}else{console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`)}}},"View all providers ",e("chevron-icon",{width:"17",height:"17"})),e("small",{class:"disclaimer-text",part:"nse__login-required-disclaimer-text"},"* You will be redirected to authenticate your account.")));function fe({currentUser:n,calendars:i,selectedEventType:s}){const r=i?.find((e=>e.is_primary))||i?.[0];switch(s){case w.one_on_one:case w.max_availability:case w.max_fairness:{return e(t,null,e("nylas-event-info",null,e("div",{slot:"inputs"},e("nylas-event-title",null),e("nylas-event-duration",null),e("nylas-event-location",{userProvider:n.provider}))),e("nylas-booking-calendar-picker",{exportparts:"nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content",expressFlow:true,calendars:i,currentUser:n,defaultBookingCalendar:r?.id}),e("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}))}case w.collective:{return e(t,null,e("nylas-event-info",null,e("div",{slot:"inputs"},e("nylas-event-title",null),e("nylas-event-duration",null),e("nylas-event-location",{userProvider:n.provider}))),e("nylas-booking-calendar-picker",{exportparts:"nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content",expressFlow:true,calendars:i,currentUser:n,defaultBookingCalendar:r?.id}),e("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}),e("nylas-additional-participants",{name:"participants",eventParticipants:[{name:n?.name||n?.email,email:n?.email||"",is_organizer:true}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}))}case w.group:{return e(t,null,e("nylas-event-info",null,e("div",{slot:"inputs"},e("nylas-event-title",{noTemplates:true}),e("nylas-event-description",{noTemplates:true,hideAutoPopulateButton:true}),e("nylas-event-location",{userProvider:n.provider}),e("nylas-event-timeslot",{name:"event-timeslot"}),e("nylas-event-capacity",null))),e("nylas-booking-calendar-picker",{exportparts:"nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content",expressFlow:true,calendars:i,currentUser:n,defaultBookingCalendar:r?.id}),e("nylas-additional-participants",{name:"participants",eventParticipants:[{name:n?.name||n?.email,email:n?.email||"",is_organizer:true}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}),e("nylas-page-name",{requirePageName:true,pageName:"Group events page"}),e("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}))}}}const pe=':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-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}:host nylas-notification{position:absolute;top:0;right:0}@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:800px}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-content slot[name=login-required]{height:inherit}div.scheduler-editor-content--group{height:800px}@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;color:var(--nylas-base-900)}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;color:var(--nylas-base-900);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)}.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;color:var(--nylas-base-900)}.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;color:var(--nylas-base-900)}.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}@media screen and (max-width: 768px){.login-required{height:auto}}.list-configurations{padding:2rem;height:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}';const ge=class{constructor(e){n(this,e);this.init=i(this,"init",7);this.loggedIn=i(this,"loggedIn",7);this.loggedOut=i(this,"loggedOut",7);this.schedulerConfigCloseClicked=i(this,"schedulerConfigCloseClicked",7);this.eventOverrides={};this.schedulerPreviewLink="";this.mode="app";this.hideEditorTabs=[];this.requiresSlug=false;this.enableUserFeedback=true;this.nylasBranding=true;this.enableEventTypes={one_on_one:true,collective:true,max_fairness:true,max_availability:true,group:true};this.automaticComponentRegistration=true;this.selectedLanguage=this.defaultLanguage||b.en;this.langVersion=0;this.version="2.2.2";this.handleSchedulerConfigCloseClicked=e=>{const t=this.schedulerConfigCloseClicked.emit(this.host);if("schedulerConfigCloseClicked"in this.eventOverrides){this.eventOverrides.schedulerConfigCloseClicked(t,this.nylasSchedulerConfigConnector)}if(!t.defaultPrevented){localStorage.removeItem("grant");localStorage.removeItem("user");window.location.reload()}};this.authenticationUrl=async e=>{if(!this.nylasApiRequest){console.error(`[nylas-scheduler-editor] Nylas API Request is not initialized.`);return""}const t=await this.nylasApiRequest.authenticationUrl({provider:e});return t||""}}connectedCallback(){f(`[nylas-scheduler-editor] connectedCallback`)}async componentWillLoad(){f(`[nylas-scheduler-editor] componentWillLoad`);const e=this.additionalParticipants?.filter((e=>{const t=e.calendars?.length>0?e.calendars.filter((e=>e.id&&e.name)):[];if(e.name&&e.email&&t.length>0){return{name:e.name,email:e.email,calendars:t}}}));this.stores={schedulerConfig:E({...this.defaultSchedulerConfigState,additionalParticipants:e,conferenceProviders:this.conferenceProviders,requiresSlug:this.requiresSlug,selectedLanguage:this.defaultLanguage||b.en,nylasBranding:this.nylasBranding,experimentalFeatures:this.experimentalFeatures,enableEventTypes:this.enableEventTypes,themeConfig:this.themeConfig})};if(!this.nylasApiRequest&&this.nylasSessionsConfig){const e=new re(this.nylasSessionsConfig);await e.isLoggedIn();e.onLoginSuccess((async()=>{const e=await(this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser());if(e){const t=this.loggedIn.emit(this.host);if("loggedIn"in this.eventOverrides){await this.eventOverrides.loggedIn(t,this.nylasSchedulerConfigConnector)}if(!t.defaultPrevented){await this.loggedInHandler(e)}}}));e.onLoginFail((async()=>{this.stores?.schedulerConfig?.set("currentUser",null);const e=this.loggedOut.emit(this.host);if("loggedOut"in this.eventOverrides){await this.eventOverrides.loggedOut(e,this.nylasSchedulerConfigConnector);if(e.defaultPrevented){return}}}));this.nylasApiRequest=new a(e)}if(this.nylasApiRequest&&this.defaultAuthArgs){this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs)}this.baseProvider=new o(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const t=this.baseProvider.getStore("schedulerConfig");this.nylasSchedulerConfigConnector=new _({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:t});const n=this.init.emit(this.host);if("init"in this.eventOverrides){await this.eventOverrides.init(n,this.nylasSchedulerConfigConnector)}if(!n.defaultPrevented){const e=await(this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser());if(e){const t=this.loggedIn.emit(this.host);if("loggedIn"in this.eventOverrides){await this.eventOverrides.loggedIn(t,this.nylasSchedulerConfigConnector)}if(!t.defaultPrevented){await this.loggedInHandler(e)}}else{this.stores?.schedulerConfig?.set("currentUser",null);const e=this.loggedOut.emit(this.host);if("loggedOut"in this.eventOverrides){await this.eventOverrides.loggedOut(e,this.nylasSchedulerConfigConnector);if(e.defaultPrevented){return}}}}this.stores?.schedulerConfig?.onChange("selectedConfiguration",(async e=>{if(e&&e.id){this.configurationId=e.id}}));this.baseProvider?.componentWillLoad(this.nylasSchedulerConfigConnector);this.applyThemeConfig(this.themeConfig)}async componentDidLoad(){f(`[nylas-scheduler-editor] componentDidLoad`);await(this.baseProvider?.componentDidLoad());this.updateLocalization(this.localization);this.version="2.2.2"}async componentDisconnected(){await(this.baseProvider?.componentDisconnected())}async configurationIdChanged(e){if(e){await(this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(e));this.stores?.schedulerConfig?.set("action","edit")}else{this.stores?.schedulerConfig?.set("selectedConfiguration",{});this.stores?.schedulerConfig?.set("action",null)}}updateLocalization(e){if(!e){return}Object.keys(e).forEach((t=>{if(!(t in b)){return}p.addResourceBundle(t,"translation",e[t],false,true)}));this.langVersion++}updateNylasBranding(e){this.stores?.schedulerConfig?.set("nylasBranding",e)}updateExperimentalFeatures(e){this.stores?.schedulerConfig?.set("experimentalFeatures",e)}updateEnableEventTypes(e){this.stores?.schedulerConfig?.set("enableEventTypes",e)}themeConfigChanged(e){this.baseProvider?.getStore("schedulerConfig")?.set("themeConfig",e);this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}async store(){return this.stores?.schedulerConfig}async schedulerConnector(){return this.nylasSchedulerConfigConnector}async registerComponentHandler(e){this.baseProvider?.registerComponent(e.detail)}async unregisterComponentHandler(e){this.baseProvider?.unregisterComponent(e.detail)}nylasFormDropdownChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="language"){this.selectedLanguage=b[n];p.changeLanguage(this.selectedLanguage);this.stores?.schedulerConfig?.set("selectedLanguage",this.selectedLanguage)}}async loggedInHandler(e){this.stores?.schedulerConfig?.set("currentUser",e);if(!this.nylasSchedulerConfigConnector){return}await(this.nylasSchedulerConfigConnector.schedulerConfig?.getCalendars());if(this.configurationId){const e=await(this.nylasSchedulerConfigConnector.schedulerConfig?.getConfigurationById(this.configurationId));if(e&&e[0]?.id){this.stores?.schedulerConfig?.set("action","edit")}}}render(){const t=this.host.querySelector('[slot="custom-page-style-inputs"]');const n=this.stores?.schedulerConfig?.state.selectedConfiguration?.id;const i=Object.keys(m).map((e=>({label:m[e],value:e})));const r=this.stores?.schedulerConfig?.state.selectedEventType===w.group||this.stores?.schedulerConfig?.state.selectedConfiguration?.type===w.group;f(`[nylas-scheduler-editor] render mode: ${this.mode}`);return e(s,{key:"0ed6233ce777efc96d8c338dfca8dcdb58189a88"},e("div",{key:"f03ebd9354a5354a8b7bf96f8f4a893dbe0cdb51",class:"scheduler-editor-header",part:"nse__header"},e("h1",{key:"08f598da6f99df7dd9b8489399c778017290a5ab",class:"scheduler-editor-title",part:"nse__title"},e("calendar-icon",{key:"d45a288da25c8767d313acfdbc3d2d01455a8248",width:"18",height:"18"}),p.t("schedulerEditorTitle"),e("tooltip-component",{key:"114c54f5175e7ea7ff421fd4d85599c2edbcf362"},e("info-icon",{key:"fae29b3d0579b3b8f796d45290984b20a0e4f964",slot:"tooltip-icon"}),e("span",{key:"266835d0224159977f5284e946e5c76cd17ca9a1",slot:"tooltip-content"},this.version))),e("div",{key:"20bc2a98e03ed04509d40e09e7782a2e9f463a24",class:{language:true},part:"nse__language"},e("select-dropdown",{key:"5c380a4a14d9d4b5c4e4b9b3be8e3c929de9359d",name:"language",searchPlaceholder:p.t("search"),options:i,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:i.find((e=>e.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"},e("span",{key:"c8d33671643a63c8086e5665c86ae177a88770de",slot:"select-icon"},e("translate-icon",{key:"399127d7bdfa13f1028a3500c907eaa33ccf521f",width:"20",height:"20"})))),e("button",{key:"4b99c3c73f2155c50b8f264b7363ef38246637f9",class:"scheduler-editor-close",title:"logout",onClick:e=>this.handleSchedulerConfigCloseClicked(e),part:"nse__close-button"},e("close-icon",{key:"18f760f64c8233c9c76d431d5cef4b486c6def42",width:"18",height:"18"}))),e("div",{key:"b2d4601f7286f0a3af0d89bab6890f7a85155d47",class:{"scheduler-editor-content":true,"scheduler-editor-content--group":r},part:"nse__content"},this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action===null&&e("div",{key:"0b016e02499cde5ba5e20850440d5f743990fb23",class:"list-configurations",part:"nse__list-configurations"},e("nylas-list-configurations",{key:"adf9e242baef6ec09a7611aa9c5f58e7142f05f9",exportparts:"nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete"})),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="create-select"&&e("nylas-select-event-type",{key:"dcc2604843c2b7406feed6562c65f192a742436b"}),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="create"&&r&&e("nylas-editor-tabs-group",{key:"eb021702d5c5ceb1d693fa28c409bd2a41491630",mode:"composable"},e(fe,{key:"5eea8e023765cda8bbe2ddeb1f5d9fc6c0189635",selectedEventType:this.stores?.schedulerConfig?.state?.selectedEventType||w.one_on_one,currentUser:this.stores?.schedulerConfig?.state.currentUser,calendars:this.stores?.schedulerConfig?.state?.calendars,selectedConfiguration:this.stores?.schedulerConfig?.state?.selectedConfiguration})),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="create"&&!r&&e("nylas-editor-tabs",{key:"77a33fd49642b670c3aa7724d0bf5bd1c41f0b15",mode:"composable"},e(fe,{key:"f606f2ecc273b01a09a9394390bf0961ba9d8915",selectedEventType:this.stores?.schedulerConfig?.state?.selectedEventType||w.one_on_one,currentUser:this.stores?.schedulerConfig?.state.currentUser,calendars:this.stores?.schedulerConfig?.state?.calendars,selectedConfiguration:this.stores?.schedulerConfig?.state?.selectedConfiguration})),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="edit"&&r&&e("nylas-editor-tabs-group",{key:n,mode:this.mode},this.mode==="composable"&&e("slot",{key:"4bb66c5b1ae858d8cc96a15e8488f83a7bb53fb3"}),this.mode==="app"&&t&&e("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:n},e("slot",{key:"58bb10ddabb0f4206ddbc5984f1bd73135df7733",name:"custom-page-style-inputs"}))),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="edit"&&!r&&e("nylas-editor-tabs",{key:n,mode:this.mode},this.mode==="composable"&&e("slot",{key:"0cf7476d6cebcdbc64b56b955373263ff55f0053"}),this.mode==="app"&&t&&e("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:n},e("slot",{key:"b6992d02808bd35e742b52b817625a7dc9695b11",name:"custom-page-style-inputs"}))),!this.stores?.schedulerConfig?.state.currentUser&&e("slot",{key:"8946a6f4cb758864e18ed4313230ff23ba231027",name:"login-required"},e(he,{key:"308e0357ae236c2edc195a67e67a0d2685b3097d",authenticationUrl:this.authenticationUrl}))))}get host(){return r(this)}static get watchers(){return{configurationId:["configurationIdChanged"],localization:["updateLocalization"],nylasBranding:["updateNylasBranding"],experimentalFeatures:["updateExperimentalFeatures"],enableEventTypes:["updateEnableEventTypes"],themeConfig:["themeConfigChanged"]}}};ge.style=pe;export{ge as nylas_scheduler_editor};
|
|
11
|
-
//# sourceMappingURL=p-
|
|
10
|
+
*/var ce;function le(){if(ce)return ae;ce=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator;function h(e){if(null===e||"object"!==typeof e)return null;e=d&&e[d]||e["@@iterator"];return"function"===typeof e?e:null}var f={isMounted:function(){return false},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,g={};function y(e,t,n){this.props=e;this.context=t;this.refs=g;this.updater=n||f}y.prototype.isReactComponent={};y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)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,e,t,"setState")};y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function w(){}w.prototype=y.prototype;function b(e,t,n){this.props=e;this.context=t;this.refs=g;this.updater=n||f}var m=b.prototype=new w;m.constructor=b;p(m,y.prototype);m.isPureReactComponent=true;var v=Array.isArray,_=Object.prototype.hasOwnProperty,E={current:null},k={key:true,ref:true,__self:true,__source:true};function x(t,n,i){var s,r={},o=null,a=null;if(null!=n)for(s in void 0!==n.ref&&(a=n.ref),void 0!==n.key&&(o=""+n.key),n)_.call(n,s)&&!k.hasOwnProperty(s)&&(r[s]=n[s]);var c=arguments.length-2;if(1===c)r.children=i;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}if(t&&t.defaultProps)for(s in c=t.defaultProps,c)void 0===r[s]&&(r[s]=c[s]);return{$$typeof:e,type:t,key:o,ref:a,props:r,_owner:E.current}}function C(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}function $(t){return"object"===typeof t&&null!==t&&t.$$typeof===e}function T(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}var S=/\/+/g;function P(e,t){return"object"===typeof e&&null!==e&&null!=e.key?T(""+e.key):t.toString(36)}function R(n,i,s,r,o){var a=typeof n;if("undefined"===a||"boolean"===a)n=null;var c=false;if(null===n)c=true;else switch(a){case"string":case"number":c=true;break;case"object":switch(n.$$typeof){case e:case t:c=true}}if(c)return c=n,o=o(c),n=""===r?"."+P(c,0):r,v(o)?(s="",null!=n&&(s=n.replace(S,"$&/")+"/"),R(o,i,s,"",(function(e){return e}))):null!=o&&($(o)&&(o=C(o,s+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(S,"$&/")+"/")+n)),i.push(o)),1;c=0;r=""===r?".":r+":";if(v(n))for(var l=0;l<n.length;l++){a=n[l];var u=r+P(a,l);c+=R(a,i,s,u,o)}else if(u=h(n),"function"===typeof u)for(n=u.call(n),l=0;!(a=n.next()).done;)a=a.value,u=r+P(a,l++),c+=R(a,i,s,u,o);else if("object"===a)throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.");return c}function I(e,t,n){if(null==e)return e;var i=[],s=0;R(e,i,"","",(function(e){return t.call(n,e,s++)}));return i}function q(e){if(-1===e._status){var t=e._result;t=t();t.then((function(t){if(0===e._status||-1===e._status)e._status=1,e._result=t}),(function(t){if(0===e._status||-1===e._status)e._status=2,e._result=t}));-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var A={current:null},N={transition:null},U={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:N,ReactCurrentOwner:E};ae.Children={map:I,forEach:function(e,t,n){I(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;I(e,(function(){t++}));return t},toArray:function(e){return I(e,(function(e){return e}))||[]},only:function(e){if(!$(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=y;ae.Fragment=n;ae.Profiler=s;ae.PureComponent=b;ae.StrictMode=i;ae.Suspense=c;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U;ae.cloneElement=function(t,n,i){if(null===t||void 0===t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=p({},t.props),r=t.key,o=t.ref,a=t._owner;if(null!=n){void 0!==n.ref&&(o=n.ref,a=E.current);void 0!==n.key&&(r=""+n.key);if(t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(l in n)_.call(n,l)&&!k.hasOwnProperty(l)&&(s[l]=void 0===n[l]&&void 0!==c?c[l]:n[l])}var l=arguments.length-2;if(1===l)s.children=i;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}return{$$typeof:e,type:t.type,key:r,ref:o,props:s,_owner:a}};ae.createContext=function(e){e={$$typeof:o,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};e.Provider={$$typeof:r,_context:e};return e.Consumer=e};ae.createElement=x;ae.createFactory=function(e){var t=x.bind(null,e);t.type=e;return t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:a,render:e}};ae.isValidElement=$;ae.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:q}};ae.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}};ae.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}};ae.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};ae.useCallback=function(e,t){return A.current.useCallback(e,t)};ae.useContext=function(e){return A.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return A.current.useDeferredValue(e)};ae.useEffect=function(e,t){return A.current.useEffect(e,t)};ae.useId=function(){return A.current.useId()};ae.useImperativeHandle=function(e,t,n){return A.current.useImperativeHandle(e,t,n)};ae.useInsertionEffect=function(e,t){return A.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return A.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return A.current.useMemo(e,t)};ae.useReducer=function(e,t,n){return A.current.useReducer(e,t,n)};ae.useRef=function(e){return A.current.useRef(e)};ae.useState=function(e){return A.current.useState(e)};ae.useSyncExternalStore=function(e,t,n){return A.current.useSyncExternalStore(e,t,n)};ae.useTransition=function(){return A.current.useTransition()};ae.version="18.2.0";return ae}var ue;function de(){if(ue)return oe.exports;ue=1;{oe.exports=le()}return oe.exports}de();const he=({authenticationUrl:t})=>e("div",{class:"login-required",part:"nse__login-required login-component"},e("div",{class:"card",part:"nse__login-required-card"},e("p",{part:"nse__login-required-text"},"Log into your account to use the Scheduler Editor."),e("button",{class:"google-button",part:"nse__login-required-google-button",onClick:async e=>{e.preventDefault();const n=await t("google");if(n){window.location.href=n}else{console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`)}}},e("span",{class:"icon"},e("google-logo-icon",{width:"15",height:"15"})),"Continue with Google"),e("button",{class:"microsoft-button",part:"nse__login-required-microsoft-button",onClick:async e=>{e.preventDefault();const n=await t("microsoft");if(n){window.location.href=n}else{console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`)}}},e("span",{class:"icon"},e("microsoft-logo-icon",{width:"15",height:"15"})),"Continue with Microsoft"),e("button",{class:"other-provider-button",part:"nse__login-required-other-provider-button",onClick:async e=>{e.preventDefault();const n=await t();if(n){window.location.href=n}else{console.error(`[nylas-scheduler-editor] Unable to get authentication URL.`)}}},"View all providers ",e("chevron-icon",{width:"17",height:"17"})),e("small",{class:"disclaimer-text",part:"nse__login-required-disclaimer-text"},"* You will be redirected to authenticate your account.")));function fe({currentUser:n,calendars:i,selectedEventType:s}){const r=i?.find((e=>e.is_primary))||i?.[0];switch(s){case w.one_on_one:case w.max_availability:case w.max_fairness:{return e(t,null,e("nylas-event-info",null,e("div",{slot:"inputs"},e("nylas-event-title",null),e("nylas-event-duration",null),e("nylas-event-location",{userProvider:n.provider}))),e("nylas-booking-calendar-picker",{exportparts:"nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content",expressFlow:true,calendars:i,currentUser:n,defaultBookingCalendar:r?.id}),e("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}))}case w.collective:{return e(t,null,e("nylas-event-info",null,e("div",{slot:"inputs"},e("nylas-event-title",null),e("nylas-event-duration",null),e("nylas-event-location",{userProvider:n.provider}))),e("nylas-booking-calendar-picker",{exportparts:"nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content",expressFlow:true,calendars:i,currentUser:n,defaultBookingCalendar:r?.id}),e("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}),e("nylas-additional-participants",{name:"participants",eventParticipants:[{name:n?.name||n?.email,email:n?.email||"",is_organizer:true}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}))}case w.group:{return e(t,null,e("nylas-event-info",null,e("div",{slot:"inputs"},e("nylas-event-title",{noTemplates:true}),e("nylas-event-description",{noTemplates:true,hideAutoPopulateButton:true}),e("nylas-event-location",{userProvider:n.provider}),e("nylas-event-timeslot",{name:"event-timeslot"}),e("nylas-event-capacity",null))),e("nylas-booking-calendar-picker",{exportparts:"nbcp, nbcp__header, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content",expressFlow:true,calendars:i,currentUser:n,defaultBookingCalendar:r?.id}),e("nylas-additional-participants",{name:"participants",eventParticipants:[{name:n?.name||n?.email,email:n?.email||"",is_organizer:true}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}),e("nylas-page-name",{requirePageName:true,pageName:"Group events page"}),e("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}))}}}const pe=':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-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}:host nylas-notification{position:absolute;top:0;right:0}@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:800px}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-content slot[name=login-required]{height:inherit}div.scheduler-editor-content--group{height:800px}@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;color:var(--nylas-base-900)}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;color:var(--nylas-base-900);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)}.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;color:var(--nylas-base-900)}.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;color:var(--nylas-base-900)}.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}@media screen and (max-width: 768px){.login-required{height:auto}}.list-configurations{padding:2rem;height:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}';const ge=class{constructor(e){n(this,e);this.init=i(this,"init",7);this.loggedIn=i(this,"loggedIn",7);this.loggedOut=i(this,"loggedOut",7);this.schedulerConfigCloseClicked=i(this,"schedulerConfigCloseClicked",7);this.eventOverrides={};this.schedulerPreviewLink="";this.mode="app";this.hideEditorTabs=[];this.requiresSlug=false;this.enableUserFeedback=true;this.nylasBranding=true;this.enableEventTypes={one_on_one:true,collective:true,max_fairness:true,max_availability:true,group:true};this.automaticComponentRegistration=true;this.selectedLanguage=this.defaultLanguage||b.en;this.langVersion=0;this.version="2.2.3";this.handleSchedulerConfigCloseClicked=e=>{const t=this.schedulerConfigCloseClicked.emit(this.host);if("schedulerConfigCloseClicked"in this.eventOverrides){this.eventOverrides.schedulerConfigCloseClicked(t,this.nylasSchedulerConfigConnector)}if(!t.defaultPrevented){localStorage.removeItem("grant");localStorage.removeItem("user");window.location.reload()}};this.authenticationUrl=async e=>{if(!this.nylasApiRequest){console.error(`[nylas-scheduler-editor] Nylas API Request is not initialized.`);return""}const t=await this.nylasApiRequest.authenticationUrl({provider:e});return t||""}}connectedCallback(){f(`[nylas-scheduler-editor] connectedCallback`)}async componentWillLoad(){f(`[nylas-scheduler-editor] componentWillLoad`);const e=this.additionalParticipants?.filter((e=>{const t=e.calendars?.length>0?e.calendars.filter((e=>e.id&&e.name)):[];if(e.name&&e.email&&t.length>0){return{name:e.name,email:e.email,calendars:t}}}));this.stores={schedulerConfig:E({...this.defaultSchedulerConfigState,additionalParticipants:e,conferenceProviders:this.conferenceProviders,requiresSlug:this.requiresSlug,selectedLanguage:this.defaultLanguage||b.en,nylasBranding:this.nylasBranding,experimentalFeatures:this.experimentalFeatures,enableEventTypes:this.enableEventTypes,themeConfig:this.themeConfig})};if(!this.nylasApiRequest&&this.nylasSessionsConfig){const e=new re(this.nylasSessionsConfig);await e.isLoggedIn();e.onLoginSuccess((async()=>{const e=await(this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser());if(e){const t=this.loggedIn.emit(this.host);if("loggedIn"in this.eventOverrides){await this.eventOverrides.loggedIn(t,this.nylasSchedulerConfigConnector)}if(!t.defaultPrevented){await this.loggedInHandler(e)}}}));e.onLoginFail((async()=>{this.stores?.schedulerConfig?.set("currentUser",null);const e=this.loggedOut.emit(this.host);if("loggedOut"in this.eventOverrides){await this.eventOverrides.loggedOut(e,this.nylasSchedulerConfigConnector);if(e.defaultPrevented){return}}}));this.nylasApiRequest=new a(e)}if(this.nylasApiRequest&&this.defaultAuthArgs){this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs)}this.baseProvider=new o(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const t=this.baseProvider.getStore("schedulerConfig");this.nylasSchedulerConfigConnector=new _({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:t});const n=this.init.emit(this.host);if("init"in this.eventOverrides){await this.eventOverrides.init(n,this.nylasSchedulerConfigConnector)}if(!n.defaultPrevented){const e=await(this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser());if(e){const t=this.loggedIn.emit(this.host);if("loggedIn"in this.eventOverrides){await this.eventOverrides.loggedIn(t,this.nylasSchedulerConfigConnector)}if(!t.defaultPrevented){await this.loggedInHandler(e)}}else{this.stores?.schedulerConfig?.set("currentUser",null);const e=this.loggedOut.emit(this.host);if("loggedOut"in this.eventOverrides){await this.eventOverrides.loggedOut(e,this.nylasSchedulerConfigConnector);if(e.defaultPrevented){return}}}}this.stores?.schedulerConfig?.onChange("selectedConfiguration",(async e=>{if(e&&e.id){this.configurationId=e.id}}));this.baseProvider?.componentWillLoad(this.nylasSchedulerConfigConnector);this.applyThemeConfig(this.themeConfig)}async componentDidLoad(){f(`[nylas-scheduler-editor] componentDidLoad`);await(this.baseProvider?.componentDidLoad());this.updateLocalization(this.localization);this.version="2.2.3"}async componentDisconnected(){await(this.baseProvider?.componentDisconnected())}async configurationIdChanged(e){if(e){await(this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(e));this.stores?.schedulerConfig?.set("action","edit")}else{this.stores?.schedulerConfig?.set("selectedConfiguration",{});this.stores?.schedulerConfig?.set("action",null)}}updateLocalization(e){if(!e){return}Object.keys(e).forEach((t=>{if(!(t in b)){return}p.addResourceBundle(t,"translation",e[t],false,true)}));this.langVersion++}updateNylasBranding(e){this.stores?.schedulerConfig?.set("nylasBranding",e)}updateExperimentalFeatures(e){this.stores?.schedulerConfig?.set("experimentalFeatures",e)}updateEnableEventTypes(e){this.stores?.schedulerConfig?.set("enableEventTypes",e)}themeConfigChanged(e){this.baseProvider?.getStore("schedulerConfig")?.set("themeConfig",e);this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}async store(){return this.stores?.schedulerConfig}async schedulerConnector(){return this.nylasSchedulerConfigConnector}async registerComponentHandler(e){this.baseProvider?.registerComponent(e.detail)}async unregisterComponentHandler(e){this.baseProvider?.unregisterComponent(e.detail)}nylasFormDropdownChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="language"){this.selectedLanguage=b[n];p.changeLanguage(this.selectedLanguage);this.stores?.schedulerConfig?.set("selectedLanguage",this.selectedLanguage)}}async loggedInHandler(e){this.stores?.schedulerConfig?.set("currentUser",e);if(!this.nylasSchedulerConfigConnector){return}await(this.nylasSchedulerConfigConnector.schedulerConfig?.getCalendars());if(this.configurationId){const e=await(this.nylasSchedulerConfigConnector.schedulerConfig?.getConfigurationById(this.configurationId));if(e&&e[0]?.id){this.stores?.schedulerConfig?.set("action","edit")}}}render(){const t=this.host.querySelector('[slot="custom-page-style-inputs"]');const n=this.stores?.schedulerConfig?.state.selectedConfiguration?.id;const i=Object.keys(m).map((e=>({label:m[e],value:e})));const r=this.stores?.schedulerConfig?.state.selectedEventType===w.group||this.stores?.schedulerConfig?.state.selectedConfiguration?.type===w.group;f(`[nylas-scheduler-editor] render mode: ${this.mode}`);return e(s,{key:"0ed6233ce777efc96d8c338dfca8dcdb58189a88"},e("div",{key:"f03ebd9354a5354a8b7bf96f8f4a893dbe0cdb51",class:"scheduler-editor-header",part:"nse__header"},e("h1",{key:"08f598da6f99df7dd9b8489399c778017290a5ab",class:"scheduler-editor-title",part:"nse__title"},e("calendar-icon",{key:"d45a288da25c8767d313acfdbc3d2d01455a8248",width:"18",height:"18"}),p.t("schedulerEditorTitle"),e("tooltip-component",{key:"114c54f5175e7ea7ff421fd4d85599c2edbcf362"},e("info-icon",{key:"fae29b3d0579b3b8f796d45290984b20a0e4f964",slot:"tooltip-icon"}),e("span",{key:"266835d0224159977f5284e946e5c76cd17ca9a1",slot:"tooltip-content"},this.version))),e("div",{key:"20bc2a98e03ed04509d40e09e7782a2e9f463a24",class:{language:true},part:"nse__language"},e("select-dropdown",{key:"5c380a4a14d9d4b5c4e4b9b3be8e3c929de9359d",name:"language",searchPlaceholder:p.t("search"),options:i,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:i.find((e=>e.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"},e("span",{key:"c8d33671643a63c8086e5665c86ae177a88770de",slot:"select-icon"},e("translate-icon",{key:"399127d7bdfa13f1028a3500c907eaa33ccf521f",width:"20",height:"20"})))),e("button",{key:"4b99c3c73f2155c50b8f264b7363ef38246637f9",class:"scheduler-editor-close",title:"logout",onClick:e=>this.handleSchedulerConfigCloseClicked(e),part:"nse__close-button"},e("close-icon",{key:"18f760f64c8233c9c76d431d5cef4b486c6def42",width:"18",height:"18"}))),e("div",{key:"b2d4601f7286f0a3af0d89bab6890f7a85155d47",class:{"scheduler-editor-content":true,"scheduler-editor-content--group":r},part:"nse__content"},this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action===null&&e("div",{key:"0b016e02499cde5ba5e20850440d5f743990fb23",class:"list-configurations",part:"nse__list-configurations"},e("nylas-list-configurations",{key:"adf9e242baef6ec09a7611aa9c5f58e7142f05f9",exportparts:"nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete"})),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="create-select"&&e("nylas-select-event-type",{key:"dcc2604843c2b7406feed6562c65f192a742436b"}),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="create"&&r&&e("nylas-editor-tabs-group",{key:"eb021702d5c5ceb1d693fa28c409bd2a41491630",mode:"composable"},e(fe,{key:"5eea8e023765cda8bbe2ddeb1f5d9fc6c0189635",selectedEventType:this.stores?.schedulerConfig?.state?.selectedEventType||w.one_on_one,currentUser:this.stores?.schedulerConfig?.state.currentUser,calendars:this.stores?.schedulerConfig?.state?.calendars,selectedConfiguration:this.stores?.schedulerConfig?.state?.selectedConfiguration})),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="create"&&!r&&e("nylas-editor-tabs",{key:"77a33fd49642b670c3aa7724d0bf5bd1c41f0b15",mode:"composable"},e(fe,{key:"f606f2ecc273b01a09a9394390bf0961ba9d8915",selectedEventType:this.stores?.schedulerConfig?.state?.selectedEventType||w.one_on_one,currentUser:this.stores?.schedulerConfig?.state.currentUser,calendars:this.stores?.schedulerConfig?.state?.calendars,selectedConfiguration:this.stores?.schedulerConfig?.state?.selectedConfiguration})),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="edit"&&r&&e("nylas-editor-tabs-group",{key:n,mode:this.mode},this.mode==="composable"&&e("slot",{key:"4bb66c5b1ae858d8cc96a15e8488f83a7bb53fb3"}),this.mode==="app"&&t&&e("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:n},e("slot",{key:"58bb10ddabb0f4206ddbc5984f1bd73135df7733",name:"custom-page-style-inputs"}))),this.stores?.schedulerConfig?.state.currentUser&&this.stores.schedulerConfig.state.action==="edit"&&!r&&e("nylas-editor-tabs",{key:n,mode:this.mode},this.mode==="composable"&&e("slot",{key:"0cf7476d6cebcdbc64b56b955373263ff55f0053"}),this.mode==="app"&&t&&e("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:n},e("slot",{key:"b6992d02808bd35e742b52b817625a7dc9695b11",name:"custom-page-style-inputs"}))),!this.stores?.schedulerConfig?.state.currentUser&&e("slot",{key:"8946a6f4cb758864e18ed4313230ff23ba231027",name:"login-required"},e(he,{key:"308e0357ae236c2edc195a67e67a0d2685b3097d",authenticationUrl:this.authenticationUrl}))))}get host(){return r(this)}static get watchers(){return{configurationId:["configurationIdChanged"],localization:["updateLocalization"],nylasBranding:["updateNylasBranding"],experimentalFeatures:["updateExperimentalFeatures"],enableEventTypes:["updateEnableEventTypes"],themeConfig:["themeConfigChanged"]}}};ge.style=pe;export{ge as nylas_scheduler_editor};
|
|
11
|
+
//# sourceMappingURL=p-e3bdf91a.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as a,H as l,a as r}from"./p-0EQQA0nE.js";import{R as o}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as a,H as l,a as r}from"./p-0EQQA0nE.js";import{R as o}from"./p-Dygm6M6b.js";import{b as n,F as s}from"./p-C_2w_vhw.js";const c=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-form-card{width:100%;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-form-card__header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}';var f=undefined&&undefined.__decorate||function(e,a,l,r){var o=arguments.length,n=o<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,l):r,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,a,l,r);else for(var c=e.length-1;c>=0;c--)if(s=e[c])n=(o<3?s(n):o>3?s(a,l,n):s(a,l))||n;return o>3&&n&&Object.defineProperty(a,l,n),n};var y=undefined&&undefined.__metadata||function(e,a){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,a)};const d=class{constructor(a){e(this,a);if(a.$hostElement$["s-ei"]){this.internals=a.$hostElement$["s-ei"]}else{this.internals=a.$hostElement$.attachInternals();a.$hostElement$["s-ei"]=this.internals}}themeConfigChangedHandler(e,a){if(e===a)return;this.applyThemeConfig(e)}connectedCallback(){n("nylas-event-card","connectedCallback")}componentWillLoad(){n("nylas-event-card","componentWillLoad");this.applyThemeConfig(this.themeConfig)}componentDidLoad(){n("nylas-event-card","componentDidLoad")}disconnectedCallback(){n("nylas-event-card","disconnectedCallback");const e=["header-title","header-subtitle","content"];s(e,this.host)}applyThemeConfig(e){if(e){for(const[a,l]of Object.entries(e)){this.host.style.setProperty(`${a}`,l)}}}render(){return a(l,{key:"ccd7a9849ea5e8d424bb80a8aa4afd67dd28423a"},a("div",{key:"41064647cfca7ea4d08cdaab916b74ad7ed43ba4",class:"nylas-form-card",part:"nfc"},a("div",{key:"549e6b4daec030f2e76b4c1c870620094af9bc83",class:"nylas-form-card__header",part:"nfc__header"},a("slot",{key:"8d1b3e33f026cf806fe1a7c5e4c3b39c87468e16",name:"header-title"}),a("slot",{key:"81479dfa94fec4a3d8d9cd5c84249e7caf9f36b7",name:"header-subtitle"})),a("div",{key:"e81e8f141b8764a9f0917ffceeafc8879acd1284",class:"nylas-form-card__content"},a("slot",{key:"f076c6368d2f5771c4c8289af6460b33c845ba4f",name:"content"}))))}static get formAssociated(){return true}get host(){return r(this)}static get watchers(){return{themeConfig:["themeConfigChangedHandler"]}}};f([o({name:"nylas-form-card",stateToProps:new Map([["schedulerConfig.themeConfig","themeConfig"]]),eventToProps:{},fireRegisterEvent:true}),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",void 0)],d.prototype,"render",null);d.style=c;export{d as nylas_form_card};
|
|
2
|
+
//# sourceMappingURL=p-e40b0d20.entry.js.map
|