@nylas/web-elements 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/cdn/nylas-availability-picker/nylas-availability-picker.es.js +202 -191
  2. package/dist/cdn/nylas-booking-calendar-picker/nylas-booking-calendar-picker.es.js +466 -455
  3. package/dist/cdn/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.es.js +299 -288
  4. package/dist/cdn/nylas-booking-confirmation-type/nylas-booking-confirmation-type.es.js +330 -319
  5. package/dist/cdn/nylas-booking-form/nylas-booking-form.es.js +440 -426
  6. package/dist/cdn/nylas-booking-form-config/nylas-booking-form-config.es.js +174 -163
  7. package/dist/cdn/nylas-buffer-time/nylas-buffer-time.es.js +469 -458
  8. package/dist/cdn/nylas-custom-event-slug/nylas-custom-event-slug.es.js +194 -194
  9. package/dist/cdn/nylas-editor-tabs/nylas-editor-tabs.es.js +20 -9
  10. package/dist/cdn/nylas-event-duration/nylas-event-duration.es.js +357 -346
  11. package/dist/cdn/nylas-event-location/nylas-event-location.es.js +502 -491
  12. package/dist/cdn/nylas-limit-future-bookings/nylas-limit-future-bookings.es.js +325 -314
  13. package/dist/cdn/nylas-list-configurations/nylas-list-configurations.es.js +239 -228
  14. package/dist/cdn/nylas-locale-switch/nylas-locale-switch.es.js +235 -224
  15. package/dist/cdn/nylas-min-booking-notice/nylas-min-booking-notice.es.js +325 -314
  16. package/dist/cdn/nylas-min-cancellation-notice/nylas-min-cancellation-notice.es.js +209 -198
  17. package/dist/cdn/nylas-participant-booking-calendars/nylas-participant-booking-calendars.es.js +249 -238
  18. package/dist/cdn/nylas-participants-custom-availability/nylas-participants-custom-availability.es.js +801 -790
  19. package/dist/cdn/nylas-reminder-emails/nylas-reminder-emails.es.js +287 -276
  20. package/dist/cdn/nylas-reminder-time/nylas-reminder-time.es.js +334 -323
  21. package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +23 -12
  22. package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +587 -559
  23. package/dist/cdn/nylas-scheduling-method/nylas-scheduling-method.es.js +275 -264
  24. package/dist/cdn/nylas-timeslot-interval/nylas-timeslot-interval.es.js +353 -342
  25. package/dist/cdn/select-dropdown/select-dropdown.es.js +108 -97
  26. package/dist/cdn/time-period-selector/time-period-selector.es.js +340 -329
  27. package/dist/cjs/calendar-agenda-fill-icon_48.cjs.entry.js +5 -4
  28. package/dist/cjs/calendar-agenda-fill-icon_48.cjs.entry.js.map +1 -1
  29. package/dist/cjs/chevron-icon_3.cjs.entry.js +14 -1
  30. package/dist/cjs/chevron-icon_3.cjs.entry.js.map +1 -1
  31. package/dist/cjs/loader.cjs.js +1 -1
  32. package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js +11 -7
  33. package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js.map +1 -1
  34. package/dist/cjs/nylas-booking-form.cjs.entry.js +11 -7
  35. package/dist/cjs/nylas-booking-form.cjs.entry.js.map +1 -1
  36. package/dist/cjs/nylas-custom-event-slug.cjs.entry.js +5 -4
  37. package/dist/cjs/nylas-custom-event-slug.cjs.entry.js.map +1 -1
  38. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +2 -1
  39. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
  40. package/dist/cjs/nylas-scheduling.cjs.entry.js +25 -4
  41. package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
  42. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  43. package/dist/cjs/select-dropdown.cjs.entry.js +14 -1
  44. package/dist/cjs/select-dropdown.cjs.entry.js.map +1 -1
  45. package/dist/collection/components/design-system/select-dropdown/select-dropdown.js +33 -1
  46. package/dist/collection/components/design-system/select-dropdown/select-dropdown.js.map +1 -1
  47. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +17 -7
  48. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -1
  49. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +26 -5
  50. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
  51. package/dist/collection/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.css +6 -2
  52. package/dist/collection/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.js +4 -3
  53. package/dist/collection/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.js.map +1 -1
  54. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/ExpressFlow.js +2 -1
  55. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/ExpressFlow.js.map +1 -1
  56. package/dist/components/nylas-booking-form2.js +12 -8
  57. package/dist/components/nylas-booking-form2.js.map +1 -1
  58. package/dist/components/nylas-custom-event-slug2.js +5 -4
  59. package/dist/components/nylas-custom-event-slug2.js.map +1 -1
  60. package/dist/components/nylas-scheduler-editor.js +2 -1
  61. package/dist/components/nylas-scheduler-editor.js.map +1 -1
  62. package/dist/components/nylas-scheduling.js +25 -4
  63. package/dist/components/nylas-scheduling.js.map +1 -1
  64. package/dist/components/select-dropdown2.js +14 -1
  65. package/dist/components/select-dropdown2.js.map +1 -1
  66. package/dist/esm/calendar-agenda-fill-icon_48.entry.js +5 -4
  67. package/dist/esm/calendar-agenda-fill-icon_48.entry.js.map +1 -1
  68. package/dist/esm/chevron-icon_3.entry.js +14 -1
  69. package/dist/esm/chevron-icon_3.entry.js.map +1 -1
  70. package/dist/esm/loader.js +1 -1
  71. package/dist/esm/nylas-booked-event-card_12.entry.js +11 -7
  72. package/dist/esm/nylas-booked-event-card_12.entry.js.map +1 -1
  73. package/dist/esm/nylas-booking-form.entry.js +11 -7
  74. package/dist/esm/nylas-booking-form.entry.js.map +1 -1
  75. package/dist/esm/nylas-custom-event-slug.entry.js +5 -4
  76. package/dist/esm/nylas-custom-event-slug.entry.js.map +1 -1
  77. package/dist/esm/nylas-scheduler-editor.entry.js +2 -1
  78. package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
  79. package/dist/esm/nylas-scheduling.entry.js +25 -4
  80. package/dist/esm/nylas-scheduling.entry.js.map +1 -1
  81. package/dist/esm/nylas-web-elements.js +1 -1
  82. package/dist/esm/select-dropdown.entry.js +14 -1
  83. package/dist/esm/select-dropdown.entry.js.map +1 -1
  84. package/dist/nylas-web-elements/nylas-booking-form.entry.js +11 -7
  85. package/dist/nylas-web-elements/nylas-booking-form.entry.js.map +1 -1
  86. package/dist/nylas-web-elements/nylas-custom-event-slug.entry.js +5 -4
  87. package/dist/nylas-web-elements/nylas-custom-event-slug.entry.js.map +1 -1
  88. package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +2 -1
  89. package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js.map +1 -1
  90. package/dist/nylas-web-elements/nylas-scheduling.entry.js +25 -4
  91. package/dist/nylas-web-elements/nylas-scheduling.entry.js.map +1 -1
  92. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  93. package/dist/nylas-web-elements/{p-670e4bd1.entry.js → p-795ebe60.entry.js} +2 -2
  94. package/dist/nylas-web-elements/p-795ebe60.entry.js.map +1 -0
  95. package/dist/nylas-web-elements/{p-d32d9a1d.entry.js → p-8dee5c91.entry.js} +2 -2
  96. package/dist/nylas-web-elements/p-8dee5c91.entry.js.map +1 -0
  97. package/dist/nylas-web-elements/p-8fdc5d3d.entry.js +2 -0
  98. package/dist/nylas-web-elements/p-8fdc5d3d.entry.js.map +1 -0
  99. package/dist/nylas-web-elements/p-efa03f8c.entry.js +2 -0
  100. package/dist/nylas-web-elements/p-efa03f8c.entry.js.map +1 -0
  101. package/dist/nylas-web-elements/p-fbec0698.entry.js +2 -0
  102. package/dist/nylas-web-elements/p-fbec0698.entry.js.map +1 -0
  103. package/dist/nylas-web-elements/select-dropdown.entry.js +14 -1
  104. package/dist/nylas-web-elements/select-dropdown.entry.js.map +1 -1
  105. package/dist/types/components/design-system/select-dropdown/select-dropdown.d.ts +6 -0
  106. package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +6 -0
  107. package/dist/types/components/scheduler/nylas-scheduling/nylas-scheduling.d.ts +1 -0
  108. package/dist/types/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.d.ts +0 -1
  109. package/dist/types/components.d.ts +15 -0
  110. package/package.json +1 -1
  111. package/dist/nylas-web-elements/p-14e194b2.entry.js +0 -2
  112. package/dist/nylas-web-elements/p-14e194b2.entry.js.map +0 -1
  113. package/dist/nylas-web-elements/p-169a3f6d.entry.js +0 -2
  114. package/dist/nylas-web-elements/p-169a3f6d.entry.js.map +0 -1
  115. package/dist/nylas-web-elements/p-670e4bd1.entry.js.map +0 -1
  116. package/dist/nylas-web-elements/p-8ad09f72.entry.js +0 -2
  117. package/dist/nylas-web-elements/p-8ad09f72.entry.js.map +0 -1
  118. package/dist/nylas-web-elements/p-d32d9a1d.entry.js.map +0 -1
@@ -0,0 +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-7d71679f.js";import{a as l,i as d,k as c,j as h,l as g}from"./p-c6fcb288.js";import{N as f,E as p,C as u}from"./p-3bd81aa6.js";import{L as m,a as b}from"./p-d4353a55.js";import"./p-cb65c223.js";import"./p-cabb2e68.js";class y{constructor({schedulerAPIURL:e,nylasSchedulerStore:t,sessionId:n,configId:i,slug:s,clientId:a}){if(!e){throw new Error("schedulerAPIURL is required")}if(!t){throw new Error("nylasSchedulerStore is required")}if(!n&&!i&&!(s||a)){throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.")}if(e==="/"){const t=new URL(window.location.href);e=t.origin}this.configId=i;this.sessionId=n;this.schedulerAPIURL=e;this.nylasSchedulerStore=t;this.slug=s;this.clientId=a}init(){l("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){if(this._schedulerAPIConnector){return this._schedulerAPIConnector}this._schedulerAPIConnector=new f({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId});return this._schedulerAPIConnector}resetStores(){this.nylasSchedulerStore.reset()}}const _=(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 v=(t,n)=>e("div",{class:"message-banner"},n);const w=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-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:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer 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;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}';const x=w;const k={title:d.t("genericErrorTitle"),type:o.Error,category:p.Component};const I=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.configSettingsLoaded=i(this,"configSettingsLoaded",7);this.bookingRefExtracted=i(this,"bookingRefExtracted",7);this.bookedEventInfo=i(this,"bookedEventInfo",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.organizerConfirmationBookingRef=undefined;this.configurationId=undefined;this.slug=undefined;this.clientId=undefined;this.nylasBranding=true;this.eventOverrides={};this.isLoading=undefined;this.themeConfig=undefined;this.localization=undefined;this.showNotification=true;this.automaticComponentRegistration=true;this.selectedDateLabel=(new Date).toLocaleDateString(undefined,{dateStyle:"full"})||`${d.t("noDateSelected")}`;this.refConfigId=undefined;this.language=navigator.language}connectedCallback(){l(`[nylas-scheduler] connectedCallback`)}async componentWillLoad(){l(`[nylas-scheduler] Component will load`);const e=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides){await this.eventOverrides.schedulerWillLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}this.stores={scheduler:u({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})};this.baseProvider=new r(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);this.refConfigId=this.configurationId;let t;if(this.rescheduleBookingRef){const[e,n,i]=c(this.rescheduleBookingRef);this.refConfigId=e;this.stores.scheduler.set("rescheduleBookingId",n);t=this.bookingRefExtracted.emit({configurationId:e,bookingId:n})}else if(this.cancelBookingRef){const[e,n,i]=c(this.cancelBookingRef);this.refConfigId=e;this.stores.scheduler.set("cancelBookingId",n);t=this.bookingRefExtracted.emit({configurationId:e,bookingId:n})}else if(this.organizerConfirmationBookingRef){const[e,n,i]=c(this.organizerConfirmationBookingRef);this.refConfigId=e;this.stores.scheduler.set("organizerConfirmationBookingId",n);this.stores.scheduler.set("organizerConfirmationSalt",i);t=this.bookingRefExtracted.emit({configurationId:e,bookingId:n,salt:i})}if("bookingRefExtracted"in this.eventOverrides){await this.eventOverrides.bookingRefExtracted(t,this.nylasSchedulerConnector);if(t.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists()){return}const n=this.baseProvider?.getStore("scheduler");this.nylasSchedulerConnector=new y({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:n});const i=this.init.emit(this.host);if("init"in this.eventOverrides){await this.eventOverrides.init(i,this.nylasSchedulerConnector);if(i.defaultPrevented){return}}this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector);this.applyThemeConfig(this.themeConfig)}async componentDidLoad(){this.baseProvider?.componentDidLoad();const e=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides){await this.eventOverrides.schedulerDidLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists()){return}this.localizationChanged(this.localization);const t=await(this.nylasSchedulerConnector?.scheduler.getUISettings());if(!t||"error"in t){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(t?.error)},host:this.host});return}else{if("data"in t&&t.data?.appearance){console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.")}const e=this.configSettingsLoaded.emit({settings:t});if("configSettingsLoaded"in this.eventOverrides){await this.eventOverrides.configSettingsLoaded(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}}const n=this.baseProvider?.getStore("scheduler");const i=n?.get("configSettings")?.scheduler?.available_days_in_future;const s=n?.get("selectedTimeslot");if(s&&s?.start_time){if(!this.isTimeslotValid(s)){return}if(n?.get("showBookingForm")){n?.set("selectedDate",s.start_time);return}}const a=n?.get("selectedDate");const o=n?.get("availability");let r;if(o&&o.length>0){return}if(!a){const e=new Date;const{startTime:t,endTime:n,endTimeForAvailableDaysInFuture:s}=this.validateAvailableDaysInFuture(e,i||30);if(e.getTime()<s*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(t,n))}}else{const{startTime:e,endTime:t,endTimeForAvailableDaysInFuture:n}=this.validateAvailableDaysInFuture(a,i||30);if(a.getTime()<n*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(e,t))}}if(!r||"error"in r){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r?.error)},host:this.host})}if(!a){let e=new Date;const t=n?.get("availability").find((e=>new Date(e.start_time)>new Date));if(t){e=t.start_time}n?.set("selectedDate",e)}}componentDisconnected(){this.baseProvider?.componentDisconnected()}bookingInfoChanged(e){this.stores?.scheduler.set("bookingInfo",e)}rescheduleBookingRefChanged(e){if(e){const[t,n]=c(e);this.stores?.scheduler.set("rescheduleBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}cancelBookingRefChanged(e){if(e){const[t,n]=c(e);this.stores?.scheduler.set("cancelBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}organizerConfirmationBookingRefChanged(e){if(e){const[t,n]=c(e);this.stores?.scheduler.set("organizerConfirmationBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}localizationChanged(e){if(!e){return}Object.keys(e).forEach((t=>{if(!(t in m)){return}d.addResourceBundle(t,"translation",e[t],false,true);this.language=this.language}))}themeConfigChanged(e){this.applyThemeConfig(e)}languageChanged(e){const t=e.detail;this.language=t;d.changeLanguage(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({notification:{...this.getErrorObject(e?.error)},host:this.host})}const t=this.stores?.scheduler.get("selectableDates");if(t&&t.length>0){this.stores?.scheduler.set("selectedDate",t[0])}}}mapToBookingData(e){const t=this.stores?.scheduler.get("selectedTimeslot");const n=this.stores?.scheduler.get("selectedLanguage");const i=this.stores?.scheduler.get("selectedTimezone");const s=t?.start_time?new Date(t?.start_time).getTime()/1e3:"";const a=t?.end_time?new Date(t?.end_time).getTime()/1e3:"";return{additional_guests:e.guests,guest:e.primaryParticipant,additional_fields:e.additionalFields,start_time:s,end_time:a,email_language:n,timezone:i}}async bookButtonClickedHandler(e){const t=e.detail;const n=this.mapToBookingData(t);const i=this.nylasSchedulerConnector?.schedulerStore?.get("rescheduleBookingId");const s=i;if(s){const e=await(this.nylasSchedulerConnector?.scheduler.rescheduleBooking(s,t));if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e?.error)},host:this.host})}const i=e?.data;const a=this.bookedEventInfo.emit({...e,data:{...i,...n}});if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(a,this.nylasSchedulerConnector)}return}const a=await(this.nylasSchedulerConnector?.scheduler.bookTimeslot(t));if(!a||"error"in a){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(a?.error)},host:this.host})}const o=a?.data;const r=this.bookedEventInfo.emit({...a,data:{...o,...n}});if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(r,this.nylasSchedulerConnector)}}dateSelectedHandler(e){const t=e.detail;this.selectedDateLabel=t?t.toLocaleDateString(undefined,{dateStyle:"full"}):`${d.t("noDateSelected")}`}cancelBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}confirmBookingErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}async getNylasSchedulerStore(){return this.baseProvider?.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(e){return{title:e?.title||k.title,category:e?.category||k.category,type:o.Error,description:e?.message||"",id:(new Date).getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let e="";if(!this.sessionId){e+=d.t("sessionIdRequiredErrorMessage")}if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){e=d.t("sessionIdRequiredErrorMessage")+" "+d.t("publicConfigErrorMessage")}this.nylasSchedulerError.emit({notification:{title:d.t("schedulingComponentErrorTitle"),category:p.Component,type:o.Error,description:e,id:(new Date).getTime().toString(),ttl:"none"},host:this.host});return false}return true}isTimeslotValid(e){const t=new Date(e.start_time);if(t<new Date){this.nylasSchedulerError.emit({notification:{title:d.t("invalidTimeslotErrorTitle"),category:p.Component,type:o.Error,description:d.t("invalidTimeslotErrorMessage"),id:(new Date).getTime().toString(),ttl:"none"},host:this.host});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(h(n,t).getTime()/1e3);const o=Math.min(a,s);const r=i<n.getTime()/1e3?Math.floor(n.getTime()/1e3):i;return{startTime:r,endTime:o,endTimeForAvailableDaysInFuture:a}}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}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 c=n?.get("rescheduleBookingId");const h=n?.get("organizerConfirmationBookingId");const f=n?.get("rejectBookingId");const p=n?.get("confirmedEventInfo");const u=n?.get("nylasBranding")||this.nylasBranding;const m=n?.get("selectedDate");const y=n?.get("configSettings")?.scheduler?.confirmation_redirect_url;this.selectedDateLabel=m&&this.language?g(m.toLocaleDateString(b[this.language],{dateStyle:"full"})):`${d.t("noDateSelected")}`;if(t&&(r||f)&&!o){return e(s,null,e(_,{nylasBranding:u,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e("nylas-cancel-booking-form",{selectedTimeslot:l,cancelBookingId:r,rejectBookingId:f,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))))}if(t&&h){return e(s,null,e(_,{nylasBranding:u,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},e("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:h,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))))}if(t&&o){return e(s,null,e(_,{nylasBranding:u,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&&p){return e(s,null,e(_,{nylasBranding:u,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"confirmed-event-page"},e("nylas-confirmed-event-card",{confirmedEventInfo:p,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))))}if(t&&i&&y){window.location.assign(y);return}if(t&&i){return e(s,null,e(_,{nylasBranding:u,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||!!c)&&!a){const t=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e(s,null,e(_,{nylasBranding:u,isLoading:this.isLoading,showNotification:this.showNotification},c&&e(v,null,`${d.t("rescheduleTitle")}`),e("div",{class:"select-date-page",part:"select-date-page"},e("div",{class:"left-panel"},e("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),e("div",{class:`right-panel ${c?"reschedule":""}`},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){return e(s,null,e(_,{nylasBranding:u,isLoading:this.isLoading,showNotification:this.showNotification},c&&e(v,null,`${d.t("rescheduleTitle")}`),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, nsec__timezone"}))),e("div",{class:`right-panel ${c?"reschedule":""}`},e("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"})))))}return e(s,null,e("slot",null))}get host(){return a(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],themeConfig:["themeConfigChanged"]}}};I.style=x;export{I as nylas_scheduling};
2
+ //# sourceMappingURL=p-8fdc5d3d.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NylasSchedulerConnector","constructor","schedulerAPIURL","nylasSchedulerStore","sessionId","configId","slug","clientId","Error","url","URL","window","location","href","origin","this","init","debug","schedulerStore","scheduler","_schedulerAPIConnector","NylaSchedulerAPIConnector","resetStores","reset","SchedulerView","props","children","isLoading","showNotification","nylasBranding","h","Fragment","class","MessageBanner","_props","nylasSchedulingCss","NylasSchedulingStyle0","genericError","title","i18next","t","type","NotificationType","category","ErrorCategory","Component","NylasScheduling","Date","toLocaleDateString","undefined","dateStyle","navigator","language","connectedCallback","componentWillLoad","schedulerWillLoadEvent","schedulerWillLoad","emit","host","eventOverrides","nylasSchedulerConnector","defaultPrevented","stores","CreateNylasSchedulerStore","bookingInfo","defaultSchedulerState","baseProvider","NylasBaseProvider","automaticComponentRegistration","refConfigId","configurationId","bookingRefExtractedEvent","rescheduleBookingRef","rescheduleConfigId","rescheduleBookingId","_","compactStringToUUIDs","set","bookingRefExtracted","bookingId","cancelBookingRef","cancelConfigId","cancelBookingId","organizerConfirmationBookingRef","organizerConfirmationConfigId","organizerConfirmationBookingId","salt","checkIfSessionIdOrConfigIdExists","getStore","schedulerApiUrl","initEvent","applyThemeConfig","themeConfig","componentDidLoad","schedulerDidLoadEvent","schedulerDidLoad","localizationChanged","localization","settingsResponse","getUISettings","nylasSchedulerError","notification","getErrorObject","error","data","appearance","console","info","configSettingsLoadedEvent","configSettingsLoaded","settings","availableDaysInFuture","get","available_days_in_future","selectedTimeslot","start_time","isTimeslotValid","selectedDate","availability","result","length","today","startTime","endTime","endTimeForAvailableDaysInFuture","validateAvailableDaysInFuture","getTime","getAvailability","_selectedDate","firstAvailableDate","find","timeslot","componentDisconnected","bookingInfoChanged","newVal","rescheduleBookingRefChanged","setConfigId","cancelBookingRefChanged","organizerConfirmationBookingRefChanged","Object","keys","forEach","lang","LANGUAGE_CODE","addResourceBundle","themeConfigChanged","languageChanged","event","newLanguage","detail","changeLanguage","registerComponentHandler","registerComponent","unregisterComponentHandler","unregisterComponent","monthChangedHandler","date","selectableDates","mapToBookingData","timezone","end_time","additional_guests","guests","guest","primaryParticipant","additional_fields","additionalFields","email_language","bookButtonClickedHandler","bookingData","mappedBookingData","storeRescheduleId","rescheduleBooking","resultData","bookedEventInfoEvent","bookedEventInfo","bookTimeslot","dateSelectedHandler","selectedDateLabel","cancelBookedEventErrorHandler","cancelBookedEventValidationErrorHandler","rescheduleBookedEventErrorHandler","confirmBookingErrorHandler","getNylasSchedulerStore","getNylasSchedulerConnector","getRef","description","message","id","toString","ttl","startDate","getFullYear","getMonth","endTimeForCurrentMonth","Math","floor","addDaysToCurrentDate","min","startTimeWithOffset","key","value","entries","style","setProperty","render","showDefaultScheduler","mode","eventInfo","showBookingForm","cancelledEventInfo","rejectBookingId","confirmedEventInfo","redirectUrl","confirmation_redirect_url","capitalizeFirstLetter","LANGUAGE_CODE_MAP","Host","part","exportparts","assign","timeslotPickerCTALabel","querySelector","slot","name"],"sources":["src/connector/nylas-scheduler-connector/index.ts","src/components/scheduler/nylas-scheduling/scheduler-view.tsx","src/components/scheduler/nylas-scheduling/message-banner.tsx","src/components/scheduler/nylas-scheduling/nylas-scheduling.scss?tag=nylas-scheduling&encapsulation=shadow","src/components/scheduler/nylas-scheduling/nylas-scheduling.tsx"],"sourcesContent":["import { NylasSchedulerStoreType } from '@/stores/scheduler-store';\nimport { debug } from '@/utils/utils';\nimport { NylasSchedulerConnectorInterface } from '../connector-interface';\nimport { NylaSchedulerAPIConnector } from '../shared/api/scheduler';\n\ntype NylasSchedulerConnectorOptions = {\n schedulerAPIURL: string;\n nylasSchedulerStore: NylasSchedulerStoreType;\n sessionId?: string;\n configId?: string;\n slug?: string;\n clientId?: string;\n};\n/**\n * Base class for the Nylas connector.\n */\nexport class NylasSchedulerConnector implements NylasSchedulerConnectorInterface {\n public schedulerAPIURL: string;\n public nylasSchedulerStore: NylasSchedulerStoreType;\n public sessionId: string | undefined;\n public configId: string | undefined;\n public slug: string | undefined;\n public clientId: string | undefined;\n\n private _schedulerAPIConnector: NylaSchedulerAPIConnector | undefined;\n\n constructor({ schedulerAPIURL, nylasSchedulerStore, sessionId, configId, slug, clientId }: NylasSchedulerConnectorOptions) {\n if (!schedulerAPIURL) {\n throw new Error('schedulerAPIURL is required');\n }\n\n if (!nylasSchedulerStore) {\n throw new Error('nylasSchedulerStore is required');\n }\n\n if (!sessionId && !configId && !(slug || clientId)) {\n throw new Error('sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.');\n }\n\n // If the url is only /, then we need to add the base url.\n // We assume that the base url is the same as the current url.\n if (schedulerAPIURL === '/') {\n const url = new URL(window.location.href);\n schedulerAPIURL = url.origin;\n }\n\n this.configId = configId;\n this.sessionId = sessionId;\n this.schedulerAPIURL = schedulerAPIURL;\n this.nylasSchedulerStore = nylasSchedulerStore;\n this.slug = slug;\n this.clientId = clientId;\n }\n\n public init() {\n debug('NylasConnector init');\n }\n\n public get schedulerStore() {\n return this.nylasSchedulerStore;\n }\n\n public get scheduler() {\n if (this._schedulerAPIConnector) {\n return this._schedulerAPIConnector;\n }\n this._schedulerAPIConnector = new NylaSchedulerAPIConnector({\n schedulerAPIURL: this.schedulerAPIURL,\n schedulerStore: this.schedulerStore,\n sessionId: this.sessionId,\n configId: this.configId,\n slug: this.slug,\n clientId: this.clientId,\n });\n return this._schedulerAPIConnector;\n }\n\n public resetStores() {\n this.nylasSchedulerStore.reset();\n }\n}\nexport type PublicMethods<T> = {\n [K in keyof T]: T[K] extends Function ? (string extends K ? never : K) : never;\n}[keyof T];\n\nexport type NylasSchedulerConnectorPublicMethods = PublicMethods<NylasSchedulerConnector>;\n","import { Fragment, FunctionalComponent, h } from '@stencil/core';\n\nexport type SchedulerViewProps = {\n isLoading?: boolean;\n showNotification?: boolean;\n nylasBranding?: boolean;\n};\n\n/**\n * The Scheduler view component.\n */\nexport const SchedulerView: FunctionalComponent<SchedulerViewProps> = (props: SchedulerViewProps, children) => {\n const isLoading = props.isLoading;\n const showNotification = props.showNotification;\n const nylasBranding = props.nylasBranding;\n\n return (\n <Fragment>\n {showNotification && <nylas-notification></nylas-notification>}\n\n {isLoading && (\n <div class={'loading'}>\n <div class={'left'}>\n <div class={'skeleton'} />\n </div>\n <div class={'right'}>\n <div class={'skeleton'} />\n <div class={'skeleton'} />\n <div class={'skeleton'} />\n <div class={'skeleton'} />\n <div class={'skeleton'} />\n </div>\n </div>\n )}\n {!isLoading && children}\n <div class={'footer'}>\n {nylasBranding && (\n <Fragment>\n Powered by&nbsp;\n <nylas-logo />\n </Fragment>\n )}\n </div>\n </Fragment>\n );\n};\n","import { FunctionalComponent, h } from '@stencil/core';\n\nexport type HeaderBannerProps = {};\n\nexport const MessageBanner: FunctionalComponent<HeaderBannerProps> = (_props: HeaderBannerProps, children) => <div class=\"message-banner\">{children}</div>;\n","@import '../../../common/styles/variables.scss';\n\n:host {\n display: flex;\n flex-direction: column;\n overflow: visible;\n border-radius: var(--nylas-border-radius-2x);\n width: fit-content;\n\n @media #{$mobile} {\n width: auto;\n min-width: 325px;\n }\n\n background: var(--nylas-base-0);\n position: relative;\n box-shadow: 0px 4px 8px 2px rgba(0, 0, 0, 0.05),\n 0px 8px 16px -2px rgba(0, 0, 0, 0.1);\n\n @include default-css-variables;\n font-family: var(--nylas-font-family);\n font-optical-sizing: auto;\n font-style: normal;\n font-variation-settings: 'slnt' 0;\n}\n\n:root {\n font-family: inherit;\n}\n\n.error {\n padding: 8rem 12rem;\n color: var(--nylas-base-0);\n background-color: var(--nylas-error);\n margin: 1.5rem;\n border-radius: var(--nylas-border-radius-2x);\n}\n\n.message-banner {\n text-align: right;\n color: var(--nylas-base-800);\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-color-primary-200);\n margin: 0;\n}\n\n.loading {\n margin: 1.5rem;\n display: flex;\n gap: 1rem;\n\n .skeleton {\n border-radius: var(--nylas-border-radius-2x);\n animation: pulsate 1.5s infinite;\n\n &:nth-child(2) {\n animation-delay: -100ms;\n }\n\n &:nth-child(3) {\n animation-delay: -200ms;\n }\n\n &:nth-child(4) {\n animation-delay: -300ms;\n }\n\n &:nth-child(5) {\n animation-delay: -400ms;\n }\n }\n\n .left .skeleton {\n height: 100%;\n width: 400px;\n }\n\n .right .skeleton {\n height: 5rem;\n width: 300px;\n margin-bottom: 1rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n }\n}\n\n@keyframes pulsate {\n 0% {\n background-color: var(--nylas-base-50);\n }\n\n 50% {\n background-color: var(--nylas-base-100);\n }\n\n 100% {\n background-color: var(--nylas-base-50);\n }\n}\n\n.select-date-page,\n.additional-data-page,\n.booked-event-page,\n.manual-confirmation-page,\n.cancelled-event-page,\n.cancel-flow-page {\n border-top-left-radius: var(--nylas-border-radius-2x);\n border-top-right-radius: var(--nylas-border-radius-2x);\n}\n\n.select-date-page,\n.additional-data-page {\n display: flex;\n\n @media #{$mobile} {\n flex-direction: column;\n }\n}\n\n.booked-event-page,\n.manual-confirmation-page {\n background-color: var(--nylas-base-50);\n}\n\n.cancelled-event-page,\n.manual-confirmation-page,\n.cancel-flow-page {\n padding: 1rem;\n height: 496px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.booked-event-page,\n.manual-confirmation-page,\n.cancelled-event-page,\n.cancel-flow-page {\n min-width: 784px;\n\n @media #{$mobile} {\n min-width: 90%;\n }\n\n background: var(--nylas-base-50);\n}\n\n.left-panel {\n display: flex;\n flex-direction: column;\n min-width: 424px;\n border-top-left-radius: inherit;\n background: var(--nylas-base-0);\n position: relative;\n padding: 1rem 0 0 0;\n height: 624px;\n\n @media #{$mobile} {\n border-top-right-radius: inherit;\n min-width: unset;\n height: auto;\n }\n}\n\n.select-date-page .left-panel {\n @media #{$mobile} {\n padding: 0.5rem 4px 0;\n height: 624px;\n }\n}\n\n.border {\n margin-left: -20px; // Offset left padding\n margin-right: -20px; // Offset right padding\n border-top-width: 1px;\n height: 0.5px;\n background-color: var(--nylas-base-200);\n\n @media #{$mobile} {\n display: none;\n }\n}\n\n.right-panel {\n min-width: 360px;\n width: 360px;\n background-color: var(--nylas-base-50);\n height: 624px;\n padding-top: 16px;\n border-left: 1px solid var(--nylas-base-200);\n border-top-right-radius: inherit;\n\n &.reschedule {\n border-top-right-radius: 0px;\n }\n\n @media #{$mobile} {\n border-top-right-radius: 0px;\n width: inherit;\n min-width: unset;\n height: auto;\n }\n\n h2 {\n display: flex;\n margin: 0;\n height: 48px;\n gap: 0.5rem;\n justify-content: center;\n align-items: center;\n width: auto;\n font-size: 1.125rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n color: var(--nylas-base-800);\n }\n}\n\n.additional-data-page {\n .left-panel {\n background-color: var(--nylas-base-50);\n }\n\n .right-panel {\n background-color: var(--nylas-base-0);\n }\n}\n\nnylas-selected-event-card {\n height: calc(640px - 36px);\n padding: 0 1rem;\n\n @media #{$mobile} {\n height: 250px;\n }\n}\n\n.footer {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n padding: 16px;\n font-size: 14px;\n font-weight: 300;\n color: var(--nylas-base-500);\n border-top: 1px solid var(--nylas-base-200);\n min-height: 24px;\n\n svg {\n fill: var(--nylas-base-500);\n }\n}\n\n.footer svg {\n margin-top: 1px;\n}\n\nnylas-selected-event-card::part(nsec__timezone) {\n position: absolute;\n bottom: 0;\n}\n\nnylas-notification {\n margin: 1.5rem;\n width: -webkit-fill-available;\n width: -moz-available;\n position: absolute;\n}\n\nnylas-locale-switch {\n position: absolute;\n padding: 18px 20px;\n bottom: 0;\n width: -webkit-fill-available;\n width: -moz-available;\n border-top: 1px solid var(--nylas-base-200);\n\n @media #{$mobile} {\n height: auto;\n }\n}\n\nnylas-date-picker {\n padding: 0 20px;\n}","import { NylasBaseProvider } from '@/common/abstract-provider';\nimport { RegisteredComponent } from '@/common/register-component';\nimport type { SchedulerEventOverride } from '@/common/component-types';\nimport { NylasSchedulerConnector } from '@/connector/nylas-scheduler-connector';\nimport { CreateNylasSchedulerStore, NylasSchedulerStoreState, NylasSchedulerStoreType } from '@/stores/scheduler-store';\nimport {\n NylasSchedulerBookingData,\n ThemeConfig,\n Notification,\n NotificationType,\n NylasSchedulerErrorResponse,\n Timeslot,\n NylasSchedulerResponse,\n NylasSuccessResponse,\n} from '@nylas/core';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { addDaysToCurrentDate, capitalizeFirstLetter, compactStringToUUIDs, debug } from '@/utils/utils';\nimport { SchedulerView } from './scheduler-view';\nimport { ErrorCategory } from '@/connector/nylas-scheduler-connector/errors';\nimport { MessageBanner } from './message-banner';\nimport i18next from '@/utils/i18n';\nimport { NylasEvent, UISettingsResponse } from '@/common/types';\nimport { LANGUAGE_CODE, LANGUAGE_CODE_MAP, Locale } from '@/common/constants';\n\nconst genericError = { title: i18next.t('genericErrorTitle'), type: NotificationType.Error, category: ErrorCategory.Component };\n\n/**\n * The `nylas-scheduling` component is used to display the Nylas Scheduling UI.\n *\n * @part ndp - [nylas-date-picker] The date picker host.\n * @part ndp__title - [nylas-date-picker] The title.\n * @part ndp__month-header - [nylas-date-picker] The month header.\n * @part ndp__month-button - [nylas-date-picker] The month button.\n * @part ndp__day - [nylas-date-picker] The day.\n * @part ndp__date - [nylas-date-picker] The date.\n * @part ndp__date--selected - [nylas-date-picker] The selected date.\n * @part ndp__date--current-day - [nylas-date-picker] The current day.\n * @part ndp__date--current-month - [nylas-date-picker] The dates in the current month.\n * @part ndp__date--disabled - [nylas-date-picker] The disabled dates.\n * @part ntp - [nylas-timeslot-picker] The timeslot picker component.\n * @part ntp__timeslot - [nylas-timeslot-picker] The timeslot button.\n * @part ntp__timeslot--selected - [nylas-timeslot-picker] The selected timeslot button.\n * @part ntp__button-primary - [nylas-timeslot-picker] The timeslot picker CTA.\n * @part nsec - [nylas-selected-event-card] The selected event card component.\n * @part nsec__card - [nylas-selected-event-card] The card component.\n * @part nsec__icon - [nylas-selected-event-card] The calendar icon.\n * @part nsec__date - [nylas-selected-event-card] The date selected.\n * @part nsec__time - [nylas-selected-event-card] The timeslot selected.\n * @part nbf - [nylas-booking-form] The booking form host.\n * @part nbf__input-textfield - [nylas-booking-form] The input textfield.\n * @part nbf__button-ghost - [nylas-booking-form] The ghost button.\n * @part nbf__button-outline - [nylas-booking-form] The outline button.\n * @part nbf__button-primary - [nylas-booking-form] The primary button.\n * @part nbf__input-wrapper - [nylas-booking-form] The input wrapper.\n * @part nbf__checkbox-component - [nylas-booking-form] The checkbox component.\n * @part nbf__radio-button-group - [nylas-booking-form] The radio button group.\n * @part nbf__textarea-component - [nylas-booking-form] The textarea component.\n * @part nbf__dropdown - [nylas-booking-form] The dropdown component.\n * @part nbf__dropdown-button - [nylas-booking-form] The dropdown button.\n * @part nbf__dropdown-content - [nylas-booking-form] The dropdown content.\n * @part ncec - [nylas-cancelled-event-card] The cancelled event card host.\n * @part ncec__icon - [nylas-cancelled-event-card] The calendar icon.\n * @part ncec__title - [nylas-cancelled-event-card] The title of the cancelled event card.\n * @part ncec__description - [nylas-cancelled-event-card] The description of the cancelled event card.\n * @part ncec__button-outline - [nylas-cancelled-event-card] The close button CTA.\n * @part ncec__card - [nylas-cancelled-event-card] The cancelled event card.\n * @part nbec - [nylas-booked-event-card] The booked event card host.\n * @part nbec__card - [nylas-booked-event-card] The booked event card.\n * @part nbec__title - [nylas-booked-event-card] The title of the booked event card.\n * @part nbec__description - [nylas-booked-event-card] The description of the booked event card.\n * @part nbec__button-outline - [nylas-booked-event-card] The cancel & reschedule button CTA.\n * @part nbec__cancel-cta - [nylas-booked-event-card] The cancel button CTA.\n * @part nbec__reschedule-cta - [nylas-booked-event-card] The reschedule button CTA.\n * @part nls - [nylas-locale-switch] The locale switch container.\n * @part nls__timezone - [nylas-locale-switch] The timezone select container\n * @part nls__timezone-dropdown - [nylas-locale-switch] The timezone dropdown\n * @part nls__timezone-drop-button - [nylas-locale-switch] The timezone dropdown button\n * @part nls__timezone-drop-button-selected-label - [nylas-locale-switch] The timezone dropdown button selected label\n * @part nls__timezone-drop-content - [nylas-locale-switch] The timezone dropdown content\n * @part nls__timezone-drop-label - [nylas-locale-switch] The timezone dropdown label\n * @part nls__language - [nylas-locale-switch] The language select container\n * @part nls__language-dropdown - [nylas-locale-switch] The language dropdown\n * @part nls__language-drop-button - [nylas-locale-switch] The language dropdown button\n * @part nls__language-drop-content - [nylas-locale-switch] The language dropdown content\n * @part nls__language-drop-label - [nylas-locale-switch] The language dropdown label\n * @part ncbf - [nylas-cancel-booking-form] The cancel booking form container.\n * @part ncbf__icon - [nylas-cancel-booking-form] The calendar icon.\n * @part ncbf__title - [nylas-cancel-booking-form] The title of the cancel booking form.\n * @part ncbf__description - [nylas-cancel-booking-form] The description of the cancel booking form.\n * @part ncbf__reason-textarea - [nylas-cancel-booking-form] The reason textarea.\n * @part ncbf__button-cta - [nylas-cancel-booking-form] The cancel booking form CTA button.\n * @part ncbf__button-outline - [nylas-cancel-booking-form] The cancel booking form outline button.\n * @part ncbf__card - [nylas-cancel-booking-form] The cancel booking form card.\n */\n@Component({\n tag: 'nylas-scheduling',\n styleUrl: 'nylas-scheduling.scss',\n shadow: true,\n})\nexport class NylasScheduling {\n /**\n * Stores to be used by the provider.\n */\n private stores?: { scheduler: NylasSchedulerStoreType };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Scheduler Connector instance.\n * The branins of the provider. It manages data fetching and state synchronization.\n */\n private nylasSchedulerConnector?: NylasSchedulerConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasSchedulingElement;\n\n /**\n * This is used to set the mode for the Nylas Scheduler.\n * The mode can be either `app` or `composable`. The default mode is `app`.\n * - `app`: This mode is used to show the default Nylas Scheduler UI.\n * - `composable`: This mode is used to show the composable Nylas Scheduler UI\n * by passing the individual scheduler components as children.\n */\n @Prop() readonly mode: 'app' | 'composable' = 'app';\n\n /**\n * The default scheduler store state.\n * Used to set the initial state of the scheduler store.\n */\n @Prop({ attribute: 'default-scheduler-store-state' }) readonly defaultSchedulerState?: Partial<NylasSchedulerStoreState>;\n\n /**\n * The session ID for the Nylas Scheduler.\n * This is used to authenticate the user.\n */\n @Prop() readonly sessionId?: string;\n\n /**\n * The URL for the Nylas Scheduler API. (staging or production URL)\n */\n @Prop() readonly schedulerApiUrl: string = 'https://api.us.nylas.com';\n\n /**\n * This enables passing the bookingInfo object to the Scheduler UI for direct booking event creation.\n * When used with timeslotConfirmedHandler, it bypasses the additional data page and immediately\n * invokes the handler after booking.\n */\n @Prop() readonly bookingInfo?: NylasSchedulerBookingData;\n\n /**\n * Booking Ref required for rescheduling flow.\n */\n @Prop() readonly rescheduleBookingRef?: string;\n\n /**\n * Booking Ref required for cancelling flow.\n */\n @Prop() readonly cancelBookingRef?: string;\n\n /**\n * Booking Ref required for the manual confirmation flow.\n */\n @Prop() readonly organizerConfirmationBookingRef?: string;\n\n /**\n * The config ID for the Nylas Scheduler. This should be passed in when using a public config,\n * in which case the sessionId is not required.\n */\n @Prop() readonly configurationId?: string;\n\n /**\n * The slug of the configuration (public config) to be used for the Nylas Scheduler. This is used in conjunction with the clientId.\n * When the configurationId is not provided, the slug and clientId are used to make requests to the Scheduler API endpoints.\n * If the configurationId is provided, this prop will be ignored.\n */\n @Prop() readonly slug?: string;\n\n /**\n * The app ID of the configuration (public config) to be used for the Nylas Scheduler. This is used in conjunction with the slug.\n * When the configurationId is not provided, the slug and clientId are used to make requests to the Scheduler API endpoints.\n * If the configurationId is provided, this prop will be ignored.\n */\n @Prop() readonly clientId?: string;\n\n /**\n * This prop lets you hide the Nylas branding.\n * Default is true.\n */\n @Prop() readonly nylasBranding?: boolean = true;\n\n /**\n * This provides an easy way to override the default function of the event emitter.\n * An example of this is the `timeslotConfirmed` event. By default, this event will set the scheduler store state for `showBookingForm` to `true` which will\n * show the booking form. However, if you want to override this behavior, you can pass in the prop `eventOverride` like:\n * ```html\n * <nylas-scheduling eventOverride={{\"timeslotConfirmed\": (event, nylasConnector) => { console.log(\"Timeslot confirmed event fired!\"); } }} />\n * ```\n */\n @Prop({ attribute: 'event-overrides' }) readonly eventOverrides: SchedulerEventOverride = {};\n\n /**\n * The loading state. This is used to set the loading state for the Nylas Scheduler when fetching data.\n */\n @Prop() readonly isLoading?: boolean;\n\n /**\n * Theme config, used to automatically generate a theme with color palette and\n * CSS variables to customize the look and feel of the Nylas Scheduler.\n */\n @Prop() readonly themeConfig?: ThemeConfig;\n\n /**\n * This prop will allow to override the default localization strings for each language.\n * Nylas scheduling page currently support the following language codes: en, es, fr, de, sv, zh, ja, nl.\n */\n @Prop() readonly localization?: Partial<Record<LANGUAGE_CODE, Locale>>;\n\n /*\n * Displays notifications for errors by default. When enabled (`true`), errors\n * automatically appear as notifications. Disabling this feature (`false`) allows\n * the parent application to capture and manage errors by listening to the\n * `nylasSchedulerError` event, providing flexibility in error handling.\n */\n @Prop() readonly showNotification?: boolean = true;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @State() automaticComponentRegistration: boolean = true;\n\n /**\n * The selected date label for the Nylas Scheduler.\n * This is used to set the initial date label for the Nylas Scheduler.\n */\n @State() selectedDateLabel: string = new Date().toLocaleDateString(undefined, { dateStyle: 'full' }) || `${i18next.t('noDateSelected')}`;\n\n /**\n * The config id extracted from the rescheduleBookingRef or cancelBookingRef or organizerConfirmationBookingRef.\n */\n @State() refConfigId?: string;\n\n /**\n * The selected language for the Nylas Scheduler.\n */\n @State() language: string = navigator.language;\n\n /**\n * This event is fired when the provider is initialized.\n * It can be used to set the initial state of the provider,\n * or to prevent the provider from firing some default behavior.\n */\n @Event({ cancelable: true }) init!: EventEmitter<HTMLNylasSchedulingElement>;\n\n /**\n * This event is fired when the scheduler component enters componentWillLoad lifecycle.\n */\n @Event() schedulerWillLoad!: EventEmitter<HTMLNylasSchedulingElement>;\n\n /**\n * This event is fired when the scheduler component enters componentDidLoad lifecycle.\n */\n @Event() schedulerDidLoad!: EventEmitter<HTMLNylasSchedulingElement>;\n\n @Event({\n eventName: 'nylasSchedulerError',\n })\n nylasSchedulerError!: EventEmitter<{ notification: Notification; host: HTMLElement }>;\n\n @Event({\n eventName: 'configSettingsLoaded',\n })\n configSettingsLoaded!: EventEmitter<{ settings: NylasSchedulerResponse<UISettingsResponse> }>;\n\n /**\n * This event is triggered if either the rescheduleBookingRef or cancelBookingRef or organizerConfirmationBookingRef prop\n * is supplied and the component has been attached to the DOM. It emits the configurationId\n * and bookingId derived from the rescheduleBookingRef or cancelBookingRef or organizerConfirmationBookingRef. Subscribe to this\n * event to obtain the extracted configurationId, which is necessary to generate the sessionID\n * for configurations that are not public.\n */\n @Event() bookingRefExtracted!: EventEmitter<{ configurationId: string; bookingId: string; salt?: string }>;\n\n /**\n * This event is triggered on successful booking request. It emits the event data.\n */\n @Event() bookedEventInfo!: EventEmitter<NylasSchedulerResponse<NylasEvent>>;\n\n /**\n * This function is called when the component is connected to the DOM.\n * At this point in the component lifecycle, the base provider has not yet\n * been initialized. So avoid using the base provider in this method or stores\n * in this method.\n */\n connectedCallback() {\n debug(`[nylas-scheduler] connectedCallback`);\n }\n\n async componentWillLoad() {\n debug(`[nylas-scheduler] Component will load`);\n\n // Emit the schedulerWillLoad event to allow the parent application to set the initial\n // state of the provider or to prevent the provider from firing some default behavior.\n const schedulerWillLoadEvent = this.schedulerWillLoad.emit(this.host);\n if ('schedulerWillLoad' in this.eventOverrides) {\n await this.eventOverrides.schedulerWillLoad(schedulerWillLoadEvent, this.nylasSchedulerConnector);\n if (schedulerWillLoadEvent.defaultPrevented) {\n return;\n }\n }\n\n this.stores = {\n scheduler: CreateNylasSchedulerStore({\n bookingInfo: this.bookingInfo,\n nylasBranding: this.nylasBranding,\n ...this.defaultSchedulerState,\n }),\n };\n\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n // Set the configId to the reschedule configId if rescheduleBookingRef is provided or\n // Set the configId to the cancel configId if cancelBookingRef is provided\n this.refConfigId = this.configurationId;\n let bookingRefExtractedEvent;\n if (this.rescheduleBookingRef) {\n const [rescheduleConfigId, rescheduleBookingId, _] = compactStringToUUIDs(this.rescheduleBookingRef);\n this.refConfigId = rescheduleConfigId;\n this.stores.scheduler.set('rescheduleBookingId', rescheduleBookingId);\n bookingRefExtractedEvent = this.bookingRefExtracted.emit({ configurationId: rescheduleConfigId, bookingId: rescheduleBookingId });\n } else if (this.cancelBookingRef) {\n const [cancelConfigId, cancelBookingId, _] = compactStringToUUIDs(this.cancelBookingRef);\n this.refConfigId = cancelConfigId;\n this.stores.scheduler.set('cancelBookingId', cancelBookingId);\n bookingRefExtractedEvent = this.bookingRefExtracted.emit({ configurationId: cancelConfigId, bookingId: cancelBookingId });\n } else if (this.organizerConfirmationBookingRef) {\n const [organizerConfirmationConfigId, organizerConfirmationBookingId, salt] = compactStringToUUIDs(this.organizerConfirmationBookingRef);\n this.refConfigId = organizerConfirmationConfigId;\n this.stores.scheduler.set('organizerConfirmationBookingId', organizerConfirmationBookingId);\n this.stores.scheduler.set('organizerConfirmationSalt', salt);\n bookingRefExtractedEvent = this.bookingRefExtracted.emit({ configurationId: organizerConfirmationConfigId, bookingId: organizerConfirmationBookingId, salt: salt });\n }\n\n if ('bookingRefExtracted' in this.eventOverrides) {\n await this.eventOverrides.bookingRefExtracted(bookingRefExtractedEvent, this.nylasSchedulerConnector);\n if (bookingRefExtractedEvent.defaultPrevented) {\n return;\n }\n }\n\n if (!this.checkIfSessionIdOrConfigIdExists()) {\n return;\n }\n\n const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');\n this.nylasSchedulerConnector = new NylasSchedulerConnector({\n schedulerAPIURL: this.schedulerApiUrl,\n sessionId: this.sessionId,\n configId: this.refConfigId,\n slug: this.slug,\n clientId: this.clientId,\n nylasSchedulerStore,\n });\n\n const initEvent = this.init.emit(this.host);\n if ('init' in this.eventOverrides) {\n await this.eventOverrides.init(initEvent, this.nylasSchedulerConnector);\n if (initEvent.defaultPrevented) {\n return;\n }\n }\n\n this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector);\n // Override theme\n this.applyThemeConfig(this.themeConfig);\n }\n\n async componentDidLoad() {\n this.baseProvider?.componentDidLoad();\n\n const schedulerDidLoadEvent = this.schedulerDidLoad.emit(this.host);\n if ('schedulerDidLoad' in this.eventOverrides) {\n await this.eventOverrides.schedulerDidLoad(schedulerDidLoadEvent, this.nylasSchedulerConnector);\n if (schedulerDidLoadEvent.defaultPrevented) {\n return;\n }\n }\n\n // If sessionId is not provided, do not fetch availability\n if (!this.checkIfSessionIdOrConfigIdExists()) {\n return;\n }\n this.localizationChanged(this.localization);\n const settingsResponse = await this.nylasSchedulerConnector?.scheduler.getUISettings();\n if (!settingsResponse || 'error' in settingsResponse) {\n this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(settingsResponse?.error) }, host: this.host });\n return;\n } else {\n if ('data' in settingsResponse && settingsResponse.data?.appearance) {\n console.info(\n 'Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.',\n );\n }\n const configSettingsLoadedEvent = this.configSettingsLoaded.emit({ settings: settingsResponse });\n if ('configSettingsLoaded' in this.eventOverrides) {\n await this.eventOverrides.configSettingsLoaded(configSettingsLoadedEvent, this.nylasSchedulerConnector);\n if (configSettingsLoadedEvent.defaultPrevented) {\n return;\n }\n }\n }\n\n const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');\n const availableDaysInFuture = nylasSchedulerStore?.get('configSettings')?.scheduler?.available_days_in_future;\n const selectedTimeslot = nylasSchedulerStore?.get('selectedTimeslot');\n\n if (selectedTimeslot && selectedTimeslot?.start_time) {\n if (!this.isTimeslotValid(selectedTimeslot)) {\n return;\n }\n\n // If the selected timeslot is already set, do not fetch availability\n if (nylasSchedulerStore?.get('showBookingForm')) {\n nylasSchedulerStore?.set('selectedDate', selectedTimeslot.start_time);\n return;\n }\n }\n\n const selectedDate = nylasSchedulerStore?.get('selectedDate');\n const availability = nylasSchedulerStore?.get('availability');\n let result;\n\n if (availability && availability.length > 0) {\n return;\n }\n\n if (!selectedDate) {\n const today = new Date();\n const { startTime, endTime, endTimeForAvailableDaysInFuture } = this.validateAvailableDaysInFuture(today, availableDaysInFuture || 30);\n if (today.getTime() < endTimeForAvailableDaysInFuture * 1000) {\n result = await this.nylasSchedulerConnector?.scheduler.getAvailability(startTime, endTime);\n }\n } else {\n const { startTime, endTime, endTimeForAvailableDaysInFuture } = this.validateAvailableDaysInFuture(selectedDate, availableDaysInFuture || 30);\n if (selectedDate.getTime() < endTimeForAvailableDaysInFuture * 1000) {\n result = await this.nylasSchedulerConnector?.scheduler.getAvailability(startTime, endTime);\n }\n }\n\n if (!result || 'error' in result) {\n this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(result?.error) }, host: this.host });\n }\n\n if (!selectedDate) {\n let _selectedDate = new Date();\n const firstAvailableDate = nylasSchedulerStore?.get('availability').find((timeslot: any) => new Date(timeslot.start_time) > new Date());\n if (firstAvailableDate) {\n _selectedDate = firstAvailableDate.start_time;\n }\n nylasSchedulerStore?.set('selectedDate', _selectedDate);\n }\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n @Watch('bookingInfo')\n bookingInfoChanged(newVal?: NylasSchedulerBookingData) {\n this.stores?.scheduler.set('bookingInfo', newVal);\n }\n\n @Watch('rescheduleBookingRef')\n rescheduleBookingRefChanged(newVal?: string) {\n if (newVal) {\n const [configId, bookingId] = compactStringToUUIDs(newVal);\n this.stores?.scheduler.set('rescheduleBookingId', bookingId);\n this.refConfigId = configId;\n this.nylasSchedulerConnector?.scheduler.setConfigId(configId);\n }\n }\n\n @Watch('cancelBookingRef')\n cancelBookingRefChanged(newVal?: string) {\n if (newVal) {\n const [configId, bookingId] = compactStringToUUIDs(newVal);\n this.stores?.scheduler.set('cancelBookingId', bookingId);\n this.refConfigId = configId;\n this.nylasSchedulerConnector?.scheduler.setConfigId(configId);\n }\n }\n\n @Watch('organizerConfirmationBookingRef')\n organizerConfirmationBookingRefChanged(newVal?: string) {\n if (newVal) {\n const [configId, bookingId] = compactStringToUUIDs(newVal);\n this.stores?.scheduler.set('organizerConfirmationBookingId', bookingId);\n this.refConfigId = configId;\n this.nylasSchedulerConnector?.scheduler.setConfigId(configId);\n }\n }\n\n @Watch('localization')\n localizationChanged(newVal?: Partial<Record<LANGUAGE_CODE, Locale>>) {\n if (!newVal) {\n return;\n }\n\n Object.keys(newVal).forEach(lang => {\n if (!(lang in LANGUAGE_CODE)) {\n return;\n }\n i18next.addResourceBundle(\n lang,\n 'translation',\n newVal[lang],\n false, // Merge with existing translations\n true, // Replace the existing translations with the same key\n );\n this.language = this.language;\n });\n }\n\n @Watch('themeConfig')\n themeConfigChanged(newVal?: ThemeConfig) {\n this.applyThemeConfig(newVal);\n }\n\n @Listen('languageChanged')\n languageChanged(event: CustomEvent<string>) {\n const newLanguage = event.detail;\n this.language = newLanguage;\n i18next.changeLanguage(newLanguage);\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to refetch the availability when the month is changed.\n */\n @Listen('monthChanged')\n async monthChangedHandler(event: CustomEvent<Date>) {\n const date = event.detail;\n const availableDaysInFuture = this.nylasSchedulerConnector?.schedulerStore?.get('configSettings')?.scheduler?.available_days_in_future;\n const { startTime, endTime, endTimeForAvailableDaysInFuture } = this.validateAvailableDaysInFuture(date, availableDaysInFuture || 30);\n\n if (startTime < endTimeForAvailableDaysInFuture && date.getTime() < endTimeForAvailableDaysInFuture * 1000) {\n const result = await this.nylasSchedulerConnector?.scheduler.getAvailability(startTime, endTime);\n\n if (!result || 'error' in result) {\n this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(result?.error) }, host: this.host });\n }\n const selectableDates = this.stores?.scheduler.get('selectableDates');\n if (selectableDates && selectableDates.length > 0) {\n this.stores?.scheduler.set('selectedDate', selectableDates[0]);\n }\n }\n }\n\n mapToBookingData(bookingInfo: NylasSchedulerBookingData): any {\n const timeslot = this.stores?.scheduler.get('selectedTimeslot');\n const language = this.stores?.scheduler.get('selectedLanguage');\n const timezone = this.stores?.scheduler.get('selectedTimezone');\n const startTime = timeslot?.start_time ? new Date(timeslot?.start_time).getTime() / 1000 : '';\n const endTime = timeslot?.end_time ? new Date(timeslot?.end_time).getTime() / 1000 : '';\n return {\n additional_guests: bookingInfo.guests,\n guest: bookingInfo.primaryParticipant,\n additional_fields: bookingInfo.additionalFields,\n start_time: startTime,\n end_time: endTime,\n email_language: language,\n timezone: timezone,\n };\n }\n\n /**\n * This is a custom event handler to book an event.\n */\n @Listen('detailsConfirmed')\n async bookButtonClickedHandler(event: CustomEvent<NylasSchedulerBookingData>) {\n const bookingData = event.detail;\n const mappedBookingData = this.mapToBookingData(bookingData);\n const storeRescheduleId = this.nylasSchedulerConnector?.schedulerStore?.get('rescheduleBookingId');\n const rescheduleBookingId = storeRescheduleId;\n if (rescheduleBookingId) {\n const result = await this.nylasSchedulerConnector?.scheduler.rescheduleBooking(rescheduleBookingId, bookingData);\n if (!result || 'error' in result) {\n this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(result?.error) }, host: this.host });\n }\n const resultData = (result as NylasSuccessResponse<NylasEvent>)?.data;\n const bookedEventInfoEvent = this.bookedEventInfo.emit({ ...result, data: { ...resultData, ...mappedBookingData } });\n if ('bookedEventInfo' in this.eventOverrides) {\n await this.eventOverrides.bookedEventInfo(bookedEventInfoEvent, this.nylasSchedulerConnector);\n }\n return;\n }\n const result = await this.nylasSchedulerConnector?.scheduler.bookTimeslot(bookingData);\n if (!result || 'error' in result) {\n this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(result?.error) }, host: this.host });\n }\n const resultData = (result as NylasSuccessResponse<NylasEvent>)?.data;\n const bookedEventInfoEvent = this.bookedEventInfo.emit({ ...result, data: { ...resultData, ...mappedBookingData } });\n if ('bookedEventInfo' in this.eventOverrides) {\n await this.eventOverrides.bookedEventInfo(bookedEventInfoEvent, this.nylasSchedulerConnector);\n }\n }\n\n /**\n * This is a custom event handler to update the selected date label.\n */\n @Listen('dateSelected')\n dateSelectedHandler(event: CustomEvent<Date>) {\n const date = event.detail;\n this.selectedDateLabel = date ? date.toLocaleDateString(undefined, { dateStyle: 'full' }) : `${i18next.t('noDateSelected')}`;\n }\n\n /**\n * This is an event handler to handle the error (if any) when the\n * cancel booking button is clicked on the cancel booking form.\n */\n @Listen('cancelBookedEventError')\n cancelBookedEventErrorHandler(event: CustomEvent<NylasSchedulerErrorResponse>) {\n this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(event.detail.error) }, host: this.host });\n }\n\n @Listen('cancelBookedEventValidationError')\n cancelBookedEventValidationErrorHandler(event: CustomEvent<NylasSchedulerErrorResponse>) {\n this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(event.detail.error) }, host: this.host });\n }\n\n /**\n * This is an event handler to handle the error (if any) when the\n * reschedule button is clicked on the booked event card.\n */\n @Listen('rescheduleBookedEventError')\n rescheduleBookedEventErrorHandler(event: CustomEvent<NylasSchedulerErrorResponse>) {\n this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(event.detail.error) }, host: this.host });\n }\n\n /**\n * This is an event handler to handle the error (if any) when the\n * manual confirmation button is clicked on the manual confirmation card.\n */\n @Listen('confirmBookingError')\n confirmBookingErrorHandler(event: CustomEvent<NylasSchedulerErrorResponse>) {\n this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(event.detail.error) }, host: this.host });\n }\n\n /**\n * This method is used to retrieve the NylasScheduler instance\n * @returns The NylasScheduler instance\n */\n @Method()\n async getNylasSchedulerStore(): Promise<NylasSchedulerStoreType | undefined> {\n return this.baseProvider?.getStore('scheduler');\n }\n\n /**\n * This method is used to retrieve the NylasConnector instance\n * @returns The NylasConnector instance\n */\n @Method()\n async getNylasSchedulerConnector() {\n return this.nylasSchedulerConnector;\n }\n\n @Method()\n async getRef() {\n return this.host;\n }\n\n private getErrorObject(error: NylasSchedulerErrorResponse['error']): Notification {\n return {\n title: error?.title || genericError.title,\n category: error?.category || genericError.category,\n type: NotificationType.Error,\n description: error?.message || '',\n id: new Date().getTime().toString(),\n ttl: 'none',\n };\n }\n private checkIfSessionIdOrConfigIdExists(): boolean {\n if (!this.sessionId && !this.refConfigId && !(this.slug && this.clientId)) {\n let description = '';\n\n if (!this.sessionId) {\n description += i18next.t('sessionIdRequiredErrorMessage');\n }\n\n if (!this.sessionId && !this.refConfigId && !(this.slug && this.clientId)) {\n description = i18next.t('sessionIdRequiredErrorMessage') + ' ' + i18next.t('publicConfigErrorMessage');\n }\n\n this.nylasSchedulerError.emit({\n notification: {\n title: i18next.t('schedulingComponentErrorTitle'),\n category: ErrorCategory.Component,\n type: NotificationType.Error,\n description: description,\n id: new Date().getTime().toString(),\n ttl: 'none',\n },\n host: this.host,\n });\n return false;\n }\n return true;\n }\n\n private isTimeslotValid(timeslot: Timeslot): boolean {\n const selectedDate = new Date(timeslot.start_time);\n if (selectedDate < new Date()) {\n this.nylasSchedulerError.emit({\n notification: {\n title: i18next.t('invalidTimeslotErrorTitle'),\n category: ErrorCategory.Component,\n type: NotificationType.Error,\n description: i18next.t('invalidTimeslotErrorMessage'),\n id: new Date().getTime().toString(),\n ttl: 'none',\n },\n host: this.host,\n });\n return false;\n }\n return true;\n }\n\n private validateAvailableDaysInFuture(\n startDate: Date,\n availableDaysInFuture: number,\n ): {\n startTime: number;\n endTime: number;\n endTimeForAvailableDaysInFuture: number;\n } {\n const today = new Date();\n const startTime = new Date(startDate.getFullYear(), startDate.getMonth(), 1).getTime() / 1000;\n const endTimeForCurrentMonth = new Date(startDate.getFullYear(), startDate.getMonth() + 1, 1).getTime() / 1000;\n const endTimeForAvailableDaysInFuture = Math.floor(addDaysToCurrentDate(today, availableDaysInFuture).getTime() / 1000);\n const endTime = Math.min(endTimeForAvailableDaysInFuture, endTimeForCurrentMonth);\n const startTimeWithOffset = startTime < today.getTime() / 1000 ? Math.floor(today.getTime() / 1000) : startTime;\n return { startTime: startTimeWithOffset, endTime, endTimeForAvailableDaysInFuture };\n }\n\n private applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n /**\n * @slot timeslot-picker-cta-label - This slot is used to pass a custom label to the timeslot picker CTA. The default label is \"Next\".\n * @slot custom-booking-form - This slot is used to pass a custom booking form to the Nylas Scheduling component.\n * @deprecated Deprecated in favor of using the additional fields defined in the config settings.\n */\n render() {\n const showDefaultScheduler = this.mode === 'app';\n const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');\n const eventInfo = nylasSchedulerStore?.get('eventInfo');\n const showBookingForm = nylasSchedulerStore?.get('showBookingForm');\n const cancelledEventInfo = nylasSchedulerStore?.get('cancelledEventInfo');\n const cancelBookingId = nylasSchedulerStore?.get('cancelBookingId');\n const selectedTimeslot = nylasSchedulerStore?.get('selectedTimeslot') as Timeslot;\n const rescheduleBookingId = nylasSchedulerStore?.get('rescheduleBookingId');\n const organizerConfirmationBookingId = nylasSchedulerStore?.get('organizerConfirmationBookingId');\n const rejectBookingId = nylasSchedulerStore?.get('rejectBookingId');\n const confirmedEventInfo = nylasSchedulerStore?.get('confirmedEventInfo');\n const nylasBranding = nylasSchedulerStore?.get('nylasBranding') || this.nylasBranding;\n const selectedDate = nylasSchedulerStore?.get('selectedDate');\n const redirectUrl = nylasSchedulerStore?.get('configSettings')?.scheduler?.confirmation_redirect_url;\n this.selectedDateLabel =\n selectedDate && this.language\n ? capitalizeFirstLetter(selectedDate.toLocaleDateString(LANGUAGE_CODE_MAP[this.language], { dateStyle: 'full' }))\n : `${i18next.t('noDateSelected')}`;\n\n if (showDefaultScheduler && (cancelBookingId || rejectBookingId) && !cancelledEventInfo) {\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n <div class=\"cancel-flow-page\" part=\"cancel-flow-page\">\n <nylas-cancel-booking-form\n selectedTimeslot={selectedTimeslot}\n cancelBookingId={cancelBookingId}\n rejectBookingId={rejectBookingId}\n exportparts=\"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card\"\n />\n </div>\n </SchedulerView>\n </Host>\n );\n }\n\n // Manual confirmation page is shown when the event is manually confirmed\n if (showDefaultScheduler && organizerConfirmationBookingId) {\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n <div class=\"manual-confirmation-page\" part=\"manual-confirmation-page\">\n <nylas-organizer-confirmation-card\n organizerConfirmationBookingId={organizerConfirmationBookingId}\n exportparts=\"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline\"\n />\n </div>\n </SchedulerView>\n </Host>\n );\n }\n\n // Cancelled event card is shown when the event is cancelled\n if (showDefaultScheduler && cancelledEventInfo) {\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n <div class=\"cancelled-event-page\" part=\"cancelled-event-page\">\n <nylas-cancelled-event-card\n cancelledEventInfo={cancelledEventInfo}\n exportparts=\"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card\"\n />\n </div>\n </SchedulerView>\n </Host>\n );\n }\n\n // Confirmed event card is shown when the event is confirmed\n if (showDefaultScheduler && confirmedEventInfo) {\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n <div class=\"cancelled-event-page\" part=\"confirmed-event-page\">\n <nylas-confirmed-event-card\n confirmedEventInfo={confirmedEventInfo}\n exportparts=\"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card\"\n />\n </div>\n </SchedulerView>\n </Host>\n );\n }\n\n // Redirected to custom URL when the event is booked and redirect URL is provided\n if (showDefaultScheduler && eventInfo && redirectUrl) {\n window.location.assign(redirectUrl);\n return;\n }\n\n // Booked event card is shown when the event is booked or booking is sent\n if (showDefaultScheduler && eventInfo) {\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n <div class=\"booked-event-page\" part=\"booked-event-page\">\n <nylas-booked-event-card\n selectedTimeslot={selectedTimeslot}\n eventInfo={eventInfo}\n exportparts=\"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta\"\n />\n </div>\n </SchedulerView>\n </Host>\n );\n }\n // Date and time picker is shown when the event is not booked and no additional data is shown\n if (showDefaultScheduler && (!eventInfo || !!rescheduleBookingId) && !showBookingForm) {\n const timeslotPickerCTALabel = this.host.querySelector('[slot=\"timeslot-picker-cta-label\"]');\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n {rescheduleBookingId && <MessageBanner>{`${i18next.t('rescheduleTitle')}`}</MessageBanner>}\n <div class=\"select-date-page\" part=\"select-date-page\">\n <div class=\"left-panel\">\n <nylas-date-picker exportparts=\"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month\"></nylas-date-picker>\n <nylas-locale-switch exportparts=\"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label\"></nylas-locale-switch>\n </div>\n <div class={`right-panel ${rescheduleBookingId ? 'reschedule' : ''}`}>\n <h2>\n <calendar-icon></calendar-icon>\n <span id=\"selectedDate\">{this.selectedDateLabel}</span>\n </h2>\n <nylas-timeslot-picker exportparts=\"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary\">\n {timeslotPickerCTALabel && (\n <span slot=\"timeslot-picker-cta-label\">\n <slot name=\"timeslot-picker-cta-label\"></slot>\n </span>\n )}\n </nylas-timeslot-picker>\n </div>\n </div>\n </SchedulerView>\n </Host>\n );\n }\n // Additional data is shown when the time is selected, event is not booked and additional data is shown\n if (showDefaultScheduler && !eventInfo && showBookingForm) {\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n {rescheduleBookingId && <MessageBanner>{`${i18next.t('rescheduleTitle')}`}</MessageBanner>}\n <div class=\"additional-data-page\" part=\"additional-data-page\">\n <div class=\"left-panel\">\n <div class=\"wrapper\">\n <nylas-selected-event-card exportparts=\"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone\"></nylas-selected-event-card>\n </div>\n </div>\n <div class={`right-panel ${rescheduleBookingId ? 'reschedule' : ''}`}>\n <nylas-booking-form exportparts=\"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content\"></nylas-booking-form>\n </div>\n </div>\n </SchedulerView>\n </Host>\n );\n }\n\n return (\n <Host>\n <slot />\n </Host>\n );\n }\n}\n"],"mappings":"gUAgBaA,EAUX,WAAAC,EAAYC,gBAAEA,EAAeC,oBAAEA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Bb,KAAKa,kBAC5F8C,GAAuB5C,EAACG,EAAa,KAAE,GAAGM,EAAQC,EAAE,sBACrDV,EAAA,OAAKE,MAAM,uBAAuB0L,KAAK,wBACrC5L,EAAA,OAAKE,MAAM,cACTF,EAAA,OAAKE,MAAM,WACTF,EAAA,6BAA2B6L,YAAY,2EAG3C7L,EAAA,OAAKE,MAAO,eAAe0C,EAAsB,aAAe,MAC9D5C,EAAA,sBAAoB6L,YAAY,yP,CAQ5C,OACE7L,EAAC2L,EAAI,KACH3L,EAAA,a"}
@@ -0,0 +1,2 @@
1
+ import{r as e,c as t,h as n,H as a,a as i,F as o}from"./p-68c2fadf.js";import{R as r}from"./p-ec824acf.js";import{a as s,i as c,l,x as d,y as f,j as b,z as p,A as h,C as u,D as m,E as y,F as g}from"./p-c6fcb288.js";import{T as v,a as k,g as x,b as w}from"./p-d4353a55.js";import"./p-cb65c223.js";const _=":host{display:block}.nylas-booked-event-card{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 0;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400;border-bottom:1px solid var(--nylas-base-200);width:inherit;padding:0 0 1.5rem}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booked-event-header .card-description{text-align:center}.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}.button-container{width:inherit}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);border-top:1px solid var(--nylas-base-200);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}";const C=_;var j=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var z=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const L=class{constructor(n){e(this,n);this.cancelBookingButtonClicked=t(this,"cancelBookingButtonClicked",7);this.rescheduleButtonClicked=t(this,"rescheduleButtonClicked",7);this.rescheduleBookedEventError=t(this,"rescheduleBookedEventError",7);this.cancelBookedEventValidationError=t(this,"cancelBookedEventValidationError",7);this.handleCancelBookingButtonClicked=()=>{const e=new Date(this.selectedTimeslot.start_time);const t=this.configSettings?.scheduler?.min_cancellation_notice;const n=e.getTime()-t*60*1e3;if(n<(new Date).getTime()){this.cancelBookedEventValidationError.emit({error:{title:"Cancellation Error",message:`You cannot cancel the booking within ${t} 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.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;this.isLoading=undefined;this.selectedLanguage=navigator.language}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){s(`[nylas-booked-event-card] Component will load`)}async componentDidLoad(){s(`[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(){const e=this.configSettings?.booking_type;const t=e&&e!=="booking";return n(a,{key:"6780a2a0b1c59efc4311278e85e6800f72ab6a98",part:"nbec"},n("div",{key:"eed7c01aaaca8c92a65beccac1242efe1194f4a3",class:"nylas-booked-event-card"},n("div",{key:"f20609db6794c30012f299017b01bf63752b6b7f",class:"booked-event-timezone"},n("globe-icon",{key:"e2f277abf894b2c34e32f4cec4309e81a1b6e19b"}),v[this.selectedTimezone]),n("div",{key:"84c8bcdc7f247eade07d502cd480430cfb2894fd",class:"event-card-wrapper",part:"nbec__card"},n("div",{key:"58835f4e2b261dff59e212573a2391cac9217cb6",class:"calendar-icon"},n("calendar-check-icon",{key:"53e406d85941c03c7d0c7c5e86e071f948fe85bd"})),n("div",{key:"0e16b5cabfe5afcea5fd15fefbf88ed2558c5492",class:"booked-event-header"},n("h2",{key:"8ad08c13c5860cf47b217cc9c6d82dddb0940894",slot:"card-title",part:"nbec__title"},!!this.rescheduleBookingId&&!this.isLoading?`${c.t("bookingRescheduled")}`:t&&!this.isLoading?`${c.t("bookingSent")}`:`${c.t("bookingConfirmed")}`,"!"),n("div",{key:"07a056ef47e7d3c173c7ad67acedc5b94748d28f",class:"card-description",part:"nbec__description"},t?c.t("bookingSentDescription"):n("span",null,c.t("bookingConfirmedDescription")))),n("div",{key:"4d4f43295cef324b63b3d5fa6f3476dcf3163d25",class:"booking-date-time"},n("checkmark-circle-icon",{key:"2c717204ed669e40898c8b23dd408e3c62608e8f"}),n("h3",{key:"1a2ec41f82e740d9bdbac8fe1a818454e402db2f"},c.t("bookingDateAndTimeHeader")),n("p",{key:"1451ecae33ccfbe9f0bc4b682d90a64313f1120c"},this.selectedTimeslot?.start_time?l(new Date(this.selectedTimeslot?.start_time).toLocaleDateString(k[this.selectedLanguage],{dateStyle:"full"})):"-"," ",n("br",{key:"df6922d0097f6d3aa7b17dee26a7903e89c9258c"}),new Date(this.selectedTimeslot?.start_time).toLocaleTimeString(undefined,{timeStyle:"short"})," -"," ",new Date(this.selectedTimeslot?.end_time).toLocaleTimeString(undefined,{timeStyle:"short"}))),n("div",{key:"6e4264737dc50225feeec5374a6bec91de77a0ea",class:"booking-participants"}),!t&&n("div",{class:"button-container"},n("div",{class:{footer:true,"no-footer":this.configSettings?.scheduler?.hide_cancellation_options&&this.configSettings?.scheduler?.hide_rescheduling_options||this.configSettings?.booking_type==="organizer-confirmation","no-template-cols":this.configSettings?.scheduler?.hide_cancellation_options||this.configSettings?.scheduler?.hide_rescheduling_options}},!this.configSettings?.scheduler?.hide_cancellation_options&&n("button-component",{variant:"destructive",onClick:this.handleCancelBookingButtonClicked,part:"nbec__button-outline nbec__cancel-cta"},`${c.t("cancelBookingButton")}`),!this.configSettings?.scheduler?.hide_rescheduling_options&&n("button-component",{variant:"basic",onClick:this.handleRescheduleButtonClicked,part:"nbec__button-outline nbec__reschedule-cta"},`${c.t("rescheduleBookingButton")}`))))))}};j([r({name:"nylas-booked-event-card",stateToProps:new Map([["scheduler.bookingInfo","bookingInfo"],["scheduler.rescheduleBookingId","rescheduleBookingId"],["scheduler.selectedTimezone","selectedTimezone"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.isLoading","isLoading"],["scheduler.selectedLanguage","selectedLanguage"],["scheduler.configSettings","configSettings"]]),eventToProps:{cancelBookingButtonClicked:async(e,t)=>{t.scheduler.setCancel(e.detail.bookingId)},rescheduleButtonClicked:async(e,t)=>{const n=await t.scheduler.setReschedule(e.detail.bookingId);const{errorHandler:a}=e.detail;if(a&&(!n||"error"in n)){a(n)}},rescheduleBookedEventError:async(e,t)=>{s("nylas-booked-event-card","rescheduleBookedEventError",e.detail)},cancelBookedEventValidationError:async(e,t)=>{s("nylas-booked-event-card","cancelBookedEventValidationError",e.detail)}},fireRegisterEvent:true}),z("design:type",Function),z("design:paramtypes",[]),z("design:returntype",void 0)],L.prototype,"render",null);L.style=C;const R=":host{display:block;height:100%}.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:grid;grid-template-columns:1fr 1fr;gap:0.5rem;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{grid-template-columns:1fr}}.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}.button-content{display:flex;gap:4px;align-items:center}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]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}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}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}button-component.back button{--dot-color:var(--nylas-base-800)}.guest-email-input{position:relative;display:flex;width:100%}";const B=R;var E=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var D=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const I=/^[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 S=class{constructor(n){e(this,n);this.nameChanged=t(this,"nameChanged",7);this.emailChanged=t(this,"emailChanged",7);this.backButtonClicked=t(this,"backButtonClicked",7);this.detailsConfirmed=t(this,"detailsConfirmed",7);this.bookingFormError=t(this,"bookingFormError",7);this.bookingFormSubmitted=t(this,"bookingFormSubmitted",7);this.handleGuestChange=(e,t)=>{this.resetGuestEmailError(e);const n=[...this.guestEmails];n[e]=d(t);this.guestEmails=[...n]};this.handleGuestBlur=(e,t)=>{this.resetGuestEmailError(e);if(t===""){this.guestEmailErrors[e]=c.t("fieldRequired",{field:c.t("email")});return}if(!I.test(t)){this.guestEmailErrors[e]=c.t("invalidInputFormat",{field:c.t("email")});return}this.handleGuestChange(e,t)};this.addGuestButtonClickedHandler=e=>{e.preventDefault();this.guestEmails=[...this.guestEmails,""]};this.removeGuestButtonClickHandler=(e,t)=>{e.preventDefault();this.resetGuestEmailError(t);const n=[...this.guestEmails];n.splice(t,1);this.guestEmails=[...n]};this.handleBackButtonClicked=e=>{e.preventDefault();this.backButtonLoading=true;this.backButtonClicked.emit()};this.bookButtonClickedHandler=async e=>{e.preventDefault();const t=this.bookingFormSubmitted.emit();if(t.defaultPrevented){return}s("nylas-booking-form","bookButtonClickedHandler",this.bookingInfo);const n=this.name||this.bookingInfo?.primaryParticipant?.name;const a=this.email||this.bookingInfo?.primaryParticipant?.email;if(!n||n===""){this.isNameValid=false;this.validationError.name=c.t("fieldRequired",{field:c.t("name")})||"Name is required";this.bookingFormError.emit({title:"Booking form error",description:"Name is required"});return}if(!a||a===""){this.isEmailValid=false;this.validationError.email=c.t("fieldRequired",{field:c.t("email")})||"Email is required";this.bookingFormError.emit({title:"Booking form error",description:"Email is required"});return}if(!I.test(a)){this.isEmailValid=false;this.validationError.email=c.t("invalidInputFormat",{field:c.t("email")});this.bookingFormError.emit({title:"Booking form error",description:c.t("invalidInputFormat",{field:c.t("email")})||"Invalid email"});return}let i=[];if(this.guestEmails.length>0){let e=false;this.guestEmails.forEach(((t,n)=>{if(t===""){e=true;this.guestEmailErrors={...this.guestEmailErrors,[n]:c.t("fieldRequired",{field:c.t("email")})}}else if(!I.test(t)){e=true;this.guestEmailErrors={...this.guestEmailErrors,[n]:c.t("invalidInputFormat",{field:c.t("email")})}}}));if(e){this.bookingFormError.emit({title:"Booking form error",description:c.t("invalidInputFormat",{field:c.t("guestEmail")})||"Invalid guest email"});return}i=this.guestEmails.map((e=>({name:e.trim(),email:e.trim()})))}else if(this.bookingInfo?.guests){i=this.bookingInfo?.guests}const o=this.bookingInfo?.additionalFields||[];this.detailsConfirmed.emit({primaryParticipant:{name:n,email:a},guests:i,additionalFields:{...o,...this.additionalFields}})};this.updateAdditionalFields=(e,t)=>{if(this.additionalFields){this.additionalFields[e]=t}};this.isLoading=undefined;this.bookingInfo=undefined;this.eventInfo=undefined;this.configSettings=undefined;this.name="";this.email="";this.guestEmails=[];this.guestEmailErrors={};this.isNameValid=true;this.isEmailValid=true;this.additionalFields={};this.validationError={name:"",email:""};this.backButtonLoading=false}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){s("nylas-booking-form","componentWillLoad",this.bookingInfo);if(this.bookingInfo&&this.bookingInfo?.primaryParticipant){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=f(e);this.nameChanged.emit(e)}changeEmail(e){this.isEmailValid=true;this.validationError.email="";this.email=d(e);this.emailChanged.emit(e)}resetGuestEmailError(e){const t={...this.guestEmailErrors};delete t[e];this.guestEmailErrors={...t}}nylasFormInputChangedHandler(e){switch(e.detail.name){case"name":this.changeName(e.detail.value);break;case"email":this.changeEmail(e.detail.value);break;default:if(e.detail.error){this.bookingFormError.emit({title:"Booking form error",description:e.detail.error});return}this.updateAdditionalFields(e.detail.name,e.detail.value);break}}selectOptionChangedHandler(e){if(e.detail.error){this.bookingFormError.emit({title:"Booking form error",description:e.detail.error});return}this.updateAdditionalFields(e.detail.name,e.detail.value)}switchToggledHandler(e){this.updateAdditionalFields(e.detail.name,e.detail.checked?"true":"false")}checkboxToggledHandler(e){this.updateAdditionalFields(e.detail.name,e.detail.checked?"true":"false")}radioChangedHandler(e){this.updateAdditionalFields(e.detail.name,e.detail.value)}dropdownDefaultSelectedHandler(e){this.updateAdditionalFields(e.detail.name,e.detail.value)}render(){return n(a,{key:"e6226715a8817b1ac42f46e3efd78cc2aa1d413c"},n("form",{key:"d6e4aff3c6f9b978bef7cc7c1becdd8f84f2897d",onSubmit:e=>this.bookButtonClickedHandler(e),noValidate:true},n("div",{key:"c3561940f06b86fab4eb248626cb63a09cbf1353",class:"nylas-booking-form",part:"nbf"},n("div",{key:"02072469ac898b656c9829c484a24415d9e8e597",class:"input-wrapper",part:"nbf__input-wrapper"},n("input-component",{key:"301574dd5c31489404efc426bc41d413b659c0a4",label:c.t("name"),name:"name",id:"name",defaultValue:this.bookingInfo?.primaryParticipant?.name||this.name,placeholder:c.t("namePlaceholder"),type:"text",required:true,requiredError:c.t("fieldRequired",{field:c.t("name")}),patternError:c.t("invalidInputFormat",{field:c.t("name")}),part:"nbf__input-textfield"})),n("div",{key:"af992058321d3efbc622e335400da283123fe54c",class:"input-wrapper",part:"nbf__input-wrapper"},n("input-component",{key:"3815bf80434a7178dcdc75fde5ee80db5c651179",label:c.t("email"),name:"email",id:"email",pattern:I,defaultValue:this.bookingInfo?.primaryParticipant?.email||this.email,placeholder:c.t("emailPlaceholder"),type:"email",required:true,requiredError:c.t("fieldRequired",{field:c.t("email")}),patternError:c.t("invalidInputFormat",{field:c.t("email")}),part:"nbf__input-textfield"})),this.configSettings?.scheduler?.hide_additional_guests!==true&&n("div",{class:"input-wrapper",part:"nbf__input-wrapper"},this.guestEmails.map(((e,t)=>n("div",{class:"input-wrapper button-wrapper"},n("label",{class:{error:!!this.guestEmailErrors[t]}},c.t("guestEmail")),n("div",{class:"guest-email-input"},n("input",{type:"email",id:`guest-email-${t}`,maxLength:100,class:{"guest-email":true,error:!!this.guestEmailErrors[t]},placeholder:c.t("guestEmailPlaceholder"),value:e,"data-index":t,part:"nbf__input-textfield",onBlur:e=>this.handleGuestBlur(t,e.target?.value),onInput:e=>this.handleGuestChange(t,e.target?.value)}),n("button-component",{variant:"basic",onClick:e=>this.removeGuestButtonClickHandler(e,t),class:{"remove-guest":true,error:!!this.guestEmailErrors[t]}},n("close-icon",null))),n("p",{class:"help-text"},this.guestEmailErrors[t])))),n("button-component",{class:"add-guest",variant:"invisible",part:"nbf__button-ghost",onClick:e=>this.addGuestButtonClickedHandler(e)},n("div",{class:"button-content"},n("add-circle-icon",{slot:"icon"}),this.guestEmails.length>0?`${c.t("addAnotherGuest")}`:`${c.t("addGuest")}`))),Object.entries(this.configSettings?.scheduler?.additional_fields||{})?.sort(((e,t)=>e[1].order-t[1].order)).map((e=>{const t=e[1];const a=t.label;const i=e[0];const o=this.bookingInfo?.additionalFields?.[i]?.value||"";switch(t.type){case"dropdown":return n("div",{class:"input-wrapper",part:"nbf__input-wrapper"},n("select-dropdown",{label:a,name:i,id:i,withSearch:false,defaultSelectedOption:o?{value:o,label:o}:undefined,options:t.options?.map((e=>({value:e,label:e}))),required:t.required,exportparts:"sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content"}));case"checkbox":return n("div",{class:"input-wrapper",part:"nbf__input-wrapper"},n("checkbox-component",{label:a,name:i,id:i,checked:o==="true",required:t.required,part:"nbf__checkbox-component"}));case"radio_button":return n("div",{class:"input-wrapper",part:"nbf__input-wrapper"},n("radio-button-group",{label:a,name:i,id:i,defaultSelectedValue:o||t.options?.[0]||"",options:t.options?.map((e=>({value:e,label:e}))),required:t.required,part:"nbf__radio-button-group"}));case"multi_line_text":return n("div",{class:"input-wrapper",part:"nbf__input-wrapper"},n("textarea-component",{label:a,defaultValue:o,name:i,id:i,required:t.required,part:"nbf__textarea-component"}));default:return n("div",{class:"input-wrapper",part:"nbf__input-wrapper"},n("input-component",{label:a,name:i,id:i,type:t.type,defaultValue:o||"",requiredError:c.t("fieldRequired",{field:a}),required:t.required,part:"nbf__input-textfield"}))}}))),n("div",{key:"0f18461673aa4542e73b9316509aa7b5a2fba6f3",class:"cta"},n("button-component",{key:"7041a279f4acc3fb2029321dec40b9fffd9d9a6d",variant:"basic",class:"back",part:"nbf__button-outline",isLoading:this.backButtonLoading&&this.isLoading,onClick:this.handleBackButtonClicked},n("slot",{key:"6bf9092b2143c0b48cf56f2159d91283f804c3a3",name:"booking-form-back-label"},`${c.t("backButton")}`)),n("button-component",{key:"2e97b28476b04ede3687737c78bfa6a8814b42c9",variant:"primary",isLoading:!this.backButtonLoading&&this.isLoading,disabled:this.isLoading,part:"nbf__button-primary",type:"submit"},n("slot",{key:"e708cfa7c230cced4f75c814a660af51a1b8dfe4",name:"booking-form-book-label"},`${c.t("bookNowButton")}`)))))}get host(){return i(this)}static get watchers(){return{bookingInfo:["bookingInfoChangedHandler"]}}};E([r({name:"nylas-booking-form",stateToProps:new Map([["scheduler.isLoading","isLoading"],["scheduler.bookingInfo","bookingInfo"],["scheduler.eventInfo","eventInfo"],["scheduler.configSettings","configSettings"]]),eventToProps:{backButtonClicked:async(e,t)=>{t.scheduler.toggleAdditionalData(false)},nameChanged:async(e,t)=>{t.scheduler.setParticipantName(e.detail)},emailChanged:async(e,t)=>{t.scheduler.setParticipantEmail(e.detail)},detailsConfirmed:async(e,t)=>{s("nylas-booking-form","detailsConfirmed",e.detail)},bookingFormSubmitted:async(e,t)=>{s("nylas-booking-form","bookingFormSubmitted",e.detail)},bookingFormError:async(e,t)=>{s("nylas-booking-form","bookingFormError",e.detail)}},fireRegisterEvent:true}),D("design:type",Function),D("design:paramtypes",[]),D("design:returntype",void 0)],S.prototype,"render",null);S.style=B;const T=":host{display:block;width:400px;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 form{width:100%}.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);padding-bottom:1.25rem}.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%}.footer{display:grid;grid-template-columns:1fr 1fr;width:100%;padding-top:1.25rem;gap:1rem;border-top:1px solid var(--nylas-base-200);margin-top:1.25rem}";const $=T;var F=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var H=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const M=class{constructor(n){e(this,n);this.goBackButtonClicked=t(this,"goBackButtonClicked",7);this.cancelBookingFormSubmitted=t(this,"cancelBookingFormSubmitted",7);this.triggerValidation=t(this,"triggerValidation",7);this.cancelBookedEventError=t(this,"cancelBookedEventError",7);this.cancelBookingFormError=t(this,"cancelBookingFormError",7);this.handleGoBackClicked=()=>{this.goBackButtonClicked.emit()};this.handleSubmitCancelBooking=e=>{this.triggerValidation.emit({});e.preventDefault();if(!this.cancellationReason){this.cancellationError=c.t("cancellationErrorMessage");this.cancelBookingFormError.emit({title:c.t("cancelBokingFormError"),description:c.t("cancellationErrorMessage")});return}const t=this.configSettings?.scheduler?.min_cancellation_notice;if(this.selectedTimeslot&&t){const e=new Date(this.selectedTimeslot?.start_time);const n=e.getTime()-t*60*1e3;if(n<(new Date).getTime()){this.cancelBookedEventError.emit({error:{title:c.t("cancellationErrorTitle"),message:c.t("minimumCancellationNoticeErrorMessage",{minCancellationNotice:t})}});return}}s(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);const n=e=>{this.cancelBookedEventError.emit(e)};if(this.cancelBookingId){this.cancelBookingFormSubmitted.emit({bookingId:this.cancelBookingId,action:"cancel",reason:this.cancellationReason,errorHandler:n})}else if(this.rejectBookingId){this.cancelBookingFormSubmitted.emit({bookingId:this.rejectBookingId,action:"reject",reason:this.cancellationReason,errorHandler:n})}};this.cancelBookingId=undefined;this.rejectBookingId=undefined;this.configSettings=undefined;this.eventInfo=undefined;this.selectedTimeslot=undefined;this.isLoading=undefined;this.cancellationReason="";this.cancellationError="";this.cancellationPolicy=this.configSettings?.scheduler?.cancellation_policy||"Your current timeslot will become available to others."}configSettingsChangedHandler(e){this.cancellationPolicy=e?.scheduler?.cancellation_policy||"Your current timeslot will become available to others."}connectedCallback(){s(`[nylas-cancel-booking-form] Component connected`)}async componentWillLoad(){s(`[nylas-cancel-booking-form] Component will load`)}async componentDidLoad(){s(`[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(){s(`[nylas-cancel-booking-form] Component disconnected`)}handleNylasFormInputChanged(e){this.triggerValidation.emit({});if(e.detail.name==="cancel-reason"){this.cancellationReason=e.detail.value;this.cancellationError=e.detail.error}}render(){return n(a,{key:"6f680273959b2726cc68cb465aeacce03447ba8e",part:"ncbf"},n("div",{key:"be243375f24e2029af0ad14c990a254c7f005631",class:"nylas-cancel-booking-form",part:"ncbf__card"},n("div",{key:"5bef53a115c1108a0ff15ed52b773e03456ed249",class:"nylas-cancel-booking-form__calendar-icon",part:"ncbf__icon"},n("calendar-cancel-icon",{key:"baa79cd9b1b8fea1019ccacdf0679b702d2f07a2"})),n("h3",{key:"260994a6886a04baccbba07198cb7b55843dcb94",class:"nylas-cancel-booking-form__title",part:"ncbf__title"},c.t("cancelBookingTitle")),n("div",{key:"5b551fb4c2f91a043b1a06b64dd635cfb2a6465e",class:"nylas-cancel-booking-form__description",part:"ncbf__description"},!this.configSettings?.scheduler?.cancellation_policy?`${c.t("cancelBookingMessage")}`:this.cancellationPolicy),n("form",{key:"535c7fbc0ccd04b614b0b52e39c183bcc0bd4501",onSubmit:this.handleSubmitCancelBooking},n("textarea-component",{key:"349fa734e6ca521418f315feca30de5c67c5b4ab",id:"cancel-reason",name:"cancel-reason",required:true,label:c.t("reasonForCancellation"),class:this.cancellationError?"error":"",part:"ncbf__reason-textarea",defaultValue:this.cancellationReason}),n("div",{key:"c260628841bb3872a9a1439499c42e494894af9e",class:"footer"},n("button-component",{key:"1de46efdfe24eaffae44d5a649f9b3ad6a11b3b6",variant:"destructive",class:"cancel",type:"submit",part:"ncbf__button-cta",disabled:this.isLoading},c.t("cancelBookingButton")),!!this.eventInfo&&n("button-component",{variant:"basic",class:"back",part:"ncbf__button-outline",onClick:this.handleGoBackClicked},c.t("goBackButton"))))))}static get watchers(){return{configSettings:["configSettingsChangedHandler"]}}};F([r({name:"nylas-cancel-booking-form",stateToProps:new Map([["scheduler.configSettings","configSettings"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.eventInfo","eventInfo"],["scheduler.isLoading","isLoading"],["scheduler.cancelBookingId","cancelBookingId"],["scheduler.rejectBookingId","rejectBookingId"]]),eventToProps:{cancelBookingFormSubmitted:async(e,t)=>{const{action:n,errorHandler:a}=e.detail;if(n==="cancel"){const n=await t.scheduler.cancelBooking(e.detail.bookingId,e.detail.reason);if(a&&(!n||"error"in n)){a(n)}}else if(n==="reject"){const n=await t.scheduler.updateBooking({bookingId:e.detail.bookingId,status:"cancelled",reason:e.detail.reason});if(a&&(!n||"error"in n)){a(n)}}},goBackButtonClicked:async(e,t)=>{s("nylas-cancel-booking-form","goBackButtonClicked",e.detail);t.scheduler.goBack()},cancelBookedEventError:async(e,t)=>{s("nylas-cancel-booking-form","cancelBookedEventError",e.detail)},cancelBookingFormError:async(e,t)=>{s("nylas-cancel-booking-form","cancelBookingFormError",e.detail)}},fireRegisterEvent:true}),H("design:type",Function),H("design:paramtypes",[]),H("design:returntype",void 0)],M.prototype,"render",null);M.style=$;const V=":host{display:block}.nylas-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);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%}button-component{width:100%}";const O=V;var P=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var q=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const Z=class{constructor(n){e(this,n);this.closeCancelEventCardClicked=t(this,"closeCancelEventCardClicked",7);this.cancelledEventCardError=t(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(){s(`[nylas-cancelled-event-card] Component connected`)}async componentWillLoad(){s(`[nylas-cancelled-event-card] Component will load`)}async componentDidLoad(){s(`[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(){s(`[nylas-cancelled-event-card] Component disconnected`)}render(){return n(a,{key:"e890d06179d7e35d38abe0f30934645d0dd0866f",part:"ncec"},n("div",{key:"c2e455774c4d962dbd178c967d6ffcf0dad495e8",class:"nylas-cancelled-event-card",part:"ncec__card"},n("div",{key:"dae3d09a326b89e8d5c5ac662b663a87332b483f",class:"nylas-cancelled-event-card__calendar-icon",part:"ncec__icon"},n("calendar-cancel-icon",{key:"908f8f9dce64ef8a02d12b8bea383a9e65662def"})),n("h3",{key:"61a2d624b51686a6a1d9e045a3efa99f204c9e21",class:"nylas-cancelled-event-card__title",part:"ncec__title"},c.t("bookingCancelledTitle"),"!"),n("div",{key:"0cbf5bce08b5b623729e0741108ecd1a169c0cdb",class:"nylas-cancelled-event-card__description",part:"ncec__description"},c.t("bookingCancelledMessage")," ",this.configSettings?.organizer?.name||"the participants","."),n("div",{key:"e43af5b395977d607b3c427bcb7d6062db8d6678",class:"nylas-cancelled-event-card__cta"},n("button-component",{key:"36bb4ba3bf9fa46a52f5fd7b452bf8e001341d00",variant:"basic",disabled:this.isClosing,part:"ncec__button-outline",onClick:this.handleCloseClicked},this.isClosing?`${c.t("closingButton")}...`:`${c.t("closeButton")}`))))}};P([r({name:"nylas-cancelled-event-card",stateToProps:new Map([["scheduler.configSettings","configSettings"]]),eventToProps:{closeCancelEventCardClicked:async(e,t)=>{const n=await t.scheduler.resetCancel();const{errorHandler:a}=e.detail;if(a&&(!n||"error"in n)){a(n)}},cancelledEventCardError:async(e,t)=>{s("nylas-cancelled-event-card","cancelledEventCardError",e.detail)}},fireRegisterEvent:true}),q("design:type",Function),q("design:paramtypes",[]),q("design:returntype",void 0)],Z.prototype,"render",null);Z.style=O;const N=':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-confirmed-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);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-confirmed-event-card{width:inherit}}.nylas-confirmed-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-confirmed-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-confirmed-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-confirmed-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%}button-component{width:100%}';const W=N;var A=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var X=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const Y=class{constructor(n){e(this,n);this.closeConfirmEventCardClicked=t(this,"closeConfirmEventCardClicked",7);this.confirmedEventCardError=t(this,"confirmedEventCardError",7);this.handleCloseClicked=()=>{this.isClosing=true;const e=e=>{this.confirmedEventCardError.emit(e);this.isClosing=false};this.closeConfirmEventCardClicked.emit({errorHandler:e})};this.confirmedEventInfo=undefined;this.isClosing=false;this.configSettings=undefined}connectedCallback(){s(`[nylas-confirmed-event-card] Component connected`)}async componentWillLoad(){s(`[nylas-confirmed-event-card] Component will load`)}async componentDidLoad(){s(`[nylas-confirmed-event-card] Component did load`);if(!this.confirmedEventInfo){console.warn(`[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.`)}}disconnectedCallback(){s(`[nylas-confirmed-event-card] Component disconnected`)}render(){return n(a,{key:"f78755849f1e51daa16349080efbd1154ee5421f",part:"ncec"},n("div",{key:"3bef7ce7a2365171566b29b096b1625d0724a322",class:"nylas-confirmed-event-card",part:"ncec__card"},n("div",{key:"1a246865b9400017d1945eb079691ac8f94baf1b",class:"nylas-confirmed-event-card__calendar-icon",part:"ncec__icon"},n("calendar-cancel-icon",{key:"6af3a586336dc9d89f9e20bd9fbb2d64641c883f"})),n("h3",{key:"ccb933bf503bd9f316c04647dd99652ac4422c78",class:"nylas-confirmed-event-card__title",part:"ncec__title"},c.t("confirmedEventCardTitle"),"!"),n("div",{key:"21d9fa9069fc947e05b1bfe5f9c5e9a6aa4bb091",class:"nylas-confirmed-event-card__description",part:"ncec__description"},c.t("confirmedEventCardDescription")," ",this.configSettings?.organizer?.name||"the participants","."),n("div",{key:"93ee8ddcb48b9ec5f30df4cce75ca1a13a38bfff",class:"nylas-confirmed-event-card__cta"},n("button-component",{key:"ca0960f860c3701821b492e318a47a7cf58d6c40",variant:"basic",disabled:this.isClosing,part:"ncec__button-outline",onClick:this.handleCloseClicked},this.isClosing?`${c.t("closingButton")}...`:`${c.t("closeButton")}`))))}};A([r({name:"nylas-confirmed-event-card",stateToProps:new Map([["scheduler.configSettings","configSettings"]]),eventToProps:{closeConfirmEventCardClicked:async(e,t)=>{const n=await t.scheduler.resetConfirm();const{errorHandler:a}=e.detail;if(a&&(!n||"error"in n)){a(n)}}},fireRegisterEvent:true}),X("design:type",Function),X("design:paramtypes",[]),X("design:returntype",void 0)],Y.prototype,"render",null);Y.style=W;const G=new Date,U=new Date;function J(e,t,n,a){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}i.floor=t=>(e(t=new Date(+t)),t);i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n);i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n};i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e);i.range=(n,a,o)=>{const r=[];n=i.ceil(n);o=o==null?1:Math.floor(o);if(!(n<a)||!(o>0))return r;let s;do{r.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<a);return r};i.filter=n=>J((t=>{if(t>=t)while(e(t),!n(t))t.setTime(t-1)}),((e,a)=>{if(e>=e){if(a<0)while(++a<=0){while(t(e,-1),!n(e)){}}else while(--a>=0){while(t(e,+1),!n(e)){}}}}));if(n){i.count=(t,a)=>{G.setTime(+t),U.setTime(+a);e(G),e(U);return Math.floor(n(G,U))};i.every=e=>{e=Math.floor(e);return!isFinite(e)||!(e>0)?null:!(e>1)?i:i.filter(a?t=>a(t)%e===0:t=>i.count(0,t)%e===0)}}return i}const K=1e3;const Q=K*60;const ee=Q*60;const te=ee*24;const ne=J((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Q)/te),(e=>e.getDate()-1));J((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/te),(e=>e.getUTCDate()-1));J((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/te),(e=>Math.floor(e/te)));const ae=':host{display:block;min-height:444px}@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 ie=ae;var oe=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var re=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const se=class{constructor(n){e(this,n);this.dateSelected=t(this,"dateSelected",7);this.monthChanged=t(this,"monthChanged",7);this.selectableDates=undefined;this.selectedDate=undefined;this.configSettings=undefined;this.selectedLanguage=undefined;this.isLoading=undefined;this.eventDuration=undefined;this.month=this.selectedDate||new Date;this.dates=this.getDates();this.disableNextMonthButton=false}configSettingsChanged(e){const t=new Date(this.month.getFullYear(),this.month.getMonth()+1,1);const n=e?.scheduler?.available_days_in_future;if(n===undefined){return}const a=b(new Date,n);if(a.getTime()<t.getTime()){this.disableNextMonthButton=true}else{this.disableNextMonthButton=false}}selectedLanguageChanged(e){c.changeLanguage(e)}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}getDates(){const e=p(this.month);const t=h(this.month);return ne.range(ne.offset(t,-t.getDay()),ne.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 t=new Date(this.month.getFullYear(),this.month.getMonth()+1,1);const n=this.configSettings?.scheduler?.available_days_in_future;const a=b(new Date,n);if(a.getTime()<t.getTime()){this.disableNextMonthButton=true}else{this.disableNextMonthButton=false}this.dates=this.getDates();this.monthChanged.emit(this.month)}isSelected(e,t,n){return e&&t&&u(e,t)&&n&&n?.length>0}isDisabled(e,t){return e&&t?.find((t=>u(t,e)))===undefined}render(){return n(a,{key:"3e6dd28572687991de4841d639c5bdbd5d2d6e0b",part:"ndp"},n("div",{key:"b8a31231d9e04035c468f9c025bbd3adb4f0dbb2",class:"nylas-date-picker"},n("div",{key:"c25024241ce71fb94bcc485cc32614c820a69fee",class:"title",part:"ndp__title"},this.configSettings?.name?n("h1",null,this.configSettings?.name):this.configSettings?.organizer?.name&&n("h1",null,n("person-icon",null),this.configSettings?.organizer?.name||"Organizer"),n("p",{key:"f51da2bb7f8b5d6b84ea5a9ea66aef03b9e10e12"},n("clock-icon",{key:"42a947b00a14afe7c57c716e37ef4d418e55e337"}),this.eventDuration?m(this.eventDuration):`- ${c.t("time.minutes")}`)),n("div",{key:"bb264f745cbe51ece10238e3a2f3fae55d2f1bdb",class:"header flex-row"},n("h2",{key:"16ecbac96e4ede32b8b524a645f96e30d16e2814",part:"ndp__month-header"},n("strong",{key:"aaf8064ac4ebd41680fb4c147b5a23fc7e5554f2"},y(this.month.toLocaleDateString(undefined,{month:"long"}).toLocaleLowerCase()))," ",this.month.toLocaleDateString(undefined,{year:"numeric"})),n("div",{key:"8d5fdca1f4de5d8b75c89ebf6bc6d964b39b8351",class:"pagination"},n("button",{key:"9a993814c06483337caea097727932aa75e53243",onClick:()=>this.changeMonth(-1),class:{"chevron-left":true,button:true},disabled:!this.selectableDates?.length||this.month<=new Date,part:"ndp__month-button"},n("chevron-icon",{key:"edd3668dee154cb573cf3ed25e72beb2938cb9d2"})),n("button",{key:"9452edc29c45e8ff24f76521b94762f128201ba0",onClick:()=>this.changeMonth(1),class:{"chevron-right":true,button:true},disabled:this.disableNextMonthButton,part:"ndp__month-button"},n("chevron-icon",{key:"1f27334ee808470e844f8f08c4fd4dfc39376b2d"})))),n("div",{key:"4173feb8a2661c49d0c898864886db0f90f6a181",class:"dates"},[c.t("days.sunday"),c.t("days.monday"),c.t("days.tuesday"),c.t("days.wednesday"),c.t("days.thursday"),c.t("days.friday"),c.t("days.saturday")].map((e=>n("div",{class:"day",part:"ndp__day"},e))),this.dates.map(((e,t)=>{const a=this.isDisabled(e,this.selectableDates);if(this.isLoading){return n("button",{disabled:true,class:{"date day-skeleton":true,"current-month":g(e,this.month)},style:{animationDelay:`${t*20}ms`},part:`ndp__date ndp__date--disabled`},e.getDate())}return n("button",{class:{date:true,selected:!!(this.selectedDate&&u(e,this.selectedDate)&&this.selectableDates&&this.selectableDates?.length>0),"current-day":u(e,new Date),"current-month":g(e,this.month)},"aria-lang":e.toLocaleDateString(undefined,{dateStyle:"full"}),disabled:a,onClick:()=>this.selectDate(e),part:`ndp__date ${this.isSelected(e,this.selectedDate,this.selectableDates)?"ndp__date--selected":""} ${u(e,new Date)?"ndp__date--current-day":""} ${g(e,this.month)?"ndp__date--current-month":""}`},e.getDate())})))))}static get watchers(){return{configSettings:["configSettingsChanged"],selectedLanguage:["selectedLanguageChanged"]}}};oe([r({name:"nylas-date-picker",stateToProps:new Map([["scheduler.selectableDates","selectableDates"],["scheduler.selectedDate","selectedDate"],["scheduler.isLoading","isLoading"],["scheduler.configSettings","configSettings"],["scheduler.eventDuration","eventDuration"],["scheduler.selectedLanguage","selectedLanguage"]]),eventToProps:{dateSelected:async(e,t)=>{s("nylas-date-picker","dateSelected",e.detail);t.scheduler.selectDate(e.detail)},monthChanged:async(e,t)=>{s("nylas-date-picker","monthChanged",e.detail)}},fireRegisterEvent:true}),re("design:type",Function),re("design:paramtypes",[]),re("design:returntype",void 0)],se.prototype,"render",null);se.style=ie;const ce=":host{display:block}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;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{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}";const le=ce;var de=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var fe=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const be=class{constructor(n){e(this,n);this.timezoneChanged=t(this,"timezoneChanged",7);this.languageChanged=t(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)}nylasFormDropdownChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="timezone"){this.changeTimezone(n)}else if(t==="language"){this.changeLanguage(n)}}getTimezoneLabelHTML(e){const t=x(e);return n("span",{class:"timezone-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"-webkit-fill-available"}},v[e]," ",n("span",{class:"timezone-offset",style:{fontSize:"14px",fontWeight:"400",color:"var(--nylas-base-500)"}},t))}render(){const e=Object.keys(v).map((e=>({labelHTML:this.getTimezoneLabelHTML(e),label:v[e],value:e})));const t=Object.keys(w).map((e=>({label:w[e],value:e})));return n(a,{key:"8e8ec3819083fb25cb8620f14aa1f140a995ec89"},n("div",{key:"45aaebcd9f80d54dc01b5d611094fa05225c8331",class:"nylas-locale-switch",part:"nls"},n("div",{key:"47d8166b91a3ef742b14e5783338c3701be85eb7",class:{"select-wrapper":true,timezone:true},part:"nls__timezone"},n("select-dropdown",{key:"71edd2352b6067a18b9ba676495e59c954e6c07d",name:"timezone",options:e,defaultSelectedOption:e.find((e=>e.value==this.selectedTimezone)),exportparts:"sd_dropdown: nls__timezone-dropdown, sd_dropdown-button: nls__timezone-drop-button, sd_dropdown-button-selected-label: nls__timezone-drop-button-selected-label, sd_dropdown-content: nls__timezone-drop-content, sd_dropdown_label: nls__timezone-drop-label"},n("span",{key:"f48e3c11a1981e32b75f5425570db0b584db7f51",slot:"select-icon"},n("globe-icon",{key:"6b6721c8d88d715dbcb52d2e2750c22015ac252c",width:"20",height:"20"})))),n("div",{key:"fe652536d637774336cad11a65bba7bfd8636972",class:{"select-wrapper":true,language:true},part:"nls__language"},n("select-dropdown",{key:"f83f8dbf84878fb1670d4a6f59b045c111420ce1",name:"language",options:t,defaultSelectedOption:t.find((e=>e.value==this.selectedLanguage)),exportparts:"sd_dropdown: nls__language-dropdown, sd_dropdown-button: nls__language-drop-button, sd_dropdown-content: nls__language-drop-content, sd_dropdown_label: nls__language-drop-label"},n("span",{key:"3d66833265053e81c9333b5d36ae822ed3a17878",slot:"select-icon"},n("translate-icon",{key:"30121c5733873930e7e1e3bdaedf11bd2f258139",width:"20",height:"20"}))))))}};de([r({name:"nylas-locale-switch",stateToProps:new Map([["scheduler.selectedLanguage","selectedLanguage"],["scheduler.selectedTimezone","selectedTimezone"]]),eventToProps:{timezoneChanged:async(e,t)=>{s("nylas-locale-switch","timezoneChanged",e.detail);t.scheduler.selectTimezone(e.detail)},languageChanged:async(e,t)=>{s("nylas-locale-switch","languageChanged",e.detail);t.scheduler.selectLanguage(e.detail)}},fireRegisterEvent:true}),fe("design:type",Function),fe("design:paramtypes",[]),fe("design:returntype",void 0)],be.prototype,"render",null);be.style=le;const pe=".sc-nylas-logo-h{display:flex}";const he=pe;const ue=class{constructor(t){e(this,t);this.width="69";this.height="24"}render(){return n("svg",{key:"62222dd3800378729b2adde6c2983fe6cee23caa",width:this.width,height:this.height,viewBox:"0 0 69 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("g",{key:"97910c954c2b27d45639c4efee40a9b692928d5c","clip-path":"url(#clip0_455_3543)"},n("path",{key:"e0334bf2d85c5bb3d69f9ef9fd16dfcc213fe853",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"}),n("path",{key:"0e4dcb860598c50b18aa23b870f995c387df5db1",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"}),n("path",{key:"0932b6eef652d9a91bd578c888bdaf3bd14aba4a",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"}),n("path",{key:"19c41ab0458b7c96debb14698f9b7c12fb8155d7",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"}),n("path",{key:"3f67d09eef5ed6fd2189d8f346cdc87a1fb2d9eb",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"}),n("path",{key:"12c89a71827969f361db08eaa92989e77273197c",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"}),n("path",{key:"e129a0531742754423169ea6d4f88a8b9a7a3448",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"}),n("path",{key:"f1e19b3ef09568e57cac44d71d21a8db19ee1184",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"})),n("defs",{key:"c97ba75e4811081b3bd50460af81e60666c44d38"},n("clipPath",{key:"e585d77949e6cf411e08275bd51b239a8a6b4af8",id:"clip0_455_3543"},n("rect",{key:"586c6b1e9c085419045cf92a2fd21301ead072ea",width:"68.7123",height:"19.2877",fill:"white",transform:"translate(0.144043 0.356201)"}))))}};ue.style=he;const me=':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 ye=me;const ge=class{constructor(t){e(this,t);this.ttl=5e3;this.allowedCategories=["component","api","validation","invalid_session"];this.notifications=[]}onError(e){s(`[nylas-notification] Error: ${e.detail.notification.title}`);this.handleNotification(e)}onWarning(e){s(`[nylas-notification] Warning: ${e.detail.notification.title}`);this.handleNotification(e)}onInfo(e){s(`[nylas-notification] Info: ${e.detail.notification.title}`);this.handleNotification(e)}onSuccess(e){s(`[nylas-notification] Success: ${e.detail.notification.title}`);this.handleNotification(e)}isChildOf(e){let t=this.host.parentNode;while(t){if(t===e){return true}if(t instanceof ShadowRoot){t=t.host}else{t=t.parentNode}}return false}handleNotification(e){const t=e.detail.host;if(e.defaultPrevented){s(`[nylas-notification] Event default prevented`);return}if(t&&!this.isChildOf(t)){s(`[nylas-notification] Host not a parent`);return}if(this.ttl===0){s(`[nylas-notification] TTL is 0`);return}if(this.allowedCategories.length>0&&!this.allowedCategories.includes(e.detail.notification.category)){s(`[nylas-notification] Category not allowed`);return}this.notifications=[...this.notifications,{...e.detail.notification}];if(e.detail.notification.ttl!=="none"){const t=e.detail.notification.ttl?e.detail.notification.ttl:this.ttl;window.setTimeout((()=>{this.notifications=this.notifications.filter((t=>t.id!==e.detail.notification.id))}),t)}}dismissNotification(e){this.notifications=this.notifications.filter((t=>t.id!==e))}render(){return n(a,{key:"9a2b2d32b746b25c06f61494c2cae183712f61e0"},n(o,{key:"561d628e0954735a0a0643b076101f4a0e4cfe0a"},this.notifications.map((e=>n("div",{class:`notif ${e.type}`,key:e.id},n("div",{class:"content"},n("span",{class:`icon ${e.type}`},(e.type==="error"||e.type==="warning")&&n("warning-icon",null)),n("span",{class:"message"},n("span",{class:"title"},e.title),e.description&&n("span",{class:"description"},e.description))),n("button",{class:"dismiss-btn",onClick:()=>this.dismissNotification(e.id)},n("close-icon",null))))),n("slot",{key:"2f2d91b57282c87026f507f065b0e98615658ff2"})))}get host(){return i(this)}};ge.style=ye;const ve=':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}.event-card-wrapper{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;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}.manage-booking-description{border-top:1px solid var(--nylas-base-200)}.manage-booking-description p{font-size:16px;margin:1rem;padding:0.5rem 1rem;font-weight:400;color:var(--nylas-base-800)}.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)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{--dot-color:var(--nylas-base-700)}';const ke=ve;var xe=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var we=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const _e=class{constructor(n){e(this,n);this.rejectBookingButtonClicked=t(this,"rejectBookingButtonClicked",7);this.confirmBookingButtonClicked=t(this,"confirmBookingButtonClicked",7);this.confirmBookingError=t(this,"confirmBookingError",7);this.handleConfirmBookingButtonClicked=()=>{this.action="confirm";const e=e=>{this.confirmBookingError.emit(e)};if(this.organizerConfirmationBookingId&&!this.isLoading){this.confirmBookingButtonClicked.emit({bookingId:this.organizerConfirmationBookingId,host:this.host,errorHandler:e})}};this.handleRejectBookingButtonClicked=()=>{this.action="reject";if(this.organizerConfirmationBookingId&&!this.isLoading){this.rejectBookingButtonClicked.emit({bookingId:this.organizerConfirmationBookingId,host:this.host})}};this.organizerConfirmationBookingId=undefined;this.configSettings=undefined;this.isLoading=undefined;this.selectedLanguage=navigator.language;this.action=null}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){s(`[nylas-organizer-confirmation-card] Component will load`)}async componentDidLoad(){s(`[nylas-organizer-confirmation-card] Component did load`)}async resetAction(){this.action=null}render(){return n(a,{key:"6d80da6d7d359bad3d317d04db827e51d02f36c9",part:"nmcc"},n("div",{key:"eeca3a1fe7937e7be2a15ab418e0c46bee8b207f",class:"event-card-wrapper",part:"nmccc__card"},n("div",{key:"7b5fad347fbe69a1b62945cd4945854e086e4bd2",class:"calendar-icon"},n("calendar-check-icon",{key:"427696f8e3de3f7d1f8d131626897460beb616f9"})),n("div",{key:"fdb11fa1b76f83cd64e8ed44e637aff89b33e93e",class:"booked-event-header"},n("h2",{key:"2c18ab70ed2f00251552c972a040721c64979276",slot:"card-title",part:"nmcc__title"},!!this.organizerConfirmationBookingId&&`${c.t("bookingPendingTitle")}!`)),n("div",{key:"70cbb157ae6436799d24092f6bd0ce82df8c4c5d",class:"manage-booking-description"},n("p",{key:"afaeb94cf6ff0d75fa17c8a24298078b95d5d8f8"},c.t("bookingPendingnDescription"))),n("div",{key:"fb6b22ad30e9af98b50cd4a35ad545ba8b5a100b",class:{footer:true,"no-footer":this.configSettings?.scheduler?.hide_cancellation_options&&this.configSettings?.scheduler?.hide_rescheduling_options,"no-template-cols":this.configSettings?.scheduler?.hide_cancellation_options||this.configSettings?.scheduler?.hide_rescheduling_options}},!this.configSettings?.scheduler?.hide_cancellation_options&&n("button-component",{variant:"destructive",onClick:this.handleRejectBookingButtonClicked,isLoading:this.isLoading&&this.action==="reject",part:"nmcc__button-outline nmcc__cancel-cta"},`${c.t("rejectBookingButton")}`),!this.configSettings?.scheduler?.hide_rescheduling_options&&n("button-component",{variant:"basic",onClick:this.handleConfirmBookingButtonClicked,isLoading:this.isLoading&&this.action==="confirm",part:"nmcc__button-outline nmcc__reschedule-cta"},`${c.t("confirmBookingButton")}`))))}get host(){return i(this)}};xe([r({name:"nylas-organizer-confirmation-card",stateToProps:new Map([["scheduler.organizerConfirmationBookingId","organizerConfirmationBookingId"],["scheduler.configSettings","configSettings"],["scheduler.isLoading","isLoading"],["scheduler.selectedLanguage","selectedLanguage"]]),eventToProps:{rejectBookingButtonClicked:async(e,t)=>{t.scheduler.setReject(e.detail.bookingId)},confirmBookingButtonClicked:async(e,t)=>{const{host:n}=e.detail;const a=await t.scheduler.updateBooking({bookingId:e.detail.bookingId,status:"confirmed"});const{errorHandler:i}=e.detail;if(i&&(!a||"error"in a)){i(a)}await n.resetAction()}},fireRegisterEvent:true}),we("design:type",Function),we("design:paramtypes",[]),we("design:returntype",void 0)],_e.prototype,"render",null);_e.style=ke;const Ce=":host{display:block;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 je=Ce;var ze=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var Le=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const Re=class{constructor(t){e(this,t);this.selectedDate=undefined;this.selectedTimeslot=undefined;this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone;this.selectedLanguage=undefined;this.startTime="";this.endTime=""}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){s(`[nylas-selected-event-card] Component will load`)}async componentDidLoad(){s(`[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.')}const e=new Intl.DateTimeFormat("en-US",{hour:"2-digit",minute:"2-digit",timeZone:this.selectedTimezone});this.startTime=e.format(new Date(this.selectedTimeslot?.start_time));this.endTime=e.format(new Date(this.selectedTimeslot?.end_time))}render(){return n(a,{key:"2b4257d6793fd263e7978504b88e270d77e2e78f",part:"nsec"},n("div",{key:"8eb84c0c375afd9824d88337003d09b7fe3db171",class:"event-card",part:"nsec__card"},n("div",{key:"bc7d364f1ec772f06f5eab4549b0433cb947f68d",class:"calendar-icon",part:"nsec__icon"},n("calendar-icon",{key:"a3f38777fea8b17714ad0dc34cd236a93e4360fd"})),n("div",{key:"1d23698c5a8d627bc10c7969e269a381584b6477",class:"nylas-selected-event-card__date",part:"nsec__date"},this.selectedDate?l(this.selectedDate?.toLocaleDateString(k[this.selectedLanguage||navigator.language],{dateStyle:"full",timeZone:this.selectedTimezone})):"-"),n("div",{key:"4e02d04cc6918076935614be321619a9df16430d",class:"nylas-selected-event-card__time",part:"nsec__time"},this.startTime," - ",this.endTime)),n("div",{key:"ad39ae7e3df5e6652b0dad88b98695cfee00e3db",class:"event-timezone",part:"nsec__timezone"},n("globe-icon",{key:"23b1e1fd15842a65278a969e1ce3aea0313ea46e"}),v[this.selectedTimezone]))}};ze([r({name:"nylas-selected-event-card",stateToProps:new Map([["scheduler.selectedDate","selectedDate"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.selectedTimezone","selectedTimezone"],["scheduler.selectedLanguage","selectedLanguage"]]),eventToProps:{},fireRegisterEvent:true}),Le("design:type",Function),Le("design:paramtypes",[]),Le("design:returntype",void 0)],Re.prototype,"render",null);Re.style=je;const Be=":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{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 .timeslot-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:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}";const Ee=Be;var De=undefined&&undefined.__decorate||function(e,t,n,a){var i=arguments.length,o=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)if(r=e[s])o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o;return i>3&&o&&Object.defineProperty(t,n,o),o};var Ie=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const Se=class{constructor(n){e(this,n);this.timeslotSelected=t(this,"timeslotSelected",7);this.timeslotConfirmed=t(this,"timeslotConfirmed",7);this.handleConfirmedTimeslot=async(e,t)=>{e.preventDefault();s(`[nylas-timeslot-picker] Confirm timeslot`,t);this.timeslotConfirmed.emit(t)};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.selectedLanguage=undefined;this.times=[];this.hoveredTimeslotIndex=undefined;this.selectedTimeslotIndex=undefined}selectedLanguageChanged(e){c.changeLanguage(e)}selectedDateChanged(e){s(`[nylas-timeslot-picker] Selected date changed`,{newVal:e});if(e){this.selectedTimeslotIndex="";if(typeof e!=="undefined"){const t=this.availability?.filter((t=>u(t.start_time,e))).map((e=>e));this.times=t||[]}}}availabilityChanged(e){s(`[nylas-timeslot-picker] Available times changed`,{newVal:e,selectedDate:this.selectedDate});if(typeof e!=="undefined"){const t=e?.filter((e=>this.selectedDate&&u(e.start_time,this.selectedDate))).map((e=>e));this.times=t||[]}}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){const e=this.availability?.filter((e=>this.selectedDate&&u(e.start_time,this.selectedDate))).map((e=>e));this.times=e||[];s(`[nylas-timeslot-picker] Component will load`,{selectedDate:this.selectedDate,availability:this.availability,times:this.times})}async componentDidLoad(){s(`[nylas-timeslot-picker] Component did load`)}getTimeslotId(e,t){return`${e.toLocaleDateString()}-${t}`}onClickSelectTime(e,t){s(`[nylas-timeslot-picker] Time selected`,e,t);this.selectedTimeslotIndex=this.getTimeslotId(e.start_time,t);this.timeslotSelected.emit({start_time:e.start_time,end_time:e.end_time,emails:e.emails})}getTimeSlotLabel(e){const t=new Intl.DateTimeFormat("en-US",{hour:"2-digit",minute:"2-digit",timeZone:this.selectedTimezone});return`${t.format(e.start_time)} - ${t.format(e.end_time)}`}render(){if(this.isLoading){return n(a,null,n("div",{class:"loading"},new Array(6).fill(0).map(((e,t)=>n("div",{class:"timeslot-skeleton",style:{animationDelay:`${t*20}ms`}})))))}if(this.availability&&this.availability.length===0){return n(a,null,n("div",{class:"empty"},n("span",null,"No dates available")))}if((!this.times||this.times.length===0)&&!!this.selectedDate){return n(a,null,n("div",{class:"empty"},n("span",null,"No time slots available for selected date")))}if(!this.selectedDate)return n(a,null);return n(a,{part:"ntp"},n("div",{class:"time-picker-wrapper"},n("div",{class:"timeslots"},this.times.map(((e,t)=>n("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,t),onMouseEnter:()=>this.handleMouseEnter(t),onMouseLeave:()=>this.handleMouseLeave()},this.hoveredTimeslotIndex==t||this.selectedTimeslotIndex==this.getTimeslotId(e.start_time,t)?this.getTimeSlotLabel(e):e.start_time.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",timeZone:this.selectedTimezone}))))),this.selectedTimeslot&&n("div",{class:"footer"},n("button-component",{variant:"primary",onClick:e=>this.handleConfirmedTimeslot(e,this.selectedTimeslot),part:"ntp__button-primary"},n("slot",{name:"timeslot-picker-cta-label"},c.t("nextButton"))))))}static get watchers(){return{selectedLanguage:["selectedLanguageChanged"],selectedDate:["selectedDateChanged"],availability:["availabilityChanged"]}}};De([r({name:"nylas-timeslot-picker",stateToProps:new Map([["scheduler.selectedDate","selectedDate"],["scheduler.availability","availability"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.selectedTimezone","selectedTimezone"],["scheduler.selectedLanguage","selectedLanguage"],["scheduler.isLoading","isLoading"]]),eventToProps:{timeslotSelected:async(e,t)=>{s("nylas-timeslot-picker","timeslotSelected",e.detail);t.scheduler.selectTime(e.detail)},timeslotConfirmed:async(e,t)=>{s("nylas-timeslot-picker","timeslotConfirmed",e.detail);if(e.detail){t.scheduler.toggleAdditionalData(true)}}},fireRegisterEvent:true}),Ie("design:type",Function),Ie("design:paramtypes",[]),Ie("design:returntype",void 0)],Se.prototype,"render",null);Se.style=Ee;export{L as nylas_booked_event_card,S as nylas_booking_form,M as nylas_cancel_booking_form,Z as nylas_cancelled_event_card,Y as nylas_confirmed_event_card,se as nylas_date_picker,be as nylas_locale_switch,ue as nylas_logo,ge as nylas_notification,_e as nylas_organizer_confirmation_card,Re as nylas_selected_event_card,Se as nylas_timeslot_picker};
2
+ //# sourceMappingURL=p-efa03f8c.entry.js.map