@nylas/web-elements 2.5.15 → 2.5.16
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 +2982 -2982
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +1 -1
- package/dist/cjs/google-logo-icon.microsoft-logo-icon.nylas-editor-tabs.nylas-editor-tabs-group.nylas-list-configurations.nylas-select-event-type.entry.cjs.js.map +1 -1
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +21 -13
- package/dist/cjs/google-logo-icon_6.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +1 -1
- package/dist/cjs/{version-1ZdVKLpt.js → version-Cc3rTMtG.js} +3 -3
- package/dist/cjs/{version-1ZdVKLpt.js.map → version-Cc3rTMtG.js.map} +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +10 -6
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js +10 -6
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js.map +1 -1
- package/dist/collection/version.js +1 -1
- package/dist/collection/version.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-notetaker-config.js +1 -1
- package/dist/components/nylas-notification.js +1 -1
- package/dist/components/nylas-only-specific-time-availability.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 +56 -56
- package/dist/components/nylas-scheduling-method.js +1 -1
- package/dist/components/nylas-scheduling.js +19 -19
- 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-BNzrPoR6.js → p-37a4h3J_.js} +5 -5
- package/dist/components/{p-BNzrPoR6.js.map → p-37a4h3J_.js.map} +1 -1
- package/dist/components/{p-CiJgH0CI.js → p-3FTb1-in.js} +17 -17
- package/dist/components/{p-CiJgH0CI.js.map → p-3FTb1-in.js.map} +1 -1
- package/dist/components/{p-Dlku8PCX.js → p-96zW11tR.js} +4 -4
- package/dist/components/{p-Dlku8PCX.js.map → p-96zW11tR.js.map} +1 -1
- package/dist/components/{p-CSECxNkF.js → p-B2cPNmM_.js} +6 -6
- package/dist/components/{p-CSECxNkF.js.map → p-B2cPNmM_.js.map} +1 -1
- package/dist/components/{p-DqgGszYv.js → p-B3cnALr8.js} +8 -8
- package/dist/components/{p-DqgGszYv.js.map → p-B3cnALr8.js.map} +1 -1
- package/dist/components/{p-FBEildbE.js → p-BBxu-pwN.js} +8 -8
- package/dist/components/{p-FBEildbE.js.map → p-BBxu-pwN.js.map} +1 -1
- package/dist/components/{p-Cx6l-C7e.js → p-BGbMXlLy.js} +4 -4
- package/dist/components/{p-Cx6l-C7e.js.map → p-BGbMXlLy.js.map} +1 -1
- package/dist/components/{p-DfNywLNk.js → p-BJ5a9k3B.js} +4 -4
- package/dist/components/{p-DfNywLNk.js.map → p-BJ5a9k3B.js.map} +1 -1
- package/dist/components/{p-Di0G82W0.js → p-BJsBeE4_.js} +60 -56
- package/dist/components/p-BJsBeE4_.js.map +1 -0
- package/dist/components/{p-rODq8j3H.js → p-BMmtU0fv.js} +5 -5
- package/dist/components/{p-rODq8j3H.js.map → p-BMmtU0fv.js.map} +1 -1
- package/dist/components/{p-uQf7jw6y.js → p-BTwTmU9e.js} +7 -7
- package/dist/components/{p-uQf7jw6y.js.map → p-BTwTmU9e.js.map} +1 -1
- package/dist/components/{p-B5zQj3-Z.js → p-BWbQSVNH.js} +4 -4
- package/dist/components/{p-B5zQj3-Z.js.map → p-BWbQSVNH.js.map} +1 -1
- package/dist/components/{p-D_CPIneS.js → p-BYzkNeMW.js} +3 -3
- package/dist/components/{p-D_CPIneS.js.map → p-BYzkNeMW.js.map} +1 -1
- package/dist/components/{p-B9G8DJJr.js → p-BqD6DKLT.js} +4 -4
- package/dist/components/{p-B9G8DJJr.js.map → p-BqD6DKLT.js.map} +1 -1
- package/dist/components/{p-Ch03cZa9.js → p-Bsd63RFi.js} +3 -3
- package/dist/components/{p-Ch03cZa9.js.map → p-Bsd63RFi.js.map} +1 -1
- package/dist/components/{p-BTo3RJwU.js → p-BuJdnN6-.js} +5 -5
- package/dist/components/{p-BTo3RJwU.js.map → p-BuJdnN6-.js.map} +1 -1
- package/dist/components/{p-Bj4ZUpbc.js → p-Bvnci8k8.js} +4 -4
- package/dist/components/{p-Bj4ZUpbc.js.map → p-Bvnci8k8.js.map} +1 -1
- package/dist/components/{p-DclMe63w.js → p-BxrC0Rsf.js} +3 -3
- package/dist/components/{p-DclMe63w.js.map → p-BxrC0Rsf.js.map} +1 -1
- package/dist/components/{p-W0q3GPje.js → p-BzLxndYA.js} +3 -3
- package/dist/components/{p-W0q3GPje.js.map → p-BzLxndYA.js.map} +1 -1
- package/dist/components/{p-CfNiz60j.js → p-CL8ugNmu.js} +5 -5
- package/dist/components/{p-CfNiz60j.js.map → p-CL8ugNmu.js.map} +1 -1
- package/dist/components/{p-BCUF1qcs.js → p-CMNiSC4o.js} +3 -3
- package/dist/components/{p-BCUF1qcs.js.map → p-CMNiSC4o.js.map} +1 -1
- package/dist/components/{p-CM9l-8zy.js → p-CRIlyxX5.js} +5 -5
- package/dist/components/{p-CM9l-8zy.js.map → p-CRIlyxX5.js.map} +1 -1
- package/dist/components/{p-xnXT49TS.js → p-CUe11ohy.js} +4 -4
- package/dist/components/{p-xnXT49TS.js.map → p-CUe11ohy.js.map} +1 -1
- package/dist/components/{p-CpP2uaEo.js → p-CUlV7ZGv.js} +3 -3
- package/dist/components/{p-CpP2uaEo.js.map → p-CUlV7ZGv.js.map} +1 -1
- package/dist/components/{p-BWCjcWGP.js → p-CXkCnHr5.js} +4 -4
- package/dist/components/{p-BWCjcWGP.js.map → p-CXkCnHr5.js.map} +1 -1
- package/dist/components/{p-DW9sxBeM.js → p-CdBb4zI5.js} +6 -6
- package/dist/components/{p-DW9sxBeM.js.map → p-CdBb4zI5.js.map} +1 -1
- package/dist/components/{p-OAhdn1vx.js → p-CdPtFwy6.js} +3 -3
- package/dist/components/{p-OAhdn1vx.js.map → p-CdPtFwy6.js.map} +1 -1
- package/dist/components/{p-umrdj-23.js → p-CeKOSPvz.js} +5 -5
- package/dist/components/{p-umrdj-23.js.map → p-CeKOSPvz.js.map} +1 -1
- package/dist/components/{p-CNvWFjFr.js → p-Ch_HOS-9.js} +4 -4
- package/dist/components/{p-CNvWFjFr.js.map → p-Ch_HOS-9.js.map} +1 -1
- package/dist/components/{p-sH4nuWqV.js → p-Ci-pKDnr.js} +4 -4
- package/dist/components/{p-sH4nuWqV.js.map → p-Ci-pKDnr.js.map} +1 -1
- package/dist/components/{p-Co08mMKn.js → p-CpGRDWt9.js} +4 -4
- package/dist/components/{p-Co08mMKn.js.map → p-CpGRDWt9.js.map} +1 -1
- package/dist/components/{p-DjFQHhGY.js → p-CuaQW941.js} +4 -4
- package/dist/components/{p-DjFQHhGY.js.map → p-CuaQW941.js.map} +1 -1
- package/dist/components/{p-Dwxouxgj.js → p-CzSowwcD.js} +4 -4
- package/dist/components/{p-Dwxouxgj.js.map → p-CzSowwcD.js.map} +1 -1
- package/dist/components/{p-i8gpwgDT.js → p-D0137Jos.js} +4 -4
- package/dist/components/{p-i8gpwgDT.js.map → p-D0137Jos.js.map} +1 -1
- package/dist/components/{p-4jS2598L.js → p-D04Mu9fK.js} +3 -3
- package/dist/components/{p-4jS2598L.js.map → p-D04Mu9fK.js.map} +1 -1
- package/dist/components/{p-BlxYpYrq.js → p-D0qMgeBc.js} +4 -4
- package/dist/components/{p-BlxYpYrq.js.map → p-D0qMgeBc.js.map} +1 -1
- package/dist/components/{p-DswqiER3.js → p-D42UGkjM.js} +3 -3
- package/dist/components/{p-DswqiER3.js.map → p-D42UGkjM.js.map} +1 -1
- package/dist/components/{p-TOG3UyB_.js → p-D4gKLnje.js} +7 -7
- package/dist/components/{p-TOG3UyB_.js.map → p-D4gKLnje.js.map} +1 -1
- package/dist/components/{p-DjQuy9Lc.js → p-D5Swz0J4.js} +5 -5
- package/dist/components/{p-DjQuy9Lc.js.map → p-D5Swz0J4.js.map} +1 -1
- package/dist/components/{p-D6yyOiee.js → p-D9mHh12b.js} +5 -5
- package/dist/components/{p-D6yyOiee.js.map → p-D9mHh12b.js.map} +1 -1
- package/dist/components/{p-B2_cvJns.js → p-DDd7Mjvz.js} +5 -5
- package/dist/components/{p-B2_cvJns.js.map → p-DDd7Mjvz.js.map} +1 -1
- package/dist/components/{p-C1Z2qktB.js → p-DGDbXfHm.js} +7 -7
- package/dist/components/{p-C1Z2qktB.js.map → p-DGDbXfHm.js.map} +1 -1
- package/dist/components/{p-CjMpnxmP.js → p-DMwaGWVu.js} +3 -3
- package/dist/components/{p-CjMpnxmP.js.map → p-DMwaGWVu.js.map} +1 -1
- package/dist/components/{p-C2EKszp0.js → p-DOryfnIf.js} +3 -3
- package/dist/components/{p-C2EKszp0.js.map → p-DOryfnIf.js.map} +1 -1
- package/dist/components/{p-D8f8zHZu.js → p-DPL6BIu2.js} +5 -5
- package/dist/components/{p-D8f8zHZu.js.map → p-DPL6BIu2.js.map} +1 -1
- package/dist/components/{p-B2iddmWd.js → p-DPPqmJvY.js} +5 -5
- package/dist/components/{p-B2iddmWd.js.map → p-DPPqmJvY.js.map} +1 -1
- package/dist/components/{p-Bi06RVaz.js → p-DRMxunL6.js} +3 -3
- package/dist/components/{p-Bi06RVaz.js.map → p-DRMxunL6.js.map} +1 -1
- package/dist/components/{p-D7Xfdt74.js → p-DUVwWh7e.js} +4 -4
- package/dist/components/{p-D7Xfdt74.js.map → p-DUVwWh7e.js.map} +1 -1
- package/dist/components/{p-f0IvxSr9.js → p-DZwGCUUK.js} +6 -6
- package/dist/components/{p-f0IvxSr9.js.map → p-DZwGCUUK.js.map} +1 -1
- package/dist/components/{p-tIcs9Qo5.js → p-D_daFt1t.js} +5 -5
- package/dist/components/{p-tIcs9Qo5.js.map → p-D_daFt1t.js.map} +1 -1
- package/dist/components/{p-DGUo_p68.js → p-DcXycU5_.js} +4 -4
- package/dist/components/{p-DGUo_p68.js.map → p-DcXycU5_.js.map} +1 -1
- package/dist/components/{p-w9ANRXbn.js → p-DfxhC7Fd.js} +5 -5
- package/dist/components/{p-w9ANRXbn.js.map → p-DfxhC7Fd.js.map} +1 -1
- package/dist/components/{p-eej_Ksq1.js → p-DjJOgfxK.js} +5 -5
- package/dist/components/{p-eej_Ksq1.js.map → p-DjJOgfxK.js.map} +1 -1
- package/dist/components/{p-p9sl0FFV.js → p-KzMRmaBa.js} +50 -46
- package/dist/components/p-KzMRmaBa.js.map +1 -0
- package/dist/components/{p-ixTtdC_2.js → p-LOCJMijY.js} +5 -5
- package/dist/components/{p-ixTtdC_2.js.map → p-LOCJMijY.js.map} +1 -1
- package/dist/components/{p-DGwr7E6J.js → p-NA5f_7b7.js} +4 -4
- package/dist/components/{p-DGwr7E6J.js.map → p-NA5f_7b7.js.map} +1 -1
- package/dist/components/{p-Cf-rjo7-.js → p-O9btdnkK.js} +6 -6
- package/dist/components/{p-Cf-rjo7-.js.map → p-O9btdnkK.js.map} +1 -1
- package/dist/components/{p-tx39yUB3.js → p-RPocf_FZ.js} +8 -8
- package/dist/components/{p-tx39yUB3.js.map → p-RPocf_FZ.js.map} +1 -1
- package/dist/components/{p-EKeBVTKB.js → p-UTn_XnKO.js} +5 -5
- package/dist/components/{p-EKeBVTKB.js.map → p-UTn_XnKO.js.map} +1 -1
- package/dist/components/{p-CeWOPOaM.js → p-eV80kRKP.js} +4 -4
- package/dist/components/{p-CeWOPOaM.js.map → p-eV80kRKP.js.map} +1 -1
- package/dist/components/{p-CbB5JFln.js → p-fwU4mtR0.js} +4 -4
- package/dist/components/{p-CbB5JFln.js.map → p-fwU4mtR0.js.map} +1 -1
- package/dist/components/{p-DrmjHhDH.js → p-g9YD1HRv.js} +5 -5
- package/dist/components/{p-DrmjHhDH.js.map → p-g9YD1HRv.js.map} +1 -1
- package/dist/components/{p-DvPuyp-I.js → p-nhhVpJed.js} +7 -7
- package/dist/components/{p-DvPuyp-I.js.map → p-nhhVpJed.js.map} +1 -1
- package/dist/components/{p-oVDOs1AN.js → p-oRjUujH5.js} +4 -4
- package/dist/components/{p-oVDOs1AN.js.map → p-oRjUujH5.js.map} +1 -1
- package/dist/components/{p-hmiyEk6L.js → p-qo42Sy8T.js} +5 -5
- package/dist/components/{p-hmiyEk6L.js.map → p-qo42Sy8T.js.map} +1 -1
- package/dist/components/{p-D_8c_n1h.js → p-uxA_4Zq1.js} +4 -4
- package/dist/components/{p-D_8c_n1h.js.map → p-uxA_4Zq1.js.map} +1 -1
- package/dist/components/{p-DWMCGYZt.js → p-wJgbEd5m.js} +5 -5
- package/dist/components/{p-DWMCGYZt.js.map → p-wJgbEd5m.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-DfvNw5fP.js → abstract-provider-C4xP8KoA.js} +3 -3
- package/dist/esm/{abstract-provider-DfvNw5fP.js.map → abstract-provider-C4xP8KoA.js.map} +1 -1
- package/dist/esm/calendar-agenda-fill-icon_39.entry.js +2 -2
- package/dist/esm/checkbox-group_4.entry.js +3 -3
- package/dist/esm/checkmark-icon_14.entry.js +2 -2
- package/dist/esm/{customParseFormat-BUZsRKas.js → customParseFormat-oEkUiMUN.js} +3 -3
- package/dist/esm/{customParseFormat-BUZsRKas.js.map → customParseFormat-oEkUiMUN.js.map} +1 -1
- package/dist/esm/globe-icon_3.entry.js +2 -2
- package/dist/esm/google-logo-icon.microsoft-logo-icon.nylas-editor-tabs.nylas-editor-tabs-group.nylas-list-configurations.nylas-select-event-type.entry.js.map +1 -1
- package/dist/esm/google-logo-icon_6.entry.js +23 -15
- package/dist/esm/google-logo-icon_6.entry.js.map +1 -1
- 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/input-image-url_2.entry.js +2 -2
- package/dist/esm/multi-select-dropdown.entry.js +1 -1
- package/dist/esm/{nylas-api-request-B3Fj4B-L.js → nylas-api-request-CWLncKIc.js} +3 -3
- package/dist/esm/{nylas-api-request-B3Fj4B-L.js.map → nylas-api-request-CWLncKIc.js.map} +1 -1
- package/dist/esm/nylas-booked-event-card_11.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 +4 -4
- package/dist/esm/nylas-scheduling.entry.js +3 -3
- package/dist/esm/{register-component-B9YP9nha.js → register-component-4Wk1RjFK.js} +3 -3
- package/dist/esm/{register-component-B9YP9nha.js.map → register-component-4Wk1RjFK.js.map} +1 -1
- package/dist/esm/textarea-component.entry.js +1 -1
- package/dist/esm/{utils-OpKyWV8q.js → utils-DfIu4gMZ.js} +3 -3
- package/dist/esm/{utils-OpKyWV8q.js.map → utils-DfIu4gMZ.js.map} +1 -1
- package/dist/esm/{version-CEtdwas_.js → version-Ce04N_Lo.js} +3 -3
- package/dist/esm/{version-CEtdwas_.js.map → version-Ce04N_Lo.js.map} +1 -1
- package/dist/nylas-web-elements/google-logo-icon.microsoft-logo-icon.nylas-editor-tabs.nylas-editor-tabs-group.nylas-list-configurations.nylas-select-event-type.entry.esm.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-2f3a33e1.entry.js → p-0745cbcc.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-ad920702.entry.js → p-0c276fdb.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-72e72392.entry.js → p-1618c8ac.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-97034347.entry.js → p-2491c840.entry.js} +2 -2
- package/dist/nylas-web-elements/p-71137e94.entry.js +2 -0
- package/dist/nylas-web-elements/p-71137e94.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-330c2159.entry.js → p-81af9950.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-4d9bdaa0.entry.js → p-95c4f538.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-CEtdwas_.js → p-Ce04N_Lo.js} +2 -2
- package/dist/nylas-web-elements/{p-CEtdwas_.js.map → p-Ce04N_Lo.js.map} +1 -1
- package/dist/nylas-web-elements/{p-S0IPwRIR.js → p-DNbD_8zD.js} +2 -2
- package/dist/nylas-web-elements/{p-S0IPwRIR.js.map → p-DNbD_8zD.js.map} +1 -1
- package/dist/nylas-web-elements/{p-OpKyWV8q.js → p-DfIu4gMZ.js} +2 -2
- package/dist/nylas-web-elements/{p-OpKyWV8q.js.map → p-DfIu4gMZ.js.map} +1 -1
- package/dist/nylas-web-elements/{p-C-mOw2iU.js → p-Dgl7p7tZ.js} +2 -2
- package/dist/nylas-web-elements/{p-C-mOw2iU.js.map → p-Dgl7p7tZ.js.map} +1 -1
- package/dist/nylas-web-elements/p-VQ6-FdEA.js +2 -0
- package/dist/nylas-web-elements/{p-D8VJgipo.js.map → p-VQ6-FdEA.js.map} +1 -1
- package/dist/nylas-web-elements/{p-db79a1ca.entry.js → p-a5bb5b9d.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-74747365.entry.js → p-b607eace.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-3f66ac98.entry.js → p-c7f4c268.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-f235211e.entry.js → p-d48d8562.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-9a5ddc21.entry.js → p-eb5b77ab.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-38806f4d.entry.js → p-f45da541.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-f5cf565f.entry.js → p-fed4cb19.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-28182324.entry.js → p-ff693a85.entry.js} +3 -3
- package/dist/nylas-web-elements/{p-FlNKXp4j.js → p-gXPNb-6F.js} +2 -2
- package/dist/nylas-web-elements/{p-FlNKXp4j.js.map → p-gXPNb-6F.js.map} +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/p-Di0G82W0.js.map +0 -1
- package/dist/components/p-p9sl0FFV.js.map +0 -1
- package/dist/nylas-web-elements/p-9a42cebd.entry.js +0 -2
- package/dist/nylas-web-elements/p-9a42cebd.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-D8VJgipo.js +0 -2
- /package/dist/nylas-web-elements/{p-2f3a33e1.entry.js.map → p-0745cbcc.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ad920702.entry.js.map → p-0c276fdb.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-72e72392.entry.js.map → p-1618c8ac.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-97034347.entry.js.map → p-2491c840.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-330c2159.entry.js.map → p-81af9950.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-4d9bdaa0.entry.js.map → p-95c4f538.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-db79a1ca.entry.js.map → p-a5bb5b9d.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-74747365.entry.js.map → p-b607eace.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3f66ac98.entry.js.map → p-c7f4c268.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f235211e.entry.js.map → p-d48d8562.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9a5ddc21.entry.js.map → p-eb5b77ab.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-38806f4d.entry.js.map → p-f45da541.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f5cf565f.entry.js.map → p-fed4cb19.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-28182324.entry.js.map → p-ff693a85.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as t}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{b as t}from"./p-DfIu4gMZ.js";class e{constructor(t){this.defaultAuthArgs=[];this.session=t}setActiveGrantId(t){this.activeGrantId=t}async request({method:e,path:s,body:n,headers:i}){try{const r=await this.session.fetch(`grants/me/${s}`,{method:e,headers:i?new Headers(i):undefined,body:n,...this.session.isMultiAccount()&&this.activeGrantId?{grant_id:this.activeGrantId}:{}});if(typeof r==="undefined"){throw new Error("Response is undefined")}return t(r)}catch(e){const s=String(e);let n=s;if(s.includes("Access token not found")||s.includes("invalid_grant")||s.includes("token expired")||s.includes("unauthorized")){n="Your session has expired. Please log in again to continue.";setTimeout((()=>{localStorage.removeItem("grant");localStorage.removeItem("user");window.location.reload()}),3e3)}return t(null,{message:n})}}async currentUser(){const t=this.session.isMultiAccount()?this.activeGrantId:undefined;const e=await this.session.getProfile(t);if(await this.session.isLoggedIn()){const t=await this.session.fetch(`grants/me`,{method:"GET",...this.session.isMultiAccount()&&this.activeGrantId?{grant_id:this.activeGrantId}:{}});const s=t.data;if(!e||!s){return null}const n=s.email;return{id:e.sub,email:n,name:e.name,provider:e.provider}}return null}async authenticationUrl(t){const e=t?.provider||"google";const s=this.defaultAuthArgs.find((t=>t.provider===e));let n=s||{};if(t){n={...n,...t}}return this.session.auth(n)}setDefaultAuthArgs(t){this.defaultAuthArgs=t}}export{e as N};
|
|
2
|
+
//# sourceMappingURL=p-Dgl7p7tZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-Dgl7p7tZ.js","sources":["src/common/nylas-api-request.ts"],"sourcesContent":["import { dataResponse } from '@/utils/utils';\nimport type { NylasSessions } from '@nylas/identity';\nimport { DataResponseReturnType } from './types';\n\n/**\n * Arguments for making a request to the Nylas API.\n */\nexport type NylasRequestArgs = {\n method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n path: string;\n body?: any;\n headers?: Record<string, string>;\n};\n\n/**\n * A model representing a user in the Nylas Identity system.\n */\nexport type User = {\n id: string;\n email: string;\n name?: string;\n provider?: string;\n};\n\n/**\n * Arguments for authenticating a user with the Nylas Identity system.\n */\nexport type AuthArgs = {\n /**\n * The provider of the user's email address.\n */\n provider?: string;\n /**\n * A list of permission scopes for the provider.\n */\n scope?: Array<string>;\n /**\n * The login hint associated with the user.\n */\n loginHint?: string;\n /**\n * Whether to include grant scopes in the auth exchange.\n */\n includeGrantScopes?: boolean;\n prompt?: string;\n metadata?: string;\n state?: string;\n};\n\n/**\n * Interface for making requests to the Nylas API.\n *\n * This is an abstract class that is meant to be implemented by customers to provide their own\n * implementation of making requests to the Nylas API. This allows customers to use their own\n * authentication mechanism, or to use a different HTTP client library.\n */\nexport abstract class NylasApiRequest {\n /**\n * This method should make an authenticated request to the Nylas API.\n * Note: It should not throw an error if the request fails, but should return an object with the error\n * information as part of the tuple returned.\n * @param args NylasRequestArgs\n */\n abstract request<T = any>(args: NylasRequestArgs): Promise<DataResponseReturnType<T>>;\n\n /**\n * This method should return the current user's information.\n */\n\n abstract currentUser(): Promise<User | null>;\n\n /**\n * This method should set the default authentication arguments to use when authenticating the user.\n */\n abstract setDefaultAuthArgs(authArgs: AuthArgs[]): void;\n\n /**\n * This method should return the URL to redirect the user to for authentication.\n */\n abstract authenticationUrl(authArgs?: AuthArgs): Promise<string | undefined>;\n}\n\n/**\n * A wrapper around the Nylas Identity session that implements the NylasApiRequest interface.\n * This class is used by the Nylas Web Elements to make requests to the Nylas API if no custom\n * implementation of NylasApiRequest is provided.\n */\nexport class NylasIdentityRequestWrapper implements NylasApiRequest {\n /**\n * The Nylas Identity session instance.\n */\n private session: NylasSessions;\n\n /**\n * The grant_id to use for requests, if there is multi-account support\n * enabled in the Nylas Identity settings.\n */\n private activeGrantId?: string;\n\n /**\n * The default authentication arguments to use when authenticating the user.\n */\n private defaultAuthArgs: AuthArgs[] = [];\n\n /**\n * Constructor for the NylasIdentityRequestWrapper class.\n * @param session The Nylas Identity session instance.\n */\n constructor(session: NylasSessions) {\n this.session = session;\n }\n\n /**\n * This method sets the grant_id to use for requests.\n * This is used when there is multi-account support enabled in the Nylas Identity settings.\n *\n * @param grantId\n */\n setActiveGrantId(grantId: string) {\n this.activeGrantId = grantId;\n }\n\n /**\n * This method makes a request to the Nylas API, using the Nylas Identity's fetch method.\n *\n * The `grants/me/` prefix is added because all requests made from the browser to the Nylas API\n * must be made on behalf of the currently logged in user with a valid access token.\n *\n * @param NylasRequestArgs\n * @returns Promise<[T | null, NylasErrorResponse['error'] | null]>\n */\n async request<T>({ method, path, body, headers }: NylasRequestArgs): Promise<DataResponseReturnType<T>> {\n try {\n const response = await this.session.fetch(`grants/me/${path}`, {\n method,\n headers: headers ? new Headers(headers) : undefined,\n body,\n ...(this.session.isMultiAccount() && this.activeGrantId ? { grant_id: this.activeGrantId } : {}),\n });\n\n // Sometimes the Nylas identity session fetch method returns undefined.\n // Possibly due to CORS issues. In this case, we throw an error.\n if (typeof response === 'undefined') {\n throw new Error('Response is undefined');\n }\n\n return dataResponse(response as T);\n } catch (error: any) {\n const errorStr = String(error);\n let errorMessage = errorStr;\n if (errorStr.includes('Access token not found') || errorStr.includes('invalid_grant') || errorStr.includes('token expired') || errorStr.includes('unauthorized')) {\n errorMessage = 'Your session has expired. Please log in again to continue.';\n setTimeout(() => {\n localStorage.removeItem('grant');\n localStorage.removeItem('user');\n window.location.reload();\n }, 3000);\n }\n return dataResponse(null as T, {\n message: errorMessage,\n });\n }\n }\n\n /**\n * This method returns the current (logged in) user's information.\n * If the user is not logged in, it returns null.\n * @returns Promise<User | null>\n */\n async currentUser(): Promise<User | null> {\n const grantId = this.session.isMultiAccount() ? this.activeGrantId : undefined;\n const idToken = await this.session.getProfile(grantId);\n // If the user is not logged in, we can't get the grant (no access token)\n if (await this.session.isLoggedIn()) {\n const grantResponse = await this.session.fetch(`grants/me`, {\n method: 'GET',\n ...(this.session.isMultiAccount() && this.activeGrantId ? { grant_id: this.activeGrantId } : {}),\n });\n const grant = grantResponse.data;\n\n if (!idToken || !grant) {\n return null;\n }\n\n const grantEmail = grant.email;\n return {\n id: idToken.sub,\n email: grantEmail,\n name: idToken.name,\n provider: idToken.provider,\n };\n }\n\n return null;\n }\n\n /**\n * This method returns the URL to redirect the user to for authentication.\n * @param authConfig authArgs\n * @returns Promise<string | undefined>\n */\n async authenticationUrl(authArgs?: AuthArgs): Promise<string | undefined> {\n const provider = authArgs?.provider || 'google';\n const defaultArgs = this.defaultAuthArgs.find(args => args.provider === provider);\n let args = defaultArgs || {};\n\n if (authArgs) {\n args = { ...args, ...authArgs };\n }\n return this.session.auth(args);\n }\n\n /**\n * This method sets the default authentication arguments to use when authenticating the user.\n * @param authArgs authArgs\n */\n setDefaultAuthArgs(authArgs: AuthArgs[]) {\n this.defaultAuthArgs = authArgs;\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,e as t}from"./p-DfIu4gMZ.js";import{a as r}from"./p-0EQQA0nE.js";function n(e,t,r="registerComponent"){return new CustomEvent(r,{bubbles:true,composed:true,detail:t})}function o(e,t,r="unregisterComponent"){return new CustomEvent(r,{bubbles:true,composed:true,detail:t})}function u(u){return(s,c)=>{const i=u.name;e(`[${i}] Registering component ${i} being called on ${c}`);const a=s.componentWillLoad;if(!a){t(`[${i}] componentWillLoad lifecycle method in ${i} missing. Required for RegisterComponent decorator.`);return}const l=s.connectedCallback;if(!l){t(`[${i}] connectedCallback lifecycle method in ${i} missing. Required for RegisterComponent decorator.`);return}const p=s.disconnectedCallback;if(!p){t(`[${i}] disconnectedCallback lifecycle method in ${i} missing. Required for RegisterComponent decorator.`);return}if(u.storeToProps&&u.stateToProps){const e=Array.from(u.storeToProps.values());const r=Array.from(u.stateToProps.values());const n=e.filter((e=>r.includes(e)));if(n.length>0){t(`[${i}] Overlapping prop keys detected in ${i} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${n.join(", ")}`);return}}const m=new Map;if(u.eventToProps){Object.keys(u.eventToProps).forEach((e=>{m.set(e,u.eventToProps?.[e])}))}s.connectedCallback=function(){e(`[~${i}] connectedCallback called`);const t=l?.call(this);const n=r(this);if(n.dataset.nylasId){Object.defineProperty(n,"registerNylasComponent",{get(){return true},enumerable:true});Object.defineProperty(n,"stateToProps",{get(){return u.stateToProps},enumerable:true});Object.defineProperty(n,"getStoresToProp",{get(){return u.getStoresToProp},enumerable:true});Object.defineProperty(n,"storeToProps",{get(){return u.storeToProps},enumerable:true});Object.defineProperty(n,"eventToProps",{get(){return m},enumerable:true});Object.defineProperty(n,"authToProp",{get(){return u.authToProp},enumerable:true});Object.defineProperty(n,"connectorToProp",{get(){return u.connectorToProp},enumerable:true});Object.defineProperty(n,"localPropsToProp",{get(){return u.localPropsToProp},enumerable:true});return t}Object.defineProperty(n,"registerNylasComponent",{get(){return true},enumerable:true});Object.defineProperty(n,"stateToProps",{get(){return u.stateToProps},enumerable:true});Object.defineProperty(n,"getStoresToProp",{get(){return u.getStoresToProp},enumerable:true});Object.defineProperty(n,"storeToProps",{get(){return u.storeToProps},enumerable:true});Object.defineProperty(n,"eventToProps",{get(){return m},enumerable:true});Object.defineProperty(n,"authToProp",{get(){return u.authToProp},enumerable:true});Object.defineProperty(n,"connectorToProp",{get(){return u.connectorToProp},enumerable:true});Object.defineProperty(n,"localPropsToProp",{get(){return u.localPropsToProp},enumerable:true});return t};if(u.fireRegisterEvent){s.componentWillLoad=function(){const t=a?.call(this);const o=r(this);const c={element:o,...u,eventToProps:m};const l=n(s,c,u.registrationEventName);if(o.dispatchEvent(l)){e(`[${i}] Component ${i} successfully fired registration event`)}return t};s.disconnectedCallback=function(){const t=p?.call(this);const n=r(this);const c={element:n,...u,eventToProps:m};const a=o(s,c,u.unregistrationEventName);try{if(n.dispatchEvent(a)){e(`[${i}] Component ${i} successfully fired unregistration event`)}}catch(t){e(`[${i}] Error dispatching unregistration event:`,t)}if(n.dataset.nylasId){delete n.dataset.nylasId;e(`[${i}] Cleared nylasId on disconnect for component ${i}`)}return t}}}}export{u as R};
|
|
2
|
+
//# sourceMappingURL=p-VQ6-FdEA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-D8VJgipo.js","sources":["src/common/register-component.ts"],"sourcesContent":["import { BaseNylasConnectorInterface } from '@/connector/connector-interface';\nimport { debug, error } from '@/utils/utils';\nimport { ComponentInterface, getElement } from '@stencil/core';\nimport { CombinedStoreStateKeys, EventEmitterEventType, ExtractEventEmitterKeys, ExtractEventEmitterProperties } from './types';\nimport { HTMLStencilElement } from '@stencil/core/internal';\nexport interface RegisteredComponent<H extends ComponentInterface, B extends BaseNylasConnectorInterface, MailboxStores = string> {\n name: string;\n element: HTMLStencilElement & { setProperty?: (key: string, value: any) => Promise<void>; registerCallback?(): Promise<void> };\n getStoresToProp?: keyof H;\n storeToProps?: Map<string, keyof H>;\n stateToProps?: Map<MailboxStores, keyof H>;\n eventToProps?: Map<ExtractEventEmitterKeys<H>, (event: CustomEvent<EventEmitterEventType<H[ExtractEventEmitterKeys<H>]>>, nylasConnector: B) => Promise<void>>;\n localPropsToProp?: Map<string, keyof H>;\n authToProp?: keyof H;\n connectorToProp?: keyof H;\n registrationEventName?: string;\n unregistrationEventName?: string;\n}\n\nexport function createComponentEvent<T extends ComponentInterface, B extends BaseNylasConnectorInterface>(\n instance: T,\n registeredComponent: RegisteredComponent<T, B>,\n eventName: string = 'registerComponent',\n) {\n return new CustomEvent<RegisteredComponent<typeof instance, B>>(eventName, {\n bubbles: true,\n composed: true,\n detail: registeredComponent,\n });\n}\n\nexport function unregisterComponentEvent<T extends ComponentInterface, B extends BaseNylasConnectorInterface>(\n instance: T,\n registeredComponent: RegisteredComponent<T, B>,\n eventName: string = 'unregisterComponent',\n) {\n return new CustomEvent<RegisteredComponent<typeof instance, B>>(eventName, {\n bubbles: true,\n composed: true,\n detail: registeredComponent,\n });\n}\n\nexport interface RegisterComponentConfig<H extends ComponentInterface, B extends BaseNylasConnectorInterface, MailboxStores>\n extends Omit<RegisteredComponent<H, B, MailboxStores>, 'eventToProps' | 'name' | 'element'> {\n name: string;\n eventToProps?: Partial<{\n [P in ExtractEventEmitterProperties<H> as P['key']]: (event: CustomEvent<P['eventType']>, nylasConnector: B) => Promise<void>;\n }>;\n fireRegisterEvent?: boolean | ((host: H) => boolean);\n}\n\nexport interface NylasComponentInterface extends ComponentInterface {\n authToProp?: keyof this;\n connectorToProp?: keyof this;\n registerCallback?: () => Promise<void>;\n}\n\nexport function RegisterComponent<H extends NylasComponentInterface, B extends BaseNylasConnectorInterface, MailboxStores extends Record<string, any>>(\n config: RegisterComponentConfig<H, B, CombinedStoreStateKeys<keyof MailboxStores, MailboxStores>>,\n) {\n return (target: H, propKey: string) => {\n const componentName = config.name;\n debug(`[${componentName}] Registering component ${componentName} being called on ${propKey}`);\n\n const originalComponentWillLoad = target.componentWillLoad;\n if (!originalComponentWillLoad) {\n error(`[${componentName}] componentWillLoad lifecycle method in ${componentName} missing. Required for RegisterComponent decorator.`);\n return;\n }\n\n const originalConnectCallback = target.connectedCallback;\n if (!originalConnectCallback) {\n error(`[${componentName}] connectedCallback lifecycle method in ${componentName} missing. Required for RegisterComponent decorator.`);\n return;\n }\n\n const originalDisconnectCallback = target.disconnectedCallback;\n if (!originalDisconnectCallback) {\n error(`[${componentName}] disconnectedCallback lifecycle method in ${componentName} missing. Required for RegisterComponent decorator.`);\n return;\n }\n\n // Detect a conflict if config.storeToProps and config.stateToProps are both defined\n // for overlapping prop keys\n if (config.storeToProps && config.stateToProps) {\n const storeToPropsKeys = Array.from(config.storeToProps.values());\n const stateToPropsKeys = Array.from(config.stateToProps.values());\n const intersection = storeToPropsKeys.filter(key => stateToPropsKeys.includes(key));\n if (intersection.length > 0) {\n error(\n `[${componentName}] Overlapping prop keys detected in ${componentName} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${intersection.join(\n ', ',\n )}`,\n );\n return;\n }\n }\n\n // Convert the record of eventToProps to a map\n const eventToPropsMap = new Map<ExtractEventEmitterKeys<H>, (event: CustomEvent<EventEmitterEventType<H[ExtractEventEmitterKeys<H>]>>, nylasConnector: B) => Promise<void>>();\n if (config.eventToProps) {\n Object.keys(config.eventToProps).forEach(key => {\n eventToPropsMap.set(\n key as ExtractEventEmitterKeys<H>,\n config.eventToProps?.[key as ExtractEventEmitterKeys<H>] as (\n event: CustomEvent<EventEmitterEventType<H[ExtractEventEmitterKeys<H>]>>,\n nylasConnector: B,\n ) => Promise<void>,\n );\n });\n }\n\n target.connectedCallback = function () {\n debug(`[~${componentName}] connectedCallback called`);\n const origionalResult = originalConnectCallback?.call(this);\n const host = getElement(this);\n\n // If the nylas id is already set, ensure properties are still set up\n // This handles the case where component was disconnected and reconnected\n // Properties may have been cleared during disconnect\n if (host.dataset.nylasId) {\n // Still set up properties in case they were cleared during disconnect\n // This ensures reconnected components have proper setup\n Object.defineProperty(host, 'registerNylasComponent', {\n get() {\n return true;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'stateToProps', {\n get() {\n return config.stateToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'getStoresToProp', {\n get() {\n return config.getStoresToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'storeToProps', {\n get() {\n return config.storeToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'eventToProps', {\n get() {\n return eventToPropsMap;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'authToProp', {\n get() {\n return config.authToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'connectorToProp', {\n get() {\n return config.connectorToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'localPropsToProp', {\n get() {\n return config.localPropsToProp;\n },\n enumerable: true,\n });\n return origionalResult;\n }\n\n Object.defineProperty(host, 'registerNylasComponent', {\n get() {\n return true;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'stateToProps', {\n get() {\n return config.stateToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'getStoresToProp', {\n get() {\n return config.getStoresToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'storeToProps', {\n get() {\n return config.storeToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'eventToProps', {\n get() {\n return eventToPropsMap;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'authToProp', {\n get() {\n return config.authToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'connectorToProp', {\n get() {\n return config.connectorToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'localPropsToProp', {\n get() {\n return config.localPropsToProp;\n },\n enumerable: true,\n });\n return origionalResult;\n };\n\n if (config.fireRegisterEvent) {\n target.componentWillLoad = function () {\n const origionalResult = originalComponentWillLoad?.call(this);\n const host = getElement(this);\n\n // We use our host element to dispatch a registration event that is picked up by the\n // the nylas-provider component.\n const registeredComponent: RegisteredComponent<H, B> = {\n element: host,\n ...config,\n eventToProps: eventToPropsMap,\n };\n const event = createComponentEvent(target, registeredComponent, config.registrationEventName);\n if (host.dispatchEvent(event)) {\n debug(`[${componentName}] Component ${componentName} successfully fired registration event`);\n }\n\n return origionalResult;\n };\n\n target.disconnectedCallback = function () {\n const origionalResult = originalDisconnectCallback?.call(this);\n const host = getElement(this);\n\n // We use our host element to dispatch a registration event that is picked up by the\n // the nylas-provider component.\n const registeredComponent: RegisteredComponent<H, B> = {\n element: host,\n ...config,\n eventToProps: eventToPropsMap,\n };\n const event = unregisterComponentEvent(target, registeredComponent, config.unregistrationEventName);\n\n // Dispatch event before clearing nylasId to ensure it bubbles to provider\n // disconnectedCallback is called before element is fully detached, so event should bubble\n try {\n if (host.dispatchEvent(event)) {\n debug(`[${componentName}] Component ${componentName} successfully fired unregistration event`);\n }\n } catch (error) {\n debug(`[${componentName}] Error dispatching unregistration event:`, error);\n }\n\n // Clear nylasId on disconnect so reconnection triggers fresh registration\n // This ensures reconnected components get proper property setup\n if (host.dataset.nylasId) {\n delete host.dataset.nylasId;\n debug(`[${componentName}] Cleared nylasId on disconnect for component ${componentName}`);\n }\n\n return origionalResult;\n };\n }\n };\n}\n"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"p-VQ6-FdEA.js","sources":["src/common/register-component.ts"],"sourcesContent":["import { BaseNylasConnectorInterface } from '@/connector/connector-interface';\nimport { debug, error } from '@/utils/utils';\nimport { ComponentInterface, getElement } from '@stencil/core';\nimport { CombinedStoreStateKeys, EventEmitterEventType, ExtractEventEmitterKeys, ExtractEventEmitterProperties } from './types';\nimport { HTMLStencilElement } from '@stencil/core/internal';\nexport interface RegisteredComponent<H extends ComponentInterface, B extends BaseNylasConnectorInterface, MailboxStores = string> {\n name: string;\n element: HTMLStencilElement & { setProperty?: (key: string, value: any) => Promise<void>; registerCallback?(): Promise<void> };\n getStoresToProp?: keyof H;\n storeToProps?: Map<string, keyof H>;\n stateToProps?: Map<MailboxStores, keyof H>;\n eventToProps?: Map<ExtractEventEmitterKeys<H>, (event: CustomEvent<EventEmitterEventType<H[ExtractEventEmitterKeys<H>]>>, nylasConnector: B) => Promise<void>>;\n localPropsToProp?: Map<string, keyof H>;\n authToProp?: keyof H;\n connectorToProp?: keyof H;\n registrationEventName?: string;\n unregistrationEventName?: string;\n}\n\nexport function createComponentEvent<T extends ComponentInterface, B extends BaseNylasConnectorInterface>(\n instance: T,\n registeredComponent: RegisteredComponent<T, B>,\n eventName: string = 'registerComponent',\n) {\n return new CustomEvent<RegisteredComponent<typeof instance, B>>(eventName, {\n bubbles: true,\n composed: true,\n detail: registeredComponent,\n });\n}\n\nexport function unregisterComponentEvent<T extends ComponentInterface, B extends BaseNylasConnectorInterface>(\n instance: T,\n registeredComponent: RegisteredComponent<T, B>,\n eventName: string = 'unregisterComponent',\n) {\n return new CustomEvent<RegisteredComponent<typeof instance, B>>(eventName, {\n bubbles: true,\n composed: true,\n detail: registeredComponent,\n });\n}\n\nexport interface RegisterComponentConfig<H extends ComponentInterface, B extends BaseNylasConnectorInterface, MailboxStores>\n extends Omit<RegisteredComponent<H, B, MailboxStores>, 'eventToProps' | 'name' | 'element'> {\n name: string;\n eventToProps?: Partial<{\n [P in ExtractEventEmitterProperties<H> as P['key']]: (event: CustomEvent<P['eventType']>, nylasConnector: B) => Promise<void>;\n }>;\n fireRegisterEvent?: boolean | ((host: H) => boolean);\n}\n\nexport interface NylasComponentInterface extends ComponentInterface {\n authToProp?: keyof this;\n connectorToProp?: keyof this;\n registerCallback?: () => Promise<void>;\n}\n\nexport function RegisterComponent<H extends NylasComponentInterface, B extends BaseNylasConnectorInterface, MailboxStores extends Record<string, any>>(\n config: RegisterComponentConfig<H, B, CombinedStoreStateKeys<keyof MailboxStores, MailboxStores>>,\n) {\n return (target: H, propKey: string) => {\n const componentName = config.name;\n debug(`[${componentName}] Registering component ${componentName} being called on ${propKey}`);\n\n const originalComponentWillLoad = target.componentWillLoad;\n if (!originalComponentWillLoad) {\n error(`[${componentName}] componentWillLoad lifecycle method in ${componentName} missing. Required for RegisterComponent decorator.`);\n return;\n }\n\n const originalConnectCallback = target.connectedCallback;\n if (!originalConnectCallback) {\n error(`[${componentName}] connectedCallback lifecycle method in ${componentName} missing. Required for RegisterComponent decorator.`);\n return;\n }\n\n const originalDisconnectCallback = target.disconnectedCallback;\n if (!originalDisconnectCallback) {\n error(`[${componentName}] disconnectedCallback lifecycle method in ${componentName} missing. Required for RegisterComponent decorator.`);\n return;\n }\n\n // Detect a conflict if config.storeToProps and config.stateToProps are both defined\n // for overlapping prop keys\n if (config.storeToProps && config.stateToProps) {\n const storeToPropsKeys = Array.from(config.storeToProps.values());\n const stateToPropsKeys = Array.from(config.stateToProps.values());\n const intersection = storeToPropsKeys.filter(key => stateToPropsKeys.includes(key));\n if (intersection.length > 0) {\n error(\n `[${componentName}] Overlapping prop keys detected in ${componentName} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${intersection.join(\n ', ',\n )}`,\n );\n return;\n }\n }\n\n // Convert the record of eventToProps to a map\n const eventToPropsMap = new Map<ExtractEventEmitterKeys<H>, (event: CustomEvent<EventEmitterEventType<H[ExtractEventEmitterKeys<H>]>>, nylasConnector: B) => Promise<void>>();\n if (config.eventToProps) {\n Object.keys(config.eventToProps).forEach(key => {\n eventToPropsMap.set(\n key as ExtractEventEmitterKeys<H>,\n config.eventToProps?.[key as ExtractEventEmitterKeys<H>] as (\n event: CustomEvent<EventEmitterEventType<H[ExtractEventEmitterKeys<H>]>>,\n nylasConnector: B,\n ) => Promise<void>,\n );\n });\n }\n\n target.connectedCallback = function () {\n debug(`[~${componentName}] connectedCallback called`);\n const origionalResult = originalConnectCallback?.call(this);\n const host = getElement(this);\n\n // If the nylas id is already set, ensure properties are still set up\n // This handles the case where component was disconnected and reconnected\n // Properties may have been cleared during disconnect\n if (host.dataset.nylasId) {\n // Still set up properties in case they were cleared during disconnect\n // This ensures reconnected components have proper setup\n Object.defineProperty(host, 'registerNylasComponent', {\n get() {\n return true;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'stateToProps', {\n get() {\n return config.stateToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'getStoresToProp', {\n get() {\n return config.getStoresToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'storeToProps', {\n get() {\n return config.storeToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'eventToProps', {\n get() {\n return eventToPropsMap;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'authToProp', {\n get() {\n return config.authToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'connectorToProp', {\n get() {\n return config.connectorToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'localPropsToProp', {\n get() {\n return config.localPropsToProp;\n },\n enumerable: true,\n });\n return origionalResult;\n }\n\n Object.defineProperty(host, 'registerNylasComponent', {\n get() {\n return true;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'stateToProps', {\n get() {\n return config.stateToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'getStoresToProp', {\n get() {\n return config.getStoresToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'storeToProps', {\n get() {\n return config.storeToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'eventToProps', {\n get() {\n return eventToPropsMap;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'authToProp', {\n get() {\n return config.authToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'connectorToProp', {\n get() {\n return config.connectorToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'localPropsToProp', {\n get() {\n return config.localPropsToProp;\n },\n enumerable: true,\n });\n return origionalResult;\n };\n\n if (config.fireRegisterEvent) {\n target.componentWillLoad = function () {\n const origionalResult = originalComponentWillLoad?.call(this);\n const host = getElement(this);\n\n // We use our host element to dispatch a registration event that is picked up by the\n // the nylas-provider component.\n const registeredComponent: RegisteredComponent<H, B> = {\n element: host,\n ...config,\n eventToProps: eventToPropsMap,\n };\n const event = createComponentEvent(target, registeredComponent, config.registrationEventName);\n if (host.dispatchEvent(event)) {\n debug(`[${componentName}] Component ${componentName} successfully fired registration event`);\n }\n\n return origionalResult;\n };\n\n target.disconnectedCallback = function () {\n const origionalResult = originalDisconnectCallback?.call(this);\n const host = getElement(this);\n\n // We use our host element to dispatch a registration event that is picked up by the\n // the nylas-provider component.\n const registeredComponent: RegisteredComponent<H, B> = {\n element: host,\n ...config,\n eventToProps: eventToPropsMap,\n };\n const event = unregisterComponentEvent(target, registeredComponent, config.unregistrationEventName);\n\n // Dispatch event before clearing nylasId to ensure it bubbles to provider\n // disconnectedCallback is called before element is fully detached, so event should bubble\n try {\n if (host.dispatchEvent(event)) {\n debug(`[${componentName}] Component ${componentName} successfully fired unregistration event`);\n }\n } catch (error) {\n debug(`[${componentName}] Error dispatching unregistration event:`, error);\n }\n\n // Clear nylasId on disconnect so reconnection triggers fresh registration\n // This ensures reconnected components get proper property setup\n if (host.dataset.nylasId) {\n delete host.dataset.nylasId;\n debug(`[${componentName}] Cleared nylasId on disconnect for component ${componentName}`);\n }\n\n return origionalResult;\n };\n }\n };\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as s,c as a,a as i,H as t}from"./p-0EQQA0nE.js";import{A as r,d as l,L as o,i as n,a2 as c,a3 as h,N as f,a4 as d,a5 as y,O as b}from"./p-OpKyWV8q.js";import{c as p}from"./p-S0IPwRIR.js";const u=".sc-globe-icon-h{display:flex}";const m=class{constructor(s){e(this,s);this.width="16";this.height="16"}render(){return s("svg",{key:"cb0e3380c9fec6c904edcec530eda0df7d82b5fe",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 16 16",fill:"none"},s("path",{key:"ba93585bd0da85eecebc7c2a3a8c7f705571b219",d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z",fill:"currentColor"}))}};m.style=u;const g=':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;word-break:break-word;overflow-wrap:break-word;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error);border-color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=date]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:100%;width:-moz-available;width:-webkit-fill-available;font-family:var(--nylas-font-family);padding:0 8px;cursor:pointer}input[type=date]:focus{outline-color:var(--nylas-primary)}input[type=date].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=date].error::placeholder{font-weight:400}input[type=date]::placeholder{color:var(--nylas-base-300)}input[type=date]::-webkit-calendar-picker-indicator{filter:invert(37%) sepia(51%) saturate(6324%) hue-rotate(215deg) brightness(94%) contrast(95%);cursor:pointer}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}';const k={date:"YYYY-MM-DD"};const x=class{constructor(s){e(this,s);this.nylasFormInputChanged=a(this,"nylasFormInputChanged",7);this.nylasFormInputFocused=a(this,"nylasFormInputFocused",7);this.nylasFormInputBlurred=a(this,"nylasFormInputBlurred",7);this.name="input";this.label="";this.placeholder=k["date"];this.required=false;this.readOnly=false;this.autoFocus=false;this.maxLength=255;this.patternError="";this.requiredError="";this.errorMessage="";this.hasError=false;this.error="";this.isDateValid=true}handleDefaultValueChange(e){this.value=r(e);if(this.value){this.validatePattern(this.value,true)}}themeConfigChangedHandler(e,s){if(e===s)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[s,a]of Object.entries(e)){this.el.style.setProperty(`${s}`,a)}}}connectedCallback(){queueMicrotask((()=>{if(this.themeConfig){this.applyThemeConfig(this.themeConfig);this.el.setAttribute("data-themed","")}}))}componentDidLoad(){this.value=r(this.defaultValue||"");if(this.value){this.validatePattern(this.value,true)}}handleBookingFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}async handleFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}handleInput(e){this.error="";const s=e.target;this.value=r(s.value);this.isDateValid=s.validity.valid;this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"})}handleBlur(){this.nylasFormInputBlurred.emit({value:this.value,name:this.name})}handleFocus(){this.nylasFormInputFocused.emit({value:this.value,name:this.name})}validatePattern(e,s=false){this.error="";if(!s&&(this.required&&!this.isDateValid||this.minDate&&new Date(this.minDate)>new Date(e))){this.error=this.errorMessage||"Please enter a valid date";this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"});return}if(this.required&&!e){this.error=this.requiredError||"This field is required.";return}if(!this.pattern||!e&&!this.required)return;if(this.pattern.test(e)){this.error=""}else{this.error=this.patternError||"Invalid format."}}render(){return s("label",{key:"2b85ec5e76a7d585403b355b2e143ced48e98b81",part:"ic__label",class:{error:!!this.error||this.hasError}},this.label&&s("p",{key:"3a7dce7c85961bb6695beef195d10f03eb8d8d33"},s("span",{key:"0e4ddb991c5b5e9684f36eaac79c1961a33bf346",class:"label"},this.label),this.required&&s("span",{key:"9c4ff17b839a72f9a8b6d0228773f820be85f918",class:"required"},"*")),s("div",{key:"ee9732ec821f68192191b368e3cd62a3f0f9d3cd",part:"ic__input_wrapper",class:"input_wrapper"},s("input",{key:"56ec6ac542c470e23395b8f098932fdc4a0e2d6f",type:"date",min:this.minDate,value:this.value,name:this.name,part:"ic__date",title:this.readOnly?"read-only field":undefined,readOnly:this.readOnly,autoFocus:this.autoFocus,maxLength:this.maxLength,placeholder:this.placeholder,class:{error:!!this.error||this.hasError},onInput:e=>this.handleInput(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),s("slot",{key:"b3158bc42f1586392ebc9304df23973e5bef5a7a",name:"additional-input"})),this.error&&s("span",{key:"abc73483451f6b009b6e830cdbc0a737728252c7",class:"error help-text"},this.error))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"],themeConfig:["themeConfigChangedHandler"]}}};x.style=g;const w=':host{display:block;position:relative;--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}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;color:var(--nylas-base-900);cursor:pointer;background:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:var(--nylas-base-0)}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}';l.extend(p);const v=class{constructor(s){e(this,s);this.timeChange=a(this,"timeChange",7);this.timeWindowFormError=a(this,"timeWindowFormError",7);this.minimumStartTime=null;this.placeholder="hh:mmam/pm";this.hasError=false;this.language=o.en;this.err="";this.showTimes=false;this.ariaActivedescendant="";this.times=this.generateTimes();this.shouldAutoScroll=false}handleOutsideClick(e){const s=e.composedPath();const a=s.includes(this.el);if(!a&&this.showTimes){this.showTimes=false}}timeChangedHandler(){this.validateTimeAgainstMinimum()}minimumStartTimeChangedHandler(){this.validateTimeAgainstMinimum()}themeConfigChangedHandler(e,s){this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[s,a]of Object.entries(e)){this.el.style.setProperty(`${s}`,a)}}}validateTimeAgainstMinimum(){if(this.minimumStartTime){const e=l(this.minimumStartTime,"hh:mma");const s=l(this.time,"hh:mma");this.times=this.generateTimes();const a=n.t("nylasTimeWindowPicker.errors.invalid");if(s.isBefore(e)){this.err=a;this.timeWindowFormError.emit({key:this.el.id,message:a})}else{this.err="";this.timeWindowFormError.emit({key:this.el.id,message:""})}}else{this.err="";this.timeWindowFormError.emit({key:this.el.id,message:""})}}connectedCallback(){queueMicrotask((()=>{if(this.themeConfig){this.applyThemeConfig(this.themeConfig);this.el.setAttribute("data-themed","")}}))}componentWillLoad(){}componentDidLoad(){this.validateTimeAgainstMinimum()}componentDidRender(){if(this.showTimes&&this.shouldAutoScroll){const e=c(this.time);const s=this.times.findIndex((s=>s.value===e));if(s>-1){this.shouldAutoScroll=false;this.scrollToViewWithinParent(s)}return}}handleTimeChange(e,s){const a=s.split(":");if(a[0]==="00"&&a[1].slice(-2)=="pm"){const e=n.t("nylasTimeWindowPicker.errors.invalid");this.err=e;this.timeWindowFormError.emit({key:this.el.id,message:e})}if(!h(s)){const e=n.t("nylasTimeWindowPicker.errors.invalid");this.err=e;this.timeWindowFormError.emit({key:this.el.id,message:e})}else{this.err="";this.timeWindowFormError.emit({key:this.el.id,message:""})}if(this.err){return}this.timeChange.emit({key:this.el.id,value:s})}handleTimeAutocomplete(e){const s=e.target?.value;const a=this.language!==o.en?f(s):s;const i=n.t("nylasTimeWindowPicker.errors.invalid");if(!h(a)){this.err=i;this.timeWindowFormError.emit({key:this.el.id,message:i});return}if(a===""){const e=d().format("hh:mma");this.timeChange.emit({key:this.el.id,value:e});return}if(!y(a)){const e=c(a);this.timeChange.emit({key:this.el.id,value:e});return}this.timeChange.emit({key:this.el.id,value:a})}handleOnInput(e){const s=e.target?.value;if(!h(s)){return}if(s===""){const e=d().format("hh:mma");const s=this.times.findIndex((s=>s.value===e));if(s>-1){this.scrollToViewWithinParent(s)}return}if(!y(s)){const e=c(s);const a=this.times.findIndex((s=>s.value===e));if(a>-1){this.scrollToViewWithinParent(a)}return}}generateTimes(){const e=[];let s=l().set("hour",0).set("minute",0).set("second",0);if(this.minimumStartTime){s=l(this.minimumStartTime,"hh:mma")}const a=s.endOf("day").diff(s,"minutes");const i=Math.round(a/15);for(let a=0;a<i+1;a++){const t=s.add(a*15,"minute");if(a==i&&t.format("hh:mma").includes("am")){break}e.push({id:a,value:t.format("hh:mma")})}return e}handleComboboxKeyDown(e){if(e.key==="ArrowDown"){e.preventDefault();if(!this.showTimes){this.showTimes=true;this.shouldAutoScroll=true;return}if(this.ariaActivedescendant===""){this.ariaActivedescendant=this.times[0].id.toString();this.focusOption(0)}else{const e=this.times.findIndex((e=>e.id.toString()===this.ariaActivedescendant));const s=e+1<this.times.length?e+1:0;this.ariaActivedescendant=this.times[s].id.toString();this.focusOption(s)}}else if(e.key==="ArrowUp"){e.preventDefault();if(this.ariaActivedescendant===""){this.ariaActivedescendant=this.times[this.times.length-1].id.toString();this.focusOption(this.times.length-1)}else{const e=this.times.findIndex((e=>e.id.toString()===this.ariaActivedescendant));const s=e-1>=0?e-1:this.times.length-1;this.ariaActivedescendant=this.times[s].id.toString();this.focusOption(s)}}else if(e.key==="Escape"){this.showTimes=false;this.timeInput.focus()}}handleListboxKeydown(e){const s=this.times;const a=s.findIndex((e=>e.id.toString()===this.ariaActivedescendant));if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){e.preventDefault();const i=a+1<s.length?a+1:0;this.ariaActivedescendant=s[i].id.toString();this.focusOption(i)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();const i=a-1>=0?a-1:s.length-1;this.ariaActivedescendant=s[i].id.toString();this.focusOption(i)}else if(e.key==="Enter"){e.preventDefault();if(this.ariaActivedescendant){const i=s[a];this.handleTimeChange(e,i.value);this.showTimes=false;this.ariaActivedescendant="";this.timeInput.focus()}}else if(e.key==="Escape"){this.showTimes=false;this.timeInput.focus()}}scrollToViewWithinParent(e){const s=this.times[e];const a=this.el.shadowRoot?.getElementById(s.id.toString());const i=this.timeMenu;this.ariaActivedescendant=s.id.toString();const t=a.getBoundingClientRect();const r=i.getBoundingClientRect();if(t.top<r.top){i.scrollTop-=r.top-t.top}else if(t.bottom>r.bottom){i.scrollTop+=t.bottom-r.bottom}if(t.left<r.left){i.scrollLeft-=r.left-t.left}else if(t.right>r.right){i.scrollLeft+=t.right-r.right}}focusOption(e){const s=this.times[e];if(!s)return;const a=s.id.toString();const i=this.el.shadowRoot?.getElementById(a);if(i){i.focus();i.scrollIntoView({behavior:"smooth",block:"nearest"})}}render(){const e=this.language===o.en?false:true;return s(t,{key:"b5c0c24d84d44312d2223be037872dc9d03db3f8"},s("div",{key:"3c77e7501bb38ebe22f1a27d53577b05e2f1fb22",class:"time-picker",part:"time-picker"},s("input",{key:"8e636c248c38900aa4ad9c2bd8cc89c0a9c84424",type:"text",name:this.name,id:this.name,part:"time-input",class:{"time-input":true,error:!!this.err||this.hasError},ref:e=>this.timeInput=e,value:e?b(this.time):this.time,onClick:()=>{this.showTimes=!this.showTimes;this.shouldAutoScroll=true},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.showTimes?"true":"false",placeholder:this.placeholder,onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e),onBlur:e=>this.handleTimeAutocomplete(e)}),this.err&&s("div",{key:"3e6b9ae63890b47148426919552172e39db0eaf4",class:"invalid-time-icon"}),this.showTimes&&s("div",{key:"8b32c32b03cca0b27e70435887a3c8150cf5c8b7",class:"times",part:"times",ref:e=>this.timeMenu=e},s("ul",{key:"f7a5d65fcb9b675f76448bcf4cf1540eb822f225",tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.times.map((a=>s("li",{tabindex:"0",key:a.id,id:a.id.toString(),class:{focused:this.ariaActivedescendant===a.id.toString()},onClick:e=>{this.handleTimeChange(e,a.value);this.showTimes=false;this.timeInput.focus()},role:"option"},`${e?b(a.value):a.value}`))))),!this.showTimes&&this.err&&s("p",{key:"c194ce42271aa6b72a547b7c0f387fcc6c95daae",class:"error",id:"email-error"},this.err)))}get el(){return i(this)}static get watchers(){return{time:["timeChangedHandler"],minimumStartTime:["minimumStartTimeChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};v.style=w;export{m as globe_icon,x as nylas_date_component,v as nylas_time_window_picker};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as s,c as a,a as i,H as t}from"./p-0EQQA0nE.js";import{A as r,d as l,L as o,i as n,a2 as c,a3 as h,N as f,a4 as d,a5 as y,O as b}from"./p-DfIu4gMZ.js";import{c as p}from"./p-DNbD_8zD.js";const u=".sc-globe-icon-h{display:flex}";const m=class{constructor(s){e(this,s);this.width="16";this.height="16"}render(){return s("svg",{key:"cb0e3380c9fec6c904edcec530eda0df7d82b5fe",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 16 16",fill:"none"},s("path",{key:"ba93585bd0da85eecebc7c2a3a8c7f705571b219",d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z",fill:"currentColor"}))}};m.style=u;const g=':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;word-break:break-word;overflow-wrap:break-word;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error);border-color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=date]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:100%;width:-moz-available;width:-webkit-fill-available;font-family:var(--nylas-font-family);padding:0 8px;cursor:pointer}input[type=date]:focus{outline-color:var(--nylas-primary)}input[type=date].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=date].error::placeholder{font-weight:400}input[type=date]::placeholder{color:var(--nylas-base-300)}input[type=date]::-webkit-calendar-picker-indicator{filter:invert(37%) sepia(51%) saturate(6324%) hue-rotate(215deg) brightness(94%) contrast(95%);cursor:pointer}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}';const k={date:"YYYY-MM-DD"};const x=class{constructor(s){e(this,s);this.nylasFormInputChanged=a(this,"nylasFormInputChanged",7);this.nylasFormInputFocused=a(this,"nylasFormInputFocused",7);this.nylasFormInputBlurred=a(this,"nylasFormInputBlurred",7);this.name="input";this.label="";this.placeholder=k["date"];this.required=false;this.readOnly=false;this.autoFocus=false;this.maxLength=255;this.patternError="";this.requiredError="";this.errorMessage="";this.hasError=false;this.error="";this.isDateValid=true}handleDefaultValueChange(e){this.value=r(e);if(this.value){this.validatePattern(this.value,true)}}themeConfigChangedHandler(e,s){if(e===s)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[s,a]of Object.entries(e)){this.el.style.setProperty(`${s}`,a)}}}connectedCallback(){queueMicrotask((()=>{if(this.themeConfig){this.applyThemeConfig(this.themeConfig);this.el.setAttribute("data-themed","")}}))}componentDidLoad(){this.value=r(this.defaultValue||"");if(this.value){this.validatePattern(this.value,true)}}handleBookingFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}async handleFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}handleInput(e){this.error="";const s=e.target;this.value=r(s.value);this.isDateValid=s.validity.valid;this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"})}handleBlur(){this.nylasFormInputBlurred.emit({value:this.value,name:this.name})}handleFocus(){this.nylasFormInputFocused.emit({value:this.value,name:this.name})}validatePattern(e,s=false){this.error="";if(!s&&(this.required&&!this.isDateValid||this.minDate&&new Date(this.minDate)>new Date(e))){this.error=this.errorMessage||"Please enter a valid date";this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"});return}if(this.required&&!e){this.error=this.requiredError||"This field is required.";return}if(!this.pattern||!e&&!this.required)return;if(this.pattern.test(e)){this.error=""}else{this.error=this.patternError||"Invalid format."}}render(){return s("label",{key:"2b85ec5e76a7d585403b355b2e143ced48e98b81",part:"ic__label",class:{error:!!this.error||this.hasError}},this.label&&s("p",{key:"3a7dce7c85961bb6695beef195d10f03eb8d8d33"},s("span",{key:"0e4ddb991c5b5e9684f36eaac79c1961a33bf346",class:"label"},this.label),this.required&&s("span",{key:"9c4ff17b839a72f9a8b6d0228773f820be85f918",class:"required"},"*")),s("div",{key:"ee9732ec821f68192191b368e3cd62a3f0f9d3cd",part:"ic__input_wrapper",class:"input_wrapper"},s("input",{key:"56ec6ac542c470e23395b8f098932fdc4a0e2d6f",type:"date",min:this.minDate,value:this.value,name:this.name,part:"ic__date",title:this.readOnly?"read-only field":undefined,readOnly:this.readOnly,autoFocus:this.autoFocus,maxLength:this.maxLength,placeholder:this.placeholder,class:{error:!!this.error||this.hasError},onInput:e=>this.handleInput(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),s("slot",{key:"b3158bc42f1586392ebc9304df23973e5bef5a7a",name:"additional-input"})),this.error&&s("span",{key:"abc73483451f6b009b6e830cdbc0a737728252c7",class:"error help-text"},this.error))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"],themeConfig:["themeConfigChangedHandler"]}}};x.style=g;const w=':host{display:block;position:relative;--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}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;color:var(--nylas-base-900);cursor:pointer;background:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:var(--nylas-base-0)}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}';l.extend(p);const v=class{constructor(s){e(this,s);this.timeChange=a(this,"timeChange",7);this.timeWindowFormError=a(this,"timeWindowFormError",7);this.minimumStartTime=null;this.placeholder="hh:mmam/pm";this.hasError=false;this.language=o.en;this.err="";this.showTimes=false;this.ariaActivedescendant="";this.times=this.generateTimes();this.shouldAutoScroll=false}handleOutsideClick(e){const s=e.composedPath();const a=s.includes(this.el);if(!a&&this.showTimes){this.showTimes=false}}timeChangedHandler(){this.validateTimeAgainstMinimum()}minimumStartTimeChangedHandler(){this.validateTimeAgainstMinimum()}themeConfigChangedHandler(e,s){this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[s,a]of Object.entries(e)){this.el.style.setProperty(`${s}`,a)}}}validateTimeAgainstMinimum(){if(this.minimumStartTime){const e=l(this.minimumStartTime,"hh:mma");const s=l(this.time,"hh:mma");this.times=this.generateTimes();const a=n.t("nylasTimeWindowPicker.errors.invalid");if(s.isBefore(e)){this.err=a;this.timeWindowFormError.emit({key:this.el.id,message:a})}else{this.err="";this.timeWindowFormError.emit({key:this.el.id,message:""})}}else{this.err="";this.timeWindowFormError.emit({key:this.el.id,message:""})}}connectedCallback(){queueMicrotask((()=>{if(this.themeConfig){this.applyThemeConfig(this.themeConfig);this.el.setAttribute("data-themed","")}}))}componentWillLoad(){}componentDidLoad(){this.validateTimeAgainstMinimum()}componentDidRender(){if(this.showTimes&&this.shouldAutoScroll){const e=c(this.time);const s=this.times.findIndex((s=>s.value===e));if(s>-1){this.shouldAutoScroll=false;this.scrollToViewWithinParent(s)}return}}handleTimeChange(e,s){const a=s.split(":");if(a[0]==="00"&&a[1].slice(-2)=="pm"){const e=n.t("nylasTimeWindowPicker.errors.invalid");this.err=e;this.timeWindowFormError.emit({key:this.el.id,message:e})}if(!h(s)){const e=n.t("nylasTimeWindowPicker.errors.invalid");this.err=e;this.timeWindowFormError.emit({key:this.el.id,message:e})}else{this.err="";this.timeWindowFormError.emit({key:this.el.id,message:""})}if(this.err){return}this.timeChange.emit({key:this.el.id,value:s})}handleTimeAutocomplete(e){const s=e.target?.value;const a=this.language!==o.en?f(s):s;const i=n.t("nylasTimeWindowPicker.errors.invalid");if(!h(a)){this.err=i;this.timeWindowFormError.emit({key:this.el.id,message:i});return}if(a===""){const e=d().format("hh:mma");this.timeChange.emit({key:this.el.id,value:e});return}if(!y(a)){const e=c(a);this.timeChange.emit({key:this.el.id,value:e});return}this.timeChange.emit({key:this.el.id,value:a})}handleOnInput(e){const s=e.target?.value;if(!h(s)){return}if(s===""){const e=d().format("hh:mma");const s=this.times.findIndex((s=>s.value===e));if(s>-1){this.scrollToViewWithinParent(s)}return}if(!y(s)){const e=c(s);const a=this.times.findIndex((s=>s.value===e));if(a>-1){this.scrollToViewWithinParent(a)}return}}generateTimes(){const e=[];let s=l().set("hour",0).set("minute",0).set("second",0);if(this.minimumStartTime){s=l(this.minimumStartTime,"hh:mma")}const a=s.endOf("day").diff(s,"minutes");const i=Math.round(a/15);for(let a=0;a<i+1;a++){const t=s.add(a*15,"minute");if(a==i&&t.format("hh:mma").includes("am")){break}e.push({id:a,value:t.format("hh:mma")})}return e}handleComboboxKeyDown(e){if(e.key==="ArrowDown"){e.preventDefault();if(!this.showTimes){this.showTimes=true;this.shouldAutoScroll=true;return}if(this.ariaActivedescendant===""){this.ariaActivedescendant=this.times[0].id.toString();this.focusOption(0)}else{const e=this.times.findIndex((e=>e.id.toString()===this.ariaActivedescendant));const s=e+1<this.times.length?e+1:0;this.ariaActivedescendant=this.times[s].id.toString();this.focusOption(s)}}else if(e.key==="ArrowUp"){e.preventDefault();if(this.ariaActivedescendant===""){this.ariaActivedescendant=this.times[this.times.length-1].id.toString();this.focusOption(this.times.length-1)}else{const e=this.times.findIndex((e=>e.id.toString()===this.ariaActivedescendant));const s=e-1>=0?e-1:this.times.length-1;this.ariaActivedescendant=this.times[s].id.toString();this.focusOption(s)}}else if(e.key==="Escape"){this.showTimes=false;this.timeInput.focus()}}handleListboxKeydown(e){const s=this.times;const a=s.findIndex((e=>e.id.toString()===this.ariaActivedescendant));if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){e.preventDefault();const i=a+1<s.length?a+1:0;this.ariaActivedescendant=s[i].id.toString();this.focusOption(i)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();const i=a-1>=0?a-1:s.length-1;this.ariaActivedescendant=s[i].id.toString();this.focusOption(i)}else if(e.key==="Enter"){e.preventDefault();if(this.ariaActivedescendant){const i=s[a];this.handleTimeChange(e,i.value);this.showTimes=false;this.ariaActivedescendant="";this.timeInput.focus()}}else if(e.key==="Escape"){this.showTimes=false;this.timeInput.focus()}}scrollToViewWithinParent(e){const s=this.times[e];const a=this.el.shadowRoot?.getElementById(s.id.toString());const i=this.timeMenu;this.ariaActivedescendant=s.id.toString();const t=a.getBoundingClientRect();const r=i.getBoundingClientRect();if(t.top<r.top){i.scrollTop-=r.top-t.top}else if(t.bottom>r.bottom){i.scrollTop+=t.bottom-r.bottom}if(t.left<r.left){i.scrollLeft-=r.left-t.left}else if(t.right>r.right){i.scrollLeft+=t.right-r.right}}focusOption(e){const s=this.times[e];if(!s)return;const a=s.id.toString();const i=this.el.shadowRoot?.getElementById(a);if(i){i.focus();i.scrollIntoView({behavior:"smooth",block:"nearest"})}}render(){const e=this.language===o.en?false:true;return s(t,{key:"b5c0c24d84d44312d2223be037872dc9d03db3f8"},s("div",{key:"3c77e7501bb38ebe22f1a27d53577b05e2f1fb22",class:"time-picker",part:"time-picker"},s("input",{key:"8e636c248c38900aa4ad9c2bd8cc89c0a9c84424",type:"text",name:this.name,id:this.name,part:"time-input",class:{"time-input":true,error:!!this.err||this.hasError},ref:e=>this.timeInput=e,value:e?b(this.time):this.time,onClick:()=>{this.showTimes=!this.showTimes;this.shouldAutoScroll=true},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.showTimes?"true":"false",placeholder:this.placeholder,onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e),onBlur:e=>this.handleTimeAutocomplete(e)}),this.err&&s("div",{key:"3e6b9ae63890b47148426919552172e39db0eaf4",class:"invalid-time-icon"}),this.showTimes&&s("div",{key:"8b32c32b03cca0b27e70435887a3c8150cf5c8b7",class:"times",part:"times",ref:e=>this.timeMenu=e},s("ul",{key:"f7a5d65fcb9b675f76448bcf4cf1540eb822f225",tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.times.map((a=>s("li",{tabindex:"0",key:a.id,id:a.id.toString(),class:{focused:this.ariaActivedescendant===a.id.toString()},onClick:e=>{this.handleTimeChange(e,a.value);this.showTimes=false;this.timeInput.focus()},role:"option"},`${e?b(a.value):a.value}`))))),!this.showTimes&&this.err&&s("p",{key:"c194ce42271aa6b72a547b7c0f387fcc6c95daae",class:"error",id:"email-error"},this.err)))}get el(){return i(this)}static get watchers(){return{time:["timeChangedHandler"],minimumStartTime:["minimumStartTimeChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};v.style=w;export{m as globe_icon,x as nylas_date_component,v as nylas_time_window_picker};
|
|
2
|
+
//# sourceMappingURL=p-a5bb5b9d.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as e,F as t,r as i,c as n,H as s,a as o}from"./p-0EQQA0nE.js";import{N as a}from"./p-FlNKXp4j.js";import{n as r,L as l,i as c,f as d,h,a as g,j as f,k as u,l as p,m,c as b}from"./p-OpKyWV8q.js";import{E as y,v as _,u as w}from"./p-CEtdwas_.js";import{c as v}from"./p-_i6H-yQH.js";import{i as k,a as I,f as x,c as C,b as T}from"./p-B8tfyAQm.js";class S{constructor(){this.component=e=>{const t=y.Component;const i=`${e} Error`;return{endtime_not_in_future:(e='"endtime" can not be in the future')=>({title:i,message:e,category:t}),no_booking_info:(e="No booking info provided")=>({title:i,message:e,category:t}),no_timeslot_selected:(e="No timeslot selected")=>({title:i,message:e,category:t}),no_timezone_selected:(e="No timezone selected")=>({title:i,message:e,category:t}),no_booking_id:(e="No booking id provided")=>({title:i,message:e,category:t}),no_salt:(e="No salt provided")=>({title:i,message:e,category:t}),invalid_start_time:(e="Invalid start time")=>({title:i,message:e,category:t}),invalid_end_time:(e="Invalid end time")=>({title:i,message:e,category:t}),invalid_timezone:(e="Invalid timezone")=>({title:i,message:e,category:t}),no_config_id:(e="No configuration id provided")=>({title:i,message:e,category:t})}};this.api=e=>{const t=y.Api;const i=`${e} Error`;return{invalid_session:e=>({title:i,message:e,category:t}),general_error:e=>({title:i,message:e,category:t}),internal_error:e=>({title:i,message:e,category:t}),invalid_request_error:e=>({title:i,message:e,category:t}),timeslot_not_available:e=>({title:i,message:e,category:t}),provider_error:e=>({title:i,message:e,category:t}),not_found_error:e=>({title:i,message:e,category:t})}}}}class E{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:i,configId:n,slug:s,clientId:o}){this.errors=new S;this.schedulerStore=t;this.schedulerAPIURL=e;this.sessionId=i;this.configId=n;this.slug=s;this.clientId=o}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,i,n={},s){try{const o=new URL(this.schedulerAPIURL);o.pathname=e;const a=await fetch(decodeURIComponent(o.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,"X-Source":"nylas-scheduling","X-Nylas-Web-Elements-Version":_,...this.clientId&&{"X-Nylas-Application-Public-Id":this.clientId},...n},body:i,signal:s});const r=await a.json();return r}catch(e){if(e.name==="AbortError"){throw e}return{error:{message:e.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){let t=e?.message||e?.title||"Something went wrong";if(e?.type==="provider_error"){t=e?.provider_error?.error?.message||e?.provider_error?.error?.title||"Something went wrong"}return t}setConfigId(e){this.configId=e}setSchedulerAPIURL(e){if(e==="/"){e=new URL(window.location.href).origin}this.schedulerAPIURL=e}setSessionId(e){this.sessionId=e}selectDate(e){this.schedulerStore.set("selectedDate",e);this.schedulerStore.set("selectedTimeslot",null)}selectTime(e){this.schedulerStore.set("selectedTimeslot",e)}selectTimezone(e){this.schedulerStore.set("selectedTimezone",e)}selectLanguage(e){const t=r(e)||l.en;this.schedulerStore.set("selectedLanguage",t);c.changeLanguage(t)}async toggleAdditionalData(e){if(!e){await this.refetchAvailability()}this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t?.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t?.primaryParticipant,email:e}})}async refetchAvailability(){const e=new Date;const t=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const i=t<e.getTime()/1e3?Math.floor(e.getTime()/1e3):t;const n=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const s=await this.getAvailability(i,n);return s}async resetStoreStateAndFetchAvailability(){const e=new Date;const t=await this.refetchAvailability();const i=this.schedulerStore.get("availability").find((e=>{const t=d(e.start_time);return t?t>new Date:false}));let n=e;if(i){n=d(i.start_time)||e}this.schedulerStore.set("selectedDate",n);this.schedulerStore.set("eventInfo",null);this.schedulerStore.set("showBookingForm",false);this.schedulerStore.set("selectedTimeslot",null);return t}async setReschedule(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.state.eventInfo;if(t){this.schedulerStore.set("reschedulingEventInfo",t)}this.schedulerStore.set("rescheduleBookingId",e);await this.getUISettings();const i=await this.resetStoreStateAndFetchAvailability().finally((()=>{this.schedulerStore.set("isLoading",false)}));return i}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async setReject(e){this.schedulerStore.set("rejectBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();this.schedulerStore.set("cancelBookingId","");this.schedulerStore.set("rejectBookingId","");this.schedulerStore.set("cancelledEventInfo",null);return e}async goBack(){this.schedulerStore.set("cancelBookingId","");return}async resetConfirm(){const e=await this.resetStoreStateAndFetchAvailability();this.schedulerStore.set("organizerConfirmationBookingId","");this.schedulerStore.set("confirmedEventInfo",undefined);return e}async bookTimeslot(e){this.schedulerStore.set("isLoading",true);const{selectedTimeslot:t,selectedTimezone:i,bookingInfo:n,selectedLanguage:s}=this.schedulerStore.state;if(!e&&!n){return{error:this.errors.component(c.t("createBookingErrorTitle")).no_booking_info()}}const o=e?.timeslot||t;if(!o){return{error:this.errors.component(c.t("createBookingErrorTitle")).no_timeslot_selected()}}const a=e&&e?.timezone?e?.timezone:i;const r=s||"en-US";if(!a){return{error:this.errors.component(c.t("createBookingErrorTitle")).no_timezone_selected()}}const l=[...this.schedulerStore.get("availabilityOrderEmails")];let d="";const h=o?.emails||[];const g={};Object.entries(n?.additionalFields||{}).forEach((([e,t])=>{g[e]=t.value}));const f=e?e?.primaryParticipant:n?.primaryParticipant;const u=e?e?.guests||[]:n?.guests||[];const p=e?e?.additionalFields:g;const m=this.getHeaders();const b=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const y=`/v3/scheduling/bookings${b}`;if(l.length===0){const e=await this.makeAPIRequest(decodeURIComponent(y),"POST",JSON.stringify({additional_fields:p,additional_guests:u,guest:{...f},start_time:o.start_time.getTime()/1e3,end_time:o.end_time.getTime()/1e3,timezone:a,event_id:o?.event_id||undefined,master_id:o?.master_id||undefined,calendar_id:o?.calendar_id||undefined,email_language:this.getTwoLetterLanguageCode(r)}),m);this.schedulerStore.set("isLoading",false);if("data"in e){this.schedulerStore.set("eventInfo",e.data);return e}return{error:e.error}}while(l.length>0){d=l.shift();if(!h.includes(d)){continue}const e=await this.makeAPIRequest(decodeURIComponent(y),"POST",JSON.stringify({participants:d?[{email:d}]:undefined,additional_fields:p,additional_guests:u,guest:{...f},start_time:o.start_time.getTime()/1e3,end_time:o.end_time.getTime()/1e3,timezone:a,email_language:this.getTwoLetterLanguageCode(r)}),m);if("data"in e){this.schedulerStore.set("isLoading",false);this.schedulerStore.set("eventInfo",e?.data);return e}else if(e.error?.message?.startsWith("The selected timeslot is unavailable")){continue}else{this.schedulerStore.set("isLoading",false);const t=e.error?.type;let i=e.error;if(t&&t in this.errors.api(c.t("createBookingErrorTitle"))){const e=this.getErrorMessage(i);i=this.errors.api(c.t("createBookingErrorTitle"))[t](e)}return{error:i}}}this.schedulerStore.set("isLoading",false);return{error:this.errors.api(c.t("createBookingErrorTitle")).timeslot_not_available("The selected timeslot is unavailable")}}async getUISettings(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.get("rescheduleBookingId");const i=this.getHeaders();let n=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";if(t&&!!n){n+=`&booking_id=${t}`}else if(t){n+=`?booking_id=${t}`}const s=`/v3/scheduling/ui-settings${n}`;const o=await this.makeAPIRequest(s,"GET",undefined,i,e);if("error"in o){this.schedulerStore.set("isLoading",false);const e=o.error?.type;let t=o.error;if(e&&e in this.errors.api(c.t("getUISettingErrorTitle"))){t=this.errors.api(c.t("getUISettingErrorTitle"))[e](t?.message||t?.title||"Something went wrong")}return{error:t}}if("data"in o){this.schedulerStore.set("configSettings",o.data);this.clientId=o.data.app_client_id||this.clientId}this.schedulerStore.set("isLoading",false);return o}getTwoLetterLanguageCode(e){return e.split("-")[0]}getStartTimeWithMinBookingNotice(e){const t=this.schedulerStore.get("configSettings")?.scheduler;const i=t?.min_booking_notice;if(!i){return e}const n=(new Date).getTime();if(e<(n+i*60*1e3)/1e3){return Math.floor((n+i*60*1e3)/1e3)}else{return e}}getEndTimeForAvailableDaysInFuture(e){const t=new Date;const i=this.schedulerStore.get("configSettings")?.scheduler?.available_days_in_future;const n=Math.floor(h(t,i).getTime()/1e3);const s=Math.min(n,e);return s}async getAvailability(e=0,t=0,i){this.schedulerStore.set("isLoading",true);const n=new URLSearchParams;const s=new Date;const o=s.getTime();if(t&&t<o/1e3){this.schedulerStore.set("isLoading",false);const e=this.errors.component(c.t("getAvailabilityErrorTitle")).endtime_not_in_future();return{error:e}}if(!e){const t=new Date(s.getFullYear(),s.getMonth(),1);e=Math.floor(t.getTime()/1e3)}if(!t){const e=new Date(s.getFullYear(),s.getMonth()+1,0);t=Math.floor(e.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(t);const a=this.getStartTimeWithMinBookingNotice(e);e=a;t=a>t?a+1:t;n.append("start_time",encodeURIComponent(e.toString()));n.append("end_time",encodeURIComponent(t.toString()));if(this.configId&&!this.sessionId){n.append("configuration_id",encodeURIComponent(this.configId))}else if(this.slug&&this.clientId&&!this.sessionId){n.append("slug",encodeURIComponent(this.slug));n.append("client_id",encodeURIComponent(this.clientId))}const r=this.schedulerStore.get("rescheduleBookingId");if(r){n.append("booking_id",encodeURIComponent(r))}const l=n.toString();const d=`/v3/scheduling/availability${l?`?${l}`:""}`;const h=this.getHeaders();const g=await this.makeAPIRequest(decodeURIComponent(d),"GET",undefined,h,i);if("error"in g){this.schedulerStore.set("availability",[]);this.schedulerStore.set("isLoading",false);const e=g.error?.type;let t=g.error;if(t?.message?.toLowerCase().includes("Failed to find a valid Grant")){const e=c.t("invalidGrantError");return{error:{title:c.t("invalidGrantErrorTitle"),message:e,category:y.Api}}}if(e&&e in this.errors.api(c.t("getAvailabilityErrorTitle"))){const i=this.getErrorMessage(t);t=this.errors.api(c.t("getAvailabilityErrorTitle"))[e](i)}return{error:t}}if("data"in g){const e=g.data?.time_slots?.map((e=>({...e,start_time:new Date(e.start_time*1e3),end_time:new Date(e.end_time*1e3)})))||[];const t=e.filter((e=>e.start_time.getTime()>o));const i=t.sort(((e,t)=>e.start_time.getTime()-t.start_time.getTime()));this.schedulerStore.set("availability",i);const n=g.data?.order||[];this.schedulerStore.set("availabilityOrderEmails",n)}this.schedulerStore.set("isLoading",false);return g}async cancelBooking(e,t){this.schedulerStore.set("isLoading",true);if(!e){return{error:this.errors.component(c.t("cancelBookingErrorTitle")).no_booking_id()}}const i=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const n=`/v3/scheduling/bookings/${e}${i}`;const s=this.getHeaders();const o=await this.makeAPIRequest(decodeURIComponent(n),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),s);if("error"in o){this.schedulerStore.set("isLoading",false);const e=o.error?.type;let t=o.error;if(e&&e in this.errors.api(c.t("cancelBookingErrorTitle"))){const i=this.getErrorMessage(t);t=this.errors.api(c.t("cancelBookingErrorTitle"))[e](i)}return{error:t}}this.schedulerStore.set("cancelledEventInfo",{booking_id:e});this.schedulerStore.set("rescheduleBookingId","");this.schedulerStore.set("isLoading",false);return o}async rescheduleBooking(e,t){this.schedulerStore.set("isLoading",true);if(!e){return{error:this.errors.component(c.t("rescheduleBookingErrorTitle")).no_booking_id()}}const i=this.errors.api(c.t("rescheduleBookingErrorTitle"));const n=this.errors.component(c.t("rescheduleBookingErrorTitle"));const{bookingInfo:s,selectedTimeslot:o,selectedTimezone:a,selectedLanguage:r}=this.schedulerStore.state;const{startTime:l,endTime:d,timezone:h}=t;const g=l||o?.start_time;if(!g){return{error:n.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')}}const f=d||o?.end_time;if(!f){return{error:n.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')}}const u=this.schedulerStore.get("availabilityOrderEmails");let p="";if(u.length>0){const e=o?.emails||[];for(let t=0;t<u.length;t++){if(e.includes(u[t])){p=u[t];break}}}const m=h||a;if(!m){return{error:n.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')}}const b=o?.event_id||undefined;const y=o?.master_id||undefined;const _=o?.calendar_id||undefined;const w={};Object.entries(s?.additionalFields||{}).forEach((([e,t])=>{w[e]=t.value}));const v=t?t?.primaryParticipant:s?.primaryParticipant;const k=t?t?.guests||[]:s?.guests||[];const I=t?t?.additionalFields:w;const x=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const C=`/v3/scheduling/bookings/${e}${x}`;const T=this.getHeaders();const S=await this.makeAPIRequest(decodeURIComponent(C),"PATCH",JSON.stringify({start_time:g.getTime()/1e3,end_time:f.getTime()/1e3,timezone:m,additional_fields:I,guest:{...v},additional_guests:k,participants:p?[{email:p}]:undefined,email_language:this.getTwoLetterLanguageCode(r),event_id:b,master_id:y,calendar_id:_}),T);if("error"in S){this.schedulerStore.set("isLoading",false);const e=S.error?.type;let t=S.error;if(e&&e in i){const n=this.getErrorMessage(t);t=i[e](n)}return{error:t}}const E=this.schedulerStore.get("reschedulingEventInfo");if("data"in S){this.schedulerStore.set("eventInfo",S?.data);if(S.data?.booking_id){this.schedulerStore.set("rescheduleBookingId",S.data.booking_id)}}else if(E){this.schedulerStore.set("eventInfo",E)}else{const t={booking_id:e};this.schedulerStore.set("eventInfo",t)}this.schedulerStore.set("reschedulingEventInfo",undefined);this.schedulerStore.set("isLoading",false);return S}async updateBooking(e){this.schedulerStore.set("isLoading",true);const{bookingId:t,status:i,reason:n}=e;const s=this.schedulerStore.get("organizerConfirmationSalt");const o=i==="confirmed"?c.t("confirmBookingErrorTitle"):c.t("rejectBookingErrorTitle");if(!t){return{error:this.errors.component(o).no_booking_id()}}if(!s){return{error:this.errors.component(o).no_salt()}}const a=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const r=`/v3/scheduling/bookings/${t}${a}`;const l=this.getHeaders();const d=await this.makeAPIRequest(decodeURIComponent(r),"PUT",JSON.stringify({status:i,cancellation_reason:n,salt:s}),l);if("error"in d){this.schedulerStore.set("isLoading",false);const e=d.error?.type;let t=d.error;if(e&&e in this.errors.api(o)){const i=this.getErrorMessage(t);t=this.errors.api(o)[e](i)}return{error:t}}if("data"in d&&i==="confirmed"){this.schedulerStore.set("confirmedEventInfo",d?.data)}else if("request_id"in d&&i==="cancelled"){this.schedulerStore.set("cancelledEventInfo",{booking_id:t})}this.schedulerStore.set("organizerConfirmationBookingId","");this.schedulerStore.set("isLoading",false);return d}async validateGroupEventTimeslot(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.get("configSettings")?.configuration_id;if(!t){return{error:this.errors.component(c.t("validateTimeslotErrorTitle")).no_config_id()}}const i=this.getHeaders();const n=`/v3/scheduling/configurations/${t}/group-events/validate-timeslot`;const s=await this.makeAPIRequest(decodeURIComponent(n),"POST",JSON.stringify({...e,start_time:e.start_time.getTime()/1e3,end_time:e.end_time.getTime()/1e3}),i);if("error"in s){this.schedulerStore.set("isLoading",false);const e=s.error?.type;let t=s.error;if(e&&e in this.errors.api(c.t("validateTimeslotErrorTitle"))){const i=this.getErrorMessage(t);t=this.errors.api(c.t("validateTimeslotErrorTitle"))[e](i)}this.refetchAvailability();return{error:t}}this.schedulerStore.set("selectedTimeslot",e);this.schedulerStore.set("showBookingForm",true);this.schedulerStore.set("isLoading",false);return s}}class L{constructor({schedulerAPIURL:e,nylasSchedulerStore:t,sessionId:i,configId:n,slug:s,clientId:o}){if(!e){throw new Error("schedulerAPIURL is required")}if(!t){throw new Error("nylasSchedulerStore is required")}if(!i&&!n&&!(s&&o)){throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.")}if(e==="/"){const t=new URL(window.location.href);e=t.origin}this.configId=n;this.sessionId=i;this.schedulerAPIURL=e;this.nylasSchedulerStore=t;this.slug=s;this.clientId=o}init(){g("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}setSchedulerAPIURL(e){if(e==="/"){e=new URL(window.location.href).origin}this.schedulerAPIURL=e;if(this._schedulerAPIConnector){this._schedulerAPIConnector.setSchedulerAPIURL(e)}}get scheduler(){if(this._schedulerAPIConnector){return this._schedulerAPIConnector}this._schedulerAPIConnector=new E({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId});return this._schedulerAPIConnector}resetStores(){this.nylasSchedulerStore.reset()}}function B(e={}){const t={selectedDate:null,selectedLanguage:f()||l.en,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:false,availabilityOrderEmails:[],selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:false,nylasBranding:true,...e};g(`[defaultNylasStoreState]: `,t);const i=v(t);i.onChange("availability",(e=>{g(`[availability]: `,e);const t=e.map((e=>e.start_time));g(`[selectableDates]: `,t);i.set("selectableDates",t);const n=e[0];if(!n)return;const s=Math.floor((n.end_time.getTime()-n.start_time.getTime())/6e4);g(`[durationMinutes]: `,s);i.set("eventDuration",s)}));i.reset=()=>{for(const e in t){const n=t[e];i.set(e,n)}};return i}const D=(i,n)=>{const s=i.isLoading;const o=i.showNotification;const a=i.nylasBranding;const r=i.version;return e(t,null,o&&e("nylas-notification",null),s&&e("div",{class:"loading"},e("div",{class:"left"},e("div",{class:"skeleton"})),e("div",{class:"right"},e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}))),!s&&n,e("div",{key:"ns-footer",class:"footer",part:"ns_footer"},a&&e("a",{href:"https://scheduler.nylas.com?utm_source=powered-by-nylas-logoutm_medium=link&utm_campaign=get-scheduler&utm_id=get-scheduler",class:"powered-by-nylas",target:"_blank",rel:"noreferrer noopener"},"Powered by ",e("span",{class:"sr-only"},"Nylas"),e("nylas-logo",{"aria-hidden":true})),e("tooltip-component",null,e("info-icon",{slot:"tooltip-icon"}),e("span",{slot:"tooltip-content"},r))))};const z=(t,i)=>e("div",{class:"message-banner"},i);const R=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-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;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto;border-left:none}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer .powered-by-nylas{display:flex;align-items:center;text-decoration:none;color:var(--nylas-base-500)}.footer .powered-by-nylas:hover{color:var(--nylas-base-800)}.footer svg{fill:var(--nylas-base-500)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}.language-feedback-container{width:auto;position:absolute;bottom:4px;left:16px;display:flex;gap:8px;align-items:center}.language-feedback-container button-component#report-issue{position:initial}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}';const $={title:c.t("genericErrorTitle"),category:y.Component};const U=class{constructor(e){i(this,e);this.init=n(this,"init",7);this.schedulerWillLoad=n(this,"schedulerWillLoad",7);this.schedulerDidLoad=n(this,"schedulerDidLoad",7);this.nylasSchedulerError=n(this,"nylasSchedulerError",7);this.nylasSchedulerInfo=n(this,"nylasSchedulerInfo",7);this.configSettingsLoaded=n(this,"configSettingsLoaded",7);this.bookingRefExtracted=n(this,"bookingRefExtracted",7);this.bookedEventInfo=n(this,"bookedEventInfo",7);this.initDeferred=false;this.mode="app";this.schedulerApiUrl="https://api.us.nylas.com";this.nylasBranding=true;this.eventOverrides={};this.showNotification=true;this.enableUserFeedback=true;this.automaticComponentRegistration=true;this.selectedDateLabel=`${c.t("noDateSelected")}`;this.language=navigator.language;this.showFeedbackModal=false;this.bookingInfoConfirmed=null;this.version=_}connectedCallback(){g(`[nylas-scheduler] connectedCallback`)}async componentWillLoad(){g(`[nylas-scheduler] Component will load`);this.version=_;await new Promise((e=>setTimeout(e,0)));if(this.enableUserFeedback&&!k()){I({dsn:"https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",release:this.version,integrations:e=>[...e.filter((e=>false)),x({colorScheme:"system",autoInject:false})],autoSessionTracking:false,beforeSend:()=>null})}const e=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides){await this.eventOverrides.schedulerWillLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}const t=new URLSearchParams(window.location.search);const i=r(t.get("lang"))||r(t.get("language"));const n=i||this.defaultLanguage||r(this.bookingInfo?.language)||this.defaultSchedulerState?.selectedLanguage||f()||l.en;this.language=n;c.changeLanguage(n);this.stores={scheduler:B({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,themeConfig:this.themeConfig,hour12:this.hour12,...this.defaultSchedulerState,selectedLanguage:n})};this.baseProvider=new a(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);this.refConfigId=this.configurationId;let s;try{if(this.rescheduleBookingRef){const[e,t,i]=u(this.rescheduleBookingRef);this.refConfigId=e;this.stores.scheduler.set("rescheduleBookingId",t);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.cancelBookingRef){const[e,t,i]=u(this.cancelBookingRef);this.refConfigId=e;this.stores.scheduler.set("cancelBookingId",t);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.organizerConfirmationBookingRef){const[e,t,i]=u(this.organizerConfirmationBookingRef);this.refConfigId=e;this.stores.scheduler.set("organizerConfirmationBookingId",t);this.stores.scheduler.set("organizerConfirmationSalt",i);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t,salt:i})}}catch(e){g(e);const t=this.rescheduleBookingRef||this.cancelBookingRef||this.organizerConfirmationBookingRef;this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:`Invalid booking reference: ${t}`})},host:this.host})}this.applyThemeConfig(this.themeConfig);if("bookingRefExtracted"in this.eventOverrides){await this.eventOverrides.bookingRefExtracted(s,this.nylasSchedulerConnector);if(s.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists(false)){this.initDeferred=true;return}const o=this.baseProvider?.getStore("scheduler");this.nylasSchedulerConnector=new L({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:o});const d=this.init.emit(this.host);if("init"in this.eventOverrides){await this.eventOverrides.init(d,this.nylasSchedulerConnector);if(d.defaultPrevented){return}}this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector)}async componentDidLoad(){if(this.initDeferred){return}this.baseProvider?.componentDidLoad();await Promise.resolve();const e=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides){await this.eventOverrides.schedulerDidLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists()){return}await this.performSchedulerDataFetch()}async performSchedulerDataFetch(){this.fetchAbortController?.abort();this.fetchAbortController=new AbortController;const{signal:e}=this.fetchAbortController;try{if(this.nylasSchedulerConnector){if(this.schedulerApiUrl){this.nylasSchedulerConnector.setSchedulerAPIURL(this.schedulerApiUrl)}if(this.sessionId){this.nylasSchedulerConnector.sessionId=this.sessionId;this.nylasSchedulerConnector.scheduler.setSessionId(this.sessionId)}}this.localizationChanged(this.localization);const t=await(this.nylasSchedulerConnector?.scheduler.getUISettings(e));if(e.aborted)return;if(!t||"error"in t){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(t?.error)},host:this.host});return}else{if("data"in t&&t.data?.appearance){g("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.")}const i=this.configSettingsLoaded.emit({settings:t});if("configSettingsLoaded"in this.eventOverrides){await this.eventOverrides.configSettingsLoaded(i,this.nylasSchedulerConnector);if(e.aborted)return;if(i.defaultPrevented){return}}}const i=this.baseProvider?.getStore("scheduler");const n=i?.get("configSettings")?.scheduler?.available_days_in_future;const s=i?.get("selectedTimeslot");if(s&&s?.start_time){if(!this.isTimeslotValid(s)){return}if(i?.get("showBookingForm")){i?.set("selectedDate",s.start_time);return}}const o=d(i?.get("selectedDate"));const a=i?.get("availability");let r;if(a&&a.length>0){return}if(!o){const t=new Date;const{startTime:i,endTime:s,endTimeForAvailableDaysInFuture:o}=this.validateAvailableDaysInFuture(t,n||30);if(t.getTime()<o*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(i,s,e))}}else{const{startTime:t,endTime:i,endTimeForAvailableDaysInFuture:s}=this.validateAvailableDaysInFuture(o,n||30);if(o.getTime()<s*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(t,i,e))}}if(e.aborted)return;if(!r||"error"in r){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r?.error)},host:this.host})}if(!o){let e=new Date;const t=i?.get("availability").find((e=>{const t=d(e.start_time);return t?t>new Date:false}));if(t){e=d(t.start_time)||e}i?.set("selectedDate",e)}}catch(e){if(e.name==="AbortError")return;throw e}}hasValidAuthConfig(){return!!(this.sessionId||this.refConfigId||this.slug&&this.clientId)}async performDeferredInit(){if(!this.hasValidAuthConfig()||!this.initDeferred||!this.baseProvider){return}document.body.dispatchEvent(new CustomEvent("nylasSchedulerClearNotifications",{detail:{host:this.host},bubbles:true}));this.initDeferred=false;this.refConfigId=this.refConfigId||this.configurationId;this.baseProvider.eventOverrides=this.eventOverrides;const e=this.baseProvider.getStore("scheduler");this.nylasSchedulerConnector=new L({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:e});const t=this.init.emit(this.host);if("init"in this.eventOverrides){await this.eventOverrides.init(t,this.nylasSchedulerConnector);if(t.defaultPrevented){return}}await this.baseProvider.componentWillLoad(this.nylasSchedulerConnector);this.baseProvider.componentDidLoad();await Promise.resolve();const i=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides){await this.eventOverrides.schedulerDidLoad(i,this.nylasSchedulerConnector);if(i.defaultPrevented){return}}await this.performSchedulerDataFetch()}async authPropsChanged(e){if(e&&"bookingRefExtracted"in this.eventOverrides){await this.eventOverrides.bookingRefExtracted(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}if(this.initDeferred&&this.hasValidAuthConfig()){this.performDeferredInit()}}configurationIdChanged(){if(!this.rescheduleBookingRef&&!this.cancelBookingRef&&!this.organizerConfirmationBookingRef){this.refConfigId=this.configurationId}this.authPropsChanged()}schedulerApiUrlChanged(){if(this.nylasSchedulerConnector&&this.schedulerApiUrl){this.nylasSchedulerConnector.setSchedulerAPIURL(this.schedulerApiUrl);document.body.dispatchEvent(new CustomEvent("nylasSchedulerClearNotifications",{detail:{host:this.host},bubbles:true}));this.stores?.scheduler.set("availability",[]);this.performSchedulerDataFetch()}}sessionIdChanged(){if(this.nylasSchedulerConnector&&this.sessionId){this.nylasSchedulerConnector.sessionId=this.sessionId;this.nylasSchedulerConnector.scheduler.setSessionId(this.sessionId);document.body.dispatchEvent(new CustomEvent("nylasSchedulerClearNotifications",{detail:{host:this.host},bubbles:true}));this.performSchedulerDataFetch()}this.authPropsChanged()}slugChanged(){this.authPropsChanged()}clientIdChanged(){this.authPropsChanged()}componentDisconnected(){this.baseProvider?.componentDisconnected()}bookingInfoChanged(e){this.stores?.scheduler.set("bookingInfo",e);if(e?.language&&!this.defaultLanguage){this.stores?.scheduler.set("selectedLanguage",r(e.language)||l.en)}}rescheduleBookingRefChanged(e){let t;if(e){try{const[i,n]=u(e);this.stores?.scheduler.set("rescheduleBookingId",n);this.refConfigId=i;this.nylasSchedulerConnector?.scheduler.setConfigId(i);t=this.bookingRefExtracted.emit({configurationId:i,bookingId:n})}catch(t){g(t);this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:`Invalid booking reference: ${e}`})},host:this.host})}}this.authPropsChanged(t)}cancelBookingRefChanged(e){let t;if(e){try{const[i,n]=u(e);this.stores?.scheduler.set("cancelBookingId",n);this.refConfigId=i;this.nylasSchedulerConnector?.scheduler.setConfigId(i);t=this.bookingRefExtracted.emit({configurationId:i,bookingId:n})}catch(t){g(t);this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:`Invalid booking reference: ${e}`})},host:this.host})}}this.authPropsChanged(t)}organizerConfirmationBookingRefChanged(e){let t;if(e){try{const[i,n,s]=u(e);this.stores?.scheduler.set("organizerConfirmationBookingId",n);this.stores?.scheduler.set("organizerConfirmationSalt",s);this.refConfigId=i;this.nylasSchedulerConnector?.scheduler.setConfigId(i);t=this.bookingRefExtracted.emit({configurationId:i,bookingId:n,salt:s})}catch(t){g(t);this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:`Invalid booking reference: ${e}`})},host:this.host})}}this.authPropsChanged(t)}localizationChanged(e){if(!e){return}Object.keys(e).forEach((t=>{if(!(t in l)){return}c.addResourceBundle(t,"translation",e[t],false,true)}))}defaultLanguageChanged(e){if(e){this.stores?.scheduler.set("selectedLanguage",e);c.changeLanguage(e)}}themeConfigChanged(e){this.baseProvider?.getStore("scheduler")?.set("themeConfig",e);this.applyThemeConfig(e)}languageChanged(e){const t=r(e.detail)||l.en;this.language=t;c.changeLanguage(t);this.stores?.scheduler?.set("selectedLanguage",t)}async registerComponentHandler(e){this.baseProvider?.registerComponent(e.detail)}async unregisterComponentHandler(e){this.baseProvider?.unregisterComponent(e.detail)}async monthChangedHandler(e){const t=e.detail;const i=this.nylasSchedulerConnector?.schedulerStore?.get("configSettings")?.scheduler?.available_days_in_future;const{startTime:n,endTime:s,endTimeForAvailableDaysInFuture:o}=this.validateAvailableDaysInFuture(t,i||30);if(e.defaultPrevented){return}if(n<o&&t.getTime()<o*1e3){const e=await(this.nylasSchedulerConnector?.scheduler.getAvailability(n,s));if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e?.error)},host:this.host})}const t=this.stores?.scheduler.get("selectableDates");if(t&&t.length>0){this.stores?.scheduler.set("selectedDate",t[0])}}}mapToBookingData(e){const t=this.stores?.scheduler.get("selectedTimeslot");const i=this.stores?.scheduler.get("selectedLanguage");const n=this.stores?.scheduler.get("selectedTimezone");const s=t?.start_time?new Date(t?.start_time).getTime()/1e3:"";const o=t?.end_time?new Date(t?.end_time).getTime()/1e3:"";return{additional_guests:e.guests,guest:{...e.primaryParticipant},additional_fields:{...e.additionalFields},start_time:s,end_time:o,email_language:i,timezone:n}}async bookButtonClickedHandler(e){if(e.defaultPrevented){return}const t=e.detail;const i=this.mapToBookingData(t);this.bookingInfoConfirmed=t;const n=this.nylasSchedulerConnector?.schedulerStore?.get("rescheduleBookingId");const s=n;if(s){const e=await(this.nylasSchedulerConnector?.scheduler.rescheduleBooking(s,t));if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e?.error)},host:this.host})}const n=e?.data;const o=this.bookedEventInfo.emit({...e,data:{...n,...i}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...n};if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(o,this.nylasSchedulerConnector)}return}const o=await(this.nylasSchedulerConnector?.scheduler.bookTimeslot(t));if(!o||"error"in o){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(o?.error)},host:this.host})}const a=o?.data;const r=this.bookedEventInfo.emit({...o,data:{...a,...i}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...a};if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(r,this.nylasSchedulerConnector)}}dateSelectedHandler(e){const t=d(e.detail);this.selectedDateLabel=t?this.formatSelectedDateLabel(t):`${c.t("noDateSelected")}`}getSelectedLanguage(){const e=this.stores?.scheduler.get("selectedLanguage")||this.defaultLanguage||f()||l.en;return r(e)||l.en}getSelectedDateLocale(){const e=this.getSelectedLanguage();return p[e]||e||p[l.en]}formatSelectedDateLabel(e){return m(e.toLocaleDateString(this.getSelectedDateLocale(),{dateStyle:"full"}))}cancelBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}confirmBookingErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}feedbackModalClosedHandler(){this.showFeedbackModal=false}eventIsFullHandler(e){const t=e.detail.error;const i=e.detail.type;if(i==="error"){this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:t})},host:this.host})}else{this.nylasSchedulerInfo.emit({notification:{title:"Event is full",category:y.Component,type:w.Info,description:"The event you selected is full. Please try a different time.",id:(new Date).getTime().toString(),ttl:3e3},host:this.host})}}feedbackSubmittedHandler(e){C("Scheduling Page User Feedback",{extra:{configId:this.configurationId,slug:this.slug}});const t={message:e.detail.feedback};T(t,{includeReplay:true,captureContext:{tags:{"nylas-web-element":"nylas-scheduling","nylas-web-element-version":this.version,"nylas-config-id":this.configurationId,"nylas-slug":this.slug,"host-url":window.location.href},extra:{configId:this.configurationId,slug:this.slug,version:this.version}}});this.showFeedbackModal=false}async getNylasSchedulerStore(){return this.baseProvider?.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(e){return{title:e?.title||$.title,category:e?.category||$.category,type:w.Error,description:e?.message||"",id:(new Date).getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(e=true){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){if(e){let e="";if(!this.sessionId){e+=c.t("sessionIdRequiredErrorMessage")}if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){e=c.t("sessionIdRequiredErrorMessage")+" "+c.t("publicConfigErrorMessage")}this.nylasSchedulerError.emit({notification:{title:c.t("schedulingComponentErrorTitle"),category:y.Component,type:w.Error,description:e,id:(new Date).getTime().toString(),ttl:"none"},host:this.host})}return false}return true}isTimeslotValid(e){const t=new Date(e.start_time);if(t<new Date){this.nylasSchedulerError.emit({notification:{title:c.t("invalidTimeslotErrorTitle"),category:y.Component,type:w.Error,description:c.t("invalidTimeslotErrorMessage"),id:(new Date).getTime().toString(),ttl:"none"},host:this.host});return false}return true}validateAvailableDaysInFuture(e,t){const i=new Date;const n=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const s=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const o=Math.floor(h(i,t).getTime()/1e3);const a=Math.min(o,s);const r=n<i.getTime()/1e3?Math.floor(i.getTime()/1e3):n;return{startTime:r,endTime:a,endTimeForAvailableDaysInFuture:o}}applyThemeConfig(e){if(e){for(const[t,i]of Object.entries(e)){this.host.style.setProperty(`${t}`,i)}}}onFeedbackClick(e){e.preventDefault();this.showFeedbackModal=true}redirectToCustomUrl(e){window.location.assign(e)}nylasFormDropdownChangedHandler(e){const{name:t,value:i}=e.detail;if(t==="language"){const e=l[i];c.changeLanguage(e);this.stores?.scheduler?.set("selectedLanguage",e)}}render(){const t=this.mode==="app";const i=this.baseProvider?.getStore("scheduler");const n=i?.get("eventInfo");const o=i?.get("showBookingForm");const a=i?.get("cancelledEventInfo");const r=i?.get("cancelBookingId");const l=i?.get("selectedTimeslot");const h=i?.get("rescheduleBookingId");const g=i?.get("organizerConfirmationBookingId");const f=i?.get("rejectBookingId");const u=i?.get("confirmedEventInfo");const p=i?.get("nylasBranding")||this.nylasBranding;const m=d(i?.get("selectedDate"));const y=i?.get("configSettings")?.scheduler?.confirmation_redirect_url;const _=Object.keys(b).map((e=>({label:b[e],value:e})));const w=this.getSelectedLanguage();const v=m?this.formatSelectedDateLabel(m):`${c.t("noDateSelected")}`;if(t&&(r||f)&&!a){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e("nylas-cancel-booking-form",{selectedTimeslot:l,cancelBookingId:r,rejectBookingId:f,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&g){return e(s,null,e(D,null,e("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},e("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:g,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&a){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e("nylas-cancelled-event-card",{cancelledEventInfo:a,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&u){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"confirmed-event-page"},e("nylas-confirmed-event-card",{confirmedEventInfo:u,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&n&&y){const e=this.bookingInfoConfirmed?.primaryParticipant;const t=this.bookingInfoConfirmed?.location;const i=this.bookingInfoConfirmed?.booking_ref;const s=this.bookingInfoConfirmed?.additionalFields||{};if(this.bookingInfo&&typeof this.bookingInfo?.additionalFields!=="undefined"){const e=this.bookingInfo.additionalFields;Object.keys(e).forEach((t=>{if(!s[t]&&e?.[t]){s[t]=e[t].value}}))}const o=this.stores?.scheduler.get("selectedTimeslot");const a=this.stores?.scheduler.get("selectedTimezone");const r=this.stores?.scheduler.get("selectedLanguage");const l=this.stores?.scheduler.get("configSettings");const c=this.configurationId?this.configurationId:l?.configuration_id;const d=window.location.search;const h=new URLSearchParams(d);h.set("booking_id",n.booking_id);e?.name&&h.set("name",e.name);e?.email&&h.set("email",e.email);o?.start_time&&h.set("start_time",(new Date(o.start_time).getTime()/1e3).toString());o?.end_time&&h.set("end_time",(new Date(o.end_time).getTime()/1e3).toString());a&&h.set("tz",a);r&&h.set("language",r);s&&h.set("additional_values",JSON.stringify(s));this.slug&&h.set("page_slug",this.slug);c&&h.set("config_id",c);t&&h.set("location",t);i&&h.set("booking_ref",i);const g=new URL(y,window.location.origin);h.forEach(((e,t)=>{g.searchParams.set(t,e)}));this.redirectToCustomUrl(g.toString());return}if(t&&n){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"booked-event-page",part:"booked-event-page ns_booked-event-page"},e("nylas-booked-event-card",{selectedTimeslot:l,eventInfo:n,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&(!n||!!h)&&!o){const t=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},h&&e(z,null,`${c.t("rescheduleTitle")}`),e("div",{class:"select-date-page",part:"select-date-page ns_select-date-page"},e("div",{class:"left-panel",part:"ns_left-panel"},e("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),e("div",{class:`right-panel ${h?"reschedule":""}`,part:`ns_right-panel ${h?"ns_reschedule":""}`},e("h2",{part:"ns_right-panel__title"},e("calendar-icon",{part:"ns_right-panel__calendar-icon"}),e("span",{id:"selectedDate",part:"ns_right-panel__selected-date"},v)),e("nylas-timeslot-picker",{exportparts:"ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},t&&e("span",{slot:"timeslot-picker-cta-label"},e("slot",{name:"timeslot-picker-cta-label"})))))),this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&!n&&o){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},h&&e(z,null,`${c.t("rescheduleTitle")}`),e("div",{class:"additional-data-page",part:"additional-data-page ns_additional-data-page"},e("div",{class:"left-panel ns_left-panel",part:"ns_left-panel"},e("div",{class:"wrapper",part:"ns_left-panel__wrapper"},e("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),e("div",{class:`right-panel ${h?"reschedule":""}`,part:`ns_right-panel ${h?"ns_reschedule":""}`},e("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"})))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}return e(s,null,e("slot",null))}get host(){return o(this)}static get watchers(){return{configurationId:["configurationIdChanged"],schedulerApiUrl:["schedulerApiUrlChanged"],sessionId:["sessionIdChanged"],slug:["slugChanged"],clientId:["clientIdChanged"],bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],defaultLanguage:["defaultLanguageChanged"],themeConfig:["themeConfigChanged"]}}};U.style=R;export{U as nylas_scheduling};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{h as e,F as t,r as i,c as n,H as s,a as o}from"./p-0EQQA0nE.js";import{N as a}from"./p-gXPNb-6F.js";import{n as r,L as l,i as c,f as d,h,a as g,j as f,k as u,l as p,m,c as b}from"./p-DfIu4gMZ.js";import{E as y,v as _,u as w}from"./p-Ce04N_Lo.js";import{c as v}from"./p-_i6H-yQH.js";import{i as k,a as I,f as x,c as C,b as T}from"./p-B8tfyAQm.js";class S{constructor(){this.component=e=>{const t=y.Component;const i=`${e} Error`;return{endtime_not_in_future:(e='"endtime" can not be in the future')=>({title:i,message:e,category:t}),no_booking_info:(e="No booking info provided")=>({title:i,message:e,category:t}),no_timeslot_selected:(e="No timeslot selected")=>({title:i,message:e,category:t}),no_timezone_selected:(e="No timezone selected")=>({title:i,message:e,category:t}),no_booking_id:(e="No booking id provided")=>({title:i,message:e,category:t}),no_salt:(e="No salt provided")=>({title:i,message:e,category:t}),invalid_start_time:(e="Invalid start time")=>({title:i,message:e,category:t}),invalid_end_time:(e="Invalid end time")=>({title:i,message:e,category:t}),invalid_timezone:(e="Invalid timezone")=>({title:i,message:e,category:t}),no_config_id:(e="No configuration id provided")=>({title:i,message:e,category:t})}};this.api=e=>{const t=y.Api;const i=`${e} Error`;return{invalid_session:e=>({title:i,message:e,category:t}),general_error:e=>({title:i,message:e,category:t}),internal_error:e=>({title:i,message:e,category:t}),invalid_request_error:e=>({title:i,message:e,category:t}),timeslot_not_available:e=>({title:i,message:e,category:t}),provider_error:e=>({title:i,message:e,category:t}),not_found_error:e=>({title:i,message:e,category:t})}}}}class E{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:i,configId:n,slug:s,clientId:o}){this.errors=new S;this.schedulerStore=t;this.schedulerAPIURL=e;this.sessionId=i;this.configId=n;this.slug=s;this.clientId=o}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,i,n={},s){try{const o=new URL(this.schedulerAPIURL);o.pathname=e;const a=await fetch(decodeURIComponent(o.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,"X-Source":"nylas-scheduling","X-Nylas-Web-Elements-Version":_,...this.clientId&&{"X-Nylas-Application-Public-Id":this.clientId},...n},body:i,signal:s});const r=await a.json();return r}catch(e){if(e.name==="AbortError"){throw e}return{error:{message:e.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){let t=e?.message||e?.title||"Something went wrong";if(e?.type==="provider_error"){t=e?.provider_error?.error?.message||e?.provider_error?.error?.title||"Something went wrong"}return t}setConfigId(e){this.configId=e}setSchedulerAPIURL(e){if(e==="/"){e=new URL(window.location.href).origin}this.schedulerAPIURL=e}setSessionId(e){this.sessionId=e}selectDate(e){this.schedulerStore.set("selectedDate",e);this.schedulerStore.set("selectedTimeslot",null)}selectTime(e){this.schedulerStore.set("selectedTimeslot",e)}selectTimezone(e){this.schedulerStore.set("selectedTimezone",e)}selectLanguage(e){const t=r(e)||l.en;this.schedulerStore.set("selectedLanguage",t);c.changeLanguage(t)}async toggleAdditionalData(e){if(!e){await this.refetchAvailability()}this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t?.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t?.primaryParticipant,email:e}})}async refetchAvailability(){const e=new Date;const t=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const i=t<e.getTime()/1e3?Math.floor(e.getTime()/1e3):t;const n=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const s=await this.getAvailability(i,n);return s}async resetStoreStateAndFetchAvailability(){const e=new Date;const t=await this.refetchAvailability();const i=this.schedulerStore.get("availability").find((e=>{const t=d(e.start_time);return t?t>new Date:false}));let n=e;if(i){n=d(i.start_time)||e}this.schedulerStore.set("selectedDate",n);this.schedulerStore.set("eventInfo",null);this.schedulerStore.set("showBookingForm",false);this.schedulerStore.set("selectedTimeslot",null);return t}async setReschedule(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.state.eventInfo;if(t){this.schedulerStore.set("reschedulingEventInfo",t)}this.schedulerStore.set("rescheduleBookingId",e);await this.getUISettings();const i=await this.resetStoreStateAndFetchAvailability().finally((()=>{this.schedulerStore.set("isLoading",false)}));return i}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async setReject(e){this.schedulerStore.set("rejectBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();this.schedulerStore.set("cancelBookingId","");this.schedulerStore.set("rejectBookingId","");this.schedulerStore.set("cancelledEventInfo",null);return e}async goBack(){this.schedulerStore.set("cancelBookingId","");return}async resetConfirm(){const e=await this.resetStoreStateAndFetchAvailability();this.schedulerStore.set("organizerConfirmationBookingId","");this.schedulerStore.set("confirmedEventInfo",undefined);return e}async bookTimeslot(e){this.schedulerStore.set("isLoading",true);const{selectedTimeslot:t,selectedTimezone:i,bookingInfo:n,selectedLanguage:s}=this.schedulerStore.state;if(!e&&!n){return{error:this.errors.component(c.t("createBookingErrorTitle")).no_booking_info()}}const o=e?.timeslot||t;if(!o){return{error:this.errors.component(c.t("createBookingErrorTitle")).no_timeslot_selected()}}const a=e&&e?.timezone?e?.timezone:i;const r=s||"en-US";if(!a){return{error:this.errors.component(c.t("createBookingErrorTitle")).no_timezone_selected()}}const l=[...this.schedulerStore.get("availabilityOrderEmails")];let d="";const h=o?.emails||[];const g={};Object.entries(n?.additionalFields||{}).forEach((([e,t])=>{g[e]=t.value}));const f=e?e?.primaryParticipant:n?.primaryParticipant;const u=e?e?.guests||[]:n?.guests||[];const p=e?e?.additionalFields:g;const m=this.getHeaders();const b=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const y=`/v3/scheduling/bookings${b}`;if(l.length===0){const e=await this.makeAPIRequest(decodeURIComponent(y),"POST",JSON.stringify({additional_fields:p,additional_guests:u,guest:{...f},start_time:o.start_time.getTime()/1e3,end_time:o.end_time.getTime()/1e3,timezone:a,event_id:o?.event_id||undefined,master_id:o?.master_id||undefined,calendar_id:o?.calendar_id||undefined,email_language:this.getTwoLetterLanguageCode(r)}),m);this.schedulerStore.set("isLoading",false);if("data"in e){this.schedulerStore.set("eventInfo",e.data);return e}return{error:e.error}}while(l.length>0){d=l.shift();if(!h.includes(d)){continue}const e=await this.makeAPIRequest(decodeURIComponent(y),"POST",JSON.stringify({participants:d?[{email:d}]:undefined,additional_fields:p,additional_guests:u,guest:{...f},start_time:o.start_time.getTime()/1e3,end_time:o.end_time.getTime()/1e3,timezone:a,email_language:this.getTwoLetterLanguageCode(r)}),m);if("data"in e){this.schedulerStore.set("isLoading",false);this.schedulerStore.set("eventInfo",e?.data);return e}else if(e.error?.message?.startsWith("The selected timeslot is unavailable")){continue}else{this.schedulerStore.set("isLoading",false);const t=e.error?.type;let i=e.error;if(t&&t in this.errors.api(c.t("createBookingErrorTitle"))){const e=this.getErrorMessage(i);i=this.errors.api(c.t("createBookingErrorTitle"))[t](e)}return{error:i}}}this.schedulerStore.set("isLoading",false);return{error:this.errors.api(c.t("createBookingErrorTitle")).timeslot_not_available("The selected timeslot is unavailable")}}async getUISettings(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.get("rescheduleBookingId");const i=this.getHeaders();let n=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";if(t&&!!n){n+=`&booking_id=${t}`}else if(t){n+=`?booking_id=${t}`}const s=`/v3/scheduling/ui-settings${n}`;const o=await this.makeAPIRequest(s,"GET",undefined,i,e);if("error"in o){this.schedulerStore.set("isLoading",false);const e=o.error?.type;let t=o.error;if(e&&e in this.errors.api(c.t("getUISettingErrorTitle"))){t=this.errors.api(c.t("getUISettingErrorTitle"))[e](t?.message||t?.title||"Something went wrong")}return{error:t}}if("data"in o){this.schedulerStore.set("configSettings",o.data);this.clientId=o.data.app_client_id||this.clientId}this.schedulerStore.set("isLoading",false);return o}getTwoLetterLanguageCode(e){return e.split("-")[0]}getStartTimeWithMinBookingNotice(e){const t=this.schedulerStore.get("configSettings")?.scheduler;const i=t?.min_booking_notice;if(!i){return e}const n=(new Date).getTime();if(e<(n+i*60*1e3)/1e3){return Math.floor((n+i*60*1e3)/1e3)}else{return e}}getEndTimeForAvailableDaysInFuture(e){const t=new Date;const i=this.schedulerStore.get("configSettings")?.scheduler?.available_days_in_future;const n=Math.floor(h(t,i).getTime()/1e3);const s=Math.min(n,e);return s}async getAvailability(e=0,t=0,i){this.schedulerStore.set("isLoading",true);const n=new URLSearchParams;const s=new Date;const o=s.getTime();if(t&&t<o/1e3){this.schedulerStore.set("isLoading",false);const e=this.errors.component(c.t("getAvailabilityErrorTitle")).endtime_not_in_future();return{error:e}}if(!e){const t=new Date(s.getFullYear(),s.getMonth(),1);e=Math.floor(t.getTime()/1e3)}if(!t){const e=new Date(s.getFullYear(),s.getMonth()+1,0);t=Math.floor(e.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(t);const a=this.getStartTimeWithMinBookingNotice(e);e=a;t=a>t?a+1:t;n.append("start_time",encodeURIComponent(e.toString()));n.append("end_time",encodeURIComponent(t.toString()));if(this.configId&&!this.sessionId){n.append("configuration_id",encodeURIComponent(this.configId))}else if(this.slug&&this.clientId&&!this.sessionId){n.append("slug",encodeURIComponent(this.slug));n.append("client_id",encodeURIComponent(this.clientId))}const r=this.schedulerStore.get("rescheduleBookingId");if(r){n.append("booking_id",encodeURIComponent(r))}const l=n.toString();const d=`/v3/scheduling/availability${l?`?${l}`:""}`;const h=this.getHeaders();const g=await this.makeAPIRequest(decodeURIComponent(d),"GET",undefined,h,i);if("error"in g){this.schedulerStore.set("availability",[]);this.schedulerStore.set("isLoading",false);const e=g.error?.type;let t=g.error;if(t?.message?.toLowerCase().includes("Failed to find a valid Grant")){const e=c.t("invalidGrantError");return{error:{title:c.t("invalidGrantErrorTitle"),message:e,category:y.Api}}}if(e&&e in this.errors.api(c.t("getAvailabilityErrorTitle"))){const i=this.getErrorMessage(t);t=this.errors.api(c.t("getAvailabilityErrorTitle"))[e](i)}return{error:t}}if("data"in g){const e=g.data?.time_slots?.map((e=>({...e,start_time:new Date(e.start_time*1e3),end_time:new Date(e.end_time*1e3)})))||[];const t=e.filter((e=>e.start_time.getTime()>o));const i=t.sort(((e,t)=>e.start_time.getTime()-t.start_time.getTime()));this.schedulerStore.set("availability",i);const n=g.data?.order||[];this.schedulerStore.set("availabilityOrderEmails",n)}this.schedulerStore.set("isLoading",false);return g}async cancelBooking(e,t){this.schedulerStore.set("isLoading",true);if(!e){return{error:this.errors.component(c.t("cancelBookingErrorTitle")).no_booking_id()}}const i=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const n=`/v3/scheduling/bookings/${e}${i}`;const s=this.getHeaders();const o=await this.makeAPIRequest(decodeURIComponent(n),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),s);if("error"in o){this.schedulerStore.set("isLoading",false);const e=o.error?.type;let t=o.error;if(e&&e in this.errors.api(c.t("cancelBookingErrorTitle"))){const i=this.getErrorMessage(t);t=this.errors.api(c.t("cancelBookingErrorTitle"))[e](i)}return{error:t}}this.schedulerStore.set("cancelledEventInfo",{booking_id:e});this.schedulerStore.set("rescheduleBookingId","");this.schedulerStore.set("isLoading",false);return o}async rescheduleBooking(e,t){this.schedulerStore.set("isLoading",true);if(!e){return{error:this.errors.component(c.t("rescheduleBookingErrorTitle")).no_booking_id()}}const i=this.errors.api(c.t("rescheduleBookingErrorTitle"));const n=this.errors.component(c.t("rescheduleBookingErrorTitle"));const{bookingInfo:s,selectedTimeslot:o,selectedTimezone:a,selectedLanguage:r}=this.schedulerStore.state;const{startTime:l,endTime:d,timezone:h}=t;const g=l||o?.start_time;if(!g){return{error:n.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')}}const f=d||o?.end_time;if(!f){return{error:n.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')}}const u=this.schedulerStore.get("availabilityOrderEmails");let p="";if(u.length>0){const e=o?.emails||[];for(let t=0;t<u.length;t++){if(e.includes(u[t])){p=u[t];break}}}const m=h||a;if(!m){return{error:n.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')}}const b=o?.event_id||undefined;const y=o?.master_id||undefined;const _=o?.calendar_id||undefined;const w={};Object.entries(s?.additionalFields||{}).forEach((([e,t])=>{w[e]=t.value}));const v=t?t?.primaryParticipant:s?.primaryParticipant;const k=t?t?.guests||[]:s?.guests||[];const I=t?t?.additionalFields:w;const x=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const C=`/v3/scheduling/bookings/${e}${x}`;const T=this.getHeaders();const S=await this.makeAPIRequest(decodeURIComponent(C),"PATCH",JSON.stringify({start_time:g.getTime()/1e3,end_time:f.getTime()/1e3,timezone:m,additional_fields:I,guest:{...v},additional_guests:k,participants:p?[{email:p}]:undefined,email_language:this.getTwoLetterLanguageCode(r),event_id:b,master_id:y,calendar_id:_}),T);if("error"in S){this.schedulerStore.set("isLoading",false);const e=S.error?.type;let t=S.error;if(e&&e in i){const n=this.getErrorMessage(t);t=i[e](n)}return{error:t}}const E=this.schedulerStore.get("reschedulingEventInfo");if("data"in S){this.schedulerStore.set("eventInfo",S?.data);if(S.data?.booking_id){this.schedulerStore.set("rescheduleBookingId",S.data.booking_id)}}else if(E){this.schedulerStore.set("eventInfo",E)}else{const t={booking_id:e};this.schedulerStore.set("eventInfo",t)}this.schedulerStore.set("reschedulingEventInfo",undefined);this.schedulerStore.set("isLoading",false);return S}async updateBooking(e){this.schedulerStore.set("isLoading",true);const{bookingId:t,status:i,reason:n}=e;const s=this.schedulerStore.get("organizerConfirmationSalt");const o=i==="confirmed"?c.t("confirmBookingErrorTitle"):c.t("rejectBookingErrorTitle");if(!t){return{error:this.errors.component(o).no_booking_id()}}if(!s){return{error:this.errors.component(o).no_salt()}}const a=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const r=`/v3/scheduling/bookings/${t}${a}`;const l=this.getHeaders();const d=await this.makeAPIRequest(decodeURIComponent(r),"PUT",JSON.stringify({status:i,cancellation_reason:n,salt:s}),l);if("error"in d){this.schedulerStore.set("isLoading",false);const e=d.error?.type;let t=d.error;if(e&&e in this.errors.api(o)){const i=this.getErrorMessage(t);t=this.errors.api(o)[e](i)}return{error:t}}if("data"in d&&i==="confirmed"){this.schedulerStore.set("confirmedEventInfo",d?.data)}else if("request_id"in d&&i==="cancelled"){this.schedulerStore.set("cancelledEventInfo",{booking_id:t})}this.schedulerStore.set("organizerConfirmationBookingId","");this.schedulerStore.set("isLoading",false);return d}async validateGroupEventTimeslot(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.get("configSettings")?.configuration_id;if(!t){return{error:this.errors.component(c.t("validateTimeslotErrorTitle")).no_config_id()}}const i=this.getHeaders();const n=`/v3/scheduling/configurations/${t}/group-events/validate-timeslot`;const s=await this.makeAPIRequest(decodeURIComponent(n),"POST",JSON.stringify({...e,start_time:e.start_time.getTime()/1e3,end_time:e.end_time.getTime()/1e3}),i);if("error"in s){this.schedulerStore.set("isLoading",false);const e=s.error?.type;let t=s.error;if(e&&e in this.errors.api(c.t("validateTimeslotErrorTitle"))){const i=this.getErrorMessage(t);t=this.errors.api(c.t("validateTimeslotErrorTitle"))[e](i)}this.refetchAvailability();return{error:t}}this.schedulerStore.set("selectedTimeslot",e);this.schedulerStore.set("showBookingForm",true);this.schedulerStore.set("isLoading",false);return s}}class L{constructor({schedulerAPIURL:e,nylasSchedulerStore:t,sessionId:i,configId:n,slug:s,clientId:o}){if(!e){throw new Error("schedulerAPIURL is required")}if(!t){throw new Error("nylasSchedulerStore is required")}if(!i&&!n&&!(s&&o)){throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.")}if(e==="/"){const t=new URL(window.location.href);e=t.origin}this.configId=n;this.sessionId=i;this.schedulerAPIURL=e;this.nylasSchedulerStore=t;this.slug=s;this.clientId=o}init(){g("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}setSchedulerAPIURL(e){if(e==="/"){e=new URL(window.location.href).origin}this.schedulerAPIURL=e;if(this._schedulerAPIConnector){this._schedulerAPIConnector.setSchedulerAPIURL(e)}}get scheduler(){if(this._schedulerAPIConnector){return this._schedulerAPIConnector}this._schedulerAPIConnector=new E({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId});return this._schedulerAPIConnector}resetStores(){this.nylasSchedulerStore.reset()}}function B(e={}){const t={selectedDate:null,selectedLanguage:f()||l.en,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:false,availabilityOrderEmails:[],selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:false,nylasBranding:true,...e};g(`[defaultNylasStoreState]: `,t);const i=v(t);i.onChange("availability",(e=>{g(`[availability]: `,e);const t=e.map((e=>e.start_time));g(`[selectableDates]: `,t);i.set("selectableDates",t);const n=e[0];if(!n)return;const s=Math.floor((n.end_time.getTime()-n.start_time.getTime())/6e4);g(`[durationMinutes]: `,s);i.set("eventDuration",s)}));i.reset=()=>{for(const e in t){const n=t[e];i.set(e,n)}};return i}const D=(i,n)=>{const s=i.isLoading;const o=i.showNotification;const a=i.nylasBranding;const r=i.version;return e(t,null,o&&e("nylas-notification",null),s&&e("div",{class:"loading"},e("div",{class:"left"},e("div",{class:"skeleton"})),e("div",{class:"right"},e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}))),!s&&n,e("div",{key:"ns-footer",class:"footer",part:"ns_footer"},a&&e("a",{href:"https://scheduler.nylas.com?utm_source=powered-by-nylas-logoutm_medium=link&utm_campaign=get-scheduler&utm_id=get-scheduler",class:"powered-by-nylas",target:"_blank",rel:"noreferrer noopener"},"Powered by ",e("span",{class:"sr-only"},"Nylas"),e("nylas-logo",{"aria-hidden":true})),e("tooltip-component",null,e("info-icon",{slot:"tooltip-icon"}),e("span",{slot:"tooltip-content"},r))))};const z=(t,i)=>e("div",{class:"message-banner"},i);const R=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-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;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto;border-left:none}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer .powered-by-nylas{display:flex;align-items:center;text-decoration:none;color:var(--nylas-base-500)}.footer .powered-by-nylas:hover{color:var(--nylas-base-800)}.footer svg{fill:var(--nylas-base-500)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}.language-feedback-container{width:auto;position:absolute;bottom:4px;left:16px;display:flex;gap:8px;align-items:center}.language-feedback-container button-component#report-issue{position:initial}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}';const $={title:c.t("genericErrorTitle"),category:y.Component};const P=class{constructor(e){i(this,e);this.init=n(this,"init",7);this.schedulerWillLoad=n(this,"schedulerWillLoad",7);this.schedulerDidLoad=n(this,"schedulerDidLoad",7);this.nylasSchedulerError=n(this,"nylasSchedulerError",7);this.nylasSchedulerInfo=n(this,"nylasSchedulerInfo",7);this.configSettingsLoaded=n(this,"configSettingsLoaded",7);this.bookingRefExtracted=n(this,"bookingRefExtracted",7);this.bookedEventInfo=n(this,"bookedEventInfo",7);this.initDeferred=false;this.mode="app";this.schedulerApiUrl="https://api.us.nylas.com";this.nylasBranding=true;this.eventOverrides={};this.showNotification=true;this.enableUserFeedback=true;this.automaticComponentRegistration=true;this.selectedDateLabel=`${c.t("noDateSelected")}`;this.language=navigator.language;this.showFeedbackModal=false;this.bookingInfoConfirmed=null;this.version=_}connectedCallback(){g(`[nylas-scheduler] connectedCallback`)}async componentWillLoad(){g(`[nylas-scheduler] Component will load`);this.version=_;await new Promise((e=>setTimeout(e,0)));if(this.enableUserFeedback&&!k()){I({dsn:"https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",release:this.version,integrations:e=>[...e.filter((e=>false)),x({colorScheme:"system",autoInject:false})],autoSessionTracking:false,beforeSend:()=>null})}const e=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides){await this.eventOverrides.schedulerWillLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}const t=new URLSearchParams(window.location.search);const i=r(t.get("lang"))||r(t.get("language"));const n=i||this.defaultLanguage||r(this.bookingInfo?.language)||this.defaultSchedulerState?.selectedLanguage||f()||l.en;this.language=n;c.changeLanguage(n);this.stores={scheduler:B({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,themeConfig:this.themeConfig,hour12:this.hour12,...this.defaultSchedulerState,selectedLanguage:n})};this.baseProvider=new a(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);this.refConfigId=this.configurationId;let s;try{if(this.rescheduleBookingRef){const[e,t,i]=u(this.rescheduleBookingRef);this.refConfigId=e;this.stores.scheduler.set("rescheduleBookingId",t);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.cancelBookingRef){const[e,t,i]=u(this.cancelBookingRef);this.refConfigId=e;this.stores.scheduler.set("cancelBookingId",t);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.organizerConfirmationBookingRef){const[e,t,i]=u(this.organizerConfirmationBookingRef);this.refConfigId=e;this.stores.scheduler.set("organizerConfirmationBookingId",t);this.stores.scheduler.set("organizerConfirmationSalt",i);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t,salt:i})}}catch(e){g(e);const t=this.rescheduleBookingRef||this.cancelBookingRef||this.organizerConfirmationBookingRef;this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:`Invalid booking reference: ${t}`})},host:this.host})}this.applyThemeConfig(this.themeConfig);if("bookingRefExtracted"in this.eventOverrides){await this.eventOverrides.bookingRefExtracted(s,this.nylasSchedulerConnector);if(s.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists(false)){this.initDeferred=true;return}const o=this.baseProvider?.getStore("scheduler");this.nylasSchedulerConnector=new L({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:o});const d=this.init.emit(this.host);if("init"in this.eventOverrides){await this.eventOverrides.init(d,this.nylasSchedulerConnector);if(d.defaultPrevented){return}}this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector)}async componentDidLoad(){if(this.initDeferred){return}this.baseProvider?.componentDidLoad();await Promise.resolve();const e=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides){await this.eventOverrides.schedulerDidLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists()){return}await this.performSchedulerDataFetch()}async performSchedulerDataFetch(){this.fetchAbortController?.abort();this.fetchAbortController=new AbortController;const{signal:e}=this.fetchAbortController;try{if(this.nylasSchedulerConnector){if(this.schedulerApiUrl){this.nylasSchedulerConnector.setSchedulerAPIURL(this.schedulerApiUrl)}if(this.sessionId){this.nylasSchedulerConnector.sessionId=this.sessionId;this.nylasSchedulerConnector.scheduler.setSessionId(this.sessionId)}}this.localizationChanged(this.localization);const t=await(this.nylasSchedulerConnector?.scheduler.getUISettings(e));if(e.aborted)return;if(!t||"error"in t){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(t?.error)},host:this.host});return}else{if("data"in t&&t.data?.appearance){g("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.")}const i=this.configSettingsLoaded.emit({settings:t});if("configSettingsLoaded"in this.eventOverrides){await this.eventOverrides.configSettingsLoaded(i,this.nylasSchedulerConnector);if(e.aborted)return;if(i.defaultPrevented){return}}}const i=this.baseProvider?.getStore("scheduler");const n=i?.get("configSettings")?.scheduler?.available_days_in_future;const s=i?.get("selectedTimeslot");if(s&&s?.start_time){if(!this.isTimeslotValid(s)){return}if(i?.get("showBookingForm")){i?.set("selectedDate",s.start_time);return}}const o=d(i?.get("selectedDate"));const a=i?.get("availability");let r;if(a&&a.length>0){return}if(!o){const t=new Date;const{startTime:i,endTime:s,endTimeForAvailableDaysInFuture:o}=this.validateAvailableDaysInFuture(t,n||30);if(t.getTime()<o*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(i,s,e))}}else{const{startTime:t,endTime:i,endTimeForAvailableDaysInFuture:s}=this.validateAvailableDaysInFuture(o,n||30);if(o.getTime()<s*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(t,i,e))}}if(e.aborted)return;if(!r||"error"in r){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r?.error)},host:this.host})}if(!o){let e=new Date;const t=i?.get("availability").find((e=>{const t=d(e.start_time);return t?t>new Date:false}));if(t){e=d(t.start_time)||e}i?.set("selectedDate",e)}}catch(e){if(e.name==="AbortError")return;throw e}}hasValidAuthConfig(){return!!(this.sessionId||this.refConfigId||this.slug&&this.clientId)}async performDeferredInit(){if(!this.hasValidAuthConfig()||!this.initDeferred||!this.baseProvider){return}document.body.dispatchEvent(new CustomEvent("nylasSchedulerClearNotifications",{detail:{host:this.host},bubbles:true}));this.initDeferred=false;this.refConfigId=this.refConfigId||this.configurationId;this.baseProvider.eventOverrides=this.eventOverrides;const e=this.baseProvider.getStore("scheduler");this.nylasSchedulerConnector=new L({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:e});const t=this.init.emit(this.host);if("init"in this.eventOverrides){await this.eventOverrides.init(t,this.nylasSchedulerConnector);if(t.defaultPrevented){return}}await this.baseProvider.componentWillLoad(this.nylasSchedulerConnector);this.baseProvider.componentDidLoad();await Promise.resolve();const i=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides){await this.eventOverrides.schedulerDidLoad(i,this.nylasSchedulerConnector);if(i.defaultPrevented){return}}await this.performSchedulerDataFetch()}async authPropsChanged(e){if(e&&"bookingRefExtracted"in this.eventOverrides){await this.eventOverrides.bookingRefExtracted(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}if(this.initDeferred&&this.hasValidAuthConfig()){this.performDeferredInit()}}configurationIdChanged(){if(!this.rescheduleBookingRef&&!this.cancelBookingRef&&!this.organizerConfirmationBookingRef){this.refConfigId=this.configurationId}this.authPropsChanged()}schedulerApiUrlChanged(){if(this.nylasSchedulerConnector&&this.schedulerApiUrl){this.nylasSchedulerConnector.setSchedulerAPIURL(this.schedulerApiUrl);document.body.dispatchEvent(new CustomEvent("nylasSchedulerClearNotifications",{detail:{host:this.host},bubbles:true}));this.stores?.scheduler.set("availability",[]);this.performSchedulerDataFetch()}}sessionIdChanged(){if(this.nylasSchedulerConnector&&this.sessionId){this.nylasSchedulerConnector.sessionId=this.sessionId;this.nylasSchedulerConnector.scheduler.setSessionId(this.sessionId);document.body.dispatchEvent(new CustomEvent("nylasSchedulerClearNotifications",{detail:{host:this.host},bubbles:true}));this.performSchedulerDataFetch()}this.authPropsChanged()}slugChanged(){this.authPropsChanged()}clientIdChanged(){this.authPropsChanged()}componentDisconnected(){this.baseProvider?.componentDisconnected()}bookingInfoChanged(e){this.stores?.scheduler.set("bookingInfo",e);if(e?.language&&!this.defaultLanguage){this.stores?.scheduler.set("selectedLanguage",r(e.language)||l.en)}}rescheduleBookingRefChanged(e){let t;if(e){try{const[i,n]=u(e);this.stores?.scheduler.set("rescheduleBookingId",n);this.refConfigId=i;this.nylasSchedulerConnector?.scheduler.setConfigId(i);t=this.bookingRefExtracted.emit({configurationId:i,bookingId:n})}catch(t){g(t);this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:`Invalid booking reference: ${e}`})},host:this.host})}}this.authPropsChanged(t)}cancelBookingRefChanged(e){let t;if(e){try{const[i,n]=u(e);this.stores?.scheduler.set("cancelBookingId",n);this.refConfigId=i;this.nylasSchedulerConnector?.scheduler.setConfigId(i);t=this.bookingRefExtracted.emit({configurationId:i,bookingId:n})}catch(t){g(t);this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:`Invalid booking reference: ${e}`})},host:this.host})}}this.authPropsChanged(t)}organizerConfirmationBookingRefChanged(e){let t;if(e){try{const[i,n,s]=u(e);this.stores?.scheduler.set("organizerConfirmationBookingId",n);this.stores?.scheduler.set("organizerConfirmationSalt",s);this.refConfigId=i;this.nylasSchedulerConnector?.scheduler.setConfigId(i);t=this.bookingRefExtracted.emit({configurationId:i,bookingId:n,salt:s})}catch(t){g(t);this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:`Invalid booking reference: ${e}`})},host:this.host})}}this.authPropsChanged(t)}localizationChanged(e){if(!e){return}Object.keys(e).forEach((t=>{if(!(t in l)){return}c.addResourceBundle(t,"translation",e[t],false,true)}))}defaultLanguageChanged(e){if(e){this.stores?.scheduler.set("selectedLanguage",e);c.changeLanguage(e)}}themeConfigChanged(e){this.baseProvider?.getStore("scheduler")?.set("themeConfig",e);this.applyThemeConfig(e)}languageChanged(e){const t=r(e.detail)||l.en;this.language=t;c.changeLanguage(t);this.stores?.scheduler?.set("selectedLanguage",t)}async registerComponentHandler(e){this.baseProvider?.registerComponent(e.detail)}async unregisterComponentHandler(e){this.baseProvider?.unregisterComponent(e.detail)}async monthChangedHandler(e){const t=e.detail;const i=this.nylasSchedulerConnector?.schedulerStore?.get("configSettings")?.scheduler?.available_days_in_future;const{startTime:n,endTime:s,endTimeForAvailableDaysInFuture:o}=this.validateAvailableDaysInFuture(t,i||30);if(e.defaultPrevented){return}if(n<o&&t.getTime()<o*1e3){const e=await(this.nylasSchedulerConnector?.scheduler.getAvailability(n,s));if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e?.error)},host:this.host})}const t=this.stores?.scheduler.get("selectableDates");if(t&&t.length>0){this.stores?.scheduler.set("selectedDate",t[0])}}}mapToBookingData(e){const t=this.stores?.scheduler.get("selectedTimeslot");const i=this.stores?.scheduler.get("selectedLanguage");const n=this.stores?.scheduler.get("selectedTimezone");const s=t?.start_time?new Date(t?.start_time).getTime()/1e3:"";const o=t?.end_time?new Date(t?.end_time).getTime()/1e3:"";return{additional_guests:e.guests,guest:{...e.primaryParticipant},additional_fields:{...e.additionalFields},start_time:s,end_time:o,email_language:i,timezone:n}}async bookButtonClickedHandler(e){if(e.defaultPrevented){return}const t=e.detail;const i=this.mapToBookingData(t);this.bookingInfoConfirmed=t;const n=this.nylasSchedulerConnector?.schedulerStore?.get("rescheduleBookingId");const s=n;if(s){const e=await(this.nylasSchedulerConnector?.scheduler.rescheduleBooking(s,t));if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e?.error)},host:this.host})}const n=e?.data;const o=this.bookedEventInfo.emit({...e,data:{...n,...i}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...n};if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(o,this.nylasSchedulerConnector)}return}const o=await(this.nylasSchedulerConnector?.scheduler.bookTimeslot(t));if(!o||"error"in o){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(o?.error)},host:this.host})}const a=o?.data;const r=this.bookedEventInfo.emit({...o,data:{...a,...i}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...a};if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(r,this.nylasSchedulerConnector)}}dateSelectedHandler(e){const t=d(e.detail);this.selectedDateLabel=t?this.formatSelectedDateLabel(t):`${c.t("noDateSelected")}`}getSelectedLanguage(){const e=this.stores?.scheduler.get("selectedLanguage")||this.defaultLanguage||f()||l.en;return r(e)||l.en}getSelectedDateLocale(){const e=this.getSelectedLanguage();return p[e]||e||p[l.en]}formatSelectedDateLabel(e){return m(e.toLocaleDateString(this.getSelectedDateLocale(),{dateStyle:"full"}))}cancelBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}confirmBookingErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}feedbackModalClosedHandler(){this.showFeedbackModal=false}eventIsFullHandler(e){const t=e.detail.error;const i=e.detail.type;if(i==="error"){this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:t})},host:this.host})}else{this.nylasSchedulerInfo.emit({notification:{title:"Event is full",category:y.Component,type:w.Info,description:"The event you selected is full. Please try a different time.",id:(new Date).getTime().toString(),ttl:3e3},host:this.host})}}feedbackSubmittedHandler(e){C("Scheduling Page User Feedback",{extra:{configId:this.configurationId,slug:this.slug}});const t={message:e.detail.feedback};T(t,{includeReplay:true,captureContext:{tags:{"nylas-web-element":"nylas-scheduling","nylas-web-element-version":this.version,"nylas-config-id":this.configurationId,"nylas-slug":this.slug,"host-url":window.location.href},extra:{configId:this.configurationId,slug:this.slug,version:this.version}}});this.showFeedbackModal=false}async getNylasSchedulerStore(){return this.baseProvider?.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(e){return{title:e?.title||$.title,category:e?.category||$.category,type:w.Error,description:e?.message||"",id:(new Date).getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(e=true){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){if(e){let e="";if(!this.sessionId){e+=c.t("sessionIdRequiredErrorMessage")}if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){e=c.t("sessionIdRequiredErrorMessage")+" "+c.t("publicConfigErrorMessage")}this.nylasSchedulerError.emit({notification:{title:c.t("schedulingComponentErrorTitle"),category:y.Component,type:w.Error,description:e,id:(new Date).getTime().toString(),ttl:"none"},host:this.host})}return false}return true}isTimeslotValid(e){const t=new Date(e.start_time);if(t<new Date){this.nylasSchedulerError.emit({notification:{title:c.t("invalidTimeslotErrorTitle"),category:y.Component,type:w.Error,description:c.t("invalidTimeslotErrorMessage"),id:(new Date).getTime().toString(),ttl:"none"},host:this.host});return false}return true}validateAvailableDaysInFuture(e,t){const i=new Date;const n=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const s=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const o=Math.floor(h(i,t).getTime()/1e3);const a=Math.min(o,s);const r=n<i.getTime()/1e3?Math.floor(i.getTime()/1e3):n;return{startTime:r,endTime:a,endTimeForAvailableDaysInFuture:o}}applyThemeConfig(e){if(e){for(const[t,i]of Object.entries(e)){this.host.style.setProperty(`${t}`,i)}}}onFeedbackClick(e){e.preventDefault();this.showFeedbackModal=true}redirectToCustomUrl(e){window.location.assign(e)}nylasFormDropdownChangedHandler(e){const{name:t,value:i}=e.detail;if(t==="language"){const e=l[i];c.changeLanguage(e);this.stores?.scheduler?.set("selectedLanguage",e)}}render(){const t=this.mode==="app";const i=this.baseProvider?.getStore("scheduler");const n=i?.get("eventInfo");const o=i?.get("showBookingForm");const a=i?.get("cancelledEventInfo");const r=i?.get("cancelBookingId");const l=i?.get("selectedTimeslot");const h=i?.get("rescheduleBookingId");const g=i?.get("organizerConfirmationBookingId");const f=i?.get("rejectBookingId");const u=i?.get("confirmedEventInfo");const p=i?.get("nylasBranding")||this.nylasBranding;const m=d(i?.get("selectedDate"));const y=i?.get("configSettings")?.scheduler?.confirmation_redirect_url;const _=Object.keys(b).map((e=>({label:b[e],value:e})));const w=this.getSelectedLanguage();const v=m?this.formatSelectedDateLabel(m):`${c.t("noDateSelected")}`;if(t&&(r||f)&&!a){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e("nylas-cancel-booking-form",{selectedTimeslot:l,cancelBookingId:r,rejectBookingId:f,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&g){return e(s,null,e(D,null,e("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},e("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:g,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&a){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e("nylas-cancelled-event-card",{cancelledEventInfo:a,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&u){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"confirmed-event-page"},e("nylas-confirmed-event-card",{confirmedEventInfo:u,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&n&&y){const e=this.bookingInfoConfirmed?.primaryParticipant;const t=this.bookingInfoConfirmed?.location;const i=this.bookingInfoConfirmed?.booking_ref;const s=this.bookingInfoConfirmed?.additionalFields||{};if(this.bookingInfo&&typeof this.bookingInfo?.additionalFields!=="undefined"){const e=this.bookingInfo.additionalFields;Object.keys(e).forEach((t=>{if(!s[t]&&e?.[t]){s[t]=e[t].value}}))}const o=this.stores?.scheduler.get("selectedTimeslot");const a=this.stores?.scheduler.get("selectedTimezone");const r=this.stores?.scheduler.get("selectedLanguage");const l=this.stores?.scheduler.get("configSettings");const c=this.configurationId?this.configurationId:l?.configuration_id;const d=window.location.search;const h=new URLSearchParams(d);h.set("booking_id",n.booking_id);e?.name&&h.set("name",e.name);e?.email&&h.set("email",e.email);o?.start_time&&h.set("start_time",(new Date(o.start_time).getTime()/1e3).toString());o?.end_time&&h.set("end_time",(new Date(o.end_time).getTime()/1e3).toString());a&&h.set("tz",a);r&&h.set("language",r);s&&h.set("additional_values",JSON.stringify(s));this.slug&&h.set("page_slug",this.slug);c&&h.set("config_id",c);t&&h.set("location",t);i&&h.set("booking_ref",i);const g=new URL(y,window.location.origin);h.forEach(((e,t)=>{g.searchParams.set(t,e)}));this.redirectToCustomUrl(g.toString());return}if(t&&n){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"booked-event-page",part:"booked-event-page ns_booked-event-page"},e("nylas-booked-event-card",{selectedTimeslot:l,eventInfo:n,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&(!n||!!h)&&!o){const t=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},h&&e(z,null,`${c.t("rescheduleTitle")}`),e("div",{class:"select-date-page",part:"select-date-page ns_select-date-page"},e("div",{class:"left-panel",part:"ns_left-panel"},e("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),e("div",{class:`right-panel ${h?"reschedule":""}`,part:`ns_right-panel ${h?"ns_reschedule":""}`},e("h2",{part:"ns_right-panel__title"},e("calendar-icon",{part:"ns_right-panel__calendar-icon"}),e("span",{id:"selectedDate",part:"ns_right-panel__selected-date"},v)),e("nylas-timeslot-picker",{exportparts:"ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},t&&e("span",{slot:"timeslot-picker-cta-label"},e("slot",{name:"timeslot-picker-cta-label"})))))),this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&!n&&o){return e(s,null,e(D,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},h&&e(z,null,`${c.t("rescheduleTitle")}`),e("div",{class:"additional-data-page",part:"additional-data-page ns_additional-data-page"},e("div",{class:"left-panel ns_left-panel",part:"ns_left-panel"},e("div",{class:"wrapper",part:"ns_left-panel__wrapper"},e("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),e("div",{class:`right-panel ${h?"reschedule":""}`,part:`ns_right-panel ${h?"ns_reschedule":""}`},e("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"})))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:c.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==w)),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",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}return e(s,null,e("slot",null))}get host(){return o(this)}static get watchers(){return{configurationId:["configurationIdChanged"],schedulerApiUrl:["schedulerApiUrlChanged"],sessionId:["sessionIdChanged"],slug:["slugChanged"],clientId:["clientIdChanged"],bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],defaultLanguage:["defaultLanguageChanged"],themeConfig:["themeConfigChanged"]}}};P.style=R;export{P as nylas_scheduling};
|
|
2
|
+
//# sourceMappingURL=p-b607eace.entry.js.map
|