@nylas/web-elements 1.1.0-canary.13 → 1.1.0-canary.14
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/cjs/nylas-booked-event-card.cjs.entry.js +1 -1
- package/dist/cjs/nylas-booked-event-card.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +8 -8
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booking-form.cjs.entry.js +1 -1
- package/dist/cjs/nylas-booking-form.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-cancel-booking-form.cjs.entry.js +2 -2
- package/dist/cjs/nylas-cancel-booking-form.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/nylas-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-locale-switch.cjs.entry.js +1 -1
- package/dist/cjs/nylas-locale-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-provider.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +1 -1
- package/dist/cjs/nylas-selected-event-card.cjs.entry.js +1 -1
- package/dist/cjs/nylas-selected-event-card.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-timeslot-picker.cjs.entry.js +1 -1
- package/dist/cjs/nylas-timeslot-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/{scheduler-store-62db2e23.js → scheduler-store-60f3329a.js} +3 -2
- package/dist/cjs/scheduler-store-60f3329a.js.map +1 -0
- package/dist/cjs/{scheduler-store-09ba6cab.js → scheduler-store-f3bb6712.js} +3 -2
- package/dist/cjs/scheduler-store-f3bb6712.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.css +1 -1
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.css +5 -0
- package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js +2 -2
- package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.css +1 -1
- package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.css +4 -0
- package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.css +1 -1
- package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.css +2 -2
- package/dist/collection/connector/shared/api/scheduler.js +2 -1
- package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
- package/dist/components/nylas-booked-event-card2.js +1 -1
- package/dist/components/nylas-booked-event-card2.js.map +1 -1
- package/dist/components/nylas-booking-form2.js +1 -1
- package/dist/components/nylas-booking-form2.js.map +1 -1
- package/dist/components/nylas-cancel-booking-form2.js +2 -2
- package/dist/components/nylas-cancel-booking-form2.js.map +1 -1
- package/dist/components/nylas-date-picker2.js +1 -1
- package/dist/components/nylas-date-picker2.js.map +1 -1
- package/dist/components/nylas-locale-switch2.js +1 -1
- package/dist/components/nylas-locale-switch2.js.map +1 -1
- package/dist/components/nylas-selected-event-card2.js +1 -1
- package/dist/components/nylas-selected-event-card2.js.map +1 -1
- package/dist/components/nylas-timeslot-picker2.js +1 -1
- package/dist/components/nylas-timeslot-picker2.js.map +1 -1
- package/dist/components/scheduler-store.js +2 -1
- package/dist/components/scheduler-store.js.map +1 -1
- package/dist/esm/nylas-booked-event-card.entry.js +1 -1
- package/dist/esm/nylas-booked-event-card.entry.js.map +1 -1
- package/dist/esm/nylas-booked-event-card_10.entry.js +8 -8
- package/dist/esm/nylas-booked-event-card_10.entry.js.map +1 -1
- package/dist/esm/nylas-booking-form.entry.js +1 -1
- package/dist/esm/nylas-booking-form.entry.js.map +1 -1
- package/dist/esm/nylas-cancel-booking-form.entry.js +2 -2
- package/dist/esm/nylas-cancel-booking-form.entry.js.map +1 -1
- package/dist/esm/nylas-date-picker.entry.js +1 -1
- package/dist/esm/nylas-date-picker.entry.js.map +1 -1
- package/dist/esm/nylas-locale-switch.entry.js +1 -1
- package/dist/esm/nylas-locale-switch.entry.js.map +1 -1
- package/dist/esm/nylas-provider.entry.js +1 -1
- package/dist/esm/nylas-scheduling.entry.js +1 -1
- package/dist/esm/nylas-selected-event-card.entry.js +1 -1
- package/dist/esm/nylas-selected-event-card.entry.js.map +1 -1
- package/dist/esm/nylas-timeslot-picker.entry.js +1 -1
- package/dist/esm/nylas-timeslot-picker.entry.js.map +1 -1
- package/dist/esm/{scheduler-store-3afbcda0.js → scheduler-store-04e15f8a.js} +3 -2
- package/dist/esm/scheduler-store-04e15f8a.js.map +1 -0
- package/dist/{nylas-web-elements/scheduler-store-8f5974ed.js → esm/scheduler-store-bf3671b7.js} +3 -2
- package/dist/esm/scheduler-store-bf3671b7.js.map +1 -0
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-booking-form.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-booking-form.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-cancel-booking-form.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-cancel-booking-form.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-date-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-date-picker.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-locale-switch.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-locale-switch.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-provider.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-scheduling.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-selected-event-card.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-timeslot-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-timeslot-picker.entry.js.map +1 -1
- package/dist/nylas-web-elements/{p-a3c4317a.entry.js → p-3240c0aa.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-ff896e96.entry.js → p-cab5c048.entry.js} +2 -2
- package/dist/nylas-web-elements/p-d7038914.entry.js +2 -0
- package/dist/nylas-web-elements/p-d7038914.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-7e7a3c01.js → p-e1dcf5ca.js} +2 -2
- package/dist/nylas-web-elements/p-e1dcf5ca.js.map +1 -0
- package/dist/{esm/scheduler-store-8f5974ed.js → nylas-web-elements/scheduler-store-bf3671b7.js} +3 -2
- package/dist/nylas-web-elements/scheduler-store-bf3671b7.js.map +1 -0
- package/dist/types/connector/shared/api/scheduler.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/scheduler-store-09ba6cab.js.map +0 -1
- package/dist/cjs/scheduler-store-62db2e23.js.map +0 -1
- package/dist/esm/scheduler-store-3afbcda0.js.map +0 -1
- package/dist/esm/scheduler-store-8f5974ed.js.map +0 -1
- package/dist/nylas-web-elements/p-64fc3c8e.entry.js +0 -2
- package/dist/nylas-web-elements/p-64fc3c8e.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-7e7a3c01.js.map +0 -1
- package/dist/nylas-web-elements/scheduler-store-8f5974ed.js.map +0 -1
- /package/dist/nylas-web-elements/{p-a3c4317a.entry.js.map → p-3240c0aa.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ff896e96.entry.js.map → p-cab5c048.entry.js.map} +0 -0
|
@@ -4,7 +4,7 @@ import { R as RegisterComponent } from './register-component-e92f8a6f.js';
|
|
|
4
4
|
import './_commonjsHelpers-fc8d6640.js';
|
|
5
5
|
import './utils-ec8dc014.js';
|
|
6
6
|
|
|
7
|
-
const nylasLocaleSwitchCss = ":host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:68px;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}";
|
|
7
|
+
const nylasLocaleSwitchCss = ":host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:68px;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown::part(sd_dropdown-content){width:100%}";
|
|
8
8
|
|
|
9
9
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
10
10
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nylas-locale-switch.entry.esm.js","mappings":";;;;;;AAAA,MAAM,oBAAoB,GAAG
|
|
1
|
+
{"file":"nylas-locale-switch.entry.esm.js","mappings":";;;;;;AAAA,MAAM,oBAAoB,GAAG,q2CAAq2C;;;;;;;;;;;;;;;;MCcr3C,iBAAiB;;;;;gCAIwB,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;gCAKhD,SAAS,CAAC,QAAQ;;IAYtE,iBAAiB,MAAK;IAEtB,oBAAoB,MAAK;IAEzB,iBAAiB,MAAK;IAMd,cAAc,CAAC,QAAgB;QACrC,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QACjC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACrC;IAMO,cAAc,CAAC,QAAgB;QACrC,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QACjC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACrC;IAGD,4BAA4B,CAC1B,KAGE;QAEF,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QACrC,IAAI,IAAI,KAAK,UAAU,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,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e,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAC7I,6DAAM,IAAI,EAAC,aAAa,IACtB,mEAAY,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CAChC,CACS,CACd,EACN,4DACE,KAAK,EAAE;gBACL,gBAAgB,EAAE,IAAI;gBACtB,UAAU,EAAE,IAAI;aACjB,IAED,wEAAiB,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,gBAAgB,CAAC,IACjJ,6DAAM,IAAI,EAAC,aAAa,IACtB,uEAAgB,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CACpC,CACS,CACd,CACF,CACD,EACP;KACH;;AAzCD;IAbC,iBAAiB,CAA4F;QAC5G,IAAI,EAAE,qBAAqB;QAC3B,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;SACnD,CAAC;QACF,YAAY,EAAE;YACZ,eAAe,EAAE,OAAO,KAA0B,EAAE,uBAAgD;gBAClG,uBAAuB,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;aAChE;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;+CA0CD;;;;;","names":[],"sources":["src/components/scheduler/nylas-locale-switch/nylas-locale-switch.scss?tag=nylas-locale-switch&encapsulation=shadow","src/components/scheduler/nylas-locale-switch/nylas-locale-switch.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n @include default-css-variables;\n}\n\n.nylas-locale-switch {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n height: 68px;\n border-left: none;\n border-right: none;\n color: var(--nylas-base-50);\n font-size: 14px;\n @media #{$mobile} {\n font-size: 16px;\n }\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s ease-in-out;\n font-family: inherit;\n}\n\n.select-wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\nselect {\n border: none;\n background: transparent;\n cursor: pointer;\n outline: none;\n background-color: transparent;\n margin: 0 0 1px;\n padding: 4px;\n vertical-align: middle;\n &#timezone {\n width: 140px;\n }\n &#language {\n width: 80px;\n }\n}\n\nspan.timezone-label {\n display: flex;\n width: -webkit-fill-available;\n justify-content: space-between;\n}\n\nselect-dropdown::part(sd_dropdown-content) {\n width: 100%;\n}\n","import { LANGUAGE_MAP, TIMEZONE_MAP, getTimezoneOffset } from '@/common/constants';\nimport { RegisterComponent } from '@/common/register-component';\nimport { Component, Event, EventEmitter, Host, Listen, Prop, h } from '@stencil/core';\nimport { NylasSchedulerConnector } from '../../../components';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\n\n/**\n * The `nylas-locale-switch` component is a UI component that allows users to select a timezone and language.\n */\n@Component({\n tag: 'nylas-locale-switch',\n styleUrl: 'nylas-locale-switch.scss',\n shadow: true,\n})\nexport class NylasLocaleSwitch {\n /**\n * The selected timezone.\n */\n @Prop({ mutable: true }) selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n /**\n * The selected language.\n */\n @Prop({ mutable: true }) selectedLanguage: string = navigator.language;\n\n /**\n * This event is fired when the timezone is changed.\n */\n @Event() timezoneChanged!: EventEmitter<string>;\n\n /**\n * This event is fired when the language is changed.\n */\n @Event() languageChanged!: EventEmitter<string>;\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n componentWillLoad() {}\n\n /**\n * Change the timezone.\n * @param timezone The timezone to select.\n */\n private changeTimezone(timezone: string) {\n this.selectedTimezone = timezone;\n this.timezoneChanged.emit(timezone);\n }\n\n /**\n * Change the language.\n * @param language The language to select.\n */\n private changeLanguage(language: string) {\n this.selectedLanguage = language;\n this.languageChanged.emit(language);\n }\n\n @Listen('selectedOptionChanged')\n selectedOptionChangedHandler(\n event: CustomEvent<{\n value: string;\n name: string;\n }>,\n ) {\n const { name, value } = event.detail;\n if (name === 'timezone') {\n this.changeTimezone(value);\n } else if (name === 'language') {\n this.changeLanguage(value);\n }\n }\n\n getTimezoneLabelHTML(timezone: string) {\n const offset = getTimezoneOffset(timezone);\n return (\n <span\n class=\"timezone-label\"\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '-webkit-fill-available',\n }}\n >\n {TIMEZONE_MAP[timezone]}{' '}\n <span\n class=\"timezone-offset\"\n style={{\n fontSize: '14px',\n fontWeight: '400',\n color: 'var(--nylas-base-500)',\n }}\n >\n {offset}\n </span>\n </span>\n );\n }\n\n @RegisterComponent<NylasLocaleSwitch, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-locale-switch',\n stateToProps: new Map([\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ]),\n eventToProps: {\n timezoneChanged: async (event: CustomEvent<string>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n nylasSchedulerConnector.scheduler.selectTimezone(event.detail);\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const timezoneOptions = Object.keys(TIMEZONE_MAP).map(key => ({\n labelHTML: this.getTimezoneLabelHTML(key),\n label: TIMEZONE_MAP[key],\n value: key,\n }));\n const languageOptions = Object.keys(LANGUAGE_MAP).map(key => ({\n label: LANGUAGE_MAP[key],\n value: key,\n }));\n\n return (\n <Host>\n <div class=\"nylas-locale-switch\">\n <div\n class={{\n 'select-wrapper': true,\n 'timezone': true,\n }}\n >\n <select-dropdown name=\"timezone\" options={timezoneOptions} defaultSelectedOption={timezoneOptions.find(op => op.value == this.selectedTimezone)}>\n <span slot=\"select-icon\">\n <globe-icon width=\"20\" height=\"20\" />\n </span>\n </select-dropdown>\n </div>\n <div\n class={{\n 'select-wrapper': true,\n 'language': true,\n }}\n >\n <select-dropdown name=\"language\" options={languageOptions} defaultSelectedOption={languageOptions.find(lang => lang.value == this.selectedLanguage)}>\n <span slot=\"select-icon\">\n <translate-icon width=\"20\" height=\"20\" />\n </span>\n </select-dropdown>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, i as createEvent, h, a as Host, e as getElement
|
|
|
2
2
|
import { N as NylasBaseProvider, e as es } from './index.es-ad5a6927.js';
|
|
3
3
|
import { a as debug } from './utils-ec8dc014.js';
|
|
4
4
|
import { N as NylasAuthConnector, a as NylasThreadsConnector, b as NylasMessagesConnector, c as NylasFoldersConnector, C as CreateNylasAuthStore, d as CreateNylasMailboxStore, H as HashRouter } from './mailbox-store-4897e2a5.js';
|
|
5
|
-
import { N as NylaSchedulerAPIConnector, C as CreateNylasSchedulerStore } from './scheduler-store-
|
|
5
|
+
import { N as NylaSchedulerAPIConnector, C as CreateNylasSchedulerStore } from './scheduler-store-bf3671b7.js';
|
|
6
6
|
import { C as CreateNylasSchedulerConfigStore } from './scheduler-config-store-8ccc8dc7.js';
|
|
7
7
|
import './_commonjsHelpers-fc8d6640.js';
|
|
8
8
|
import './index-11d12497.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, F as Fragment, r as registerInstance, i as createEvent, a as Host, e as getElement } from './index-8362ce5c.js';
|
|
2
2
|
import { n as nr, N as NylasBaseProvider } from './index.es-ad5a6927.js';
|
|
3
3
|
import { a as debug, i as compactStringToUUIDs, j as addDaysToCurrentDate } from './utils-ec8dc014.js';
|
|
4
|
-
import { N as NylaSchedulerAPIConnector, E as ErrorCategory, C as CreateNylasSchedulerStore } from './scheduler-store-
|
|
4
|
+
import { N as NylaSchedulerAPIConnector, E as ErrorCategory, C as CreateNylasSchedulerStore } from './scheduler-store-bf3671b7.js';
|
|
5
5
|
import './_commonjsHelpers-fc8d6640.js';
|
|
6
6
|
import './index-11d12497.js';
|
|
7
7
|
|
|
@@ -4,7 +4,7 @@ import { a as debug } from './utils-ec8dc014.js';
|
|
|
4
4
|
import { T as TIMEZONE_MAP } from './constants-9ea99bef.js';
|
|
5
5
|
import './_commonjsHelpers-fc8d6640.js';
|
|
6
6
|
|
|
7
|
-
const nylasSelectedEventCardCss = ":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:
|
|
7
|
+
const nylasSelectedEventCardCss = ":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}";
|
|
8
8
|
|
|
9
9
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
10
10
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nylas-selected-event-card.entry.esm.js","mappings":";;;;;;AAAA,MAAM,yBAAyB,GAAG,
|
|
1
|
+
{"file":"nylas-selected-event-card.entry.esm.js","mappings":";;;;;;AAAA,MAAM,yBAAyB,GAAG,iqCAAiqC;;;;;;;;;;;;;;;;MCuBtrC,sBAAsB;;;;;gCAa6C,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;yBAEjG,EAAE;uBACJ,EAAE;;IAE7B,iBAAiB,MAAK;IAEtB,oBAAoB,MAAK;IAEzB,MAAM,iBAAiB;QACrB,KAAK,CAAC,iDAAiD,CAAC,CAAC;KAC1D;IAED,MAAM,gBAAgB;QACpB,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,OAAO,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;SAClF;QACD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC1B,OAAO,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC;SACtF;KACF;IAGD,4BAA4B,CAAC,gBAA0B;QACrD,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,gBAAgB,EAAE,UAAkB,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;QAClH,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,gBAAgB,EAAE,QAAgB,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;KAC/G;IAYD,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,IAAI,EAAC,MAAM,IACf,iEAAU,KAAK,EAAC,UAAU,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,QAAQ,IACpD,4DAAK,KAAK,EAAC,YAAY,EAAC,IAAI,EAAC,YAAY,IACvC,4DAAK,KAAK,EAAC,eAAe,EAAC,IAAI,EAAC,YAAY,IAC1C,uEAAiB,CACb,EACN,4DAAK,KAAK,EAAC,iCAAiC,EAAC,IAAI,EAAC,YAAY,IAC3D,IAAI,CAAC,YAAY,EAAE,kBAAkB,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CACpE,EACN,4DAAK,KAAK,EAAC,iCAAiC,EAAC,IAAI,EAAC,YAAY,IAC3D,IAAI,CAAC,SAAS,SAAK,IAAI,CAAC,OAAO,CAC5B,CACF,EACN,4DAAK,KAAK,EAAC,gBAAgB,EAAC,IAAI,EAAC,gBAAgB,IAC/C,oEAAyB,EACxB,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAChC,CACG,CACN,EACP;KACH;;;;;AAtBD;IAVC,iBAAiB,CAAiG;QACjH,IAAI,EAAE,2BAA2B;QACjC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,wBAAwB,EAAE,cAAc,CAAC;YAC1C,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;SACnD,CAAC;QACF,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;oDAuBD;;;;;","names":[],"sources":["src/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.scss?tag=nylas-selected-event-card&encapsulation=shadow","src/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n\n:host {\n display: block;\n}\n\nsp-theme {\n position: relative;\n height: inherit;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-family: var(--nylas-font-family);\n}\n\n.event-card {\n display: flex;\n align-items: center;\n flex-direction: column;\n width: calc(100% - 3rem);\n background-color: var(--nylas-base-0);\n color: var(--nylas-base-800);\n border-radius: var(--nylas-border-radius-2x);\n padding: 3rem 1.5rem 1.5rem 1.5rem;\n position: relative;\n box-shadow:\n 0px 1px 3px 0px rgba(0, 0, 0, 0.1),\n 0px 1px 2px 0px rgba(0, 0, 0, 0.06);\n @media #{$mobile} {\n margin-bottom: 2rem;\n }\n}\n\n.nylas-selected-event-card__date {\n font-size: min(max(16px, 3vw), 18px);\n font-weight: 600;\n}\n\n.nylas-selected-event-card__time {\n font-size: 16px;\n font-weight: 500;\n}\n\n.calendar-icon {\n width: 3rem;\n height: 3rem;\n border-radius: 50%;\n position: absolute;\n top: -1.25rem;\n left: 50%;\n transform: translateX(-50%);\n background-color: var(--nylas-base-0);\n border: 1px solid var(--nylas-base-200);\n}\n\ncalendar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n\n.event-timezone {\n display: flex;\n color: var(--nylas-base-600);\n margin-bottom: 8px;\n @media #{$mobile} {\n margin-bottom: 16px;\n }\n gap: 4px;\n align-items: center;\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport type { NylasSchedulerConnector } from '../../..';\nimport type { Timeslot } from '@nylas/core';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { debug } from '@/utils/utils';\nimport { TIMEZONE_MAP } from '@/common/constants';\n\n/**\n * The `nylas-selected-event-card` component is a UI component that displays the selected event card.\n *\n * @part nsec - The selected event card component.\n * @part nsec__card - The card component.\n * @part nsec__icon - The calendar icon.\n * @part nsec__date - The date selected.\n * @part nsec__time - The timeslot selected.\n * @part nsec__timezone - The timezone selected.\n */\n@Component({\n tag: 'nylas-selected-event-card',\n styleUrl: 'nylas-selected-event-card.scss',\n shadow: true,\n})\nexport class NylasSelectedEventCard {\n /**\n * The selected date.\n */\n @Prop({ attribute: 'selected-date' }) readonly selectedDate?: Date;\n\n /**\n * The selected time.\n */\n @Prop({ attribute: 'selected-timeslot' }) readonly selectedTimeslot?: Timeslot;\n /***\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n @State() startTime: string = '';\n @State() endTime: string = '';\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n debug(`[nylas-selected-event-card] Component will load`);\n }\n\n async componentDidLoad() {\n debug(`[nylas-selected-event-card] Component did load`);\n if (!this.selectedDate) {\n console.warn('[nylas-selected-event-card] \"selectedDate\" prop is not provided.');\n }\n if (!this.selectedTimeslot) {\n console.warn('[nylas-selected-event-card] \"selectedTimeslot\" prop is not provided.');\n }\n }\n\n @Watch('selectedTimeslot')\n handleSelectedTimeslotChange(selectedTimeslot: Timeslot) {\n this.startTime = new Date(selectedTimeslot?.start_time as Date).toLocaleString(undefined, { timeStyle: 'short' });\n this.endTime = new Date(selectedTimeslot?.end_time as Date).toLocaleString(undefined, { timeStyle: 'short' });\n }\n\n @RegisterComponent<NylasSelectedEventCard, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-selected-event-card',\n stateToProps: new Map([\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host part=\"nsec\">\n <sp-theme theme=\"spectrum\" color=\"dark\" scale=\"medium\">\n <div class=\"event-card\" part=\"nsec__card\">\n <div class=\"calendar-icon\" part=\"nsec__icon\">\n <calendar-icon />\n </div>\n <div class=\"nylas-selected-event-card__date\" part=\"nsec__date\">\n {this.selectedDate?.toLocaleDateString(undefined, { dateStyle: 'full' })}\n </div>\n <div class=\"nylas-selected-event-card__time\" part=\"nsec__time\">\n {this.startTime} - {this.endTime}\n </div>\n </div>\n <div class=\"event-timezone\" part=\"nsec__timezone\">\n <globe-icon></globe-icon>\n {TIMEZONE_MAP[this.selectedTimezone]}\n </div>\n </sp-theme>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@ import { R as RegisterComponent } from './register-component-e92f8a6f.js';
|
|
|
3
3
|
import { a as debug, p as isSameDay } from './utils-ec8dc014.js';
|
|
4
4
|
import './_commonjsHelpers-fc8d6640.js';
|
|
5
5
|
|
|
6
|
-
const nylasTimeslotPickerCss = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .time-slot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:
|
|
6
|
+
const nylasTimeslotPickerCss = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .time-slot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:9px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}";
|
|
7
7
|
|
|
8
8
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
9
9
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,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EAAC,OAAO,EAAE,CAAC,KAAY,KAAK,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAC,qBAAqB,IAC5I,YAAM,IAAI,EAAC,2BAA2B,WAAY,CACxC,CACR,CACP,CACG,CACD,EACP;KACH;;;;;;AAnED;IArBC,iBAAiB,CAA8F;QAC9G,IAAI,EAAE,uBAAuB;QAC7B,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,wBAAwB,EAAE,cAAc,CAAC;YAC1C,CAAC,wBAAwB,EAAE,cAAc,CAAC;YAC1C,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,qBAAqB,EAAE,WAAW,CAAC;SACrC,CAAC;QACF,YAAY,EAAE;YACZ,gBAAgB,EAAE,OAAO,KAA4B,EAAE,uBAAgD;gBACrG,uBAAuB,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;aAC5D;YACD,iBAAiB,EAAE,OAAO,KAA4B,EAAE,uBAAgD;gBACtG,IAAI,KAAK,CAAC,MAAM,EAAE;oBAChB,uBAAuB,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;iBAC9D;aACF;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;iDAoED;;;;;","names":[],"sources":["src/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.scss?tag=nylas-timeslot-picker&encapsulation=shadow","src/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.tsx"],"sourcesContent":[":host {\n display: block;\n height: calc(100% - 48px); //48px is the height of the header\n}\n\n.time-picker-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.time-slots {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n align-items: center;\n overflow-y: scroll;\n padding: 0.5rem 1.5rem;\n flex: 1;\n}\n\n.time {\n /* Frame 12 */\n box-sizing: border-box;\n\n /* Auto layout */\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 4px 12px;\n gap: 0.5rem;\n font-size: 16px;\n font-weight: 500;\n font-family: inherit;\n\n width: 100%;\n height: 48px;\n\n color: var(--nylas-base-800);\n background: var(--nylas-base-0);\n border: none;\n outline: 1.5px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n\n flex: none;\n order: 4;\n align-self: stretch;\n flex-grow: 0;\n\n cursor: pointer;\n\n &:hover,\n &:focus {\n color: var(--nylas-primary);\n outline-color: var(--nylas-primary);\n }\n\n &.selected {\n font-weight: 600;\n color: var(--nylas-primary);\n outline: 2px solid var(--nylas-primary);\n border-color: transparent;\n box-shadow: 0 0 0 2px var(--nylas-primary);\n }\n}\n\n.empty {\n text-align: center;\n padding: 0 1.5rem;\n color: var(--nylas-base-600);\n font-size: min(max(12px, 2vw), 14px);\n height: 450px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n@keyframes pulsate {\n 0% {\n background-color: var(--nylas-base-50);\n }\n 50% {\n background-color: var(--nylas-base-100);\n }\n 100% {\n background-color: var(--nylas-base-50);\n }\n}\n\n.loading {\n padding: 0 1.5rem;\n\n .time-slot-skeleton {\n width: 100%;\n height: 4rem;\n background-color: var(--nylas-base-50);\n margin-bottom: 0.5rem;\n border-radius: var(--nylas-border-radius-2x);\n animation: pulsate 1.5s infinite ease-in-out;\n }\n}\n\n.footer {\n width: 100%;\n padding: 10px;\n box-sizing: border-box;\n border-top: 1px solid var(--nylas-base-200);\n\n sp-button {\n padding: 14px;\n color: var(--nylas-base-100);\n border-radius: var(--nylas-border-radius-2x);\n width: 100%;\n height: 48px;\n font-weight: 600;\n font-size: 16px;\n background-color: var(--nylas-primary);\n border: none;\n &:hover,\n &:focus {\n background-color: var(--nylas-base-600);\n }\n &:active {\n background-color: var(--nylas-base-800);\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { debug, isSameDay } from '@/utils/utils';\nimport { Component, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerConnector } from '../../..';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { AvailabilityTimeslot } from '@/stores/scheduler-store';\nimport type { Timeslot } from '@nylas/core';\n\n/**\n * The `nylas-timeslot-picker` component is a UI component that allows users to select a timeslot from a list of available timeslots.\n *\n * @slot timeslot-picker-cta-label - The label for the timeslot picker CTA. Default is \"Next\".\n * @part ntp - The timeslot picker component.\n * @part ntp__timeslot - The timeslot button.\n * @part ntp__timeslot--selected - The selected timeslot button.\n * @part ntp__button-primary - The timeslot picker CTA.\n */\n@Component({\n tag: 'nylas-timeslot-picker',\n styleUrl: 'nylas-timeslot-picker.scss',\n shadow: true,\n})\nexport class NylasTimeslotPicker {\n /**\n * The selected date.\n */\n @Prop({ attribute: 'selected-date' }) readonly selectedDate?: Date = new Date();\n /**\n * The available timeslots.\n */\n @Prop({ attribute: 'availability' }) readonly availability?: AvailabilityTimeslot[];\n /**\n * The selected timeslot.\n */\n @Prop({ attribute: 'selected-timeslot' }) readonly selectedTimeslot?: Timeslot;\n /**\n * The loading state prop. Used to display loading state when fetching availability.\n */\n @Prop({ attribute: 'loading-state' }) readonly isLoading?: boolean;\n /**\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n /**\n * This event is fired when a timeslot is selected.\n */\n @Event() readonly timeslotSelected!: EventEmitter<Timeslot>;\n /**\n * This event is fired when a timeslot is confirmed. By default, this will proceed to the booking form page.\n */\n @Event() readonly timeslotConfirmed!: EventEmitter<Timeslot>;\n\n @State() times: AvailabilityTimeslot[] = [];\n @State() hoveredTimeslotIndex?: number;\n @State() selectedTimeslotIndex?: string;\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n const availableTimes = this.availability?.filter(timeslot => this.selectedDate && isSameDay(timeslot.start_time, this.selectedDate)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n debug(`[nylas-timeslot-picker] Component will load`, { selectedDate: this.selectedDate, availability: this.availability, times: this.times });\n }\n\n async componentDidLoad() {\n debug(`[nylas-timeslot-picker] Component did load`);\n }\n\n private getTimeslotId(date: Date, index: number) {\n return `${date.toLocaleDateString()}-${index}`;\n }\n\n private onClickSelectTime(timeslot: Timeslot, index: number) {\n debug(`[nylas-timeslot-picker] Time selected`, timeslot, index);\n this.selectedTimeslotIndex = this.getTimeslotId(timeslot.start_time, index);\n this.timeslotSelected.emit({\n start_time: timeslot.start_time,\n end_time: timeslot.end_time,\n });\n }\n\n private handleConfirmedTimeslot = async (event: Event, timeslot: Timeslot | undefined) => {\n event.preventDefault();\n debug(`[nylas-timeslot-picker] Confirm timeslot`, timeslot);\n this.timeslotConfirmed.emit(timeslot);\n };\n\n private handleMouseEnter = (index: number) => {\n this.hoveredTimeslotIndex = index;\n };\n\n private handleMouseLeave = () => {\n this.hoveredTimeslotIndex = -1;\n };\n\n private getTimeSlotLabel(timeslot: Timeslot) {\n const timeFormat = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: 'numeric',\n timeZone: this.selectedTimezone,\n });\n return `${timeFormat.format(timeslot.start_time)} - ${timeFormat.format(timeslot.end_time)}`;\n }\n\n @Watch('selectedDate')\n selectedDateChanged(newVal: Date | null | undefined) {\n debug(`[nylas-timeslot-picker] Selected date changed`, { newVal });\n\n if (newVal) {\n this.selectedTimeslotIndex = '';\n if (typeof newVal !== 'undefined') {\n const availableTimes = this.availability?.filter(timeslot => isSameDay(timeslot.start_time, newVal)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n }\n\n @Watch('availability')\n availabilityChanged(newVal: AvailabilityTimeslot[] | undefined) {\n debug(`[nylas-timeslot-picker] Available times changed`, { newVal, selectedDate: this.selectedDate });\n\n if (typeof newVal !== 'undefined') {\n const availableTimes = newVal?.filter(timeslot => this.selectedDate && isSameDay(timeslot.start_time, this.selectedDate)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n\n @RegisterComponent<NylasTimeslotPicker, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-timeslot-picker',\n stateToProps: new Map([\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.availability', 'availability'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.isLoading', 'isLoading'],\n ]),\n eventToProps: {\n timeslotSelected: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n nylasSchedulerConnector.scheduler.selectTime(event.detail);\n },\n timeslotConfirmed: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n if (event.detail) {\n nylasSchedulerConnector.scheduler.toggleAdditionalData(true);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n if (this.isLoading) {\n return (\n <Host>\n <div class={'loading'}>\n {new Array(6).fill(0).map((_, i) => (\n <div class={'time-slot-skeleton'} style={{ animationDelay: `${i * 20}ms` }} />\n ))}\n </div>\n </Host>\n );\n }\n\n if (this.availability && this.availability.length === 0) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No dates available</span>\n </div>\n </Host>\n );\n }\n\n if ((!this.times || this.times.length === 0) && !!this.selectedDate) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No time slots available for selected date</span>\n </div>\n </Host>\n );\n }\n\n if (!this.selectedDate) return <Host></Host>;\n\n return (\n <Host part=\"ntp\">\n <div class={'time-picker-wrapper'}>\n <div class={'time-slots'}>\n {this.times.map((timeslot, index) => (\n <button\n part={`ntp__timeslot ${this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime() ? 'ntp__timeslot--selected' : ''}`}\n aria-role=\"button\"\n class={{\n time: true,\n selected: typeof this.selectedTimeslot !== 'undefined' && this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime(),\n }}\n onClick={() => this.onClickSelectTime(timeslot, index)}\n onMouseEnter={() => this.handleMouseEnter(index)}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n {this.hoveredTimeslotIndex == index || this.selectedTimeslotIndex == this.getTimeslotId(timeslot.start_time, index)\n ? this.getTimeSlotLabel(timeslot)\n : timeslot.start_time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', timeZone: this.selectedTimezone })}\n </button>\n ))}\n </div>\n {this.selectedTimeslot && (\n <div class={'footer'}>\n <sp-button variant=\"primary\" onClick={(event: Event) => this.handleConfirmedTimeslot(event, this.selectedTimeslot)} part=\"ntp__button-primary\">\n <slot name=\"timeslot-picker-cta-label\">Next</slot>\n </sp-button>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"nylas-timeslot-picker.entry.esm.js","mappings":";;;;;AAAA,MAAM,sBAAsB,GAAG,u5DAAu5D;;;;;;;;;;;;;;;;MCsBz6D,mBAAmB;;;;;QA8DtB,4BAAuB,GAAG,OAAO,KAAY,EAAE,QAA8B;YACnF,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,KAAK,CAAC,0CAA0C,EAAE,QAAQ,CAAC,CAAC;YAC5D,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACvC,CAAC;QAEM,qBAAgB,GAAG,CAAC,KAAa;YACvC,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;SACnC,CAAC;QAEM,qBAAgB,GAAG;YACzB,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC;SAChC,CAAC;4BAtEmE,IAAI,IAAI,EAAE;;;;gCAgBD,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;qBAWrF,EAAE;;;;IAI3C,iBAAiB,MAAK;IAEtB,oBAAoB,MAAK;IAEzB,MAAM,iBAAiB;QACrB,MAAM,cAAc,GAAG,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;oBAChB,uBAAuB,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;iBAC9D;aACF;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;iDAoED;;;;;","names":[],"sources":["src/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.scss?tag=nylas-timeslot-picker&encapsulation=shadow","src/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.tsx"],"sourcesContent":[":host {\n display: block;\n height: calc(100% - 48px); //48px is the height of the header\n}\n\n.time-picker-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.time-slots {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n align-items: center;\n overflow-y: scroll;\n padding: 0.5rem 1.5rem 1.5rem;\n flex: 1;\n}\n\n.time {\n /* Frame 12 */\n box-sizing: border-box;\n\n /* Auto layout */\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 4px 12px;\n gap: 0.5rem;\n font-size: 16px;\n font-weight: 500;\n font-family: inherit;\n\n width: 100%;\n height: 48px;\n\n color: var(--nylas-base-800);\n background: var(--nylas-base-0);\n border: none;\n outline: 1.5px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n\n flex: none;\n order: 4;\n align-self: stretch;\n flex-grow: 0;\n\n cursor: pointer;\n\n &:hover,\n &:focus {\n color: var(--nylas-primary);\n outline-color: var(--nylas-primary);\n }\n\n &.selected {\n font-weight: 600;\n color: var(--nylas-primary);\n outline: 2px solid var(--nylas-primary);\n border-color: transparent;\n box-shadow: 0 0 0 2px var(--nylas-primary);\n }\n}\n\n.empty {\n text-align: center;\n padding: 0 1.5rem;\n color: var(--nylas-base-600);\n font-size: min(max(12px, 2vw), 14px);\n height: 450px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n@keyframes pulsate {\n 0% {\n background-color: var(--nylas-base-50);\n }\n 50% {\n background-color: var(--nylas-base-100);\n }\n 100% {\n background-color: var(--nylas-base-50);\n }\n}\n\n.loading {\n padding: 0 1.5rem;\n\n .time-slot-skeleton {\n width: 100%;\n height: 4rem;\n background-color: var(--nylas-base-50);\n margin-bottom: 0.5rem;\n border-radius: var(--nylas-border-radius-2x);\n animation: pulsate 1.5s infinite ease-in-out;\n }\n}\n\n.footer {\n width: 100%;\n padding: 9px;\n box-sizing: border-box;\n border-top: 1px solid var(--nylas-base-200);\n\n sp-button {\n padding: 14px;\n color: var(--nylas-base-100);\n border-radius: var(--nylas-border-radius-2x);\n width: 100%;\n height: 48px;\n font-weight: 600;\n font-size: 16px;\n background-color: var(--nylas-primary);\n border: none;\n &:hover,\n &:focus {\n background-color: var(--nylas-base-600);\n }\n &:active {\n background-color: var(--nylas-base-800);\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { debug, isSameDay } from '@/utils/utils';\nimport { Component, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerConnector } from '../../..';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { AvailabilityTimeslot } from '@/stores/scheduler-store';\nimport type { Timeslot } from '@nylas/core';\n\n/**\n * The `nylas-timeslot-picker` component is a UI component that allows users to select a timeslot from a list of available timeslots.\n *\n * @slot timeslot-picker-cta-label - The label for the timeslot picker CTA. Default is \"Next\".\n * @part ntp - The timeslot picker component.\n * @part ntp__timeslot - The timeslot button.\n * @part ntp__timeslot--selected - The selected timeslot button.\n * @part ntp__button-primary - The timeslot picker CTA.\n */\n@Component({\n tag: 'nylas-timeslot-picker',\n styleUrl: 'nylas-timeslot-picker.scss',\n shadow: true,\n})\nexport class NylasTimeslotPicker {\n /**\n * The selected date.\n */\n @Prop({ attribute: 'selected-date' }) readonly selectedDate?: Date = new Date();\n /**\n * The available timeslots.\n */\n @Prop({ attribute: 'availability' }) readonly availability?: AvailabilityTimeslot[];\n /**\n * The selected timeslot.\n */\n @Prop({ attribute: 'selected-timeslot' }) readonly selectedTimeslot?: Timeslot;\n /**\n * The loading state prop. Used to display loading state when fetching availability.\n */\n @Prop({ attribute: 'loading-state' }) readonly isLoading?: boolean;\n /**\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n /**\n * This event is fired when a timeslot is selected.\n */\n @Event() readonly timeslotSelected!: EventEmitter<Timeslot>;\n /**\n * This event is fired when a timeslot is confirmed. By default, this will proceed to the booking form page.\n */\n @Event() readonly timeslotConfirmed!: EventEmitter<Timeslot>;\n\n @State() times: AvailabilityTimeslot[] = [];\n @State() hoveredTimeslotIndex?: number;\n @State() selectedTimeslotIndex?: string;\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n const availableTimes = this.availability?.filter(timeslot => this.selectedDate && isSameDay(timeslot.start_time, this.selectedDate)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n debug(`[nylas-timeslot-picker] Component will load`, { selectedDate: this.selectedDate, availability: this.availability, times: this.times });\n }\n\n async componentDidLoad() {\n debug(`[nylas-timeslot-picker] Component did load`);\n }\n\n private getTimeslotId(date: Date, index: number) {\n return `${date.toLocaleDateString()}-${index}`;\n }\n\n private onClickSelectTime(timeslot: Timeslot, index: number) {\n debug(`[nylas-timeslot-picker] Time selected`, timeslot, index);\n this.selectedTimeslotIndex = this.getTimeslotId(timeslot.start_time, index);\n this.timeslotSelected.emit({\n start_time: timeslot.start_time,\n end_time: timeslot.end_time,\n });\n }\n\n private handleConfirmedTimeslot = async (event: Event, timeslot: Timeslot | undefined) => {\n event.preventDefault();\n debug(`[nylas-timeslot-picker] Confirm timeslot`, timeslot);\n this.timeslotConfirmed.emit(timeslot);\n };\n\n private handleMouseEnter = (index: number) => {\n this.hoveredTimeslotIndex = index;\n };\n\n private handleMouseLeave = () => {\n this.hoveredTimeslotIndex = -1;\n };\n\n private getTimeSlotLabel(timeslot: Timeslot) {\n const timeFormat = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: 'numeric',\n timeZone: this.selectedTimezone,\n });\n return `${timeFormat.format(timeslot.start_time)} - ${timeFormat.format(timeslot.end_time)}`;\n }\n\n @Watch('selectedDate')\n selectedDateChanged(newVal: Date | null | undefined) {\n debug(`[nylas-timeslot-picker] Selected date changed`, { newVal });\n\n if (newVal) {\n this.selectedTimeslotIndex = '';\n if (typeof newVal !== 'undefined') {\n const availableTimes = this.availability?.filter(timeslot => isSameDay(timeslot.start_time, newVal)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n }\n\n @Watch('availability')\n availabilityChanged(newVal: AvailabilityTimeslot[] | undefined) {\n debug(`[nylas-timeslot-picker] Available times changed`, { newVal, selectedDate: this.selectedDate });\n\n if (typeof newVal !== 'undefined') {\n const availableTimes = newVal?.filter(timeslot => this.selectedDate && isSameDay(timeslot.start_time, this.selectedDate)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n\n @RegisterComponent<NylasTimeslotPicker, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-timeslot-picker',\n stateToProps: new Map([\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.availability', 'availability'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.isLoading', 'isLoading'],\n ]),\n eventToProps: {\n timeslotSelected: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n nylasSchedulerConnector.scheduler.selectTime(event.detail);\n },\n timeslotConfirmed: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n if (event.detail) {\n nylasSchedulerConnector.scheduler.toggleAdditionalData(true);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n if (this.isLoading) {\n return (\n <Host>\n <div class={'loading'}>\n {new Array(6).fill(0).map((_, i) => (\n <div class={'time-slot-skeleton'} style={{ animationDelay: `${i * 20}ms` }} />\n ))}\n </div>\n </Host>\n );\n }\n\n if (this.availability && this.availability.length === 0) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No dates available</span>\n </div>\n </Host>\n );\n }\n\n if ((!this.times || this.times.length === 0) && !!this.selectedDate) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No time slots available for selected date</span>\n </div>\n </Host>\n );\n }\n\n if (!this.selectedDate) return <Host></Host>;\n\n return (\n <Host part=\"ntp\">\n <div class={'time-picker-wrapper'}>\n <div class={'time-slots'}>\n {this.times.map((timeslot, index) => (\n <button\n part={`ntp__timeslot ${this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime() ? 'ntp__timeslot--selected' : ''}`}\n aria-role=\"button\"\n class={{\n time: true,\n selected: typeof this.selectedTimeslot !== 'undefined' && this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime(),\n }}\n onClick={() => this.onClickSelectTime(timeslot, index)}\n onMouseEnter={() => this.handleMouseEnter(index)}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n {this.hoveredTimeslotIndex == index || this.selectedTimeslotIndex == this.getTimeslotId(timeslot.start_time, index)\n ? this.getTimeSlotLabel(timeslot)\n : timeslot.start_time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', timeZone: this.selectedTimezone })}\n </button>\n ))}\n </div>\n {this.selectedTimeslot && (\n <div class={'footer'}>\n <sp-button variant=\"primary\" onClick={(event: Event) => this.handleConfirmedTimeslot(event, this.selectedTimeslot)} part=\"ntp__button-primary\">\n <slot name=\"timeslot-picker-cta-label\">Next</slot>\n </sp-button>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,H as i,a as h}from"./p-68c2fadf.js";import{N as r,e as n}from"./p-e80eb060.js";import{a as o}from"./p-ed30c891.js";import{N as a,a as c,b as u,c as l,C as d,d as p,H as g}from"./p-e5e37ea4.js";import{N as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as e,H as i,a as h}from"./p-68c2fadf.js";import{N as r,e as n}from"./p-e80eb060.js";import{a as o}from"./p-ed30c891.js";import{N as a,a as c,b as u,c as l,C as d,d as p,H as g}from"./p-e5e37ea4.js";import{N as f,C as m}from"./p-e1dcf5ca.js";import{C as y}from"./p-ee91a2a0.js";import"./p-cb65c223.js";import"./p-cabb2e68.js";class b{constructor(t,s,e,i,h,r,n="https://api.us.nylas.com"){this.router=t;this.schedulerAPIURL=n;this.nylasAuth=s;this.nylasAuthStore=e;this.nylasMailboxStore=i;this.nylasSchedulerStore=h;this.nylasSchedulerConfigStore=r}init(){o("NylasConnector init")}get authStore(){return this.nylasAuthStore}get mailboxStore(){return this.nylasMailboxStore}get schedulerStore(){return this.nylasSchedulerStore}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get auth(){if(this._authConnector){return this._authConnector}this._authConnector=new a(this.nylasAuth,this.nylasAuthStore);return this._authConnector}get threads(){if(this._threadConnector){return this._threadConnector}this._threadConnector=new c(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router);return this._threadConnector}get messages(){if(this._messageConnector){return this._messageConnector}this._messageConnector=new u(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore);return this._messageConnector}get folders(){if(this._foldersConnector){return this._foldersConnector}this._foldersConnector=new l(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore);return this._foldersConnector}get scheduler(){if(this._schedulerAPIConnector){return this._schedulerAPIConnector}this._schedulerAPIConnector=new f({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore});return this._schedulerAPIConnector}getAuth(){return this.nylasAuth}resetStores(){this.nylasAuthStore.reset();this.nylasMailboxStore.reset()}async logout(){await this.nylasAuth.logout();this.resetStores()}}const w=":host{display:contents}";const C=w;const S=class{constructor(e){t(this,e);this.init=s(this,"init",7);this.loggedIn=s(this,"loggedIn",7);this.loggedOut=s(this,"loggedOut",7);this.handleAuthChange=async t=>{if(t){this.loggedIn.emit(this.host)}else{this.loggedOut.emit(this.host)}};this.authConfig=undefined;this.eventOverrides={};this.automaticComponentRegistration=true}connectedCallback(){o("[nylas-provider] connectedCallback")}async componentWillLoad(){o("[nylas-provider] componentWillLoad");this.stores={auth:d(),mailbox:p(),scheduler:m(),schedulerConfig:y()};this.baseProvider=new r(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const t=new g;this.nylasAuth=n({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const s=this.baseProvider?.getStore("mailbox");if(!s){throw new Error("The mailbox store is not set")}const e=this.baseProvider?.getStore("auth");if(!e){throw new Error("The auth store is not set")}const i=this.baseProvider?.getStore("scheduler");if(!i){throw new Error("The scheduler store is not set")}const h=this.baseProvider?.getStore("schedulerConfig");if(!h){throw new Error("The scheduler config store is not set")}this.nylasConnector=new b(t,this.nylasAuth,e,s,i,h);const a=this.init.emit(this.host);if(!a.defaultPrevented){await(this.nylasConnector?.auth.validateSession())}this.handleAuthChange(e.state.isAuthenticated);this.baseProvider?.componentWillLoad(this.nylasConnector)}componentDidLoad(){const t=this.baseProvider?.getStore("auth");t?.onChange("isAuthenticated",this.handleAuthChange);this.baseProvider?.componentDidLoad()}componentDisconnected(){this.baseProvider?.componentDisconnected()}async registerComponentHandler(t){this.baseProvider?.registerComponent(t.detail)}async unregisterComponentHandler(t){this.baseProvider?.unregisterComponent(t.detail)}async getNylasAuth(){return this.nylasAuth}async getNylasConnector(){return this.nylasConnector}async getMailboxStore(){return this.baseProvider?.getStore("mailbox")}async getAuthStore(){return this.baseProvider?.getStore("auth")}async getNylasSchedulerStore(){return this.baseProvider?.getStore("scheduler")}async getNylasSchedulerConfigStore(){return this.baseProvider?.getStore("schedulerConfig")}render(){return e(i,{key:"8680114f7752839d350eb387dd6fbb2651461a33"},e("slot",{key:"2edb639669604995e7e8067901701783a54d7d3a"}))}get host(){return h(this)}};S.style=C;export{S as nylas_provider};
|
|
2
|
+
//# sourceMappingURL=p-3240c0aa.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as e,F as t,r as n,c as i,H as s,a}from"./p-68c2fadf.js";import{N as o,n as r}from"./p-e80eb060.js";import{a as l,i as d,j as c}from"./p-ed30c891.js";import{N as h,C as p,E as g}from"./p-7e7a3c01.js";import"./p-cb65c223.js";import"./p-cabb2e68.js";class f{constructor({schedulerAPIURL:e,nylasSchedulerStore:t,sessionId:n,configId:i}){if(!e){throw new Error("schedulerAPIURL is required")}if(!t){throw new Error("nylasSchedulerStore is required")}if(!n&&!i){throw new Error("sessionId is required for private configs, if not config id is required for public configs")}if(e==="/"){const t=new URL(window.location.href);e=t.origin}this.configId=i;this.sessionId=n;this.schedulerAPIURL=e;this.nylasSchedulerStore=t}init(){l("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){if(this._schedulerAPIConnector){return this._schedulerAPIConnector}this._schedulerAPIConnector=new h({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId});return this._schedulerAPIConnector}resetStores(){this.nylasSchedulerStore.reset()}}const u=(n,i)=>{const s=n.isLoading;const a=n.showNotification;const o=n.nylasBranding;return e(t,null,a&&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&&i,e("div",{class:"footer"},o&&e(t,null,"Powered by ",e("nylas-logo",null))))};const b=(t,n)=>e("div",{class:"message-banner"},n);const m=':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 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;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-top:1rem}.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,.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{background-color:var(--nylas-base-50)}.cancelled-event-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{padding:1rem 20px 0;gap:1rem;height:558px;min-width:384px;border-top-left-radius:inherit;background:var(--nylas-base-0)}@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{padding:0.5rem 4px 0}}.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:558px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.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:496px}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.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;position:absolute}';const y=m;const v={title:"Something went wrong...",type:r.Error,category:g.Component};const x=class{constructor(e){n(this,e);this.init=i(this,"init",7);this.schedulerWillLoad=i(this,"schedulerWillLoad",7);this.schedulerDidLoad=i(this,"schedulerDidLoad",7);this.nylasSchedulerError=i(this,"nylasSchedulerError",7);this.bookingRefExtracted=i(this,"bookingRefExtracted",7);this.mode="app";this.defaultSchedulerState=undefined;this.sessionId=undefined;this.schedulerApiUrl="https://api.us.nylas.com";this.bookingInfo=undefined;this.rescheduleBookingRef=undefined;this.cancelBookingRef=undefined;this.configurationId=undefined;this.nylasBranding=true;this.eventOverrides={};this.isLoading=undefined;this.themeConfig=undefined;this.showNotification=true;this.automaticComponentRegistration=true;this.selectedDateLabel=(new Date).toLocaleDateString(undefined,{dateStyle:"full"})||"No date selected";this.refConfigId=undefined}connectedCallback(){l(`[nylas-scheduler] connectedCallback`)}async componentWillLoad(){l(`[nylas-scheduler] Component will load`);const e=this.schedulerWillLoad.emit(this.host);if(e.defaultPrevented){return}this.stores={scheduler:p({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})};this.baseProvider=new o(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);this.refConfigId=this.configurationId;if(this.rescheduleBookingRef){const[e,t]=d(this.rescheduleBookingRef);this.refConfigId=e;this.stores.scheduler.set("rescheduleBookingId",t);this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.cancelBookingRef){const[e,t]=d(this.cancelBookingRef);this.refConfigId=e;this.stores.scheduler.set("cancelBookingId",t);this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}if(!this.checkIfSessionIdOrConfigIdExists()){return}const t=this.baseProvider?.getStore("scheduler");this.nylasSchedulerConnector=new f({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,nylasSchedulerStore:t});this.init.emit(this.host);this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector);if(this.themeConfig){for(const[e,t]of Object.entries(this.themeConfig)){this.host.style.setProperty(`${e}`,t)}}}async componentDidLoad(){this.baseProvider?.componentDidLoad();if(!this.checkIfSessionIdOrConfigIdExists()){return}const e=await(this.nylasSchedulerConnector?.scheduler.getUISettings());if(!e||"error"in e){this.nylasSchedulerError.emit({...this.getErrorObject(e?.error)})}const t=this.baseProvider?.getStore("scheduler");const n=t?.get("configSettings")?.scheduler?.available_days_in_future;const i=t?.get("selectedTimeslot");if(i&&i?.start_time){if(!this.isTimeslotValid(i)){return}if(t?.get("showBookingForm")){t?.set("selectedDate",i.start_time);return}}const s=t?.get("selectedDate");const a=t?.get("availability");let o;if(a&&a.length>0){return}if(!s){const e=new Date;const{startTime:t,endTime:i,endTimeForAvailableDaysInFuture:s}=this.validateAvailableDaysInFuture(e,n||30);if(e.getTime()<s*1e3){o=await(this.nylasSchedulerConnector?.scheduler.getAvailability(t,i))}}else{const{startTime:e,endTime:t,endTimeForAvailableDaysInFuture:i}=this.validateAvailableDaysInFuture(s,n||30);if(s.getTime()<i*1e3){o=await(this.nylasSchedulerConnector?.scheduler.getAvailability(e,t))}}if(!o||"error"in o){this.nylasSchedulerError.emit({...this.getErrorObject(o?.error)})}if(!s){let e=new Date;const n=t?.get("availability").find((e=>new Date(e.start_time)>new Date));if(n){e=n.start_time}t?.set("selectedDate",e)}}componentDisconnected(){this.baseProvider?.componentDisconnected()}bookingInfoChanged(e){this.stores?.scheduler.set("bookingInfo",e)}rescheduleBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("rescheduleBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}cancelBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("cancelBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(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 n=this.nylasSchedulerConnector?.schedulerStore?.get("configSettings")?.scheduler?.available_days_in_future;const{startTime:i,endTime:s,endTimeForAvailableDaysInFuture:a}=this.validateAvailableDaysInFuture(t,n||30);if(i<a&&t.getTime()<a*1e3){const e=await(this.nylasSchedulerConnector?.scheduler.getAvailability(i,s));if(!e||"error"in e){this.nylasSchedulerError.emit({...this.getErrorObject(e?.error)})}}}async bookButtonClickedHandler(e){const t=this.nylasSchedulerConnector?.schedulerStore?.get("rescheduleBookingId");const n=t;if(n){const t=await(this.nylasSchedulerConnector?.scheduler.rescheduleBooking(n,e.detail));if(!t||"error"in t){this.nylasSchedulerError.emit({...this.getErrorObject(t?.error)})}return}const i=await(this.nylasSchedulerConnector?.scheduler.bookTimeslot(e.detail));if(!i||"error"in i){this.nylasSchedulerError.emit({...this.getErrorObject(i?.error)})}}dateSelectedHandler(e){const t=e.detail;this.selectedDateLabel=t?t.toLocaleDateString(undefined,{dateStyle:"full"}):"No date selected"}cancelBookedEventErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}cancelBookedEventValidationErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}rescheduleBookedEventErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}async getNylasSchedulerStore(){return this.baseProvider?.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(e){return{title:e?.title||v.title,category:e?.category||v.category,type:r.Error,description:e?.message||"",id:(new Date).getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId){this.nylasSchedulerError.emit({title:"No sessionId!",category:g.Component,type:r.Error,description:"Session ID is required",id:(new Date).getTime().toString(),ttl:"none"});return false}return true}isTimeslotValid(e){const t=new Date(e.start_time);if(t<new Date){this.nylasSchedulerError.emit({title:"Invalid tiemslot!",category:g.Component,type:r.Error,description:"The selected timeslot is invalid.",id:(new Date).getTime().toString(),ttl:"none"});return false}return true}validateAvailableDaysInFuture(e,t){const n=new Date;const i=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const s=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const a=Math.floor(c(n,t).getTime()/1e3);const o=Math.min(a,s);return{startTime:i,endTime:o,endTimeForAvailableDaysInFuture:a}}render(){const t=this.mode==="app";const n=this.baseProvider?.getStore("scheduler");const i=n?.get("eventInfo");const a=n?.get("showBookingForm");const o=n?.get("cancelledEventInfo");const r=n?.get("cancelBookingId");const l=n?.get("selectedTimeslot");const d=n?.get("rescheduleBookingId");const c=n?.get("nylasBranding")||this.nylasBranding;if(t&&r&&!o){return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e("nylas-cancel-booking-form",{cancelBookingId:r,exportparts:"ncbf, ncbf__input-textfield, ncbf__button-cta, ncbf__button-outline, ncbf__input-label"}))))}if(t&&o){return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e("nylas-cancelled-event-card",{cancelledEventInfo:o,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))))}if(t&&i){return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"booked-event-page",part:"booked-event-page"},e("nylas-booked-event-card",{selectedTimeslot:l,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))))}if(t&&(!i||!!d)&&!a){const t=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(b,null,"Choose another time slot to reschedule your meeting"),e("div",{class:"select-date-page",part:"select-date-page"},e("div",{class:"left-panel"},e("nylas-date-picker",{exportparts:"ndp, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e("div",{class:"border"}),e("nylas-locale-switch",null)),e("div",{class:"right-panel"},e("h2",null,e("calendar-icon",null),e("span",{id:"selectedDate"},this.selectedDateLabel)),e("nylas-timeslot-picker",{exportparts:"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},t&&e("span",{slot:"timeslot-picker-cta-label"},e("slot",{name:"timeslot-picker-cta-label"})))))))}if(t&&!i&&a){const t=this.host.querySelector('[slot="custom-booking-form"]');return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(b,null,"Choose another time slot to reschedule your meeting"),e("div",{class:"additional-data-page",part:"additional-data-page"},e("div",{class:"left-panel"},e("div",{class:"wrapper"},e("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time"}))),e("div",{class:"right-panel"},e("nylas-booking-form",{exportparts:"nbf, nbf__input-label, nbf__input-textfield, nbf__button-ghost, nbf__button-primary, nbf__button-outline"},t&&e("div",{slot:"custom-booking-form"},e("slot",{name:"custom-booking-form"})))))))}return e(s,null,e("slot",null))}get host(){return a(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"]}}};x.style=y;export{x as nylas_scheduling};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{h as e,F as t,r as n,c as i,H as s,a}from"./p-68c2fadf.js";import{N as o,n as r}from"./p-e80eb060.js";import{a as l,i as d,j as c}from"./p-ed30c891.js";import{N as h,C as p,E as g}from"./p-e1dcf5ca.js";import"./p-cb65c223.js";import"./p-cabb2e68.js";class f{constructor({schedulerAPIURL:e,nylasSchedulerStore:t,sessionId:n,configId:i}){if(!e){throw new Error("schedulerAPIURL is required")}if(!t){throw new Error("nylasSchedulerStore is required")}if(!n&&!i){throw new Error("sessionId is required for private configs, if not config id is required for public configs")}if(e==="/"){const t=new URL(window.location.href);e=t.origin}this.configId=i;this.sessionId=n;this.schedulerAPIURL=e;this.nylasSchedulerStore=t}init(){l("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){if(this._schedulerAPIConnector){return this._schedulerAPIConnector}this._schedulerAPIConnector=new h({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId});return this._schedulerAPIConnector}resetStores(){this.nylasSchedulerStore.reset()}}const u=(n,i)=>{const s=n.isLoading;const a=n.showNotification;const o=n.nylasBranding;return e(t,null,a&&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&&i,e("div",{class:"footer"},o&&e(t,null,"Powered by ",e("nylas-logo",null))))};const b=(t,n)=>e("div",{class:"message-banner"},n);const m=':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 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;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-top:1rem}.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,.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{background-color:var(--nylas-base-50)}.cancelled-event-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{padding:1rem 20px 0;gap:1rem;height:558px;min-width:384px;border-top-left-radius:inherit;background:var(--nylas-base-0)}@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{padding:0.5rem 4px 0}}.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:558px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.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:496px}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.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;position:absolute}';const y=m;const v={title:"Something went wrong...",type:r.Error,category:g.Component};const x=class{constructor(e){n(this,e);this.init=i(this,"init",7);this.schedulerWillLoad=i(this,"schedulerWillLoad",7);this.schedulerDidLoad=i(this,"schedulerDidLoad",7);this.nylasSchedulerError=i(this,"nylasSchedulerError",7);this.bookingRefExtracted=i(this,"bookingRefExtracted",7);this.mode="app";this.defaultSchedulerState=undefined;this.sessionId=undefined;this.schedulerApiUrl="https://api.us.nylas.com";this.bookingInfo=undefined;this.rescheduleBookingRef=undefined;this.cancelBookingRef=undefined;this.configurationId=undefined;this.nylasBranding=true;this.eventOverrides={};this.isLoading=undefined;this.themeConfig=undefined;this.showNotification=true;this.automaticComponentRegistration=true;this.selectedDateLabel=(new Date).toLocaleDateString(undefined,{dateStyle:"full"})||"No date selected";this.refConfigId=undefined}connectedCallback(){l(`[nylas-scheduler] connectedCallback`)}async componentWillLoad(){l(`[nylas-scheduler] Component will load`);const e=this.schedulerWillLoad.emit(this.host);if(e.defaultPrevented){return}this.stores={scheduler:p({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})};this.baseProvider=new o(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);this.refConfigId=this.configurationId;if(this.rescheduleBookingRef){const[e,t]=d(this.rescheduleBookingRef);this.refConfigId=e;this.stores.scheduler.set("rescheduleBookingId",t);this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.cancelBookingRef){const[e,t]=d(this.cancelBookingRef);this.refConfigId=e;this.stores.scheduler.set("cancelBookingId",t);this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}if(!this.checkIfSessionIdOrConfigIdExists()){return}const t=this.baseProvider?.getStore("scheduler");this.nylasSchedulerConnector=new f({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,nylasSchedulerStore:t});this.init.emit(this.host);this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector);if(this.themeConfig){for(const[e,t]of Object.entries(this.themeConfig)){this.host.style.setProperty(`${e}`,t)}}}async componentDidLoad(){this.baseProvider?.componentDidLoad();if(!this.checkIfSessionIdOrConfigIdExists()){return}const e=await(this.nylasSchedulerConnector?.scheduler.getUISettings());if(!e||"error"in e){this.nylasSchedulerError.emit({...this.getErrorObject(e?.error)})}const t=this.baseProvider?.getStore("scheduler");const n=t?.get("configSettings")?.scheduler?.available_days_in_future;const i=t?.get("selectedTimeslot");if(i&&i?.start_time){if(!this.isTimeslotValid(i)){return}if(t?.get("showBookingForm")){t?.set("selectedDate",i.start_time);return}}const s=t?.get("selectedDate");const a=t?.get("availability");let o;if(a&&a.length>0){return}if(!s){const e=new Date;const{startTime:t,endTime:i,endTimeForAvailableDaysInFuture:s}=this.validateAvailableDaysInFuture(e,n||30);if(e.getTime()<s*1e3){o=await(this.nylasSchedulerConnector?.scheduler.getAvailability(t,i))}}else{const{startTime:e,endTime:t,endTimeForAvailableDaysInFuture:i}=this.validateAvailableDaysInFuture(s,n||30);if(s.getTime()<i*1e3){o=await(this.nylasSchedulerConnector?.scheduler.getAvailability(e,t))}}if(!o||"error"in o){this.nylasSchedulerError.emit({...this.getErrorObject(o?.error)})}if(!s){let e=new Date;const n=t?.get("availability").find((e=>new Date(e.start_time)>new Date));if(n){e=n.start_time}t?.set("selectedDate",e)}}componentDisconnected(){this.baseProvider?.componentDisconnected()}bookingInfoChanged(e){this.stores?.scheduler.set("bookingInfo",e)}rescheduleBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("rescheduleBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}cancelBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("cancelBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(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 n=this.nylasSchedulerConnector?.schedulerStore?.get("configSettings")?.scheduler?.available_days_in_future;const{startTime:i,endTime:s,endTimeForAvailableDaysInFuture:a}=this.validateAvailableDaysInFuture(t,n||30);if(i<a&&t.getTime()<a*1e3){const e=await(this.nylasSchedulerConnector?.scheduler.getAvailability(i,s));if(!e||"error"in e){this.nylasSchedulerError.emit({...this.getErrorObject(e?.error)})}}}async bookButtonClickedHandler(e){const t=this.nylasSchedulerConnector?.schedulerStore?.get("rescheduleBookingId");const n=t;if(n){const t=await(this.nylasSchedulerConnector?.scheduler.rescheduleBooking(n,e.detail));if(!t||"error"in t){this.nylasSchedulerError.emit({...this.getErrorObject(t?.error)})}return}const i=await(this.nylasSchedulerConnector?.scheduler.bookTimeslot(e.detail));if(!i||"error"in i){this.nylasSchedulerError.emit({...this.getErrorObject(i?.error)})}}dateSelectedHandler(e){const t=e.detail;this.selectedDateLabel=t?t.toLocaleDateString(undefined,{dateStyle:"full"}):"No date selected"}cancelBookedEventErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}cancelBookedEventValidationErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}rescheduleBookedEventErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}async getNylasSchedulerStore(){return this.baseProvider?.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(e){return{title:e?.title||v.title,category:e?.category||v.category,type:r.Error,description:e?.message||"",id:(new Date).getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId){this.nylasSchedulerError.emit({title:"No sessionId!",category:g.Component,type:r.Error,description:"Session ID is required",id:(new Date).getTime().toString(),ttl:"none"});return false}return true}isTimeslotValid(e){const t=new Date(e.start_time);if(t<new Date){this.nylasSchedulerError.emit({title:"Invalid tiemslot!",category:g.Component,type:r.Error,description:"The selected timeslot is invalid.",id:(new Date).getTime().toString(),ttl:"none"});return false}return true}validateAvailableDaysInFuture(e,t){const n=new Date;const i=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const s=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const a=Math.floor(c(n,t).getTime()/1e3);const o=Math.min(a,s);return{startTime:i,endTime:o,endTimeForAvailableDaysInFuture:a}}render(){const t=this.mode==="app";const n=this.baseProvider?.getStore("scheduler");const i=n?.get("eventInfo");const a=n?.get("showBookingForm");const o=n?.get("cancelledEventInfo");const r=n?.get("cancelBookingId");const l=n?.get("selectedTimeslot");const d=n?.get("rescheduleBookingId");const c=n?.get("nylasBranding")||this.nylasBranding;if(t&&r&&!o){return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e("nylas-cancel-booking-form",{cancelBookingId:r,exportparts:"ncbf, ncbf__input-textfield, ncbf__button-cta, ncbf__button-outline, ncbf__input-label"}))))}if(t&&o){return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e("nylas-cancelled-event-card",{cancelledEventInfo:o,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))))}if(t&&i){return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"booked-event-page",part:"booked-event-page"},e("nylas-booked-event-card",{selectedTimeslot:l,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))))}if(t&&(!i||!!d)&&!a){const t=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(b,null,"Choose another time slot to reschedule your meeting"),e("div",{class:"select-date-page",part:"select-date-page"},e("div",{class:"left-panel"},e("nylas-date-picker",{exportparts:"ndp, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e("div",{class:"border"}),e("nylas-locale-switch",null)),e("div",{class:"right-panel"},e("h2",null,e("calendar-icon",null),e("span",{id:"selectedDate"},this.selectedDateLabel)),e("nylas-timeslot-picker",{exportparts:"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},t&&e("span",{slot:"timeslot-picker-cta-label"},e("slot",{name:"timeslot-picker-cta-label"})))))))}if(t&&!i&&a){const t=this.host.querySelector('[slot="custom-booking-form"]');return e(s,null,e(u,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(b,null,"Choose another time slot to reschedule your meeting"),e("div",{class:"additional-data-page",part:"additional-data-page"},e("div",{class:"left-panel"},e("div",{class:"wrapper"},e("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time"}))),e("div",{class:"right-panel"},e("nylas-booking-form",{exportparts:"nbf, nbf__input-label, nbf__input-textfield, nbf__button-ghost, nbf__button-primary, nbf__button-outline"},t&&e("div",{slot:"custom-booking-form"},e("slot",{name:"custom-booking-form"})))))))}return e(s,null,e("slot",null))}get host(){return a(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"]}}};x.style=y;export{x as nylas_scheduling};
|
|
2
|
+
//# sourceMappingURL=p-cab5c048.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as a,h as t,H as n,a as s,F as i}from"./p-68c2fadf.js";import{R as r}from"./p-c72d20a4.js";import{s as o,a as l,v as c,w as d,j as f,x as b,y as p,z as y}from"./p-ed30c891.js";import{T as h,g as u,L as m}from"./p-49f716ed.js";import{s as g}from"./p-937340a0.js";import"./p-cb65c223.js";import"./p-1ffbe196.js";const v=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}';const k=v;var x=undefined&&undefined.__decorate||function(e,a,t,n){var s=arguments.length,i=s<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,t):n,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,a,t,n);else for(var o=e.length-1;o>=0;o--)if(r=e[o])i=(s<3?r(i):s>3?r(a,t,i):r(a,t))||i;return s>3&&i&&Object.defineProperty(a,t,i),i};var w=undefined&&undefined.__metadata||function(e,a){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,a)};const C=class{constructor(t){e(this,t);this.cancelBookingButtonClicked=a(this,"cancelBookingButtonClicked",7);this.rescheduleButtonClicked=a(this,"rescheduleButtonClicked",7);this.rescheduleBookedEventError=a(this,"rescheduleBookedEventError",7);this.cancelBookedEventValidationError=a(this,"cancelBookedEventValidationError",7);this.handleCancelBookingButtonClicked=()=>{const e=new Date;const a=this.configSettings?.scheduler.min_cancellation_notice;const t=o(e,a);if(e.getTime()<t.getTime()){this.cancelBookedEventValidationError.emit({error:{title:"Cancellation Error",message:`You cannot cancel the booking within ${a} minutes of the event.`}})}else{this.cancelBookingButtonClicked.emit({bookingId:this.eventInfo.booking_id})}};this.handleRescheduleButtonClicked=()=>{const e=e=>{this.rescheduleBookedEventError.emit(e)};this.rescheduleButtonClicked.emit({bookingId:this.eventInfo.booking_id,errorHandler:e})};this.getOrganizer=e=>{const a=e?.organizer;return a};this.getPaticipantType=e=>{switch(e){case"host":return"Host";case"you":return"You";default:return""}};this.eventInfo=undefined;this.rescheduleBookingId=undefined;this.bookingInfo=undefined;this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone;this.selectedTimeslot=undefined;this.configSettings=undefined}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){l(`[nylas-booked-event-card] Component will load`)}async componentDidLoad(){l(`[nylas-booked-event-card] Component did load`);if(!this.eventInfo){console.warn('[nylas-booked-event-card] "eventInfo" prop missing. Please provide the event info to display the event details in the booked event card component.')}if(!this.bookingInfo){console.warn('[nylas-booked-event-card] "bookingInfo" prop missing. Please provide the booking info to display the guest details in the booked event card component.')}}render(){return t(n,{key:"67dd2b25ed9f6e97043f3df7b939c5e23e465109",part:"nbec"},t("sp-theme",{key:"52e55db58f82c3e4b11da76f4d595395512ea9d7",theme:"spectrum",color:"dark",scale:"medium"},t("div",{key:"197889d870b6c052e6444984bff0f3fe35644bc7",class:"booked-event-timezone"},t("globe-icon",{key:"95132cf92e263162a745ab54f8df090d7a65c53f"}),h[this.selectedTimezone]),t("div",{key:"c6a057ddcbffd3cdf2a2b898cf0e071adaa8fc8a",class:"event-card-wrapper",part:"nbec__card"},t("div",{key:"3a2dc83f4a3f79e2cd46576037026074ffc75ca7",class:"calendar-icon"},t("calendar-check-icon",{key:"dedeccea4e24d5cf61bd19669f819921422ee9b5"})),t("div",{key:"41cf9cd787f85d85a53add470562a146e65b2405",class:"booked-event-header"},t("h2",{key:"7457dedb9bc4cfa1a04f8edb2e0b42dcfb71024f",slot:"card-title",part:"nbec__title"},"Booking ",!!this.rescheduleBookingId?"rescheduled":"confirmed","!"),t("div",{key:"03b987813744b2b625f089d4217c9bc7820d0a7c",part:"nbec__description"},this.getOrganizer(this.eventInfo)?.name||this.getOrganizer(this.eventInfo)?.email," & ",this.bookingInfo?.primaryParticipant?.name||this.bookingInfo?.primaryParticipant?.email)),t("sp-divider",{key:"5f12482df20b09a77df16c2b4945439b90364655"}),t("div",{key:"efa52924c2d866be7eecd216ef9be381228671b7",class:"booking-date-time"},t("checkmark-circle-icon",{key:"a24ebafa19530d7be9e86bfe5a30bc059708b7c7"}),t("h3",{key:"835150638c5cc9328a067e60328bf1e8cb28dd1b"},"Booking date and time"),t("p",{key:"ab0897c947c57c847836ddd6f04ce922cc216c77"},new Date(this.selectedTimeslot?.start_time).toLocaleDateString(undefined,{dateStyle:"full"})," ",t("br",{key:"47a610f350fefe6554af54b567bfd5b79dd08f20"}),new Date(this.selectedTimeslot?.start_time).toLocaleTimeString(undefined,{timeStyle:"short"})," -"," ",new Date(this.selectedTimeslot?.end_time).toLocaleTimeString(undefined,{timeStyle:"short"}))),t("div",{key:"0db95adfa64e57bcc5e7c216e85c1479f0b6e4de",class:"booking-participants"}),t("sp-divider",{key:"68ee8a7fd3f4ff6c31dee82d7b8b1e4f0d75a889"}),t("div",{key:"efe3bb06d1a26c36ab75807ed7d24a3098e0015f",class:"footer"},t("sp-button",{key:"31a69af4569c122200cc52866ceac17f49b781df",variant:"secondary",treatment:"outline",class:"cancel",onClick:this.handleCancelBookingButtonClicked,part:"nbec__button-outline nbec__cancel-cta"},"Cancel booking"),t("sp-button",{key:"393c0f23c68e5e24c5190df328867fba4a05abc9",variant:"secondary",treatment:"outline",class:"reschedule",onClick:this.handleRescheduleButtonClicked,part:"nbec__button-outline nbec__reschedule-cta"},"Reschedule")))))}};x([r({name:"nylas-booked-event-card",stateToProps:new Map([["scheduler.bookingInfo","bookingInfo"],["scheduler.rescheduleBookingId","rescheduleBookingId"],["scheduler.selectedTimezone","selectedTimezone"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.configSettings","configSettings"]]),eventToProps:{cancelBookingButtonClicked:async(e,a)=>{a.scheduler.setCancel(e.detail.bookingId)},rescheduleButtonClicked:async(e,a)=>{const t=await a.scheduler.setReschedule(e.detail.bookingId);const{errorHandler:n}=e.detail;if(n&&(!t||"error"in t)){n(t)}}},fireRegisterEvent:true}),w("design:type",Function),w("design:paramtypes",[]),w("design:returntype",void 0)],C.prototype,"render",null);C.style=k;const _=':host{display:block;height:100%;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{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%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}';const z=_;var j=undefined&&undefined.__decorate||function(e,a,t,n){var s=arguments.length,i=s<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,t):n,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,a,t,n);else for(var o=e.length-1;o>=0;o--)if(r=e[o])i=(s<3?r(i):s>3?r(a,t,i):r(a,t))||i;return s>3&&i&&Object.defineProperty(a,t,i),i};var R=undefined&&undefined.__metadata||function(e,a){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,a)};const L=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;const D=class{constructor(t){e(this,t);this.nameChanged=a(this,"nameChanged",7);this.emailChanged=a(this,"emailChanged",7);this.backButtonClicked=a(this,"backButtonClicked",7);this.detailsConfirmed=a(this,"detailsConfirmed",7);this.bookingFormError=a(this,"bookingFormError",7);this.handleGuestChange=(e,a)=>{this.resetGuestEmailError(e);const t=[...this.guestEmails];t[e]=g(a);this.guestEmails=[...t]};this.handleGuestBlur=(e,a)=>{this.resetGuestEmailError(e);if(a===""){this.guestEmailErrors[e]="Email is required";return}if(!L.test(a)){this.guestEmailErrors[e]="Enter a valid email address";return}this.handleGuestChange(e,a)};this.addGuestButtonClickedHandler=()=>{this.guestEmails=[...this.guestEmails,""]};this.removeGuestButtonClickHandler=(e,a)=>{e.preventDefault();this.resetGuestEmailError(a);const t=[...this.guestEmails];t.splice(a,1);this.guestEmails=[...t]};this.handleBackButtonClicked=()=>{this.backButtonClicked.emit()};this.bookButtonClickedHandler=async e=>{e.preventDefault();l("nylas-booking-form","bookButtonClickedHandler",this.bookingInfo);const a=this.name||this.bookingInfo?.primaryParticipant?.name;const t=this.email||this.bookingInfo?.primaryParticipant?.email;if(!a||a===""){this.isNameValid=false;this.validationError.name="Name is required";this.bookingFormError.emit({title:"Booking form error",description:"Name is required"});return}if(!t||t===""){this.isEmailValid=false;this.validationError.email="Email is required";this.bookingFormError.emit({title:"Booking form error",description:"Email is required"});return}if(!L.test(t)){this.isEmailValid=false;this.validationError.email="Enter a valid email address";this.bookingFormError.emit({title:"Booking form error",description:"Invalid email"});return}let n=[];if(this.guestEmails.length>0){let e=false;this.guestEmails.forEach(((a,t)=>{if(a===""){e=true;this.guestEmailErrors={...this.guestEmailErrors,[t]:"Email is required"}}else if(!L.test(a)){e=true;this.guestEmailErrors={...this.guestEmailErrors,[t]:"Enter a valid email address"}}}));if(e){this.bookingFormError.emit({title:"Booking form error",description:"Invalid guest email"});return}n=this.guestEmails.map((e=>({name:"",email:e.trim()})))}else if(this.bookingInfo?.guests){n=this.bookingInfo?.guests}this.detailsConfirmed.emit({primaryParticipant:{name:a,email:t},guests:n,additionalFields:{...this.bookingInfo?.additionalFields}})};this.isLoading=undefined;this.bookingInfo=undefined;this.eventInfo=undefined;this.name="";this.email="";this.guestEmails=[];this.guestEmailErrors={};this.isNameValid=true;this.isEmailValid=true;this.validationError={name:"",email:""}}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){l("nylas-booking-form","componentWillLoad",this.bookingInfo);if(this.bookingInfo){this.name=this.bookingInfo.primaryParticipant?.name;this.email=this.bookingInfo.primaryParticipant?.email}}bookingInfoChangedHandler(e){if(e&&e.primaryParticipant){this.name=e.primaryParticipant.name;this.email=e.primaryParticipant.email}}changeName(e){this.isNameValid=true;this.validationError.name="";this.name=g(e);this.nameChanged.emit(e)}changeEmail(e){this.isEmailValid=true;this.validationError.email="";this.email=g(e);this.emailChanged.emit(e)}resetGuestEmailError(e){const a={...this.guestEmailErrors};delete a[e];this.guestEmailErrors={...a}}render(){return t(n,{key:"bee0a966f819effdeabadaa8cc1229f5ee4c7060"},t("form",{key:"d90b5a39e6f3ce8474f0d2f27cd1c9a3ce8aefe2",onSubmit:e=>this.bookButtonClickedHandler(e),noValidate:true},t("div",{key:"8ff0260d32955371dcb45d27838ca1d02547f146",class:"nylas-booking-form"},t("slot",{key:"e1015293cc5196a6b3f8d8198abb965b2fff77ce",name:"custom-booking-form"},t("div",{key:"a5d52a3f967170cfac3c4d2dedb481d1b838d1c6",class:"input-wrapper"},t("label",{key:"a67a697fe8308055735e766ca5bfcc9d78f6e44e",htmlFor:"name",class:{"input-label":true,error:!this.isNameValid},part:"nbf__input-label"},"Name ",t("span",{key:"e2b5ba9820903f7e7dbe859c17ae72b10e90d6ab",class:"required"},"*")),t("input",{key:"4b60f641975188748f5993e289680062afea8040",id:"name",type:"text",placeholder:"Enter your name",value:this.name,class:{input:true,error:!this.isNameValid},maxLength:100,part:"nbf__input-textfield",onInput:e=>this.changeName(e.target?.value)}),t("p",{key:"267dc5714e20d262c83bea6537b7285c36c147f1",class:"help-text"},this.validationError.name)),t("div",{key:"3577781aebed1a45766636e3d5e0975d0f19fbb1",class:"input-wrapper"},t("label",{key:"a7ea061ca58e73b716398818e6f9dedc5be6ccef",htmlFor:"email",class:{"input-label":true,error:!this.isEmailValid},part:"nbf__input-label"},"Email ",t("span",{key:"bc47e307dadb4871ea49f3860caea3e3399a746c",class:"required"},"*")),t("input",{key:"be165163609b1076570229ce82e441be46ca6280",id:"email",type:"email",placeholder:"Enter your email",value:this.email,maxLength:100,class:{input:true,error:!this.isEmailValid},part:"nbf__input-textfield",onInput:e=>this.changeEmail(e.target?.value)}),t("p",{key:"99abcc70e33efa30b4e16283049a79148b0ec507",class:"help-text"},this.validationError.email)))),t("div",{key:"ac458a426a8262f22868ec8fa4a9fb7326b2a7c7",class:"cta"},t("sp-button",{key:"8306f88e73ba2c3162662a3e77153730f2a5f039",treatment:"outline",variant:"secondary",class:"back",part:"nbf__button-outline",onClick:this.handleBackButtonClicked},t("slot",{key:"18238d444c45a2ce872cbecdbea6e2a6d12bf79c",name:"booking-form-back-label"},"Back")),t("sp-button",{key:"837886ad7f762c978af174fcfa4e2b78a0920960",variant:"primary",class:"book",part:"nbf__button-primary",type:"submit"},this.isLoading&&t("loading-icon",{slot:"icon"}),t("slot",{key:"57a0a6ce4784a2969a0f8e89980ac146ab0a2e3a",name:"booking-form-book-label"},"Book now")))))}get host(){return s(this)}static get watchers(){return{bookingInfo:["bookingInfoChangedHandler"]}}};j([r({name:"nylas-booking-form",stateToProps:new Map([["scheduler.isLoading","isLoading"],["scheduler.bookingInfo","bookingInfo"],["scheduler.eventInfo","eventInfo"]]),eventToProps:{backButtonClicked:async(e,a)=>{a.scheduler.toggleAdditionalData(false)},nameChanged:async(e,a)=>{a.scheduler.setParticipantName(e.detail)},emailChanged:async(e,a)=>{a.scheduler.setParticipantEmail(e.detail)}},fireRegisterEvent:true}),R("design:type",Function),R("design:paramtypes",[]),R("design:returntype",void 0)],D.prototype,"render",null);D.style=z;const T=':host{display:block;width:400px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}';const E=T;var I=undefined&&undefined.__decorate||function(e,a,t,n){var s=arguments.length,i=s<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,t):n,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,a,t,n);else for(var o=e.length-1;o>=0;o--)if(r=e[o])i=(s<3?r(i):s>3?r(a,t,i):r(a,t))||i;return s>3&&i&&Object.defineProperty(a,t,i),i};var S=undefined&&undefined.__metadata||function(e,a){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,a)};const B=class{constructor(t){e(this,t);this.goBackButtonClicked=a(this,"goBackButtonClicked",7);this.cancelBookingFormSubmitted=a(this,"cancelBookingFormSubmitted",7);this.cancelBookedEventError=a(this,"cancelBookedEventError",7);this.cancelBookingFormError=a(this,"cancelBookingFormError",7);this.handleGoBackClicked=()=>{this.goBackButtonClicked.emit()};this.handleSubmitCancelBooking=e=>{e.preventDefault();if(!this.cancellationReason){this.cancellationError="Please provide a reason for cancellation.";this.cancelBookingFormError.emit({title:"Cancel booking form error",description:"Please provide a reason for cancellation."});return}l(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);const a=e=>{this.cancelBookedEventError.emit(e)};this.cancelBookingFormSubmitted.emit({bookingId:this.cancelBookingId,reason:this.cancellationReason,errorHandler:a})};this.handleOnChangeCancellationReason=e=>{this.cancellationError="";this.cancellationReason=e.target.value};this.cancelBookingId=undefined;this.cancellationReason="";this.cancellationError=""}connectedCallback(){l(`[nylas-cancel-booking-form] Component connected`)}async componentWillLoad(){l(`[nylas-cancel-booking-form] Component will load`)}async componentDidLoad(){l(`[nylas-cancel-booking-form] Component did load`);if(!this.cancelBookingId){console.warn(`[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.`)}}disconnectedCallback(){l(`[nylas-cancel-booking-form] Component disconnected`)}render(){return t(n,{key:"1adb9feda638c4d8d8a1d8393a7cf9a91b8bc670",part:"ncec"},t("sp-theme",{key:"dda572233ab6b2816594ca6f7cd2ea2199a34394",theme:"spectrum",scale:"medium"},t("div",{key:"2e54734b0763bc127a7b8e2acaba77cb91e6217c",class:"nylas-cancel-booking-form",part:"ncec__card"},t("div",{key:"79300b5640e3f6e1602cbdc26c598e3aab403721",class:"nylas-cancel-booking-form__calendar-icon",part:"ncec__icon"},t("calendar-cancel-icon",{key:"1e57e7c3d0154929da6c318215f99349696a0f42"})),t("h3",{key:"7df6fe8acbe6cfa030305555fed0307d0b3c7150",class:"nylas-cancel-booking-form__title",part:"ncec__title"},"Cancel booking?"),t("div",{key:"80a3b525b440d81470bd9279a9e81da53db5823d",class:"nylas-cancel-booking-form__description",part:"ncec__description"},"Your current timeslot will become available to others."),t("form",{key:"a0bd33531db46816774c1cf5802e5b0a03046436",onSubmit:this.handleSubmitCancelBooking},t("sp-field-label",{key:"2d4896e6c61f464a5914a6c854075542aeeb637e",for:"cancel-reason",class:this.cancellationError?"error":""},"Reason for cancellation ",t("span",{key:"c867adf9311edef27d535e525faf7e776d7edb1f",class:"required"},"*")),t("sp-textfield",{key:"96d9a97dced583946423e07f561964fd6e5a1f85",id:"cancel-reason",class:this.cancellationError?"error":"",part:"ncec__reason-textarea",multiline:true,value:this.cancellationReason,onInput:this.handleOnChangeCancellationReason,onFocus:this.handleOnChangeCancellationReason,invalid:!!this.cancellationError},t("sp-help-text",{key:"771bc7ae47ba5635d5707e5840bf4ebb13cdd60c",slot:"negative-help-text"},this.cancellationError)),t("sp-button",{key:"07bc558de2f6464c043ff86af24da036c0848f96",variant:"primary",class:"cancel",type:"submit",part:"ncec__button-cta"},"Cancel booking"),t("sp-button",{key:"f33976367a2e023a442b9477ad0cbc9d4e520055",variant:"secondary",class:"back",treatment:"outline",part:"ncec__button-outline",onClick:this.handleGoBackClicked},"Go back")))))}};I([r({name:"nylas-cancel-booking-form",eventToProps:{cancelBookingFormSubmitted:async(e,a)=>{const t=await a.scheduler.cancelBooking(e.detail.bookingId,e.detail.reason);const{errorHandler:n}=e.detail;if(n&&(!t||"error"in t)){n(t)}}},fireRegisterEvent:true}),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",void 0)],B.prototype,"render",null);B.style=E;const M=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}';const H=M;var O=undefined&&undefined.__decorate||function(e,a,t,n){var s=arguments.length,i=s<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,t):n,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,a,t,n);else for(var o=e.length-1;o>=0;o--)if(r=e[o])i=(s<3?r(i):s>3?r(a,t,i):r(a,t))||i;return s>3&&i&&Object.defineProperty(a,t,i),i};var V=undefined&&undefined.__metadata||function(e,a){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,a)};const P=class{constructor(t){e(this,t);this.closeCancelEventCardClicked=a(this,"closeCancelEventCardClicked",7);this.cancelledEventCardError=a(this,"cancelledEventCardError",7);this.handleCloseClicked=()=>{this.isClosing=true;const e=e=>{this.cancelledEventCardError.emit(e);this.isClosing=false};this.closeCancelEventCardClicked.emit({errorHandler:e})};this.cancelledEventInfo=undefined;this.isClosing=false;this.configSettings=undefined}connectedCallback(){l(`[nylas-cancelled-event-card] Component connected`)}async componentWillLoad(){l(`[nylas-cancelled-event-card] Component will load`)}async componentDidLoad(){l(`[nylas-cancelled-event-card] Component did load`);if(!this.cancelledEventInfo){console.warn(`[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.`)}}disconnectedCallback(){l(`[nylas-cancelled-event-card] Component disconnected`)}render(){return t(n,{key:"570e95a1df3f30fdc6bd8e2cd4c38bfa0a7a6f88",part:"ncec"},t("sp-theme",{key:"bb6095bec7b1880219f62e80b7437efa4551a56f",theme:"spectrum",color:"dark",scale:"medium"},t("div",{key:"928ca293a610a8a49c5426e50c66ff0e67beb039",class:"nylas-cancelled-event-card",part:"ncec__card"},t("div",{key:"634f6af4c75cac6ae19b3992c0eb250faccfeb3b",class:"nylas-cancelled-event-card__calendar-icon",part:"ncec__icon"},t("calendar-cancel-icon",{key:"a57e39e3ffe08fb07856a9f9b840ec41242cd183"})),t("h3",{key:"21a2122ff49af730735ee612c4a0e64076a65d94",class:"nylas-cancelled-event-card__title",part:"ncec__title"},"Your booking has been cancelled successfully!"),t("div",{key:"517c4657f8f19466622c3992077bb245333e2452",class:"nylas-cancelled-event-card__description",part:"ncec__description"},"A cancellation email has been sent to ",this.configSettings?.organizer?.name||"the participants","."),t("div",{key:"8cbd77f9dc6b13c383b367ccc9576c3f1c2fc57b",class:"nylas-cancelled-event-card__cta"},t("sp-button",{key:"b9a1d5cb47fff9eb6688ab57b6acc701a4e4f1b1",variant:"secondary",treatment:"outline",disabled:this.isClosing,part:"ncec__button-outline",onClick:this.handleCloseClicked},this.isClosing?"Closing...":"Close")))))}};O([r({name:"nylas-cancelled-event-card",stateToProps:new Map([["scheduler.configSettings","configSettings"]]),eventToProps:{closeCancelEventCardClicked:async(e,a)=>{const t=await a.scheduler.resetCancel();const{errorHandler:n}=e.detail;if(n&&(!t||"error"in t)){n(t)}}},fireRegisterEvent:true}),V("design:type",Function),V("design:paramtypes",[]),V("design:returntype",void 0)],P.prototype,"render",null);P.style=H;const $=new Date,F=new Date;function Z(e,a,t,n){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}s.floor=a=>(e(a=new Date(+a)),a);s.ceil=t=>(e(t=new Date(t-1)),a(t,1),e(t),t);s.round=e=>{const a=s(e),t=s.ceil(e);return e-a<t-e?a:t};s.offset=(e,t)=>(a(e=new Date(+e),t==null?1:Math.floor(t)),e);s.range=(t,n,i)=>{const r=[];t=s.ceil(t);i=i==null?1:Math.floor(i);if(!(t<n)||!(i>0))return r;let o;do{r.push(o=new Date(+t)),a(t,i),e(t)}while(o<t&&t<n);return r};s.filter=t=>Z((a=>{if(a>=a)while(e(a),!t(a))a.setTime(a-1)}),((e,n)=>{if(e>=e){if(n<0)while(++n<=0){while(a(e,-1),!t(e)){}}else while(--n>=0){while(a(e,+1),!t(e)){}}}}));if(t){s.count=(a,n)=>{$.setTime(+a),F.setTime(+n);e($),e(F);return Math.floor(t($,F))};s.every=e=>{e=Math.floor(e);return!isFinite(e)||!(e>0)?null:!(e>1)?s:s.filter(n?a=>n(a)%e===0:a=>s.count(0,a)%e===0)}}return s}const q=1e3;const N=q*60;const W=N*60;const A=W*24;const X=Z((e=>e.setHours(0,0,0,0)),((e,a)=>e.setDate(e.getDate()+a)),((e,a)=>(a-e-(a.getTimezoneOffset()-e.getTimezoneOffset())*N)/A),(e=>e.getDate()-1));Z((e=>{e.setUTCHours(0,0,0,0)}),((e,a)=>{e.setUTCDate(e.getUTCDate()+a)}),((e,a)=>(a-e)/A),(e=>e.getUTCDate()-1));Z((e=>{e.setUTCHours(0,0,0,0)}),((e,a)=>{e.setUTCDate(e.getUTCDate()+a)}),((e,a)=>(a-e)/A),(e=>Math.floor(e/A)));const U=':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family)}.title h1{margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}';const Y=U;var G=undefined&&undefined.__decorate||function(e,a,t,n){var s=arguments.length,i=s<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,t):n,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,a,t,n);else for(var o=e.length-1;o>=0;o--)if(r=e[o])i=(s<3?r(i):s>3?r(a,t,i):r(a,t))||i;return s>3&&i&&Object.defineProperty(a,t,i),i};var J=undefined&&undefined.__metadata||function(e,a){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,a)};const K=class{constructor(t){e(this,t);this.dateSelected=a(this,"dateSelected",7);this.monthChanged=a(this,"monthChanged",7);this.selectableDates=undefined;this.selectedDate=undefined;this.configSettings=undefined;this.isLoading=undefined;this.eventDuration=undefined;this.month=this.selectedDate||new Date;this.dates=this.getDates();this.disableNextMonthButton=false}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}getDates(){const e=c(this.month);const a=d(this.month);return X.range(X.offset(a,-a.getDay()),X.offset(e,7-e.getDay()))}selectDate(e){this.dateSelected.emit(e)}changeMonth(e){this.month=new Date(this.month.getFullYear(),this.month.getMonth()+e,1);const a=new Date(this.month.getFullYear(),this.month.getMonth()+1,1);const t=this.configSettings?.scheduler?.available_days_in_future;const n=f(new Date,t);if(n.getTime()<a.getTime()){this.disableNextMonthButton=true}else{this.disableNextMonthButton=false}this.dates=this.getDates();this.monthChanged.emit(this.month);this.selectDate()}isSelected(e,a,t){return e&&a&&b(e,a)&&t&&t?.length>0}isDisabled(e,a){return e&&a?.find((a=>b(a,e)))===undefined}render(){return t(n,{key:"a015e0a944f8f149be1c4e2f11a457e2eaa835f4",part:"ndp"},t("div",{key:"0e9b0e42d8c194bc099b108834b0718e49fe87a1",class:"nylas-date-picker"},t("div",{key:"48858da247f5148c48be7c0e4cb612c827c2c573",class:"title",part:"'ndp__title"},t("h1",{key:"da2651fd1b32579b6f94134096e0bb24372fe335"},t("person-icon",{key:"02e38c19d8aa489c060339a8cf431f7106bdee4c"}),this.configSettings?.organizer?.name||this.configSettings?.organizer.email),t("p",{key:"b6beb5d95ce832acd3969dd5b8dedf55c4910455"},t("clock-icon",{key:"b5eb3534daee467c482b4d9b696c3fedb4e1ac38"}),this.eventDuration?p(this.eventDuration):`- minutes`)),t("div",{key:"cd593ff88f3958671955c0a87071f3fbaa254820",class:"header flex-row"},t("h2",{key:"8b11d5e5a2fbecb1b41fd2ad018a35d949cb2170",part:"ndp__month-header"},t("strong",{key:"f9781cdf0f7e66ff6b40629e6316f73c195b5254"},this.month.toLocaleDateString(undefined,{month:"long"}))," ",this.month.toLocaleDateString(undefined,{year:"numeric"})),t("div",{key:"a04be08256c1b8cd90d4bd7f51a41cb2741ad18b",class:"pagination"},t("button",{key:"fdec6bb568e8e857f7a8dd68f00f751d6db78cf4",onClick:()=>this.changeMonth(-1),class:{"chevron-left":true,button:true},disabled:!this.selectableDates?.length||this.month<=new Date,part:"ndp__month-button"},t("chevron-icon",{key:"530a0bdb932ec987731721b26976c559eb939f1a"})),t("button",{key:"af35238a1b2fd324af994c758d4ad85ab1a479b7",onClick:()=>this.changeMonth(1),class:{"chevron-right":true,button:true},disabled:!this.selectableDates?.length||this.disableNextMonthButton,part:"ndp__month-button"},t("chevron-icon",{key:"a27412828bcb40a204c1f7cb6ecbf35af53f8257"})))),t("div",{key:"b92c36bd25605f4a0149e9a6fb81c697b2180a43",class:"dates"},["SUN","MON","TUE","WED","THU","FRI","SAT"].map((e=>t("div",{class:"day",part:"ndp__day"},e))),this.dates.map(((e,a)=>{const n=this.isDisabled(e,this.selectableDates);if(this.isLoading){return t("button",{disabled:true,class:{"date day-skeleton":true,"current-month":y(e,this.month)},style:{animationDelay:`${a*20}ms`},part:"ndp__date"},e.getDate())}return t("button",{class:{date:true,selected:!!(this.selectedDate&&b(e,this.selectedDate)&&this.selectableDates&&this.selectableDates?.length>0),"current-day":b(e,new Date),"current-month":y(e,this.month)},"aria-lang":e.toLocaleDateString(undefined,{dateStyle:"full"}),disabled:n,onClick:()=>this.selectDate(e),part:`ndp__date ${this.isSelected(e,this.selectedDate,this.selectableDates)?"ndp__date--selected":""} ${b(e,new Date)?"ndp__date--current-day":""} ${y(e,this.month)?"ndp__date--current-month":""}`},e.getDate())})))))}};G([r({name:"nylas-date-picker",stateToProps:new Map([["scheduler.selectableDates","selectableDates"],["scheduler.selectedDate","selectedDate"],["scheduler.isLoading","isLoading"],["scheduler.configSettings","configSettings"],["scheduler.eventDuration","eventDuration"]]),eventToProps:{dateSelected:async(e,a)=>{a.scheduler.selectDate(e.detail)}},fireRegisterEvent:true}),J("design:type",Function),J("design:paramtypes",[]),J("design:returntype",void 0)],K.prototype,"render",null);K.style=Y;const Q=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:68px;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown::part(sd_dropdown-content){width:100%}';const ee=Q;var ae=undefined&&undefined.__decorate||function(e,a,t,n){var s=arguments.length,i=s<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,t):n,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,a,t,n);else for(var o=e.length-1;o>=0;o--)if(r=e[o])i=(s<3?r(i):s>3?r(a,t,i):r(a,t))||i;return s>3&&i&&Object.defineProperty(a,t,i),i};var te=undefined&&undefined.__metadata||function(e,a){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,a)};const ne=class{constructor(t){e(this,t);this.timezoneChanged=a(this,"timezoneChanged",7);this.languageChanged=a(this,"languageChanged",7);this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone;this.selectedLanguage=navigator.language}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}changeTimezone(e){this.selectedTimezone=e;this.timezoneChanged.emit(e)}changeLanguage(e){this.selectedLanguage=e;this.languageChanged.emit(e)}selectedOptionChangedHandler(e){const{name:a,value:t}=e.detail;if(a==="timezone"){this.changeTimezone(t)}else if(a==="language"){this.changeLanguage(t)}}getTimezoneLabelHTML(e){const a=u(e);return t("span",{class:"timezone-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"-webkit-fill-available"}},h[e]," ",t("span",{class:"timezone-offset",style:{fontSize:"14px",fontWeight:"400",color:"var(--nylas-base-500)"}},a))}render(){const e=Object.keys(h).map((e=>({labelHTML:this.getTimezoneLabelHTML(e),label:h[e],value:e})));const a=Object.keys(m).map((e=>({label:m[e],value:e})));return t(n,{key:"c0a6a862393a28172f9e5a27f877ad1649bedca2"},t("div",{key:"924cea83d4737928c8e22ceba75db5ed55c23cdd",class:"nylas-locale-switch"},t("div",{key:"8503ba7c1983961e904acaba394153e3f391cd6d",class:{"select-wrapper":true,timezone:true}},t("select-dropdown",{key:"41232c533e3da00301397c9550bbcff763d8632f",name:"timezone",options:e,defaultSelectedOption:e.find((e=>e.value==this.selectedTimezone))},t("span",{key:"66fdd8cb15f9c2f6a61d4f7d11b4a6ea602a1230",slot:"select-icon"},t("globe-icon",{key:"17997840324dd2dc42d8dd29163289cbe18fbb6a",width:"20",height:"20"})))),t("div",{key:"350c75bd2b1b7c482daa6c1a07d0c5f30247ba5d",class:{"select-wrapper":true,language:true}},t("select-dropdown",{key:"f4e9247105873e359a9d048b924bcb27428ad3ab",name:"language",options:a,defaultSelectedOption:a.find((e=>e.value==this.selectedLanguage))},t("span",{key:"f3cae8af43608f1fb571f181c6ae861e74a0d35f",slot:"select-icon"},t("translate-icon",{key:"0d89c0fac2bc30f0d557785f5dc93e565542ff2e",width:"20",height:"20"}))))))}};ae([r({name:"nylas-locale-switch",stateToProps:new Map([["scheduler.selectedLanguage","selectedLanguage"],["scheduler.selectedTimezone","selectedTimezone"]]),eventToProps:{timezoneChanged:async(e,a)=>{a.scheduler.selectTimezone(e.detail)}},fireRegisterEvent:true}),te("design:type",Function),te("design:paramtypes",[]),te("design:returntype",void 0)],ne.prototype,"render",null);ne.style=ee;const se=".sc-nylas-logo-h{display:flex}";const ie=se;const re=class{constructor(a){e(this,a);this.width="69";this.height="24"}render(){return t("svg",{key:"ed631631650c1b1e72a33514c62620f07db0aab5",width:this.width,height:this.height,viewBox:"0 0 69 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("g",{key:"4529b46e6c641a1a510ddcd26e7867ef67719d51","clip-path":"url(#clip0_455_3543)"},t("path",{key:"3b6abbf3d05c2d64979feacc3e472478cc2b6bef",d:"M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z",fill:"currentColor"}),t("path",{key:"0fab0203a5b35f5328cf556cffc5b70d91b1c6cf",d:"M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z",fill:"currentColor"}),t("path",{key:"f1a4740faedaa576e3eaba1a5e57c6373d0919f3",d:"M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z",fill:"currentColor"}),t("path",{key:"161dbecb5673e0585285692d3e1a863c7f949994",d:"M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z",fill:"currentColor"}),t("path",{key:"c11c9713589afaa684befbfb82aa5748196f92f2",d:"M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z",fill:"currentColor"}),t("path",{key:"c6c0c7c00597373123a283b5ed63f3045b3c2dec",d:"M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z",fill:"currentColor"}),t("path",{key:"abaeeab72cdf96a4875750bb5804272ccd95ad62",d:"M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z",fill:"currentColor"}),t("path",{key:"55ce1c450fcc735ec75faeb729691a7b40541c98",d:"M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z",fill:"currentColor"})),t("defs",{key:"724826a441c49bc34aed5507963411bbb58db4c4"},t("clipPath",{key:"039d04c4978547f1d3125f48eb57d2862ad0aa4a",id:"clip0_455_3543"},t("rect",{key:"d1a31fb9f05a649236f5b3a4b3bebcabb8663146",width:"68.7123",height:"19.2877",fill:"white",transform:"translate(0.144043 0.356201)"}))))}};re.style=ie;const oe=':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error);background:rgb(255, 248, 248)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}';const le=oe;const ce=class{constructor(a){e(this,a);this.ttl=5e3;this.allowedCategories=["component","api","validation","invalid_session"];this.notifications=[]}onError(e){l(`[nylas-notification] Error: ${e.detail.title}`);this.handleNotification(e)}onWarning(e){l(`[nylas-notification] Warning: ${e.detail.title}`);this.handleNotification(e)}onInfo(e){l(`[nylas-notification] Info: ${e.detail.title}`);this.handleNotification(e)}onSuccess(e){l(`[nylas-notification] Success: ${e.detail.title}`);this.handleNotification(e)}handleNotification(e){if(e.defaultPrevented){l(`[nylas-notification] Event default prevented`);return}if(this.ttl===0){l(`[nylas-notification] TTL is 0`);return}if(this.allowedCategories.length>0&&!this.allowedCategories.includes(e.detail.category)){l(`[nylas-notification] Category not allowed`);return}this.notifications=[...this.notifications,{...e.detail}];if(e.detail.ttl!=="none"){const a=e.detail.ttl?e.detail.ttl:this.ttl;window.setTimeout((()=>{this.notifications=this.notifications.filter((a=>a.id!==e.detail.id))}),a)}}dismissNotification(e){this.notifications=this.notifications.filter((a=>a.id!==e))}render(){return t(n,{key:"04b12b24fcae1b215c6fd27745eda909e200ce99"},t(i,{key:"023971b83ac850df2801d2aa02c3af37b834ddc8"},this.notifications.map((e=>t("div",{class:`notif ${e.type}`,key:e.id},t("div",{class:"content"},t("span",{class:`icon ${e.type}`},(e.type==="error"||e.type==="warning")&&t("warning-icon",null)),t("span",{class:"message"},t("span",{class:"title"},e.title),e.description&&t("span",{class:"description"},e.description))),t("button",{class:"dismiss-btn",onClick:()=>this.dismissNotification(e.id)},t("close-icon",null))))),t("slot",{key:"2bf249b06c07b8acad8511608831e77bc6c50ec7"})))}};ce.style=le;const de=":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}";const fe=de;var be=undefined&&undefined.__decorate||function(e,a,t,n){var s=arguments.length,i=s<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,t):n,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,a,t,n);else for(var o=e.length-1;o>=0;o--)if(r=e[o])i=(s<3?r(i):s>3?r(a,t,i):r(a,t))||i;return s>3&&i&&Object.defineProperty(a,t,i),i};var pe=undefined&&undefined.__metadata||function(e,a){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,a)};const ye=class{constructor(a){e(this,a);this.selectedDate=undefined;this.selectedTimeslot=undefined;this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone;this.startTime="";this.endTime=""}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){l(`[nylas-selected-event-card] Component will load`)}async componentDidLoad(){l(`[nylas-selected-event-card] Component did load`);if(!this.selectedDate){console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.')}if(!this.selectedTimeslot){console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.')}}handleSelectedTimeslotChange(e){this.startTime=new Date(e?.start_time).toLocaleString(undefined,{timeStyle:"short"});this.endTime=new Date(e?.end_time).toLocaleString(undefined,{timeStyle:"short"})}render(){return t(n,{key:"5db94a07ff685fc783fa49e6eb890fce2be57cbf",part:"nsec"},t("sp-theme",{key:"9444e08365080532c403eb0db8241d3a5be1bbf1",theme:"spectrum",color:"dark",scale:"medium"},t("div",{key:"ace05d8165e68b9eb389fad78926a4c19e64859a",class:"event-card",part:"nsec__card"},t("div",{key:"82f4ea6cb3bfad565cfea1ef8eef651c9776b486",class:"calendar-icon",part:"nsec__icon"},t("calendar-icon",{key:"f984463ebcaab6e32e24951293633f651ebb7f24"})),t("div",{key:"1c48032e65079ce172219d92a79b38338db03c89",class:"nylas-selected-event-card__date",part:"nsec__date"},this.selectedDate?.toLocaleDateString(undefined,{dateStyle:"full"})),t("div",{key:"71efc4d5f7d409877d3a5d6cf62fd95f7df10176",class:"nylas-selected-event-card__time",part:"nsec__time"},this.startTime," - ",this.endTime)),t("div",{key:"3f9cbf108c99a8d6cfdc448781dfa67c90504c18",class:"event-timezone",part:"nsec__timezone"},t("globe-icon",{key:"92f77867dc3b6fba848746b690484f83511e9c7e"}),h[this.selectedTimezone])))}static get watchers(){return{selectedTimeslot:["handleSelectedTimeslotChange"]}}};be([r({name:"nylas-selected-event-card",stateToProps:new Map([["scheduler.selectedDate","selectedDate"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.selectedTimezone","selectedTimezone"]]),eventToProps:{},fireRegisterEvent:true}),pe("design:type",Function),pe("design:paramtypes",[]),pe("design:returntype",void 0)],ye.prototype,"render",null);ye.style=fe;const he=":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .time-slot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:9px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}";const ue=he;var me=undefined&&undefined.__decorate||function(e,a,t,n){var s=arguments.length,i=s<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,t):n,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,a,t,n);else for(var o=e.length-1;o>=0;o--)if(r=e[o])i=(s<3?r(i):s>3?r(a,t,i):r(a,t))||i;return s>3&&i&&Object.defineProperty(a,t,i),i};var ge=undefined&&undefined.__metadata||function(e,a){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,a)};const ve=class{constructor(t){e(this,t);this.timeslotSelected=a(this,"timeslotSelected",7);this.timeslotConfirmed=a(this,"timeslotConfirmed",7);this.handleConfirmedTimeslot=async(e,a)=>{e.preventDefault();l(`[nylas-timeslot-picker] Confirm timeslot`,a);this.timeslotConfirmed.emit(a)};this.handleMouseEnter=e=>{this.hoveredTimeslotIndex=e};this.handleMouseLeave=()=>{this.hoveredTimeslotIndex=-1};this.selectedDate=new Date;this.availability=undefined;this.selectedTimeslot=undefined;this.isLoading=undefined;this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone;this.times=[];this.hoveredTimeslotIndex=undefined;this.selectedTimeslotIndex=undefined}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){const e=this.availability?.filter((e=>this.selectedDate&&b(e.start_time,this.selectedDate))).map((e=>e));this.times=e||[];l(`[nylas-timeslot-picker] Component will load`,{selectedDate:this.selectedDate,availability:this.availability,times:this.times})}async componentDidLoad(){l(`[nylas-timeslot-picker] Component did load`)}getTimeslotId(e,a){return`${e.toLocaleDateString()}-${a}`}onClickSelectTime(e,a){l(`[nylas-timeslot-picker] Time selected`,e,a);this.selectedTimeslotIndex=this.getTimeslotId(e.start_time,a);this.timeslotSelected.emit({start_time:e.start_time,end_time:e.end_time})}getTimeSlotLabel(e){const a=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"numeric",timeZone:this.selectedTimezone});return`${a.format(e.start_time)} - ${a.format(e.end_time)}`}selectedDateChanged(e){l(`[nylas-timeslot-picker] Selected date changed`,{newVal:e});if(e){this.selectedTimeslotIndex="";if(typeof e!=="undefined"){const a=this.availability?.filter((a=>b(a.start_time,e))).map((e=>e));this.times=a||[]}}}availabilityChanged(e){l(`[nylas-timeslot-picker] Available times changed`,{newVal:e,selectedDate:this.selectedDate});if(typeof e!=="undefined"){const a=e?.filter((e=>this.selectedDate&&b(e.start_time,this.selectedDate))).map((e=>e));this.times=a||[]}}render(){if(this.isLoading){return t(n,null,t("div",{class:"loading"},new Array(6).fill(0).map(((e,a)=>t("div",{class:"time-slot-skeleton",style:{animationDelay:`${a*20}ms`}})))))}if(this.availability&&this.availability.length===0){return t(n,null,t("div",{class:"empty"},t("span",null,"No dates available")))}if((!this.times||this.times.length===0)&&!!this.selectedDate){return t(n,null,t("div",{class:"empty"},t("span",null,"No time slots available for selected date")))}if(!this.selectedDate)return t(n,null);return t(n,{part:"ntp"},t("div",{class:"time-picker-wrapper"},t("div",{class:"time-slots"},this.times.map(((e,a)=>t("button",{part:`ntp__timeslot ${this.selectedTimeslot?.start_time?.getTime()===e.start_time.getTime()?"ntp__timeslot--selected":""}`,"aria-role":"button",class:{time:true,selected:typeof this.selectedTimeslot!=="undefined"&&this.selectedTimeslot?.start_time?.getTime()===e.start_time.getTime()},onClick:()=>this.onClickSelectTime(e,a),onMouseEnter:()=>this.handleMouseEnter(a),onMouseLeave:()=>this.handleMouseLeave()},this.hoveredTimeslotIndex==a||this.selectedTimeslotIndex==this.getTimeslotId(e.start_time,a)?this.getTimeSlotLabel(e):e.start_time.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",timeZone:this.selectedTimezone}))))),this.selectedTimeslot&&t("div",{class:"footer"},t("sp-button",{variant:"primary",onClick:e=>this.handleConfirmedTimeslot(e,this.selectedTimeslot),part:"ntp__button-primary"},t("slot",{name:"timeslot-picker-cta-label"},"Next")))))}static get watchers(){return{selectedDate:["selectedDateChanged"],availability:["availabilityChanged"]}}};me([r({name:"nylas-timeslot-picker",stateToProps:new Map([["scheduler.selectedDate","selectedDate"],["scheduler.availability","availability"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.selectedTimezone","selectedTimezone"],["scheduler.isLoading","isLoading"]]),eventToProps:{timeslotSelected:async(e,a)=>{a.scheduler.selectTime(e.detail)},timeslotConfirmed:async(e,a)=>{if(e.detail){a.scheduler.toggleAdditionalData(true)}}},fireRegisterEvent:true}),ge("design:type",Function),ge("design:paramtypes",[]),ge("design:returntype",void 0)],ve.prototype,"render",null);ve.style=ue;export{C as nylas_booked_event_card,D as nylas_booking_form,B as nylas_cancel_booking_form,P as nylas_cancelled_event_card,K as nylas_date_picker,ne as nylas_locale_switch,re as nylas_logo,ce as nylas_notification,ye as nylas_selected_event_card,ve as nylas_timeslot_picker};
|
|
2
|
+
//# sourceMappingURL=p-d7038914.entry.js.map
|